mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
1 line
5.0 MiB
1 line
5.0 MiB
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/Player.ts","webpack:///./src/Netscript/NetscriptHelpers.ts","webpack:///./src/Faction/data/FactionNames.ts","webpack:///./src/Settings/Settings.ts","webpack:///./src/ui/numeralFormat.ts","webpack:///./src/Terminal.ts","webpack:///./src/Locations/data/LocationNames.ts","webpack:///./src/Augmentation/data/AugmentationNames.ts","webpack:///./src/Constants.ts","webpack:///./src/utils/JSONReviver.ts","webpack:///./src/Locations/data/CityNames.ts","webpack:///./src/ui/React/DialogBox.tsx","webpack:///./src/ui/GameRoot.tsx","webpack:///./src/ui/React/Money.tsx","webpack:///./src/BitNode/BitNodeMultipliers.ts","webpack:///./src/Server/AllServers.ts","webpack:///./src/ui/Router.ts","webpack:///./src/utils/StringHelperFunctions.ts","webpack:///./src/Faction/Factions.ts","webpack:///./src/utils/helpers/keyCodes.ts","webpack:///./src/Company/data/companypositionnames.ts","webpack:///./src/utils/helpers/getRandomInt.ts","webpack:///./src/Corporation/data/Constants.ts","webpack:///./src/Augmentation/Augmentation.tsx","webpack:///./src/ui/React/Modal.tsx","webpack:///./src/Hacknet/data/Constants.ts","webpack:///./src/Corporation/EmployeePositions.ts","webpack:///./src/Bladeburner/data/ActionTypes.ts","webpack:///./src/InteractiveTutorial.ts","webpack:///./src/Server/Server.ts","webpack:///./src/Corporation/ui/Context.ts","webpack:///./src/Corporation/IndustryData.tsx","webpack:///./src/Locations/LocationTypeEnum.ts","webpack:///./src/Programs/Programs.ts","webpack:///./src/Work/ClassWork.tsx","webpack:///./src/Hacknet/HacknetHelpers.tsx","webpack:///./src/Corporation/Actions.ts","webpack:///./src/Bladeburner/data/BlackOperationNames.ts","webpack:///./src/Bladeburner/data/Constants.ts","webpack:///./src/CotMG/FragmentType.ts","webpack:///./src/Literature/data/LiteratureNames.ts","webpack:///./src/Augmentation/StaticAugmentations.ts","webpack:///./src/ui/React/StatsRow.tsx","webpack:///./src/StockMarket/data/PositionTypes.ts","webpack:///./src/ui/React/Table.tsx","webpack:///./src/Terminal/DirectoryHelpers.ts","webpack:///./src/Company/Companies.ts","webpack:///./src/Gang/AllGangs.ts","webpack:///./src/ui/React/Snackbar.tsx","webpack:///./src/Crime/Crimes.ts","webpack:///./src/Work/WorkStats.ts","webpack:///./src/Casino/utils.ts","webpack:///./src/Server/data/SpecialServers.ts","webpack:///./src/PersonObjects/Player/PlayerObjectGeneralMethods.ts","webpack:///./src/Hacknet/HacknetServer.ts","webpack:///./src/Script/isScriptFilename.ts","webpack:///./src/StockMarket/StockMarket.tsx","webpack:///./src/PersonObjects/Sleeve/Work/Work.ts","webpack:///./src/Hacking.ts","webpack:///./src/Faction/FactionHelpers.tsx","webpack:///./src/SaveObject.tsx","webpack:///./src/Themes/Themes.ts","webpack:///./src/CotMG/Helper.tsx","webpack:///./src/StockMarket/data/StockSymbols.ts","webpack:///./src/Company/CompanyPositions.ts","webpack:///./src/Work/data/FactionWorkType.ts","webpack:///./src/Exploits/Exploit.ts","webpack:///./src/Augmentation/AugmentationHelpers.tsx","webpack:///./src/ui/React/MoneyRate.tsx","webpack:///./src/CodingContracts.ts","webpack:///./src/StockMarket/data/OrderTypes.ts","webpack:///./src/CotMG/Fragment.ts","webpack:///./src/utils/EventEmitter.ts","webpack:///./src/ScriptEditor/ui/themes.ts","webpack:///./src/DevMenu/ui/Adjuster.tsx","webpack:///./src/ui/React/OptionSwitch.tsx","webpack:///./src/Infiltration/utils.ts","webpack:///./src/Bladeburner/BlackOperation.ts","webpack:///./src/utils/WorkType.ts","webpack:///./src/Corporation/data/BaseResearchTree.ts","webpack:///./src/Server/ServerHelpers.ts","webpack:///./src/Corporation/ui/MoneyCost.tsx","webpack:///./src/Bladeburner/data/SkillNames.ts","webpack:///./src/ui/React/Reputation.tsx","webpack:///./src/Gang/ui/Context.ts","webpack:///./src/BitNode/BitNode.tsx","webpack:///./src/Work/Work.ts","webpack:///./src/StockMarket/Stock.ts","webpack:///./src/Locations/Cities.ts","webpack:///./src/Hacknet/formulas/HacknetServers.ts","webpack:///./src/Netscript/killWorkerScript.ts","webpack:///./src/Alias.ts","webpack:///./src/Locations/Locations.ts","webpack:///./src/ui/React/LogBoxManager.tsx","webpack:///./src/Literature/Literature.ts","webpack:///./src/ui/React/CopyableText.tsx","webpack:///./src/Themes/ui/Theme.tsx","webpack:///./src/Settings/SettingEnums.ts","webpack:///./src/Netscript/WorkerScripts.ts","webpack:///./src/Corporation/MaterialSizes.ts","webpack:///./src/PersonObjects/formulas/skill.ts","webpack:///./src/Gang/data/upgrades.ts","webpack:///./src/utils/helpers/isString.ts","webpack:///./src/Gang/data/Constants.ts","webpack:///./src/NetscriptWorker.ts","webpack:///./src/PersonObjects/Multipliers.ts","webpack:///./src/Server/ServerPurchases.ts","webpack:///./src/StockMarket/BuyingAndSelling.tsx","webpack:///./src/Casino/Game.ts","webpack:///./src/Gang/formulas/formulas.ts","webpack:///./src/RemoteFileAPI/MessageDefinitions.ts","webpack:///./src/Infiltration/ui/GameTimer.tsx","webpack:///./src/DarkWeb/DarkWebItems.ts","webpack:///./src/Hacknet/formulas/HacknetNodes.ts","webpack:///./src/CotMG/data/Shapes.ts","webpack:///./src/Infiltration/ui/Difficulty.ts","webpack:///./src/Infiltration/ui/KeyHandler.tsx","webpack:///./src/Work/FactionWork.tsx","webpack:///./src/ui/React/Hashes.tsx","webpack:///./src/Hacknet/HacknetNode.ts","webpack:///./src/PersonObjects/formulas/reputation.ts","webpack:///./src/TextFile.ts","webpack:///./src/Bladeburner/Skills.ts","webpack:///./src/Gang/GangMemberUpgrades.ts","webpack:///./src/Netscript/RamCostGenerator.ts","webpack:///./src/StockMarket/StockMarketHelpers.ts","webpack:///./src/StockMarket/StockMarketCosts.ts","webpack:///./src/ui/React/NumberInput.tsx","webpack:///./src/Gang/GangMemberTasks.ts","webpack:///./src/Hacknet/HashUpgrades.ts","webpack:///./src/Terminal/OutputTypes.tsx","webpack:///./src/utils/helpers/createProgressBarText.ts","webpack:///./src/ui/React/ConfirmationModal.tsx","webpack:///./src/utils/helpers/checkEnum.ts","webpack:///./src/hash/hash.ts","webpack:///./src/Work/formulas/Class.ts","webpack:///./src/Script/Script.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveBladeburnerWork.ts","webpack:///./src/ui/React/StatsTable.tsx","webpack:///./src/Bladeburner/GeneralActions.tsx","webpack:///./src/Corporation/Material.ts","webpack:///./src/Casino/CardDeck/Card.ts","webpack:///./src/SourceFile/SourceFile.ts","webpack:///./src/Script/ScriptHelpers.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveCompanyWork.ts","webpack:///./src/Achievements/Achievements.ts","webpack:///./src/MathJaxWrapper.tsx","webpack:///./src/utils/helpers/exceptionAlert.ts","webpack:///./src/Corporation/data/CorporationUnlockUpgrades.ts","webpack:///./src/PersonObjects/Grafting/GraftingHelpers.ts","webpack:///./src/Bladeburner/ActionIdentifier.ts","webpack:///./src/Bladeburner/BlackOperations.tsx","webpack:///./src/CotMG/ActiveFragment.ts","webpack:///./src/GameOptions/GameOptionsTab.ts","webpack:///./src/Bladeburner/Skill.ts","webpack:///./src/Crime/Crime.ts","webpack:///./src/PersonObjects/PersonMethods.ts","webpack:///./src/ui/React/AlertManager.tsx","webpack:///./src/utils/helpers/arrayToString.ts","webpack:///./src/ExportBonus.tsx","webpack:///./src/ui/React/HashRate.tsx","webpack:///./src/Message/Message.ts","webpack:///./src/Locations/ui/ApplyToJobButton.tsx","webpack:///./src/Work/CreateProgramWork.ts","webpack:///./src/Netscript/WorkerScriptStartStopEventEmitter.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveFactionWork.ts","webpack:///./src/Corporation/ResearchMap.ts","webpack:///./src/SourceFile/SourceFiles.tsx","webpack:///./src/Electron.tsx","webpack:///./src/ui/React/CharacterOverview.tsx","webpack:///./src/PersonObjects/formulas/intelligence.ts","webpack:///./src/Netscript/ScriptDeath.ts","webpack:///./src/CodingContractGenerator.ts","webpack:///./src/utils/helpers/addOffset.ts","webpack:///./src/DarkWeb/DarkWebItem.ts","webpack:///./src/Augmentation/PlayerOwnedAugmentation.ts","webpack:///./src/Casino/RNG.ts","webpack:///./src/Work/CompanyWork.tsx","webpack:///./src/GameOptions/ui/GameOptionsPage.tsx","webpack:///./src/ui/React/Favor.tsx","webpack:///./src/Terminal/TerminalEvents.ts","webpack:///./src/StockMarket/OrderProcessing.tsx","webpack:///./src/db.tsx","webpack:///./src/PersonObjects/Sleeve/Work/SleeveSupportWork.ts","webpack:///./src/utils/IPAddress.ts","webpack:///./src/Message/MessageHelpers.tsx","webpack:///./src/Netscript/RecentScripts.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveClassWork.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveCrimeWork.ts","webpack:///./src/Faction/formulas/favor.ts","webpack:///./src/utils/helpers/formatTime.ts","webpack:///./src/ui/React/ReputationRate.tsx","webpack:///./src/Bladeburner/Operation.ts","webpack:///./src/Faction/ui/Option.tsx","webpack:///./src/Augmentation/data/AugmentationCreator.tsx","webpack:///./src/PersonObjects/Sleeve/Work/SleeveInfiltrateWork.ts","webpack:///./src/Server/data/servers.ts","webpack:///./src/StockMarket/PlayerInfluencing.ts","webpack:///./src/Work/GraftingWork.tsx","webpack:///./src/Bladeburner/ui/StartButton.tsx","webpack:///./src/ui/React/CorruptableText.tsx","webpack:///./src/engine.tsx","webpack:///./src/Faction/FactionInfo.tsx","webpack:///./src/Work/formulas/Faction.ts","webpack:///./src/Corporation/data/CorporationUpgrades.ts","webpack:///./src/ui/InteractiveTutorial/ITutorialEvents.ts","webpack:///./src/Netscript/WorkerScript.ts","webpack:///./src/Crime/CrimeHelpers.ts","webpack:///./src/PersonObjects/Grafting/GraftableAugmentation.ts","webpack:///./src/ui/React/Progress.tsx","webpack:///./src/utils/Validator.ts","webpack:///./src/Infiltration/formulas/victory.ts","webpack:///./src/utils/MoneySourceTracker.ts","webpack:///./src/PersonObjects/Player/PlayerObjectGangMethods.ts","webpack:///./src/utils/CompressionContracts.ts","webpack:///./src/ui/React/StatsProgressBar.tsx","webpack:///./src/Hospital/Hospital.ts","webpack:///./src/utils/helpers/compareArrays.ts","webpack:///./src/Hacking/netscriptCanHack.ts","webpack:///./src/ui/React/PromptManager.tsx","webpack:///./src/Corporation/ui/Helpers.tsx","webpack:///./src/Programs/ui/ProgramsRoot.tsx","webpack:///./src/Faction/ui/FactionsRoot.tsx","webpack:///./src/ui/React/RecoveryRoot.tsx","webpack:///./src/NetworkShare/Share.tsx","webpack:///./src/Script/RamCalculationErrorCodes.ts","webpack:///./src/Locations/City.ts","webpack:///./src/PersonObjects/Player/PlayerObjectServerMethods.ts","webpack:///./src/GameOptions/ui/OptionsSlider.tsx","webpack:///./src/StockMarket/ui/StockTickersConfig.tsx","webpack:///./src/Themes/Styles.ts","webpack:///./src/Bladeburner/Bladeburner.tsx","webpack:///./src/Bladeburner/Action.tsx","webpack:///./src/Literature/LiteratureHelpers.ts","webpack:///./src/Gang/GangMemberTask.ts","webpack:///./src/Work/CrimeWork.ts","webpack:///./src/Work/formulas/Crime.ts","webpack:///./src/ui/Apr1.tsx","webpack:///./src/Script/RunningScript.ts","webpack:///./src/Prestige.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveSynchroWork.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveRecoveryWork.ts","webpack:///./src/ui/React/WorldMap.tsx","webpack:///./src/Bladeburner/ui/SuccessChance.tsx","webpack:///./src/ui/React/StaticModal.tsx","webpack:///./src/DarkWeb/DarkWeb.tsx","webpack:///./src/Terminal/Parser.ts","webpack:///./src/Hacknet/HashManager.ts","webpack:///./src/Infiltration/formulas/game.ts","webpack:///./src/ui/React/CinematicText.tsx","webpack:///./src/PersonObjects/Sleeve/SleeveCovenantPurchases.tsx","webpack:///./src/Company/GetJobRequirementText.ts","webpack:///./src/Script/RamCalculations.ts","webpack:///./src/utils/helpers/roundToTwo.ts","webpack:///./src/Terminal/HelpText.ts","webpack:///./src/Netscript/Pid.ts","webpack:///./src/Faction/formulas/donation.ts","webpack:///./src/RedPill.tsx","webpack:///./src/RemoteFileAPI/RemoteFileAPI.ts","webpack:///./src/utils/ErrorHelper.ts","webpack:///./src/Bladeburner/data/Growths.ts","webpack:///./src/utils/helpers/getRandomByte.ts","webpack:///./src/Locations/createCityMap.ts","webpack:///./src/Casino/CardDeck/Hand.ts","webpack:///./src/StockMarket/ui/StockTickerTxButton.tsx","webpack:///./src/CotMG/ui/DummyGrid.tsx","webpack:///./src/Faction/Faction.ts","webpack:///./src/PersonObjects/Player/PlayerObject.ts","webpack:///./src/Faction/ui/InvitationModal.tsx","webpack:///./src/Gang/GangMember.ts","webpack:///./src/data/codingcontracttypes.ts","webpack:///./src/ui/React/CodingContractModal.tsx","webpack:///./src/Server/BaseServer.ts","webpack:///./src/Server/formulas/grow.ts","webpack:///./src/Terminal/DirectoryServerHelpers.ts","webpack:///./src/Terminal/commands/download.ts","webpack:///./src/ThirdParty/JSInterpreter.js","webpack:///./src/NetscriptFunctions.ts","webpack:///./src/ui/React/ANSIITypography.tsx","webpack:///./src/Bladeburner/data/GeneralActions.tsx","webpack:///./src/Work/formulas/Company.ts","webpack:///./src/CotMG/BaseGift.ts","webpack:///./src/CotMG/StaneksGiftEvents.ts","webpack:///./src/Locations/data/LocationsMetadata.ts","webpack:///./src/Corporation/OfficeSpace.ts","webpack:///./src/Corporation/Warehouse.ts","webpack:///./src/PersonObjects/Grafting/ui/GraftingRoot.tsx","webpack:///./src/SourceFile/PlayerOwnedSourceFile.ts","webpack:///./src/utils/V2Modal.tsx","webpack:///./src/NetscriptFunctions/Flags.ts","webpack:///./src/NetscriptFunctions/toNative.ts","webpack:///./src/NetscriptJSEvaluator.ts","webpack:///./src/Script/RunningScriptHelpers.ts","webpack:///./src/Terminal/commands/common/editor.ts","webpack:///./src/BitNode/ui/BitFlumeModal.tsx","webpack:///./src/PersonObjects/Sleeve/Sleeve.ts","webpack:///./src/PersonObjects/Person.ts","webpack:///./src/Bladeburner/data/Contracts.tsx","webpack:///./src/Bladeburner/data/Icons.tsx","webpack:///./src/Bladeburner/ui/ActionLevel.tsx","webpack:///./src/Bladeburner/ui/Autolevel.tsx","webpack:///./src/Bladeburner/ui/TeamSizeButton.tsx","webpack:///./src/Infiltration/ui/BlinkingCursor.tsx","webpack:///./src/Themes/ui/StyleEditorButton.tsx","webpack:///./src/Themes/ui/ThemeEditorButton.tsx","webpack:///./src/Themes/ui/ThemeCollaborate.tsx","webpack:///./src/ui/React/DeleteGameButton.tsx","webpack:///./src/ui/React/SoftResetButton.tsx","webpack:///./src/ScriptEditor/NetscriptDefinitions.d.ts","webpack:///./src/Augmentation/ui/PurchasableAugmentations.tsx","webpack:///./src/Locations/ui/TravelAgencyRoot.tsx","webpack:///./src/ScriptEditor/ui/ScriptEditorRoot.tsx","webpack:///./src/ui/React/TablePaginationActionsAll.tsx","webpack:///./src/BitNode/ui/BitnodeMultipliersDescription.tsx","webpack:///./src/CotMG/ui/Cell.tsx","webpack:///./src/CotMG/ui/Grid.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectBladeburnerMethods.ts","webpack:///./src/Bladeburner/Contract.ts","webpack:///./src/Bladeburner/data/Help.ts","webpack:///./src/PersonObjects/Player/PlayerObjectCorporationMethods.ts","webpack:///./src/utils/HammingCodeTools.ts","webpack:///./src/Company/GetNextCompanyPosition.ts","webpack:///./src/StockMarket/StockMarketConstants.ts","webpack:///./src/CotMG/data/Constants.ts","webpack:///./src/Corporation/ResearchTree.ts","webpack:///./src/utils/v1APIBreak.ts","webpack:///./src/PersonObjects/Player/PlayerObjectWorkMethods.ts","webpack:///./src/Themes/data/index.ts","webpack:///./src/ui/LoadingScreen.tsx","webpack:///./src/utils/helpers/isValidNumber.ts","webpack:///./src/StockMarket/Order.ts","webpack:///./src/utils/helpers/isPowerOfTwo.ts","webpack:///./src/CotMG/StaneksGift.ts","webpack:///./src/PersonObjects/Sleeve/SleeveMethods.ts","webpack:///./src/RemoteFileAPI/MessageHandlers.ts","webpack:///./src/PersonObjects/Sleeve/ui/StatsElement.tsx","webpack:///./src/ui/React/ServerDropdown.tsx","webpack:///./src/Casino/Blackjack.tsx","webpack:///./src/Casino/CardDeck/ReactCard.tsx","webpack:///./src/Milestones/Milestones.ts","webpack:///./src/StockMarket/data/TickerHeaderFormatData.ts","webpack:///./src/Achievements/AchievementEntry.tsx","webpack:///./src/ThirdParty/colorUtils.ts","webpack:///./src/Themes/data/default/index.ts","webpack:///./src/Themes/data/default-lite/index.ts","webpack:///./src/Themes/data/monokai-ish/index.ts","webpack:///./src/Themes/data/warmer/index.ts","webpack:///./src/Themes/data/dark-plus/index.ts","webpack:///./src/Themes/data/mayukai-dark/index.ts","webpack:///./src/Themes/data/purple/index.ts","webpack:///./src/Themes/data/smooth-green/index.ts","webpack:///./src/Themes/data/dracula/index.ts","webpack:///./src/Themes/data/dark-blue/index.ts","webpack:///./src/Themes/data/discord-like/index.ts","webpack:///./src/Themes/data/one-dark/index.ts","webpack:///./src/Themes/data/muted-gold-blue/index.ts","webpack:///./src/Themes/data/light/index.ts","webpack:///./src/Themes/data/default/screenshot.png","webpack:///./src/Themes/data/default-lite/screenshot.png","webpack:///./src/Themes/data/monokai-ish/screenshot.png","webpack:///./src/Themes/data/warmer/screenshot.png","webpack:///./src/Themes/data/dark-plus/screenshot.png","webpack:///./src/Themes/data/mayukai-dark/screenshot.png","webpack:///./src/Themes/data/purple/screenshot.png","webpack:///./src/Themes/data/smooth-green/screenshot.png","webpack:///./src/Themes/data/dracula/screenshot.png","webpack:///./src/Themes/data/dark-blue/screenshot.png","webpack:///./src/Themes/data/discord-like/screenshot.png","webpack:///./src/Themes/data/one-dark/screenshot.png","webpack:///./src/Themes/data/muted-gold-blue/screenshot.png","webpack:///./src/Themes/data/light/screenshot.png","webpack:///./src/PersonObjects/Player/PlayerObjectAugmentationMethods.ts","webpack:///./src/PersonObjects/Grafting/EntropyAccumulation.ts","webpack:///./src/Bladeburner/City.ts","webpack:///./src/utils/helpers/getTimestamp.ts","webpack:///./src/NetworkShare/formulas/share.tsx","webpack:///./src/Corporation/Corporation.tsx","webpack:///./src/Corporation/CorporationState.ts","webpack:///./src/Literature/Literatures.ts","webpack:///./src/Gang/Gang.ts","webpack:///./src/Gang/data/tasks.ts","webpack:///./src/Gang/GangMemberUpgrade.ts","webpack:///./src/Gang/data/power.ts","webpack:///./src/utils/Heap.ts","webpack:///./src/Company/data/CompaniesMetadata.ts","webpack:///./src/Company/Company.ts","webpack:///./src/Company/data/CompanyPositionsMetadata.ts","webpack:///./src/Company/CompanyPosition.ts","webpack:///./src/Programs/Program.ts","webpack:///./src/Programs/data/ProgramsMetadata.ts","webpack:///./src/utils/helpers/createRandomString.ts","webpack:///./src/Terminal/Terminal.ts","webpack:///./src/utils/helpers/isValidIPAddress.ts","webpack:///./src/Terminal/commands/alias.ts","webpack:///./src/Terminal/commands/analyze.ts","webpack:///./src/Terminal/commands/backdoor.ts","webpack:///./src/Terminal/commands/buy.ts","webpack:///./src/Terminal/commands/cat.ts","webpack:///./src/Terminal/commands/cd.ts","webpack:///./src/Terminal/commands/check.ts","webpack:///./src/Terminal/commands/connect.ts","webpack:///./src/Terminal/commands/cp.ts","webpack:///./src/Terminal/commands/expr.ts","webpack:///./src/Terminal/commands/free.ts","webpack:///./src/Terminal/commands/grow.ts","webpack:///./src/Terminal/commands/hack.ts","webpack:///./src/Terminal/commands/help.ts","webpack:///./src/Terminal/commands/history.ts","webpack:///./src/Terminal/commands/home.ts","webpack:///./src/Terminal/commands/hostname.ts","webpack:///./src/Terminal/commands/kill.ts","webpack:///./src/Netscript/Environment.ts","webpack:///./src/StockMarket/data/InitStockMetadata.ts","webpack:///./src/NetscriptPort.ts","webpack:///./src/NetscriptFunctions/Gang.ts","webpack:///./src/NetscriptFunctions/Sleeve.ts","webpack:///./src/NetscriptFunctions/Extra.ts","webpack:///./src/NetscriptFunctions/Hacknet.ts","webpack:///./src/Hacknet/HashUpgrade.ts","webpack:///./src/Hacknet/data/HashUpgradesMetadata.tsx","webpack:///./src/NetscriptFunctions/Stanek.ts","webpack:///./src/CotMG/formulas/effect.ts","webpack:///./src/NetscriptFunctions/Infiltration.ts","webpack:///./src/Locations/Location.ts","webpack:///./src/NetscriptFunctions/UserInterface.ts","webpack:///./src/NetscriptFunctions/Bladeburner.ts","webpack:///./src/NetscriptFunctions/CodingContract.ts","webpack:///./src/NetscriptFunctions/Corporation.ts","webpack:///./src/Corporation/Research.ts","webpack:///./src/Corporation/data/ResearchMetadata.ts","webpack:///./src/Corporation/Industry.ts","webpack:///./src/utils/calculateEffectWithFactors.ts","webpack:///./src/Corporation/Employee.ts","webpack:///./src/Corporation/Product.ts","webpack:///./src/Corporation/ProductRatingWeights.ts","webpack:///./src/NetscriptFunctions/Formulas.ts","webpack:///./src/NetscriptFunctions/StockMarket.ts","webpack:///./src/NetscriptFunctions/Grafting.ts","webpack:///./src/NetscriptFunctions/Singularity.ts","webpack:///./src/utils/v2APIBreak.ts","webpack:///./src/Netscript/APIWrapper.ts","webpack:///./src/Script/ScriptUrl.ts","webpack:///./src/Terminal/commands/killall.ts","webpack:///./src/Terminal/commands/ls.tsx","webpack:///./src/Terminal/commands/lscpu.ts","webpack:///./src/Terminal/commands/mem.ts","webpack:///./src/Terminal/commands/mv.ts","webpack:///./src/Terminal/commands/nano.ts","webpack:///./src/ScriptEditor/CursorPositions.ts","webpack:///./src/Terminal/commands/ps.ts","webpack:///./src/Terminal/commands/rm.ts","webpack:///./src/Terminal/commands/run.ts","webpack:///./src/Terminal/commands/runScript.ts","webpack:///./src/Terminal/commands/runProgram.ts","webpack:///./src/Terminal/commands/scan.ts","webpack:///./src/Terminal/commands/scananalyze.ts","webpack:///./src/Terminal/commands/scp.ts","webpack:///./src/Terminal/commands/sudov.ts","webpack:///./src/Terminal/commands/tail.ts","webpack:///./src/Terminal/commands/top.ts","webpack:///./src/Terminal/commands/unalias.ts","webpack:///./src/Terminal/commands/vim.ts","webpack:///./src/Terminal/commands/weaken.ts","webpack:///./src/Terminal/commands/wget.ts","webpack:///./src/Terminal/commands/apr1.ts","webpack:///./src/SourceFile/applySourceFile.ts","webpack:///./src/Exploits/applyExploits.ts","webpack:///./src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx","webpack:///./src/ui/InteractiveTutorial/NSSelection.tsx","webpack:///./src/ui/React/Overview.tsx","webpack:///./src/Sidebar/ui/SidebarRoot.tsx","webpack:///./src/Programs/ProgramHelpers.ts","webpack:///./src/Augmentation/ui/AugmentationsRoot.tsx","webpack:///./src/Augmentation/ui/InstalledAugmentations.tsx","webpack:///./src/Augmentation/ui/PlayerMultipliers.tsx","webpack:///./src/Augmentation/ui/PurchasedAugmentations.tsx","webpack:///./src/Augmentation/ui/SourceFiles.tsx","webpack:///./src/DevMenu.tsx","webpack:///./src/DevMenu/ui/General.tsx","webpack:///./src/DevMenu/ui/Stats.tsx","webpack:///./src/DevMenu/ui/Factions.tsx","webpack:///./src/DevMenu/ui/Augmentations.tsx","webpack:///./src/DevMenu/ui/SourceFiles.tsx","webpack:///./src/DevMenu/ui/Programs.tsx","webpack:///./src/DevMenu/ui/Servers.tsx","webpack:///./src/DevMenu/ui/Companies.tsx","webpack:///./src/DevMenu/ui/Bladeburner.tsx","webpack:///./src/DevMenu/ui/Gang.tsx","webpack:///./src/DevMenu/ui/Corporation.tsx","webpack:///./src/DevMenu/ui/CodingContracts.tsx","webpack:///./src/DevMenu/ui/StockMarket.tsx","webpack:///./src/DevMenu/ui/Sleeves.tsx","webpack:///./src/DevMenu/ui/Stanek.tsx","webpack:///./src/DevMenu/ui/TimeSkip.tsx","webpack:///./src/DevMenu/ui/SaveFile.tsx","webpack:///./src/DevMenu/ui/Achievements.tsx","webpack:///./src/DevMenu/ui/Entropy.tsx","webpack:///./src/Bladeburner/ui/BladeburnerRoot.tsx","webpack:///./src/Bladeburner/ui/Stats.tsx","webpack:///./src/Bladeburner/ui/TravelModal.tsx","webpack:///./src/Bladeburner/ui/Console.tsx","webpack:///./src/Bladeburner/ui/AllPages.tsx","webpack:///./src/Bladeburner/ui/GeneralActionPage.tsx","webpack:///./src/Bladeburner/ui/GeneralActionList.tsx","webpack:///./src/Bladeburner/ui/GeneralActionElem.tsx","webpack:///./src/Bladeburner/ui/ContractPage.tsx","webpack:///./src/Bladeburner/ui/ContractList.tsx","webpack:///./src/Bladeburner/ui/ContractElem.tsx","webpack:///./src/Bladeburner/ui/StealthIcon.tsx","webpack:///./src/Bladeburner/ui/KillIcon.tsx","webpack:///./src/Bladeburner/ui/OperationPage.tsx","webpack:///./src/Bladeburner/ui/OperationList.tsx","webpack:///./src/Bladeburner/ui/OperationElem.tsx","webpack:///./src/Bladeburner/ui/TeamSizeModal.tsx","webpack:///./src/Bladeburner/data/Operations.tsx","webpack:///./src/Bladeburner/ui/BlackOpPage.tsx","webpack:///./src/Bladeburner/ui/BlackOpList.tsx","webpack:///./src/Bladeburner/ui/BlackOpElem.tsx","webpack:///./src/Bladeburner/data/BlackOperations.tsx","webpack:///./src/Bladeburner/ui/SkillPage.tsx","webpack:///./src/Bladeburner/ui/SkillList.tsx","webpack:///./src/Bladeburner/ui/SkillElem.tsx","webpack:///./src/Gang/ui/GangRoot.tsx","webpack:///./src/Gang/ui/ManagementSubpage.tsx","webpack:///./src/Gang/ui/GangStats.tsx","webpack:///./src/Gang/ui/BonusTime.tsx","webpack:///./src/Gang/ui/GangMemberList.tsx","webpack:///./src/Gang/ui/GangMemberCard.tsx","webpack:///./src/Gang/ui/GangMemberCardContent.tsx","webpack:///./src/Gang/ui/GangMemberStats.tsx","webpack:///./src/ui/React/KillScriptsModal.tsx","webpack:///./src/Gang/ui/TaskSelector.tsx","webpack:///./src/Gang/ui/TaskDescription.tsx","webpack:///./src/Gang/ui/AscensionModal.tsx","webpack:///./src/Gang/ui/RecruitButton.tsx","webpack:///./src/Gang/ui/RecruitModal.tsx","webpack:///./src/Gang/ui/TerritorySubpage.tsx","webpack:///./src/Gang/ui/TerritoryInfoModal.tsx","webpack:///./src/Gang/ui/EquipmentsSubpage.tsx","webpack:///./src/Corporation/ui/CorporationRoot.tsx","webpack:///./src/Corporation/ui/MainPanel.tsx","webpack:///./src/Corporation/ui/CityTabs.tsx","webpack:///./src/Corporation/ui/Industry.tsx","webpack:///./src/Corporation/ui/IndustryOffice.tsx","webpack:///./src/Corporation/ui/modals/UpgradeOfficeSizeModal.tsx","webpack:///./src/Corporation/ui/modals/ThrowPartyModal.tsx","webpack:///./src/Corporation/ui/IndustryOverview.tsx","webpack:///./src/Corporation/ui/modals/MakeProductModal.tsx","webpack:///./src/Corporation/ui/modals/ResearchModal.tsx","webpack:///./src/Corporation/ui/IndustryWarehouse.tsx","webpack:///./src/Corporation/ui/modals/SmartSupplyModal.tsx","webpack:///./src/Corporation/ui/ProductElem.tsx","webpack:///./src/Corporation/ui/modals/DiscontinueProductModal.tsx","webpack:///./src/Corporation/ui/modals/LimitProductProductionModal.tsx","webpack:///./src/Corporation/ui/modals/SellProductModal.tsx","webpack:///./src/Corporation/ui/modals/ProductMarketTaModal.tsx","webpack:///./src/Corporation/ui/modals/CancelProductModal.tsx","webpack:///./src/Corporation/ui/MaterialElem.tsx","webpack:///./src/Corporation/ui/modals/ExportModal.tsx","webpack:///./src/Corporation/ui/modals/MaterialMarketTaModal.tsx","webpack:///./src/Corporation/ui/modals/SellMaterialModal.tsx","webpack:///./src/Corporation/ui/modals/PurchaseMaterialModal.tsx","webpack:///./src/Corporation/ui/modals/LimitMaterialProductionModal.tsx","webpack:///./src/Corporation/ui/IndustryProductEquation.tsx","webpack:///./src/Corporation/ui/ExpandNewCity.tsx","webpack:///./src/Corporation/ui/ExpandIndustryTab.tsx","webpack:///./src/Corporation/ui/Overview.tsx","webpack:///./src/Corporation/ui/LevelableUpgrade.tsx","webpack:///./src/Corporation/ui/UnlockUpgrade.tsx","webpack:///./src/Corporation/ui/modals/BribeFactionModal.tsx","webpack:///./src/Corporation/ui/modals/SellSharesModal.tsx","webpack:///./src/Corporation/ui/modals/BuybackSharesModal.tsx","webpack:///./src/Corporation/ui/modals/IssueDividendsModal.tsx","webpack:///./src/Corporation/ui/modals/IssueNewSharesModal.tsx","webpack:///./src/Corporation/ui/modals/FindInvestorsModal.tsx","webpack:///./src/Corporation/ui/modals/GoPublicModal.tsx","webpack:///./src/Infiltration/ui/InfiltrationRoot.tsx","webpack:///./src/Infiltration/ui/Game.tsx","webpack:///./src/Infiltration/ui/BackwardGame.tsx","webpack:///./src/Infiltration/ui/BracketGame.tsx","webpack:///./src/Infiltration/ui/BribeGame.tsx","webpack:///./src/Infiltration/ui/CheatCodeGame.tsx","webpack:///./src/Infiltration/ui/Countdown.tsx","webpack:///./src/Infiltration/ui/Cyberpunk2077Game.tsx","webpack:///./src/Infiltration/ui/MinesweeperGame.tsx","webpack:///./src/Infiltration/ui/SlashGame.tsx","webpack:///./src/Infiltration/ui/Victory.tsx","webpack:///./src/Infiltration/ui/WireCuttingGame.tsx","webpack:///./src/Infiltration/ui/Intro.tsx","webpack:///./src/ui/WorkInProgressRoot.tsx","webpack:///./src/GameOptions/ui/GameOptionsRoot.tsx","webpack:///./src/GameOptions/ui/GameOptionsSidebar.tsx","webpack:///./src/Diagnostic/FileDiagnosticModal.tsx","webpack:///./src/Themes/ui/StyleEditorModal.tsx","webpack:///./src/Themes/ui/ThemeEditorModal.tsx","webpack:///./src/GameOptions/ui/GameplayPage.tsx","webpack:///./src/GameOptions/ui/InterfacePage.tsx","webpack:///./src/GameOptions/ui/MiscPage.tsx","webpack:///./src/GameOptions/ui/RemoteAPIPage.tsx","webpack:///./src/GameOptions/ui/ConnectionBauble.tsx","webpack:///./src/RemoteFileAPI/Remote.ts","webpack:///./src/GameOptions/ui/SystemPage.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveElem.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreStatsModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveAugmentationsModal.tsx","webpack:///./src/Augmentation/ui/PurchaseAugmentationModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TaskSelector.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TravelModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/FAQModal.tsx","webpack:///./src/Hacknet/ui/HacknetRoot.tsx","webpack:///./src/Hacknet/ui/GeneralInfo.tsx","webpack:///./src/Hacknet/ui/HacknetNodeElem.tsx","webpack:///./src/Hacknet/ui/HacknetServerElem.tsx","webpack:///./src/Hacknet/ui/HashUpgradeModal.tsx","webpack:///./src/Hacknet/ui/HacknetUpgradeElem.tsx","webpack:///./src/Hacknet/ui/MultiplierButtons.tsx","webpack:///./src/Hacknet/ui/PlayerInfo.tsx","webpack:///./src/Hacknet/ui/PurchaseButton.tsx","webpack:///./src/Locations/ui/GenericLocation.tsx","webpack:///./src/Locations/ui/CompanyLocation.tsx","webpack:///./src/Company/ui/QuitJobModal.tsx","webpack:///./src/Locations/ui/GymLocation.tsx","webpack:///./src/Locations/ui/HospitalLocation.tsx","webpack:///./src/Locations/ui/SlumsLocation.tsx","webpack:///./src/Locations/ui/SpecialLocation.tsx","webpack:///./src/Corporation/ui/modals/CreateCorporationModal.tsx","webpack:///./src/utils/helpers/N00dles.ts","webpack:///./src/Arcade/ui/ArcadeRoot.tsx","webpack:///./src/Arcade/ui/BBCabinet.tsx","webpack:///./src/Locations/ui/TechVendorLocation.tsx","webpack:///./src/Locations/ui/RamButton.tsx","webpack:///./src/Locations/ui/TorButton.tsx","webpack:///./src/Locations/ui/CoresButton.tsx","webpack:///./src/Locations/ui/PurchaseServerModal.tsx","webpack:///./src/Locations/ui/TravelConfirmationModal.tsx","webpack:///./src/Locations/ui/UniversityLocation.tsx","webpack:///./src/Locations/ui/CasinoLocation.tsx","webpack:///./src/Casino/CardDeck/Deck.ts","webpack:///./src/Casino/CoinFlip.tsx","webpack:///./src/Casino/Roulette.tsx","webpack:///./src/Casino/SlotMachine.tsx","webpack:///./src/Locations/ui/City.tsx","webpack:///./src/ScriptEditor/ui/OptionsModal.tsx","webpack:///./src/ScriptEditor/ui/ThemeEditorModal.tsx","webpack:///./src/Milestones/ui/MilestonesRoot.tsx","webpack:///./src/Terminal/ui/TerminalRoot.tsx","webpack:///./src/Terminal/ui/TerminalInput.tsx","webpack:///./src/Terminal/determineAllPossibilitiesForTabCompletion.ts","webpack:///./src/Terminal/tabCompletion.ts","webpack:///./src/Tutorial/ui/TutorialRoot.tsx","webpack:///./src/ui/ActiveScripts/ActiveScriptsRoot.tsx","webpack:///./src/ui/ActiveScripts/ActiveScriptsPage.tsx","webpack:///./src/ui/ActiveScripts/ScriptProduction.tsx","webpack:///./src/ui/ActiveScripts/ServerAccordions.tsx","webpack:///./src/ui/ActiveScripts/ServerAccordion.tsx","webpack:///./src/ui/ActiveScripts/ServerAccordionContent.tsx","webpack:///./src/ui/ActiveScripts/WorkerScriptAccordion.tsx","webpack:///./src/ui/ActiveScripts/RecentScriptsPage.tsx","webpack:///./src/ui/ActiveScripts/RecentScriptAccordion.tsx","webpack:///./src/Faction/ui/FactionRoot.tsx","webpack:///./src/Faction/ui/AugmentationsPage.tsx","webpack:///./src/Faction/ui/DonateOption.tsx","webpack:///./src/Faction/ui/Info.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantSleeveMemoryUpgrade.tsx","webpack:///./src/Faction/ui/GangButton.tsx","webpack:///./src/Faction/ui/CreateGangModal.tsx","webpack:///./src/ui/CharacterStats.tsx","webpack:///./src/StockMarket/ui/StockMarketRoot.tsx","webpack:///./src/StockMarket/ui/InfoAndPurchases.tsx","webpack:///./src/StockMarket/ui/StockTickers.tsx","webpack:///./src/StockMarket/ui/StockTicker.tsx","webpack:///./src/StockMarket/ui/StockTickerHeaderText.tsx","webpack:///./src/StockMarket/ui/StockTickerOrderList.tsx","webpack:///./src/StockMarket/ui/StockTickerOrder.tsx","webpack:///./src/StockMarket/ui/StockTickerPositionText.tsx","webpack:///./src/StockMarket/ui/PlaceOrderModal.tsx","webpack:///./src/BitNode/ui/BitverseRoot.tsx","webpack:///./src/BitNode/ui/PortalModal.tsx","webpack:///./src/ui/React/CinematicLine.tsx","webpack:///./src/CotMG/ui/StaneksGiftRoot.tsx","webpack:///./src/CotMG/ui/MainBoard.tsx","webpack:///./src/CotMG/ui/FragmentInspector.tsx","webpack:///./src/CotMG/ui/FragmentSelector.tsx","webpack:///./src/CotMG/ui/FragmentPreview.tsx","webpack:///./src/CotMG/ui/ActiveFragmentSummary.tsx","webpack:///./src/Bladeburner/ui/BladeburnerCinematic.tsx","webpack:///./src/Exploits/Unclickable.tsx","webpack:///./src/Achievements/AchievementsRoot.tsx","webpack:///./src/Achievements/AchievementList.tsx","webpack:///./src/Achievements/AchievementIcon.tsx","webpack:///./src/ui/ErrorBoundary.tsx","webpack:///./src/Themes/ui/ThemeBrowser.tsx","webpack:///./src/Themes/ui/ThemeEntry.tsx","webpack:///./src/ui/React/ImportSaveRoot.tsx","webpack:///./src/ui/React/BypassWrapper.tsx","webpack:///./src/utils/helpers/clearObject.ts","webpack:///./src/Exploits/loops.ts","webpack:///./src/UncaughtPromiseHandler.ts","webpack:///./src/index.tsx"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","0","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","Player","PlayerObject","loadPlayer","saveString","JSON","parse","Reviver","money","parseFloat","exploits","sanitizeExploits","helpers","string","number","ctx","argName","v","x","isNaN","makeRuntimeErrorMsg","debugType","scriptArgs","argsToString","args","out","arg","undefined","toNative","stringify","makeBasicErrorMsg","resolveNetscriptRequestedThreads","requestedThreads","threads","workerScript","scriptRef","requestedThreadsAsInt","function","checkEnvFlags","ws","env","stopFlag","log","ScriptDeath","runningFn","delayReject","checkSingularityAccess","bitNodeN","sourceFileLvl","netscriptDelay","time","Promise","resolve","reject","delay","setTimeout","updateDynamicRam","ramCost","fnName","dynamicLoadedFns","console","warn","hostname","dynamicRamUsage","ramUsage","numeralWrapper","formatRAM","city","values","CityName","includes","getServer","scriptIdentifier","scriptID","_hostname","_args","pid","scriptname","hack","manual","stock","server","Server","hackingTime","calculateHackingTime","canHack","netscriptCanHack","res","msg","convertTimeMsToTimeElapsedString","formatThreads","then","hackChance","calculateHackingChance","rand","Math","random","expGainedOnSuccess","calculateHackingExpGain","expGainedOnFailure","percentHacked","calculatePercentMoneyHacked","maxThreadNeeded","ceil","moneyDrained","floor","moneyAvailable","moneyGained","BitNodeMultipliers","ScriptHackMoneyGain","ManualHackMoney","gainMoney","onlineMoneyMade","scriptProdSinceLastAug","recordHack","gainHackingExp","gainIntelligenceExp","onlineExpGained","formatMoney","formatExp","fortify","CONSTANTS","ServerFortifyAmount","min","influenceStockThroughServerHack","backdoorInstalled","getValidPort","port","NumNetscriptPorts","round","iport","NetscriptPorts","NetscriptPort","set","player","roughlyIs","hp","mults","numPeopleKilled","location","totalPlaytime","playtimeSinceLastAug","playtimeSinceLastBitnode","jobs","factions","tor","inBladeburner","hasCorporation","entropy","cpuCores","ftpPortOpen","hasAdminRights","httpPortOpen","ip","isConnectedTo","maxRam","organizationName","ramUsed","smtpPortOpen","sqlPortOpen","sshPortOpen","purchasedByPlayer","baseDifficulty","hackDifficulty","minDifficulty","moneyMax","numOpenPortsRequired","openPortCount","requiredHackingSkill","serverGrowth","gang","g","respect","territory","wantedLevel","gangMember","GangMember","gangTask","GangMemberTask","hackWeight","getRunningScript","ident","GetAllServers","runningScript","findRunningScriptByPid","getRunningScriptByPid","getRunningScriptByArgs","getCannotFindRunningScriptErrorMessage","arrayToString","createPublicRunningScript","filename","logs","offlineExpGained","offlineMoneyMade","offlineRunningTime","onlineRunningTime","failOnHacknetServer","HacknetServer","assertObjectType","obj","desiredObject","objHas","val","entries","objVal","clip","String","json","userFriendlyString","Array","isArray","every","isScriptArgs","type","WorkerScript","scriptUrl","dependencies","replace","RegExp","url","errstack","Error","stack","split","caller","functionPath","scripts","userstack","stackline","script","dependency","parseChromeStackline","line","lineMatch","match","funcMatch","func","chromeCall","parseFirefoxStackline","lio","lastIndexOf","firefoxCall","rejectMsg","join","GetServer","expect","actual","expects","keys","actuals","message","fn","findRunningScript","handleUnknownError","e","initialText","errorMessage","headerText","SyntaxError","toString","error","dialogBoxCreate","FactionNames","Settings","ActiveScriptsServerPageSize","ActiveScriptsScriptPageSize","AutosaveInterval","CodeInstructionRunTime","DisableASCIIArt","DisableHotkeys","DisableTextEffects","DisableOverviewProgressBars","EnableBashHotkeys","TimestampsFormat","Locale","MaxRecentScriptsCapacity","MaxLogCapacity","MaxPortCapacity","MaxTerminalCapacity","RemoteFileApiPort","SaveGameOnFileSave","SuppressBuyAugmentationConfirmation","SuppressFactionInvites","SuppressMessages","SuppressTravelConfirmation","SuppressBladeburnerPopup","SuppressTIXPopup","SuppressSavedGameToast","SuppressAutosaveDisabledWarnings","UseIEC60027_2","ShowMiddleNullTimeUnit","ExcludeRunningScriptsFromSave","IsSidebarOpened","theme","defaultTheme","styles","defaultStyles","overview","y","opened","EditorTheme","defaultMonacoTheme","OwnedAugmentationsOrder","OwnedAugmentationsOrderSetting","AcquirementTime","PurchaseAugmentationsOrder","PurchaseAugmentationsOrderSetting","Default","MonacoTheme","MonacoInsertSpaces","MonacoFontSize","MonacoVim","MonacoWordWrap","load","save","assign","extraFormats","extraNotations","gigaMultiplier","constructor","this","defaultLocale","updateLocale","numeral","locale","format","abs","answer","formatBigNumber","formatReallyBigNumber","decimalPlaces","nAbs","Infinity","repeat","str","formatHp","formatSkill","formatHashes","formatReputation","formatFavor","formatSecurity","toFixed","formatPercentage","formatter","formatServerSecurity","formatRespect","formatWanted","formatMultiplier","formatSleeveShock","formatSleeveSynchro","formatSleeveMemory","formatPopulation","formatStamina","formatShares","formatInfiltrationSecurity","formatStaneksGiftHeat","formatStaneksGiftCharge","formatStaneksGiftPower","parseCustomLargeNumber","numericRegExp","NaN","notation","notationIndex","indexOf","largestAbsoluteNumber","n1","n2","n3","max","parseMoney","numeralValue","parsed","selfParsed","Terminal","TTerminal","LocationName","AugmentationNames","VersionString","VersionNumber","_idleSpeed","MaxSkillLevel","MilliPerCycle","CorpFactionRepRequirement","BaseCostFor1GBOfRamHome","BaseCostFor1GBOfRamServer","TravelCost","BaseFavorToDonate","DonateMoneyToRepDivisor","FactionReputationToFavorBase","FactionReputationToFavorMult","CompanyReputationToFavorBase","CompanyReputationToFavorMult","NeuroFluxGovernorLevelMult","Number","MAX_SAFE_INTEGER","HomeComputerMaxRam","ServerBaseGrowthRate","ServerMaxGrowthRate","ServerWeakenAmount","PurchasedServerLimit","PurchasedServerMaxRam","MultipleAugMultiplier","TorRouterCost","WSEAccountCost","TIXAPICost","MarketData4SCost","MarketDataTixApi4SCost","StockMarketCommission","HospitalCostPerHp","IntelligenceCrimeWeight","IntelligenceInfiltrationWeight","IntelligenceCrimeBaseExpGain","IntelligenceProgramBaseExpGain","IntelligenceGraftBaseExpGain","IntelligenceTerminalHackBaseExpGain","IntelligenceSingFnBaseExpGain","IntelligenceClassBaseExpGain","MillisecondsPer20Hours","GameCyclesPer20Hours","MillisecondsPer10Hours","GameCyclesPer10Hours","MillisecondsPer8Hours","GameCyclesPer8Hours","MillisecondsPer4Hours","GameCyclesPer4Hours","MillisecondsPer2Hours","GameCyclesPer2Hours","MillisecondsPerHour","GameCyclesPerHour","MillisecondsPerHalfHour","GameCyclesPerHalfHour","MillisecondsPerQuarterHour","GameCyclesPerQuarterHour","MillisecondsPerFiveMinutes","GameCyclesPerFiveMinutes","BaseFocusBonus","ClassDataStructuresBaseCost","ClassNetworksBaseCost","ClassAlgorithmsBaseCost","ClassManagementBaseCost","ClassLeadershipBaseCost","ClassGymBaseCost","ClassStudyComputerScienceBaseExp","ClassDataStructuresBaseExp","ClassNetworksBaseExp","ClassAlgorithmsBaseExp","ClassManagementBaseExp","ClassLeadershipBaseExp","CodingContractBaseFactionRepGain","CodingContractBaseCompanyRepGain","CodingContractBaseMoneyGain","AugmentationGraftingCostMult","AugmentationGraftingTimeBase","SoACostMult","SoARepMult","EntropyEffect","TotalNumBitNodes","InfiniteLoopLimit","Donations","LatestUpdate","ctor","constructors","fromJSON","validationData","validateObject","Generic_toJSON","ctorName","index","Generic_fromJSON","txt","html","AlertEvents","emit","dangerouslySetInnerHTML","__html","component","htmlLocation","useStyles","makeStyles","createStyles","root","margin","spacing","flexGrow","padding","minHeight","boxSizing","width","uninitialized","Router","isInitialized","page","allowRouting","toActiveScripts","toAugmentations","toBitVerse","toBladeburner","toStats","toCity","toCorporation","toCreateProgram","toDevMenu","toFaction","toFactions","toGameOptions","toGang","toHacknetNodes","toInfiltration","toJob","toMilestones","toGrafting","toScriptEditor","toSleeves","toStockMarket","toTerminal","toTravel","toTutorial","toWork","toBladeburnerCinematic","toLocation","toStaneksGift","toAchievements","toThemeBrowser","toImportSave","GameRoot","classes","files","vim","setEditorOptions","useState","setPage","RecoveryMode","Page","Recovery","currentWork","Work","setRerender","augPage","setAugPage","faction","setFaction","isFactionWork","Factions","factionName","Faction","flume","setFlume","quick","setQuick","setLocation","Infiltration","Location","Job","cinematicText","setCinematicText","errorBoundaryKey","setErrorBoundaryKey","sidebarOpened","setSideBarOpened","importString","setImportString","importAutomatic","setImportAutomatic","ImportSave","allowRoutingCalls","setAllowRoutingCalls","rerender","old","killAllScripts","runningScripts","saveObject","saveGame","reload","softReset","installAugmentations","useEffect","ITutorialEvents","subscribe","ActiveScripts","Augmentations","Bladeburner","Stats","Corporation","CreateProgram","DevMenu","Options","Gang","Hacknet","Milestones","Grafting","options","ScriptEditor","Sleeves","StockMarket","Tutorial","City","gotoLocation","TravelAgency","Travel","calculateAchievements","BitVerse","BladeburnerCinematic","StaneksGift","Achievements","ThemeBrowser","base64save","automatic","_functions","filter","startsWith","forEach","_wrap","scrollTo","mainPage","withSidebar","withPopups","bypassGame","staneksGift","getCurrentServer","workerScripts","reactivateTutorial","prestigeAugmentation","iTutorialStart","stockMarket","loc","export","onExport","exportGame","forceKill","exportGameFn","installAugmentationsFn","content","ITutorial","isRunning","killScripts","display","flexDirection","onToggled","isOpened","className","unbuyable","color","palette","action","disabled","colors","Money","props","forPurchase","canAfford","defaultMultipliers","AllServers","isValidIPAddress","GetServerByHostname","ipserver","GetServerByIP","servers","DeleteServer","serverkey","ipExists","hostName","createUniqueRandomIp","createRandomIp","AddToAllServers","renameServer","newName","initForeignServers","homeComputer","networkLayers","toNumber","getRandomInt","metadata","serverMetadata","serverParams","maxRamExponent","pow","literature","messages","SpecialServers","WorldDaemon","WorldDaemonDifficulty","networkLayer","linkNetworkLayers","network1","selectServer","server1","server2","serversOnNetwork","getRandomArrayItem","arr","prestigeAllServers","member","loadAllServers","saveAllServers","excludeRunningScripts","TempAllServers","runningScriptObj","showMilli","totalSeconds","days","secondPerHours","secTruncDays","hours","secondPerMinute","secTruncHours","minutes","secTruncMinutes","milliTruncSec","seconds","longestCommonStart","strings","containsAllStrings","A","concat","sort","a1","a2","L","a","charAt","b","toUpperCase","substring","isString","formatNumber","num","numFractionDigits","toLocaleString","maximumFractionDigits","minimumFractionDigits","generateRandomString","chars","cyrb53","seed","h1","h2","ch","charCodeAt","imul","loadFactions","getInfo","err","factionExists","initFactions","FactionInfos","resetFaction","newFactionObject","favor","AddToFactions","KEY","KEYCODE","SoftwareCompanyPositions","ITCompanyPositions","SecurityEngineerCompanyPositions","NetworkEngineerCompanyPositions","BusinessCompanyPositions","SecurityCompanyPositions","AgentCompanyPositions","MiscCompanyPositions","SoftwareConsultantCompanyPositions","BusinessConsultantCompanyPositions","PartTimeCompanyPositions","lower","upper","AllCorporationStates","CorporationConstants","INITIALSHARES","SHARESPERPRICEUPDATE","IssueNewSharesCooldown","SellSharesCooldown","CyclesPerMarketCycle","CyclesPerIndustryStateCycle","SecsPerMarketCycle","Cities","Aevum","Chongqing","Sector12","NewTokyo","Ishima","Volhaven","WarehouseInitialCost","WarehouseInitialSize","WarehouseUpgradeBaseCost","OfficeInitialCost","OfficeInitialSize","OfficeUpgradeBaseCost","BribeThreshold","BribeToRepRatio","ProductProductionCostRatio","DividendMaxRate","EmployeeSalaryMultiplier","CyclesPerEmployeeRaise","EmployeeRaiseAmount","BaseMaxProducts","AllMaterials","AllIndustryTypes","AllUnlocks","AllUpgrades","AllResearch","FundingRoundShares","FundingRoundMultiplier","ValuationLength","Augmentation","params","info","moneyCost","repCost","prereqs","baseRepRequirement","freeze","baseCost","isSpecial","hacking","strength","defense","dexterity","agility","charisma","hacking_exp","strength_exp","defense_exp","dexterity_exp","agility_exp","charisma_exp","hacking_chance","hacking_speed","hacking_money","hacking_grow","company_rep","faction_rep","crime_money","crime_success","work_money","hacknet_node_money","hacknet_node_purchase_cost","hacknet_node_ram_cost","hacknet_node_core_cost","hacknet_node_level_cost","bladeburner_max_stamina","bladeburner_stamina_gain","bladeburner_analysis","bladeburner_success_chance","stats","programs","startingMoney","f","decimals","desc","generateStatsDescription","addToFactions","factionList","augmentations","getCost","augmentationReference","StaticAugmentations","NeuroFluxGovernor","nextLevel","getLevel","multiplier","AugmentationRepCost","AugmentationMoneyCost","queuedAugmentations","getBaseAugmentationPriceMultiplier","ShadowsOfAnarchy","soaAugmentationNames","initSoAAugmentations","map","augmentation","soaAugCount","augmentationName","hasAugmentation","find","getGenericAugmentationPriceMultiplier","currLevel","level","addToAllFactions","fac","facObj","special","toJSON","modal","alignItems","justifyContent","paper","backgroundColor","background","default","border","primary","main","boxShadow","dark","maxWidth","maxHeight","overflow","scrollbarWidth","Modal","disableRestoreFocus","disableScrollLock","disableEnforceFocus","disableAutoFocus","open","onClose","closeAfterTransition","sx","in","children","HacknetNodeConstants","MoneyGainPerLevel","BaseCost","LevelBaseCost","RamBaseCost","CoreBaseCost","PurchaseNextMult","UpgradeLevelMult","UpgradeRamMult","UpgradeCoreMult","MaxLevel","MaxRam","MaxCores","PurchaseMultipliers","x1","x5","x10","MAX","HacknetServerConstants","HashesPerLevel","CacheBaseCost","PurchaseMult","UpgradeCacheMult","MaxServers","MaxCache","EmployeePositions","ActionTypes","Idle","Contract","Operation","BlackOp","BlackOperation","Training","Recruitment","FieldAnalysis","Diplomacy","iTutorialSteps","currStep","Start","stepIsDone","NSSelection","GoToCharacterPage","CharacterPage","CharacterGoToTerminalPage","TerminalIntro","TerminalHelp","TerminalLs","TerminalScan","TerminalScanAnalyze1","TerminalScanAnalyze2","TerminalConnect","TerminalAnalyze","TerminalNuke","TerminalManualHack","TerminalHackingMechanics","TerminalGoHome","TerminalCreateScript","TerminalTypeScript","TerminalFree","TerminalRunScript","TerminalGoToActiveScriptsPage","ActiveScriptsPage","ActiveScriptsToTerminal","TerminalTailScript","GoToHacknetNodesPage","HacknetNodesIntroduction","HacknetNodesGoToWorldPage","WorldDescription","TutorialPageInfo","End","iTutorialNextStep","iTutorialEnd","iTutorialPrevStep","getHomeComputer","handbook","LiteratureNames","HackersStartingHandbook","BaseServer","super","createRandomString","ServerStartingMoney","ServerMaxMoney","realDifficulty","ServerStartingSecurity","capDifficulty","changeMinimumSecurity","perc","changeMaximumMoney","aboveCap","amt","weaken","ServerWeakenRate","Context","React","createContext","Division","useCorporation","useContext","useDivision","Industries","Energy","Utilities","Agriculture","Fishing","Mining","Food","Tobacco","Chemical","Pharmaceutical","Computer","Robotics","Software","Healthcare","RealEstate","IndustryStartingCosts","IndustryDescriptions","corp","IndustryResearchTrees","getBaseResearchTreeCopy","getProductIndustryResearchTreeCopy","resetIndustryResearchTrees","LocationType","Programs","initPrograms","programsMetadata","Program","run","ClassType","Classes","StudyComputerScience","youAreCurrently","earnings","newWorkStats","hackExp","intExp","DataStructures","Networks","Algorithms","Management","chaExp","Leadership","GymStrength","strExp","GymDefense","defExp","GymDexterity","dexExp","GymAgility","agiExp","isClassWork","w","WorkType","CLASS","ClassWork","singularity","classType","Sector12RothmanUniversity","isGym","getClass","calculateRates","calculateClassEarningsRate","process","cycles","cyclesWorked","rate","applyWorkStats","sumWorkStats","finish","APICopy","hasHacknetServers","purchaseHacknet","numOwned","hacknetNodes","cost","getCostOfNextHacknetServer","loseMoney","createHacknetServer","updateHashManagerCapacity","getCostOfNextHacknetNode","node","HacknetNode","hasMaxNumberHacknetServers","calculateNodeCost","calculateServerCost","getMaxNumberLevelUpgrades","nodeObj","maxLevel","calculateLevelUpgradeCost","levelsToMax","curr","getMaxNumberRamUpgrades","calculateRamUpgradeCost","log2","ram","getMaxNumberCoreUpgrades","calculateCoreUpgradeCost","cores","getMaxNumberCacheUpgrades","calculateCacheUpgradeCost","cache","purchaseLevelUpgrade","levels","sanitizedLevels","isServer","upgradeLevel","purchaseRamUpgrade","upgradeRam","purchaseCoreUpgrade","upgradeCore","purchaseCacheUpgrade","upgradeCache","processHacknetEarnings","numCycles","hashManager","HashManager","hashes","hserver","updateHashRate","h","wastedHashes","storeHashes","upgrade","HashUpgrades","processAllHacknetServerEarnings","total","processSingleHacknetNodeEarnings","processAllHacknetNodeEarnings","totalEarnings","nodes","updateCapacity","hashCapacity","purchaseHashUpgrade","upgName","upgTarget","count","upg","corporation","refundUpgrade","funds","target","division","divisions","sciResearch","qty","bladeburner","changeRank","skillPoints","generateRandomContract","NewIndustry","industry","Industry","NewCity","offices","OfficeSpace","size","UnlockUpgrade","price","unlockUpgrades","unlock","LevelUpgrade","basePrice","priceMult","upgrades","IssueDividends","dividendRate","SellMaterial","mat","temp","bCost","eval","sCost","q","tempQty","maxsll","prd","sllman","SellProduct","product","all","cities","tempCity","SetSmartSupply","warehouse","smartSupply","smartSupplyEnabled","SetSmartSupplyUseLeftovers","material","useLeftover","smartSupplyUseLeftovers","BuyMaterial","buy","BulkPurchase","matSize","MaterialSizes","maxAmount","sizeUsed","SellShares","numShares","public","shareSaleCooldown","stockSaleResults","calculateShareSale","profit","newSharePrice","newSharesUntilUpdate","issuedShares","sharePrice","shareSalesUntilPriceUpdate","BuyBackShares","buybackPrice","AssignJob","office","employeeName","job","employee","employees","checkEnum","assignSingleJob","AutoAssignJob","autoAssignJob","UpgradeOfficeSize","initialPriceMult","mult","BuyCoffee","getCoffeeCost","setCoffee","ThrowParty","costPerEmployee","setParty","PurchaseWarehouse","warehouses","Warehouse","UpgradeWarehouseCost","from","reduce","acc","UpgradeWarehouse","sizeUpgradeCost","updateSize","HireAdVert","getAdVertCost","applyAdVert","MakeProduct","productName","designInvest","marketingInvest","makesProducts","maxProducts","hasResearch","products","Product","trim","createCity","designCost","advCost","Research","researchName","researchTree","getAllNodes","research","ResearchMap","researched","ExportMaterial","divisionName","cityName","sanitizedAmt","isRelevantMaterial","exportObj","ind","exp","CancelExportMaterial","LimitProductProduction","prdman","LimitMaterialProduction","SetMaterialMarketTA1","on","marketTa1","SetMaterialMarketTA2","marketTa2","SetProductMarketTA1","SetProductMarketTA2","BlackOperationNames","BladeburnerConstants","CityNames","CyclesPerSecond","StaminaGainPerSecond","BaseStaminaLoss","MaxStaminaToGainFactor","DifficultyToTimeFactor","DiffMultExponentialFactor","DiffMultLinearFactor","EffAgiLinearFactor","EffDexLinearFactor","EffAgiExponentialFactor","EffDexExponentialFactor","BaseRecruitmentTimeNeeded","PopulationThreshold","PopulationExponent","ChaosThreshold","BaseStatGain","BaseIntGain","ActionCountGrowthPeriod","RankToFactionRepFactor","RankNeededForFaction","ContractSuccessesPerLevel","OperationSuccessesPerLevel","RanksPerSkillPoint","ContractBaseMoneyGain","HrcHpGain","HrcStaminaGain","FragmentType","Effect","tpe","HackingChance","HackingSpeed","HackingMoney","HackingGrow","Hacking","Strength","Defense","Dexterity","Agility","Charisma","HacknetMoney","HacknetCost","Rep","WorkMoney","Crime","StatsRow","cellNone","style","align","PositionTypes","borderBottom","small","TableCell","Table","removeLeadingSlash","removeTrailingSlash","endsWith","isValidFilename","isValidDirectoryName","isValidDirectoryPath","path","t_path","dirs","dir","isValidFilePath","fnSeparator","getFirstParentDirectory","getAllParentDirectories","lastSlash","getDestinationFilepath","destination","source","cwd","dstDir","evaluateDirectoryPath","fileName","getFileName","isInRootDirectory","currPath","reconstructedPath","pop","evaluateFilePath","areFilesEqual","f0","f1","areImportsEquals","Companies","initCompanies","oldCompanies","companiesMetadata","Company","companyName","company","loadCompanies","AllGangs","SlumSnakes","power","Tetrads","TheSyndicate","TheDarkArmy","SpeakersForTheDead","NiteSec","TheBlackHand","resetGangs","loadAllGangs","ToastVariant","snackbar","zIndex","logBoxBaseZIndex","alignSelf","SnackbarProvider","dense","maxSnack","anchorOrigin","horizontal","vertical","autoHideDuration","containerRoot","SnackbarEvents","EventEmitter","Snackbar","enqueueSnackbar","closeSnackbar","useSnackbar","variant","duration","id","severity","k","onClick","Crimes","Shoplift","CrimeType","SHOPLIFT","dexterity_success_weight","agility_success_weight","RobStore","ROB_STORE","hacking_success_weight","intelligence_exp","Mug","MUG","strength_success_weight","defense_success_weight","Larceny","LARCENY","DealDrugs","DRUGS","charisma_success_weight","BondForgery","BOND_FORGERY","TraffickArms","TRAFFIC_ARMS","Homicide","HOMICIDE","kills","GrandTheftAuto","GRAND_THEFT_AUTO","Kidnap","KIDNAP","Assassination","ASSASSINATION","Heist","HEIST","reputation","w0","w1","scaleWorkStats","scaleMoney","workStats","expStats","applyWorkStatsExp","gains","gainStrengthExp","gainDefenseExp","gainDexterityExp","gainAgilityExp","gainCharismaExp","trusted","event","isTrusted","Home","FulcrumSecretTechnologies","CyberSecServer","NiteSecServer","TheBlackHandServer","BitRunnersServer","TheDarkArmyServer","DaedalusServer","DarkWeb","init","t_homeComp","safelyCreateUniqueServer","adminRights","currentServer","NukeProgram","skills","purchasedServers","factionInvitations","numSleeves","sleevesFromCovenant","sleeves","Sleeve","sleeve","shock","synchronize","shockRecovery","lastUpdate","Date","getTime","moneySourceA","reset","prestige","reapplyAllAugmentations","current","finishWork","prestigeSourceFile","karma","sync","hasWseAccount","hasTixApiAccess","has4SData","has4SDataTixApi","moneySourceB","receiveInvite","calculateSkillProgress","calculateSkillProgressF","hasProgram","programName","home","toLowerCase","setMoney","recordMoneySource","MoneySourceTracker","record","startFocusing","focus","stopFocusing","takeDamage","hospitalize","getHospitalizationCost","SUCCESS","applyForJob","entryPosType","sing","pos","isQualified","getJobRequirementText","hasPosition","nextPos","getNextCompanyPositionHelper","reqText","getNextCompanyPosition","currCompany","currentPositionName","currentPosition","CompanyPositions","isSoftwareJob","isITJob","isBusinessJob","isSecurityEngineerJob","isNetworkEngineerJob","isSecurityJob","isAgentJob","isSoftwareConsultantJob","isBusinessConsultantJob","isPartTimeJob","quitJob","isCompanyWork","isSleeveCompanyWork","stopWork","hasJob","Boolean","applyForSoftwareJob","posNames","applyForSoftwareConsultantJob","applyForItJob","applyForSecurityEngineerJob","applyForNetworkEngineerJob","applyForBusinessJob","applyForBusinessConsultantJob","applyForSecurityJob","applyForAgentJob","applyForEmployeeJob","position","applyForPartTimeEmployeeJob","applyForWaiterJob","applyForPartTimeWaiterJob","offset","jobStatReqOffset","reqHacking","requiredHacking","reqStrength","requiredStrength","reqDefense","requiredDefense","reqDexterity","requiredDexterity","reqAgility","reqCharisma","requiredCharisma","playerReputation","requiredReputation","resetMultipliers","playerAug","applyAugmentation","updateSkillLevels","reapplyAllSourceFiles","sourceFiles","srcFileKey","SourceFiles","applySourceFile","applyExploit","checkForFactionInvitations","invitedFactions","numAugmentations","allCompanies","allPositions","checkMegacorpRequirements","serverMeta","specialName","bonus","getCompanyRep","illuminatiFac","Illuminati","isBanned","isMember","alreadyInvited","daedalusFac","Daedalus","DaedalusAugsRequirement","covenantFac","TheCovenant","ecorpFac","ECorp","AevumECorp","megacorpFac","MegaCorp","Sector12MegaCorp","bachmanandassociatesFac","BachmanAssociates","AevumBachmanAndAssociates","bladeindustriesFac","BladeIndustries","Sector12BladeIndustries","nwoFac","NWO","VolhavenNWO","clarkeincorporatedFac","ClarkeIncorporated","AevumClarkeIncorporated","omnitekincorporatedFac","OmniTekIncorporated","VolhavenOmniTekIncorporated","foursigmaFac","FourSigma","Sector12FourSigma","kuaigonginternationalFac","KuaiGongInternational","ChongqingKuaiGongInternational","fulcrumsecrettechonologiesFac","fulcrumSecretServer","AevumFulcrumTechnologies","bitrunnersFac","BitRunners","bitrunnersServer","theblackhandFac","blackhandServer","nitesecFac","nitesecServer","chongqingFac","sector12Fac","newtokyoFac","aevumFac","ishimaFac","volhavenFac","speakersforthedeadFac","Sector12CIA","Sector12NSA","thedarkarmyFac","thesyndicateFac","silhouetteFac","Silhouette","tetradsFac","slumsnakesFac","netburnersFac","Netburners","totalHacknetRam","totalHacknetCores","totalHacknetLevels","tiandihuiFac","TianDiHui","cybersecFac","CyberSec","cybersecServer","setBitNodeNumber","queueAugmentation","aug","PlayerOwnedAugmentation","gainCodingContractReward","reward","difficulty","CodingContractRewardType","FactionReputation","FactionReputationAll","repGain","totalGain","specialFactions","Bladeburners","gainPerFaction","facName","CompanyReputation","moneyGain","CodingContractMoney","travel","to","Locations","canAccessGrafting","giveExploit","exploit","giveAchievement","achievementId","achievement","achievements","ID","unlockedOn","Name","getCasinoWinnings","casino","canAccessCotMG","sf","lvl","focusPenalty","NeuroreceptorManager","updateHashCapacity","costMult","onlineTimeSeconds","hashRate","totalHashesGenerated","prodMult","runScript","updateRamUsed","calculateHashGainRate","validScriptExtensions","isScriptFilename","some","ext","Orders","storedCycles","ticksUntilCycle","SymbolToStockMap","placeOrder","shares","Stock","order","Order","symbol","orders","stk","processOrderRefs","symbolToStockMap","processOrders","cancelOrder","stockOrders","stockSymbol","orderTxt","loadStockMarket","deleteStockMarket","initStockMarket","InitStockMetadata","TicksPerCycle","initSymbolToStockMap","StockSymbols","cyclesPerStockUpdate","processStockPrices","timeNow","flipForecastForecast","stockMarketCycle","av","mv","chc","otlkMag","cap","changePrice","OrderTypes","LimitBuy","Short","LimitSell","Long","StopBuy","StopSell","otlkMagChange","cycleForecast","cycleForecastForecast","shareTxUntilMovement","shareTxForMovement","initStockMarketFn","applySleeveGains","rawStats","shockedStats","shockBonus","syncStats","syncBonus","person","difficultyMult","skillMult","chance","calculateIntelligenceBonus","intelligence","expGain","HackExpGain","percentMoneyHacked","ScriptHackMoney","skillFactor","calculateGrowTime","calculateWeakenTime","inviteToFaction","InvitationEvent","joinFaction","allFactions","factionInfo","enemy","enemies","hasAugmentationPrereqs","purchaseAugmentation","hasPrereqs","augCosts","queuedAugmentation","req","processPassiveFactionRepGain","offersWork","getGangName","favorMult","hRep","getHackingWorkRepGain","sRep","getFactionSecurityWorkRepGain","fRep","getFactionFieldWorkRepGain","FactionPassiveRepGain","getFactionAugmentationsFiltered","hasGangWith","augs","CongruityImplant","TheRedPill","rng","SFC32RNG","uniqueFilter","GangUniqueAugs","BitburnerSaveObject","getSaveString","PlayerSave","AllServersSave","CompaniesSave","FactionsSave","AliasesSave","Aliases","GlobalAliasesSave","GlobalAliases","StockMarketSave","SettingsSave","VersionSave","LastExportBonus","ExportBonus","StaneksGiftSave","AllGangsSave","btoa","unescape","encodeURIComponent","emitToastEvent","savedOn","lastSave","saveData","playerIdentifier","identifier","getSaveFileName","pushGameSaved","INFO","catch","isRecovery","epochTime","now","bn","download","importGame","base64Save","getImportStringFromFile","file","reader","FileReader","promise","onload","readAsText","newSave","parsedSave","atob","base64","importedPlayer","playerData","bitNode","bitNodeLevel","loadGame","navigator","userAgent","setInterval","decodeURIComponent","escape","saveObj","loadStaneksGift","loadAliases","loadGlobalAliases","ver","anyPlayer","companyPosition","positionName","companyPositions","changes","convert","code","change","v1APIBreak","AwardNFG","revenue","expenses","lastCycleRevenue","lastCycleExpenses","thisCycleRevenue","thisCycleExpenses","Sector12JoesGuns","resleeves","contract","contracts","v22PlayerBreak","ownedNFGs","newNFG","nfg","darkweb","pushProgram","graft","v2APIBreak","removePlayerFields","removeSleeveFields","field","anySleeve","evaluateVersionCompatibility","href","createNewUpdateText","Blob","document","createElement","URL","createObjectURL","body","appendChild","click","removeChild","revokeObjectURL","predefined","getPredefinedThemes","zeros","height","array","fill","calculateGrid","gift","newgrid","fragmentAt","IshimaStormTechnologies","NewTokyoDefComm","VolhavenHeliosLabs","NewTokyoVitaLife","Sector12IcarusMicrosystems","Sector12UniversalEnergy","AevumAeroCorp","VolhavenOmniaCybersystems","ChongqingSolarisSpaceSystems","NewTokyoGlobalPharmaceuticals","IshimaNovaMedical","AevumWatchdogSecurity","VolhavenLexoCorp","AevumRhoConstruction","Sector12AlphaEnterprises","VolhavenSysCoreSecurities","VolhavenCompuTek","AevumNetLinkTechnologies","IshimaOmegaSoftware","Sector12FoodNStuff","companyPositionMetadata","CompanyPosition","FactionWorkType","Exploit","names","Bypass","EditSaveFile","PrototypeTampering","TimeCompression","Unclickable","UndocumentedFunctionCall","RealityAlteration","N00dles","YoureNotMeantToAccessThis","TrueRecursion","INeedARainbow","ExploitName","Set","initAugmentations","resetFactionAugmentations","clearObject","initNeuroFluxGovernor","initUnstableCircadianModulator","initGeneralAugmentations","initBladeburnerAugmentations","ChurchOfTheMachineGod","initChurchOfTheMachineGodAugmentations","resetAugmentation","augmentationExists","AddToStaticAugmentations","reapply","staticAugmentation","mergeMultipliers","applyEntropy","ownedNfg","pAug","ownedAug","force","augmentationList","nfgIndex","isRepeatableAug","MoneyRate","CodingContractType","gen","solver","diff","numTries","generate","CodingContractTypes","md","codingContractTypesMetadata","CodingContractResult","CodingContract","getData","getDescription","getDifficulty","getMaxNumTries","getType","isSolution","solution","Cancelled","onAttempt","Success","Failure","CodingContractEvent","Fragments","Fragment","shape","limit","fullAt","rotation","sy","mx","my","qx","qy","neighbors","candidates","add","coord","cells","candidate","cell","copy","FragmentById","fragment","_","X","Shapes","S","Z","T","I","J","O","Booster","NoneFragment","None","DeleteFragment","Delete","uuidv4","uuid","subscribers","sub","base","inherit","common","accent","bg","fg","syntax","tag","entity","regexp","markup","keyword","comment","constant","ui","panel","selected","selection","colorRegExp","sanitizeTheme","repairBlock","block","makeTheme","themeRules","token","foreground","themeColors","fromEntries","rules","async","loadThemes","monaco","editor","defineTheme","fontStyle","Adjuster","setValue","label","placeholder","subtract","tons","onChange","InputProps","startAdornment","title","transform","endAdornment","OptionSwitch","checked","text","tooltip","control","upArrowSymbol","downArrowSymbol","leftArrowSymbol","rightArrowSymbol","getArrow","UP_ARROW","W","LEFT_ARROW","DOWN_ARROW","RIGHT_ARROW","D","getInverseArrow","getActionTimePenalty","getChaosCompetencePenalty","getChaosDifficultyBonus","makeNode","Node","createBaseResearchTreeNodes","rootNode","autoBrew","autoParty","autoDrugs","bulkPurchasing","cph4","drones","dronesAssembly","dronesTransport","goJuice","hrRecruitment","hrTraining","joywire","marketta1","marketta2","overclock","scAssemblers","stimu","addChild","baseResearchTree","ResearchTree","setRoot","upgradeFulcrum","upgradeCapacity1","upgradeCapacity2","upgradeDashboard","numCycleForGrowth","growth","ajdGrowthRate","serverGrowthPercentage","coreBonus","ServerGrowthRate","numCycleForGrowthCorrected","targetMoney","startMoney","adjGrowthRate","exponentialBase","coreMultiplier","threadMultiplier","ey","bt","corr","bct","opc","fca","cca","processSingleServerGrowth","calculateServerGrowth","oldMoneyAvailable","isValidNumber","usedCycles","prestigeHomeComputer","homeComp","hasBitflume","BitFlume","updateRamUsage","getServerOnNetwork","isBackdoorInstalled","MoneyCost","SkillNames","BladesIntuition","Cloak","Marksman","WeaponProficiency","ShortCircuit","DigitalObserver","Tracer","Overclock","Reaper","EvasiveSystem","Datamancer","CybersEdge","HandsOfMidas","Hyperdrive","rep","Reputation","useGang","BitNode","BitNodes","initBitNodes","HackingLevelMultiplier","StrengthLevelMultiplier","DefenseLevelMultiplier","DexterityLevelMultiplier","AgilityLevelMultiplier","CharismaLevelMultiplier","HomeComputerRamCost","PurchasedServerCost","PurchasedServerSoftcap","CompanyWorkMoney","CrimeMoney","HacknetNodeMoney","ClassGymExpGain","CompanyWorkExpGain","CrimeExpGain","FactionWorkExpGain","FactionWorkRepGain","RepToDonateToFaction","InfiltrationMoney","InfiltrationRep","FourSigmaMarketDataCost","FourSigmaMarketDataApiCost","CorporationValuation","CorporationSoftcap","BladeburnerRank","BladeburnerSkillCost","GangSoftcap","StaneksGiftPowerMultiplier","StaneksGiftExtraSize","getBitNodeMultipliers","inc","dec","initBitNodeMultipliers","defaultConstructorParams","initPrice","marketCap","spreadPerc","range","divisor","lastPrice","playerShares","playerAvgPx","playerShortShares","playerAvgShortPx","otlkMagForecast","getAbsoluteForecast","totalSharesUnrounded","totalShares","maxShares","changeForecastForecast","newff","newPrice","changeAmt","increaseChance","getForecastIncreaseChance","getAskPrice","getBidPrice","influenceForecast","influenceForecastForecast","startingLevel","extraLevels","totalMultiplier","startingRam","totalCost","numUpgrades","currentRam","startingCores","currentCores","startingCache","currentCache","killWorkerScript","stopAndCleanUpWorkerScript","killWorkerScriptByPid","clearTimeout","atExit","rs","delete","AddRecentScript","WorkerScriptStartStopEventEmitter","removeWorkerScript","printAliases","print","parseAliasDeclaration","global","matches","addGlobalAlias","addAlias","getAlias","getGlobalAlias","removeAlias","substituteAliases","origCommand","commandArray","somethingSubstituted","depth","alias","constructLocation","asciiArt","LocationsMetadata","addLocation","layerCounter","LogBoxEvents","LogBoxCloserEvents","LogBoxClearEvents","LogBoxPositionEvents","LogBoxSizeEvents","LogBoxManager","closePid","LogWindow","close","overflowY","overflowX","whiteSpace","wordWrap","titleButton","draggableRef","useRef","rootRef","setScript","container","setSize","minimized","setMinimized","setPosition","state","kill","startWorkerScript","updateLayer","full","maxLength","minimize","innerWidth","innerHeight","clearInterval","addEventListener","onWindowResize","removeEventListener","debounce","isOnScreen","bounds","getBoundingClientRect","right","bottom","left","top","outerWidth","minConstraints","handle","onDrag","MouseEvent","clientX","clientY","ref","onMouseDown","flexFlow","minWidth","welllight","onResize","cursor","fontSize","marginRight","textOverflow","has","onTouchEnd","Literature","CopyableText","setOpen","copyText","select","setSelectionRange","execCommand","ThemeEvents","refreshTheme","createTheme","combat","cha","int","backgroundprimary","backgroundsecondary","button","successlight","success","successdark","white","black","light","primarylight","primarydark","secondary","secondarylight","secondarydark","errorlight","errordark","infolight","infodark","warning","warninglight","warningdark","well","typography","fontFamily","textTransform","components","MuiInputBase","styleOverrides","input","userSelect","MuiInput","borderBottomColor","underline","MuiInputLabel","MuiButtonGroup","MuiButton","borderRadius","MuiSelect","icon","defaultProps","MuiTextField","MuiTypography","lineHeight","MuiMenu","list","MuiMenuItem","MuiAccordionSummary","MuiAccordionDetails","MuiIconButton","MuiTooltip","disableInteractive","MuiSlider","valueLabel","MuiDrawer","paperAnchorDockedLeft","borderRight","MuiDivider","MuiFormControlLabel","MuiSwitch","switchBase","track","MuiPaper","MuiTablePagination","selectLabel","displayedRows","MuiTab","textColorPrimary","MuiTabs","scrollButtons","opacity","TabIndicatorProps","MuiAlert","standardSuccess","standardError","standardWarning","standardInfo","TTheme","injectFirst","Map","Water","Plants","Metal","Hardware","Chemicals","Drugs","Robots","AICores","calculateSkill","calculateExp","skill","currentSkill","nextSkill","baseExperience","nextExperience","progress","currentExperience","remainingExperience","experience","UpgradeType","gangMemberUpgradesMetadata","def","upgType","Weapon","dex","agi","Armor","Vehicle","Rootkit","GangConstants","GangRespectToReputationRatio","MaximumGangMembers","CyclesPerTerritoryAndPowerUpdate","AscensionMultiplierRatio","Names","GangKarmaRequirement","prestigeWorkerScripts","clear","startNetscript2Script","getScript","loadedModule","compile","vars","startNetscript1Script","errorToThrow","codeWithImports","codeLineOffset","interpreter","importProcessingRes","ast","ecmaVersion","allowReserved","sourceType","generatedCode","hasImports","walksimple","ImportDeclaration","scriptName","scriptAst","specifiers","namespace","local","fnNames","fnDeclarations","FunctionDeclaration","fnsToImport","lineOffset","linesRemoved","processNetscript1Imports","Interpreter","wrapNS1Layer","intLayer","nsLayer","entry","wrapper","callback","pseudoToNative","nativeToPseudo","setProperty","createAsyncFunction","properties","more","step","parent","createAndAddWorkerScript","oneRamUsage","getRamUsageFromRunningScript","roundToTwo","generateNextPid","NetscriptFunctions","updateOnlineScriptTimes","loadAllRunningScripts","skipScriptLoad","markUpdated","scriptCalculateOfflineProduction","runScriptFromScript","ramAvailable","RunningScript","m0","m1","scaleMultipliers","getPurchaseServerCost","sanitizedRam","isPowerOfTwo","sign","getPurchaseServerMaxRam","getPurchasedServerUpgradeCost","upgradePurchasedServer","renamePurchasedServer","next","getPurchaseServerLimit","clz32","purchaseServer","newServ","purchaseRamForHomeComputer","getUpgradeHomeRamCost","buyStock","opts","suppressDialog","totalPrice","getBuyTransactionCost","origTotal","newTotal","processTransactionForecastMovement","rerenderFn","resultTxt","sellStock","getSellTransactionGain","netProfit","shortStock","sellShort","origCost","win","reachedLimit","reached","calculateWantedPenalty","calculateRespectGain","task","baseRespect","statWeight","strWeight","defWeight","dexWeight","agiWeight","chaWeight","territoryMult","territoryPenalty","respectMult","calculateWantedLevelGain","baseWanted","wanted","calc","calculateMoneyGain","baseMoney","calculateAscensionPointsGain","calculateAscensionMult","points","RFAMessage","method","isFileData","pf","isFileLocation","isFileServer","GameTimer","setV","totalMillis","ignoreAugment_WKSharmonizer","WKSharmonizer","millis","intervalId","onExpire","noPaper","mb","DarkWebItems","initDarkWebItems","BruteSSHProgram","DarkWebItem","FTPCrackProgram","RelaySMTPProgram","HTTPWormProgram","SQLInjectProgram","ServerProfiler","DeepscanV1","DeepscanV2","AutolinkProgram","AutoLink","FormulasProgram","Formulas","calculateMoneyGainRate","startingCore","sanitizedCores","coreBaseCost","interpolate","settings","lerpD","lerp","Trivial","Normal","Hard","Impossible","KeyHandler","press","onKeyDown","FACTION","FactionWork","factionWorkType","HACKING","getFaction","getReputationRate","focusBonus","calculateFactionRep","getExpRates","calculateFactionExp","Hashes","updateMoneyGainRate","gain","moneyGainRatePerSecond","totalMoneyGenerated","minMax","CalculateShareMult","TextFile","append","read","show","write","getTextFile","textFiles","createTextFile","Skills","Skill","costInc","successChanceAll","successChanceStealth","successChanceKill","successChanceOperation","successChanceContract","maxLvl","actionTime","effStr","effDef","effDex","effAgi","successChanceEstimate","stamina","GangMemberUpgrades","GangMemberUpgrade","RamCostConstants","ScriptBaseRamCost","ScriptDomRamCost","ScriptCorporationRamCost","ScriptHackRamCost","ScriptHackAnalyzeRamCost","ScriptGrowRamCost","ScriptGrowthAnalyzeRamCost","ScriptWeakenRamCost","ScriptWeakenAnalyzeRamCost","ScriptScanRamCost","ScriptRecentScriptsRamCost","ScriptPortProgramRamCost","ScriptRunRamCost","ScriptExecRamCost","ScriptSpawnRamCost","ScriptScpRamCost","ScriptKillRamCost","ScriptHasRootAccessRamCost","ScriptGetHostnameRamCost","ScriptGetHackingLevelRamCost","ScriptGetMultipliersRamCost","ScriptGetServerRamCost","ScriptGetServerMaxRam","ScriptGetServerUsedRam","ScriptFileExistsRamCost","ScriptIsRunningRamCost","ScriptHacknetNodesRamCost","ScriptHNUpgLevelRamCost","ScriptHNUpgRamRamCost","ScriptHNUpgCoreRamCost","ScriptGetStockRamCost","ScriptBuySellStockRamCost","ScriptGetPurchaseServerRamCost","ScriptPurchaseServerRamCost","ScriptGetPurchasedServerLimit","ScriptGetPurchasedServerMaxRam","ScriptRoundRamCost","ScriptReadWriteRamCost","ScriptArbScriptRamCost","ScriptGetScriptRamCost","ScriptGetRunningScriptRamCost","ScriptGetHackTimeRamCost","ScriptGetFavorToDonate","ScriptCodingContractBaseRamCost","ScriptSleeveBaseRamCost","ScriptClearTerminalCost","ScriptGetMoneySourcesCost","ScriptSingularityFn1RamCost","ScriptSingularityFn2RamCost","ScriptSingularityFn3RamCost","ScriptGangApiBaseRamCost","ScriptBladeburnerApiBaseRamCost","ScriptStanekWidth","ScriptStanekHeight","ScriptStanekCharge","ScriptStanekFragmentDefinitions","ScriptStanekPlacedFragments","ScriptStanekClear","ScriptStanekCanPlace","ScriptStanekPlace","ScriptStanekFragmentAt","ScriptStanekDeleteAt","ScriptInfiltrationCalculateDifficulty","ScriptInfiltrationCalculateRewards","ScriptInfiltrationGetLocations","ScriptInfiltrationGetInfiltrations","ScriptStanekAcceptGift","SF4Cost","sf4","RamCosts","getMaterialNames","getIndustryTypes","getUnlockables","getUpgradeNames","getResearchNames","createCorporation","hasUnlockUpgrade","getUnlockUpgradeCost","getUpgradeLevel","getUpgradeLevelCost","getExpandIndustryCost","getExpandCityCost","getInvestmentOffer","acceptInvestmentOffer","goPublic","bribe","getCorporation","getDivision","expandIndustry","expandCity","unlockUpgrade","levelUpgrade","issueDividends","buyBackShares","sellShares","getBonusTime","sellMaterial","sellProduct","discontinueProduct","setSmartSupply","setSmartSupplyUseLeftovers","buyMaterial","bulkPurchase","getWarehouse","getProduct","getMaterial","setMaterialMarketTA1","setMaterialMarketTA2","setProductMarketTA1","setProductMarketTA2","exportMaterial","cancelExportMaterial","purchaseWarehouse","upgradeWarehouse","makeProduct","limitMaterialProduction","limitProductProduction","getPurchaseWarehouseCost","getUpgradeWarehouseCost","hasWarehouse","assignJob","hireEmployee","upgradeOfficeSize","throwParty","buyCoffee","hireAdVert","getOffice","getEmployee","getHireAdVertCost","getHireAdVertCount","getResearchCost","hasResearched","setAutoJobAssignment","getOfficeSizeUpgradeCost","hacknet","numNodes","purchaseNode","getPurchaseNodeCost","getNodeStats","getLevelUpgradeCost","getRamUpgradeCost","getCoreUpgradeCost","getCacheUpgradeCost","numHashes","hashCost","spendHashes","maxNumNodes","getHashUpgrades","getHashUpgradeLevel","getStudyMult","getTrainingMult","hasWSEAccount","hasTIXAPIAccess","has4SDataTIXAPI","getSymbols","getPrice","getPosition","getMaxShares","getPurchaseCost","getSaleGain","buyShort","getOrders","getVolatility","getForecast","purchase4SMarketData","purchase4SMarketDataTixApi","purchaseWseAccount","purchaseTixApi","universityCourse","gymWorkout","travelToCity","goToLocation","purchaseTor","purchaseProgram","connect","manualHack","installBackdoor","getDarkwebProgramCost","getDarkwebPrograms","isBusy","stopAction","upgradeHomeRam","upgradeHomeCores","getUpgradeHomeCoresCost","workForCompany","applyToCompany","getCompanyFavor","getCompanyFavorGain","checkFactionInvitations","workForFaction","getFactionRep","getFactionFavor","getFactionFavorGain","donateToFaction","createProgram","commitCrime","getCrimeChance","getCrimeStats","getOwnedAugmentations","getOwnedSourceFiles","getAugmentationsFromFaction","getAugmentationCost","getAugmentationPrereq","getAugmentationPrice","getAugmentationBasePrice","getAugmentationRepReq","getAugmentationStats","isFocused","setFocus","exportGameBonus","b1tflum3","destroyW0r1dD43m0n","getCurrentWork","createGang","inGang","getMemberNames","getGangInformation","getOtherGangInformation","getMemberInformation","canRecruitMember","recruitMember","getTaskNames","getTaskStats","setMemberTask","getEquipmentNames","getEquipmentCost","getEquipmentType","getEquipmentStats","purchaseEquipment","ascendMember","getAscensionResult","setTerritoryWarfare","getChanceToWinClash","getContractNames","getOperationNames","getBlackOpNames","getBlackOpRank","getGeneralActionNames","getSkillNames","startAction","stopBladeburnerAction","getCurrentAction","getActionTime","getActionCurrentTime","getActionEstimatedSuccessChance","getActionRepGain","getActionCountRemaining","getActionMaxLevel","getActionCurrentLevel","getActionAutolevel","setActionAutolevel","setActionLevel","getRank","getSkillPoints","getSkillLevel","getSkillUpgradeCost","upgradeSkill","getTeamSize","setTeamSize","getCityEstimatedPopulation","getCityCommunities","getCityChaos","getCity","switchCity","getStamina","joinBladeburnerFaction","joinBladeburnerDivision","infiltration","getPossibleLocations","getInfiltration","codingcontract","attempt","getContractType","getNumTriesRemaining","createDummyContract","getContractTypes","getNumSleeves","setToShockRecovery","setToSynchronize","setToCommitCrime","setToUniversityCourse","setToCompanyWork","setToFactionWork","setToGymWorkout","getSleeveStats","getTask","getInformation","getSleeveAugmentations","getSleevePurchasableAugs","purchaseSleeveAug","setToBladeburnerAction","getSleeveAugmentationPrice","getSleeveAugmentationRepReq","stanek","giftWidth","giftHeight","chargeFragment","fragmentDefinitions","activeFragments","clearGift","canPlaceFragment","placeFragment","getFragment","removeFragment","acceptGift","getTheme","setTheme","resetTheme","getStyles","setStyles","resetStyles","getGameInfo","clearTerminal","windowSize","grafting","getAugmentationGraftPrice","getAugmentationGraftTime","getGraftableAugmentations","graftAugmentation","sprintf","vsprintf","scan","hackAnalyzeThreads","hackAnalyze","hackAnalyzeSecurity","hackAnalyzeChance","sleep","asleep","share","getSharePower","grow","growthAnalyze","growthAnalyzeSecurity","weakenAnalyze","printf","tprint","tprintf","clearLog","disableLog","enableLog","isLogEnabled","getScriptLogs","nuke","brutessh","ftpcrack","relaysmtp","httpworm","sqlinject","exec","spawn","killall","exit","scp","ls","ps","getRecentScripts","hasRootAccess","getHostname","getHackingLevel","getHackingMultipliers","getHacknetMultipliers","getServerMoneyAvailable","getServerSecurityLevel","getServerBaseSecurityLevel","getServerMinSecurityLevel","getServerRequiredHackingLevel","getServerMaxMoney","getServerGrowth","getServerNumPortsRequired","getServerRam","getServerMaxRam","getServerUsedRam","serverExists","fileExists","getPurchasedServerLimit","getPurchasedServerMaxRam","getPurchasedServerCost","deleteServer","getPurchasedServers","tryWritePort","peek","writePort","readPort","getPortHandle","rm","scriptRunning","scriptKill","getScriptName","getScriptRam","getHackTime","getGrowTime","getWeakenTime","getTotalScriptIncome","getScriptIncome","getTotalScriptExpGain","getScriptExpGain","nFormat","tFormat","getTimeSinceLastAug","prompt","wget","getFavorToDonate","getPlayer","getMoneySources","tail","toast","moveTail","resizeTail","closeTail","clearPort","openDevMenu","alert","flags","bypass","alterReality","rainbow","heart","break","iKnowWhatImDoing","formulas","mockServer","mockPlayer","calculateFavorToRep","calculateRepToFavor","repFromDonation","hackPercent","growPercent","hackTime","growTime","weakenTime","moneyGainRate","levelUpgradeCost","ramUpgradeCost","coreUpgradeCost","hacknetNodeCost","constants","hacknetServers","hashGainRate","cacheUpgradeCost","hashUpgradeCost","hacknetServerCost","wantedPenalty","respectGain","wantedLevelGain","ascensionPointsGain","ascensionMultiplier","work","crimeGains","classGains","factionGains","getRamCost","currType","posType","firstShares","remainingShares","numIterations","forecastChange","forecastForecastChange","calculateBuyMaxAmount","isLong","remainingMoney","currPrice","getStockMarket4SDataCost","getStockMarket4STixApiCost","getStockMarketWseCost","getStockMarketTixApiCost","NumberInput","textProps","GangMemberTasks","gangMemberTasksMetadata","isHacking","isCombat","HashUpgradesMetadata","HashUpgrade","Output","formatTime","RawOutput","raw","Link","dashes","TTimer","timeLeft","createProgressBarText","derived","totalTicks","bars","ConfirmationModal","confirmationText","onConfirm","additionalButton","hash","__COMMIT_HASH__","gameCPS","calculateCost","classs","discount","calculateClassEarnings","locationName","hashMult","expMult","globalModuleSequenceNumber","Script","otherScripts","moduleSequenceNumber","saveScript","formatCode","dependent","dependents","dependentScript","calculateRamUsage","ramUsageEntries","imports","isSleeveBladeburnerWork","BLADEBURNER","SleeveBladeburnerWork","actionType","actionName","cyclesNeeded","ret","getActionTimeNetscriptFn","actionIdent","getActionIdFromTypeAndName","getActionObject","retValue","completeAction","GeneralActions","StatsTable","rows","wide","MuiTable","row","elem","noWrap","actionNames","Action","Material","getMarkupLimit","qlt","mku","dmd","dmdR","cmp","cmpR","processMarket","priceChange","compChange","dmdChange","Suit","Card","suit","formatValue","isRedSuit","Hearts","Diamonds","getStringRepresentation","SourceFile","bitnodeKey","bitnode","timePassed","confidence","dataMap","serv","timesGrown","host","timesWeakened","compareArrays","COMPANY","SleeveCompanyWork","NewTokyoNoodleBar","getCompany","getGainRates","calculateCompanyWorkStats","influenceStockThroughCompanyWork","achievementData","bitNodeFinishedState","wd","blackops","OperationDaedalus","hasAccessToSF","knowsAboutBitverse","Icon","Condition","THE_BLACK_HAND","THE_COVENANT","Visible","MONEY_1Q","MONEY_M1B","Secret","INSTALL_1","INSTALL_100","QUEUE_40","HACKING_100000","COMBAT_3000","NEUROFLUX_255","NS2","FROZE","RUNNING_SCRIPTS_1000","running","DRAIN_SERVER","MAX_RAM","MAX_CORES","SCRIPTS_30","KARMA_1000000","STOCK_1q","DISCOUNT","SCRIPT_32GB","FIRST_HACKNET_NODE","MAX_HACKNET_NODE","HACKNET_NODE_10M","REPUTATION_10M","DONATION","TRAVEL","WORKOUT","TOR","hasTorRouter","HOSPITALIZED","hospitalization","GANG","FULL_GANG","members","GANG_TERRITORY","GANG_MEMBER_POWER","CORPORATION","CORPORATION_BRIBE","CORPORATION_PROD_1000","CORPORATION_EMPLOYEE_3000","CORPORATION_REAL_ESTATE","Description","INTELLIGENCE_255","BLADEBURNER_DIVISION","BLADEBURNER_OVERCLOCK","BLADEBURNER_UNSPENT_100000","FIRST_HACKNET_SERVER","AdditionalUnlock","ALL_HACKNET_SERVER","MAX_HACKNET_SERVER","hs","HACKNET_SERVER_1B","MAX_CACHE","capacity","SLEEVE_8","INDECISIVE","FAST_BN","CHALLENGE_BN1","CHALLENGE_BN2","CHALLENGE_BN3","CHALLENGE_BN6","CHALLENGE_BN7","CHALLENGE_BN8","CHALLENGE_BN9","hacknet_expenses","CHALLENGE_BN10","CHALLENGE_BN12","BYPASS","PROTOTYPETAMPERING","UNCLICKABLE","UNDOCUMENTEDFUNCTIONCALL","TIMECOMPRESSION","REALITYALTERATION","N00DLES","EDITSAVEFILE","UNACHIEVABLE","CHALLENGE_BN13","StaneksGift1","DEVMENU","RAINBOW","TRUE_RECURSION","playerAchievements","missingAchievements","flatMap","MathJaxWrapper","version","src","exceptionAlert","lineNumber","CorporationUnlockUpgradeIndex","CorporationUnlockUpgrades","Export","SmartSupply","MarketResearchDemand","MarketDataCompetition","VeChain","ShadyAccounting","GovernmentPartnership","WarehouseAPI","OfficeAPI","getGraftingAvailableAugs","augName","graftingIntBonus","getIntelligenceBonus","calculateGraftingTimeWithBonus","ActionIdentifier","BlackOperations","OperationTyphoon","reqdRank","rankGain","rankLoss","hpLoss","weights","decays","isKill","OperationZero","isStealth","OperationX","OperationTitan","OperationAres","OperationArchangel","OperationJuggernaut","OperationRedDragon","OperationK","OperationDeckard","OperationTyrell","OperationWallace","OperationShoulderOfOrion","OperationHyron","OperationMorpheus","OperationIonStorm","OperationAnnihilus","OperationUltron","OperationCenturion","OperationVindictus","ActiveFragment","highestCharge","numCharge","collide","other","thisFragment","otherFragment","dx","dy","fragSize","worldX","worldY","GameOptionsTab","effHack","effCha","currentLevel","recursiveMode","thisUpgrade","unFloored","getMultiplier","workName","commit","div","startWork","CrimeWork","crimeType","successRate","ratio","gainStats","queryStatFromString","tempStr","regenerateHp","ignoreQueued","AlertManager","alerts","setAlerts","sha256","getMessageHash","overflowWrap","vals","canGetBonus","setLastExportBonus","unixTime","HashRate","Message","ApplyToJobButton","getJobRequirementTooltip","isCreateProgramWork","CREATE_PROGRAM","CreateProgramWork","unitCompleted","programFile","percComplete","unitNeeded","getProgram","reqLvl","cancelled","incompleteName","lines","isSleeveFactionWork","SleeveFactionWork","FIELD","SECURITY","researchMetadata","initSourceFiles","initElectron","normalizeFileName","getFiles","deleteFile","removeFile","saveFile","Buffer","overwritten","writeToScriptFile","initWebserver","funcs","terminal","typesFn","appNotifier","initAppNotifier","triggerSave","triggerGameExport","ERROR","triggerScriptsExport","exportScripts","getSaveData","getSaveInfo","getImportDataFromString","pushSaveData","appSaveFns","initSaveFunctions","bridge","electronBridge","receive","send","initElectronBridge","pushGameReady","playtime","game","pushImportResult","wasImported","pushDisableRestore","Intelligence","useTheme","scope","getTypeAndNameFromActionId","colSpan","WorkInProgressOverview","onClickFocus","header","workCell","workHeader","pt","pb","workSubtitles","mt","details","innerText","isCrimeWork","crime","getCrime","isGraftingWork","factionWork","companyWork","textAlign","CharacterOverview","killOpen","setKillOpen","hackingProgress","strengthProgress","defenseProgress","dexterityProgress","agilityProgress","charismaProgress","borderTop","flex","aria-label","weight","problemType","getRandomProblemType","getRandomReward","randServer","getRandomServer","contractFn","getRandomFilename","addContract","generateRandomContractOnHome","generateDummyContract","generateContract","problemTypes","rewardType","factionsThatAllowHacking","offerHackingWork","sanitizeRewardType","numFactions","randFaction","allJobs","randIndex","addOffset","midpoint","percentage","program","description","BadRNG","WHRNG","s1","s2","s3","genSeed","CompanyWork","GameOptionsPage","Favor","TerminalEvents","TerminalClearEvents","orderType","refs","orderBook","executeOrder","isBuy","getDB","indexedDB","indexedDbRequest","onupgradeneeded","createObjectStore","onerror","ev","onsuccess","db","transaction","objectStore","request","put","deleteGame","isSleeveSupportWork","SUPPORT","SleeveSupportWork","sleeveSupport","getRandomByte","sendMessage","forced","showMessage","recvd","addMessageToServer","Messages","checkForMessagesToSend","jumper0","MessageFilenames","Jumper0","jumper1","Jumper1","jumper2","Jumper2","jumper3","Jumper3","jumper4","Jumper4","cybersecTest","CyberSecTest","nitesecTest","NiteSecTest","bitrunnersTest","BitRunnersTest","truthGazer","TruthGazer","redpill","RedPill","worldDaemon","flightName","Flight","recentScripts","killedTime","unshift","timeOfDeath","isSleeveClassWork","SleeveClassWork","isSleeveCrimeWork","CRIME","SleeveCrimeWork","getExp","favorToRep","repToFavor","fmt","ReputationRate","teamCount","getTeamSuccessBonus","inst","teamSize","getActionTypeSkillSuccessBonus","skillMultipliers","getCurrentCity","chaos","Option","buttonText","infoText","MightOfAres","WisdomOfAthena","ChaosOfDionysus","BeautyOfAphrodite","TrickeryOfHermes","FloodOfPoseidon","HuntOfArtemis","KnowledgeOfApollo","HemoRecirculator","Targeting1","Targeting2","Targeting3","SyntheticHeart","SynfibrilMuscle","CombatRib1","CombatRib2","CombatRib3","NanofiberWeave","SubdermalArmor","WiredReflexes","GrapheneBoneLacings","BionicSpine","GrapheneBionicSpine","BionicLegs","GrapheneBionicLegs","SpeechProcessor","TITN41Injection","EnhancedSocialInteractionImplant","BitWire","ArtificialBioNeuralNetwork","ArtificialSynapticPotentiation","EnhancedMyelinSheathing","SynapticEnhancement","NeuralRetentionEnhancement","DataJack","ENM","ENMCore","ENMCoreV2","ENMCoreV3","ENMAnalyzeEngine","ENMDMA","Neuralstimulator","NeuralAccelerator","CranialSignalProcessorsG1","CranialSignalProcessorsG2","CranialSignalProcessorsG3","CranialSignalProcessorsG4","CranialSignalProcessorsG5","NeuronalDensification","NuoptimalInjectorImplant","SpeechEnhancement","FocusWire","PCDNI","PCDNIOptimizer","PCDNINeuralNetwork","ADRPheromone1","ADRPheromone2","ShadowsSimulacrum","HacknetNodeCPUUpload","HacknetNodeCacheUpload","HacknetNodeNICUpload","HacknetNodeKernelDNI","HacknetNodeCoreDNI","Neurotrainer1","Neurotrainer2","Neurotrainer3","Hypersight","LuminCloaking1","LuminCloaking2","SmartSonar","PowerRecirculator","QLink","SPTN97","HiveMind","CordiARCReactor","SmartJaw","Neotra","Xanipher","HydroflameLeftArm","nextSENS","OmniTekInfoLoad","PhotosyntheticCells","Neurolink","CRTX42AA","Neuregen","CashRoot","NutriGen","PCMatrix","INFRARet","DermaForce","GrapheneBrachiBlades","BrachiBlades","GrapheneBionicArms","BionicArms","SNA","ZOE","EsperEyewear","EMS4Recombination","OrionShoulder","HyperionV1","HyperionV2","GolemSerum","VangelisVirus","VangelisVirus3","INTERLINKED","BladeRunner","BladeArmor","BladeArmorPowerCells","BladeArmorEnergyShielding","BladeArmorUnibeam","BladeArmorOmnibeam","BladeArmorIPU","BladesSimulacrum","StaneksGift2","StaneksGift3","BigDsBigBrain","donationBonus","randomBonuses","bonuses","randomNumber","getRandomBonus","UnstableCircadianModulatorParams","UnstableCircadianModulator","infiltrateCycles","isSleeveInfiltrateWork","INFILTRATE","SleeveInfiltrateWork","_sleeve","infiltrateSynthoidCommunities","BeyondMan","TheHiddenWorld","CostOfImmortality","CodedIntelligence","HistoryOfSynthoids","SimulatedReality","AGreenTomorrow","SyntheticMuscles","BrighterThanTheSun","AevumGalacticCybersystems","ManAndMachine","TheFailedFrontier","Sector12DeltaOne","Sector12Crime","AevumPolice","SecretSocieties","TensionsInTechRace","VolhavenZBInstituteOfTechnology","AevumSummitUniversity","NewTriads","TheNewGod","AevumCrushFitnessGym","Sector12IronGym","VolhavenMilleniumFitnessGym","Sector12PowerhouseGym","AevumSnapFitnessGym","DemocracyIsDead","AlphaOmega","moneyHacked","orgName","percTotalMoneyHacked","influenceStockThroughServerGrow","moneyGrown","percTotalMoneyGrown","performanceMult","cyclesOfWork","compName","GRAFTING","GraftingWork","gAugs","GraftableAugmentations","GraftableAugmentation","StartButton","comms","rank","char","CorruptableText","setContent","counter","timers","letter","randFrom","randomize","timerId","Engine","_lastUpdate","updateGame","processWork","storeCycles","decrementAllCounters","checkCounters","Counters","autoSaveCounter","updateSkillLevelsCounter","updateDisplays","updateDisplaysLong","updateActiveScriptsDisplay","createProgramNotifications","augmentationsNotifications","passiveFactionGrowth","mechanicProcess","contractGeneration","achievementsCounter","counterName","warningToast","ml","WARNING","warnAutosaveDisabled","adjustedCycles","startExploits","setupUncaughtPromiseHandler","timeOffline","numCyclesOffline","contractChancesWhileOffline","numContracts","offlineReputation","offlineHackingIncome","offlineProductionFromHacknetNodes","hacknetProdInfo","start","timeOfflineString","SetupTextEditor","_thisUpdate","requestAnimationFrame","FactionInfo","offerFieldWork","offerSecurityWork","keep","keepOnInstall","assignment","FactionWorkStats","baseStats","CorporationUpgradeIndex","CorporationUpgrades","SmartFactories","benefit","SmartStorage","DreamSense","WilsonAnalytics","NuoptimalNootropicInjectorImplants","SpeechProcessorImplants","NeuralAccelerators","FocusWires","ABCSalesBots","ProjectInsight","nsFuncsGenerator","sanitizedPid","found","Environment","getScriptOnServer","shouldLog","disableLogs","determineCrimeSuccess","findCrime","roughName","antiLog","sum","ProgressBar","withStyles","bar","transition","LinearProgress","validator","paramValidator","calculateSellInformationCashReward","levelBonus","calculateTradeInformationRepReward","calculateInfiltratorsRepReward","startingSecurityLevel","infiltrationData","sanitizedSource","prop","canAccessGang","isAwareOfGang","getGangFaction","startGang","comprGenChar","comprLZGenerate","plain","comprLZEncode","cur_state","new_state","new_offset","tmp_state","len","comprLZDecode","compr","literal_length","backref_length","backref_offset","StatsProgressBar","remaining","StatsProgressOverviewCell","characterOverviewStyles","paddingBottom","calculateHospitalizationCost","damage","oldhp","v1","v2","baseCheck","initialCheck","netscriptCanGrow","netscriptCanWeaken","PromptEvent","PromptManager","setPrompt","types","PromptMenuText","PromptMenuSelect","PromptContent","PromptMenuBoolean","paddingTop","submit","autoFocus","onInput","stopPropagation","ENTER","preventDefault","choices","getItems","matName","reqMats","prodMats","ProgramsSeen","ProgramsRoot","prog","getHackingLevelRemaining","disableGutters","gridTemplateColumns","curCompletion","getProgCompletion","Paper","flexWrap","mr","InvitationsSeen","WorkTypesOffered","FactionElement","facInfo","joined","gap","openFaction","openFactionAugPage","acceptInvitation","justifyItems","gridAutoFlow","FactionsRoot","allJoinedFactions","invitations","breakpoints","down","gridTemplateRows","gridAutoRows","ActivateRecoveryMode","RecoveryRoot","errorData","resetError","issueUrl","newIssueUrl","startIcon","onTriggered","px","multiline","fullWidth","sharePower","StartSharing","CSM","RamCalculationErrorCode","locations","OptionsSlider","initialValue","_evt","newValue","onChangeCommitted","valueLabelDisplay","marks","TickerDisplayMode","DisplayModeButton","tickerDisplayMode","Portfolio","changeDisplayMode","StockTickersConfig","changeWatchlistFilter","general","ops","events","updateSkillMultipliers","calculateMaxStamina","maxStamina","calculateStaminaPenalty","canAttemptBlackOp","actionId","nm","isAvailable","actionTimeCurrent","actionTimeToComplete","resetAction","testBlackOp","getRecruitmentTime","skillName","executeConsoleCommands","commands","consoleHistory","arrayOfCommands","executeConsoleCommand","postToConsole","saveToLogs","consoleLogs","getTimestamp","clearConsole","bladeburnerFac","convertedType","convertedName","operations","executeStartConsoleCommand","executeSkillConsoleCommand","skillNames","multKeys","pointCost","executeLogConsoleCommand","flag","logging","executeHelpConsoleCommand","ConsoleHelpText","helpList","helpText","executeAutomateConsoleCommand","variable","highLow","automateActionHigh","automateActionLow","automateThreshHigh","automateThreshLow","automateEnabled","parseCommandArguments","command","endQuote","SPACE","substr","triggerMigration","sourceCityName","destCityName","destCity","sourceCity","triggerPotentialMigration","randomEvent","getActionStats","successMult","unweightedGain","unweightedIntGain","getDiplomacyEffectiveness","getRecruitmentSuccessChance","sleeveSize","effCharisma","charismaFactor","joining","resetSkillMultipliers","effInt","multiplierNames","multiplierName","multiplierValue","completeOperation","losses","sup","teamLost","improvePopulationEstimateByPercentage","changePopulationByPercentage","changeEstEqually","nonZero","changeChaosByCount","changeChaosByPercentage","changePopulationByCount","estChange","estOffset","completeContract","improvePopulationEstimateByCount","isPlayer","isOperation","difficultyMultiplier","rewardMultiplier","rewardFac","successes","setMaxLevel","whoAmI","failures","loss","hpLost","numHosp","moneyLost","logLossText","autoLevel","teamLossMax","strExpGain","defExpGain","dexExpGain","agiExpGain","staminaGain","staminaBonus","eff","hackingExpGain","charismaExpGain","successChance","recruitTime","growthF","Growths","operation","infilSleeves","maxRank","bladeburnersFactionName","favorBonus","rankNeededForSp","totalSkillPoints","gainedSkillPoints","processAction","actionTimeOverflow","calculateStaminaGainPerSecond","effAgility","maxStaminaBonus","oldMax","difficultyFac","op","randomEventCounter","getContractNamesNetscriptFn","getOperationNamesNetscriptFn","getBlackOpNamesNetscriptFn","getGeneralActionNamesNetscriptFn","getSkillNamesNetscriptFn","startActionNetscriptFn","errorLogText","canRunOp","actionObj","getActionEstimatedSuccessChanceNetscriptFn","getEstSuccessChance","recChance","getActionCountRemainingNetscriptFn","getSkillLevelNetscriptFn","getSkillUpgradeCostNetscriptFn","upgradeSkillNetscriptFn","getTeamSizeNetscriptFn","setTeamSizeNetscriptFn","sanitizedSize","joinBladeburnerFactionNetscriptFn","EPSILON","decay","getSuccessChance","baseTime","skillFac","effDexterity","statFac","est","popEst","clamp","real","low","high","competence","stat","playerStatLvl","effMultiplier","getSuccessesNeededForNextLevel","baseSuccessesPerLevel","showLiterature","litObj","Literatures","newCrimeType","convertCrimeType","ROBSTORE","BONDFORGERY","TRAFFICKARMS","GRANDTHEFTAUTO","calculateCrimeWorkStats","frames","Apr1Events","Apr1","getMonth","getDate","isApr1","setN","allow","logEntry","logUpd","displayLog","recordGrow","recordWeaken","maintainMembership","gainFavor","finishAction","penalty","hack_asc_points","str_asc_points","def_asc_points","dex_asc_points","agi_asc_points","cha_asc_points","CorporationManagementHandbook","resetPidCounter","setMaxRam","isSleeveSynchroWork","SYNCHRO","SleeveSynchroWork","isSleeveRecoveryWork","RECOVERY","SleeveRecoveryWork","currentCity","onTravel","WorldMap","SuccessChance","estimatedSuccessChance","StaticModal","checkIfConnectedToDarkweb","listAllDarkwebItems","item","printRaw","buyDarkwebItem","itemName","buyAllDarkwebItems","itemsToBuy","parseArg","asNumber","ParseCommands","allCommands","flat","ParseCommand","idx","lastQuote","DOUBLE_QUOTE","QUOTE","getMult","getUpgrade","getUpgradeCost","newCap","calculateRawDiff","startingDifficulty","calculateDifficulty","calculateReward","CinematicText","setI","done","setDone","onDone","newI","auto","MaxSleevesFromCovenant","BaseCostPerSleeve","tooltiptext","reqRep","parseOnlyRamCalculate","dependencyMap","completedParses","parseQueue","parseCode","moduleName","currentModule","globalKey","internalToExternal","additionalModules","addRef","external","objectPrototypeProperties","getOwnPropertyNames","commonVisitors","Identifier","st","WhileStatement","walkDeeper","test","DoWhileStatement","ForStatement","update","IfStatement","consequent","alternate","MemberExpression","walk","importModuleName","spec","imported","parseOnlyCalculateDeps","initialModule","nextModule","ImportError","detailedCosts","unresolvedRefs","resolvedRefs","loadedFns","prefix","dep","findFunc","refDetail","fnRam","checkInfiniteLoop","missingAwaitLine","nodeHasTrueTest","hasAwait","AwaitExpression","codeCopy","decimal","TerminalHelpText","TemplatedHelpTexts","HelpTexts","analyze","backdoor","cat","cd","check","cls","cp","expr","free","help","history","lscpu","mem","nano","sudov","unalias","pidCounter","tempCounter","enterBitNode","destroyedBitNode","newBitNode","bitNodeNumber","sourceFileKey","sourceFile","ownedSourceFile","newSrcFile","PlayerOwnedSourceFile","giveSourceFile","newRemoteFileApiConnection","stopConnection","Remote","startConnection","isRemoteFileApiConnectionLive","connection","readyState","GameEnv","Platform","getErrorForDisplay","errorInfo","isElectron","Production","toDisplay","features","language","cookiesEnabled","cookieEnabled","doNotTrack","indexedDb","platform","Steam","Browser","environment","getErrorMetadata","Development","componentStack","Tracking","Retirement","Investigation","Raid","createCityMap","initValue","Hand","cards","addCards","removeByIndex","StockTickerTxButton","DummyGrid","BaseGift","fragments","ghostGrid","enter","getFavorGain","totalRep","Person","generalMethods","workMethods","bladeburnerMethods","corporationMethods","gangMethods","serverMethods","augmentationMethods","InvitationModal","findIndex","hack_exp","hack_mult","str_exp","str_mult","def_exp","def_mult","dex_exp","dex_mult","agi_exp","agi_mult","cha_exp","cha_mult","calculatePower","assignToTask","taskName","unassignFromTask","getTerritory","gainExperience","difficultyPerCycles","recordEarnedRespect","earnedRespect","getGainedAscensionPoints","canAscend","getCurrentAscensionMults","getAscensionMultsAfterAscend","getAscensionResults","postAscend","preAscend","ascend","applyUpgrade","respectToDeduct","buyUpgrade","removeBracketsFromArrayString","strCpy","removeQuotesFromString","convert2DArrayToString","ans","parseInt","_n","_data","nums","ways","maxLen","padStart","matrix","spiral","u","col","playerAns","_arr","reach","jumps","lastJump","jumpedFrom","intervals","numIntervals","end","interval","sanitizedResult","sanitizedAns","B","C","ansArr","ipInAns","maxCur","maxSoFar","hold1","MIN_SAFE_INTEGER","hold2","release1","release2","prices","hold","rele","cur","createTriangleRecurse","numLevels","createTriangle","triangle","dp","numRows","numColumns","currentRow","gridString","grid","obstacleGrid","dstY","dstX","minPathLength","distanceFactor","distance","queue","MinHeap","validPosition","yN","xN","changeWeight","yQ","xQ","ansX","ansY","direction","roll","dfs","pair","sanitizedPlayerAnsArr","resultInAnswer","digits","numDigits","digitsArray","helper","evaluated","multed","HammingEncode","_alteredBit","_buildArray","HammingEncodeProperly","_randomIndex","HammingDecode","edges","shuffle","vertexShuffler","sanitizedPlayerAns","neighbourhood","vertex","adjLeft","adjRight","coloring","initialVertex","frontier","validColors","aColor","bColor","plaintext","ans_plain","run_length","compressed","fromCharCode","CodingContractModal","setProps","setAnswer","contractType","tries","getContract","contractName","removeContract","existingPartialExeIndex","newScript","writeToTextFile","newFile","numServerGrowthCycles","numServerGrowthCyclesAdjusted","getSubdirectories","t_dir","processFile","subdir","containsFiles","dirWithTrailingSlash","pattern","matchEnding","zip","JSZip","zipFiles","fileNames","fileContents","zipFn","generateAsync","FileSaver","saveAs","opt_initFunc","sourceCode","sourceCodeLineOffset","acorn","PARSE_OPTIONS","initFunc_","paused_","polyfills_","functionCounter_","stepFunctions_","stepMatch","methodName","createScope","stripLocations_","State","stateStack","nodeConstructor","READONLY_DESCRIPTOR","configurable","writable","NONENUMERABLE_DESCRIPTOR","READONLY_NONENUMERABLE_DESCRIPTOR","VARIABLE_DESCRIPTOR","STEP_ERROR","SCOPE_REFERENCE","VALUE_IN_DESCRIPTOR","toStringCycles_","getErrorLineNumber","getErrorLineNumberMessage","appendCode","populateScope_","nextState","initGlobalScope","OBJECT_PROTO","FUNCTION_PROTO","initFunction","initObject","proto","OBJECT","initArray","initString","initBoolean","initNumber","initDate","initRegExp","initError","initMath","initJSON","thisInterpreter","createNativeFunction","EvalError","isFinite","strFunctions","decodeURI","encodeURI","nativeFunc","throwException","URI_ERROR","FUNCTION","ARRAY","ARRAY_PROTO","REGEXP","REGEXP_PROTO","DATE","DATE_PROTO","identifierRegexp","var_args","calledWithNew","newFunc","createObjectProto","arguments","argsStr","SYNTAX_ERROR","parentScope","boxThis","isObject","getScope","strict","box","getPrototype","thisArg","func_","funcThis_","arguments_","arrayPseudoToNative","TYPE_ERROR","doneExec_","setNativeFunctionPrototype","valueOf","throwIfNullUndefined","arrayNativeToPseudo","descriptor","preventExtensions","getOwnPropertyDescriptor","setter","hasValue","pseudoDescriptor","propertyIsEnumerable","newArray","first","legalArrayLength","RANGE_ERROR","class","reverse","howmany","opt_begin","opt_end","opt_separator","iLength","getProperty","hasProperty","element","isa","jLength","searchElement","opt_fromIndex","STRING","functions","compareString","locales","localeCompare","separator","jsList","search","newSubstr","BOOLEAN","NUMBER","numConsts","fractionDigits","toExponential","precision","toPrecision","radix","Function","UTC","rgx","populateRegExp","lastIndex","opt_message","newError","createObject","createErrorSubclass","EVAL_ERROR","REFERENCE_ERROR","myMath","mathConsts","numFunctions","myJSON","nativeObj","child","legalArrayIndex","Value","strs","pseudoRegexp","nativeRegexp","ignoreCase","createFunction","opt_constructor","illegalConstructor","asyncFunc","pseudoDate","pseudoObj","opt_cycles","pseudo","native","nativeArray","pseudoArray","lineNum","isGetter","TypeError","opt_descriptor","ReferenceError","defObj","firstNode","expression","createSpecialScope","opt_scope","getValueFromScope","prevNode","setValueToScope","nodeClass","isConstructor","getValue","Completion","NORMAL","BREAK","CONTINUE","RETURN","THROW","errorClass","lineNumErrorMsg","unwind","lineNumberMsg","cv","labels","isLoop","isSwitch","realError","errorTable","RangeError","URIError","createGetter_","funcThis","doneCallee_","doneArgs_","createSetter_","elements","n_","array_","doneLeft_","doneRight_","leftReference_","doneGetter_","leftValue_","leftValue","doneSetter_","setterValue_","rightValue","directEval_","funcNode","paramName","paramValue","argsList","evalNode","argsWithCallback","done_","throwValue","mode_","test_","doneInit_","doneObject_","variable_","object_","visited_","name_","gotPropName","props_","doneVariable_","propName","doneProperty_","properties_","kinds","switchValue_","defaultCase_","index_","switchCase","matched_","tested_","doneBlock_","doneHandler_","doneFinalizer_","leftSide_","changeValue","returnValue","declarations","declarationNode","init_","doneBody_","wrapAPI","enums","NetscriptSingularity","NetscriptGang","NetscriptBladeburner","NetscriptCodingContract","NetscriptSleeve","NetscriptCorporation","NetscriptStanek","NetscriptInfiltration","NetscriptUserInterface","NetscriptFormulas","NetscriptStockMarket","NetscriptGrafting","NetscriptHacknet","_hackAmount","hackAmount","_threads","_time","moneyBefore","moneyAfter","logGrowPercent","_growth","_cores","maxThreadsNeeded","finally","_format","_fn","possibleLogs","_x","_y","_pid","_w","_h","_scriptname","scriptServer","spawnDelay","killByPid","_safetyguard","safetyguard","scriptsKilled","_files","_destination","_source","destServer","sourceServ","noFailures","sourceTextFile","textFile","destTextFile","sourceScript","destScript","_grep","grep","allFiles","processes","speed","production","purchaseCost","coreCost","levelCost","_lvl","_filename","_ram","_name","hostnameStr","_newName","_port","_mode","txtFile","tryWrite","_file","status","suc","_milliseconds","_milliPrecision","milliseconds","milliPrecision","_message","_variant","_duration","_txt","_url","_target","$","fail","sinceInstall","sinceStart","_host","source_is_txt","dest_is_txt","source_file","dest_file","Flags","NetscriptExtra","getFunctionNames","functionNames","ANSI_ESCAPE","lineClass","ANSIITypography","memo","parts","groups","matchAll","startIndex","stopIndex","partText","paragraph","part","ansiCodeStyle","COLOR_MAP_BRIGHT","1","2","3","4","5","6","7","COLOR_MAP_DARK","8","9","10","11","12","13","14","15","codeParts","nextStyleKey","codePart","ir","ig","ib","grey","ansi2rgb","fontWeight","textDecoration","worker","companyPositionName","bn11Mult","jobPerformance","calculateJobPerformance","baseSalary","salaryMultiplier","expMultiplier","strengthExpGain","defenseExpGain","dexterityExpGain","agilityExpGain","_width","_height","aFrag","StaneksGiftEvents","maxClearanceLevel","Gym","TechVendor","techVendorMaxRam","techVendorMinRam","University","AevumCasino","Casino","Special","NewTokyoArcade","Sector12CarmichaelSecurity","Sector12CityHall","Hospital","Slums","WorldStockExchange","ChongqingChurchOfTheMachineGod","IshimaGlitch","Operations","Engineer","Business","RandD","Unassigned","atCapacity","marketCycles","emp","hireRandomEmployee","calculateTotalEmployees","calculateNextEmployees","maxEne","maxHap","maxMor","autoCoffee","perfMult","totalSalary","ene","coffeeMult","coffeeEmployees","mor","hap","partyMult","partyEmployees","minEne","minMor","minHap","calculateEmployeeProductivity","employeeNextJobs","employeeJobs","employeeProd","prod","calculateProductivity","getElementById","cre","sal","Employee","creativity","efficiency","salary","materials","updateMaterialSizeUsed","getStorageMultiplier","graftableAug","canGraft","AugPreReqsChecklist","preAug","GraftingRoot","graftableAugmentations","selectedAug","setSelectedAug","graftOpen","setGraftOpen","selectedAugmentation","switchSortOrder","newOrder","Cost","getAugsSorted","v2ModalOpen","openV2Modal","V2Modal","vargs","schema","numDashes","libarg","argv","defaultInterpreter","makeScriptBlob","shouldCompile","queueCompile","uurls","_getScriptUrls","isDependencyOutOfDate","scriptModuleSequenceNumber","depScript","seen","urlStack","ranges","importNodes","ExportNamedDeclaration","ExportAllDeclaration","transformedCode","matchingScripts","importedScript","urls","blob","ScriptUrl","newNs2Template","detectSimpleScriptGlob","globString","globDatabase","parsedGlob","glob","preGlob","postGlob","globError","globMatches","globAgainst","parseSimpleScriptGlob","commonEditor","scriptEditorRouteOptions","filesToLoadOrCreate","globSearch","isEmpty","filepath","getFilepath","fileIsNs2","isNs2","CursorPositions","saveCursor","column","BitFlumeEvent","BitFlumeModal","sleeveMethods","crimeKey","getMemoryUpgradeCost","memory","currCost","currMemory","installAugmentation","cyclesUsed","takeUniversityCourse","universityName","newCity","tryBuyAugmentation","upgradeMemory","workType","sanitizedWorkType","workoutAtGym","gymName","sanitizedStat","Contracts","recruitmentSuccessChance","contractSuccessChance","bb","chances","personMethods","stealthIcon","xmlns","viewBox","killIcon","ActionLevel","isActive","canIncrease","canDecrease","Autolevel","TeamSizeButton","BlinkingCursor","setOn","StyleEditorButton","styleEditorOpen","setStyleEditorOpen","ThemeEditorButton","themeEditorOpen","setThemeEditorOpen","ThemeCollaborate","DeleteGameButton","modalOpened","setModalOpened","SoftResetButton","noConfirmation","PreReqs","ownedPreReqs","hasPreReqs","Requirement","gridArea","Exclusive","PurchasableAugmentations","augNames","PurchasableAugmentation","owned","ownedAugNames","sleeveAugs","canPurchase","float","gridTemplateAreas","TravelAgencyRoot","setDestination","startTravel","symbolsLoaded","symbols","populate","exclude","OpenScript","lastPosition","model","isTxt","openScripts","currentScript","Root","editorRef","monacoRef","vimStatusRef","vimEditor","setVimEditor","setEditor","setFilter","searchExpanded","setSearchExpanded","setRAM","ramEntries","setRamEntries","updatingRam","setUpdatingRam","decorations","setDecorations","optionsOpen","setOptionsOpen","setOptions","insertSpaces","ramInfoOpen","setRamInfoOpen","regenerateModel","createModel","updateRAM","keydown","ctrlKey","metaKey","require","initVimMode","VimMode","Vim","defineEx","saveNQuit","defineAction","_cm","nTabs","currIndex","currentTabIndex","onTabClick","nextIndex","mapCommand","context","dispose","debouncedUpdateRAM","newCode","entriesDisp","RAM","scriptToSave","cleanCode","ns1","ns2","curIndex","isDisposed","setModel","revealLineInCenter","onTabClose","closingScript","savedScriptCode","wasCurrentScript","dirty","indexOffset","openScript","serverData","getServerCode","handleFilterChange","handleExpandSearch","filteredOpenScripts","tabMaxWidth","tabTextWidth","tabIconWidth","onDragEnd","endIndex","removed","reorder","droppableId","provided","snapshot","innerRef","droppableProps","isDraggingOver","spellCheck","externalScript","colorProps","borderColor","iconButtonStyle","scriptTabText","draggableId","disableInteractiveElementBlocking","draggableProps","dragHandleProps","flexShrink","serverScriptCode","onTabUpdate","beforeMount","languages","registerCompletionItemProvider","provideCompletionItems","suggestions","kind","CompletionItemKind","insertText","insertTextRules","CompletionItemInsertTextRule","InsertAsSnippet","getLanguages","loader","tokenizer","libSource","typescript","javascriptDefaults","addExtraLib","typescriptDefaults","onMount","Position","loading","defaultLanguage","defaultValue","newPos","awaitWarning","newDecorations","deltaDecorations","startLineNumber","startColumn","endLineNumber","endColumn","isWholeLine","glyphMarginClassName","glyphMarginHoverMessage","infLoop","glyphMargin","getAction","TablePaginationActionsAll","rowsPerPage","onPageChange","BitnodeMultiplierDescription","BitNodeMultipliersDisplay","maxSfLevel","columnCount","columnGap","GeneralMults","SkillMults","FactionMults","AugmentationMults","HackingMults","PurchasedServersMults","StockMults","CrimeMults","InfiltrationMults","CompanyMults","GangMults","CorporationMults","BladeburnerMults","StanekMults","BNMultTable","rowsArray","rowData","uniqueId","marginBottom","sectionName","canAccessBladeburner","extraSize","canAccessCorporation","Cell","cellProps","onMouseEnter","Grid","activeGrid","randomColor","elems","startBladeburner","automate","stop","startCorporation","corpName","additionalShares","warehouseApi","OfficeApi","enc","data_bits","parity","bits","bit","currPos","nextPosName","nextPosition","StanekConstants","RAMBonus","BaseSize","MaxSize","findNode","setParent","getAdvertisingMultiplier","getMultiplierHelper","getEmployeeChaMultiplier","getEmployeeCreMultiplier","getEmployeeEffMultiplier","getEmployeeIntMultiplier","getProductionMultiplier","getProductProductionMultiplier","getSalesMultiplier","getScientificResearchMultiplier","advertisingMult","employeeChaMult","employeeCreMult","employeeEffMult","employeeIntMult","productionMult","productProductionMult","salesMult","sciResearchMult","storageMult","detect","hasChanges","orig","nf","fl","backups","LoadingScreen","setShow","loaded","setLoaded","reason","doLoad","typ","invalidArgs","baseSize","charge","af","cotmg","inBonus","updateMults","effect","boost","neighboor","CalculateEffect","canPlace","rootX","rootY","newFrag","place","findFragment","clearCharge","calculateMults","zoeAmt","scaling","sleeveMults","findPurchasableAugs","availableAugs","isAvailableForSleeve","validMults","gangAugs","errorMsg","RFARequestHandler","pushFile","fileData","at","getFile","scriptContent","getFileNames","fileNameList","scr","getAllFiles","fileList","calculateRam","getDefinitionFile","StatsElement","EarningsElement","rates","ServerType","All","Foreign","Owned","Purchased","ServerDropdown","isValidServer","purchased","serverType","purchase","DECK_COUNT","Result","Blackjack","bet","canStartGame","playerHand","deck","safeDrawCard","dealerHand","setState","gameInProgress","Pending","getTrueHandValue","finishGame","Tie","PlayerWonByBlackjack","DealerWon","hand","handValues","getHandValue","valuesUnder21","isHandBusted","newHand","newDealerHand","PlayerWon","dealerHandValue","playerHandValue","betInput","wager","wagerInvalid","wagerInvalidHelperText","startGame","Deck","render","playerHandValues","getHandDisplayValues","dealerHandValues","wagerOnChange","helperText","playerHit","playerStay","startOnClick","elevation","card","prev","hidden","red","ReactCard","Clubs","Spades","allFactionAugs","factionAugs","factionAug","TickerHeaderFormatData","longestName","longestSymbol","AchievementEntry","cssFiltersUnlocked","cssFiltersLocked","isUnlocked","mainColor","achievedOn","unlocked","colorFilters","Color","hueRotate","angle","PI","sin","cos","multiply","grayscale","sepia","saturate","newR","newG","newB","brightness","linear","contrast","slope","intercept","invert","hsl","Solver","targetHSL","reusedColor","solve","solveNarrow","solveWide","css","best","initial","spsa","A1","iters","bestLoss","deltas","highArgs","lowArgs","ck","lossDiff","ak","fix","filters","colorHSL","getFiltersFromHex","hex","rgb","hexToRgb","Theme","credit","screenshot","img1","reference","stacks","calculateEntropy","nerf","formattedHours","getHours","formattedMinutes","getMinutes","formattedSeconds","getSeconds","CorporationState","numUnlockUpgrades","upgradeMultipliers","addFunds","getState","gameCycles","resetImports","issueNewSharesCooldown","cycleValuation","determineCycleValuation","determineValuation","cycleProfit","updateDividendTax","retainedEarnings","getCycleDividends","updateSharePrice","dividendTax","dividendsPerShare","dividends","valuationsList","valuation","getTargetSharePrice","targetPrice","immediatelyUpdateSharePrice","sharesTracker","sharesUntilUpdate","sharesSold","maxIterations","convertCooldownToString","upgN","upgradeAmt","getDreamSenseGain","getStarterGuide","hasHandbook","handbookFn","TheSecretWar","isHackingGang","respectGainRate","wantedGainRate","storedTerritoryAndPowerCycles","territoryClashChance","territoryWarfareEngaged","notifyMemberDeath","getPower","processGains","processExperienceGains","processTerritoryAndPowerGains","moneyGains","respectGains","wantedLevelGains","justice","oldWanted","newWanted","gangName","gainRoll","multiplicativeGain","powerMult","PowerMultiplier","additiveGain","gangs","others","thisGang","otherGang","thisPwr","thisChance","calculateTerritoryGain","winGang","loseGang","powerBonus","territoryGain","clash","won","baseDeathChance","modifiedDeathChance","killMember","getRespectNeededToRecruitMember","getWantedPenalty","memberTotal","totalRespect","lostRespect","getDiscount","getAllTaskNames","createDescription","BinHeap","heapifyUp","heapifyDown","predicate","heapOrderABeforeB","tmp","toSwap","weightA","weightB","AllSoftwarePositions","AllITPositions","AllNetworkEngineerPositions","SecurityEngineerPositions","AllTechnologyPositions","AllBusinessPositions","AllAgentPositions","AllSecurityPositions","AllSoftwareConsultantPositions","AllBusinessConsultantPositions","SoftwarePositionsUpToHeadOfEngineering","SoftwarePositionsUpToLeadDeveloper","BusinessPositionsUpToOperationsManager","WaiterOnly","EmployeeOnly","PartTimeWaiterOnly","PartTimeEmployeeOnly","OperationsManagerOnly","CEOOnly","DefaultConstructorParams","isPlayerEmployed","isMegacorp","hasAgentPositions","hasBusinessConsultantPositions","hasBusinessPositions","hasEmployeePositions","hasITPositions","hasSecurityPositions","hasSoftwareConsultantPositions","hasSoftwarePositions","hasWaiterPositions","charismaEffectiveness","hackingEffectiveness","reqdHacking","repMultiplier","reqdReputation","reqdCharisma","strengthEffectiveness","defenseEffectiveness","dexterityEffectiveness","agilityEffectiveness","reqdStrength","reqdDefense","reqdDexterity","reqdAgility","requiredAgility","hackRatio","strRatio","defRatio","dexRatio","agiRatio","chaRatio","reputationGain","requireHackingLevel","targetServer","numAugReq","outputHistory","startHack","startGrow","startWeaken","startBackdoor","startAnalyze","finishHack","oldSec","newSec","finishGrow","finishWeaken","finishBackdoor","finishAnalyze","currServ","isHacknet","org","canRunScripts","hackingSkill","security","hackingChance","numPort","getProgressText","getLitFile","lit","currDir","setcwd","contractOpen","executeScanAnalyzeCommand","visited","depthQueue","newS","titleDashes","connectToServer","executeCommands","commandHistory","terminalCommandHistory","commandHistoryIndex","executeCommand","n00dlesServ","commandName","scananalyze","apr1","ipaddress","byteRange","normalServer","relative_filename","evaledDir","t_dst","dst","srcExt","tRes","sRes","sanitizedExpr","used","avail","usedPercent","cmd","empty","getGang","getGangMember","_faction","wantedLevelGainRate","cpy","_memberName","memberName","hack_asc_mult","str_asc_mult","def_asc_mult","dex_asc_mult","agi_asc_mult","cha_asc_mult","recruited","tasks","_taskName","getGangTask","_equipName","equipName","equipment","typecheck","_engage","engage","_otherGang","playerPower","checkSleeveAPIAccess","checkSleeveNumber","sleeveNumber","sl","_sleeveNumber","_crimeRoughName","crimeRoughName","_universityName","_className","_cityName","acompanyName","_factionName","_workType","_gymName","_stat","jobTitle","agilityExp","charismaExp","companyRep","crimeMoney","crimeSuccess","defenseExp","dexterityExp","factionRep","hackingExp","strengthExp","workMoney","purchasableAugs","_augName","_action","_contract","devMenu","doc","completely_unused_field","real_document","recur","guess","bcrypt","tprintRaw","getHacknetNode","hi","_i","hasUpgraded","timeOnline","totalProduction","_upgName","_count","_upgTarget","effectText","costPerLevel","hasTargetServer","collapsedSum","checkStanekAPIAccess","_rootX","_rootY","_rotation","_fragmentId","fragmentId","getLocationsWithInfiltrations","_location","tradeRep","sellCash","SoARep","calculateInfiltrationData","Void","newTheme","currentTheme","errors","newStyles","currentStyles","checkBladeburnerAccess","getBladeburner","checkBladeburnerCity","getBladeburnerActionObject","_blackOpName","blackOpName","_type","_level","_autoLevel","_skillName","_size","getCodingContract","optsValidator","returnReward","answerStr","creward","upgradeName","materialName","checkAccess","api","getSafeDivision","awareness","popularity","numAdVerts","_divisionName","_amt","_materialName","sell","sll","_productName","rat","per","dur","rel","aes","fea","pCost","cityData","developmentProgress","_price","_all","_enabled","enabled","_designInvest","_marketingInvest","_qty","_sourceDivision","_sourceCity","_targetDivision","_targetCity","sourceDivision","targetDivision","targetCity","_on","_researchName","_employeeName","_job","_amount","amount","_costPerEmployee","_industryName","industryName","_upgradeName","_rate","dividendEarnings","_corporationName","_selfFund","corporationName","selfFund","fundingRound","percShares","funding","investShares","_numShares","initialSharePrice","_amountCash","amountCash","startingCost","reFac","sciFac","robFac","aiFac","advFac","hwFac","getProductDescriptionText","getMaximumNumberProducts","additional","hasMaximumNumberProducts","calculateProductionFactors","multSum","cityMult","updateWarehouseSizeUsed","prodName","siz","newInd","employeeSalary","officeLoc","processMaterialMarket","processProductMarket","popularityGain","awarenessGain","MAX_VALUE","processMaterials","processProducts","wh","foo","buyAmt","maxAmt","smartBuy","reqMat","smartSupplyStore","worseAmt","totalSize","freeSpace","maxProd","getOfficeProductivity","totalMatSize","reqMatName","normQty","producableFrac","reqMatQtyNeeded","fooProd","fooI","businessFactor","getBusinessFactor","advertisingFactor","getAdvertisingFactors","marketFactor","getMarketFactor","markupLimit","numerator","sqrtNumerator","sqrtDenominator","denominator","sqrt","optimalPrice","marketTa2Price","sellAmt","totalExp","expI","amtStr","expIndustry","expWarehouse","imp","fin","createProduct","finishProduct","processProduct","totalProfit","forProduct","netStorageSize","sCostString","advMult","opProd","engrProd","mgmtProd","mgmtFactor","businessProd","calculateEffectWithFactors","awarenessFac","popularityFac","ratioFac","updateResearchTree","expFac","linearFac","morale","happiness","energy","det","trainingEff","effCre","effEff","prodBase","demand","competition","quality","performance","durability","reliability","aesthetics","creationProd","totalProd","engrRatio","mgmtRatio","rndRatio","opsRatio","busRatio","totalMult","calculateRating","busmgtgRatio","ProductRatingWeights","Quality","Performance","Durability","Reliability","Aesthetics","Features","checkFormulasAccess","_favor","_rep","_player","_exp","_mult","_skill","_server","_startingLevel","_extraLevels","_costMult","_startingRam","_startingCore","_extraCores","extraCores","_ramUsed","_maxRam","HScalculateHashGainRate","HScalculateLevelUpgradeCost","HScalculateRamUpgradeCost","HScalculateCoreUpgradeCost","_startingCache","_extraCache","extraCache","HScalculateCacheUpgradeCost","HScalculateServerCost","_gang","_member","_task","_points","_crimeType","_person","_classType","_locationName","checkTixApiAccess","getStockFromSymbol","_symbol","_shares","_posType","sanitizedPosType","_pos","orderPos","ltype","lpos","stockMarketOrders","forecast","checkGraftingAPIAccess","_focus","wasFocusing","craftableAug","getAugmentation","runAfterReset","cbScript","_purchased","_facName","costs","_cbScript","_programName","baseserver","installTime","wasWorking","_companyName","wasFocused","_field","repNeededToDonate","crimeTime","crimeStatsWithMultipliers","_nextBN","_callbackScript","nextBN","callbackScript","getPlayerFields","matchJS","matchScript","offenders","processScript","formatRules","formatOffenders","off","fileline","rule","wrapFunction","wrappedAPI","tree","functionName","branch","getNestedProperty","wrapAPILayer","setNestedProperty","incorrectUsage","newPath","allPrograms","allScripts","allTextFiles","allContracts","allMessages","folders","handleFn","dest","parsedFn","firstParentDir","msgOrLit","ClickableScriptRow","scriptLinksWrap","scriptLink","textDecorationLine","paddingRight","rowSplitArray","rowItem","onScriptLinkClick","ClickableMessageRow","linksWrap","link","onMessageLinkClick","FileType","postSegments","group","segments","linked","filesPerRow","Folder","numThreads","verboseEntries","t_dest","srcFile","sourcePath","destFile","destPath","positions","getCursor","re","matching","rsObj","delTarget","executableName","runContract","runProgram","commandArgs","runArgs","permissive","threadFlag","tailFlag","toLocaleLowerCase","hasRoot","maxHostname","maxIP","onDestServer","args2","headers","currRunningScripts","numSpacesScript","spacesScript","numSpacesPid","spacesPid","numSpacesThread","spacesThread","sourceFileObject","incMult","decMult","textfield","Language","InteractiveTutorialRoot","nsSelectionOpen","setNSSelectionOpen","setLanguage","tutorialScriptExtension","NS1","tutorialScriptName","contents","canNext","square","tab","updateOptions","readOnly","overviewContainer","visibilityToggle","collapse","Overview","setX","setY","CurrentIcon","KeyboardArrowUpIcon","KeyboardArrowDownIcon","LeftIcon","SchoolIcon","EqualizerIcon","fakeDrag","triggerMouseEvent","eventType","clickEvent","createEvent","initEvent","dispatchEvent","Loading","onStop","defaultPosition","onDoubleClick","openedMixin","transitions","easing","sharp","enteringScreen","closedMixin","leavingScreen","up","Drawer","styled","shouldForwardProp","active","borderLeft","listitem","SidebarRoot","hackingOpen","setHackingOpen","characterOpen","setCharacterOpen","worldOpen","setWorldOpen","helpOpen","setHelpOpen","flashTerminal","flashStats","flashActiveScripts","flashHacknet","flashCity","flashTutorial","augmentationCount","invitationsCount","programCount","getAvailableCreatePrograms","canOpenFactions","canOpenAugmentations","canOpenSleeves","canCorporation","canGang","canJob","canStockMarket","canBladeburner","canStaneksGift","clickTerminal","clickScriptEditor","clickStats","clickActiveScripts","clickCreateProgram","clickFactions","clickAugmentations","clickHacknet","clickCity","clickTravel","clickJob","clickBladeburner","clickGang","clickTutorial","clickOptions","handleShortcuts","altKey","E","H","R","P","F","U","G","anchor","timeout","unmountOnExit","clsx","badgeContent","NeuroFluxDisplay","EntropyDisplay","AugmentationsRoot","installOpen","setInstallOpen","InstalledAugmentations","sourceAugs","Alphabetically","aug1","aug2","BitNodeModifiedStats","MultiplierList","listItems","augmented","bnMult","py","disableTypography","disablePadding","PlayerMultipliers","augP","augObj","calculateAugmentedStats","leftColData","rightColData","PurchasedAugmentations","displayName","enterNextDelay","safeGetSf","sfNum","sfObj","getMaxLevel","SourceFilesElement","sourceSfs","sf1","sf2","selectedSf","setSelectedSf","DevMenuRoot","General","setError","setCorporationName","gangFaction","setGangFaction","addMoney","TransitionProps","expandIcon","bigNumber","modifyExp","modifier","modifyKarma","resetExperience","modifyFactionRep","AllFaction","modifyFactionFavor","labelId","arial-label","setAugmentation","validSFN","setSF","sfN","sfLvl","setAllSF","setProgram","AllPrograms","Servers","setServer","setCompany","modifyCompanyRep","AllCompanies","modifyCompanyFavor","modifyBladeburnerRank","modify","modifyBladeburnerCycles","modifyGangCycles","modifyCorporationFunds","modifyCorporationCycles","CodingContracts","setCodingcontract","cc","stockPrice","setStockPrice","setStockSymbol","processStocks","inputSymbols","SM","stocks","sleeveSetStoredCycles","Stanek","modCycles","modCharge","TimeSkip","timeskip","SaveFile","importInput","setSaveFile","restoreScripts","setRestoreScripts","restoreAugs","setRestoreAugs","restoreSFs","setRestoreSFs","File","FileList","ii","playerAchievement","setPlayerAchievements","achieved","grantAchievement","removeAchievement","Entropy","BladeburnerRoot","travelOpen","setTravelOpen","inFaction","wordBreak","TravelModal","nopadding","preformatted","Line","Console","setCommand","consoleInput","consoleHistoryIndex","setConsoleHistoryIndex","Logs","tabIndex","inputRef","prevCommand","currentTarget","scrollHook","scrollTop","scrollHeight","AllPages","GeneralActionPage","GeneralActionList","actions","GeneralActionElem","computedActionTimeCurrent","actionData","ContractPage","ContractList","ContractElem","StealthIcon","KillIcon","OperationPage","OperationList","OperationElem","TeamSizeModal","BlackOpPage","BlackOpList","blackopName","blackop","BlackOpElem","hasReqdRank","SkillPage","valid","onUpgrade","SkillList","SkillElem","canLevel","GangRoot","Provider","ManagementSubpage","GangStats","territoryStr","BonusTime","CyclerPerSecond","bonusMillis","GangMemberList","ascendOnly","setAscendOnly","onRecruit","GangMemberCard","GangMemberCardContent","ascendOpen","setAscendOpen","borderRightWidth","onAscend","borderLeftWidth","onTaskChange","GangMemberStats","asc","KillScriptsModal","TaskSelector","currentTask","setCurrentTask","contextMember","TaskDescription","AscensionModal","RecruitButton","RecruitModal","setName","recruit","onKeyUp","TerritorySubpage","gangNames","infoOpen","setInfoOpen","formatTerritory","OtherGangTerritory","clashVictoryChance","TerritoryInfoModal","NextReveal","PurchasedUpgrade","UpgradeButton","GangMemberUpgradePanel","currentCategory","setCurrentCategory","filterUpgrades","weaponUpgrades","armorUpgrades","vehicleUpgrades","rootkitUpgrades","augUpgrades","categories","Weapons","Vehicles","Rootkits","EquipmentsSubpage","CorporationRoot","setDivisionName","canExpand","industryType","MainPanel","CityTabs","setCity","cityStateSetter","SwitchButton","manualMode","switchMode","ManualManagement","setEmployee","employeePositionSelectorInitialValue","employeePositions","positionNames","EmployeeCount","currJob","nextJob","nextUna","AutoManagement","vechain","totalMorale","totalHappiness","totalEnergy","avgMorale","avgHappiness","avgEnergy","currUna","IndustryOffice","upgradeOfficeSizeOpen","setUpgradeOfficeSizeOpen","throwPartyOpen","setThrowPartyOpen","employeeManualAssignMode","setEmployeeManualAssignMode","UpgradeSizeButton","upgradeSize","UpgradeOfficeSizeModal","upgradeCost","upgradeCost15","maxMult","maxNum","multIncrease","upgradeCostMax","ThrowPartyModal","setCost","canParty","EffectText","MakeProductButton","makeOpen","setMakeOpen","hasMaxProducts","createProductButtonText","IndustryOverview","researchOpen","setResearchOpen","advertisingInfo","advertisingFactors","totalAdvertisingFac","convertEffectFacToGraphic","MakeProductModal","allCities","design","setDesign","marketing","setMarketing","createProductPopupText","Upgrade","wrapInTooltip","ele","but","ResearchModal","retainHeight","WarehouseRoot","smartSupplyOpen","setSmartSupplyOpen","canAffordUpgrade","stateText","mats","isInStock","isRelevant","breakdownItems","breakdown","previous","IndustryWarehouse","EmptyWarehouse","Leftover","setChecked","SmartSupplyModal","ProductElem","sellOpen","setSellOpen","limitOpen","setLimitOpen","discontinueOpen","setDiscontinueOpen","cancelOpen","setCancelOpen","marketTaOpen","setMarketTaOpen","nfB","hasUpgradeDashboard","sellButtonText","limitProductionButtonText","DiscontinueProductModal","LimitProductProductionModal","setLimit","SellProductModal","iQty","setQty","setPx","initialPrice","MarketTA2","ProductMarketTaModal","CancelProductModal","MaterialElem","purchaseMaterialOpen","setPurchaseMaterialOpen","exportOpen","setExportOpen","sellMaterialOpen","setSellMaterialOpen","materialMarketTaOpen","setMaterialMarketTaOpen","limitProductionOpen","setLimitProductionOpen","tutorial","purchaseButtonText","limitMaterialButtonText","disablePurchaseLimit","ExportModal","possibleDivisions","defaultDivision","setIndustry","setAmt","removeExport","currentDivision","possibleCities","newCost","setNewCost","MaterialMarketTaModal","SellMaterialModal","setPrice","BulkPurchaseSection","setBuyAmt","setDisabled","BulkPurchaseText","parsedAmt","PurchaseMaterialModal","purchaseMaterial","LimitMaterialProductionModal","IndustryProductEquation","reqs","reqAmt","ExpandNewCity","ExpandIndustryTab","possibleIndustries","newIndustry","multRows","appendMult","DividendsStats","PublicButtons","PrivateButtons","BribeButton","Upgrades","findInvestorsopen","setFindInvestorsopen","goPublicopen","setGoPublicopen","fundingAvailable","findInvestorsTooltip","upgradeData","sellSharesOpen","setSellSharesOpen","buybackSharesOpen","setBuybackSharesOpen","issueNewSharesOpen","setIssueNewSharesOpen","issueDividendsOpen","setIssueDividendsOpen","sellSharesOnCd","sellSharesTooltip","issueNewSharesOnCd","issueNewSharesTooltip","canBribe","totalDividends","playerEarnings","storedTime","LevelableUpgrade","xs","UU","BribeFactionModal","selectedFaction","setSelectedFaction","getRepText","SellSharesModal","setShares","ProfitIndicator","BuybackSharesModal","CostIndicator","IssueDividendsModal","percent","setPercent","canIssue","maxNewSharesUnrounded","maxNewShares","newShares","IssueNewSharesModal","issueNewShares","privateOwnedRatio","maxPrivateShares","privateShares","dialogContents","FindInvestorsModal","GoPublicModal","InfiltrationRoot","setStart","StartingDifficulty","Difficulty","Reward","cancel","Stage","minigames","SlashGame","BracketGame","BackwardGame","BribeGame","CheatCodeGame","Cyberpunk2077Game","MinesweeperGame","WireCuttingGame","Game","setLevel","stage","setStage","Countdown","results","setResults","gameIds","setGameIds","lastGames","nextGameId","ids","setupNextGame","pushResult","stageComponent","onFinish","Minigame","MiniGame","onSuccess","Sell","onFailure","automated","Progress","difficulties","timer","words","makeAnswer","setGuess","hasAugment","BACKSPACE","shiftKey","ignorableKeyboardEvent","nextGuess","setRight","OPEN_BRACKET","LESS_THAN","OPEN_PARENTHESIS","OPEN_BRACE","generateLeftSide","CLOSE_PARENTHESIS","CLOSE_BRACKET","CLOSE_BRACE","GREATER_THAN","getChar","positive","option","negative","shuffleArray","makeChoices","correctIndex","setCorrectIndex","setIndex","currentChoice","choice","defaultColor","disabledColor","upColor","downColor","choiceColor","upIndex","upDistance","downIndex","downDistance","onCorrectIndex","newIndex","arrows","arrow","generateCode","puzzle","randChar","generatePuzzle","answers","generateAnswers","currentAnswerIndex","setCurrentAnswerIndex","setPos","flatGrid","isCorrectAnswer","optionColor","move","mines","minefield","generateEmptyField","generateMinefield","memoryPhase","setMemoryPhase","flagged","marked","fieldEquals","phase","setPhase","phaseZeroTime","timeUntilAttacking","Victory","quitInfiltration","handleInfiltrators","soa","infiltrationRepGain","isMemberOfInfiltrators","wiresmin","wiresmax","PIPE","DOT","FORWARD_SLASH","HYPHEN","HASH","colorNames","blue","wires","numWires","wireColors","generateWires","cutWires","setCutWires","questions","numQuestions","questionGenerators","randomPositionQuestion","randomColorQuestion","generateQuestion","checkWire","wireNum","shouldCut","wiresToBeCut","shouldBeCut","question","isCorrectWire","wire","wireColor","cutColor","arrowPart","Intro","CYCLES_PER_SEC","ExpRows","WorkInProgressRoot","workInfo","buttons","stopText","completion","unfocus","classWork","elapsed","stopTooltip","comp","tooltipInfo","GameOptionsRoot","currentTab","setCurrentTab","SYSTEM","setTab","INTERFACE","GAMEPLAY","MISC","REMOTE_API","SideBarTab","sideBarProps","tabName","GameOptionsSidebar","diagnosticOpen","setDiagnosticOpen","importSaveOpen","setImportSaveOpen","importData","setImportData","confirmedImportGame","alt","ServerAccordion","FileDiagnosticModal","FontFamilyField","refreshId","errorText","setErrorText","setFontFamily","LineHeightField","setLineHeight","StyleEditorModal","setRefreshId","customStyle","setCustomStyle","persistToSettings","endIcon","ColorEditor","onColorChange","hideTextfield","deferred","newColor","disableAlpha","ThemeEditorModal","customTheme","setCustomTheme","setTemplateTheme","placement","maxRows","importedTheme","GameplayPage","InterfacePage","timestampFormat","setTimestampFormat","setLocale","MiscPage","RemoteAPIPage","remoteFileApiPort","setRemoteFileApiPort","isConnected","ConnectionBauble","setConnection","ipaddr","address","protocol","WebSocket","handleMessageEvent","response","SystemPage","execTime","setExecTime","recentScriptsSize","setRecentScriptsSize","logSize","setLogSize","portSize","setPortSize","terminalSize","setTerminalSize","autosaveInterval","setAutosaveInterval","_event","SleeveRoot","FAQOpen","setFAQOpen","SleeveElem","statsOpen","setStatsOpen","augmentationsOpen","setAugmentationsOpen","abc","setABC","doing","MoreStatsModal","SleeveAugmentationsModal","PurchaseAugmentationModal","universitySelectorOptions","gymSelectorOptions","bladeburnerSelectorOptions","possibleJobs","forbiddenCompanies","otherSleeve","possibleFactions","forbiddenFactions","factionObj","second","universities","gyms","possibleContracts","Synchronize","canDo","getABC","s0","setS0","setS1","setS2","validActions","detailsF","details2","detail","FAQModal","HacknetRoot","purchaseMultiplier","setPurchaseMultiplier","purchaseMultiplierOnClicks","onClicks","GeneralInfo","HacknetNodeElem","purchaseMult","upgradeLevelButton","upgradeRAMButton","upgradeCoresButton","increase","upgradeLevelCost","upgradeRamCost","upgradeCoreCost","HacknetServerElem","upgradeRamButton","upgradeCacheButton","base_increase","modded_increase","upgradeCacheCost","HashUpgradeModal","serversMap","HacknetUpgradeElem","selectedServer","setSelectedServer","MultiplierButton","MultiplierButtons","btnProps","PlayerInfo","hasServers","PurchaseButton","GenericLocation","locContent","locName","getLocationSpecificContent","CompanyLocation","quitOpen","setQuitOpen","isEmployedHere","favorGain","onQuit","QuitJobModal","GymLocation","train","HospitalLocation","currHp","getHealed","btnStyle","SlumsLocation","shopliftChance","robStoreChance","mugChance","larcenyChance","drugsChance","bondChance","armsChance","homicideChance","gtaChance","kidnapChance","assassinateChance","heistChance","SpecialLocation","handleBladeburner","worldHeader","HTMLElement","handleGrafting","CreateCorporation","handleCotMG","renderBladeburner","toStanek","renderCotMG","CreateCorporationModal","canSelfFund","n00dlePower","ArcadeRoot","Megabyteburner2000","currentGame","BBCabinetRoot","origin","joystick","borderStyle","borderWidth","ServerButton","TechVendorLocation","purchaseServerButtons","RamButton","TorButton","purchaseTorRouter","CoresButton","maxCores","PurchaseServerModal","setHostname","tryToPurchaseServer","TravelConfirmationModal","UniversityLocation","take","dataStructuresCost","networksCost","algorithmsCost","managementCost","leadershipCost","GameType","CasinoLocation","setGame","Coin","Slots","Roulette","numDecks","drawCard","CoinFlip","investment","setInvestment","setResult","setStatus","playLock","setPlayLock","play","correct","redNumbers","strategies","Red","payout","Black","Odd","Even","High","Low","Third1","Third2","Third3","Single","canPlay","setCanPlay","lock","setLock","strategy","playerWin","isRed","currentNumber","getPayout","payLines","SlotMachine","locks","setLocks","stoppedOne","getPaylineData","payline","point","countSequence","checkWinnings","getTable","LocationLetter","ASCIICity","locationLettersRegex","letterMap","K","M","N","Q","V","Y","lineElems","startI","endI","locationI","ListCity","locationButtons","LocationCity","OptionsModal","setInsertSpaces","setFontSize","setWordWrap","setVim","themePath","themeCopy","setThemeCopy","MilestonesRoot","milestones","highestMilestone","milestone","ActionTimer","TerminalRoot","setKey","doScroll","hook","scrollIntoView","debounced","maxWait","unsubscribe","scrollId","TerminalInput","terminalInput","postUpdateValue","setPostUpdateValue","possibilities","setPossibilities","saveValue","postUpdate","modifyInput","mod","inputLength","selectionStart","inputText","delStart","moveTextCursor","keyDown","autoComplete","onBlur","TAB","semiColonIndex","allPos","determineAllPossibilitiesForTabCompletion","tabCompletion","selectionEnd","anchorEl","parentDirPath","evaledParentDirPath","addAllCodingContracts","cct","addAllLitFiles","addAllPrograms","addAllScripts","processFilepath","addAllTextFiles","addAllDirectories","subdirs","t_parentDirPath","convertParentPath","isCommand","t_cmd","autocomplete","flagFunc","autocompleteData","txts","pos2","scriptAutocomplete","addAllMessages","allPossibilities","oldValue","longestStartSubstr","TutorialRoot","confirmResetOpen","setConfirmResetOpen","ActiveScriptsRoot","ScriptProduction","prodRateSinceLastAug","ServerAccordions","setRowsPerPage","serverToScriptMap","filtered","rowsPerPageOptions","newPage","onRowsPerPageChange","ActionsComponent","paddedName","barOptions","headerTxt","ServerAccordionContent","noborder","WorkerScriptAccordion","killScript","onlineMps","onlineEps","RecentScriptsPage","recentScript","RecentScriptAccordion","MainPage","onAugmentations","sleevesOpen","setSleevesOpen","isPlayersGang","favorToDonate","canDonate","canPurchaseSleeves","startHackingContracts","startFieldWork","startSecurityWork","FactionRoot","purchasingAugs","setPurchasingAugs","routeToMainPage","AugmentationsPage","getAugs","augName1","augName2","getAugsSortedByCost","getAugsSortedByReputation","Purchasable","canBuy","hasReq","hasRep","cantBuy","getAugsSortedByPurchasable","purchasable","multiplierComponent","showModal","DonateOption","donateAmt","setDonateAmt","Status","noformat","DefaultAssignment","Info","Assignment","CovenantPurchasesRoot","setUpdate","purchaseDisabled","upgradePanels","CovenantSleeveMemoryUpgrade","maxMemory","purchaseBtnDisabled","purchaseBtnContent","GangButton","gangOpen","setGangOpen","CreateGangModal","EmployersModal","MultiplierTable","noMargin","effValue","CurrentBitNode","MoneyModal","convertMoneySourceTrackerToString","CharacterStats","moneyOpen","setMoneyOpen","employersOpen","setEmployersOpen","timeRows","showBitNodeMults","isEqual","StockMarketRoot","Purchase4SMarketDataTixApiAccessButton","PurchaseWseAccountButton","PurchaseTixApiAccessButton","Purchase4SMarketDataButton","InfoAndPurchases","StockTickers","setTickerDisplayMode","AllStocks","watchlistSymbols","setWatchlistSymbols","tickers","stockMarketProp","rerenderAllTickers","sanitizedWatchlist","SelectorOrderType","StockTicker","setOrderType","Market","tickerOpen","setTicketOpen","modalProps","setModalProps","placeText","getQuantity","hasOrderAccess","Limit","Stop","getBuyTransactionCostContent","getSellTransactionCostContent","playerMoney","localesWithLongPriceFormat","StockTickerHeaderText","stockPriceFormat","spacesAllottedForStockPrice","spacesAfterStockName","spacesBeforePrice","hdrText","plusOrMinus","StockTickerOrderList","StockTickerOrder","posTxt","LongPosition","percentageGains","ShortPosition","StockTickerPositionText","PlaceOrderModal","portal","level0","level1","level2","level3","BitNodePortal","portalOpen","setPortalOpen","cssClass","aria-description","BitverseRoot","destroyed","destroySequence","setDestroySequence","nextSourceFileLvl","PortalModal","bitNodeKey","maxSourceFileLevel","newLevel","CinematicLine","setLength","ms","newLength","advance","StaneksGiftRoot","MainBoard","setGhostGrid","setRotation","selectedFragment","setSelectedFragment","moveGhost","clickAt","deleteAt","doRotate","selectFragment","FragmentInspector","setC","effectAmt","FragmentOption","colorAt","FragmentSelector","FragmentPreview","ActiveFragmentSummary","summary","coordinate","formatEffect","getComputedStyle","Element","visibility","AchievementsRoot","AchievementList","cssPrimary","cssSecondary","secret","unavailable","locked","pr","defaultExpanded","AchievementIcon","imgLoaded","setImgLoaded","onLoad","ErrorBoundary","Component","hasError","componentDidCatch","ex","previousScrollY","modalOpen","setModalOpen","modalImageSrc","setModalImageSrc","predefinedThemes","themes","templateTheme","onActivated","scrollY","previousColors","onImageClick","handleZoom","ThemeEntry","subheader","image","ComparisonIcon","isBetter","initialAutosave","ImportSaveRoot","currentData","setCurrentData","importModalOpen","setImportModalOpen","headback","setHeadback","dataBeingImported","dataCurrentlyInGame","fetchData","BypassWrapper","tampering","last","minute","timeCompression","ReactDOM","globalThis","onbeforeunload"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IA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cACJvlB,SAAUwmB,IAAeiyB,QACzB3yC,iBAAkB,GAClBF,eAAe,EACfizC,aAAa,EACb1yC,mBAAmB,EACnBN,OAAQ,IAEV4f,YAAgB+uC,IAGpB,GAAIzB,EAAM,GAAI,CAEZU,YAAS,IACT,MAAMj4D,EAASw3D,EAAS,kBACpBx3D,GAAQW,IAAOm9B,kBAAkBm7B,YAAYj5D,GACjD,MAAMk5D,EAAQ1B,EAAS,sBACnB0B,GAAOv4D,IAAOk1B,cAAcl4B,KAAK,CAAEuB,KAAMg6D,EAAO9hC,MAAO,IAY7D,GAVImgC,EAAM,KACRqB,IACAO,eAEE5B,EAAM,KACRC,EAAUx1C,YAAc,MAEtBu1C,EAAM,IACR52D,IAAOm9B,kBAAkBlvB,QAAQgY,QAASnoB,GAAMA,EAAE+N,SAASooC,SAAS,SAAWn2C,EAAE+N,UAAY,QAE3F+qD,EAAM,GAAI,CACZ,MAAM6B,EAAqB,CACzB,sBACA,qBACA,qBACA,oBACA,eACA,gBACA,eACA,iBACA,eACA,gBACA,mBACA,oBACA,mBACA,qBACA,mBACA,oBACA,mBACA,mBACA,mBACA,qBACA,kBACA,0BACA,kCACA,6BACA,8BACA,+BACA,+BACA,gCACA,4BACA,kCACA,cACA,eACA,cACA,gBACA,cACA,eACA,mBACA,cACA,YACA,WACA,eACA,cACA,yBACA,gCACA,sBACA,qBACA,qBACA,qBACA,qBACA,qBACA,kBACA,oBACA,oBACA,oBACA,mBACA,mBACA,mBACA,mBACA,mBACA,gBACA,kBACA,oBACA,sBACA,wBACA,8BACA,YACA,YACA,aACA,0BACA,2BACA,kBACA,4BACA,0BACA,UACA,SACA,WACA,UACA,YACA,UACA,WACA,gBAEIC,EAAqB,CACzB,cACA,WACA,aACA,UACA,WACA,UACA,YACA,UACA,WACA,eACA,SACA,cACA,eACA,cACA,gBACA,cACA,eACA,mBACA,eACA,gBACA,eACA,iBACA,eACA,gBACA,mBACA,oBACA,mBACA,qBACA,mBACA,oBACA,sBACA,qBACA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IK,OAItB,SAAS6sD,EAAaroB,GAC3B,IAAK,MAAMsoB,KAAYpB,EACrB,GAAIoB,EAAStoB,KAAOA,EAAI,OAAOsoB,EAEjC,OAAO,MAGT,WACE,MAAMC,GAAI,EACJC,GAAI,EACVtB,EAAUziE,KACR,IAAI0iE,EACF,EACAsB,IAAOC,EACP7uB,IAAaO,QACb,EACA,IAGJ8sB,EAAUziE,KACR,IAAI0iE,EACF,EACAsB,IAAOE,EACP9uB,IAAaO,QACb,EACA,IAGJ8sB,EAAUziE,KACR,IAAI0iE,EACF,EACAsB,IAAOG,EACP/uB,IAAaI,aACb,IACA,IAIJitB,EAAUziE,KACR,IAAI0iE,EACF,EACAsB,IAAOI,EACPhvB,IAAaK,aACb,EACA,IAGJgtB,EAAUziE,KACR,IAAI0iE,EACF,EACAsB,IAAOK,EACPjvB,IAAaM,YACb,GACA,IAGJ+sB,EAAUziE,KACR,IAAI0iE,EACF,GACAsB,IAAOG,EACP/uB,IAAaQ,SACb,EACA,IAGJ6sB,EAAUziE,KACR,IAAI0iE,EACF,GACAsB,IAAOp0C,EACPwlB,IAAaS,QACb,EACA,IAGJ4sB,EAAUziE,KACR,IAAI0iE,EACF,GACAsB,IAAOp0C,EACPwlB,IAAaU,UACb,EACA,IAGJ2sB,EAAUziE,KACR,IAAI0iE,EACF,GACAsB,IAAOC,EACP7uB,IAAaW,QACb,EACA,IAGJ0sB,EAAUziE,KACR,IAAI0iE,EACF,GACAsB,IAAOC,EACP7uB,IAAaY,SACb,EACA,IAGJysB,EAAUziE,KACR,IAAI0iE,EACF,GACAsB,IAAOI,EACPhvB,IAAaa,aACb,EACA,IAGJwsB,EAAUziE,KACR,IAAI0iE,EACF,GACAsB,IAAOM,EACPlvB,IAAac,YACb,EACA,IAGJusB,EAAUziE,KACR,IAAI0iE,EACF,GACAsB,IAAOK,EACPjvB,IAAae,IACb,GACA,IAGJssB,EAAUziE,KACR,IAAI0iE,EACF,GACAsB,IAAOK,EACPjvB,IAAagB,UACb,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CACEH,WAAY,SACZrsC,WAAY,SACZosC,MAAO,IAET,CACEC,WAAY,SACZD,MAAO,WAET,CACEC,WAAY,SACZD,MAAO,UAET,CACEA,MAAO,SACPC,WAAY,UAEd,CACED,MAAO,eACPC,WAAY,UAEd,CACEA,WAAY,SACZD,MAAO,YAET,CACEC,WAAY,SACZD,MAAO,WAET,CACEA,MAAO,2BACPC,WAAY,UAEd,CACED,MAAO,KACPC,WAAY,UAEd,CACED,MAAO,oBACPC,WAAY,UAEd,CACED,MAAO,gBACPC,WAAY,UAEd,CACED,MAAO,qBACPC,WAAY,UAEd,CACED,MAAO,sBACPC,WAAY,UAEd,CACED,MAAO,uBACPC,WAAY,UAEd,CACED,MAAO,OACPC,WAAY,WAGhBr7C,OAAQ,CACN,oBAAqB,UACrB,oBAAqB,UACrB,6BAA8B,UAC9B,iCAAkC,UAClC,0BAA2B,UAC3B,8BAA+B,UAC/B,qCAAsC,UACtC,kCAAmC,aAIvC27C,EAAOC,OAAOC,YAAY,UAAW,CACnCjC,KAAM,UACNC,SAAS,EACT2B,MAAO,CACL,CACExsC,WAAY,SACZqsC,WAAY,SACZD,MAAO,IAET,CACEC,WAAY,SACZD,MAAO,WAET,CACEC,WAAY,SACZD,MAAO,UAET,CACEA,MAAO,SACPC,WAAY,UAEd,CACED,MAAO,eACPC,WAAY,UAEd,CACEA,WAAY,SACZD,MAAO,YAET,CACEC,WAAY,SACZD,MAAO,WAET,CACEA,MAAO,2BACPC,WAAY,UAEd,CACED,MAAO,KACPC,WAAY,SACZS,UAAW,UAGb,CACEV,MAAO,oBACPC,WAAY,UAEd,CACED,MAAO,gBACPC,WAAY,UAEd,CACED,MAAO,qBACPC,WAAY,SACZS,UAAW,UAEb,CACEV,MAAO,sBACPC,WAAY,UAEd,CACED,MAAO,2BACPC,WAAY,UAEd,CACED,MAAO,uBACPC,WAAY,UAEd,CACED,MAAO,OACPC,WAAY,SACZS,UAAW,WAGf97C,OAAQ,CACN,oBAAqB,UACrB,oBAAqB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B37E,EAAKp3D,MAAM,EAAG8jC,EAAKyxF,OAAO7mH,MAAM,QAAU,IAAI/R,OAAS,KAQ5Eo2I,EAwIF,SAASpoC,EAAkBwoC,EAAkB/oC,GAClD,IACE,OAAO8lC,EAAsB9lC,EAAc+oC,GAC3C,MAAOrjI,GAGP,OAFAlM,QAAQwM,MAAO,gDACfxM,QAAQwM,MAAMN,GACP,CAAE0zB,KAAMm7F,IAAwBzuH,gB,6BC7XpC,SAAS4wE,EAAWsyD,GAGzB,QAF0BrtI,KAAKkC,MAAMxH,WAAc2yI,EAAF,QAExC,OAPX,mC,6BCAA,oEAEO,MAAMC,EAA6B,CACxC,oDACA,IACA,8EACA,sFACA,sFACA,mFACA,8EACA,qEACA,6EACA,2EACA,gEACA,uEACA,uDACA,4FACA,8EACA,kFACA,mHACA,oEACA,kGACA,wEACA,oEACA,gFACA,6FACA,4FACA,6EACA,2FACA,iGACA,6EACA,4GACA,0FACA,yEACA,uEACA,gGACA,0FACA,iFACA,+FACA,0FACA,4FACA,uEACA,wHACA,sFACA,iFACA,KAGIC,EACWvQ,GACN,CACJ,UAASA,wBACT,IACA,4GACA,4FACA,IACA,4CAA2CA,kDAC3C,kBAAiBA,yEACjB,IACA,YACA,IACA,OAAMA,YACN,OAAMA,qBACN,IACA,OAAMA,WACN,OAAMA,iBACN,KAKMwQ,EAAsC,CACjDjiE,MAAO,CACL,oCACA,IACA,4FACA,uGACA,yHACA,kGACA,IACA,gCACA,IACA,mHACA,yHACA,4CACA,IACA,gCACA,IACA,6DACA,IACA,eACA,IACA,2HACA,4HACA,IACA,mCACA,IACA,8GACA,IACA,uHACA,uCACA,IACA,uDACA,KAEFkiE,QAAS,CACP,iBACA,IACA,0GACA,mHACA,kHACA,gCACA,KAEFC,SAAU,CACR,kBACA,IACA,6FACA,IACA,+BACA,KAEF5oG,IAAK,CACH,iCACA,IACA,yEACA,IACA,oHACA,oDACA,IACA,+FACA,IACA,wGACA,KAEF6oG,IAAK,CACH,oBACA,IACA,6EACA,IACA,iBACA,IACA,kBACA,IACA,sBACA,KAEFC,GAAI,CACF,kBACA,IACA,yGACA,iFACA,IACA,yBACA,IACA,eACA,IACA,aACA,KAEFC,MAAO,CACL,uCACA,IACA,+HACA,uDACA,kIACA,IACA,oCACA,IACA,gGACA,IACA,sCACA,KAEFh2D,MAAO,CACL,eACA,IACA,mIACA,uIACA,KAEFi2D,IAAK,CACH,aACA,IACA,mIACA,yIACA,KAEFj+C,QAAS,CACP,4BACA,IACA,+FACA,oIACA,8GACA,KAEFk+C,GAAI,CAAC,wBAAyB,IAAK,wEAAyE,KAC5G7+E,SAAU,CACR,qCACA,IACA,mFACA,IACA,4GACA,IACA,kDACA,IACA,0CACA,IACA,0CACA,KAEF8+E,KAAM,CACJ,wCACA,IACA,oFACA,IACA,oBACA,IACA,WACA,IACA,wBACA,IACA,qFACA,KAEFC,KAAM,CACJ,cACA,IACA,gIACA,gCACA,KAEFx0C,KAAM,CACJ,cACA,IACA,6GACA,2CACA,KAEF16F,KAAM,CACJ,cACA,IACA,uHACA,KAEFmvI,KAAM,CACJ,wBACA,IACA,yHACA,0HACA,mEACA,IACA,iBACA,IACA,wBACA,KAEFC,QAAS,CACP,sBACA,IACA,6GACA,KAEFn1F,KAAM,CACJ,cACA,IACA,sGACA,KAEFj7C,SAAU,CAAC,kBAAmB,IAAK,4CAA6C,KAChFsvE,KAAM,CACJ,mDACA,IACA,4EACA,IACA,6EACA,4EACA,iFACA,4DACA,IACA,uCACA,IACA,qEACA,IACA,wCACA,IACA,qFACA,KAEFwtB,QAAS,CACP,iBACA,IACA,4CACA,2HACA,uHACA,2EACA,KAEFG,GAAI,CACF,wCACA,IACA,iIACA,sDACA,IACA,8FACA,IACA,gFACA,IACA,yHACA,IACA,YACA,IACA,wEACA,IACA,2BACA,IACA,iEACA,IACA,yBACA,IACA,uFACA,IACA,oCACA,KAEFozC,MAAO,CAAC,eAAgB,IAAK,wDAAyD,KAEtFC,IAAK,CACH,4CACA,IACA,6HACA,2HACA,gFACA,IACA,qBACA,IACA,2BACA,IACA,4HACA,iFACA,KAEF3lF,GAAI,CACF,yBACA,IACA,6FACA,6FACA,kCACA,IACA,kFACA,kBACA,aACA,IACA,qEACA,IACA,oCACA,KAEF4lF,KAAMf,EAAgC,QACtCtyC,GAAI,CAAC,YAAa,IAAK,4DAA6D,KACpF8B,GAAI,CACF,mBACA,IACA,6GACA,IACA,kDACA,KAEFriE,IAAK,CACH,sDACA,IACA,gDACA,IACA,sHACA,2GACA,gEACA,2DACA,2FACA,IACA,kHACA,iFACA,KAEFs+D,KAAM,CACJ,cACA,IACA,6HACA,2CACA,KAEF,eAAgB,CACd,mCACA,IACA,kGACA,wGACA,4EACA,IACA,uGACA,qGACA,0BACA,IACA,iHACA,yGACA,UACA,IACA,2GACA,sEACA,KAEF+B,IAAK,CACH,4CACA,IACA,8EACA,2GACA,oCACA,2FACA,IACA,6BACA,IACA,wCACA,KAEFwzC,MAAO,CAAC,eAAgB,IAAK,oEAAqE,KAElGpwC,KAAM,CACJ,sCACA,IACA,oHACA,uHACA,oEACA,IACA,8BACA,IACA,gFACA,IACA,+BACA,KAEF3vB,IAAK,CACH,aACA,IACA,yGACA,+BACA,KAEFggE,QAAS,CACP,8BACA,IACA,mFACA,IACA,iDACA,IACA,oBACA,IACA,kCACA,IACA,gBACA,IACA,kGACA,KAEFxzH,IAAKuyH,EAAgC,OACrCj1G,OAAQ,CACN,gBACA,IACA,oHACA,iEACA,KAEFylE,KAAM,CACJ,kCACA,IACA,iGACA,iGACA,0CACA,IACA,mGACA,iDACA,IACA,mGACA,O,6BCheJ,iFAEA,IAAI0wC,EAAa,EAGV,SAASzzD,IACd,IAAI0zD,EAAcD,EAIdrd,GAAQ,EACZ,IAAK,IAAI16H,EAAI,EAAGA,EAAI,KAAO,CACzB,IAAKkqB,IAAc8uD,IAAIg/D,EAAch4I,GAAI,CACvC06H,GAAQ,EACRsd,GAA4Bh4I,EAC5B,MAGEA,IAAMgc,OAAOC,iBAAmB,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,iBAAgB/+I,EAAK,SAASA,EAAK,SACpC,6EACA,8CACAgT,KAAK,MAETw6C,WAAY,EACZyU,IAAK,IAqHI,CAnHO,CACZ,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SA4FG1xC,KAAK,IAAM3mB,KAAKC,SAAW,IAC3BhG,MAAM,EAAG,GACTmP,KAAK,IA5FG,CACX,YACA,YACA,UACA,WACA,YACA,UACA,UACA,YACA,YACA,UACA,UACA,WACA,WACA,YACA,YACA,WACA,UACA,UACA,WACA,WACA,UACA,WACA,UACA,UACA,WACA,WACA,UACA,YACA,WACA,WACA,WACA,WACA,YACA,YACA,UACA,YACA,WACA,YACA,WACA,WACA,WACA,UACA,UACA,YACA,YACA,UACA,UACA,UACA,WACA,WACA,UACA,YACA,WACA,WACA,WACA,UACA,UACA,UACA,UACA,UACA,WACA,WACA,UACA,UACA,UACA,WACA,YACA,WACA,WACA,UACA,UACA,UACA,WACA,WACA,WACA,UACA,WACA,WACA,UACA,UACA,UACA,YACA,UACA,UACA,WACA,aAOKud,KAAK,IAAM3mB,KAAKC,SAAW,IAAK,IAGzCxH,KAAM,iCACN+/D,SAAU,GACVF,OAAQ,CAAC68E,EAAgBH,KACvB,IAAK9tI,MAAMC,QAAQguI,GAAQ,MAAM,IAAIrtI,MAAM,kCAC3C,MAAM1R,EAAO++I,EAUb,MAPe,IAAI/+I,EAAK,IACrB+5B,IAAI,CAACpJ,EAAGrwB,IACM,MAANqwB,EACHA,EACAhgB,OAAOs0I,cAAet0H,EAAEmB,WAAW,GAAK,IAAS9xB,EAAK,GAAG8xB,WAAWxxB,EAAIN,EAAK,GAAGQ,SAAW,GAAM,KAEtGwS,KAAK,MACU4rI,M,6BCr2DxB,0JAiBO,MAAMt7E,EAAsB,IAAIxnB,IAEhC,SAASopG,IACd,MAAO94H,EAAO+4H,GAAYrgI,mBAAwB,OA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,oBAAoB1vE,IAE7CplE,KAAK20I,2BAA2B30I,KAAK+yI,MAAO,SAAU9mE,GAEtDA,EAAU,SAAUqqE,EAAeC,GACjC,OAAOt9I,MAAMpQ,UAAU8Z,QAAQrZ,MAAM0W,KAAKusE,WAAYmnE,YAExD1zI,KAAK20I,2BAA2B30I,KAAK+yI,MAAO,UAAW9mE,GAEvDA,EAAU,SAAUqqE,EAAeC,GACjC,OAAOt9I,MAAMpQ,UAAUmS,YAAY1R,MAAM0W,KAAKusE,WAAYmnE,YAE5D1zI,KAAK20I,2BAA2B30I,KAAK+yI,MAAO,cAAe9mE,GAE3DA,EAAU,WAER,OADAhzE,MAAMpQ,UAAU6vB,KAAK3vB,KAAKiX,KAAKusE,YACxBvsE,MAETA,KAAK20I,2BAA2B30I,KAAK+yI,MAAO,OAAQ9mE,GAEpDjsE,KAAK2vI,WAAW1mJ,KAGd,kDACA,8CACA,kCACA,oEACA,YACA,wBACA,4BACA,yCACA,SACA,oBACA,+DACA,OACA,IACA,eACA,IACA,MAIA,mDACA,8CACA,+BACA,wFACA,wBACA,4BACA,gBACA,+DACA,kCACA,gBACA,kBACA,mDACA,IACA,IACA,cACA,IACA,MAKA,+BACA,mDACA,+BACA,sBACA,0DACA,IACA,wBACA,4BACA,yCACA,uDACA,IACA,8BACA,aACA,oBACA,qBACA,+CACA,iBACA,IACA,OACA,IACA,oBACA,KACA,sBACA,iBACA,MACA,IAKA,oCACA,wDACA,+BACA,sBACA,0DACA,IACA,wBACA,4BACA,yCACA,uDACA,IACA,8BACA,aACA,oBACA,qBACA,+CACA,YACA,IACA,OACA,IACA,aACA,KACA,sBACA,iBACA,MACA,IAIA,oDACA,8CACA,gCACA,kEACA,YACA,wBACA,4BACA,yCACA,SACA,oBACA,4CACA,OACA,IACA,IACA,MAIA,uDACA,8CACA,sBACA,0DACA,IACA,yCACA,wBACA,mDACA,4BACA,mCACA,mBACA,gBACA,IACA,yCACA,qEACA,yBACA,uBACA,qBACA,oBACA,2BACA,+BACA,uDACA,iCACA,8FACA,IACA,8BACA,oBACA,+DACA,wEACA,4CACA,eACA,IACA,0BACA,OACA,IACA,qBACA,gBACA,IACA,MAIA,gDACA,8CACA,gCACA,8DACA,eACA,wBACA,4BACA,yCACA,sBACA,SACA,oBACA,mDACA,OACA,IACA,YACA,IACA,MAIA,mDACA,8CACA,0CACA,kEACA,4DACA,gCACA,wBACA,WACA,oCACA,kBACA,kEACA,IACA,kBACA,IACA,yBACA,mDACA,IACA,gBACA,IACA,MAIA,wDACA,8CACA,0CACA,yGACA,kEACA,+BACA,wBACA,WACA,mCACA,eACA,kEACA,IACA,kBACA,IACA,wBACA,mDACA,IACA,gBACA,IACA,MAIA,iDACA,8CACA,+BACA,6DACA,wBACA,4BACA,+DACA,kCACA,iDACA,eACA,IACA,IACA,gBACA,IACA,MAEA,gBACA,oCACA,8CAEA,wCACA,2BACA,IAEA,0CACA,mBACA,kDACA,4CACA,sBACA,yBACA,sBACA,aACA,IACA,IACA,uBACA,IACA,eACA,KACA,QAEA,2DACA,8CACA,eACA,gBACA,0CACA,wFACA,IACA,wBACA,IACA,MACA,KAQJ2iF,EAAY/iF,UAAU+oJ,WAAa,SAAUrnC,GAC3C,IACIt+B,EADAmmE,EAAkBpyI,KAGtBisE,EAAU,SAAUhhF,GAElB,OADAA,EAAQ6N,OAAO7N,GACXmnJ,EAAgBmB,iBAElBvzI,KAAK7X,KAAO8C,EACL+U,MAGA/U,GAGX+U,KAAKw2I,OAASx2I,KAAKqyI,qBAAqBpmE,GAAS,GACjDjsE,KAAKqsE,YAAYk+B,EAAO,SAAUvqG,KAAKw2I,QAGvCx2I,KAAKqsE,YACHrsE,KAAKw2I,OACL,eACAx2I,KAAKqyI,qBAAqBv5I,OAAOs0I,cAAc,GAC/CxhE,EAAY4kE,0BAoBd,IAfA,IAAIiG,EAAY,CACd,SACA,aACA,SACA,UACA,cACA,QACA,SACA,YACA,oBACA,oBACA,cACA,cACA,QAEOhuJ,EAAI,EAAGA,EAAIguJ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B,CACE50B,KAAM,iKACNszE,UAAU,EACVD,WAAW,EACX5pG,KAAM,yBACN2zB,OAAQ,CACN8xD,YAAa,KACbW,WAAY,GACZI,UAAW,GACX75E,WAAY,GACZo5E,UAAW,GACX56B,WAAY,KAGhB,CACE50B,KAAM,2GACNszE,UAAU,EACVD,WAAW,EACX5pG,KAAM,mBACN2zB,OAAQ,CACN8xD,YAAa,KACbW,WAAY,KACZI,UAAW,IACX75E,WAAY,GACZo5E,UAAW,GACX56B,WAAY,KAGhB,CACE50B,KAAM,6HACNszE,UAAU,EACVD,WAAW,EACX5pG,KAAM,iBACN2zB,OAAQ,CACN8xD,YAAa,IACbW,WAAY,EACZz5E,WAAY,GACZo5E,UAAW,GACX56B,WAAY,KAGhB,CACE50B,KAAM,4GACNszE,UAAU,EACVD,WAAW,EACX5pG,KAAM,kBACN2zB,OAAQ,CACNyyD,YAAa,KACbI,UAAW,EACX75E,WAAY,GACZo5E,UAAW,GACX56B,WAAY,IAGhB,CACE50B,KAAM,qJACNszE,UAAU,EACVD,WAAW,EACX5pG,KAAM,aACN2zB,OAAQ,CACN8xD,YAAa,KACbW,WAAY,KACZI,UAAW,IACXb,UAAW,GACXC,UAAW,GACXC,UAAW,GACXC,UAAW,GACXC,UAAW,GACX56B,WAAY,IAGhB,CACE50B,KAAM,2JACNszE,UAAU,EACVD,WAAW,EACX5pG,KAAM,aACN2zB,OAAQ,CACN8xD,YAAa,KACbW,WAAY,KACZI,UAAW,GACXV,UAAW,GACXD,UAAW,GACXE,UAAW,GACX56B,WAAY,IACZ9+C,UAAW,CACTrK,MAAO,IACPoK,QAAS,EACTi6E,OAAQ,QAId,CACE9vD,KAAM,mKACNszE,UAAU,EACVD,WAAW,EACX5pG,KAAM,sBACN2zB,OAAQ,CACN8xD,YAAa,KACbW,WAAY,IACZI,UAAW,IACX75E,WAAY,GACZg5E,UAAW,GACXC,UAAW,GACXC,UAAW,GACXC,UAAW,GACXC,UAAW,GACX56B,WAAY,EACZ9+C,UAA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YACA,gBACA,qBACA,WACA,qBACA,YACA,kBACA,mBACA,gCACA,sBACA,qBACA,qBACA,kBACA,oBACA,oBACA,oBACA,qBACA,mBACA,YACA,UACA,WACA,UACA,YACA,UACA,WACA,eACA,cACA,eACA,cACA,gBACA,cACA,eACA,mBACA,KACA,SACA,gBACA,kBACA,YACA,mBAGIj+L,EAAQ,CACZ,sBACA,qBACA,qBACA,oBACA,eACA,mBACA,gBACA,oBACA,eACA,mBACA,iBACA,qBACA,eACA,mBACA,gBACA,oBACA,0BACA,kCACA,6BACA,8BACA,+BACA,mBACA,mBACA,kBACA,qBACA,mBACA,+BACA,gCACA,4BACA,mCAUWgwD,EAAa,KACxB,MAAM1Z,EAAO3vC,YAAU,QACvB,IAAK2vC,EAAM,MAAM,IAAIlxC,MAAM,gCAC3B,MAAMg2D,EAAiB,CACrB,CACE8iI,QAAS,sBACTC,YAAa,kBACbhvB,OAAQ,2DACRivB,UAAW,IAEb,CACEF,QAAS,wBACTC,YAAa,oBACbhvB,OAAQ,uGACRivB,UAAW,IAEb,CACEF,QAAS,wBACTC,YAAa,oBACbhvB,OAAQ,qGACRivB,UAAW,IAEb,CACEF,QAAS,WACTC,YAAa,OACbhvB,OACE,iJACFivB,UAAW,IAEb,CACEF,QAAS,kBACTC,YAAa,cACbhvB,OAAQ,4FACRivB,UAAW,IAEb,CACEF,QAAS,mBACTC,YAAa,eACbhvB,OAAQ,8FACRivB,UAAW,IAEb,CACEF,QAAS,oBACTC,YAAa,gBACbhvB,OAAQ,8FACRivB,UAAW,IAEb,CACEF,QAAS,0BACTC,YAAa,sBACbhvB,OAAQ,2EACRivB,UAAW,KAIf,IAAK,MAAMl3L,KAAM0yB,EACfwhC,EAAM5mE,KAAK,CACT0pM,QAAS,IAAIj5L,OAAQ,MAAKiC,EAAM,KAChCioK,OAAS,MAAKjoK,iCAAkCA,IAChDk3L,UAAW,KAIf,IAAK,MAAMh6J,KAAQpkC,EACjBo7D,EAAM5mE,KAAK,CACT0pM,QAA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kBAAC,IAAD,CAAY78K,MAAO,CAAEqxB,UAAWgsJ,EAAa,OAAS,eAAiBv8M,GACvE,kBAAC,IAAD,KACGq/K,EACD,kBAAC,IAAD,SAkBV,MAAM+8B,EAAQ,CACZ,YACA,SACA,MACA,cACA,QACA,SACA,YACA,SACA,MACA,OACA,SACA,OACA,UACA,WACA,OACA,YACA,UACA,SACA,MACA,MACA,OACA,QACA,YACA,UACA,KACA,SACA,SACA,YACA,QACA,YACA,UACA,UACA,WACA,WACA,YACA,SACA,OACA,MACA,aACA,aACA,YACA,OACA,SACA,WACA,QACA,aACA,SACA,UACA,cACA,UACA,OACA,MACA,WACA,SACA,cACA,MACA,aACA,WACA,OACA,MACA,UACA,QACA,WACA,UACA,aACA,QACA,UACA,MACA,OACA,SACA,WACA,WACA,UACA,QACA,cACA,cACA,YACA,SACA,OACA,SACA,QACA,WACA,WACA,WACA,OACA,SACA,WACA,YACA,OACA,OACA,YACA,YACA,OACA,QACA,UACA,YACA,WACA,aACA,YACA,OACA,WACA,WACA,SACA,MACA,WACA,UACA,SACA,gBACA,OACA,QACA,UACA,QACA,QACA,UACA,YACA,QACA,YACA,UACA,QACA,SACA,SACA,QACA,UACA,cACA,QACA,aACA,MACA,UACA,OACA,WACA,WACA,UACA,SACA,aACA,YACA,SACA,SACA,SACA,OACA,WACA,QACA,OACA,WACA,SACA,SACA,WACA,SACA,UACA,QACA,SACA,QACA,UACA,UACA,UACA,UACA,aACA,WACA,QACA,SACA,MACA,WACA,SACA,aACA,UACA,MACA,OACA,SACA,UACA,OACA,OACA,UACA,SACA,aACA,SACA,SACA,SACA,SACA,SACA,WACA,SACA,YACA,QACA,QACA,YACA,WACA,oBACA,WACA,OACA,UACA,cACA,UACA,SACA,UACA,gBACA,OACA,SACA,QACA,MACA,WACA,WACA,WACA,cACA,SACA,UACA,QACA,eACA,WACA,OACA,OACA,SACA,MACA,OACA,iBACA,WACA,UACA,UACA,UACA,iBACA,QACA,MACA,YACA,UACA,SACA,OACA,S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AASt0J,IACP6yD,cACAwnK,IAASrgE,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEFpkH,SAAS+mG,eAAe,SAlB5BjkD,cACA4hI,WAAU,MAAYp/M,IACtBo/M,WAAU,SAAeD,IACzBA,IAASrgE,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEFpkH,SAAS+mG,eAAe,SAG1B18J,WAAW6xI,IAA4B,KAarCl/D,IAAYjyD,UAAUX,GAIwB3a,SAASowD,KAAK9yC,WAAW,aACvEnmB,OAAO+9O,eAAiB,WACtB,MAAO,4BAKT/9O,OAAO0wE,MAAQ,KACb,MAAM,IAAI3iE,MAAM,6DAKlB/N,OAAO+jG,OAAS,KACd,MAAM,IAAIh2F,MAAM,gE","file":"main.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([1571,1]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import { PlayerObject } from \"./PersonObjects/Player/PlayerObject\";\nimport { sanitizeExploits } from \"./Exploits/Exploit\";\n\nimport { Reviver } from \"./utils/JSONReviver\";\n\nexport let Player = new PlayerObject();\n\nexport function loadPlayer(saveString: string): void {\n Player = JSON.parse(saveString, Reviver);\n Player.money = parseFloat(Player.money + \"\");\n Player.exploits = sanitizeExploits(Player.exploits);\n}\n","import { NetscriptContext } from \"./APIWrapper\";\nimport { WorkerScript } from \"./WorkerScript\";\nimport { GetAllServers, GetServer } from \"../Server/AllServers\";\nimport { Player } from \"@player\";\nimport { ScriptDeath } from \"./ScriptDeath\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { ScriptArg } from \"./ScriptArg\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { BasicHGWOptions } from \"src/ScriptEditor/NetscriptDefinitions\";\nimport { Server } from \"../Server/Server\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculateHackingTime,\n calculatePercentMoneyHacked,\n} from \"../Hacking\";\nimport { netscriptCanHack } from \"../Hacking/netscriptCanHack\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { influenceStockThroughServerHack } from \"../StockMarket/PlayerInfluencing\";\nimport { IPort, NetscriptPort } from \"../NetscriptPort\";\nimport { NetscriptPorts } from \"../NetscriptWorker\";\nimport { Person } from \"../PersonObjects/Person\";\nimport { FormulaGang } from \"../Gang/formulas/formulas\";\nimport { GangMember } from \"../Gang/GangMember\";\nimport { GangMemberTask } from \"../Gang/GangMemberTask\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { toNative } from \"../NetscriptFunctions/toNative\";\nimport { ScriptIdentifier } from \"./ScriptIdentifier\";\nimport { findRunningScript, findRunningScriptByPid } from \"../Script/ScriptHelpers\";\nimport { RunningScript as IRunningScript } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { arrayToString } from \"../utils/helpers/arrayToString\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nexport const helpers = {\n string,\n number,\n scriptArgs,\n argsToString,\n makeBasicErrorMsg,\n makeRuntimeErrorMsg,\n resolveNetscriptRequestedThreads,\n checkEnvFlags,\n checkSingularityAccess,\n netscriptDelay,\n updateDynamicRam,\n city,\n getServer,\n scriptIdentifier,\n hack,\n getValidPort,\n player,\n server,\n gang,\n gangMember,\n gangTask,\n log,\n getRunningScript,\n getRunningScriptByArgs,\n getCannotFindRunningScriptErrorMessage,\n createPublicRunningScript,\n failOnHacknetServer,\n};\n\nexport function assertObjectType<T extends object>(\n ctx: NetscriptContext,\n name: string,\n obj: unknown,\n desiredObject: T,\n): asserts obj is T {\n if (typeof obj !== \"object\" || obj === null) {\n throw makeRuntimeErrorMsg(\n ctx,\n `Type ${obj === null ? \"null\" : typeof obj} provided for ${name}. Must be an object.`,\n \"TYPE\",\n );\n }\n const objHas = Object.prototype.hasOwnProperty.bind(obj);\n for (const [key, val] of Object.entries(desiredObject)) {\n if (!objHas(key)) {\n throw makeRuntimeErrorMsg(\n ctx,\n `Object provided for argument ${name} is missing required property ${key}.`,\n \"TYPE\",\n );\n }\n const objVal = (obj as Record<string, unknown>)[key];\n if (typeof val !== typeof objVal) {\n throw makeRuntimeErrorMsg(\n ctx,\n `Incorrect type ${typeof objVal} provided for property ${key} on ${name} argument. Should be type ${typeof val}.`,\n \"TYPE\",\n );\n }\n }\n}\n\nconst userFriendlyString = (v: unknown): string => {\n const clip = (s: string): string => {\n if (s.length > 15) return s.slice(0, 12) + \"...\";\n return s;\n };\n if (typeof v === \"number\") return String(v);\n if (typeof v === \"string\") {\n if (v === \"\") return \"empty string\";\n return `'${clip(v)}'`;\n }\n const json = JSON.stringify(v);\n if (!json) return \"???\";\n return `'${clip(json)}'`;\n};\n\nconst debugType = (v: unknown): string => {\n if (v === null) return `Is null.`;\n if (v === undefined) return \"Is undefined.\";\n if (typeof v === \"function\") return \"Is a function.\";\n return `Is of type '${typeof v}', value: ${userFriendlyString(v)}`;\n};\n\n/** Convert a provided value v for argument argName to string. If it wasn't originally a string or number, throw. */\nfunction string(ctx: NetscriptContext, argName: string, v: unknown): string {\n if (typeof v === \"string\") return v;\n if (typeof v === \"number\") return v + \"\"; // cast to string;\n throw makeRuntimeErrorMsg(ctx, `'${argName}' should be a string. ${debugType(v)}`, \"TYPE\");\n}\n\n/** Convert provided value v for argument argName to number. Throw if could not convert to a non-NaN number. */\nfunction number(ctx: NetscriptContext, argName: string, v: unknown): number {\n if (typeof v === \"string\") {\n const x = parseFloat(v);\n if (!isNaN(x)) return x; // otherwise it wasn't even a string representing a number.\n } else if (typeof v === \"number\") {\n if (isNaN(v)) throw makeRuntimeErrorMsg(ctx, `'${argName}' is NaN.`);\n return v;\n }\n throw makeRuntimeErrorMsg(ctx, `'${argName}' should be a number. ${debugType(v)}`, \"TYPE\");\n}\n\n/** Returns args back if it is a ScriptArg[]. Throws an error if it is not. */\nfunction scriptArgs(ctx: NetscriptContext, args: unknown) {\n if (!isScriptArgs(args)) throw makeRuntimeErrorMsg(ctx, \"'args' is not an array of script args\", \"TYPE\");\n return args;\n}\n\n/** Convert multiple arguments for tprint or print into a single string. */\nfunction argsToString(args: unknown[]): string {\n let out = \"\";\n for (let arg of args) {\n if (arg === null) {\n out += \"null\";\n continue;\n }\n if (arg === undefined) {\n out += \"undefined\";\n continue;\n }\n arg = toNative(arg);\n out += typeof arg === \"object\" ? JSON.stringify(arg) : `${arg}`;\n }\n\n return out;\n}\n\n/** Creates an error message string containing hostname, scriptname, and the error message msg */\nfunction makeBasicErrorMsg(ws: WorkerScript | ScriptDeath, msg: string, type = \"RUNTIME\"): string {\n if (ws instanceof WorkerScript) {\n for (const scriptUrl of ws.scriptRef.dependencies) {\n msg = msg.replace(new RegExp(scriptUrl.url, \"g\"), scriptUrl.filename);\n }\n }\n return `${type} ERROR\\n${ws.name}@${ws.hostname} (PID - ${ws.pid})\\n\\n${msg}`;\n}\n\n/** Creates an error message string with a stack trace. */\nfunction makeRuntimeErrorMsg(ctx: NetscriptContext, msg: string, type = \"RUNTIME\"): string {\n const errstack = new Error().stack;\n if (errstack === undefined) throw new Error(\"how did we not throw an error?\");\n const stack = errstack.split(\"\\n\").slice(1);\n const ws = ctx.workerScript;\n const caller = ctx.functionPath;\n const scripts = ws.getServer().scripts;\n const userstack = [];\n for (const stackline of stack) {\n let filename;\n for (const script of scripts) {\n if (script.filename && stackline.includes(script.filename)) {\n filename = script.filename;\n }\n for (const dependency of script.dependencies) {\n if (stackline.includes(dependency.filename)) {\n filename = dependency.filename;\n }\n }\n }\n if (!filename) continue;\n\n interface ILine {\n line: string;\n func: string;\n }\n\n function parseChromeStackline(line: string): ILine | null {\n const lineRe = /.*:(\\d+):\\d+.*/;\n const funcRe = /.*at (.+) \\(.*/;\n\n const lineMatch = line.match(lineRe);\n const funcMatch = line.match(funcRe);\n if (lineMatch && funcMatch) {\n return { line: lineMatch[1], func: funcMatch[1] };\n }\n return null;\n }\n let call = { line: \"-1\", func: \"unknown\" };\n const chromeCall = parseChromeStackline(stackline);\n if (chromeCall) {\n call = chromeCall;\n }\n\n function parseFirefoxStackline(line: string): ILine | null {\n const lineRe = /.*:(\\d+):\\d+$/;\n const lineMatch = line.match(lineRe);\n\n const lio = line.lastIndexOf(\"@\");\n\n if (lineMatch && lio !== -1) {\n return { line: lineMatch[1], func: line.slice(0, lio) };\n }\n return null;\n }\n\n const firefoxCall = parseFirefoxStackline(stackline);\n if (firefoxCall) {\n call = firefoxCall;\n }\n\n userstack.push(`${filename}:L${call.line}@${call.func}`);\n }\n\n log(ctx, () => msg);\n let rejectMsg = `${caller}: ${msg}`;\n if (userstack.length !== 0) rejectMsg += `\\n\\nStack:\\n${userstack.join(\"\\n\")}`;\n return makeBasicErrorMsg(ws, rejectMsg, type);\n}\n\n/** Validate requested number of threads for h/g/w options */\nfunction resolveNetscriptRequestedThreads(ctx: NetscriptContext, requestedThreads?: number): number {\n const threads = ctx.workerScript.scriptRef.threads;\n if (!requestedThreads) {\n return isNaN(threads) || threads < 1 ? 1 : threads;\n }\n const requestedThreadsAsInt = requestedThreads | 0;\n if (isNaN(requestedThreads) || requestedThreadsAsInt < 1) {\n throw makeRuntimeErrorMsg(ctx, `Invalid thread count: ${requestedThreads}. Threads must be a positive number.`);\n }\n if (requestedThreadsAsInt > threads) {\n throw makeRuntimeErrorMsg(\n ctx,\n `Too many threads requested by ${ctx.function}. Requested: ${requestedThreads}. Has: ${threads}.`,\n );\n }\n return requestedThreadsAsInt;\n}\n\n/** Validate singularity access by throwing an error if the player does not have access. */\nfunction checkSingularityAccess(ctx: NetscriptContext): void {\n if (Player.bitNodeN !== 4 && Player.sourceFileLvl(4) === 0) {\n throw makeRuntimeErrorMsg(\n ctx,\n `This singularity function requires Source-File 4 to run. A power up you obtain later in the game.\n It will be very obvious when and how you can obtain it.`,\n \"API ACCESS\",\n );\n }\n}\n\n/** Create an error if a script is dead or if concurrent ns function calls are made */\nfunction checkEnvFlags(ctx: NetscriptContext): void {\n const ws = ctx.workerScript;\n if (ws.env.stopFlag) {\n log(ctx, () => \"Failed to run due to script being killed.\");\n throw new ScriptDeath(ws);\n }\n if (ws.env.runningFn && ctx.function !== \"asleep\") {\n ws.delayReject?.(new ScriptDeath(ws));\n ws.env.stopFlag = true;\n log(ctx, () => \"Failed to run due to failed concurrency check.\");\n throw makeRuntimeErrorMsg(\n ctx,\n `Concurrent calls to Netscript functions are not allowed!\n Did you forget to await hack(), grow(), or some other\n promise-returning function?\n Currently running: ${ws.env.runningFn} tried to run: ${ctx.function}`,\n \"CONCURRENCY\",\n );\n }\n}\n\n/** Set a timeout for performing a task, mark the script as busy in the meantime. */\nfunction netscriptDelay(ctx: NetscriptContext, time: number): Promise<void> {\n const ws = ctx.workerScript;\n return new Promise(function (resolve, reject) {\n ws.delay = window.setTimeout(() => {\n ws.delay = null;\n ws.delayReject = undefined;\n ws.env.runningFn = \"\";\n if (ws.env.stopFlag) reject(new ScriptDeath(ws));\n else resolve();\n }, time);\n ws.delayReject = reject;\n ws.env.runningFn = ctx.function;\n });\n}\n\n/** Adds to dynamic ram cost when calling new ns functions from a script */\nfunction updateDynamicRam(ctx: NetscriptContext, ramCost: number): void {\n const ws = ctx.workerScript;\n const fnName = ctx.function;\n if (ws.dynamicLoadedFns[fnName]) return;\n ws.dynamicLoadedFns[fnName] = true;\n\n let threads = ws.scriptRef.threads;\n if (typeof threads !== \"number\") {\n console.warn(`WorkerScript detected NaN for thread count for ${ws.name} on ${ws.hostname}`);\n threads = 1;\n }\n ws.dynamicRamUsage += ramCost;\n if (ws.dynamicRamUsage > 1.01 * ws.ramUsage) {\n log(ctx, () => \"Insufficient static ram available.\");\n ws.env.stopFlag = true;\n throw makeRuntimeErrorMsg(\n ctx,\n `Dynamic RAM usage calculated to be greater than initial RAM usage.\n This is probably because you somehow circumvented the static RAM calculation.\n\n Threads: ${threads}\n Dynamic RAM Usage: ${numeralWrapper.formatRAM(ws.dynamicRamUsage)} per thread\n Static RAM Usage: ${numeralWrapper.formatRAM(ws.ramUsage)} per thread\n\n One of these could be the reason:\n * Using eval() to get a reference to a ns function\n \\u00a0\\u00a0const myScan = eval('ns.scan');\n\n * Using map access to do the same\n \\u00a0\\u00a0const myScan = ns['scan'];\n\n Sorry :(`,\n \"RAM USAGE\",\n );\n }\n}\n\n/** Validates the input v as being a CityName. Throws an error if it is not. */\nfunction city(ctx: NetscriptContext, argName: string, v: unknown): CityName {\n if (typeof v !== \"string\") throw makeRuntimeErrorMsg(ctx, `${argName} should be a city name.`);\n const s = v as CityName;\n if (!Object.values(CityName).includes(s)) throw makeRuntimeErrorMsg(ctx, `${argName} should be a city name.`);\n return s;\n}\n\nfunction scriptIdentifier(\n ctx: NetscriptContext,\n scriptID: unknown,\n _hostname: unknown,\n _args: unknown,\n): ScriptIdentifier {\n const ws = ctx.workerScript;\n // Provide the pid for the current script if no identifier provided\n if (scriptID === undefined) return ws.pid;\n if (typeof scriptID === \"number\") return scriptID;\n if (typeof scriptID === \"string\") {\n const hostname = _hostname === undefined ? ctx.workerScript.hostname : string(ctx, \"hostname\", _hostname);\n const args = _args === undefined ? [] : scriptArgs(ctx, _args);\n return {\n scriptname: scriptID,\n hostname,\n args,\n };\n }\n throw makeRuntimeErrorMsg(ctx, \"An unknown type of input was provided as a script identifier.\", \"TYPE\");\n}\n\n/**\n * Gets the Server for a specific hostname/ip, throwing an error\n * if the server doesn't exist.\n * @param {NetscriptContext} ctx - Context from which getServer is being called. For logging purposes.\n * @param {string} hostname - Hostname of the server\n * @returns {BaseServer} The specified server as a BaseServer\n */\nfunction getServer(ctx: NetscriptContext, hostname: string) {\n const server = GetServer(hostname);\n if (server == null) {\n const str = hostname === \"\" ? \"'' (empty string)\" : \"'\" + hostname + \"'\";\n throw makeRuntimeErrorMsg(ctx, `Invalid hostname: ${str}`);\n }\n return server;\n}\n\nfunction isScriptArgs(args: unknown): args is ScriptArg[] {\n const isScriptArg = (arg: unknown) => typeof arg === \"string\" || typeof arg === \"number\" || typeof arg === \"boolean\";\n return Array.isArray(args) && args.every(isScriptArg);\n}\n\nfunction hack(\n ctx: NetscriptContext,\n hostname: string,\n manual: boolean,\n { threads: requestedThreads, stock }: BasicHGWOptions = {},\n): Promise<number> {\n const ws = ctx.workerScript;\n const threads = helpers.resolveNetscriptRequestedThreads(ctx, requestedThreads);\n const server = getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n throw makeRuntimeErrorMsg(ctx, \"Cannot be executed on this server.\");\n }\n\n // Calculate the hacking time\n const hackingTime = calculateHackingTime(server, Player); // This is in seconds\n\n // No root access or skill level too low\n const canHack = netscriptCanHack(server);\n if (!canHack.res) {\n throw makeRuntimeErrorMsg(ctx, canHack.msg || \"\");\n }\n\n log(\n ctx,\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n hackingTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n\n return helpers.netscriptDelay(ctx, hackingTime * 1000).then(function () {\n const hackChance = calculateHackingChance(server, Player);\n const rand = Math.random();\n let expGainedOnSuccess = calculateHackingExpGain(server, Player) * threads;\n const expGainedOnFailure = expGainedOnSuccess / 4;\n if (rand < hackChance) {\n // Success!\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n let maxThreadNeeded = Math.ceil(1 / percentHacked);\n if (isNaN(maxThreadNeeded)) {\n // Server has a 'max money' of 0 (probably). We'll set this to an arbitrarily large value\n maxThreadNeeded = 1e6;\n }\n\n let moneyDrained = Math.floor(server.moneyAvailable * percentHacked) * threads;\n\n // Over-the-top safety checks\n if (moneyDrained <= 0) {\n moneyDrained = 0;\n expGainedOnSuccess = expGainedOnFailure;\n }\n if (moneyDrained > server.moneyAvailable) {\n moneyDrained = server.moneyAvailable;\n }\n server.moneyAvailable -= moneyDrained;\n if (server.moneyAvailable < 0) {\n server.moneyAvailable = 0;\n }\n\n let moneyGained = moneyDrained * BitNodeMultipliers.ScriptHackMoneyGain;\n if (manual) {\n moneyGained = moneyDrained * BitNodeMultipliers.ManualHackMoney;\n }\n\n Player.gainMoney(moneyGained, \"hacking\");\n ws.scriptRef.onlineMoneyMade += moneyGained;\n Player.scriptProdSinceLastAug += moneyGained;\n ws.scriptRef.recordHack(server.hostname, moneyGained, threads);\n Player.gainHackingExp(expGainedOnSuccess);\n if (manual) Player.gainIntelligenceExp(0.005);\n ws.scriptRef.onlineExpGained += expGainedOnSuccess;\n log(\n ctx,\n () =>\n `Successfully hacked '${server.hostname}' for ${numeralWrapper.formatMoney(\n moneyGained,\n )} and ${numeralWrapper.formatExp(expGainedOnSuccess)} exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n server.fortify(CONSTANTS.ServerFortifyAmount * Math.min(threads, maxThreadNeeded));\n if (stock) {\n influenceStockThroughServerHack(server, moneyDrained);\n }\n if (manual) {\n server.backdoorInstalled = true;\n }\n return moneyGained;\n } else {\n // Player only gains 25% exp for failure?\n Player.gainHackingExp(expGainedOnFailure);\n ws.scriptRef.onlineExpGained += expGainedOnFailure;\n log(\n ctx,\n () =>\n `Failed to hack '${server.hostname}'. Gained ${numeralWrapper.formatExp(\n expGainedOnFailure,\n )} exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n return 0;\n }\n });\n}\n\nfunction getValidPort(ctx: NetscriptContext, port: number): IPort {\n if (isNaN(port)) {\n throw makeRuntimeErrorMsg(\n ctx,\n `Invalid argument. Must be a port number between 1 and ${CONSTANTS.NumNetscriptPorts}, is ${port}`,\n );\n }\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw makeRuntimeErrorMsg(\n ctx,\n `Trying to use an invalid port: ${port}. Only ports 1-${CONSTANTS.NumNetscriptPorts} are valid.`,\n );\n }\n let iport = NetscriptPorts.get(port);\n if (!iport) {\n iport = NetscriptPort();\n NetscriptPorts.set(port, iport);\n }\n return iport;\n}\n\nfunction player(ctx: NetscriptContext, p: unknown): Person {\n const fakePlayer = {\n hp: undefined,\n mults: undefined,\n numPeopleKilled: undefined,\n money: undefined,\n city: undefined,\n location: undefined,\n bitNodeN: undefined,\n totalPlaytime: undefined,\n playtimeSinceLastAug: undefined,\n playtimeSinceLastBitnode: undefined,\n jobs: undefined,\n factions: undefined,\n tor: undefined,\n inBladeburner: undefined,\n hasCorporation: undefined,\n entropy: undefined,\n };\n if (!roughlyIs(fakePlayer, p)) throw makeRuntimeErrorMsg(ctx, `player should be a Player.`, \"TYPE\");\n return p as Person;\n}\n\nfunction server(ctx: NetscriptContext, s: unknown): Server {\n const fakeServer = {\n cpuCores: undefined,\n ftpPortOpen: undefined,\n hasAdminRights: undefined,\n hostname: undefined,\n httpPortOpen: undefined,\n ip: undefined,\n isConnectedTo: undefined,\n maxRam: undefined,\n organizationName: undefined,\n ramUsed: undefined,\n smtpPortOpen: undefined,\n sqlPortOpen: undefined,\n sshPortOpen: undefined,\n purchasedByPlayer: undefined,\n backdoorInstalled: undefined,\n baseDifficulty: undefined,\n hackDifficulty: undefined,\n minDifficulty: undefined,\n moneyAvailable: undefined,\n moneyMax: undefined,\n numOpenPortsRequired: undefined,\n openPortCount: undefined,\n requiredHackingSkill: undefined,\n serverGrowth: undefined,\n };\n if (!roughlyIs(fakeServer, s)) throw makeRuntimeErrorMsg(ctx, `server should be a Server.`, \"TYPE\");\n return s as Server;\n}\n\nfunction roughlyIs(expect: object, actual: unknown): boolean {\n if (typeof actual !== \"object\" || actual == null) return false;\n\n const expects = Object.keys(expect);\n const actuals = Object.keys(actual);\n for (const expect of expects)\n if (!actuals.includes(expect)) {\n return false;\n }\n return true;\n}\n\nfunction gang(ctx: NetscriptContext, g: unknown): FormulaGang {\n if (!roughlyIs({ respect: 0, territory: 0, wantedLevel: 0 }, g))\n throw makeRuntimeErrorMsg(ctx, `gang should be a Gang.`, \"TYPE\");\n return g as FormulaGang;\n}\n\nfunction gangMember(ctx: NetscriptContext, m: unknown): GangMember {\n if (!roughlyIs(new GangMember(), m)) throw makeRuntimeErrorMsg(ctx, `member should be a GangMember.`, \"TYPE\");\n return m as GangMember;\n}\n\nfunction gangTask(ctx: NetscriptContext, t: unknown): GangMemberTask {\n if (!roughlyIs(new GangMemberTask(\"\", \"\", false, false, { hackWeight: 100 }), t))\n throw makeRuntimeErrorMsg(ctx, `task should be a GangMemberTask.`, \"TYPE\");\n return t as GangMemberTask;\n}\n\nfunction log(ctx: NetscriptContext, message: () => string) {\n ctx.workerScript.log(ctx.functionPath, message);\n}\n\n/**\n * Searches for and returns the RunningScript object for the specified script.\n * If the 'fn' argument is not specified, this returns the current RunningScript.\n * @param {string} fn - Filename of script\n * @param {string} hostname - Hostname/ip of the server on which the script resides\n * @param {any[]} scriptArgs - Running script's arguments\n * @returns {RunningScript}\n * Running script identified by the parameters, or null if no such script\n * exists, or the current running script if the first argument 'fn'\n * is not specified.\n */\nfunction getRunningScriptByArgs(\n ctx: NetscriptContext,\n fn: string,\n hostname: string,\n scriptArgs: ScriptArg[],\n): RunningScript | null {\n if (!Array.isArray(scriptArgs)) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"Invalid scriptArgs argument passed into getRunningScriptByArgs().\\n\" +\n \"This is probably a bug. Please report to game developer\",\n );\n }\n\n if (fn != null && typeof fn === \"string\") {\n // Get Logs of another script\n if (hostname == null) {\n hostname = ctx.workerScript.hostname;\n }\n const server = helpers.getServer(ctx, hostname);\n\n return findRunningScript(fn, scriptArgs, server);\n }\n\n // If no arguments are specified, return the current RunningScript\n return ctx.workerScript.scriptRef;\n}\n\nfunction getRunningScriptByPid(pid: number): RunningScript | null {\n for (const server of GetAllServers()) {\n const runningScript = findRunningScriptByPid(pid, server);\n if (runningScript) return runningScript;\n }\n return null;\n}\n\nfunction getRunningScript(ctx: NetscriptContext, ident: ScriptIdentifier): RunningScript | null {\n if (typeof ident === \"number\") {\n return getRunningScriptByPid(ident);\n } else {\n return getRunningScriptByArgs(ctx, ident.scriptname, ident.hostname, ident.args);\n }\n}\n\n/**\n * Helper function for getting the error log message when the user specifies\n * a nonexistent running script\n * @param {string} fn - Filename of script\n * @param {string} hostname - Hostname/ip of the server on which the script resides\n * @param {any[]} scriptArgs - Running script's arguments\n * @returns {string} Error message to print to logs\n */\nfunction getCannotFindRunningScriptErrorMessage(ident: ScriptIdentifier): string {\n if (typeof ident === \"number\") return `Cannot find running script with pid: ${ident}`;\n\n return `Cannot find running script ${ident.scriptname} on server ${ident.hostname} with args: ${arrayToString(\n ident.args,\n )}`;\n}\n\n/**\n * Sanitizes a `RunningScript` to remove sensitive information, making it suitable for\n * return through an NS function.\n * @see NS.getRecentScripts\n * @see NS.getRunningScript\n * @param runningScript Existing, internal RunningScript\n * @returns A sanitized, NS-facing copy of the RunningScript\n */\nfunction createPublicRunningScript(runningScript: RunningScript): IRunningScript {\n return {\n args: runningScript.args.slice(),\n filename: runningScript.filename,\n logs: runningScript.logs.slice(),\n offlineExpGained: runningScript.offlineExpGained,\n offlineMoneyMade: runningScript.offlineMoneyMade,\n offlineRunningTime: runningScript.offlineRunningTime,\n onlineExpGained: runningScript.onlineExpGained,\n onlineMoneyMade: runningScript.onlineMoneyMade,\n onlineRunningTime: runningScript.onlineRunningTime,\n pid: runningScript.pid,\n ramUsage: runningScript.ramUsage,\n server: runningScript.server,\n threads: runningScript.threads,\n };\n}\n\n/**\n * Used to fail a function if the function's target is a Hacknet Server.\n * This is used for functions that should run on normal Servers, but not Hacknet Servers\n * @param {Server} server - Target server\n * @param {string} callingFn - Name of calling function. For logging purposes\n * @returns {boolean} True if the server is a Hacknet Server, false otherwise\n */\nfunction failOnHacknetServer(ctx: NetscriptContext, server: BaseServer): boolean {\n if (server instanceof HacknetServer) {\n log(ctx, () => `Does not work on Hacknet Servers`);\n return true;\n } else {\n return false;\n }\n}\n\n/** Generate an error dialog when workerscript is known */\nexport function handleUnknownError(e: unknown, ws: WorkerScript | ScriptDeath | null = null, initialText = \"\") {\n if (e instanceof ScriptDeath) {\n //No dialog for an empty ScriptDeath\n if (e.errorMessage === \"\") return;\n if (!ws) {\n ws = e;\n e = ws.errorMessage;\n }\n }\n if (ws && typeof e === \"string\") {\n const headerText = makeBasicErrorMsg(ws, \"\", \"\");\n if (!e.includes(headerText)) e = makeBasicErrorMsg(ws, e);\n } else if (e instanceof SyntaxError) {\n const msg = `${e.message} (sorry we can't be more helpful)`;\n e = ws ? makeBasicErrorMsg(ws, msg, \"SYNTAX\") : `SYNTAX ERROR:\\n\\n${msg}`;\n } else if (e instanceof Error) {\n const msg = `${e.message}${e.stack ? `\\nstack:\\n${e.stack.toString()}` : \"\"}`;\n e = ws ? makeBasicErrorMsg(ws, msg) : `RUNTIME ERROR:\\n\\n${msg}`;\n }\n if (typeof e !== \"string\") {\n console.error(\"Unexpected error type:\", e);\n e = \"Unexpected type of error thrown. See console output.\";\n }\n dialogBoxCreate(initialText + e);\n}\n","export enum FactionNames {\n Illuminati = \"Illuminati\",\n Daedalus = \"Daedalus\",\n TheCovenant = \"The Covenant\",\n ECorp = \"ECorp\",\n MegaCorp = \"MegaCorp\",\n BachmanAssociates = \"Bachman & Associates\",\n BladeIndustries = \"Blade Industries\",\n NWO = \"NWO\",\n ClarkeIncorporated = \"Clarke Incorporated\",\n OmniTekIncorporated = \"OmniTek Incorporated\",\n FourSigma = \"Four Sigma\",\n KuaiGongInternational = \"KuaiGong International\",\n FulcrumSecretTechnologies = \"Fulcrum Secret Technologies\",\n BitRunners = \"BitRunners\",\n TheBlackHand = \"The Black Hand\",\n NiteSec = \"NiteSec\",\n Aevum = \"Aevum\",\n Chongqing = \"Chongqing\",\n Ishima = \"Ishima\",\n NewTokyo = \"New Tokyo\",\n Sector12 = \"Sector-12\",\n Volhaven = \"Volhaven\",\n SpeakersForTheDead = \"Speakers for the Dead\",\n TheDarkArmy = \"The Dark Army\",\n TheSyndicate = \"The Syndicate\",\n Silhouette = \"Silhouette\",\n Tetrads = \"Tetrads\",\n SlumSnakes = \"Slum Snakes\",\n Netburners = \"Netburners\",\n TianDiHui = \"Tian Di Hui\",\n CyberSec = \"CyberSec\",\n Bladeburners = \"Bladeburners\",\n ChurchOfTheMachineGod = \"Church of the Machine God\",\n ShadowsOfAnarchy = \"Shadows of Anarchy\",\n}\n","import { OwnedAugmentationsOrderSetting, PurchaseAugmentationsOrderSetting } from \"./SettingEnums\";\nimport { defaultTheme } from \"../Themes/Themes\";\nimport { defaultStyles } from \"../Themes/Styles\";\nimport { WordWrapOptions } from \"../ScriptEditor/ui/Options\";\nimport { defaultMonacoTheme } from \"../ScriptEditor/ui/themes\";\n\n/** The current options the player has customized to their play style. */\nexport const Settings = {\n /** How many servers per page */\n ActiveScriptsServerPageSize: 10,\n /** How many scripts per page */\n ActiveScriptsScriptPageSize: 10,\n /** How often the game should autosave the player's progress, in seconds. */\n AutosaveInterval: 60,\n /** How many milliseconds between execution points for Netscript 1 statements. */\n CodeInstructionRunTime: 25,\n /** Whether to render city as list of buttons. */\n DisableASCIIArt: false,\n /** Whether global keyboard shortcuts should be disabled throughout the game. */\n DisableHotkeys: false,\n /** Whether text effects such as corruption should be disabled. */\n DisableTextEffects: false,\n /** Whether overview progress bars should be visible. */\n DisableOverviewProgressBars: false,\n /** Whether to enable bash hotkeys */\n EnableBashHotkeys: false,\n /** Timestamps format string */\n TimestampsFormat: \"\",\n /** Locale used for display numbers. */\n Locale: \"en\",\n /** Limit the number of recently killed script entries being tracked. */\n MaxRecentScriptsCapacity: 50,\n /** Limit the number of log entries for each script being executed on each server. */\n MaxLogCapacity: 50,\n /** Limit how many entries can be written to a Netscript Port before entries start to get pushed out. */\n MaxPortCapacity: 50,\n /** Limit the number of entries in the terminal. */\n MaxTerminalCapacity: 500,\n /** Port the Remote File API client will try to connect to. 0 to disable. */\n RemoteFileApiPort: 0,\n /** Whether to save the game when the player saves any file. */\n SaveGameOnFileSave: true,\n /** Whether to hide the confirmation dialog for augmentation purchases. */\n SuppressBuyAugmentationConfirmation: false,\n /** Whether to hide the dialog showing new faction invites. */\n SuppressFactionInvites: false,\n /** Whether to hide the dialog when the player receives a new message file. */\n SuppressMessages: false,\n /** Whether to hide the confirmation dialog when the player attempts to travel between cities. */\n SuppressTravelConfirmation: false,\n /** Whether to hide the dialog when the player's Bladeburner actions are cancelled. */\n SuppressBladeburnerPopup: false,\n /** Whether to hide dialogs for stock market actions. */\n SuppressTIXPopup: false,\n /** Whether to hide the toast alert when the game is saved. */\n SuppressSavedGameToast: false,\n /** Whether to hide the toast warning when the autosave is disabled. */\n SuppressAutosaveDisabledWarnings: false,\n /** Whether to GiB instead of GB. */\n UseIEC60027_2: false,\n /** Whether to display intermediary time unit when their value is null */\n ShowMiddleNullTimeUnit: false,\n /** Whether the game should skip saving the running scripts to the save file. */\n ExcludeRunningScriptsFromSave: false,\n /** Whether the game's sidebar is opened. */\n IsSidebarOpened: true,\n /** Theme colors. */\n theme: { ...defaultTheme },\n /** Interface styles. */\n styles: { ...defaultStyles },\n /** Character overview settings. */\n overview: { x: 0, y: 0, opened: true },\n /** Script editor theme data. */\n EditorTheme: { ...defaultMonacoTheme },\n /** Order to display the player's owned Augmentations/Source Files. */\n OwnedAugmentationsOrder: OwnedAugmentationsOrderSetting.AcquirementTime,\n /** What order the Augmentations should be displayed in when purchasing from a Faction. */\n PurchaseAugmentationsOrder: PurchaseAugmentationsOrderSetting.Default,\n /** Script editor theme. */\n MonacoTheme: \"monokai\",\n MonacoInsertSpaces: false,\n /** Text size for script editor. */\n MonacoFontSize: 20,\n /** Whether to use Vim mod by default in the script editor */\n MonacoVim: false,\n /** Word wrap setting for Script Editor. */\n MonacoWordWrap: \"off\" as WordWrapOptions,\n\n load(saveString: string) {\n const save = JSON.parse(saveString);\n save.theme && Object.assign(Settings.theme, save.theme);\n save.styles && Object.assign(Settings.styles, save.styles);\n save.overview && Object.assign(Settings.overview, save.overview);\n save.EditorTheme && Object.assign(Settings.EditorTheme, save.EditorTheme);\n delete save.theme, save.styles, save.overview, save.EditorTheme;\n Object.assign(Settings, save);\n },\n};\n","import numeral from \"numeral\";\nimport \"numeral/locales/bg\";\nimport \"numeral/locales/cs\";\nimport \"numeral/locales/da-dk\";\nimport \"numeral/locales/de\";\nimport \"numeral/locales/en-au\";\nimport \"numeral/locales/en-gb\";\nimport \"numeral/locales/es\";\nimport \"numeral/locales/fr\";\nimport \"numeral/locales/hu\";\nimport \"numeral/locales/it\";\nimport \"numeral/locales/lv\";\nimport \"numeral/locales/no\";\nimport \"numeral/locales/pl\";\nimport \"numeral/locales/ru\";\n\nimport { Settings } from \"../Settings/Settings\";\n\nconst extraFormats = [1e15, 1e18, 1e21, 1e24, 1e27, 1e30];\nconst extraNotations = [\"q\", \"Q\", \"s\", \"S\", \"o\", \"n\"];\nconst gigaMultiplier = { standard: 1e9, iec60027_2: 2 ** 30 };\n\nclass NumeralFormatter {\n // Default Locale\n defaultLocale = \"en\";\n\n constructor() {\n this.defaultLocale = \"en\";\n }\n\n updateLocale(l: string): boolean {\n if (numeral.locale(l) == null) {\n console.warn(`Invalid locale for numeral: ${l}`);\n\n numeral.locale(this.defaultLocale);\n return false;\n }\n return true;\n }\n\n format(n: number | string, format?: string): string {\n // numeral.js doesn't properly format numbers that are too big or too small\n if (Math.abs(n as number) < 1e-6) {\n n = 0;\n }\n const answer = numeral(n).format(format);\n if (answer === \"NaN\") {\n return `${n}`;\n }\n return answer;\n }\n\n formatBigNumber(n: number | string): string {\n return this.format(n, \"0.000a\");\n }\n\n // TODO: leverage numeral.js to do it. This function also implies you can\n // use this format in some text field but you can't. ( \"1t\" will parse but\n // \"1s\" will not)\n formatReallyBigNumber(n: number | string, decimalPlaces = 3): string {\n const nAbs = Math.abs(n as number);\n if (n === Infinity) return \"∞\";\n for (let i = 0; i < extraFormats.length; i++) {\n if (extraFormats[i] < nAbs && nAbs <= extraFormats[i] * 1000) {\n return this.format((n as number) / extraFormats[i], \"0.\" + \"0\".repeat(decimalPlaces)) + extraNotations[i];\n }\n }\n if (nAbs < 1000) {\n return this.format(n, \"0.\" + \"0\".repeat(decimalPlaces));\n }\n const str = this.format(n, \"0.\" + \"0\".repeat(decimalPlaces) + \"a\");\n if (str === \"NaNt\") return this.format(n, \"0.\" + \" \".repeat(decimalPlaces) + \"e+0\");\n return str;\n }\n\n formatHp(n: number): string {\n if (n < 1e6) {\n return this.format(n, \"0,0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatMoney(n: number): string {\n return \"$\" + this.formatReallyBigNumber(n);\n }\n\n formatSkill(n: number): string {\n if (n < 1e15) {\n return this.format(n, \"0,0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatExp(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatHashes(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatReputation(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatFavor(n: number): string {\n return this.format(n, \"0,0\");\n }\n\n formatSecurity(n: number): string {\n return n.toFixed(3);\n }\n\n formatRAM(n: number): string {\n if (Settings.UseIEC60027_2) {\n return this.format(n * gigaMultiplier.iec60027_2, \"0.00ib\");\n }\n return this.format(n * gigaMultiplier.standard, \"0.00b\");\n }\n\n formatPercentage(n: number | string, decimalPlaces = 2): string {\n const formatter: string = \"0.\" + \"0\".repeat(decimalPlaces) + \"%\";\n return this.format(n, formatter);\n }\n\n formatServerSecurity(n: number): string {\n return this.format(n, \"0,0.000\");\n }\n\n formatRespect(n: number): string {\n return this.formatReallyBigNumber(n, 5);\n }\n\n formatWanted(n: number): string {\n return this.formatReallyBigNumber(n, 5);\n }\n\n formatMultiplier(n: number): string {\n return this.format(n, \"0,0.00\");\n }\n\n formatSleeveShock(n: number): string {\n return this.format(n, \"0,0.000\");\n }\n\n formatSleeveSynchro(n: number): string {\n return this.format(n, \"0,0.000\");\n }\n\n formatSleeveMemory(n: number): string {\n return this.format(n, \"0\");\n }\n\n formatPopulation(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n formatStamina(n: number): string {\n return this.format(n, \"0.0\");\n }\n\n formatShares(n: number): string {\n if (n < 1000) {\n return this.format(n, \"0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatInfiltrationSecurity(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatThreads(n: number): string {\n return this.format(n, \"0,0\");\n }\n\n formatStaneksGiftHeat(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n formatStaneksGiftCharge(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n formatStaneksGiftPower(n: number): string {\n return this.format(n, \"0.00\");\n }\n\n parseCustomLargeNumber(str: string): number {\n const numericRegExp = new RegExp(\"^(-?\\\\d+\\\\.?\\\\d*)([\" + extraNotations.join(\"\") + \"]?)$\");\n const match = str.match(numericRegExp);\n if (match == null) {\n return NaN;\n }\n const [, number, notation] = match;\n const notationIndex = extraNotations.indexOf(notation);\n if (notationIndex === -1) {\n return NaN;\n }\n return parseFloat(number) * extraFormats[notationIndex];\n }\n\n largestAbsoluteNumber(n1: number, n2 = 0, n3 = 0): number {\n if (isNaN(n1)) n1 = 0;\n if (isNaN(n2)) n2 = 0;\n if (isNaN(n3)) n3 = 0;\n const largestAbsolute = Math.max(Math.abs(n1), Math.abs(n2), Math.abs(n3));\n switch (largestAbsolute) {\n case Math.abs(n1):\n return n1;\n case Math.abs(n2):\n return n2;\n case Math.abs(n3):\n return n3;\n }\n return 0;\n }\n\n parseMoney(s: string): number {\n // numeral library does not handle formats like 1s (returns 1) and 1e10 (returns 110) well,\n // so if more then 1 return a valid number, return the one farthest from 0\n const numeralValue = numeral(s).value();\n const parsed = parseFloat(s);\n const selfParsed = this.parseCustomLargeNumber(s);\n // Check for one or more NaN values\n if (isNaN(parsed) && isNaN(selfParsed)) {\n if (numeralValue === null) {\n // 3x NaN\n return NaN;\n }\n // 2x NaN\n return numeralValue;\n } else if (numeralValue === null && isNaN(selfParsed)) {\n // 2x NaN\n return parsed;\n } else if (isNaN(parsed)) {\n if (numeralValue === null) {\n // 2x NaN\n return selfParsed;\n }\n // 1x NaN\n return this.largestAbsoluteNumber(numeralValue, selfParsed);\n } else if (numeralValue === null) {\n // 1x NaN\n return this.largestAbsoluteNumber(parsed, selfParsed);\n } else if (isNaN(selfParsed)) {\n // 1x NaN\n return this.largestAbsoluteNumber(numeralValue, parsed);\n } else {\n // no NaN\n return this.largestAbsoluteNumber(numeralValue, parsed, selfParsed);\n }\n }\n}\n\nexport const numeralWrapper = new NumeralFormatter();\n","import { Terminal as TTerminal } from \"./Terminal/Terminal\";\nexport const Terminal = new TTerminal();\n","/** Names of all locations */\nexport enum LocationName {\n // Aevum Locations\n AevumAeroCorp = \"AeroCorp\",\n AevumBachmanAndAssociates = \"Bachman & Associates\",\n AevumClarkeIncorporated = \"Clarke Incorporated\",\n AevumCrushFitnessGym = \"Crush Fitness Gym\",\n AevumECorp = \"ECorp\",\n AevumFulcrumTechnologies = \"Fulcrum Technologies\",\n AevumGalacticCybersystems = \"Galactic Cybersystems\",\n AevumNetLinkTechnologies = \"NetLink Technologies\",\n AevumPolice = \"Aevum Police Headquarters\",\n AevumRhoConstruction = \"Rho Construction\",\n AevumSnapFitnessGym = \"Snap Fitness Gym\",\n AevumSummitUniversity = \"Summit University\",\n AevumWatchdogSecurity = \"Watchdog Security\",\n AevumCasino = \"Iker Molina Casino\",\n\n // Chongqing locations\n ChongqingKuaiGongInternational = \"KuaiGong International\",\n ChongqingSolarisSpaceSystems = \"Solaris Space Systems\",\n ChongqingChurchOfTheMachineGod = \"Church of the Machine God\",\n\n // Sector 12\n Sector12AlphaEnterprises = \"Alpha Enterprises\",\n Sector12BladeIndustries = \"Blade Industries\",\n Sector12CIA = \"Central Intelligence Agency\",\n Sector12CarmichaelSecurity = \"Carmichael Security\",\n Sector12CityHall = \"Sector-12 City Hall\",\n Sector12DeltaOne = \"DeltaOne\",\n Sector12FoodNStuff = \"FoodNStuff\",\n Sector12FourSigma = \"Four Sigma\",\n Sector12IcarusMicrosystems = \"Icarus Microsystems\",\n Sector12IronGym = \"Iron Gym\",\n Sector12JoesGuns = \"Joe's Guns\",\n Sector12MegaCorp = \"MegaCorp\",\n Sector12NSA = \"National Security Agency\",\n Sector12PowerhouseGym = \"Powerhouse Gym\",\n Sector12RothmanUniversity = \"Rothman University\",\n Sector12UniversalEnergy = \"Universal Energy\",\n\n // New Tokyo\n NewTokyoDefComm = \"DefComm\",\n NewTokyoGlobalPharmaceuticals = \"Global Pharmaceuticals\",\n NewTokyoNoodleBar = \"Noodle Bar\",\n NewTokyoVitaLife = \"VitaLife\",\n NewTokyoArcade = \"Arcade\",\n\n // Ishima\n IshimaNovaMedical = \"Nova Medical\",\n IshimaOmegaSoftware = \"Omega Software\",\n IshimaStormTechnologies = \"Storm Technologies\",\n IshimaGlitch = \"0x6C1\",\n\n // Volhaven\n VolhavenCompuTek = \"CompuTek\",\n VolhavenHeliosLabs = \"Helios Labs\",\n VolhavenLexoCorp = \"LexoCorp\",\n VolhavenMilleniumFitnessGym = \"Millenium Fitness Gym\",\n VolhavenNWO = \"NWO\",\n VolhavenOmniTekIncorporated = \"OmniTek Incorporated\",\n VolhavenOmniaCybersystems = \"Omnia Cybersystems\",\n VolhavenSysCoreSecurities = \"SysCore Securities\",\n VolhavenZBInstituteOfTechnology = \"ZB Institute of Technology\",\n\n // Generic locations\n Hospital = \"Hospital\",\n Slums = \"The Slums\",\n TravelAgency = \"Travel Agency\",\n WorldStockExchange = \"World Stock Exchange\",\n\n // Default name for Location objects\n Void = \"The Void\",\n}\n","export enum AugmentationNames {\n Targeting1 = \"Augmented Targeting I\",\n Targeting2 = \"Augmented Targeting II\",\n Targeting3 = \"Augmented Targeting III\",\n SyntheticHeart = \"Synthetic Heart\",\n SynfibrilMuscle = \"Synfibril Muscle\",\n CombatRib1 = \"Combat Rib I\",\n CombatRib2 = \"Combat Rib II\",\n CombatRib3 = \"Combat Rib III\",\n NanofiberWeave = \"Nanofiber Weave\",\n SubdermalArmor = \"NEMEAN Subdermal Weave\",\n WiredReflexes = \"Wired Reflexes\",\n GrapheneBoneLacings = \"Graphene Bone Lacings\",\n BionicSpine = \"Bionic Spine\",\n GrapheneBionicSpine = \"Graphene Bionic Spine Upgrade\",\n BionicLegs = \"Bionic Legs\",\n GrapheneBionicLegs = \"Graphene Bionic Legs Upgrade\",\n SpeechProcessor = \"Speech Processor Implant\",\n TITN41Injection = \"TITN-41 Gene-Modification Injection\",\n EnhancedSocialInteractionImplant = \"Enhanced Social Interaction Implant\",\n BitWire = \"BitWire\",\n ArtificialBioNeuralNetwork = \"Artificial Bio-neural Network Implant\",\n ArtificialSynapticPotentiation = \"Artificial Synaptic Potentiation\",\n EnhancedMyelinSheathing = \"Enhanced Myelin Sheathing\",\n SynapticEnhancement = \"Synaptic Enhancement Implant\",\n NeuralRetentionEnhancement = \"Neural-Retention Enhancement\",\n DataJack = \"DataJack\",\n ENM = \"Embedded Netburner Module\",\n ENMCore = \"Embedded Netburner Module Core Implant\",\n ENMCoreV2 = \"Embedded Netburner Module Core V2 Upgrade\",\n ENMCoreV3 = \"Embedded Netburner Module Core V3 Upgrade\",\n ENMAnalyzeEngine = \"Embedded Netburner Module Analyze Engine\",\n ENMDMA = \"Embedded Netburner Module Direct Memory Access Upgrade\",\n Neuralstimulator = \"Neuralstimulator\",\n NeuralAccelerator = \"Neural Accelerator\",\n CranialSignalProcessorsG1 = \"Cranial Signal Processors - Gen I\",\n CranialSignalProcessorsG2 = \"Cranial Signal Processors - Gen II\",\n CranialSignalProcessorsG3 = \"Cranial Signal Processors - Gen III\",\n CranialSignalProcessorsG4 = \"Cranial Signal Processors - Gen IV\",\n CranialSignalProcessorsG5 = \"Cranial Signal Processors - Gen V\",\n NeuronalDensification = \"Neuronal Densification\",\n NeuroreceptorManager = \"Neuroreceptor Management Implant\",\n NuoptimalInjectorImplant = \"Nuoptimal Nootropic Injector Implant\",\n SpeechEnhancement = \"Speech Enhancement\",\n FocusWire = \"FocusWire\",\n PCDNI = \"PC Direct-Neural Interface\",\n PCDNIOptimizer = \"PC Direct-Neural Interface Optimization Submodule\",\n PCDNINeuralNetwork = \"PC Direct-Neural Interface NeuroNet Injector\",\n PCMatrix = \"PCMatrix\",\n ADRPheromone1 = \"ADR-V1 Pheromone Gene\",\n ADRPheromone2 = \"ADR-V2 Pheromone Gene\",\n ShadowsSimulacrum = \"The Shadow's Simulacrum\",\n HacknetNodeCPUUpload = \"Hacknet Node CPU Architecture Neural-Upload\",\n HacknetNodeCacheUpload = \"Hacknet Node Cache Architecture Neural-Upload\",\n HacknetNodeNICUpload = \"Hacknet Node NIC Architecture Neural-Upload\",\n HacknetNodeKernelDNI = \"Hacknet Node Kernel Direct-Neural Interface\",\n HacknetNodeCoreDNI = \"Hacknet Node Core Direct-Neural Interface\",\n NeuroFluxGovernor = \"NeuroFlux Governor\",\n Neurotrainer1 = \"Neurotrainer I\",\n Neurotrainer2 = \"Neurotrainer II\",\n Neurotrainer3 = \"Neurotrainer III\",\n Hypersight = \"HyperSight Corneal Implant\",\n LuminCloaking1 = \"LuminCloaking-V1 Skin Implant\",\n LuminCloaking2 = \"LuminCloaking-V2 Skin Implant\",\n HemoRecirculator = \"HemoRecirculator\",\n SmartSonar = \"SmartSonar Implant\",\n PowerRecirculator = \"Power Recirculation Core\",\n QLink = \"QLink\",\n TheRedPill = \"The Red Pill\",\n SPTN97 = \"SPTN-97 Gene Modification\",\n HiveMind = \"ECorp HVMind Implant\",\n CordiARCReactor = \"CordiARC Fusion Reactor\",\n SmartJaw = \"SmartJaw\",\n Neotra = \"Neotra\",\n Xanipher = \"Xanipher\",\n nextSENS = \"nextSENS Gene Modification\",\n OmniTekInfoLoad = \"OmniTek InfoLoad\",\n PhotosyntheticCells = \"Photosynthetic Cells\",\n Neurolink = \"BitRunners Neurolink\",\n TheBlackHand = \"The Black Hand\",\n UnstableCircadianModulator = \"Unstable Circadian Modulator\",\n CRTX42AA = \"CRTX42-AA Gene Modification\",\n Neuregen = \"Neuregen Gene Modification\",\n CashRoot = \"CashRoot Starter Kit\",\n NutriGen = \"NutriGen Implant\",\n INFRARet = \"INFRARET Enhancement\",\n DermaForce = \"DermaForce Particle Barrier\",\n GrapheneBrachiBlades = \"Graphene BrachiBlades Upgrade\",\n GrapheneBionicArms = \"Graphene Bionic Arms Upgrade\",\n BrachiBlades = \"BrachiBlades\",\n BionicArms = \"Bionic Arms\",\n SNA = \"Social Negotiation Assistant (S.N.A)\",\n CongruityImplant = \"nickofolas Congruity Implant\",\n HydroflameLeftArm = \"Hydroflame Left Arm\",\n BigDsBigBrain = \"BigD's Big ... Brain\",\n ZOE = \"Z.O.Ë.\",\n // UnnamedAug2 = \"UnnamedAug2\",\n\n // Bladeburner augs\n EsperEyewear = \"EsperTech Bladeburner Eyewear\",\n EMS4Recombination = \"EMS-4 Recombination\",\n OrionShoulder = \"ORION-MKIV Shoulder\",\n HyperionV1 = \"Hyperion Plasma Cannon V1\",\n HyperionV2 = \"Hyperion Plasma Cannon V2\",\n GolemSerum = \"GOLEM Serum\",\n VangelisVirus = \"Vangelis Virus\",\n VangelisVirus3 = \"Vangelis Virus 3.0\",\n INTERLINKED = \"I.N.T.E.R.L.I.N.K.E.D\",\n BladeRunner = \"Blade's Runners\",\n BladeArmor = \"BLADE-51b Tesla Armor\",\n BladeArmorPowerCells = \"BLADE-51b Tesla Armor: Power Cells Upgrade\",\n BladeArmorEnergyShielding = \"BLADE-51b Tesla Armor: Energy Shielding Upgrade\",\n BladeArmorUnibeam = \"BLADE-51b Tesla Armor: Unibeam Upgrade\",\n BladeArmorOmnibeam = \"BLADE-51b Tesla Armor: Omnibeam Upgrade\",\n BladeArmorIPU = \"BLADE-51b Tesla Armor: IPU Upgrade\",\n BladesSimulacrum = \"The Blade's Simulacrum\",\n\n StaneksGift1 = \"Stanek's Gift - Genesis\",\n StaneksGift2 = \"Stanek's Gift - Awakening\",\n StaneksGift3 = \"Stanek's Gift - Serenity\",\n\n // Infiltrators MiniGames\n MightOfAres = \"SoA - Might of Ares\", // slash\n WisdomOfAthena = \"SoA - Wisdom of Athena\", // bracket\n TrickeryOfHermes = \"SoA - Trickery of Hermes\", // cheatcode\n BeautyOfAphrodite = \"SoA - Beauty of Aphrodite\", // bribe\n ChaosOfDionysus = \"SoA - Chaos of Dionysus\", // reverse\n FloodOfPoseidon = \"SoA - Flood of Poseidon\", // hex\n HuntOfArtemis = \"SoA - Hunt of Artemis\", // mine\n KnowledgeOfApollo = \"SoA - Knowledge of Apollo\", // wire\n WKSharmonizer = \"SoA - phyzical WKS harmonizer\",\n}\n","/**\n * Generic Game Constants\n *\n * Constants for specific mechanics or features will NOT be here.\n */\nexport const CONSTANTS: {\n VersionString: string;\n VersionNumber: number;\n _idleSpeed: number;\n MaxSkillLevel: number;\n MilliPerCycle: number;\n CorpFactionRepRequirement: number;\n BaseFocusBonus: number;\n BaseCostFor1GBOfRamHome: number;\n BaseCostFor1GBOfRamServer: number;\n TravelCost: number;\n BaseFavorToDonate: number;\n DonateMoneyToRepDivisor: number;\n FactionReputationToFavorBase: number;\n FactionReputationToFavorMult: number;\n CompanyReputationToFavorBase: number;\n CompanyReputationToFavorMult: number;\n NeuroFluxGovernorLevelMult: number;\n NumNetscriptPorts: number;\n HomeComputerMaxRam: number;\n ServerBaseGrowthRate: number;\n ServerMaxGrowthRate: number;\n ServerFortifyAmount: number;\n ServerWeakenAmount: number;\n PurchasedServerLimit: number;\n PurchasedServerMaxRam: number;\n MultipleAugMultiplier: number;\n TorRouterCost: number;\n WSEAccountCost: number;\n TIXAPICost: number;\n MarketData4SCost: number;\n MarketDataTixApi4SCost: number;\n StockMarketCommission: number;\n HospitalCostPerHp: number;\n IntelligenceCrimeWeight: number;\n IntelligenceInfiltrationWeight: number;\n IntelligenceCrimeBaseExpGain: number;\n IntelligenceProgramBaseExpGain: number;\n IntelligenceGraftBaseExpGain: number;\n IntelligenceTerminalHackBaseExpGain: number;\n IntelligenceSingFnBaseExpGain: number;\n IntelligenceClassBaseExpGain: number;\n MillisecondsPer20Hours: number;\n GameCyclesPer20Hours: number;\n MillisecondsPer10Hours: number;\n GameCyclesPer10Hours: number;\n MillisecondsPer8Hours: number;\n GameCyclesPer8Hours: number;\n MillisecondsPer4Hours: number;\n GameCyclesPer4Hours: number;\n MillisecondsPer2Hours: number;\n GameCyclesPer2Hours: number;\n MillisecondsPerHour: number;\n GameCyclesPerHour: number;\n MillisecondsPerHalfHour: number;\n GameCyclesPerHalfHour: number;\n MillisecondsPerQuarterHour: number;\n GameCyclesPerQuarterHour: number;\n MillisecondsPerFiveMinutes: number;\n GameCyclesPerFiveMinutes: number;\n ClassDataStructuresBaseCost: number;\n ClassNetworksBaseCost: number;\n ClassAlgorithmsBaseCost: number;\n ClassManagementBaseCost: number;\n ClassLeadershipBaseCost: number;\n ClassGymBaseCost: number;\n ClassStudyComputerScienceBaseExp: number;\n ClassDataStructuresBaseExp: number;\n ClassNetworksBaseExp: number;\n ClassAlgorithmsBaseExp: number;\n ClassManagementBaseExp: number;\n ClassLeadershipBaseExp: number;\n CodingContractBaseFactionRepGain: number;\n CodingContractBaseCompanyRepGain: number;\n CodingContractBaseMoneyGain: number;\n AugmentationGraftingCostMult: number;\n AugmentationGraftingTimeBase: number;\n SoACostMult: number;\n SoARepMult: number;\n EntropyEffect: number;\n TotalNumBitNodes: number;\n InfiniteLoopLimit: number;\n Donations: number; // number of blood/plasma/palette donation the dev have verified., boosts NFG\n LatestUpdate: string;\n} = {\n VersionString: \"2.1.0\",\n VersionNumber: 26,\n\n // Speed (in ms) at which the main loop is updated\n _idleSpeed: 200,\n\n /** Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience\n * and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then\n * the player will have this level assuming no multipliers. Multipliers can cause skills to go above this.\n */\n MaxSkillLevel: 975,\n\n // Milliseconds per game cycle\n MilliPerCycle: 200,\n\n // How much reputation is needed to join a megacorporation's faction\n CorpFactionRepRequirement: 400e3,\n\n // Base RAM costs\n BaseCostFor1GBOfRamHome: 32000,\n BaseCostFor1GBOfRamServer: 55000, //1 GB of RAM\n\n // Cost to travel to another city\n TravelCost: 200e3,\n\n // Faction and Company favor-related things\n BaseFavorToDonate: 150,\n DonateMoneyToRepDivisor: 1e6,\n FactionReputationToFavorBase: 500,\n FactionReputationToFavorMult: 1.02,\n CompanyReputationToFavorBase: 500,\n CompanyReputationToFavorMult: 1.02,\n\n // NeuroFlux Governor Augmentation cost multiplier\n NeuroFluxGovernorLevelMult: 1.14,\n\n NumNetscriptPorts: Number.MAX_SAFE_INTEGER,\n\n // Server-related constants\n HomeComputerMaxRam: 1073741824, // 2 ^ 30\n ServerBaseGrowthRate: 1.03, // Unadjusted Growth rate\n ServerMaxGrowthRate: 1.0035, // Maximum possible growth rate (max rate accounting for server security)\n ServerFortifyAmount: 0.002, // Amount by which server's security increases when its hacked/grown\n ServerWeakenAmount: 0.05, // Amount by which server's security decreases when weakened\n\n PurchasedServerLimit: 25,\n PurchasedServerMaxRam: 1048576, // 2^20\n\n // Augmentation Constants\n MultipleAugMultiplier: 1.9,\n\n // TOR Router\n TorRouterCost: 200e3,\n\n // Stock market\n WSEAccountCost: 200e6,\n TIXAPICost: 5e9,\n MarketData4SCost: 1e9,\n MarketDataTixApi4SCost: 25e9,\n StockMarketCommission: 100e3,\n\n // Hospital/Health\n HospitalCostPerHp: 100e3,\n\n // Intelligence-related constants\n IntelligenceCrimeWeight: 0.025, // Weight for how much int affects crime success rates\n IntelligenceInfiltrationWeight: 0.1, // Weight for how much int affects infiltration success rates\n IntelligenceCrimeBaseExpGain: 0.05,\n IntelligenceProgramBaseExpGain: 0.1, // Program required hack level divided by this to determine int exp gain\n IntelligenceGraftBaseExpGain: 0.05,\n IntelligenceTerminalHackBaseExpGain: 200, // Hacking exp divided by this to determine int exp gain\n IntelligenceSingFnBaseExpGain: 1.5,\n IntelligenceClassBaseExpGain: 0.01,\n\n // Time-related constants\n MillisecondsPer20Hours: 72000000,\n GameCyclesPer20Hours: 72000000 / 200,\n\n MillisecondsPer10Hours: 36000000,\n GameCyclesPer10Hours: 36000000 / 200,\n\n MillisecondsPer8Hours: 28800000,\n GameCyclesPer8Hours: 28800000 / 200,\n\n MillisecondsPer4Hours: 14400000,\n GameCyclesPer4Hours: 14400000 / 200,\n\n MillisecondsPer2Hours: 7200000,\n GameCyclesPer2Hours: 7200000 / 200,\n\n MillisecondsPerHour: 3600000,\n GameCyclesPerHour: 3600000 / 200,\n\n MillisecondsPerHalfHour: 1800000,\n GameCyclesPerHalfHour: 1800000 / 200,\n\n MillisecondsPerQuarterHour: 900000,\n GameCyclesPerQuarterHour: 900000 / 200,\n\n MillisecondsPerFiveMinutes: 300000,\n GameCyclesPerFiveMinutes: 300000 / 200,\n\n // Player Work & Action\n BaseFocusBonus: 0.8,\n\n ClassDataStructuresBaseCost: 40,\n ClassNetworksBaseCost: 80,\n ClassAlgorithmsBaseCost: 320,\n ClassManagementBaseCost: 160,\n ClassLeadershipBaseCost: 320,\n ClassGymBaseCost: 120,\n\n ClassStudyComputerScienceBaseExp: 0.5,\n ClassDataStructuresBaseExp: 1,\n ClassNetworksBaseExp: 2,\n ClassAlgorithmsBaseExp: 4,\n ClassManagementBaseExp: 2,\n ClassLeadershipBaseExp: 4,\n\n // Coding Contract\n // TODO: Move this into Coding contract implementation?\n CodingContractBaseFactionRepGain: 2500,\n CodingContractBaseCompanyRepGain: 4000,\n CodingContractBaseMoneyGain: 75e6,\n\n // Augmentation grafting multipliers\n AugmentationGraftingCostMult: 3,\n AugmentationGraftingTimeBase: 3600000,\n\n // SoA mults\n SoACostMult: 7,\n SoARepMult: 1.3,\n\n // Value raised to the number of entropy stacks, then multiplied to player multipliers\n EntropyEffect: 0.98,\n\n // BitNode/Source-File related stuff\n TotalNumBitNodes: 24,\n\n InfiniteLoopLimit: 2000,\n\n Donations: 30,\n\n LatestUpdate: `\n v2.1.0 - 2022-09-23 Remote File API\n -----------------------------------\n \n Dev notes\n * The most important change about this update is the introduction of the remote file api.\n With this we also deprecate the HTTP file api and the visual studio extension. Those things\n were made during the rush of Steam and aren't well thought out. This new process works with\n both the web and Steam version of the game and every text editor. Moving forward we also\n won't be doing much, if any, upgrades to the in-game editor. We think it's good enough for\n now and if you need more we recommend you hook up your favorite external editor.\n * Added functions to resize, move, and close tail windows\n * Added a new Augmentation, Z.O.Ë., which allows Sleeves to benefit from Stanek.\n \n API\n * Remove incorrectly placed 's' in ns.tFormat() (by @LJNeon)\n * More ports (previously max 20, now practically unlimited) (by @Hoekstraa)\n * Corp functions now return copy of constant arrays instead of the original (by @Mughur)\n * All the player sub-objects need to be copied for 'getPlayer'. (by @MageKing17)\n * add corp get<constant> functions, UI (by @Mughur)\n * FIX #3860 destroyW0r1dD43m0n now properly gives achievements and FIX #3890 favor now properly syncs across pages and the Donate achievement is now given correctly (by @Aerophia)\n \n CONTRIBUTIONS\n * Modify PR template (by @Hoekstraa)\n \n CCT\n * inconsistent probability for generation between online and offline (by @quacksouls)\n \n DOC\n * Some typo fixes in Netscript functions (by @quacksouls)\n * Fix #4033 Why use Coding Contract API (by @quacksouls)\n * typo fix in description of Caesar cipher (by @quacksouls)\n * FIX DOCS TYPO IN terminal.rst (by @BugiDev)\n * Update bitburner.sleeve.settobladeburneraction.md (by @borisflagell)\n \n CORPORATION\n * FIX #3880, #3876, #3322 and #3138 Bunch of corporation fixes (by @Mughur)\n * Gave investors some economics classes (by @Mughur)\n * Limit shareholder priority on newly issued shares (by @Undeemiss)\n \n UI\n * FIX #2962 Add a setting to display middle time unit in Time Elapsed String (by @hydroflame)\n * FIX #4106 Fix incorrect experience display in Crime UI. (by @SilverNexus)\n * Bitnode stats now show if BB/Corporation are disabled (by @Kelenius)\n * Removed three empty lines from BB status screen (by @Kelenius)\n * Add missing space to BN7 description (by @hex7cd)\n * Improvements to crime work UI (by @Kelenius)\n * FIX #3975, #3882 Script Editor more responsive on resize, and fix dirty file indicator (by @Snarling)\n \n API FIX\n * getCrimeStats use bitnode multipliers in the output of crime stats (by @phyzical)\n \n SLEEVES\n * FIX #3819 Allow using the regeneration chamber with sleeves to heal them. (by @coderanger)\n * FIX #4063 fix crash when player tries to assign more than 3 sleeves to Bladeburner contracts (by @Snarling)\n * FIX #4051 Sleeves no longer crash when player quits company sleeve was working (by @Snarling)\n \n API BACKUP\n * add singularity function for exporting game save back (by @phyzical)\n \n CORPORATION API\n * FIX #3655 Expose exports from Material (by @Rasmoh)\n \n SCRIPTS\n * FIX #4081 Rerunning a script from tail window recalculates ram usage (by @Snarling)\n * FIX #3962 The correct script will be closed even if the player modifies args (v2.0) (by @Snarling)\n \n DOCUMENTATION\n * Fixed Argument order for scp() (by @njalooo)\n \n CORP API\n * Fix up param order for limitProductProduction to match docs (by @phyzical)\n \n NETSCRIPT\n * FIX #2376 ns.exit now exits immediately (by @Snarling)\n * FIX #4055 Fix dynamic ram check (by @Snarling)\n * FIX #4037 ns1 wraps deeper layers correctly. (by @Snarling)\n * FIX #3963 Prevent bladeburner.setActionLevel from setting invalid action levels (by @MPJ-K)\n * Typo fixes in CodingContract, Hacknet, Singularity APIs (by @quacksouls)\n * Fix a typo in doc of Singularity.travelToCity() (by @quacksouls)\n * Update netscript definition file for scp, write, read, and flags (by @Snarling)\n * Correct missing ! for boolean coercion in Corporation.createCorporation(). (by @Risenafis)\n * Normalized Stock API logging (by @Snarling)\n * fix #3992 allow null duration in toast ns function (by @RollerKnobster)\n * Correct missing '!' for boolean coercion in 'singularity.workForCompany()'. (by @MageKing17)\n * ns.scp and ns.write are now synchronous + fix exec race condition (by @Snarling)\n * FIX #2931 atExit now allows synchronous ns functions (by @Snarling)\n * Improve real life CPU and memory performance of scripts. (by @Snarling)\n \n INFILTRATION\n * Corrected ns formula for infiltration rewards (by @ezylot)\n \n RFA\n * NetscriptDefinitions retains export strings (by @Hoekstraa)\n * Fix type of RFAMessages with non-String results (by @Hoekstraa)\n * New Remote File API addition for transmitting files to the game (by @Hoekstraa)\n \n SLEEVE\n * FIX #4022, #4024, #4025, #3998 (by @Mughur)\n \n DOCS, UI\n * update docs a bit more, amending some BN and SF texts (by @Mughur)\n \n GANG\n * Added weight to GangMemberTask construction call (by @ezylot)\n \n Coding Contracts\n * Don't stringify answer if already a string (by @alainbryden)\n \n TERMINAL\n * Fix ansi display bugs (by @Snarling)\n \n SCRIPT EDITOR\n * Debounce updateRAM calls. (by @Snarling)\n \n WORK\n * Add singularity check for finishing company work (by @Snarling)\n \n DOCS\n * Correct documentation for 'run()' with 0 threads. (by @MageKing17)\n * Some doc updates (by @Mughur)\n \n FILES\n * FIX #3979 Allow characters & and ' in filenames (by @Snarling)\n \n CORP FIX\n * dont take research points for something already researched via api (by @phyzical)\n \n FIX\n * Prompt Add user friendly message to avoid throwing recovery screen for invalid choices (by @phyzical)\n \n TUTORIAL\n * Fix #3965 Corrected tutorial text (by @mihilt)\n \n CONTRACTS\n * FIX #3755 change input handling for contract attempts (by @Snarling)\n \n HOTFIX\n * Fix infil definitions.d.ts (by @phyzical)\n \n MISC\n * crime gains, sleeve gang augs and faq (by @Mughur)\n * FIX #3649 Preventing server starting security level from going above 100 (by @Shiiyu)\n * Adds Shadows of Anarchy (by @Lagicrus)\n * Added intormation about hacking managers to hacking algorithms page (by @Kelenius)\n * Fix Jest CI Error (by @geggleto)\n * multiple hasAugmentation checks didn't check if the augment was installed (by @Mughur)\n * Fix for #2442 and #2795. (by @G4mingJon4s)\n * Adds info regarding augments and focus (by @Lagicrus)\n * Removed console.log line (by @dhosborne)\n * Update some doc (by @hydroflame)\n * Sleeve crime gain bitnode multiplier fix (by @Mughur)\n * trying to fix int problems (by @hydroflame)\n * Fix broken ns filesnames (by @hydroflame)\n * new formula functions (by @hydroflame)\n * v2.0.0 (by @hydroflame)\n * test fixes/md updates (by @phyzical)\n * Remove \"based\" from positive adjectives in infil (by @faangbait)\n * minor fix in instance calculation (by @hydroflame)\n * fix dynamic ram miscalc not triggering (by @hydroflame)\n * Refactor game options into separate components (by @hydroflame)\n * fix documentation for remote api (by @hydroflame)\n * fix settings unfocusing on every key stroke (by @hydroflame)\n * fix some stuff with the timestamp settings (by @hydroflame)\n * fix some stuff with the timestamp settings (by @hydroflame)\n * Fix unique key problem with ascii elements (by @hydroflame)\n * Improve wrong arg user message and add ui.windowSize (by @hydroflame)\n * fix stack trace missing in some errors (by @hydroflame)\n * Fix scp and write in ns1 (by @hydroflame)\n * Did some changes of the remote api and added documentation (by @hydroflame)\n * Add dummy function to generate a mock server or player for formulas stuff (by @hydroflame)\n * fix compile error (by @hydroflame)\n * regen doc (by @hydroflame)\n * rm console log (by @hydroflame)\n * regen doc (by @hydroflame)\n * Added more info about blood program, change some aug descriptions (by @hydroflame)\n * use triple equal (by @hydroflame)\n * Minor improvements to Netscript Port loading and unloading (by @hydroflame)\n * Fix hostname generation being weird about dash 0 added (by @hydroflame)\n * upgrade version number. (by @hydroflame)\n * Nerf Noodle bar \n \n`,\n};\n","/* Generic Reviver, toJSON, and fromJSON functions used for saving and loading objects */\n\nimport { validateObject } from \"./Validator\";\n\nexport interface IReviverValue {\n ctor: string;\n data: any;\n}\n\n// A generic \"smart reviver\" function.\n// Looks for object values with a `ctor` property and\n// a `data` property. If it finds them, and finds a matching\n// constructor that has a `fromJSON` property on it, it hands\n// off to that `fromJSON` function, passing in the value.\nexport function Reviver(key: string, value: IReviverValue | null): any {\n if (value == null) {\n return null;\n }\n\n if (typeof value === \"object\" && typeof value.ctor === \"string\" && typeof value.data !== \"undefined\") {\n // Compatibility for version v0.43.1\n // TODO Remove this eventually\n if (value.ctor === \"AllServersMap\") {\n console.warn(\"Converting AllServersMap for v0.43.1\");\n return value.data;\n }\n\n const ctor = Reviver.constructors[value.ctor];\n\n if (typeof ctor === \"function\" && typeof ctor.fromJSON === \"function\") {\n const obj = ctor.fromJSON(value);\n if (ctor.validationData !== undefined) {\n validateObject(obj, ctor.validationData);\n }\n return obj;\n }\n }\n return value;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Reviver {\n export const constructors: { [key: string]: any } = {};\n}\n\n// A generic \"toJSON\" function that creates the data expected\n// by Reviver.\n// `ctorName` The name of the constructor to use to revive it\n// `obj` The object being serialized\n// `keys` (Optional) Array of the properties to serialize,\n// if not given then all of the objects \"own\" properties\n// that don't have function values will be serialized.\n// (Note: If you list a property in `keys`, it will be serialized\n// regardless of whether it's an \"own\" property.)\n// Returns: The structure (which will then be turned into a string\n// as part of the JSON.stringify algorithm)\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function Generic_toJSON(ctorName: string, obj: Record<string, any>, keys?: string[]): IReviverValue {\n if (!keys) {\n keys = Object.keys(obj); // Only \"own\" properties are included\n }\n\n const data: Record<string, unknown> = {};\n for (let index = 0; index < keys.length; ++index) {\n const key = keys[index];\n data[key] = obj[key];\n }\n return { ctor: ctorName, data: data };\n}\n\n// A generic \"fromJSON\" function for use with Reviver: Just calls the\n// constructor function with no arguments, then applies all of the\n// key/value pairs from the raw data to the instance. Only useful for\n// constructors that can be reasonably called without arguments!\n// `ctor` The constructor to call\n// `data` The data to apply\n// Returns: The object\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function Generic_fromJSON<T>(ctor: new () => T, data: any): T {\n const obj: any = new ctor();\n for (const name in data) {\n obj[name] = data[name];\n }\n return obj;\n}\n","/**\n * All possible Cities in the game. Names only, not actual \"City\" object\n * Implemented as an enum for typing purposes\n */\nexport enum CityName {\n Aevum = \"Aevum\",\n Chongqing = \"Chongqing\",\n Ishima = \"Ishima\",\n NewTokyo = \"New Tokyo\",\n Sector12 = \"Sector-12\",\n Volhaven = \"Volhaven\",\n}\n","import { AlertEvents } from \"./AlertManager\";\n\nimport React from \"react\";\nimport { Typography } from \"@mui/material\";\n\nexport function dialogBoxCreate(txt: string | JSX.Element, html = false): void {\n AlertEvents.emit(\n typeof txt !== \"string\" ? (\n txt\n ) : html ? (\n <div dangerouslySetInnerHTML={{ __html: txt }}></div>\n ) : (\n <Typography component=\"span\">{txt}</Typography>\n ),\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { Player } from \"@player\";\nimport { installAugmentations } from \"../Augmentation/AugmentationHelpers\";\nimport { saveObject } from \"../SaveObject\";\nimport { onExport } from \"../ExportBonus\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { Location } from \"../Locations/Location\";\nimport { ITutorial, iTutorialStart } from \"../InteractiveTutorial\";\nimport { InteractiveTutorialRoot } from \"./InteractiveTutorial/InteractiveTutorialRoot\";\nimport { ITutorialEvents } from \"./InteractiveTutorial/ITutorialEvents\";\n\nimport { Faction } from \"../Faction/Faction\";\nimport { prestigeAugmentation } from \"../Prestige\";\nimport { dialogBoxCreate } from \"./React/DialogBox\";\nimport { GetAllServers } from \"../Server/AllServers\";\nimport { Factions } from \"../Faction/Factions\";\nimport { StockMarket } from \"../StockMarket/StockMarket\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\n\nimport { Page, IRouter, ScriptEditorRouteOptions } from \"./Router\";\nimport { Overview } from \"./React/Overview\";\nimport { SidebarRoot } from \"../Sidebar/ui/SidebarRoot\";\nimport { AugmentationsRoot } from \"../Augmentation/ui/AugmentationsRoot\";\nimport { DevMenuRoot } from \"../DevMenu\";\nimport { BladeburnerRoot } from \"../Bladeburner/ui/BladeburnerRoot\";\nimport { GangRoot } from \"../Gang/ui/GangRoot\";\nimport { CorporationRoot } from \"../Corporation/ui/CorporationRoot\";\nimport { InfiltrationRoot } from \"../Infiltration/ui/InfiltrationRoot\";\nimport { GraftingRoot } from \"../PersonObjects/Grafting/ui/GraftingRoot\";\nimport { WorkInProgressRoot } from \"./WorkInProgressRoot\";\nimport { GameOptionsRoot } from \"../GameOptions/ui/GameOptionsRoot\";\nimport { SleeveRoot } from \"../PersonObjects/Sleeve/ui/SleeveRoot\";\nimport { HacknetRoot } from \"../Hacknet/ui/HacknetRoot\";\nimport { GenericLocation } from \"../Locations/ui/GenericLocation\";\nimport { LocationCity } from \"../Locations/ui/City\";\nimport { ProgramsRoot } from \"../Programs/ui/ProgramsRoot\";\nimport { Root as ScriptEditorRoot } from \"../ScriptEditor/ui/ScriptEditorRoot\";\nimport { MilestonesRoot } from \"../Milestones/ui/MilestonesRoot\";\nimport { TerminalRoot } from \"../Terminal/ui/TerminalRoot\";\nimport { TutorialRoot } from \"../Tutorial/ui/TutorialRoot\";\nimport { ActiveScriptsRoot } from \"./ActiveScripts/ActiveScriptsRoot\";\nimport { FactionsRoot } from \"../Faction/ui/FactionsRoot\";\nimport { FactionRoot } from \"../Faction/ui/FactionRoot\";\nimport { CharacterStats } from \"./CharacterStats\";\nimport { TravelAgencyRoot } from \"../Locations/ui/TravelAgencyRoot\";\nimport { StockMarketRoot } from \"../StockMarket/ui/StockMarketRoot\";\nimport { BitverseRoot } from \"../BitNode/ui/BitverseRoot\";\nimport { StaneksGiftRoot } from \"../CotMG/ui/StaneksGiftRoot\";\nimport { staneksGift } from \"../CotMG/Helper\";\nimport { CharacterOverview } from \"./React/CharacterOverview\";\nimport { BladeburnerCinematic } from \"../Bladeburner/ui/BladeburnerCinematic\";\nimport { workerScripts } from \"../Netscript/WorkerScripts\";\nimport { Unclickable } from \"../Exploits/Unclickable\";\nimport { Snackbar, SnackbarProvider } from \"./React/Snackbar\";\nimport { LogBoxManager } from \"./React/LogBoxManager\";\nimport { AlertManager } from \"./React/AlertManager\";\nimport { PromptManager } from \"./React/PromptManager\";\nimport { InvitationModal } from \"../Faction/ui/InvitationModal\";\nimport { calculateAchievements } from \"../Achievements/Achievements\";\n\nimport { RecoveryMode, RecoveryRoot } from \"./React/RecoveryRoot\";\nimport { AchievementsRoot } from \"../Achievements/AchievementsRoot\";\nimport { ErrorBoundary } from \"./ErrorBoundary\";\nimport { Settings } from \"../Settings/Settings\";\nimport { ThemeBrowser } from \"../Themes/ui/ThemeBrowser\";\nimport { ImportSaveRoot } from \"./React/ImportSaveRoot\";\nimport { BypassWrapper } from \"./React/BypassWrapper\";\n\nimport _wrap from \"lodash/wrap\";\nimport _functions from \"lodash/functions\";\nimport { Apr1 } from \"./Apr1\";\nimport { isFactionWork } from \"../Work/FactionWork\";\nimport { V2Modal } from \"../utils/V2Modal\";\n\nconst htmlLocation = location;\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n \"-ms-overflow-style\": \"none\" /* for Internet Explorer, Edge */,\n \"scrollbar-width\": \"none\" /* for Firefox */,\n margin: theme.spacing(0),\n flexGrow: 1,\n padding: \"8px\",\n minHeight: \"100vh\",\n boxSizing: \"border-box\",\n width: \"1px\",\n },\n }),\n);\n\nconst uninitialized = (): void => {\n throw new Error(\"Router called before initialization\");\n};\n\nexport let Router: IRouter = {\n isInitialized: false,\n page: () => {\n throw new Error(\"Router called before initialization\");\n },\n allowRouting: uninitialized,\n toActiveScripts: uninitialized,\n toAugmentations: uninitialized,\n toBitVerse: uninitialized,\n toBladeburner: uninitialized,\n toStats: uninitialized,\n toCity: uninitialized,\n toCorporation: uninitialized,\n toCreateProgram: uninitialized,\n toDevMenu: uninitialized,\n toFaction: uninitialized,\n toFactions: uninitialized,\n toGameOptions: uninitialized,\n toGang: uninitialized,\n toHacknetNodes: uninitialized,\n toInfiltration: uninitialized,\n toJob: uninitialized,\n toMilestones: uninitialized,\n toGrafting: uninitialized,\n toScriptEditor: uninitialized,\n toSleeves: uninitialized,\n toStockMarket: uninitialized,\n toTerminal: uninitialized,\n toTravel: uninitialized,\n toTutorial: uninitialized,\n toWork: uninitialized,\n toBladeburnerCinematic: uninitialized,\n toLocation: uninitialized,\n toStaneksGift: uninitialized,\n toAchievements: uninitialized,\n toThemeBrowser: uninitialized,\n toImportSave: uninitialized,\n};\n\nfunction determineStartPage(): Page {\n if (RecoveryMode) return Page.Recovery;\n if (Player.currentWork !== null) return Page.Work;\n return Page.Terminal;\n}\n\nexport function GameRoot(): React.ReactElement {\n const classes = useStyles();\n const [{ files, vim }, setEditorOptions] = useState({ files: {}, vim: false });\n const [page, setPage] = useState(determineStartPage());\n const setRerender = useState(0)[1];\n const [augPage, setAugPage] = useState<boolean>(false);\n const [faction, setFaction] = useState<Faction>(\n isFactionWork(Player.currentWork) ? Factions[Player.currentWork.factionName] : (undefined as unknown as Faction),\n );\n if (faction === undefined && page === Page.Faction)\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [flume, setFlume] = useState<boolean>(false);\n const [quick, setQuick] = useState<boolean>(false);\n const [location, setLocation] = useState<Location>(undefined as unknown as Location);\n if (location === undefined && (page === Page.Infiltration || page === Page.Location || page === Page.Job))\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [cinematicText, setCinematicText] = useState(\"\");\n const [errorBoundaryKey, setErrorBoundaryKey] = useState<number>(0);\n const [sidebarOpened, setSideBarOpened] = useState(Settings.IsSidebarOpened);\n\n const [importString, setImportString] = useState<string>(undefined as unknown as string);\n const [importAutomatic, setImportAutomatic] = useState<boolean>(false);\n if (importString === undefined && page === Page.ImportSave)\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [allowRoutingCalls, setAllowRoutingCalls] = useState(true);\n\n function resetErrorBoundary(): void {\n setErrorBoundaryKey(errorBoundaryKey + 1);\n }\n\n function rerender(): void {\n setRerender((old) => old + 1);\n }\n useEffect(() => {\n return ITutorialEvents.subscribe(rerender);\n }, []);\n\n function killAllScripts(): void {\n for (const server of GetAllServers()) {\n server.runningScripts = [];\n }\n saveObject.saveGame();\n setTimeout(() => htmlLocation.reload(), 2000);\n }\n\n Router = {\n isInitialized: true,\n page: () => page,\n allowRouting: (value: boolean) => setAllowRoutingCalls(value),\n toActiveScripts: () => setPage(Page.ActiveScripts),\n toAugmentations: () => setPage(Page.Augmentations),\n toBladeburner: () => setPage(Page.Bladeburner),\n toStats: () => setPage(Page.Stats),\n toCorporation: () => setPage(Page.Corporation),\n toCreateProgram: () => setPage(Page.CreateProgram),\n toDevMenu: () => setPage(Page.DevMenu),\n toFaction: (faction: Faction, augPage = false) => {\n setAugPage(augPage);\n setPage(Page.Faction);\n if (faction) setFaction(faction);\n },\n toFactions: () => setPage(Page.Factions),\n toGameOptions: () => setPage(Page.Options),\n toGang: () => setPage(Page.Gang),\n toHacknetNodes: () => setPage(Page.Hacknet),\n toMilestones: () => setPage(Page.Milestones),\n toGrafting: () => setPage(Page.Grafting),\n toScriptEditor: (files: Record<string, string>, options?: ScriptEditorRouteOptions) => {\n setEditorOptions({\n files,\n vim: !!options?.vim,\n });\n setPage(Page.ScriptEditor);\n },\n toSleeves: () => setPage(Page.Sleeves),\n toStockMarket: () => setPage(Page.StockMarket),\n toTerminal: () => setPage(Page.Terminal),\n toTutorial: () => setPage(Page.Tutorial),\n toJob: (location: Location) => {\n setLocation(location);\n setPage(Page.Job);\n },\n toCity: () => {\n setPage(Page.City);\n },\n toTravel: () => {\n Player.gotoLocation(LocationName.TravelAgency);\n setPage(Page.Travel);\n },\n toBitVerse: (flume: boolean, quick: boolean) => {\n setFlume(flume);\n setQuick(quick);\n calculateAchievements();\n setPage(Page.BitVerse);\n },\n toInfiltration: (location: Location) => {\n setLocation(location);\n setPage(Page.Infiltration);\n },\n toWork: () => setPage(Page.Work),\n toBladeburnerCinematic: () => {\n setPage(Page.BladeburnerCinematic);\n setCinematicText(cinematicText);\n },\n toLocation: (location: Location) => {\n setLocation(location);\n setPage(Page.Location);\n },\n toStaneksGift: () => {\n setPage(Page.StaneksGift);\n },\n toAchievements: () => {\n setPage(Page.Achievements);\n },\n toThemeBrowser: () => {\n setPage(Page.ThemeBrowser);\n },\n toImportSave: (base64save: string, automatic = false) => {\n setImportString(base64save);\n setImportAutomatic(automatic);\n setPage(Page.ImportSave);\n },\n };\n\n useEffect(() => {\n // Wrap Router navigate functions to be able to disable the execution\n _functions(Router)\n .filter((fnName) => fnName.startsWith(\"to\"))\n .forEach((fnName) => {\n // @ts-ignore - tslint does not like this, couldn't find a way to make it cooperate\n Router[fnName] = _wrap(Router[fnName], (func, ...args) => {\n if (!allowRoutingCalls) {\n // Let's just log to console.\n console.error(`Routing is currently disabled - Attempted router.${fnName}()`);\n return;\n }\n\n // Call the function normally\n return func(...args);\n });\n });\n });\n\n useEffect(() => {\n if (page !== Page.Terminal) window.scrollTo(0, 0);\n });\n\n function softReset(): void {\n dialogBoxCreate(\"Soft Reset!\");\n installAugmentations(true);\n resetErrorBoundary();\n Router.toTerminal();\n }\n\n let mainPage = <Typography>Cannot load</Typography>;\n let withSidebar = true;\n let withPopups = true;\n let bypassGame = false;\n switch (page) {\n case Page.Recovery: {\n mainPage = <RecoveryRoot softReset={softReset} />;\n withSidebar = false;\n withPopups = false;\n bypassGame = true;\n break;\n }\n case Page.BitVerse: {\n mainPage = <BitverseRoot flume={flume} quick={quick} />;\n withSidebar = false;\n withPopups = false;\n break;\n }\n case Page.Infiltration: {\n mainPage = <InfiltrationRoot location={location} />;\n withSidebar = false;\n withPopups = false;\n break;\n }\n case Page.BladeburnerCinematic: {\n mainPage = <BladeburnerCinematic />;\n withSidebar = false;\n withPopups = false;\n break;\n }\n case Page.Work: {\n mainPage = <WorkInProgressRoot />;\n withSidebar = false;\n break;\n }\n case Page.Terminal: {\n mainPage = <TerminalRoot />;\n break;\n }\n case Page.Sleeves: {\n mainPage = <SleeveRoot />;\n break;\n }\n case Page.StaneksGift: {\n mainPage = <StaneksGiftRoot staneksGift={staneksGift} />;\n break;\n }\n case Page.Stats: {\n mainPage = <CharacterStats />;\n break;\n }\n case Page.ScriptEditor: {\n mainPage = <ScriptEditorRoot files={files} hostname={Player.getCurrentServer().hostname} vim={vim} />;\n break;\n }\n case Page.ActiveScripts: {\n mainPage = <ActiveScriptsRoot workerScripts={workerScripts} />;\n break;\n }\n case Page.Hacknet: {\n mainPage = <HacknetRoot />;\n break;\n }\n case Page.CreateProgram: {\n mainPage = <ProgramsRoot />;\n break;\n }\n case Page.Factions: {\n mainPage = <FactionsRoot />;\n break;\n }\n case Page.Faction: {\n mainPage = <FactionRoot faction={faction} augPage={augPage} />;\n break;\n }\n case Page.Milestones: {\n mainPage = <MilestonesRoot />;\n break;\n }\n case Page.Tutorial: {\n mainPage = (\n <TutorialRoot\n reactivateTutorial={() => {\n prestigeAugmentation();\n Router.toTerminal();\n iTutorialStart();\n }}\n />\n );\n break;\n }\n case Page.DevMenu: {\n mainPage = <DevMenuRoot />;\n break;\n }\n case Page.Gang: {\n mainPage = <GangRoot />;\n break;\n }\n case Page.Corporation: {\n mainPage = <CorporationRoot />;\n break;\n }\n case Page.Bladeburner: {\n mainPage = <BladeburnerRoot />;\n break;\n }\n case Page.Grafting: {\n mainPage = <GraftingRoot />;\n break;\n }\n case Page.Travel: {\n mainPage = <TravelAgencyRoot />;\n break;\n }\n case Page.StockMarket: {\n mainPage = <StockMarketRoot stockMarket={StockMarket} />;\n break;\n }\n case Page.City: {\n mainPage = <LocationCity />;\n break;\n }\n case Page.Job:\n case Page.Location: {\n mainPage = <GenericLocation loc={location} />;\n break;\n }\n case Page.Options: {\n mainPage = (\n <GameOptionsRoot\n save={() => saveObject.saveGame()}\n export={() => {\n // Apply the export bonus before saving the game\n onExport();\n saveObject.exportGame();\n }}\n forceKill={killAllScripts}\n softReset={softReset}\n />\n );\n break;\n }\n case Page.Augmentations: {\n mainPage = (\n <AugmentationsRoot\n exportGameFn={() => {\n // Apply the export bonus before saving the game\n onExport();\n saveObject.exportGame();\n }}\n installAugmentationsFn={() => {\n installAugmentations();\n }}\n />\n );\n break;\n }\n case Page.Achievements: {\n mainPage = <AchievementsRoot />;\n break;\n }\n case Page.ThemeBrowser: {\n mainPage = <ThemeBrowser />;\n break;\n }\n case Page.ImportSave: {\n mainPage = <ImportSaveRoot importString={importString} automatic={importAutomatic} />;\n withSidebar = false;\n withPopups = false;\n bypassGame = true;\n }\n }\n\n return (\n <>\n <ErrorBoundary key={errorBoundaryKey} softReset={softReset}>\n <BypassWrapper content={bypassGame ? mainPage : null}>\n <SnackbarProvider>\n <Overview mode={ITutorial.isRunning ? \"tutorial\" : \"overview\"}>\n {!ITutorial.isRunning ? (\n <CharacterOverview save={() => saveObject.saveGame()} killScripts={killAllScripts} />\n ) : (\n <InteractiveTutorialRoot />\n )}\n </Overview>\n {withSidebar ? (\n <Box display=\"flex\" flexDirection=\"row\" width=\"100%\">\n <SidebarRoot\n page={page}\n opened={sidebarOpened}\n onToggled={(isOpened) => {\n setSideBarOpened(isOpened);\n Settings.IsSidebarOpened = isOpened;\n }}\n />\n <Box className={classes.root}>{mainPage}</Box>\n </Box>\n ) : (\n <Box className={classes.root}>{mainPage}</Box>\n )}\n <Unclickable />\n {withPopups && (\n <>\n <LogBoxManager />\n <AlertManager />\n <PromptManager />\n <InvitationModal />\n <Snackbar />\n </>\n )}\n <Apr1 />\n </SnackbarProvider>\n </BypassWrapper>\n </ErrorBoundary>\n <V2Modal />\n </>\n );\n}\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Player } from \"@player\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n unbuyable: {\n color: theme.palette.action.disabled,\n },\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\ninterface IProps {\n money: number | string;\n forPurchase?: boolean;\n}\nexport function Money(props: IProps): React.ReactElement {\n const classes = useStyles();\n if (props.forPurchase) {\n if (typeof props.money !== \"number\")\n throw new Error(\"if value is for a purchase, money should be number, contact dev\");\n if (!Player.canAfford(props.money))\n return <span className={classes.unbuyable}>{numeralWrapper.formatMoney(props.money)}</span>;\n }\n return (\n <span className={classes.money}>\n {typeof props.money === \"number\" ? numeralWrapper.formatMoney(props.money) : props.money}\n </span>\n );\n}\n","import { defaultMultipliers } from \"./BitNode\";\n\n/**\n * Bitnode multipliers influence the difficulty of different aspects of the game.\n * Each Bitnode has a different theme/strategy to achieving the end goal, so these multipliers will can help drive the\n * player toward the intended strategy. Unless they really want to play the long, slow game of waiting...\n */\nexport interface IBitNodeMultipliers {\n /** Influences how quickly the player's agility level (not exp) scales */\n AgilityLevelMultiplier: number;\n\n /** Influences the base cost to purchase an augmentation. */\n AugmentationMoneyCost: number;\n\n /** Influences the base rep the player must have with a faction to purchase an augmentation. */\n AugmentationRepCost: number;\n\n /** Influences how quickly the player can gain rank within Bladeburner. */\n BladeburnerRank: number;\n\n /** Influences the cost of skill levels from Bladeburner. */\n BladeburnerSkillCost: number;\n\n /** Influences how quickly the player's charisma level (not exp) scales */\n CharismaLevelMultiplier: number;\n\n /** Influences the experience gained for each ability when a player completes a class. */\n ClassGymExpGain: number;\n\n /**Influences the amount of money gained from completing Coding Contracts. */\n CodingContractMoney: number;\n\n /** Influences the experience gained for each ability when the player completes working their job. */\n CompanyWorkExpGain: number;\n\n /** Influences how much money the player earns when completing working their job. */\n CompanyWorkMoney: number;\n\n /** Influences the valuation of corporations created by the player. */\n CorporationValuation: number;\n\n /** Influences the base experience gained for each ability when the player commits a crime. */\n CrimeExpGain: number;\n\n /** Influences the base money gained when the player commits a crime. */\n CrimeMoney: number;\n\n /** Influences how many Augmentations you need in order to get invited to the Daedalus faction */\n DaedalusAugsRequirement: number;\n\n /** Influences how quickly the player's defense level (not exp) scales */\n DefenseLevelMultiplier: number;\n\n /** Influences how quickly the player's dexterity level (not exp) scales */\n DexterityLevelMultiplier: number;\n\n /** Influences how much rep the player gains in each faction simply by being a member. */\n FactionPassiveRepGain: number;\n\n /** Influences the experience gained for each ability when the player completes work for a Faction. */\n FactionWorkExpGain: number;\n\n /** Influences how much rep the player gains when performing work for a faction. */\n FactionWorkRepGain: number;\n\n /** Influences how much it costs to unlock the stock market's 4S Market Data API */\n FourSigmaMarketDataApiCost: number;\n\n /** Influences how much it costs to unlock the stock market's 4S Market Data (NOT API) */\n FourSigmaMarketDataCost: number;\n\n /** Reduces gangs earning. */\n GangSoftcap: number;\n\n /** Percentage of unique augs that the gang has. */\n GangUniqueAugs: number;\n\n /** Influences the experienced gained when hacking a server. */\n HackExpGain: number;\n\n /** Influences how quickly the player's hacking level (not experience) scales */\n HackingLevelMultiplier: number;\n\n /**\n * Influences how much money is produced by Hacknet Nodes.\n * Influences the hash rate of Hacknet Servers (unlocked in BitNode-9)\n */\n HacknetNodeMoney: number;\n\n /** Influences how much money it costs to upgrade your home computer's RAM */\n HomeComputerRamCost: number;\n\n /** Influences how much money is gained when the player infiltrates a company. */\n InfiltrationMoney: number;\n\n /** Influences how much rep the player can gain from factions when selling stolen documents and secrets */\n InfiltrationRep: number;\n\n /**\n * Influences how much money can be stolen from a server when the player performs a hack against it through\n * the Terminal.\n */\n ManualHackMoney: number;\n\n /** Influence how much it costs to purchase a server */\n PurchasedServerCost: number;\n\n /** Influence how much it costs to purchase a server */\n PurchasedServerSoftcap: number;\n\n /** Influences the maximum number of purchased servers you can have */\n PurchasedServerLimit: number;\n\n /** Influences the maximum allowed RAM for a purchased server */\n PurchasedServerMaxRam: number;\n\n /** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */\n RepToDonateToFaction: number;\n\n /** Influences how much money can be stolen from a server when a script performs a hack against it. */\n ScriptHackMoney: number;\n\n /**\n * The amount of money actually gained when script hack a server. This is\n * different than the above because you can reduce the amount of money but\n * not gain that same amount.\n */\n ScriptHackMoneyGain: number;\n\n /** Influences the growth percentage per cycle against a server. */\n ServerGrowthRate: number;\n\n /** Influences the maximum money that a server can grow to. */\n ServerMaxMoney: number;\n\n /** Influences the initial money that a server starts with. */\n ServerStartingMoney: number;\n\n /** Influences the initial security level (hackDifficulty) of a server. */\n ServerStartingSecurity: number;\n\n /** Influences the weaken amount per invocation against a server. */\n ServerWeakenRate: number;\n\n /** Influences how quickly the player's strength level (not exp) scales */\n StrengthLevelMultiplier: number;\n\n /** Influences the power of the gift. */\n StaneksGiftPowerMultiplier: number;\n\n /** Influences the size of the gift. */\n StaneksGiftExtraSize: number;\n\n /** Influences the hacking skill required to backdoor the world daemon. */\n WorldDaemonDifficulty: number;\n\n /** Influences corporation dividends. */\n CorporationSoftcap: number;\n\n // Index signature\n [key: string]: number;\n}\n\n/** The multipliers that are influenced by current Bitnode progression. */\n// tslint:disable-next-line:variable-name\nexport const BitNodeMultipliers = Object.assign({}, defaultMultipliers);\n","import { Server } from \"./Server\";\nimport { BaseServer } from \"./BaseServer\";\nimport { serverMetadata } from \"./data/servers\";\n\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\n\nimport { IMinMaxRange } from \"../types\";\nimport { createRandomIp } from \"../utils/IPAddress\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { Reviver } from \"../utils/JSONReviver\";\nimport { isValidIPAddress } from \"../utils/helpers/isValidIPAddress\";\nimport { SpecialServers } from \"./data/SpecialServers\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\n/**\n * Map of all Servers that exist in the game\n * Key (string) = IP\n * Value = Server object\n */\nlet AllServers: Record<string, Server | HacknetServer> = {};\n\nfunction GetServerByIP(ip: string): BaseServer | undefined {\n for (const key of Object.keys(AllServers)) {\n const server = AllServers[key];\n if (server.ip !== ip) continue;\n return server;\n }\n}\n\n//Returns server object with corresponding hostname\n// Relatively slow, would rather not use this a lot\nfunction GetServerByHostname(hostname: string): BaseServer | null {\n for (const key of Object.keys(AllServers)) {\n const server = AllServers[key];\n if (server.hostname == hostname) {\n return server;\n }\n }\n\n return null;\n}\n\n//Get server by IP or hostname. Returns null if invalid\nexport function GetServer(s: string): BaseServer | null {\n if (AllServers.hasOwnProperty(s)) {\n const server = AllServers[s];\n if (server) return server;\n }\n\n if (!isValidIPAddress(s)) {\n return GetServerByHostname(s);\n }\n\n const ipserver = GetServerByIP(s);\n if (ipserver !== undefined) {\n return ipserver;\n }\n\n return null;\n}\n\nexport function GetAllServers(): BaseServer[] {\n const servers: BaseServer[] = [];\n for (const key of Object.keys(AllServers)) {\n servers.push(AllServers[key]);\n }\n return servers;\n}\n\nexport function DeleteServer(serverkey: string): void {\n for (const key of Object.keys(AllServers)) {\n const server = AllServers[key];\n if (server.ip !== serverkey && server.hostname !== serverkey) continue;\n delete AllServers[key];\n break;\n }\n}\n\nexport function ipExists(ip: string): boolean {\n for (const hostName in AllServers) {\n if (AllServers[hostName].ip === ip) {\n return true;\n }\n }\n return false;\n}\n\nexport function createUniqueRandomIp(): string {\n let ip: string;\n // Repeat generating ip, until unique one is found\n do {\n ip = createRandomIp();\n } while (ipExists(ip));\n\n return ip;\n}\n\n// Safely add a Server to the AllServers map\nexport function AddToAllServers(server: Server | HacknetServer): void {\n if (GetServer(server.hostname)) {\n console.warn(`Hostname of the server thats being added: ${server.hostname}`);\n console.warn(`The server that already has this IP is: ${AllServers[server.hostname].hostname}`);\n throw new Error(\"Error: Trying to add a server with an existing IP\");\n }\n\n AllServers[server.hostname] = server;\n}\n\nexport const renameServer = (hostname: string, newName: string): void => {\n AllServers[newName] = AllServers[hostname];\n delete AllServers[hostname];\n};\n\ninterface IServerParams {\n hackDifficulty?: number;\n hostname: string;\n ip: string;\n maxRam?: number;\n moneyAvailable?: number;\n numOpenPortsRequired: number;\n organizationName: string;\n requiredHackingSkill?: number;\n serverGrowth?: number;\n}\n\nexport function initForeignServers(homeComputer: Server): void {\n /* Create a randomized network for all the foreign servers */\n //Groupings for creating a randomized network\n const networkLayers: Server[][] = [];\n for (let i = 0; i < 15; i++) {\n networkLayers.push([]);\n }\n\n const toNumber = (value: number | IMinMaxRange): number => {\n if (typeof value === \"number\") return value;\n else return getRandomInt(value.min, value.max);\n };\n\n for (const metadata of serverMetadata) {\n const serverParams: IServerParams = {\n hostname: metadata.hostname,\n ip: createUniqueRandomIp(),\n numOpenPortsRequired: metadata.numOpenPortsRequired,\n organizationName: metadata.organizationName,\n };\n\n if (metadata.maxRamExponent !== undefined) {\n serverParams.maxRam = Math.pow(2, toNumber(metadata.maxRamExponent));\n }\n\n if (metadata.hackDifficulty) serverParams.hackDifficulty = toNumber(metadata.hackDifficulty);\n if (metadata.moneyAvailable) serverParams.moneyAvailable = toNumber(metadata.moneyAvailable);\n if (metadata.requiredHackingSkill) serverParams.requiredHackingSkill = toNumber(metadata.requiredHackingSkill);\n if (metadata.serverGrowth) serverParams.serverGrowth = toNumber(metadata.serverGrowth);\n\n const server = new Server(serverParams);\n for (const filename of metadata.literature || []) {\n server.messages.push(filename);\n }\n\n if (server.hostname === SpecialServers.WorldDaemon) {\n server.requiredHackingSkill *= BitNodeMultipliers.WorldDaemonDifficulty;\n }\n AddToAllServers(server);\n if (metadata.networkLayer !== undefined) {\n networkLayers[toNumber(metadata.networkLayer) - 1].push(server);\n }\n }\n\n /* Create a randomized network for all the foreign servers */\n const linkComputers = (server1: Server, server2: Server): void => {\n server1.serversOnNetwork.push(server2.hostname);\n server2.serversOnNetwork.push(server1.hostname);\n };\n\n const getRandomArrayItem = <T>(arr: T[]): T => arr[Math.floor(Math.random() * arr.length)];\n\n const linkNetworkLayers = (network1: Server[], selectServer: () => Server): void => {\n for (const server of network1) {\n linkComputers(server, selectServer());\n }\n };\n\n // Connect the first tier of servers to the player's home computer\n linkNetworkLayers(networkLayers[0], () => homeComputer);\n for (let i = 1; i < networkLayers.length; i++) {\n linkNetworkLayers(networkLayers[i], () => getRandomArrayItem(networkLayers[i - 1]));\n }\n}\n\nexport function prestigeAllServers(): void {\n for (const member of Object.keys(AllServers)) {\n delete AllServers[member];\n }\n AllServers = {};\n}\n\nexport function loadAllServers(saveString: string): void {\n AllServers = JSON.parse(saveString, Reviver);\n}\n\nexport function saveAllServers(excludeRunningScripts = false): string {\n const TempAllServers = JSON.parse(JSON.stringify(AllServers), Reviver);\n for (const key of Object.keys(TempAllServers)) {\n const server = TempAllServers[key];\n if (excludeRunningScripts) {\n server.runningScripts = [];\n continue;\n }\n for (let i = 0; i < server.runningScripts.length; ++i) {\n const runningScriptObj = server.runningScripts[i];\n runningScriptObj.logs.length = 0;\n runningScriptObj.logs = [];\n }\n }\n\n return JSON.stringify(TempAllServers);\n}\n","import { Faction } from \"../Faction/Faction\";\nimport { Location } from \"../Locations/Location\";\n\n/**\n * The full-screen page the player is currently be on.\n * These pages are mutually exclusive.\n */\nexport enum Page {\n ActiveScripts,\n Augmentations,\n BitVerse,\n Bladeburner,\n City,\n Corporation,\n CreateProgram,\n ScriptEditor,\n DevMenu,\n Faction,\n Factions,\n Gang,\n Hacknet,\n Infiltration,\n Job,\n Milestones,\n Options,\n Grafting,\n Sleeves,\n Stats,\n StockMarket,\n Terminal,\n Travel,\n Tutorial,\n Work,\n BladeburnerCinematic,\n Location,\n Loading,\n StaneksGift,\n Recovery,\n Achievements,\n ThemeBrowser,\n ImportSave,\n}\n\nexport interface ScriptEditorRouteOptions {\n vim: boolean;\n}\n\n/** The router keeps track of player navigation/routing within the game. */\nexport interface IRouter {\n // toCinematicText(): void;\n // toInfiltration(): void;\n // toMission(): void;\n // toRedPill(): void;\n // toworkInProgress(): void;\n isInitialized: boolean;\n page(): Page;\n allowRouting(value: boolean): void;\n toActiveScripts(): void;\n toAugmentations(): void;\n toBitVerse(flume: boolean, quick: boolean): void;\n toBladeburner(): void;\n toStats(): void;\n toCity(): void; // travel ? city ?\n toCorporation(): void;\n toCreateProgram(): void;\n toDevMenu(): void;\n toFaction(faction: Faction, augPage?: boolean): void; // faction name\n toFactions(): void;\n toGameOptions(): void;\n toGang(): void;\n toHacknetNodes(): void;\n toInfiltration(location: Location): void;\n toJob(location: Location): void;\n toMilestones(): void;\n toGrafting(): void;\n toScriptEditor(files?: Record<string, string>, options?: ScriptEditorRouteOptions): void;\n toSleeves(): void;\n toStockMarket(): void;\n toTerminal(): void;\n toTravel(): void;\n toTutorial(): void;\n toWork(): void;\n toBladeburnerCinematic(): void;\n toLocation(location: Location): void;\n toStaneksGift(): void;\n toAchievements(): void;\n toThemeBrowser(): void;\n toImportSave(base64Save: string, automatic?: boolean): void;\n}\n","import { Settings } from \"../Settings/Settings\";\nimport { isString } from \"./helpers/isString\";\n\n/*\nConverts a date representing time in milliseconds to a string with the format H hours M minutes and S seconds\ne.g. 10000 -> \"10 seconds\"\n 120000 -> \"2 minutes and 0 seconds\"\n*/\nfunction convertTimeMsToTimeElapsedString(time: number, showMilli = false): string {\n time = Math.floor(time);\n const millisecondsPerSecond = 1000;\n const secondPerMinute = 60;\n const minutesPerHours = 60;\n const secondPerHours: number = secondPerMinute * minutesPerHours;\n const hoursPerDays = 24;\n const secondPerDay: number = secondPerHours * hoursPerDays;\n\n // Convert ms to seconds, since we only have second-level precision\n const totalSeconds: number = Math.floor(time / millisecondsPerSecond);\n\n const days: number = Math.floor(totalSeconds / secondPerDay);\n const secTruncDays: number = totalSeconds % secondPerDay;\n\n const hours: number = Math.floor(secTruncDays / secondPerHours);\n const secTruncHours: number = secTruncDays % secondPerHours;\n\n const minutes: number = Math.floor(secTruncHours / secondPerMinute);\n const secTruncMinutes: number = secTruncHours % secondPerMinute;\n\n const milliTruncSec: string = (() => {\n let str = `${time % millisecondsPerSecond}`;\n while (str.length < 3) str = \"0\" + str;\n return str;\n })();\n\n const seconds: string = showMilli ? `${secTruncMinutes}.${milliTruncSec}` : `${secTruncMinutes}`;\n\n let res = \"\";\n if (days > 0) {\n res += `${days} day${days === 1 ? \"\" : \"s\"} `;\n }\n if (hours > 0 || (Settings.ShowMiddleNullTimeUnit && res != \"\")) {\n res += `${hours} hour${hours === 1 ? \"\" : \"s\"} `;\n }\n if (minutes > 0 || (Settings.ShowMiddleNullTimeUnit && res != \"\")) {\n res += `${minutes} minute${minutes === 1 ? \"\" : \"s\"} `;\n }\n res += `${seconds} second${!showMilli && secTruncMinutes === 1 ? \"\" : \"s\"}`;\n\n return res;\n}\n\n// Finds the longest common starting substring in a set of strings\nfunction longestCommonStart(strings: string[]): string {\n if (!containsAllStrings(strings)) {\n return \"\";\n }\n if (strings.length === 0) {\n return \"\";\n }\n\n const A: string[] = strings.concat().sort();\n const a1: string = A[0];\n const a2: string = A[A.length - 1];\n const L: number = a1.length;\n let i = 0;\n const areEqualCaseInsensitive = (a: string, b: string) => a.toUpperCase() === b.toUpperCase();\n while (i < L && areEqualCaseInsensitive(a1.charAt(i), a2.charAt(i))) {\n i++;\n }\n\n return a1.substring(0, i);\n}\n\n// Returns whether an array contains entirely of string objects\nfunction containsAllStrings(arr: string[]): boolean {\n return arr.every(isString);\n}\n\n// Formats a number with commas and a specific number of decimal digits\nfunction formatNumber(num: number, numFractionDigits = 0): string {\n return num.toLocaleString(undefined, {\n maximumFractionDigits: numFractionDigits,\n minimumFractionDigits: numFractionDigits,\n });\n}\n\n// Generates a random alphanumeric string with N characters\nfunction generateRandomString(n: number): string {\n let str = \"\";\n const chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (let i = 0; i < n; i++) {\n str += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n\n return str;\n}\n\n/**\n * Hashes the input string. This is a fast hash, so NOT good for cryptography.\n * This has been ripped off here: https://stackoverflow.com/a/52171480\n * @param str The string that is to be hashed\n * @param seed A seed to randomize the result\n * @returns An hexadecimal string representation of the hashed input\n */\nfunction cyrb53(str: string, seed = 0): string {\n let h1 = 0xdeadbeef ^ seed;\n let h2 = 0x41c6ce57 ^ seed;\n for (let i = 0, ch; i < str.length; i++) {\n ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(16);\n}\n\nfunction capitalizeFirstLetter(s: string): string {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\nfunction capitalizeEachWord(s: string): string {\n return s\n .split(\" \")\n .map((word) => capitalizeFirstLetter(word))\n .join(\" \");\n}\n\nexport {\n convertTimeMsToTimeElapsedString,\n longestCommonStart,\n containsAllStrings,\n formatNumber,\n generateRandomString,\n cyrb53,\n capitalizeFirstLetter,\n capitalizeEachWord,\n};\n","/**\n * Initialization and manipulation of the Factions object, which stores data\n * about all Factions in the game\n */\nimport { Faction } from \"./Faction\";\nimport { FactionInfos } from \"./FactionInfo\";\n\nimport { Reviver } from \"../utils/JSONReviver\";\n\nexport let Factions: Record<string, Faction> = {};\n\nexport function loadFactions(saveString: string): void {\n Factions = JSON.parse(saveString, Reviver);\n // safety check for when we load older save file that don't have newer factions\n for (const faction of Object.keys(Factions)) {\n try {\n Factions[faction].getInfo();\n } catch (err) {\n console.error(\"deleting \" + faction);\n delete Factions[faction];\n }\n }\n}\n\nfunction AddToFactions(faction: Faction): void {\n const name: string = faction.name;\n Factions[name] = faction;\n}\n\nexport function factionExists(name: string): boolean {\n return Factions.hasOwnProperty(name);\n}\n\nexport function initFactions(): void {\n for (const name of Object.keys(FactionInfos)) {\n resetFaction(new Faction(name));\n }\n}\n\n//Resets a faction during (re-)initialization. Saves the favor in the new\n//Faction object and deletes the old Faction Object from \"Factions\". Then\n//reinserts the new Faction object\nfunction resetFaction(newFactionObject: Faction): void {\n const factionName: string = newFactionObject.name;\n if (factionExists(factionName)) {\n newFactionObject.favor = Factions[factionName].favor;\n delete Factions[factionName];\n }\n AddToFactions(newFactionObject);\n}\n","/** Keyboard key codes as returned by event.key */\nexport enum KEY {\n //SHIFT: 16, // Check by `&& event.shiftKey`\n //CTRL: 17, // Check by `&& event.ctrlKey`\n //ALT: 18, // Check by `&& event.altKey`\n ENTER = \"Enter\",\n ESC = \"Escape\",\n TAB = \"Tab\",\n SPACE = \" \",\n BACKSPACE = \"Backspace\",\n UP_ARROW = \"ArrowUp\",\n DOWN_ARROW = \"ArrowDown\",\n LEFT_ARROW = \"ArrowLeft\",\n RIGHT_ARROW = \"ArrowRight\",\n\n QUOTE = \"'\",\n DOUBLE_QUOTE = '\"',\n OPEN_BRACKET = \"[\",\n CLOSE_BRACKET = \"]\",\n LESS_THAN = \"<\",\n GREATER_THAN = \">\",\n OPEN_PARENTHESIS = \"(\",\n CLOSE_PARENTHESIS = \")\",\n OPEN_BRACE = \"{\",\n CLOSE_BRACE = \"}\",\n EQUAL = \"=\",\n\n PIPE = \"|\",\n DOT = \".\",\n FORWARD_SLASH = \"/\",\n HYPHEN = \"-\",\n HASH = \"#\",\n\n k0 = \"0\",\n k1 = \"1\",\n k2 = \"2\",\n k3 = \"3\",\n k4 = \"4\",\n k5 = \"5\",\n k6 = \"6\",\n k7 = \"7\",\n k8 = \"8\",\n k9 = \"9\",\n\n A = \"a\",\n B = \"b\",\n C = \"c\",\n D = \"d\",\n E = \"e\",\n F = \"f\",\n G = \"g\",\n H = \"h\",\n I = \"i\",\n J = \"j\",\n K = \"k\",\n L = \"l\",\n M = \"m\",\n N = \"n\",\n O = \"o\",\n P = \"p\",\n Q = \"q\",\n R = \"r\",\n S = \"s\",\n T = \"t\",\n U = \"u\",\n V = \"v\",\n W = \"w\",\n X = \"x\",\n Y = \"y\",\n Z = \"z\",\n}\n\n/** Keyboard key codes as returned by event.code */\nexport enum KEYCODE {\n //SHIFT: 16, // Check by `&& event.shiftKey`\n //CTRL: 17, // Check by `&& event.ctrlKey`\n //ALT: 18, // Check by `&& event.altKey`\n ENTER = \"Enter\",\n ESC = \"Escape\",\n TAB = \"Tab\",\n SPACE = \"Space\",\n BACKSPACE = \"Backspace\",\n UP_ARROW = \"ArrowUp\",\n DOWN_ARROW = \"ArrowDown\",\n LEFT_ARROW = \"ArrowLeft\",\n RIGHT_ARROW = \"ArrowRight\",\n\n BACKWARD_SLASH = \"Backslash\",\n BACKQUOTE = \"Backquote\",\n COMMA = \"Comma\",\n DOT = \"Period\",\n EQUAL = \"Equal\",\n FORWARD_SLASH = \"Slash\",\n HYPHEN = \"Minus\",\n SEMICOLON = \"Semicolon\",\n QUOTE = \"Quote\",\n\n k0 = \"Digit0\",\n k1 = \"Digit1\",\n k2 = \"Digit2\",\n k3 = \"Digit3\",\n k4 = \"Digit4\",\n k5 = \"Digit5\",\n k6 = \"Digit6\",\n k7 = \"Digit7\",\n k8 = \"Digit8\",\n k9 = \"Digit9\",\n\n A = \"KeyA\",\n B = \"KeyB\",\n C = \"KeyC\",\n D = \"KeyD\",\n E = \"KeyE\",\n F = \"KeyF\",\n G = \"KeyG\",\n H = \"KeyH\",\n I = \"KeyI\",\n J = \"KeyJ\",\n K = \"KeyK\",\n L = \"KeyL\",\n M = \"KeyM\",\n N = \"KeyN\",\n O = \"KeyO\",\n P = \"KeyP\",\n Q = \"KeyQ\",\n R = \"KeyR\",\n S = \"KeyS\",\n T = \"KeyT\",\n U = \"KeyU\",\n V = \"KeyV\",\n W = \"KeyW\",\n X = \"KeyX\",\n Y = \"KeyY\",\n Z = \"KeyZ\",\n}\n","// Defs for job titles, stored in arrays and categorized by job \"type\"\n\nexport const SoftwareCompanyPositions: string[] = [\n \"Software Engineering Intern\",\n \"Junior Software Engineer\",\n \"Senior Software Engineer\",\n \"Lead Software Developer\",\n \"Head of Software\",\n \"Head of Engineering\",\n \"Vice President of Technology\",\n \"Chief Technology Officer\",\n];\n\nexport const ITCompanyPositions: string[] = [\"IT Intern\", \"IT Analyst\", \"IT Manager\", \"Systems Administrator\"];\n\nexport const SecurityEngineerCompanyPositions: string[] = [\"Security Engineer\"];\n\nexport const NetworkEngineerCompanyPositions: string[] = [\"Network Engineer\", \"Network Administrator\"];\n\nexport const BusinessCompanyPositions: string[] = [\n \"Business Intern\",\n \"Business Analyst\",\n \"Business Manager\",\n \"Operations Manager\",\n \"Chief Financial Officer\",\n \"Chief Executive Officer\",\n];\n\nexport const SecurityCompanyPositions: string[] = [\n \"Police Officer\",\n \"Police Chief\",\n \"Security Guard\",\n \"Security Officer\",\n \"Security Supervisor\",\n \"Head of Security\",\n];\n\nexport const AgentCompanyPositions: string[] = [\"Field Agent\", \"Secret Agent\", \"Special Operative\"];\n\nexport const MiscCompanyPositions: string[] = [\"Waiter\", \"Employee\"];\n\nexport const SoftwareConsultantCompanyPositions: string[] = [\"Software Consultant\", \"Senior Software Consultant\"];\n\nexport const BusinessConsultantCompanyPositions: string[] = [\"Business Consultant\", \"Senior Business Consultant\"];\n\nexport const PartTimeCompanyPositions: string[] = [\"Part-time Waiter\", \"Part-time Employee\"];\n","/**\n * Gets a random integer bounded by the values passed in.\n * @param min The minimum value in the range.\n * @param max The maximum value in the range.\n */\nexport function getRandomInt(min: number, max: number): number {\n const lower: number = Math.min(min, max);\n const upper: number = Math.max(min, max);\n\n return Math.floor(Math.random() * (upper - lower + 1)) + lower;\n}\n","import { CityName } from \"./../../Locations/data/CityNames\";\nconst CyclesPerMarketCycle = 50;\nconst AllCorporationStates = [\"START\", \"PURCHASE\", \"PRODUCTION\", \"SALE\", \"EXPORT\"];\nexport const CorporationConstants = {\n INITIALSHARES: 1e9, //Total number of shares you have at your company\n SHARESPERPRICEUPDATE: 1e6, //When selling large number of shares, price is dynamically updated for every batch of this amount\n IssueNewSharesCooldown: 216e3, // 12 Hour in terms of game cycles\n SellSharesCooldown: 18e3, // 1 Hour in terms of game cycles\n\n CyclesPerMarketCycle: CyclesPerMarketCycle,\n CyclesPerIndustryStateCycle: CyclesPerMarketCycle / AllCorporationStates.length,\n SecsPerMarketCycle: CyclesPerMarketCycle / 5,\n\n Cities: [\n CityName.Aevum,\n CityName.Chongqing,\n CityName.Sector12,\n CityName.NewTokyo,\n CityName.Ishima,\n CityName.Volhaven,\n ],\n\n WarehouseInitialCost: 5e9, //Initial purchase cost of warehouse\n WarehouseInitialSize: 100,\n WarehouseUpgradeBaseCost: 1e9,\n\n OfficeInitialCost: 4e9,\n OfficeInitialSize: 3,\n OfficeUpgradeBaseCost: 1e9,\n\n BribeThreshold: 100e12, //Money needed to be able to bribe for faction rep\n BribeToRepRatio: 1e9, //Bribe Value divided by this = rep gain\n\n ProductProductionCostRatio: 5, //Ratio of material cost of a product to its production cost\n\n DividendMaxRate: 1,\n\n EmployeeSalaryMultiplier: 3, // Employee stats multiplied by this to determine initial salary\n CyclesPerEmployeeRaise: 400, // All employees get a raise every X market cycles\n EmployeeRaiseAmount: 50, // Employee salary increases by this (additive)\n\n BaseMaxProducts: 3, // Initial value for maximum number of products allowed\n AllCorporationStates: AllCorporationStates,\n AllMaterials: [\n \"Water\",\n \"Energy\",\n \"Food\",\n \"Plants\",\n \"Metal\",\n \"Hardware\",\n \"Chemicals\",\n \"Drugs\",\n \"Robots\",\n \"AI Cores\",\n \"Real Estate\",\n ],\n AllIndustryTypes: [\n \"Energy\",\n \"Utilities\",\n \"Agriculture\",\n \"Fishing\",\n \"Mining\",\n \"Food\",\n \"Tobacco\",\n \"Chemical\",\n \"Pharmaceutical\",\n \"Computers\",\n \"Robotics\",\n \"Software\",\n \"Healthcare\",\n \"RealEstate\",\n ],\n AllUnlocks: [\n \"Export\",\n \"Smart Supply\",\n \"Market Research - Demand\",\n \"Market Data - Competition\",\n \"VeChain\",\n \"Shady Accounting\",\n \"Government Partnership\",\n \"Warehouse API\",\n \"Office API\",\n ],\n AllUpgrades: [\n \"Smart Factories\",\n \"Smart Storage\",\n \"DreamSense\",\n \"Wilson Analytics\",\n \"Nuoptimal Nootropic Injector Implants\",\n \"Speech Processor Implants\",\n \"Neural Accelerators\",\n \"FocusWires\",\n \"ABC SalesBots\",\n \"Project Insight\",\n ],\n AllResearch: [\n \"Hi-Tech R&D Laboratory\",\n \"AutoBrew\",\n \"AutoPartyManager\",\n \"Automatic Drug Administration\",\n \"Bulk Purchasing\",\n \"CPH4 Injections\",\n \"Drones\",\n \"Drones - Assembly\",\n \"Drones - Transport\",\n \"Go-Juice\",\n \"HRBuddy-Recruitment\",\n \"HRBuddy-Training\",\n \"JoyWire\",\n \"Market-TA.I\",\n \"Market-TA.II\",\n \"Overclock\",\n \"Self-Correcting Assemblers\",\n \"Sti.mu\",\n \"sudo.Assist\",\n \"uPgrade: Capacity.I\",\n \"uPgrade: Capacity.II\",\n \"uPgrade: Dashboard\",\n \"uPgrade: Fulcrum\",\n ],\n FundingRoundShares: [0.1, 0.35, 0.25, 0.2],\n FundingRoundMultiplier: [4, 3, 3, 2.5],\n\n ValuationLength: 5,\n};\n","// Class definition for a single Augmentation object\nimport * as React from \"react\";\n\nimport { Faction } from \"../Faction/Faction\";\nimport { Factions } from \"../Faction/Factions\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Player } from \"@player\";\nimport { AugmentationNames } from \"./data/AugmentationNames\";\nimport { CONSTANTS } from \"../Constants\";\nimport { StaticAugmentations } from \"./StaticAugmentations\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { getBaseAugmentationPriceMultiplier, getGenericAugmentationPriceMultiplier } from \"./AugmentationHelpers\";\nimport { initSoAAugmentations } from \"./data/AugmentationCreator\";\nimport { Multipliers, defaultMultipliers } from \"../PersonObjects/Multipliers\";\n\nexport interface AugmentationCosts {\n moneyCost: number;\n repCost: number;\n}\n\nexport interface IConstructorParams {\n info: string | JSX.Element;\n stats?: JSX.Element | null;\n isSpecial?: boolean;\n moneyCost: number;\n name: string;\n prereqs?: string[];\n repCost: number;\n factions: string[];\n\n hacking?: number;\n strength?: number;\n defense?: number;\n dexterity?: number;\n agility?: number;\n charisma?: number;\n hacking_exp?: number;\n strength_exp?: number;\n defense_exp?: number;\n dexterity_exp?: number;\n agility_exp?: number;\n charisma_exp?: number;\n hacking_chance?: number;\n hacking_speed?: number;\n hacking_money?: number;\n hacking_grow?: number;\n company_rep?: number;\n faction_rep?: number;\n crime_money?: number;\n crime_success?: number;\n work_money?: number;\n hacknet_node_money?: number;\n hacknet_node_purchase_cost?: number;\n hacknet_node_ram_cost?: number;\n hacknet_node_core_cost?: number;\n hacknet_node_level_cost?: number;\n bladeburner_max_stamina?: number;\n bladeburner_stamina_gain?: number;\n bladeburner_analysis?: number;\n bladeburner_success_chance?: number;\n\n startingMoney?: number;\n programs?: string[];\n}\n\nfunction generateStatsDescription(mults: Multipliers, programs?: string[], startingMoney?: number): JSX.Element {\n const f = (x: number, decimals = 0): string => {\n // look, I don't know how to make a \"smart decimals\"\n // todo, make it smarter\n if (x === 1.0777 - 1) return \"7.77%\";\n if (x === 1.777 - 1) return \"77.7%\";\n return numeralWrapper.formatPercentage(x, decimals);\n };\n let desc = <>Effects:</>;\n\n if (\n mults.hacking !== 1 &&\n mults.hacking == mults.strength &&\n mults.hacking == mults.defense &&\n mults.hacking == mults.dexterity &&\n mults.hacking == mults.agility &&\n mults.hacking == mults.charisma\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking - 1)} all skills\n </>\n );\n } else {\n if (mults.hacking !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking - 1)} hacking skill\n </>\n );\n\n if (\n mults.strength !== 1 &&\n mults.strength == mults.defense &&\n mults.strength == mults.dexterity &&\n mults.strength == mults.agility\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength - 1)} combat skills\n </>\n );\n } else {\n if (mults.strength !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength - 1)} strength skill\n </>\n );\n if (mults.defense !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.defense - 1)} defense skill\n </>\n );\n if (mults.dexterity !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.dexterity - 1)} dexterity skill\n </>\n );\n if (mults.agility !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.agility - 1)} agility skill\n </>\n );\n }\n if (mults.charisma !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.charisma - 1)} charisma skill\n </>\n );\n }\n\n if (\n mults.hacking_exp !== 1 &&\n mults.hacking_exp === mults.strength_exp &&\n mults.hacking_exp === mults.defense_exp &&\n mults.hacking_exp === mults.dexterity_exp &&\n mults.hacking_exp === mults.agility_exp &&\n mults.hacking_exp === mults.charisma_exp\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_exp - 1)} exp for all skills\n </>\n );\n } else {\n if (mults.hacking_exp !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_exp - 1)} hacking exp\n </>\n );\n\n if (\n mults.strength_exp !== 1 &&\n mults.strength_exp === mults.defense_exp &&\n mults.strength_exp === mults.dexterity_exp &&\n mults.strength_exp === mults.agility_exp\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength_exp - 1)} combat exp\n </>\n );\n } else {\n if (mults.strength_exp !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength_exp - 1)} strength exp\n </>\n );\n if (mults.defense_exp !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.defense_exp - 1)} defense exp\n </>\n );\n if (mults.dexterity_exp !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.dexterity_exp - 1)} dexterity exp\n </>\n );\n if (mults.agility_exp !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.agility_exp - 1)} agility exp\n </>\n );\n }\n if (mults.charisma_exp !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.charisma_exp - 1)} charisma exp\n </>\n );\n }\n\n if (mults.hacking_speed !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_speed - 1)} faster hack(), grow(), and weaken()\n </>\n );\n if (mults.hacking_chance !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_chance - 1)} hack() success chance\n </>\n );\n if (mults.hacking_money !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_money - 1)} hack() power\n </>\n );\n if (mults.hacking_grow !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_grow - 1)} grow() power\n </>\n );\n\n if (mults.faction_rep !== 1 && mults.faction_rep === mults.company_rep) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.faction_rep - 1)} reputation from factions and companies\n </>\n );\n } else {\n if (mults.faction_rep !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.faction_rep - 1)} reputation from factions\n </>\n );\n if (mults.company_rep !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.company_rep - 1)} reputation from companies\n </>\n );\n }\n\n if (mults.crime_money !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.crime_money - 1)} crime money\n </>\n );\n if (mults.crime_success !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.crime_success - 1)} crime success rate\n </>\n );\n if (mults.work_money !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.work_money - 1)} work money\n </>\n );\n\n if (mults.hacknet_node_money !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacknet_node_money - 1)} hacknet production\n </>\n );\n if (mults.hacknet_node_purchase_cost !== 1)\n desc = (\n <>\n {desc}\n <br />-{f(-(mults.hacknet_node_purchase_cost - 1))} hacknet nodes cost\n </>\n );\n if (mults.hacknet_node_level_cost !== 1)\n desc = (\n <>\n {desc}\n <br />-{f(-(mults.hacknet_node_level_cost - 1))} hacknet nodes upgrade cost\n </>\n );\n\n if (mults.bladeburner_max_stamina !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_max_stamina - 1)} Bladeburner Max Stamina\n </>\n );\n if (mults.bladeburner_stamina_gain !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_stamina_gain - 1)} Bladeburner Stamina gain\n </>\n );\n if (mults.bladeburner_analysis !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_analysis - 1)} Bladeburner Field Analysis effectiveness\n </>\n );\n if (mults.bladeburner_success_chance !== 1)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_success_chance - 1)} Bladeburner Contracts and Operations success chance\n </>\n );\n if (startingMoney)\n desc = (\n <>\n {desc}\n <br />\n Start with <Money money={startingMoney} /> after installing Augmentations.\n </>\n );\n\n if (programs)\n desc = (\n <>\n {desc}\n <br />\n Start with {programs.join(\" and \")} after installing Augmentations.\n </>\n );\n return desc;\n}\n\nexport class Augmentation {\n // How much money this costs to buy before multipliers\n baseCost = 0;\n\n // How much faction reputation is required to unlock this before multipliers\n baseRepRequirement = 0;\n\n // Description of what this Aug is and what it does\n info: string | JSX.Element;\n\n // Description of the stats, often autogenerated, sometimes manually written.\n stats: JSX.Element | null;\n\n // Any Augmentation not immediately available in BitNode-1 is special (e.g. Bladeburner augs)\n isSpecial = false;\n\n // Name of Augmentation\n name = \"\";\n\n // Array of names of all prerequisites\n prereqs: string[] = [];\n\n // Multipliers given by this Augmentation. Must match the property name in\n // The Player/Person classes\n mults: Multipliers = defaultMultipliers();\n\n // Factions that offer this aug.\n factions: string[] = [];\n\n constructor(\n params: IConstructorParams = {\n info: \"\",\n moneyCost: 0,\n name: \"\",\n repCost: 0,\n factions: [],\n },\n ) {\n this.name = params.name;\n this.info = params.info;\n this.prereqs = params.prereqs ? params.prereqs : [];\n\n this.baseRepRequirement = params.repCost;\n Object.freeze(this.baseRepRequirement);\n this.baseCost = params.moneyCost;\n Object.freeze(this.baseCost);\n this.factions = params.factions;\n\n if (params.isSpecial) {\n this.isSpecial = true;\n }\n\n // Set multipliers\n if (params.hacking) {\n this.mults.hacking = params.hacking;\n }\n if (params.strength) {\n this.mults.strength = params.strength;\n }\n if (params.defense) {\n this.mults.defense = params.defense;\n }\n if (params.dexterity) {\n this.mults.dexterity = params.dexterity;\n }\n if (params.agility) {\n this.mults.agility = params.agility;\n }\n if (params.charisma) {\n this.mults.charisma = params.charisma;\n }\n if (params.hacking_exp) {\n this.mults.hacking_exp = params.hacking_exp;\n }\n if (params.strength_exp) {\n this.mults.strength_exp = params.strength_exp;\n }\n if (params.defense_exp) {\n this.mults.defense_exp = params.defense_exp;\n }\n if (params.dexterity_exp) {\n this.mults.dexterity_exp = params.dexterity_exp;\n }\n if (params.agility_exp) {\n this.mults.agility_exp = params.agility_exp;\n }\n if (params.charisma_exp) {\n this.mults.charisma_exp = params.charisma_exp;\n }\n if (params.hacking_chance) {\n this.mults.hacking_chance = params.hacking_chance;\n }\n if (params.hacking_speed) {\n this.mults.hacking_speed = params.hacking_speed;\n }\n if (params.hacking_money) {\n this.mults.hacking_money = params.hacking_money;\n }\n if (params.hacking_grow) {\n this.mults.hacking_grow = params.hacking_grow;\n }\n if (params.company_rep) {\n this.mults.company_rep = params.company_rep;\n }\n if (params.faction_rep) {\n this.mults.faction_rep = params.faction_rep;\n }\n if (params.crime_money) {\n this.mults.crime_money = params.crime_money;\n }\n if (params.crime_success) {\n this.mults.crime_success = params.crime_success;\n }\n if (params.work_money) {\n this.mults.work_money = params.work_money;\n }\n if (params.hacknet_node_money) {\n this.mults.hacknet_node_money = params.hacknet_node_money;\n }\n if (params.hacknet_node_purchase_cost) {\n this.mults.hacknet_node_purchase_cost = params.hacknet_node_purchase_cost;\n }\n if (params.hacknet_node_ram_cost) {\n this.mults.hacknet_node_ram_cost = params.hacknet_node_ram_cost;\n }\n if (params.hacknet_node_core_cost) {\n this.mults.hacknet_node_core_cost = params.hacknet_node_core_cost;\n }\n if (params.hacknet_node_level_cost) {\n this.mults.hacknet_node_level_cost = params.hacknet_node_level_cost;\n }\n if (params.bladeburner_max_stamina) {\n this.mults.bladeburner_max_stamina = params.bladeburner_max_stamina;\n }\n if (params.bladeburner_stamina_gain) {\n this.mults.bladeburner_stamina_gain = params.bladeburner_stamina_gain;\n }\n if (params.bladeburner_analysis) {\n this.mults.bladeburner_analysis = params.bladeburner_analysis;\n }\n if (params.bladeburner_success_chance) {\n this.mults.bladeburner_success_chance = params.bladeburner_success_chance;\n }\n\n if (params.stats === undefined)\n this.stats = generateStatsDescription(this.mults, params.programs, params.startingMoney);\n else this.stats = params.stats;\n }\n\n // Adds this Augmentation to the specified Factions\n addToFactions(factionList: string[]): void {\n for (let i = 0; i < factionList.length; ++i) {\n const faction: Faction | null = Factions[factionList[i]];\n if (faction == null) {\n console.warn(`In Augmentation.addToFactions(), could not find faction with this name: ${factionList[i]}`);\n continue;\n }\n faction.augmentations.push(this.name);\n }\n }\n\n getCost(): AugmentationCosts {\n const augmentationReference = StaticAugmentations[this.name];\n let moneyCost = augmentationReference.baseCost;\n let repCost = augmentationReference.baseRepRequirement;\n\n if (augmentationReference.name === AugmentationNames.NeuroFluxGovernor) {\n let nextLevel = this.getLevel();\n --nextLevel;\n const multiplier = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel);\n repCost = augmentationReference.baseRepRequirement * multiplier * BitNodeMultipliers.AugmentationRepCost;\n moneyCost = augmentationReference.baseCost * multiplier * BitNodeMultipliers.AugmentationMoneyCost;\n\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n moneyCost *= getBaseAugmentationPriceMultiplier();\n }\n } else if (augmentationReference.factions.includes(FactionNames.ShadowsOfAnarchy)) {\n const soaAugmentationNames = initSoAAugmentations().map((augmentation) => augmentation.name);\n const soaAugCount = soaAugmentationNames.filter((augmentationName) =>\n Player.hasAugmentation(augmentationName),\n ).length;\n moneyCost = augmentationReference.baseCost * Math.pow(CONSTANTS.SoACostMult, soaAugCount);\n if (soaAugmentationNames.find((augmentationName) => augmentationName === augmentationReference.name)) {\n repCost = augmentationReference.baseRepRequirement * Math.pow(CONSTANTS.SoARepMult, soaAugCount);\n }\n } else {\n moneyCost =\n augmentationReference.baseCost *\n getGenericAugmentationPriceMultiplier() *\n BitNodeMultipliers.AugmentationMoneyCost;\n repCost = augmentationReference.baseRepRequirement * BitNodeMultipliers.AugmentationRepCost;\n }\n return { moneyCost, repCost };\n }\n\n getLevel(): number {\n // Get current Neuroflux level based on Player's augmentations\n if (this.name === AugmentationNames.NeuroFluxGovernor) {\n let currLevel = 0;\n for (let i = 0; i < Player.augmentations.length; ++i) {\n if (Player.augmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n currLevel = Player.augmentations[i].level;\n }\n }\n\n // Account for purchased but uninstalled Augmentations\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n if (Player.queuedAugmentations[i].name == AugmentationNames.NeuroFluxGovernor) {\n ++currLevel;\n }\n }\n return currLevel + 1;\n }\n return 0;\n }\n\n // Adds this Augmentation to all Factions\n addToAllFactions(): void {\n for (const fac of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(fac)) {\n const facObj: Faction | null = Factions[fac];\n if (facObj == null) {\n console.warn(`Invalid Faction object in addToAllFactions(). Key value: ${fac}`);\n continue;\n }\n if (facObj.getInfo().special) continue;\n facObj.augmentations.push(this.name);\n }\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Augmentation\", this);\n }\n\n // Initializes a Augmentation object from a JSON save state.\n static fromJSON(value: IReviverValue): Augmentation {\n return Generic_fromJSON(Augmentation, value.data);\n }\n}\n\nReviver.constructors.Augmentation = Augmentation;\n","import { Theme } from \"@mui/material\";\nimport Box from \"@mui/material/Box\";\nimport Fade from \"@mui/material/Fade\";\nimport M from \"@mui/material/Modal\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { SxProps } from \"@mui/system\";\nimport React from \"react\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n modal: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n paper: {\n backgroundColor: theme.palette.background.default,\n border: \"2px solid \" + theme.palette.primary.main,\n boxShadow: `0px 3px 5px -1px ${theme.palette.primary.dark},0px 5px 8px 0px ${theme.palette.primary.dark},0px 1px 14px 0px ${theme.palette.primary.dark}`,\n padding: 2,\n maxWidth: \"80%\",\n maxHeight: \"80%\",\n overflow: \"auto\",\n \"&::-webkit-scrollbar\": {\n // webkit\n display: \"none\",\n },\n scrollbarWidth: \"none\", // firefox\n },\n }),\n);\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n children: React.ReactNode;\n sx?: SxProps<Theme>;\n}\n\nexport const Modal = (props: IProps): React.ReactElement => {\n const classes = useStyles();\n return (\n <M\n disableRestoreFocus\n disableScrollLock\n disableEnforceFocus\n disableAutoFocus\n open={props.open}\n onClose={props.onClose}\n closeAfterTransition\n className={classes.modal}\n sx={props.sx}\n >\n <Fade in={props.open}>\n <div className={classes.paper}>\n <Box sx={{ m: 2 }}>{props.children}</Box>\n </div>\n </Fade>\n </M>\n );\n};\n","export const HacknetNodeConstants = {\n MoneyGainPerLevel: 1.5,\n\n BaseCost: 1000,\n LevelBaseCost: 1,\n RamBaseCost: 30e3,\n CoreBaseCost: 500e3,\n\n PurchaseNextMult: 1.85,\n UpgradeLevelMult: 1.04,\n UpgradeRamMult: 1.28,\n UpgradeCoreMult: 1.48,\n\n MaxLevel: 200,\n MaxRam: 64,\n MaxCores: 16,\n};\n\nexport const PurchaseMultipliers: {\n [key: string]: number | \"MAX\" | undefined;\n x1: number;\n x5: number;\n x10: number;\n MAX: \"MAX\";\n} = {\n x1: 1,\n x5: 5,\n x10: 10,\n MAX: \"MAX\",\n};\n\nexport const HacknetServerConstants = {\n HashesPerLevel: 0.001,\n\n BaseCost: 50e3,\n RamBaseCost: 200e3,\n CoreBaseCost: 1e6,\n CacheBaseCost: 10e6,\n\n PurchaseMult: 3.2,\n UpgradeLevelMult: 1.1,\n UpgradeRamMult: 1.4,\n UpgradeCoreMult: 1.55,\n UpgradeCacheMult: 1.85,\n\n MaxServers: 20,\n\n MaxLevel: 300,\n MaxRam: 8192,\n MaxCores: 128,\n MaxCache: 15,\n};\n","export enum EmployeePositions {\n Operations = \"Operations\",\n Engineer = \"Engineer\",\n Business = \"Business\",\n Management = \"Management\",\n RandD = \"Research & Development\",\n Training = \"Training\",\n Unassigned = \"Unassigned\",\n}\n","// Action Identifier enum\nexport const ActionTypes: {\n [key: string]: number;\n Idle: number;\n Contract: number;\n Operation: number;\n BlackOp: number;\n BlackOperation: number;\n Training: number;\n Recruitment: number;\n FieldAnalysis: number;\n \"Field Analysis\": number;\n Diplomacy: number;\n \"Hyperbolic Regeneration Chamber\": number;\n \"Incite Violence\": number;\n} = {\n Idle: 1,\n Contract: 2,\n Operation: 3,\n BlackOp: 4,\n BlackOperation: 4,\n Training: 5,\n Recruitment: 6,\n FieldAnalysis: 7,\n \"Field Analysis\": 7,\n Diplomacy: 8,\n \"Hyperbolic Regeneration Chamber\": 9,\n \"Incite Violence\": 10,\n};\n","import { Player } from \"@player\";\n\nimport { LiteratureNames } from \"./Literature/data/LiteratureNames\";\n\nimport { ITutorialEvents } from \"./ui/InteractiveTutorial/ITutorialEvents\";\n\n// Ordered array of keys to Interactive Tutorial Steps\nenum iTutorialSteps {\n Start,\n NSSelection,\n GoToCharacterPage, // Click on 'Stats' page\n CharacterPage, // Introduction to 'Stats' page\n CharacterGoToTerminalPage, // Go back to Terminal\n TerminalIntro, // Introduction to Terminal\n TerminalHelp, // Using 'help' Terminal command\n TerminalLs, // Using 'ls' Terminal command\n TerminalScan, // Using 'scan' Terminal command\n TerminalScanAnalyze1, // Using 'scan-analyze' Terminal command\n TerminalScanAnalyze2, // Using 'scan-analyze 3' Terminal command\n TerminalConnect, // Connecting to n00dles\n TerminalAnalyze, // Analyzing n00dles\n TerminalNuke, // NUKE n00dles\n TerminalManualHack, // Hack n00dles\n TerminalHackingMechanics, // Explanation of hacking mechanics\n TerminalGoHome, // Go home before creating a script.\n TerminalCreateScript, // Create a script using 'nano'\n TerminalTypeScript, // Script Editor page - Type script and then save & close\n TerminalFree, // Using 'Free' Terminal command\n TerminalRunScript, // Running script using 'run' Terminal command\n TerminalGoToActiveScriptsPage,\n ActiveScriptsPage,\n ActiveScriptsToTerminal,\n TerminalTailScript,\n GoToHacknetNodesPage,\n HacknetNodesIntroduction,\n HacknetNodesGoToWorldPage,\n WorldDescription,\n TutorialPageInfo,\n End,\n}\n\nconst ITutorial = {\n currStep: iTutorialSteps.Start,\n isRunning: false,\n\n // Keeps track of whether each step has been done\n stepIsDone: {\n [iTutorialSteps.Start]: false,\n [iTutorialSteps.NSSelection]: false,\n [iTutorialSteps.GoToCharacterPage]: false,\n [iTutorialSteps.CharacterPage]: false,\n [iTutorialSteps.CharacterGoToTerminalPage]: false,\n [iTutorialSteps.TerminalIntro]: false,\n [iTutorialSteps.TerminalHelp]: false,\n [iTutorialSteps.TerminalLs]: false,\n [iTutorialSteps.TerminalScan]: false,\n [iTutorialSteps.TerminalScanAnalyze1]: false,\n [iTutorialSteps.TerminalScanAnalyze2]: false,\n [iTutorialSteps.TerminalConnect]: false,\n [iTutorialSteps.TerminalAnalyze]: false,\n [iTutorialSteps.TerminalNuke]: false,\n [iTutorialSteps.TerminalManualHack]: false,\n [iTutorialSteps.TerminalHackingMechanics]: false,\n [iTutorialSteps.TerminalGoHome]: false,\n [iTutorialSteps.TerminalCreateScript]: false,\n [iTutorialSteps.TerminalTypeScript]: false,\n [iTutorialSteps.TerminalFree]: false,\n [iTutorialSteps.TerminalRunScript]: false,\n [iTutorialSteps.TerminalGoToActiveScriptsPage]: false,\n [iTutorialSteps.ActiveScriptsPage]: false,\n [iTutorialSteps.ActiveScriptsToTerminal]: false,\n [iTutorialSteps.TerminalTailScript]: false,\n [iTutorialSteps.GoToHacknetNodesPage]: false,\n [iTutorialSteps.HacknetNodesIntroduction]: false,\n [iTutorialSteps.HacknetNodesGoToWorldPage]: false,\n [iTutorialSteps.WorldDescription]: false,\n [iTutorialSteps.TutorialPageInfo]: false,\n [iTutorialSteps.End]: false,\n },\n};\n\nfunction iTutorialStart(): void {\n ITutorial.isRunning = true;\n ITutorial.currStep = iTutorialSteps.Start;\n}\n\n// Go to the next step and evaluate it\nfunction iTutorialNextStep(): void {\n ITutorial.stepIsDone[ITutorial.currStep] = true;\n if (ITutorial.currStep < iTutorialSteps.End) {\n ITutorial.currStep += 1;\n }\n if (ITutorial.currStep === iTutorialSteps.End) iTutorialEnd();\n ITutorialEvents.emit();\n}\n\n// Go to previous step and evaluate\nfunction iTutorialPrevStep(): void {\n if (ITutorial.currStep > iTutorialSteps.Start) {\n ITutorial.currStep -= 1;\n }\n ITutorialEvents.emit();\n}\n\nfunction iTutorialEnd(): void {\n ITutorial.isRunning = false;\n ITutorial.currStep = iTutorialSteps.Start;\n const messages = Player.getHomeComputer().messages;\n const handbook = LiteratureNames.HackersStartingHandbook;\n if (!messages.includes(handbook)) messages.push(handbook);\n ITutorialEvents.emit();\n}\n\nexport { iTutorialSteps, iTutorialEnd, iTutorialStart, iTutorialNextStep, ITutorial, iTutorialPrevStep };\n","// Class representing a single hackable Server\nimport { BaseServer } from \"./BaseServer\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\nimport { createRandomString } from \"../utils/helpers/createRandomString\";\nimport { createRandomIp } from \"../utils/IPAddress\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IConstructorParams {\n adminRights?: boolean;\n hackDifficulty?: number;\n hostname: string;\n ip?: string;\n isConnectedTo?: boolean;\n maxRam?: number;\n moneyAvailable?: number;\n numOpenPortsRequired?: number;\n organizationName?: string;\n purchasedByPlayer?: boolean;\n requiredHackingSkill?: number;\n serverGrowth?: number;\n}\n\nexport class Server extends BaseServer {\n // Flag indicating whether this server has a backdoor installed by a player\n backdoorInstalled = false;\n\n // Initial server security level\n // (i.e. security level when the server was created)\n baseDifficulty = 1;\n\n // Server Security Level\n hackDifficulty = 1;\n\n // Minimum server security level that this server can be weakened to\n minDifficulty = 1;\n\n // How much money currently resides on the server and can be hacked\n moneyAvailable = 0;\n\n // Maximum amount of money that this server can hold\n moneyMax = 0;\n\n // Number of open ports required in order to gain admin/root access\n numOpenPortsRequired = 5;\n\n // How many ports are currently opened on the server\n openPortCount = 0;\n\n // Hacking level required to hack this server\n requiredHackingSkill = 1;\n\n // Parameter that affects how effectively this server's money can\n // be increased using the grow() Netscript function\n serverGrowth = 1;\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n super(params);\n\n // \"hacknet-node-X\" hostnames are reserved for Hacknet Servers\n if (this.hostname.startsWith(\"hacknet-node-\")) {\n this.hostname = createRandomString(10);\n }\n\n this.purchasedByPlayer = params.purchasedByPlayer != null ? params.purchasedByPlayer : false;\n\n //RAM, CPU speed and Scripts\n this.maxRam = params.maxRam != null ? params.maxRam : 0; //GB\n\n /* Hacking information (only valid for \"foreign\" aka non-purchased servers) */\n this.requiredHackingSkill = params.requiredHackingSkill != null ? params.requiredHackingSkill : 1;\n this.moneyAvailable =\n params.moneyAvailable != null ? params.moneyAvailable * BitNodeMultipliers.ServerStartingMoney : 0;\n this.moneyMax = 25 * this.moneyAvailable * BitNodeMultipliers.ServerMaxMoney;\n\n //Hack Difficulty is synonymous with server security. Base Difficulty = Starting difficulty\n const realDifficulty =\n params.hackDifficulty != null ? params.hackDifficulty * BitNodeMultipliers.ServerStartingSecurity : 1;\n this.hackDifficulty = Math.min(realDifficulty, 100);\n this.baseDifficulty = this.hackDifficulty;\n this.minDifficulty = Math.min(Math.max(1, Math.round(realDifficulty / 3)), 100);\n this.serverGrowth = params.serverGrowth != null ? params.serverGrowth : 1; //Integer from 0 to 100. Affects money increase from grow()\n\n //Port information, required for porthacking servers to get admin rights\n this.numOpenPortsRequired = params.numOpenPortsRequired != null ? params.numOpenPortsRequired : 5;\n }\n\n /** Ensures that the server's difficulty (server security) doesn't get too high */\n capDifficulty(): void {\n if (this.hackDifficulty < this.minDifficulty) {\n this.hackDifficulty = this.minDifficulty;\n }\n if (this.hackDifficulty < 1) {\n this.hackDifficulty = 1;\n }\n\n // Place some arbitrarily limit that realistically should never happen unless someone is\n // screwing around with the game\n if (this.hackDifficulty > 100) {\n this.hackDifficulty = 100;\n }\n }\n\n /**\n * Change this server's minimum security\n * @param n - Value by which to increase/decrease the server's minimum security\n * @param perc - Whether it should be changed by a percentage, or a flat value\n */\n changeMinimumSecurity(n: number, perc = false): void {\n if (perc) {\n this.minDifficulty *= n;\n } else {\n this.minDifficulty += n;\n }\n\n // Server security cannot go below 1\n this.minDifficulty = Math.max(1, this.minDifficulty);\n }\n\n /**\n * Change this server's maximum money\n * @param n - Value by which to change the server's maximum money\n */\n changeMaximumMoney(n: number): void {\n const softCap = 10e12;\n if (this.moneyMax > softCap) {\n const aboveCap = this.moneyMax - softCap;\n n = 1 + (n - 1) / Math.log(aboveCap) / Math.log(8);\n }\n\n this.moneyMax *= n;\n }\n\n /** Strengthens a server's security level (difficulty) by the specified amount */\n fortify(amt: number): void {\n this.hackDifficulty += amt;\n this.capDifficulty();\n }\n\n /** Lowers the server's security level (difficulty) by the specified amount) */\n weaken(amt: number): void {\n this.hackDifficulty -= amt * BitNodeMultipliers.ServerWeakenRate;\n this.capDifficulty();\n }\n\n /** Serialize the current object to a JSON save state */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Server\", this);\n }\n\n // Initializes a Server Object from a JSON save state\n static fromJSON(value: IReviverValue): Server {\n return Generic_fromJSON(Server, value.data);\n }\n}\n\nReviver.constructors.Server = Server;\n","import React, { useContext } from \"react\";\nimport { Corporation } from \"../Corporation\";\nimport { Industry } from \"../Industry\";\n\nexport const Context = {\n Corporation: React.createContext<Corporation>({} as Corporation),\n Division: React.createContext<Industry>({} as Industry),\n};\n\nexport const useCorporation = (): Corporation => useContext(Context.Corporation);\nexport const useDivision = (): Industry => useContext(Context.Division);\n","import React from \"react\";\nimport { ResearchTree } from \"./ResearchTree\";\nimport { Corporation } from \"./Corporation\";\nimport { getBaseResearchTreeCopy, getProductIndustryResearchTreeCopy } from \"./data/BaseResearchTree\";\nimport { MoneyCost } from \"./ui/MoneyCost\";\n\ninterface IIndustryMap<T> {\n [key: string]: T | undefined;\n Energy: T;\n Utilities: T;\n Agriculture: T;\n Fishing: T;\n Mining: T;\n Food: T;\n Tobacco: T;\n Chemical: T;\n Pharmaceutical: T;\n Computer: T;\n Robotics: T;\n Software: T;\n Healthcare: T;\n RealEstate: T;\n}\n\n// Map of official names for each Industry\nexport const Industries: IIndustryMap<string> = {\n Energy: \"Energy\",\n Utilities: \"Water Utilities\",\n Agriculture: \"Agriculture\",\n Fishing: \"Fishing\",\n Mining: \"Mining\",\n Food: \"Food\",\n Tobacco: \"Tobacco\",\n Chemical: \"Chemical\",\n Pharmaceutical: \"Pharmaceutical\",\n Computer: \"Computer Hardware\",\n Robotics: \"Robotics\",\n Software: \"Software\",\n Healthcare: \"Healthcare\",\n RealEstate: \"RealEstate\",\n};\n\n// Map of how much money it takes to start each industry\nexport const IndustryStartingCosts: IIndustryMap<number> = {\n Energy: 225e9,\n Utilities: 150e9,\n Agriculture: 40e9,\n Fishing: 80e9,\n Mining: 300e9,\n Food: 10e9,\n Tobacco: 20e9,\n Chemical: 70e9,\n Pharmaceutical: 200e9,\n Computer: 500e9,\n Robotics: 1e12,\n Software: 25e9,\n Healthcare: 750e9,\n RealEstate: 600e9,\n};\n\n// Map of description for each industry\nexport const IndustryDescriptions: IIndustryMap<(corp: Corporation) => React.ReactElement> = {\n Energy: (corp: Corporation) => (\n <>\n Engage in the production and distribution of energy.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Energy} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Utilities: (corp: Corporation) => (\n <>\n Distribute water and provide wastewater services.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Utilities} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Agriculture: (corp: Corporation) => (\n <>\n Cultivate crops and breed livestock to produce food.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Agriculture} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Fishing: (corp: Corporation) => (\n <>\n Produce food through the breeding and processing of fish and fish products.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Fishing} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Mining: (corp: Corporation) => (\n <>\n Extract and process metals from the earth.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Mining} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Food: (corp: Corporation) => (\n <>\n Create your own restaurants all around the world.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Food} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Tobacco: (corp: Corporation) => (\n <>\n Create and distribute tobacco and tobacco-related products.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Tobacco} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Chemical: (corp: Corporation) => (\n <>\n Produce industrial chemicals.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Chemical} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Pharmaceutical: (corp: Corporation) => (\n <>\n Discover, develop, and create new pharmaceutical drugs.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Pharmaceutical} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Computer: (corp: Corporation) => (\n <>\n Develop and manufacture new computer hardware and networking infrastructures.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Computer} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Robotics: (corp: Corporation) => (\n <>\n Develop and create robots.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Robotics} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Software: (corp: Corporation) => (\n <>\n Develop computer software and create AI Cores.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Software} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Healthcare: (corp: Corporation) => (\n <>\n Create and manage hospitals.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Healthcare} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n RealEstate: (corp: Corporation) => (\n <>\n Develop and manage real estate properties.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.RealEstate} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n};\n\n// Map of available Research for each Industry. This data is held in a\n// ResearchTree object\nexport const IndustryResearchTrees: IIndustryMap<ResearchTree> = {\n Energy: getBaseResearchTreeCopy(),\n Utilities: getBaseResearchTreeCopy(),\n Agriculture: getBaseResearchTreeCopy(),\n Fishing: getBaseResearchTreeCopy(),\n Mining: getBaseResearchTreeCopy(),\n Food: getProductIndustryResearchTreeCopy(),\n Tobacco: getProductIndustryResearchTreeCopy(),\n Chemical: getBaseResearchTreeCopy(),\n Pharmaceutical: getProductIndustryResearchTreeCopy(),\n Computer: getProductIndustryResearchTreeCopy(),\n Robotics: getProductIndustryResearchTreeCopy(),\n Software: getProductIndustryResearchTreeCopy(),\n Healthcare: getProductIndustryResearchTreeCopy(),\n RealEstate: getProductIndustryResearchTreeCopy(),\n};\n\nexport function resetIndustryResearchTrees(): void {\n IndustryResearchTrees.Energy = getBaseResearchTreeCopy();\n IndustryResearchTrees.Utilities = getBaseResearchTreeCopy();\n IndustryResearchTrees.Agriculture = getBaseResearchTreeCopy();\n IndustryResearchTrees.Fishing = getBaseResearchTreeCopy();\n IndustryResearchTrees.Mining = getBaseResearchTreeCopy();\n IndustryResearchTrees.Food = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Tobacco = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Chemical = getBaseResearchTreeCopy();\n IndustryResearchTrees.Pharmaceutical = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Computer = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Robotics = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Software = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Healthcare = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.RealEstate = getProductIndustryResearchTreeCopy();\n}\n","/** Enum defining the different types of possible locations */\nexport enum LocationType {\n Company,\n Gym,\n Hospital,\n Slums,\n Special, // This location has special options/activities (e.g. Bladeburner, Re-sleeving)\n StockMarket,\n TechVendor,\n TravelAgency,\n University,\n Casino,\n}\n","import { Program } from \"./Program\";\nimport { programsMetadata } from \"./data/ProgramsMetadata\";\n\nexport const Programs: Record<string, Program> = {};\nexport function initPrograms() {\n for (const params of programsMetadata) {\n Programs[params.key] = new Program(params.name, params.create, params.run);\n }\n}\n","import React from \"react\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { CONSTANTS } from \"../Constants\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Money } from \"../ui/React/Money\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { Player } from \"@player\";\nimport { calculateClassEarnings as calculateClassEarningsRate } from \"./formulas/Class\";\nimport { Work, WorkType } from \"./Work\";\nimport { applyWorkStats, newWorkStats, sumWorkStats, WorkStats } from \"./WorkStats\";\n\nexport enum ClassType {\n StudyComputerScience = \"STUDYCOMPUTERSCIENCE\",\n DataStructures = \"DATASTRUCTURES\",\n Networks = \"NETWORKS\",\n Algorithms = \"ALGORITHMS\",\n\n Management = \"MANAGEMENT\",\n Leadership = \"LEADERSHIP\",\n\n GymStrength = \"GYMSTRENGTH\",\n GymDefense = \"GYMDEFENSE\",\n GymDexterity = \"GYMDEXTERITY\",\n GymAgility = \"GYMAGILITY\",\n}\n\nexport interface Class {\n youAreCurrently: string;\n type: ClassType;\n earnings: WorkStats;\n}\n\nexport const Classes: Record<ClassType, Class> = {\n [ClassType.StudyComputerScience]: {\n youAreCurrently: \"studying Computer Science\",\n type: ClassType.StudyComputerScience,\n earnings: newWorkStats({ hackExp: 0.5, intExp: 0.01 }),\n },\n [ClassType.DataStructures]: {\n youAreCurrently: \"taking a Data Structures course\",\n type: ClassType.DataStructures,\n earnings: newWorkStats({\n money: -40,\n hackExp: 1,\n intExp: 0.01,\n }),\n },\n [ClassType.Networks]: {\n youAreCurrently: \"taking a Networks course\",\n type: ClassType.Networks,\n earnings: newWorkStats({\n money: -80,\n hackExp: 2,\n intExp: 0.01,\n }),\n },\n [ClassType.Algorithms]: {\n youAreCurrently: \"taking an Algorithms course\",\n type: ClassType.Algorithms,\n earnings: newWorkStats({\n money: -320,\n hackExp: 4,\n intExp: 0.01,\n }),\n },\n [ClassType.Management]: {\n youAreCurrently: \"taking a Management course\",\n type: ClassType.Management,\n earnings: newWorkStats({\n money: -160,\n chaExp: 2,\n intExp: 0.01,\n }),\n },\n [ClassType.Leadership]: {\n youAreCurrently: \"taking a Leadership course\",\n type: ClassType.Leadership,\n earnings: newWorkStats({\n money: -320,\n chaExp: 4,\n intExp: 0.01,\n }),\n },\n [ClassType.GymStrength]: {\n youAreCurrently: \"training your strength at a gym\",\n type: ClassType.GymStrength,\n earnings: newWorkStats({\n money: -120,\n strExp: 1,\n }),\n },\n [ClassType.GymDefense]: {\n youAreCurrently: \"training your defense at a gym\",\n type: ClassType.GymDefense,\n earnings: newWorkStats({\n money: -120,\n defExp: 1,\n }),\n },\n [ClassType.GymDexterity]: {\n youAreCurrently: \"training your dexterity at a gym\",\n type: ClassType.GymDexterity,\n earnings: newWorkStats({\n money: -120,\n dexExp: 1,\n }),\n },\n [ClassType.GymAgility]: {\n youAreCurrently: \"training your agility at a gym\",\n type: ClassType.GymAgility,\n earnings: newWorkStats({\n money: -120,\n agiExp: 1,\n }),\n },\n};\n\ninterface ClassWorkParams {\n classType: ClassType;\n location: LocationName;\n singularity: boolean;\n}\n\nexport const isClassWork = (w: Work | null): w is ClassWork => w !== null && w.type === WorkType.CLASS;\n\nexport class ClassWork extends Work {\n classType: ClassType;\n location: LocationName;\n earnings = newWorkStats();\n\n constructor(params?: ClassWorkParams) {\n super(WorkType.CLASS, params?.singularity ?? true);\n this.classType = params?.classType ?? ClassType.StudyComputerScience;\n this.location = params?.location ?? LocationName.Sector12RothmanUniversity;\n }\n\n isGym(): boolean {\n return [ClassType.GymAgility, ClassType.GymDefense, ClassType.GymDexterity, ClassType.GymStrength].includes(\n this.classType,\n );\n }\n\n getClass(): Class {\n return Classes[this.classType];\n }\n\n calculateRates(): WorkStats {\n return calculateClassEarningsRate(Player, this.classType, this.location);\n }\n\n process(cycles: number): boolean {\n this.cyclesWorked += cycles;\n const rate = this.calculateRates();\n const earnings = applyWorkStats(Player, rate, cycles, \"class\");\n this.earnings = sumWorkStats(this.earnings, earnings);\n return false;\n }\n\n finish(): void {\n if (!this.singularity) {\n dialogBoxCreate(\n <>\n After {this.getClass().youAreCurrently} for{\" \"}\n {convertTimeMsToTimeElapsedString(this.cyclesWorked * CONSTANTS._idleSpeed)}, <br />\n you spent a total of <Money money={-this.earnings.money} />. <br />\n <br />\n You earned a total of: <br />\n {numeralWrapper.formatExp(this.earnings.hackExp)} hacking exp <br />\n {numeralWrapper.formatExp(this.earnings.strExp)} strength exp <br />\n {numeralWrapper.formatExp(this.earnings.defExp)} defense exp <br />\n {numeralWrapper.formatExp(this.earnings.dexExp)} dexterity exp <br />\n {numeralWrapper.formatExp(this.earnings.agiExp)} agility exp <br />\n {numeralWrapper.formatExp(this.earnings.chaExp)} charisma exp\n <br />\n </>,\n );\n }\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n classType: this.classType,\n location: this.location,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"ClassWork\", this);\n }\n\n /** Initializes a ClassWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): ClassWork {\n return Generic_fromJSON(ClassWork, value.data);\n }\n}\n\nReviver.constructors.ClassWork = ClassWork;\n","/**\n * Generic helper/utility functions for the Hacknet mechanic:\n * - Purchase nodes/upgrades\n * - Calculating maximum number of upgrades\n * - Processing Hacknet earnings\n * - Updating Hash Manager capacity\n * - Purchasing hash upgrades\n *\n * TODO Should probably split the different types of functions into their own modules\n */\nimport { HacknetNode } from \"./HacknetNode\";\nimport { calculateNodeCost } from \"./formulas/HacknetNodes\";\nimport { calculateServerCost } from \"./formulas/HacknetServers\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"./data/Constants\";\nimport { HacknetServer } from \"./HacknetServer\";\nimport { HashManager } from \"./HashManager\";\nimport { HashUpgrades } from \"./HashUpgrades\";\n\nimport { generateRandomContract } from \"../CodingContractGenerator\";\nimport { iTutorialSteps, iTutorialNextStep, ITutorial } from \"../InteractiveTutorial\";\nimport { Player } from \"@player\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { Server } from \"../Server/Server\";\n\n// Returns a boolean indicating whether the player has Hacknet Servers\n// (the upgraded form of Hacknet Nodes)\nexport function hasHacknetServers(): boolean {\n return Player.bitNodeN === 9 || Player.sourceFileLvl(9) > 0;\n}\n\nexport function purchaseHacknet(): number {\n /* INTERACTIVE TUTORIAL */\n if (ITutorial.isRunning) {\n if (ITutorial.currStep === iTutorialSteps.HacknetNodesIntroduction) {\n iTutorialNextStep();\n } else {\n return -1;\n }\n }\n /* END INTERACTIVE TUTORIAL */\n\n const numOwned = Player.hacknetNodes.length;\n if (hasHacknetServers()) {\n const cost = getCostOfNextHacknetServer();\n if (isNaN(cost)) {\n throw new Error(`Calculated cost of purchasing HacknetServer is NaN`);\n }\n\n if (!Player.canAfford(cost) || numOwned >= HacknetServerConstants.MaxServers) {\n return -1;\n }\n Player.loseMoney(cost, \"hacknet_expenses\");\n Player.createHacknetServer();\n updateHashManagerCapacity();\n\n return numOwned;\n } else {\n const cost = getCostOfNextHacknetNode();\n if (isNaN(cost)) {\n throw new Error(`Calculated cost of purchasing HacknetNode is NaN`);\n }\n\n if (!Player.canAfford(cost)) {\n return -1;\n }\n\n // Auto generate a name for the Node\n const name = \"hacknet-node-\" + numOwned;\n const node = new HacknetNode(name, Player.mults.hacknet_node_money);\n\n Player.loseMoney(cost, \"hacknet_expenses\");\n Player.hacknetNodes.push(node);\n\n return numOwned;\n }\n}\n\nexport function hasMaxNumberHacknetServers(): boolean {\n return hasHacknetServers() && Player.hacknetNodes.length >= HacknetServerConstants.MaxServers;\n}\n\nexport function getCostOfNextHacknetNode(): number {\n return calculateNodeCost(Player.hacknetNodes.length + 1, Player.mults.hacknet_node_purchase_cost);\n}\n\nexport function getCostOfNextHacknetServer(): number {\n return calculateServerCost(Player.hacknetNodes.length + 1, Player.mults.hacknet_node_purchase_cost);\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's level\nexport function getMaxNumberLevelUpgrades(nodeObj: HacknetNode | HacknetServer, maxLevel: number): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberLevelUpgrades() called without maxLevel arg`);\n }\n\n if (Player.money < nodeObj.calculateLevelUpgradeCost(1, Player.mults.hacknet_node_level_cost)) {\n return 0;\n }\n\n let min = 1;\n let max = maxLevel - 1;\n const levelsToMax = maxLevel - nodeObj.level;\n if (Player.money > nodeObj.calculateLevelUpgradeCost(levelsToMax, Player.mults.hacknet_node_level_cost)) {\n return levelsToMax;\n }\n\n while (min <= max) {\n const curr = ((min + max) / 2) | 0;\n if (\n curr !== maxLevel &&\n Player.money > nodeObj.calculateLevelUpgradeCost(curr, Player.mults.hacknet_node_level_cost) &&\n Player.money < nodeObj.calculateLevelUpgradeCost(curr + 1, Player.mults.hacknet_node_level_cost)\n ) {\n return Math.min(levelsToMax, curr);\n } else if (Player.money < nodeObj.calculateLevelUpgradeCost(curr, Player.mults.hacknet_node_level_cost)) {\n max = curr - 1;\n } else if (Player.money > nodeObj.calculateLevelUpgradeCost(curr, Player.mults.hacknet_node_level_cost)) {\n min = curr + 1;\n } else {\n return Math.min(levelsToMax, curr);\n }\n }\n return 0;\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's RAM\nexport function getMaxNumberRamUpgrades(nodeObj: HacknetNode | HacknetServer, maxLevel: number): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberRamUpgrades() called without maxLevel arg`);\n }\n\n if (Player.money < nodeObj.calculateRamUpgradeCost(1, Player.mults.hacknet_node_ram_cost)) {\n return 0;\n }\n\n let levelsToMax;\n if (nodeObj instanceof HacknetServer) {\n levelsToMax = Math.round(Math.log2(maxLevel / nodeObj.maxRam));\n } else {\n levelsToMax = Math.round(Math.log2(maxLevel / nodeObj.ram));\n }\n if (Player.money > nodeObj.calculateRamUpgradeCost(levelsToMax, Player.mults.hacknet_node_ram_cost)) {\n return levelsToMax;\n }\n\n //We'll just loop until we find the max\n for (let i = levelsToMax - 1; i >= 0; --i) {\n if (Player.money > nodeObj.calculateRamUpgradeCost(i, Player.mults.hacknet_node_ram_cost)) {\n return i;\n }\n }\n return 0;\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's cores\nexport function getMaxNumberCoreUpgrades(nodeObj: HacknetNode | HacknetServer, maxLevel: number): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberCoreUpgrades() called without maxLevel arg`);\n }\n\n if (Player.money < nodeObj.calculateCoreUpgradeCost(1, Player.mults.hacknet_node_core_cost)) {\n return 0;\n }\n\n let min = 1;\n let max = maxLevel - 1;\n const levelsToMax = maxLevel - nodeObj.cores;\n if (Player.money > nodeObj.calculateCoreUpgradeCost(levelsToMax, Player.mults.hacknet_node_core_cost)) {\n return levelsToMax;\n }\n\n // Use a binary search to find the max possible number of upgrades\n while (min <= max) {\n const curr = ((min + max) / 2) | 0;\n if (\n curr != maxLevel &&\n Player.money > nodeObj.calculateCoreUpgradeCost(curr, Player.mults.hacknet_node_core_cost) &&\n Player.money < nodeObj.calculateCoreUpgradeCost(curr + 1, Player.mults.hacknet_node_core_cost)\n ) {\n return Math.min(levelsToMax, curr);\n } else if (Player.money < nodeObj.calculateCoreUpgradeCost(curr, Player.mults.hacknet_node_core_cost)) {\n max = curr - 1;\n } else if (Player.money > nodeObj.calculateCoreUpgradeCost(curr, Player.mults.hacknet_node_core_cost)) {\n min = curr + 1;\n } else {\n return Math.min(levelsToMax, curr);\n }\n }\n\n return 0;\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's cache\nexport function getMaxNumberCacheUpgrades(nodeObj: HacknetServer, maxLevel: number): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberCacheUpgrades() called without maxLevel arg`);\n }\n\n if (!Player.canAfford(nodeObj.calculateCacheUpgradeCost(1))) {\n return 0;\n }\n\n let min = 1;\n let max = maxLevel - 1;\n const levelsToMax = maxLevel - nodeObj.cache;\n if (Player.canAfford(nodeObj.calculateCacheUpgradeCost(levelsToMax))) {\n return levelsToMax;\n }\n\n // Use a binary search to find the max possible number of upgrades\n while (min <= max) {\n const curr = ((min + max) / 2) | 0;\n if (\n curr != maxLevel &&\n Player.canAfford(nodeObj.calculateCacheUpgradeCost(curr)) &&\n !Player.canAfford(nodeObj.calculateCacheUpgradeCost(curr + 1))\n ) {\n return Math.min(levelsToMax, curr);\n } else if (!Player.canAfford(nodeObj.calculateCacheUpgradeCost(curr))) {\n max = curr - 1;\n } else if (Player.canAfford(nodeObj.calculateCacheUpgradeCost(curr))) {\n min = curr + 1;\n } else {\n return Math.min(levelsToMax, curr);\n }\n }\n\n return 0;\n}\n\nexport function purchaseLevelUpgrade(node: HacknetNode | HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateLevelUpgradeCost(sanitizedLevels, Player.mults.hacknet_node_level_cost);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n const isServer = node instanceof HacknetServer;\n\n // If we're at max level, return false\n if (node.level >= (isServer ? HacknetServerConstants.MaxLevel : HacknetNodeConstants.MaxLevel)) {\n return false;\n }\n\n // If the number of specified upgrades would exceed the max level, calculate\n // the maximum number of upgrades and use that\n if (node.level + sanitizedLevels > (isServer ? HacknetServerConstants.MaxLevel : HacknetNodeConstants.MaxLevel)) {\n const diff = Math.max(0, (isServer ? HacknetServerConstants.MaxLevel : HacknetNodeConstants.MaxLevel) - node.level);\n return purchaseLevelUpgrade(node, diff);\n }\n\n if (!Player.canAfford(cost)) {\n return false;\n }\n\n Player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeLevel(sanitizedLevels, Player.mults.hacknet_node_money);\n\n return true;\n}\n\nexport function purchaseRamUpgrade(node: HacknetNode | HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateRamUpgradeCost(sanitizedLevels, Player.mults.hacknet_node_ram_cost);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n if (node instanceof HacknetServer && node.maxRam >= HacknetServerConstants.MaxRam) {\n return false;\n }\n\n if (node instanceof HacknetNode && node.ram >= HacknetNodeConstants.MaxRam) {\n return false;\n }\n\n // If the number of specified upgrades would exceed the max RAM, calculate the\n // max possible number of upgrades and use that\n if (node instanceof HacknetServer) {\n if (node.maxRam * Math.pow(2, sanitizedLevels) > HacknetServerConstants.MaxRam) {\n const diff = Math.max(0, Math.log2(Math.round(HacknetServerConstants.MaxRam / node.maxRam)));\n return purchaseRamUpgrade(node, diff);\n }\n } else if (node instanceof HacknetNode) {\n if (node.ram * Math.pow(2, sanitizedLevels) > HacknetNodeConstants.MaxRam) {\n const diff = Math.max(0, Math.log2(Math.round(HacknetNodeConstants.MaxRam / node.ram)));\n return purchaseRamUpgrade(node, diff);\n }\n }\n\n if (!Player.canAfford(cost)) {\n return false;\n }\n\n Player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeRam(sanitizedLevels, Player.mults.hacknet_node_money);\n\n return true;\n}\n\nexport function purchaseCoreUpgrade(node: HacknetNode | HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateCoreUpgradeCost(sanitizedLevels, Player.mults.hacknet_node_core_cost);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n const isServer = node instanceof HacknetServer;\n\n // Fail if we're already at max\n if (node.cores >= (isServer ? HacknetServerConstants.MaxCores : HacknetNodeConstants.MaxCores)) {\n return false;\n }\n\n // If the specified number of upgrades would exceed the max Cores, calculate\n // the max possible number of upgrades and use that\n if (node.cores + sanitizedLevels > (isServer ? HacknetServerConstants.MaxCores : HacknetNodeConstants.MaxCores)) {\n const diff = Math.max(0, (isServer ? HacknetServerConstants.MaxCores : HacknetNodeConstants.MaxCores) - node.cores);\n return purchaseCoreUpgrade(node, diff);\n }\n\n if (!Player.canAfford(cost)) {\n return false;\n }\n\n Player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeCore(sanitizedLevels, Player.mults.hacknet_node_money);\n\n return true;\n}\n\nexport function purchaseCacheUpgrade(node: HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateCacheUpgradeCost(sanitizedLevels);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n if (!(node instanceof HacknetServer)) {\n console.warn(`purchaseCacheUpgrade() called for a non-HacknetNode`);\n return false;\n }\n\n // Fail if we're already at max\n if (node.cache + sanitizedLevels > HacknetServerConstants.MaxCache) {\n const diff = Math.max(0, HacknetServerConstants.MaxCache - node.cache);\n return purchaseCacheUpgrade(node, diff);\n }\n\n if (!Player.canAfford(cost)) {\n return false;\n }\n\n Player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeCache(sanitizedLevels);\n\n return true;\n}\n\nexport function processHacknetEarnings(numCycles: number): number {\n // Determine if player has Hacknet Nodes or Hacknet Servers, then\n // call the appropriate function\n if (Player.hacknetNodes.length === 0) {\n return 0;\n }\n if (hasHacknetServers()) {\n return processAllHacknetServerEarnings(numCycles);\n } else if (Player.hacknetNodes[0] instanceof HacknetNode) {\n return processAllHacknetNodeEarnings(numCycles);\n } else {\n return 0;\n }\n}\n\nfunction processAllHacknetNodeEarnings(numCycles: number): number {\n let total = 0;\n for (let i = 0; i < Player.hacknetNodes.length; ++i) {\n const node = Player.hacknetNodes[i];\n if (typeof node === \"string\") throw new Error(\"player node should not be ip string\");\n total += processSingleHacknetNodeEarnings(numCycles, node);\n }\n\n return total;\n}\n\nfunction processSingleHacknetNodeEarnings(numCycles: number, nodeObj: HacknetNode): number {\n const totalEarnings = nodeObj.process(numCycles);\n Player.gainMoney(totalEarnings, \"hacknet\");\n\n return totalEarnings;\n}\n\nfunction processAllHacknetServerEarnings(numCycles: number): number {\n if (!(Player.hashManager instanceof HashManager)) {\n throw new Error(`Player does not have a HashManager (should be in 'hashManager' prop)`);\n }\n\n let hashes = 0;\n for (let i = 0; i < Player.hacknetNodes.length; ++i) {\n // hacknetNodes array only contains the IP addresses of the servers.\n // Also, update the hash rate before processing\n const ip = Player.hacknetNodes[i];\n if (ip instanceof HacknetNode) throw new Error(`player nodes should not be HacknetNode`);\n const hserver = GetServer(ip);\n if (!(hserver instanceof HacknetServer)) throw new Error(`player nodes should not be Server`);\n hserver.updateHashRate(Player.mults.hacknet_node_money);\n const h = hserver.process(numCycles);\n hashes += h;\n }\n\n const wastedHashes = Player.hashManager.storeHashes(hashes);\n if (wastedHashes > 0) {\n const upgrade = HashUpgrades[\"Sell for Money\"];\n if (upgrade === null) throw new Error(\"Could not get the hash upgrade\");\n if (!upgrade.cost) throw new Error(\"Upgrade is not properly configured\");\n\n const multiplier = wastedHashes / upgrade.cost;\n if (multiplier > 0) {\n Player.gainMoney(upgrade.value * multiplier, \"hacknet\");\n }\n }\n\n return hashes;\n}\n\nexport function updateHashManagerCapacity(): void {\n if (!(Player.hashManager instanceof HashManager)) {\n console.error(`Player does not have a HashManager`);\n return;\n }\n\n const nodes = Player.hacknetNodes;\n if (nodes.length === 0) {\n Player.hashManager.updateCapacity(0);\n return;\n }\n\n let total = 0;\n for (let i = 0; i < nodes.length; ++i) {\n if (typeof nodes[i] !== \"string\") {\n Player.hashManager.updateCapacity(0);\n return;\n }\n const ip = nodes[i];\n if (ip instanceof HacknetNode) throw new Error(`player nodes should be string but isn't`);\n const h = GetServer(ip);\n if (!(h instanceof HacknetServer)) {\n Player.hashManager.updateCapacity(0);\n return;\n }\n\n total += h.hashCapacity;\n }\n\n Player.hashManager.updateCapacity(total);\n}\n\nexport function purchaseHashUpgrade(upgName: string, upgTarget: string, count = 1): boolean {\n if (!(Player.hashManager instanceof HashManager)) {\n console.error(`Player does not have a HashManager`);\n return false;\n }\n\n // HashManager handles the transaction. This just needs to actually implement\n // the effects of the upgrade\n if (Player.hashManager.upgrade(upgName, count)) {\n const upg = HashUpgrades[upgName];\n\n switch (upgName) {\n case \"Sell for Money\": {\n Player.gainMoney(upg.value * count, \"hacknet\");\n break;\n }\n case \"Sell for Corporation Funds\": {\n const corp = Player.corporation;\n if (corp === null) {\n Player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n corp.funds = corp.funds + upg.value * count;\n break;\n }\n case \"Reduce Minimum Security\": {\n try {\n const target = GetServer(upgTarget);\n if (target == null) {\n console.error(`Invalid target specified in purchaseHashUpgrade(): ${upgTarget}`);\n throw new Error(`'${upgTarget}' is not a server.`);\n }\n if (!(target instanceof Server)) throw new Error(`'${upgTarget}' is not a normal server.`);\n\n target.changeMinimumSecurity(upg.value ** count, true);\n } catch (e) {\n Player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n break;\n }\n case \"Increase Maximum Money\": {\n try {\n const target = GetServer(upgTarget);\n if (target == null) {\n console.error(`Invalid target specified in purchaseHashUpgrade(): ${upgTarget}`);\n throw new Error(`'${upgTarget}' is not a server.`);\n }\n if (!(target instanceof Server)) throw new Error(`'${upgTarget}' is not a normal server.`);\n\n //Manually loop the change so as to properly handle the softcap\n for (let i = 0; i < count; i++) {\n target.changeMaximumMoney(upg.value);\n }\n } catch (e) {\n Player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n break;\n }\n case \"Improve Studying\": {\n // Multiplier handled by HashManager\n break;\n }\n case \"Improve Gym Training\": {\n // Multiplier handled by HashManager\n break;\n }\n case \"Exchange for Corporation Research\": {\n // This will throw if player doesn't have a corporation\n const corp = Player.corporation;\n if (corp === null) {\n Player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n for (const division of corp.divisions) {\n division.sciResearch.qty += upg.value * count;\n }\n break;\n }\n case \"Exchange for Bladeburner Rank\": {\n // This will throw if player isn't in Bladeburner\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) {\n Player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n bladeburner.changeRank(Player, upg.value * count);\n break;\n }\n case \"Exchange for Bladeburner SP\": {\n // This will throw if player isn't in Bladeburner\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) {\n Player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n\n bladeburner.skillPoints += upg.value * count;\n break;\n }\n case \"Generate Coding Contract\": {\n for (let i = 0; i < count; i++) {\n generateRandomContract();\n }\n break;\n }\n default:\n console.warn(`Unrecognized upgrade name ${upgName}. Upgrade has no effect`);\n return false;\n }\n\n return true;\n }\n\n return false;\n}\n","import { Player } from \"@player\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { Corporation } from \"./Corporation\";\nimport { IndustryStartingCosts, IndustryResearchTrees } from \"./IndustryData\";\nimport { Industry } from \"./Industry\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { OfficeSpace } from \"./OfficeSpace\";\nimport { Material } from \"./Material\";\nimport { Product } from \"./Product\";\nimport { Warehouse } from \"./Warehouse\";\nimport { CorporationUnlockUpgrade } from \"./data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade } from \"./data/CorporationUpgrades\";\nimport { Cities } from \"../Locations/Cities\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { ResearchMap } from \"./ResearchMap\";\nimport { isRelevantMaterial } from \"./ui/Helpers\";\nimport { checkEnum } from \"../utils/helpers/checkEnum\";\n\nexport function NewIndustry(corporation: Corporation, industry: string, name: string): void {\n if (corporation.divisions.find(({ type }) => industry == type))\n throw new Error(`You have already expanded into the ${industry} industry!`);\n\n for (let i = 0; i < corporation.divisions.length; ++i) {\n if (corporation.divisions[i].name === name) {\n throw new Error(\"This division name is already in use!\");\n }\n }\n\n const cost = IndustryStartingCosts[industry];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industry}'`);\n }\n if (corporation.funds < cost) {\n throw new Error(\"Not enough money to create a new division in this industry\");\n } else if (name === \"\") {\n throw new Error(\"New division must have a name!\");\n } else {\n corporation.funds = corporation.funds - cost;\n corporation.divisions.push(\n new Industry({\n corp: corporation,\n name: name,\n type: industry,\n }),\n );\n }\n}\n\nexport function NewCity(corporation: Corporation, division: Industry, city: string): void {\n if (corporation.funds < CorporationConstants.OfficeInitialCost) {\n throw new Error(\"You don't have enough company funds to open a new office!\");\n }\n if (division.offices[city]) {\n throw new Error(`You have already expanded into ${city} for ${division.name}`);\n }\n corporation.funds = corporation.funds - CorporationConstants.OfficeInitialCost;\n division.offices[city] = new OfficeSpace({\n loc: city,\n size: CorporationConstants.OfficeInitialSize,\n });\n}\n\nexport function UnlockUpgrade(corporation: Corporation, upgrade: CorporationUnlockUpgrade): void {\n if (corporation.funds < upgrade.price) {\n throw new Error(\"Insufficient funds\");\n }\n if (corporation.unlockUpgrades[upgrade.index] === 1) {\n throw new Error(`You have already unlocked the ${upgrade.name} upgrade!`);\n }\n corporation.unlock(upgrade);\n}\n\nexport function LevelUpgrade(corporation: Corporation, upgrade: CorporationUpgrade): void {\n const baseCost = upgrade.basePrice;\n const priceMult = upgrade.priceMult;\n const level = corporation.upgrades[upgrade.index];\n const cost = baseCost * Math.pow(priceMult, level);\n if (corporation.funds < cost) {\n throw new Error(\"Insufficient funds\");\n } else {\n corporation.upgrade(upgrade);\n }\n}\n\nexport function IssueDividends(corporation: Corporation, rate: number): void {\n if (isNaN(rate) || rate < 0 || rate > CorporationConstants.DividendMaxRate) {\n throw new Error(`Invalid value. Must be an number between 0 and ${CorporationConstants.DividendMaxRate}`);\n }\n\n corporation.dividendRate = rate;\n}\n\nexport function SellMaterial(mat: Material, amt: string, price: string): void {\n if (price === \"\") price = \"0\";\n if (amt === \"\") amt = \"0\";\n let cost = price.replace(/\\s+/g, \"\");\n cost = cost.replace(/[^-()\\d/*+.MPe]/g, \"\"); //Sanitize cost\n let temp = cost.replace(/MP/g, mat.bCost + \"\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell price field: \" + e);\n }\n\n if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {\n throw new Error(\"Invalid value or expression for sell price field\");\n }\n\n if (cost.includes(\"MP\")) {\n mat.sCost = cost; //Dynamically evaluated\n } else {\n mat.sCost = temp;\n }\n\n //Parse quantity\n amt = amt.toUpperCase();\n if (amt.includes(\"MAX\") || amt.includes(\"PROD\")) {\n let q = amt.replace(/\\s+/g, \"\");\n q = q.replace(/[^-()\\d/*+.MAXPROD]/g, \"\");\n let tempQty = q.replace(/MAX/g, mat.maxsll.toString());\n tempQty = tempQty.replace(/PROD/g, mat.prd.toString());\n try {\n tempQty = eval(tempQty);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell quantity field: \" + e);\n }\n\n if (tempQty == null || isNaN(parseFloat(tempQty)) || parseFloat(tempQty) < 0) {\n throw new Error(\"Invalid value or expression for sell quantity field\");\n }\n\n mat.sllman[0] = true;\n mat.sllman[1] = q; //Use sanitized input\n } else if (isNaN(parseFloat(amt)) || parseFloat(amt) < 0) {\n throw new Error(\"Invalid value for sell quantity field! Must be numeric or 'PROD' or 'MAX'\");\n } else {\n let q = parseFloat(amt);\n if (isNaN(q)) {\n q = 0;\n }\n if (q === 0) {\n mat.sllman[0] = false;\n mat.sllman[1] = 0;\n } else {\n mat.sllman[0] = true;\n mat.sllman[1] = q;\n }\n }\n}\n\nexport function SellProduct(product: Product, city: string, amt: string, price: string, all: boolean): void {\n //Parse price\n if (price.includes(\"MP\")) {\n //Dynamically evaluated quantity. First test to make sure its valid\n //Sanitize input, then replace dynamic variables with arbitrary numbers\n price = price.replace(/\\s+/g, \"\");\n price = price.replace(/[^-()\\d/*+.MP]/g, \"\");\n let temp = price.replace(/MP/g, \"1\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell price field: \" + e);\n }\n if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {\n throw new Error(\"Invalid value or expression for sell price field.\");\n }\n product.sCost = price; //Use sanitized price\n } else {\n const cost = parseFloat(price);\n if (isNaN(cost)) {\n throw new Error(\"Invalid value for sell price field\");\n }\n product.sCost = cost;\n }\n\n // Array of all cities. Used later\n const cities = Object.keys(Cities);\n\n // Parse quantity\n amt = amt.toUpperCase();\n if (amt.includes(\"MAX\") || amt.includes(\"PROD\")) {\n //Dynamically evaluated quantity. First test to make sure its valid\n let qty = amt.replace(/\\s+/g, \"\");\n qty = qty.replace(/[^-()\\d/*+.MAXPROD]/g, \"\");\n let temp = qty.replace(/MAX/g, product.maxsll.toString());\n temp = temp.replace(/PROD/g, product.data[city][1].toString());\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell quantity field: \" + e);\n }\n\n if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {\n throw new Error(\"Invalid value or expression for sell quantity field\");\n }\n if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = true;\n product.sllman[tempCity][1] = qty; //Use sanitized input\n }\n } else {\n product.sllman[city][0] = true;\n product.sllman[city][1] = qty; //Use sanitized input\n }\n } else if (isNaN(parseFloat(amt)) || parseFloat(amt) < 0) {\n throw new Error(\"Invalid value for sell quantity field! Must be numeric or 'PROD' or 'MAX'\");\n } else {\n let qty = parseFloat(amt);\n if (isNaN(qty)) {\n qty = 0;\n }\n if (qty === 0) {\n if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = false;\n product.sllman[tempCity][1] = \"\";\n }\n } else {\n product.sllman[city][0] = false;\n product.sllman[city][1] = \"\";\n }\n } else if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = true;\n product.sllman[tempCity][1] = qty;\n }\n } else {\n product.sllman[city][0] = true;\n product.sllman[city][1] = qty;\n }\n }\n}\n\nexport function SetSmartSupply(warehouse: Warehouse, smartSupply: boolean): void {\n warehouse.smartSupplyEnabled = smartSupply;\n}\n\nexport function SetSmartSupplyUseLeftovers(warehouse: Warehouse, material: Material, useLeftover: boolean): void {\n if (!Object.keys(warehouse.smartSupplyUseLeftovers).includes(material.name.replace(/ /g, \"\")))\n throw new Error(`Invalid material '${material.name}'`);\n warehouse.smartSupplyUseLeftovers[material.name.replace(/ /g, \"\")] = useLeftover;\n}\n\nexport function BuyMaterial(material: Material, amt: number): void {\n if (isNaN(amt) || amt < 0) {\n throw new Error(`Invalid amount '${amt}' to buy material '${material.name}'`);\n }\n material.buy = amt;\n}\n\nexport function BulkPurchase(corp: Corporation, warehouse: Warehouse, material: Material, amt: number): void {\n const matSize = MaterialSizes[material.name];\n const maxAmount = (warehouse.size - warehouse.sizeUsed) / matSize;\n if (isNaN(amt) || amt < 0) {\n throw new Error(`Invalid input amount`);\n }\n if (amt > maxAmount) {\n throw new Error(`You do not have enough warehouse size to fit this purchase`);\n }\n const cost = amt * material.bCost;\n if (corp.funds >= cost) {\n corp.funds = corp.funds - cost;\n material.qty += amt;\n } else {\n throw new Error(`You cannot afford this purchase.`);\n }\n}\n\nexport function SellShares(corporation: Corporation, numShares: number): number {\n if (isNaN(numShares)) throw new Error(\"Invalid value for number of shares\");\n if (numShares < 0) throw new Error(\"Invalid value for number of shares\");\n if (numShares > corporation.numShares) throw new Error(\"You don't have that many shares to sell!\");\n if (!corporation.public) throw new Error(\"You haven't gone public!\");\n if (corporation.shareSaleCooldown) throw new Error(\"Share sale on cooldown!\");\n const stockSaleResults = corporation.calculateShareSale(numShares);\n const profit = stockSaleResults[0];\n const newSharePrice = stockSaleResults[1];\n const newSharesUntilUpdate = stockSaleResults[2];\n\n corporation.numShares -= numShares;\n corporation.issuedShares += numShares;\n corporation.sharePrice = newSharePrice;\n corporation.shareSalesUntilPriceUpdate = newSharesUntilUpdate;\n corporation.shareSaleCooldown = CorporationConstants.SellSharesCooldown;\n Player.gainMoney(profit, \"corporation\");\n return profit;\n}\n\nexport function BuyBackShares(corporation: Corporation, numShares: number): boolean {\n if (isNaN(numShares)) throw new Error(\"Invalid value for number of shares\");\n if (numShares < 0) throw new Error(\"Invalid value for number of shares\");\n if (numShares > corporation.issuedShares) throw new Error(\"You don't have that many shares to buy!\");\n if (!corporation.public) throw new Error(\"You haven't gone public!\");\n const buybackPrice = corporation.sharePrice * 1.1;\n if (Player.money < numShares * buybackPrice) throw new Error(\"You cant afford that many shares!\");\n corporation.numShares += numShares;\n corporation.issuedShares -= numShares;\n Player.loseMoney(numShares * buybackPrice, \"corporation\");\n return true;\n}\n\nexport function AssignJob(office: OfficeSpace, employeeName: string, job: string): void {\n const employee = office.employees.find((e) => e.name === employeeName);\n if (!employee) throw new Error(`Could not find employee '${name}'.`);\n if (!checkEnum(EmployeePositions, job)) throw new Error(`'${job}' is not a valid job.`);\n office.assignSingleJob(employee, job);\n}\n\nexport function AutoAssignJob(office: OfficeSpace, job: string, count: number): boolean {\n if (!checkEnum(EmployeePositions, job)) throw new Error(`'${job}' is not a valid job.`);\n return office.autoAssignJob(job, count);\n}\n\nexport function UpgradeOfficeSize(corp: Corporation, office: OfficeSpace, size: number): void {\n const initialPriceMult = Math.round(office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n // Calculate cost to upgrade size by 15 employees\n let mult = 0;\n for (let i = 0; i < size / CorporationConstants.OfficeInitialSize; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n const cost = CorporationConstants.OfficeInitialCost * mult;\n if (corp.funds < cost) return;\n office.size += size;\n corp.funds = corp.funds - cost;\n}\n\nexport function BuyCoffee(corp: Corporation, office: OfficeSpace): boolean {\n const cost = office.getCoffeeCost();\n if (corp.funds < cost) {\n return false;\n }\n\n if (!office.setCoffee()) {\n return false;\n }\n corp.funds -= cost;\n\n return true;\n}\n\nexport function ThrowParty(corp: Corporation, office: OfficeSpace, costPerEmployee: number): number {\n const mult = 1 + costPerEmployee / 10e6;\n const cost = costPerEmployee * office.employees.length;\n if (corp.funds < cost) {\n return 0;\n }\n\n if (!office.setParty(mult)) {\n return 0;\n }\n corp.funds -= cost;\n\n return mult;\n}\n\nexport function PurchaseWarehouse(corp: Corporation, division: Industry, city: string): void {\n if (corp.funds < CorporationConstants.WarehouseInitialCost) return;\n if (division.warehouses[city]) return;\n division.warehouses[city] = new Warehouse({\n corp: corp,\n industry: division,\n loc: city,\n size: CorporationConstants.WarehouseInitialSize,\n });\n corp.funds = corp.funds - CorporationConstants.WarehouseInitialCost;\n}\n\nexport function UpgradeWarehouseCost(warehouse: Warehouse, amt: number): number {\n return Array.from(Array(amt).keys()).reduce(\n (acc, index) => acc + CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, warehouse.level + 1 + index),\n 0,\n );\n}\n\nexport function UpgradeWarehouse(corp: Corporation, division: Industry, warehouse: Warehouse, amt = 1): void {\n const sizeUpgradeCost = UpgradeWarehouseCost(warehouse, amt);\n if (corp.funds < sizeUpgradeCost) return;\n warehouse.level += amt;\n warehouse.updateSize(corp, division);\n corp.funds = corp.funds - sizeUpgradeCost;\n}\n\nexport function HireAdVert(corp: Corporation, division: Industry): void {\n const cost = division.getAdVertCost();\n if (corp.funds < cost) return;\n corp.funds = corp.funds - cost;\n division.applyAdVert(corp);\n}\n\nexport function MakeProduct(\n corp: Corporation,\n division: Industry,\n city: string,\n productName: string,\n designInvest: number,\n marketingInvest: number,\n): void {\n if (designInvest < 0) {\n designInvest = 0;\n }\n if (marketingInvest < 0) {\n marketingInvest = 0;\n }\n if (productName == null || productName === \"\") {\n throw new Error(\"You must specify a name for your product!\");\n }\n if (!division.makesProducts) {\n throw new Error(\"You cannot create products for this industry!\");\n }\n if (isNaN(designInvest)) {\n throw new Error(\"Invalid value for design investment\");\n }\n if (isNaN(marketingInvest)) {\n throw new Error(\"Invalid value for marketing investment\");\n }\n if (corp.funds < designInvest + marketingInvest) {\n throw new Error(\"You don't have enough company funds to make this large of an investment\");\n }\n let maxProducts = 3;\n if (division.hasResearch(\"uPgrade: Capacity.II\")) {\n maxProducts = 5;\n } else if (division.hasResearch(\"uPgrade: Capacity.I\")) {\n maxProducts = 4;\n }\n const products = division.products;\n if (Object.keys(products).length >= maxProducts) {\n throw new Error(`You are already at the max products (${maxProducts}) for division: ${division.name}!`);\n }\n\n const product = new Product({\n name: productName.replace(/[<>]/g, \"\").trim(), //Sanitize for HTMl elements\n createCity: city,\n designCost: designInvest,\n advCost: marketingInvest,\n });\n if (products[product.name]) {\n throw new Error(`You already have a product with this name!`);\n }\n\n corp.funds = corp.funds - (designInvest + marketingInvest);\n products[product.name] = product;\n}\n\nexport function Research(division: Industry, researchName: string): void {\n const researchTree = IndustryResearchTrees[division.type];\n if (researchTree === undefined) throw new Error(`No research tree for industry '${division.type}'`);\n const allResearch = researchTree.getAllNodes();\n if (!allResearch.includes(researchName)) throw new Error(`No research named '${researchName}'`);\n const research = ResearchMap[researchName];\n\n if (division.researched[researchName]) return;\n if (division.sciResearch.qty < research.cost)\n throw new Error(`You do not have enough Scientific Research for ${research.name}`);\n division.sciResearch.qty -= research.cost;\n\n // Get the Node from the Research Tree and set its 'researched' property\n researchTree.research(researchName);\n division.researched[researchName] = true;\n\n // I couldn't figure out where else to put this so that warehouse size would get updated instantly\n // whether research is done by script or UI. All other stats gets calculated in every cycle\n // Warehouse size gets updated only when something increases it.\n if (researchName == \"Drones - Transport\") {\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const warehouse = division.warehouses[city];\n if (!warehouse) {\n continue;\n }\n if (Player.corporation) {\n // Stores cycles in a \"buffer\". Processed separately using Engine Counters\n warehouse.updateSize(Player.corporation, division);\n }\n }\n }\n}\n\nexport function ExportMaterial(\n divisionName: string,\n cityName: string,\n material: Material,\n amt: string,\n division?: Industry,\n): void {\n // Sanitize amt\n let sanitizedAmt = amt.replace(/\\s+/g, \"\").toUpperCase();\n sanitizedAmt = sanitizedAmt.replace(/[^-()\\d/*+.MAX]/g, \"\");\n let temp = sanitizedAmt.replace(/MAX/g, \"1\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid expression entered for export amount: \" + e);\n }\n\n const n = parseFloat(temp);\n\n if (n == null || isNaN(n) || n < 0) {\n throw new Error(\"Invalid amount entered for export\");\n }\n\n if (!division || !isRelevantMaterial(material.name, division)) {\n throw new Error(`You cannot export material: ${material.name} to division: ${divisionName}!`);\n }\n\n const exportObj = { ind: divisionName, city: cityName, amt: sanitizedAmt };\n material.exp.push(exportObj);\n}\n\nexport function CancelExportMaterial(divisionName: string, cityName: string, material: Material, amt: string): void {\n for (let i = 0; i < material.exp.length; ++i) {\n if (material.exp[i].ind !== divisionName || material.exp[i].city !== cityName || material.exp[i].amt !== amt)\n continue;\n material.exp.splice(i, 1);\n break;\n }\n}\n\nexport function LimitProductProduction(product: Product, cityName: string, qty: number): void {\n if (qty < 0 || isNaN(qty)) {\n product.prdman[cityName][0] = false;\n product.prdman[cityName][1] = 0;\n } else {\n product.prdman[cityName][0] = true;\n product.prdman[cityName][1] = qty;\n }\n}\n\nexport function LimitMaterialProduction(material: Material, qty: number): void {\n if (qty < 0 || isNaN(qty)) {\n material.prdman[0] = false;\n material.prdman[1] = 0;\n } else {\n material.prdman[0] = true;\n material.prdman[1] = qty;\n }\n}\n\nexport function SetMaterialMarketTA1(material: Material, on: boolean): void {\n material.marketTa1 = on;\n}\n\nexport function SetMaterialMarketTA2(material: Material, on: boolean): void {\n material.marketTa2 = on;\n}\n\nexport function SetProductMarketTA1(product: Product, on: boolean): void {\n product.marketTa1 = on;\n}\n\nexport function SetProductMarketTA2(product: Product, on: boolean): void {\n product.marketTa2 = on;\n}\n","export enum BlackOperationNames {\n OperationTyphoon = \"Operation Typhoon\",\n OperationZero = \"Operation Zero\",\n OperationX = \"Operation X\",\n OperationTitan = \"Operation Titan\",\n OperationAres = \"Operation Ares\",\n OperationArchangel = \"Operation Archangel\",\n OperationJuggernaut = \"Operation Juggernaut\",\n OperationRedDragon = \"Operation Red Dragon\",\n OperationK = \"Operation K\",\n OperationDeckard = \"Operation Deckard\",\n OperationTyrell = \"Operation Tyrell\",\n OperationWallace = \"Operation Wallace\",\n OperationShoulderOfOrion = \"Operation Shoulder of Orion\",\n OperationHyron = \"Operation Hyron\",\n OperationMorpheus = \"Operation Morpheus\",\n OperationIonStorm = \"Operation Ion Storm\",\n OperationAnnihilus = \"Operation Annihilus\",\n OperationUltron = \"Operation Ultron\",\n OperationCenturion = \"Operation Centurion\",\n OperationVindictus = \"Operation Vindictus\",\n OperationDaedalus = \"Operation Daedalus\",\n}\n","import { CityName } from \"./../../Locations/data/CityNames\";\nexport const BladeburnerConstants = {\n CityNames: [\n CityName.Aevum,\n CityName.Chongqing,\n CityName.Sector12,\n CityName.NewTokyo,\n CityName.Ishima,\n CityName.Volhaven,\n ],\n CyclesPerSecond: 5, // Game cycle is 200 ms\n\n StaminaGainPerSecond: 0.0085,\n BaseStaminaLoss: 0.285, // Base stamina loss per action. Increased based on difficulty\n MaxStaminaToGainFactor: 70000, // Max Stamina is divided by this to get bonus stamina gain\n\n DifficultyToTimeFactor: 10, // Action Difficulty divided by this to get base action time\n\n /**\n * The difficulty multiplier affects stamina loss and hp loss of an action. Also affects\n * experience gain. Its formula is:\n * difficulty ^ exponentialFactor + difficulty / linearFactor\n */\n DiffMultExponentialFactor: 0.28,\n DiffMultLinearFactor: 650,\n\n /**\n * These factors are used to calculate action time.\n * They affect how much action time is reduced based on your agility and dexterity\n */\n EffAgiLinearFactor: 10e3,\n EffDexLinearFactor: 10e3,\n EffAgiExponentialFactor: 0.04,\n EffDexExponentialFactor: 0.035,\n\n BaseRecruitmentTimeNeeded: 300, // Base time needed (s) to complete a Recruitment action\n\n PopulationThreshold: 1e9, // Population which determines baseline success rate\n PopulationExponent: 0.7, // Exponent that influences how different populations affect success rate\n ChaosThreshold: 50, // City chaos level after which it starts making tasks harder\n\n BaseStatGain: 1, // Base stat gain per second\n BaseIntGain: 0.003, // Base intelligence stat gain\n\n ActionCountGrowthPeriod: 480, // Time (s) it takes for action count to grow by its specified value\n\n RankToFactionRepFactor: 2, // Delta Faction Rep = this * Delta Rank\n RankNeededForFaction: 25,\n\n ContractSuccessesPerLevel: 3, // How many successes you need to level up a contract\n OperationSuccessesPerLevel: 2.5, // How many successes you need to level up an op\n\n RanksPerSkillPoint: 3, // How many ranks needed to get 1 Skill Point\n\n ContractBaseMoneyGain: 250e3, // Base Money Gained per contract\n\n HrcHpGain: 2, // HP Gained from Hyperbolic Regeneration chamber\n HrcStaminaGain: 1, // Percentage Stamina gained from Hyperbolic Regeneration Chamber\n};\n","export enum FragmentType {\n // Special fragments for the UI\n None,\n Delete,\n\n // Stats boosting fragments\n HackingChance,\n HackingSpeed,\n HackingMoney,\n HackingGrow,\n Hacking,\n Strength,\n Defense,\n Dexterity,\n Agility,\n Charisma,\n HacknetMoney,\n HacknetCost,\n Rep,\n WorkMoney,\n Crime,\n Bladeburner,\n\n // utility fragments.\n Booster,\n}\n\nexport function Effect(tpe: FragmentType): string {\n switch (tpe) {\n case FragmentType.HackingChance: {\n return \"+x% hack() success chance\";\n }\n case FragmentType.HackingSpeed: {\n return \"+x% faster hack(), grow(), and weaken()\";\n }\n case FragmentType.HackingMoney: {\n return \"+x% hack() power\";\n }\n case FragmentType.HackingGrow: {\n return \"+x% grow() power\";\n }\n case FragmentType.Hacking: {\n return \"+x% hacking skill\";\n }\n case FragmentType.Strength: {\n return \"+x% strength skill\";\n }\n case FragmentType.Defense: {\n return \"+x% defense skill\";\n }\n case FragmentType.Dexterity: {\n return \"+x% dexterity skill\";\n }\n case FragmentType.Agility: {\n return \"+x% agility skill\";\n }\n case FragmentType.Charisma: {\n return \"+x% charisma skill\";\n }\n case FragmentType.HacknetMoney: {\n return \"+x% hacknet production\";\n }\n case FragmentType.HacknetCost: {\n return \"-x% cheaper hacknet cost\";\n }\n case FragmentType.Rep: {\n return \"+x% reputation from factions and companies\";\n }\n case FragmentType.WorkMoney: {\n return \"+x% work money\";\n }\n case FragmentType.Crime: {\n return \"+x% crime money\";\n }\n case FragmentType.Bladeburner: {\n return \"+x% all bladeburner stats\";\n }\n }\n throw new Error(\"Calling effect for fragment type that doesn't have an effect \" + tpe);\n}\n","export enum LiteratureNames {\n HackersStartingHandbook = \"hackers-starting-handbook.lit\",\n CorporationManagementHandbook = \"corporation-management-handbook.lit\",\n HistoryOfSynthoids = \"history-of-synthoids.lit\",\n AGreenTomorrow = \"A-Green-Tomorrow.lit\",\n AlphaOmega = \"alpha-omega.lit\",\n SimulatedReality = \"simulated-reality.lit\",\n BeyondMan = \"beyond-man.lit\",\n BrighterThanTheSun = \"brighter-than-the-sun.lit\",\n DemocracyIsDead = \"democracy-is-dead.lit\",\n Sector12Crime = \"sector-12-crime.lit\",\n ManAndMachine = \"man-and-machine.lit\",\n SecretSocieties = \"secret-societies.lit\",\n TheFailedFrontier = \"the-failed-frontier.lit\",\n CodedIntelligence = \"coded-intelligence.lit\",\n SyntheticMuscles = \"synthetic-muscles.lit\",\n TensionsInTechRace = \"tensions-in-tech-race.lit\",\n CostOfImmortality = \"cost-of-immortality.lit\",\n TheHiddenWorld = \"the-hidden-world.lit\",\n TheNewGod = \"the-new-god.lit\",\n NewTriads = \"new-triads.lit\",\n TheSecretWar = \"the-secret-war.lit\",\n}\n","import { Augmentation } from \"./Augmentation\";\n\nexport const StaticAugmentations: Record<string, Augmentation> = {};\n","import React from \"react\";\n\nimport { Typography, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { characterOverviewStyles as useStyles } from \"./CharacterOverview\";\nimport { ClassNameMap } from \"@material-ui/core/styles/withStyles\";\n\ninterface ITableRowData {\n content?: string;\n level?: number;\n exp?: number;\n}\n\ninterface IProps {\n name: string;\n color: string;\n classes?: ClassNameMap;\n data?: ITableRowData;\n children?: React.ReactElement;\n}\n\nexport const StatsRow = ({ name, color, classes = useStyles(), children, data }: IProps): React.ReactElement => {\n let content = \"\";\n\n if (data) {\n if (data.content !== undefined) {\n content = data.content;\n } else if (data.level !== undefined && data.exp !== undefined) {\n content = `${formatNumber(data.level, 0)} (${numeralWrapper.formatExp(data.exp)} exp)`;\n } else if (data.level !== undefined && data.exp === undefined) {\n content = `${formatNumber(data.level, 0)}`;\n }\n }\n\n return (\n <TableRow>\n <TableCell classes={{ root: classes.cellNone }}>\n <Typography style={{ color: color }}>{name}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n {content ? <Typography style={{ color: color }}>{content}</Typography> : <></>}\n {children}\n </TableCell>\n </TableRow>\n );\n};\n","export enum PositionTypes {\n Long = \"L\",\n Short = \"S\",\n}\n","import React from \"react\";\nimport { TableCell as MuiTableCell, TableCellProps, Table as MuiTable, TableProps } from \"@mui/material\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\n\nconst useStyles = makeStyles({\n root: {\n borderBottom: \"none\",\n },\n small: {\n width: \"1px\",\n },\n});\n\nexport const TableCell: React.FC<TableCellProps> = (props: TableCellProps) => {\n return (\n <MuiTableCell\n {...props}\n classes={{\n root: useStyles().root,\n ...props.classes,\n }}\n />\n );\n};\n\nexport const Table: React.FC<TableProps> = (props: TableProps) => {\n return (\n <MuiTable\n {...props}\n classes={{\n root: useStyles().small,\n ...props.classes,\n }}\n />\n );\n};\n","/**\n * Helper functions that implement \"directory\" functionality in the Terminal.\n * These aren't \"real\" directories, it's more of a pseudo-directory implementation\n * that uses mainly string manipulation.\n *\n * This file contains functions that deal only with that string manipulation.\n * Functions that need to access/process Server-related things can be\n * found in ./DirectoryServerHelpers.ts\n */\n\n/** Removes leading forward slash (\"/\") from a string. */\nexport function removeLeadingSlash(s: string): string {\n if (s.startsWith(\"/\")) {\n return s.slice(1);\n }\n\n return s;\n}\n\n/**\n * Removes trailing forward slash (\"/\") from a string.\n * Note that this will also remove the slash if it is the leading slash (i.e. if s = \"/\")\n */\nexport function removeTrailingSlash(s: string): string {\n if (s.endsWith(\"/\")) {\n return s.slice(0, -1);\n }\n\n return s;\n}\n\n/**\n * Checks whether a string is a valid filename. Only used for the filename itself,\n * not the entire filepath\n */\nexport function isValidFilename(filename: string): boolean {\n // Allows alphanumerics, hyphens, underscores, and percentage signs\n // Must have a file extension\n const regex = /^[.&'a-zA-Z0-9_-]+\\.[a-zA-Z0-9]+(?:-\\d+(?:\\.\\d*)?%-INC)?$/;\n\n // match() returns null if no match is found\n return filename.match(regex) != null;\n}\n\n/**\n * Checks whether a string is a valid directory name. Only used for the directory itself,\n * not an entire path\n */\nexport function isValidDirectoryName(name: string): boolean {\n // A valid directory name:\n // Must be at least 1 character long\n // Can only include characters in the character set [-.%a-zA-Z0-9_]\n // Cannot end with a '.'\n const regex = /^.?[a-zA-Z0-9_-]+$/;\n\n // match() returns null if no match is found\n return name.match(regex) != null;\n}\n\n/**\n * Checks whether a string is a valid directory path.\n * This only checks if it has the proper formatting. It does NOT check\n * if the directories actually exist on Terminal\n */\nexport function isValidDirectoryPath(path: string): boolean {\n let t_path: string = path;\n\n if (t_path.length === 0) {\n return false;\n }\n if (t_path.length === 1) {\n return t_path === \"/\";\n }\n\n // A full path must have a leading slash, but we'll ignore it for the checks\n if (t_path.startsWith(\"/\")) {\n t_path = t_path.slice(1);\n } else {\n return false;\n }\n\n // Trailing slash does not matter\n t_path = removeTrailingSlash(t_path);\n\n // Check that every section of the path is a valid directory name\n const dirs = t_path.split(\"/\");\n for (const dir of dirs) {\n // Special case, \".\" and \"..\" are valid for path\n if (dir === \".\" || dir === \"..\") {\n continue;\n }\n if (!isValidDirectoryName(dir)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Checks whether a string is a valid file path. This only checks if it has the\n * proper formatting. It dose NOT check if the file actually exists on Terminal\n */\nexport function isValidFilePath(path: string): boolean {\n if (path == null || typeof path !== \"string\") {\n return false;\n }\n const t_path = path;\n\n // Impossible for filename to have less than length of 3\n if (t_path.length < 3) {\n return false;\n }\n\n // Full filepath can't end with trailing slash because it must be a file\n if (t_path.endsWith(\"/\")) {\n return false;\n }\n\n // Everything after the last forward slash is the filename. Everything before\n // it is the file path\n const fnSeparator = t_path.lastIndexOf(\"/\");\n if (fnSeparator === -1) {\n return isValidFilename(t_path);\n }\n\n const fn = t_path.slice(fnSeparator + 1);\n const dirPath = t_path.slice(0, fnSeparator + 1);\n\n return isValidDirectoryPath(dirPath) && isValidFilename(fn);\n}\n\n/**\n * Returns a formatted string for the first parent directory in a filepath. For example:\n * /home/var/test/ -> home/\n * If there is no first parent directory, then it returns \"/\" for root\n */\nexport function getFirstParentDirectory(path: string): string {\n let t_path = path;\n t_path = removeLeadingSlash(t_path);\n t_path = removeTrailingSlash(t_path);\n\n if (t_path.lastIndexOf(\"/\") === -1) {\n return \"/\";\n }\n\n const dirs = t_path.split(\"/\");\n if (dirs.length === 0) {\n return \"/\";\n }\n\n return dirs[0] + \"/\";\n}\n\n/**\n * Given a filepath, returns a formatted string for all of the parent directories\n * in that filepath. For example:\n * /home/var/tes -> home/var/\n * /home/var/test/ -> home/var/test/\n * If there are no parent directories, it returns the empty string\n */\nexport function getAllParentDirectories(path: string): string {\n const t_path = path;\n const lastSlash = t_path.lastIndexOf(\"/\");\n if (lastSlash === -1) {\n return \"\";\n }\n\n return t_path.slice(0, lastSlash + 1);\n}\n\n/**\n * Given a destination that only contains a directory part, returns the\n * path to the source filename inside the new destination directory.\n * Otherwise, returns the path to the destination file.\n * @param destination The destination path or file name\n * @param source The source path\n * @param cwd The current working directory\n * @returns A file path which may be absolute or relative\n */\nexport function getDestinationFilepath(destination: string, source: string, cwd: string): string {\n const dstDir = evaluateDirectoryPath(destination, cwd);\n // If evaluating the directory for this destination fails, we have a filename or full path.\n if (dstDir === null) {\n return destination;\n } else {\n // Append the filename to the directory provided.\n const t_path = removeTrailingSlash(dstDir);\n const fileName = getFileName(source);\n return t_path + \"/\" + fileName;\n }\n}\n\n/**\n * Given a filepath, returns the file name (e.g. without directory parts)\n * For example:\n * /home/var/test.js -> test.js\n * ./var/test.js -> test.js\n * test.js -> test.js\n */\nexport function getFileName(path: string): string {\n const t_path = path;\n const lastSlash = t_path.lastIndexOf(\"/\");\n if (lastSlash === -1) {\n return t_path;\n }\n\n return t_path.slice(lastSlash + 1);\n}\n\n/** Checks if a file path refers to a file in the root directory. */\nexport function isInRootDirectory(path: string): boolean {\n if (!isValidFilePath(path)) {\n return false;\n }\n if (path == null || path.length === 0) {\n return false;\n }\n\n return path.lastIndexOf(\"/\") <= 0;\n}\n\n/**\n * Evaluates a directory path, including the processing of linux dots.\n * Returns the full, proper path, or null if an invalid path is passed in\n */\nexport function evaluateDirectoryPath(path: string, currPath?: string): string | null {\n let t_path = path;\n\n // If the path begins with a slash, then its an absolute path. Otherwise its relative\n // For relative paths, we need to prepend the current directory\n if (!t_path.startsWith(\"/\") && currPath) {\n t_path = currPath + (currPath.endsWith(\"/\") ? \"\" : \"/\") + t_path;\n }\n\n if (!isValidDirectoryPath(t_path)) {\n return null;\n }\n\n // Trim leading/trailing slashes\n t_path = removeLeadingSlash(t_path);\n t_path = removeTrailingSlash(t_path);\n\n const dirs = t_path.split(\"/\");\n const reconstructedPath: string[] = [];\n\n for (const dir of dirs) {\n if (dir === \".\") {\n // Current directory, do nothing\n continue;\n } else if (dir === \"..\") {\n // Parent directory\n const res = reconstructedPath.pop();\n if (res == null) {\n return null; // Array was empty, invalid path\n }\n } else {\n reconstructedPath.push(dir);\n }\n }\n\n return \"/\" + reconstructedPath.join(\"/\");\n}\n\n/**\n * Evaluates a file path, including the processing of linux dots.\n * Returns the full, proper path, or null if an invalid path is passed in\n */\nexport function evaluateFilePath(path: string, currPath?: string): string | null {\n let t_path = path;\n\n // If the path begins with a slash, then its an absolute path. Otherwise its relative\n // For relative paths, we need to prepend the current directory\n if (!t_path.startsWith(\"/\") && currPath != null) {\n t_path = currPath + (currPath.endsWith(\"/\") ? \"\" : \"/\") + t_path;\n }\n\n if (!isValidFilePath(t_path)) {\n return null;\n }\n\n // Trim leading/trailing slashes\n t_path = removeLeadingSlash(t_path);\n\n const dirs = t_path.split(\"/\");\n const reconstructedPath: string[] = [];\n\n for (const dir of dirs) {\n if (dir === \".\") {\n // Current directory, do nothing\n continue;\n } else if (dir === \"..\") {\n // Parent directory\n const res = reconstructedPath.pop();\n if (res == null) {\n return null; // Array was empty, invalid path\n }\n } else {\n reconstructedPath.push(dir);\n }\n }\n\n return \"/\" + reconstructedPath.join(\"/\");\n}\n\nexport function areFilesEqual(f0: string, f1: string): boolean {\n if (!f0.startsWith(\"/\")) f0 = \"/\" + f0;\n if (!f1.startsWith(\"/\")) f1 = \"/\" + f1;\n return f0 === f1;\n}\n\nexport function areImportsEquals(f0: string, f1: string): boolean {\n if (!f0.endsWith(\".js\")) f0 = f0 + \".js\";\n if (!f1.endsWith(\".js\")) f1 = f1 + \".js\";\n return areFilesEqual(f0, f1);\n}\n","// Constructs all CompanyPosition objects using the metadata in data/companypositions.ts\nimport { companiesMetadata } from \"./data/CompaniesMetadata\";\nimport { Company, IConstructorParams } from \"./Company\";\nimport { Reviver } from \"../utils/JSONReviver\";\n\nexport let Companies: Record<string, Company> = {};\n\nfunction addCompany(params: IConstructorParams): void {\n if (Companies[params.name] != null) {\n console.warn(`Duplicate Company Position being defined: ${params.name}`);\n }\n Companies[params.name] = new Company(params);\n}\n\n// Used to initialize new Company objects for the Companies map\n// Called when creating new game or after a prestige/reset\nexport function initCompanies(): void {\n // Save Old Company data for 'favor'\n const oldCompanies = Companies;\n\n // Re-construct all Companies\n Companies = {};\n companiesMetadata.forEach((e) => {\n addCompany(e);\n });\n\n // Reset data\n for (const companyName of Object.keys(Companies)) {\n const company = Companies[companyName];\n const oldCompany = oldCompanies[companyName];\n if (!oldCompany) {\n // New game, so no OldCompanies data\n company.favor = 0;\n } else {\n company.favor = oldCompanies[companyName].favor;\n if (isNaN(company.favor)) {\n company.favor = 0;\n }\n }\n }\n}\n\n// Used to load Companies map from a save\nexport function loadCompanies(saveString: string): void {\n Companies = JSON.parse(saveString, Reviver);\n}\n","import { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Reviver } from \"../utils/JSONReviver\";\n\ninterface GangTerritory {\n power: number;\n territory: number;\n}\n\nexport let AllGangs: {\n [key: string]: GangTerritory;\n} = {\n [FactionNames.SlumSnakes]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.Tetrads]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheSyndicate]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheDarkArmy]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.SpeakersForTheDead]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.NiteSec]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheBlackHand]: {\n power: 1,\n territory: 1 / 7,\n },\n};\n\nexport function resetGangs(): void {\n AllGangs = {\n [FactionNames.SlumSnakes]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.Tetrads]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheSyndicate]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheDarkArmy]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.SpeakersForTheDead]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.NiteSec]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheBlackHand]: {\n power: 1,\n territory: 1 / 7,\n },\n };\n}\n\nexport function loadAllGangs(saveString: string): void {\n AllGangs = JSON.parse(saveString, Reviver);\n}\n","import React, { useEffect } from \"react\";\nimport { useSnackbar, SnackbarProvider as SB } from \"notistack\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Alert from \"@mui/material/Alert\";\nimport Paper from \"@mui/material/Paper\";\nimport { logBoxBaseZIndex } from \"./LogBoxManager\";\n\ninterface IProps {\n children: React.ReactNode | React.ReactNode[];\n}\n\nexport enum ToastVariant {\n SUCCESS = \"success\",\n WARNING = \"warning\",\n ERROR = \"error\",\n INFO = \"info\",\n}\n\nconst useStyles = makeStyles(() => ({\n snackbar: {\n // Log popup z-index increments, so let's add a padding to be well above them.\n zIndex: `${logBoxBaseZIndex + 1000} !important` as any,\n\n \"& .MuiAlert-icon\": {\n alignSelf: \"center\",\n },\n },\n}));\n\nexport function SnackbarProvider(props: IProps): React.ReactElement {\n const classes = useStyles();\n return (\n <SB\n dense\n maxSnack={9}\n anchorOrigin={{ horizontal: \"right\", vertical: \"bottom\" }}\n autoHideDuration={2000}\n classes={{ containerRoot: classes.snackbar }}\n >\n {props.children}\n </SB>\n );\n}\n\nexport const SnackbarEvents = new EventEmitter<[string | React.ReactNode, ToastVariant, number | null]>();\n\nexport function Snackbar(): React.ReactElement {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n\n useEffect(() =>\n SnackbarEvents.subscribe((s, variant, duration) => {\n const id = enqueueSnackbar(<Alert severity={variant}>{s}</Alert>, {\n content: (k, m) => <Paper key={k}>{m}</Paper>,\n variant: variant,\n autoHideDuration: duration,\n onClick: () => closeSnackbar(id),\n });\n }),\n );\n return <></>;\n}\n","import { Crime } from \"./Crime\";\n\nimport { CONSTANTS } from \"../Constants\";\n\nimport { CrimeType } from \"../utils/WorkType\";\n\nexport const Crimes: Record<string, Crime> = {\n Shoplift: new Crime(\"Shoplift\", \"to shoplift\", CrimeType.SHOPLIFT, 2e3, 15e3, 1 / 20, 0.1, {\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n dexterity_exp: 2,\n agility_exp: 2,\n }),\n\n RobStore: new Crime(\"Rob Store\", \"to rob a store\", CrimeType.ROB_STORE, 60e3, 400e3, 1 / 5, 0.5, {\n hacking_exp: 30,\n dexterity_exp: 45,\n agility_exp: 45,\n\n hacking_success_weight: 0.5,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n\n intelligence_exp: 7.5 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Mug: new Crime(\"Mug\", \"to mug\", CrimeType.MUG, 4e3, 36e3, 1 / 5, 0.25, {\n strength_exp: 3,\n defense_exp: 3,\n dexterity_exp: 3,\n agility_exp: 3,\n\n strength_success_weight: 1.5,\n defense_success_weight: 0.5,\n dexterity_success_weight: 1.5,\n agility_success_weight: 0.5,\n }),\n\n Larceny: new Crime(\"Larceny\", \"larceny\", CrimeType.LARCENY, 90e3, 800e3, 1 / 3, 1.5, {\n hacking_exp: 45,\n dexterity_exp: 60,\n agility_exp: 60,\n\n hacking_success_weight: 0.5,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n intelligence_exp: 15 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n DealDrugs: new Crime(\"Deal Drugs\", \"to deal drugs\", CrimeType.DRUGS, 10e3, 120e3, 1, 0.5, {\n dexterity_exp: 5,\n agility_exp: 5,\n charisma_exp: 10,\n\n charisma_success_weight: 3,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n }),\n\n BondForgery: new Crime(\"Bond Forgery\", \"to forge bonds\", CrimeType.BOND_FORGERY, 300e3, 4.5e6, 1 / 2, 0.1, {\n hacking_exp: 100,\n dexterity_exp: 150,\n charisma_exp: 15,\n\n hacking_success_weight: 0.05,\n dexterity_success_weight: 1.25,\n\n intelligence_exp: 60 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n TraffickArms: new Crime(\"Traffick Arms\", \"to traffic arms\", CrimeType.TRAFFIC_ARMS, 40e3, 600e3, 2, 1, {\n strength_exp: 20,\n defense_exp: 20,\n dexterity_exp: 20,\n agility_exp: 20,\n charisma_exp: 40,\n\n charisma_success_weight: 1,\n strength_success_weight: 1,\n defense_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n }),\n\n Homicide: new Crime(\"Homicide\", \"homicide\", CrimeType.HOMICIDE, 3e3, 45e3, 1, 3, {\n strength_exp: 2,\n defense_exp: 2,\n dexterity_exp: 2,\n agility_exp: 2,\n\n strength_success_weight: 2,\n defense_success_weight: 2,\n dexterity_success_weight: 0.5,\n agility_success_weight: 0.5,\n\n kills: 1,\n }),\n\n GrandTheftAuto: new Crime(\"Grand Theft Auto\", \"grand theft auto\", CrimeType.GRAND_THEFT_AUTO, 80e3, 1.6e6, 8, 5, {\n strength_exp: 20,\n defense_exp: 20,\n dexterity_exp: 20,\n agility_exp: 80,\n charisma_exp: 40,\n\n hacking_success_weight: 1,\n strength_success_weight: 1,\n dexterity_success_weight: 4,\n agility_success_weight: 2,\n charisma_success_weight: 2,\n\n intelligence_exp: 16 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Kidnap: new Crime(\"Kidnap\", \"to kidnap\", CrimeType.KIDNAP, 120e3, 3.6e6, 5, 6, {\n strength_exp: 80,\n defense_exp: 80,\n dexterity_exp: 80,\n agility_exp: 80,\n charisma_exp: 80,\n\n charisma_success_weight: 1,\n strength_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n intelligence_exp: 26 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Assassination: new Crime(\"Assassination\", \"to assassinate\", CrimeType.ASSASSINATION, 300e3, 12e6, 8, 10, {\n strength_exp: 300,\n defense_exp: 300,\n dexterity_exp: 300,\n agility_exp: 300,\n\n strength_success_weight: 1,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n\n intelligence_exp: 65 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n\n kills: 1,\n }),\n\n Heist: new Crime(\"Heist\", \"a heist\", CrimeType.HEIST, 600e3, 120e6, 18, 15, {\n hacking_exp: 450,\n strength_exp: 450,\n defense_exp: 450,\n dexterity_exp: 450,\n agility_exp: 450,\n charisma_exp: 450,\n\n hacking_success_weight: 1,\n strength_success_weight: 1,\n defense_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n charisma_success_weight: 1,\n\n intelligence_exp: 130 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n};\n","import { Person } from \"src/PersonObjects/Person\";\nimport { Player } from \"@player\";\n\nexport interface WorkStats {\n money: number;\n reputation: number;\n hackExp: number;\n strExp: number;\n defExp: number;\n dexExp: number;\n agiExp: number;\n chaExp: number;\n intExp: number;\n}\n\ninterface newWorkStatsParams {\n money?: number;\n reputation?: number;\n hackExp?: number;\n strExp?: number;\n defExp?: number;\n dexExp?: number;\n agiExp?: number;\n chaExp?: number;\n intExp?: number;\n}\n\nexport const newWorkStats = (params?: newWorkStatsParams): WorkStats => {\n return {\n money: params?.money ?? 0,\n reputation: params?.reputation ?? 0,\n hackExp: params?.hackExp ?? 0,\n strExp: params?.strExp ?? 0,\n defExp: params?.defExp ?? 0,\n dexExp: params?.dexExp ?? 0,\n agiExp: params?.agiExp ?? 0,\n chaExp: params?.chaExp ?? 0,\n intExp: params?.intExp ?? 0,\n };\n};\n\nexport const sumWorkStats = (w0: WorkStats, w1: WorkStats): WorkStats => {\n return {\n money: w0.money + w1.money,\n reputation: w0.reputation + w1.reputation,\n hackExp: w0.hackExp + w1.hackExp,\n strExp: w0.strExp + w1.strExp,\n defExp: w0.defExp + w1.defExp,\n dexExp: w0.dexExp + w1.dexExp,\n agiExp: w0.agiExp + w1.agiExp,\n chaExp: w0.chaExp + w1.chaExp,\n intExp: w0.intExp + w1.intExp,\n };\n};\n\nexport const scaleWorkStats = (w: WorkStats, n: number, scaleMoney = true): WorkStats => {\n const m = scaleMoney ? n : 1;\n return {\n money: w.money * m,\n reputation: w.reputation * n,\n hackExp: w.hackExp * n,\n strExp: w.strExp * n,\n defExp: w.defExp * n,\n dexExp: w.dexExp * n,\n agiExp: w.agiExp * n,\n chaExp: w.chaExp * n,\n intExp: w.intExp * n,\n };\n};\n\nexport const applyWorkStats = (target: Person, workStats: WorkStats, cycles: number, source: string): WorkStats => {\n const expStats = applyWorkStatsExp(target, workStats, cycles);\n const gains = {\n money: workStats.money * cycles,\n reputation: 0,\n hackExp: expStats.hackExp,\n strExp: expStats.strExp,\n defExp: expStats.defExp,\n dexExp: expStats.dexExp,\n agiExp: expStats.agiExp,\n chaExp: expStats.chaExp,\n intExp: expStats.intExp,\n };\n Player.gainMoney(gains.money, source);\n\n return gains;\n};\n\nexport const applyWorkStatsExp = (target: Person, workStats: WorkStats, cycles: number): WorkStats => {\n const gains = {\n money: 0,\n reputation: 0,\n hackExp: workStats.hackExp * cycles,\n strExp: workStats.strExp * cycles,\n defExp: workStats.defExp * cycles,\n dexExp: workStats.dexExp * cycles,\n agiExp: workStats.agiExp * cycles,\n chaExp: workStats.chaExp * cycles,\n intExp: workStats.intExp * cycles,\n };\n target.gainHackingExp(gains.hackExp);\n target.gainStrengthExp(gains.strExp);\n target.gainDefenseExp(gains.defExp);\n target.gainDexterityExp(gains.dexExp);\n target.gainAgilityExp(gains.agiExp);\n target.gainCharismaExp(gains.chaExp);\n target.gainIntelligenceExp(gains.intExp);\n return gains;\n};\n","import * as React from \"react\";\n\nexport function trusted(f: () => void): (event: React.MouseEvent<HTMLElement, MouseEvent>) => void {\n return function (event: React.MouseEvent<HTMLElement, MouseEvent>): void {\n if (!event.isTrusted) return;\n f();\n };\n}\n","/* Holds IP of Special Servers */\nexport const SpecialServers: {\n [key: string]: string | undefined;\n\n Home: string;\n FulcrumSecretTechnologies: string;\n CyberSecServer: string;\n NiteSecServer: string;\n TheBlackHandServer: string;\n BitRunnersServer: string;\n TheDarkArmyServer: string;\n DaedalusServer: string;\n WorldDaemon: string;\n DarkWeb: string;\n} = {\n Home: \"home\",\n FulcrumSecretTechnologies: \"fulcrumassets\",\n CyberSecServer: \"CSEC\",\n NiteSecServer: \"avmnite-02h\",\n TheBlackHandServer: \"I.I.I.I\",\n BitRunnersServer: \"run4theh111z\",\n TheDarkArmyServer: \".\",\n DaedalusServer: \"The-Cave\",\n WorldDaemon: \"w0r1d_d43m0n\",\n DarkWeb: \"darkweb\",\n};\n","import { PlayerObject } from \"./PlayerObject\";\nimport { applyAugmentation } from \"../../Augmentation/AugmentationHelpers\";\nimport { PlayerOwnedAugmentation } from \"../../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CodingContractRewardType, ICodingContractReward } from \"../../CodingContracts\";\nimport { Company } from \"../../Company/Company\";\nimport { Companies } from \"../../Company/Companies\";\nimport { getNextCompanyPositionHelper } from \"../../Company/GetNextCompanyPosition\";\nimport { getJobRequirementText } from \"../../Company/GetJobRequirementText\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport * as posNames from \"../../Company/data/companypositionnames\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Programs } from \"../../Programs/Programs\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { resetGangs } from \"../../Gang/AllGangs\";\nimport { Cities } from \"../../Locations/Cities\";\nimport { Locations } from \"../../Locations/Locations\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { Sleeve } from \"../Sleeve/Sleeve\";\nimport { isSleeveCompanyWork } from \"../Sleeve/Work/SleeveCompanyWork\";\nimport { calculateSkillProgress as calculateSkillProgressF, ISkillProgress } from \"../formulas/skill\";\nimport { GetServer, AddToAllServers, createUniqueRandomIp } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport { safelyCreateUniqueServer } from \"../../Server/ServerHelpers\";\n\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\nimport { applySourceFile } from \"../../SourceFile/applySourceFile\";\nimport { applyExploit } from \"../../Exploits/applyExploits\";\nimport { SourceFiles } from \"../../SourceFile/SourceFiles\";\nimport { getHospitalizationCost } from \"../../Hospital/Hospital\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { MoneySourceTracker } from \"../../utils/MoneySourceTracker\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { achievements } from \"../../Achievements/Achievements\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nimport { isCompanyWork } from \"../../Work/CompanyWork\";\nimport { serverMetadata } from \"../../Server/data/servers\";\n\nexport function init(this: PlayerObject): void {\n /* Initialize Player's home computer */\n const t_homeComp = safelyCreateUniqueServer({\n adminRights: true,\n hostname: \"home\",\n ip: createUniqueRandomIp(),\n isConnectedTo: true,\n maxRam: 8,\n organizationName: \"Home PC\",\n purchasedByPlayer: true,\n });\n this.currentServer = SpecialServers.Home;\n AddToAllServers(t_homeComp);\n\n this.getHomeComputer().programs.push(Programs.NukeProgram.name);\n}\n\nexport function prestigeAugmentation(this: PlayerObject): void {\n this.currentServer = SpecialServers.Home;\n\n this.numPeopleKilled = 0;\n\n //Reset stats\n this.skills.hacking = 1;\n\n this.skills.strength = 1;\n this.skills.defense = 1;\n this.skills.dexterity = 1;\n this.skills.agility = 1;\n\n this.skills.charisma = 1;\n\n this.exp.hacking = 0;\n this.exp.strength = 0;\n this.exp.defense = 0;\n this.exp.dexterity = 0;\n this.exp.agility = 0;\n this.exp.charisma = 0;\n\n this.money = 1000 + CONSTANTS.Donations;\n\n this.city = CityName.Sector12;\n this.location = LocationName.TravelAgency;\n\n this.jobs = {};\n\n this.purchasedServers = [];\n\n this.factions = [];\n this.factionInvitations = [];\n\n this.queuedAugmentations = [];\n\n const numSleeves = Math.min(3, this.sourceFileLvl(10) + (this.bitNodeN === 10 ? 1 : 0)) + this.sleevesFromCovenant;\n if (this.sleeves.length > numSleeves) this.sleeves.length = numSleeves;\n for (let i = this.sleeves.length; i < numSleeves; i++) {\n this.sleeves.push(new Sleeve());\n }\n\n this.sleeves.forEach((sleeve) => (sleeve.shock >= 100 ? sleeve.synchronize() : sleeve.shockRecovery()));\n\n this.lastUpdate = new Date().getTime();\n\n // Statistics Trackers\n this.playtimeSinceLastAug = 0;\n this.scriptProdSinceLastAug = 0;\n this.moneySourceA.reset();\n\n this.hacknetNodes.length = 0;\n this.hashManager.prestige();\n\n // Reapply augs, re-calculate skills and reset HP\n this.reapplyAllAugmentations(true);\n this.hp.current = this.hp.max;\n\n this.finishWork(true);\n}\n\nexport function prestigeSourceFile(this: PlayerObject): void {\n this.entropy = 0;\n this.prestigeAugmentation();\n this.karma = 0;\n // Duplicate sleeves are reset to level 1 every Bit Node (but the number of sleeves you have persists)\n this.sleeves.forEach((sleeve) => sleeve.prestige());\n\n if (this.bitNodeN === 10) {\n for (let i = 0; i < this.sleeves.length; i++) {\n this.sleeves[i].shock = Math.max(25, this.sleeves[i].shock);\n this.sleeves[i].sync = Math.max(25, this.sleeves[i].sync);\n }\n }\n\n // Gang\n this.gang = null;\n resetGangs();\n\n // Reset Stock market\n this.hasWseAccount = false;\n this.hasTixApiAccess = false;\n this.has4SData = false;\n this.has4SDataTixApi = false;\n\n // BitNode 3: Corporatocracy\n this.corporation = null;\n\n this.moneySourceB.reset();\n this.playtimeSinceLastBitnode = 0;\n this.augmentations = [];\n}\n\nexport function receiveInvite(this: PlayerObject, factionName: string): void {\n if (this.factionInvitations.includes(factionName) || this.factions.includes(factionName)) {\n return;\n }\n this.factionInvitations.push(factionName);\n}\n\n//Calculates skill level progress based on experience. The same formula will be used for every skill\nexport function calculateSkillProgress(this: PlayerObject, exp: number, mult = 1): ISkillProgress {\n return calculateSkillProgressF(exp, mult);\n}\n\nexport function hasProgram(this: PlayerObject, programName: string): boolean {\n const home = this.getHomeComputer();\n if (home == null) {\n return false;\n }\n\n for (let i = 0; i < home.programs.length; ++i) {\n if (programName.toLowerCase() == home.programs[i].toLowerCase()) {\n return true;\n }\n }\n return false;\n}\n\nexport function setMoney(this: PlayerObject, money: number): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.setMoney()\");\n return;\n }\n this.money = money;\n}\n\nexport function gainMoney(this: PlayerObject, money: number, source: string): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.gainMoney()\");\n return;\n }\n\n this.money = this.money + money;\n this.recordMoneySource(money, source);\n}\n\nexport function loseMoney(this: PlayerObject, money: number, source: string): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.loseMoney()\");\n return;\n }\n if (this.money === Infinity && money === Infinity) return;\n this.money = this.money - money;\n this.recordMoneySource(-1 * money, source);\n}\n\nexport function canAfford(this: PlayerObject, cost: number): boolean {\n if (isNaN(cost)) {\n console.error(`NaN passed into Player.canAfford()`);\n return false;\n }\n return this.money >= cost;\n}\n\nexport function recordMoneySource(this: PlayerObject, amt: number, source: string): void {\n if (!(this.moneySourceA instanceof MoneySourceTracker)) {\n console.warn(`Player.moneySourceA was not properly initialized. Resetting`);\n this.moneySourceA = new MoneySourceTracker();\n }\n if (!(this.moneySourceB instanceof MoneySourceTracker)) {\n console.warn(`Player.moneySourceB was not properly initialized. Resetting`);\n this.moneySourceB = new MoneySourceTracker();\n }\n this.moneySourceA.record(amt, source);\n this.moneySourceB.record(amt, source);\n}\n\nexport function startFocusing(this: PlayerObject): void {\n this.focus = true;\n}\n\nexport function stopFocusing(this: PlayerObject): void {\n this.focus = false;\n}\n\n// Returns true if hospitalized, false otherwise\nexport function takeDamage(this: PlayerObject, amt: number): boolean {\n if (typeof amt !== \"number\") {\n console.warn(`Player.takeDamage() called without a numeric argument: ${amt}`);\n return false;\n }\n\n this.hp.current -= amt;\n if (this.hp.current <= 0) {\n this.hospitalize();\n return true;\n } else {\n return false;\n }\n}\n\nexport function hospitalize(this: PlayerObject): number {\n const cost = getHospitalizationCost();\n SnackbarEvents.emit(`You've been Hospitalized for ${numeralWrapper.formatMoney(cost)}`, ToastVariant.SUCCESS, 2000);\n\n this.loseMoney(cost, \"hospitalization\");\n this.hp.current = this.hp.max;\n return cost;\n}\n\n/********* Company job application **********/\n//Determines the job that the Player should get (if any) at the current company\n//The 'sing' argument designates whether or not this is being called from\n//the applyToCompany() Netscript Singularity function\nexport function applyForJob(this: PlayerObject, entryPosType: CompanyPosition, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (!company) {\n console.error(`Could not find company that matches the location: ${this.location}. Player.applyToCompany() failed`);\n return false;\n }\n\n let pos = entryPosType;\n\n if (!this.isQualified(company, pos)) {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\\n\" + getJobRequirementText(company, pos));\n }\n return false;\n }\n\n if (!company.hasPosition(pos)) {\n console.error(`Company ${company.name} does not have position ${pos}. Player.applyToCompany() failed`);\n return false;\n }\n\n while (true) {\n const nextPos = getNextCompanyPositionHelper(pos);\n if (nextPos == null) break;\n if (company.hasPosition(nextPos) && this.isQualified(company, nextPos)) {\n pos = nextPos;\n } else break;\n }\n\n //Check if player already has the assigned job\n if (this.jobs[company.name] === pos.name) {\n if (!sing) {\n const nextPos = getNextCompanyPositionHelper(pos);\n if (nextPos == null || !company.hasPosition(nextPos)) {\n dialogBoxCreate(\"You are already at the highest position for your field! No promotion available\");\n } else {\n const reqText = getJobRequirementText(company, nextPos);\n dialogBoxCreate(\"Unfortunately, you do not qualify for a promotion\\n\" + reqText);\n }\n }\n return false;\n }\n\n this.jobs[company.name] = pos.name;\n\n if (!sing) {\n dialogBoxCreate(`Congratulations! You were offered a new job at ${company.name} for position ${pos.name}!`);\n }\n return true;\n}\n\n//Returns your next position at a company given the field (software, business, etc.)\nexport function getNextCompanyPosition(\n this: PlayerObject,\n company: Company,\n entryPosType: CompanyPosition,\n): CompanyPosition | null {\n const currCompany = Companies[company.name];\n\n //Not employed at this company, so return the entry position\n if (currCompany == null || currCompany.name != company.name) {\n return entryPosType;\n }\n\n //If the entry pos type and the player's current position have the same type,\n //return the player's \"nextCompanyPosition\". Otherwise return the entryposType\n //Employed at this company, so just return the next position if it exists.\n const currentPositionName = this.jobs[company.name];\n if (!currentPositionName) return entryPosType;\n const currentPosition = CompanyPositions[currentPositionName];\n if (\n (currentPosition.isSoftwareJob() && entryPosType.isSoftwareJob()) ||\n (currentPosition.isITJob() && entryPosType.isITJob()) ||\n (currentPosition.isBusinessJob() && entryPosType.isBusinessJob()) ||\n (currentPosition.isSecurityEngineerJob() && entryPosType.isSecurityEngineerJob()) ||\n (currentPosition.isNetworkEngineerJob() && entryPosType.isNetworkEngineerJob()) ||\n (currentPosition.isSecurityJob() && entryPosType.isSecurityJob()) ||\n (currentPosition.isAgentJob() && entryPosType.isAgentJob()) ||\n (currentPosition.isSoftwareConsultantJob() && entryPosType.isSoftwareConsultantJob()) ||\n (currentPosition.isBusinessConsultantJob() && entryPosType.isBusinessConsultantJob()) ||\n (currentPosition.isPartTimeJob() && entryPosType.isPartTimeJob())\n ) {\n return getNextCompanyPositionHelper(currentPosition);\n }\n\n return entryPosType;\n}\n\nexport function quitJob(this: PlayerObject, company: string): void {\n if (isCompanyWork(this.currentWork) && this.currentWork.companyName === company) {\n this.finishWork(true);\n }\n for (const sleeve of this.sleeves) {\n if (isSleeveCompanyWork(sleeve.currentWork) && sleeve.currentWork.companyName === company) {\n sleeve.stopWork();\n dialogBoxCreate(`You quit ${company} while one of your sleeves was working there. The sleeve is now idle.`);\n }\n }\n delete this.jobs[company];\n}\n\n/**\n * Method to see if the player has at least one job assigned to them\n * @param this The player instance\n * @returns Whether the user has at least one job\n */\nexport function hasJob(this: PlayerObject): boolean {\n return Boolean(Object.keys(this.jobs).length);\n}\n\nexport function applyForSoftwareJob(this: PlayerObject, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.SoftwareCompanyPositions[0]], sing);\n}\n\nexport function applyForSoftwareConsultantJob(this: PlayerObject, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.SoftwareConsultantCompanyPositions[0]], sing);\n}\n\nexport function applyForItJob(this: PlayerObject, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.ITCompanyPositions[0]], sing);\n}\n\nexport function applyForSecurityEngineerJob(this: PlayerObject, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.SecurityEngineerCompanyPositions[0]])) {\n return this.applyForJob(CompanyPositions[posNames.SecurityEngineerCompanyPositions[0]], sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForNetworkEngineerJob(this: PlayerObject, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.NetworkEngineerCompanyPositions[0]])) {\n const pos = CompanyPositions[posNames.NetworkEngineerCompanyPositions[0]];\n return this.applyForJob(pos, sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForBusinessJob(this: PlayerObject, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.BusinessCompanyPositions[0]], sing);\n}\n\nexport function applyForBusinessConsultantJob(this: PlayerObject, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.BusinessConsultantCompanyPositions[0]], sing);\n}\n\nexport function applyForSecurityJob(this: PlayerObject, sing = false): boolean {\n // TODO Police Jobs\n // Indexing starts at 2 because 0 is for police officer\n return this.applyForJob(CompanyPositions[posNames.SecurityCompanyPositions[2]], sing);\n}\n\nexport function applyForAgentJob(this: PlayerObject, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.AgentCompanyPositions[0]])) {\n const pos = CompanyPositions[posNames.AgentCompanyPositions[0]];\n return this.applyForJob(pos, sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForEmployeeJob(this: PlayerObject, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.MiscCompanyPositions[1];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed at \" + this.location);\n }\n\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n\n return false;\n }\n}\n\nexport function applyForPartTimeEmployeeJob(this: PlayerObject, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.PartTimeCompanyPositions[1];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed part-time at \" + this.location);\n }\n\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n\n return false;\n }\n}\n\nexport function applyForWaiterJob(this: PlayerObject, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.MiscCompanyPositions[0];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed as a waiter at \" + this.location);\n }\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForPartTimeWaiterJob(this: PlayerObject, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.PartTimeCompanyPositions[0];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed as a part-time waiter at \" + this.location);\n }\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\n//Checks if the Player is qualified for a certain position\nexport function isQualified(this: PlayerObject, company: Company, position: CompanyPosition): boolean {\n const offset = company.jobStatReqOffset;\n const reqHacking = position.requiredHacking > 0 ? position.requiredHacking + offset : 0;\n const reqStrength = position.requiredStrength > 0 ? position.requiredStrength + offset : 0;\n const reqDefense = position.requiredDefense > 0 ? position.requiredDefense + offset : 0;\n const reqDexterity = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;\n const reqAgility = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;\n const reqCharisma = position.requiredCharisma > 0 ? position.requiredCharisma + offset : 0;\n\n return (\n this.skills.hacking >= reqHacking &&\n this.skills.strength >= reqStrength &&\n this.skills.defense >= reqDefense &&\n this.skills.dexterity >= reqDexterity &&\n this.skills.agility >= reqAgility &&\n this.skills.charisma >= reqCharisma &&\n company.playerReputation >= position.requiredReputation\n );\n}\n\n/********** Reapplying Augmentations and Source File ***********/\nexport function reapplyAllAugmentations(this: PlayerObject, resetMultipliers = true): void {\n if (resetMultipliers) {\n this.resetMultipliers();\n }\n\n for (let i = 0; i < this.augmentations.length; ++i) {\n //Compatibility with new version\n if (this.augmentations[i].name === \"HacknetNode NIC Architecture Neural-Upload\") {\n this.augmentations[i].name = \"Hacknet Node NIC Architecture Neural-Upload\";\n }\n\n const playerAug = this.augmentations[i];\n const augName = playerAug.name;\n\n if (augName == AugmentationNames.NeuroFluxGovernor) {\n for (let j = 0; j < playerAug.level; ++j) {\n applyAugmentation(this.augmentations[i], true);\n }\n continue;\n }\n applyAugmentation(this.augmentations[i], true);\n }\n\n this.updateSkillLevels();\n}\n\nexport function reapplyAllSourceFiles(this: PlayerObject): void {\n //Will always be called after reapplyAllAugmentations() so multipliers do not have to be reset\n //this.resetMultipliers();\n\n for (let i = 0; i < this.sourceFiles.length; ++i) {\n const srcFileKey = \"SourceFile\" + this.sourceFiles[i].n;\n const sourceFileObject = SourceFiles[srcFileKey];\n if (sourceFileObject == null) {\n console.error(`Invalid source file number: ${this.sourceFiles[i].n}`);\n continue;\n }\n applySourceFile(this.sourceFiles[i]);\n }\n applyExploit();\n this.updateSkillLevels();\n}\n\n/*************** Check for Faction Invitations *************/\n//This function sets the requirements to join a Faction. It checks whether the Player meets\n//those requirements and will return an array of all factions that the Player should\n//receive an invitation to\nexport function checkForFactionInvitations(this: PlayerObject): Faction[] {\n const invitedFactions: Faction[] = []; //Array which will hold all Factions the player should be invited to\n\n const numAugmentations = this.augmentations.length;\n\n const allCompanies = Object.keys(this.jobs);\n const allPositions = Object.values(this.jobs);\n\n // Given a company name, safely returns the reputation (returns 0 if invalid company is specified)\n function getCompanyRep(companyName: string): number {\n const company = Companies[companyName];\n if (company == null) {\n return 0;\n } else {\n return company.playerReputation;\n }\n }\n\n // Helper function that returns a boolean indicating whether the Player meets\n // the requirements for the specified company. There are two requirements:\n // 1. High enough reputation\n // 2. Player is employed at the company\n function checkMegacorpRequirements(companyName: string): boolean {\n const serverMeta = serverMetadata.find((s) => s.specialName === companyName);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n const bonus = (server as Server).backdoorInstalled ? -100e3 : 0;\n return (\n allCompanies.includes(companyName) && getCompanyRep(companyName) > CONSTANTS.CorpFactionRepRequirement + bonus\n );\n }\n\n //Illuminati\n const illuminatiFac = Factions[FactionNames.Illuminati];\n if (\n !illuminatiFac.isBanned &&\n !illuminatiFac.isMember &&\n !illuminatiFac.alreadyInvited &&\n numAugmentations >= 30 &&\n this.money >= 150000000000 &&\n this.skills.hacking >= 1500 &&\n this.skills.strength >= 1200 &&\n this.skills.defense >= 1200 &&\n this.skills.dexterity >= 1200 &&\n this.skills.agility >= 1200\n ) {\n invitedFactions.push(illuminatiFac);\n }\n\n //Daedalus\n const daedalusFac = Factions[FactionNames.Daedalus];\n if (\n !daedalusFac.isBanned &&\n !daedalusFac.isMember &&\n !daedalusFac.alreadyInvited &&\n numAugmentations >= BitNodeMultipliers.DaedalusAugsRequirement &&\n this.money >= 100000000000 &&\n (this.skills.hacking >= 2500 ||\n (this.skills.strength >= 1500 &&\n this.skills.defense >= 1500 &&\n this.skills.dexterity >= 1500 &&\n this.skills.agility >= 1500))\n ) {\n invitedFactions.push(daedalusFac);\n }\n\n //The Covenant\n const covenantFac = Factions[FactionNames.TheCovenant];\n if (\n !covenantFac.isBanned &&\n !covenantFac.isMember &&\n !covenantFac.alreadyInvited &&\n numAugmentations >= 20 &&\n this.money >= 75000000000 &&\n this.skills.hacking >= 850 &&\n this.skills.strength >= 850 &&\n this.skills.defense >= 850 &&\n this.skills.dexterity >= 850 &&\n this.skills.agility >= 850\n ) {\n invitedFactions.push(covenantFac);\n }\n\n //ECorp\n const ecorpFac = Factions[FactionNames.ECorp];\n if (\n !ecorpFac.isBanned &&\n !ecorpFac.isMember &&\n !ecorpFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumECorp)\n ) {\n invitedFactions.push(ecorpFac);\n }\n\n //MegaCorp\n const megacorpFac = Factions[FactionNames.MegaCorp];\n if (\n !megacorpFac.isBanned &&\n !megacorpFac.isMember &&\n !megacorpFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12MegaCorp)\n ) {\n invitedFactions.push(megacorpFac);\n }\n\n //Bachman & Associates\n const bachmanandassociatesFac = Factions[FactionNames.BachmanAssociates];\n if (\n !bachmanandassociatesFac.isBanned &&\n !bachmanandassociatesFac.isMember &&\n !bachmanandassociatesFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumBachmanAndAssociates)\n ) {\n invitedFactions.push(bachmanandassociatesFac);\n }\n\n //Blade Industries\n const bladeindustriesFac = Factions[FactionNames.BladeIndustries];\n if (\n !bladeindustriesFac.isBanned &&\n !bladeindustriesFac.isMember &&\n !bladeindustriesFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12BladeIndustries)\n ) {\n invitedFactions.push(bladeindustriesFac);\n }\n\n //NWO\n const nwoFac = Factions[FactionNames.NWO];\n if (\n !nwoFac.isBanned &&\n !nwoFac.isMember &&\n !nwoFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.VolhavenNWO)\n ) {\n invitedFactions.push(nwoFac);\n }\n\n //Clarke Incorporated\n const clarkeincorporatedFac = Factions[FactionNames.ClarkeIncorporated];\n if (\n !clarkeincorporatedFac.isBanned &&\n !clarkeincorporatedFac.isMember &&\n !clarkeincorporatedFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumClarkeIncorporated)\n ) {\n invitedFactions.push(clarkeincorporatedFac);\n }\n\n //OmniTek Incorporated\n const omnitekincorporatedFac = Factions[FactionNames.OmniTekIncorporated];\n if (\n !omnitekincorporatedFac.isBanned &&\n !omnitekincorporatedFac.isMember &&\n !omnitekincorporatedFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.VolhavenOmniTekIncorporated)\n ) {\n invitedFactions.push(omnitekincorporatedFac);\n }\n\n //Four Sigma\n const foursigmaFac = Factions[FactionNames.FourSigma];\n if (\n !foursigmaFac.isBanned &&\n !foursigmaFac.isMember &&\n !foursigmaFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12FourSigma)\n ) {\n invitedFactions.push(foursigmaFac);\n }\n\n //KuaiGong International\n const kuaigonginternationalFac = Factions[FactionNames.KuaiGongInternational];\n if (\n !kuaigonginternationalFac.isBanned &&\n !kuaigonginternationalFac.isMember &&\n !kuaigonginternationalFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.ChongqingKuaiGongInternational)\n ) {\n invitedFactions.push(kuaigonginternationalFac);\n }\n\n //Fulcrum Secret Technologies - If you've unlocked fulcrum secret technologies server and have a high rep with the company\n const fulcrumsecrettechonologiesFac = Factions[FactionNames.FulcrumSecretTechnologies];\n const fulcrumSecretServer = GetServer(SpecialServers.FulcrumSecretTechnologies);\n if (!(fulcrumSecretServer instanceof Server))\n throw new Error(`${FactionNames.FulcrumSecretTechnologies} should be normal server`);\n if (fulcrumSecretServer == null) {\n console.error(`Could not find ${FactionNames.FulcrumSecretTechnologies} Server`);\n } else if (\n !fulcrumsecrettechonologiesFac.isBanned &&\n !fulcrumsecrettechonologiesFac.isMember &&\n !fulcrumsecrettechonologiesFac.alreadyInvited &&\n fulcrumSecretServer.backdoorInstalled &&\n checkMegacorpRequirements(LocationName.AevumFulcrumTechnologies)\n ) {\n invitedFactions.push(fulcrumsecrettechonologiesFac);\n }\n\n //BitRunners\n const bitrunnersFac = Factions[FactionNames.BitRunners];\n const bitrunnersServer = GetServer(SpecialServers.BitRunnersServer);\n if (!(bitrunnersServer instanceof Server)) throw new Error(`${FactionNames.BitRunners} should be normal server`);\n if (bitrunnersServer == null) {\n console.error(`Could not find ${FactionNames.BitRunners} Server`);\n } else if (\n !bitrunnersFac.isBanned &&\n !bitrunnersFac.isMember &&\n bitrunnersServer.backdoorInstalled &&\n !bitrunnersFac.alreadyInvited\n ) {\n invitedFactions.push(bitrunnersFac);\n }\n\n //The Black Hand\n\n const theblackhandFac = Factions[FactionNames.TheBlackHand];\n const blackhandServer = GetServer(SpecialServers.TheBlackHandServer);\n if (!(blackhandServer instanceof Server)) throw new Error(`${FactionNames.TheBlackHand} should be normal server`);\n if (blackhandServer == null) {\n console.error(`Could not find ${FactionNames.TheBlackHand} Server`);\n } else if (\n !theblackhandFac.isBanned &&\n !theblackhandFac.isMember &&\n blackhandServer.backdoorInstalled &&\n !theblackhandFac.alreadyInvited\n ) {\n invitedFactions.push(theblackhandFac);\n }\n\n //NiteSec\n const nitesecFac = Factions[FactionNames.NiteSec];\n const nitesecServer = GetServer(SpecialServers.NiteSecServer);\n if (!(nitesecServer instanceof Server)) throw new Error(`${FactionNames.NiteSec} should be normal server`);\n if (nitesecServer == null) {\n console.error(`Could not find ${FactionNames.NiteSec} Server`);\n } else if (\n !nitesecFac.isBanned &&\n !nitesecFac.isMember &&\n nitesecServer.backdoorInstalled &&\n !nitesecFac.alreadyInvited\n ) {\n invitedFactions.push(nitesecFac);\n }\n\n //Chongqing\n const chongqingFac = Factions[FactionNames.Chongqing];\n if (\n !chongqingFac.isBanned &&\n !chongqingFac.isMember &&\n !chongqingFac.alreadyInvited &&\n this.money >= 20000000 &&\n this.city == CityName.Chongqing\n ) {\n invitedFactions.push(chongqingFac);\n }\n\n //Sector-12\n const sector12Fac = Factions[FactionNames.Sector12];\n if (\n !sector12Fac.isBanned &&\n !sector12Fac.isMember &&\n !sector12Fac.alreadyInvited &&\n this.money >= 15000000 &&\n this.city == CityName.Sector12\n ) {\n invitedFactions.push(sector12Fac);\n }\n\n //New Tokyo\n const newtokyoFac = Factions[FactionNames.NewTokyo];\n if (\n !newtokyoFac.isBanned &&\n !newtokyoFac.isMember &&\n !newtokyoFac.alreadyInvited &&\n this.money >= 20000000 &&\n this.city == CityName.NewTokyo\n ) {\n invitedFactions.push(newtokyoFac);\n }\n\n //Aevum\n const aevumFac = Factions[FactionNames.Aevum];\n if (\n !aevumFac.isBanned &&\n !aevumFac.isMember &&\n !aevumFac.alreadyInvited &&\n this.money >= 40000000 &&\n this.city == CityName.Aevum\n ) {\n invitedFactions.push(aevumFac);\n }\n\n //Ishima\n const ishimaFac = Factions[FactionNames.Ishima];\n if (\n !ishimaFac.isBanned &&\n !ishimaFac.isMember &&\n !ishimaFac.alreadyInvited &&\n this.money >= 30000000 &&\n this.city == CityName.Ishima\n ) {\n invitedFactions.push(ishimaFac);\n }\n\n //Volhaven\n const volhavenFac = Factions[FactionNames.Volhaven];\n if (\n !volhavenFac.isBanned &&\n !volhavenFac.isMember &&\n !volhavenFac.alreadyInvited &&\n this.money >= 50000000 &&\n this.city == CityName.Volhaven\n ) {\n invitedFactions.push(volhavenFac);\n }\n\n //Speakers for the Dead\n const speakersforthedeadFac = Factions[FactionNames.SpeakersForTheDead];\n if (\n !speakersforthedeadFac.isBanned &&\n !speakersforthedeadFac.isMember &&\n !speakersforthedeadFac.alreadyInvited &&\n this.skills.hacking >= 100 &&\n this.skills.strength >= 300 &&\n this.skills.defense >= 300 &&\n this.skills.dexterity >= 300 &&\n this.skills.agility >= 300 &&\n this.numPeopleKilled >= 30 &&\n this.karma <= -45 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(speakersforthedeadFac);\n }\n\n //The Dark Army\n const thedarkarmyFac = Factions[FactionNames.TheDarkArmy];\n if (\n !thedarkarmyFac.isBanned &&\n !thedarkarmyFac.isMember &&\n !thedarkarmyFac.alreadyInvited &&\n this.skills.hacking >= 300 &&\n this.skills.strength >= 300 &&\n this.skills.defense >= 300 &&\n this.skills.dexterity >= 300 &&\n this.skills.agility >= 300 &&\n this.city == CityName.Chongqing &&\n this.numPeopleKilled >= 5 &&\n this.karma <= -45 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(thedarkarmyFac);\n }\n\n //The Syndicate\n const thesyndicateFac = Factions[FactionNames.TheSyndicate];\n if (\n !thesyndicateFac.isBanned &&\n !thesyndicateFac.isMember &&\n !thesyndicateFac.alreadyInvited &&\n this.skills.hacking >= 200 &&\n this.skills.strength >= 200 &&\n this.skills.defense >= 200 &&\n this.skills.dexterity >= 200 &&\n this.skills.agility >= 200 &&\n (this.city == CityName.Aevum || this.city == CityName.Sector12) &&\n this.money >= 10000000 &&\n this.karma <= -90 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(thesyndicateFac);\n }\n\n //Silhouette\n const silhouetteFac = Factions[FactionNames.Silhouette];\n if (\n !silhouetteFac.isBanned &&\n !silhouetteFac.isMember &&\n !silhouetteFac.alreadyInvited &&\n (allPositions.includes(\"Chief Technology Officer\") ||\n allPositions.includes(\"Chief Financial Officer\") ||\n allPositions.includes(\"Chief Executive Officer\")) &&\n this.money >= 15000000 &&\n this.karma <= -22\n ) {\n invitedFactions.push(silhouetteFac);\n }\n\n //Tetrads\n const tetradsFac = Factions[FactionNames.Tetrads];\n if (\n !tetradsFac.isBanned &&\n !tetradsFac.isMember &&\n !tetradsFac.alreadyInvited &&\n (this.city == CityName.Chongqing || this.city == CityName.NewTokyo || this.city == CityName.Ishima) &&\n this.skills.strength >= 75 &&\n this.skills.defense >= 75 &&\n this.skills.dexterity >= 75 &&\n this.skills.agility >= 75 &&\n this.karma <= -18\n ) {\n invitedFactions.push(tetradsFac);\n }\n\n //SlumSnakes\n const slumsnakesFac = Factions[FactionNames.SlumSnakes];\n if (\n !slumsnakesFac.isBanned &&\n !slumsnakesFac.isMember &&\n !slumsnakesFac.alreadyInvited &&\n this.skills.strength >= 30 &&\n this.skills.defense >= 30 &&\n this.skills.dexterity >= 30 &&\n this.skills.agility >= 30 &&\n this.karma <= -9 &&\n this.money >= 1000000\n ) {\n invitedFactions.push(slumsnakesFac);\n }\n\n //Netburners\n const netburnersFac = Factions[FactionNames.Netburners];\n let totalHacknetRam = 0;\n let totalHacknetCores = 0;\n let totalHacknetLevels = 0;\n for (let i = 0; i < this.hacknetNodes.length; ++i) {\n const v = this.hacknetNodes[i];\n if (typeof v === \"string\") {\n const hserver = GetServer(v);\n if (hserver === null || !(hserver instanceof HacknetServer))\n throw new Error(\"player hacknet server was not HacknetServer\");\n totalHacknetLevels += hserver.level;\n totalHacknetRam += hserver.maxRam;\n totalHacknetCores += hserver.cores;\n } else {\n totalHacknetLevels += v.level;\n totalHacknetRam += v.ram;\n totalHacknetCores += v.cores;\n }\n }\n if (\n !netburnersFac.isBanned &&\n !netburnersFac.isMember &&\n !netburnersFac.alreadyInvited &&\n this.skills.hacking >= 80 &&\n totalHacknetRam >= 8 &&\n totalHacknetCores >= 4 &&\n totalHacknetLevels >= 100\n ) {\n invitedFactions.push(netburnersFac);\n }\n\n //Tian Di Hui\n const tiandihuiFac = Factions[FactionNames.TianDiHui];\n if (\n !tiandihuiFac.isBanned &&\n !tiandihuiFac.isMember &&\n !tiandihuiFac.alreadyInvited &&\n this.money >= 1000000 &&\n this.skills.hacking >= 50 &&\n (this.city == CityName.Chongqing || this.city == CityName.NewTokyo || this.city == CityName.Ishima)\n ) {\n invitedFactions.push(tiandihuiFac);\n }\n\n //CyberSec\n const cybersecFac = Factions[FactionNames.CyberSec];\n const cybersecServer = GetServer(SpecialServers.CyberSecServer);\n if (!(cybersecServer instanceof Server)) throw new Error(`${FactionNames.CyberSec} should be normal server`);\n if (cybersecServer == null) {\n console.error(`Could not find ${FactionNames.CyberSec} Server`);\n } else if (\n !cybersecFac.isBanned &&\n !cybersecFac.isMember &&\n cybersecServer.backdoorInstalled &&\n !cybersecFac.alreadyInvited\n ) {\n invitedFactions.push(cybersecFac);\n }\n\n return invitedFactions;\n}\n\n/************* BitNodes **************/\nexport function setBitNodeNumber(this: PlayerObject, n: number): void {\n this.bitNodeN = n;\n}\n\nexport function queueAugmentation(this: PlayerObject, name: string): void {\n for (const aug of this.queuedAugmentations) {\n if (aug.name == name) {\n console.warn(`tried to queue ${name} twice, this may be a bug`);\n return;\n }\n }\n\n for (const aug of this.augmentations) {\n if (aug.name == name) {\n console.warn(`tried to queue ${name} twice, this may be a bug`);\n return;\n }\n }\n\n this.queuedAugmentations.push(new PlayerOwnedAugmentation(name));\n}\n\n/************* Coding Contracts **************/\nexport function gainCodingContractReward(\n this: PlayerObject,\n reward: ICodingContractReward | null,\n difficulty = 1,\n): string {\n if (reward == null || reward.type == null) {\n return `No reward for this contract`;\n }\n\n /* eslint-disable no-case-declarations */\n switch (reward.type) {\n case CodingContractRewardType.FactionReputation:\n if (reward.name == null || !Factions[reward.name]) {\n // If no/invalid faction was designated, just give rewards to all factions\n reward.type = CodingContractRewardType.FactionReputationAll;\n return this.gainCodingContractReward(reward);\n }\n const repGain = CONSTANTS.CodingContractBaseFactionRepGain * difficulty;\n Factions[reward.name].playerReputation += repGain;\n return `Gained ${repGain} faction reputation for ${reward.name}`;\n case CodingContractRewardType.FactionReputationAll:\n const totalGain = CONSTANTS.CodingContractBaseFactionRepGain * difficulty;\n\n // Ignore Bladeburners and other special factions for this calculation\n const specialFactions = [FactionNames.Bladeburners as string];\n const factions = this.factions.slice().filter((f) => {\n return !specialFactions.includes(f);\n });\n\n // If the player was only part of the special factions, we'll just give money\n if (factions.length == 0) {\n reward.type = CodingContractRewardType.Money;\n return this.gainCodingContractReward(reward, difficulty);\n }\n\n const gainPerFaction = Math.floor(totalGain / factions.length);\n for (const facName of factions) {\n if (!Factions[facName]) continue;\n Factions[facName].playerReputation += gainPerFaction;\n }\n return `Gained ${gainPerFaction} reputation for each of the following factions: ${factions.join(\", \")}`;\n case CodingContractRewardType.CompanyReputation: {\n if (reward.name == null || !Companies[reward.name]) {\n //If no/invalid company was designated, just give rewards to all factions\n reward.type = CodingContractRewardType.FactionReputationAll;\n return this.gainCodingContractReward(reward);\n }\n const repGain = CONSTANTS.CodingContractBaseCompanyRepGain * difficulty;\n Companies[reward.name].playerReputation += repGain;\n return `Gained ${repGain} company reputation for ${reward.name}`;\n }\n case CodingContractRewardType.Money:\n default: {\n const moneyGain = CONSTANTS.CodingContractBaseMoneyGain * difficulty * BitNodeMultipliers.CodingContractMoney;\n this.gainMoney(moneyGain, \"codingcontract\");\n return `Gained ${numeralWrapper.formatMoney(moneyGain)}`;\n }\n }\n /* eslint-enable no-case-declarations */\n}\n\nexport function travel(this: PlayerObject, to: CityName): boolean {\n if (Cities[to] == null) {\n console.warn(`Player.travel() called with invalid city: ${to}`);\n return false;\n }\n this.city = to;\n\n return true;\n}\n\nexport function gotoLocation(this: PlayerObject, to: LocationName): boolean {\n if (Locations[to] == null) {\n console.warn(`Player.gotoLocation() called with invalid location: ${to}`);\n return false;\n }\n this.location = to;\n\n return true;\n}\n\nexport function canAccessGrafting(this: PlayerObject): boolean {\n return this.bitNodeN === 10 || this.sourceFileLvl(10) > 0;\n}\n\nexport function giveExploit(this: PlayerObject, exploit: Exploit): void {\n if (!this.exploits.includes(exploit)) {\n this.exploits.push(exploit);\n SnackbarEvents.emit(\"SF -1 acquired!\", ToastVariant.SUCCESS, 2000);\n }\n}\n\nexport function giveAchievement(this: PlayerObject, achievementId: string): void {\n const achievement = achievements[achievementId];\n if (!achievement) return;\n if (!this.achievements.map((a) => a.ID).includes(achievementId)) {\n this.achievements.push({ ID: achievementId, unlockedOn: new Date().getTime() });\n SnackbarEvents.emit(`Unlocked Achievement: \"${achievement.Name}\"`, ToastVariant.SUCCESS, 2000);\n }\n}\n\nexport function getCasinoWinnings(this: PlayerObject): number {\n return this.moneySourceA.casino;\n}\n\nexport function canAccessCotMG(this: PlayerObject): boolean {\n return this.bitNodeN === 13 || this.sourceFileLvl(13) > 0;\n}\n\nexport function sourceFileLvl(this: PlayerObject, n: number): number {\n const sf = this.sourceFiles.find((sf) => sf.n === n);\n if (!sf) return 0;\n return sf.lvl;\n}\n\nexport function focusPenalty(this: PlayerObject): number {\n let focus = 1;\n if (!this.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {\n focus = this.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n return focus;\n}\n","import { CONSTANTS } from \"../Constants\";\n\nimport { IHacknetNode } from \"./IHacknetNode\";\n\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { HacknetServerConstants } from \"./data/Constants\";\nimport {\n calculateHashGainRate,\n calculateLevelUpgradeCost,\n calculateRamUpgradeCost,\n calculateCoreUpgradeCost,\n calculateCacheUpgradeCost,\n} from \"./formulas/HacknetServers\";\n\nimport { createRandomIp } from \"../utils/IPAddress\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { Player } from \"@player\";\n\ninterface IConstructorParams {\n adminRights?: boolean;\n hostname: string;\n ip?: string;\n isConnectedTo?: boolean;\n maxRam?: number;\n organizationName?: string;\n}\n\n/** Hacknet Servers - Reworked Hacknet Node mechanic for BitNode-9 */\nexport class HacknetServer extends BaseServer implements IHacknetNode {\n // Cache level. Affects hash Capacity\n cache = 1;\n\n // Number of cores. Improves hash production\n cores = 1;\n\n // Number of hashes that can be stored by this Hacknet Server\n hashCapacity = 0;\n\n // Hashes produced per second\n hashRate = 0;\n\n // Similar to Node level. Improves hash production\n level = 1;\n\n // How long this HacknetServer has existed, in seconds\n onlineTimeSeconds = 0;\n\n // Total number of hashes earned by this server\n totalHashesGenerated = 0;\n\n // Flag indicating whether this is a purchased server\n purchasedByPlayer = true;\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n super(params);\n\n this.maxRam = 1;\n this.updateHashCapacity();\n }\n\n calculateCacheUpgradeCost(levels: number): number {\n return calculateCacheUpgradeCost(this.cache, levels);\n }\n\n calculateCoreUpgradeCost(levels: number, costMult: number): number {\n return calculateCoreUpgradeCost(this.cores, levels, costMult);\n }\n\n calculateLevelUpgradeCost(levels: number, costMult: number): number {\n return calculateLevelUpgradeCost(this.level, levels, costMult);\n }\n\n calculateRamUpgradeCost(levels: number, costMult: number): number {\n return calculateRamUpgradeCost(this.maxRam, levels, costMult);\n }\n\n // Process this Hacknet Server in the game loop. Returns the number of hashes generated\n process(numCycles = 1): number {\n const seconds = (numCycles * CONSTANTS.MilliPerCycle) / 1000;\n this.onlineTimeSeconds += seconds;\n\n const hashes = this.hashRate * seconds;\n this.totalHashesGenerated += hashes;\n\n return hashes;\n }\n\n upgradeCache(levels: number): void {\n this.cache = Math.min(HacknetServerConstants.MaxCache, Math.round(this.cache + levels));\n this.updateHashCapacity();\n }\n\n upgradeCore(levels: number, prodMult: number): void {\n this.cores = Math.min(HacknetServerConstants.MaxCores, Math.round(this.cores + levels));\n this.updateHashRate(prodMult);\n this.cpuCores = this.cores;\n }\n\n upgradeLevel(levels: number, prodMult: number): void {\n this.level = Math.min(HacknetServerConstants.MaxLevel, Math.round(this.level + levels));\n this.updateHashRate(prodMult);\n }\n\n upgradeRam(levels: number, prodMult: number): boolean {\n for (let i = 0; i < levels; ++i) {\n this.maxRam *= 2;\n }\n this.maxRam = Math.min(HacknetServerConstants.MaxRam, Math.round(this.maxRam));\n this.updateHashRate(prodMult);\n\n return true;\n }\n\n // Whenever a script is run, we must update this server's hash rate\n runScript(script: RunningScript, prodMult?: number): void {\n super.runScript(script);\n if (prodMult != null && typeof prodMult === \"number\") {\n this.updateHashRate(prodMult);\n }\n }\n\n updateRamUsed(ram: number): void {\n super.updateRamUsed(ram);\n this.updateHashRate(Player.mults.hacknet_node_money);\n }\n\n updateHashCapacity(): void {\n this.hashCapacity = 32 * Math.pow(2, this.cache);\n }\n\n updateHashRate(prodMult: number): void {\n this.hashRate = calculateHashGainRate(this.level, this.ramUsed, this.maxRam, this.cores, prodMult);\n\n if (isNaN(this.hashRate)) {\n this.hashRate = 0;\n console.error(\n `Error calculating Hacknet Server hash production. This is a bug. Please report to game dev`,\n false,\n );\n }\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): IReviverValue {\n return Generic_toJSON(\"HacknetServer\", this);\n }\n\n // Initializes a HacknetServer Object from a JSON save state\n static fromJSON(value: IReviverValue): HacknetServer {\n return Generic_fromJSON(HacknetServer, value.data);\n }\n}\n\nReviver.constructors.HacknetServer = HacknetServer;\n","export const validScriptExtensions: Array<string> = [`.js`, `.script`];\n\nexport function isScriptFilename(f: string): boolean {\n return validScriptExtensions.some((ext) => f.endsWith(ext));\n}\n","import { IOrderBook } from \"./IOrderBook\";\nimport { IStockMarket } from \"./IStockMarket\";\nimport { Order } from \"./Order\";\nimport { processOrders } from \"./OrderProcessing\";\nimport { Stock } from \"./Stock\";\nimport { TicksPerCycle } from \"./StockMarketConstants\";\nimport { InitStockMetadata } from \"./data/InitStockMetadata\";\nimport { OrderTypes } from \"./data/OrderTypes\";\nimport { PositionTypes } from \"./data/PositionTypes\";\nimport { StockSymbols } from \"./data/StockSymbols\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver } from \"../utils/JSONReviver\";\nimport { NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport let StockMarket: IStockMarket = {\n lastUpdate: 0,\n Orders: {},\n storedCycles: 0,\n ticksUntilCycle: 0,\n} as IStockMarket; // Maps full stock name -> Stock object\nexport const SymbolToStockMap: Record<string, Stock> = {}; // Maps symbol -> Stock object\n\nexport function placeOrder(\n stock: Stock,\n shares: number,\n price: number,\n type: OrderTypes,\n position: PositionTypes,\n ctx?: NetscriptContext,\n): boolean {\n if (!(stock instanceof Stock)) {\n if (ctx) {\n helpers.log(ctx, () => `Invalid stock: '${stock}'`);\n } else {\n dialogBoxCreate(`ERROR: Invalid stock passed to placeOrder() function`);\n }\n return false;\n }\n if (typeof shares !== \"number\" || typeof price !== \"number\") {\n if (ctx) {\n helpers.log(ctx, () => `Invalid arguments: shares='${shares}' price='${price}'`);\n } else {\n dialogBoxCreate(\"ERROR: Invalid numeric value provided for either 'shares' or 'price' argument\");\n }\n return false;\n }\n\n const order = new Order(stock.symbol, shares, price, type, position);\n if (StockMarket[\"Orders\"] == null) {\n const orders: IOrderBook = {};\n for (const name of Object.keys(StockMarket)) {\n const stk = StockMarket[name];\n if (!(stk instanceof Stock)) {\n continue;\n }\n orders[stk.symbol] = [];\n }\n StockMarket[\"Orders\"] = orders;\n }\n StockMarket[\"Orders\"][stock.symbol].push(order);\n\n // Process to see if it should be executed immediately\n const processOrderRefs = {\n stockMarket: StockMarket,\n symbolToStockMap: SymbolToStockMap,\n };\n processOrders(stock, order.type, order.pos, processOrderRefs);\n\n return true;\n}\n\n// Returns true if successfully cancels an order, false otherwise\nexport interface ICancelOrderParams {\n order?: Order;\n pos?: PositionTypes;\n price?: number;\n shares?: number;\n stock?: Stock;\n type?: OrderTypes;\n}\nexport function cancelOrder(params: ICancelOrderParams, ctx?: NetscriptContext): boolean {\n if (StockMarket[\"Orders\"] == null) return false;\n if (params.order && params.order instanceof Order) {\n const order = params.order;\n // An 'Order' object is passed in\n const stockOrders = StockMarket[\"Orders\"][order.stockSymbol];\n for (let i = 0; i < stockOrders.length; ++i) {\n if (order == stockOrders[i]) {\n stockOrders.splice(i, 1);\n return true;\n }\n }\n return false;\n } else if (\n params.stock &&\n params.shares &&\n params.price &&\n params.type &&\n params.pos &&\n params.stock instanceof Stock\n ) {\n // Order properties are passed in. Need to look for the order\n const stockOrders = StockMarket[\"Orders\"][params.stock.symbol];\n const orderTxt = params.stock.symbol + \" - \" + params.shares + \" @ \" + numeralWrapper.formatMoney(params.price);\n for (let i = 0; i < stockOrders.length; ++i) {\n const order = stockOrders[i];\n if (\n params.shares === order.shares &&\n params.price === order.price &&\n params.type === order.type &&\n params.pos === order.pos\n ) {\n stockOrders.splice(i, 1);\n if (ctx) helpers.log(ctx, () => \"Successfully cancelled order: \" + orderTxt);\n return true;\n }\n }\n if (ctx) helpers.log(ctx, () => \"Failed to cancel order: \" + orderTxt);\n return false;\n }\n return false;\n}\n\nexport function loadStockMarket(saveString: string): void {\n if (saveString === \"\") {\n StockMarket = {\n lastUpdate: 0,\n Orders: {},\n storedCycles: 0,\n ticksUntilCycle: 0,\n } as IStockMarket;\n } else StockMarket = JSON.parse(saveString, Reviver);\n}\n\nexport function deleteStockMarket(): void {\n StockMarket = {\n lastUpdate: 0,\n Orders: {},\n storedCycles: 0,\n ticksUntilCycle: 0,\n } as IStockMarket;\n}\n\nexport function initStockMarket(): void {\n for (const stk of Object.keys(StockMarket)) {\n if (StockMarket.hasOwnProperty(stk)) delete StockMarket[stk];\n }\n\n for (const metadata of InitStockMetadata) {\n const name = metadata.name;\n StockMarket[name] = new Stock(metadata);\n }\n\n const orders: IOrderBook = {};\n for (const name of Object.keys(StockMarket)) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) continue;\n orders[stock.symbol] = [];\n }\n StockMarket[\"Orders\"] = orders;\n\n StockMarket.storedCycles = 0;\n StockMarket.lastUpdate = 0;\n StockMarket.ticksUntilCycle = TicksPerCycle;\n}\n\nexport function initSymbolToStockMap(): void {\n for (const [name, symbol] of Object.entries(StockSymbols)) {\n const stock = StockMarket[name];\n if (stock == null) {\n console.error(`Could not find Stock for ${name}`);\n continue;\n }\n SymbolToStockMap[symbol] = stock;\n }\n}\n\nfunction stockMarketCycle(): void {\n for (const name of Object.keys(StockMarket)) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) continue;\n\n const roll = Math.random();\n if (roll < 0.45) {\n stock.b = !stock.b;\n stock.flipForecastForecast();\n }\n\n StockMarket.ticksUntilCycle = TicksPerCycle;\n }\n}\n\n// Stock prices updated every 6 seconds\nconst msPerStockUpdate = 6e3;\nconst cyclesPerStockUpdate = msPerStockUpdate / CONSTANTS.MilliPerCycle;\nexport function processStockPrices(numCycles = 1): void {\n if (StockMarket.storedCycles == null || isNaN(StockMarket.storedCycles)) {\n StockMarket.storedCycles = 0;\n }\n StockMarket.storedCycles += numCycles;\n\n if (StockMarket.storedCycles < cyclesPerStockUpdate) {\n return;\n }\n\n // We can process the update every 4 seconds as long as there are enough\n // stored cycles. This lets us account for offline time\n const timeNow = new Date().getTime();\n if (timeNow - StockMarket.lastUpdate < 4e3) return;\n\n StockMarket.lastUpdate = timeNow;\n StockMarket.storedCycles -= cyclesPerStockUpdate;\n\n // Cycle\n if (StockMarket.ticksUntilCycle == null || typeof StockMarket.ticksUntilCycle !== \"number\") {\n StockMarket.ticksUntilCycle = TicksPerCycle;\n }\n --StockMarket.ticksUntilCycle;\n if (StockMarket.ticksUntilCycle <= 0) stockMarketCycle();\n\n const v = Math.random();\n for (const name of Object.keys(StockMarket)) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) continue;\n let av = (v * stock.mv) / 100;\n if (isNaN(av)) {\n av = 0.02;\n }\n\n let chc = 50;\n if (stock.b) {\n chc = (chc + stock.otlkMag) / 100;\n } else {\n chc = (chc - stock.otlkMag) / 100;\n }\n if (stock.price >= stock.cap) {\n chc = 0.1; // \"Soft Limit\" on stock price. It could still go up but its unlikely\n stock.b = false;\n }\n if (isNaN(chc)) {\n chc = 0.5;\n }\n\n const c = Math.random();\n const processOrderRefs = {\n stockMarket: StockMarket,\n symbolToStockMap: SymbolToStockMap,\n };\n if (c < chc) {\n stock.changePrice(stock.price * (1 + av));\n processOrders(stock, OrderTypes.LimitBuy, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.LimitSell, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.StopBuy, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.StopSell, PositionTypes.Short, processOrderRefs);\n } else {\n stock.changePrice(stock.price / (1 + av));\n processOrders(stock, OrderTypes.LimitBuy, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.LimitSell, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.StopBuy, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.StopSell, PositionTypes.Long, processOrderRefs);\n }\n\n let otlkMagChange = stock.otlkMag * av;\n if (stock.otlkMag < 5) {\n if (stock.otlkMag <= 1) {\n otlkMagChange = 1;\n } else {\n otlkMagChange *= 10;\n }\n }\n stock.cycleForecast(otlkMagChange);\n stock.cycleForecastForecast(otlkMagChange / 2);\n\n // Shares required for price movement gradually approaches max over time\n stock.shareTxUntilMovement = Math.min(stock.shareTxUntilMovement + 10, stock.shareTxForMovement);\n }\n}\n\nexport function initStockMarketFn(): void {\n initStockMarket();\n initSymbolToStockMap();\n}\n","import { Player } from \"@player\";\nimport { IReviverValue } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { applyWorkStats, applyWorkStatsExp, scaleWorkStats, WorkStats } from \"../../../Work/WorkStats\";\n\nexport const applySleeveGains = (sleeve: Sleeve, rawStats: WorkStats, cycles = 1): void => {\n const shockedStats = scaleWorkStats(rawStats, sleeve.shockBonus(), rawStats.money > 0);\n applyWorkStatsExp(sleeve, shockedStats, cycles);\n const syncStats = scaleWorkStats(shockedStats, sleeve.syncBonus(), rawStats.money > 0);\n applyWorkStats(Player, syncStats, cycles, \"sleeves\");\n Player.sleeves.filter((s) => s !== sleeve).forEach((s) => applyWorkStatsExp(s, syncStats, cycles));\n};\n\nexport abstract class Work {\n type: WorkType;\n\n constructor(type: WorkType) {\n this.type = type;\n }\n\n abstract process(sleeve: Sleeve, cycles: number): number;\n abstract APICopy(): Record<string, unknown>;\n abstract toJSON(): IReviverValue;\n finish(): void {\n /* left for children to implement */\n }\n}\n\nexport enum WorkType {\n COMPANY = \"COMPANY\",\n FACTION = \"FACTION\",\n CRIME = \"CRIME\",\n CLASS = \"CLASS\",\n RECOVERY = \"RECOVERY\",\n SYNCHRO = \"SYNCHRO\",\n BLADEBURNER = \"BLADEBURNER\",\n INFILTRATE = \"INFILTRATE\",\n SUPPORT = \"SUPPORT\",\n}\n","import { BitNodeMultipliers } from \"./BitNode/BitNodeMultipliers\";\nimport { Person } from \"./PersonObjects/Person\";\nimport { calculateIntelligenceBonus } from \"./PersonObjects/formulas/intelligence\";\nimport { Server } from \"./Server/Server\";\n\n/** Returns the chance the person has to successfully hack a server */\nexport function calculateHackingChance(server: Server, person: Person): number {\n const hackFactor = 1.75;\n const difficultyMult = (100 - server.hackDifficulty) / 100;\n const skillMult = hackFactor * person.skills.hacking;\n const skillChance = (skillMult - server.requiredHackingSkill) / skillMult;\n const chance =\n skillChance *\n difficultyMult *\n person.mults.hacking_chance *\n calculateIntelligenceBonus(person.skills.intelligence, 1);\n if (chance > 1) {\n return 1;\n }\n if (chance < 0) {\n return 0;\n }\n\n return chance;\n}\n\n/**\n * Returns the amount of hacking experience the person will gain upon\n * successfully hacking a server\n */\nexport function calculateHackingExpGain(server: Server, person: Person): number {\n const baseExpGain = 3;\n const diffFactor = 0.3;\n if (server.baseDifficulty == null) {\n server.baseDifficulty = server.hackDifficulty;\n }\n let expGain = baseExpGain;\n expGain += server.baseDifficulty * diffFactor;\n\n return expGain * person.mults.hacking_exp * BitNodeMultipliers.HackExpGain;\n}\n\n/**\n * Returns the percentage of money that will be stolen from a server if\n * it is successfully hacked (returns the decimal form, not the actual percent value)\n */\nexport function calculatePercentMoneyHacked(server: Server, person: Person): number {\n // Adjust if needed for balancing. This is the divisor for the final calculation\n const balanceFactor = 240;\n\n const difficultyMult = (100 - server.hackDifficulty) / 100;\n const skillMult = (person.skills.hacking - (server.requiredHackingSkill - 1)) / person.skills.hacking;\n const percentMoneyHacked =\n (difficultyMult * skillMult * person.mults.hacking_money * BitNodeMultipliers.ScriptHackMoney) / balanceFactor;\n if (percentMoneyHacked < 0) {\n return 0;\n }\n if (percentMoneyHacked > 1) {\n return 1;\n }\n\n return percentMoneyHacked;\n}\n\n/** Returns time it takes to complete a hack on a server, in seconds */\nexport function calculateHackingTime(server: Server, person: Person): number {\n const difficultyMult = server.requiredHackingSkill * server.hackDifficulty;\n\n const baseDiff = 500;\n const baseSkill = 50;\n const diffFactor = 2.5;\n let skillFactor = diffFactor * difficultyMult + baseDiff;\n // tslint:disable-next-line\n skillFactor /= person.skills.hacking + baseSkill;\n\n const hackTimeMultiplier = 5;\n const hackingTime =\n (hackTimeMultiplier * skillFactor) /\n (person.mults.hacking_speed * calculateIntelligenceBonus(person.skills.intelligence, 1));\n\n return hackingTime;\n}\n\n/** Returns time it takes to complete a grow operation on a server, in seconds */\nexport function calculateGrowTime(server: Server, person: Person): number {\n const growTimeMultiplier = 3.2; // Relative to hacking time. 16/5 = 3.2\n\n return growTimeMultiplier * calculateHackingTime(server, person);\n}\n\n/** Returns time it takes to complete a weaken operation on a server, in seconds */\nexport function calculateWeakenTime(server: Server, person: Person): number {\n const weakenTimeMultiplier = 4; // Relative to hacking time\n\n return weakenTimeMultiplier * calculateHackingTime(server, person);\n}\n","import { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\nimport { PlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\nimport { Faction } from \"./Faction\";\nimport { Factions } from \"./Factions\";\nimport { Player } from \"@player\";\nimport { Settings } from \"../Settings/Settings\";\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"../PersonObjects/formulas/reputation\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { InvitationEvent } from \"./ui/InvitationModal\";\nimport { FactionNames } from \"./data/FactionNames\";\nimport { SFC32RNG } from \"../Casino/RNG\";\nimport { isFactionWork } from \"../Work/FactionWork\";\n\nexport function inviteToFaction(faction: Faction): void {\n Player.receiveInvite(faction.name);\n faction.alreadyInvited = true;\n if (!Settings.SuppressFactionInvites) {\n InvitationEvent.emit(faction);\n }\n}\n\nexport function joinFaction(faction: Faction): void {\n if (faction.isMember) return;\n faction.isMember = true;\n Player.factions.push(faction.name);\n const allFactions = Object.values(FactionNames).map((faction) => faction as string);\n Player.factions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b));\n const factionInfo = faction.getInfo();\n\n //Determine what factions you are banned from now that you have joined this faction\n for (const enemy of factionInfo.enemies) {\n if (Factions[enemy]) Factions[enemy].isBanned = true;\n }\n for (let i = 0; i < Player.factionInvitations.length; ++i) {\n if (Player.factionInvitations[i] == faction.name || Factions[Player.factionInvitations[i]].isBanned) {\n Player.factionInvitations.splice(i, 1);\n i--;\n }\n }\n}\n\n//Returns a boolean indicating whether the player has the prerequisites for the\n//specified Augmentation\nexport function hasAugmentationPrereqs(aug: Augmentation): boolean {\n return aug.prereqs.every((aug) => Player.hasAugmentation(aug));\n}\n\nexport function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = false): string {\n const hasPrereqs = hasAugmentationPrereqs(aug);\n const augCosts = aug.getCost();\n if (!hasPrereqs) {\n const txt = `You must first purchase or install ${aug.prereqs\n .filter((req) => !Player.hasAugmentation(req))\n .join(\",\")} before you can purchase this one.`;\n if (sing) {\n return txt;\n } else {\n dialogBoxCreate(txt);\n }\n } else if (augCosts.moneyCost !== 0 && Player.money < augCosts.moneyCost) {\n const txt = \"You don't have enough money to purchase \" + aug.name;\n if (sing) {\n return txt;\n }\n dialogBoxCreate(txt);\n } else if (fac.playerReputation < augCosts.repCost) {\n const txt = \"You don't have enough faction reputation to purchase \" + aug.name;\n if (sing) {\n return txt;\n }\n dialogBoxCreate(txt);\n } else if (augCosts.moneyCost === 0 || Player.money >= augCosts.moneyCost) {\n const queuedAugmentation = new PlayerOwnedAugmentation(aug.name);\n if (aug.name == AugmentationNames.NeuroFluxGovernor) {\n queuedAugmentation.level = aug.getLevel();\n }\n Player.queuedAugmentations.push(queuedAugmentation);\n\n Player.loseMoney(augCosts.moneyCost, \"augmentations\");\n\n if (sing) {\n return \"You purchased \" + aug.name;\n } else if (!Settings.SuppressBuyAugmentationConfirmation) {\n dialogBoxCreate(\n `You purchased ${aug.name}. Its enhancements will not take effect until they are installed.` +\n \"To install your augmentations, go to the 'Augmentations' tab on the left-hand navigation menu.\" +\n \"Purchasing additional augmentations will now be more expensive.\",\n );\n }\n } else {\n dialogBoxCreate(\n \"Hmm, something went wrong when trying to purchase an Augmentation. \" +\n \"Please report this to the game developer with an explanation of how to \" +\n \"reproduce this.\",\n );\n }\n return \"\";\n}\n\nexport function processPassiveFactionRepGain(numCycles: number): void {\n for (const name of Object.keys(Factions)) {\n if (isFactionWork(Player.currentWork) && name === Player.currentWork.factionName) continue;\n if (!Factions.hasOwnProperty(name)) continue;\n const faction = Factions[name];\n if (!faction.isMember) continue;\n // No passive rep for special factions\n const info = faction.getInfo();\n if (!info.offersWork()) continue;\n // No passive rep for gangs.\n if (Player.getGangName() === name) continue;\n // 0 favor = 1%/s\n // 50 favor = 6%/s\n // 100 favor = 11%/s\n const favorMult = Math.min(0.1, faction.favor / 1000 + 0.01);\n // Find the best of all possible favor gain, minimum 1 rep / 2 minute.\n const hRep = getHackingWorkRepGain(Player, faction.favor);\n const sRep = getFactionSecurityWorkRepGain(Player, faction.favor);\n const fRep = getFactionFieldWorkRepGain(Player, faction.favor);\n const rate = Math.max(hRep * favorMult, sRep * favorMult, fRep * favorMult, 1 / 120);\n\n faction.playerReputation += rate * numCycles * Player.mults.faction_rep * BitNodeMultipliers.FactionPassiveRepGain;\n }\n}\n\nexport const getFactionAugmentationsFiltered = (faction: Faction): string[] => {\n // If player has a gang with this faction, return (almost) all augmentations\n if (Player.hasGangWith(faction.name)) {\n let augs = Object.values(StaticAugmentations);\n\n // Remove special augs\n augs = augs.filter((a) => !a.isSpecial && a.name !== AugmentationNames.CongruityImplant);\n\n if (Player.bitNodeN === 2) {\n // TRP is not available outside of BN2 for Gangs\n augs.push(StaticAugmentations[AugmentationNames.TheRedPill]);\n }\n\n const rng = SFC32RNG(`BN${Player.bitNodeN}.${Player.sourceFileLvl(Player.bitNodeN)}`);\n // Remove faction-unique augs that don't belong to this faction\n const uniqueFilter = (a: Augmentation): boolean => {\n // Keep all the non-unique one\n if (a.factions.length > 1) {\n return true;\n }\n // Keep all the ones that this faction has anyway.\n if (faction.augmentations.includes(a.name)) {\n return true;\n }\n\n return rng() >= 1 - BitNodeMultipliers.GangUniqueAugs;\n };\n augs = augs.filter(uniqueFilter);\n\n return augs.map((a) => a.name);\n }\n\n return faction.augmentations.slice();\n};\n","import { loadAliases, loadGlobalAliases, Aliases, GlobalAliases } from \"./Alias\";\nimport { Companies, loadCompanies } from \"./Company/Companies\";\nimport { CONSTANTS } from \"./Constants\";\nimport { Factions, loadFactions } from \"./Faction/Factions\";\nimport { loadAllGangs, AllGangs } from \"./Gang/AllGangs\";\nimport { Player, loadPlayer } from \"./Player\";\nimport {\n saveAllServers,\n loadAllServers,\n GetAllServers,\n createUniqueRandomIp,\n AddToAllServers,\n GetServer,\n} from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { loadStockMarket, StockMarket } from \"./StockMarket/StockMarket\";\nimport { staneksGift, loadStaneksGift } from \"./CotMG/Helper\";\n\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\n\nimport * as ExportBonus from \"./ExportBonus\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"./utils/JSONReviver\";\nimport { save } from \"./db\";\nimport { AwardNFG, v1APIBreak } from \"./utils/v1APIBreak\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { PlayerOwnedAugmentation } from \"./Augmentation/PlayerOwnedAugmentation\";\nimport { LocationName } from \"./Locations/data/LocationNames\";\nimport { PlayerObject } from \"./PersonObjects/Player/PlayerObject\";\nimport { pushGameSaved } from \"./Electron\";\nimport { defaultMonacoTheme } from \"./ScriptEditor/ui/themes\";\nimport { FactionNames } from \"./Faction/data/FactionNames\";\nimport { Faction } from \"./Faction/Faction\";\nimport { safelyCreateUniqueServer } from \"./Server/ServerHelpers\";\nimport { SpecialServers } from \"./Server/data/SpecialServers\";\nimport { v2APIBreak } from \"./utils/v2APIBreak\";\n\n/* SaveObject.js\n * Defines the object used to save/load games\n */\n\nexport interface SaveData {\n playerIdentifier: string;\n fileName: string;\n save: string;\n savedOn: number;\n}\n\nexport interface ImportData {\n base64: string;\n playerData?: ImportPlayerData;\n}\n\nexport interface ImportPlayerData {\n identifier: string;\n lastSave: number;\n totalPlaytime: number;\n\n money: number;\n hacking: number;\n\n augmentations: number;\n factions: number;\n achievements: number;\n\n bitNode: number;\n bitNodeLevel: number;\n sourceFiles: number;\n}\n\nclass BitburnerSaveObject {\n PlayerSave = \"\";\n AllServersSave = \"\";\n CompaniesSave = \"\";\n FactionsSave = \"\";\n AliasesSave = \"\";\n GlobalAliasesSave = \"\";\n StockMarketSave = \"\";\n SettingsSave = \"\";\n VersionSave = \"\";\n AllGangsSave = \"\";\n LastExportBonus = \"\";\n StaneksGiftSave = \"\";\n\n getSaveString(excludeRunningScripts = false): string {\n this.PlayerSave = JSON.stringify(Player);\n\n this.AllServersSave = saveAllServers(excludeRunningScripts);\n this.CompaniesSave = JSON.stringify(Companies);\n this.FactionsSave = JSON.stringify(Factions);\n this.AliasesSave = JSON.stringify(Aliases);\n this.GlobalAliasesSave = JSON.stringify(GlobalAliases);\n this.StockMarketSave = JSON.stringify(StockMarket);\n this.SettingsSave = JSON.stringify(Settings);\n this.VersionSave = JSON.stringify(CONSTANTS.VersionNumber);\n this.LastExportBonus = JSON.stringify(ExportBonus.LastExportBonus);\n this.StaneksGiftSave = JSON.stringify(staneksGift);\n\n if (Player.gang) this.AllGangsSave = JSON.stringify(AllGangs);\n\n const saveString = btoa(unescape(encodeURIComponent(JSON.stringify(this))));\n\n return saveString;\n }\n\n saveGame(emitToastEvent = true): Promise<void> {\n const savedOn = new Date().getTime();\n Player.lastSave = savedOn;\n const saveString = this.getSaveString(Settings.ExcludeRunningScriptsFromSave);\n return new Promise((resolve, reject) => {\n save(saveString)\n .then(() => {\n const saveData: SaveData = {\n playerIdentifier: Player.identifier,\n fileName: this.getSaveFileName(),\n save: saveString,\n savedOn,\n };\n pushGameSaved(saveData);\n\n if (emitToastEvent) {\n SnackbarEvents.emit(\"Game Saved!\", ToastVariant.INFO, 2000);\n }\n return resolve();\n })\n .catch((err) => {\n console.error(err);\n return reject();\n });\n });\n }\n\n getSaveFileName(isRecovery = false): string {\n // Save file name is based on current timestamp and BitNode\n const epochTime = Math.round(Date.now() / 1000);\n const bn = Player.bitNodeN;\n let filename = `bitburnerSave_${epochTime}_BN${bn}x${Player.sourceFileLvl(bn) + 1}.json`;\n if (isRecovery) filename = \"RECOVERY\" + filename;\n return filename;\n }\n\n exportGame(): void {\n const saveString = this.getSaveString(Settings.ExcludeRunningScriptsFromSave);\n const filename = this.getSaveFileName();\n download(filename, saveString);\n }\n\n importGame(base64Save: string, reload = true): Promise<void> {\n if (!base64Save || base64Save === \"\") throw new Error(\"Invalid import string\");\n return save(base64Save).then(() => {\n if (reload) setTimeout(() => location.reload(), 1000);\n return Promise.resolve();\n });\n }\n\n getImportStringFromFile(files: FileList | null): Promise<string> {\n if (files === null) return Promise.reject(new Error(\"No file selected\"));\n const file = files[0];\n if (!file) return Promise.reject(new Error(\"Invalid file selected\"));\n\n const reader = new FileReader();\n const promise: Promise<string> = new Promise((resolve, reject) => {\n reader.onload = function (this: FileReader, e: ProgressEvent<FileReader>) {\n const target = e.target;\n if (target === null) {\n return reject(new Error(\"Error importing file\"));\n }\n const result = target.result;\n if (typeof result !== \"string\") {\n return reject(new Error(\"FileReader event was not type string\"));\n }\n const contents = result;\n resolve(contents);\n };\n });\n reader.readAsText(file);\n return promise;\n }\n\n async getImportDataFromString(base64Save: string): Promise<ImportData> {\n if (!base64Save || base64Save === \"\") throw new Error(\"Invalid import string\");\n\n let newSave;\n try {\n newSave = window.atob(base64Save);\n newSave = newSave.trim();\n } catch (error) {\n console.error(error); // We'll handle below\n }\n\n if (!newSave || newSave === \"\") {\n return Promise.reject(new Error(\"Save game had not content or was not base64 encoded\"));\n }\n\n let parsedSave;\n try {\n parsedSave = JSON.parse(newSave);\n } catch (error) {\n console.error(error); // We'll handle below\n }\n\n if (!parsedSave || parsedSave.ctor !== \"BitburnerSaveObject\" || !parsedSave.data) {\n return Promise.reject(new Error(\"Save game did not seem valid\"));\n }\n\n const data: ImportData = {\n base64: base64Save,\n };\n\n const importedPlayer = PlayerObject.fromJSON(JSON.parse(parsedSave.data.PlayerSave));\n\n const playerData: ImportPlayerData = {\n identifier: importedPlayer.identifier,\n lastSave: importedPlayer.lastSave,\n totalPlaytime: importedPlayer.totalPlaytime,\n\n money: importedPlayer.money,\n hacking: importedPlayer.skills.hacking,\n\n augmentations: importedPlayer.augmentations?.reduce<number>((total, current) => (total += current.level), 0) ?? 0,\n factions: importedPlayer.factions?.length ?? 0,\n achievements: importedPlayer.achievements?.length ?? 0,\n\n bitNode: importedPlayer.bitNodeN,\n bitNodeLevel: importedPlayer.sourceFileLvl(Player.bitNodeN) + 1,\n sourceFiles: importedPlayer.sourceFiles?.reduce<number>((total, current) => (total += current.lvl), 0) ?? 0,\n };\n\n data.playerData = playerData;\n return Promise.resolve(data);\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"BitburnerSaveObject\", this);\n }\n\n static fromJSON(value: IReviverValue): BitburnerSaveObject {\n return Generic_fromJSON(BitburnerSaveObject, value.data);\n }\n}\n\n// Makes necessary changes to the loaded/imported data to ensure\n// the game stills works with new versions\nfunction evaluateVersionCompatibility(ver: string | number): void {\n // We have to do this because ts won't let us otherwise\n const anyPlayer = Player as any;\n if (typeof ver === \"string\") {\n // This version refactored the Company/job-related code\n if (ver <= \"0.41.2\") {\n // Player's company position is now a string\n if (anyPlayer.companyPosition != null && typeof anyPlayer.companyPosition !== \"string\") {\n anyPlayer.companyPosition = anyPlayer.companyPosition.data.positionName;\n if (anyPlayer.companyPosition == null) {\n anyPlayer.companyPosition = \"\";\n }\n }\n\n // The \"companyName\" property of all Companies is renamed to \"name\"\n interface Company0_41_2 {\n name: string | number;\n companyName: string;\n companyPositions: Record<number, boolean>;\n }\n for (const companyName of Object.keys(Companies)) {\n const company = Companies[companyName] as unknown as Company0_41_2;\n if (company.name == 0 && company.companyName != null) {\n company.name = company.companyName;\n }\n\n if (company.companyPositions instanceof Array) {\n const pos: Record<number, boolean> = {};\n\n for (let i = 0; i < company.companyPositions.length; ++i) {\n pos[company.companyPositions[i]] = true;\n }\n company.companyPositions = pos;\n }\n }\n }\n\n // This version allowed players to hold multiple jobs\n if (ver < \"0.43.0\") {\n if (anyPlayer.companyName !== \"\" && anyPlayer.companyPosition != null && anyPlayer.companyPosition !== \"\") {\n anyPlayer.jobs[anyPlayer.companyName] = anyPlayer.companyPosition;\n }\n\n delete anyPlayer.companyPosition;\n }\n if (ver < \"0.56.0\") {\n for (const q of anyPlayer.queuedAugmentations) {\n if (q.name === \"Graphene BranchiBlades Upgrade\") {\n q.name = \"Graphene BrachiBlades Upgrade\";\n }\n }\n for (const q of anyPlayer.augmentations) {\n if (q.name === \"Graphene BranchiBlades Upgrade\") {\n q.name = \"Graphene BrachiBlades Upgrade\";\n }\n }\n }\n if (ver < \"0.56.1\") {\n if (anyPlayer.bladeburner === 0) {\n anyPlayer.bladeburner = null;\n }\n if (anyPlayer.gang === 0) {\n anyPlayer.gang = null;\n }\n if (anyPlayer.corporation === 0) {\n anyPlayer.corporation = null;\n }\n // convert all Messages to just filename to save space.\n const home = anyPlayer.getHomeComputer();\n for (let i = 0; i < home.messages.length; i++) {\n if (home.messages[i].filename) {\n home.messages[i] = home.messages[i].filename;\n }\n }\n }\n if (ver < \"0.58.0\") {\n const changes: [RegExp, string][] = [\n [/getStockSymbols/g, \"stock.getSymbols\"],\n [/getStockPrice/g, \"stock.getPrice\"],\n [/getStockAskPrice/g, \"stock.getAskPrice\"],\n [/getStockBidPrice/g, \"stock.getBidPrice\"],\n [/getStockPosition/g, \"stock.getPosition\"],\n [/getStockMaxShares/g, \"stock.getMaxShares\"],\n [/getStockPurchaseCost/g, \"stock.getPurchaseCost\"],\n [/getStockSaleGain/g, \"stock.getSaleGain\"],\n [/buyStock/g, \"stock.buy\"],\n [/sellStock/g, \"stock.sell\"],\n [/shortStock/g, \"stock.short\"],\n [/sellShort/g, \"stock.sellShort\"],\n [/placeOrder/g, \"stock.placeOrder\"],\n [/cancelOrder/g, \"stock.cancelOrder\"],\n [/getOrders/g, \"stock.getOrders\"],\n [/getStockVolatility/g, \"stock.getVolatility\"],\n [/getStockForecast/g, \"stock.getForecast\"],\n [/purchase4SMarketData/g, \"stock.purchase4SMarketData\"],\n [/purchase4SMarketDataTixApi/g, \"stock.purchase4SMarketDataTixApi\"],\n ];\n function convert(code: string): string {\n for (const change of changes) {\n code = code.replace(change[0], change[1]);\n }\n return code;\n }\n for (const server of GetAllServers()) {\n for (const script of server.scripts) {\n script.code = convert(script.code);\n }\n }\n }\n v1APIBreak();\n ver = 1;\n }\n if (typeof ver === \"number\") {\n if (ver < 2) {\n AwardNFG(10);\n Player.reapplyAllAugmentations(true);\n Player.reapplyAllSourceFiles();\n }\n if (ver < 3) {\n anyPlayer.money = parseFloat(anyPlayer.money);\n if (anyPlayer.corporation) {\n anyPlayer.corporation.funds = parseFloat(anyPlayer.corporation.funds);\n anyPlayer.corporation.revenue = parseFloat(anyPlayer.corporation.revenue);\n anyPlayer.corporation.expenses = parseFloat(anyPlayer.corporation.expenses);\n\n for (let i = 0; i < anyPlayer.corporation.divisions.length; ++i) {\n const ind = anyPlayer.corporation.divisions[i];\n ind.lastCycleRevenue = parseFloat(ind.lastCycleRevenue);\n ind.lastCycleExpenses = parseFloat(ind.lastCycleExpenses);\n ind.thisCycleRevenue = parseFloat(ind.thisCycleRevenue);\n ind.thisCycleExpenses = parseFloat(ind.thisCycleExpenses);\n }\n }\n }\n if (ver < 9) {\n if (StockMarket.hasOwnProperty(\"Joes Guns\")) {\n const s = StockMarket[\"Joes Guns\"];\n delete StockMarket[\"Joes Guns\"];\n StockMarket[LocationName.Sector12JoesGuns] = s;\n }\n }\n if (ver < 10) {\n // Augmentation name was changed in 0.56.0 but sleeves aug list was missed.\n if (anyPlayer.sleeves && anyPlayer.sleeves.length > 0) {\n for (const sleeve of anyPlayer.sleeves) {\n if (!sleeve.augmentations || sleeve.augmentations.length === 0) continue;\n for (const augmentation of sleeve.augmentations) {\n if (augmentation.name !== \"Graphene BranchiBlades Upgrade\") continue;\n augmentation.name = \"Graphene BrachiBlades Upgrade\";\n }\n }\n }\n }\n if (ver < 12) {\n if (anyPlayer.resleeves !== undefined) {\n delete anyPlayer.resleeves;\n }\n }\n\n if (ver < 15) {\n Settings.EditorTheme = { ...defaultMonacoTheme };\n }\n //Fix contract names\n if (ver < 16) {\n Factions[FactionNames.ShadowsOfAnarchy] = new Faction(FactionNames.ShadowsOfAnarchy);\n //Iterate over all contracts on all servers\n for (const server of GetAllServers()) {\n for (const contract of server.contracts) {\n //Rename old \"HammingCodes: Integer to encoded Binary\" contracts\n //to \"HammingCodes: Integer to Encoded Binary\"\n if (contract.type == \"HammingCodes: Integer to encoded Binary\") {\n contract.type = \"HammingCodes: Integer to Encoded Binary\";\n }\n }\n }\n }\n\n const v22PlayerBreak = () => {\n // reset HP correctly to avoid crash\n anyPlayer.hp = { current: 1, max: 1 };\n for (const sleeve of anyPlayer.sleeves) {\n sleeve.hp = { current: 1, max: 1 };\n }\n\n // transfer over old exp to new struct\n anyPlayer.exp.hacking = anyPlayer.hacking_exp;\n anyPlayer.exp.strength = anyPlayer.strength_exp;\n anyPlayer.exp.defense = anyPlayer.defense_exp;\n anyPlayer.exp.dexterity = anyPlayer.dexterity_exp;\n anyPlayer.exp.agility = anyPlayer.agility_exp;\n anyPlayer.exp.charisma = anyPlayer.charisma_exp;\n anyPlayer.exp.intelligence = anyPlayer.intelligence_exp;\n };\n\n // Fix bugged NFG accumulation in owned augmentations\n if (ver < 17) {\n let ownedNFGs = [...Player.augmentations];\n ownedNFGs = ownedNFGs.filter((aug) => aug.name === AugmentationNames.NeuroFluxGovernor);\n const newNFG = new PlayerOwnedAugmentation(AugmentationNames.NeuroFluxGovernor);\n newNFG.level = 0;\n\n for (const nfg of ownedNFGs) {\n newNFG.level += nfg.level;\n }\n\n Player.augmentations = [\n ...Player.augmentations.filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor),\n newNFG,\n ];\n\n v22PlayerBreak();\n Player.reapplyAllAugmentations(true);\n Player.reapplyAllSourceFiles();\n }\n\n if (ver < 20) {\n // Create the darkweb for everyone but it won't be linked\n const dw = GetServer(SpecialServers.DarkWeb);\n if (!dw) {\n const darkweb = safelyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: SpecialServers.DarkWeb,\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: false,\n purchasedByPlayer: false,\n maxRam: 1,\n });\n AddToAllServers(darkweb);\n }\n }\n if (ver < 21) {\n // 2.0.0 work rework\n AwardNFG(10);\n const create = anyPlayer[\"createProgramName\"];\n if (create) Player.getHomeComputer().pushProgram(create);\n const graft = anyPlayer[\"graftAugmentationName\"];\n if (graft) Player.augmentations.push({ name: graft, level: 1 });\n }\n if (ver < 22) {\n v22PlayerBreak();\n v2APIBreak();\n }\n if (ver < 23) {\n anyPlayer.currentWork = null;\n }\n if (ver < 24) {\n Player.getHomeComputer().scripts.forEach((s) => s.filename.endsWith(\".ns\") && (s.filename += \".js\"));\n }\n if (ver < 25) {\n const removePlayerFields = [\n \"hacking_chance_mult\",\n \"hacking_speed_mult\",\n \"hacking_money_mult\",\n \"hacking_grow_mult\",\n \"hacking_mult\",\n \"strength_mult\",\n \"defense_mult\",\n \"dexterity_mult\",\n \"agility_mult\",\n \"charisma_mult\",\n \"hacking_exp_mult\",\n \"strength_exp_mult\",\n \"defense_exp_mult\",\n \"dexterity_exp_mult\",\n \"agility_exp_mult\",\n \"charisma_exp_mult\",\n \"company_rep_mult\",\n \"faction_rep_mult\",\n \"crime_money_mult\",\n \"crime_success_mult\",\n \"work_money_mult\",\n \"hacknet_node_money_mult\",\n \"hacknet_node_purchase_cost_mult\",\n \"hacknet_node_ram_cost_mult\",\n \"hacknet_node_core_cost_mult\",\n \"hacknet_node_level_cost_mult\",\n \"bladeburner_max_stamina_mult\",\n \"bladeburner_stamina_gain_mult\",\n \"bladeburner_analysis_mult\",\n \"bladeburner_success_chance_mult\",\n \"hacking_exp\",\n \"strength_exp\",\n \"defense_exp\",\n \"dexterity_exp\",\n \"agility_exp\",\n \"charisma_exp\",\n \"intelligence_exp\",\n \"companyName\",\n \"isWorking\",\n \"workType\",\n \"workCostMult\",\n \"workExpMult\",\n \"currentWorkFactionName\",\n \"currentWorkFactionDescription\",\n \"workHackExpGainRate\",\n \"workStrExpGainRate\",\n \"workDefExpGainRate\",\n \"workDexExpGainRate\",\n \"workAgiExpGainRate\",\n \"workChaExpGainRate\",\n \"workRepGainRate\",\n \"workMoneyGainRate\",\n \"workMoneyLossRate\",\n \"workHackExpGained\",\n \"workStrExpGained\",\n \"workDefExpGained\",\n \"workDexExpGained\",\n \"workAgiExpGained\",\n \"workChaExpGained\",\n \"workRepGained\",\n \"workMoneyGained\",\n \"createProgramName\",\n \"createProgramReqLvl\",\n \"graftAugmentationName\",\n \"timeWorkedGraftAugmentation\",\n \"className\",\n \"crimeType\",\n \"timeWorked\",\n \"timeWorkedCreateProgram\",\n \"timeNeededToCompleteWork\",\n \"factionWorkType\",\n \"committingCrimeThruSingFn\",\n \"singFnCrimeWorkerScript\",\n \"hacking\",\n \"max_hp\",\n \"strength\",\n \"defense\",\n \"dexterity\",\n \"agility\",\n \"charisma\",\n \"intelligence\",\n ];\n const removeSleeveFields = [\n \"gymStatType\",\n \"bbAction\",\n \"bbContract\",\n \"hacking\",\n \"strength\",\n \"defense\",\n \"dexterity\",\n \"agility\",\n \"charisma\",\n \"intelligence\",\n \"max_hp\",\n \"hacking_exp\",\n \"strength_exp\",\n \"defense_exp\",\n \"dexterity_exp\",\n \"agility_exp\",\n \"charisma_exp\",\n \"intelligence_exp\",\n \"hacking_mult\",\n \"strength_mult\",\n \"defense_mult\",\n \"dexterity_mult\",\n \"agility_mult\",\n \"charisma_mult\",\n \"hacking_exp_mult\",\n \"strength_exp_mult\",\n \"defense_exp_mult\",\n \"dexterity_exp_mult\",\n \"agility_exp_mult\",\n \"charisma_exp_mult\",\n \"hacking_chance_mult\",\n \"hacking_speed_mult\",\n \"hacking_money_mult\",\n \"hacking_grow_mult\",\n \"company_rep_mult\",\n \"faction_rep_mult\",\n \"crime_money_mult\",\n \"crime_success_mult\",\n \"work_money_mult\",\n \"hacknet_node_money_mult\",\n \"hacknet_node_purchase_cost_mult\",\n \"hacknet_node_ram_cost_mult\",\n \"hacknet_node_core_cost_mult\",\n \"hacknet_node_level_cost_mult\",\n \"bladeburner_max_stamina_mult\",\n \"bladeburner_stamina_gain_mult\",\n \"bladeburner_analysis_mult\",\n \"bladeburner_success_chance_mult\",\n \"className\",\n \"crimeType\",\n \"currentTask\",\n \"currentTaskLocation\",\n \"currentTaskMaxTime\",\n \"currentTaskTime\",\n \"earningsForSleeves\",\n \"earningsForPlayer\",\n \"earningsForTask\",\n \"factionWorkType\",\n \"gainRatesForTask\",\n \"logs\",\n ];\n let intExp = Number(anyPlayer.intelligence_exp);\n if (isNaN(intExp)) intExp = 0;\n anyPlayer.exp.intelligence += intExp;\n for (const field of removePlayerFields) {\n delete anyPlayer[field];\n }\n for (const sleeve of anyPlayer.sleeves) {\n const anySleeve = sleeve as any;\n let intExp = Number(anySleeve.intelligence_exp);\n if (isNaN(intExp)) intExp = 0;\n anySleeve.exp.intelligence += intExp;\n for (const field of removeSleeveFields) {\n delete sleeve[field];\n }\n }\n }\n }\n}\n\nfunction loadGame(saveString: string): boolean {\n createScamUpdateText();\n if (!saveString) return false;\n saveString = decodeURIComponent(escape(atob(saveString)));\n\n const saveObj = JSON.parse(saveString, Reviver);\n\n loadPlayer(saveObj.PlayerSave);\n loadAllServers(saveObj.AllServersSave);\n loadCompanies(saveObj.CompaniesSave);\n loadFactions(saveObj.FactionsSave);\n\n if (saveObj.hasOwnProperty(\"StaneksGiftSave\")) {\n loadStaneksGift(saveObj.StaneksGiftSave);\n } else {\n console.warn(`Could not load Staneks Gift from save`);\n loadStaneksGift(\"\");\n }\n if (saveObj.hasOwnProperty(\"AliasesSave\")) {\n try {\n loadAliases(saveObj.AliasesSave);\n } catch (e) {\n console.warn(`Could not load Aliases from save`);\n loadAliases(\"\");\n }\n } else {\n console.warn(`Save file did not contain an Aliases property`);\n loadAliases(\"\");\n }\n if (saveObj.hasOwnProperty(\"GlobalAliasesSave\")) {\n try {\n loadGlobalAliases(saveObj.GlobalAliasesSave);\n } catch (e) {\n console.warn(`Could not load GlobalAliases from save`);\n loadGlobalAliases(\"\");\n }\n } else {\n console.warn(`Save file did not contain a GlobalAliases property`);\n loadGlobalAliases(\"\");\n }\n if (saveObj.hasOwnProperty(\"StockMarketSave\")) {\n try {\n loadStockMarket(saveObj.StockMarketSave);\n } catch (e) {\n loadStockMarket(\"\");\n }\n } else {\n loadStockMarket(\"\");\n }\n if (saveObj.hasOwnProperty(\"SettingsSave\")) {\n try {\n // Try to set saved settings.\n Settings.load(saveObj.SettingsSave);\n } catch (e) {}\n }\n if (saveObj.hasOwnProperty(\"LastExportBonus\")) {\n try {\n ExportBonus.setLastExportBonus(JSON.parse(saveObj.LastExportBonus));\n } catch (err) {\n ExportBonus.setLastExportBonus(new Date().getTime());\n console.error(\"ERROR: Failed to parse last export bonus Settings \" + err);\n }\n }\n if (Player.gang && saveObj.hasOwnProperty(\"AllGangsSave\")) {\n try {\n loadAllGangs(saveObj.AllGangsSave);\n } catch (e) {\n console.error(\"ERROR: Failed to parse AllGangsSave: \" + e);\n }\n }\n if (saveObj.hasOwnProperty(\"VersionSave\")) {\n try {\n const ver = JSON.parse(saveObj.VersionSave, Reviver);\n evaluateVersionCompatibility(ver);\n if (window.location.href.toLowerCase().includes(\"bitburner-beta\")) {\n // Beta branch, always show changes\n createBetaUpdateText();\n } else if (ver !== CONSTANTS.VersionNumber) {\n createNewUpdateText();\n }\n } catch (e) {\n createNewUpdateText();\n }\n } else {\n createNewUpdateText();\n }\n return true;\n}\n\nfunction createScamUpdateText(): void {\n if (navigator.userAgent.indexOf(\"wv\") !== -1 && navigator.userAgent.indexOf(\"Chrome/\") !== -1) {\n setInterval(() => {\n dialogBoxCreate(\"SCAM ALERT. This app is not official and you should uninstall it.\");\n }, 1000);\n }\n}\n\nfunction createNewUpdateText(): void {\n setTimeout(\n () =>\n dialogBoxCreate(\n \"New update!\\n\" +\n \"Please report any bugs/issues through the GitHub repository \" +\n \"or the Bitburner subreddit (reddit.com/r/bitburner).\\n\\n\" +\n CONSTANTS.LatestUpdate,\n ),\n 1000,\n );\n}\n\nfunction createBetaUpdateText(): void {\n dialogBoxCreate(\n \"You are playing on the beta environment! This branch of the game \" +\n \"features the latest developments in the game. This version may be unstable.\\n\" +\n \"Please report any bugs/issues through the github repository (https://github.com/danielyxie/bitburner/issues) \" +\n \"or the Bitburner subreddit (reddit.com/r/bitburner).\\n\\n\" +\n CONSTANTS.LatestUpdate,\n );\n}\n\nfunction download(filename: string, content: string): void {\n const file = new Blob([content], { type: \"text/plain\" });\n\n const a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n}\n\nReviver.constructors.BitburnerSaveObject = BitburnerSaveObject;\n\nexport { saveObject, loadGame, download };\n\nconst saveObject = new BitburnerSaveObject();\n","import * as predefined from \"./data\";\n\nexport interface ITheme {\n [key: string]: string | undefined;\n primarylight: string;\n primary: string;\n primarydark: string;\n successlight: string;\n success: string;\n successdark: string;\n errorlight: string;\n error: string;\n errordark: string;\n secondarylight: string;\n secondary: string;\n secondarydark: string;\n warninglight: string;\n warning: string;\n warningdark: string;\n infolight: string;\n info: string;\n infodark: string;\n welllight: string;\n well: string;\n white: string;\n black: string;\n hp: string;\n money: string;\n hack: string;\n combat: string;\n cha: string;\n int: string;\n rep: string;\n disabled: string;\n backgroundprimary: string;\n backgroundsecondary: string;\n button: string;\n}\n\nexport interface IPredefinedTheme {\n colors: ITheme;\n name: string;\n credit: string;\n screenshot: string;\n description: string;\n reference?: string;\n}\n\nexport const defaultTheme: ITheme = {\n ...predefined.Default.colors,\n};\n\nexport const getPredefinedThemes = (): Record<string, IPredefinedTheme> => ({\n ...predefined,\n});\n","import { Reviver } from \"../utils/JSONReviver\";\nimport { BaseGift } from \"./BaseGift\";\n\nimport { StaneksGift } from \"./StaneksGift\";\n\nexport let staneksGift = new StaneksGift();\n\nexport function loadStaneksGift(saveString: string): void {\n if (saveString) {\n staneksGift = JSON.parse(saveString, Reviver);\n } else {\n staneksGift = new StaneksGift();\n }\n}\n\nexport function zeros(width: number, height: number): number[][] {\n const array = [];\n\n for (let i = 0; i < width; ++i) {\n array.push(Array(height).fill(0));\n }\n\n return array;\n}\n\nexport function calculateGrid(gift: BaseGift): number[][] {\n const newgrid = zeros(gift.width(), gift.height()) as unknown as number[][];\n for (let i = 0; i < gift.width(); i++) {\n for (let j = 0; j < gift.height(); j++) {\n const fragment = gift.fragmentAt(i, j);\n if (!fragment) continue;\n newgrid[i][j] = 1;\n }\n }\n\n return newgrid;\n}\n","import { LocationName } from \"../../Locations/data/LocationNames\";\n\n//Enum-like object because some keys are created via code and have spaces. Membership can still be checked with checkEnum.\nexport const StockSymbols = {\n // Stocks for companies at which you can work\n [LocationName.AevumECorp]: \"ECP\",\n [LocationName.Sector12MegaCorp]: \"MGCP\",\n [LocationName.Sector12BladeIndustries]: \"BLD\",\n [LocationName.AevumClarkeIncorporated]: \"CLRK\",\n [LocationName.VolhavenOmniTekIncorporated]: \"OMTK\",\n [LocationName.Sector12FourSigma]: \"FSIG\",\n [LocationName.ChongqingKuaiGongInternational]: \"KGI\",\n [LocationName.AevumFulcrumTechnologies]: \"FLCM\",\n [LocationName.IshimaStormTechnologies]: \"STM\",\n [LocationName.NewTokyoDefComm]: \"DCOMM\",\n [LocationName.VolhavenHeliosLabs]: \"HLS\",\n [LocationName.NewTokyoVitaLife]: \"VITA\",\n [LocationName.Sector12IcarusMicrosystems]: \"ICRS\",\n [LocationName.Sector12UniversalEnergy]: \"UNV\",\n [LocationName.AevumAeroCorp]: \"AERO\",\n [LocationName.VolhavenOmniaCybersystems]: \"OMN\",\n [LocationName.ChongqingSolarisSpaceSystems]: \"SLRS\",\n [LocationName.NewTokyoGlobalPharmaceuticals]: \"GPH\",\n [LocationName.IshimaNovaMedical]: \"NVMD\",\n [LocationName.AevumWatchdogSecurity]: \"WDS\",\n [LocationName.VolhavenLexoCorp]: \"LXO\",\n [LocationName.AevumRhoConstruction]: \"RHOC\",\n [LocationName.Sector12AlphaEnterprises]: \"APHE\",\n [LocationName.VolhavenSysCoreSecurities]: \"SYSC\",\n [LocationName.VolhavenCompuTek]: \"CTK\",\n [LocationName.AevumNetLinkTechnologies]: \"NTLK\",\n [LocationName.IshimaOmegaSoftware]: \"OMGA\",\n [LocationName.Sector12FoodNStuff]: \"FNS\",\n [LocationName.Sector12JoesGuns]: \"JGN\",\n\n // Stocks for other companies\n [\"Sigma Cosmetics\"]: \"SGC\",\n [\"Catalyst Ventures\"]: \"CTYS\",\n [\"Microdyne Technologies\"]: \"MDYN\",\n [\"Titan Laboratories\"]: \"TITN\",\n} as const;\n","// Constructs all CompanyPosition objects using the metadata in data/companypositions.ts\nimport { companyPositionMetadata } from \"./data/CompanyPositionsMetadata\";\nimport { CompanyPosition, IConstructorParams } from \"./CompanyPosition\";\n\nexport const CompanyPositions: Record<string, CompanyPosition> = {};\n\nfunction addCompanyPosition(params: IConstructorParams): void {\n if (CompanyPositions[params.name] != null) {\n console.warn(`Duplicate Company Position being defined: ${params.name}`);\n }\n CompanyPositions[params.name] = new CompanyPosition(params);\n}\n\ncompanyPositionMetadata.forEach((e) => {\n addCompanyPosition(e);\n});\n","export enum FactionWorkType {\n HACKING = \"HACKING\",\n FIELD = \"FIELD\",\n SECURITY = \"SECURITY\",\n}\n","/*\nThe game cannot block every possible exploits. Specially since one of them is\nthat you can just edit your save file and that's impractical to prevent.\n\nSo instead we have source file minus 1. It is not obtained by destroying a\nBitNode but instead it is awarded when the player finds innovative ways to break\nthe game, this serves 2 purpose, [one] the developers don't have to spend time\ntrying to implement anti-cheat measures and [two] finding ways to break a\nhacking game is very much in the spirit of the game.\nSource-File minus 1 is extremely weak because it can be fully level up quickly.\n*/\n\nexport enum Exploit {\n Bypass = \"Bypass\",\n PrototypeTampering = \"PrototypeTampering\",\n Unclickable = \"Unclickable\",\n UndocumentedFunctionCall = \"UndocumentedFunctionCall\",\n TimeCompression = \"TimeCompression\",\n RealityAlteration = \"RealityAlteration\",\n N00dles = \"N00dles\",\n YoureNotMeantToAccessThis = \"YoureNotMeantToAccessThis\",\n TrueRecursion = \"TrueRecursion\",\n INeedARainbow = \"INeedARainbow\",\n // To the players reading this. Yes you're supposed to add EditSaveFile by\n // editing your save file, yes you could add them all, no we don't care\n // that's not the point.\n EditSaveFile = \"EditSaveFile\",\n}\n\nconst names: {\n [key: string]: string;\n} = {\n Bypass: \"by circumventing the ram cost of document.\",\n EditSaveFile: \"by editing your save file.\",\n PrototypeTampering: \"by tampering with Numbers prototype.\",\n TimeCompression: \"by compressing time.\",\n Unclickable: \"by clicking the unclickable.\",\n UndocumentedFunctionCall: \"by looking beyond the documentation.\",\n RealityAlteration: \"by altering reality to suit your whims.\",\n N00dles: \"by harnessing the power of the n00dles.\",\n YoureNotMeantToAccessThis: \"by accessing the dev menu.\",\n TrueRecursion: \"by truly recursing.\",\n INeedARainbow: \"by using the power of the rainbow.\",\n};\n\nexport function ExploitName(exploit: string): string {\n return names[exploit];\n}\n\nexport function sanitizeExploits(exploits: Exploit[]): Exploit[] {\n exploits = exploits.filter((e: Exploit) => Object.keys(Exploit).includes(e));\n return [...new Set(exploits)];\n}\n","import { Augmentation } from \"./Augmentation\";\nimport { StaticAugmentations } from \"./StaticAugmentations\";\nimport { PlayerOwnedAugmentation } from \"./PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"./data/AugmentationNames\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { Factions, factionExists } from \"../Faction/Factions\";\nimport { Player } from \"@player\";\nimport { prestigeAugmentation } from \"../Prestige\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { clearObject } from \"../utils/helpers/clearObject\";\n\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport {\n initBladeburnerAugmentations,\n initChurchOfTheMachineGodAugmentations,\n initGeneralAugmentations,\n initSoAAugmentations,\n initNeuroFluxGovernor,\n initUnstableCircadianModulator,\n} from \"./data/AugmentationCreator\";\nimport { Router } from \"../ui/GameRoot\";\nimport { mergeMultipliers } from \"../PersonObjects/Multipliers\";\n\nexport function AddToStaticAugmentations(aug: Augmentation): void {\n const name = aug.name;\n StaticAugmentations[name] = aug;\n}\n\nfunction createAugmentations(): void {\n [\n initNeuroFluxGovernor(),\n initUnstableCircadianModulator(),\n ...initGeneralAugmentations(),\n ...initSoAAugmentations(),\n ...(factionExists(FactionNames.Bladeburners) ? initBladeburnerAugmentations() : []),\n ...(factionExists(FactionNames.ChurchOfTheMachineGod) ? initChurchOfTheMachineGodAugmentations() : []),\n ].map(resetAugmentation);\n}\n\nfunction resetFactionAugmentations(): void {\n for (const name of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(name)) {\n Factions[name].augmentations = [];\n }\n }\n}\n\nfunction initAugmentations(): void {\n resetFactionAugmentations();\n clearObject(StaticAugmentations);\n createAugmentations();\n Player.reapplyAllAugmentations();\n}\n\nexport function getBaseAugmentationPriceMultiplier(): number {\n return CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][Player.sourceFileLvl(11)];\n}\nexport function getGenericAugmentationPriceMultiplier(): number {\n return Math.pow(getBaseAugmentationPriceMultiplier(), Player.queuedAugmentations.length);\n}\n\n//Resets an Augmentation during (re-initialization)\nfunction resetAugmentation(aug: Augmentation): void {\n aug.addToFactions(aug.factions);\n const name = aug.name;\n if (augmentationExists(name)) {\n delete StaticAugmentations[name];\n }\n AddToStaticAugmentations(aug);\n}\n\nfunction applyAugmentation(aug: PlayerOwnedAugmentation, reapply = false): void {\n const staticAugmentation = StaticAugmentations[aug.name];\n\n // Apply multipliers\n Player.mults = mergeMultipliers(Player.mults, staticAugmentation.mults);\n\n // Special logic for Congruity Implant\n if (aug.name === AugmentationNames.CongruityImplant && !reapply) {\n Player.entropy = 0;\n Player.applyEntropy(Player.entropy);\n }\n\n // Special logic for NeuroFlux Governor\n const ownedNfg = Player.augmentations.find((pAug) => pAug.name === AugmentationNames.NeuroFluxGovernor);\n if (aug.name === AugmentationNames.NeuroFluxGovernor && !reapply && ownedNfg) {\n ownedNfg.level = aug.level;\n return;\n }\n\n // Push onto Player's Augmentation list\n if (!reapply) {\n const ownedAug = new PlayerOwnedAugmentation(aug.name);\n\n Player.augmentations.push(ownedAug);\n }\n}\n\nfunction installAugmentations(force?: boolean): boolean {\n if (Player.queuedAugmentations.length == 0 && !force) {\n dialogBoxCreate(\"You have not purchased any Augmentations to install!\");\n return false;\n }\n let augmentationList = \"\";\n let nfgIndex = -1;\n for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n nfgIndex = i;\n break;\n }\n }\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n const ownedAug = Player.queuedAugmentations[i];\n const aug = StaticAugmentations[ownedAug.name];\n if (aug == null) {\n console.error(`Invalid augmentation: ${ownedAug.name}`);\n continue;\n }\n\n applyAugmentation(Player.queuedAugmentations[i]);\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;\n\n let level = \"\";\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {\n level = ` - ${ownedAug.level}`;\n }\n augmentationList += aug.name + level + \"\\n\";\n }\n Player.queuedAugmentations = [];\n if (!force) {\n dialogBoxCreate(\n \"You slowly drift to sleep as scientists put you under in order \" +\n \"to install the following Augmentations:\\n\" +\n augmentationList +\n \"\\nYou wake up in your home...you feel different...\",\n );\n }\n prestigeAugmentation();\n Router.toTerminal();\n return true;\n}\n\nfunction augmentationExists(name: string): boolean {\n return StaticAugmentations.hasOwnProperty(name);\n}\n\nexport function isRepeatableAug(aug: Augmentation | string): boolean {\n const augName = typeof aug === \"string\" ? aug : aug.name;\n return augName === AugmentationNames.NeuroFluxGovernor;\n}\n\nexport { installAugmentations, initAugmentations, applyAugmentation, augmentationExists };\n","import React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Money } from \"./Money\";\n\nexport function MoneyRate({ money }: { money: number }): JSX.Element {\n return <Money money={`${numeralWrapper.formatMoney(money)} / sec`} />;\n}\n","import { codingContractTypesMetadata, DescriptionFunc, GeneratorFunc, SolverFunc } from \"./data/codingcontracttypes\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"./utils/JSONReviver\";\nimport { CodingContractEvent } from \"./ui/React/CodingContractModal\";\n\n/* tslint:disable:no-magic-numbers completed-docs max-classes-per-file no-console */\n\n/* Represents different types of problems that a Coding Contract can have */\nclass CodingContractType {\n /** Function that generates a description of the problem */\n desc: DescriptionFunc;\n\n /** Number that generally represents the problem's difficulty. Bigger numbers = harder */\n difficulty: number;\n\n /** A function that randomly generates a valid 'data' for the problem */\n generate: GeneratorFunc;\n\n /** Name of the type of problem */\n name: string;\n\n /** The maximum number of tries the player gets on this kind of problem before it self-destructs */\n numTries: number;\n\n /** Stores a function that checks if the provided answer is correct */\n solver: SolverFunc;\n\n constructor(\n name: string,\n desc: DescriptionFunc,\n gen: GeneratorFunc,\n solver: SolverFunc,\n diff: number,\n numTries: number,\n ) {\n this.name = name;\n this.desc = desc;\n this.generate = gen;\n this.solver = solver;\n this.difficulty = diff;\n this.numTries = numTries;\n }\n}\n\n/* Contract Types */\n// tslint:disable-next-line\nexport const CodingContractTypes: Record<string, CodingContractType> = {};\n\nfor (const md of codingContractTypesMetadata) {\n // tslint:disable-next-line\n CodingContractTypes[md.name] = new CodingContractType(\n md.name,\n md.desc,\n md.gen,\n md.solver,\n md.difficulty,\n md.numTries,\n );\n}\n\n/** Enum representing the different types of rewards a Coding Contract can give */\nexport enum CodingContractRewardType {\n FactionReputation,\n FactionReputationAll,\n CompanyReputation,\n Money, // This must always be the last reward type\n}\n\n/** Enum representing the result when trying to solve the Contract */\nexport enum CodingContractResult {\n Success,\n Failure,\n Cancelled,\n}\n\n/** A class that represents the type of reward a contract gives */\nexport interface ICodingContractReward {\n /* Name of Company/Faction name for reward, if applicable */\n name?: string;\n type: CodingContractRewardType;\n}\n\n/**\n * A Coding Contract is a file that poses a programming-related problem to the Player.\n * The player receives a reward if the problem is solved correctly\n */\nexport class CodingContract {\n /* Relevant data for the contract's problem */\n data: unknown;\n\n /* Contract's filename */\n fn: string;\n\n /* Describes the reward given if this Contract is solved. The reward is actually\n processed outside of this file */\n reward: ICodingContractReward | null;\n\n /* Number of times the Contract has been attempted */\n tries = 0;\n\n /* String representing the contract's type. Must match type in ContractTypes */\n type: string;\n\n constructor(fn = \"\", type = \"Find Largest Prime Factor\", reward: ICodingContractReward | null = null) {\n this.fn = fn;\n if (!this.fn.endsWith(\".cct\")) {\n this.fn += \".cct\";\n }\n\n // tslint:disable-next-line\n if (CodingContractTypes[type] == null) {\n throw new Error(`Error: invalid contract type: ${type} please contact developer`);\n }\n\n this.type = type;\n this.data = CodingContractTypes[type].generate();\n this.reward = reward;\n }\n\n getData(): unknown {\n return this.data;\n }\n\n getDescription(): string {\n return CodingContractTypes[this.type].desc(this.data);\n }\n\n getDifficulty(): number {\n return CodingContractTypes[this.type].difficulty;\n }\n\n getMaxNumTries(): number {\n return CodingContractTypes[this.type].numTries;\n }\n\n getType(): string {\n return CodingContractTypes[this.type].name;\n }\n\n isSolution(solution: string): boolean {\n return CodingContractTypes[this.type].solver(this.data, solution);\n }\n\n /** Creates a popup to prompt the player to solve the problem */\n async prompt(): Promise<CodingContractResult> {\n return new Promise<CodingContractResult>((resolve) => {\n const props = {\n c: this,\n onClose: () => {\n resolve(CodingContractResult.Cancelled);\n },\n onAttempt: (val: string) => {\n if (this.isSolution(val)) {\n resolve(CodingContractResult.Success);\n } else {\n resolve(CodingContractResult.Failure);\n }\n },\n };\n CodingContractEvent.emit(props);\n });\n }\n\n /** Serialize the current file to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"CodingContract\", this);\n }\n\n /** Initializes a CodingContract from a JSON save state. */\n static fromJSON(value: IReviverValue): CodingContract {\n return Generic_fromJSON(CodingContract, value.data);\n }\n}\n\nReviver.constructors.CodingContract = CodingContract;\n","export enum OrderTypes {\n LimitBuy = \"Limit Buy Order\",\n LimitSell = \"Limit Sell Order\",\n StopBuy = \"Stop Buy Order\",\n StopSell = \"Stop Sell Order\",\n}\n","import { FragmentType } from \"./FragmentType\";\nimport { Shapes } from \"./data/Shapes\";\n\nexport const Fragments: Fragment[] = [];\n\nexport class Fragment {\n id: number;\n shape: boolean[][];\n type: FragmentType;\n power: number;\n limit: number;\n\n constructor(id: number, shape: boolean[][], type: FragmentType, power: number, limit: number) {\n this.id = id;\n this.shape = shape;\n this.type = type;\n this.power = power;\n this.limit = limit;\n }\n\n fullAt(x: number, y: number, rotation: number): boolean {\n if (y < 0) return false;\n if (y >= this.height(rotation)) return false;\n if (x < 0) return false;\n if (x >= this.width(rotation)) return false;\n // start xy, modifier xy\n let [sx, sy, mx, my] = [0, 0, 1, 1];\n if (rotation === 1) {\n [sx, sy, mx, my] = [this.width(rotation) - 1, 0, -1, 1];\n } else if (rotation === 2) {\n [sx, sy, mx, my] = [this.width(rotation) - 1, this.height(rotation) - 1, -1, -1];\n } else if (rotation === 3) {\n [sx, sy, mx, my] = [0, this.height(rotation) - 1, 1, -1];\n }\n let [qx, qy] = [sx + mx * x, sy + my * y];\n if (rotation % 2 === 1) [qx, qy] = [qy, qx];\n return this.shape[qy][qx];\n }\n\n width(rotation: number): number {\n if (rotation % 2 === 0) return this.shape[0].length;\n return this.shape.length;\n }\n\n height(rotation: number): number {\n if (rotation % 2 === 0) return this.shape.length;\n return this.shape[0].length;\n }\n\n // List of direct neighbors of this fragment.\n neighbors(rotation: number): number[][] {\n const candidates: number[][] = [];\n\n const add = (x: number, y: number): void => {\n if (this.fullAt(x, y, rotation)) return;\n if (candidates.some((coord) => coord[0] === x && coord[1] === y)) return;\n candidates.push([x, y]);\n };\n for (let y = 0; y < this.height(rotation); y++) {\n for (let x = 0; x < this.width(rotation); x++) {\n // This cell is full, add all it's neighbors.\n if (!this.fullAt(x, y, rotation)) continue;\n add(x - 1, y);\n add(x + 1, y);\n add(x, y - 1);\n add(x, y + 1);\n }\n }\n const cells: number[][] = [];\n for (const candidate of candidates) {\n if (cells.some((cell) => cell[0] === candidate[0] && cell[1] === candidate[1])) continue;\n cells.push(candidate);\n }\n\n return cells;\n }\n\n copy(): Fragment {\n return Object.assign({}, this);\n }\n}\n\nexport function FragmentById(id: number): Fragment | null {\n for (const fragment of Fragments) {\n if (fragment.id === id) return fragment;\n }\n return null;\n}\n\n(function () {\n const _ = false;\n const X = true;\n Fragments.push(\n new Fragment(\n 0, // id\n Shapes.S,\n FragmentType.Hacking, // type\n 1,\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 1, // id\n Shapes.Z,\n FragmentType.Hacking, // type\n 1,\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 5, // id\n Shapes.T,\n FragmentType.HackingSpeed, // type\n 1.3,\n 1, // limit\n ),\n );\n\n Fragments.push(\n new Fragment(\n 6, // id\n Shapes.I,\n FragmentType.HackingMoney, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 7, // id\n Shapes.J,\n FragmentType.HackingGrow, // type\n 0.5, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 10, // id\n Shapes.T,\n FragmentType.Strength, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 12, // id\n Shapes.L,\n FragmentType.Defense, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 14, // id\n Shapes.L,\n FragmentType.Dexterity, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 16, // id\n Shapes.S,\n FragmentType.Agility, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 18, // id\n Shapes.S,\n FragmentType.Charisma, // type\n 3, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 20, // id\n Shapes.I,\n FragmentType.HacknetMoney, // type\n 1, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 21, // id\n Shapes.O,\n FragmentType.HacknetCost, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 25, // id\n Shapes.J,\n FragmentType.Rep, // type\n 0.5, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 27, // id\n Shapes.J,\n FragmentType.WorkMoney, // type\n 10, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 28, // id\n Shapes.L,\n FragmentType.Crime, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 30, // id\n Shapes.S,\n FragmentType.Bladeburner, // type\n 0.4, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 100, // id\n [\n // shape\n [_, X, X],\n [X, X, _],\n [_, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 101, // id\n [\n // shape\n [X, X, X, X],\n [X, _, _, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 102, // id\n [\n // shape\n [_, X, X, X],\n [X, X, _, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 103, // id\n [\n // shape\n [X, X, X, _],\n [_, _, X, X],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 104, // id\n [\n // shape\n [_, X, X],\n [_, X, _],\n [X, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 105, // id\n [\n // shape\n [_, _, X],\n [_, X, X],\n [X, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 106, // id\n [\n // shape\n [X, _, _],\n [X, X, X],\n [X, _, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 107, // id\n [\n // shape\n [_, X, _],\n [X, X, X],\n [_, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n})();\n\nexport const NoneFragment = new Fragment(-2, [], FragmentType.None, 0, Infinity);\nexport const DeleteFragment = new Fragment(-2, [], FragmentType.Delete, 0, Infinity);\n","function uuidv4(): string {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\n/** Generic Event Emitter class following a subscribe/publish paradigm. */\nexport class EventEmitter<T extends any[]> {\n subscribers: { [key: string]: (...args: [...T]) => void | undefined } = {};\n\n subscribe(s: (...args: [...T]) => void): () => void {\n let uuid = uuidv4();\n while (this.subscribers[uuid] !== undefined) uuid = uuidv4();\n this.subscribers[uuid] = s;\n\n return () => {\n delete this.subscribers[uuid];\n };\n }\n\n emit(...args: [...T]): void {\n for (const s in this.subscribers) {\n const sub = this.subscribers[s];\n if (sub === undefined) continue;\n\n sub(...args);\n }\n }\n}\n","import * as monaco from \"monaco-editor\";\nimport type { Monaco } from \"@monaco-editor/react\";\n\nexport interface IScriptEditorTheme {\n base: \"vs\" | \"vs-dark\" | \"hc-black\";\n inherit: boolean;\n common: {\n accent: string;\n bg: string;\n fg: string;\n };\n syntax: {\n tag: string;\n entity: string;\n string: string;\n regexp: string;\n markup: string;\n keyword: string;\n comment: string;\n constant: string;\n error: string;\n };\n ui: {\n line: string;\n panel: {\n bg: string;\n selected: string;\n border: string;\n };\n selection: {\n bg: string;\n };\n };\n}\n\nexport const defaultMonacoTheme: IScriptEditorTheme = {\n base: \"vs-dark\",\n inherit: true,\n common: {\n accent: \"B5CEA8\",\n bg: \"1E1E1E\",\n fg: \"D4D4D4\",\n },\n syntax: {\n tag: \"569CD6\",\n entity: \"569CD6\",\n string: \"CE9178\",\n regexp: \"646695\",\n markup: \"569CD6\",\n keyword: \"569CD6\",\n comment: \"6A9955\",\n constant: \"569CD6\",\n error: \"F44747\",\n },\n ui: {\n line: \"1E1E1E\",\n panel: {\n bg: \"252526\",\n selected: \"252526\",\n border: \"1E1E1E\",\n },\n selection: {\n bg: \"ADD6FF26\",\n },\n },\n};\n\n// Regex used for token color validation\n// https://github.com/microsoft/vscode/blob/973684056e67153952f495fce93bf50d0ec0b892/src/vs/editor/common/languages/supports/tokenization.ts#L153\nconst colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;\n\n// Recursively sanitize the theme data to prevent errors\n// Invalid data will be replaced with FF0000 (bright red)\nexport const sanitizeTheme = (theme: IScriptEditorTheme): void => {\n for (const [k, v] of Object.entries(theme)) {\n switch (k) {\n case \"base\":\n if (![\"vs-dark\", \"vs\"].includes(theme.base)) theme.base = \"vs-dark\";\n continue;\n case \"inherit\":\n if (typeof theme.inherit !== \"boolean\") theme.inherit = true;\n continue;\n }\n\n const repairBlock = (block: { [key: string]: object | string }): void => {\n for (const [k, v] of Object.entries(block)) {\n if (typeof v === \"object\") {\n repairBlock(v as { [key: string]: string });\n } else if (!v.match(colorRegExp)) block[k] = \"FF0000\";\n }\n };\n repairBlock(v);\n }\n};\n\nexport function makeTheme(theme: IScriptEditorTheme): monaco.editor.IStandaloneThemeData {\n const themeRules = [\n {\n token: \"\",\n background: theme.ui.line,\n foreground: theme.common.fg,\n },\n {\n token: \"identifier\",\n foreground: theme.common.accent,\n },\n {\n token: \"keyword\",\n foreground: theme.syntax.keyword,\n },\n {\n token: \"string\",\n foreground: theme.syntax.string,\n },\n {\n token: \"string.escape\",\n foreground: theme.syntax.regexp,\n },\n {\n token: \"comment\",\n foreground: theme.syntax.comment,\n },\n {\n token: \"constant\",\n foreground: theme.syntax.constant,\n },\n {\n token: \"entity\",\n foreground: theme.syntax.entity,\n },\n {\n token: \"type\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"tag\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"regexp\",\n foreground: theme.syntax.regexp,\n },\n {\n token: \"attribute\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"constructor\",\n foreground: theme.syntax.markup,\n },\n {\n token: \"invalid\",\n foreground: theme.syntax.error,\n },\n {\n token: \"number\",\n foreground: theme.common.accent,\n },\n {\n token: \"delimiter\",\n foreground: theme.common.fg,\n },\n // Custom tokens\n {\n token: \"ns\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"netscriptfunction\",\n foreground: theme.syntax.markup,\n },\n {\n token: \"otherkeywords\",\n foreground: theme.syntax.keyword,\n },\n {\n token: \"otherkeyvars\",\n foreground: theme.common.accent,\n },\n {\n token: \"this\",\n foreground: theme.syntax.tag,\n },\n ];\n\n const themeColors = Object.fromEntries(\n [\n [\"editor.background\", theme.common.bg],\n [\"editor.foreground\", theme.common.fg],\n [\"editor.lineHighlightBackground\", theme.ui.line],\n [\"editor.selectionBackground\", theme.ui.selection.bg],\n\n [\"editorSuggestWidget.background\", theme.ui.panel.bg],\n [\"editorSuggestWidget.border\", theme.ui.panel.border],\n [\"editorSuggestWidget.selectedBackground\", theme.ui.panel.selected],\n\n [\"editorHoverWidget.background\", theme.ui.panel.bg],\n [\"editorHoverWidget.border\", theme.ui.panel.border],\n\n [\"editorWidget.background\", theme.ui.panel.bg],\n [\"editorWidget.border\", theme.ui.panel.border],\n\n [\"input.background\", theme.ui.panel.bg],\n [\"input.border\", theme.ui.panel.border],\n ].map(([k, v]) => [k, \"#\" + v]),\n );\n\n return { base: theme.base, inherit: theme.inherit, rules: themeRules, colors: themeColors };\n}\n\nexport async function loadThemes(monaco: Monaco): Promise<void> {\n monaco.editor.defineTheme(\"monokai\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n background: \"272822\",\n token: \"\",\n },\n {\n foreground: \"75715e\",\n token: \"comment\",\n },\n {\n foreground: \"e6db74\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"ae81ff\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"ae81ff\",\n },\n {\n foreground: \"ae81ff\",\n token: \"function\",\n },\n {\n foreground: \"f92672\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"ae81ff\",\n },\n {\n token: \"ns\",\n foreground: \"97d92b\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"53d3e4\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"53d3e4\",\n },\n {\n token: \"this\",\n foreground: \"fd971f\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#F8F8F2\",\n \"editor.background\": \"#272822\",\n \"editor.selectionBackground\": \"#49483E\",\n \"editor.lineHighlightBackground\": \"#3E3D32\",\n \"editorCursor.foreground\": \"#F8F8F0\",\n \"editorWhitespace.foreground\": \"#3B3A32\",\n \"editorIndentGuide.activeBackground\": \"#9D550FB0\",\n \"editor.selectionHighlightBorder\": \"#222218\",\n },\n });\n\n monaco.editor.defineTheme(\"solarized-dark\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n background: \"002b36\",\n token: \"\",\n },\n {\n foreground: \"586e75\",\n token: \"comment\",\n },\n {\n foreground: \"00afaf\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"00afaf\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"268bd2\",\n },\n {\n foreground: \"268bd2\",\n token: \"function\",\n },\n {\n foreground: \"859900\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"cb4b16\",\n },\n {\n token: \"ns\",\n foreground: \"cb4b16\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"268bd2\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"268bd2\",\n },\n {\n token: \"type.identifier.js\",\n foreground: \"b58900\",\n },\n {\n token: \"delimiter.square.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"delimiter.bracket.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"this\",\n foreground: \"cb4b16\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#839496\",\n \"editor.background\": \"#002b36\",\n \"editor.selectionBackground\": \"#073642\",\n \"editor.lineHighlightBackground\": \"#073642\",\n \"editorCursor.foreground\": \"#819090\",\n \"editorWhitespace.foreground\": \"#073642\",\n \"editorIndentGuide.activeBackground\": \"#9D550FB0\",\n \"editor.selectionHighlightBorder\": \"#222218\",\n },\n });\n\n monaco.editor.defineTheme(\"solarized-light\", {\n base: \"vs\",\n inherit: true,\n rules: [\n {\n foreground: \"657b83\",\n background: \"fdf6e3\",\n token: \"\",\n },\n {\n foreground: \"586e75\",\n token: \"comment\",\n },\n {\n foreground: \"2aa198\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"2aa198\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"268bd2\",\n },\n {\n foreground: \"268bd2\",\n token: \"function\",\n },\n {\n foreground: \"859900\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"bc4b16\",\n },\n {\n token: \"ns\",\n foreground: \"cb4b16\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"268bd2\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"268bd2\",\n },\n {\n token: \"type.identifier.js\",\n foreground: \"b58900\",\n },\n {\n token: \"delimiter.square.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"delimiter.bracket.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"this\",\n foreground: \"cb4b16\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#657b83\",\n \"editor.background\": \"#fdf6e3\",\n \"editor.selectionBackground\": \"#eee8d5\",\n \"editor.lineHighlightBackground\": \"#eee8d5\",\n \"editorCursor.foreground\": \"#657b83\",\n \"editorWhitespace.foreground\": \"#eee8d5\",\n \"editorIndentGuide.activeBackground\": \"#eee8d5\",\n \"editor.selectionHighlightBorder\": \"#073642\",\n },\n });\n\n monaco.editor.defineTheme(\"dracula\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n background: \"282A36\",\n foreground: \"F8F8F2\",\n token: \"\",\n },\n {\n foreground: \"6272A4\",\n token: \"comment\",\n },\n {\n foreground: \"F1FA8C\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"BD93F9\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"BD93F9\",\n },\n {\n foreground: \"FF79C6\",\n token: \"function\",\n },\n {\n foreground: \"FF79C6\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"FF79C6\",\n },\n {\n token: \"ns\",\n foreground: \"FFB86C\",\n fontStyle: \"italic\",\n },\n\n {\n token: \"netscriptfunction\",\n foreground: \"FF79C6\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"FF68A7\",\n },\n {\n token: \"type.identifier.js\",\n foreground: \"7EE9FD\",\n fontStyle: \"italic\",\n },\n {\n token: \"delimiter.square.js\",\n foreground: \"FFD709\",\n },\n {\n token: \"delimiter.parenthesis.js\",\n foreground: \"FFD709\",\n },\n {\n token: \"delimiter.bracket.js\",\n foreground: \"FFD709\",\n },\n {\n token: \"this\",\n foreground: \"BD93F9\",\n fontStyle: \"italic\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#F8F8F2\",\n \"editor.background\": \"#282A36\",\n \"editorLineNumber.foreground\": \"#6272A4\",\n \"editor.selectionBackground\": \"#44475A\",\n \"editor.selectionHighlightBackground\": \"#424450\",\n \"editor.foldBackground\": \"#21222C\",\n \"editor.wordHighlightBackground\": \"#8BE9FD50\",\n \"editor.wordHighlightStrongBackground\": \"#50FA7B50\",\n \"editor.findMatchBackground\": \"#FFB86C80\",\n \"editor.findMatchHighlightBackground\": \"#FFFFFF40\",\n \"editor.findRangeHighlightBackground\": \"#44475A75\",\n \"editor.hoverHighlightBackground\": \"#8BE9FD50\",\n \"editor.lineHighlightBorder\": \"#44475A\",\n \"editor.rangeHighlightBackground\": \"#BD93F915\",\n \"editor.snippetTabstopHighlightBackground\": \"#282A36\",\n \"editor.snippetTabstopHighlightBorder\": \"#6272A4\",\n \"editor.snippetFinalTabstopHighlightBackground\": \"#282A36\",\n \"editor.snippetFinalTabstopHighlightBorder\": \"#50FA7B\",\n },\n });\n\n monaco.editor.defineTheme(\"one-dark\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n token: \"\",\n background: \"333842\",\n foreground: \"ABB2BF\",\n },\n {\n token: \"comment\",\n foreground: \"5C6370\",\n },\n {\n token: \"string\",\n foreground: \"98C379\",\n },\n {\n token: \"number\",\n foreground: \"D19A66\",\n },\n {\n token: \"function\",\n foreground: \"C678DD\",\n },\n {\n token: \"keyword\",\n foreground: \"C678DD\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"D19A66\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"C678DD\",\n },\n {\n token: \"ns\",\n foreground: \"E06C75\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"61AFEF\",\n },\n {\n token: \"type.identifier\",\n foreground: \"E5C07B\",\n },\n {\n token: \"delimiter\",\n foreground: \"ABB2BF\",\n },\n {\n token: \"this\",\n foreground: \"E06C75\",\n },\n ],\n colors: {\n \"editor.background\": \"#282C34\",\n \"editor.foreground\": \"#ABB2BF\",\n \"editor.lineHighlightBackground\": \"#99BBFF0A\",\n \"editor.selectionBackground\": \"#3E4451\",\n \"editor.findMatchHighlightBackground\": \"#528BFF3D\",\n \"editorCursor.foreground\": \"#528BFF\",\n \"editorHoverWidget.background\": \"#21252B\",\n \"editorHoverWidget.border\": \"#181A1F\",\n \"editorIndentGuide.background\": \"#ABB2BF26\",\n \"editorIndentGuide.activeBackground\": \"#626772\",\n \"editorLineNumber.foreground\": \"#636D83\",\n \"editorLineNumber.activeForeground\": \"#ABB2BF\",\n \"editorSuggestWidget.background\": \"#21252B\",\n \"editorSuggestWidget.border\": \"#181A1F\",\n \"editorSuggestWidget.selectedBackground\": \"#2C313A\",\n \"editorWhitespace.foreground\": \"#ABB2BF26\",\n \"editorWidget.background\": \"#21252B\",\n \"editorWidget.border\": \"#3A3F4B\",\n \"input.background\": \"#1B1D23\",\n \"input.border\": \"#181A1F\",\n \"peekView.border\": \"#528BFF\",\n \"peekViewResult.background\": \"#21252B\",\n \"peekViewResult.selectionBackground\": \"#2C313A\",\n \"peekViewTitle.background\": \"#1B1D23\",\n \"peekViewEditor.background\": \"#1B1D23\",\n \"scrollbarSlider.background\": \"#4E566680\",\n \"scrollbarSlider.activeBackground\": \"#747D9180\",\n \"scrollbarSlider.hoverBackground\": \"#5A637580\",\n },\n });\n}\n","import React, { useState } from \"react\";\nimport AddIcon from \"@mui/icons-material/Add\";\nimport RemoveIcon from \"@mui/icons-material/Remove\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ClearIcon from \"@mui/icons-material/Clear\";\nimport DoubleArrowIcon from \"@mui/icons-material/DoubleArrow\";\nimport TextField from \"@mui/material/TextField\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IProps {\n label: string;\n placeholder: string;\n add: (x: number) => void;\n subtract: (x: number) => void;\n tons: () => void;\n reset: () => void;\n}\n\nexport function Adjuster(props: IProps): React.ReactElement {\n const [value, setValue] = useState<number | string>(\"\");\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setValue(\"\");\n else setValue(parseFloat(event.target.value));\n }\n\n const { label, placeholder, add, subtract, reset, tons } = props;\n return (\n <>\n <TextField\n label={label}\n value={value}\n onChange={onChange}\n placeholder={placeholder}\n type=\"number\"\n InputProps={{\n startAdornment: (\n <>\n <Tooltip title=\"Add a lot\">\n <IconButton onClick={tons} size=\"large\">\n <DoubleArrowIcon style={{ transform: \"rotate(-90deg)\" }} />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Add\">\n <IconButton onClick={() => add(typeof value !== \"string\" ? value : 0)} size=\"large\">\n <AddIcon />\n </IconButton>\n </Tooltip>\n </>\n ),\n endAdornment: (\n <>\n <Tooltip title=\"Remove\">\n <IconButton onClick={() => subtract(typeof value !== \"string\" ? value : 0)} size=\"large\">\n <RemoveIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Reset\">\n <IconButton onClick={reset} size=\"large\">\n <ClearIcon />\n </IconButton>\n </Tooltip>\n </>\n ),\n }}\n />\n </>\n );\n}\n","import { FormControlLabel, Switch, Tooltip, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface IProps {\n checked: boolean;\n onChange: (newValue: boolean, error?: string) => void;\n text: React.ReactNode;\n tooltip: React.ReactNode;\n}\n\nexport function OptionSwitch({ checked, onChange, text, tooltip }: IProps): React.ReactElement {\n const [value, setValue] = useState(checked);\n\n function handleSwitchChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setValue(event.target.checked);\n }\n\n useEffect(() => onChange(value), [value]);\n\n return (\n <>\n <FormControlLabel\n control={<Switch checked={value} onChange={handleSwitchChange} />}\n label={\n <Tooltip title={<Typography>{tooltip}</Typography>}>\n <Typography>{text}</Typography>\n </Tooltip>\n }\n />\n <br />\n </>\n );\n}\n","import { KEY } from \"../utils/helpers/keyCodes\";\n\nexport function random(min: number, max: number): number {\n return Math.random() * (max - min) + min;\n}\n\nexport const upArrowSymbol = \"↑\";\nexport const downArrowSymbol = \"↓\";\nexport const leftArrowSymbol = \"←\";\nexport const rightArrowSymbol = \"→\";\n\nexport function getArrow(event: KeyboardEvent): string {\n switch (event.key) {\n case KEY.UP_ARROW:\n case KEY.W:\n return upArrowSymbol;\n case KEY.LEFT_ARROW:\n case KEY.A:\n return leftArrowSymbol;\n case KEY.DOWN_ARROW:\n case KEY.S:\n return downArrowSymbol;\n case KEY.RIGHT_ARROW:\n case KEY.D:\n return rightArrowSymbol;\n }\n return \"\";\n}\n\nexport function getInverseArrow(event: KeyboardEvent): string {\n switch (event.key) {\n case KEY.DOWN_ARROW:\n case KEY.S:\n return upArrowSymbol;\n case KEY.RIGHT_ARROW:\n case KEY.D:\n return leftArrowSymbol;\n case KEY.UP_ARROW:\n case KEY.W:\n return downArrowSymbol;\n case KEY.LEFT_ARROW:\n case KEY.A:\n return rightArrowSymbol;\n }\n return \"\";\n}\n","import { Operation, IOperationParams } from \"./Operation\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class BlackOperation extends Operation {\n constructor(params: IOperationParams | null = null) {\n super(params);\n this.count = 1;\n }\n\n // To be implemented by subtypes\n getActionTimePenalty(): number {\n return 1.5;\n }\n\n getChaosCompetencePenalty(/*inst: Bladeburner, params: ISuccessChanceParams*/): number {\n return 1;\n }\n\n getChaosDifficultyBonus(/*inst: Bladeburner, params: ISuccessChanceParams*/): number {\n return 1;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"BlackOperation\", this);\n }\n\n static fromJSON(value: IReviverValue): Operation {\n return Generic_fromJSON(BlackOperation, value.data);\n }\n}\n\nReviver.constructors.BlackOperation = BlackOperation;\n","export enum CrimeType {\n None = \"\",\n SHOPLIFT = \"SHOPLIFT\", //\"shoplift\",\n ROB_STORE = \"ROBSTORE\", //\"rob a store\",\n MUG = \"MUG\", //\"mug someone\",\n LARCENY = \"LARCENY\", //\"commit larceny\",\n DRUGS = \"DRUGS\", //\"deal drugs\",\n BOND_FORGERY = \"BONDFORGERY\", //\"forge corporate bonds\",\n TRAFFIC_ARMS = \"TRAFFICKARMS\", //\"traffick illegal arms\",\n HOMICIDE = \"HOMICIDE\", //\"commit homicide\",\n GRAND_THEFT_AUTO = \"GRANDTHEFTAUTO\", //\"commit grand theft auto\",\n KIDNAP = \"KIDNAP\", //\"kidnap someone for ransom\",\n ASSASSINATION = \"ASSASSINATION\", //\"assassinate a high-profile target\",\n HEIST = \"HEIST\", //\"pull off the ultimate heist\",\n}\n","// Defines the ResearchTree that is common to all Corporation Industries\n// i.e. all Industries have these types of Research available to unlock\nimport { Research } from \"../Research\";\nimport { ResearchMap } from \"../ResearchMap\";\nimport { ResearchTree, Node } from \"../ResearchTree\";\n\nfunction makeNode(name: string): Node {\n const research: Research | null = ResearchMap[name];\n if (research == null) {\n throw new Error(`Invalid research name: ${name}`);\n }\n\n return new Node({ text: research.name, cost: research.cost });\n}\n\n// Creates the Nodes for the BaseResearchTree.\n// Return the Root Node\nfunction createBaseResearchTreeNodes(): Node {\n const rootNode: Node = makeNode(\"Hi-Tech R&D Laboratory\");\n const autoBrew: Node = makeNode(\"AutoBrew\");\n const autoParty: Node = makeNode(\"AutoPartyManager\");\n const autoDrugs: Node = makeNode(\"Automatic Drug Administration\");\n const bulkPurchasing: Node = makeNode(\"Bulk Purchasing\");\n const cph4: Node = makeNode(\"CPH4 Injections\");\n const drones: Node = makeNode(\"Drones\");\n const dronesAssembly: Node = makeNode(\"Drones - Assembly\");\n const dronesTransport: Node = makeNode(\"Drones - Transport\");\n const goJuice: Node = makeNode(\"Go-Juice\");\n const hrRecruitment: Node = makeNode(\"HRBuddy-Recruitment\");\n const hrTraining: Node = makeNode(\"HRBuddy-Training\");\n const joywire: Node = makeNode(\"JoyWire\");\n const marketta1: Node = makeNode(\"Market-TA.I\");\n const marketta2: Node = makeNode(\"Market-TA.II\");\n const overclock: Node = makeNode(\"Overclock\");\n const scAssemblers: Node = makeNode(\"Self-Correcting Assemblers\");\n const stimu: Node = makeNode(\"Sti.mu\");\n\n autoDrugs.addChild(goJuice);\n autoDrugs.addChild(cph4);\n\n drones.addChild(dronesAssembly);\n drones.addChild(dronesTransport);\n\n hrRecruitment.addChild(hrTraining);\n\n marketta1.addChild(marketta2);\n\n overclock.addChild(stimu);\n\n rootNode.addChild(autoBrew);\n rootNode.addChild(autoParty);\n rootNode.addChild(autoDrugs);\n rootNode.addChild(bulkPurchasing);\n rootNode.addChild(drones);\n rootNode.addChild(hrRecruitment);\n rootNode.addChild(joywire);\n rootNode.addChild(marketta1);\n rootNode.addChild(overclock);\n rootNode.addChild(scAssemblers);\n\n return rootNode;\n}\n\nexport function getBaseResearchTreeCopy(): ResearchTree {\n const baseResearchTree: ResearchTree = new ResearchTree();\n baseResearchTree.setRoot(createBaseResearchTreeNodes());\n\n return baseResearchTree;\n}\n\n// Base Research Tree for Industry's that make products\nexport function getProductIndustryResearchTreeCopy(): ResearchTree {\n const researchTree: ResearchTree = new ResearchTree();\n const root = createBaseResearchTreeNodes();\n\n const upgradeFulcrum = makeNode(\"uPgrade: Fulcrum\");\n const upgradeCapacity1 = makeNode(\"uPgrade: Capacity.I\");\n const upgradeCapacity2 = makeNode(\"uPgrade: Capacity.II\");\n const upgradeDashboard = makeNode(\"uPgrade: Dashboard\");\n\n upgradeCapacity1.addChild(upgradeCapacity2);\n upgradeFulcrum.addChild(upgradeCapacity1);\n upgradeFulcrum.addChild(upgradeDashboard);\n root.addChild(upgradeFulcrum);\n\n researchTree.setRoot(root);\n\n return researchTree;\n}\n","import { GetServer, createUniqueRandomIp, ipExists } from \"./AllServers\";\nimport { Server, IConstructorParams } from \"./Server\";\nimport { BaseServer } from \"./BaseServer\";\nimport { calculateServerGrowth } from \"./formulas/grow\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { Player } from \"@player\";\nimport { Programs } from \"../Programs/Programs\";\nimport { LiteratureNames } from \"../Literature/data/LiteratureNames\";\n\nimport { isValidNumber } from \"../utils/helpers/isValidNumber\";\n\n/**\n * Constructs a new server, while also ensuring that the new server\n * does not have a duplicate hostname/ip.\n */\nexport function safelyCreateUniqueServer(params: IConstructorParams): Server {\n let hostname: string = params.hostname.replace(/ /g, `-`);\n\n if (params.ip != null && ipExists(params.ip)) {\n params.ip = createUniqueRandomIp();\n }\n\n if (GetServer(hostname) != null) {\n if (hostname.slice(-2) != `-0`) {\n hostname = `${hostname}-0`;\n }\n\n // Use a for loop to ensure that we don't get suck in an infinite loop somehow\n for (let i = 0; i < 200; ++i) {\n hostname = hostname.replace(/-[0-9]+$/, `-${i}`);\n if (GetServer(hostname) == null) {\n break;\n }\n }\n }\n\n params.hostname = hostname;\n return new Server(params);\n}\n\n/**\n * Returns the number of \"growth cycles\" needed to grow the specified server by the\n * specified amount.\n * @param server - Server being grown\n * @param growth - How much the server is being grown by, in DECIMAL form (e.g. 1.5 rather than 50)\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowth(server: Server, growth: number, cores = 1): number {\n let ajdGrowthRate = 1 + (CONSTANTS.ServerBaseGrowthRate - 1) / server.hackDifficulty;\n if (ajdGrowthRate > CONSTANTS.ServerMaxGrowthRate) {\n ajdGrowthRate = CONSTANTS.ServerMaxGrowthRate;\n }\n\n const serverGrowthPercentage = server.serverGrowth / 100;\n\n const coreBonus = 1 + (cores - 1) / 16;\n const cycles =\n Math.log(growth) /\n (Math.log(ajdGrowthRate) *\n Player.mults.hacking_grow *\n serverGrowthPercentage *\n BitNodeMultipliers.ServerGrowthRate *\n coreBonus);\n\n return cycles;\n}\n\n/**\n * This function calculates the number of threads needed to grow a server from one $amount to a higher $amount\n * (ie, how many threads to grow this server from $200 to $600 for example). Used primarily for a formulas (or possibly growthAnalyze)\n * type of application. It lets you \"theorycraft\" and easily ask what-if type questions. It's also the one that implements the\n * main thread calculation algorithm, and so is the function all helper functions should call.\n * It protects the inputs (so putting in INFINITY for targetMoney will use moneyMax, putting in a negative for start will use 0, etc.)\n * @param server - Server being grown\n * @param targetMoney - How much you want the server grown TO (not by), for instance, to grow from 200 to 600, input 600\n * @param startMoney - How much you are growing the server from, for instance, to grow from 200 to 600, input 200\n * @param cores - Number of cores on the host performing grow\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowthCorrected(server: Server, targetMoney: number, startMoney: number, cores = 1): number {\n if (startMoney < 0) {\n startMoney = 0;\n } // servers \"can't\" have less than 0 dollars on them\n if (targetMoney > server.moneyMax) {\n targetMoney = server.moneyMax;\n } // can't grow a server to more than its moneyMax\n if (targetMoney <= startMoney) {\n return 0;\n } // no growth --> no threads\n\n // exponential base adjusted by security\n const adjGrowthRate = 1 + (CONSTANTS.ServerBaseGrowthRate - 1) / server.hackDifficulty;\n const exponentialBase = Math.min(adjGrowthRate, CONSTANTS.ServerMaxGrowthRate); // cap growth rate\n\n // total of all grow thread multipliers\n const serverGrowthPercentage = server.serverGrowth / 100.0;\n const coreMultiplier = 1 + (cores - 1) / 16;\n const threadMultiplier =\n serverGrowthPercentage * Player.mults.hacking_grow * coreMultiplier * BitNodeMultipliers.ServerGrowthRate;\n\n /* To understand what is done below we need to do some math. I hope the explanation is clear enough.\n * First of, the names will be shortened for ease of manipulation:\n * n:= targetMoney (n for new), o:= startMoney (o for old), b:= exponentialBase, t:= threadMultiplier, c:= cycles/threads\n * c is what we are trying to compute.\n *\n * After growing, the money on a server is n = (o + c) * b^(c*t)\n * c appears in an exponent and outside it, this is usually solved using the productLog/lambert's W special function\n * this function will be noted W in the following\n * The idea behind lambert's W function is W(x)*exp(W(x)) = x, or in other words, solving for y, y*exp(y) = x, as a function of x\n * This function is provided in some advanced math library but we will compute it ourself here.\n *\n * Let's get back to solving the equation. It cannot be rewrote using W immediately because the base of the exponentiation is b\n * b^(c*t) = exp(ln(b)*c*t) (this is how a^b is defined on reals, it matches the definition on integers)\n * so n = (o + c) * exp(ln(b)*c*t) , W still cannot be used directly. We want to eliminate the other terms in 'o + c' and 'ln(b)*c*t'.\n *\n * A change of variable will do. The idea is to add an equation introducing a new variable (w here) in the form c = f(w) (for some f)\n * With this equation we will eliminate all references to c, then solve for w and plug the result in the new equation to get c.\n * The change of variable performed here should get rid of the unwanted terms mentioned above, c = w/(ln(b)*t) - o should help.\n * This change of variable is allowed because whatever the value of c is, there is a value of w such that this equation holds:\n * w = (c + o)*ln(b)*t (see how we used the terms we wanted to eliminate in order to build this variable change)\n *\n * We get n = (o + w/(ln(b)*t) - o) * exp(ln(b)*(w/(ln(b)*t) - o)*t) [ = w/(ln(b)*t) * exp(w - ln(b)*o*t) ]\n * The change of variable exposed exp(w - o*ln(b)*t), we can rewrite that with exp(a - b) = exp(a)/exp(b) to isolate 'w*exp(w)'\n * n = w/(ln(b)*t) * exp(w)/exp(ln(b)*o*t) [ = w*exp(w) / (ln(b) * t * b^(o*t)) ]\n * Almost there, we just need to cancel the denominator on the right side of the equation:\n * n * ln(b) * t * b^(o*t) = w*exp(w), Thus w = W(n * ln(b) * t * b^(o*t))\n * Finally we invert the variable change: c = W(n * ln(b) * t * b^(o*t))/(ln(b)*t) - o\n *\n * There is still an issue left: b^(o*t) doesn't fit inside a double precision float\n * because the typical amount of money on servers is around 10^6~10^9\n * We need to get an approximation of W without computing the power when o is huge\n * Thankfully an approximation giving ~30% error uses log immediately so we will use\n * W(n * ln(b) * t * b^(o*t)) ~= log(n * ln(b) * t * b^(o*t)) = log(n * ln(b) * t) + log(exp(ln(b) * o * t))\n * = log(n * ln(b) * t) + ln(b) * o * t\n * (thanks to Drak for the grow formula, f4113nb34st and Wolfram Alpha for the rewrite, dwRchyngqxs for the explanation)\n */\n const x = threadMultiplier * Math.log(exponentialBase);\n const y = startMoney * x + Math.log(targetMoney * x);\n /* Code for the approximation of lambert's W function is adapted from\n * https://git.savannah.gnu.org/cgit/gsl.git/tree/specfunc/lambert.c\n * using the articles [1] https://doi.org/10.1007/BF02124750 (algorithm above)\n * and [2] https://doi.org/10.1145/361952.361970 (initial approximation when x < 2.5)\n */\n let w;\n if (y < Math.log(2.5)) {\n /* exp(y) can be safely computed without overflow.\n * The relative error on the result is better when exp(y) < 2.5\n * using Padé rational fraction approximation [2](5)\n */\n const ey = Math.exp(y);\n w = (ey + (4 / 3) * ey * ey) / (1 + (7 / 3) * ey + (5 / 6) * ey * ey);\n } else {\n /* obtain initial approximation from rough asymptotic [1](4.18)\n * w = y [- log y when 0 <= y]\n */\n w = y;\n if (y > 0) w -= Math.log(y);\n }\n let cycles = w / x - startMoney;\n\n /* Iterative refinement, the goal is to correct c until |(o + c) * b^(c*t) - n| < 1\n * or the correction on the approximation is less than 1\n * The Newton-Raphson method will be used, this method is a classic to find roots of functions\n * (given f, find c such that f(c) = 0).\n *\n * The idea of this method is to take the horizontal position at which the horizontal axis\n * intersects with of the tangent of the function's curve as the next approximation.\n * It is equivalent to treating the curve as a line (it is called a first order approximation)\n * If the current approximation is c then the new approximated value is c - f(c)/f'(c)\n * (where f' is the derivative of f).\n *\n * In our case f(c) = (o + c) * b^(c*t) - n, f'(c) = d((o + c) * b^(c*t) - n)/dc\n * = (ln(b)*t * (c + o) + 1) * b^(c*t)\n * And the update step is c[new] = c[old] - ((o + c) * b^(c*t) - n)/((ln(b)*t * (o + c) + 1) * b^(c*t))\n *\n * The main question to ask when using this method is \"does it converges?\"\n * (are the approximations getting better?), if it does then it does quickly.\n * DOES IT CONVERGES? In the present case it does. The reason why doesn't help explaining the algorithm.\n * If you are interested then check out the wikipedia page.\n */\n const bt = exponentialBase ** threadMultiplier;\n let corr = Infinity;\n // Two sided error because we do not want to get stuck if the error stays on the wrong side\n do {\n // c should be above 0 so Halley's method can't be used, we have to stick to Newton-Raphson\n const bct = bt ** cycles;\n const opc = startMoney + cycles;\n const diff = opc * bct - targetMoney;\n corr = diff / (opc * x + 1.0) / bct;\n cycles -= corr;\n } while (Math.abs(corr) >= 1);\n /* c is now within +/- 1 of the exact result.\n * We want the ceiling of the exact result, so the floor if the approximation is above,\n * the ceiling if the approximation is in the same unit as the exact result,\n * and the ceiling + 1 if the approximation is below.\n */\n const fca = Math.floor(cycles);\n if (targetMoney <= (startMoney + fca) * Math.pow(exponentialBase, fca * threadMultiplier)) {\n return fca;\n }\n const cca = Math.ceil(cycles);\n if (targetMoney <= (startMoney + cca) * Math.pow(exponentialBase, cca * threadMultiplier)) {\n return cca;\n }\n return cca + 1;\n}\n\n//Applied server growth for a single server. Returns the percentage growth\nexport function processSingleServerGrowth(server: Server, threads: number, cores = 1): number {\n let serverGrowth = calculateServerGrowth(server, threads, Player, cores);\n if (serverGrowth < 1) {\n console.warn(\"serverGrowth calculated to be less than 1\");\n serverGrowth = 1;\n }\n\n const oldMoneyAvailable = server.moneyAvailable;\n server.moneyAvailable += 1 * threads; // It can be grown even if it has no money\n server.moneyAvailable *= serverGrowth;\n\n // in case of data corruption\n if (isValidNumber(server.moneyMax) && isNaN(server.moneyAvailable)) {\n server.moneyAvailable = server.moneyMax;\n }\n\n // cap at max\n if (isValidNumber(server.moneyMax) && server.moneyAvailable > server.moneyMax) {\n server.moneyAvailable = server.moneyMax;\n }\n\n // if there was any growth at all, increase security\n if (oldMoneyAvailable !== server.moneyAvailable) {\n let usedCycles = numCycleForGrowthCorrected(server, server.moneyAvailable, oldMoneyAvailable, cores);\n // Growing increases server security twice as much as hacking\n usedCycles = Math.min(Math.max(0, Math.ceil(usedCycles)), threads);\n server.fortify(2 * CONSTANTS.ServerFortifyAmount * usedCycles);\n }\n return server.moneyAvailable / oldMoneyAvailable;\n}\n\nexport function prestigeHomeComputer(homeComp: Server): void {\n const hasBitflume = homeComp.programs.includes(Programs.BitFlume.name);\n\n homeComp.programs.length = 0; //Remove programs\n homeComp.runningScripts = [];\n homeComp.serversOnNetwork = [];\n homeComp.isConnectedTo = true;\n homeComp.ramUsed = 0;\n homeComp.programs.push(Programs.NukeProgram.name);\n if (hasBitflume) {\n homeComp.programs.push(Programs.BitFlume.name);\n }\n\n //Update RAM usage on all scripts\n homeComp.scripts.forEach(function (script) {\n script.updateRamUsage(homeComp.scripts);\n });\n\n homeComp.messages.length = 0; //Remove .lit and .msg files\n homeComp.messages.push(LiteratureNames.HackersStartingHandbook);\n}\n\n// Returns the i-th server on the specified server's network\n// A Server's serverOnNetwork property holds only the IPs. This function returns\n// the actual Server object\nexport function getServerOnNetwork(server: BaseServer, i: number): BaseServer | null {\n if (i > server.serversOnNetwork.length) {\n console.error(\"Tried to get server on network that was out of range\");\n return null;\n }\n\n return GetServer(server.serversOnNetwork[i]);\n}\n\nexport function isBackdoorInstalled(server: BaseServer): boolean {\n if (server instanceof Server) {\n return server.backdoorInstalled;\n }\n return false;\n}\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Corporation } from \"../Corporation\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n unbuyable: {\n color: theme.palette.action.disabled,\n },\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\ninterface IProps {\n money: number;\n corp: Corporation;\n}\n\nexport function MoneyCost(props: IProps): React.ReactElement {\n const classes = useStyles();\n if (!(props.corp.funds > props.money))\n return <span className={classes.unbuyable}>{numeralWrapper.formatMoney(props.money)}</span>;\n\n return <span className={classes.money}>{numeralWrapper.formatMoney(props.money)}</span>;\n}\n","export const SkillNames = {\n BladesIntuition: \"Blade's Intuition\",\n Cloak: \"Cloak\",\n Marksman: \"Marksman\",\n WeaponProficiency: \"Weapon Proficiency\",\n ShortCircuit: \"Short-Circuit\",\n DigitalObserver: \"Digital Observer\",\n Tracer: \"Tracer\",\n Overclock: \"Overclock\",\n Reaper: \"Reaper\",\n EvasiveSystem: \"Evasive System\",\n Datamancer: \"Datamancer\",\n CybersEdge: \"Cyber's Edge\",\n HandsOfMidas: \"Hands of Midas\",\n Hyperdrive: \"Hyperdrive\",\n};\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n reputation: {\n color: theme.colors.rep,\n },\n }),\n);\n\nexport function Reputation({ reputation }: { reputation: number | string }): React.ReactElement {\n const classes = useStyles();\n return (\n <span className={classes.reputation}>\n {typeof reputation === \"number\" ? numeralWrapper.formatReputation(reputation) : reputation}\n </span>\n );\n}\n","import React, { useContext } from \"react\";\nimport { Gang } from \"../Gang\";\n\nexport const Context = {\n Gang: React.createContext<Gang>({} as Gang),\n};\n\nexport const useGang = (): Gang => useContext(Context.Gang);\n","import React from \"react\";\nimport { Player } from \"@player\";\nimport { BitNodeMultipliers, IBitNodeMultipliers } from \"./BitNodeMultipliers\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { CityName } from \"../Locations/data/CityNames\";\n\nclass BitNode {\n // A short description, or tagline, about the BitNode\n desc: string;\n\n // A long, detailed overview of the BitNode\n info: JSX.Element;\n\n // Name of BitNode\n name: string;\n\n // BitNode number\n number: number;\n\n difficulty: 0 | 1 | 2;\n\n constructor(n: number, difficulty: 0 | 1 | 2, name: string, desc = \"\", info: JSX.Element = <></>) {\n this.number = n;\n this.difficulty = difficulty;\n this.name = name;\n this.desc = desc;\n this.info = info;\n }\n}\n\nexport const BitNodes: Record<string, BitNode> = {};\nexport function initBitNodes() {\n BitNodes[\"BitNode1\"] = new BitNode(\n 1,\n 0,\n \"Source Genesis\",\n \"The original BitNode\",\n (\n <>\n The first BitNode created by the Enders to imprison the minds of humans. It became the prototype and\n testing-grounds for all of the BitNodes that followed.\n <br />\n <br />\n This is the first BitNode that you play through. It has no special modifications or mechanics.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 1, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets the player start with 32GB of RAM on his/her home computer\n when entering a new BitNode, and also increases all of the player's multipliers by:\n <br />\n <br />\n Level 1: 16%\n <br />\n Level 2: 24%\n <br />\n Level 3: 28%\n </>\n ),\n );\n BitNodes[\"BitNode2\"] = new BitNode(\n 2,\n 0,\n \"Rise of the Underworld\",\n \"From the shadows, they rose\", //Gangs\n (\n <>\n From the shadows, they rose.\n <br />\n <br />\n Organized crime groups quickly filled the void of power left behind from the collapse of Western government in\n the 2050s. As society and civilization broke down, people quickly succumbed to the innate human impulse of evil\n and savagery. The organized crime factions quickly rose to the top of the modern world.\n <br />\n <br />\n Certain Factions ({FactionNames.SlumSnakes}, {FactionNames.Tetrads}, {FactionNames.TheSyndicate},{\" \"}\n {FactionNames.TheDarkArmy}, {FactionNames.SpeakersForTheDead}, {FactionNames.NiteSec},{\" \"}\n {FactionNames.TheBlackHand}\n ) give the player the ability to form and manage their own gangs. These gangs will earn the player money and\n reputation with the corresponding Faction\n <br />\n Every Augmentation in the game will be available through the Factions listed above\n <br />\n <br />\n Destroying this BitNode will give you Source-File 2, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes once your karma\n decreases to a certain value. It also increases the player's crime success rate, crime money, and charisma\n multipliers by:\n <br />\n <br />\n Level 1: 24%\n <br />\n Level 2: 36%\n <br />\n Level 3: 42%\n </>\n ),\n );\n BitNodes[\"BitNode3\"] = new BitNode(\n 3,\n 0,\n \"Corporatocracy\",\n \"The Price of Civilization\",\n (\n <>\n Our greatest illusion is that a healthy society can revolve around a single-minded pursuit of wealth.\n <br />\n <br />\n Sometime in the early 21st century economic and political globalization turned the world into a corporatocracy,\n and it never looked back. Now, the privileged elite will happily bankrupt their own countrymen, decimate their\n own community, and evict their neighbors from houses in their desperate bid to increase their wealth.\n <br />\n <br />\n In this BitNode you can create and manage your own corporation. Running a successful corporation has the\n potential of generating massive profits.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 3, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although some\n BitNodes will disable this mechanic) and level 3 permanently unlocks the full API. This Source-File also\n increases your charisma and company salary multipliers by:\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n );\n BitNodes[\"BitNode4\"] = new BitNode(\n 4,\n 1,\n \"The Singularity\",\n \"The Man and the Machine\",\n (\n <>\n The Singularity has arrived. The human race is gone, replaced by artificially superintelligent beings that are\n more machine than man. <br />\n <br />\n <br />\n In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions. These\n functions allow you to control most aspects of the game through scripts, including working for\n factions/companies, purchasing/installing Augmentations, and creating programs.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 4, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets you access and use the Singularity Functions in other\n BitNodes. Each level of this Source-File reduces the RAM cost of singularity functions:\n <br />\n Level 1: 16x\n <br />\n Level 2: 4x\n <br />\n Level 3: 1x\n </>\n ),\n );\n BitNodes[\"BitNode5\"] = new BitNode(\n 5,\n 1,\n \"Artificial Intelligence\",\n \"Posthuman\",\n (\n <>\n They said it couldn't be done. They said the human brain, along with its consciousness and intelligence,\n couldn't be replicated. They said the complexity of the brain results from unpredictable, nonlinear interactions\n that couldn't be modeled by 1's and 0's. They were wrong.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants you a special new stat called Intelligence. Intelligence is\n unique because it is permanent and persistent (it never gets reset back to 1). However gaining Intelligence\n experience is much slower than other stats. Higher Intelligence levels will boost your production for many\n actions in the game. <br />\n <br />\n In addition, this Source-File will unlock the getBitNodeMultipliers() Netscript function and let you start with\n Formulas.exe, and will also raise all of your hacking-related multipliers by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n );\n BitNodes[\"BitNode6\"] = new BitNode(\n 6,\n 1,\n FactionNames.Bladeburners,\n \"Like Tears in Rain\",\n (\n <>\n In the middle of the 21st century, {FactionNames.OmniTekIncorporated} began designing and manufacturing advanced\n synthetic androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth\n generation of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was\n the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more\n intelligent than the humans that had created them.\n <br />\n <br />\n In this BitNode you will be able to access the {FactionNames.Bladeburners} Division at the NSA, which provides a\n new mechanic for progression.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to access the NSA's {FactionNames.Bladeburners} Division\n in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your\n combat stats by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n );\n BitNodes[\"BitNode7\"] = new BitNode(\n 7,\n 2,\n `${FactionNames.Bladeburners} 2079`,\n \"More human than humans\",\n (\n <>\n In the middle of the 21st century, you were doing cutting-edge work at {FactionNames.OmniTekIncorporated} as\n part of the AI design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major\n technological breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing\n a hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid\n models that were stronger, faster, and more intelligent than the humans that had created them.\n <br />\n <br />\n In this BitNode you will be able to access the {FactionNames.Bladeburners} API, which allows you to access{\" \"}\n {FactionNames.Bladeburners} functionality through Netscript.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to access the {FactionNames.Bladeburners} Netscript API\n in other BitNodes. In addition, this Source-File will increase all of your {FactionNames.Bladeburners}{\" \"}\n multipliers by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n );\n BitNodes[\"BitNode8\"] = new BitNode(\n 8,\n 2,\n \"Ghost of Wall Street\",\n \"Money never sleeps\",\n (\n <>\n You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n You start with $250 million\n <br />\n You start with a WSE membership and access to the TIX API\n <br />\n You are able to short stocks and place different types of orders (limit/stop)\n <br />\n <br />\n Destroying this BitNode will give you Source-File 8, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants the following benefits:\n <br />\n <br />\n Level 1: Permanent access to WSE and TIX API\n <br />\n Level 2: Ability to short stocks in other BitNodes\n <br />\n Level 3: Ability to use limit/stop orders in other BitNodes\n <br />\n <br />\n This Source-File also increases your hacking growth multipliers by:\n <br />\n Level 1: 12%\n <br />\n Level 2: 18%\n <br />\n Level 3: 21%\n </>\n ),\n );\n BitNodes[\"BitNode9\"] = new BitNode(\n 9,\n 2,\n \"Hacktocracy\",\n \"Hacknet Unleashed\",\n (\n <>\n When {FactionNames.FulcrumSecretTechnologies} released their open-source Linux distro Chapeau, it quickly became\n the OS of choice for the underground hacking community. Chapeau became especially notorious for powering the\n Hacknet, a global, decentralized network used for nefarious purposes. {FactionNames.FulcrumSecretTechnologies}{\" \"}\n quickly abandoned the project and dissociated themselves from it.\n <br />\n <br />\n This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate\n hashes, which can be spent on a variety of different upgrades.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 9, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants the following benefits:\n <br />\n <br />\n Level 1: Permanently unlocks the Hacknet Server in other BitNodes\n <br />\n Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode\n <br />\n Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode\n <br />\n <br />\n (Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing\n Augmentations)\n <br />\n <br />\n This Source-File also increases your hacknet multipliers by:\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n );\n BitNodes[\"BitNode10\"] = new BitNode(\n 10,\n 2,\n \"Digital Carbon\",\n \"Your body is not who you are\",\n (\n <>\n In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people to digitize their\n consciousness. Their consciousness could then be transferred into Synthoids or other bodies by transmitting the\n digitized data. Human bodies became nothing more than 'sleeves' for the human consciousness. Mankind had finally\n achieved immortality - at least for those that could afford it.\n <br />\n <br />\n This BitNode unlocks Sleeve and grafting technologies. Sleeve technology allows you to:\n <br />\n <br />\n 1. Grafting: Visit VitaLife in New Tokyo to be able to obtain Augmentations without needing to install\n <br />\n 2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks\n synchronously.\n <br />\n <br />\n Grafting technology allows you to graft Augmentations, which is an alternative way of installing Augmentations.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 10, or if you already have this Source-File it will upgrade\n its level up to a maximum of 3. This Source-File unlocks Sleeve technology, and the Grafting API in other\n BitNodes. Each level of this Source-File also grants you a Duplicate Sleeve\n </>\n ),\n );\n BitNodes[\"BitNode11\"] = new BitNode(\n 11,\n 1,\n \"The Big Crash\",\n \"Okay. Sell it all.\",\n (\n <>\n The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around\n the world. It was this period of disorder that eventually lead to the governmental reformation of many global\n superpowers, most notably the USA and China. But just as the world was slowly beginning to recover from these\n dark times, financial catastrophe hit.\n <br />\n <br />\n In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of\n this chaos and confusion, hackers were able to steal billions of dollars from the world's largest electronic\n banks, prompting an international banking crisis as governments were unable to bail out insolvent banks. Now,\n the world is slowly crumbling in the middle of the biggest economic crisis of all time.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will upgrade\n its level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH the player's\n salary and reputation gain rate at that company by 1% per favor (rather than just the reputation gain). This\n Source-File also increases the player's company salary and reputation gain multipliers by:\n <br />\n <br />\n Level 1: 32%\n <br />\n Level 2: 48%\n <br />\n Level 3: 56%\n <br />\n <br />\n It also reduces the price increase for every aug bought by:\n <br />\n <br />\n Level 1: 4%\n <br />\n Level 2: 6%\n <br />\n Level 3: 7%\n </>\n ),\n );\n BitNodes[\"BitNode12\"] = new BitNode(\n 12,\n 0,\n \"The Recursion\",\n \"Repeat.\",\n (\n <>\n To iterate is human, to recurse divine.\n <br />\n <br />\n Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give you\n Source-File 12, or if you already have this Source-File it will upgrade its level. There is no maximum level for\n Source-File 12. Each level of Source-File 12 lets you start any BitNodes with NeuroFlux Governor equal to the\n level of this source file.\n </>\n ),\n );\n BitNodes[\"BitNode13\"] = new BitNode(\n 13,\n 2,\n \"They're lunatics\",\n \"1 step back, 2 steps forward\",\n (\n <>\n With the invention of Augmentations in the 2040s a religious group known as the{\" \"}\n {FactionNames.ChurchOfTheMachineGod} has rallied far more support than anyone would have hoped.\n <br />\n <br />\n Their leader, Allison \"Mother\" Stanek is said to have created her own Augmentation whose power goes beyond any\n other. Find her in {CityName.Chongqing} and gain her trust.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 13, or if you already have this Source-File it will upgrade\n its level up to a maximum of 3. This Source-File lets the {FactionNames.ChurchOfTheMachineGod} appear in other\n BitNodes.\n <br />\n <br />\n Each level of this Source-File increases the size of Stanek's Gift.\n </>\n ),\n );\n}\n\nexport const defaultMultipliers: IBitNodeMultipliers = {\n HackingLevelMultiplier: 1,\n StrengthLevelMultiplier: 1,\n DefenseLevelMultiplier: 1,\n DexterityLevelMultiplier: 1,\n AgilityLevelMultiplier: 1,\n CharismaLevelMultiplier: 1,\n\n ServerGrowthRate: 1,\n ServerMaxMoney: 1,\n ServerStartingMoney: 1,\n ServerStartingSecurity: 1,\n ServerWeakenRate: 1,\n\n HomeComputerRamCost: 1,\n\n PurchasedServerCost: 1,\n PurchasedServerSoftcap: 1,\n PurchasedServerLimit: 1,\n PurchasedServerMaxRam: 1,\n\n CompanyWorkMoney: 1,\n CrimeMoney: 1,\n HacknetNodeMoney: 1,\n ManualHackMoney: 1,\n ScriptHackMoney: 1,\n ScriptHackMoneyGain: 1,\n CodingContractMoney: 1,\n\n ClassGymExpGain: 1,\n CompanyWorkExpGain: 1,\n CrimeExpGain: 1,\n FactionWorkExpGain: 1,\n HackExpGain: 1,\n\n FactionPassiveRepGain: 1,\n FactionWorkRepGain: 1,\n RepToDonateToFaction: 1,\n\n AugmentationMoneyCost: 1,\n AugmentationRepCost: 1,\n\n InfiltrationMoney: 1,\n InfiltrationRep: 1,\n\n FourSigmaMarketDataCost: 1,\n FourSigmaMarketDataApiCost: 1,\n\n CorporationValuation: 1,\n CorporationSoftcap: 1,\n\n BladeburnerRank: 1,\n BladeburnerSkillCost: 1,\n\n GangSoftcap: 1,\n GangUniqueAugs: 1,\n\n DaedalusAugsRequirement: 30,\n\n StaneksGiftPowerMultiplier: 1,\n StaneksGiftExtraSize: 0,\n\n WorldDaemonDifficulty: 1,\n};\n\nObject.freeze(defaultMultipliers);\n\nexport function getBitNodeMultipliers(n: number, lvl: number): IBitNodeMultipliers {\n const mults = Object.assign({}, defaultMultipliers);\n switch (n) {\n case 1: {\n return mults;\n }\n case 2: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.8,\n ServerGrowthRate: 0.8,\n ServerMaxMoney: 0.2,\n ServerStartingMoney: 0.4,\n CrimeMoney: 3,\n InfiltrationMoney: 3,\n FactionWorkRepGain: 0.5,\n FactionPassiveRepGain: 0,\n StaneksGiftPowerMultiplier: 2,\n StaneksGiftExtraSize: -6,\n PurchasedServerSoftcap: 1.3,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 5,\n });\n }\n case 3: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.8,\n RepToDonateToFaction: 0.5,\n AugmentationRepCost: 3,\n AugmentationMoneyCost: 3,\n ServerMaxMoney: 0.2,\n ServerStartingMoney: 0.2,\n ServerGrowthRate: 0.2,\n ScriptHackMoney: 0.2,\n CompanyWorkMoney: 0.25,\n CrimeMoney: 0.25,\n HacknetNodeMoney: 0.25,\n HomeComputerRamCost: 1.5,\n PurchasedServerCost: 2,\n StaneksGiftPowerMultiplier: 0.75,\n StaneksGiftExtraSize: -2,\n PurchasedServerSoftcap: 1.3,\n GangSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.5,\n });\n }\n case 4: {\n return Object.assign(mults, {\n ServerMaxMoney: 0.15,\n ServerStartingMoney: 0.75,\n ScriptHackMoney: 0.2,\n CompanyWorkMoney: 0.1,\n CrimeMoney: 0.2,\n HacknetNodeMoney: 0.05,\n CompanyWorkExpGain: 0.5,\n ClassGymExpGain: 0.5,\n FactionWorkExpGain: 0.5,\n HackExpGain: 0.4,\n CrimeExpGain: 0.5,\n FactionWorkRepGain: 0.75,\n StaneksGiftPowerMultiplier: 1.5,\n StaneksGiftExtraSize: 0,\n PurchasedServerSoftcap: 1.2,\n WorldDaemonDifficulty: 3,\n GangUniqueAugs: 0.5,\n });\n }\n case 5: {\n return Object.assign(mults, {\n ServerMaxMoney: 2,\n ServerStartingSecurity: 2,\n ServerStartingMoney: 0.5,\n ScriptHackMoney: 0.15,\n HacknetNodeMoney: 0.2,\n CrimeMoney: 0.5,\n InfiltrationRep: 1.5,\n InfiltrationMoney: 1.5,\n AugmentationMoneyCost: 2,\n HackExpGain: 0.5,\n CorporationValuation: 0.5,\n StaneksGiftPowerMultiplier: 1.3,\n StaneksGiftExtraSize: 0,\n PurchasedServerSoftcap: 1.2,\n WorldDaemonDifficulty: 1.5,\n GangUniqueAugs: 0.5,\n });\n }\n case 6: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.35,\n ServerMaxMoney: 0.4,\n ServerStartingMoney: 0.5,\n ServerStartingSecurity: 1.5,\n ScriptHackMoney: 0.75,\n CompanyWorkMoney: 0.5,\n CrimeMoney: 0.75,\n InfiltrationMoney: 0.75,\n CorporationValuation: 0.2,\n HacknetNodeMoney: 0.2,\n HackExpGain: 0.25,\n DaedalusAugsRequirement: 35,\n PurchasedServerSoftcap: 2,\n StaneksGiftPowerMultiplier: 0.5,\n StaneksGiftExtraSize: 2,\n GangSoftcap: 0.7,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.2,\n });\n }\n case 7: {\n return Object.assign(mults, {\n BladeburnerRank: 0.6,\n BladeburnerSkillCost: 2,\n AugmentationMoneyCost: 3,\n HackingLevelMultiplier: 0.35,\n ServerMaxMoney: 0.4,\n ServerStartingMoney: 0.5,\n ServerStartingSecurity: 1.5,\n ScriptHackMoney: 0.5,\n CompanyWorkMoney: 0.5,\n CrimeMoney: 0.75,\n InfiltrationMoney: 0.75,\n CorporationValuation: 0.2,\n HacknetNodeMoney: 0.2,\n HackExpGain: 0.25,\n FourSigmaMarketDataCost: 2,\n FourSigmaMarketDataApiCost: 2,\n DaedalusAugsRequirement: 35,\n PurchasedServerSoftcap: 2,\n StaneksGiftPowerMultiplier: 0.9,\n StaneksGiftExtraSize: -1,\n GangSoftcap: 0.7,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.2,\n });\n }\n case 8: {\n return Object.assign(mults, {\n BladeburnerRank: 0,\n ScriptHackMoney: 0.3,\n ScriptHackMoneyGain: 0,\n ManualHackMoney: 0,\n CompanyWorkMoney: 0,\n CrimeMoney: 0,\n HacknetNodeMoney: 0,\n InfiltrationMoney: 0,\n RepToDonateToFaction: 0,\n CorporationValuation: 0,\n CodingContractMoney: 0,\n StaneksGiftExtraSize: -99,\n PurchasedServerSoftcap: 4,\n GangSoftcap: 0,\n CorporationSoftcap: 0,\n GangUniqueAugs: 0,\n });\n }\n case 9: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.5,\n StrengthLevelMultiplier: 0.45,\n DefenseLevelMultiplier: 0.45,\n DexterityLevelMultiplier: 0.45,\n AgilityLevelMultiplier: 0.45,\n CharismaLevelMultiplier: 0.45,\n PurchasedServerLimit: 0,\n HomeComputerRamCost: 5,\n CrimeMoney: 0.5,\n ScriptHackMoney: 0.1,\n HackExpGain: 0.05,\n ServerStartingMoney: 0.1,\n ServerMaxMoney: 0.1,\n ServerStartingSecurity: 2.5,\n CorporationValuation: 0.5,\n FourSigmaMarketDataCost: 5,\n FourSigmaMarketDataApiCost: 4,\n BladeburnerRank: 0.9,\n BladeburnerSkillCost: 1.2,\n StaneksGiftPowerMultiplier: 0.5,\n StaneksGiftExtraSize: 2,\n GangSoftcap: 0.8,\n CorporationSoftcap: 0.7,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.25,\n });\n }\n case 10: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.35,\n StrengthLevelMultiplier: 0.4,\n DefenseLevelMultiplier: 0.4,\n DexterityLevelMultiplier: 0.4,\n AgilityLevelMultiplier: 0.4,\n CharismaLevelMultiplier: 0.4,\n CompanyWorkMoney: 0.5,\n CrimeMoney: 0.5,\n HacknetNodeMoney: 0.5,\n ManualHackMoney: 0.5,\n ScriptHackMoney: 0.5,\n CodingContractMoney: 0.5,\n InfiltrationMoney: 0.5,\n CorporationValuation: 0.5,\n AugmentationMoneyCost: 5,\n AugmentationRepCost: 2,\n HomeComputerRamCost: 1.5,\n PurchasedServerCost: 5,\n PurchasedServerLimit: 0.6,\n PurchasedServerMaxRam: 0.5,\n BladeburnerRank: 0.8,\n StaneksGiftPowerMultiplier: 0.75,\n StaneksGiftExtraSize: -3,\n PurchasedServerSoftcap: 1.1,\n GangSoftcap: 0.9,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.25,\n });\n }\n case 11: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.6,\n HackExpGain: 0.5,\n ServerMaxMoney: 0.1,\n ServerStartingMoney: 0.1,\n ServerGrowthRate: 0.2,\n ServerWeakenRate: 2,\n CrimeMoney: 3,\n CompanyWorkMoney: 0.5,\n HacknetNodeMoney: 0.1,\n AugmentationMoneyCost: 2,\n InfiltrationMoney: 2.5,\n InfiltrationRep: 2.5,\n CorporationValuation: 0.1,\n CodingContractMoney: 0.25,\n FourSigmaMarketDataCost: 4,\n FourSigmaMarketDataApiCost: 4,\n PurchasedServerSoftcap: 2,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 1.5,\n GangUniqueAugs: 0.75,\n });\n }\n case 12: {\n const inc = Math.pow(1.02, lvl);\n const dec = 1 / inc;\n\n return Object.assign(mults, {\n DaedalusAugsRequirement: Math.floor(Math.min(mults.DaedalusAugsRequirement + inc, 40)),\n\n HackingLevelMultiplier: dec,\n StrengthLevelMultiplier: dec,\n DefenseLevelMultiplier: dec,\n DexterityLevelMultiplier: dec,\n AgilityLevelMultiplier: dec,\n CharismaLevelMultiplier: dec,\n\n ServerMaxMoney: dec,\n ServerStartingMoney: dec,\n ServerGrowthRate: dec,\n ServerWeakenRate: dec,\n\n //Does not scale, otherwise security might start at 300+\n ServerStartingSecurity: 1.5,\n\n HomeComputerRamCost: inc,\n\n PurchasedServerCost: inc,\n PurchasedServerLimit: dec,\n PurchasedServerMaxRam: dec,\n PurchasedServerSoftcap: inc,\n\n ManualHackMoney: dec,\n ScriptHackMoney: dec,\n CompanyWorkMoney: dec,\n CrimeMoney: dec,\n HacknetNodeMoney: dec,\n CodingContractMoney: dec,\n\n CompanyWorkExpGain: dec,\n ClassGymExpGain: dec,\n FactionWorkExpGain: dec,\n HackExpGain: dec,\n CrimeExpGain: dec,\n\n FactionWorkRepGain: dec,\n FactionPassiveRepGain: dec,\n RepToDonateToFaction: inc,\n\n AugmentationRepCost: inc,\n AugmentationMoneyCost: inc,\n\n InfiltrationMoney: dec,\n InfiltrationRep: dec,\n\n FourSigmaMarketDataCost: inc,\n FourSigmaMarketDataApiCost: inc,\n\n CorporationValuation: dec,\n\n BladeburnerRank: dec,\n BladeburnerSkillCost: inc,\n\n StaneksGiftPowerMultiplier: inc,\n StaneksGiftExtraSize: inc,\n GangSoftcap: 0.8,\n CorporationSoftcap: 0.8,\n WorldDaemonDifficulty: inc,\n\n GangUniqueAugs: dec,\n });\n }\n case 13: {\n return Object.assign(mults, {\n PurchasedServerSoftcap: 1.6,\n\n HackingLevelMultiplier: 0.25,\n StrengthLevelMultiplier: 0.7,\n DefenseLevelMultiplier: 0.7,\n DexterityLevelMultiplier: 0.7,\n AgilityLevelMultiplier: 0.7,\n\n ServerMaxMoney: 0.45,\n ServerStartingMoney: 0.75,\n\n ServerStartingSecurity: 3,\n\n ScriptHackMoney: 0.2,\n CompanyWorkMoney: 0.4,\n CrimeMoney: 0.4,\n HacknetNodeMoney: 0.4,\n CodingContractMoney: 0.4,\n\n CompanyWorkExpGain: 0.5,\n ClassGymExpGain: 0.5,\n FactionWorkExpGain: 0.5,\n HackExpGain: 0.1,\n CrimeExpGain: 0.5,\n\n FactionWorkRepGain: 0.6,\n\n FourSigmaMarketDataCost: 10,\n FourSigmaMarketDataApiCost: 10,\n\n CorporationValuation: 0.001,\n\n BladeburnerRank: 0.45,\n BladeburnerSkillCost: 2,\n StaneksGiftPowerMultiplier: 2,\n StaneksGiftExtraSize: 1,\n GangSoftcap: 0.3,\n CorporationSoftcap: 0.3,\n WorldDaemonDifficulty: 3,\n GangUniqueAugs: 0.1,\n });\n }\n default: {\n throw new Error(\"Invalid BitNodeN\");\n }\n }\n}\n\nexport function initBitNodeMultipliers(): void {\n Object.assign(BitNodeMultipliers, getBitNodeMultipliers(Player.bitNodeN, Player.sourceFileLvl(Player.bitNodeN)));\n}\n","import { IReviverValue } from \"../utils/JSONReviver\";\n\nexport abstract class Work {\n type: WorkType;\n singularity: boolean;\n cyclesWorked: number;\n\n constructor(type: WorkType, singularity: boolean) {\n this.type = type;\n this.singularity = singularity;\n this.cyclesWorked = 0;\n }\n\n abstract process(cycles: number): boolean;\n abstract finish(cancelled: boolean): void;\n abstract APICopy(): Record<string, unknown>;\n abstract toJSON(): IReviverValue;\n}\n\nexport enum WorkType {\n CRIME = \"CRIME\",\n CLASS = \"CLASS\",\n CREATE_PROGRAM = \"CREATE_PROGRAM\",\n GRAFTING = \"GRAFTING\",\n FACTION = \"FACTION\",\n COMPANY = \"COMPANY\",\n}\n","import { IMinMaxRange } from \"../types\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\nexport const StockForecastInfluenceLimit = 5;\n\nexport interface IConstructorParams {\n b: boolean;\n initPrice: number | IMinMaxRange;\n marketCap: number;\n mv: number | IMinMaxRange;\n name: string;\n otlkMag: number;\n spreadPerc: number | IMinMaxRange;\n shareTxForMovement: number | IMinMaxRange;\n symbol: string;\n}\n\nconst defaultConstructorParams: IConstructorParams = {\n b: true,\n initPrice: 10e3,\n marketCap: 1e12,\n mv: 1,\n name: \"\",\n otlkMag: 0,\n spreadPerc: 0,\n shareTxForMovement: 1e6,\n symbol: \"\",\n};\n\n// Helper function that convert a IMinMaxRange to a number\nfunction toNumber(n: number | IMinMaxRange): number {\n let value: number;\n switch (typeof n) {\n case \"number\": {\n return n;\n }\n case \"object\": {\n const range = n;\n value = getRandomInt(range.min, range.max);\n break;\n }\n default:\n throw Error(`Do not know how to convert the type '${typeof n}' to a number`);\n }\n\n if (typeof n === \"object\" && typeof n.divisor === \"number\") {\n return value / n.divisor;\n }\n\n return value;\n}\n\n/** Represents the valuation of a company in the World Stock Exchange. */\nexport class Stock {\n /** Bear or bull (more likely to go up or down, based on otlkMag) */\n b: boolean;\n\n /** Maximum price of a stock (per share) */\n readonly cap: number;\n\n /** Stocks previous share price */\n lastPrice: number;\n\n /** Maximum number of shares that player can own (both long and short combined) */\n readonly maxShares: number;\n\n /** Maximum volatility */\n readonly mv: number;\n\n /** Name of the company that the stock is for */\n readonly name: string;\n\n /**\n * Outlook magnitude. Represents the stock's forecast and likelihood\n * of increasing/decreasing (based on whether its in bear or bull mode)\n */\n otlkMag: number;\n\n /**\n * Forecast of outlook magnitude. Essentially a second-order forecast.\n * Unlike 'otlkMag', this number is on an absolute scale from 0-100 (rather than 0-50)\n */\n otlkMagForecast: number;\n\n /** Average price of stocks that the player owns in the LONG position */\n playerAvgPx: number;\n\n /** Average price of stocks that the player owns in the SHORT position */\n playerAvgShortPx: number;\n\n /** Number of shares the player owns in the LONG position */\n playerShares: number;\n\n /** Number of shares the player owns in the SHORT position */\n playerShortShares: number;\n\n /** Stock's share price */\n price: number;\n\n /** How many shares need to be transacted in order to trigger a price movement */\n readonly shareTxForMovement: number;\n\n /**\n * How many share transactions remaining until a price movement occurs\n * (separately tracked for upward and downward movements)\n */\n shareTxUntilMovement: number;\n\n /**\n * Spread percentage. The bid/ask prices for this stock are N% above or below\n * the \"real price\" to emulate spread.\n */\n readonly spreadPerc: number;\n\n /** The stock's ticker symbol */\n readonly symbol: string;\n\n /**\n * Total number of shares of this stock\n * This is different than maxShares, as this is like authorized stock while\n * maxShares is outstanding stock.\n */\n readonly totalShares: number;\n\n constructor(p: IConstructorParams = defaultConstructorParams) {\n this.name = p.name;\n this.symbol = p.symbol;\n this.price = toNumber(p.initPrice);\n this.lastPrice = this.price;\n this.playerShares = 0;\n this.playerAvgPx = 0;\n this.playerShortShares = 0;\n this.playerAvgShortPx = 0;\n this.mv = toNumber(p.mv);\n this.b = p.b;\n this.otlkMag = p.otlkMag;\n this.otlkMagForecast = this.getAbsoluteForecast();\n this.cap = getRandomInt(this.price * 1e3, this.price * 25e3);\n this.spreadPerc = toNumber(p.spreadPerc);\n this.shareTxForMovement = toNumber(p.shareTxForMovement);\n this.shareTxUntilMovement = this.shareTxForMovement;\n\n // Total shares is determined by market cap, and is rounded to nearest 100k\n const totalSharesUnrounded: number = p.marketCap / this.price;\n this.totalShares = Math.round(totalSharesUnrounded / 1e5) * 1e5;\n\n // Max Shares (Outstanding shares) is a percentage of total shares\n const outstandingSharePercentage = 0.2;\n this.maxShares = Math.round((this.totalShares * outstandingSharePercentage) / 1e5) * 1e5;\n }\n\n /** Safely set the stock's second-order forecast to a new value */\n changeForecastForecast(newff: number): void {\n this.otlkMagForecast = newff;\n if (this.otlkMagForecast > 100) {\n this.otlkMagForecast = 100;\n } else if (this.otlkMagForecast < 0) {\n this.otlkMagForecast = 0;\n }\n }\n\n /** Set the stock to a new price. Also updates the stock's previous price tracker */\n changePrice(newPrice: number): void {\n this.lastPrice = this.price;\n this.price = newPrice;\n }\n\n /**\n * Change the stock's forecast during a stock market 'tick'.\n * The way a stock's forecast changes depends on various internal properties,\n * but is ultimately determined by RNG\n */\n cycleForecast(changeAmt = 0.1): void {\n const increaseChance = this.getForecastIncreaseChance();\n\n if (Math.random() < increaseChance) {\n // Forecast increases\n if (this.b) {\n this.otlkMag += changeAmt;\n } else {\n this.otlkMag -= changeAmt;\n }\n } else if (this.b) {\n // Forecast decreases\n this.otlkMag -= changeAmt;\n } else {\n this.otlkMag += changeAmt;\n }\n\n this.otlkMag = Math.min(this.otlkMag, 50);\n if (this.otlkMag < 0) {\n this.otlkMag *= -1;\n this.b = !this.b;\n }\n }\n\n /**\n * Change's the stock's second-order forecast during a stock market 'tick'.\n * The change for the second-order forecast to increase is 50/50\n */\n cycleForecastForecast(changeAmt = 0.1): void {\n if (Math.random() < 0.5) {\n this.changeForecastForecast(this.otlkMagForecast + changeAmt);\n } else {\n this.changeForecastForecast(this.otlkMagForecast - changeAmt);\n }\n }\n\n /**\n * \"Flip\" the stock's second-order forecast. This can occur during a\n * stock market \"cycle\" (determined by RNG). It is used to simulate\n * RL stock market cycles and introduce volatility\n */\n flipForecastForecast(): void {\n const diff = this.otlkMagForecast - 50;\n this.otlkMagForecast = 50 + -1 * diff;\n }\n\n /** Returns the stock's absolute forecast, which is a number between 0-100 */\n getAbsoluteForecast(): number {\n return this.b ? 50 + this.otlkMag : 50 - this.otlkMag;\n }\n\n /** Return the price at which YOUR stock is bought (market ask price). Accounts for spread */\n getAskPrice(): number {\n return this.price * (1 + this.spreadPerc / 100);\n }\n\n /** Return the price at which YOUR stock is sold (market bid price). Accounts for spread */\n getBidPrice(): number {\n return this.price * (1 - this.spreadPerc / 100);\n }\n\n /** Returns the chance (0-1 decimal) that a stock has of having its forecast increase */\n getForecastIncreaseChance(): number {\n const diff = this.otlkMagForecast - this.getAbsoluteForecast();\n\n return (50 + Math.min(Math.max(diff, -45), 45)) / 100;\n }\n\n /**\n * Changes a stock's forecast. This is used when the stock is influenced\n * by a transaction. The stock's forecast always goes towards 50, but the\n * movement is capped by a certain threshold/limit\n */\n influenceForecast(change: number): void {\n if (this.otlkMag > StockForecastInfluenceLimit) {\n this.otlkMag = Math.max(StockForecastInfluenceLimit, this.otlkMag - change);\n }\n }\n\n /**\n * Changes a stock's second-order forecast. This is used when the stock is\n * influenced by a transaction. The stock's second-order forecast always\n * goes towards 50.\n */\n influenceForecastForecast(change: number): void {\n if (this.otlkMagForecast > 50) {\n this.otlkMagForecast -= change;\n this.otlkMagForecast = Math.max(50, this.otlkMagForecast);\n } else if (this.otlkMagForecast < 50) {\n this.otlkMagForecast += change;\n this.otlkMagForecast = Math.min(50, this.otlkMagForecast);\n }\n }\n\n /** Serialize the Stock to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Stock\", this);\n }\n\n /** Initializes a Stock from a JSON save state */\n static fromJSON(value: IReviverValue): Stock {\n return Generic_fromJSON(Stock, value.data);\n }\n}\n\nReviver.constructors.Stock = Stock;\n","/**\n * Map of all Cities in the game\n * Key = City Name, Value = City object\n */\nimport { City } from \"./City\";\n\nexport const Cities: Record<string, City> = {};\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { HacknetServerConstants } from \"../data/Constants\";\n\nexport function calculateHashGainRate(\n level: number,\n ramUsed: number,\n maxRam: number,\n cores: number,\n mult: number,\n): number {\n const baseGain = HacknetServerConstants.HashesPerLevel * level;\n const ramMultiplier = Math.pow(1.07, Math.log2(maxRam));\n const coreMultiplier = 1 + (cores - 1) / 5;\n const ramRatio = 1 - ramUsed / maxRam;\n\n return baseGain * ramMultiplier * coreMultiplier * ramRatio * mult * BitNodeMultipliers.HacknetNodeMoney;\n}\n\nexport function calculateLevelUpgradeCost(startingLevel: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingLevel >= HacknetServerConstants.MaxLevel) {\n return Infinity;\n }\n\n const mult = HacknetServerConstants.UpgradeLevelMult;\n let totalMultiplier = 0;\n let currLevel = startingLevel;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalMultiplier += Math.pow(mult, currLevel);\n ++currLevel;\n }\n\n return 10 * HacknetServerConstants.BaseCost * totalMultiplier * costMult;\n}\n\nexport function calculateRamUpgradeCost(startingRam: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingRam >= HacknetServerConstants.MaxRam) {\n return Infinity;\n }\n\n let totalCost = 0;\n let numUpgrades = Math.round(Math.log2(startingRam));\n let currentRam = startingRam;\n for (let i = 0; i < sanitizedLevels; ++i) {\n const baseCost = currentRam * HacknetServerConstants.RamBaseCost;\n const mult = Math.pow(HacknetServerConstants.UpgradeRamMult, numUpgrades);\n\n totalCost += baseCost * mult;\n\n currentRam *= 2;\n ++numUpgrades;\n }\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateCoreUpgradeCost(startingCores: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingCores >= HacknetServerConstants.MaxCores) {\n return Infinity;\n }\n\n const mult = HacknetServerConstants.UpgradeCoreMult;\n let totalCost = 0;\n let currentCores = startingCores;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalCost += Math.pow(mult, currentCores - 1);\n ++currentCores;\n }\n totalCost *= HacknetServerConstants.CoreBaseCost;\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateCacheUpgradeCost(startingCache: number, extraLevels = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingCache >= HacknetServerConstants.MaxCache) {\n return Infinity;\n }\n\n const mult = HacknetServerConstants.UpgradeCacheMult;\n let totalCost = 0;\n let currentCache = startingCache;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalCost += Math.pow(mult, currentCache - 1);\n ++currentCache;\n }\n totalCost *= HacknetServerConstants.CacheBaseCost;\n\n return totalCost;\n}\n\nexport function calculateServerCost(n: number, mult = 1): number {\n if (n - 1 >= HacknetServerConstants.MaxServers) {\n return Infinity;\n }\n\n return HacknetServerConstants.BaseCost * Math.pow(HacknetServerConstants.PurchaseMult, n - 1) * mult;\n}\n","/**\n * Stops an actively-running script (represented by a WorkerScript object)\n * and removes it from the global pool of active scripts.\n */\nimport { ScriptDeath } from \"./ScriptDeath\";\nimport { WorkerScript } from \"./WorkerScript\";\nimport { workerScripts } from \"./WorkerScripts\";\nimport { WorkerScriptStartStopEventEmitter } from \"./WorkerScriptStartStopEventEmitter\";\n\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { AddRecentScript } from \"./RecentScripts\";\nimport { ITutorial } from \"../InteractiveTutorial\";\nimport { AlertEvents } from \"../ui/React/AlertManager\";\nimport { handleUnknownError } from \"./NetscriptHelpers\";\n\nexport type killScriptParams = WorkerScript | number | { runningScript: RunningScript; hostname: string };\n\nexport function killWorkerScript(params: killScriptParams): boolean {\n if (ITutorial.isRunning) {\n AlertEvents.emit(\"Processes cannot be killed during the tutorial.\");\n return false;\n }\n if (params instanceof WorkerScript) {\n stopAndCleanUpWorkerScript(params);\n\n return true;\n } else if (typeof params === \"number\") {\n return killWorkerScriptByPid(params);\n } else {\n // Try to kill by PID\n const res = killWorkerScriptByPid(params.runningScript.pid);\n if (res) {\n return res;\n }\n\n // If for some reason that doesn't work, we'll try the old way\n for (const ws of workerScripts.values()) {\n if (ws.scriptRef === params.runningScript) {\n stopAndCleanUpWorkerScript(ws);\n return true;\n }\n }\n\n return false;\n }\n}\n\nfunction killWorkerScriptByPid(pid: number): boolean {\n const ws = workerScripts.get(pid);\n if (ws instanceof WorkerScript) {\n stopAndCleanUpWorkerScript(ws);\n return true;\n }\n\n return false;\n}\n\nfunction stopAndCleanUpWorkerScript(ws: WorkerScript): void {\n //Clean up any ongoing netscriptDelay\n if (ws.delay) clearTimeout(ws.delay);\n ws.delayReject?.(new ScriptDeath(ws));\n ws.env.runningFn = \"\";\n\n if (typeof ws.atExit === \"function\") {\n try {\n ws.env.stopFlag = false;\n ws.atExit();\n } catch (e: unknown) {\n handleUnknownError(e, ws, \"Error running atExit function.\\n\\n\");\n }\n ws.atExit = undefined;\n }\n ws.env.stopFlag = true;\n removeWorkerScript(ws);\n}\n\n/**\n * Helper function that removes the script being killed from the global pool.\n * Also handles other cleanup-time operations\n *\n * @param {WorkerScript} - Identifier for WorkerScript. Either the object itself, or\n * its index in the global workerScripts array\n */\nfunction removeWorkerScript(workerScript: WorkerScript): void {\n const ip = workerScript.hostname;\n\n // Get the server on which the script runs\n const server = GetServer(ip);\n if (server == null) {\n console.error(`Could not find server on which this script is running: ${ip}`);\n return;\n }\n\n // Delete the RunningScript object from that server\n for (let i = 0; i < server.runningScripts.length; ++i) {\n const runningScript = server.runningScripts[i];\n if (runningScript === workerScript.scriptRef) {\n server.runningScripts.splice(i, 1);\n break;\n }\n }\n\n // Recalculate ram used on that server\n\n server.updateRamUsed(0);\n for (const rs of server.runningScripts) server.updateRamUsed(server.ramUsed + rs.ramUsage * rs.threads);\n\n // Delete script from global pool (workerScripts)\n workerScripts.delete(workerScript.pid);\n // const res = workerScripts.delete(workerScript.pid);\n // if (!res) {\n // console.warn(`removeWorkerScript() called with WorkerScript that wasn't in the global map:`);\n // console.warn(workerScript);\n // }\n AddRecentScript(workerScript);\n\n WorkerScriptStartStopEventEmitter.emit();\n}\n","import { Terminal } from \"./Terminal\";\n\nexport let Aliases: Record<string, string> = {};\nexport let GlobalAliases: Record<string, string> = {};\n\nexport function loadAliases(saveString: string): void {\n if (saveString === \"\") {\n Aliases = {};\n } else {\n Aliases = JSON.parse(saveString);\n }\n}\n\nexport function loadGlobalAliases(saveString: string): void {\n if (saveString === \"\") {\n GlobalAliases = {};\n } else {\n GlobalAliases = JSON.parse(saveString);\n }\n}\n\n// Prints all aliases to terminal\nexport function printAliases(): void {\n for (const name of Object.keys(Aliases)) {\n if (Aliases.hasOwnProperty(name)) {\n Terminal.print(\"alias \" + name + \"=\" + Aliases[name]);\n }\n }\n for (const name of Object.keys(GlobalAliases)) {\n if (GlobalAliases.hasOwnProperty(name)) {\n Terminal.print(\"global alias \" + name + \"=\" + GlobalAliases[name]);\n }\n }\n}\n\n// Returns true if successful, false otherwise\nexport function parseAliasDeclaration(dec: string, global = false): boolean {\n const re = /^([\\w|!%,@-]+)=(.+)$/;\n const matches = dec.match(re);\n if (matches == null || matches.length != 3) {\n return false;\n }\n\n if (global) {\n addGlobalAlias(matches[1], matches[2]);\n } else {\n addAlias(matches[1], matches[2]);\n }\n return true;\n}\n\nfunction addAlias(name: string, value: string): void {\n if (name in GlobalAliases) {\n delete GlobalAliases[name];\n }\n Aliases[name] = value.trim();\n}\n\nfunction addGlobalAlias(name: string, value: string): void {\n if (name in Aliases) {\n delete Aliases[name];\n }\n GlobalAliases[name] = value.trim();\n}\n\nfunction getAlias(name: string): string | null {\n if (Aliases.hasOwnProperty(name)) {\n return Aliases[name];\n }\n\n return null;\n}\n\nfunction getGlobalAlias(name: string): string | null {\n if (GlobalAliases.hasOwnProperty(name)) {\n return GlobalAliases[name];\n }\n return null;\n}\n\nexport function removeAlias(name: string): boolean {\n if (Aliases.hasOwnProperty(name)) {\n delete Aliases[name];\n return true;\n }\n\n if (GlobalAliases.hasOwnProperty(name)) {\n delete GlobalAliases[name];\n return true;\n }\n\n return false;\n}\n\n/**\n * Returns the original string with any aliases substituted in.\n * Aliases are only applied to \"whole words\", one level deep\n */\nexport function substituteAliases(origCommand: string): string {\n const commandArray = origCommand.split(\" \");\n if (commandArray.length > 0) {\n // For the alias and unalias commands, don't substitute\n if (commandArray[0] === \"unalias\" || commandArray[0] === \"alias\") {\n return commandArray.join(\" \");\n }\n\n let somethingSubstituted = true;\n let depth = 0;\n\n while (somethingSubstituted && depth < 10) {\n depth++;\n somethingSubstituted = false;\n const alias = getAlias(commandArray[0])?.split(\" \");\n if (alias != null) {\n somethingSubstituted = true;\n commandArray.splice(0, 1, ...alias);\n //commandArray[0] = alias;\n }\n for (let i = 0; i < commandArray.length; ++i) {\n const alias = getGlobalAlias(commandArray[i])?.split(\" \");\n if (alias != null) {\n somethingSubstituted = true;\n commandArray.splice(i, 1, ...alias);\n i += alias.length - 1;\n //commandArray[i] = alias;\n }\n }\n }\n }\n return commandArray.join(\" \");\n}\n","/**\n * Map of all Locations in the game\n * Key = Location name, value = Location object\n */\nimport { City } from \"./City\";\nimport { Cities } from \"./Cities\";\nimport { Location, IConstructorParams } from \"./Location\";\nimport { CityName } from \"./data/CityNames\";\nimport { LocationsMetadata } from \"./data/LocationsMetadata\";\n\nexport const Locations: Record<string, Location> = {};\n\n/**\n * Here, we'll initialize both Locations and Cities data. These can both\n * be initialized from the `LocationsMetadata`\n */\nfunction constructLocation(p: IConstructorParams): Location {\n if (!p.name) {\n throw new Error(`Invalid constructor parameters for Location. No 'name' property`);\n }\n\n if (Locations[p.name]) {\n console.warn(`Property with name ${p.name} already exists and is being overwritten`);\n }\n\n Locations[p.name] = new Location(p);\n\n return Locations[p.name];\n}\n\n// First construct all cities\nCities[CityName.Aevum] = new City(CityName.Aevum);\nCities[CityName.Chongqing] = new City(CityName.Chongqing);\nCities[CityName.Ishima] = new City(CityName.Ishima);\nCities[CityName.NewTokyo] = new City(CityName.NewTokyo);\nCities[CityName.Sector12] = new City(CityName.Sector12);\nCities[CityName.Volhaven] = new City(CityName.Volhaven);\n\nCities[CityName.Aevum].asciiArt = `\n [aevum police headquarters] 26 \n o \n I \\\\ [bachman & associates] \n \\\\ 56 B \n x \\\\ [summit university] \n \\\\ \\\\ 28 \n \\\\ [snap fitness gym] x o--L-----------N \n K \\\\ / \n \\\\ \\\\ Q [casino] \n x 58 \\\\ / [travel agency] \n \\\\ 94 95 o \n 90 x 59 o------o | \n \\\\ / \\\\ | 98 102 103 \n o--------O------x----o 93 96 o-----+------------o o----o \n \\\\ | \\\\ / \n [hospital] \\\\ 61 [ecorp] x 31 99 o-F-o 101 \n o | \n | o---E-- | [fulcrum tech.] \n x 62 / A [aerocorp] \n [crush fitness gym] | / | \n | / | \n o--------D------+--o o \n | |\\\\ [rho construction] \n H [netlink tech.] | J \n | | \\\\ \n | 34 x \\\\ \n [clarke inc.] C | \\\\ [world stock exchange] \n | | \\\\ \n | | o-M-------R--------o \n[galactic cybersystems] G 35 x \n | [watchdog security] \n | \n 67 o \n \n [the slums] P `;\nCities[CityName.Chongqing].asciiArt = `\n | \n 75 o \n \\\\ \n o 76 \n 7 | | \n | + 77 \n [world stock exchange] F | \n \\\\ o 78 [kuaigong international] \n \\\\ / \n 38 o----x--x------x------A------G-- \n / 39 | 41 [church] \n 37 o + 79 o--x--x-C-0 \n / | / \n / x-----+-----x-----0 [hospital] \n[solaris space system] B | \n | + 80 \n | | \n 34 o E [travel agency] \n | \n | \n x 82 \n [the slums] D `;\nCities[CityName.Ishima].asciiArt = `\n o 59 \n o o | \n [storm tech.] | | G [world stock exchange] \n | | 28 | \n 23 o--C------o--------+----x----o | \n / / 25 | 27 \\\\ x 57 \n / / | \\\\ | \n / / | \\\\ | \n o 22 o | \\\\| 29/56 \n | | o \n | [hospital] D / \\\\ 3 2 1 \n o | / \\\\ o-------x------o \n / o / \\\\ / \n 48 o / 55 x \\\\ / \n \\\\ / / x [glitch] \n \\\\ / [nova medical] / 4/30 \\\\ \n 49 x A \\\\ H \n / \\\\ / \\\\ \n / \\\\ [travel agency] F o 31 \n / \\\\ 51 / \n / o----B------x-----o \n o 50 52 \n [omega soft.] \n [the slums] E `;\nCities[CityName.NewTokyo].asciiArt = `\n \n \n o \n \\\\ \n [arcade] E [defcomm] \n \\\\ \n o--x---A--x--o [travel agency] \n 7 8 10 H \n [vitalife] o 12 [global pharmaceuticals] \n | \n o--D-x----x-------x-C-+--------x--x-B-x---x-o \n 21 22 23 \\\\ 24 25 26 27 \n \\\\ \n [noodle bar] x 14 \n \\\\ \n \\\\ \n [hospital] o 15 [world stock exchange] \n | \n o--x--F--x-----x-----x---+---x----x--I--x-o \n | \n | \n o 17 \n \n \n \n G [the slums] \n `;\nCities[CityName.Sector12].asciiArt = `\n 78 o 97 \n o [icarus microsystems] / \n N [powerhouse gym] o I \n 1 | | / \n o-----+---x----o 4 A [alpha ent.] o-------o / \n | 3 \\\\ | \\\\ / \n | \\\\ | [iron gym] x 95 \n (79) x \\\\ | / \\\\ \n | o-E----+----x----J--o 10 / o----T--o \n | | 8 \\\\ 94 x \n 80 x [city hall] | x 11 / [world stock exchange]\n | | \\\\ / \n | C [cia] \\\\ / \n Q [hospital] | F P [universal energy] \n | o [deltaone] \\\\ / \n | 35 o---------x 13/92/36 \n L [megacorp] 33 / / \\\\ \n | o------------o 34 / \\\\ \n (29) | / [carmichael sec.] D \\\\ \n o-----+-----x------o / O [rothman university] \n | 31 32 [nsa] M \n | / \n B [blade industries] H \n | / [four sigma] \n | [joe's guns] / \n | / \n 85 o--G--------K--------S-------o 88 [the slums] R \n \n [foodnstuff] [travel agency] `;\nCities[CityName.Volhaven].asciiArt = `\n [omnia cybersystems] \n 17 66 68 \n o o------G-------o \n \\\\ / \\\\ \n \\\\ o 65 o 69 \n [syscore sec.] H | | \n \\\\ | | [millenium fitness gym] \n \\\\ | 21 22 23 24 | 26 \n o----+--x--x----x---x---+-----x-------D-----o \n 19 | | 28 \n | F [omnitek inc.] \n [hospital] J 63 o \n | / 72 \n 3 | 5 6 / 9 \n o--------+----x-----x----+----------M-------o \n / | | \n / 61 x [helios labs] B [world stock exchange] \n [travel agency] L | | \n / | o \n / E [nwo] / 75 \n / [computek] | / \n / A-------o------I-----o \n 1 o | | \n | [zb] o 77 \n [lexocorp] C \n | \n o \n 57 \n \n \n [the slums] K `;\n\n// Then construct all locations, and add them to the cities as we go.\nfor (const metadata of LocationsMetadata) {\n const loc = constructLocation(metadata);\n\n const cityName = loc.city;\n if (cityName === null) {\n // Generic location, add to all cities\n for (const city of Object.keys(Cities)) {\n Cities[city].addLocation(loc.name);\n }\n } else {\n Cities[cityName].addLocation(loc.name);\n }\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { RunningScript } from \"../../Script/RunningScript\";\nimport { killWorkerScript } from \"../../Netscript/killWorkerScript\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport Draggable, { DraggableEvent } from \"react-draggable\";\nimport { ResizableBox, ResizeCallbackData } from \"react-resizable\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport ArrowForwardIosIcon from \"@mui/icons-material/ArrowForwardIos\";\nimport { workerScripts } from \"../../Netscript/WorkerScripts\";\nimport { startWorkerScript } from \"../../NetscriptWorker\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { findRunningScript } from \"../../Script/ScriptHelpers\";\nimport { debounce } from \"lodash\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { ANSIITypography } from \"./ANSIITypography\";\nimport { ScriptArg } from \"../../Netscript/ScriptArg\";\n\nlet layerCounter = 0;\n\nexport const LogBoxEvents = new EventEmitter<[RunningScript]>();\nexport const LogBoxCloserEvents = new EventEmitter<[number]>();\nexport const LogBoxClearEvents = new EventEmitter<[]>();\n\ninterface LogBoxUIEvent<T> {\n pid: number;\n data: T;\n}\n\ninterface LogBoxPositionData {\n x: number;\n y: number;\n}\n\nexport const LogBoxPositionEvents = new EventEmitter<[LogBoxUIEvent<LogBoxPositionData>]>();\n\ninterface LogBoxResizeData {\n w: number;\n h: number;\n}\n\nexport const LogBoxSizeEvents = new EventEmitter<[LogBoxUIEvent<LogBoxResizeData>]>();\n\ninterface Log {\n id: string;\n script: RunningScript;\n}\n\nlet logs: Log[] = [];\n\nexport function LogBoxManager(): React.ReactElement {\n const setRerender = useState(true)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n useEffect(\n () =>\n LogBoxEvents.subscribe((script: RunningScript) => {\n const id = script.server + \"-\" + script.filename + script.args.map((x: ScriptArg): string => `${x}`).join(\"-\");\n if (logs.find((l) => l.id === id)) return;\n logs.push({\n id: id,\n script: script,\n });\n rerender();\n }),\n [],\n );\n\n //Event used by ns.closeTail to close tail windows\n useEffect(\n () =>\n LogBoxCloserEvents.subscribe((pid: number) => {\n closePid(pid);\n }),\n [],\n );\n\n useEffect(() =>\n LogBoxClearEvents.subscribe(() => {\n logs = [];\n rerender();\n }),\n );\n\n //Close tail windows by their id\n function close(id: string): void {\n logs = logs.filter((l) => l.id !== id);\n rerender();\n }\n\n //Close tail windows by their pid\n function closePid(pid: number): void {\n logs = logs.filter((log) => log.script.pid != pid);\n rerender();\n }\n\n return (\n <>\n {logs.map((log) => (\n <LogWindow key={log.id} script={log.script} id={log.id} onClose={() => close(log.id)} />\n ))}\n </>\n );\n}\n\ninterface IProps {\n script: RunningScript;\n id: string;\n onClose: () => void;\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n logs: {\n overflowY: \"scroll\",\n overflowX: \"hidden\",\n scrollbarWidth: \"auto\",\n flexDirection: \"column-reverse\",\n whiteSpace: \"pre-wrap\",\n wordWrap: \"break-word\",\n },\n titleButton: {\n padding: \"1px 0\",\n height: \"100%\",\n },\n }),\n);\n\nexport const logBoxBaseZIndex = 1500;\n\nfunction LogWindow(props: IProps): React.ReactElement {\n const draggableRef = useRef<HTMLDivElement>(null);\n const rootRef = useRef<Draggable>(null);\n const [script, setScript] = useState(props.script);\n const classes = useStyles();\n const container = useRef<HTMLDivElement>(null);\n const setRerender = useState(false)[1];\n const [size, setSize] = useState<[number, number]>([500, 500]);\n const [minimized, setMinimized] = useState(false);\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const onResize = (e: React.SyntheticEvent, { size }: ResizeCallbackData) => {\n setSize([size.width, size.height]);\n };\n\n // useEffect(\n // () =>\n // WorkerScriptStartStopEventEmitter.subscribe(() => {\n // setTimeout(() => {\n // const server = GetServer(script.server);\n // if (server === null) return;\n // const existingScript = findRunningScript(script.filename, script.args, server);\n // if (existingScript) {\n // existingScript.logs = script.logs.concat(existingScript.logs)\n // setScript(existingScript)\n // }\n // rerender();\n // }, 100)\n // }),\n // [],\n // );\n\n const setPosition = ({ x, y }: LogBoxPositionData) => {\n const node = rootRef?.current;\n if (!node) return;\n const state = node.state as { x: number; y: number };\n state.x = x;\n state.y = y;\n };\n\n // Listen to Logbox positioning events.\n useEffect(\n () =>\n LogBoxPositionEvents.subscribe((e) => {\n if (e.pid !== props.script.pid) return;\n setPosition(e.data);\n }),\n [],\n );\n\n // Listen to Logbox resizing events.\n useEffect(\n () =>\n LogBoxSizeEvents.subscribe((e) => {\n if (e.pid !== props.script.pid) return;\n setSize([e.data.w, e.data.h]);\n }),\n [],\n );\n\n // initial position if 40%/30%\n useEffect(() => setPosition({ x: window.innerWidth * 0.4, y: window.innerHeight * 0.3 }), []);\n\n useEffect(() => {\n updateLayer();\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n function kill(): void {\n killWorkerScript({ runningScript: script, hostname: script.server });\n }\n\n function run(): void {\n const server = GetServer(script.server);\n if (server === null) return;\n const s = findRunningScript(script.filename, script.args, server);\n if (s === null) {\n script.ramUsage = 0;\n startWorkerScript(script, server);\n } else {\n setScript(s);\n }\n }\n\n function updateLayer(): void {\n const c = container.current;\n if (c === null) return;\n c.style.zIndex = logBoxBaseZIndex + layerCounter + \"\";\n layerCounter++;\n rerender();\n }\n\n function title(full = false): string {\n const maxLength = 30;\n const t = `${script.filename} ${script.args.map((x: ScriptArg): string => `${x}`).join(\" \")}`;\n if (full || t.length <= maxLength) {\n return t;\n }\n return t.slice(0, maxLength - 3) + \"...\";\n }\n\n function minimize(): void {\n setMinimized(!minimized);\n }\n\n function lineColor(s: string): \"error\" | \"success\" | \"warn\" | \"info\" | \"primary\" {\n if (s.match(/(^\\[[^\\]]+\\] )?ERROR/) || s.match(/(^\\[[^\\]]+\\] )?FAIL/)) {\n return \"error\";\n }\n if (s.match(/(^\\[[^\\]]+\\] )?SUCCESS/)) {\n return \"success\";\n }\n if (s.match(/(^\\[[^\\]]+\\] )?WARN/)) {\n return \"warn\";\n }\n if (s.match(/(^\\[[^\\]]+\\] )?INFO/)) {\n return \"info\";\n }\n return \"primary\";\n }\n\n // And trigger fakeDrag when the window is resized\n useEffect(() => {\n window.addEventListener(\"resize\", onWindowResize);\n return () => {\n window.removeEventListener(\"resize\", onWindowResize);\n };\n }, []);\n\n const onWindowResize = debounce((): void => {\n const node = draggableRef?.current;\n if (!node) return;\n\n if (!isOnScreen(node)) {\n setPosition({ x: 0, y: 0 });\n }\n }, 100);\n\n const isOnScreen = (node: HTMLDivElement): boolean => {\n const bounds = node.getBoundingClientRect();\n\n return !(bounds.right < 0 || bounds.bottom < 0 || bounds.left > innerWidth || bounds.top > outerWidth);\n };\n\n const boundToBody = (e: DraggableEvent): void | false => {\n if (\n e instanceof MouseEvent &&\n (e.clientX < 0 || e.clientY < 0 || e.clientX > innerWidth || e.clientY > innerHeight)\n )\n return false;\n };\n\n // Max [width, height]\n const minConstraints: [number, number] = [250, 33];\n\n return (\n <Draggable handle=\".drag\" onDrag={boundToBody} ref={rootRef} onMouseDown={updateLayer}>\n <Box\n display=\"flex\"\n sx={{\n flexFlow: \"column\",\n position: \"fixed\",\n zIndex: 1400,\n minWidth: `${minConstraints[0]}px`,\n minHeight: `${minConstraints[1]}px`,\n ...(minimized\n ? {\n border: \"none\",\n margin: 0,\n maxHeight: 0,\n padding: 0,\n }\n : {\n border: `1px solid ${Settings.theme.welllight}`,\n }),\n }}\n ref={container}\n >\n <ResizableBox\n width={size[0]}\n height={size[1]}\n onResize={onResize}\n minConstraints={minConstraints}\n handle={\n <span\n style={{\n position: \"absolute\",\n right: \"-10px\",\n bottom: \"-16px\",\n cursor: \"nw-resize\",\n display: minimized ? \"none\" : \"inline-block\",\n }}\n >\n <ArrowForwardIosIcon color=\"primary\" style={{ transform: \"rotate(45deg)\", fontSize: \"1.75rem\" }} />\n </span>\n }\n >\n <>\n <Paper className=\"drag\" sx={{ display: \"flex\", alignItems: \"center\", cursor: \"grab\" }} ref={draggableRef}>\n <Typography\n variant=\"h6\"\n sx={{ marginRight: \"auto\", textOverflow: \"ellipsis\", whiteSpace: \"nowrap\", overflow: \"hidden\" }}\n title={title(true)}\n >\n {title(true)}\n </Typography>\n\n <span style={{ minWidth: \"fit-content\", height: `${minConstraints[1]}px` }}>\n {!workerScripts.has(script.pid) ? (\n <Button className={classes.titleButton} onClick={run} onTouchEnd={run}>\n Run\n </Button>\n ) : (\n <Button className={classes.titleButton} onClick={kill} onTouchEnd={kill}>\n Kill\n </Button>\n )}\n <Button className={classes.titleButton} onClick={minimize} onTouchEnd={minimize}>\n {minimized ? \"\\u{1F5D6}\" : \"\\u{1F5D5}\"}\n </Button>\n <Button className={classes.titleButton} onClick={props.onClose} onTouchEnd={props.onClose}>\n Close\n </Button>\n </span>\n </Paper>\n\n <Paper\n className={classes.logs}\n sx={{ height: `calc(100% - ${minConstraints[1]}px)`, display: minimized ? \"none\" : \"flex\" }}\n >\n <span style={{ display: \"flex\", flexDirection: \"column\" }}>\n {script.logs.map(\n (line: string, i: number): JSX.Element => (\n <ANSIITypography key={i} text={line} color={lineColor(line)} />\n ),\n )}\n </span>\n </Paper>\n </>\n </ResizableBox>\n </Box>\n </Draggable>\n );\n}\n","/**\n * Lore / world building literature files that can be found on servers.\n * These files can be read by the player\n */\nexport class Literature {\n title: string;\n fn: string;\n txt: string;\n\n constructor(title: string, filename: string, txt: string) {\n this.title = title;\n this.fn = filename;\n this.txt = txt;\n }\n}\n","import React, { useState } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ntype IProps = {\n value: string;\n color?: string;\n variant?:\n | \"button\"\n | \"caption\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"subtitle1\"\n | \"subtitle2\"\n | \"body1\"\n | \"body2\"\n | \"overline\"\n | \"inherit\"\n | undefined;\n};\n\nexport function CopyableText(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n function copy(): void {\n const copyText = document.createElement(\"textarea\");\n copyText.value = props.value;\n document.body.appendChild(copyText);\n copyText.select();\n copyText.setSelectionRange(0, 1e10);\n document.execCommand(\"copy\");\n document.body.removeChild(copyText);\n setOpen(true);\n setTimeout(() => setOpen(false), 1000);\n }\n\n return (\n <Tooltip open={open} title={<Typography>Copied!</Typography>}>\n <Typography variant={props.variant} color={props.color} onClick={copy}>\n {props.value}\n </Typography>\n </Tooltip>\n );\n}\n","import React from \"react\";\nimport { createTheme, ThemeProvider, Theme, StyledEngineProvider } from \"@mui/material/styles\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Settings } from \"../../Settings/Settings\";\n\nexport const ThemeEvents = new EventEmitter<[]>();\n\ndeclare module \"@mui/material/styles\" {\n interface Theme {\n colors: {\n hp: React.CSSProperties[\"color\"];\n money: React.CSSProperties[\"color\"];\n hack: React.CSSProperties[\"color\"];\n combat: React.CSSProperties[\"color\"];\n cha: React.CSSProperties[\"color\"];\n int: React.CSSProperties[\"color\"];\n rep: React.CSSProperties[\"color\"];\n backgroundprimary: React.CSSProperties[\"color\"];\n backgroundsecondary: React.CSSProperties[\"color\"];\n button: React.CSSProperties[\"color\"];\n successlight: React.CSSProperties[\"color\"];\n success: React.CSSProperties[\"color\"];\n successdark: React.CSSProperties[\"color\"];\n white: React.CSSProperties[\"color\"];\n black: React.CSSProperties[\"color\"];\n };\n }\n interface ThemeOptions {\n colors: {\n hp: React.CSSProperties[\"color\"];\n money: React.CSSProperties[\"color\"];\n hack: React.CSSProperties[\"color\"];\n combat: React.CSSProperties[\"color\"];\n cha: React.CSSProperties[\"color\"];\n int: React.CSSProperties[\"color\"];\n rep: React.CSSProperties[\"color\"];\n backgroundprimary: React.CSSProperties[\"color\"];\n backgroundsecondary: React.CSSProperties[\"color\"];\n button: React.CSSProperties[\"color\"];\n successlight: React.CSSProperties[\"color\"];\n success: React.CSSProperties[\"color\"];\n successdark: React.CSSProperties[\"color\"];\n white: React.CSSProperties[\"color\"];\n black: React.CSSProperties[\"color\"];\n };\n }\n}\n\nlet theme: Theme;\n\nexport function refreshTheme(): void {\n theme = createTheme({\n colors: {\n hp: Settings.theme.hp,\n money: Settings.theme.money,\n hack: Settings.theme.hack,\n combat: Settings.theme.combat,\n cha: Settings.theme.cha,\n int: Settings.theme.int,\n rep: Settings.theme.rep,\n backgroundprimary: Settings.theme.backgroundprimary,\n backgroundsecondary: Settings.theme.backgroundsecondary,\n button: Settings.theme.button,\n successlight: Settings.theme.successlight,\n success: Settings.theme.success,\n successdark: Settings.theme.successdark,\n white: Settings.theme.white,\n black: Settings.theme.black,\n },\n palette: {\n primary: {\n light: Settings.theme.primarylight,\n main: Settings.theme.primary,\n dark: Settings.theme.primarydark,\n },\n secondary: {\n light: Settings.theme.secondarylight,\n main: Settings.theme.secondary,\n dark: Settings.theme.secondarydark,\n },\n error: {\n light: Settings.theme.errorlight,\n main: Settings.theme.error,\n dark: Settings.theme.errordark,\n },\n info: {\n light: Settings.theme.infolight,\n main: Settings.theme.info,\n dark: Settings.theme.infodark,\n },\n warning: {\n light: Settings.theme.warninglight,\n main: Settings.theme.warning,\n dark: Settings.theme.warningdark,\n },\n success: {\n light: Settings.theme.successlight,\n main: Settings.theme.success,\n dark: Settings.theme.successdark,\n },\n background: {\n default: Settings.theme.backgroundprimary,\n paper: Settings.theme.well,\n },\n action: {\n disabled: Settings.theme.disabled,\n },\n },\n typography: {\n fontFamily: Settings.styles.fontFamily,\n button: {\n textTransform: \"none\",\n },\n },\n components: {\n MuiInputBase: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.well,\n color: Settings.theme.primary,\n },\n input: {\n \"&::placeholder\": {\n userSelect: \"none\",\n color: Settings.theme.primarydark,\n },\n },\n },\n },\n\n MuiInput: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.well,\n borderBottomColor: \"#fff\",\n },\n underline: {\n \"&:hover\": {\n borderBottomColor: Settings.theme.primarydark,\n },\n \"&:before\": {\n borderBottomColor: Settings.theme.primary,\n },\n \"&:after\": {\n borderBottomColor: Settings.theme.primarylight,\n },\n },\n },\n },\n\n MuiInputLabel: {\n styleOverrides: {\n root: {\n color: Settings.theme.primarydark, // why is this switched?\n userSelect: \"none\",\n \"&:before\": {\n color: Settings.theme.primarylight,\n },\n },\n },\n },\n\n MuiButtonGroup: {\n styleOverrides: {\n root: {\n \"& .MuiButton-root:not(:last-of-type)\": {\n marginRight: \"1px\",\n },\n },\n },\n },\n\n MuiButton: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.button,\n border: \"1px solid \" + Settings.theme.well,\n // color: Settings.theme.primary,\n \"&:hover\": {\n backgroundColor: Settings.theme.backgroundsecondary,\n },\n\n borderRadius: 0,\n },\n },\n },\n MuiSelect: {\n styleOverrides: {\n icon: {\n color: Settings.theme.primary,\n },\n },\n defaultProps: {\n variant: \"standard\",\n },\n },\n MuiTextField: {\n defaultProps: {\n variant: \"standard\",\n },\n },\n MuiTypography: {\n defaultProps: {\n color: \"primary\",\n },\n styleOverrides: {\n root: {\n lineHeight: Settings.styles.lineHeight,\n },\n },\n },\n MuiMenu: {\n styleOverrides: {\n list: {\n backgroundColor: Settings.theme.well,\n },\n },\n },\n MuiMenuItem: {\n styleOverrides: {\n root: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiAccordionSummary: {\n styleOverrides: {\n root: {\n backgroundColor: \"#111\",\n },\n },\n },\n MuiAccordionDetails: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.backgroundsecondary,\n },\n },\n },\n MuiIconButton: {\n styleOverrides: {\n root: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiTooltip: {\n styleOverrides: {\n tooltip: {\n fontSize: \"1em\",\n color: Settings.theme.primary,\n backgroundColor: Settings.theme.well,\n borderRadius: 0,\n border: \"2px solid white\",\n maxWidth: \"100vh\",\n },\n },\n defaultProps: {\n disableInteractive: true,\n },\n },\n MuiSlider: {\n styleOverrides: {\n valueLabel: {\n color: Settings.theme.primary,\n backgroundColor: Settings.theme.well,\n },\n },\n },\n MuiDrawer: {\n styleOverrides: {\n paper: {\n \"&::-webkit-scrollbar\": {\n // webkit\n display: \"none\",\n },\n scrollbarWidth: \"none\", // firefox\n backgroundColor: Settings.theme.backgroundsecondary,\n },\n paperAnchorDockedLeft: {\n borderRight: \"1px solid \" + Settings.theme.welllight,\n },\n },\n },\n MuiDivider: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.welllight,\n },\n },\n },\n MuiFormControlLabel: {\n styleOverrides: {\n root: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiSwitch: {\n styleOverrides: {\n switchBase: {\n color: Settings.theme.primarydark,\n },\n track: {\n backgroundColor: Settings.theme.welllight,\n },\n },\n },\n MuiPaper: {\n styleOverrides: {\n root: {\n borderRadius: 0,\n backgroundColor: Settings.theme.backgroundsecondary,\n border: \"1px solid \" + Settings.theme.welllight,\n },\n },\n },\n MuiTablePagination: {\n styleOverrides: {\n select: {\n color: Settings.theme.primary,\n },\n selectLabel: {\n color: Settings.theme.primary,\n },\n displayedRows: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiTab: {\n styleOverrides: {\n textColorPrimary: {\n color: Settings.theme.secondary,\n \"&.Mui-selected\": {\n color: Settings.theme.primary,\n },\n },\n root: {\n backgroundColor: Settings.theme.backgroundsecondary,\n border: \"1px solid \" + Settings.theme.well,\n margin: \"3px\",\n\n \"&.Mui-selected\": {\n backgroundColor: Settings.theme.button,\n },\n },\n },\n },\n MuiTabs: {\n styleOverrides: {\n scrollButtons: {\n backgroundColor: Settings.theme.backgroundsecondary,\n color: Settings.theme.secondary,\n margin: \"3px\",\n opacity: 1,\n width: \"fit-content\",\n\n \"&.Mui-disabled\": {\n opacity: 0.5,\n },\n },\n },\n defaultProps: {\n TabIndicatorProps: {\n style: {\n display: \"none\",\n },\n },\n },\n },\n MuiAlert: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.black,\n borderRadius: 0,\n border: \"1px solid \" + Settings.theme.well,\n },\n standardSuccess: {\n color: Settings.theme.successlight,\n },\n standardError: {\n color: Settings.theme.errorlight,\n },\n standardWarning: {\n color: Settings.theme.warninglight,\n },\n standardInfo: {\n color: Settings.theme.infolight,\n },\n },\n },\n },\n });\n\n document.body.style.backgroundColor = theme.colors.backgroundprimary?.toString() ?? \"black\";\n}\nrefreshTheme();\n\ninterface IProps {\n children: JSX.Element[] | JSX.Element;\n}\n\nexport const TTheme = ({ children }: IProps): React.ReactElement => (\n <StyledEngineProvider injectFirst>\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </StyledEngineProvider>\n);\n","/** Allowed values for the 'OwnedAugmentationsOrder' setting */\nexport enum PurchaseAugmentationsOrderSetting {\n Cost,\n Default,\n Reputation,\n Purchasable,\n}\n\n/** Allowed values for the 'OwnedAugmentationsOrder' setting */\nexport enum OwnedAugmentationsOrderSetting {\n Alphabetically,\n AcquirementTime,\n}\n","import { WorkerScript } from \"./WorkerScript\";\n\n/** Global pool of all active scripts (scripts that are currently running) */\nexport const workerScripts: Map<number, WorkerScript> = new Map();\n","// Map of material (by name) to their sizes (how much space it takes in warehouse)\nexport const MaterialSizes: Record<string, number> = {\n Water: 0.05,\n Energy: 0.01,\n Food: 0.03,\n Plants: 0.05,\n Metal: 0.1,\n Hardware: 0.06,\n Chemicals: 0.05,\n Drugs: 0.02,\n Robots: 0.5,\n AICores: 0.1,\n RealEstate: 0.005,\n \"Real Estate\": 0.005,\n \"AI Cores\": 0.1,\n};\n","/**\n * Given an experience amount and stat multiplier, calculates the\n * stat level. Stat-agnostic (same formula for every stat)\n */\nexport function calculateSkill(exp: number, mult = 1): number {\n return Math.max(Math.floor(mult * (32 * Math.log(exp + 534.5) - 200)), 1);\n}\n\nexport function calculateExp(skill: number, mult = 1): number {\n return Math.exp((skill / mult + 200) / 32) - 534.6;\n}\n\nexport function calculateSkillProgress(exp: number, mult = 1): ISkillProgress {\n const currentSkill = calculateSkill(exp, mult);\n const nextSkill = currentSkill + 1;\n\n let baseExperience = calculateExp(currentSkill, mult);\n if (baseExperience < 0) baseExperience = 0;\n\n let nextExperience = calculateExp(nextSkill, mult);\n if (nextExperience < 0) nextExperience = 0;\n\n const normalize = (value: number): number => ((value - baseExperience) * 100) / (nextExperience - baseExperience);\n let progress = nextExperience - baseExperience !== 0 ? normalize(exp) : 99.99;\n\n // Clamp progress: When sleeves are working out, the player gets way too much progress\n if (progress < 0) progress = 0;\n if (progress > 100) progress = 100;\n\n // Clamp floating point imprecisions\n let currentExperience = exp - baseExperience;\n let remainingExperience = nextExperience - exp;\n if (currentExperience < 0) currentExperience = 0;\n if (remainingExperience < 0) remainingExperience = 0;\n\n return {\n currentSkill,\n nextSkill,\n baseExperience,\n experience: exp,\n nextExperience,\n currentExperience,\n remainingExperience,\n progress,\n };\n}\n\nexport interface ISkillProgress {\n currentSkill: number;\n nextSkill: number;\n baseExperience: number;\n experience: number;\n nextExperience: number;\n currentExperience: number;\n remainingExperience: number;\n progress: number;\n}\n\nexport function getEmptySkillProgress(): ISkillProgress {\n return {\n currentSkill: 0,\n nextSkill: 0,\n baseExperience: 0,\n experience: 0,\n nextExperience: 0,\n currentExperience: 0,\n remainingExperience: 0,\n progress: 0,\n };\n}\n","export interface IMults {\n hack?: number;\n str?: number;\n def?: number;\n dex?: number;\n agi?: number;\n cha?: number;\n}\n\nexport enum UpgradeType {\n Weapon = \"w\",\n Armor = \"a\",\n Vehicle = \"v\",\n Rootkit = \"r\",\n Augmentation = \"g\",\n}\n\n/**\n * Defines the parameters that can be used to initialize and describe a GangMemberUpgrade\n * (defined in Gang.js)\n */\ninterface IGangMemberUpgradeMetadata {\n cost: number;\n mults: IMults;\n name: string;\n upgType: UpgradeType;\n}\n\n/**\n * Array of metadata for all Gang Member upgrades. Used to construct the global GangMemberUpgrade\n * objects in Gang.js\n */\nexport const gangMemberUpgradesMetadata: IGangMemberUpgradeMetadata[] = [\n {\n cost: 1e6,\n mults: { str: 1.04, def: 1.04 },\n name: \"Baseball Bat\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 12e6,\n mults: { str: 1.08, def: 1.08, dex: 1.08 },\n name: \"Katana\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 25e6,\n mults: { str: 1.1, def: 1.1, dex: 1.1, agi: 1.1 },\n name: \"Glock 18C\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 50e6,\n mults: { str: 1.12, def: 1.1, agi: 1.1 },\n name: \"P90C\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 60e6,\n mults: { str: 1.2, def: 1.15 },\n name: \"Steyr AUG\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 100e6,\n mults: { str: 1.25, def: 1.2 },\n name: \"AK-47\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 150e6,\n mults: { str: 1.3, def: 1.25 },\n name: \"M15A10 Assault Rifle\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 225e6,\n mults: { str: 1.3, dex: 1.25, agi: 1.3 },\n name: \"AWM Sniper Rifle\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 2e6,\n mults: { def: 1.04 },\n name: \"Bulletproof Vest\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 5e6,\n mults: { def: 1.08 },\n name: \"Full Body Armor\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 25e6,\n mults: { def: 1.15, agi: 1.15 },\n name: \"Liquid Body Armor\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 40e6,\n mults: { def: 1.2 },\n name: \"Graphene Plating Armor\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 3e6,\n mults: { agi: 1.04, cha: 1.04 },\n name: \"Ford Flex V20\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 9e6,\n mults: { agi: 1.08, cha: 1.08 },\n name: \"ATX1070 Superbike\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 18e6,\n mults: { agi: 1.12, cha: 1.12 },\n name: \"Mercedes-Benz S9001\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 30e6,\n mults: { agi: 1.16, cha: 1.16 },\n name: \"White Ferrari\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 5e6,\n mults: { hack: 1.05 },\n name: \"NUKE Rootkit\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 25e6,\n mults: { hack: 1.1 },\n name: \"Soulstealer Rootkit\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 75e6,\n mults: { hack: 1.15 },\n name: \"Demon Rootkit\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 40e6,\n mults: { hack: 1.12 },\n name: \"Hmap Node\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 75e6,\n mults: { hack: 1.15 },\n name: \"Jack the Ripper\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 10e9,\n mults: { str: 1.3, dex: 1.3 },\n name: \"Bionic Arms\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 10e9,\n mults: { agi: 1.6 },\n name: \"Bionic Legs\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 15e9,\n mults: { str: 1.15, def: 1.15, dex: 1.15, agi: 1.15 },\n name: \"Bionic Spine\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 20e9,\n mults: { str: 1.4, def: 1.4 },\n name: \"BrachiBlades\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 12e9,\n mults: { str: 1.2, def: 1.2 },\n name: \"Nanofiber Weave\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 25e9,\n mults: { str: 1.5, agi: 1.5 },\n name: \"Synthetic Heart\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 15e9,\n mults: { str: 1.3, def: 1.3 },\n name: \"Synfibril Muscle\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 5e9,\n mults: { hack: 1.05 },\n name: \"BitWire\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 10e9,\n mults: { hack: 1.15 },\n name: \"Neuralstimulator\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 7.5e9,\n mults: { hack: 1.1 },\n name: \"DataJack\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 50e9,\n mults: { str: 1.7, def: 1.7 },\n name: \"Graphene Bone Lacings\",\n upgType: UpgradeType.Augmentation,\n },\n];\n","/**\n * Checks whether the value passed in can be considered a string.\n * @param value The value to check if it is a string.\n */\nexport function isString(value: unknown): value is string {\n return typeof value === \"string\" || value instanceof String;\n}\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\n\nexport const GangConstants = {\n // Respect is divided by this to get rep gain\n GangRespectToReputationRatio: 75,\n MaximumGangMembers: 12,\n CyclesPerTerritoryAndPowerUpdate: 100,\n // Portion of upgrade multiplier that is kept after ascending\n AscensionMultiplierRatio: 0.15,\n // Names of possible Gangs\n Names: [\n FactionNames.SlumSnakes,\n FactionNames.Tetrads,\n FactionNames.TheSyndicate,\n FactionNames.TheDarkArmy,\n FactionNames.SpeakersForTheDead,\n FactionNames.NiteSec,\n FactionNames.TheBlackHand,\n ] as string[],\n GangKarmaRequirement: -54000,\n};\n","/**\n * Functions for handling WorkerScripts, which are the underlying mechanism\n * that allows for scripts to run\n */\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { ScriptDeath } from \"./Netscript/ScriptDeath\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\nimport { generateNextPid } from \"./Netscript/Pid\";\n\nimport { CONSTANTS } from \"./Constants\";\nimport { Interpreter } from \"./ThirdParty/JSInterpreter\";\nimport { NetscriptFunctions } from \"./NetscriptFunctions\";\nimport { compile, Node } from \"./NetscriptJSEvaluator\";\nimport { IPort } from \"./NetscriptPort\";\nimport { RunningScript } from \"./Script/RunningScript\";\nimport { getRamUsageFromRunningScript } from \"./Script/RunningScriptHelpers\";\nimport { scriptCalculateOfflineProduction } from \"./Script/ScriptHelpers\";\nimport { Script } from \"./Script/Script\";\nimport { GetAllServers } from \"./Server/AllServers\";\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { Settings } from \"./Settings/Settings\";\n\nimport { generate } from \"escodegen\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { roundToTwo } from \"./utils/helpers/roundToTwo\";\n\nimport { parse } from \"acorn\";\nimport { simple as walksimple } from \"acorn-walk\";\nimport { areFilesEqual } from \"./Terminal/DirectoryHelpers\";\nimport { Terminal } from \"./Terminal\";\nimport { ScriptArg } from \"./Netscript/ScriptArg\";\nimport { handleUnknownError } from \"./Netscript/NetscriptHelpers\";\n\nexport const NetscriptPorts: Map<number, IPort> = new Map();\n\nexport function prestigeWorkerScripts(): void {\n for (const ws of workerScripts.values()) {\n ws.env.stopFlag = true;\n killWorkerScript(ws);\n }\n\n NetscriptPorts.clear();\n\n WorkerScriptStartStopEventEmitter.emit();\n workerScripts.clear();\n}\n\nasync function startNetscript2Script(workerScript: WorkerScript): Promise<void> {\n const scripts = workerScript.getServer().scripts;\n const script = workerScript.getScript();\n if (script === null) throw \"workerScript had no associated script. This is a bug.\";\n const loadedModule = await compile(script, scripts);\n workerScript.ramUsage = script.ramUsage;\n const ns = workerScript.env.vars;\n\n if (!loadedModule) throw `${script.filename} cannot be run because the script module won't load`;\n // TODO: Better error for \"unexpected reserved word\" when using await in non-async function?\n if (typeof loadedModule.main !== \"function\")\n throw `${script.filename} cannot be run because it does not have a main function.`;\n if (!ns) throw `${script.filename} cannot be run because the NS object hasn't been constructed properly.`;\n await loadedModule.main(ns);\n}\n\nasync function startNetscript1Script(workerScript: WorkerScript): Promise<void> {\n const code = workerScript.code;\n let errorToThrow: unknown;\n\n //Process imports\n let codeWithImports, codeLineOffset;\n try {\n const importProcessingRes = processNetscript1Imports(code, workerScript);\n codeWithImports = importProcessingRes.code;\n codeLineOffset = importProcessingRes.lineOffset;\n } catch (e: unknown) {\n throw `Error processing Imports in ${workerScript.name}@${workerScript.hostname}:\\n\\n${e}`;\n }\n\n interface BasicObject {\n [key: string]: any;\n }\n function wrapNS1Layer(int: Interpreter, intLayer: unknown, nsLayer = workerScript.env.vars as BasicObject) {\n for (const [name, entry] of Object.entries(nsLayer)) {\n if (typeof entry === \"function\") {\n const wrapper = async (...args: unknown[]) => {\n try {\n // Sent a resolver function as an extra arg. See createAsyncFunction JSInterpreter.js:3209\n const callback = args.pop() as (value: unknown) => void;\n const result = await entry(...args.map((arg) => int.pseudoToNative(arg)));\n return callback(int.nativeToPseudo(result));\n } catch (e: unknown) {\n errorToThrow = e;\n }\n };\n int.setProperty(intLayer, name, int.createAsyncFunction(wrapper));\n } else if (Array.isArray(entry) || typeof entry !== \"object\") {\n // args, strings on enums, etc\n int.setProperty(intLayer, name, int.nativeToPseudo(entry));\n } else {\n // new object layer, e.g. bladeburner\n int.setProperty(intLayer, name, int.nativeToPseudo({}));\n wrapNS1Layer(int, (intLayer as BasicObject).properties[name], nsLayer[name]);\n }\n }\n }\n\n let interpreter: Interpreter;\n try {\n interpreter = new Interpreter(codeWithImports, wrapNS1Layer, codeLineOffset);\n } catch (e: unknown) {\n throw `Syntax ERROR in ${workerScript.name}@${workerScript.hostname}:\\n\\n${String(e)}`;\n }\n\n let more = true;\n while (more) {\n if (errorToThrow) throw errorToThrow;\n if (workerScript.env.stopFlag) return;\n for (let i = 0; more && i < 3; i++) more = interpreter.step();\n if (more) await new Promise((r) => setTimeout(r, Settings.CodeInstructionRunTime));\n }\n}\n\n/* Since the JS Interpreter used for Netscript 1.0 only supports ES5, the keyword\n 'import' throws an error. However, since we want to support import functionality\n we'll implement it ourselves by parsing the Nodes in the AST out.\n\n @param code - The script's code\n @returns {Object} {\n code: Newly-generated code with imported functions\n lineOffset: Net number of lines of code added/removed due to imported functions\n Should typically be positive\n }\n*/\nfunction processNetscript1Imports(code: string, workerScript: WorkerScript): { code: string; lineOffset: number } {\n //allowReserved prevents 'import' from throwing error in ES5\n const ast: Node = parse(code, {\n ecmaVersion: 9,\n allowReserved: true,\n sourceType: \"module\",\n });\n\n const server = workerScript.getServer();\n if (server == null) {\n throw new Error(\"Failed to find underlying Server object for script\");\n }\n\n function getScript(scriptName: string): Script | null {\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === scriptName) {\n return server.scripts[i];\n }\n }\n return null;\n }\n\n let generatedCode = \"\"; // Generated Javascript Code\n let hasImports = false;\n\n // Walk over the tree and process ImportDeclaration nodes\n walksimple(ast, {\n ImportDeclaration: (node: Node) => {\n hasImports = true;\n let scriptName = node.source.value;\n if (scriptName.startsWith(\"./\")) {\n scriptName = scriptName.slice(2);\n }\n const script = getScript(scriptName);\n if (script == null) {\n throw new Error(\"'Import' failed due to invalid script: \" + scriptName);\n }\n const scriptAst = parse(script.code, {\n ecmaVersion: 9,\n allowReserved: true,\n sourceType: \"module\",\n });\n\n if (node.specifiers.length === 1 && node.specifiers[0].type === \"ImportNamespaceSpecifier\") {\n // import * as namespace from script\n const namespace = node.specifiers[0].local.name;\n const fnNames: string[] = []; //Names only\n const fnDeclarations: Node[] = []; //FunctionDeclaration Node objects\n walksimple(scriptAst, {\n FunctionDeclaration: (node: Node) => {\n fnNames.push(node.id.name);\n fnDeclarations.push(node);\n },\n });\n\n //Now we have to generate the code that would create the namespace\n generatedCode += `var ${namespace};\\n(function (namespace) {\\n`;\n\n //Add the function declarations\n fnDeclarations.forEach((fn: Node) => {\n generatedCode += generate(fn);\n generatedCode += \"\\n\";\n });\n\n //Add functions to namespace\n fnNames.forEach((fnName) => {\n generatedCode += \"namespace.\" + fnName + \" = \" + fnName;\n generatedCode += \"\\n\";\n });\n\n //Finish\n generatedCode += `})(${namespace} || (\" + namespace + \" = {}));\\n`;\n } else {\n //import {...} from script\n\n //Get array of all fns to import\n const fnsToImport: string[] = [];\n node.specifiers.forEach((e: Node) => {\n fnsToImport.push(e.local.name);\n });\n\n //Walk through script and get FunctionDeclaration code for all specified fns\n const fnDeclarations: Node[] = [];\n walksimple(scriptAst, {\n FunctionDeclaration: (node: Node) => {\n if (fnsToImport.includes(node.id.name)) {\n fnDeclarations.push(node);\n }\n },\n });\n\n //Convert FunctionDeclarations into code\n fnDeclarations.forEach((fn: Node) => {\n generatedCode += generate(fn);\n generatedCode += \"\\n\";\n });\n }\n },\n });\n\n //If there are no imports, just return the original code\n if (!hasImports) {\n return { code: code, lineOffset: 0 };\n }\n\n //Remove ImportDeclarations from AST. These ImportDeclarations must be in top-level\n let linesRemoved = 0;\n if (ast.type !== \"Program\" || ast.body == null) {\n throw new Error(\"Code could not be properly parsed\");\n }\n for (let i = ast.body.length - 1; i >= 0; --i) {\n if (ast.body[i].type === \"ImportDeclaration\") {\n ast.body.splice(i, 1);\n ++linesRemoved;\n }\n }\n\n //Calculated line offset\n const lineOffset = (generatedCode.match(/\\n/g) || []).length - linesRemoved;\n\n //Convert the AST back into code\n code = generate(ast);\n\n //Add the imported code and re-generate in ES5 (JS Interpreter for NS1 only supports ES5);\n code = generatedCode + code;\n\n const res = {\n code: code,\n lineOffset: lineOffset,\n };\n return res;\n}\n\n/**\n * Used to start a RunningScript (by creating and starting its\n * corresponding WorkerScript), and add the RunningScript to the server on which\n * it is active\n */\nexport function startWorkerScript(runningScript: RunningScript, server: BaseServer, parent?: WorkerScript): number {\n if (createAndAddWorkerScript(runningScript, server, parent)) {\n // Push onto runningScripts.\n // This has to come after createAndAddWorkerScript() because that fn updates RAM usage\n server.runScript(runningScript);\n\n // Once the WorkerScript is constructed in createAndAddWorkerScript(), the RunningScript\n // object should have a PID assigned to it, so we return that\n return runningScript.pid;\n }\n\n return 0;\n}\n\n/**\n * Given a RunningScript object, constructs its corresponding WorkerScript,\n * adds it to the global 'workerScripts' pool, and begins executing it.\n * @param {RunningScript} runningScriptObj - Script that's being run\n * @param {Server} server - Server on which the script is to be run\n * returns {boolean} indicating whether or not the workerScript was successfully added\n */\nfunction createAndAddWorkerScript(runningScriptObj: RunningScript, server: BaseServer, parent?: WorkerScript): boolean {\n // Update server's ram usage\n let threads = 1;\n if (runningScriptObj.threads && !isNaN(runningScriptObj.threads)) {\n threads = runningScriptObj.threads;\n } else {\n runningScriptObj.threads = 1;\n }\n const oneRamUsage = getRamUsageFromRunningScript(runningScriptObj);\n const ramUsage = roundToTwo(oneRamUsage * threads);\n const ramAvailable = server.maxRam - server.ramUsed;\n if (ramUsage > ramAvailable + 0.001) {\n dialogBoxCreate(\n `Not enough RAM to run script ${runningScriptObj.filename} with args ${arrayToString(runningScriptObj.args)}.\\n` +\n `This can occur when you reload the game and the script's RAM usage has increased (either because of an update to the game or ` +\n `your changes to the script).\\nThis can also occur if you have attempted to launch a script from a tail window with insufficient RAM. `,\n );\n return false;\n }\n\n server.updateRamUsed(roundToTwo(server.ramUsed + ramUsage));\n\n // Get the pid\n const pid = generateNextPid();\n if (pid === -1) {\n throw new Error(\n `Failed to start script because could not find available PID. This is most ` +\n `because you have too many scripts running.`,\n );\n }\n\n // Create the WorkerScript. NOTE: WorkerScript ctor will set the underlying\n // RunningScript's PID as well\n const workerScript = new WorkerScript(runningScriptObj, pid, NetscriptFunctions);\n workerScript.ramUsage = oneRamUsage;\n\n // Add the WorkerScript to the global pool\n workerScripts.set(pid, workerScript);\n WorkerScriptStartStopEventEmitter.emit();\n\n // Start the script's execution using the correct function for file type\n (workerScript.name.endsWith(\".js\") ? startNetscript2Script : startNetscript1Script)(workerScript)\n // Once the code finishes (either resolved or rejected, doesnt matter), set its\n // running status to false\n .then(function () {\n // On natural death, the earnings are transferred to the parent if it still exists.\n if (parent && !parent.env.stopFlag) {\n parent.scriptRef.onlineExpGained += runningScriptObj.onlineExpGained;\n parent.scriptRef.onlineMoneyMade += runningScriptObj.onlineMoneyMade;\n }\n killWorkerScript(workerScript);\n workerScript.log(\"\", () => \"Script finished running\");\n })\n .catch(function (e) {\n handleUnknownError(e, workerScript);\n workerScript.log(\"\", () => (e instanceof ScriptDeath ? \"Script killed.\" : \"Script crashed due to an error.\"));\n killWorkerScript(workerScript);\n });\n return true;\n}\n\n/** Updates the online running time stat of all running scripts */\nexport function updateOnlineScriptTimes(numCycles = 1): void {\n const time = (numCycles * CONSTANTS._idleSpeed) / 1000; //seconds\n for (const ws of workerScripts.values()) {\n ws.scriptRef.onlineRunningTime += time;\n }\n}\n\n/**\n * Called when the game is loaded. Loads all running scripts (from all servers)\n * into worker scripts so that they will start running\n */\nexport function loadAllRunningScripts(): void {\n const skipScriptLoad = window.location.href.toLowerCase().indexOf(\"?noscripts\") !== -1;\n if (skipScriptLoad) {\n Terminal.warn(\"Skipped loading player scripts during startup\");\n console.info(\"Skipping the load of any scripts during startup\");\n }\n for (const server of GetAllServers()) {\n // Reset each server's RAM usage to 0\n server.ramUsed = 0;\n\n // Reset modules on all scripts\n for (let i = 0; i < server.scripts.length; ++i) {\n server.scripts[i].markUpdated();\n }\n\n if (skipScriptLoad) {\n // Start game with no scripts\n server.runningScripts.length = 0;\n } else {\n for (let j = 0; j < server.runningScripts.length; ++j) {\n const fileName = server.runningScripts[j].filename;\n createAndAddWorkerScript(server.runningScripts[j], server);\n\n if (!server.runningScripts[j]) {\n // createAndAddWorkerScript can modify the server.runningScripts array if a script is invalid\n console.error(`createAndAddWorkerScript removed ${fileName} from ${server}`);\n continue;\n }\n\n // Offline production\n scriptCalculateOfflineProduction(server.runningScripts[j]);\n }\n }\n }\n}\n\n/** Run a script from inside another script (run(), exec(), spawn(), etc.) */\nexport function runScriptFromScript(\n caller: string,\n server: BaseServer,\n scriptname: string,\n args: ScriptArg[],\n workerScript: WorkerScript,\n threads = 1,\n): number {\n // Sanitize arguments\n if (!(workerScript instanceof WorkerScript)) {\n return 0;\n }\n\n if (typeof scriptname !== \"string\" || !Array.isArray(args)) {\n workerScript.log(caller, () => `Invalid arguments: scriptname='${scriptname} args='${args}'`);\n console.error(`runScriptFromScript() failed due to invalid arguments`);\n return 0;\n }\n\n args.forEach((arg, i) => {\n if (typeof arg !== \"string\" && typeof arg !== \"number\" && typeof arg !== \"boolean\")\n throw new Error(\n \"Only strings, numbers, and booleans can be passed as arguments to other scripts.\\n\" +\n `${scriptname} argument index ${i} is of type ${typeof arg} and value ${JSON.stringify(arg)}`,\n );\n });\n\n // Check if the script is already running\n const runningScriptObj = server.getRunningScript(scriptname, args);\n if (runningScriptObj != null) {\n workerScript.log(caller, () => `'${scriptname}' is already running on '${server.hostname}'`);\n return 0;\n }\n\n // 'null/undefined' arguments are not allowed\n for (let i = 0; i < args.length; ++i) {\n if (args[i] == null) {\n workerScript.log(caller, () => \"Cannot execute a script with null/undefined as an argument\");\n return 0;\n }\n }\n\n // Check if the script exists and if it does run it\n for (let i = 0; i < server.scripts.length; ++i) {\n if (!areFilesEqual(server.scripts[i].filename, scriptname)) continue;\n // Check for admin rights and that there is enough RAM available to run\n const script = server.scripts[i];\n let ramUsage = script.ramUsage;\n threads = Math.floor(Number(threads));\n if (threads === 0) {\n return 0;\n }\n ramUsage = ramUsage * threads;\n const ramAvailable = server.maxRam - server.ramUsed;\n\n if (server.hasAdminRights == false) {\n workerScript.log(caller, () => `You do not have root access on '${server.hostname}'`);\n return 0;\n } else if (ramUsage > ramAvailable + 0.001) {\n workerScript.log(\n caller,\n () =>\n `Cannot run script '${scriptname}' (t=${threads}) on '${server.hostname}' because there is not enough available RAM!`,\n );\n return 0;\n }\n // Able to run script\n workerScript.log(\n caller,\n () => `'${scriptname}' on '${server.hostname}' with ${threads} threads and args: ${arrayToString(args)}.`,\n );\n const runningScriptObj = new RunningScript(script, args);\n runningScriptObj.threads = threads;\n runningScriptObj.server = server.hostname;\n\n return startWorkerScript(runningScriptObj, server, workerScript);\n }\n\n workerScript.log(caller, () => `Could not find script '${scriptname}' on '${server.hostname}'`);\n return 0;\n}\n","export interface Multipliers {\n hacking_chance: number;\n hacking_speed: number;\n hacking_money: number;\n hacking_grow: number;\n hacking: number;\n hacking_exp: number;\n strength: number;\n strength_exp: number;\n defense: number;\n defense_exp: number;\n dexterity: number;\n dexterity_exp: number;\n agility: number;\n agility_exp: number;\n charisma: number;\n charisma_exp: number;\n hacknet_node_money: number;\n hacknet_node_purchase_cost: number;\n hacknet_node_ram_cost: number;\n hacknet_node_core_cost: number;\n hacknet_node_level_cost: number;\n company_rep: number;\n faction_rep: number;\n work_money: number;\n crime_success: number;\n crime_money: number;\n bladeburner_max_stamina: number;\n bladeburner_stamina_gain: number;\n bladeburner_analysis: number;\n bladeburner_success_chance: number;\n}\n\nexport const defaultMultipliers = (): Multipliers => {\n return {\n hacking_chance: 1,\n hacking_speed: 1,\n hacking_money: 1,\n hacking_grow: 1,\n hacking: 1,\n hacking_exp: 1,\n strength: 1,\n strength_exp: 1,\n defense: 1,\n defense_exp: 1,\n dexterity: 1,\n dexterity_exp: 1,\n agility: 1,\n agility_exp: 1,\n charisma: 1,\n charisma_exp: 1,\n hacknet_node_money: 1,\n hacknet_node_purchase_cost: 1,\n hacknet_node_ram_cost: 1,\n hacknet_node_core_cost: 1,\n hacknet_node_level_cost: 1,\n company_rep: 1,\n faction_rep: 1,\n work_money: 1,\n crime_success: 1,\n crime_money: 1,\n bladeburner_max_stamina: 1,\n bladeburner_stamina_gain: 1,\n bladeburner_analysis: 1,\n bladeburner_success_chance: 1,\n };\n};\n\nexport const mergeMultipliers = (m0: Multipliers, m1: Multipliers): Multipliers => {\n return {\n hacking_chance: m0.hacking_chance * m1.hacking_chance,\n hacking_speed: m0.hacking_speed * m1.hacking_speed,\n hacking_money: m0.hacking_money * m1.hacking_money,\n hacking_grow: m0.hacking_grow * m1.hacking_grow,\n hacking: m0.hacking * m1.hacking,\n hacking_exp: m0.hacking_exp * m1.hacking_exp,\n strength: m0.strength * m1.strength,\n strength_exp: m0.strength_exp * m1.strength_exp,\n defense: m0.defense * m1.defense,\n defense_exp: m0.defense_exp * m1.defense_exp,\n dexterity: m0.dexterity * m1.dexterity,\n dexterity_exp: m0.dexterity_exp * m1.dexterity_exp,\n agility: m0.agility * m1.agility,\n agility_exp: m0.agility_exp * m1.agility_exp,\n charisma: m0.charisma * m1.charisma,\n charisma_exp: m0.charisma_exp * m1.charisma_exp,\n hacknet_node_money: m0.hacknet_node_money * m1.hacknet_node_money,\n hacknet_node_purchase_cost: m0.hacknet_node_purchase_cost * m1.hacknet_node_purchase_cost,\n hacknet_node_ram_cost: m0.hacknet_node_ram_cost * m1.hacknet_node_ram_cost,\n hacknet_node_core_cost: m0.hacknet_node_core_cost * m1.hacknet_node_core_cost,\n hacknet_node_level_cost: m0.hacknet_node_level_cost * m1.hacknet_node_level_cost,\n company_rep: m0.company_rep * m1.company_rep,\n faction_rep: m0.faction_rep * m1.faction_rep,\n work_money: m0.work_money * m1.work_money,\n crime_success: m0.crime_success * m1.crime_success,\n crime_money: m0.crime_money * m1.crime_money,\n bladeburner_max_stamina: m0.bladeburner_max_stamina * m1.bladeburner_max_stamina,\n bladeburner_stamina_gain: m0.bladeburner_stamina_gain * m1.bladeburner_stamina_gain,\n bladeburner_analysis: m0.bladeburner_analysis * m1.bladeburner_analysis,\n bladeburner_success_chance: m0.bladeburner_success_chance * m1.bladeburner_success_chance,\n };\n};\n\nexport const scaleMultipliers = (m0: Multipliers, v: number): Multipliers => {\n return {\n hacking_chance: (m0.hacking_chance - 1) * v + 1,\n hacking_speed: (m0.hacking_speed - 1) * v + 1,\n hacking_money: (m0.hacking_money - 1) * v + 1,\n hacking_grow: (m0.hacking_grow - 1) * v + 1,\n hacking: (m0.hacking - 1) * v + 1,\n hacking_exp: (m0.hacking_exp - 1) * v + 1,\n strength: (m0.strength - 1) * v + 1,\n strength_exp: (m0.strength_exp - 1) * v + 1,\n defense: (m0.defense - 1) * v + 1,\n defense_exp: (m0.defense_exp - 1) * v + 1,\n dexterity: (m0.dexterity - 1) * v + 1,\n dexterity_exp: (m0.dexterity_exp - 1) * v + 1,\n agility: (m0.agility - 1) * v + 1,\n agility_exp: (m0.agility_exp - 1) * v + 1,\n charisma: (m0.charisma - 1) * v + 1,\n charisma_exp: (m0.charisma_exp - 1) * v + 1,\n hacknet_node_money: (m0.hacknet_node_money - 1) * v + 1,\n hacknet_node_purchase_cost: (m0.hacknet_node_purchase_cost - 1) * v + 1,\n hacknet_node_ram_cost: (m0.hacknet_node_ram_cost - 1) * v + 1,\n hacknet_node_core_cost: (m0.hacknet_node_core_cost - 1) * v + 1,\n hacknet_node_level_cost: (m0.hacknet_node_level_cost - 1) * v + 1,\n company_rep: (m0.company_rep - 1) * v + 1,\n faction_rep: (m0.faction_rep - 1) * v + 1,\n work_money: (m0.work_money - 1) * v + 1,\n crime_success: (m0.crime_success - 1) * v + 1,\n crime_money: (m0.crime_money - 1) * v + 1,\n bladeburner_max_stamina: (m0.bladeburner_max_stamina - 1) * v + 1,\n bladeburner_stamina_gain: (m0.bladeburner_stamina_gain - 1) * v + 1,\n bladeburner_analysis: (m0.bladeburner_analysis - 1) * v + 1,\n bladeburner_success_chance: (m0.bladeburner_success_chance - 1) * v + 1,\n };\n};\n","/**\n * Implements functions for purchasing servers or purchasing more RAM for\n * the home computer\n */\nimport { AddToAllServers, createUniqueRandomIp, GetServer, renameServer } from \"./AllServers\";\nimport { safelyCreateUniqueServer } from \"./ServerHelpers\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { Player } from \"@player\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { isPowerOfTwo } from \"../utils/helpers/isPowerOfTwo\";\nimport { workerScripts } from \"../Netscript/WorkerScripts\";\n\n// Returns the cost of purchasing a server with the given RAM\n// Returns Infinity for invalid 'ram' arguments\n/**\n * @param ram Amount of RAM on purchased server (GB)\n * @returns Cost of purchasing the given server. Returns infinity for invalid arguments\n */\nexport function getPurchaseServerCost(ram: number): number {\n const sanitizedRam = Math.round(ram);\n if (isNaN(sanitizedRam) || !isPowerOfTwo(sanitizedRam) || !(Math.sign(sanitizedRam) === 1)) {\n return Infinity;\n }\n\n if (sanitizedRam > getPurchaseServerMaxRam()) {\n return Infinity;\n }\n\n const upg = Math.max(0, Math.log(sanitizedRam) / Math.log(2) - 6);\n\n return (\n sanitizedRam *\n CONSTANTS.BaseCostFor1GBOfRamServer *\n BitNodeMultipliers.PurchasedServerCost *\n Math.pow(BitNodeMultipliers.PurchasedServerSoftcap, upg)\n );\n}\n\nexport const getPurchasedServerUpgradeCost = (hostname: string, ram: number): number => {\n const server = GetServer(hostname);\n if (!server) throw new Error(`Server '${hostname}' not found.`);\n if (!Player.purchasedServers.includes(hostname)) throw new Error(`Server '${hostname}' not a purchased server.`);\n if (isNaN(ram) || !isPowerOfTwo(ram) || !(Math.sign(ram) === 1))\n throw new Error(`${ram} is not a positive power of 2`);\n if (server.maxRam >= ram)\n throw new Error(`'${hostname}' current ram (${server.maxRam}) is not bigger than new ram (${ram})`);\n return getPurchaseServerCost(ram) - getPurchaseServerCost(server.maxRam);\n};\n\nexport const upgradePurchasedServer = (hostname: string, ram: number): void => {\n const server = GetServer(hostname);\n if (!server) throw new Error(`Server '${hostname}' not found.`);\n const cost = getPurchasedServerUpgradeCost(hostname, ram);\n if (!Player.canAfford(cost)) throw new Error(`You don't have enough money to upgrade '${hostname}'.`);\n Player.loseMoney(cost, \"servers\");\n server.maxRam = ram;\n};\n\nexport const renamePurchasedServer = (hostname: string, newName: string): void => {\n const server = GetServer(hostname);\n if (!server) throw new Error(`Server '${newName}' doesn't exists.`);\n if (GetServer(newName)) throw new Error(`Server '${newName}' already exists.`);\n if (!Player.purchasedServers.includes(hostname)) throw new Error(`Server '${hostname}' is not a player server.`);\n const replace = (arr: string[], old: string, next: string): string[] => {\n return arr.map((v) => (v === old ? next : v));\n };\n Player.purchasedServers = replace(Player.purchasedServers, hostname, newName);\n const home = Player.getHomeComputer();\n home.serversOnNetwork = replace(home.serversOnNetwork, hostname, newName);\n server.serversOnNetwork = replace(server.serversOnNetwork, hostname, newName);\n server.runningScripts.forEach((r) => (r.server = newName));\n server.scripts.forEach((r) => (r.server = newName));\n server.hostname = newName;\n workerScripts.forEach((w) => {\n if (w.hostname === hostname) w.hostname = newName;\n });\n renameServer(hostname, newName);\n};\n\nexport function getPurchaseServerLimit(): number {\n return Math.round(CONSTANTS.PurchasedServerLimit * BitNodeMultipliers.PurchasedServerLimit);\n}\n\nexport function getPurchaseServerMaxRam(): number {\n const ram = Math.round(CONSTANTS.PurchasedServerMaxRam * BitNodeMultipliers.PurchasedServerMaxRam);\n\n // Round this to the nearest power of 2\n return 1 << (31 - Math.clz32(ram));\n}\n\n// Manually purchase a server (NOT through Netscript)\nexport function purchaseServer(hostname: string, ram: number, cost: number): void {\n //Check if player has enough money\n if (!Player.canAfford(cost)) {\n dialogBoxCreate(\"You don't have enough money to purchase this server!\");\n return;\n }\n\n //Maximum server limit\n if (Player.purchasedServers.length >= getPurchaseServerLimit()) {\n dialogBoxCreate(\n \"You have reached the maximum limit of \" +\n getPurchaseServerLimit() +\n \" servers. \" +\n \"You cannot purchase any more. You can \" +\n \"delete some of your purchased servers using the deleteServer() Netscript function in a script\",\n );\n return;\n }\n\n if (hostname == \"\") {\n dialogBoxCreate(\"You must enter a hostname for your new server!\");\n return;\n }\n\n // Create server\n const newServ = safelyCreateUniqueServer({\n adminRights: true,\n hostname: hostname,\n ip: createUniqueRandomIp(),\n isConnectedTo: false,\n maxRam: ram,\n organizationName: \"\",\n purchasedByPlayer: true,\n });\n AddToAllServers(newServ);\n\n // Add to Player's purchasedServers array\n Player.purchasedServers.push(newServ.hostname);\n\n // Connect new server to home computer\n const homeComputer = Player.getHomeComputer();\n homeComputer.serversOnNetwork.push(newServ.hostname);\n newServ.serversOnNetwork.push(homeComputer.hostname);\n\n Player.loseMoney(cost, \"servers\");\n\n dialogBoxCreate(\"Server successfully purchased with hostname \" + newServ.hostname);\n}\n\n// Manually upgrade RAM on home computer (NOT through Netscript)\nexport function purchaseRamForHomeComputer(): void {\n const cost = Player.getUpgradeHomeRamCost();\n if (!Player.canAfford(cost)) {\n dialogBoxCreate(\"You do not have enough money to purchase additional RAM for your home computer\");\n return;\n }\n\n const homeComputer = Player.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n dialogBoxCreate(`You cannot upgrade your home computer RAM because it is at its maximum possible value`);\n return;\n }\n\n homeComputer.maxRam *= 2;\n Player.loseMoney(cost, \"servers\");\n}\n","/**\n * Functions for buying/selling stocks. There are four functions total, two for\n * long positions and two for short positions.\n */\nimport { Stock } from \"./Stock\";\nimport {\n getBuyTransactionCost,\n getSellTransactionGain,\n processTransactionForecastMovement,\n} from \"./StockMarketHelpers\";\n\nimport { PositionTypes } from \"./data/PositionTypes\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { Player } from \"@player\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nimport * as React from \"react\";\nimport { NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\n/** Each function takes an optional config object as its last argument */\ninterface IOptions {\n rerenderFn?: () => void;\n suppressDialog?: boolean;\n}\n\n/**\n * Attempt to buy a stock in the long position\n * @param {Stock} stock - Stock to buy\n * @param {number} shares - Number of shares to buy\n * @param {NetscriptContext} ctx - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * @returns {boolean} - true if successful, false otherwise\n */\nexport function buyStock(\n stock: Stock,\n shares: number,\n ctx: NetscriptContext | null = null,\n opts: IOptions = {},\n): boolean {\n // Validate arguments\n shares = Math.round(shares);\n if (shares <= 0) {\n return false;\n }\n if (stock == null || isNaN(shares)) {\n if (ctx) {\n helpers.log(ctx, () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\"Failed to buy stock. This may be a bug, contact developer\");\n }\n\n return false;\n }\n\n // Does player have enough money?\n const totalPrice = getBuyTransactionCost(stock, shares, PositionTypes.Long);\n if (totalPrice == null) {\n return false;\n }\n if (Player.money < totalPrice) {\n if (ctx) {\n helpers.log(\n ctx,\n () =>\n `You do not have enough money to purchase this position. You need ${numeralWrapper.formatMoney(totalPrice)}.`,\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n You do not have enough money to purchase this. You need <Money money={totalPrice} />\n </>,\n );\n }\n\n return false;\n }\n\n // Would this purchase exceed the maximum number of shares?\n if (shares + stock.playerShares + stock.playerShortShares > stock.maxShares) {\n if (ctx) {\n helpers.log(\n ctx,\n () =>\n `Purchasing '${shares + stock.playerShares + stock.playerShortShares}' shares would exceed ${\n stock.symbol\n }'s maximum (${stock.maxShares}) number of shares`,\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n `You cannot purchase this many shares. ${stock.symbol} has a maximum of ${numeralWrapper.formatShares(\n stock.maxShares,\n )} shares.`,\n );\n }\n\n return false;\n }\n\n const origTotal = stock.playerShares * stock.playerAvgPx;\n Player.loseMoney(totalPrice, \"stock\");\n const newTotal = origTotal + totalPrice - CONSTANTS.StockMarketCommission;\n stock.playerShares = Math.round(stock.playerShares + shares);\n stock.playerAvgPx = newTotal / stock.playerShares;\n processTransactionForecastMovement(stock, shares);\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (ctx) {\n const resultTxt = `Bought ${numeralWrapper.formatShares(shares)} shares of ${\n stock.symbol\n } for ${numeralWrapper.formatMoney(totalPrice)}. Paid ${numeralWrapper.formatMoney(\n CONSTANTS.StockMarketCommission,\n )} in commission fees.`;\n helpers.log(ctx, () => resultTxt);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n Bought {numeralWrapper.formatShares(shares)} shares of {stock.symbol} for <Money money={totalPrice} />. Paid{\" \"}\n <Money money={CONSTANTS.StockMarketCommission} /> in commission fees.\n </>,\n );\n }\n\n return true;\n}\n\n/**\n * Attempt to sell a stock in the long position\n * @param {Stock} stock - Stock to sell\n * @param {number} shares - Number of shares to sell\n * @param {NetscriptContext} ctx - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * returns {boolean} - true if successfully sells given number of shares OR MAX owned, false otherwise\n */\nexport function sellStock(\n stock: Stock,\n shares: number,\n ctx: NetscriptContext | null = null,\n opts: IOptions = {},\n): boolean {\n // Sanitize/Validate arguments\n if (stock == null || shares < 0 || isNaN(shares)) {\n if (ctx) {\n helpers.log(ctx, () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n \"Failed to sell stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, contact developer\",\n );\n }\n\n return false;\n }\n shares = Math.round(shares);\n if (shares > stock.playerShares) {\n shares = stock.playerShares;\n }\n if (shares === 0) {\n return false;\n }\n\n const gains = getSellTransactionGain(stock, shares, PositionTypes.Long);\n if (gains == null) {\n return false;\n }\n let netProfit = gains - stock.playerAvgPx * shares;\n if (isNaN(netProfit)) {\n netProfit = 0;\n }\n Player.gainMoney(gains, \"stock\");\n if (ctx) {\n ctx.workerScript.scriptRef.onlineMoneyMade += netProfit;\n Player.scriptProdSinceLastAug += netProfit;\n }\n\n stock.playerShares = Math.round(stock.playerShares - shares);\n if (stock.playerShares === 0) {\n stock.playerAvgPx = 0;\n }\n\n processTransactionForecastMovement(stock, shares);\n\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (ctx) {\n const resultTxt =\n `Sold ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol}. ` +\n `After commissions, you gained a total of ${numeralWrapper.formatMoney(gains)}.`;\n helpers.log(ctx, () => resultTxt);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n Sold {numeralWrapper.formatShares(shares)} shares of {stock.symbol}. After commissions, you gained a total of{\" \"}\n <Money money={gains} />.\n </>,\n );\n }\n\n return true;\n}\n\n/**\n * Attempt to buy a stock in the short position\n * @param {Stock} stock - Stock to sell\n * @param {number} shares - Number of shares to short\n * @param {NetscriptContext} ctx - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * @returns {boolean} - true if successful, false otherwise\n */\nexport function shortStock(\n stock: Stock,\n shares: number,\n ctx: NetscriptContext | null = null,\n opts: IOptions = {},\n): boolean {\n // Validate arguments\n shares = Math.round(shares);\n if (shares <= 0) {\n return false;\n }\n if (stock == null || isNaN(shares)) {\n if (ctx) {\n helpers.log(ctx, () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n \"Failed to initiate a short position in a stock. This is probably \" +\n \"due to an invalid quantity. Otherwise, this may be a bug, so contact developer\",\n );\n }\n return false;\n }\n\n // Does the player have enough money?\n const totalPrice = getBuyTransactionCost(stock, shares, PositionTypes.Short);\n if (totalPrice == null) {\n return false;\n }\n if (Player.money < totalPrice) {\n if (ctx) {\n helpers.log(\n ctx,\n () =>\n \"You do not have enough \" +\n \"money to purchase this short position. You need \" +\n numeralWrapper.formatMoney(totalPrice),\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n You do not have enough money to purchase this short position. You need <Money money={totalPrice} />\n </>,\n );\n }\n\n return false;\n }\n\n // Would this purchase exceed the maximum number of shares?\n if (shares + stock.playerShares + stock.playerShortShares > stock.maxShares) {\n if (ctx) {\n helpers.log(\n ctx,\n () =>\n `This '${shares + stock.playerShares + stock.playerShortShares}' short shares would exceed ${\n stock.symbol\n }'s maximum (${stock.maxShares}) number of shares.`,\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n `You cannot purchase this many shares. ${stock.symbol} has a maximum of ${stock.maxShares} shares.`,\n );\n }\n\n return false;\n }\n\n const origTotal = stock.playerShortShares * stock.playerAvgShortPx;\n Player.loseMoney(totalPrice, \"stock\");\n const newTotal = origTotal + totalPrice - CONSTANTS.StockMarketCommission;\n stock.playerShortShares = Math.round(stock.playerShortShares + shares);\n stock.playerAvgShortPx = newTotal / stock.playerShortShares;\n processTransactionForecastMovement(stock, shares);\n\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (ctx) {\n const resultTxt =\n `Bought a short position of ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol} ` +\n `for ${numeralWrapper.formatMoney(totalPrice)}. Paid ${numeralWrapper.formatMoney(\n CONSTANTS.StockMarketCommission,\n )} ` +\n `in commission fees.`;\n helpers.log(ctx, () => resultTxt);\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n <>\n Bought a short position of {numeralWrapper.formatShares(shares)} shares of {stock.symbol} for{\" \"}\n <Money money={totalPrice} />. Paid <Money money={CONSTANTS.StockMarketCommission} /> in commission fees.\n </>,\n );\n }\n\n return true;\n}\n\n/**\n * Attempt to sell a stock in the short position\n * @param {Stock} stock - Stock to sell\n * @param {number} shares - Number of shares to sell\n * @param {NetscriptContext} ctx - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * @returns {boolean} true if successfully sells given amount OR max owned, false otherwise\n */\nexport function sellShort(\n stock: Stock,\n shares: number,\n ctx: NetscriptContext | null = null,\n opts: IOptions = {},\n): boolean {\n if (stock == null || isNaN(shares) || shares < 0) {\n if (ctx) {\n helpers.log(ctx, () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n \"Failed to sell a short position in a stock. This is probably \" +\n \"due to an invalid quantity. Otherwise, this may be a bug, so contact developer\",\n );\n }\n\n return false;\n }\n shares = Math.round(shares);\n if (shares > stock.playerShortShares) {\n shares = stock.playerShortShares;\n }\n if (shares === 0) {\n return false;\n }\n\n const origCost = shares * stock.playerAvgShortPx;\n const totalGain = getSellTransactionGain(stock, shares, PositionTypes.Short);\n if (totalGain == null || isNaN(totalGain) || origCost == null) {\n if (ctx) {\n helpers.log(\n ctx,\n () => `Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug`,\n );\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n `Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug`,\n );\n }\n\n return false;\n }\n let profit = totalGain - origCost;\n if (isNaN(profit)) {\n profit = 0;\n }\n Player.gainMoney(totalGain, \"stock\");\n if (ctx) {\n ctx.workerScript.scriptRef.onlineMoneyMade += profit;\n Player.scriptProdSinceLastAug += profit;\n }\n\n stock.playerShortShares = Math.round(stock.playerShortShares - shares);\n if (stock.playerShortShares === 0) {\n stock.playerAvgShortPx = 0;\n }\n processTransactionForecastMovement(stock, shares);\n\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (ctx) {\n const resultTxt =\n `Sold your short position of ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol}. ` +\n `After commissions, you gained a total of ${numeralWrapper.formatMoney(totalGain)}`;\n helpers.log(ctx, () => resultTxt);\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n <>\n Sold your short position of {numeralWrapper.formatShares(shares)} shares of {stock.symbol}. After commissions,\n you gained a total of <Money money={totalGain} />\n </>,\n );\n }\n\n return true;\n}\n","import { Player } from \"@player\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nconst gainLimit = 10e9;\n\nexport function win(n: number): void {\n Player.gainMoney(n, \"casino\");\n}\n\nexport function reachedLimit(): boolean {\n const reached = Player.getCasinoWinnings() > gainLimit;\n if (reached) {\n dialogBoxCreate(\"Alright cheater get out of here. You're not allowed here anymore.\");\n }\n return reached;\n}\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { GangMember } from \"../GangMember\";\nimport { GangMemberTask } from \"../GangMemberTask\";\n\nexport interface FormulaGang {\n respect: number;\n territory: number;\n wantedLevel: number;\n}\n\nexport function calculateWantedPenalty(gang: FormulaGang): number {\n return gang.respect / (gang.respect + gang.wantedLevel);\n}\n\nexport function calculateRespectGain(gang: FormulaGang, member: GangMember, task: GangMemberTask): number {\n if (task.baseRespect === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * member.hack +\n (task.strWeight / 100) * member.str +\n (task.defWeight / 100) * member.def +\n (task.dexWeight / 100) * member.dex +\n (task.agiWeight / 100) * member.agi +\n (task.chaWeight / 100) * member.cha;\n statWeight -= 4 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(0.005, Math.pow(gang.territory * 100, task.territory.respect) / 100);\n const territoryPenalty = (0.2 * gang.territory + 0.8) * BitNodeMultipliers.GangSoftcap;\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n const respectMult = calculateWantedPenalty(gang);\n return Math.pow(11 * task.baseRespect * statWeight * territoryMult * respectMult, territoryPenalty);\n}\n\nexport function calculateWantedLevelGain(gang: FormulaGang, member: GangMember, task: GangMemberTask): number {\n if (task.baseWanted === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * member.hack +\n (task.strWeight / 100) * member.str +\n (task.defWeight / 100) * member.def +\n (task.dexWeight / 100) * member.dex +\n (task.agiWeight / 100) * member.agi +\n (task.chaWeight / 100) * member.cha;\n statWeight -= 3.5 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(0.005, Math.pow(gang.territory * 100, task.territory.wanted) / 100);\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n if (task.baseWanted < 0) {\n return 0.4 * task.baseWanted * statWeight * territoryMult;\n }\n const calc = (7 * task.baseWanted) / Math.pow(3 * statWeight * territoryMult, 0.8);\n\n // Put an arbitrary cap on this to prevent wanted level from rising too fast if the\n // denominator is very small. Might want to rethink formula later\n return Math.min(100, calc);\n}\n\nexport function calculateMoneyGain(gang: FormulaGang, member: GangMember, task: GangMemberTask): number {\n if (task.baseMoney === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * member.hack +\n (task.strWeight / 100) * member.str +\n (task.defWeight / 100) * member.def +\n (task.dexWeight / 100) * member.dex +\n (task.agiWeight / 100) * member.agi +\n (task.chaWeight / 100) * member.cha;\n\n statWeight -= 3.2 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(0.005, Math.pow(gang.territory * 100, task.territory.money) / 100);\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n const respectMult = calculateWantedPenalty(gang);\n const territoryPenalty = (0.2 * gang.territory + 0.8) * BitNodeMultipliers.GangSoftcap;\n return Math.pow(5 * task.baseMoney * statWeight * territoryMult * respectMult, territoryPenalty);\n}\n\nexport function calculateAscensionPointsGain(exp: number): number {\n return Math.max(exp - 1000, 0);\n}\n\nexport function calculateAscensionMult(points: number): number {\n return Math.max(Math.pow(points / 2000, 0.5), 1);\n}\n","export class RFAMessage {\n jsonrpc = \"2.0\"; // Transmits version of JSON-RPC. Compliance maybe allows some funky interaction with external tools?\n public method?: string; // Is defined when it's a request/notification, otherwise undefined\n public result?: ResultType; // Is defined when it's a response, otherwise undefined\n public params?: FileMetadata; // Optional parameters to method\n public error?: string; // Only defined on error\n public id?: number; // ID to keep track of request -> response interaction, undefined with notifications, defined with request/response\n\n constructor(obj: { method?: string; result?: ResultType; params?: FileMetadata; error?: string; id?: number } = {}) {\n this.method = obj.method;\n this.result = obj.result;\n this.params = obj.params;\n this.error = obj.error;\n this.id = obj.id;\n }\n}\n\ntype ResultType = string | number | Array<string> | Array<FileContent>;\ntype FileMetadata = FileData | FileContent | FileLocation | FileServer;\n\nexport interface FileData {\n filename: string;\n content: string;\n server: string;\n}\n\nexport interface FileContent {\n filename: string;\n content: string;\n}\n\nexport interface FileLocation {\n filename: string;\n server: string;\n}\n\nexport interface FileServer {\n server: string;\n}\n\nexport function isFileData(p: unknown): p is FileData {\n const pf = p as FileData;\n return typeof pf.server === \"string\" && typeof pf.filename === \"string\" && typeof pf.content === \"string\";\n}\n\nexport function isFileLocation(p: unknown): p is FileLocation {\n const pf = p as FileLocation;\n return typeof pf.server === \"string\" && typeof pf.filename === \"string\";\n}\n\nexport function isFileContent(p: unknown): p is FileContent {\n const pf = p as FileContent;\n return typeof pf.filename === \"string\" && typeof pf.content === \"string\";\n}\n\nexport function isFileServer(p: unknown): p is FileServer {\n const pf = p as FileServer;\n return typeof pf.server === \"string\";\n}\n","import { Paper } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"@player\";\nimport { ProgressBar } from \"../../ui/React/Progress\";\n\ninterface IProps {\n millis: number;\n onExpire: () => void;\n noPaper?: boolean;\n ignoreAugment_WKSharmonizer?: boolean;\n}\n\nexport function GameTimer(props: IProps): React.ReactElement {\n const [v, setV] = useState(100);\n const totalMillis =\n (!props.ignoreAugment_WKSharmonizer && Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.3 : 1) *\n props.millis;\n\n const tick = 200;\n useEffect(() => {\n const intervalId = setInterval(() => {\n setV((old) => {\n if (old <= 0) props.onExpire();\n return old - (tick / totalMillis) * 100;\n });\n }, tick);\n return () => {\n clearInterval(intervalId);\n };\n }, []);\n\n // https://stackoverflow.com/questions/55593367/disable-material-uis-linearprogress-animation\n // TODO(hydroflame): there's like a bug where it triggers the end before the\n // bar physically reaches the end\n return props.noPaper ? (\n <ProgressBar variant=\"determinate\" value={v} color=\"primary\" />\n ) : (\n <Paper sx={{ p: 1, mb: 1 }}>\n <ProgressBar variant=\"determinate\" value={v} color=\"primary\" />\n </Paper>\n );\n}\n","import { DarkWebItem } from \"./DarkWebItem\";\nimport { Programs, initPrograms } from \"../Programs/Programs\";\n\nexport const DarkWebItems: Record<string, DarkWebItem> = {};\nexport function initDarkWebItems() {\n initPrograms();\n Object.assign(DarkWebItems, {\n BruteSSHProgram: new DarkWebItem(Programs.BruteSSHProgram.name, 500e3, \"Opens up SSH Ports.\"),\n FTPCrackProgram: new DarkWebItem(Programs.FTPCrackProgram.name, 1500e3, \"Opens up FTP Ports.\"),\n RelaySMTPProgram: new DarkWebItem(Programs.RelaySMTPProgram.name, 5e6, \"Opens up SMTP Ports.\"),\n HTTPWormProgram: new DarkWebItem(Programs.HTTPWormProgram.name, 30e6, \"Opens up HTTP Ports.\"),\n SQLInjectProgram: new DarkWebItem(Programs.SQLInjectProgram.name, 250e6, \"Opens up SQL Ports.\"),\n ServerProfiler: new DarkWebItem(\n Programs.ServerProfiler.name,\n 500000,\n \"Displays detailed information about a server.\",\n ),\n DeepscanV1: new DarkWebItem(Programs.DeepscanV1.name, 500000, \"Enables 'scan-analyze' with a depth up to 5.\"),\n DeepscanV2: new DarkWebItem(Programs.DeepscanV2.name, 25e6, \"Enables 'scan-analyze' with a depth up to 10.\"),\n AutolinkProgram: new DarkWebItem(Programs.AutoLink.name, 1e6, \"Enables direct connect via 'scan-analyze'.\"),\n FormulasProgram: new DarkWebItem(Programs.Formulas.name, 5e9, \"Unlock access to the formulas API.\"),\n });\n}\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { HacknetNodeConstants } from \"../data/Constants\";\n\nexport function calculateMoneyGainRate(level: number, ram: number, cores: number, mult: number): number {\n const gainPerLevel = HacknetNodeConstants.MoneyGainPerLevel;\n\n const levelMult = level * gainPerLevel;\n const ramMult = Math.pow(1.035, ram - 1);\n const coresMult = (cores + 5) / 6;\n return levelMult * ramMult * coresMult * mult * BitNodeMultipliers.HacknetNodeMoney;\n}\n\nexport function calculateLevelUpgradeCost(startingLevel: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingLevel >= HacknetNodeConstants.MaxLevel) {\n return Infinity;\n }\n\n const mult = HacknetNodeConstants.UpgradeLevelMult;\n let totalMultiplier = 0;\n let currLevel = startingLevel;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalMultiplier += HacknetNodeConstants.LevelBaseCost * Math.pow(mult, currLevel);\n ++currLevel;\n }\n\n return (HacknetNodeConstants.BaseCost / 2) * totalMultiplier * costMult;\n}\n\nexport function calculateRamUpgradeCost(startingRam: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingRam >= HacknetNodeConstants.MaxRam) {\n return Infinity;\n }\n\n let totalCost = 0;\n let numUpgrades = Math.round(Math.log2(startingRam));\n let currentRam = startingRam;\n\n for (let i = 0; i < sanitizedLevels; ++i) {\n const baseCost = currentRam * HacknetNodeConstants.RamBaseCost;\n const mult = Math.pow(HacknetNodeConstants.UpgradeRamMult, numUpgrades);\n\n totalCost += baseCost * mult;\n\n currentRam *= 2;\n ++numUpgrades;\n }\n\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateCoreUpgradeCost(startingCore: number, extraLevels = 1, costMult = 1): number {\n const sanitizedCores = Math.round(extraLevels);\n if (isNaN(sanitizedCores) || sanitizedCores < 1) {\n return 0;\n }\n\n if (startingCore >= HacknetNodeConstants.MaxCores) {\n return Infinity;\n }\n\n const coreBaseCost = HacknetNodeConstants.CoreBaseCost;\n const mult = HacknetNodeConstants.UpgradeCoreMult;\n let totalCost = 0;\n let currentCores = startingCore;\n for (let i = 0; i < sanitizedCores; ++i) {\n totalCost += coreBaseCost * Math.pow(mult, currentCores - 1);\n ++currentCores;\n }\n\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateNodeCost(n: number, mult = 1): number {\n if (n <= 0) {\n return 0;\n }\n return HacknetNodeConstants.BaseCost * Math.pow(HacknetNodeConstants.PurchaseNextMult, n - 1) * mult;\n}\n","const _ = false;\nconst X = true;\nexport const Shapes: {\n O: boolean[][];\n I: boolean[][];\n L: boolean[][];\n J: boolean[][];\n S: boolean[][];\n Z: boolean[][];\n T: boolean[][];\n} = {\n O: [\n [X, X],\n [X, X],\n ],\n I: [[X, X, X, X]],\n L: [\n [_, _, X],\n [X, X, X],\n ],\n J: [\n [X, _, _],\n [X, X, X],\n ],\n S: [\n [_, X, X],\n [X, X, _],\n ],\n Z: [\n [X, X, _],\n [_, X, X],\n ],\n T: [\n [X, X, X],\n [_, X, _],\n ],\n};\n","interface DifficultySetting {\n [key: string]: number;\n}\n\ninterface DifficultySettings {\n Trivial: DifficultySetting;\n Normal: DifficultySetting;\n Hard: DifficultySetting;\n Impossible: DifficultySetting;\n}\n\n// I could use `any` to simply some of this but I also want to take advantage\n// of the type safety that typescript provides. I'm just not sure how in this\n// case.\nexport function interpolate(settings: DifficultySettings, n: number, out: DifficultySetting): DifficultySetting {\n // interpolates between 2 difficulties.\n function lerpD(a: DifficultySetting, b: DifficultySetting, t: number): DifficultySetting {\n // interpolates between 2 numbers.\n function lerp(x: number, y: number, t: number): number {\n return (1 - t) * x + t * y;\n }\n for (const key of Object.keys(a)) {\n out[key] = lerp(a[key], b[key], t);\n }\n return a;\n }\n if (n < 0) return lerpD(settings.Trivial, settings.Trivial, 0);\n if (n >= 0 && n < 1) return lerpD(settings.Trivial, settings.Normal, n);\n if (n >= 1 && n < 2) return lerpD(settings.Normal, settings.Hard, n - 1);\n if (n >= 2 && n < 3) return lerpD(settings.Hard, settings.Impossible, n - 2);\n return lerpD(settings.Impossible, settings.Impossible, 0);\n}\n","import React, { useEffect } from \"react\";\n\ninterface IProps {\n onKeyDown: (this: Document, event: KeyboardEvent) => void;\n onFailure: (options?: { automated: boolean }) => void;\n}\n\nexport function KeyHandler(props: IProps): React.ReactElement {\n useEffect(() => {\n function press(this: Document, event: KeyboardEvent): void {\n if (!event.isTrusted) return;\n const f = props.onKeyDown.bind(this);\n f(event);\n }\n document.addEventListener(\"keydown\", press);\n return () => document.removeEventListener(\"keydown\", press);\n });\n\n // invisible autofocused element that eats all the keypress for the minigames.\n return <></>;\n}\n","import React from \"react\";\nimport { Work, WorkType } from \"./Work\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { Player } from \"@player\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Factions } from \"../Faction/Factions\";\nimport { Faction } from \"../Faction/Faction\";\nimport { applyWorkStats, scaleWorkStats, WorkStats } from \"./WorkStats\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reputation } from \"../ui/React/Reputation\";\nimport { CONSTANTS } from \"../Constants\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { calculateFactionExp, calculateFactionRep } from \"./formulas/Faction\";\nimport { FactionWorkType } from \"./data/FactionWorkType\";\n\ninterface FactionWorkParams {\n singularity: boolean;\n factionWorkType: FactionWorkType;\n faction: string;\n}\n\nexport const isFactionWork = (w: Work | null): w is FactionWork => w !== null && w.type === WorkType.FACTION;\n\nexport class FactionWork extends Work {\n factionWorkType: FactionWorkType;\n factionName: string;\n\n constructor(params?: FactionWorkParams) {\n super(WorkType.FACTION, params?.singularity ?? true);\n this.factionWorkType = params?.factionWorkType ?? FactionWorkType.HACKING;\n this.factionName = params?.faction ?? FactionNames.Sector12;\n }\n\n getFaction(): Faction {\n const f = Factions[this.factionName];\n if (!f) throw new Error(`Faction work started with invalid / unknown faction: '${this.factionName}'`);\n return f;\n }\n\n getReputationRate(): number {\n let focusBonus = 1;\n if (!Player.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {\n focusBonus = Player.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n return calculateFactionRep(Player, this.factionWorkType, this.getFaction().favor) * focusBonus;\n }\n\n getExpRates(): WorkStats {\n let focusBonus = 1;\n if (!Player.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {\n focusBonus = Player.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n const rate = calculateFactionExp(Player, this.factionWorkType);\n return scaleWorkStats(rate, focusBonus, false);\n }\n\n process(cycles: number): boolean {\n this.cyclesWorked += cycles;\n this.getFaction().playerReputation += this.getReputationRate() * cycles;\n\n const rate = this.getExpRates();\n applyWorkStats(Player, rate, cycles, \"class\");\n\n return false;\n }\n\n finish(): void {\n if (!this.singularity) {\n dialogBoxCreate(\n <>\n You worked for {this.getFaction().name}.\n <br />\n They now have a total of <Reputation reputation={this.getFaction().playerReputation} /> reputation.\n </>,\n );\n }\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n factionWorkType: this.factionWorkType,\n factionName: this.factionName,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"FactionWork\", this);\n }\n\n /** Initializes a FactionWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): FactionWork {\n return Generic_fromJSON(FactionWork, value.data);\n }\n}\n\nReviver.constructors.FactionWork = FactionWork;\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\nexport function Hashes({ hashes }: { hashes: number | string }): React.ReactElement {\n const classes = useStyles();\n return (\n <span className={classes.money}>{typeof hashes === \"number\" ? numeralWrapper.formatHashes(hashes) : hashes}</span>\n );\n}\n","/**\n * Hacknet Node Class\n *\n * Hacknet Nodes are specialized machines that passively earn the player money over time.\n * They can be upgraded to increase their production\n */\nimport { IHacknetNode } from \"./IHacknetNode\";\n\nimport { CONSTANTS } from \"../Constants\";\n\nimport {\n calculateMoneyGainRate,\n calculateLevelUpgradeCost,\n calculateCoreUpgradeCost,\n calculateRamUpgradeCost,\n} from \"./formulas/HacknetNodes\";\nimport { HacknetNodeConstants } from \"./data/Constants\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { ObjectValidator, minMax } from \"../utils/Validator\";\n\nexport class HacknetNode implements IHacknetNode {\n static validationData: ObjectValidator<HacknetNode> = {\n cores: minMax(1, 1, HacknetNodeConstants.MaxCores),\n level: minMax(1, 1, HacknetNodeConstants.MaxLevel),\n ram: minMax(1, 1, HacknetNodeConstants.MaxRam),\n onlineTimeSeconds: minMax(0, 0, Infinity),\n totalMoneyGenerated: minMax(0, 0, Infinity),\n };\n\n // Node's number of cores\n cores = 1;\n\n // Node's Level\n level = 1;\n\n // Node's production per second\n moneyGainRatePerSecond = 0;\n\n // Identifier for Node. Includes the full \"name\" (hacknet-node-N)\n name: string;\n\n // How long this Node has existed, in seconds\n onlineTimeSeconds = 0;\n\n // Node's RAM (GB)\n ram = 1;\n\n // Total money earned by this Node\n totalMoneyGenerated = 0;\n\n constructor(name = \"\", prodMult = 1) {\n this.name = name;\n\n this.updateMoneyGainRate(prodMult);\n }\n\n // Get the cost to upgrade this Node's number of cores\n calculateCoreUpgradeCost(levels = 1, costMult: number): number {\n return calculateCoreUpgradeCost(this.cores, levels, costMult);\n }\n\n // Get the cost to upgrade this Node's level\n calculateLevelUpgradeCost(levels = 1, costMult: number): number {\n return calculateLevelUpgradeCost(this.level, levels, costMult);\n }\n\n // Get the cost to upgrade this Node's RAM\n calculateRamUpgradeCost(levels = 1, costMult: number): number {\n return calculateRamUpgradeCost(this.ram, levels, costMult);\n }\n\n // Process this Hacknet Node in the game loop.\n // Returns the amount of money generated\n process(numCycles = 1): number {\n const seconds = (numCycles * CONSTANTS.MilliPerCycle) / 1000;\n let gain = this.moneyGainRatePerSecond * seconds;\n if (isNaN(gain)) {\n console.error(`Hacknet Node ${this.name} calculated earnings of NaN`);\n gain = 0;\n }\n\n this.totalMoneyGenerated += gain;\n this.onlineTimeSeconds += seconds;\n\n return gain;\n }\n\n // Upgrade this Node's number of cores, if possible\n // Returns a boolean indicating whether new cores were successfully bought\n upgradeCore(levels = 1, prodMult: number): void {\n this.cores = Math.min(HacknetNodeConstants.MaxCores, Math.round(this.cores + levels));\n this.updateMoneyGainRate(prodMult);\n }\n\n // Upgrade this Node's level, if possible\n // Returns a boolean indicating whether the level was successfully updated\n upgradeLevel(levels = 1, prodMult: number): void {\n this.level = Math.min(HacknetNodeConstants.MaxLevel, Math.round(this.level + levels));\n this.updateMoneyGainRate(prodMult);\n }\n\n // Upgrade this Node's RAM, if possible\n // Returns a boolean indicating whether the RAM was successfully upgraded\n upgradeRam(levels = 1, prodMult: number): void {\n for (let i = 0; i < levels; ++i) {\n this.ram *= 2; // Ram is always doubled\n }\n this.ram = Math.round(this.ram); // Handle any floating point precision issues\n this.updateMoneyGainRate(prodMult);\n }\n\n // Re-calculate this Node's production and update the moneyGainRatePerSecond prop\n updateMoneyGainRate(prodMult: number): void {\n this.moneyGainRatePerSecond = calculateMoneyGainRate(this.level, this.ram, this.cores, prodMult);\n if (isNaN(this.moneyGainRatePerSecond)) {\n this.moneyGainRatePerSecond = 0;\n dialogBoxCreate(\"Error in calculating Hacknet Node production. Please report to game developer\");\n }\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"HacknetNode\", this);\n }\n\n /** Initializes a HacknetNode object from a JSON save state. */\n static fromJSON(value: IReviverValue): HacknetNode {\n return Generic_fromJSON(HacknetNode, value.data);\n }\n}\n\nReviver.constructors.HacknetNode = HacknetNode;\n","import { CONSTANTS } from \"../../Constants\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CalculateShareMult } from \"../../NetworkShare/Share\";\nimport { Person } from \"../Person\";\nimport { calculateIntelligenceBonus } from \"./intelligence\";\n\nfunction mult(favor: number): number {\n let favorMult = 1 + favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n return favorMult * BitNodeMultipliers.FactionWorkRepGain;\n}\n\nexport function getHackingWorkRepGain(p: Person, favor: number): number {\n return (\n ((p.skills.hacking + p.skills.intelligence / 3) / CONSTANTS.MaxSkillLevel) *\n p.mults.faction_rep *\n calculateIntelligenceBonus(p.skills.intelligence, 1) *\n mult(favor) *\n CalculateShareMult()\n );\n}\n\nexport function getFactionSecurityWorkRepGain(p: Person, favor: number): number {\n const t =\n (0.9 *\n (p.skills.strength +\n p.skills.defense +\n p.skills.dexterity +\n p.skills.agility +\n (p.skills.hacking + p.skills.intelligence) * CalculateShareMult())) /\n CONSTANTS.MaxSkillLevel /\n 4.5;\n return t * p.mults.faction_rep * mult(favor) * calculateIntelligenceBonus(p.skills.intelligence, 1);\n}\n\nexport function getFactionFieldWorkRepGain(p: Person, favor: number): number {\n const t =\n (0.9 *\n (p.skills.strength +\n p.skills.defense +\n p.skills.dexterity +\n p.skills.agility +\n p.skills.charisma +\n (p.skills.hacking + p.skills.intelligence) * CalculateShareMult())) /\n CONSTANTS.MaxSkillLevel /\n 5.5;\n return t * p.mults.faction_rep * mult(favor) * calculateIntelligenceBonus(p.skills.intelligence, 1);\n}\n","import { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"./utils/JSONReviver\";\nimport { removeLeadingSlash, isInRootDirectory } from \"./Terminal/DirectoryHelpers\";\n\n/** Represents a plain text file that is typically stored on a server. */\nexport class TextFile {\n /** The full file name. */\n fn: string;\n\n /** The content of the file. */\n text: string;\n\n //TODO: Why are we using getter/setter for fn as filename?\n /** The full file name. */\n get filename(): string {\n return this.fn;\n }\n\n /** The full file name. */\n set filename(value: string) {\n this.fn = value;\n }\n\n constructor(fn = \"\", txt = \"\") {\n this.fn = (fn.endsWith(\".txt\") ? fn : `${fn}.txt`).replace(/\\s+/g, \"\");\n this.text = txt;\n }\n\n /** Concatenates the raw values to the end of current content. */\n append(txt: string): void {\n this.text += txt;\n }\n\n /** Serves the file to the user as a downloadable resource through the browser. */\n download(): void {\n const file: Blob = new Blob([this.text], { type: \"text/plain\" });\n const a: HTMLAnchorElement = document.createElement(\"a\");\n const url: string = URL.createObjectURL(file);\n a.href = url;\n a.download = this.fn;\n document.body.appendChild(a);\n a.click();\n setTimeout(() => {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n\n /** Retrieve the content of the file. */\n read(): string {\n return this.text;\n }\n\n /** Shows the content to the user via the game's dialog box. */\n show(): void {\n dialogBoxCreate(`${this.fn}<br /><br />${this.text}`);\n }\n\n /** Serialize the current file to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"TextFile\", this);\n }\n\n /** Replaces the current content with the text provided. */\n write(txt: string): void {\n this.text = txt;\n }\n\n /** Initializes a TextFile from a JSON save state. */\n static fromJSON(value: IReviverValue): TextFile {\n return Generic_fromJSON(TextFile, value.data);\n }\n}\n\nReviver.constructors.TextFile = TextFile;\n\n/**\n * Retrieve the file object for the filename on the specified server.\n * @param fn The file name to look for\n * @param server The server object to look in\n * @returns The file object, or null if it couldn't find it.\n */\nexport function getTextFile(fn: string, server: BaseServer): TextFile | null {\n let filename: string = !fn.endsWith(\".txt\") ? `${fn}.txt` : fn;\n\n if (isInRootDirectory(filename)) {\n filename = removeLeadingSlash(filename);\n }\n\n for (const file of server.textFiles) {\n if (file.fn === filename) {\n return file;\n }\n }\n\n return null;\n}\n\n/**\n * Creates a TextFile on the target server.\n * @param fn The file name to create.\n * @param txt The contents of the file.\n * @param server The server that the file should be created on.\n * @returns The instance of the file.\n */\nexport function createTextFile(fn: string, txt: string, server: BaseServer): TextFile | undefined {\n if (getTextFile(fn, server) !== null) {\n // This should probably be a `throw`...\n /* tslint:disable-next-line:no-console */\n console.error(`A file named \"${fn}\" already exists on server ${server.hostname}.`);\n\n return undefined;\n }\n const file: TextFile = new TextFile(fn, txt);\n server.textFiles.push(file);\n\n return file;\n}\n","import { Skill } from \"./Skill\";\nimport { SkillNames } from \"./data/SkillNames\";\n\nexport const Skills: Record<string, Skill> = {};\n\n(function () {\n Skills[SkillNames.BladesIntuition] = new Skill({\n name: SkillNames.BladesIntuition,\n desc: \"Each level of this skill increases your success chance for all Contracts, Operations, and BlackOps by 3%\",\n baseCost: 3,\n costInc: 2.1,\n successChanceAll: 3,\n });\n Skills[SkillNames.Cloak] = new Skill({\n name: SkillNames.Cloak,\n desc:\n \"Each level of this skill increases your \" +\n \"success chance in stealth-related Contracts, Operations, and BlackOps by 5.5%\",\n baseCost: 2,\n costInc: 1.1,\n successChanceStealth: 5.5,\n });\n Skills[SkillNames.ShortCircuit] = new Skill({\n name: SkillNames.ShortCircuit,\n desc:\n \"Each level of this skill increases your success chance \" +\n \"in Contracts, Operations, and BlackOps that involve retirement by 5.5%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceKill: 5.5,\n });\n Skills[SkillNames.DigitalObserver] = new Skill({\n name: SkillNames.DigitalObserver,\n desc: \"Each level of this skill increases your success chance in all Operations and BlackOps by 4%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceOperation: 4,\n });\n Skills[SkillNames.Tracer] = new Skill({\n name: SkillNames.Tracer,\n desc: \"Each level of this skill increases your success chance in all Contracts by 4%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceContract: 4,\n });\n Skills[SkillNames.Overclock] = new Skill({\n name: SkillNames.Overclock,\n desc:\n \"Each level of this skill decreases the time it takes \" +\n \"to attempt a Contract, Operation, and BlackOp by 1% (Max Level: 90)\",\n baseCost: 3,\n costInc: 1.4,\n maxLvl: 90,\n actionTime: 1,\n });\n Skills[SkillNames.Reaper] = new Skill({\n name: SkillNames.Reaper,\n desc: \"Each level of this skill increases your effective combat stats for Bladeburner actions by 2%\",\n baseCost: 2,\n costInc: 2.1,\n effStr: 2,\n effDef: 2,\n effDex: 2,\n effAgi: 2,\n });\n Skills[SkillNames.EvasiveSystem] = new Skill({\n name: SkillNames.EvasiveSystem,\n desc: \"Each level of this skill increases your effective dexterity and agility for Bladeburner actions by 4%\",\n baseCost: 2,\n costInc: 2.1,\n effDex: 4,\n effAgi: 4,\n });\n Skills[SkillNames.Datamancer] = new Skill({\n name: SkillNames.Datamancer,\n desc:\n \"Each level of this skill increases your effectiveness in \" +\n \"synthoid population analysis and investigation by 5%. \" +\n \"This affects all actions that can potentially increase \" +\n \"the accuracy of your synthoid population/community estimates.\",\n baseCost: 3,\n costInc: 1,\n successChanceEstimate: 5,\n });\n Skills[SkillNames.CybersEdge] = new Skill({\n name: SkillNames.CybersEdge,\n desc: \"Each level of this skill increases your max stamina by 2%\",\n baseCost: 1,\n costInc: 3,\n stamina: 2,\n });\n Skills[SkillNames.HandsOfMidas] = new Skill({\n name: SkillNames.HandsOfMidas,\n desc: \"Each level of this skill increases the amount of money you receive from Contracts by 10%\",\n baseCost: 2,\n costInc: 2.5,\n money: 10,\n });\n Skills[SkillNames.Hyperdrive] = new Skill({\n name: SkillNames.Hyperdrive,\n desc: \"Each level of this skill increases the experience earned from Contracts, Operations, and BlackOps by 10%\",\n baseCost: 1,\n costInc: 2.5,\n expGain: 10,\n });\n})();\n","import { gangMemberUpgradesMetadata } from \"./data/upgrades\";\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\n\nexport const GangMemberUpgrades: {\n [key: string]: GangMemberUpgrade;\n} = {};\n\n(function () {\n gangMemberUpgradesMetadata.forEach((e) => {\n GangMemberUpgrades[e.name] = new GangMemberUpgrade(e.name, e.cost, e.upgType, e.mults);\n });\n})();\n","import { Player } from \"@player\";\nimport { NSFull } from \"../NetscriptFunctions\";\n\n/** This type assumes any value that isn't an API layer or a function has been omitted (args and enum) */\ntype RamCostTree<API> = {\n [Property in keyof API]: API[Property] extends () => unknown ? number | (() => number) : RamCostTree<API[Property]>;\n};\n\n/** Constants for assigning costs to ns functions */\nexport const RamCostConstants: Record<string, number> = {\n ScriptBaseRamCost: 1.6,\n ScriptDomRamCost: 25,\n ScriptCorporationRamCost: 1024 - 1.6,\n ScriptHackRamCost: 0.1,\n ScriptHackAnalyzeRamCost: 1,\n ScriptGrowRamCost: 0.15,\n ScriptGrowthAnalyzeRamCost: 1,\n ScriptWeakenRamCost: 0.15,\n ScriptWeakenAnalyzeRamCost: 1,\n ScriptScanRamCost: 0.2,\n ScriptRecentScriptsRamCost: 0.2,\n ScriptPortProgramRamCost: 0.05,\n ScriptRunRamCost: 1.0,\n ScriptExecRamCost: 1.3,\n ScriptSpawnRamCost: 2.0,\n ScriptScpRamCost: 0.6,\n ScriptKillRamCost: 0.5,\n ScriptHasRootAccessRamCost: 0.05,\n ScriptGetHostnameRamCost: 0.05,\n ScriptGetHackingLevelRamCost: 0.05,\n ScriptGetMultipliersRamCost: 4.0,\n ScriptGetServerRamCost: 0.1,\n ScriptGetServerMaxRam: 0.05,\n ScriptGetServerUsedRam: 0.05,\n ScriptFileExistsRamCost: 0.1,\n ScriptIsRunningRamCost: 0.1,\n ScriptHacknetNodesRamCost: 4.0,\n ScriptHNUpgLevelRamCost: 0.4,\n ScriptHNUpgRamRamCost: 0.6,\n ScriptHNUpgCoreRamCost: 0.8,\n ScriptGetStockRamCost: 2.0,\n ScriptBuySellStockRamCost: 2.5,\n ScriptGetPurchaseServerRamCost: 0.25,\n ScriptPurchaseServerRamCost: 2.25,\n ScriptGetPurchasedServerLimit: 0.05,\n ScriptGetPurchasedServerMaxRam: 0.05,\n ScriptRoundRamCost: 0.05,\n ScriptReadWriteRamCost: 1.0,\n ScriptArbScriptRamCost: 1.0,\n ScriptGetScriptRamCost: 0.1,\n ScriptGetRunningScriptRamCost: 0.3,\n ScriptGetHackTimeRamCost: 0.05,\n ScriptGetFavorToDonate: 0.1,\n ScriptCodingContractBaseRamCost: 10,\n ScriptSleeveBaseRamCost: 4,\n ScriptClearTerminalCost: 0.2,\n ScriptGetMoneySourcesCost: 1.0,\n\n ScriptSingularityFn1RamCost: 2,\n ScriptSingularityFn2RamCost: 3,\n ScriptSingularityFn3RamCost: 5,\n\n ScriptGangApiBaseRamCost: 4,\n\n ScriptBladeburnerApiBaseRamCost: 4,\n\n ScriptStanekWidth: 0.4,\n ScriptStanekHeight: 0.4,\n ScriptStanekCharge: 0.4,\n ScriptStanekFragmentDefinitions: 0,\n ScriptStanekPlacedFragments: 5,\n ScriptStanekClear: 0,\n ScriptStanekCanPlace: 0.5,\n ScriptStanekPlace: 5,\n ScriptStanekFragmentAt: 2,\n ScriptStanekDeleteAt: 0.15,\n ScriptInfiltrationCalculateDifficulty: 2.5,\n ScriptInfiltrationCalculateRewards: 2.5,\n ScriptInfiltrationGetLocations: 5,\n ScriptInfiltrationGetInfiltrations: 15,\n ScriptStanekAcceptGift: 2,\n};\n\nfunction SF4Cost(cost: number): () => number {\n return () => {\n if (Player.bitNodeN === 4) return cost;\n const sf4 = Player.sourceFileLvl(4);\n if (sf4 <= 1) return cost * 16;\n if (sf4 === 2) return cost * 4;\n return cost;\n };\n}\n\n// Hacknet API\nconst hacknet = {\n numNodes: 0,\n purchaseNode: 0,\n getPurchaseNodeCost: 0,\n getNodeStats: 0,\n upgradeLevel: 0,\n upgradeRam: 0,\n upgradeCore: 0,\n upgradeCache: 0,\n getLevelUpgradeCost: 0,\n getRamUpgradeCost: 0,\n getCoreUpgradeCost: 0,\n getCacheUpgradeCost: 0,\n numHashes: 0,\n hashCost: 0,\n spendHashes: 0,\n maxNumNodes: 0,\n hashCapacity: 0,\n getHashUpgrades: 0,\n getHashUpgradeLevel: 0,\n getStudyMult: 0,\n getTrainingMult: 0,\n} as const;\n\n// Stock API\nconst stock = {\n hasWSEAccount: 0.05,\n hasTIXAPIAccess: 0.05,\n has4SData: 0.05,\n has4SDataTIXAPI: 0.05,\n getSymbols: RamCostConstants.ScriptGetStockRamCost,\n getPrice: RamCostConstants.ScriptGetStockRamCost,\n getAskPrice: RamCostConstants.ScriptGetStockRamCost,\n getBidPrice: RamCostConstants.ScriptGetStockRamCost,\n getPosition: RamCostConstants.ScriptGetStockRamCost,\n getMaxShares: RamCostConstants.ScriptGetStockRamCost,\n getPurchaseCost: RamCostConstants.ScriptGetStockRamCost,\n getSaleGain: RamCostConstants.ScriptGetStockRamCost,\n buyStock: RamCostConstants.ScriptBuySellStockRamCost,\n sellStock: RamCostConstants.ScriptBuySellStockRamCost,\n buyShort: RamCostConstants.ScriptBuySellStockRamCost,\n sellShort: RamCostConstants.ScriptBuySellStockRamCost,\n placeOrder: RamCostConstants.ScriptBuySellStockRamCost,\n cancelOrder: RamCostConstants.ScriptBuySellStockRamCost,\n getOrders: RamCostConstants.ScriptBuySellStockRamCost,\n getVolatility: RamCostConstants.ScriptBuySellStockRamCost,\n getForecast: RamCostConstants.ScriptBuySellStockRamCost,\n purchase4SMarketData: RamCostConstants.ScriptBuySellStockRamCost,\n purchase4SMarketDataTixApi: RamCostConstants.ScriptBuySellStockRamCost,\n purchaseWseAccount: RamCostConstants.ScriptBuySellStockRamCost,\n purchaseTixApi: RamCostConstants.ScriptBuySellStockRamCost,\n} as const;\n\n// Singularity API\nconst singularity = {\n universityCourse: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n gymWorkout: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n travelToCity: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n goToLocation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n purchaseTor: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n purchaseProgram: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n getCurrentServer: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n connect: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n manualHack: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n installBackdoor: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n getDarkwebProgramCost: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n getDarkwebPrograms: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n hospitalize: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n isBusy: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n stopAction: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 2),\n upgradeHomeRam: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n upgradeHomeCores: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n getUpgradeHomeRamCost: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 2),\n getUpgradeHomeCoresCost: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 2),\n workForCompany: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n applyToCompany: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n quitJob: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n getCompanyRep: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getCompanyFavor: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getCompanyFavorGain: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 4),\n checkFactionInvitations: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n joinFaction: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n workForFaction: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n getFactionRep: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getFactionFavor: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getFactionFavorGain: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 4),\n donateToFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n createProgram: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n commitCrime: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getCrimeChance: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getCrimeStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getOwnedAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getOwnedSourceFiles: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationsFromFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationCost: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationPrereq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationPrice: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),\n getAugmentationBasePrice: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),\n getAugmentationRepReq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),\n getAugmentationStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n purchaseAugmentation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n softReset: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n installAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n isFocused: SF4Cost(0.1),\n setFocus: SF4Cost(0.1),\n exportGame: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 2),\n exportGameBonus: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n b1tflum3: SF4Cost(16),\n destroyW0r1dD43m0n: SF4Cost(32),\n getCurrentWork: SF4Cost(0.5),\n} as const;\n\n// Gang API\nconst gang = {\n createGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n inGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getMemberNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getOtherGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getMemberInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n canRecruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n recruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getTaskNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getTaskStats: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n setMemberTask: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getEquipmentCost: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentType: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentStats: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n purchaseEquipment: RamCostConstants.ScriptGangApiBaseRamCost,\n ascendMember: RamCostConstants.ScriptGangApiBaseRamCost,\n getAscensionResult: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n setTerritoryWarfare: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getChanceToWinClash: RamCostConstants.ScriptGangApiBaseRamCost,\n getBonusTime: 0,\n} as const;\n\n// Bladeburner API\nconst bladeburner = {\n getContractNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getOperationNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getBlackOpNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getBlackOpRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,\n getGeneralActionNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getSkillNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n startAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n stopBladeburnerAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,\n getCurrentAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 4,\n getActionTime: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionCurrentTime: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionEstimatedSuccessChance: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionRepGain: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionCountRemaining: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionMaxLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionCurrentLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setActionLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillPoints: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillUpgradeCost: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n upgradeSkill: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityEstimatedPopulation: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityCommunities: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityChaos: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n switchCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getStamina: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n joinBladeburnerFaction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n joinBladeburnerDivision: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getBonusTime: 0,\n} as const;\n\nconst infiltration = {\n getPossibleLocations: RamCostConstants.ScriptInfiltrationGetLocations,\n getInfiltration: RamCostConstants.ScriptInfiltrationGetInfiltrations,\n} as const;\n\n// Coding Contract API\nconst codingcontract = {\n attempt: RamCostConstants.ScriptCodingContractBaseRamCost,\n getContractType: RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getData: RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getDescription: RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getNumTriesRemaining: RamCostConstants.ScriptCodingContractBaseRamCost / 5,\n createDummyContract: RamCostConstants.ScriptCodingContractBaseRamCost / 5,\n getContractTypes: RamCostConstants.ScriptCodingContractBaseRamCost / 5,\n} as const;\n\n// Duplicate Sleeve API\nconst sleeve = {\n getNumSleeves: RamCostConstants.ScriptSleeveBaseRamCost,\n setToShockRecovery: RamCostConstants.ScriptSleeveBaseRamCost,\n setToSynchronize: RamCostConstants.ScriptSleeveBaseRamCost,\n setToCommitCrime: RamCostConstants.ScriptSleeveBaseRamCost,\n setToUniversityCourse: RamCostConstants.ScriptSleeveBaseRamCost,\n travel: RamCostConstants.ScriptSleeveBaseRamCost,\n setToCompanyWork: RamCostConstants.ScriptSleeveBaseRamCost,\n setToFactionWork: RamCostConstants.ScriptSleeveBaseRamCost,\n setToGymWorkout: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveStats: RamCostConstants.ScriptSleeveBaseRamCost,\n getTask: RamCostConstants.ScriptSleeveBaseRamCost,\n getInformation: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveAugmentations: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleevePurchasableAugs: RamCostConstants.ScriptSleeveBaseRamCost,\n purchaseSleeveAug: RamCostConstants.ScriptSleeveBaseRamCost,\n setToBladeburnerAction: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveAugmentationPrice: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveAugmentationRepReq: RamCostConstants.ScriptSleeveBaseRamCost,\n} as const;\n\n// Stanek API\nconst stanek = {\n giftWidth: RamCostConstants.ScriptStanekWidth,\n giftHeight: RamCostConstants.ScriptStanekHeight,\n chargeFragment: RamCostConstants.ScriptStanekCharge,\n fragmentDefinitions: RamCostConstants.ScriptStanekFragmentDefinitions,\n activeFragments: RamCostConstants.ScriptStanekPlacedFragments,\n clearGift: RamCostConstants.ScriptStanekClear,\n canPlaceFragment: RamCostConstants.ScriptStanekCanPlace,\n placeFragment: RamCostConstants.ScriptStanekPlace,\n getFragment: RamCostConstants.ScriptStanekFragmentAt,\n removeFragment: RamCostConstants.ScriptStanekDeleteAt,\n acceptGift: RamCostConstants.ScriptStanekAcceptGift,\n} as const;\n\n// UI API\nconst ui = {\n getTheme: 0,\n setTheme: 0,\n resetTheme: 0,\n getStyles: 0,\n setStyles: 0,\n resetStyles: 0,\n getGameInfo: 0,\n clearTerminal: 0,\n windowSize: 0,\n} as const;\n\n// Grafting API\nconst grafting = {\n getAugmentationGraftPrice: 3.75,\n getAugmentationGraftTime: 3.75,\n getGraftableAugmentations: 5,\n graftAugmentation: 7.5,\n} as const;\n\nconst corporation = {\n getMaterialNames: 0,\n getIndustryTypes: 0,\n getUnlockables: 0,\n getUpgradeNames: 0,\n getResearchNames: 0,\n createCorporation: 0,\n hasUnlockUpgrade: 0,\n getUnlockUpgradeCost: 0,\n getUpgradeLevel: 0,\n getUpgradeLevelCost: 0,\n getExpandIndustryCost: 0,\n getExpandCityCost: 0,\n getInvestmentOffer: 0,\n acceptInvestmentOffer: 0,\n goPublic: 0,\n bribe: 0,\n getCorporation: 0,\n getDivision: 0,\n expandIndustry: 0,\n expandCity: 0,\n unlockUpgrade: 0,\n levelUpgrade: 0,\n issueDividends: 0,\n buyBackShares: 0,\n sellShares: 0,\n getBonusTime: 0,\n sellMaterial: 0,\n sellProduct: 0,\n discontinueProduct: 0,\n setSmartSupply: 0,\n setSmartSupplyUseLeftovers: 0,\n buyMaterial: 0,\n bulkPurchase: 0,\n getWarehouse: 0,\n getProduct: 0,\n getMaterial: 0,\n setMaterialMarketTA1: 0,\n setMaterialMarketTA2: 0,\n setProductMarketTA1: 0,\n setProductMarketTA2: 0,\n exportMaterial: 0,\n cancelExportMaterial: 0,\n purchaseWarehouse: 0,\n upgradeWarehouse: 0,\n makeProduct: 0,\n limitMaterialProduction: 0,\n limitProductProduction: 0,\n getPurchaseWarehouseCost: 0,\n getUpgradeWarehouseCost: 0,\n hasWarehouse: 0,\n assignJob: 0,\n hireEmployee: 0,\n upgradeOfficeSize: 0,\n throwParty: 0,\n buyCoffee: 0,\n hireAdVert: 0,\n research: 0,\n getOffice: 0,\n getEmployee: 0,\n getHireAdVertCost: 0,\n getHireAdVertCount: 0,\n getResearchCost: 0,\n hasResearched: 0,\n setAutoJobAssignment: 0,\n getOfficeSizeUpgradeCost: 0,\n} as const;\n\n/** RamCosts guaranteed to match ns structure 1:1 (aside from args and enums).\n * An error will be generated if there are missing OR additional ram costs defined.\n * To avoid errors, define every function in NetscriptDefinition.d.ts and NetscriptFunctions,\n * and have a ram cost associated here. */\nexport const RamCosts: RamCostTree<Omit<NSFull, \"args\" | \"enums\">> = {\n corporation,\n hacknet,\n stock,\n singularity,\n gang,\n bladeburner,\n infiltration,\n codingcontract,\n sleeve,\n stanek,\n ui,\n grafting,\n\n sprintf: 0,\n vsprintf: 0,\n scan: RamCostConstants.ScriptScanRamCost,\n hack: RamCostConstants.ScriptHackRamCost,\n hackAnalyzeThreads: RamCostConstants.ScriptHackAnalyzeRamCost,\n hackAnalyze: RamCostConstants.ScriptHackAnalyzeRamCost,\n hackAnalyzeSecurity: RamCostConstants.ScriptHackAnalyzeRamCost,\n hackAnalyzeChance: RamCostConstants.ScriptHackAnalyzeRamCost,\n sleep: 0,\n asleep: 0,\n share: 2.4,\n getSharePower: 0.2,\n grow: RamCostConstants.ScriptGrowRamCost,\n growthAnalyze: RamCostConstants.ScriptGrowthAnalyzeRamCost,\n growthAnalyzeSecurity: RamCostConstants.ScriptGrowthAnalyzeRamCost,\n weaken: RamCostConstants.ScriptWeakenRamCost,\n weakenAnalyze: RamCostConstants.ScriptWeakenAnalyzeRamCost,\n print: 0,\n printf: 0,\n tprint: 0,\n tprintf: 0,\n clearLog: 0,\n disableLog: 0,\n enableLog: 0,\n isLogEnabled: 0,\n getScriptLogs: 0,\n nuke: RamCostConstants.ScriptPortProgramRamCost,\n brutessh: RamCostConstants.ScriptPortProgramRamCost,\n ftpcrack: RamCostConstants.ScriptPortProgramRamCost,\n relaysmtp: RamCostConstants.ScriptPortProgramRamCost,\n httpworm: RamCostConstants.ScriptPortProgramRamCost,\n sqlinject: RamCostConstants.ScriptPortProgramRamCost,\n run: RamCostConstants.ScriptRunRamCost,\n exec: RamCostConstants.ScriptExecRamCost,\n spawn: RamCostConstants.ScriptSpawnRamCost,\n kill: RamCostConstants.ScriptKillRamCost,\n killall: RamCostConstants.ScriptKillRamCost,\n exit: 0,\n atExit: 0,\n scp: RamCostConstants.ScriptScpRamCost,\n ls: RamCostConstants.ScriptScanRamCost,\n ps: RamCostConstants.ScriptScanRamCost,\n getRecentScripts: RamCostConstants.ScriptRecentScriptsRamCost,\n hasRootAccess: RamCostConstants.ScriptHasRootAccessRamCost,\n getHostname: RamCostConstants.ScriptGetHostnameRamCost,\n getHackingLevel: RamCostConstants.ScriptGetHackingLevelRamCost,\n getHackingMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,\n getHacknetMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,\n getBitNodeMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,\n getServer: RamCostConstants.ScriptGetMultipliersRamCost / 2,\n getServerMoneyAvailable: RamCostConstants.ScriptGetServerRamCost,\n getServerSecurityLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerBaseSecurityLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerMinSecurityLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerRequiredHackingLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerMaxMoney: RamCostConstants.ScriptGetServerRamCost,\n getServerGrowth: RamCostConstants.ScriptGetServerRamCost,\n getServerNumPortsRequired: RamCostConstants.ScriptGetServerRamCost,\n getServerRam: RamCostConstants.ScriptGetServerRamCost,\n getServerMaxRam: RamCostConstants.ScriptGetServerMaxRam,\n getServerUsedRam: RamCostConstants.ScriptGetServerUsedRam,\n serverExists: RamCostConstants.ScriptGetServerRamCost,\n fileExists: RamCostConstants.ScriptFileExistsRamCost,\n isRunning: RamCostConstants.ScriptIsRunningRamCost,\n getPurchasedServerLimit: RamCostConstants.ScriptGetPurchasedServerLimit,\n getPurchasedServerMaxRam: RamCostConstants.ScriptGetPurchasedServerMaxRam,\n getPurchasedServerCost: RamCostConstants.ScriptGetPurchaseServerRamCost,\n getPurchasedServerUpgradeCost: 0.1,\n upgradePurchasedServer: 0.25,\n renamePurchasedServer: 2,\n purchaseServer: RamCostConstants.ScriptPurchaseServerRamCost,\n deleteServer: RamCostConstants.ScriptPurchaseServerRamCost,\n getPurchasedServers: RamCostConstants.ScriptPurchaseServerRamCost,\n write: 0,\n tryWritePort: 0,\n read: 0,\n peek: 0,\n clear: 0,\n writePort: 0,\n readPort: 0,\n getPortHandle: 0,\n rm: RamCostConstants.ScriptReadWriteRamCost,\n scriptRunning: RamCostConstants.ScriptArbScriptRamCost,\n scriptKill: RamCostConstants.ScriptArbScriptRamCost,\n getScriptName: 0,\n getScriptRam: RamCostConstants.ScriptGetScriptRamCost,\n getHackTime: RamCostConstants.ScriptGetHackTimeRamCost,\n getGrowTime: RamCostConstants.ScriptGetHackTimeRamCost,\n getWeakenTime: RamCostConstants.ScriptGetHackTimeRamCost,\n getTotalScriptIncome: RamCostConstants.ScriptGetScriptRamCost,\n getScriptIncome: RamCostConstants.ScriptGetScriptRamCost,\n getTotalScriptExpGain: RamCostConstants.ScriptGetScriptRamCost,\n getScriptExpGain: RamCostConstants.ScriptGetScriptRamCost,\n getRunningScript: RamCostConstants.ScriptGetRunningScriptRamCost,\n nFormat: 0,\n tFormat: 0,\n getTimeSinceLastAug: RamCostConstants.ScriptGetHackTimeRamCost,\n prompt: 0,\n wget: 0,\n getFavorToDonate: RamCostConstants.ScriptGetFavorToDonate,\n getPlayer: RamCostConstants.ScriptSingularityFn1RamCost / 4,\n getMoneySources: RamCostConstants.ScriptGetMoneySourcesCost,\n mv: 0,\n tail: 0,\n toast: 0,\n moveTail: 0,\n resizeTail: 0,\n closeTail: 0,\n clearPort: 0,\n openDevMenu: 0,\n alert: 0,\n flags: 0,\n exploit: 0,\n bypass: 0,\n alterReality: 0,\n rainbow: 0,\n heart: {\n // Easter egg function\n break: 0,\n },\n iKnowWhatImDoing: 0,\n\n formulas: {\n mockServer: 0,\n mockPlayer: 0,\n reputation: {\n calculateFavorToRep: 0,\n calculateRepToFavor: 0,\n repFromDonation: 0,\n },\n skills: {\n calculateSkill: 0,\n calculateExp: 0,\n },\n hacking: {\n hackChance: 0,\n hackExp: 0,\n hackPercent: 0,\n growPercent: 0,\n hackTime: 0,\n growTime: 0,\n weakenTime: 0,\n },\n hacknetNodes: {\n moneyGainRate: 0,\n levelUpgradeCost: 0,\n ramUpgradeCost: 0,\n coreUpgradeCost: 0,\n hacknetNodeCost: 0,\n constants: 0,\n },\n hacknetServers: {\n hashGainRate: 0,\n levelUpgradeCost: 0,\n ramUpgradeCost: 0,\n coreUpgradeCost: 0,\n cacheUpgradeCost: 0,\n hashUpgradeCost: 0,\n hacknetServerCost: 0,\n constants: 0,\n },\n gang: {\n wantedPenalty: 0,\n respectGain: 0,\n wantedLevelGain: 0,\n moneyGain: 0,\n ascensionPointsGain: 0,\n ascensionMultiplier: 0,\n },\n work: {\n crimeGains: 0,\n classGains: 0,\n factionGains: 0,\n },\n },\n} as const;\n\nexport function getRamCost(...args: string[]): number {\n if (args.length === 0) {\n console.warn(`No arguments passed to getRamCost()`);\n return 0;\n }\n\n let curr = RamCosts[args[0] as keyof typeof RamCosts];\n for (let i = 1; i < args.length; ++i) {\n if (curr == null) {\n console.warn(`Invalid function passed to getRamCost: ${args}`);\n return 0;\n }\n\n const currType = typeof curr;\n if (currType === \"function\" || currType === \"number\") {\n break;\n }\n\n curr = curr[args[i] as keyof typeof curr];\n }\n\n if (typeof curr === \"number\") {\n return curr;\n }\n\n if (typeof curr === \"function\") {\n return curr();\n }\n\n console.warn(`Unexpected type (${curr}) for value [${args}]`);\n return 0;\n}\n","import { Stock } from \"./Stock\";\nimport { PositionTypes } from \"./data/PositionTypes\";\nimport { CONSTANTS } from \"../Constants\";\n\n// Amount by which a stock's forecast changes during each price movement\nexport const forecastChangePerPriceMovement = 0.006;\n\n/**\n * Calculate the total cost of a \"buy\" transaction. This accounts for spread and commission.\n * @param {Stock} stock - Stock being purchased\n * @param {number} shares - Number of shares being transacted\n * @param {PositionTypes} posType - Long or short position\n * @returns {number | null} Total transaction cost. Returns null for an invalid transaction\n */\nexport function getBuyTransactionCost(stock: Stock, shares: number, posType: PositionTypes): number | null {\n if (isNaN(shares) || shares <= 0 || !(stock instanceof Stock)) {\n return null;\n }\n\n // Cap the 'shares' arg at the stock's maximum shares. This'll prevent\n // hanging in the case when a really big number is passed in\n shares = Math.min(shares, stock.maxShares);\n\n const isLong = posType === PositionTypes.Long;\n\n // If the number of shares doesn't trigger a price movement, its a simple calculation\n if (isLong) {\n return shares * stock.getAskPrice() + CONSTANTS.StockMarketCommission;\n } else {\n return shares * stock.getBidPrice() + CONSTANTS.StockMarketCommission;\n }\n}\n\n/**\n * Calculate the TOTAL amount of money gained from a sale (NOT net profit). This accounts\n * for spread and commission.\n * @param {Stock} stock - Stock being sold\n * @param {number} shares - Number of shares being transacted\n * @param {PositionTypes} posType - Long or short position\n * @returns {number | null} Amount of money gained from transaction. Returns null for an invalid transaction\n */\nexport function getSellTransactionGain(stock: Stock, shares: number, posType: PositionTypes): number | null {\n if (isNaN(shares) || shares <= 0 || !(stock instanceof Stock)) {\n return null;\n }\n\n // Cap the 'shares' arg at the stock's maximum shares. This'll prevent\n // hanging in the case when a really big number is passed in\n shares = Math.min(shares, stock.maxShares);\n\n const isLong = posType === PositionTypes.Long;\n if (isLong) {\n return shares * stock.getBidPrice() - CONSTANTS.StockMarketCommission;\n } else {\n // Calculating gains for a short position requires calculating the profit made\n const origCost = shares * stock.playerAvgShortPx;\n const profit = (stock.playerAvgShortPx - stock.getAskPrice()) * shares - CONSTANTS.StockMarketCommission;\n\n return origCost + profit;\n }\n}\n\n/**\n * Processes a stock's change in forecast & second-order forecast\n * whenever it is transacted\n * @param {Stock} stock - Stock being sold\n * @param {number} shares - Number of shares being transacted\n * @param {PositionTypes} posType - Long or short position\n */\nexport function processTransactionForecastMovement(stock: Stock, shares: number): void {\n if (isNaN(shares) || shares <= 0 || !(stock instanceof Stock)) {\n return;\n }\n\n // Cap the 'shares' arg at the stock's maximum shares. This'll prevent\n // hanging in the case when a really big number is passed in\n shares = Math.min(shares, stock.maxShares);\n\n // If there's only going to be one iteration at most\n const firstShares = stock.shareTxUntilMovement;\n if (shares <= firstShares) {\n stock.shareTxUntilMovement -= shares;\n if (stock.shareTxUntilMovement <= 0) {\n stock.shareTxUntilMovement = stock.shareTxForMovement;\n stock.influenceForecast(forecastChangePerPriceMovement);\n stock.influenceForecastForecast(forecastChangePerPriceMovement * (stock.mv / 100));\n }\n\n return;\n }\n\n // Calculate how many iterations of price changes we need to account for\n const remainingShares = shares - firstShares;\n let numIterations = 1 + Math.ceil(remainingShares / stock.shareTxForMovement);\n\n // If on the off chance we end up perfectly at the next price movement\n stock.shareTxUntilMovement =\n stock.shareTxForMovement - ((shares - stock.shareTxUntilMovement) % stock.shareTxForMovement);\n if (stock.shareTxUntilMovement === stock.shareTxForMovement || stock.shareTxUntilMovement <= 0) {\n ++numIterations;\n stock.shareTxUntilMovement = stock.shareTxForMovement;\n }\n\n // Forecast always decreases in magnitude\n const forecastChange = forecastChangePerPriceMovement * (numIterations - 1);\n const forecastForecastChange = forecastChange * (stock.mv / 100);\n stock.influenceForecast(forecastChange);\n stock.influenceForecastForecast(forecastForecastChange);\n}\n\n/**\n * Calculate the maximum number of shares of a stock that can be purchased.\n * Handles mid-transaction price movements, both L and S positions, etc.\n * Used for the \"Buy Max\" button in the UI\n * @param {Stock} stock - Stock being purchased\n * @param {PositionTypes} posType - Long or short position\n * @param {number} money - Amount of money player has\n * @returns maximum number of shares that the player can purchase\n */\nexport function calculateBuyMaxAmount(stock: Stock, posType: PositionTypes, money: number): number {\n if (!(stock instanceof Stock)) {\n return 0;\n }\n\n const isLong = posType === PositionTypes.Long;\n\n const remainingMoney = money - CONSTANTS.StockMarketCommission;\n const currPrice = isLong ? stock.getAskPrice() : stock.getBidPrice();\n\n return Math.floor(remainingMoney / currPrice);\n}\n","import { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\n\nexport function getStockMarket4SDataCost(): number {\n return CONSTANTS.MarketData4SCost * BitNodeMultipliers.FourSigmaMarketDataCost;\n}\n\nexport function getStockMarket4STixApiCost(): number {\n return CONSTANTS.MarketDataTixApi4SCost * BitNodeMultipliers.FourSigmaMarketDataApiCost;\n}\n\nexport function getStockMarketWseCost(): number {\n return CONSTANTS.WSEAccountCost;\n}\n\nexport function getStockMarketTixApiCost(): number {\n return CONSTANTS.TIXAPICost;\n}\n","import { TextField, StandardTextFieldProps } from \"@mui/material\";\nimport React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\n\ninterface IProps extends Omit<StandardTextFieldProps, \"onChange\"> {\n onChange: (v: number) => void;\n}\n\nexport function NumberInput(props: IProps): React.ReactElement {\n const textProps = {\n ...props,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n const amt = numeralWrapper.parseMoney(event.target.value);\n if (event.target.value === \"\" || isNaN(amt)) props.onChange(NaN);\n else props.onChange(amt);\n },\n };\n return <TextField {...textProps} />;\n}\n","import { gangMemberTasksMetadata } from \"./data/tasks\";\nimport { GangMemberTask } from \"./GangMemberTask\";\n\nexport const GangMemberTasks: {\n [key: string]: GangMemberTask;\n} = {};\n\n(function () {\n gangMemberTasksMetadata.forEach((e) => {\n GangMemberTasks[e.name] = new GangMemberTask(e.name, e.desc, e.isHacking, e.isCombat, e.params);\n });\n})();\n","/**\n * Map of all Hash Upgrades\n * Key = Hash name, Value = HashUpgrade object\n */\nimport { HashUpgrade, IConstructorParams } from \"./HashUpgrade\";\nimport { HashUpgradesMetadata } from \"./data/HashUpgradesMetadata\";\n\nexport const HashUpgrades: Record<string, HashUpgrade> = {};\n\nfunction createHashUpgrade(p: IConstructorParams): void {\n HashUpgrades[p.name] = new HashUpgrade(p);\n}\n\nfor (const metadata of HashUpgradesMetadata) {\n createHashUpgrade(metadata);\n}\n","import React from \"react\";\nimport { Settings } from \"../Settings/Settings\";\nimport { formatTime } from \"../utils/helpers/formatTime\";\nimport { BaseServer } from \"../Server/BaseServer\";\n\nexport class Output {\n text: string;\n color: \"primary\" | \"error\" | \"success\" | \"info\" | \"warn\";\n constructor(text: string, color: \"primary\" | \"error\" | \"success\" | \"info\" | \"warn\") {\n if (Settings.TimestampsFormat) text = \"[\" + formatTime(Settings.TimestampsFormat) + \"] \" + text;\n this.text = text;\n this.color = color;\n }\n}\n\nexport class RawOutput {\n raw: React.ReactNode;\n constructor(node: React.ReactNode) {\n if (Settings.TimestampsFormat)\n node = (\n <>\n [{formatTime(Settings.TimestampsFormat)}] {node}\n </>\n );\n this.raw = node;\n }\n}\n\nexport class Link {\n hostname: string;\n dashes: string;\n constructor(dashes: string, hostname: string) {\n if (Settings.TimestampsFormat) dashes = \"[\" + formatTime(Settings.TimestampsFormat) + \"] \" + dashes;\n this.hostname = hostname;\n this.dashes = dashes;\n }\n}\n\nexport class TTimer {\n time: number;\n timeLeft: number;\n action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\";\n server?: BaseServer;\n\n constructor(time: number, action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\", server?: BaseServer) {\n this.time = time;\n this.timeLeft = time;\n this.action = action;\n this.server = server;\n }\n}\n","/** Represents the possible configuration values that can be provided when creating the progress bar text. */\ninterface IProgressBarConfiguration {\n /** Current progress, taken as a decimal (i.e. '0.6' to represent '60%') */\n progress?: number;\n\n /** Total number of ticks in progress bar. Preferably a factor of 100. */\n totalTicks?: number;\n}\n\n/** Represents concrete configuration values when creating the progress bar text. */\ninterface IProgressBarConfigurationMaterialized extends IProgressBarConfiguration {\n progress: number;\n totalTicks: number;\n}\n\n/**\n * Creates a graphical \"progress bar\"\n * e.g.: [||||---------------]\n * @param params The configuration parameters for the progress bar\n */\nexport function createProgressBarText(params: IProgressBarConfiguration): string {\n // Default values\n const defaultParams: IProgressBarConfigurationMaterialized = {\n progress: 0,\n totalTicks: 20,\n };\n\n // tslint:disable-next-line:prefer-object-spread\n const derived: IProgressBarConfigurationMaterialized = Object.assign({}, defaultParams, params);\n // Ensure it is 0..1\n derived.progress = Math.max(Math.min(derived.progress, 1), 0);\n\n // This way there is always at least one bar filled in...\n const bars: number = Math.max(Math.floor(derived.progress / (1 / derived.totalTicks)), 1);\n const dashes: number = Math.max(derived.totalTicks - bars, 0);\n\n // String.prototype.repeat isn't completely supported, but good enough for our purposes\n return `[${\"|\".repeat(bars)}${\"-\".repeat(dashes)}]`;\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n onConfirm: () => void;\n confirmationText: string | React.ReactNode;\n additionalButton?: React.ReactNode;\n}\n\nexport function ConfirmationModal(props: IProps): React.ReactElement {\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>{props.confirmationText}</Typography>\n <Button\n onClick={() => {\n props.onConfirm();\n }}\n >\n Confirm\n </Button>\n {props.additionalButton && <>{props.additionalButton}</>}\n </>\n </Modal>\n );\n}\n","/** Verifies that a supplied value is a member of the provided object/enum. Works for enums as well as enum-like objects (const {} as const). */\nexport function checkEnum<T extends Record<string, unknown>>(obj: T, value: unknown): value is T[keyof T] {\n return Object.values(obj).includes(value);\n}\n","export function hash(): string {\n try {\n if (__COMMIT_HASH__) {\n return __COMMIT_HASH__;\n }\n } catch (err) {}\n return \"DEV\";\n}\n","import { Locations } from \"../../Locations/Locations\";\nimport { Location } from \"../../Locations/Location\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Player } from \"@player\";\nimport { Class, Classes, ClassType } from \"../ClassWork\";\nimport { WorkStats } from \"../WorkStats\";\nimport { Server } from \"../../Server/Server\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { Person } from \"../../PersonObjects/Person\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nconst gameCPS = 1000 / CONSTANTS._idleSpeed; // 5 cycles per second\n\nexport function calculateCost(classs: Class, location: Location): number {\n const serverMeta = serverMetadata.find((s) => s.specialName === location.name);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n const discount = (server as Server).backdoorInstalled ? 0.9 : 1;\n return classs.earnings.money * location.costMult * discount;\n}\n\nexport function calculateClassEarnings(person: Person, type: ClassType, locationName: LocationName): WorkStats {\n //Find cost and exp gain per game cycle\n const hashManager = Player.hashManager;\n const classs = Classes[type];\n const location = Locations[locationName];\n\n const hashMult = [ClassType.GymAgility, ClassType.GymDefense, ClassType.GymStrength, ClassType.GymDexterity].includes(\n type,\n )\n ? hashManager.getTrainingMult()\n : hashManager.getStudyMult();\n\n const cost = calculateCost(classs, location) / gameCPS;\n const hackExp = ((classs.earnings.hackExp * location.expMult) / gameCPS) * hashMult;\n const strExp = ((classs.earnings.strExp * location.expMult) / gameCPS) * hashMult;\n const defExp = ((classs.earnings.defExp * location.expMult) / gameCPS) * hashMult;\n const dexExp = ((classs.earnings.dexExp * location.expMult) / gameCPS) * hashMult;\n const agiExp = ((classs.earnings.agiExp * location.expMult) / gameCPS) * hashMult;\n const chaExp = ((classs.earnings.chaExp * location.expMult) / gameCPS) * hashMult;\n return {\n money: cost,\n reputation: 0,\n hackExp: hackExp * person.mults.hacking_exp * BitNodeMultipliers.ClassGymExpGain,\n strExp: strExp * person.mults.strength_exp * BitNodeMultipliers.ClassGymExpGain,\n defExp: defExp * person.mults.defense_exp * BitNodeMultipliers.ClassGymExpGain,\n dexExp: dexExp * person.mults.dexterity_exp * BitNodeMultipliers.ClassGymExpGain,\n agiExp: agiExp * person.mults.agility_exp * BitNodeMultipliers.ClassGymExpGain,\n chaExp: chaExp * person.mults.charisma_exp * BitNodeMultipliers.ClassGymExpGain,\n intExp: 0,\n };\n}\n","/**\n * Class representing a script file.\n *\n * This does NOT represent a script that is actively running and\n * being evaluated. See RunningScript for that\n */\nimport { calculateRamUsage, RamUsageEntry } from \"./RamCalculations\";\nimport { ScriptUrl } from \"./ScriptUrl\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { roundToTwo } from \"../utils/helpers/roundToTwo\";\nimport { ScriptModule } from \"./ScriptModule\";\n\nlet globalModuleSequenceNumber = 0;\n\ninterface ScriptReference {\n filename: string;\n server: string;\n}\n\nexport class Script {\n // Code for this script\n code = \"\";\n\n // Filename for the script file\n filename = \"\";\n\n // url of the script if any, only for NS2.\n url = \"\";\n\n // The dynamic module generated for this script when it is run.\n // This is only applicable for NetscriptJS\n module: Promise<ScriptModule> | null = null;\n\n // The timestamp when when the script was last updated.\n moduleSequenceNumber: number;\n\n // Only used with NS2 scripts; the list of dependency script filenames. This is constructed\n // whenever the script is first evaluated, and therefore may be out of date if the script\n // has been updated since it was last run.\n dependencies: ScriptUrl[] = [];\n dependents: ScriptReference[] = [];\n\n // Amount of RAM this Script requires to run\n ramUsage = 0;\n ramUsageEntries?: RamUsageEntry[];\n\n // Used to deconflict multiple simultaneous compilations.\n queueCompile = false;\n\n // hostname of server that this script is on.\n server = \"\";\n\n constructor(fn = \"\", code = \"\", server = \"\", otherScripts: Script[] = []) {\n this.filename = fn;\n this.code = code;\n this.server = server; // hostname of server this script is on\n this.moduleSequenceNumber = ++globalModuleSequenceNumber;\n if (this.code !== \"\") {\n this.updateRamUsage(otherScripts);\n }\n }\n\n /** Download the script as a file */\n download(): void {\n const filename = this.filename;\n const file = new Blob([this.code], { type: \"text/plain\" });\n const a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n\n /**\n * Marks this script as having been updated. It will be recompiled next time something tries\n * to exec it.\n */\n markUpdated(): void {\n this.module = null;\n this.moduleSequenceNumber = ++globalModuleSequenceNumber;\n }\n\n /**\n * Save a script from the script editor\n * @param {string} code - The new contents of the script\n * @param {Script[]} otherScripts - Other scripts on the server. Used to process imports\n */\n saveScript(filename: string, code: string, hostname: string, otherScripts: Script[]): void {\n // Update code and filename\n this.code = Script.formatCode(code);\n\n this.filename = filename;\n this.server = hostname;\n this.updateRamUsage(otherScripts);\n this.markUpdated();\n for (const dependent of this.dependents) {\n const [dependentScript] = otherScripts.filter(\n (s) => s.filename === dependent.filename && s.server == dependent.server,\n );\n dependentScript?.markUpdated();\n }\n }\n\n /**\n * Calculates and updates the script's RAM usage based on its code\n * @param {Script[]} otherScripts - Other scripts on the server. Used to process imports\n */\n updateRamUsage(otherScripts: Script[]): void {\n const res = calculateRamUsage(this.code, otherScripts);\n if (res.cost > 0) {\n this.ramUsage = roundToTwo(res.cost);\n this.ramUsageEntries = res.entries;\n }\n this.markUpdated();\n }\n\n imports(): string[] {\n return [];\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Script\", this);\n }\n\n // Initializes a Script Object from a JSON save state\n static fromJSON(value: IReviverValue): Script {\n const s = Generic_fromJSON(Script, value.data);\n // Force the url to blank from the save data. Urls are not valid outside the current browser page load.\n s.url = \"\";\n s.dependents = [];\n return s;\n }\n\n /**\n * Formats code: Removes the starting & trailing whitespace\n * @param {string} code - The code to format\n * @returns The formatted code\n */\n static formatCode(code: string): string {\n return code.replace(/^\\s+|\\s+$/g, \"\");\n }\n}\n\nReviver.constructors.Script = Script;\n","import { Player } from \"@player\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { applySleeveGains, Work, WorkType } from \"./Work\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { GeneralActions } from \"../../../Bladeburner/data/GeneralActions\";\nimport { WorkStats } from \"../../../Work/WorkStats\";\n\ninterface SleeveBladeburnerWorkParams {\n type: string;\n name: string;\n}\n\nexport const isSleeveBladeburnerWork = (w: Work | null): w is SleeveBladeburnerWork =>\n w !== null && w.type === WorkType.BLADEBURNER;\n\nexport class SleeveBladeburnerWork extends Work {\n cyclesWorked = 0;\n actionType: string;\n actionName: string;\n\n constructor(params?: SleeveBladeburnerWorkParams) {\n super(WorkType.BLADEBURNER);\n this.actionType = params?.type ?? \"General\";\n this.actionName = params?.name ?? \"Field analysis\";\n }\n\n cyclesNeeded(sleeve: Sleeve): number {\n const ret = Player.bladeburner?.getActionTimeNetscriptFn(sleeve, this.actionType, this.actionName);\n if (!ret || typeof ret === \"string\") throw new Error(`Error querying ${this.actionName} time`);\n return ret / CONSTANTS._idleSpeed;\n }\n\n process(sleeve: Sleeve, cycles: number): number {\n if (!Player.bladeburner) throw new Error(\"sleeve doing blade work without being a member\");\n this.cyclesWorked += cycles;\n const actionIdent = Player.bladeburner.getActionIdFromTypeAndName(this.actionType, this.actionName);\n if (!actionIdent) throw new Error(`Error getting ${this.actionName} action`);\n if (this.actionType === \"Contracts\") {\n const action = Player.bladeburner.getActionObject(actionIdent);\n if (!action) throw new Error(`Error getting ${this.actionName} action object`);\n if (action.count <= 0) {\n sleeve.stopWork();\n return 0;\n }\n }\n\n while (this.cyclesWorked > this.cyclesNeeded(sleeve)) {\n if (this.actionType === \"Contracts\") {\n const action = Player.bladeburner.getActionObject(actionIdent);\n if (!action) throw new Error(`Error getting ${this.actionName} action object`);\n if (action.count <= 0) {\n sleeve.stopWork();\n return 0;\n }\n }\n const retValue = Player.bladeburner.completeAction(sleeve, actionIdent, false);\n let exp: WorkStats | undefined;\n if (this.actionType === \"General\") {\n exp = GeneralActions[this.actionName]?.exp;\n if (!exp) throw new Error(`Somehow there was no exp for action ${this.actionType} ${this.actionName}`);\n applySleeveGains(sleeve, exp, 1);\n }\n\n if (this.actionType === \"Contracts\") {\n applySleeveGains(sleeve, retValue, 1);\n }\n this.cyclesWorked -= this.cyclesNeeded(sleeve);\n }\n return 0;\n }\n\n APICopy(): Record<string, unknown> {\n return {\n actionType: this.actionType,\n actionName: this.actionName,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveBladeburnerWork\", this);\n }\n\n /** Initializes a BladeburnerWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): SleeveBladeburnerWork {\n return Generic_fromJSON(SleeveBladeburnerWork, value.data);\n }\n}\n\nReviver.constructors.SleeveBladeburnerWork = SleeveBladeburnerWork;\n","import React from \"react\";\n\nimport { Table, TableCell } from \"./Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport { Table as MuiTable } from \"@mui/material\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n rows: React.ReactNode[][];\n title?: string;\n wide?: boolean;\n}\n\nexport function StatsTable({ rows, title, wide }: IProps): React.ReactElement {\n const T = wide ? MuiTable : Table;\n return (\n <>\n {title && <Typography>{title}</Typography>}\n <T size=\"small\" padding=\"none\">\n <TableBody>\n {rows.map((row: React.ReactNode[], i: number) => (\n <TableRow key={i}>\n {row.map((elem: React.ReactNode, i: number) => (\n <TableCell key={i} align={i !== 0 ? \"right\" : \"left\"}>\n <Typography noWrap>{elem}</Typography>\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </T>\n </>\n );\n}\n","import { Action } from \"./Action\";\n\nexport const GeneralActions: Record<string, Action> = {};\n\nconst actionNames: Array<string> = [\n \"Training\",\n \"Field Analysis\",\n \"Recruitment\",\n \"Diplomacy\",\n \"Hyperbolic Regeneration Chamber\",\n \"Incite Violence\",\n];\n\nfor (const actionName of actionNames) {\n GeneralActions[actionName] = new Action({\n name: actionName,\n });\n}\n","import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { Export } from \"./Export\";\n\ninterface IConstructorParams {\n name?: string;\n}\n\nexport class Material {\n // Name of material\n name = \"InitName\";\n\n // Amount of material owned\n qty = 0;\n\n // Material's \"quality\". Unbounded\n qlt = 0;\n\n // How much demand the Material has in the market, and the range of possible\n // values for this \"demand\"\n dmd = 0;\n dmdR: number[] = [0, 0];\n\n // How much competition there is for this Material in the market, and the range\n // of possible values for this \"competition\"\n cmp = 0;\n cmpR: number[] = [0, 0];\n\n // Maximum volatility of this Materials stats\n mv = 0;\n\n // Markup. Determines how high of a price you can charge on the material\n // compared to the market price without suffering loss in # of sales\n // Quality is divided by this to determine markup limits\n // e,g, If mku is 10 and quality is 100 then you can markup prices by 100/10 = 10\n mku = 0;\n\n // How much of this material is being bought, sold, imported and produced every second\n buy = 0;\n sll = 0;\n prd = 0;\n imp = 0;\n\n // Exports of this material to another warehouse/industry\n exp: Export[] = [];\n\n // Total amount of this material exported in the last cycle\n totalExp = 0;\n\n // Cost / sec to buy this material. AKA Market Price\n bCost = 0;\n\n // Cost / sec to sell this material\n sCost: string | number = 0;\n\n // Flags to keep track of whether production and/or sale of this material is limited\n // [Whether production/sale is limited, limit amount]\n prdman: [boolean, number] = [false, 0]; // Production\n sllman: [boolean, string | number] = [false, 0]; // Sale\n\n // Flags that signal whether automatic sale pricing through Market TA is enabled\n marketTa1 = false;\n marketTa2 = false;\n marketTa2Price = 0;\n\n // Determines the maximum amount of this material that can be sold in one market cycle\n maxsll = 0;\n\n constructor(params: IConstructorParams = {}) {\n if (params.name) {\n this.name = params.name;\n }\n this.init();\n }\n\n getMarkupLimit(): number {\n return this.qlt / this.mku;\n }\n\n init(): void {\n switch (this.name) {\n case \"Water\":\n this.dmd = 75;\n this.dmdR = [65, 85];\n this.cmp = 50;\n this.cmpR = [40, 60];\n this.bCost = 1500;\n this.mv = 0.2;\n this.mku = 6;\n break;\n case \"Energy\":\n this.dmd = 90;\n this.dmdR = [80, 99];\n this.cmp = 80;\n this.cmpR = [65, 95];\n this.bCost = 2000;\n this.mv = 0.2;\n this.mku = 6;\n break;\n case \"Food\":\n this.dmd = 80;\n this.dmdR = [70, 90];\n this.cmp = 60;\n this.cmpR = [35, 85];\n this.bCost = 5000;\n this.mv = 1;\n this.mku = 3;\n break;\n case \"Plants\":\n this.dmd = 70;\n this.dmdR = [20, 90];\n this.cmp = 50;\n this.cmpR = [30, 70];\n this.bCost = 3000;\n this.mv = 0.6;\n this.mku = 3.75;\n break;\n case \"Metal\":\n this.dmd = 80;\n this.dmdR = [75, 85];\n this.cmp = 70;\n this.cmpR = [60, 80];\n this.bCost = 2650;\n this.mv = 1;\n this.mku = 6;\n break;\n case \"Hardware\":\n this.dmd = 85;\n this.dmdR = [80, 90];\n this.cmp = 80;\n this.cmpR = [65, 95];\n this.bCost = 8e3;\n this.mv = 0.5; //Less mv bc its processed twice\n this.mku = 1;\n break;\n case \"Chemicals\":\n this.dmd = 55;\n this.dmdR = [40, 70];\n this.cmp = 60;\n this.cmpR = [40, 80];\n this.bCost = 9e3;\n this.mv = 1.2;\n this.mku = 2;\n break;\n case \"Real Estate\":\n this.dmd = 50;\n this.dmdR = [5, 99];\n this.cmp = 50;\n this.cmpR = [25, 75];\n this.bCost = 80e3;\n this.mv = 1.5; //Less mv bc its processed twice\n this.mku = 1.5;\n break;\n case \"Drugs\":\n this.dmd = 60;\n this.dmdR = [45, 75];\n this.cmp = 70;\n this.cmpR = [40, 99];\n this.bCost = 40e3;\n this.mv = 1.6;\n this.mku = 1;\n break;\n case \"Robots\":\n this.dmd = 90;\n this.dmdR = [80, 99];\n this.cmp = 90;\n this.cmpR = [80, 99];\n this.bCost = 75e3;\n this.mv = 0.5; //Less mv bc its processed twice\n this.mku = 1;\n break;\n case \"AI Cores\":\n this.dmd = 90;\n this.dmdR = [80, 99];\n this.cmp = 90;\n this.cmpR = [80, 99];\n this.bCost = 15e3;\n this.mv = 0.8; //Less mv bc its processed twice\n this.mku = 0.5;\n break;\n case \"Scientific Research\":\n case \"InitName\":\n break;\n default:\n console.error(`Invalid material type in init(): ${this.name}`);\n break;\n }\n }\n\n // Process change in demand, competition, and buy cost of this material\n processMarket(): void {\n // The price will change in accordance with demand and competition.\n // e.g. If demand goes up, then so does price. If competition goes up, price goes down\n const priceVolatility: number = (Math.random() * this.mv) / 300;\n const priceChange: number = 1 + priceVolatility;\n\n //This 1st random check determines whether competition increases or decreases\n const compVolatility: number = (Math.random() * this.mv) / 100;\n const compChange: number = 1 + compVolatility;\n if (Math.random() < 0.5) {\n this.cmp *= compChange;\n if (this.cmp > this.cmpR[1]) {\n this.cmp = this.cmpR[1];\n }\n this.bCost *= 1 / priceChange; // Competition increases, so price goes down\n } else {\n this.cmp *= 1 / compChange;\n if (this.cmp < this.cmpR[0]) {\n this.cmp = this.cmpR[0];\n }\n this.bCost *= priceChange; // Competition decreases, so price goes up\n }\n\n // This 2nd random check determines whether demand increases or decreases\n const dmdVolatility: number = (Math.random() * this.mv) / 100;\n const dmdChange: number = 1 + dmdVolatility;\n if (Math.random() < 0.5) {\n this.dmd *= dmdChange;\n if (this.dmd > this.dmdR[1]) {\n this.dmd = this.dmdR[1];\n }\n this.bCost *= priceChange; // Demand increases, so price goes up\n } else {\n this.dmd *= 1 / dmdChange;\n if (this.dmd < this.dmdR[0]) {\n this.dmd = this.dmdR[0];\n }\n this.bCost *= 1 / priceChange;\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Material\", this);\n }\n\n // Initializes a Material object from a JSON save state.\n static fromJSON(value: IReviverValue): Material {\n return Generic_fromJSON(Material, value.data);\n }\n}\n\nReviver.constructors.Material = Material;\n","// Enum values are lowercased to match css classes\nexport enum Suit {\n Clubs = \"clubs\",\n Diamonds = \"diamonds\",\n Hearts = \"hearts\",\n Spades = \"spades\",\n}\n\nexport class Card {\n constructor(readonly value: number, readonly suit: Suit) {\n if (value < 1 || value > 13) {\n throw new Error(`Card instantiated with improper value: ${value}`);\n }\n }\n\n formatValue(): string {\n switch (this.value) {\n case 1:\n return \"A\";\n case 11:\n return \"J\";\n case 12:\n return \"Q\";\n case 13:\n return \"K\";\n default:\n return `${this.value}`;\n }\n }\n\n isRedSuit(): boolean {\n return this.suit === Suit.Hearts || this.suit === Suit.Diamonds;\n }\n\n getStringRepresentation(): string {\n const value = this.formatValue();\n\n return `${value} of ${this.suit}`;\n }\n}\n","import { BitNodes } from \"../BitNode/BitNode\";\n\nexport class SourceFile {\n info: JSX.Element;\n lvl = 1;\n n: number;\n name: string;\n owned = false;\n\n constructor(number: number, info: JSX.Element) {\n const bitnodeKey = \"BitNode\" + number;\n const bitnode = BitNodes[bitnodeKey];\n if (bitnode == null) {\n throw new Error(\"Invalid Bit Node for this Source File\");\n }\n\n this.n = number;\n this.name = `Source-File ${number}: ${bitnode.name}`;\n this.info = info;\n }\n}\n","import { CONSTANTS } from \"../Constants\";\nimport { Player } from \"@player\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { Server } from \"../Server/Server\";\nimport { RunningScript } from \"./RunningScript\";\nimport { processSingleServerGrowth } from \"../Server/ServerHelpers\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport { compareArrays } from \"../utils/helpers/compareArrays\";\n\nexport function scriptCalculateOfflineProduction(runningScript: RunningScript): void {\n //The Player object stores the last update time from when we were online\n const thisUpdate = new Date().getTime();\n const lastUpdate = Player.lastUpdate;\n const timePassed = (thisUpdate - lastUpdate) / 1000; //Seconds\n\n //Calculate the \"confidence\" rating of the script's true production. This is based\n //entirely off of time. We will arbitrarily say that if a script has been running for\n //4 hours (14400 sec) then we are completely confident in its ability\n let confidence = runningScript.onlineRunningTime / 14400;\n if (confidence >= 1) {\n confidence = 1;\n }\n\n //Data map: [MoneyStolen, NumTimesHacked, NumTimesGrown, NumTimesWeaken]\n\n // Grow\n for (const hostname of Object.keys(runningScript.dataMap)) {\n if (runningScript.dataMap.hasOwnProperty(hostname)) {\n if (runningScript.dataMap[hostname][2] == 0 || runningScript.dataMap[hostname][2] == null) {\n continue;\n }\n const serv = GetServer(hostname);\n if (serv == null) {\n continue;\n }\n const timesGrown = Math.round(\n ((0.5 * runningScript.dataMap[hostname][2]) / runningScript.onlineRunningTime) * timePassed,\n );\n runningScript.log(`Called on ${serv.hostname} ${timesGrown} times while offline`);\n const host = GetServer(runningScript.server);\n if (host === null) throw new Error(\"getServer of null key?\");\n if (!(serv instanceof Server)) throw new Error(\"trying to grow a non-normal server\");\n const growth = processSingleServerGrowth(serv, timesGrown, host.cpuCores);\n runningScript.log(\n `'${serv.hostname}' grown by ${numeralWrapper.format(growth * 100 - 100, \"0.000000%\")} while offline`,\n );\n }\n }\n\n // Offline EXP gain\n // A script's offline production will always be at most half of its online production.\n const expGain = confidence * (runningScript.onlineExpGained / runningScript.onlineRunningTime) * timePassed;\n Player.gainHackingExp(expGain);\n\n // Update script stats\n runningScript.offlineRunningTime += timePassed;\n runningScript.offlineExpGained += expGain;\n\n // Weaken\n for (const hostname of Object.keys(runningScript.dataMap)) {\n if (runningScript.dataMap.hasOwnProperty(hostname)) {\n if (runningScript.dataMap[hostname][3] == 0 || runningScript.dataMap[hostname][3] == null) {\n continue;\n }\n const serv = GetServer(hostname);\n if (serv == null) {\n continue;\n }\n\n if (!(serv instanceof Server)) throw new Error(\"trying to weaken a non-normal server\");\n const host = GetServer(runningScript.server);\n if (host === null) throw new Error(\"getServer of null key?\");\n const timesWeakened = Math.round(\n ((0.5 * runningScript.dataMap[hostname][3]) / runningScript.onlineRunningTime) * timePassed,\n );\n runningScript.log(`Called weaken() on ${serv.hostname} ${timesWeakened} times while offline`);\n const coreBonus = 1 + (host.cpuCores - 1) / 16;\n serv.weaken(CONSTANTS.ServerWeakenAmount * timesWeakened * coreBonus);\n }\n }\n}\n\n//Returns a RunningScript object matching the filename and arguments on the\n//designated server, and false otherwise\nexport function findRunningScript(\n filename: string,\n args: (string | number | boolean)[],\n server: BaseServer,\n): RunningScript | null {\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename === filename && compareArrays(server.runningScripts[i].args, args)) {\n return server.runningScripts[i];\n }\n }\n return null;\n}\n\n//Returns a RunningScript object matching the pid on the\n//designated server, and false otherwise\nexport function findRunningScriptByPid(pid: number, server: BaseServer): RunningScript | null {\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].pid === pid) {\n return server.runningScripts[i];\n }\n }\n return null;\n}\n","import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { applySleeveGains, Work, WorkType } from \"./Work\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { Companies } from \"../../../Company/Companies\";\nimport { Company } from \"../../../Company/Company\";\nimport { calculateCompanyWorkStats } from \"../../../Work/formulas/Company\";\nimport { WorkStats } from \"../../../Work/WorkStats\";\nimport { influenceStockThroughCompanyWork } from \"../../../StockMarket/PlayerInfluencing\";\n\ninterface SleeveCompanyWorkParams {\n companyName: string;\n}\n\nexport const isSleeveCompanyWork = (w: Work | null): w is SleeveCompanyWork =>\n w !== null && w.type === WorkType.COMPANY;\n\nexport class SleeveCompanyWork extends Work {\n companyName: string;\n\n constructor(params?: SleeveCompanyWorkParams) {\n super(WorkType.COMPANY);\n this.companyName = params?.companyName ?? LocationName.NewTokyoNoodleBar;\n }\n\n getCompany(): Company {\n const c = Companies[this.companyName];\n if (!c) throw new Error(`Company not found: '${this.companyName}'`);\n return c;\n }\n\n getGainRates(sleeve: Sleeve): WorkStats {\n return calculateCompanyWorkStats(sleeve, this.getCompany());\n }\n\n process(sleeve: Sleeve, cycles: number): number {\n const company = this.getCompany();\n const gains = this.getGainRates(sleeve);\n applySleeveGains(sleeve, gains, cycles);\n company.playerReputation += gains.reputation * cycles;\n influenceStockThroughCompanyWork(company, gains.reputation, cycles);\n return 0;\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n companyName: this.companyName,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveCompanyWork\", this);\n }\n\n /** Initializes a CompanyWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): SleeveCompanyWork {\n return Generic_fromJSON(SleeveCompanyWork, value.data);\n }\n}\n\nReviver.constructors.SleeveCompanyWork = SleeveCompanyWork;\n","import { PlayerObject } from \"src/PersonObjects/Player/PlayerObject\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { SkillNames } from \"../Bladeburner/data/SkillNames\";\nimport { Skills } from \"../Bladeburner/Skills\";\nimport { CONSTANTS } from \"../Constants\";\nimport { Industries } from \"../Corporation/IndustryData\";\nimport { Exploit } from \"../Exploits/Exploit\";\nimport { Factions } from \"../Faction/Factions\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { GangConstants } from \"../Gang/data/Constants\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { hasHacknetServers } from \"../Hacknet/HacknetHelpers\";\nimport { HacknetNode } from \"../Hacknet/HacknetNode\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { Player } from \"@player\";\nimport { Programs } from \"../Programs/Programs\";\nimport { GetAllServers, GetServer } from \"../Server/AllServers\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Server } from \"../Server/Server\";\nimport { Router } from \"../ui/GameRoot\";\nimport { Page } from \"../ui/Router\";\nimport * as data from \"./AchievementData.json\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { BlackOperationNames } from \"../Bladeburner/data/BlackOperationNames\";\nimport { isClassWork } from \"../Work/ClassWork\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\n// Unable to correctly cast the JSON data into AchievementDataJson type otherwise...\nconst achievementData = (<AchievementDataJson>(<unknown>data)).achievements;\n\nexport interface Achievement {\n ID: string;\n Icon?: string;\n Name?: string;\n Description?: string;\n Secret?: boolean;\n Condition: () => boolean;\n Visible?: () => boolean;\n AdditionalUnlock?: string[]; // IDs of achievements that should be awarded when awarding this one\n}\n\nexport interface PlayerAchievement {\n ID: string;\n unlockedOn?: number;\n}\n\nexport interface AchievementDataJson {\n achievements: Record<string, AchievementData>;\n}\n\nexport interface AchievementData {\n ID: string;\n Name: string;\n Description: string;\n}\n\nfunction bitNodeFinishedState(): boolean {\n const wd = GetServer(SpecialServers.WorldDaemon);\n if (!(wd instanceof Server)) return false;\n if (wd.backdoorInstalled) return true;\n return (\n Player.bladeburner !== null && Player.bladeburner.blackops.hasOwnProperty(BlackOperationNames.OperationDaedalus)\n );\n}\n\nfunction hasAccessToSF(player: PlayerObject, bn: number): boolean {\n return player.bitNodeN === bn || player.sourceFiles.some((a) => a.n === bn);\n}\n\nfunction knowsAboutBitverse(player: PlayerObject): boolean {\n return player.sourceFiles.some((a) => a.n === 1);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction sfAchievement(): Achievement[] {\n const achs: Achievement[] = [];\n for (let i = 0; i <= 11; i++) {\n for (let j = 1; j <= 3; j++) {\n achs.push({\n ID: `SF${i}.${j}`,\n Condition: () => Player.sourceFileLvl(i) >= j,\n });\n }\n }\n return achs;\n}\n\nexport const achievements: Record<string, Achievement> = {\n [FactionNames.CyberSec.toUpperCase()]: {\n ...achievementData[FactionNames.CyberSec.toUpperCase()],\n Icon: \"CSEC\",\n Condition: () => Player.factions.includes(FactionNames.CyberSec),\n },\n [FactionNames.NiteSec.toUpperCase()]: {\n ...achievementData[FactionNames.NiteSec.toUpperCase()],\n Icon: FactionNames.NiteSec,\n Condition: () => Player.factions.includes(FactionNames.NiteSec),\n },\n THE_BLACK_HAND: {\n ...achievementData[\"THE_BLACK_HAND\"],\n Icon: \"TBH\",\n Condition: () => Player.factions.includes(FactionNames.TheBlackHand),\n },\n [FactionNames.BitRunners.toUpperCase()]: {\n ...achievementData[FactionNames.BitRunners.toUpperCase()],\n Icon: FactionNames.BitRunners.toLowerCase(),\n Condition: () => Player.factions.includes(FactionNames.BitRunners),\n },\n [FactionNames.Daedalus.toUpperCase()]: {\n ...achievementData[FactionNames.Daedalus.toUpperCase()],\n Icon: FactionNames.Daedalus.toLowerCase(),\n Condition: () => Player.factions.includes(FactionNames.Daedalus),\n },\n THE_COVENANT: {\n ...achievementData[\"THE_COVENANT\"],\n Icon: FactionNames.TheCovenant.toLowerCase().replace(/ /g, \"\"),\n Condition: () => Player.factions.includes(FactionNames.TheCovenant),\n },\n [FactionNames.Illuminati.toUpperCase()]: {\n ...achievementData[FactionNames.Illuminati.toUpperCase()],\n Icon: FactionNames.Illuminati.toLowerCase(),\n Condition: () => Player.factions.includes(FactionNames.Illuminati),\n },\n \"BRUTESSH.EXE\": {\n ...achievementData[\"BRUTESSH.EXE\"],\n Icon: \"p0\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.BruteSSHProgram.name),\n },\n \"FTPCRACK.EXE\": {\n ...achievementData[\"FTPCRACK.EXE\"],\n Icon: \"p1\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.FTPCrackProgram.name),\n },\n //-----------------------------------------------------\n \"RELAYSMTP.EXE\": {\n ...achievementData[\"RELAYSMTP.EXE\"],\n Icon: \"p2\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.RelaySMTPProgram.name),\n },\n \"HTTPWORM.EXE\": {\n ...achievementData[\"HTTPWORM.EXE\"],\n Icon: \"p3\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.HTTPWormProgram.name),\n },\n \"SQLINJECT.EXE\": {\n ...achievementData[\"SQLINJECT.EXE\"],\n Icon: \"p4\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.SQLInjectProgram.name),\n },\n \"FORMULAS.EXE\": {\n ...achievementData[\"FORMULAS.EXE\"],\n Icon: \"formulas\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.Formulas.name),\n },\n \"SF1.1\": {\n ...achievementData[\"SF1.1\"],\n Icon: \"SF1.1\",\n Visible: () => hasAccessToSF(Player, 1),\n Condition: () => Player.sourceFileLvl(1) >= 1,\n },\n \"SF2.1\": {\n ...achievementData[\"SF2.1\"],\n Icon: \"SF2.1\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.sourceFileLvl(2) >= 1,\n },\n \"SF3.1\": {\n ...achievementData[\"SF3.1\"],\n Icon: \"SF3.1\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.sourceFileLvl(3) >= 1,\n },\n \"SF4.1\": {\n ...achievementData[\"SF4.1\"],\n Icon: \"SF4.1\",\n Visible: () => hasAccessToSF(Player, 4),\n Condition: () => Player.sourceFileLvl(4) >= 1,\n },\n \"SF5.1\": {\n ...achievementData[\"SF5.1\"],\n Icon: \"SF5.1\",\n Visible: () => hasAccessToSF(Player, 5),\n Condition: () => Player.sourceFileLvl(5) >= 1,\n },\n \"SF6.1\": {\n ...achievementData[\"SF6.1\"],\n Icon: \"SF6.1\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.sourceFileLvl(6) >= 1,\n },\n \"SF7.1\": {\n ...achievementData[\"SF7.1\"],\n Icon: \"SF7.1\",\n Visible: () => hasAccessToSF(Player, 7),\n Condition: () => Player.sourceFileLvl(7) >= 1,\n },\n \"SF8.1\": {\n ...achievementData[\"SF8.1\"],\n Icon: \"SF8.1\",\n Visible: () => hasAccessToSF(Player, 8),\n Condition: () => Player.sourceFileLvl(8) >= 1,\n },\n \"SF9.1\": {\n ...achievementData[\"SF9.1\"],\n Icon: \"SF9.1\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => Player.sourceFileLvl(9) >= 1,\n },\n \"SF10.1\": {\n ...achievementData[\"SF10.1\"],\n Icon: \"SF10.1\",\n Visible: () => hasAccessToSF(Player, 10),\n Condition: () => Player.sourceFileLvl(10) >= 1,\n },\n \"SF11.1\": {\n ...achievementData[\"SF11.1\"],\n Icon: \"SF11.1\",\n Visible: () => hasAccessToSF(Player, 11),\n Condition: () => Player.sourceFileLvl(11) >= 1,\n },\n \"SF12.1\": {\n ...achievementData[\"SF12.1\"],\n Icon: \"SF12.1\",\n Visible: () => hasAccessToSF(Player, 12),\n Condition: () => Player.sourceFileLvl(12) >= 1,\n },\n MONEY_1Q: {\n ...achievementData[\"MONEY_1Q\"],\n Icon: \"$1Q\",\n Condition: () => Player.money >= 1e18,\n },\n MONEY_M1B: {\n ...achievementData[\"MONEY_M1B\"],\n Icon: \"-1b\",\n Secret: true,\n Condition: () => Player.money <= -1e9,\n },\n INSTALL_1: {\n ...achievementData[\"INSTALL_1\"],\n Icon: \"install\",\n Condition: () => Player.augmentations.length >= 1,\n },\n INSTALL_100: {\n ...achievementData[\"INSTALL_100\"],\n Icon: \"install_100\",\n Condition: () => Player.augmentations.length >= 100,\n },\n QUEUE_40: {\n ...achievementData[\"QUEUE_40\"],\n Icon: \"queue40\",\n Condition: () => Player.queuedAugmentations.length >= 40,\n },\n HACKING_100000: {\n ...achievementData[\"HACKING_100000\"],\n Icon: \"hack100000\",\n Condition: () => Player.skills.hacking >= 100000,\n },\n COMBAT_3000: {\n ...achievementData[\"COMBAT_3000\"],\n Icon: \"combat3000\",\n Condition: () =>\n Player.skills.strength >= 3000 &&\n Player.skills.defense >= 3000 &&\n Player.skills.dexterity >= 3000 &&\n Player.skills.agility >= 3000,\n },\n NEUROFLUX_255: {\n ...achievementData[\"NEUROFLUX_255\"],\n Icon: \"nf255\",\n Condition: () => Player.augmentations.some((a) => a.name === AugmentationNames.NeuroFluxGovernor && a.level >= 255),\n },\n NS2: {\n ...achievementData[\"NS2\"],\n Icon: \"ns2\",\n Condition: () => Player.getHomeComputer().scripts.some((s) => s.filename.endsWith(\".js\")),\n },\n FROZE: {\n ...achievementData[\"FROZE\"],\n Icon: \"forze\",\n Condition: () => location.href.includes(\"noScripts\"),\n },\n RUNNING_SCRIPTS_1000: {\n ...achievementData[\"RUNNING_SCRIPTS_1000\"],\n Icon: \"run1000\",\n Condition: (): boolean => {\n let running = 0;\n for (const s of GetAllServers()) {\n running += s.runningScripts.length;\n }\n return running >= 1000;\n },\n },\n DRAIN_SERVER: {\n ...achievementData[\"DRAIN_SERVER\"],\n Icon: \"drain\",\n Condition: (): boolean => {\n for (const s of GetAllServers()) {\n if (s instanceof Server) {\n if (s.moneyMax > 0 && s.moneyAvailable === 0) return true;\n }\n }\n return false;\n },\n },\n MAX_RAM: {\n ...achievementData[\"MAX_RAM\"],\n Icon: \"maxram\",\n Condition: () => Player.getHomeComputer().maxRam === CONSTANTS.HomeComputerMaxRam,\n },\n MAX_CORES: {\n ...achievementData[\"MAX_CORES\"],\n Icon: \"maxcores\",\n Condition: () => Player.getHomeComputer().cpuCores === 8,\n },\n SCRIPTS_30: {\n ...achievementData[\"SCRIPTS_30\"],\n Icon: \"folders\",\n Condition: () => Player.getHomeComputer().scripts.length >= 30,\n },\n KARMA_1000000: {\n ...achievementData[\"KARMA_1000000\"],\n Icon: \"karma\",\n Secret: true,\n Condition: () => Player.karma <= -1e6,\n },\n STOCK_1q: {\n ...achievementData[\"STOCK_1q\"],\n Icon: \"$1Q\",\n Condition: () => Player.moneySourceB.stock >= 1e15,\n },\n DISCOUNT: {\n ...achievementData[\"DISCOUNT\"],\n Icon: \"discount\",\n Condition: (): boolean => {\n const p = GetServer(\"powerhouse-fitness\");\n if (!(p instanceof Server)) return false;\n return p.backdoorInstalled;\n },\n },\n SCRIPT_32GB: {\n ...achievementData[\"SCRIPT_32GB\"],\n Icon: \"bigcost\",\n Condition: () => Player.getHomeComputer().scripts.some((s) => s.ramUsage >= 32),\n },\n FIRST_HACKNET_NODE: {\n ...achievementData[\"FIRST_HACKNET_NODE\"],\n Icon: \"node\",\n Condition: () => !hasHacknetServers() && Player.hacknetNodes.length > 0,\n },\n \"30_HACKNET_NODE\": {\n ...achievementData[\"30_HACKNET_NODE\"],\n Icon: \"hacknet-all\",\n Condition: () => !hasHacknetServers() && Player.hacknetNodes.length >= 30,\n },\n MAX_HACKNET_NODE: {\n ...achievementData[\"MAX_HACKNET_NODE\"],\n Icon: \"hacknet-max\",\n Condition: (): boolean => {\n if (hasHacknetServers()) return false;\n for (const h of Player.hacknetNodes) {\n if (!(h instanceof HacknetNode)) return false;\n if (\n h.ram === HacknetNodeConstants.MaxRam &&\n h.cores === HacknetNodeConstants.MaxCores &&\n h.level === HacknetNodeConstants.MaxLevel\n )\n return true;\n }\n return false;\n },\n },\n HACKNET_NODE_10M: {\n ...achievementData[\"HACKNET_NODE_10M\"],\n Icon: \"hacknet-10m\",\n Condition: () => !hasHacknetServers() && Player.moneySourceB.hacknet >= 10e6,\n },\n REPUTATION_10M: {\n ...achievementData[\"REPUTATION_10M\"],\n Icon: \"reputation\",\n Condition: () => Object.values(Factions).some((f) => f.playerReputation >= 10e6),\n },\n DONATION: {\n ...achievementData[\"DONATION\"],\n Icon: \"donation\",\n Condition: () =>\n Object.values(Factions).some(\n (f) => f.favor >= Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction),\n ),\n },\n TRAVEL: {\n ...achievementData[\"TRAVEL\"],\n Icon: \"TRAVEL\",\n Condition: () => Player.city !== CityName.Sector12,\n },\n WORKOUT: {\n ...achievementData[\"WORKOUT\"],\n Icon: \"WORKOUT\",\n Condition: () => isClassWork(Player.currentWork),\n },\n TOR: {\n ...achievementData[\"TOR\"],\n Icon: \"TOR\",\n Condition: () => Player.hasTorRouter(),\n },\n HOSPITALIZED: {\n ...achievementData[\"HOSPITALIZED\"],\n Icon: \"OUCH\",\n Condition: () => Player.moneySourceB.hospitalization !== 0,\n },\n GANG: {\n ...achievementData[\"GANG\"],\n Icon: \"GANG\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.gang !== null,\n },\n FULL_GANG: {\n ...achievementData[\"FULL_GANG\"],\n Icon: \"GANGMAX\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.gang !== null && Player.gang.members.length === GangConstants.MaximumGangMembers,\n },\n GANG_TERRITORY: {\n ...achievementData[\"GANG_TERRITORY\"],\n Icon: \"GANG100%\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.gang !== null && AllGangs[Player.gang.facName].territory >= 0.999,\n },\n GANG_MEMBER_POWER: {\n ...achievementData[\"GANG_MEMBER_POWER\"],\n Icon: \"GANG10000\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () =>\n Player.gang !== null &&\n Player.gang.members.some(\n (m) =>\n m.hack >= 10000 || m.str >= 10000 || m.def >= 10000 || m.dex >= 10000 || m.agi >= 10000 || m.cha >= 10000,\n ),\n },\n CORPORATION: {\n ...achievementData[\"CORPORATION\"],\n Icon: \"CORP\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.corporation !== null,\n },\n CORPORATION_BRIBE: {\n ...achievementData[\"CORPORATION_BRIBE\"],\n Icon: \"CORPLOBBY\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.corporation !== null && Player.corporation.unlockUpgrades[6] === 1,\n },\n CORPORATION_PROD_1000: {\n ...achievementData[\"CORPORATION_PROD_1000\"],\n Icon: \"CORP1000\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.corporation !== null && Player.corporation.divisions.some((d) => d.prodMult >= 1000),\n },\n CORPORATION_EMPLOYEE_3000: {\n ...achievementData[\"CORPORATION_EMPLOYEE_3000\"],\n Icon: \"CORPCITY\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: (): boolean => {\n if (Player.corporation === null) return false;\n for (const d of Player.corporation.divisions) {\n for (const o of Object.values(d.offices)) {\n if (o === 0) continue;\n if (o.employees.length >= 3000) return true;\n }\n }\n return false;\n },\n },\n CORPORATION_REAL_ESTATE: {\n ...achievementData[\"CORPORATION_REAL_ESTATE\"],\n Icon: \"CORPRE\",\n Name: \"Own the land\",\n Description: \"Expand to the Real Estate division.\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () =>\n Player.corporation !== null && Player.corporation.divisions.some((d) => d.type === Industries.RealEstate),\n },\n INTELLIGENCE_255: {\n ...achievementData[\"INTELLIGENCE_255\"],\n Icon: \"INT255\",\n Visible: () => hasAccessToSF(Player, 5),\n Condition: () => Player.skills.intelligence >= 255,\n },\n BLADEBURNER_DIVISION: {\n ...achievementData[\"BLADEBURNER_DIVISION\"],\n Icon: \"BLADE\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.bladeburner !== null,\n },\n BLADEBURNER_OVERCLOCK: {\n ...achievementData[\"BLADEBURNER_OVERCLOCK\"],\n Icon: \"BLADEOVERCLOCK\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () =>\n Player.bladeburner !== null &&\n Player.bladeburner.skills[SkillNames.Overclock] === Skills[SkillNames.Overclock].maxLvl,\n },\n BLADEBURNER_UNSPENT_100000: {\n ...achievementData[\"BLADEBURNER_UNSPENT_100000\"],\n Icon: \"BLADE100K\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.bladeburner !== null && Player.bladeburner.skillPoints >= 100000,\n },\n \"4S\": {\n ...achievementData[\"4S\"],\n Icon: \"4S\",\n Condition: () => Player.has4SData,\n },\n FIRST_HACKNET_SERVER: {\n ...achievementData[\"FIRST_HACKNET_SERVER\"],\n Icon: \"HASHNET\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => hasHacknetServers() && Player.hacknetNodes.length > 0,\n AdditionalUnlock: [achievementData.FIRST_HACKNET_NODE.ID],\n },\n ALL_HACKNET_SERVER: {\n ...achievementData[\"ALL_HACKNET_SERVER\"],\n Icon: \"HASHNETALL\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => hasHacknetServers() && Player.hacknetNodes.length === HacknetServerConstants.MaxServers,\n AdditionalUnlock: [achievementData[\"30_HACKNET_NODE\"].ID],\n },\n MAX_HACKNET_SERVER: {\n ...achievementData[\"MAX_HACKNET_SERVER\"],\n Icon: \"HASHNETALL\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: (): boolean => {\n if (!hasHacknetServers()) return false;\n for (const h of Player.hacknetNodes) {\n if (typeof h !== \"string\") return false;\n const hs = GetServer(h);\n if (!(hs instanceof HacknetServer)) return false;\n if (\n hs.maxRam === HacknetServerConstants.MaxRam &&\n hs.cores === HacknetServerConstants.MaxCores &&\n hs.level === HacknetServerConstants.MaxLevel &&\n hs.cache === HacknetServerConstants.MaxCache\n )\n return true;\n }\n return false;\n },\n AdditionalUnlock: [achievementData.MAX_HACKNET_NODE.ID],\n },\n HACKNET_SERVER_1B: {\n ...achievementData[\"HACKNET_SERVER_1B\"],\n Icon: \"HASHNETMONEY\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => hasHacknetServers() && Player.moneySourceB.hacknet >= 1e9,\n AdditionalUnlock: [achievementData.HACKNET_NODE_10M.ID],\n },\n MAX_CACHE: {\n ...achievementData[\"MAX_CACHE\"],\n Icon: \"HASHNETCAP\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () =>\n hasHacknetServers() &&\n Player.hashManager.hashes === Player.hashManager.capacity &&\n Player.hashManager.capacity > 0,\n },\n SLEEVE_8: {\n ...achievementData[\"SLEEVE_8\"],\n Icon: \"SLEEVE8\",\n Visible: () => hasAccessToSF(Player, 10),\n Condition: () => Player.sleeves.length === 8 && Player.sourceFileLvl(10) === 3,\n },\n INDECISIVE: {\n ...achievementData[\"INDECISIVE\"],\n Icon: \"1H\",\n Visible: () => knowsAboutBitverse(Player),\n Condition: (function () {\n let c = 0;\n setInterval(() => {\n if (Router.page() === Page.BitVerse) {\n c++;\n } else {\n c = 0;\n }\n }, 60 * 1000);\n return () => c > 60;\n })(),\n },\n FAST_BN: {\n ...achievementData[\"FAST_BN\"],\n Icon: \"2DAYS\",\n Visible: () => knowsAboutBitverse(Player),\n Condition: () => bitNodeFinishedState() && Player.playtimeSinceLastBitnode < 1000 * 60 * 60 * 24 * 2,\n },\n CHALLENGE_BN1: {\n ...achievementData[\"CHALLENGE_BN1\"],\n Icon: \"BN1+\",\n Visible: () => knowsAboutBitverse(Player),\n Condition: () =>\n Player.bitNodeN === 1 &&\n bitNodeFinishedState() &&\n Player.getHomeComputer().maxRam <= 128 &&\n Player.getHomeComputer().cpuCores === 1,\n },\n CHALLENGE_BN2: {\n ...achievementData[\"CHALLENGE_BN2\"],\n Icon: \"BN2+\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.bitNodeN === 2 && bitNodeFinishedState() && Player.gang === null,\n },\n CHALLENGE_BN3: {\n ...achievementData[\"CHALLENGE_BN3\"],\n Icon: \"BN3+\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.bitNodeN === 3 && bitNodeFinishedState() && Player.corporation === null,\n },\n CHALLENGE_BN6: {\n ...achievementData[\"CHALLENGE_BN6\"],\n Icon: \"BN6+\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.bitNodeN === 6 && bitNodeFinishedState() && Player.bladeburner === null,\n },\n CHALLENGE_BN7: {\n ...achievementData[\"CHALLENGE_BN7\"],\n Icon: \"BN7+\",\n Visible: () => hasAccessToSF(Player, 7),\n Condition: () => Player.bitNodeN === 7 && bitNodeFinishedState() && Player.bladeburner === null,\n },\n CHALLENGE_BN8: {\n ...achievementData[\"CHALLENGE_BN8\"],\n Icon: \"BN8+\",\n Visible: () => hasAccessToSF(Player, 8),\n Condition: () => Player.bitNodeN === 8 && bitNodeFinishedState() && !Player.has4SData && !Player.has4SDataTixApi,\n },\n CHALLENGE_BN9: {\n ...achievementData[\"CHALLENGE_BN9\"],\n Icon: \"BN9+\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () =>\n Player.bitNodeN === 9 &&\n bitNodeFinishedState() &&\n Player.moneySourceB.hacknet === 0 &&\n Player.moneySourceB.hacknet_expenses === 0,\n },\n CHALLENGE_BN10: {\n ...achievementData[\"CHALLENGE_BN10\"],\n Icon: \"BN10+\",\n Visible: () => hasAccessToSF(Player, 10),\n Condition: () =>\n Player.bitNodeN === 10 &&\n bitNodeFinishedState() &&\n !Player.sleeves.some(\n (s) =>\n s.augmentations.length > 0 ||\n s.exp.hacking > 0 ||\n s.exp.strength > 0 ||\n s.exp.defense > 0 ||\n s.exp.agility > 0 ||\n s.exp.dexterity > 0 ||\n s.exp.charisma > 0,\n ),\n },\n CHALLENGE_BN12: {\n ...achievementData[\"CHALLENGE_BN12\"],\n Icon: \"BN12+\",\n Visible: () => hasAccessToSF(Player, 12),\n Condition: () => Player.sourceFileLvl(12) >= 50,\n },\n BYPASS: {\n ...achievementData[\"BYPASS\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.Bypass),\n },\n PROTOTYPETAMPERING: {\n ...achievementData[\"PROTOTYPETAMPERING\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.PrototypeTampering),\n },\n UNCLICKABLE: {\n ...achievementData[\"UNCLICKABLE\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.Unclickable),\n },\n UNDOCUMENTEDFUNCTIONCALL: {\n ...achievementData[\"UNDOCUMENTEDFUNCTIONCALL\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.UndocumentedFunctionCall),\n },\n TIMECOMPRESSION: {\n ...achievementData[\"TIMECOMPRESSION\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.TimeCompression),\n },\n REALITYALTERATION: {\n ...achievementData[\"REALITYALTERATION\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.RealityAlteration),\n },\n N00DLES: {\n ...achievementData[\"N00DLES\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.N00dles),\n },\n EDITSAVEFILE: {\n ...achievementData[\"EDITSAVEFILE\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.EditSaveFile),\n },\n UNACHIEVABLE: {\n ...achievementData[\"UNACHIEVABLE\"],\n Icon: \"SF-1\",\n Secret: true,\n // Hey Players! Yes, you're supposed to modify this to get the achievement!\n Condition: () => false,\n },\n CHALLENGE_BN13: {\n ...achievementData[\"CHALLENGE_BN13\"],\n Icon: \"BN13+\",\n Visible: () => hasAccessToSF(Player, 13),\n Condition: () =>\n Player.bitNodeN === 13 &&\n bitNodeFinishedState() &&\n !Player.augmentations.some((a) => a.name === AugmentationNames.StaneksGift1),\n },\n DEVMENU: {\n ...achievementData[\"DEVMENU\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.YoureNotMeantToAccessThis),\n },\n RAINBOW: {\n ...achievementData[\"RAINBOW\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.INeedARainbow),\n },\n TRUE_RECURSION: {\n ...achievementData[\"TRUE_RECURSION\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.TrueRecursion),\n },\n};\n\n// Steam has a limit of 100 achievement. So these were planned but commented for now.\n// { ID: FactionNames.ECorp.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.ECorp) },\n// { ID: FactionNames.MegaCorp.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.MegaCorp) },\n// { ID: \"BACHMAN_&_ASSOCIATES\", Condition: () => Player.factions.includes(FactionNames.BachmanAssociates) },\n// { ID: \"BLADE_INDUSTRIES\", Condition: () => Player.factions.includes(FactionNames.BladeIndustries) },\n// { ID: FactionNames.NWO.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.NWO) },\n// { ID: \"CLARKE_INCORPORATED\", Condition: () => Player.factions.includes(FactionNames.ClarkeIncorporated) },\n// { ID: \"OMNITEK_INCORPORATED\", Condition: () => Player.factions.includes(FactionNames.OmniTekIncorporated) },\n// { ID: \"FOUR_SIGMA\", Condition: () => Player.factions.includes(FactionNames.FourSigma) },\n// { ID: \"KUAIGONG_INTERNATIONAL\", Condition: () => Player.factions.includes(FactionNames.KuaiGongInternational) },\n// { ID: \"FULCRUM_SECRET_TECHNOLOGIES\", Condition: () => Player.factions.includes(FactionNames.FulcrumSecretTechnologies) },\n// { ID: FactionNames.Aevum.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Aevum) },\n// { ID: FactionNames.Chongqing.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Chongqing) },\n// { ID: FactionNames.Ishima.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Ishima) },\n// { ID: \"NEW_TOKYO\", Condition: () => Player.factions.includes(FactionNames.NewTokyo) },\n// { ID: \"SECTOR-12\", Condition: () => Player.factions.includes(FactionNames.Sector12) },\n// { ID: FactionNames.Volhaven.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Volhaven) },\n// { ID: \"SPEAKERS_FOR_THE_DEAD\", Condition: () => Player.factions.includes(FactionNames.SpeakersForTheDead) },\n// { ID: \"THE_DARK_ARMY\", Condition: () => Player.factions.includes(FactionNames.TheDarkArmy) },\n// { ID: \"THE_SYNDICATE\", Condition: () => Player.factions.includes(FactionNames.TheSyndicate) },\n// { ID: FactionNames.Silhouette.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Silhouette) },\n// { ID: FactionNames.Tetrads.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Tetrads) },\n// { ID: \"SLUM_SNAKES\", Condition: () => Player.factions.includes(FactionNames.SlumSnakes) },\n// { ID: FactionNames.Netburners.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Netburners) },\n// { ID: \"TIAN_DI_HUI\", Condition: () => Player.factions.includes(FactionNames.TianDiHui) },\n// { ID: FactionNames.Bladeburners.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Bladeburners) },\n// { ID: \"DEEPSCANV1.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.DeepscanV1.name) },\n// { ID: \"DEEPSCANV2.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.DeepscanV2.name) },\n// { ID: \"INFILTRATORS\", Condition: () => Player.factions.includes(FactionNames.Infiltrators) },\n// {\n// ID: \"SERVERPROFILER.EXE\",\n// Condition: () => Player.getHomeComputer().programs.includes(Programs.ServerProfiler.name),\n// },\n// { ID: \"AUTOLINK.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.AutoLink.name) },\n// { ID: \"FLIGHT.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.Flight.name) },\n\nexport function calculateAchievements(): void {\n const playerAchievements = Player.achievements.map((a) => a.ID);\n\n const missingAchievements = Object.values(achievements)\n .filter((a) => !playerAchievements.includes(a.ID) && a.Condition())\n // callback returns array of achievement id and id of any in the additional list, flatmap means we have only a 1D array\n .flatMap((a) => [a.ID, ...(a.AdditionalUnlock || [])]);\n\n for (const id of missingAchievements) {\n Player.giveAchievement(id);\n }\n\n // Write all player's achievements to document for Steam/Electron\n // This could be replaced by \"availableAchievements\"\n // if we don't want to grant the save game achievements to steam but only currently available\n document.achievements = [...Player.achievements.map((a) => a.ID)];\n}\n","import React from \"react\";\nimport { MathJax, MathJaxContext } from \"better-react-mathjax\";\n\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport function MathJaxWrapper({ children }: IProps): React.ReactElement {\n return (\n <MathJaxContext version={3} src={\"dist/ext/MathJax-3.2.0/es5/tex-chtml.js\"}>\n <MathJax>{children}</MathJax>\n </MathJaxContext>\n );\n}\n","import { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\ninterface IError {\n fileName?: string;\n lineNumber?: number;\n}\n\nexport const isIError = (v: unknown): v is IError => {\n if (typeof v !== \"object\" || v == null) return false;\n return v.hasOwnProperty(\"fileName\") && v.hasOwnProperty(\"lineNumber\");\n};\n\nexport function exceptionAlert(e: unknown): void {\n console.error(e);\n let msg = \"\";\n let file = \"UNKNOWN FILE NAME\";\n let line = \"UNKNOWN LINE NUMBER\";\n if (isIError(e)) {\n file = e.fileName ?? file;\n line = e.lineNumber?.toString() ?? line;\n } else {\n msg = String(e);\n }\n dialogBoxCreate(\n \"Caught an exception: \" +\n msg +\n \"<br><br>\" +\n \"Filename: \" +\n file +\n \"<br><br>\" +\n \"Line Number: \" +\n line +\n \"<br><br>\" +\n \"This is a bug, please report to game developer with this \" +\n \"message as well as details about how to reproduce the bug.<br><br>\" +\n \"If you want to be safe, I suggest refreshing the game WITHOUT saving so that your \" +\n \"save doesn't get corrupted\",\n );\n}\n","export interface CorporationUnlockUpgrade {\n index: number;\n price: number;\n name: string;\n desc: string;\n}\n\nexport enum CorporationUnlockUpgradeIndex {\n Export = 0,\n SmartSupply = 1,\n MarketResearchDemand = 2,\n MarketDataCompetition = 3,\n VeChain = 4,\n ShadyAccounting = 5,\n GovernmentPartnership = 6,\n WarehouseAPI = 7,\n OfficeAPI = 8,\n}\n\n// Corporation Unlock Upgrades\n// Upgrades for entire corporation, unlocks features, either you have it or you don't.\nexport const CorporationUnlockUpgrades: Record<CorporationUnlockUpgradeIndex, CorporationUnlockUpgrade> = {\n //Lets you export goods\n [CorporationUnlockUpgradeIndex.Export]: {\n index: 0,\n price: 20e9,\n name: \"Export\",\n desc:\n \"Develop infrastructure to export your materials to your other facilities. \" +\n \"This allows you to move materials around between different divisions and cities.\",\n },\n\n //Lets you buy exactly however many required materials you need for production\n [CorporationUnlockUpgradeIndex.SmartSupply]: {\n index: 1,\n price: 25e9,\n name: \"Smart Supply\",\n desc:\n \"Use advanced AI to anticipate your supply needs. \" +\n \"This allows you to purchase exactly however many materials you need for production.\",\n },\n\n //Displays each material/product's demand\n [CorporationUnlockUpgradeIndex.MarketResearchDemand]: {\n index: 2,\n price: 5e9,\n name: \"Market Research - Demand\",\n desc:\n \"Mine and analyze market data to determine the demand of all resources. \" +\n \"The demand attribute, which affects sales, will be displayed for every material and product.\",\n },\n\n //Display's each material/product's competition\n [CorporationUnlockUpgradeIndex.MarketDataCompetition]: {\n index: 3,\n price: 5e9,\n name: \"Market Data - Competition\",\n desc:\n \"Mine and analyze market data to determine how much competition there is on the market \" +\n \"for all resources. The competition attribute, which affects sales, will be displayed for \" +\n \"every material and product.\",\n },\n [CorporationUnlockUpgradeIndex.VeChain]: {\n index: 4,\n price: 10e9,\n name: \"VeChain\",\n desc:\n \"Use AI and blockchain technology to identify where you can improve your supply chain systems. \" +\n \"This upgrade will allow you to view a wide array of useful statistics about your \" +\n \"Corporation.\",\n },\n [CorporationUnlockUpgradeIndex.ShadyAccounting]: {\n index: 5,\n price: 500e12,\n name: \"Shady Accounting\",\n desc:\n \"Utilize unscrupulous accounting practices and pay off government officials to save money \" +\n \"on taxes. This reduces the dividend tax rate by 5%.\",\n },\n [CorporationUnlockUpgradeIndex.GovernmentPartnership]: {\n index: 6,\n price: 2e15,\n name: \"Government Partnership\",\n desc:\n \"Help national governments further their agendas in exchange for lowered taxes. \" +\n \"This reduces the dividend tax rate by 10%\",\n },\n [CorporationUnlockUpgradeIndex.WarehouseAPI]: {\n index: 7,\n price: 50e9,\n name: \"Warehouse API\",\n desc: \"Enables the warehouse API.\",\n },\n [CorporationUnlockUpgradeIndex.OfficeAPI]: {\n index: 8,\n price: 50e9,\n name: \"Office API\",\n desc: \"Enables the office API.\",\n },\n};\n","import { StaticAugmentations } from \"../../Augmentation/StaticAugmentations\";\nimport { GraftableAugmentation } from \"./GraftableAugmentation\";\nimport { Player } from \"@player\";\n\nexport const getGraftingAvailableAugs = (): string[] => {\n const augs: string[] = [];\n\n for (const [augName, aug] of Object.entries(StaticAugmentations)) {\n if (aug.isSpecial) continue;\n augs.push(augName);\n }\n\n return augs.filter((augmentation: string) => !Player.hasAugmentation(augmentation));\n};\n\nexport const graftingIntBonus = (): number => {\n return 1 + (Player.getIntelligenceBonus(3) - 1) / 3;\n};\n\nexport const calculateGraftingTimeWithBonus = (aug: GraftableAugmentation): number => {\n const baseTime = aug.time;\n return baseTime / graftingIntBonus();\n};\n","import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\ninterface IParams {\n name?: string;\n type?: number;\n}\n\nexport class ActionIdentifier {\n name = \"\";\n type = -1;\n\n constructor(params: IParams = {}) {\n if (params.name) this.name = params.name;\n if (params.type) this.type = params.type;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"ActionIdentifier\", this);\n }\n\n static fromJSON(value: IReviverValue): ActionIdentifier {\n return Generic_fromJSON(ActionIdentifier, value.data);\n }\n}\n\nReviver.constructors.ActionIdentifier = ActionIdentifier;\n","import { BlackOperation } from \"./BlackOperation\";\nimport { BlackOperationNames } from \"./data/BlackOperationNames\";\n\nexport const BlackOperations: Record<string, BlackOperation> = {};\n\n(function () {\n BlackOperations[BlackOperationNames.OperationTyphoon] = new BlackOperation({\n name: BlackOperationNames.OperationTyphoon,\n baseDifficulty: 2000,\n reqdRank: 2.5e3,\n rankGain: 50,\n rankLoss: 10,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationZero] = new BlackOperation({\n name: BlackOperationNames.OperationZero,\n baseDifficulty: 2500,\n reqdRank: 5e3,\n rankGain: 60,\n rankLoss: 15,\n hpLoss: 50,\n weights: {\n hack: 0.2,\n str: 0.15,\n def: 0.15,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[BlackOperationNames.OperationX] = new BlackOperation({\n name: BlackOperationNames.OperationX,\n baseDifficulty: 3000,\n reqdRank: 7.5e3,\n rankGain: 75,\n rankLoss: 15,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationTitan] = new BlackOperation({\n name: BlackOperationNames.OperationTitan,\n baseDifficulty: 4000,\n reqdRank: 10e3,\n rankGain: 100,\n rankLoss: 20,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationAres] = new BlackOperation({\n name: BlackOperationNames.OperationAres,\n baseDifficulty: 5000,\n reqdRank: 12.5e3,\n rankGain: 125,\n rankLoss: 20,\n hpLoss: 200,\n weights: {\n hack: 0,\n str: 0.25,\n def: 0.25,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationArchangel] = new BlackOperation({\n name: BlackOperationNames.OperationArchangel,\n baseDifficulty: 7500,\n reqdRank: 15e3,\n rankGain: 200,\n rankLoss: 20,\n hpLoss: 25,\n weights: {\n hack: 0,\n str: 0.2,\n def: 0.2,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationJuggernaut] = new BlackOperation({\n name: BlackOperationNames.OperationJuggernaut,\n baseDifficulty: 10e3,\n reqdRank: 20e3,\n rankGain: 300,\n rankLoss: 40,\n hpLoss: 300,\n weights: {\n hack: 0,\n str: 0.25,\n def: 0.25,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationRedDragon] = new BlackOperation({\n name: BlackOperationNames.OperationRedDragon,\n baseDifficulty: 12.5e3,\n reqdRank: 25e3,\n rankGain: 500,\n rankLoss: 50,\n hpLoss: 500,\n weights: {\n hack: 0.05,\n str: 0.2,\n def: 0.2,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationK] = new BlackOperation({\n name: BlackOperationNames.OperationK,\n baseDifficulty: 15e3,\n reqdRank: 30e3,\n rankGain: 750,\n rankLoss: 60,\n hpLoss: 1000,\n weights: {\n hack: 0.05,\n str: 0.2,\n def: 0.2,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationDeckard] = new BlackOperation({\n name: BlackOperationNames.OperationDeckard,\n baseDifficulty: 20e3,\n reqdRank: 40e3,\n rankGain: 1e3,\n rankLoss: 75,\n hpLoss: 200,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationTyrell] = new BlackOperation({\n name: BlackOperationNames.OperationTyrell,\n baseDifficulty: 25e3,\n reqdRank: 50e3,\n rankGain: 1.5e3,\n rankLoss: 100,\n hpLoss: 500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationWallace] = new BlackOperation({\n name: BlackOperationNames.OperationWallace,\n baseDifficulty: 30e3,\n reqdRank: 75e3,\n rankGain: 2e3,\n rankLoss: 150,\n hpLoss: 1500,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationShoulderOfOrion] = new BlackOperation({\n name: BlackOperationNames.OperationShoulderOfOrion,\n baseDifficulty: 35e3,\n reqdRank: 100e3,\n rankGain: 2.5e3,\n rankLoss: 500,\n hpLoss: 1500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[BlackOperationNames.OperationHyron] = new BlackOperation({\n name: BlackOperationNames.OperationHyron,\n baseDifficulty: 40e3,\n reqdRank: 125e3,\n rankGain: 3e3,\n rankLoss: 1e3,\n hpLoss: 500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationMorpheus] = new BlackOperation({\n name: BlackOperationNames.OperationMorpheus,\n baseDifficulty: 45e3,\n reqdRank: 150e3,\n rankGain: 4e3,\n rankLoss: 1e3,\n hpLoss: 100,\n weights: {\n hack: 0.05,\n str: 0.15,\n def: 0.15,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[BlackOperationNames.OperationIonStorm] = new BlackOperation({\n name: BlackOperationNames.OperationIonStorm,\n baseDifficulty: 50e3,\n reqdRank: 175e3,\n rankGain: 5e3,\n rankLoss: 1e3,\n hpLoss: 5000,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationAnnihilus] = new BlackOperation({\n name: BlackOperationNames.OperationAnnihilus,\n baseDifficulty: 55e3,\n reqdRank: 200e3,\n rankGain: 7.5e3,\n rankLoss: 1e3,\n hpLoss: 10e3,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationUltron] = new BlackOperation({\n name: BlackOperationNames.OperationUltron,\n baseDifficulty: 60e3,\n reqdRank: 250e3,\n rankGain: 10e3,\n rankLoss: 2e3,\n hpLoss: 10e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationCenturion] = new BlackOperation({\n name: BlackOperationNames.OperationCenturion,\n baseDifficulty: 70e3,\n reqdRank: 300e3,\n rankGain: 15e3,\n rankLoss: 5e3,\n hpLoss: 10e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n BlackOperations[BlackOperationNames.OperationVindictus] = new BlackOperation({\n name: BlackOperationNames.OperationVindictus,\n baseDifficulty: 75e3,\n reqdRank: 350e3,\n rankGain: 20e3,\n rankLoss: 20e3,\n hpLoss: 20e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n BlackOperations[BlackOperationNames.OperationDaedalus] = new BlackOperation({\n name: BlackOperationNames.OperationDaedalus,\n baseDifficulty: 80e3,\n reqdRank: 400e3,\n rankGain: 40e3,\n rankLoss: 10e3,\n hpLoss: 100e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n})();\n","import { Fragment, FragmentById } from \"./Fragment\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IActiveFragmentParams {\n x: number;\n y: number;\n rotation: number;\n fragment: Fragment;\n}\n\nexport class ActiveFragment {\n id: number;\n highestCharge: number;\n numCharge: number;\n rotation: number;\n x: number;\n y: number;\n\n constructor(params?: IActiveFragmentParams) {\n if (params) {\n this.id = params.fragment.id;\n this.x = params.x;\n this.y = params.y;\n this.highestCharge = 0;\n this.numCharge = 0;\n this.rotation = params.rotation;\n } else {\n this.id = -1;\n this.x = -1;\n this.y = -1;\n this.highestCharge = 0;\n this.numCharge = 0;\n this.rotation = 0;\n }\n }\n\n collide(other: ActiveFragment): boolean {\n const thisFragment = this.fragment();\n const otherFragment = other.fragment();\n // These 2 variables converts 'this' local coordinates to world to other local.\n const dx: number = other.x - this.x;\n const dy: number = other.y - this.y;\n const fragSize = Math.max(thisFragment.shape.length, thisFragment.shape[0].length);\n for (let j = 0; j < fragSize; j++) {\n for (let i = 0; i < fragSize; i++) {\n if (thisFragment.fullAt(i, j, this.rotation) && otherFragment.fullAt(i - dx, j - dy, other.rotation))\n return true;\n }\n }\n\n return false;\n }\n\n fragment(): Fragment {\n const fragment = FragmentById(this.id);\n if (fragment === null) throw new Error(\"ActiveFragment id refers to unknown Fragment.\");\n return fragment;\n }\n\n fullAt(worldX: number, worldY: number): boolean {\n return this.fragment().fullAt(worldX - this.x, worldY - this.y, this.rotation);\n }\n\n neighbors(): number[][] {\n return this.fragment()\n .neighbors(this.rotation)\n .map((cell) => [this.x + cell[0], this.y + cell[1]]);\n }\n\n copy(): ActiveFragment {\n return Object.assign({}, this);\n }\n\n /** Serialize an active fragment to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"ActiveFragment\", this);\n }\n\n /** Initializes an active fragment from a JSON save state */\n static fromJSON(value: IReviverValue): ActiveFragment {\n return Generic_fromJSON(ActiveFragment, value.data);\n }\n}\n\nReviver.constructors.ActiveFragment = ActiveFragment;\n","export enum GameOptionsTab {\n SYSTEM,\n INTERFACE,\n GAMEPLAY,\n MISC,\n REMOTE_API,\n}\n","import { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\ninterface ISkillParams {\n name: string;\n desc: string;\n\n baseCost?: number;\n costInc?: number;\n maxLvl?: number;\n\n successChanceAll?: number;\n successChanceStealth?: number;\n successChanceKill?: number;\n successChanceContract?: number;\n successChanceOperation?: number;\n successChanceEstimate?: number;\n\n actionTime?: number;\n\n effHack?: number;\n effStr?: number;\n effDef?: number;\n effDex?: number;\n effAgi?: number;\n effCha?: number;\n\n stamina?: number;\n money?: number;\n expGain?: number;\n}\n\nexport class Skill {\n name: string;\n desc: string;\n // Cost is in Skill Points\n baseCost = 1;\n // Additive cost increase per level\n costInc = 1;\n maxLvl = 0;\n\n /**\n * These benefits are additive. So total multiplier will be level (handled externally) times the\n * effects below\n */\n successChanceAll = 0;\n successChanceStealth = 0;\n successChanceKill = 0;\n successChanceContract = 0;\n successChanceOperation = 0;\n\n /**\n * This multiplier affects everything that increases synthoid population/community estimate\n * e.g. Field analysis, Investigation Op, Undercover Op\n */\n successChanceEstimate = 0;\n actionTime = 0;\n effHack = 0;\n effStr = 0;\n effDef = 0;\n effDex = 0;\n effAgi = 0;\n effCha = 0;\n stamina = 0;\n money = 0;\n expGain = 0;\n\n constructor(params: ISkillParams = { name: \"foo\", desc: \"foo\" }) {\n if (!params.name) {\n throw new Error(\"Failed to initialize Bladeburner Skill. No name was specified in ctor\");\n }\n if (!params.desc) {\n throw new Error(\"Failed to initialize Bladeburner Skills. No desc was specified in ctor\");\n }\n this.name = params.name;\n this.desc = params.desc;\n this.baseCost = params.baseCost ? params.baseCost : 1;\n this.costInc = params.costInc ? params.costInc : 1;\n\n if (params.maxLvl) {\n this.maxLvl = params.maxLvl;\n }\n\n if (params.successChanceAll) {\n this.successChanceAll = params.successChanceAll;\n }\n if (params.successChanceStealth) {\n this.successChanceStealth = params.successChanceStealth;\n }\n if (params.successChanceKill) {\n this.successChanceKill = params.successChanceKill;\n }\n if (params.successChanceContract) {\n this.successChanceContract = params.successChanceContract;\n }\n if (params.successChanceOperation) {\n this.successChanceOperation = params.successChanceOperation;\n }\n\n if (params.successChanceEstimate) {\n this.successChanceEstimate = params.successChanceEstimate;\n }\n\n if (params.actionTime) {\n this.actionTime = params.actionTime;\n }\n if (params.effHack) {\n this.effHack = params.effHack;\n }\n if (params.effStr) {\n this.effStr = params.effStr;\n }\n if (params.effDef) {\n this.effDef = params.effDef;\n }\n if (params.effDex) {\n this.effDex = params.effDex;\n }\n if (params.effAgi) {\n this.effAgi = params.effAgi;\n }\n if (params.effCha) {\n this.effCha = params.effCha;\n }\n\n if (params.stamina) {\n this.stamina = params.stamina;\n }\n if (params.money) {\n this.money = params.money;\n }\n if (params.expGain) {\n this.expGain = params.expGain;\n }\n }\n\n calculateCost(currentLevel: number, count = 1): number {\n //Recursive mode does not handle invalid inputs properly, but it should never\n //be possible for it to run with them. For the sake of not crashing the game,\n const recursiveMode = (currentLevel: number, count: number): number => {\n if (count <= 1) {\n return Math.floor((this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost);\n } else {\n const thisUpgrade = Math.floor(\n (this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost,\n );\n return this.calculateCost(currentLevel + 1, count - 1) + thisUpgrade;\n }\n };\n\n //Count must be a positive integer.\n if (count < 0 || count % 1 != 0) {\n throw new Error(`${count} is an invalid number of upgrades`);\n }\n //Use recursive mode if count is small\n if (count <= 100) {\n return recursiveMode(currentLevel, count);\n }\n //Use optimized mode if count is large\n else {\n //unFloored is roughly equivalent to\n //(this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost\n //being repeated for increasing currentLevel\n const preMult = (count * (2 * this.baseCost + this.costInc * (2 * currentLevel + count + 1))) / 2;\n const unFloored = preMult * BitNodeMultipliers.BladeburnerSkillCost - count / 2;\n return Math.floor(unFloored);\n }\n }\n\n getMultiplier(name: string): number {\n if (name === \"successChanceAll\") return this.successChanceAll;\n if (name === \"successChanceStealth\") return this.successChanceStealth;\n if (name === \"successChanceKill\") return this.successChanceKill;\n if (name === \"successChanceContract\") return this.successChanceContract;\n if (name === \"successChanceOperation\") return this.successChanceOperation;\n if (name === \"successChanceEstimate\") return this.successChanceEstimate;\n\n if (name === \"actionTime\") return this.actionTime;\n\n if (name === \"effHack\") return this.effHack;\n if (name === \"effStr\") return this.effStr;\n if (name === \"effDef\") return this.effDef;\n if (name === \"effDex\") return this.effDex;\n if (name === \"effAgi\") return this.effAgi;\n if (name === \"effCha\") return this.effCha;\n\n if (name === \"stamina\") return this.stamina;\n if (name === \"money\") return this.money;\n if (name === \"expGain\") return this.expGain;\n return 0;\n }\n}\n","import { CONSTANTS } from \"../Constants\";\nimport { Player } from \"@player\";\nimport { Person } from \"../PersonObjects/Person\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { CrimeType } from \"../utils/WorkType\";\nimport { CrimeWork } from \"../Work/CrimeWork\";\n\ninterface IConstructorParams {\n hacking_success_weight?: number;\n strength_success_weight?: number;\n defense_success_weight?: number;\n dexterity_success_weight?: number;\n agility_success_weight?: number;\n charisma_success_weight?: number;\n hacking_exp?: number;\n strength_exp?: number;\n defense_exp?: number;\n dexterity_exp?: number;\n agility_exp?: number;\n charisma_exp?: number;\n intelligence_exp?: number;\n\n kills?: number;\n}\n\nexport class Crime {\n // Number representing the difficulty of the crime. Used for success chance calculations\n difficulty = 0;\n\n // Amount of karma lost for SUCCESSFULLY committing this crime\n karma = 0;\n\n // How many people die as a result of this crime\n kills = 0;\n\n // How much money is given by the\n money = 0;\n\n // Name of crime\n name = \"\";\n\n // Name of crime as it appears on work screen: \"You are attempting...\"\n workName = \"\";\n\n // Milliseconds it takes to attempt the crime\n time = 0;\n\n // Corresponding type in CONSTANTS. Contains a description for the crime activity\n type: CrimeType;\n\n // Weighting factors that determine how stats affect the success rate of this crime\n hacking_success_weight = 0;\n strength_success_weight = 0;\n defense_success_weight = 0;\n dexterity_success_weight = 0;\n agility_success_weight = 0;\n charisma_success_weight = 0;\n\n // How much stat experience is granted by this crime\n hacking_exp = 0;\n strength_exp = 0;\n defense_exp = 0;\n dexterity_exp = 0;\n agility_exp = 0;\n charisma_exp = 0;\n intelligence_exp = 0;\n\n constructor(\n name = \"\",\n workName = \"\",\n type: CrimeType,\n time = 0,\n money = 0,\n difficulty = 0,\n karma = 0,\n params: IConstructorParams = {},\n ) {\n this.name = name;\n this.workName = workName;\n this.type = type;\n this.time = time;\n this.money = money;\n this.difficulty = difficulty;\n this.karma = karma;\n\n this.hacking_success_weight = params.hacking_success_weight ? params.hacking_success_weight : 0;\n this.strength_success_weight = params.strength_success_weight ? params.strength_success_weight : 0;\n this.defense_success_weight = params.defense_success_weight ? params.defense_success_weight : 0;\n this.dexterity_success_weight = params.dexterity_success_weight ? params.dexterity_success_weight : 0;\n this.agility_success_weight = params.agility_success_weight ? params.agility_success_weight : 0;\n this.charisma_success_weight = params.charisma_success_weight ? params.charisma_success_weight : 0;\n\n this.hacking_exp = params.hacking_exp ? params.hacking_exp : 0;\n this.strength_exp = params.strength_exp ? params.strength_exp : 0;\n this.defense_exp = params.defense_exp ? params.defense_exp : 0;\n this.dexterity_exp = params.dexterity_exp ? params.dexterity_exp : 0;\n this.agility_exp = params.agility_exp ? params.agility_exp : 0;\n this.charisma_exp = params.charisma_exp ? params.charisma_exp : 0;\n this.intelligence_exp = params.intelligence_exp ? params.intelligence_exp : 0;\n\n this.kills = params.kills ? params.kills : 0;\n }\n\n commit(div = 1, workerScript: WorkerScript | null = null): number {\n if (div <= 0) {\n div = 1;\n }\n Player.startWork(\n new CrimeWork({\n crimeType: this.type,\n singularity: workerScript !== null,\n }),\n );\n\n return this.time;\n }\n\n successRate(p: Person): number {\n let chance: number =\n this.hacking_success_weight * p.skills.hacking +\n this.strength_success_weight * p.skills.strength +\n this.defense_success_weight * p.skills.defense +\n this.dexterity_success_weight * p.skills.dexterity +\n this.agility_success_weight * p.skills.agility +\n this.charisma_success_weight * p.skills.charisma +\n CONSTANTS.IntelligenceCrimeWeight * p.skills.intelligence;\n chance /= CONSTANTS.MaxSkillLevel;\n chance /= this.difficulty;\n chance *= p.mults.crime_success;\n chance *= p.getIntelligenceBonus(1);\n\n return Math.min(chance, 1);\n }\n}\n","import { Person } from \"./Person\";\nimport { calculateSkill } from \"./formulas/skill\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Player } from \"@player\";\nimport { WorkStats } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport function gainHackingExp(this: Person, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainHackingExp()\");\n return;\n }\n this.exp.hacking += exp;\n if (this.exp.hacking < 0) {\n this.exp.hacking = 0;\n }\n\n this.skills.hacking = calculateSkill(\n this.exp.hacking,\n this.mults.hacking * BitNodeMultipliers.HackingLevelMultiplier,\n );\n}\n\nexport function gainStrengthExp(this: Person, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainStrengthExp()\");\n return;\n }\n this.exp.strength += exp;\n if (this.exp.strength < 0) {\n this.exp.strength = 0;\n }\n\n this.skills.strength = calculateSkill(\n this.exp.strength,\n this.mults.strength * BitNodeMultipliers.StrengthLevelMultiplier,\n );\n}\n\nexport function gainDefenseExp(this: Person, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into player.gainDefenseExp()\");\n return;\n }\n this.exp.defense += exp;\n if (this.exp.defense < 0) {\n this.exp.defense = 0;\n }\n\n this.skills.defense = calculateSkill(\n this.exp.defense,\n this.mults.defense * BitNodeMultipliers.DefenseLevelMultiplier,\n );\n const ratio = this.hp.current / this.hp.max;\n this.hp = {\n max: Math.floor(10 + this.skills.defense / 10),\n current: Math.round(this.hp.max * ratio),\n };\n}\n\nexport function gainDexterityExp(this: Person, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainDexterityExp()\");\n return;\n }\n this.exp.dexterity += exp;\n if (this.exp.dexterity < 0) {\n this.exp.dexterity = 0;\n }\n\n this.skills.dexterity = calculateSkill(\n this.exp.dexterity,\n this.mults.dexterity * BitNodeMultipliers.DexterityLevelMultiplier,\n );\n}\n\nexport function gainAgilityExp(this: Person, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainAgilityExp()\");\n return;\n }\n this.exp.agility += exp;\n if (this.exp.agility < 0) {\n this.exp.agility = 0;\n }\n\n this.skills.agility = calculateSkill(\n this.exp.agility,\n this.mults.agility * BitNodeMultipliers.AgilityLevelMultiplier,\n );\n}\n\nexport function gainCharismaExp(this: Person, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainCharismaExp()\");\n return;\n }\n this.exp.charisma += exp;\n if (this.exp.charisma < 0) {\n this.exp.charisma = 0;\n }\n\n this.skills.charisma = calculateSkill(\n this.exp.charisma,\n this.mults.charisma * BitNodeMultipliers.CharismaLevelMultiplier,\n );\n}\n\nexport function gainIntelligenceExp(this: Person, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERROR: NaN passed into Player.gainIntelligenceExp()\");\n return;\n }\n if (Player.sourceFileLvl(5) > 0 || this.skills.intelligence > 0 || Player.bitNodeN === 5) {\n this.exp.intelligence += exp;\n this.skills.intelligence = Math.floor(this.calculateSkill(this.exp.intelligence, 1));\n }\n}\nexport function gainStats(this: Person, retValue: WorkStats): void {\n this.gainHackingExp(retValue.hackExp * this.mults.hacking_exp);\n this.gainStrengthExp(retValue.strExp * this.mults.strength_exp);\n this.gainDefenseExp(retValue.defExp * this.mults.defense_exp);\n this.gainDexterityExp(retValue.dexExp * this.mults.dexterity_exp);\n this.gainAgilityExp(retValue.agiExp * this.mults.agility_exp);\n this.gainCharismaExp(retValue.chaExp * this.mults.charisma_exp);\n this.gainIntelligenceExp(retValue.intExp);\n}\n\n//Given a string expression like \"str\" or \"strength\", returns the given stat\nexport function queryStatFromString(this: Person, str: string): number {\n const tempStr = str.toLowerCase();\n if (tempStr.includes(\"hack\")) {\n return this.skills.hacking;\n }\n if (tempStr.includes(\"str\")) {\n return this.skills.strength;\n }\n if (tempStr.includes(\"def\")) {\n return this.skills.defense;\n }\n if (tempStr.includes(\"dex\")) {\n return this.skills.dexterity;\n }\n if (tempStr.includes(\"agi\")) {\n return this.skills.agility;\n }\n if (tempStr.includes(\"cha\")) {\n return this.skills.charisma;\n }\n if (tempStr.includes(\"int\")) {\n return this.skills.intelligence;\n }\n return 0;\n}\n\nexport function regenerateHp(this: Person, amt: number): void {\n if (typeof amt !== \"number\") {\n console.warn(`Player.regenerateHp() called without a numeric argument: ${amt}`);\n return;\n }\n this.hp.current += amt;\n if (this.hp.current > this.hp.max) {\n this.hp.current = this.hp.max;\n }\n}\n\nexport function updateSkillLevels(this: Person): void {\n this.skills.hacking = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.exp.hacking, this.mults.hacking * BitNodeMultipliers.HackingLevelMultiplier)),\n );\n this.skills.strength = Math.max(\n 1,\n Math.floor(\n this.calculateSkill(this.exp.strength, this.mults.strength * BitNodeMultipliers.StrengthLevelMultiplier),\n ),\n );\n this.skills.defense = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.exp.defense, this.mults.defense * BitNodeMultipliers.DefenseLevelMultiplier)),\n );\n this.skills.dexterity = Math.max(\n 1,\n Math.floor(\n this.calculateSkill(this.exp.dexterity, this.mults.dexterity * BitNodeMultipliers.DexterityLevelMultiplier),\n ),\n );\n this.skills.agility = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.exp.agility, this.mults.agility * BitNodeMultipliers.AgilityLevelMultiplier)),\n );\n this.skills.charisma = Math.max(\n 1,\n Math.floor(\n this.calculateSkill(this.exp.charisma, this.mults.charisma * BitNodeMultipliers.CharismaLevelMultiplier),\n ),\n );\n\n const ratio: number = this.hp.current / this.hp.max;\n this.hp = {\n max: Math.floor(10 + this.skills.defense / 10),\n current: Math.round(this.hp.max * ratio),\n };\n}\n\nexport function hasAugmentation(this: Person, augName: string, ignoreQueued = false) {\n if (this.augmentations.some((a) => a.name === augName)) {\n return true;\n }\n if (!ignoreQueued && this.queuedAugmentations.some((a) => a.name === augName)) {\n return true;\n }\n return false;\n}\n","import React, { useState, useEffect } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Modal } from \"./Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport { sha256 } from \"js-sha256\";\n\nexport const AlertEvents = new EventEmitter<[string | JSX.Element]>();\n\ninterface Alert {\n id: string;\n text: string | JSX.Element;\n hash: string;\n}\n\nlet i = 0;\nexport function AlertManager(): React.ReactElement {\n const [alerts, setAlerts] = useState<Alert[]>([]);\n useEffect(\n () =>\n AlertEvents.subscribe((text: string | JSX.Element) => {\n const id = i + \"\";\n i++;\n setAlerts((old) => {\n const hash = getMessageHash(text);\n if (old.some((a) => a.hash === hash)) {\n return old;\n }\n return [\n ...old,\n {\n id: id,\n text: text,\n hash: hash,\n },\n ];\n });\n }),\n [],\n );\n\n useEffect(() => {\n function handle(this: Document, event: KeyboardEvent): void {\n if (event.code === \"Escape\") {\n setAlerts([]);\n }\n }\n document.addEventListener(\"keydown\", handle);\n return () => document.removeEventListener(\"keydown\", handle);\n }, []);\n\n function getMessageHash(text: string | JSX.Element): string {\n if (typeof text === \"string\") return sha256(text);\n return sha256(JSON.stringify(text.props));\n }\n\n function close(): void {\n setAlerts((old) => {\n return old.slice(1, 1e99);\n });\n }\n\n return (\n <>\n {alerts.length > 0 && (\n <Modal open={true} onClose={close}>\n <Box overflow=\"scroll\" sx={{ overflowWrap: \"break-word\", whiteSpace: \"pre-line\" }}>\n <Typography component={\"span\"}>{alerts[0].text}</Typography>\n </Box>\n </Modal>\n )}\n </>\n );\n}\n","/**\n * Returns the input array as a comma separated string.\n *\n * Does several things that Array.toString() doesn't do\n * - Adds brackets around the array\n * - Adds quotation marks around strings\n */\nexport function arrayToString(a: unknown[]): string {\n const vals: unknown[] = [];\n for (let i = 0; i < a.length; ++i) {\n let elem: unknown = a[i];\n if (Array.isArray(elem)) {\n elem = arrayToString(elem);\n } else if (typeof elem === \"string\") {\n elem = `\"${elem}\"`;\n }\n vals.push(elem);\n }\n\n return `[${vals.join(\", \")}]`;\n}\n","import { Factions } from \"./Faction/Factions\";\nimport { Player } from \"@player\";\n\nexport let LastExportBonus = 0;\n\nconst bonusTimer = 24 * 60 * 60 * 1000; // 24h\nexport function canGetBonus(): boolean {\n const now = new Date().getTime();\n return now - LastExportBonus > bonusTimer;\n}\n\nexport function onExport(): void {\n if (!canGetBonus()) return;\n for (const facName of Player.factions) {\n Factions[facName].favor++;\n }\n LastExportBonus = new Date().getTime();\n}\n\nexport function setLastExportBonus(unixTime: number): void {\n LastExportBonus = unixTime;\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Hashes } from \"./Hashes\";\n\nexport function HashRate({ hashes }: { hashes: number }): React.ReactElement {\n return <Hashes hashes={`${numeralWrapper.formatHashes(hashes)} h / s`} />;\n}\n","import { MessageFilenames } from \"./MessageHelpers\";\n\nexport class Message {\n // Name of Message file\n filename: MessageFilenames;\n\n // The text contains in the Message\n msg: string;\n\n constructor(filename: MessageFilenames, msg: string) {\n this.filename = filename;\n this.msg = msg;\n }\n}\n","import * as React from \"react\";\n\nimport { Company } from \"../../Company/Company\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { getJobRequirementText } from \"../../Company/GetJobRequirementText\";\n\nimport { Player } from \"@player\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ntype IProps = {\n company: Company;\n entryPosType: CompanyPosition;\n onClick: (e: React.MouseEvent<HTMLElement>) => void;\n text: string;\n};\n\n/** React Component for a button that's used to apply for a job */\nexport function ApplyToJobButton(props: IProps): React.ReactElement {\n function getJobRequirementTooltip(): string {\n const pos = Player.getNextCompanyPosition(props.company, props.entryPosType);\n if (pos == null) {\n return \"\";\n }\n\n if (!props.company.hasPosition(pos)) {\n return \"\";\n }\n\n return getJobRequirementText(props.company, pos, true);\n }\n\n return (\n <>\n <Tooltip title={<span dangerouslySetInnerHTML={{ __html: getJobRequirementTooltip() }}></span>}>\n <Button onClick={props.onClick}>{props.text}</Button>\n </Tooltip>\n </>\n );\n}\n","import { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { CONSTANTS } from \"../Constants\";\nimport { Player } from \"@player\";\nimport { Programs } from \"../Programs/Programs\";\nimport { Work, WorkType } from \"./Work\";\nimport { Program } from \"../Programs/Program\";\n\nexport const isCreateProgramWork = (w: Work | null): w is CreateProgramWork =>\n w !== null && w.type === WorkType.CREATE_PROGRAM;\n\ninterface CreateProgramWorkParams {\n programName: string;\n singularity: boolean;\n}\n\nexport class CreateProgramWork extends Work {\n programName: string;\n // amount of effective work completed on the program (time boosted by skills).\n unitCompleted: number;\n\n constructor(params?: CreateProgramWorkParams) {\n super(WorkType.CREATE_PROGRAM, params?.singularity ?? true);\n this.unitCompleted = 0;\n this.programName = params?.programName ?? \"\";\n\n if (params) {\n for (let i = 0; i < Player.getHomeComputer().programs.length; ++i) {\n const programFile = Player.getHomeComputer().programs[i];\n if (programFile.startsWith(this.programName) && programFile.endsWith(\"%-INC\")) {\n const res = programFile.split(\"-\");\n if (res.length != 3) {\n break;\n }\n const percComplete = Number(res[1].slice(0, -1));\n if (isNaN(percComplete) || percComplete < 0 || percComplete >= 100) {\n break;\n }\n this.unitCompleted = (percComplete / 100) * this.unitNeeded();\n Player.getHomeComputer().programs.splice(i, 1);\n }\n }\n }\n }\n\n unitNeeded(): number {\n return this.getProgram().create?.time ?? 0;\n }\n\n getProgram(): Program {\n const p = Object.values(Programs).find((p) => p.name.toLowerCase() === this.programName.toLowerCase());\n if (!p) throw new Error(\"Create program work started with invalid program \" + this.programName);\n return p;\n }\n\n process(cycles: number): boolean {\n let focusBonus = 1;\n if (!Player.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {\n focusBonus = Player.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n //Higher hacking skill will allow you to create programs faster\n const reqLvl = this.getProgram().create?.level ?? 0;\n let skillMult = (Player.skills.hacking / reqLvl) * Player.getIntelligenceBonus(3); //This should always be greater than 1;\n skillMult = 1 + (skillMult - 1) / 5; //The divider constant can be adjusted as necessary\n skillMult *= focusBonus;\n //Skill multiplier directly applied to \"time worked\"\n this.cyclesWorked += cycles;\n this.unitCompleted += CONSTANTS._idleSpeed * cycles * skillMult;\n\n if (this.unitCompleted >= this.unitNeeded()) {\n return true;\n }\n return false;\n }\n finish(cancelled: boolean): void {\n const programName = this.programName;\n if (!cancelled) {\n //Complete case\n Player.gainIntelligenceExp(\n (CONSTANTS.IntelligenceProgramBaseExpGain * this.cyclesWorked * CONSTANTS._idleSpeed) / 1000,\n );\n if (!this.singularity) {\n const lines = [\n `You've finished creating ${programName}!`,\n \"The new program can be found on your home computer.\",\n ];\n dialogBoxCreate(lines.join(\"<br>\"));\n }\n\n if (!Player.getHomeComputer().programs.includes(programName)) {\n Player.getHomeComputer().programs.push(programName);\n }\n } else if (!Player.getHomeComputer().programs.includes(programName)) {\n //Incomplete case\n const perc = ((100 * this.unitCompleted) / this.unitNeeded()).toFixed(2);\n const incompleteName = programName + \"-\" + perc + \"%-INC\";\n Player.getHomeComputer().programs.push(incompleteName);\n }\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n programName: this.programName,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"CreateProgramWork\", this);\n }\n\n /** Initializes a CreateProgramWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): CreateProgramWork {\n return Generic_fromJSON(CreateProgramWork, value.data);\n }\n}\n\nReviver.constructors.CreateProgramWork = CreateProgramWork;\n","import { EventEmitter } from \"../utils/EventEmitter\";\n\n/** Event emitter that triggers when scripts are started/stopped */\nexport const WorkerScriptStartStopEventEmitter = new EventEmitter<[]>();\n","import { Player } from \"@player\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { applySleeveGains, Work, WorkType } from \"./Work\";\nimport { FactionWorkType } from \"../../../Work/data/FactionWorkType\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport { calculateFactionExp } from \"../../../Work/formulas/Faction\";\nimport { Faction } from \"../../../Faction/Faction\";\nimport {\n getFactionFieldWorkRepGain,\n getFactionSecurityWorkRepGain,\n getHackingWorkRepGain,\n} from \"../../../PersonObjects/formulas/reputation\";\nimport { scaleWorkStats, WorkStats } from \"../../../Work/WorkStats\";\nimport { BitNodeMultipliers } from \"../../../BitNode/BitNodeMultipliers\";\n\ninterface SleeveFactionWorkParams {\n factionWorkType: FactionWorkType;\n factionName: string;\n}\n\nexport const isSleeveFactionWork = (w: Work | null): w is SleeveFactionWork =>\n w !== null && w.type === WorkType.FACTION;\n\nexport class SleeveFactionWork extends Work {\n factionWorkType: FactionWorkType;\n factionName: string;\n\n constructor(params?: SleeveFactionWorkParams) {\n super(WorkType.FACTION);\n this.factionWorkType = params?.factionWorkType ?? FactionWorkType.HACKING;\n this.factionName = params?.factionName ?? FactionNames.Sector12;\n }\n\n getExpRates(sleeve: Sleeve): WorkStats {\n return scaleWorkStats(calculateFactionExp(sleeve, this.factionWorkType), sleeve.shockBonus());\n }\n\n getReputationRate(sleeve: Sleeve): number {\n const faction = this.getFaction();\n const repFormulas = {\n [FactionWorkType.HACKING]: getHackingWorkRepGain,\n [FactionWorkType.FIELD]: getFactionFieldWorkRepGain,\n [FactionWorkType.SECURITY]: getFactionSecurityWorkRepGain,\n };\n return (\n repFormulas[this.factionWorkType](sleeve, faction.favor) *\n sleeve.shockBonus() *\n BitNodeMultipliers.FactionWorkRepGain\n );\n }\n\n getFaction(): Faction {\n const f = Factions[this.factionName];\n if (!f) throw new Error(`Faction work started with invalid / unknown faction: '${this.factionName}'`);\n return f;\n }\n\n process(sleeve: Sleeve, cycles: number): number {\n if (this.factionName === Player.gang?.facName) {\n sleeve.stopWork();\n return 0;\n }\n\n const exp = this.getExpRates(sleeve);\n applySleeveGains(sleeve, exp, cycles);\n const rep = this.getReputationRate(sleeve);\n this.getFaction().playerReputation += rep;\n return 0;\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n factionWorkType: this.factionWorkType,\n factionName: this.factionName,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveFactionWork\", this);\n }\n\n /** Initializes a FactionWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): SleeveFactionWork {\n return Generic_fromJSON(SleeveFactionWork, value.data);\n }\n}\n\nReviver.constructors.SleeveFactionWork = SleeveFactionWork;\n","// The Research Map is an object that holds all Corporation Research objects\n// as values. They are identified by their names\nimport { Research, IConstructorParams } from \"./Research\";\nimport { researchMetadata } from \"./data/ResearchMetadata\";\n\nexport const ResearchMap: Record<string, Research> = {};\n\nfunction addResearch(p: IConstructorParams): void {\n if (ResearchMap[p.name] != null) {\n console.warn(`Duplicate Research being defined: ${p.name}`);\n }\n ResearchMap[p.name] = new Research(p);\n}\n\nfor (const metadata of researchMetadata) {\n addResearch(metadata);\n}\n","import React from \"react\";\nimport { SourceFile } from \"./SourceFile\";\nimport { initBitNodes, initBitNodeMultipliers } from \"../BitNode/BitNode\";\n\nexport const SourceFiles: Record<string, SourceFile> = {};\n/** Engine initializer for SourceFiles, BitNodes, and BitNodeMultipliers. Run once at engine load. */\nexport function initSourceFiles() {\n initBitNodes();\n initBitNodeMultipliers();\n SourceFiles[\"SourceFile1\"] = new SourceFile(\n 1,\n (\n <>\n This Source-File lets the player start with 32GB of RAM on his/her home computer. It also increases all of the\n player's multipliers by:\n <br />\n <br />\n Level 1: 16%\n <br />\n Level 2: 24%\n <br />\n Level 3: 28%\n </>\n ),\n );\n SourceFiles[\"SourceFile2\"] = new SourceFile(\n 2,\n (\n <>\n This Source-File allows you to form gangs in other BitNodes once your karma decreases to a certain value. It\n also increases the player's crime success rate, crime money, and charisma multipliers by:\n <br />\n <br />\n Level 1: 24%\n <br />\n Level 2: 36%\n <br />\n Level 3: 42%\n </>\n ),\n );\n SourceFiles[\"SourceFile3\"] = new SourceFile(\n 3,\n (\n <>\n This Source-File lets you create corporations on other BitNodes (although some BitNodes will disable this\n mechanic) and level 3 permanently unlocks the full API. This Source-File also increases your charisma and\n company salary multipliers by:\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n );\n SourceFiles[\"SourceFile4\"] = new SourceFile(\n 4,\n (\n <>\n This Source-File lets you access and use the Singularity Functions in every BitNode. Every level of this\n Source-File reduces the RAM cost of Singularity functions:\n <br />\n Level 1: 16x\n <br />\n Level 2: 4x\n <br />\n Level 3: 1x\n </>\n ),\n );\n SourceFiles[\"SourceFile5\"] = new SourceFile(\n 5,\n (\n <>\n This Source-File grants a special new stat called Intelligence. Intelligence is unique because it is permanent\n and persistent (it never gets reset back to 1). However, gaining Intelligence experience is much slower than\n other stats. Higher Intelligence levels will boost your production for many actions in the game. In addition,\n this Source-File will unlock:\n <br />\n <ul>\n <li>\n The <code>getBitNodeMultipliers()</code> Netscript function\n </li>\n <li>Permanent access to Formulas.exe</li>\n <li>\n Access to BitNode multiplier information on the <b>Stats</b> page\n </li>\n </ul>\n It will also raise all of your hacking-related multipliers by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n );\n SourceFiles[\"SourceFile6\"] = new SourceFile(\n 6,\n (\n <>\n This Source-File allows you to access the NSA's Bladeburner Division in other BitNodes. In addition, this\n Source-File will raise both the level and experience gain rate of all your combat stats by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n );\n SourceFiles[\"SourceFile7\"] = new SourceFile(\n 7,\n (\n <>\n This Source-File allows you to access the Bladeburner Netscript API in other BitNodes. In addition, this\n Source-File will increase all of your Bladeburner multipliers by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n );\n SourceFiles[\"SourceFile8\"] = new SourceFile(\n 8,\n (\n <>\n This Source-File grants the following benefits:\n <br />\n <br />\n Level 1: Permanent access to WSE and TIX API\n <br />\n Level 2: Ability to short stocks in other BitNodes\n <br />\n Level 3: Ability to use limit/stop orders in other BitNodes\n <br />\n <br />\n This Source-File also increases your hacking growth multipliers by:\n <br />\n Level 1: 12%\n <br />\n Level 2: 18%\n <br />\n Level 3: 21%\n </>\n ),\n );\n SourceFiles[\"SourceFile9\"] = new SourceFile(\n 9,\n (\n <>\n This Source-File grants the following benefits:\n <br />\n <br />\n Level 1: Permanently unlocks the Hacknet Server in other BitNodes\n <br />\n Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode\n <br />\n Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode\n <br />\n <br />\n (Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing\n Augmentations)\n <br />\n <br />\n This Source-File also increases your hacknet multipliers by:\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n );\n SourceFiles[\"SourceFile10\"] = new SourceFile(\n 10,\n (\n <>\n This Source-File unlocks Sleeve technology, and the Grafting API in other BitNodes. Each level of this\n Source-File also grants you a Duplicate Sleeve\n </>\n ),\n );\n SourceFiles[\"SourceFile11\"] = new SourceFile(\n 11,\n (\n <>\n This Source-File makes it so that company favor increases BOTH the player's salary and reputation gain rate at\n that company by 1% per favor (rather than just the reputation gain). This Source-File also increases the\n player's company salary and reputation gain multipliers by:\n <br />\n <br />\n Level 1: 32%\n <br />\n Level 2: 48%\n <br />\n Level 3: 56%\n <br />\n <br />\n It also reduces the price increase for every aug bought by:\n <br />\n <br />\n Level 1: 4%\n <br />\n Level 2: 6%\n <br />\n Level 3: 7%\n </>\n ),\n );\n SourceFiles[\"SourceFile12\"] = new SourceFile(\n 12,\n <>This Source-File lets the player start with Neuroflux Governor equal to the level of this Source-File.</>,\n );\n SourceFiles[\"SourceFile13\"] = new SourceFile(\n 13,\n <>Each level of this Source-File increases the size of Stanek's Gift.</>,\n );\n}\n","import { Player } from \"@player\";\nimport { Router } from \"./ui/GameRoot\";\nimport { removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { Terminal } from \"./Terminal\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\nimport { IReturnStatus } from \"./types\";\nimport { GetServer } from \"./Server/AllServers\";\nimport { ImportPlayerData, SaveData, saveObject } from \"./SaveObject\";\nimport { Settings } from \"./Settings/Settings\";\nimport { exportScripts } from \"./Terminal/commands/download\";\nimport { CONSTANTS } from \"./Constants\";\nimport { hash } from \"./hash/hash\";\n\ninterface IReturnWebStatus extends IReturnStatus {\n data?: Record<string, unknown>;\n}\n\ndeclare global {\n interface Window {\n appNotifier: {\n terminal: (message: string, type?: string) => void;\n toast: (message: string, type: ToastVariant, duration?: number) => void;\n };\n appSaveFns: {\n triggerSave: () => Promise<void>;\n triggerGameExport: () => void;\n triggerScriptsExport: () => void;\n getSaveData: () => { save: string; fileName: string };\n getSaveInfo: (base64save: string) => Promise<ImportPlayerData | undefined>;\n pushSaveData: (base64save: string, automatic?: boolean) => void;\n };\n electronBridge: {\n send: (channel: string, data?: unknown) => void;\n receive: (channel: string, func: (...args: unknown[]) => void) => void;\n };\n }\n interface Document {\n getFiles: () => IReturnWebStatus;\n deleteFile: (filename: string) => IReturnWebStatus;\n saveFile: (filename: string, code: string) => IReturnWebStatus;\n }\n}\n\nexport function initElectron(): void {\n const userAgent = navigator.userAgent.toLowerCase();\n if (userAgent.indexOf(\" electron/\") > -1) {\n // Electron-specific code\n document.achievements = [];\n initWebserver();\n initAppNotifier();\n initSaveFunctions();\n initElectronBridge();\n }\n}\n\nfunction initWebserver(): void {\n function normalizeFileName(filename: string): string {\n filename = filename.replace(/\\/\\/+/g, \"/\");\n filename = removeLeadingSlash(filename);\n if (filename.includes(\"/\")) {\n filename = \"/\" + removeLeadingSlash(filename);\n }\n return filename;\n }\n\n document.getFiles = function (): IReturnWebStatus {\n const home = GetServer(\"home\");\n if (home === null) {\n return {\n res: false,\n msg: \"Home server does not exist.\",\n };\n }\n return {\n res: true,\n data: {\n files: home.scripts.map((script) => ({\n filename: script.filename,\n code: script.code,\n ramUsage: script.ramUsage,\n })),\n },\n };\n };\n\n document.deleteFile = function (filename: string): IReturnWebStatus {\n filename = normalizeFileName(filename);\n const home = GetServer(\"home\");\n if (home === null) {\n return {\n res: false,\n msg: \"Home server does not exist.\",\n };\n }\n return home.removeFile(filename);\n };\n\n document.saveFile = function (filename: string, code: string): IReturnWebStatus {\n filename = normalizeFileName(filename);\n\n code = Buffer.from(code, \"base64\").toString();\n const home = GetServer(\"home\");\n if (home === null) {\n return {\n res: false,\n msg: \"Home server does not exist.\",\n };\n }\n const { success, overwritten } = home.writeToScriptFile(filename, code);\n let script;\n if (success) {\n script = home.getScript(filename);\n }\n return {\n res: success,\n data: {\n overwritten,\n ramUsage: script?.ramUsage,\n },\n };\n };\n}\n\n// Expose certain alert functions to allow the wrapper to sends message to the game\nfunction initAppNotifier(): void {\n const funcs = {\n terminal: (message: string, type?: string) => {\n const typesFn: Record<string, (s: string) => void> = {\n info: Terminal.info,\n warn: Terminal.warn,\n error: Terminal.error,\n success: Terminal.success,\n };\n let fn;\n if (type) fn = typesFn[type];\n if (!fn) fn = Terminal.print;\n fn.bind(Terminal)(message);\n },\n toast: (message: string, type: ToastVariant, duration = 2000) => SnackbarEvents.emit(message, type, duration),\n };\n\n // Will be consumed by the electron wrapper.\n window.appNotifier = funcs;\n}\n\nfunction initSaveFunctions(): void {\n const funcs = {\n triggerSave: (): Promise<void> => saveObject.saveGame(true),\n triggerGameExport: (): void => {\n try {\n saveObject.exportGame();\n } catch (error) {\n console.error(error);\n SnackbarEvents.emit(\"Could not export game.\", ToastVariant.ERROR, 2000);\n }\n },\n triggerScriptsExport: (): void => exportScripts(\"*\", Player.getHomeComputer()),\n getSaveData: (): { save: string; fileName: string } => {\n return {\n save: saveObject.getSaveString(Settings.ExcludeRunningScriptsFromSave),\n fileName: saveObject.getSaveFileName(),\n };\n },\n getSaveInfo: async (base64save: string): Promise<ImportPlayerData | undefined> => {\n try {\n const data = await saveObject.getImportDataFromString(base64save);\n return data.playerData;\n } catch (error) {\n console.error(error);\n return;\n }\n },\n pushSaveData: (base64save: string, automatic = false): void => Router.toImportSave(base64save, automatic),\n };\n\n // Will be consumed by the electron wrapper.\n window.appSaveFns = funcs;\n}\n\nfunction initElectronBridge(): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n bridge.receive(\"get-save-data-request\", () => {\n const data = window.appSaveFns.getSaveData();\n bridge.send(\"get-save-data-response\", data);\n });\n bridge.receive(\"get-save-info-request\", async (save: unknown) => {\n if (typeof save !== \"string\") throw new Error(\"Error while trying to get save info\");\n const data = await window.appSaveFns.getSaveInfo(save);\n bridge.send(\"get-save-info-response\", data);\n });\n bridge.receive(\"push-save-request\", (params: unknown) => {\n if (typeof params !== \"object\") throw new Error(\"Error trying to push save request\");\n const { save, automatic = false } = params as { save: string; automatic: boolean };\n window.appSaveFns.pushSaveData(save, automatic);\n });\n bridge.receive(\"trigger-save\", () => {\n return window.appSaveFns\n .triggerSave()\n .then(() => {\n bridge.send(\"save-completed\");\n })\n .catch((error: unknown) => {\n console.error(error);\n SnackbarEvents.emit(\"Could not save game.\", ToastVariant.ERROR, 2000);\n });\n });\n bridge.receive(\"trigger-game-export\", () => {\n try {\n window.appSaveFns.triggerGameExport();\n } catch (error) {\n console.error(error);\n SnackbarEvents.emit(\"Could not export game.\", ToastVariant.ERROR, 2000);\n }\n });\n bridge.receive(\"trigger-scripts-export\", () => {\n try {\n window.appSaveFns.triggerScriptsExport();\n } catch (error) {\n console.error(error);\n SnackbarEvents.emit(\"Could not export scripts.\", ToastVariant.ERROR, 2000);\n }\n });\n}\n\nexport function pushGameSaved(data: SaveData): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n bridge.send(\"push-game-saved\", data);\n}\n\nexport function pushGameReady(): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n // Send basic information to the electron wrapper\n bridge.send(\"push-game-ready\", {\n player: {\n identifier: Player.identifier,\n playtime: Player.totalPlaytime,\n lastSave: Player.lastSave,\n },\n game: {\n version: CONSTANTS.VersionString,\n hash: hash(),\n },\n });\n}\n\nexport function pushImportResult(wasImported: boolean): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n bridge.send(\"push-import-result\", { wasImported });\n pushDisableRestore();\n}\n\nexport function pushDisableRestore(): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n bridge.send(\"push-disable-restore\", { duration: 1000 * 60 });\n}\n","// Root React Component for the Corporation UI\nimport React, { useState, useEffect } from \"react\";\n\nimport { Theme, useTheme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Reputation } from \"./Reputation\";\nimport { KillScriptsModal } from \"./KillScriptsModal\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\n\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport IconButton from \"@mui/material/IconButton\";\nimport SaveIcon from \"@mui/icons-material/Save\";\nimport ClearAllIcon from \"@mui/icons-material/ClearAll\";\n\nimport { Settings } from \"../../Settings/Settings\";\nimport { Router } from \"../GameRoot\";\nimport { Player } from \"@player\";\nimport { StatsProgressOverviewCell } from \"./StatsProgressBar\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nimport { Box, Tooltip } from \"@mui/material\";\n\nimport { isClassWork } from \"../../Work/ClassWork\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { isCreateProgramWork } from \"../../Work/CreateProgramWork\";\nimport { isGraftingWork } from \"../../Work/GraftingWork\";\nimport { isFactionWork } from \"../../Work/FactionWork\";\nimport { ReputationRate } from \"./ReputationRate\";\nimport { isCompanyWork } from \"../../Work/CompanyWork\";\nimport { isCrimeWork } from \"../../Work/CrimeWork\";\n\ninterface IProps {\n save: () => void;\n killScripts: () => void;\n}\n\nfunction Intelligence(): React.ReactElement {\n const theme = useTheme();\n const classes = useStyles();\n if (Player.skills.intelligence === 0) return <></>;\n const progress = Player.calculateSkillProgress(Player.exp.intelligence);\n\n return (\n <>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.int }}>Int </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.int }}>\n {numeralWrapper.formatSkill(Player.skills.intelligence)}\n </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-int-hook\" classes={{ root: classes.int }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={progress} color={theme.colors.int} />\n )}\n </TableRow>\n </>\n );\n}\n\nfunction Bladeburner(): React.ReactElement {\n const classes = useStyles();\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) return <></>;\n const action = bladeburner.getTypeAndNameFromActionId(bladeburner.action);\n if (action.type === \"Idle\") return <></>;\n return (\n <>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.cellNone }}>\n <Typography>Bladeburner:</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.cellNone }}>\n <Typography>\n {action.type}: {action.name}\n </Typography>\n </TableCell>\n </TableRow>\n </>\n );\n}\n\ninterface WorkInProgressOverviewProps {\n tooltip: React.ReactNode;\n header: React.ReactNode;\n children: React.ReactNode;\n onClickFocus: () => void;\n}\n\nfunction WorkInProgressOverview({\n tooltip,\n children,\n onClickFocus,\n header,\n}: WorkInProgressOverviewProps): React.ReactElement {\n const classes = useStyles();\n return (\n <>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.workCell }}>\n <Tooltip title={<>{tooltip}</>}>\n <Typography className={classes.workHeader} sx={{ pt: 1, pb: 0.5 }}>\n {header}\n </Typography>\n </Tooltip>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.workCell }}>\n <Typography className={classes.workSubtitles}>{children}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" align=\"center\" colSpan={2} classes={{ root: classes.cellNone }}>\n <Button sx={{ mt: 1 }} onClick={onClickFocus}>\n Focus\n </Button>\n </TableCell>\n </TableRow>\n </>\n );\n}\n\nfunction Work(): React.ReactElement {\n const onClickFocus = (): void => {\n Player.startFocusing();\n Router.toWork();\n };\n if (Player.currentWork === null || Player.focus) return <></>;\n\n let details = <></>;\n let header = <></>;\n let innerText = <></>;\n if (isCrimeWork(Player.currentWork)) {\n const crime = Player.currentWork.getCrime();\n const perc = (Player.currentWork.unitCompleted / crime.time) * 100;\n\n details = <>{Player.currentWork.crimeType}</>;\n header = <>You are attempting to {Player.currentWork.crimeType}</>;\n innerText = <>{perc.toFixed(2)}%</>;\n }\n if (isClassWork(Player.currentWork)) {\n details = <>{Player.currentWork.getClass().youAreCurrently}</>;\n header = <>You are {Player.currentWork.getClass().youAreCurrently}</>;\n innerText = <>{convertTimeMsToTimeElapsedString(Player.currentWork.cyclesWorked * CONSTANTS._idleSpeed)}</>;\n }\n if (isCreateProgramWork(Player.currentWork)) {\n const create = Player.currentWork;\n details = <>Coding {create.programName}</>;\n header = <>Creating a program</>;\n innerText = (\n <>\n {create.programName} {((create.unitCompleted / create.unitNeeded()) * 100).toFixed(2)}%\n </>\n );\n }\n if (isGraftingWork(Player.currentWork)) {\n const graft = Player.currentWork;\n details = <>Grafting {graft.augmentation}</>;\n header = <>Grafting an Augmentation</>;\n innerText = (\n <>\n <strong>{((graft.unitCompleted / graft.unitNeeded()) * 100).toFixed(2)}%</strong> done\n </>\n );\n }\n\n if (isFactionWork(Player.currentWork)) {\n const factionWork = Player.currentWork;\n header = (\n <>\n Working for <strong>{factionWork.factionName}</strong>\n </>\n );\n innerText = (\n <>\n <Reputation reputation={factionWork.getFaction().playerReputation} /> rep\n <br />(\n <ReputationRate reputation={factionWork.getReputationRate() * (1000 / CONSTANTS._idleSpeed)} />)\n </>\n );\n }\n if (isCompanyWork(Player.currentWork)) {\n const companyWork = Player.currentWork;\n details = (\n <>\n {Player.jobs[companyWork.companyName]} at <strong>{companyWork.companyName}</strong>\n </>\n );\n header = (\n <>\n Working at <strong>{companyWork.companyName}</strong>\n </>\n );\n innerText = (\n <>\n <Reputation reputation={companyWork.getCompany().playerReputation} /> rep\n <br />(\n <ReputationRate reputation={companyWork.getGainRates().reputation * (1000 / CONSTANTS._idleSpeed)} />)\n </>\n );\n }\n\n return (\n <WorkInProgressOverview tooltip={details} header={header} onClickFocus={onClickFocus}>\n {innerText}\n </WorkInProgressOverview>\n );\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n workCell: {\n textAlign: \"center\",\n maxWidth: \"200px\",\n borderBottom: \"none\",\n padding: 0,\n margin: 0,\n },\n\n workHeader: {\n fontSize: \"0.9rem\",\n },\n\n workSubtitles: {\n fontSize: \"0.8rem\",\n },\n\n cellNone: {\n borderBottom: \"none\",\n padding: 0,\n margin: 0,\n },\n cell: {\n padding: 0,\n margin: 0,\n },\n hp: {\n color: theme.colors.hp,\n },\n money: {\n color: theme.colors.money,\n },\n hack: {\n color: theme.colors.hack,\n },\n combat: {\n color: theme.colors.combat,\n },\n cha: {\n color: theme.colors.cha,\n },\n int: {\n color: theme.colors.int,\n },\n }),\n);\n\nexport { useStyles as characterOverviewStyles };\n\nexport function CharacterOverview({ save, killScripts }: IProps): React.ReactElement {\n const [killOpen, setKillOpen] = useState(false);\n const setRerender = useState(false)[1];\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 600);\n return () => clearInterval(id);\n }, []);\n const classes = useStyles();\n const theme = useTheme();\n\n const hackingProgress = Player.calculateSkillProgress(\n Player.exp.hacking,\n Player.mults.hacking * BitNodeMultipliers.HackingLevelMultiplier,\n );\n const strengthProgress = Player.calculateSkillProgress(\n Player.exp.strength,\n Player.mults.strength * BitNodeMultipliers.StrengthLevelMultiplier,\n );\n const defenseProgress = Player.calculateSkillProgress(\n Player.exp.defense,\n Player.mults.defense * BitNodeMultipliers.DefenseLevelMultiplier,\n );\n const dexterityProgress = Player.calculateSkillProgress(\n Player.exp.dexterity,\n Player.mults.dexterity * BitNodeMultipliers.DexterityLevelMultiplier,\n );\n const agilityProgress = Player.calculateSkillProgress(\n Player.exp.agility,\n Player.mults.agility * BitNodeMultipliers.AgilityLevelMultiplier,\n );\n const charismaProgress = Player.calculateSkillProgress(\n Player.exp.charisma,\n Player.mults.charisma * BitNodeMultipliers.CharismaLevelMultiplier,\n );\n\n return (\n <>\n <Table sx={{ display: \"block\", m: 1 }}>\n <TableBody>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.hp }}>HP </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.hp }}>\n {numeralWrapper.formatHp(Player.hp.current)} / {numeralWrapper.formatHp(Player.hp.max)}\n </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-hp-hook\" classes={{ root: classes.hp }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.money }}>Money </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.money }}>{numeralWrapper.formatMoney(Player.money)}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-money-hook\" classes={{ root: classes.money }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.hack }}>Hack </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.hack }}>\n {numeralWrapper.formatSkill(Player.skills.hacking)}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={hackingProgress} color={theme.colors.hack} />\n )}\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.hack }}></Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-hack-hook\" classes={{ root: classes.hack }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>Str </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>\n {numeralWrapper.formatSkill(Player.skills.strength)}\n </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-str-hook\" classes={{ root: classes.combat }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={strengthProgress} color={theme.colors.combat} />\n )}\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>Def </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>\n {numeralWrapper.formatSkill(Player.skills.defense)}\n </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-def-hook\" classes={{ root: classes.combat }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={defenseProgress} color={theme.colors.combat} />\n )}\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>Dex </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>\n {numeralWrapper.formatSkill(Player.skills.dexterity)}\n </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-dex-hook\" classes={{ root: classes.combat }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={dexterityProgress} color={theme.colors.combat} />\n )}\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.combat }}>Agi </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.combat }}>\n {numeralWrapper.formatSkill(Player.skills.agility)}\n </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-agi-hook\" classes={{ root: classes.combat }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={agilityProgress} color={theme.colors.combat} />\n )}\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.cha }}>Cha </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.cha }}>\n {numeralWrapper.formatSkill(Player.skills.charisma)}\n </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-cha-hook\" classes={{ root: classes.cha }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={charismaProgress} color={theme.colors.cha} />\n )}\n </TableRow>\n\n <Intelligence />\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-extra-hook-0\" classes={{ root: classes.hack }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n <TableCell component=\"th\" scope=\"row\" align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-extra-hook-1\" classes={{ root: classes.hack }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n <TableCell component=\"th\" scope=\"row\" align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-extra-hook-2\" classes={{ root: classes.hack }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <Work />\n <Bladeburner />\n </TableBody>\n </Table>\n <Box sx={{ display: \"flex\", borderTop: `1px solid ${Settings.theme.welllight}` }}>\n <Box sx={{ display: \"flex\", flex: 1, justifyContent: \"flex-start\", alignItems: \"center\" }}>\n <IconButton aria-label=\"save game\" onClick={save}>\n <Tooltip title={Settings.AutosaveInterval !== 0 ? \"Save game\" : \"Save game (auto-saves are disabled!)\"}>\n <SaveIcon color={Settings.AutosaveInterval !== 0 ? \"primary\" : \"error\"} />\n </Tooltip>\n </IconButton>\n </Box>\n <Box sx={{ display: \"flex\", flex: 1, justifyContent: \"flex-end\", alignItems: \"center\" }}>\n <IconButton aria-label=\"kill all scripts\" onClick={() => setKillOpen(true)}>\n <Tooltip title=\"Kill all running scripts\">\n <ClearAllIcon color=\"error\" />\n </Tooltip>\n </IconButton>\n </Box>\n </Box>\n <KillScriptsModal open={killOpen} onClose={() => setKillOpen(false)} killScripts={killScripts} />\n </>\n );\n}\n","export function calculateIntelligenceBonus(intelligence: number, weight = 1): number {\n return 1 + (weight * Math.pow(intelligence, 0.8)) / 600;\n}\n","import { WorkerScript } from \"./WorkerScript\";\n\n/**\n * Script death marker.\n *\n * IMPORTANT: the game engine should not base any of it's decisions on the data\n * carried in a ScriptDeath instance.\n *\n * This is because ScriptDeath instances are thrown through player code when a\n * script is killed. Which grants the player access to the class and the ability\n * to construct new instances with arbitrary data.\n */\nexport class ScriptDeath {\n /** Process ID number. */\n pid: number;\n\n /** Filename of the script. */\n name: string;\n\n /** IP Address on which the script was running */\n hostname: string;\n\n /** Status message in case of script error. */\n errorMessage = \"\";\n\n constructor(ws: WorkerScript) {\n this.pid = ws.pid;\n this.name = ws.name;\n this.hostname = ws.hostname;\n this.errorMessage = ws.errorMessage;\n\n Object.freeze(this);\n }\n}\n\nObject.freeze(ScriptDeath);\nObject.freeze(ScriptDeath.prototype);\n","import {\n CodingContract,\n CodingContractRewardType,\n CodingContractTypes,\n ICodingContractReward,\n} from \"./CodingContracts\";\nimport { Factions } from \"./Faction/Factions\";\nimport { Player } from \"@player\";\nimport { GetServer, GetAllServers } from \"./Server/AllServers\";\nimport { SpecialServers } from \"./Server/data/SpecialServers\";\nimport { Server } from \"./Server/Server\";\nimport { BaseServer } from \"./Server/BaseServer\";\n\nimport { getRandomInt } from \"./utils/helpers/getRandomInt\";\n\nexport function generateRandomContract(): void {\n // First select a random problem type\n const problemType = getRandomProblemType();\n\n // Then select a random reward type. 'Money' will always be the last reward type\n const reward = getRandomReward();\n\n // Choose random server\n const randServer = getRandomServer();\n\n const contractFn = getRandomFilename(randServer, reward);\n const contract = new CodingContract(contractFn, problemType, reward);\n\n randServer.addContract(contract);\n}\n\nexport function generateRandomContractOnHome(): void {\n // First select a random problem type\n const problemType = getRandomProblemType();\n\n // Then select a random reward type. 'Money' will always be the last reward type\n const reward = getRandomReward();\n\n // Choose random server\n const serv = Player.getHomeComputer();\n\n const contractFn = getRandomFilename(serv, reward);\n const contract = new CodingContract(contractFn, problemType, reward);\n\n serv.addContract(contract);\n}\n\nexport const generateDummyContract = (problemType: string): void => {\n if (!CodingContractTypes[problemType]) throw new Error(`Invalid problem type: '${problemType}'`);\n const serv = Player.getHomeComputer();\n\n const contractFn = getRandomFilename(serv);\n const contract = new CodingContract(contractFn, problemType, null);\n serv.addContract(contract);\n};\n\ninterface IGenerateContractParams {\n problemType?: string;\n server?: string;\n fn?: string;\n}\n\nexport function generateContract(params: IGenerateContractParams): void {\n // Problem Type\n let problemType;\n const problemTypes = Object.keys(CodingContractTypes);\n if (params.problemType && problemTypes.includes(params.problemType)) {\n problemType = params.problemType;\n } else {\n problemType = getRandomProblemType();\n }\n\n // Reward Type - This is always random for now\n const reward = getRandomReward();\n\n // Server\n let server;\n if (params.server != null) {\n server = GetServer(params.server);\n if (server == null) {\n server = getRandomServer();\n }\n } else {\n server = getRandomServer();\n }\n\n // Filename\n let fn;\n if (params.fn != null) {\n fn = params.fn;\n } else {\n fn = getRandomFilename(server, reward);\n }\n\n const contract = new CodingContract(fn, problemType, reward);\n server.addContract(contract);\n}\n\n// Ensures that a contract's reward type is valid\nfunction sanitizeRewardType(rewardType: CodingContractRewardType): CodingContractRewardType {\n let type = rewardType; // Create copy\n\n const factionsThatAllowHacking = Player.factions.filter((fac) => {\n try {\n return Factions[fac].getInfo().offerHackingWork;\n } catch (e) {\n console.error(`Error when trying to filter Hacking Factions for Coding Contract Generation: ${e}`);\n return false;\n }\n });\n if (type === CodingContractRewardType.FactionReputation && factionsThatAllowHacking.length === 0) {\n type = CodingContractRewardType.CompanyReputation;\n }\n if (type === CodingContractRewardType.FactionReputationAll && factionsThatAllowHacking.length === 0) {\n type = CodingContractRewardType.CompanyReputation;\n }\n if (type === CodingContractRewardType.CompanyReputation && Object.keys(Player.jobs).length === 0) {\n type = CodingContractRewardType.Money;\n }\n\n return type;\n}\n\nfunction getRandomProblemType(): string {\n const problemTypes = Object.keys(CodingContractTypes);\n const randIndex = getRandomInt(0, problemTypes.length - 1);\n\n return problemTypes[randIndex];\n}\n\nfunction getRandomReward(): ICodingContractReward {\n const reward: ICodingContractReward = {\n name: \"\",\n type: getRandomInt(0, CodingContractRewardType.Money),\n };\n reward.type = sanitizeRewardType(reward.type);\n\n // Add additional information based on the reward type\n const factionsThatAllowHacking = Player.factions.filter((fac) => Factions[fac].getInfo().offerHackingWork);\n\n switch (reward.type) {\n case CodingContractRewardType.FactionReputation: {\n // Get a random faction that player is a part of. That\n // faction must allow hacking contracts\n const numFactions = factionsThatAllowHacking.length;\n const randFaction = factionsThatAllowHacking[getRandomInt(0, numFactions - 1)];\n reward.name = randFaction;\n break;\n }\n case CodingContractRewardType.CompanyReputation: {\n const allJobs = Object.keys(Player.jobs);\n if (allJobs.length > 0) {\n reward.name = allJobs[getRandomInt(0, allJobs.length - 1)];\n } else {\n reward.type = CodingContractRewardType.Money;\n }\n break;\n }\n default:\n break;\n }\n\n return reward;\n}\n\nfunction getRandomServer(): BaseServer {\n const servers = GetAllServers().filter((server: BaseServer) => server.serversOnNetwork.length !== 0);\n let randIndex = getRandomInt(0, servers.length - 1);\n let randServer = servers[randIndex];\n\n // An infinite loop shouldn't ever happen, but to be safe we'll use\n // a for loop with a limited number of tries\n for (let i = 0; i < 200; ++i) {\n if (\n randServer instanceof Server &&\n !randServer.purchasedByPlayer &&\n randServer.hostname !== SpecialServers.WorldDaemon\n ) {\n break;\n }\n randIndex = getRandomInt(0, servers.length - 1);\n randServer = servers[randIndex];\n }\n\n return randServer;\n}\n\nfunction getRandomFilename(server: BaseServer, reward: ICodingContractReward = { name: \"\", type: 0 }): string {\n let contractFn = `contract-${getRandomInt(0, 1e6)}`;\n\n for (let i = 0; i < 1000; ++i) {\n if (\n server.contracts.filter((c: CodingContract) => {\n return c.fn === contractFn;\n }).length <= 0\n ) {\n break;\n }\n contractFn = `contract-${getRandomInt(0, 1e6)}`;\n }\n\n if (reward.name) {\n // Only alphanumeric characters in the reward name.\n contractFn += `-${reward.name.replace(/[^a-zA-Z0-9]/g, \"\")}`;\n }\n\n return contractFn;\n}\n","/**\n * Adds a random offset to a number within a certain percentage\n * @example\n * // Returns between 95-105\n * addOffset(100, 5);\n * @example\n * // Returns between 63-77\n * addOffSet(70, 10);\n * @param midpoint The number to be the midpoint of the offset range\n * @param percentage The percentage (in a range of 0-100) to offset\n */\nexport function addOffset(midpoint: number, percentage: number): number {\n const maxPercent = 100;\n if (percentage < 0 || percentage > maxPercent) {\n return midpoint;\n }\n\n const offset: number = midpoint * (percentage / maxPercent);\n\n // Double the range to account for both sides of the midpoint.\n // tslint:disable-next-line:no-magic-numbers\n return midpoint + (Math.random() * (offset * 2) - offset);\n}\n","export class DarkWebItem {\n program: string;\n price: number;\n description: string;\n\n constructor(program: string, price: number, description: string) {\n this.program = program;\n this.price = price;\n this.description = description;\n }\n}\n","export class PlayerOwnedAugmentation {\n level = 1;\n name = \"\";\n\n constructor(name = \"\") {\n this.name = name;\n }\n}\n","interface RNG {\n random(): number;\n}\n\n/*\n * very bad RNG, meant to be used as introduction to RNG manipulation. It has a\n * period of 1024.\n */\nclass RNG0 implements RNG {\n x: number;\n m = 1024;\n a = 341;\n c = 1;\n\n constructor() {\n this.x = 0;\n this.reset();\n }\n\n step(): void {\n this.x = (this.a * this.x + this.c) % this.m;\n }\n\n random(): number {\n this.step();\n return this.x / this.m;\n }\n\n reset(): void {\n this.x = new Date().getTime() % this.m;\n }\n}\n\nexport const BadRNG: RNG0 = new RNG0();\n\n/*\n * Wichmann–Hill PRNG\n * The period is 6e12.\n */\nexport class WHRNG implements RNG {\n s1 = 0;\n s2 = 0;\n s3 = 0;\n\n constructor(totalPlaytime: number) {\n // This one is seeded by the players total play time.\n const v: number = (totalPlaytime / 1000) % 30000;\n this.s1 = v;\n this.s2 = v;\n this.s3 = v;\n }\n\n step(): void {\n this.s1 = (171 * this.s1) % 30269;\n this.s2 = (172 * this.s2) % 30307;\n this.s3 = (170 * this.s3) % 30323;\n }\n\n random(): number {\n this.step();\n return (this.s1 / 30269.0 + this.s2 / 30307.0 + this.s3 / 30323.0) % 1.0;\n }\n}\n\nexport function SFC32RNG(seed: string): () => number {\n let h = 1779033703 ^ seed.length;\n for (let i = 0; i < seed.length; i++) {\n h = Math.imul(h ^ seed.charCodeAt(i), 3432918353);\n h = (h << 13) | (h >>> 19);\n }\n const genSeed = (): number => {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n\n let a = genSeed();\n let b = genSeed();\n let c = genSeed();\n let d = genSeed();\n return (): number => {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n","import React from \"react\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { Player } from \"@player\";\nimport { Work, WorkType } from \"./Work\";\nimport { influenceStockThroughCompanyWork } from \"../StockMarket/PlayerInfluencing\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { calculateCompanyWorkStats } from \"./formulas/Company\";\nimport { Companies } from \"../Company/Companies\";\nimport { applyWorkStats, scaleWorkStats, WorkStats } from \"./WorkStats\";\nimport { Company } from \"../Company/Company\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reputation } from \"../ui/React/Reputation\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { CONSTANTS } from \"../Constants\";\n\ninterface CompanyWorkParams {\n companyName: string;\n singularity: boolean;\n}\n\nexport const isCompanyWork = (w: Work | null): w is CompanyWork => w !== null && w.type === WorkType.COMPANY;\n\nexport class CompanyWork extends Work {\n companyName: string;\n constructor(params?: CompanyWorkParams) {\n super(WorkType.COMPANY, params?.singularity ?? false);\n this.companyName = params?.companyName ?? LocationName.NewTokyoNoodleBar;\n }\n\n getCompany(): Company {\n const c = Companies[this.companyName];\n if (!c) throw new Error(`Company not found: '${this.companyName}'`);\n return c;\n }\n\n getGainRates(): WorkStats {\n let focusBonus = 1;\n if (!Player.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {\n focusBonus = Player.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n return scaleWorkStats(calculateCompanyWorkStats(Player, this.getCompany()), focusBonus);\n }\n\n process(cycles: number): boolean {\n this.cyclesWorked += cycles;\n const company = this.getCompany();\n const gains = this.getGainRates();\n applyWorkStats(Player, gains, cycles, \"work\");\n company.playerReputation += gains.reputation * cycles;\n influenceStockThroughCompanyWork(company, gains.reputation, cycles);\n return false;\n }\n finish(): void {\n if (!this.singularity) {\n dialogBoxCreate(\n <>\n You finished working for {this.companyName}\n <br />\n You have <Reputation reputation={this.getCompany().playerReputation} /> reputation with them.\n </>,\n );\n }\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n companyName: this.companyName,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"CompanyWork\", this);\n }\n\n /** Initializes a CompanyWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): CompanyWork {\n return Generic_fromJSON(CompanyWork, value.data);\n }\n}\n\nReviver.constructors.CompanyWork = CompanyWork;\n","import { Paper, Typography } from \"@mui/material\";\nimport React from \"react\";\n\ninterface IProps {\n children: React.ReactNode;\n title: string;\n}\n\nexport const GameOptionsPage = (props: IProps): React.ReactElement => {\n return (\n <Paper sx={{ height: \"fit-content\", p: 1 }}>\n <Typography variant=\"h6\">{props.title}</Typography>\n {props.children}\n </Paper>\n );\n};\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n favor: {\n color: theme.colors.rep,\n },\n }),\n);\n\nexport function Favor({ favor }: { favor: number | string }): React.ReactElement {\n const classes = useStyles();\n return <span className={classes.favor}>{typeof favor === \"number\" ? numeralWrapper.formatFavor(favor) : favor}</span>;\n}\n","import { EventEmitter } from \"../utils/EventEmitter\";\nexport const TerminalEvents = new EventEmitter<[]>();\nexport const TerminalClearEvents = new EventEmitter<[]>();\n","/**\n * Helper functions for determine whether Limit and Stop orders should\n * be executed (and executing them)\n */\nimport { buyStock, sellStock, shortStock, sellShort } from \"./BuyingAndSelling\";\nimport { IOrderBook } from \"./IOrderBook\";\nimport { IStockMarket } from \"./IStockMarket\";\nimport { Order } from \"./Order\";\nimport { Stock } from \"./Stock\";\n\nimport { OrderTypes } from \"./data/OrderTypes\";\nimport { PositionTypes } from \"./data/PositionTypes\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Settings } from \"../Settings/Settings\";\n\nimport * as React from \"react\";\n\nexport interface IProcessOrderRefs {\n stockMarket: IStockMarket;\n symbolToStockMap: Record<string, Stock>;\n}\n\n/**\n * Search for all orders of a specific type and execute them if appropriate\n * @param {Stock} stock - Stock for which orders should be processed\n * @param {OrderTypes} orderType - Type of order to check (Limit/Stop buy/sell)\n * @param {PositionTypes} posType - Long or short\n * @param {IProcessOrderRefs} refs - References to objects/functions that are required for this function\n */\nexport function processOrders(\n stock: Stock,\n orderType: OrderTypes,\n posType: PositionTypes,\n refs: IProcessOrderRefs,\n): void {\n const orderBook = refs.stockMarket[\"Orders\"];\n if (orderBook == null) {\n const orders: IOrderBook = {};\n for (const name of Object.keys(refs.stockMarket)) {\n const stock = refs.stockMarket[name];\n if (!(stock instanceof Stock)) {\n continue;\n }\n orders[stock.symbol] = [];\n }\n refs.stockMarket[\"Orders\"] = orders;\n return; // Newly created, so no orders to process\n }\n let stockOrders = orderBook[stock.symbol];\n if (stockOrders == null || !(stockOrders.constructor === Array)) {\n console.error(`Invalid Order book for ${stock.symbol} in processOrders(): ${stockOrders}`);\n stockOrders = [];\n return;\n }\n\n for (const order of stockOrders) {\n if (order.type === orderType && order.pos === posType) {\n switch (order.type) {\n case OrderTypes.LimitBuy:\n if (order.pos === PositionTypes.Long && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n case OrderTypes.LimitSell:\n if (order.pos === PositionTypes.Long && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n case OrderTypes.StopBuy:\n if (order.pos === PositionTypes.Long && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n case OrderTypes.StopSell:\n if (order.pos === PositionTypes.Long && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n default:\n console.warn(`Invalid order type: ${order.type}`);\n return;\n }\n }\n }\n}\n\n/**\n * Execute a Stop or Limit Order.\n * @param {Order} order - Order being executed\n * @param {IProcessOrderRefs} refs - References to objects/functions that are required for this function\n */\nfunction executeOrder(order: Order, refs: IProcessOrderRefs): void {\n const stock = refs.symbolToStockMap[order.stockSymbol];\n if (!(stock instanceof Stock)) {\n console.error(`Could not find stock for this order: ${order.stockSymbol}`);\n return;\n }\n const stockMarket = refs.stockMarket;\n const orderBook = stockMarket[\"Orders\"];\n const stockOrders = orderBook[stock.symbol];\n\n // When orders are executed, the buying and selling functions shouldn't\n // emit popup dialog boxes. This options object configures the functions for that\n const opts = {\n suppressDialog: true,\n };\n\n let res = true;\n let isBuy = false;\n switch (order.type) {\n case OrderTypes.LimitBuy:\n case OrderTypes.StopBuy:\n isBuy = true;\n if (order.pos === PositionTypes.Long) {\n res = buyStock(stock, order.shares, null, opts) && res;\n } else if (order.pos === PositionTypes.Short) {\n res = shortStock(stock, order.shares, null, opts) && res;\n }\n break;\n case OrderTypes.LimitSell:\n case OrderTypes.StopSell:\n if (order.pos === PositionTypes.Long) {\n res = sellStock(stock, order.shares, null, opts) && res;\n } else if (order.pos === PositionTypes.Short) {\n res = sellShort(stock, order.shares, null, opts) && res;\n }\n break;\n default:\n console.warn(`Invalid order type: ${order.type}`);\n return;\n }\n\n // Position type, for logging/message purposes\n const pos = order.pos === PositionTypes.Long ? \"Long\" : \"Short\";\n\n if (res) {\n for (let i = 0; i < stockOrders.length; ++i) {\n if (order == stockOrders[i]) {\n stockOrders.splice(i, 1);\n if (!Settings.SuppressTIXPopup) {\n dialogBoxCreate(\n <>\n {order.type} for {stock.symbol} @ <Money money={order.price} /> ({pos}) was filled (\n {numeralWrapper.formatShares(Math.round(order.shares))} shares)\n </>,\n );\n }\n return;\n }\n }\n\n console.error(\"Could not find the following Order in Order Book: \");\n console.error(order);\n } else if (isBuy) {\n dialogBoxCreate(\n <>\n Failed to execute {order.type} for {stock.symbol} @ <Money money={order.price} /> ({pos}). This is most likely\n because you do not have enough money or the order would exceed the stock's maximum number of shares\n </>,\n );\n }\n}\n","function getDB(): Promise<IDBObjectStore> {\n return new Promise((resolve, reject) => {\n if (!window.indexedDB) {\n reject(\"Indexed DB does not exists\");\n }\n /**\n * DB is called bitburnerSave\n * Object store is called savestring\n * key for the Object store is called save\n * Version `1` is important\n */\n const indexedDbRequest: IDBOpenDBRequest = window.indexedDB.open(\"bitburnerSave\", 1);\n\n // This is called when there's no db to begin with. It's important, don't remove it.\n indexedDbRequest.onupgradeneeded = function (this: IDBRequest<IDBDatabase>) {\n const db = this.result;\n db.createObjectStore(\"savestring\");\n };\n\n indexedDbRequest.onerror = function (this: IDBRequest<IDBDatabase>, ev: Event) {\n reject(`Failed to get IDB ${ev}`);\n };\n\n indexedDbRequest.onsuccess = function (this: IDBRequest<IDBDatabase>) {\n const db = this.result;\n if (!db) {\n reject(\"database loading result was undefined\");\n return;\n }\n resolve(db.transaction([\"savestring\"], \"readwrite\").objectStore(\"savestring\"));\n };\n });\n}\n\nexport function load(): Promise<string> {\n return new Promise((resolve, reject) => {\n getDB()\n .then((db) => {\n return new Promise<string>((resolve, reject) => {\n const request: IDBRequest<string> = db.get(\"save\");\n request.onerror = function (this: IDBRequest<string>, ev: Event) {\n reject(\"Error in Database request to get savestring: \" + ev);\n };\n\n request.onsuccess = function (this: IDBRequest<string>) {\n resolve(this.result);\n };\n }).then((saveString) => resolve(saveString));\n })\n .catch((r) => reject(r));\n });\n}\n\nexport function save(saveString: string): Promise<void> {\n return getDB().then((db) => {\n return new Promise<void>((resolve, reject) => {\n // We'll save to both localstorage and indexedDb\n const request = db.put(saveString, \"save\");\n\n request.onerror = function (e) {\n reject(\"Error saving game to IndexedDB: \" + e);\n };\n\n request.onsuccess = () => resolve();\n });\n });\n}\n\nexport function deleteGame(): Promise<void> {\n return getDB().then((db) => {\n db.delete(\"save\");\n });\n}\n","import { Player } from \"@player\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Work, WorkType } from \"./Work\";\n\nexport const isSleeveSupportWork = (w: Work | null): w is SleeveSupportWork =>\n w !== null && w.type === WorkType.SUPPORT;\n\nexport class SleeveSupportWork extends Work {\n constructor() {\n super(WorkType.SUPPORT);\n Player.bladeburner?.sleeveSupport(true);\n }\n\n process(): number {\n return 0;\n }\n\n finish(): void {\n Player.bladeburner?.sleeveSupport(false);\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveSupportWork\", this);\n }\n\n /** Initializes a BladeburnerWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): SleeveSupportWork {\n return Generic_fromJSON(SleeveSupportWork, value.data);\n }\n}\n\nReviver.constructors.SleeveSupportWork = SleeveSupportWork;\n","import { getRandomByte } from \"./helpers/getRandomByte\";\n\n/**\n * Generate a random IP address\n * Does not check to see if the IP already exists in the game\n */\nexport const createRandomIp = (): string =>\n `${getRandomByte(99)}.${getRandomByte(9)}.${getRandomByte(9)}.${getRandomByte(9)}`;\n","import React from \"react\";\nimport { Message } from \"./Message\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { Router } from \"../ui/GameRoot\";\nimport { Programs } from \"../Programs/Programs\";\nimport { Player } from \"@player\";\nimport { Page } from \"../ui/Router\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Settings } from \"../Settings/Settings\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Server } from \"../Server/Server\";\n\n//Sends message to player, including a pop up\nfunction sendMessage(msg: Message, forced = false): void {\n if (forced || !Settings.SuppressMessages) {\n showMessage(msg.filename);\n }\n addMessageToServer(msg);\n}\n\nfunction showMessage(name: MessageFilenames): void {\n const msg = Messages[name];\n if (!(msg instanceof Message)) throw new Error(\"trying to display nonexistent message\");\n dialogBoxCreate(\n <>\n Message received from unknown sender:\n <br />\n <br />\n <i>{msg.msg}</i>This message was saved as {msg.filename} onto your home computer.\n </>,\n );\n}\n\n//Adds a message to a server\nfunction addMessageToServer(msg: Message): void {\n //Short-circuit if the message has already been saved\n if (recvd(msg)) {\n return;\n }\n const server = GetServer(\"home\");\n if (server == null) {\n throw new Error(\"The home server doesn't exist. You done goofed.\");\n }\n server.messages.push(msg.filename);\n}\n\n//Returns whether the given message has already been received\nfunction recvd(msg: Message): boolean {\n const server = GetServer(\"home\");\n if (server == null) {\n throw new Error(\"The home server doesn't exist. You done goofed.\");\n }\n return server.messages.includes(msg.filename);\n}\n\n//Checks if any of the 'timed' messages should be sent\nfunction checkForMessagesToSend(): void {\n if (Router.page() === Page.BitVerse) return;\n const jumper0 = Messages[MessageFilenames.Jumper0];\n const jumper1 = Messages[MessageFilenames.Jumper1];\n const jumper2 = Messages[MessageFilenames.Jumper2];\n const jumper3 = Messages[MessageFilenames.Jumper3];\n const jumper4 = Messages[MessageFilenames.Jumper4];\n const cybersecTest = Messages[MessageFilenames.CyberSecTest];\n const nitesecTest = Messages[MessageFilenames.NiteSecTest];\n const bitrunnersTest = Messages[MessageFilenames.BitRunnersTest];\n const truthGazer = Messages[MessageFilenames.TruthGazer];\n const redpill = Messages[MessageFilenames.RedPill];\n\n if (Player.hasAugmentation(AugmentationNames.TheRedPill, true)) {\n //Get the world daemon required hacking level\n const worldDaemon = GetServer(SpecialServers.WorldDaemon);\n if (!(worldDaemon instanceof Server)) {\n throw new Error(\"The world daemon is not a server???? Please un-break reality\");\n }\n //If the daemon can be hacked, send the player icarus.msg\n if (Player.skills.hacking >= worldDaemon.requiredHackingSkill) {\n sendMessage(redpill, Player.sourceFiles.length === 0);\n }\n //If the daemon cannot be hacked, send the player truthgazer.msg a single time.\n else if (!recvd(truthGazer)) {\n sendMessage(truthGazer);\n }\n } else if (!recvd(jumper0) && Player.skills.hacking >= 25) {\n sendMessage(jumper0);\n const flightName = Programs.Flight.name;\n const homeComp = Player.getHomeComputer();\n if (!homeComp.programs.includes(flightName)) {\n homeComp.programs.push(flightName);\n }\n } else if (!recvd(jumper1) && Player.skills.hacking >= 40) {\n sendMessage(jumper1);\n } else if (!recvd(cybersecTest) && Player.skills.hacking >= 50) {\n sendMessage(cybersecTest);\n } else if (!recvd(jumper2) && Player.skills.hacking >= 175) {\n sendMessage(jumper2);\n } else if (!recvd(nitesecTest) && Player.skills.hacking >= 200) {\n sendMessage(nitesecTest);\n } else if (!recvd(jumper3) && Player.skills.hacking >= 350) {\n sendMessage(jumper3);\n } else if (!recvd(jumper4) && Player.skills.hacking >= 490) {\n sendMessage(jumper4);\n } else if (!recvd(bitrunnersTest) && Player.skills.hacking >= 500) {\n sendMessage(bitrunnersTest);\n }\n}\n\nexport enum MessageFilenames {\n Jumper0 = \"j0.msg\",\n Jumper1 = \"j1.msg\",\n Jumper2 = \"j2.msg\",\n Jumper3 = \"j3.msg\",\n Jumper4 = \"j4.msg\",\n CyberSecTest = \"csec-test.msg\",\n NiteSecTest = \"nitesec-test.msg\",\n BitRunnersTest = \"19dfj3l1nd.msg\",\n TruthGazer = \"truthgazer.msg\",\n RedPill = \"icarus.msg\",\n}\n\n//Reset\nconst Messages: Record<MessageFilenames, Message> = {\n //jump3R Messages\n [MessageFilenames.Jumper0]: new Message(\n MessageFilenames.Jumper0,\n \"I know you can sense it. I know you're searching for it. \" +\n \"It's why you spend night after \" +\n \"night at your computer. \\n\\nIt's real, I've seen it. And I can \" +\n \"help you find it. But not right now. You're not ready yet.\\n\\n\" +\n \"Use this program to track your progress\\n\\n\" +\n \"The fl1ght.exe program was added to your home computer\\n\\n\" +\n \"-jump3R\",\n ),\n\n [MessageFilenames.Jumper1]: new Message(\n MessageFilenames.Jumper1,\n `Soon you will be contacted by a hacking group known as ${FactionNames.NiteSec}. ` +\n \"They can help you with your search. \\n\\n\" +\n \"You should join them, garner their favor, and \" +\n \"exploit them for their Augmentations. But do not trust them. \" +\n \"They are not what they seem. No one is.\\n\\n\" +\n \"-jump3R\",\n ),\n\n [MessageFilenames.Jumper2]: new Message(\n MessageFilenames.Jumper2,\n \"Do not try to save the world. There is no world to save. If \" +\n \"you want to find the truth, worry only about yourself. Ethics and \" +\n `morals will get you killed. \\n\\nWatch out for a hacking group known as ${FactionNames.NiteSec}.` +\n \"\\n\\n-jump3R\",\n ),\n\n [MessageFilenames.Jumper3]: new Message(\n MessageFilenames.Jumper3,\n \"You must learn to walk before you can run. And you must \" +\n `run before you can fly. Look for ${FactionNames.TheBlackHand}. \\n\\n` +\n \"I.I.I.I \\n\\n-jump3R\",\n ),\n\n [MessageFilenames.Jumper4]: new Message(\n MessageFilenames.Jumper4,\n \"To find what you are searching for, you must understand the bits. \" +\n \"The bits are all around us. The runners will help you.\\n\\n\" +\n \"-jump3R\",\n ),\n\n //Messages from hacking factions\n [MessageFilenames.CyberSecTest]: new Message(\n MessageFilenames.CyberSecTest,\n \"We've been watching you. Your skills are very impressive. But you're wasting \" +\n \"your talents. If you join us, you can put your skills to good use and change \" +\n \"the world for the better. If you join us, we can unlock your full potential. \\n\\n\" +\n \"But first, you must pass our test. Find and install the backdoor on our server. \\n\\n\" +\n `-${FactionNames.CyberSec}`,\n ),\n\n [MessageFilenames.NiteSecTest]: new Message(\n MessageFilenames.NiteSecTest,\n \"People say that the corrupted governments and corporations rule the world. \" +\n \"Yes, maybe they do. But do you know who everyone really fears? People \" +\n \"like us. Because they can't hide from us. Because they can't fight shadows \" +\n \"and ideas with bullets. \\n\\n\" +\n \"Join us, and people will fear you, too. \\n\\n\" +\n \"Find and install the backdoor on our server, avmnite-02h. Then, we will contact you again.\" +\n `\\n\\n-${FactionNames.NiteSec}`,\n ),\n\n [MessageFilenames.BitRunnersTest]: new Message(\n MessageFilenames.BitRunnersTest,\n \"We know what you are doing. We know what drives you. We know \" +\n \"what you are looking for. \\n\\n \" +\n \"We can help you find the answers.\\n\\n\" +\n \"run4theh111z\",\n ),\n\n //Messages to guide players to the daemon\n [MessageFilenames.TruthGazer]: new Message(\n MessageFilenames.TruthGazer,\n //\"THE TRUTH CAN NO LONGER ESCAPE YOUR GAZE\"\n \"@&*($#@&__TH3__#@A&#@*)__TRU1H__(*)&*)($#@&()E&R)W&\\n\" +\n \"%@*$^$()@&$)$*@__CAN__()(@^#)@&@)#__N0__(#@&#)@&@&(\\n\" +\n \"*(__LON6ER__^#)@)(()*#@)@__ESCAP3__)#(@(#@*@()@(#*$\\n\" +\n \"()@)#$*%)$#()$#__Y0UR__(*)$#()%(&(%)*!)($__GAZ3__#(\",\n ),\n\n [MessageFilenames.RedPill]: new Message(\n MessageFilenames.RedPill,\n //\"FIND THE-CAVE\"\n \"@)(#V%*N)@(#*)*C)@#%*)*V)@#(*%V@)(#VN%*)@#(*%\\n\" +\n \")@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)\\n\" +\n \"@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB\\n\" +\n \"DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)\",\n ),\n};\n\nexport { Messages, checkForMessagesToSend, showMessage };\n","import { RunningScript } from \"src/Script/RunningScript\";\nimport { Settings } from \"../Settings/Settings\";\nimport { WorkerScript } from \"./WorkerScript\";\n\nexport const recentScripts: RecentScript[] = [];\n\nexport function AddRecentScript(workerScript: WorkerScript): void {\n if (recentScripts.find((r) => r.runningScript.pid === workerScript.pid)) return;\n\n const killedTime = new Date();\n recentScripts.unshift({\n timeOfDeath: killedTime,\n runningScript: workerScript.scriptRef,\n });\n\n while (recentScripts.length > Settings.MaxRecentScriptsCapacity) {\n recentScripts.pop();\n }\n}\n\nexport interface RecentScript {\n timeOfDeath: Date;\n runningScript: RunningScript;\n}\n","import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { applySleeveGains, Work, WorkType } from \"./Work\";\nimport { ClassType } from \"../../../Work/ClassWork\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { calculateClassEarnings } from \"../../../Work/formulas/Class\";\nimport { Sleeve } from \"../Sleeve\";\nimport { scaleWorkStats, WorkStats } from \"../../../Work/WorkStats\";\n\nexport const isSleeveClassWork = (w: Work | null): w is SleeveClassWork => w !== null && w.type === WorkType.CLASS;\n\ninterface ClassWorkParams {\n classType: ClassType;\n location: LocationName;\n}\n\nexport class SleeveClassWork extends Work {\n classType: ClassType;\n location: LocationName;\n\n constructor(params?: ClassWorkParams) {\n super(WorkType.CLASS);\n this.classType = params?.classType ?? ClassType.StudyComputerScience;\n this.location = params?.location ?? LocationName.Sector12RothmanUniversity;\n }\n\n calculateRates(sleeve: Sleeve): WorkStats {\n return scaleWorkStats(calculateClassEarnings(sleeve, this.classType, this.location), sleeve.shockBonus(), false);\n }\n\n isGym(): boolean {\n return [ClassType.GymAgility, ClassType.GymDefense, ClassType.GymDexterity, ClassType.GymStrength].includes(\n this.classType,\n );\n }\n\n process(sleeve: Sleeve, cycles: number): number {\n const rate = this.calculateRates(sleeve);\n applySleeveGains(sleeve, rate, cycles);\n return 0;\n }\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n classType: this.classType,\n location: this.location,\n };\n }\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveClassWork\", this);\n }\n\n /** Initializes a ClassWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): SleeveClassWork {\n return Generic_fromJSON(SleeveClassWork, value.data);\n }\n}\n\nReviver.constructors.SleeveClassWork = SleeveClassWork;\n","import { Player } from \"@player\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { applySleeveGains, Work, WorkType } from \"./Work\";\nimport { CrimeType } from \"../../../utils/WorkType\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { Crime } from \"../../../Crime/Crime\";\nimport { newWorkStats, scaleWorkStats, WorkStats } from \"../../../Work/WorkStats\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { BitNodeMultipliers } from \"../../../BitNode/BitNodeMultipliers\";\n\nexport const isSleeveCrimeWork = (w: Work | null): w is SleeveCrimeWork => w !== null && w.type === WorkType.CRIME;\n\nexport class SleeveCrimeWork extends Work {\n crimeType: CrimeType;\n cyclesWorked = 0;\n constructor(crimeType?: CrimeType) {\n super(WorkType.CRIME);\n this.crimeType = crimeType ?? CrimeType.SHOPLIFT;\n }\n\n getCrime(): Crime {\n const crime = Object.values(Crimes).find((crime) => crime.type === this.crimeType);\n if (!crime) throw new Error(\"crime should not be undefined\");\n return crime;\n }\n\n getExp(sleeve: Sleeve): WorkStats {\n const crime = this.getCrime();\n return newWorkStats({\n money: crime.money * BitNodeMultipliers.CrimeMoney * sleeve.mults.crime_money,\n hackExp: crime.hacking_exp * BitNodeMultipliers.CrimeExpGain * sleeve.mults.hacking_exp,\n strExp: crime.strength_exp * BitNodeMultipliers.CrimeExpGain * sleeve.mults.strength_exp,\n defExp: crime.defense_exp * BitNodeMultipliers.CrimeExpGain * sleeve.mults.defense_exp,\n dexExp: crime.dexterity_exp * BitNodeMultipliers.CrimeExpGain * sleeve.mults.dexterity_exp,\n agiExp: crime.agility_exp * BitNodeMultipliers.CrimeExpGain * sleeve.mults.agility_exp,\n chaExp: crime.charisma_exp * BitNodeMultipliers.CrimeExpGain * sleeve.mults.charisma_exp,\n intExp: crime.intelligence_exp * BitNodeMultipliers.CrimeExpGain,\n });\n }\n\n cyclesNeeded(): number {\n return this.getCrime().time / CONSTANTS._idleSpeed;\n }\n\n process(sleeve: Sleeve, cycles: number): number {\n this.cyclesWorked += cycles;\n\n const crime = this.getCrime();\n let gains = this.getExp(sleeve);\n if (this.cyclesWorked >= this.cyclesNeeded()) {\n if (Math.random() < crime.successRate(sleeve)) {\n Player.karma -= crime.karma * sleeve.syncBonus();\n } else {\n gains.money = 0;\n gains = scaleWorkStats(gains, 0.25);\n }\n applySleeveGains(sleeve, gains, cycles);\n this.cyclesWorked -= this.cyclesNeeded();\n }\n return 0;\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n crimeType: this.crimeType,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveCrimeWork\", this);\n }\n\n /** Initializes a RecoveryWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): SleeveCrimeWork {\n return Generic_fromJSON(SleeveCrimeWork, value.data);\n }\n}\n\nReviver.constructors.SleeveCrimeWork = SleeveCrimeWork;\n","// The initial formulas was sum 0 to f of 500*1.02^f.\n// see https://en.wikipedia.org/wiki/Geometric_series#Closed-form_formula\n// for information on how to calculate this\n\nexport function favorToRep(f: number): number {\n const raw = 25000 * (Math.pow(1.02, f) - 1);\n return Math.round(raw * 10000) / 10000; // round to make things easier.\n}\n\nexport function repToFavor(r: number): number {\n const raw = Math.log(r / 25000 + 1) / Math.log(1.02);\n return Math.round(raw * 10000) / 10000; // round to make things easier.\n}\n","import { format } from \"date-fns\";\n\nexport function formatTime(fmt: string): string {\n try {\n return format(new Date(), fmt);\n } catch (e: unknown) {\n return \"format error\";\n }\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Reputation } from \"./Reputation\";\n\nexport function ReputationRate({ reputation }: { reputation: number }): React.ReactElement {\n return <Reputation reputation={`${numeralWrapper.formatReputation(reputation)} / sec`} />;\n}\n","import { Bladeburner } from \"./Bladeburner\";\nimport { BladeburnerConstants } from \"./data/Constants\";\nimport { Action, IActionParams } from \"./Action\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IOperationParams extends IActionParams {\n reqdRank?: number;\n teamCount?: number;\n}\n\nexport class Operation extends Action {\n reqdRank = 100;\n teamCount = 0;\n\n constructor(params: IOperationParams | null = null) {\n super(params);\n if (params && params.reqdRank) this.reqdRank = params.reqdRank;\n if (params && params.teamCount) this.teamCount = params.teamCount;\n }\n\n // For actions that have teams. To be implemented by subtypes.\n getTeamSuccessBonus(inst: Bladeburner): number {\n if (this.teamCount && this.teamCount > 0) {\n this.teamCount = Math.min(this.teamCount, inst.teamSize);\n const teamMultiplier = Math.pow(this.teamCount, 0.05);\n return teamMultiplier;\n }\n\n return 1;\n }\n\n getActionTypeSkillSuccessBonus(inst: Bladeburner): number {\n return inst.skillMultipliers.successChanceOperation;\n }\n\n getChaosDifficultyBonus(inst: Bladeburner /*, params: ISuccessChanceParams*/): number {\n const city = inst.getCurrentCity();\n if (city.chaos > BladeburnerConstants.ChaosThreshold) {\n const diff = 1 + (city.chaos - BladeburnerConstants.ChaosThreshold);\n const mult = Math.pow(diff, 0.5);\n return mult;\n }\n\n return 1;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Operation\", this);\n }\n\n static fromJSON(value: IReviverValue): Operation {\n return Generic_fromJSON(Operation, value.data);\n }\n}\n\nReviver.constructors.Operation = Operation;\n","/**\n * React component for a selectable option on the Faction UI. These\n * options including working for the faction, hacking missions, purchasing\n * augmentations, etc.\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n buttonText: string;\n infoText: string;\n onClick: (e: React.MouseEvent<HTMLElement>) => void;\n};\n\nexport function Option(props: IProps): React.ReactElement {\n return (\n <Box>\n <Paper sx={{ my: 1, p: 1 }}>\n <Button onClick={props.onClick}>{props.buttonText}</Button>\n <Typography>{props.infoText}</Typography>\n </Paper>\n </Box>\n );\n}\n","import { Augmentation, IConstructorParams } from \"../Augmentation\";\nimport { AugmentationNames } from \"./AugmentationNames\";\nimport { Player } from \"@player\";\nimport { Programs } from \"../../Programs/Programs\";\nimport { WHRNG } from \"../../Casino/RNG\";\nimport React from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { CONSTANTS } from \"../../Constants\";\n\ninterface CircadianBonus {\n bonuses: {\n [key: string]: number | undefined;\n agility?: number;\n agility_exp?: number;\n charisma?: number;\n charisma_exp?: number;\n company_rep?: number;\n crime_money?: number;\n crime_success?: number;\n defense?: number;\n defense_exp?: number;\n dexterity?: number;\n dexterity_exp?: number;\n faction_rep?: number;\n hacking?: number;\n hacking_chance?: number;\n hacking_exp?: number;\n hacking_grow?: number;\n hacking_money?: number;\n hacking_speed?: number;\n hacknet_node_core_cost?: number;\n hacknet_node_level_cost?: number;\n hacknet_node_money?: number;\n hacknet_node_purchase_cost?: number;\n hacknet_node_ram_cost?: number;\n strength?: number;\n strength_exp?: number;\n work_money?: number;\n };\n description: string;\n}\n\nfunction getRandomBonus(): CircadianBonus {\n const bonuses = [\n {\n bonuses: {\n hacking_chance: 1.25,\n hacking_speed: 1.1,\n hacking_money: 1.25,\n hacking_grow: 1.1,\n },\n description:\n \"Increases the player's hacking chance by 25%.<br>\" +\n \"Increases the player's hacking speed by 10%.<br>\" +\n \"Increases the amount of money the player's gains from hacking by 25%.<br>\" +\n \"Improves grow() by 10%.\",\n },\n {\n bonuses: {\n hacking: 1.15,\n hacking_exp: 2,\n },\n description:\n \"Increases the player's hacking skill by 15%.<br>\" +\n \"Increases the player's hacking experience gain rate by 100%.\",\n },\n {\n bonuses: {\n strength: 1.25,\n strength_exp: 2,\n defense: 1.25,\n defense_exp: 2,\n dexterity: 1.25,\n dexterity_exp: 2,\n agility: 1.25,\n agility_exp: 2,\n },\n description:\n \"Increases all of the player's combat stats by 25%.<br>\" +\n \"Increases all of the player's combat stat experience gain rate by 100%.\",\n },\n {\n bonuses: {\n charisma: 1.5,\n charisma_exp: 2,\n },\n description:\n \"This augmentation increases the player's charisma by 50%.<br>\" +\n \"Increases the player's charisma experience gain rate by 100%.\",\n },\n {\n bonuses: {\n hacknet_node_money: 1.2,\n hacknet_node_purchase_cost: 0.85,\n hacknet_node_ram_cost: 0.85,\n hacknet_node_core_cost: 0.85,\n hacknet_node_level_cost: 0.85,\n },\n description:\n \"Increases the amount of money produced by Hacknet Nodes by 20%.<br>\" +\n \"Decreases all costs related to Hacknet Node by 15%.\",\n },\n {\n bonuses: {\n company_rep: 1.25,\n faction_rep: 1.15,\n work_money: 1.7,\n },\n description:\n \"Increases the amount of money the player gains from working by 70%.<br>\" +\n \"Increases the amount of reputation the player gains when working for a company by 25%.<br>\" +\n \"Increases the amount of reputation the player gains for a faction by 15%.\",\n },\n {\n bonuses: {\n crime_success: 2,\n crime_money: 2,\n },\n description:\n \"Increases the player's crime success rate by 100%.<br>\" +\n \"Increases the amount of money the player gains from crimes by 100%.\",\n },\n ];\n\n const randomNumber = new WHRNG(Math.floor(Player.lastUpdate / 3600000));\n for (let i = 0; i < 5; i++) randomNumber.step();\n\n return bonuses[Math.floor(bonuses.length * randomNumber.random())];\n}\n\nexport const initSoAAugmentations = (): Augmentation[] => [\n new Augmentation({\n name: AugmentationNames.WKSharmonizer,\n repCost: 1e4,\n moneyCost: 1e6,\n info:\n `A copy of the WKS harmonizer from the MIA leader of the ${FactionNames.ShadowsOfAnarchy} ` +\n \"injects *Γ-based cells that provides general enhancement to the body.\",\n stats: (\n <>\n This augmentation makes many aspects of infiltration easier and more productive. Such as increased timer,\n rewards, reduced damage taken, etc.\n </>\n ),\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.MightOfAres,\n repCost: 1e4,\n moneyCost: 1e6,\n info:\n \"Extra-ocular neurons taken from old martial art master. Injecting them gives the user the ability to \" +\n \"predict the enemy's attack before they even know it themselves.\",\n stats: (\n <>This augmentation makes the Slash minigame easier by showing you via an indicator when the slash in coming.</>\n ),\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.WisdomOfAthena,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"A connective brain implant to SASHA that focuses on pattern recognition and predictive templating.\",\n stats: <>This augmentation makes the Bracket minigame easier by removing all '[' ']'.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.ChaosOfDionysus,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Opto-occipito implant to process visual signals before brain interpretation.\",\n stats: <>This augmentation makes the Backwards minigame easier by flipping the words.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.BeautyOfAphrodite,\n repCost: 1e4,\n moneyCost: 1e6,\n info:\n \"Pheromone extruder injected in the thoracodorsal nerve. Emits pleasing scent guaranteed to \" +\n \"make conversational partners more agreeable.\",\n stats: <>This augmentation makes the Bribe minigame easier by indicating the incorrect paths.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.TrickeryOfHermes,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Penta-dynamo-neurovascular-valve inserted in the carpal ligament, enhances dexterity.\",\n stats: <>This augmentation makes the Cheat Code minigame easier by allowing the opposite character.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.FloodOfPoseidon,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Transtinatium VVD reticulator used in optico-sterbing recognition.\",\n stats: <>This augmentation makes the Symbol matching minigame easier by indicating the correct choice.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.HuntOfArtemis,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"magneto-turboencabulator based on technology by Micha Eike Siemon, increases the user's electro-magnetic sensitivity.\",\n stats: (\n <>\n This augmentation makes the Minesweeper minigame easier by showing the location of all mines and keeping their\n position.\n </>\n ),\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.KnowledgeOfApollo,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Neodynic retention fjengeln spoofer using -φ karmions, net positive effect on implantee's delta wave.\",\n stats: <>This augmentation makes the Wire Cutting minigame easier by indicating the incorrect wires.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n];\n\nexport const initGeneralAugmentations = (): Augmentation[] => [\n new Augmentation({\n name: AugmentationNames.HemoRecirculator,\n moneyCost: 4.5e7,\n repCost: 1e4,\n info: \"A heart implant that greatly increases the body's ability to effectively use and pump blood.\",\n strength: 1.08,\n defense: 1.08,\n agility: 1.08,\n dexterity: 1.08,\n factions: [FactionNames.Tetrads, FactionNames.TheDarkArmy, FactionNames.TheSyndicate],\n }),\n new Augmentation({\n name: AugmentationNames.Targeting1,\n moneyCost: 1.5e7,\n repCost: 5e3,\n info:\n \"A cranial implant that is embedded within the inner ear structures and optic nerves. It regulates \" +\n \"and enhances balance and hand-eye coordination.\",\n dexterity: 1.1,\n factions: [\n FactionNames.SlumSnakes,\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Sector12,\n FactionNames.Ishima,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.Targeting2,\n moneyCost: 4.25e7,\n repCost: 8.75e3,\n info:\n \"This upgraded version of the 'Augmented Targeting' implant is capable of augmenting \" +\n \"reality by digitally displaying weaknesses and vital signs of threats.\",\n prereqs: [AugmentationNames.Targeting1],\n dexterity: 1.2,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Sector12,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.Targeting3,\n moneyCost: 1.15e8,\n repCost: 2.75e4,\n info: \"The latest version of the 'Augmented Targeting' implant adds the ability to lock-on and track threats.\",\n prereqs: [AugmentationNames.Targeting2, AugmentationNames.Targeting1],\n dexterity: 1.3,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n FactionNames.TheCovenant,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.SyntheticHeart,\n moneyCost: 2.875e9,\n repCost: 7.5e5,\n info:\n \"This advanced artificial heart, created from plasteel and graphene, is capable of pumping blood \" +\n \"more efficiently than an organic heart.\",\n agility: 1.5,\n strength: 1.5,\n factions: [\n FactionNames.KuaiGongInternational,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.SpeakersForTheDead,\n FactionNames.NWO,\n FactionNames.TheCovenant,\n FactionNames.Daedalus,\n FactionNames.Illuminati,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.SynfibrilMuscle,\n repCost: 4.375e5,\n moneyCost: 1.125e9,\n info:\n \"The myofibrils in human muscles are injected with special chemicals that react with the proteins inside \" +\n \"the myofibrils, altering their underlying structure. The end result is muscles that are stronger and more elastic. \" +\n \"Scientists have named these artificially enhanced units 'synfibrils'.\",\n strength: 1.3,\n defense: 1.3,\n factions: [\n FactionNames.KuaiGongInternational,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.SpeakersForTheDead,\n FactionNames.NWO,\n FactionNames.TheCovenant,\n FactionNames.Daedalus,\n FactionNames.Illuminati,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.CombatRib1,\n repCost: 7.5e3,\n moneyCost: 2.375e7,\n info:\n \"The rib cage is augmented to continuously release boosters into the bloodstream \" +\n \"which increase the oxygen-carrying capacity of blood.\",\n strength: 1.1,\n defense: 1.1,\n factions: [\n FactionNames.SlumSnakes,\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Volhaven,\n FactionNames.Ishima,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.CombatRib2,\n repCost: 1.875e4,\n moneyCost: 6.5e7,\n info:\n \"An upgraded version of the 'Combat Rib' augmentation that adds potent stimulants which \" +\n \"improve focus and endurance while decreasing reaction time and fatigue.\",\n prereqs: [AugmentationNames.CombatRib1],\n strength: 1.14,\n defense: 1.14,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Volhaven,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.CombatRib3,\n repCost: 3.5e4,\n moneyCost: 1.2e8,\n info:\n \"The latest version of the 'Combat Rib' augmentation releases advanced anabolic steroids that \" +\n \"improve muscle mass and physical performance while being safe and free of side effects.\",\n prereqs: [AugmentationNames.CombatRib2, AugmentationNames.CombatRib1],\n strength: 1.18,\n defense: 1.18,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n FactionNames.TheCovenant,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.NanofiberWeave,\n repCost: 3.75e4,\n moneyCost: 1.25e8,\n info:\n \"Synthetic nanofibers are woven into the skin's extracellular matrix using electrospinning, \" +\n \"which improves its regenerative and extracellular homeostasis abilities.\",\n strength: 1.2,\n defense: 1.2,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.OmniTekIncorporated,\n FactionNames.BladeIndustries,\n FactionNames.TianDiHui,\n FactionNames.SpeakersForTheDead,\n FactionNames.FulcrumSecretTechnologies,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.SubdermalArmor,\n repCost: 8.75e5,\n moneyCost: 3.25e9,\n info:\n \"The NEMEAN Subdermal Weave is a thin, light-weight, graphene plating that houses a dilatant fluid. \" +\n \"The material is implanted underneath the skin, and is the most advanced form of defensive enhancement \" +\n \"that has ever been created. The dilatant fluid, despite being thin and light, is extremely effective \" +\n \"at stopping piercing blows and reducing blunt trauma. The properties of graphene allow the plating to \" +\n \"mitigate damage from any fire or electrical traumas.\",\n defense: 2.2,\n factions: [\n FactionNames.TheSyndicate,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.Illuminati,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.WiredReflexes,\n repCost: 1.25e3,\n moneyCost: 2.5e6,\n info:\n \"Synthetic nerve-enhancements are injected into all major parts of the somatic nervous system, \" +\n \"supercharging the spread of neural signals and increasing reflex speed.\",\n agility: 1.05,\n dexterity: 1.05,\n factions: [\n FactionNames.TianDiHui,\n FactionNames.SlumSnakes,\n FactionNames.Sector12,\n FactionNames.Volhaven,\n FactionNames.Aevum,\n FactionNames.Ishima,\n FactionNames.TheSyndicate,\n FactionNames.TheDarkArmy,\n FactionNames.SpeakersForTheDead,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBoneLacings,\n repCost: 1.125e6,\n moneyCost: 4.25e9,\n info: \"Graphene is grafted and fused into the skeletal structure, enhancing bone density and tensile strength.\",\n strength: 1.7,\n defense: 1.7,\n factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.TheCovenant],\n }),\n new Augmentation({\n name: AugmentationNames.BionicSpine,\n repCost: 4.5e4,\n moneyCost: 1.25e8,\n info:\n \"The spine is reconstructed using plasteel and carbon fibers. \" +\n \"It is now capable of stimulating and regulating neural signals \" +\n \"passing through the spinal cord, improving senses and reaction speed. \" +\n \"The 'Bionic Spine' also interfaces with all other 'Bionic' implants.\",\n strength: 1.15,\n defense: 1.15,\n agility: 1.15,\n dexterity: 1.15,\n factions: [\n FactionNames.SpeakersForTheDead,\n FactionNames.TheSyndicate,\n FactionNames.KuaiGongInternational,\n FactionNames.OmniTekIncorporated,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBionicSpine,\n repCost: 1.625e6,\n moneyCost: 6e9,\n info:\n \"An upgrade to the 'Bionic Spine' augmentation. The spine is fused with graphene \" +\n \"which enhances durability and supercharges all body functions.\",\n prereqs: [AugmentationNames.BionicSpine],\n strength: 1.6,\n defense: 1.6,\n agility: 1.6,\n dexterity: 1.6,\n factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.ECorp],\n }),\n new Augmentation({\n name: AugmentationNames.BionicLegs,\n repCost: 1.5e5,\n moneyCost: 3.75e8,\n info: \"Cybernetic legs, created from plasteel and carbon fibers, enhance running speed.\",\n agility: 1.6,\n factions: [\n FactionNames.SpeakersForTheDead,\n FactionNames.TheSyndicate,\n FactionNames.KuaiGongInternational,\n FactionNames.OmniTekIncorporated,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBionicLegs,\n repCost: 7.5e5,\n moneyCost: 4.5e9,\n info:\n \"An upgrade to the 'Bionic Legs' augmentation. The legs are fused \" +\n \"with graphene, greatly enhancing jumping ability.\",\n prereqs: [AugmentationNames.BionicLegs],\n agility: 2.5,\n factions: [FactionNames.MegaCorp, FactionNames.ECorp, FactionNames.FulcrumSecretTechnologies],\n }),\n new Augmentation({\n name: AugmentationNames.SpeechProcessor,\n repCost: 7.5e3,\n moneyCost: 5e7,\n info:\n \"A cochlear implant with an embedded computer that analyzes incoming speech. \" +\n \"The embedded computer processes characteristics of incoming speech, such as tone \" +\n \"and inflection, to pick up on subtle cues and aid in social interactions.\",\n charisma: 1.2,\n factions: [\n FactionNames.TianDiHui,\n FactionNames.Chongqing,\n FactionNames.Sector12,\n FactionNames.NewTokyo,\n FactionNames.Aevum,\n FactionNames.Ishima,\n FactionNames.Volhaven,\n FactionNames.Silhouette,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.TITN41Injection,\n repCost: 2.5e4,\n moneyCost: 1.9e8,\n info:\n \"TITN is a series of viruses that targets and alters the sequences of human DNA in genes that \" +\n \"control personality. The TITN-41 strain alters these genes so that the subject becomes more \" +\n \"outgoing and sociable.\",\n charisma: 1.15,\n charisma_exp: 1.15,\n factions: [FactionNames.Silhouette],\n }),\n new Augmentation({\n name: AugmentationNames.EnhancedSocialInteractionImplant,\n repCost: 3.75e5,\n moneyCost: 1.375e9,\n info:\n \"A cranial implant that greatly assists in the user's ability to analyze social situations \" +\n \"and interactions. The system uses a wide variety of factors such as facial expression, body \" +\n \"language, voice tone, and inflection to determine the best course of action during social \" +\n \"situations. The implant also uses deep learning software to continuously learn new behavior \" +\n \"patterns and how to best respond.\",\n charisma: 1.6,\n charisma_exp: 1.6,\n factions: [\n FactionNames.BachmanAssociates,\n FactionNames.NWO,\n FactionNames.ClarkeIncorporated,\n FactionNames.OmniTekIncorporated,\n FactionNames.FourSigma,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.BitWire,\n repCost: 3.75e3,\n moneyCost: 1e7,\n info:\n \"A small brain implant embedded in the cerebrum. This regulates and improves the brain's computing \" +\n \"capabilities.\",\n hacking: 1.05,\n factions: [FactionNames.CyberSec, FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.ArtificialBioNeuralNetwork,\n repCost: 2.75e5,\n moneyCost: 3e9,\n info:\n \"A network consisting of millions of nanoprocessors is embedded into the brain. \" +\n \"The network is meant to mimic the way a biological brain solves a problem, with each \" +\n \"nanoprocessor acting similar to the way a neuron would in a neural network. However, these \" +\n \"nanoprocessors are programmed to perform computations much faster than organic neurons, \" +\n \"allowing the user to solve much more complex problems at a much faster rate.\",\n hacking_speed: 1.03,\n hacking_money: 1.15,\n hacking: 1.12,\n factions: [FactionNames.BitRunners, FactionNames.FulcrumSecretTechnologies],\n }),\n new Augmentation({\n name: AugmentationNames.ArtificialSynapticPotentiation,\n repCost: 6.25e3,\n moneyCost: 8e7,\n info:\n \"The body is injected with a chemical that artificially induces synaptic potentiation, \" +\n \"otherwise known as the strengthening of synapses. This results in enhanced cognitive abilities.\",\n hacking_speed: 1.02,\n hacking_chance: 1.05,\n hacking_exp: 1.05,\n factions: [FactionNames.TheBlackHand, FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.EnhancedMyelinSheathing,\n repCost: 1e5,\n moneyCost: 1.375e9,\n info:\n \"Electrical signals are used to induce a new, artificial form of myelinogenesis in the human body. \" +\n \"This process results in the proliferation of new, synthetic myelin sheaths in the nervous \" +\n \"system. These myelin sheaths can propagate neuro-signals much faster than their organic \" +\n \"counterparts, leading to greater processing speeds and better brain function.\",\n hacking_speed: 1.03,\n hacking_exp: 1.1,\n hacking: 1.08,\n factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.BitRunners, FactionNames.TheBlackHand],\n }),\n new Augmentation({\n name: AugmentationNames.SynapticEnhancement,\n repCost: 2e3,\n moneyCost: 7.5e6,\n info:\n \"A small cranial implant that continuously uses weak electrical signals to stimulate the brain and \" +\n \"induce stronger synaptic activity. This improves the user's cognitive abilities.\",\n hacking_speed: 1.03,\n factions: [FactionNames.CyberSec, FactionNames.Aevum],\n }),\n new Augmentation({\n name: AugmentationNames.NeuralRetentionEnhancement,\n repCost: 2e4,\n moneyCost: 2.5e8,\n info:\n \"Chemical injections are used to permanently alter and strengthen the brain's neuronal \" +\n \"circuits, strengthening the ability to retain information.\",\n hacking_exp: 1.25,\n factions: [FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.DataJack,\n repCost: 1.125e5,\n moneyCost: 4.5e8,\n info:\n \"A brain implant that provides an interface for direct, wireless communication between a computer's main \" +\n \"memory and the mind. This implant allows the user to not only access a computer's memory, but also alter \" +\n \"and delete it.\",\n hacking_money: 1.25,\n factions: [\n FactionNames.BitRunners,\n FactionNames.TheBlackHand,\n FactionNames.NiteSec,\n FactionNames.Chongqing,\n FactionNames.NewTokyo,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENM,\n repCost: 1.5e4,\n moneyCost: 2.5e8,\n info:\n \"A thin device embedded inside the arm containing a wireless module capable of connecting \" +\n \"to nearby networks. Once connected, the Netburner Module is capable of capturing and \" +\n \"processing all of the traffic on that network. By itself, the Embedded Netburner Module does \" +\n \"not do much, but a variety of very powerful upgrades can be installed that allow you to fully \" +\n \"control the traffic on a network.\",\n hacking: 1.08,\n factions: [\n FactionNames.BitRunners,\n FactionNames.TheBlackHand,\n FactionNames.NiteSec,\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENMCore,\n repCost: 175e3,\n moneyCost: 2.5e9,\n info:\n \"The Core library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgrade allows the Embedded Netburner Module to generate its own data on a network.\",\n prereqs: [AugmentationNames.ENM],\n hacking_speed: 1.03,\n hacking_money: 1.1,\n hacking_chance: 1.03,\n hacking_exp: 1.07,\n hacking: 1.07,\n factions: [\n FactionNames.BitRunners,\n FactionNames.TheBlackHand,\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENMCoreV2,\n repCost: 1e6,\n moneyCost: 4.5e9,\n info:\n \"The Core V2 library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgraded firmware allows the Embedded Netburner Module to control information on \" +\n \"a network by re-routing traffic, spoofing IP addresses, and altering the data inside network \" +\n \"packets.\",\n prereqs: [AugmentationNames.ENMCore, AugmentationNames.ENM],\n hacking_speed: 1.05,\n hacking_money: 1.3,\n hacking_chance: 1.05,\n hacking_exp: 1.15,\n hacking: 1.08,\n factions: [\n FactionNames.BitRunners,\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.BladeIndustries,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENMCoreV3,\n repCost: 1.75e6,\n moneyCost: 7.5e9,\n info:\n \"The Core V3 library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into \" +\n \"any device on a network.\",\n prereqs: [AugmentationNames.ENMCoreV2, AugmentationNames.ENMCore, AugmentationNames.ENM],\n hacking_speed: 1.05,\n hacking_money: 1.4,\n hacking_chance: 1.1,\n hacking_exp: 1.25,\n hacking: 1.1,\n factions: [\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n FactionNames.Illuminati,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENMAnalyzeEngine,\n repCost: 6.25e5,\n moneyCost: 6e9,\n info:\n \"Installs the Analyze Engine for the Embedded Netburner Module, which is a CPU cluster \" +\n \"that vastly outperforms the Netburner Module's native single-core processor.\",\n prereqs: [AugmentationNames.ENM],\n hacking_speed: 1.1,\n factions: [\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n FactionNames.Illuminati,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENMDMA,\n repCost: 1e6,\n moneyCost: 7e9,\n info:\n \"This implant installs a Direct Memory Access (DMA) controller into the \" +\n \"Embedded Netburner Module. This allows the Module to send and receive data \" +\n \"directly to and from the main memory of devices on a network.\",\n prereqs: [AugmentationNames.ENM],\n hacking_money: 1.4,\n hacking_chance: 1.2,\n factions: [\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n FactionNames.Illuminati,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.Neuralstimulator,\n repCost: 5e4,\n moneyCost: 3e9,\n info:\n \"A cranial implant that intelligently stimulates certain areas of the brain \" +\n \"in order to improve cognitive functions.\",\n hacking_speed: 1.02,\n hacking_chance: 1.1,\n hacking_exp: 1.12,\n factions: [\n FactionNames.TheBlackHand,\n FactionNames.Chongqing,\n FactionNames.Sector12,\n FactionNames.NewTokyo,\n FactionNames.Aevum,\n FactionNames.Ishima,\n FactionNames.Volhaven,\n FactionNames.BachmanAssociates,\n FactionNames.ClarkeIncorporated,\n FactionNames.FourSigma,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.NeuralAccelerator,\n repCost: 2e5,\n moneyCost: 1.75e9,\n info:\n \"A microprocessor that accelerates the processing \" +\n \"speed of biological neural networks. This is a cranial implant that is embedded inside the brain.\",\n hacking: 1.1,\n hacking_exp: 1.15,\n hacking_money: 1.2,\n factions: [FactionNames.BitRunners],\n }),\n new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG1,\n repCost: 1e4,\n moneyCost: 7e7,\n info:\n \"The first generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n hacking_speed: 1.01,\n hacking: 1.05,\n factions: [FactionNames.CyberSec, FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG2,\n repCost: 1.875e4,\n moneyCost: 1.25e8,\n info:\n \"The second generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG1],\n hacking_speed: 1.02,\n hacking_chance: 1.05,\n hacking: 1.07,\n factions: [FactionNames.CyberSec, FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG3,\n repCost: 5e4,\n moneyCost: 5.5e8,\n info:\n \"The third generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG2, AugmentationNames.CranialSignalProcessorsG1],\n hacking_speed: 1.02,\n hacking_money: 1.15,\n hacking: 1.09,\n factions: [FactionNames.NiteSec, FactionNames.TheBlackHand, FactionNames.BitRunners],\n }),\n new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG4,\n repCost: 1.25e5,\n moneyCost: 1.1e9,\n info:\n \"The fourth generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [\n AugmentationNames.CranialSignalProcessorsG3,\n AugmentationNames.CranialSignalProcessorsG2,\n AugmentationNames.CranialSignalProcessorsG1,\n ],\n hacking_speed: 1.02,\n hacking_money: 1.2,\n hacking_grow: 1.25,\n factions: [FactionNames.TheBlackHand, FactionNames.BitRunners],\n }),\n new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG5,\n repCost: 2.5e5,\n moneyCost: 2.25e9,\n info:\n \"The fifth generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [\n AugmentationNames.CranialSignalProcessorsG4,\n AugmentationNames.CranialSignalProcessorsG3,\n AugmentationNames.CranialSignalProcessorsG2,\n AugmentationNames.CranialSignalProcessorsG1,\n ],\n hacking: 1.3,\n hacking_money: 1.25,\n hacking_grow: 1.75,\n factions: [FactionNames.BitRunners],\n }),\n new Augmentation({\n name: AugmentationNames.NeuronalDensification,\n repCost: 1.875e5,\n moneyCost: 1.375e9,\n info:\n \"The brain is surgically re-engineered to have increased neuronal density \" +\n \"by decreasing the neuron gap junction. Then, the body is genetically modified \" +\n \"to enhance the production and capabilities of its neural stem cells.\",\n hacking: 1.15,\n hacking_exp: 1.1,\n hacking_speed: 1.03,\n factions: [FactionNames.ClarkeIncorporated],\n }),\n new Augmentation({\n name: AugmentationNames.NuoptimalInjectorImplant,\n repCost: 5e3,\n moneyCost: 2e7,\n info:\n \"This torso implant automatically injects nootropic supplements into \" +\n \"the bloodstream to improve memory, increase focus, and provide other \" +\n \"cognitive enhancements.\",\n company_rep: 1.2,\n factions: [\n FactionNames.TianDiHui,\n FactionNames.Volhaven,\n FactionNames.NewTokyo,\n FactionNames.Chongqing,\n FactionNames.ClarkeIncorporated,\n FactionNames.FourSigma,\n FactionNames.BachmanAssociates,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.SpeechEnhancement,\n repCost: 2.5e3,\n moneyCost: 1.25e7,\n info:\n \"An advanced neural implant that improves your speaking abilities, making \" +\n \"you more convincing and likable in conversations and overall improving your \" +\n \"social interactions.\",\n company_rep: 1.1,\n charisma: 1.1,\n factions: [\n FactionNames.TianDiHui,\n FactionNames.SpeakersForTheDead,\n FactionNames.FourSigma,\n FactionNames.KuaiGongInternational,\n FactionNames.ClarkeIncorporated,\n FactionNames.BachmanAssociates,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.FocusWire,\n repCost: 7.5e4,\n moneyCost: 9e8,\n info: \"A cranial implant that stops procrastination by blocking specific neural pathways in the brain.\",\n hacking_exp: 1.05,\n strength_exp: 1.05,\n defense_exp: 1.05,\n dexterity_exp: 1.05,\n agility_exp: 1.05,\n charisma_exp: 1.05,\n company_rep: 1.1,\n work_money: 1.2,\n factions: [\n FactionNames.BachmanAssociates,\n FactionNames.ClarkeIncorporated,\n FactionNames.FourSigma,\n FactionNames.KuaiGongInternational,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.PCDNI,\n repCost: 3.75e5,\n moneyCost: 3.75e9,\n info:\n \"Installs a Direct-Neural Interface jack into your arm that is compatible with most \" +\n \"computers. Connecting to a computer through this jack allows you to interface with \" +\n \"it using the brain's electrochemical signals.\",\n company_rep: 1.3,\n hacking: 1.08,\n factions: [\n FactionNames.FourSigma,\n FactionNames.OmniTekIncorporated,\n FactionNames.ECorp,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.PCDNIOptimizer,\n repCost: 5e5,\n moneyCost: 4.5e9,\n info:\n \"This is a submodule upgrade to the PC Direct-Neural Interface augmentation. It \" +\n \"improves the performance of the interface and gives the user more control options \" +\n \"to a connected computer.\",\n prereqs: [AugmentationNames.PCDNI],\n company_rep: 1.75,\n hacking: 1.1,\n factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.ECorp, FactionNames.BladeIndustries],\n }),\n new Augmentation({\n name: AugmentationNames.PCDNINeuralNetwork,\n repCost: 1.5e6,\n moneyCost: 7.5e9,\n info:\n \"This is an additional installation that upgrades the functionality of the \" +\n \"PC Direct-Neural Interface augmentation. When connected to a computer, \" +\n \"the Neural Network upgrade allows the user to use their own brain's \" +\n \"processing power to aid the computer in computational tasks.\",\n prereqs: [AugmentationNames.PCDNI],\n company_rep: 2,\n hacking: 1.1,\n hacking_speed: 1.05,\n factions: [FactionNames.FulcrumSecretTechnologies],\n }),\n new Augmentation({\n name: AugmentationNames.ADRPheromone1,\n repCost: 3.75e3,\n moneyCost: 1.75e7,\n info:\n \"The body is genetically re-engineered so that it produces the ADR-V1 pheromone, \" +\n \"an artificial pheromone discovered by scientists. The ADR-V1 pheromone, when excreted, \" +\n \"triggers feelings of admiration and approval in other people.\",\n company_rep: 1.1,\n faction_rep: 1.1,\n factions: [\n FactionNames.TianDiHui,\n FactionNames.TheSyndicate,\n FactionNames.NWO,\n FactionNames.MegaCorp,\n FactionNames.FourSigma,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ADRPheromone2,\n repCost: 6.25e4,\n moneyCost: 5.5e8,\n info:\n \"The body is genetically re-engineered so that it produces the ADR-V2 pheromone, \" +\n \"which is similar to but more potent than ADR-V1. This pheromone, when excreted, \" +\n \"triggers feelings of admiration, approval, and respect in others.\",\n company_rep: 1.2,\n faction_rep: 1.2,\n factions: [\n FactionNames.Silhouette,\n FactionNames.FourSigma,\n FactionNames.BachmanAssociates,\n FactionNames.ClarkeIncorporated,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ShadowsSimulacrum,\n repCost: 3.75e4,\n moneyCost: 4e8,\n info:\n \"A crude but functional matter phase-shifter module that is embedded \" +\n \"in the brainstem and cerebellum. This augmentation was developed by \" +\n \"criminal organizations and allows the user to project and control holographic \" +\n \"simulacrums within a large radius. These simulacrums are commonly used for \" +\n \"espionage and surveillance work.\",\n company_rep: 1.15,\n faction_rep: 1.15,\n factions: [FactionNames.TheSyndicate, FactionNames.TheDarkArmy, FactionNames.SpeakersForTheDead],\n }),\n new Augmentation({\n name: AugmentationNames.HacknetNodeCPUUpload,\n repCost: 3.75e3,\n moneyCost: 1.1e7,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's CPU into \" +\n \"the brain. This allows the user to engineer custom hardware and software \" +\n \"for the Hacknet Node that provides better performance.\",\n hacknet_node_money: 1.15,\n hacknet_node_purchase_cost: 0.85,\n factions: [FactionNames.Netburners],\n }),\n new Augmentation({\n name: AugmentationNames.HacknetNodeCacheUpload,\n repCost: 2.5e3,\n moneyCost: 5.5e6,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's main-memory cache \" +\n \"into the brain. This allows the user to engineer custom cache hardware for the \" +\n \"Hacknet Node that offers better performance.\",\n hacknet_node_money: 1.1,\n hacknet_node_level_cost: 0.85,\n factions: [FactionNames.Netburners],\n }),\n new Augmentation({\n name: AugmentationNames.HacknetNodeNICUpload,\n repCost: 1.875e3,\n moneyCost: 4.5e6,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's Network Interface Card (NIC) \" +\n \"into the brain. This allows the user to engineer a custom NIC for the Hacknet Node that \" +\n \"offers better performance.\",\n hacknet_node_money: 1.1,\n hacknet_node_purchase_cost: 0.9,\n factions: [FactionNames.Netburners],\n }),\n new Augmentation({\n name: AugmentationNames.HacknetNodeKernelDNI,\n repCost: 7.5e3,\n moneyCost: 4e7,\n info:\n \"Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a \" +\n \"Hacknet Node. This lets the user access and manipulate the Node's kernel using \" +\n \"electrochemical signals.\",\n hacknet_node_money: 1.25,\n factions: [FactionNames.Netburners],\n }),\n new Augmentation({\n name: AugmentationNames.HacknetNodeCoreDNI,\n repCost: 1.25e4,\n moneyCost: 6e7,\n info:\n \"Installs a Direct-Neural Interface jack into the arm that is capable of connecting \" +\n \"to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using \" +\n \"electrochemical signals.\",\n hacknet_node_money: 1.45,\n factions: [FactionNames.Netburners],\n }),\n new Augmentation({\n name: AugmentationNames.Neurotrainer1,\n repCost: 1e3,\n moneyCost: 4e6,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. It is \" +\n \"installed by releasing millions of nanobots into the human brain, each of which \" +\n \"attaches to a different neural pathway to enhance the brain's ability to retain \" +\n \"and retrieve information.\",\n hacking_exp: 1.1,\n strength_exp: 1.1,\n defense_exp: 1.1,\n dexterity_exp: 1.1,\n agility_exp: 1.1,\n charisma_exp: 1.1,\n factions: [FactionNames.CyberSec, FactionNames.Aevum],\n }),\n new Augmentation({\n name: AugmentationNames.Neurotrainer2,\n repCost: 1e4,\n moneyCost: 4.5e7,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. This \" +\n \"is a more powerful version of the Neurotrainer I augmentation, but it does not \" +\n \"require Neurotrainer I to be installed as a prerequisite.\",\n hacking_exp: 1.15,\n strength_exp: 1.15,\n defense_exp: 1.15,\n dexterity_exp: 1.15,\n agility_exp: 1.15,\n charisma_exp: 1.15,\n factions: [FactionNames.BitRunners, FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.Neurotrainer3,\n repCost: 2.5e4,\n moneyCost: 1.3e8,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. This \" +\n \"is a more powerful version of the Neurotrainer I and Neurotrainer II augmentation, \" +\n \"but it does not require either of them to be installed as a prerequisite.\",\n hacking_exp: 1.2,\n strength_exp: 1.2,\n defense_exp: 1.2,\n dexterity_exp: 1.2,\n agility_exp: 1.2,\n charisma_exp: 1.2,\n factions: [FactionNames.NWO, FactionNames.FourSigma],\n }),\n new Augmentation({\n name: AugmentationNames.Hypersight,\n repCost: 1.5e5,\n moneyCost: 2.75e9,\n info:\n \"A bionic eye implant that grants sight capabilities far beyond those of a natural human. \" +\n \"Embedded circuitry within the implant provides the ability to detect heat and movement \" +\n \"through solid objects such as walls, thus providing 'x-ray vision'-like capabilities.\",\n dexterity: 1.4,\n hacking_speed: 1.03,\n hacking_money: 1.1,\n factions: [FactionNames.BladeIndustries, FactionNames.KuaiGongInternational],\n }),\n new Augmentation({\n name: AugmentationNames.LuminCloaking1,\n repCost: 1.5e3,\n moneyCost: 5e6,\n info:\n \"A skin implant that reinforces the skin with highly-advanced synthetic cells. These \" +\n \"cells, when powered, have a negative refractive index. As a result, they bend light \" +\n \"around the skin, making the user much harder to see with the naked eye.\",\n agility: 1.05,\n crime_money: 1.1,\n factions: [FactionNames.SlumSnakes, FactionNames.Tetrads],\n }),\n new Augmentation({\n name: AugmentationNames.LuminCloaking2,\n repCost: 5e3,\n moneyCost: 3e7,\n info:\n \"This is a more advanced version of the LuminCloaking-V1 augmentation. This skin implant \" +\n \"reinforces the skin with highly-advanced synthetic cells. These \" +\n \"cells, when powered, are capable of not only bending light but also of bending heat, \" +\n \"making the user more resilient as well as stealthy.\",\n prereqs: [AugmentationNames.LuminCloaking1],\n agility: 1.1,\n defense: 1.1,\n crime_money: 1.25,\n factions: [FactionNames.SlumSnakes, FactionNames.Tetrads],\n }),\n new Augmentation({\n name: AugmentationNames.SmartSonar,\n repCost: 2.25e4,\n moneyCost: 7.5e7,\n info: \"A cochlear implant that helps the player detect and locate enemies using sound propagation.\",\n dexterity: 1.1,\n dexterity_exp: 1.15,\n crime_money: 1.25,\n factions: [FactionNames.SlumSnakes],\n }),\n new Augmentation({\n name: AugmentationNames.PowerRecirculator,\n repCost: 2.5e4,\n moneyCost: 1.8e8,\n info:\n \"The body's nerves are attached with polypyrrole nanocircuits that \" +\n \"are capable of capturing wasted energy, in the form of heat, \" +\n \"and converting it back into usable power.\",\n hacking: 1.05,\n strength: 1.05,\n defense: 1.05,\n dexterity: 1.05,\n agility: 1.05,\n charisma: 1.05,\n hacking_exp: 1.1,\n strength_exp: 1.1,\n defense_exp: 1.1,\n dexterity_exp: 1.1,\n agility_exp: 1.1,\n charisma_exp: 1.1,\n factions: [FactionNames.Tetrads, FactionNames.TheDarkArmy, FactionNames.TheSyndicate, FactionNames.NWO],\n }),\n new Augmentation({\n name: AugmentationNames.QLink,\n repCost: 1.875e6,\n moneyCost: 2.5e13,\n info:\n `A brain implant that wirelessly connects you to the ${FactionNames.Illuminati}'s ` +\n \"quantum supercomputer, allowing you to access and use its incredible \" +\n \"computing power.\",\n hacking: 1.75,\n hacking_speed: 2,\n hacking_chance: 2.5,\n hacking_money: 4,\n factions: [FactionNames.Illuminati],\n }),\n new Augmentation({\n name: AugmentationNames.SPTN97,\n repCost: 1.25e6,\n moneyCost: 4.875e9,\n info:\n \"The SPTN-97 gene is injected into the genome. The SPTN-97 gene is an \" +\n \"artificially-synthesized gene that was developed by DARPA to create \" +\n \"super-soldiers through genetic modification. The gene was outlawed in \" +\n \"2056.\",\n strength: 1.75,\n defense: 1.75,\n dexterity: 1.75,\n agility: 1.75,\n hacking: 1.15,\n factions: [FactionNames.TheCovenant],\n }),\n new Augmentation({\n name: AugmentationNames.HiveMind,\n repCost: 1.5e6,\n moneyCost: 5.5e9,\n info:\n `A brain implant developed by ${FactionNames.ECorp}. They do not reveal what ` +\n \"exactly the implant does, but they promise that it will greatly \" +\n \"enhance your abilities.\",\n hacking_grow: 3,\n stats: null,\n factions: [FactionNames.ECorp],\n }),\n new Augmentation({\n name: AugmentationNames.TheRedPill,\n repCost: 2.5e6,\n moneyCost: 0,\n info: \"It's time to leave the cave.\",\n stats: null,\n isSpecial: true,\n factions: [FactionNames.Daedalus],\n }),\n new Augmentation({\n name: AugmentationNames.CordiARCReactor,\n repCost: 1.125e6,\n moneyCost: 5e9,\n info:\n \"The thoracic cavity is equipped with a small chamber designed \" +\n \"to hold and sustain hydrogen plasma. The plasma is used to generate \" +\n \"fusion power through nuclear fusion, providing limitless amounts of clean \" +\n \"energy for the body.\",\n strength: 1.35,\n defense: 1.35,\n dexterity: 1.35,\n agility: 1.35,\n strength_exp: 1.35,\n defense_exp: 1.35,\n dexterity_exp: 1.35,\n agility_exp: 1.35,\n factions: [FactionNames.MegaCorp],\n }),\n new Augmentation({\n name: AugmentationNames.SmartJaw,\n repCost: 3.75e5,\n moneyCost: 2.75e9,\n info:\n \"A bionic jaw that contains advanced hardware and software \" +\n \"capable of psychoanalyzing and profiling the personality of \" +\n \"others using optical imaging software.\",\n charisma: 1.5,\n charisma_exp: 1.5,\n company_rep: 1.25,\n faction_rep: 1.25,\n factions: [FactionNames.BachmanAssociates],\n }),\n new Augmentation({\n name: AugmentationNames.Neotra,\n repCost: 5.625e5,\n moneyCost: 2.875e9,\n info:\n \"A highly-advanced techno-organic drug that is injected into the skeletal \" +\n \"and integumentary system. The drug permanently modifies the DNA of the \" +\n \"body's skin and bone cells, granting them the ability to repair \" +\n \"and restructure themselves.\",\n strength: 1.55,\n defense: 1.55,\n factions: [FactionNames.BladeIndustries],\n }),\n new Augmentation({\n name: AugmentationNames.Xanipher,\n repCost: 8.75e5,\n moneyCost: 4.25e9,\n info:\n \"A concoction of advanced nanobots that is orally ingested into the \" +\n \"body. These nanobots induce physiological changes and significantly \" +\n \"improve the body's functioning in all aspects.\",\n hacking: 1.2,\n strength: 1.2,\n defense: 1.2,\n dexterity: 1.2,\n agility: 1.2,\n charisma: 1.2,\n hacking_exp: 1.15,\n strength_exp: 1.15,\n defense_exp: 1.15,\n dexterity_exp: 1.15,\n agility_exp: 1.15,\n charisma_exp: 1.15,\n factions: [FactionNames.NWO],\n }),\n new Augmentation({\n name: AugmentationNames.HydroflameLeftArm,\n repCost: 1.25e6,\n moneyCost: 2.5e12,\n info:\n \"The left arm of a legendary BitRunner who ascended beyond this world. \" +\n \"It projects a light blue energy shield that protects the exposed inner parts. \" +\n \"Even though it contains no weapons, the advanced tungsten titanium \" +\n \"alloy increases the user's strength to unbelievable levels.\",\n strength: 2.8,\n factions: [FactionNames.NWO],\n }),\n new Augmentation({\n name: AugmentationNames.nextSENS,\n repCost: 4.375e5,\n moneyCost: 1.925e9,\n info:\n \"The body is genetically re-engineered to maintain a state \" +\n \"of negligible senescence, preventing the body from \" +\n \"deteriorating with age.\",\n hacking: 1.2,\n strength: 1.2,\n defense: 1.2,\n dexterity: 1.2,\n agility: 1.2,\n charisma: 1.2,\n factions: [FactionNames.ClarkeIncorporated],\n }),\n new Augmentation({\n name: AugmentationNames.OmniTekInfoLoad,\n repCost: 6.25e5,\n moneyCost: 2.875e9,\n info:\n \"OmniTek's data and information repository is uploaded \" +\n \"into your brain, enhancing your programming and \" +\n \"hacking abilities.\",\n hacking: 1.2,\n hacking_exp: 1.25,\n factions: [FactionNames.OmniTekIncorporated],\n }),\n new Augmentation({\n name: AugmentationNames.PhotosyntheticCells,\n repCost: 5.625e5,\n moneyCost: 2.75e9,\n info:\n \"Chloroplasts are added to epidermal stem cells and are applied \" +\n \"to the body using a skin graft. The result is photosynthetic \" +\n \"skin cells, allowing users to generate their own energy \" +\n \"and nutrition using solar power.\",\n strength: 1.4,\n defense: 1.4,\n agility: 1.4,\n factions: [FactionNames.KuaiGongInternational],\n }),\n new Augmentation({\n name: AugmentationNames.Neurolink,\n repCost: 8.75e5,\n moneyCost: 4.375e9,\n info:\n \"A brain implant that provides a high-bandwidth, direct neural link between your \" +\n `mind and the ${FactionNames.BitRunners}' data servers, which reportedly contain ` +\n \"the largest database of hacking tools and information in the world.\",\n hacking: 1.15,\n hacking_exp: 1.2,\n hacking_chance: 1.1,\n hacking_speed: 1.05,\n programs: [Programs.FTPCrackProgram.name, Programs.RelaySMTPProgram.name],\n factions: [FactionNames.BitRunners],\n }),\n new Augmentation({\n name: AugmentationNames.TheBlackHand,\n repCost: 1e5,\n moneyCost: 5.5e8,\n info:\n \"A highly advanced bionic hand. This prosthetic not only \" +\n \"enhances strength and dexterity but it is also embedded \" +\n \"with hardware and firmware that lets the user connect to, access, and hack \" +\n \"devices and machines by just touching them.\",\n strength: 1.15,\n dexterity: 1.15,\n hacking: 1.1,\n hacking_speed: 1.02,\n hacking_money: 1.1,\n factions: [FactionNames.TheBlackHand],\n }),\n new Augmentation({\n name: AugmentationNames.CRTX42AA,\n repCost: 4.5e4,\n moneyCost: 2.25e8,\n info:\n \"The CRTX42-AA gene is injected into the genome. \" +\n \"The CRTX42-AA is an artificially-synthesized gene that targets the visual and prefrontal \" +\n \"cortex and improves cognitive abilities.\",\n hacking: 1.08,\n hacking_exp: 1.15,\n factions: [FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.Neuregen,\n repCost: 3.75e4,\n moneyCost: 3.75e8,\n info:\n \"A drug that genetically modifies the neurons in the brain \" +\n \"resulting in neurons that never die, continuously \" +\n \"regenerate, and strengthen themselves.\",\n hacking_exp: 1.4,\n factions: [FactionNames.Chongqing],\n }),\n new Augmentation({\n name: AugmentationNames.CashRoot,\n repCost: 1.25e4,\n moneyCost: 1.25e8,\n info: (\n <>\n A collection of digital assets saved on a small chip. The chip is implanted into your wrist. A small jack in the\n chip allows you to connect it to a computer and upload the assets.\n </>\n ),\n startingMoney: 1e6,\n programs: [Programs.BruteSSHProgram.name],\n factions: [FactionNames.Sector12],\n }),\n new Augmentation({\n name: AugmentationNames.NutriGen,\n repCost: 6.25e3,\n moneyCost: 2.5e6,\n info:\n \"A thermo-powered artificial nutrition generator. Endogenously \" +\n \"synthesizes glucose, amino acids, and vitamins and redistributes them \" +\n \"across the body. The device is powered by the body's naturally wasted \" +\n \"energy in the form of heat.\",\n strength_exp: 1.2,\n defense_exp: 1.2,\n dexterity_exp: 1.2,\n agility_exp: 1.2,\n factions: [FactionNames.NewTokyo],\n }),\n new Augmentation({\n name: AugmentationNames.PCMatrix,\n repCost: 100e3,\n moneyCost: 2e9,\n info:\n \"A 'Probability Computation Matrix' is installed in the frontal cortex. This implant \" +\n \"uses advanced mathematical algorithms to rapidly identify and compute statistical \" +\n \"outcomes of nearly every situation.\",\n charisma: 1.0777,\n charisma_exp: 1.0777,\n work_money: 1.777,\n faction_rep: 1.0777,\n company_rep: 1.0777,\n crime_success: 1.0777,\n crime_money: 1.0777,\n programs: [Programs.DeepscanV1.name, Programs.AutoLink.name],\n factions: [FactionNames.Aevum],\n }),\n new Augmentation({\n name: AugmentationNames.INFRARet,\n repCost: 7.5e3,\n moneyCost: 3e7,\n info: \"A tiny chip that sits behind the retina. This implant lets the user visually detect infrared radiation.\",\n crime_success: 1.25,\n crime_money: 1.1,\n dexterity: 1.1,\n factions: [FactionNames.Ishima],\n }),\n new Augmentation({\n name: AugmentationNames.DermaForce,\n repCost: 1.5e4,\n moneyCost: 5e7,\n info:\n \"Synthetic skin that is grafted onto the body. This skin consists of \" +\n \"millions of nanobots capable of projecting high-density muon beams, \" +\n \"creating an energy barrier around the user.\",\n defense: 1.4,\n factions: [FactionNames.Volhaven],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBrachiBlades,\n repCost: 2.25e5,\n moneyCost: 2.5e9,\n info:\n \"An upgrade to the BrachiBlades augmentation. It infuses \" +\n \"the retractable blades with an advanced graphene material \" +\n \"making them stronger and lighter.\",\n prereqs: [AugmentationNames.BrachiBlades],\n strength: 1.4,\n defense: 1.4,\n crime_success: 1.1,\n crime_money: 1.3,\n factions: [FactionNames.SpeakersForTheDead],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBionicArms,\n repCost: 5e5,\n moneyCost: 3.75e9,\n info:\n \"An upgrade to the Bionic Arms augmentation. It infuses the \" +\n \"prosthetic arms with an advanced graphene material \" +\n \"to make them stronger and lighter.\",\n prereqs: [AugmentationNames.BionicArms],\n strength: 1.85,\n dexterity: 1.85,\n factions: [FactionNames.TheDarkArmy],\n }),\n new Augmentation({\n name: AugmentationNames.BrachiBlades,\n repCost: 1.25e4,\n moneyCost: 9e7,\n info: \"A set of retractable plasteel blades that are implanted in the arm, underneath the skin.\",\n strength: 1.15,\n defense: 1.15,\n crime_success: 1.1,\n crime_money: 1.15,\n factions: [FactionNames.TheSyndicate],\n }),\n new Augmentation({\n name: AugmentationNames.BionicArms,\n repCost: 6.25e4,\n moneyCost: 2.75e8,\n info: \"Cybernetic arms created from plasteel and carbon fibers that completely replace the user's organic arms.\",\n strength: 1.3,\n dexterity: 1.3,\n factions: [FactionNames.Tetrads],\n }),\n new Augmentation({\n name: AugmentationNames.SNA,\n repCost: 6.25e3,\n moneyCost: 3e7,\n info:\n \"A cranial implant that affects the user's personality, making them better \" +\n \"at negotiation in social situations.\",\n work_money: 1.1,\n company_rep: 1.15,\n faction_rep: 1.15,\n factions: [FactionNames.TianDiHui],\n }),\n new Augmentation({\n name: AugmentationNames.NeuroreceptorManager,\n repCost: 0.75e5,\n moneyCost: 5.5e8,\n info:\n \"A brain implant carefully assembled around the synapses, which \" +\n \"micromanages the activity and levels of various neuroreceptor \" +\n \"chemicals and modulates electrical activity to optimize concentration, \" +\n \"allowing the user to multitask much more effectively.\",\n stats: (\n <>\n This augmentation removes the penalty for not focusing on actions such as working in a job or working for a\n faction.\n </>\n ),\n factions: [FactionNames.TianDiHui],\n }),\n\n // new Augmentation({\n // name: AugmentationNames.UnnamedAug2,\n // repCost: 500e3,\n // moneyCost: 5e9,\n // info: \"Undecided description\",\n // startingMoney: 100e6,\n // programs: [Programs.HTTPWormProgram.name, Programs.SQLInjectProgram.name],\n // factions: [FactionNames.OmniTekIncorporated],\n // }),\n\n // Grafting-exclusive Augmentation\n new Augmentation({\n name: AugmentationNames.CongruityImplant,\n repCost: Infinity,\n moneyCost: 50e12,\n info: (\n <>\n Developed by a pioneer in Grafting research, this implant generates pulses of stability which seem to have a\n nullifying effect versus the Entropy virus.\n <br />\n <br />\n <b>Note:</b> For unknown reasons, the lowercase <code>n</code> appears to be an integral component to its\n functionality.\n </>\n ),\n stats: <>This Augmentation removes the Entropy virus, and prevents it from affecting you again.</>,\n factions: [],\n }),\n\n // Sleeve exclusive augmentations\n new Augmentation({\n name: AugmentationNames.ZOE,\n isSpecial: true,\n repCost: Infinity,\n moneyCost: 1e12,\n info:\n \"Zoë's Omnicerebrum Ënhancer for sleeves inserts an omnicerebrum into your sleeve. \" +\n \"An omnicerebrum is a near perfect simulation of the human brain, allowing it to take advantage of a larger variety of augments. \" +\n \"But you should know about this BitRunner, since you have one of these yourself!\",\n stats: <>Allows sleeves to benefit from Stanek's Gift but it is less powerful if several are installed.</>,\n factions: [\n /*Technically in FactionNames.ChurchOfTheMachineGod but not really for display reasons */\n ],\n }),\n];\n\nexport const initBladeburnerAugmentations = (): Augmentation[] => [\n new Augmentation({\n name: AugmentationNames.EsperEyewear,\n repCost: 1.25e3,\n moneyCost: 1.65e8,\n info:\n \"Ballistic-grade protective and retractable eyewear that was designed specifically \" +\n \"for Bladeburner units. This \" +\n \"is implanted by installing a mechanical frame in the skull's orbit. \" +\n \"This frame interfaces with the brain and allows the user to \" +\n \"automatically extrude and extract the eyewear. The eyewear protects \" +\n \"against debris, shrapnel, lasers, blinding flashes, and gas. It is also \" +\n \"embedded with a data processing chip that can be programmed to display an \" +\n \"AR HUD to assist the user in field missions.\",\n bladeburner_success_chance: 1.03,\n dexterity: 1.05,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.EMS4Recombination,\n repCost: 2.5e3,\n moneyCost: 2.75e8,\n info:\n \"A DNA recombination of the EMS-4 Gene. This genetic engineering \" +\n \"technique was originally used on Bladeburners during the Synthoid uprising \" +\n \"to induce wakefulness and concentration, suppress fear, reduce empathy, \" +\n \"improve reflexes, and improve memory among other things.\",\n bladeburner_success_chance: 1.03,\n bladeburner_analysis: 1.05,\n bladeburner_stamina_gain: 1.02,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.OrionShoulder,\n repCost: 6.25e3,\n moneyCost: 5.5e8,\n info:\n \"A bionic shoulder augmentation for the right shoulder. Using cybernetics, \" +\n \"the ORION-MKIV shoulder enhances the strength and dexterity \" +\n \"of the user's right arm. It also provides protection due to its \" +\n \"crystallized graphene plating.\",\n defense: 1.05,\n strength: 1.05,\n dexterity: 1.05,\n bladeburner_success_chance: 1.04,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.HyperionV1,\n repCost: 1.25e4,\n moneyCost: 2.75e9,\n info:\n \"A pair of mini plasma cannons embedded into the hands. The Hyperion is capable \" +\n \"of rapidly firing bolts of high-density plasma. The weapon is meant to \" +\n \"be used against augmented enemies as the ionized \" +\n \"nature of the plasma disrupts the electrical systems of Augmentations. However, \" +\n \"it can also be effective against non-augmented enemies due to its high temperature \" +\n \"and concussive force.\",\n bladeburner_success_chance: 1.06,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.HyperionV2,\n repCost: 2.5e4,\n moneyCost: 5.5e9,\n info:\n \"A pair of mini plasma cannons embedded into the hands. This augmentation \" +\n \"is more advanced and powerful than the original V1 model. This V2 model is \" +\n \"more power-efficient, more accurate, and can fire plasma bolts at a much \" +\n \"higher velocity than the V1 model.\",\n prereqs: [AugmentationNames.HyperionV1],\n bladeburner_success_chance: 1.08,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.GolemSerum,\n repCost: 3.125e4,\n moneyCost: 1.1e10,\n info:\n \"A serum that permanently enhances many aspects of human capabilities, \" +\n \"including strength, speed, immune system enhancements, and mitochondrial efficiency. The \" +\n \"serum was originally developed by the Chinese military in an attempt to \" +\n \"create super soldiers.\",\n strength: 1.07,\n defense: 1.07,\n dexterity: 1.07,\n agility: 1.07,\n bladeburner_stamina_gain: 1.05,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.VangelisVirus,\n repCost: 1.875e4,\n moneyCost: 2.75e9,\n info:\n \"A synthetic symbiotic virus that is injected into human brain tissue. The Vangelis virus \" +\n \"heightens the senses and focus of its host, and also enhances its intuition.\",\n dexterity_exp: 1.1,\n bladeburner_analysis: 1.1,\n bladeburner_success_chance: 1.04,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.VangelisVirus3,\n repCost: 3.75e4,\n moneyCost: 1.1e10,\n info:\n \"An improved version of Vangelis, a synthetic symbiotic virus that is \" +\n \"injected into human brain tissue. On top of the benefits of the original \" +\n \"virus, this also grants accelerated healing and enhanced \" +\n \"reflexes.\",\n prereqs: [AugmentationNames.VangelisVirus],\n defense_exp: 1.1,\n dexterity_exp: 1.1,\n bladeburner_analysis: 1.15,\n bladeburner_success_chance: 1.05,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.INTERLINKED,\n repCost: 2.5e4,\n moneyCost: 5.5e9,\n info:\n \"The DNA is genetically modified to enhance the human's body \" +\n \"extracellular matrix (ECM). This improves the ECM's ability to \" +\n \"structurally support the body and grants heightened strength and \" +\n \"durability.\",\n strength_exp: 1.05,\n defense_exp: 1.05,\n dexterity_exp: 1.05,\n agility_exp: 1.05,\n bladeburner_max_stamina: 1.1,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeRunner,\n repCost: 2e4,\n moneyCost: 8.25e9,\n info:\n `A cybernetic foot augmentation that was specifically created for ${FactionNames.Bladeburners} ` +\n \"during the Synthoid Uprising. The organic musculature of the human foot \" +\n \"is enhanced with flexible carbon nanotube matrices that are controlled by \" +\n \"intelligent servo-motors.\",\n agility: 1.05,\n bladeburner_max_stamina: 1.05,\n bladeburner_stamina_gain: 1.05,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmor,\n repCost: 1.25e4,\n moneyCost: 1.375e9,\n info:\n `A powered exoskeleton suit designed as armor for ${FactionNames.Bladeburners} units. This ` +\n \"exoskeleton is incredibly adaptable and can protect the wearer from blunt, piercing, \" +\n \"concussive, thermal, chemical, and electric trauma. It also enhances the user's \" +\n \"physical abilities.\",\n strength: 1.04,\n defense: 1.04,\n dexterity: 1.04,\n agility: 1.04,\n bladeburner_stamina_gain: 1.02,\n bladeburner_success_chance: 1.03,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmorPowerCells,\n repCost: 1.875e4,\n moneyCost: 2.75e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with Ion Power Cells, which are capable of \" +\n \"more efficiently storing and using power.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_success_chance: 1.05,\n bladeburner_stamina_gain: 1.02,\n bladeburner_max_stamina: 1.05,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmorEnergyShielding,\n repCost: 2.125e4,\n moneyCost: 5.5e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with a plasma energy propulsion system \" +\n \"that is capable of projecting an energy shielding force field.\",\n prereqs: [AugmentationNames.BladeArmor],\n defense: 1.05,\n bladeburner_success_chance: 1.06,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmorUnibeam,\n repCost: 3.125e4,\n moneyCost: 1.65e10,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with a concentrated deuterium-fluoride laser \" +\n \"weapon. It's precision and accuracy makes it useful for quickly neutralizing \" +\n \"threats while keeping casualties to a minimum.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_success_chance: 1.08,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmorOmnibeam,\n repCost: 6.25e4,\n moneyCost: 2.75e10,\n info:\n \"Upgrades the BLADE-51b Tesla Armor Unibeam augmentation to use a \" +\n \"multiple-fiber system. This upgraded weapon uses multiple fiber laser \" +\n \"modules that combine together to form a single, more powerful beam of up to \" +\n \"2000MW.\",\n prereqs: [AugmentationNames.BladeArmorUnibeam],\n bladeburner_success_chance: 1.1,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmorIPU,\n repCost: 1.5e4,\n moneyCost: 1.1e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with an AI Information Processing \" +\n \"Unit that was specially designed to analyze Synthoid related data and \" +\n \"information.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_analysis: 1.15,\n bladeburner_success_chance: 1.02,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladesSimulacrum,\n repCost: 1.25e3,\n moneyCost: 1.5e11,\n info:\n \"A highly-advanced matter phase-shifter module that is embedded \" +\n \"in the brainstem and cerebellum. This augmentation allows \" +\n \"the user to project and control a holographic simulacrum within an \" +\n \"extremely large radius. These specially-modified holograms were specifically \" +\n \"weaponized by Bladeburner units to be used against Synthoids.\",\n stats: (\n <>\n This augmentation allows you to perform Bladeburner actions and other actions (such as working, committing\n crimes, etc.) at the same time.\n </>\n ),\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n];\n\nexport const initChurchOfTheMachineGodAugmentations = (): Augmentation[] => [\n new Augmentation({\n name: AugmentationNames.StaneksGift1,\n repCost: 0,\n moneyCost: 0,\n info:\n 'Allison \"Mother\" Stanek imparts you with her gift. An ' +\n \"experimental Augmentation implanted at the base of the neck. \" +\n \"It allows you to overclock your entire system by carefully \" +\n \"changing the configuration.\",\n isSpecial: true,\n hacking_chance: 0.9,\n hacking_speed: 0.9,\n hacking_money: 0.9,\n hacking_grow: 0.9,\n hacking: 0.9,\n strength: 0.9,\n defense: 0.9,\n dexterity: 0.9,\n agility: 0.9,\n charisma: 0.9,\n hacking_exp: 0.9,\n strength_exp: 0.9,\n defense_exp: 0.9,\n dexterity_exp: 0.9,\n agility_exp: 0.9,\n charisma_exp: 0.9,\n company_rep: 0.9,\n faction_rep: 0.9,\n crime_money: 0.9,\n crime_success: 0.9,\n hacknet_node_money: 0.9,\n hacknet_node_purchase_cost: 1.1,\n hacknet_node_ram_cost: 1.1,\n hacknet_node_core_cost: 1.1,\n hacknet_node_level_cost: 1.1,\n work_money: 0.9,\n stats: <>Its unstable nature decreases all your stats by 10%</>,\n factions: [FactionNames.ChurchOfTheMachineGod],\n }),\n new Augmentation({\n name: AugmentationNames.StaneksGift2,\n repCost: 1e6,\n moneyCost: 0,\n info:\n \"The next evolution is near, a coming together of man and machine. A synthesis greater than the birth of the human \" +\n \"organism. Time spent with the gift has allowed for acclimatization of the invasive augment and the toll it takes upon \" +\n \"your frame granting a 5% reduced penalty to all stats.\",\n prereqs: [AugmentationNames.StaneksGift1],\n isSpecial: true,\n hacking_chance: 0.95 / 0.9,\n hacking_speed: 0.95 / 0.9,\n hacking_money: 0.95 / 0.9,\n hacking_grow: 0.95 / 0.9,\n hacking: 0.95 / 0.9,\n strength: 0.95 / 0.9,\n defense: 0.95 / 0.9,\n dexterity: 0.95 / 0.9,\n agility: 0.95 / 0.9,\n charisma: 0.95 / 0.9,\n hacking_exp: 0.95 / 0.9,\n strength_exp: 0.95 / 0.9,\n defense_exp: 0.95 / 0.9,\n dexterity_exp: 0.95 / 0.9,\n agility_exp: 0.95 / 0.9,\n charisma_exp: 0.95 / 0.9,\n company_rep: 0.95 / 0.9,\n faction_rep: 0.95 / 0.9,\n crime_money: 0.95 / 0.9,\n crime_success: 0.95 / 0.9,\n hacknet_node_money: 0.95 / 0.9,\n hacknet_node_purchase_cost: 1.05 / 1.1,\n hacknet_node_ram_cost: 1.05 / 1.1,\n hacknet_node_core_cost: 1.05 / 1.1,\n hacknet_node_level_cost: 1.05 / 1.1,\n work_money: 0.95 / 0.9,\n stats: <>The penalty for the gift is reduced to 5%</>,\n factions: [FactionNames.ChurchOfTheMachineGod],\n }),\n new Augmentation({\n name: AugmentationNames.StaneksGift3,\n repCost: 1e8,\n moneyCost: 0,\n info:\n \"The synthesis of human and machine is nothing to fear. It is our destiny. \" +\n \"You will become greater than the sum of our parts. As One. Embrace your gift \" +\n \"fully and wholly free of it's accursed toll. Serenity brings tranquility in the form \" +\n \"of no longer suffering a stat penalty. \",\n prereqs: [AugmentationNames.StaneksGift2, AugmentationNames.StaneksGift1],\n isSpecial: true,\n hacking_chance: 1 / 0.95,\n hacking_speed: 1 / 0.95,\n hacking_money: 1 / 0.95,\n hacking_grow: 1 / 0.95,\n hacking: 1 / 0.95,\n strength: 1 / 0.95,\n defense: 1 / 0.95,\n dexterity: 1 / 0.95,\n agility: 1 / 0.95,\n charisma: 1 / 0.95,\n hacking_exp: 1 / 0.95,\n strength_exp: 1 / 0.95,\n defense_exp: 1 / 0.95,\n dexterity_exp: 1 / 0.95,\n agility_exp: 1 / 0.95,\n charisma_exp: 1 / 0.95,\n company_rep: 1 / 0.95,\n faction_rep: 1 / 0.95,\n crime_money: 1 / 0.95,\n crime_success: 1 / 0.95,\n hacknet_node_money: 1 / 0.95,\n hacknet_node_purchase_cost: 1 / 1.05,\n hacknet_node_ram_cost: 1 / 1.05,\n hacknet_node_core_cost: 1 / 1.05,\n hacknet_node_level_cost: 1 / 1.05,\n work_money: 1 / 0.95,\n stats: <>Stanek's Gift has no penalty.</>,\n factions: [FactionNames.ChurchOfTheMachineGod],\n }),\n new Augmentation({\n name: AugmentationNames.BigDsBigBrain,\n isSpecial: true,\n factions: [],\n repCost: Infinity,\n moneyCost: Infinity,\n info:\n \"A chip containing the psyche of the greatest BitRunner to ever exists. \" +\n \"Installing this relic significantly increases ALL of your stats. \" +\n \"However it may have unintended consequence on the users mental well-being.\",\n stats: <>Grants access to unimaginable power.</>,\n hacking: 2,\n strength: 2,\n defense: 2,\n dexterity: 2,\n agility: 2,\n charisma: 2,\n hacking_exp: 2,\n strength_exp: 2,\n defense_exp: 2,\n dexterity_exp: 2,\n agility_exp: 2,\n charisma_exp: 2,\n hacking_chance: 2,\n hacking_speed: 2,\n hacking_money: 2,\n hacking_grow: 2,\n company_rep: 2,\n faction_rep: 2,\n crime_money: 2,\n crime_success: 2,\n work_money: 2,\n hacknet_node_money: 2,\n hacknet_node_purchase_cost: 0.5,\n hacknet_node_ram_cost: 0.5,\n hacknet_node_core_cost: 0.5,\n hacknet_node_level_cost: 0.5,\n bladeburner_max_stamina: 2,\n bladeburner_stamina_gain: 2,\n bladeburner_analysis: 2,\n bladeburner_success_chance: 2,\n\n startingMoney: 1e12,\n programs: [\n Programs.BruteSSHProgram.name,\n Programs.FTPCrackProgram.name,\n Programs.RelaySMTPProgram.name,\n Programs.HTTPWormProgram.name,\n Programs.SQLInjectProgram.name,\n Programs.DeepscanV1.name,\n Programs.DeepscanV2.name,\n Programs.ServerProfiler.name,\n Programs.AutoLink.name,\n Programs.Formulas.name,\n ],\n }),\n];\n\nexport function initNeuroFluxGovernor(): Augmentation {\n const donationBonus = CONSTANTS.Donations / 1e6 / 100; // 1 millionth of a percent per donation\n return new Augmentation({\n name: AugmentationNames.NeuroFluxGovernor,\n repCost: 500,\n moneyCost: 750e3,\n info:\n \"Undetectable adamantium nanobots injected in the users bloodstream. The NeuroFlux Governor \" +\n \"monitors and regulates all aspects of the human body, essentially 'governing' the body. \" +\n \"By doing so, it improves the users performance for most actions.\",\n stats: (\n <>\n This special augmentation can be leveled up infinitely. Each level of this augmentation increases MOST\n multipliers by 1% (+{(donationBonus * 100).toFixed(6)}%), stacking multiplicatively.\n </>\n ),\n isSpecial: true,\n hacking_chance: 1.01 + donationBonus,\n hacking_speed: 1.01 + donationBonus,\n hacking_money: 1.01 + donationBonus,\n hacking_grow: 1.01 + donationBonus,\n hacking: 1.01 + donationBonus,\n strength: 1.01 + donationBonus,\n defense: 1.01 + donationBonus,\n dexterity: 1.01 + donationBonus,\n agility: 1.01 + donationBonus,\n charisma: 1.01 + donationBonus,\n hacking_exp: 1.01 + donationBonus,\n strength_exp: 1.01 + donationBonus,\n defense_exp: 1.01 + donationBonus,\n dexterity_exp: 1.01 + donationBonus,\n agility_exp: 1.01 + donationBonus,\n charisma_exp: 1.01 + donationBonus,\n company_rep: 1.01 + donationBonus,\n faction_rep: 1.01 + donationBonus,\n crime_money: 1.01 + donationBonus,\n crime_success: 1.01 + donationBonus,\n hacknet_node_money: 1.01 + donationBonus,\n hacknet_node_purchase_cost: 1 / (1.01 + donationBonus),\n hacknet_node_ram_cost: 1 / (1.01 + donationBonus),\n hacknet_node_core_cost: 1 / (1.01 + donationBonus),\n hacknet_node_level_cost: 1 / (1.01 + donationBonus),\n work_money: 1.01 + donationBonus,\n factions: Object.values(FactionNames).filter(\n (factionName) =>\n ![FactionNames.ShadowsOfAnarchy, FactionNames.Bladeburners, FactionNames.ChurchOfTheMachineGod].includes(\n factionName,\n ),\n ),\n });\n}\n\nexport function initUnstableCircadianModulator(): Augmentation {\n //Time-Based Augment Test\n const randomBonuses = getRandomBonus();\n\n const UnstableCircadianModulatorParams: IConstructorParams = {\n name: AugmentationNames.UnstableCircadianModulator,\n moneyCost: 5e9,\n repCost: 3.625e5,\n info:\n \"An experimental nanobot injection. Its unstable nature leads to \" +\n \"unpredictable results based on your circadian rhythm.\",\n factions: [FactionNames.SpeakersForTheDead],\n };\n Object.keys(randomBonuses.bonuses).forEach(\n (key) => ((UnstableCircadianModulatorParams as any)[key] = randomBonuses.bonuses[key]),\n );\n\n return new Augmentation(UnstableCircadianModulatorParams);\n}\n","import { Player } from \"@player\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { Work, WorkType } from \"./Work\";\nimport { CONSTANTS } from \"../../../Constants\";\n\nconst infiltrateCycles = 60000 / CONSTANTS._idleSpeed;\n\nexport const isSleeveInfiltrateWork = (w: Work | null): w is SleeveInfiltrateWork =>\n w !== null && w.type === WorkType.INFILTRATE;\n\nexport class SleeveInfiltrateWork extends Work {\n cyclesWorked = 0;\n\n constructor() {\n super(WorkType.INFILTRATE);\n }\n\n cyclesNeeded(): number {\n return infiltrateCycles;\n }\n\n process(_sleeve: Sleeve, cycles: number): number {\n if (!Player.bladeburner) throw new Error(\"sleeve doing blade work without being a member\");\n this.cyclesWorked += cycles;\n if (this.cyclesWorked > this.cyclesNeeded()) {\n this.cyclesWorked -= this.cyclesNeeded();\n Player.bladeburner.infiltrateSynthoidCommunities();\n }\n return 0;\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveInfiltrateWork\", this);\n }\n\n /** Initializes a BladeburnerWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): SleeveInfiltrateWork {\n return Generic_fromJSON(SleeveInfiltrateWork, value.data);\n }\n}\n\nReviver.constructors.SleeveInfiltrateWork = SleeveInfiltrateWork;\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\n// tslint:disable:max-file-line-count\n\n// This could actually be a JSON file as it should be constant metadata to be imported...\nimport { IMinMaxRange } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { LiteratureNames } from \"../../Literature/data/LiteratureNames\";\nimport { SpecialServers } from \"./SpecialServers\";\n\n/**\n * The metadata describing the base state of servers on the network.\n * These values will be adjusted based on Bitnode multipliers when the Server objects are built out.\n */\ninterface IServerMetadata {\n /** When populated, the base security level of the server. */\n hackDifficulty?: number | IMinMaxRange;\n\n /** The DNS name of the server. */\n hostname: string;\n\n /** When populated, the files will be added to the server when created. */\n literature?: string[];\n\n /**\n * When populated, the exponent of 2^x amount of RAM the server has.\n * This should be in the range of 1-20, to match the Player's max RAM.\n */\n maxRamExponent?: number | IMinMaxRange;\n\n /** How much money the server starts out with. */\n moneyAvailable: number | IMinMaxRange;\n\n /**\n * The number of network layers away from the `home` server.\n * This value is between 1 and 15.\n * If this is not populated, @specialName should be.\n */\n networkLayer?: number | IMinMaxRange;\n\n /** The number of ports that must be opened before the player can execute NUKE. */\n numOpenPortsRequired: number;\n\n /** The organization that the server belongs to. */\n organizationName: string;\n\n /** The minimum hacking level before the player can run NUKE. */\n requiredHackingSkill: number | IMinMaxRange;\n\n /** The growth factor for the server. */\n serverGrowth?: number | IMinMaxRange;\n\n /** A \"unique\" server that has special implications when the player manually hacks it. */\n specialName?: string;\n}\n\n/** The metadata for building up the servers on the network. */\nexport const serverMetadata: IServerMetadata[] = [\n {\n hackDifficulty: 99,\n hostname: LocationName.AevumECorp.toLowerCase(),\n moneyAvailable: {\n max: 70e9,\n min: 30e9,\n },\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumECorp,\n requiredHackingSkill: {\n max: 1400,\n min: 1050,\n },\n serverGrowth: 99,\n specialName: LocationName.AevumECorp,\n },\n {\n hackDifficulty: 99,\n hostname: LocationName.Sector12MegaCorp.toLowerCase(),\n moneyAvailable: {\n max: 60e9,\n min: 40e9,\n },\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12MegaCorp,\n requiredHackingSkill: {\n max: 1350,\n min: 1100,\n },\n serverGrowth: 99,\n specialName: LocationName.Sector12MegaCorp,\n },\n {\n hackDifficulty: {\n max: 88,\n min: 72,\n },\n hostname: \"b-and-a\",\n moneyAvailable: {\n max: 30e9,\n min: 15e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumBachmanAndAssociates,\n requiredHackingSkill: {\n max: 1150,\n min: 900,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n specialName: LocationName.AevumBachmanAndAssociates,\n },\n {\n hackDifficulty: {\n max: 97,\n min: 88,\n },\n hostname: \"blade\",\n literature: [LiteratureNames.BeyondMan],\n maxRamExponent: {\n max: 9,\n min: 5,\n },\n moneyAvailable: {\n max: 40e9,\n min: 10e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12BladeIndustries,\n requiredHackingSkill: {\n max: 1200,\n min: 900,\n },\n serverGrowth: {\n max: 85,\n min: 55,\n },\n specialName: LocationName.Sector12BladeIndustries,\n },\n {\n hackDifficulty: 99,\n hostname: LocationName.VolhavenNWO.toLowerCase(),\n literature: [LiteratureNames.TheHiddenWorld],\n moneyAvailable: {\n max: 40e9,\n min: 20e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenNWO,\n requiredHackingSkill: {\n max: 1300,\n min: 950,\n },\n serverGrowth: {\n max: 95,\n min: 65,\n },\n specialName: LocationName.VolhavenNWO,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 45,\n },\n hostname: \"clarkinc\",\n literature: [LiteratureNames.BeyondMan, LiteratureNames.CostOfImmortality],\n moneyAvailable: {\n max: 25e9,\n min: 15e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumClarkeIncorporated,\n requiredHackingSkill: {\n max: 1250,\n min: 950,\n },\n serverGrowth: {\n max: 75,\n min: 45,\n },\n specialName: LocationName.AevumClarkeIncorporated,\n },\n {\n hackDifficulty: {\n max: 99,\n min: 90,\n },\n hostname: \"omnitek\",\n literature: [LiteratureNames.CodedIntelligence, LiteratureNames.HistoryOfSynthoids],\n maxRamExponent: {\n max: 9,\n min: 7,\n },\n moneyAvailable: {\n max: 22e9,\n min: 13e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenOmniTekIncorporated,\n requiredHackingSkill: {\n max: 1100,\n min: 900,\n },\n serverGrowth: {\n max: 99,\n min: 95,\n },\n specialName: LocationName.VolhavenOmniTekIncorporated,\n },\n {\n hackDifficulty: {\n max: 75,\n min: 55,\n },\n hostname: \"4sigma\",\n moneyAvailable: {\n max: 25e9,\n min: 15e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12FourSigma,\n requiredHackingSkill: {\n max: 1250,\n min: 900,\n },\n serverGrowth: {\n max: 99,\n min: 75,\n },\n specialName: LocationName.Sector12FourSigma,\n },\n {\n hackDifficulty: {\n max: 99,\n min: 95,\n },\n hostname: \"kuai-gong\",\n moneyAvailable: {\n max: 30e9,\n min: 20e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.ChongqingKuaiGongInternational,\n requiredHackingSkill: {\n max: 1300,\n min: 950,\n },\n serverGrowth: {\n max: 99,\n min: 90,\n },\n specialName: LocationName.ChongqingKuaiGongInternational,\n },\n {\n hackDifficulty: {\n max: 97,\n min: 83,\n },\n hostname: \"fulcrumtech\",\n literature: [LiteratureNames.SimulatedReality],\n maxRamExponent: {\n max: 11,\n min: 7,\n },\n moneyAvailable: {\n max: 1800e6,\n min: 1400e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumFulcrumTechnologies,\n requiredHackingSkill: {\n max: 1250,\n min: 950,\n },\n serverGrowth: {\n max: 99,\n min: 80,\n },\n specialName: LocationName.AevumFulcrumTechnologies,\n },\n {\n hackDifficulty: 99,\n hostname: \"fulcrumassets\",\n moneyAvailable: 1e6,\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumFulcrumTechnologies,\n requiredHackingSkill: {\n max: 1600,\n min: 1100,\n },\n serverGrowth: 1,\n specialName: SpecialServers.FulcrumSecretTechnologies,\n },\n {\n hackDifficulty: {\n max: 92,\n min: 78,\n },\n hostname: \"stormtech\",\n moneyAvailable: {\n max: 1200e6,\n min: 1000e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.IshimaStormTechnologies,\n requiredHackingSkill: {\n max: 1075,\n min: 875,\n },\n serverGrowth: {\n max: 92,\n min: 68,\n },\n specialName: LocationName.IshimaStormTechnologies,\n },\n {\n hackDifficulty: {\n max: 96,\n min: 84,\n },\n hostname: \"defcomm\",\n moneyAvailable: {\n max: 950e6,\n min: 800e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.NewTokyoDefComm,\n requiredHackingSkill: {\n max: 1050,\n min: 850,\n },\n serverGrowth: {\n max: 73,\n min: 47,\n },\n specialName: LocationName.NewTokyoDefComm,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 70,\n },\n hostname: \"infocomm\",\n moneyAvailable: {\n max: 900e6,\n min: 600e6,\n },\n networkLayer: 10,\n numOpenPortsRequired: 5,\n organizationName: \"InfoComm\",\n requiredHackingSkill: {\n max: 950,\n min: 875,\n },\n serverGrowth: {\n max: 75,\n min: 35,\n },\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"helios\",\n literature: [LiteratureNames.BeyondMan],\n maxRamExponent: {\n max: 8,\n min: 5,\n },\n moneyAvailable: {\n max: 750e6,\n min: 550e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenHeliosLabs,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n specialName: LocationName.VolhavenHeliosLabs,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: LocationName.NewTokyoVitaLife.toLowerCase(),\n literature: [LiteratureNames.AGreenTomorrow],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 800e6,\n min: 700e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.NewTokyoVitaLife,\n requiredHackingSkill: {\n max: 900,\n min: 775,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n specialName: LocationName.NewTokyoVitaLife,\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"icarus\",\n moneyAvailable: {\n max: 1000e6,\n min: 900e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12IcarusMicrosystems,\n requiredHackingSkill: {\n max: 925,\n min: 850,\n },\n serverGrowth: {\n max: 95,\n min: 85,\n },\n specialName: LocationName.Sector12IcarusMicrosystems,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: \"univ-energy\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 1200e6,\n min: 1100e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 4,\n organizationName: LocationName.Sector12UniversalEnergy,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 90,\n min: 80,\n },\n specialName: LocationName.Sector12UniversalEnergy,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"titan-labs\",\n literature: [LiteratureNames.CodedIntelligence],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 900000000,\n min: 750000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 5,\n organizationName: \"Titan Laboratories\",\n requiredHackingSkill: {\n max: 875,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n },\n {\n hackDifficulty: {\n max: 75,\n min: 65,\n },\n hostname: \"microdyne\",\n literature: [LiteratureNames.SyntheticMuscles],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 700000000,\n min: 500000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 5,\n organizationName: \"Microdyne Technologies\",\n requiredHackingSkill: {\n max: 875,\n min: 800,\n },\n serverGrowth: {\n max: 90,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"taiyang-digital\",\n literature: [LiteratureNames.AGreenTomorrow, LiteratureNames.BrighterThanTheSun],\n moneyAvailable: {\n max: 900000000,\n min: 800000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 5,\n organizationName: \"Taiyang Digital\",\n requiredHackingSkill: {\n max: 950,\n min: 850,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"galactic-cyber\",\n moneyAvailable: {\n max: 850000000,\n min: 750000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumGalacticCybersystems,\n requiredHackingSkill: {\n max: 875,\n min: 825,\n },\n serverGrowth: {\n max: 90,\n min: 70,\n },\n specialName: LocationName.AevumGalacticCybersystems,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: LocationName.AevumAeroCorp.toLowerCase(),\n literature: [LiteratureNames.ManAndMachine],\n moneyAvailable: {\n max: 1200000000,\n min: 1000000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumAeroCorp,\n requiredHackingSkill: {\n max: 925,\n min: 850,\n },\n serverGrowth: {\n max: 65,\n min: 55,\n },\n specialName: LocationName.AevumAeroCorp,\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"omnia\",\n literature: [LiteratureNames.HistoryOfSynthoids],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 1000000000,\n min: 900000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenOmniaCybersystems,\n requiredHackingSkill: {\n max: 950,\n min: 850,\n },\n serverGrowth: {\n max: 70,\n min: 60,\n },\n specialName: LocationName.VolhavenOmniaCybersystems,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"zb-def\",\n literature: [LiteratureNames.SyntheticMuscles],\n moneyAvailable: {\n max: 1100000000,\n min: 900000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 4,\n organizationName: \"ZB Defense Industries\",\n requiredHackingSkill: {\n max: 825,\n min: 775,\n },\n serverGrowth: {\n max: 75,\n min: 65,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"applied-energetics\",\n moneyAvailable: {\n max: 1000000000,\n min: 700000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 4,\n organizationName: \"Applied Energetics\",\n requiredHackingSkill: {\n max: 850,\n min: 775,\n },\n serverGrowth: {\n max: 75,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"solaris\",\n literature: [LiteratureNames.AGreenTomorrow, LiteratureNames.TheFailedFrontier],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 900000000,\n min: 700000000,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.ChongqingSolarisSpaceSystems,\n requiredHackingSkill: {\n max: 850,\n min: 750,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n specialName: LocationName.ChongqingSolarisSpaceSystems,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 75,\n },\n hostname: LocationName.Sector12DeltaOne.toLowerCase(),\n moneyAvailable: {\n max: 1700000000,\n min: 1300000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12DeltaOne,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 70,\n min: 50,\n },\n specialName: LocationName.Sector12DeltaOne,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 75,\n },\n hostname: \"global-pharm\",\n literature: [LiteratureNames.AGreenTomorrow],\n maxRamExponent: {\n max: 6,\n min: 3,\n },\n moneyAvailable: {\n max: 1750000000,\n min: 1500000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 4,\n organizationName: LocationName.NewTokyoGlobalPharmaceuticals,\n requiredHackingSkill: {\n max: 850,\n min: 750,\n },\n serverGrowth: {\n max: 90,\n min: 80,\n },\n specialName: LocationName.NewTokyoGlobalPharmaceuticals,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"nova-med\",\n moneyAvailable: {\n max: 1250000000,\n min: 1100000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 4,\n organizationName: LocationName.IshimaNovaMedical,\n requiredHackingSkill: {\n max: 850,\n min: 775,\n },\n serverGrowth: {\n max: 85,\n min: 65,\n },\n specialName: LocationName.IshimaNovaMedical,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 70,\n },\n hostname: \"zeus-med\",\n moneyAvailable: {\n max: 1500000000,\n min: 1300000000,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: \"Zeus Medical\",\n requiredHackingSkill: {\n max: 850,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"unitalife\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 1100000000,\n min: 1000000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 4,\n organizationName: \"UnitaLife Group\",\n requiredHackingSkill: {\n max: 825,\n min: 775,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"lexo-corp\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 800000000,\n min: 700000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.VolhavenLexoCorp,\n requiredHackingSkill: {\n max: 750,\n min: 650,\n },\n serverGrowth: {\n max: 65,\n min: 55,\n },\n specialName: LocationName.VolhavenLexoCorp,\n },\n {\n hackDifficulty: {\n max: 60,\n min: 40,\n },\n hostname: \"rho-construction\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 700000000,\n min: 500000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumRhoConstruction,\n requiredHackingSkill: {\n max: 525,\n min: 475,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumRhoConstruction,\n },\n {\n hackDifficulty: {\n max: 70,\n min: 50,\n },\n hostname: \"alpha-ent\",\n literature: [LiteratureNames.Sector12Crime],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 750000000,\n min: 600000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.Sector12AlphaEnterprises,\n requiredHackingSkill: {\n max: 600,\n min: 500,\n },\n serverGrowth: {\n max: 60,\n min: 50,\n },\n specialName: LocationName.Sector12AlphaEnterprises,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"aevum-police\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 400000000,\n min: 200000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.AevumPolice,\n requiredHackingSkill: {\n max: 450,\n min: 400,\n },\n serverGrowth: {\n max: 50,\n min: 30,\n },\n specialName: LocationName.AevumPolice,\n },\n {\n hackDifficulty: {\n max: 55,\n min: 45,\n },\n hostname: \"rothman-uni\",\n literature: [\n LiteratureNames.SecretSocieties,\n LiteratureNames.TheFailedFrontier,\n LiteratureNames.TensionsInTechRace,\n ],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 250000000,\n min: 175000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: LocationName.Sector12RothmanUniversity,\n requiredHackingSkill: {\n max: 430,\n min: 370,\n },\n serverGrowth: {\n max: 45,\n min: 35,\n },\n specialName: LocationName.Sector12RothmanUniversity,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 65,\n },\n hostname: \"zb-institute\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 1100000000,\n min: 800000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenZBInstituteOfTechnology,\n requiredHackingSkill: {\n max: 775,\n min: 725,\n },\n serverGrowth: {\n max: 85,\n min: 75,\n },\n specialName: LocationName.VolhavenZBInstituteOfTechnology,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 45,\n },\n hostname: \"summit-uni\",\n literature: [LiteratureNames.SecretSocieties, LiteratureNames.TheFailedFrontier, LiteratureNames.SyntheticMuscles],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 350000000,\n min: 200000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumSummitUniversity,\n requiredHackingSkill: {\n max: 475,\n min: 425,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumSummitUniversity,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"syscore\",\n moneyAvailable: {\n max: 600000000,\n min: 400000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 4,\n organizationName: LocationName.VolhavenSysCoreSecurities,\n requiredHackingSkill: {\n max: 650,\n min: 550,\n },\n serverGrowth: {\n max: 70,\n min: 60,\n },\n specialName: LocationName.VolhavenSysCoreSecurities,\n },\n {\n hackDifficulty: {\n max: 70,\n min: 60,\n },\n hostname: \"catalyst\",\n literature: [LiteratureNames.TensionsInTechRace],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 550000000,\n min: 300000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: \"Catalyst Ventures\",\n requiredHackingSkill: {\n max: 450,\n min: 400,\n },\n serverGrowth: {\n max: 55,\n min: 25,\n },\n },\n {\n hackDifficulty: {\n max: 45,\n min: 35,\n },\n hostname: \"the-hub\",\n maxRamExponent: {\n max: 6,\n min: 3,\n },\n moneyAvailable: {\n max: 200000000,\n min: 150000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"The Hub\",\n requiredHackingSkill: {\n max: 325,\n min: 275,\n },\n serverGrowth: {\n max: 55,\n min: 45,\n },\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: LocationName.VolhavenCompuTek.toLowerCase(),\n literature: [LiteratureNames.ManAndMachine],\n moneyAvailable: {\n max: 250000000,\n min: 220000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 3,\n organizationName: LocationName.VolhavenCompuTek,\n requiredHackingSkill: {\n max: 400,\n min: 300,\n },\n serverGrowth: {\n max: 65,\n min: 45,\n },\n specialName: LocationName.VolhavenCompuTek,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"netlink\",\n literature: [LiteratureNames.SimulatedReality],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: 275000000,\n networkLayer: 4,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumNetLinkTechnologies,\n requiredHackingSkill: {\n max: 425,\n min: 375,\n },\n serverGrowth: {\n max: 75,\n min: 45,\n },\n specialName: LocationName.AevumNetLinkTechnologies,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 35,\n },\n hostname: \"johnson-ortho\",\n moneyAvailable: {\n max: 85000000,\n min: 70000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"Johnson Orthopedics\",\n requiredHackingSkill: {\n max: 300,\n min: 250,\n },\n serverGrowth: {\n max: 65,\n min: 35,\n },\n },\n {\n hackDifficulty: 1,\n hostname: \"n00dles\",\n literature: [],\n maxRamExponent: 2,\n moneyAvailable: 70000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.NewTokyoNoodleBar,\n requiredHackingSkill: 1,\n serverGrowth: 3000,\n specialName: LocationName.NewTokyoNoodleBar,\n },\n {\n hackDifficulty: 10,\n hostname: LocationName.Sector12FoodNStuff.toLowerCase(),\n literature: [LiteratureNames.Sector12Crime],\n maxRamExponent: 4,\n moneyAvailable: 2000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.Sector12FoodNStuff,\n requiredHackingSkill: 1,\n serverGrowth: 5,\n specialName: LocationName.Sector12FoodNStuff,\n },\n {\n hackDifficulty: 10,\n hostname: \"sigma-cosmetics\",\n maxRamExponent: 4,\n moneyAvailable: 2300000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"Sigma Cosmetics\",\n requiredHackingSkill: 5,\n serverGrowth: 10,\n },\n {\n hackDifficulty: 15,\n hostname: \"joesguns\",\n maxRamExponent: 4,\n moneyAvailable: 2500000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.Sector12JoesGuns,\n requiredHackingSkill: 10,\n serverGrowth: 20,\n specialName: LocationName.Sector12JoesGuns,\n },\n {\n hackDifficulty: 25,\n hostname: \"zer0\",\n maxRamExponent: 5,\n moneyAvailable: 7500000,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: \"ZER0 Nightclub\",\n requiredHackingSkill: 75,\n serverGrowth: 40,\n },\n {\n hackDifficulty: 20,\n hostname: \"nectar-net\",\n maxRamExponent: 4,\n moneyAvailable: 2750000,\n networkLayer: 2,\n numOpenPortsRequired: 0,\n organizationName: \"Nectar Nightclub Network\",\n requiredHackingSkill: 20,\n serverGrowth: 25,\n },\n {\n hackDifficulty: 25,\n hostname: \"neo-net\",\n literature: [LiteratureNames.TheHiddenWorld],\n maxRamExponent: 5,\n moneyAvailable: 5000000,\n networkLayer: 3,\n numOpenPortsRequired: 1,\n organizationName: \"Neo Nightclub Network\",\n requiredHackingSkill: 50,\n serverGrowth: 25,\n },\n {\n hackDifficulty: 30,\n hostname: \"silver-helix\",\n literature: [LiteratureNames.NewTriads],\n maxRamExponent: 6,\n moneyAvailable: 45000000,\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: \"Silver Helix\",\n requiredHackingSkill: 150,\n serverGrowth: 30,\n },\n {\n hackDifficulty: 15,\n hostname: \"hong-fang-tea\",\n literature: [LiteratureNames.BrighterThanTheSun],\n maxRamExponent: 4,\n moneyAvailable: 3000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"HongFang Teahouse\",\n requiredHackingSkill: 30,\n serverGrowth: 20,\n },\n {\n hackDifficulty: 15,\n hostname: \"harakiri-sushi\",\n maxRamExponent: 4,\n moneyAvailable: 4000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"HaraKiri Sushi Bar Network\",\n requiredHackingSkill: 40,\n serverGrowth: 40,\n },\n {\n hackDifficulty: 20,\n hostname: \"phantasy\",\n maxRamExponent: 5,\n moneyAvailable: 24000000,\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: \"Phantasy Club\",\n requiredHackingSkill: 100,\n serverGrowth: 35,\n },\n {\n hackDifficulty: 15,\n hostname: \"max-hardware\",\n maxRamExponent: 5,\n moneyAvailable: 10000000,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: \"Max Hardware Store\",\n requiredHackingSkill: 80,\n serverGrowth: 30,\n },\n {\n hackDifficulty: {\n max: 35,\n min: 25,\n },\n hostname: \"omega-net\",\n literature: [LiteratureNames.TheNewGod],\n maxRamExponent: 5,\n moneyAvailable: {\n max: 70000000,\n min: 60000000,\n },\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: LocationName.IshimaOmegaSoftware,\n requiredHackingSkill: {\n max: 220,\n min: 180,\n },\n serverGrowth: {\n max: 40,\n min: 30,\n },\n specialName: LocationName.IshimaOmegaSoftware,\n },\n {\n hackDifficulty: {\n max: 45,\n min: 35,\n },\n hostname: \"crush-fitness\",\n moneyAvailable: {\n max: 60000000,\n min: 40000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"Crush Fitness\",\n requiredHackingSkill: {\n max: 275,\n min: 225,\n },\n serverGrowth: {\n max: 33,\n min: 27,\n },\n specialName: LocationName.AevumCrushFitnessGym,\n },\n {\n hackDifficulty: 30,\n hostname: \"iron-gym\",\n maxRamExponent: 5,\n moneyAvailable: 20000000,\n networkLayer: 1,\n numOpenPortsRequired: 1,\n organizationName: `${LocationName.Sector12IronGym} Network`,\n requiredHackingSkill: 100,\n serverGrowth: 20,\n specialName: LocationName.Sector12IronGym,\n },\n {\n hackDifficulty: {\n max: 55,\n min: 45,\n },\n hostname: \"millenium-fitness\",\n maxRamExponent: {\n max: 8,\n min: 4,\n },\n moneyAvailable: 250000000,\n networkLayer: 6,\n numOpenPortsRequired: 3,\n organizationName: \"Millenium Fitness Network\",\n requiredHackingSkill: {\n max: 525,\n min: 475,\n },\n serverGrowth: {\n max: 45,\n min: 25,\n },\n specialName: LocationName.VolhavenMilleniumFitnessGym,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"powerhouse-fitness\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: 900000000,\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: \"Powerhouse Fitness\",\n requiredHackingSkill: {\n max: 1100,\n min: 950,\n },\n serverGrowth: {\n max: 60,\n min: 50,\n },\n specialName: LocationName.Sector12PowerhouseGym,\n },\n {\n hackDifficulty: {\n max: 60,\n min: 40,\n },\n hostname: \"snap-fitness\",\n moneyAvailable: 450000000,\n networkLayer: 7,\n numOpenPortsRequired: 4,\n organizationName: \"Snap Fitness\",\n requiredHackingSkill: {\n max: 800,\n min: 675,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumSnapFitnessGym,\n },\n {\n hackDifficulty: 0,\n hostname: \"run4theh111z\",\n literature: [LiteratureNames.SimulatedReality, LiteratureNames.TheNewGod],\n maxRamExponent: {\n max: 9,\n min: 5,\n },\n moneyAvailable: 0,\n networkLayer: 11,\n numOpenPortsRequired: 4,\n organizationName: \"The Runners\",\n requiredHackingSkill: {\n max: 550,\n min: 505,\n },\n serverGrowth: 0,\n specialName: SpecialServers.BitRunnersServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"I.I.I.I\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: {\n max: 8,\n min: 4,\n },\n moneyAvailable: 0,\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: \"I.I.I.I\",\n requiredHackingSkill: {\n max: 365,\n min: 340,\n },\n serverGrowth: 0,\n specialName: SpecialServers.TheBlackHandServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"avmnite-02h\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: 0,\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: FactionNames.NiteSec,\n requiredHackingSkill: {\n max: 220,\n min: 202,\n },\n serverGrowth: 0,\n specialName: SpecialServers.NiteSecServer,\n },\n {\n hackDifficulty: 0,\n hostname: \".\",\n maxRamExponent: 4,\n moneyAvailable: 0,\n networkLayer: 13,\n numOpenPortsRequired: 4,\n organizationName: \".\",\n requiredHackingSkill: {\n max: 550,\n min: 505,\n },\n serverGrowth: 0,\n specialName: SpecialServers.TheDarkArmyServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"CSEC\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: 3,\n moneyAvailable: 0,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: FactionNames.CyberSec,\n requiredHackingSkill: {\n max: 60,\n min: 51,\n },\n serverGrowth: 0,\n specialName: SpecialServers.CyberSecServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"The-Cave\",\n literature: [LiteratureNames.AlphaOmega],\n moneyAvailable: 0,\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: \"Helios\",\n requiredHackingSkill: 925,\n serverGrowth: 0,\n specialName: SpecialServers.DaedalusServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"w0r1d_d43m0n\",\n moneyAvailable: 0,\n numOpenPortsRequired: 5,\n organizationName: \"w0r1d_d43m0n\",\n requiredHackingSkill: 3000,\n serverGrowth: 0,\n specialName: SpecialServers.WorldDaemon,\n },\n {\n hostname: SpecialServers.DarkWeb,\n moneyAvailable: 0,\n numOpenPortsRequired: 5,\n organizationName: SpecialServers.DarkWeb,\n requiredHackingSkill: 1,\n specialName: SpecialServers.DarkWeb,\n },\n];\n","/**\n * Implementation of the mechanisms that allow the player to affect the\n * Stock Market\n */\nimport { Stock } from \"./Stock\";\nimport { StockMarket } from \"./StockMarket\";\n\nimport { Company } from \"../Company/Company\";\nimport { Server } from \"../Server/Server\";\n\n// Change in second-order forecast due to hacks/grows\nexport const forecastForecastChangeFromHack = 0.1;\n\n// Change in second-order forecast due to company work\nexport const forecastForecastChangeFromCompanyWork = 0.001;\n\n/**\n * Potentially decreases a stock's second-order forecast when its corresponding\n * server is hacked. The chance of the hack decreasing the stock's second-order\n * forecast is dependent on what percentage of the server's money is hacked\n * @param {Server} server - Server being hack()ed\n * @param {number} moneyHacked - Amount of money stolen from the server\n */\nexport function influenceStockThroughServerHack(server: Server, moneyHacked: number): void {\n const orgName = server.organizationName;\n let stock: Stock | null = null;\n if (typeof orgName === \"string\" && orgName !== \"\") {\n stock = StockMarket[orgName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n const percTotalMoneyHacked = moneyHacked / server.moneyMax;\n if (Math.random() < percTotalMoneyHacked) {\n stock.changeForecastForecast(stock.otlkMagForecast - forecastForecastChangeFromHack);\n }\n}\n\n/**\n * Potentially increases a stock's second-order forecast when its corresponding\n * server is grown (grow()). The chance of the grow() to increase the stock's\n * second-order forecast is dependent on how much money is added to the server\n * @param {Server} server - Server being grow()n\n * @param {number} moneyHacked - Amount of money added to the server\n */\nexport function influenceStockThroughServerGrow(server: Server, moneyGrown: number): void {\n const orgName = server.organizationName;\n let stock: Stock | null = null;\n if (typeof orgName === \"string\" && orgName !== \"\") {\n stock = StockMarket[orgName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n const percTotalMoneyGrown = moneyGrown / server.moneyMax;\n if (Math.random() < percTotalMoneyGrown) {\n stock.changeForecastForecast(stock.otlkMagForecast + forecastForecastChangeFromHack);\n }\n}\n\n/**\n * Potentially increases a stock's second-order forecast when the player works for\n * its corresponding company.\n * @param {Company} company - Company being worked for\n * @param {number} performanceMult - Effectiveness of player's work. Affects influence\n * @param {number} cyclesOfWork - # game cycles of work being processed\n */\nexport function influenceStockThroughCompanyWork(\n company: Company,\n performanceMult: number,\n cyclesOfWork: number,\n): void {\n const compName = company.name;\n let stock: Stock | null = null;\n if (typeof compName === \"string\" && compName !== \"\") {\n stock = StockMarket[compName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n if (Math.random() < 0.002 * cyclesOfWork) {\n const change = forecastForecastChangeFromCompanyWork * performanceMult;\n stock.changeForecastForecast(stock.otlkMagForecast + change);\n }\n}\n","import React from \"react\";\nimport { CONSTANTS } from \"../Constants\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { GraftableAugmentations } from \"../PersonObjects/Grafting/ui/GraftingRoot\";\nimport { Player } from \"@player\";\nimport { Work, WorkType } from \"./Work\";\nimport { graftingIntBonus } from \"../PersonObjects/Grafting/GraftingHelpers\";\nimport { applyAugmentation } from \"../Augmentation/AugmentationHelpers\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { GraftableAugmentation } from \"../PersonObjects/Grafting/GraftableAugmentation\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\n\nexport const isGraftingWork = (w: Work | null): w is GraftingWork => w !== null && w.type === WorkType.GRAFTING;\n\ninterface GraftingWorkParams {\n augmentation: string;\n singularity: boolean;\n}\n\nexport class GraftingWork extends Work {\n augmentation: string;\n unitCompleted: number;\n\n constructor(params?: GraftingWorkParams) {\n super(WorkType.GRAFTING, params?.singularity ?? true);\n this.unitCompleted = 0;\n this.augmentation = params?.augmentation ?? AugmentationNames.Targeting1;\n const gAugs = GraftableAugmentations();\n if (params) Player.loseMoney(gAugs[this.augmentation].cost, \"augmentations\");\n }\n\n unitNeeded(): number {\n return new GraftableAugmentation(StaticAugmentations[this.augmentation]).time;\n }\n\n process(cycles: number): boolean {\n let focusBonus = 1;\n if (!Player.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {\n focusBonus = Player.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n\n this.cyclesWorked += cycles;\n this.unitCompleted += CONSTANTS._idleSpeed * cycles * graftingIntBonus() * focusBonus;\n\n return this.unitCompleted >= this.unitNeeded();\n }\n\n finish(cancelled: boolean): void {\n const augName = this.augmentation;\n if (!cancelled) {\n applyAugmentation({ name: augName, level: 1 });\n\n if (!Player.hasAugmentation(AugmentationNames.CongruityImplant, true)) {\n Player.entropy += 1;\n Player.applyEntropy(Player.entropy);\n }\n\n if (!this.singularity) {\n dialogBoxCreate(\n <>\n You've finished grafting {augName}.<br />\n The augmentation has been applied to your body{\" \"}\n {Player.hasAugmentation(AugmentationNames.CongruityImplant, true) ? \".\" : \", but you feel a bit off.\"}\n </>,\n );\n }\n } else if (cancelled && !this.singularity) {\n dialogBoxCreate(\n <>\n You cancelled the grafting of {augName}.\n <br />\n Your money was not returned to you.\n </>,\n );\n }\n\n // Intelligence gain\n if (!cancelled) {\n Player.gainIntelligenceExp(\n (CONSTANTS.IntelligenceGraftBaseExpGain * this.cyclesWorked * CONSTANTS._idleSpeed) / 10000,\n );\n }\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n augmentation: this.augmentation,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"GraftingWork\", this);\n }\n\n /** Initializes a GraftingWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): GraftingWork {\n return Generic_fromJSON(GraftingWork, value.data);\n }\n}\n\nReviver.constructors.GraftingWork = GraftingWork;\n","import React from \"react\";\n\nimport { Bladeburner } from \"../Bladeburner\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { Player } from \"@player\";\nimport Button from \"@mui/material/Button\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { ActionIdentifier } from \"../ActionIdentifier\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n type: number;\n name: string;\n rerender: () => void;\n}\nexport function StartButton(props: IProps): React.ReactElement {\n const action = props.bladeburner.getActionObject(new ActionIdentifier({ name: props.name, type: props.type }));\n if (action == null) {\n throw new Error(\"Failed to get Operation Object for: \" + props.name);\n }\n let disabled = false;\n if (action.count < 1) {\n disabled = true;\n }\n if (props.name === \"Raid\" && props.bladeburner.getCurrentCity().comms === 0) {\n disabled = true;\n }\n\n if (action instanceof BlackOperation && props.bladeburner.rank < action.reqdRank) {\n disabled = true;\n }\n function onStart(): void {\n if (disabled) return;\n props.bladeburner.action.type = props.type;\n props.bladeburner.action.name = props.name;\n if (!Player.hasAugmentation(AugmentationNames.BladesSimulacrum, true)) Player.finishWork(true);\n props.bladeburner.startAction(props.bladeburner.action);\n props.rerender();\n }\n\n return (\n <Button sx={{ mx: 1 }} disabled={disabled} onClick={onStart}>\n Start\n </Button>\n );\n}\n","import React, { useEffect, useState } from \"react\";\n\nfunction replace(str: string, i: number, char: string): string {\n return str.substring(0, i) + char + str.substring(i + 1);\n}\n\ninterface IProps {\n content: string;\n}\n\nfunction randomize(char: string): string {\n const randFrom = (str: string): string => str[Math.floor(Math.random() * str.length)];\n const classes = [\"abcdefghijklmnopqrstuvwxyz\", \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", \"1234567890\", \" _\", \"()[]{}<>\"];\n const other = `!@#$%^&*()_+|\\\\';\"/.,?\\`~`;\n\n for (const c of classes) {\n if (c.includes(char)) return randFrom(c);\n }\n\n return randFrom(other);\n}\n\nexport function CorruptableText(props: IProps): JSX.Element {\n const [content, setContent] = useState(props.content);\n\n useEffect(() => {\n let counter = 5;\n const timers: number[] = [];\n const intervalId = setInterval(() => {\n counter--;\n if (counter > 0) return;\n counter = Math.random() * 5;\n const index = Math.random() * content.length;\n const letter = content.charAt(index);\n setContent((content) => replace(content, index, randomize(letter)));\n timers.push(\n window.setTimeout(() => {\n setContent((content) => replace(content, index, letter));\n }, 500),\n );\n }, 20);\n\n return () => {\n clearInterval(intervalId);\n timers.forEach((timerId) => clearTimeout(timerId));\n };\n }, []);\n\n return <span>{content}</span>;\n}\n","import { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\nimport { initAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { initSourceFiles } from \"./SourceFile/SourceFiles\";\nimport { initDarkWebItems } from \"./DarkWeb/DarkWebItems\";\nimport { generateRandomContract } from \"./CodingContractGenerator\";\nimport { initCompanies } from \"./Company/Companies\";\nimport { CONSTANTS } from \"./Constants\";\nimport { Factions, initFactions } from \"./Faction/Factions\";\nimport { staneksGift } from \"./CotMG/Helper\";\nimport { processPassiveFactionRepGain, inviteToFaction } from \"./Faction/FactionHelpers\";\nimport { Router } from \"./ui/GameRoot\";\nimport { Page } from \"./ui/Router\";\nimport { SetupTextEditor } from \"./ScriptEditor/ui/ScriptEditorRoot\";\n\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"./PersonObjects/formulas/reputation\";\nimport { hasHacknetServers, processHacknetEarnings } from \"./Hacknet/HacknetHelpers\";\nimport { iTutorialStart } from \"./InteractiveTutorial\";\nimport { checkForMessagesToSend } from \"./Message/MessageHelpers\";\nimport { loadAllRunningScripts, updateOnlineScriptTimes } from \"./NetscriptWorker\";\nimport { Player } from \"@player\";\nimport { saveObject, loadGame } from \"./SaveObject\";\nimport { initForeignServers } from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { ThemeEvents } from \"./Themes/ui/Theme\";\nimport { initSymbolToStockMap, processStockPrices } from \"./StockMarket/StockMarket\";\nimport { Terminal } from \"./Terminal\";\n\nimport { Money } from \"./ui/React/Money\";\nimport { Hashes } from \"./ui/React/Hashes\";\nimport { Reputation } from \"./ui/React/Reputation\";\n\nimport { AlertEvents } from \"./ui/React/AlertManager\";\nimport { exceptionAlert } from \"./utils/helpers/exceptionAlert\";\n\nimport { startExploits } from \"./Exploits/loops\";\nimport { calculateAchievements } from \"./Achievements/Achievements\";\n\nimport React from \"react\";\nimport { setupUncaughtPromiseHandler } from \"./UncaughtPromiseHandler\";\nimport { Button, Typography } from \"@mui/material\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\n\n/** Game engine. Handles the main game loop. */\nconst Engine: {\n _lastUpdate: number;\n updateGame: (numCycles?: number) => void;\n Counters: {\n [key: string]: number | undefined;\n autoSaveCounter: number;\n updateSkillLevelsCounter: number;\n updateDisplays: number;\n updateDisplaysLong: number;\n updateActiveScriptsDisplay: number;\n createProgramNotifications: number;\n augmentationsNotifications: number;\n checkFactionInvitations: number;\n passiveFactionGrowth: number;\n messages: number;\n mechanicProcess: number;\n contractGeneration: number;\n achievementsCounter: number;\n };\n decrementAllCounters: (numCycles?: number) => void;\n checkCounters: () => void;\n load: (saveString: string) => void;\n start: () => void;\n} = {\n // Time variables (milliseconds unix epoch time)\n _lastUpdate: new Date().getTime(),\n\n updateGame: function (numCycles = 1) {\n const time = numCycles * CONSTANTS._idleSpeed;\n if (Player.totalPlaytime == null) {\n Player.totalPlaytime = 0;\n }\n if (Player.playtimeSinceLastAug == null) {\n Player.playtimeSinceLastAug = 0;\n }\n if (Player.playtimeSinceLastBitnode == null) {\n Player.playtimeSinceLastBitnode = 0;\n }\n Player.totalPlaytime += time;\n Player.playtimeSinceLastAug += time;\n Player.playtimeSinceLastBitnode += time;\n\n Terminal.process(numCycles);\n\n Player.processWork(numCycles);\n\n // Update stock prices\n if (Player.hasWseAccount) {\n processStockPrices(numCycles);\n }\n\n // Gang\n if (Player.gang) Player.gang.process(numCycles);\n\n // Staneks gift\n staneksGift.process(numCycles);\n\n // Corporation\n if (Player.corporation) Player.corporation.storeCycles(numCycles);\n\n // Bladeburner\n if (Player.bladeburner) Player.bladeburner.storeCycles(numCycles);\n\n // Sleeves\n Player.sleeves.forEach((sleeve) => sleeve.process(numCycles));\n\n // Counters\n Engine.decrementAllCounters(numCycles);\n Engine.checkCounters();\n\n // Update the running time of all active scripts\n updateOnlineScriptTimes(numCycles);\n\n // Hacknet Nodes\n processHacknetEarnings(numCycles);\n },\n\n /**\n * Counters for the main event loop. Represent the number of game cycles that\n * are required for something to happen. These counters are in game cycles,\n * which is once every 200ms\n */\n Counters: {\n autoSaveCounter: 300,\n updateSkillLevelsCounter: 10,\n updateDisplays: 3,\n updateDisplaysLong: 15,\n updateActiveScriptsDisplay: 5,\n createProgramNotifications: 10,\n augmentationsNotifications: 10,\n checkFactionInvitations: 100,\n passiveFactionGrowth: 5,\n messages: 150,\n mechanicProcess: 5, // Processes certain mechanics (Corporation, Bladeburner)\n contractGeneration: 3000, // Generate Coding Contracts\n achievementsCounter: 60, // Check if we have new achievements\n },\n\n decrementAllCounters: function (numCycles = 1) {\n for (const [counterName, counter] of Object.entries(Engine.Counters)) {\n if (counter === undefined) throw new Error(\"counter should not be undefined\");\n Engine.Counters[counterName] = counter - numCycles;\n }\n },\n\n /**\n * Checks if any counters are 0. If they are, executes whatever\n * is necessary and then resets the counter\n */\n checkCounters: function () {\n if (Engine.Counters.autoSaveCounter <= 0) {\n if (Settings.AutosaveInterval == null) {\n Settings.AutosaveInterval = 60;\n }\n if (Settings.AutosaveInterval === 0) {\n warnAutosaveDisabled();\n Engine.Counters.autoSaveCounter = 60 * 5; // Let's check back in a bit\n } else {\n Engine.Counters.autoSaveCounter = Settings.AutosaveInterval * 5;\n saveObject.saveGame(!Settings.SuppressSavedGameToast);\n }\n }\n\n if (Engine.Counters.checkFactionInvitations <= 0) {\n const invitedFactions = Player.checkForFactionInvitations();\n if (invitedFactions.length > 0) {\n const randFaction = invitedFactions[Math.floor(Math.random() * invitedFactions.length)];\n inviteToFaction(randFaction);\n }\n Engine.Counters.checkFactionInvitations = 100;\n }\n\n if (Engine.Counters.passiveFactionGrowth <= 0) {\n const adjustedCycles = Math.floor(5 - Engine.Counters.passiveFactionGrowth);\n processPassiveFactionRepGain(adjustedCycles);\n Engine.Counters.passiveFactionGrowth = 5;\n }\n\n if (Engine.Counters.messages <= 0) {\n checkForMessagesToSend();\n if (Player.hasAugmentation(AugmentationNames.TheRedPill)) {\n Engine.Counters.messages = 4500; // 15 minutes for Red pill message\n } else {\n Engine.Counters.messages = 150;\n }\n }\n if (Player.corporation) {\n Player.corporation.process();\n }\n if (Engine.Counters.mechanicProcess <= 0) {\n if (Player.bladeburner) {\n try {\n Player.bladeburner.process();\n } catch (e) {\n exceptionAlert(\"Exception caught in Bladeburner.process(): \" + e);\n }\n }\n Engine.Counters.mechanicProcess = 5;\n }\n\n if (Engine.Counters.contractGeneration <= 0) {\n // X% chance of a contract being generated\n if (Math.random() <= 0.25) {\n generateRandomContract();\n }\n Engine.Counters.contractGeneration = 3000;\n }\n\n if (Engine.Counters.achievementsCounter <= 0) {\n calculateAchievements();\n Engine.Counters.achievementsCounter = 300;\n }\n },\n\n load: function (saveString) {\n startExploits();\n setupUncaughtPromiseHandler();\n // Load game from save or create new game\n\n if (loadGame(saveString)) {\n ThemeEvents.emit();\n initSourceFiles();\n initDarkWebItems();\n initAugmentations(); // Also calls Player.reapplyAllAugmentations()\n Player.reapplyAllSourceFiles();\n if (Player.hasWseAccount) {\n initSymbolToStockMap();\n }\n\n // Apply penalty for entropy accumulation\n Player.applyEntropy(Player.entropy);\n\n // Calculate the number of cycles have elapsed while offline\n Engine._lastUpdate = new Date().getTime();\n const lastUpdate = Player.lastUpdate;\n const timeOffline = Engine._lastUpdate - lastUpdate;\n const numCyclesOffline = Math.floor(timeOffline / CONSTANTS._idleSpeed);\n\n // Calculate the number of chances for a contract the player had whilst offline\n const contractChancesWhileOffline = Math.floor(timeOffline / (1000 * 60 * 10));\n\n // Generate coding contracts\n if (Player.sourceFiles.length > 0) {\n let numContracts = 0;\n if (contractChancesWhileOffline > 100) {\n numContracts += Math.floor(contractChancesWhileOffline * 0.25);\n }\n if (contractChancesWhileOffline > 0 && contractChancesWhileOffline <= 100) {\n for (let i = 0; i < contractChancesWhileOffline; ++i) {\n if (Math.random() <= 0.25) {\n numContracts++;\n }\n }\n }\n for (let i = 0; i < numContracts; i++) {\n generateRandomContract();\n }\n }\n\n let offlineReputation = 0;\n const offlineHackingIncome = (Player.moneySourceA.hacking / Player.playtimeSinceLastAug) * timeOffline * 0.75;\n Player.gainMoney(offlineHackingIncome, \"hacking\");\n // Process offline progress\n\n loadAllRunningScripts(); // This also takes care of offline production for those scripts\n\n if (Player.currentWork !== null) {\n Player.focus = true;\n Player.processWork(numCyclesOffline);\n } else {\n for (let i = 0; i < Player.factions.length; i++) {\n const facName = Player.factions[i];\n if (!Factions.hasOwnProperty(facName)) continue;\n const faction = Factions[facName];\n if (!faction.isMember) continue;\n // No rep for special factions.\n const info = faction.getInfo();\n if (!info.offersWork()) continue;\n // No rep for gangs.\n if (Player.getGangName() === facName) continue;\n\n const hRep = getHackingWorkRepGain(Player, faction.favor);\n const sRep = getFactionSecurityWorkRepGain(Player, faction.favor);\n const fRep = getFactionFieldWorkRepGain(Player, faction.favor);\n // can be infinite, doesn't matter.\n const reputationRate = Math.max(hRep, sRep, fRep) / Player.factions.length;\n\n const rep = reputationRate * numCyclesOffline;\n faction.playerReputation += rep;\n offlineReputation += rep;\n }\n }\n\n // Hacknet Nodes offline progress\n const offlineProductionFromHacknetNodes = processHacknetEarnings(numCyclesOffline);\n const hacknetProdInfo = hasHacknetServers() ? (\n <>\n <Hashes hashes={offlineProductionFromHacknetNodes} /> hashes\n </>\n ) : (\n <Money money={offlineProductionFromHacknetNodes} />\n );\n\n // Passive faction rep gain offline\n processPassiveFactionRepGain(numCyclesOffline);\n\n // Stock Market offline progress\n if (Player.hasWseAccount) {\n processStockPrices(numCyclesOffline);\n }\n\n // Gang progress for BitNode 2\n if (Player.gang) Player.gang.process(numCyclesOffline);\n\n // Corporation offline progress\n if (Player.corporation) Player.corporation.storeCycles(numCyclesOffline);\n\n // Bladeburner offline progress\n if (Player.bladeburner) Player.bladeburner.storeCycles(numCyclesOffline);\n\n staneksGift.process(numCyclesOffline);\n\n // Sleeves offline progress\n Player.sleeves.forEach((sleeve) => sleeve.process(numCyclesOffline));\n\n // Update total playtime\n const time = numCyclesOffline * CONSTANTS._idleSpeed;\n Player.totalPlaytime ??= 0;\n Player.playtimeSinceLastAug ??= 0;\n Player.playtimeSinceLastBitnode ??= 0;\n\n Player.totalPlaytime += time;\n Player.playtimeSinceLastAug += time;\n Player.playtimeSinceLastBitnode += time;\n\n Player.lastUpdate = Engine._lastUpdate;\n Engine.start(); // Run main game loop and Scripts loop\n const timeOfflineString = convertTimeMsToTimeElapsedString(time);\n setTimeout(\n () =>\n AlertEvents.emit(\n <>\n <Typography>Offline for {timeOfflineString}. While you were offline:</Typography>\n <ul>\n <li>\n <Typography>\n Your scripts generated <Money money={offlineHackingIncome} />\n </Typography>\n </li>\n <li>\n <Typography>Your Hacknet Nodes generated {hacknetProdInfo}</Typography>\n </li>\n <li>\n <Typography>\n You gained <Reputation reputation={offlineReputation} /> reputation divided amongst your factions\n </Typography>\n </li>\n </ul>\n </>,\n ),\n 250,\n );\n } else {\n // No save found, start new game\n initSourceFiles();\n initDarkWebItems();\n Engine.start(); // Run main game loop and Scripts loop\n Player.init();\n initForeignServers(Player.getHomeComputer());\n initCompanies();\n initFactions();\n initAugmentations();\n\n // Start interactive tutorial\n iTutorialStart();\n }\n SetupTextEditor();\n },\n\n start: function () {\n // Get time difference\n const _thisUpdate = new Date().getTime();\n let diff = _thisUpdate - Engine._lastUpdate;\n const offset = diff % CONSTANTS._idleSpeed;\n\n // Divide this by cycle time to determine how many cycles have elapsed since last update\n diff = Math.floor(diff / CONSTANTS._idleSpeed);\n\n if (diff > 0) {\n // Update the game engine by the calculated number of cycles\n Engine._lastUpdate = _thisUpdate - offset;\n Player.lastUpdate = _thisUpdate - offset;\n Engine.updateGame(diff);\n }\n window.requestAnimationFrame(Engine.start);\n },\n};\n\n/** Shows a toast warning that lets the player know that auto-saves are disabled, with an button to re-enable them. */\nfunction warnAutosaveDisabled(): void {\n // If the player has suppressed those warnings let's just exit right away.\n if (Settings.SuppressAutosaveDisabledWarnings) return;\n\n // We don't want this warning to show up on certain pages.\n // When in recovery or importing we want to keep autosave disabled.\n const ignoredPages = [Page.Recovery, Page.ImportSave];\n if (ignoredPages.includes(Router.page())) return;\n\n const warningToast = (\n <>\n Auto-saves are <strong>disabled</strong>!\n <Button\n sx={{ ml: 1 }}\n color=\"warning\"\n size=\"small\"\n onClick={() => {\n // We reset the value to a default\n Settings.AutosaveInterval = 60;\n }}\n >\n Enable\n </Button>\n </>\n );\n SnackbarEvents.emit(warningToast, ToastVariant.WARNING, 5000);\n}\n\nexport { Engine };\n","import React from \"react\";\nimport { FactionNames } from \"./data/FactionNames\";\nimport { Router } from \"../ui/GameRoot\";\nimport { Option } from \"./ui/Option\";\nimport { Typography } from \"@mui/material\";\n\ninterface FactionInfoParams {\n infoText?: JSX.Element;\n enemies?: string[];\n offerHackingWork?: boolean;\n offerFieldWork?: boolean;\n offerSecurityWork?: boolean;\n special?: boolean;\n keepOnInstall?: boolean;\n assignment?: () => React.ReactElement;\n}\n\n/** Contains the \"information\" property for all the Factions, which is just a description of each faction */\nexport class FactionInfo {\n /** The names of all other factions considered to be enemies to this faction. */\n enemies: string[];\n\n /** The descriptive text to show on the faction's page. */\n infoText: JSX.Element;\n\n /** A flag indicating if the faction supports field work to earn reputation. */\n offerFieldWork: boolean;\n\n /** A flag indicating if the faction supports hacking work to earn reputation. */\n offerHackingWork: boolean;\n\n /** A flag indicating if the faction supports security work to earn reputation. */\n offerSecurityWork: boolean;\n\n /** Keep faction on install. */\n keep: boolean;\n\n /** Special faction */\n special: boolean;\n\n /** The data to display on the faction screen. */\n assignment?: () => React.ReactElement;\n\n constructor(params: FactionInfoParams) {\n this.infoText = params.infoText ?? <></>;\n this.enemies = params.enemies ?? [];\n this.offerHackingWork = params.offerHackingWork ?? false;\n this.offerFieldWork = params.offerFieldWork ?? false;\n this.offerSecurityWork = params.offerSecurityWork ?? false;\n\n this.keep = params.keepOnInstall ?? false;\n this.special = params.special ?? false;\n this.assignment = params.assignment;\n }\n\n offersWork(): boolean {\n return this.offerFieldWork || this.offerHackingWork || this.offerSecurityWork;\n }\n}\n\n/** A map of all factions and associated info to them. */\n// tslint:disable-next-line:variable-name\nexport const FactionInfos: Record<string, FactionInfo> = {\n // Endgame\n [FactionNames.Illuminati]: new FactionInfo({\n infoText: (\n <>\n Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And\n from this chaos, we are the invisible hand that guides them to order.{\" \"}\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.Daedalus]: new FactionInfo({\n infoText: <>Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.TheCovenant]: new FactionInfo({\n infoText: (\n <>\n Surrender yourself. Give up your empty individuality to become part of something great, something eternal.\n Become a slave. Submit your mind, body, and soul. Only then can you set yourself free.\n <br />\n <br />\n Only then can you discover immortality.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n // Megacorporations, each forms its own faction\n [FactionNames.ECorp]: new FactionInfo({\n infoText: (\n <>\n {FactionNames.ECorp}'s mission is simple: to connect the world of today with the technology of tomorrow. With\n our wide range of Internet-related software and commercial hardware, {FactionNames.ECorp} makes the world's\n information universally accessible.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.MegaCorp]: new FactionInfo({\n infoText: (\n <>\n {FactionNames.MegaCorp} does what no other dares to do. We imagine. We create. We invent. We create what others\n have never even dreamed of. Our work fills the world's needs for food, water, power, and transportation on an\n unprecedented scale, in ways that no other company can.\n <br />\n <br />\n In our labs and factories and on the ground with customers, {FactionNames.MegaCorp} is ushering in a new era for\n the world.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.BachmanAssociates]: new FactionInfo({\n infoText: (\n <>\n Where Law and Business meet - that's where we are.\n <br />\n <br />\n Legal Insight - Business Instinct - Innovative Experience.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.BladeIndustries]: new FactionInfo({\n infoText: <>Augmentation is Salvation.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.NWO]: new FactionInfo({\n infoText: (\n <>\n Humans don't truly desire freedom. They want to be observed, understood, and judged. They want to be given\n purpose and direction in life. That is why they created God. And that is why they created civilization - not\n because of willingness, but because of a need to be incorporated into higher orders of structure and meaning.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.ClarkeIncorporated]: new FactionInfo({\n infoText: <>The Power of the Genome - Unlocked.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.OmniTekIncorporated]: new FactionInfo({\n infoText: <>Simply put, our mission is to design and build robots that make a difference.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.FourSigma]: new FactionInfo({\n infoText: (\n <>\n The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven by\n deep learning and innovative ideas. And improved by iteration. That's {FactionNames.FourSigma}.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.KuaiGongInternational]: new FactionInfo({\n infoText: <>Dream big. Work hard. Make history.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n // Other Corporations\n [FactionNames.FulcrumSecretTechnologies]: new FactionInfo({\n infoText: (\n <>\n The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it\n would be necessary to create them. And now we can.\n </>\n ),\n offerHackingWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n // Hacker groups\n [FactionNames.BitRunners]: new FactionInfo({\n infoText: (\n <>\n Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all\n transformed into bits, stored in bits, communicated through bits. It’s impossible for any person to move, to\n live, to operate at any level without the use of bits. And when a person moves, lives, and operates, they leave\n behind their bits, mere traces of seemingly meaningless fragments of information. But these bits can be\n reconstructed. Transformed. Used.\n <br />\n <br />\n Those who run the bits, run the world.\n </>\n ),\n offerHackingWork: true,\n }),\n\n [FactionNames.TheBlackHand]: new FactionInfo({\n infoText: (\n <>\n The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power.\n Technological power. And those at the top rule with an invisible hand. They built a society where the rich get\n richer, and everyone else suffers.\n <br />\n <br />\n So much pain. So many lives. Their darkness must end.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n // prettier-ignore\n [FactionNames.NiteSec]: new FactionInfo({\n infoText:(<>\n {\" __..__ \"}<br />\n {\" _.nITESECNIt. \"}<br />\n {\" .-'NITESECNITESEc. \"}<br />\n {\" .' NITESECNITESECn \"}<br />\n {\" / NITESECNITESEC; \"}<br />\n {\" : :NITESECNITESEC; \"}<br />\n {\" ; $ NITESECNITESECN \"}<br />\n {\" : _, ,N'ITESECNITESEC \"}<br />\n {\" : .+^^`, : `NITESECNIT \"}<br />\n {\" ) /), `-,-=,NITESECNI \"}<br />\n {\" / ^ ,-;|NITESECN; \"}<br />\n {\" / _.' '-';NITESECN \"}<br />\n {\" ( , ,-''`^NITE' \"}<br />\n {\" )` :`. .' \"}<br />\n {\" )-- ; `- / \"}<br />\n {\" ' _.-' : \"}<br />\n {\" ( _.-' . \"}<br />\n {\" ------. \"}<br />\n {\" . \"}<br />\n {\" _.nIt \"}<br />\n {\" _.nITESECNi \"}<br />\n {\" nITESECNIT^' \"}<br />\n {\" NITE^' ___ \"}<br />\n {\" / .gP''''Tp. \"}<br />\n {\" : d' . `b \"}<br />\n {\" ; d' o `b ; \"}<br />\n {\" / d; `b| \"}<br />\n {\" /, $; @ `: \"}<br />\n {\" /' $/ ; \"}<br />\n {\" .' $/b o | \"}<br />\n {\" .' d$/$; : \"}<br />\n {\" / .d/$/$; , ; \"}<br />\n {\" d .dNITESEC $ | \"}<br />\n {\" :bp.__.gNITESEC/$ :$ ; \"}<br />\n {\" NITESECNITESECNIT /$b : \"}<br /></>),\n offerHackingWork: true,\n offerFieldWork: false,\n offerSecurityWork: false,\n special: false,\n keepOnInstall: false,\n }),\n\n // City factions, essentially governments\n [FactionNames.Aevum]: new FactionInfo({\n infoText: <>The Silicon City.</>,\n enemies: [FactionNames.Chongqing, FactionNames.NewTokyo, FactionNames.Ishima, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Chongqing]: new FactionInfo({\n infoText: <>Serve the People.</>,\n enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Ishima]: new FactionInfo({\n infoText: <>The East Asian Order of the Future.</>,\n enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.NewTokyo]: new FactionInfo({\n infoText: <>Asia's World City.</>,\n enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Sector12]: new FactionInfo({\n infoText: <>The City of the Future.</>,\n enemies: [FactionNames.Chongqing, FactionNames.NewTokyo, FactionNames.Ishima, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Volhaven]: new FactionInfo({\n infoText: <>Benefit, Honor, and Glory.</>,\n enemies: [\n FactionNames.Chongqing,\n FactionNames.Sector12,\n FactionNames.NewTokyo,\n FactionNames.Aevum,\n FactionNames.Ishima,\n ],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n // Criminal Organizations/Gangs\n [FactionNames.SpeakersForTheDead]: new FactionInfo({\n infoText: <>It is better to reign in Hell than to serve in Heaven.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n [FactionNames.TheDarkArmy]: new FactionInfo({\n infoText: <>The World doesn't care about right or wrong. It only cares about power.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.TheSyndicate]: new FactionInfo({\n infoText: <>Honor holds you back.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n [FactionNames.Silhouette]: new FactionInfo({\n infoText: (\n <>\n Corporations have filled the void of power left behind by the collapse of Western government. The issue is\n they've become so big that you don't know who they're working for. And if you're employed at one of these\n corporations, you don't even know who you're working for.\n <br />\n <br />\n That's terror. Terror, fear, and corruption. All born into the system, all propagated by the system.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.Tetrads]: new FactionInfo({\n infoText: <>Following the mandate of Heaven and carrying out the way.</>,\n\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n [FactionNames.SlumSnakes]: new FactionInfo({\n infoText: <>{FactionNames.SlumSnakes} rule!</>,\n\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n // Early game factions - factions the player will prestige with early on that don't belong in other categories.\n [FactionNames.Netburners]: new FactionInfo({\n infoText: <>{\"~~//*>H4CK||3T 8URN3R5**>?>\\\\~~\"}</>,\n offerHackingWork: true,\n }),\n\n [FactionNames.TianDiHui]: new FactionInfo({\n infoText: <>Obey Heaven and work righteously.</>,\n offerHackingWork: true,\n\n offerSecurityWork: true,\n }),\n\n [FactionNames.CyberSec]: new FactionInfo({\n infoText: (\n <>\n The Internet is the first thing that was built that we don't fully understand, the largest experiment in anarchy\n that we have ever had. And as the world becomes increasingly dominated by it, society approaches the brink of\n total chaos. We serve only to protect society, to protect humanity, to protect the world from imminent collapse.\n </>\n ),\n offerHackingWork: true,\n }),\n\n // Special Factions\n [FactionNames.Bladeburners]: new FactionInfo({\n infoText: (\n <>\n It's too bad they won't live. But then again, who does?\n <br />\n <br />\n Note that for this faction, reputation can only be gained through {FactionNames.Bladeburners} actions.{\" \"}\n Completing {FactionNames.Bladeburners} contracts/operations will increase your reputation.\n </>\n ),\n\n special: true,\n assignment: (): React.ReactElement => {\n return (\n <Option\n buttonText={\"Open Bladeburner headquarters\"}\n infoText={\"You can gain reputation with bladeburner by completing contracts and operations.\"}\n onClick={() => Router.toBladeburner()}\n />\n );\n },\n }),\n\n [FactionNames.ChurchOfTheMachineGod]: new FactionInfo({\n // prettier-ignore\n infoText:(<>\n {\" `` \"}<br />\n {\" -odmmNmds: \"}<br />\n {\" `hNmo:..-omNh. \"}<br />\n {\" yMd` `hNh \"}<br />\n {\" mMd oNm \"}<br />\n {\" oMNo .mM/ \"}<br />\n {\" `dMN+ -mM+ \"}<br />\n {\" -mMNo -mN+ \"}<br />\n {\" .+- :mMNo/mN/ \"}<br />\n {\":yNMd. :NMNNN/ \"}<br />\n {\"-mMMMh. /NMMh` \"}<br />\n {\" .dMMMd. /NMMMy` \"}<br />\n {\" `yMMMd. /NNyNMMh` \"}<br />\n {\" `sMMMd. +Nm: +NMMh. \"}<br />\n {\" oMMMm- oNm: /NMMd. \"}<br />\n {\" +NMMmsMm- :mMMd. \"}<br />\n {\" /NMMMm- -mMMd. \"}<br />\n {\" /MMMm- -mMMd. \"}<br />\n {\" `sMNMMm- .mMmo \"}<br />\n {\" `sMd:hMMm. ./. \"}<br />\n {\" `yMy` `yNMd` \"}<br />\n {\" `hMs` oMMy \"}<br />\n {\" `hMh sMN- \"}<br />\n {\" /MM- .NMo \"}<br />\n {\" +MM: :MM+ \"}<br />\n {\" sNNo-.`.-omNy` \"}<br />\n {\" -smNNNNmdo- \"}<br />\n {\" `..` \"}<br /><br />\n Many cultures predict an end to humanity in the near future, a final\n Armageddon that will end the world; but we disagree.</>),\n offerHackingWork: false,\n offerFieldWork: false,\n offerSecurityWork: false,\n special: true,\n keepOnInstall: true,\n assignment: (): React.ReactElement => {\n return (\n <Option\n buttonText={\"Open Staneks Gift\"}\n infoText={\n \"Stanek's Gift is a powerful augmentation that powers up the stat you chose to boost.\" +\n \"Gaining reputation with the Church of the Machine God can only be done by charging the gift.\"\n }\n onClick={() => Router.toStaneksGift()}\n />\n );\n },\n }),\n [FactionNames.ShadowsOfAnarchy]: new FactionInfo({\n infoText: (\n <>\n The government is ruled by the corporations that we have allowed to consume it. To release the world from its\n shackles, the gods grant us their strength.\n </>\n ),\n special: true,\n keepOnInstall: true,\n assignment: (): React.ReactElement => {\n return <Typography>{FactionNames.ShadowsOfAnarchy} can only gain reputation by infiltrating.</Typography>;\n },\n }),\n};\n","import { Person } from \"../../PersonObjects/Person\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { FactionWorkType } from \"../data/FactionWorkType\";\nimport { newWorkStats, WorkStats } from \"../WorkStats\";\nimport {\n getFactionFieldWorkRepGain,\n getFactionSecurityWorkRepGain,\n getHackingWorkRepGain,\n} from \"../../PersonObjects/formulas/reputation\";\n\nconst gameCPS = 1000 / CONSTANTS._idleSpeed; // 5 cycles per second\n\nexport const FactionWorkStats: Record<FactionWorkType, WorkStats> = {\n [FactionWorkType.HACKING]: newWorkStats({ hackExp: 15 }),\n [FactionWorkType.FIELD]: newWorkStats({\n hackExp: 10,\n strExp: 10,\n defExp: 10,\n dexExp: 10,\n agiExp: 10,\n chaExp: 10,\n }),\n [FactionWorkType.SECURITY]: newWorkStats({\n hackExp: 5,\n strExp: 15,\n defExp: 15,\n dexExp: 15,\n agiExp: 15,\n }),\n};\n\nexport const calculateFactionRep = (person: Person, tpe: FactionWorkType, favor: number): number => {\n const repFormulas = {\n [FactionWorkType.HACKING]: getHackingWorkRepGain,\n [FactionWorkType.FIELD]: getFactionFieldWorkRepGain,\n [FactionWorkType.SECURITY]: getFactionSecurityWorkRepGain,\n };\n return repFormulas[tpe](person, favor);\n};\n\nexport function calculateFactionExp(person: Person, tpe: FactionWorkType): WorkStats {\n const baseStats = FactionWorkStats[tpe];\n return {\n money: 0,\n reputation: 0,\n hackExp: (baseStats.hackExp * person.mults.hacking_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n strExp: (baseStats.strExp * person.mults.strength_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n defExp: (baseStats.defExp * person.mults.defense_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n dexExp: (baseStats.dexExp * person.mults.dexterity_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n agiExp: (baseStats.agiExp * person.mults.agility_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n chaExp: (baseStats.chaExp * person.mults.charisma_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n intExp: 0,\n };\n}\n","export interface CorporationUpgrade {\n index: number;\n basePrice: number;\n priceMult: number;\n benefit: number;\n name: string;\n desc: string;\n}\n\nexport enum CorporationUpgradeIndex {\n SmartFactories = 0,\n SmartStorage = 1,\n DreamSense = 2,\n WilsonAnalytics = 3,\n NuoptimalNootropicInjectorImplants = 4,\n SpeechProcessorImplants = 5,\n NeuralAccelerators = 6,\n FocusWires = 7,\n ABCSalesBots = 8,\n ProjectInsight = 9,\n}\n\n// Corporation Upgrades\n// Upgrades for entire corporation, levelable upgrades\nexport const CorporationUpgrades: Record<CorporationUpgradeIndex, CorporationUpgrade> = {\n //Smart factories, increases production\n [CorporationUpgradeIndex.SmartFactories]: {\n index: CorporationUpgradeIndex.SmartFactories,\n basePrice: 2e9,\n priceMult: 1.06,\n benefit: 0.03,\n name: \"Smart Factories\",\n desc:\n \"Advanced AI automatically optimizes the operation and productivity \" +\n \"of factories. Each level of this upgrade increases your global production by 3% (additive).\",\n },\n\n //Smart warehouses, increases storage size\n [CorporationUpgradeIndex.SmartStorage]: {\n index: CorporationUpgradeIndex.SmartStorage,\n basePrice: 2e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Smart Storage\",\n desc:\n \"Advanced AI automatically optimizes your warehouse storage methods. \" +\n \"Each level of this upgrade increases your global warehouse storage size by 10% (additive).\",\n },\n\n //Advertise through dreams, passive popularity/ awareness gain\n [CorporationUpgradeIndex.DreamSense]: {\n index: CorporationUpgradeIndex.DreamSense,\n basePrice: 4e9,\n priceMult: 1.1,\n benefit: 0.001,\n name: \"DreamSense\",\n desc:\n \"Use DreamSense LCC Technologies to advertise your corporation \" +\n \"to consumers through their dreams. Each level of this upgrade provides a passive \" +\n \"increase in awareness of all of your companies (divisions) by 0.004 / market cycle,\" +\n \"and in popularity by 0.001 / market cycle. A market cycle is approximately \" +\n \"15 seconds.\",\n },\n\n //Makes advertising more effective\n [CorporationUpgradeIndex.WilsonAnalytics]: {\n index: CorporationUpgradeIndex.WilsonAnalytics,\n basePrice: 4e9,\n priceMult: 1.5,\n benefit: 0.005,\n name: \"Wilson Analytics\",\n desc:\n \"Purchase data and analysis from Wilson, a marketing research \" +\n \"firm. Each level of this upgrade increases the effectiveness of your \" +\n \"advertising by 0.5% (additive).\",\n },\n\n //Augmentation for employees, increases cre\n [CorporationUpgradeIndex.NuoptimalNootropicInjectorImplants]: {\n index: CorporationUpgradeIndex.NuoptimalNootropicInjectorImplants,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Nuoptimal Nootropic Injector Implants\",\n desc:\n \"Purchase the Nuoptimal Nootropic \" +\n \"Injector augmentation for your employees. Each level of this upgrade \" +\n \"globally increases the creativity of your employees by 10% (additive).\",\n },\n\n //Augmentation for employees, increases cha\n [CorporationUpgradeIndex.SpeechProcessorImplants]: {\n index: CorporationUpgradeIndex.SpeechProcessorImplants,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Speech Processor Implants\",\n desc:\n \"Purchase the Speech Processor augmentation for your employees. \" +\n \"Each level of this upgrade globally increases the charisma of your employees by 10% (additive).\",\n },\n\n //Augmentation for employees, increases int\n [CorporationUpgradeIndex.NeuralAccelerators]: {\n index: CorporationUpgradeIndex.NeuralAccelerators,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Neural Accelerators\",\n desc:\n \"Purchase the Neural Accelerator augmentation for your employees. \" +\n \"Each level of this upgrade globally increases the intelligence of your employees \" +\n \"by 10% (additive).\",\n },\n\n //Augmentation for employees, increases eff\n [CorporationUpgradeIndex.FocusWires]: {\n index: CorporationUpgradeIndex.FocusWires,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"FocusWires\",\n desc:\n \"Purchase the FocusWire augmentation for your employees. Each level \" +\n \"of this upgrade globally increases the efficiency of your employees by 10% (additive).\",\n },\n\n //Improves sales of materials/products\n [CorporationUpgradeIndex.ABCSalesBots]: {\n index: CorporationUpgradeIndex.ABCSalesBots,\n basePrice: 1e9,\n priceMult: 1.07,\n benefit: 0.01,\n name: \"ABC SalesBots\",\n desc:\n \"Always Be Closing. Purchase these robotic salesmen to increase the amount of \" +\n \"materials and products you sell. Each level of this upgrade globally increases your sales \" +\n \"by 1% (additive).\",\n },\n\n //Improves scientific research rate\n [CorporationUpgradeIndex.ProjectInsight]: {\n index: CorporationUpgradeIndex.ProjectInsight,\n basePrice: 5e9,\n priceMult: 1.07,\n benefit: 0.05,\n name: \"Project Insight\",\n desc:\n \"Purchase 'Project Insight', a R&D service provided by the secretive \" +\n \"Fulcrum Technologies. Each level of this upgrade globally increases the amount of \" +\n \"Scientific Research you produce by 5% (additive).\",\n },\n};\n","import { EventEmitter } from \"../../utils/EventEmitter\";\nexport const ITutorialEvents = new EventEmitter<[]>();\n","/**\n * The worker agent for running a script instance. Each running script instance\n * has its own underlying WorkerScript object.\n *\n * Note that these objects are not saved and re-loaded when the game is refreshed.\n * Instead, whenever the game is opened, WorkerScripts are re-created from\n * RunningScript objects\n */\nimport { Environment } from \"./Environment\";\nimport { RamCostConstants } from \"./RamCostGenerator\";\n\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { Script } from \"../Script/Script\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { NS } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { ScriptDeath } from \"./ScriptDeath\";\nimport { ScriptArg } from \"./ScriptArg\";\n\nexport class WorkerScript {\n /** Script's arguments */\n args: ScriptArg[];\n\n /** Copy of the script's code */\n code = \"\";\n\n /**\n * Holds the timeoutID (numeric value) for whenever this script is blocked by a\n * timed Netscript function. i.e. Holds the return value of setTimeout()\n */\n delay: number | null = null;\n\n /** Holds the Promise reject() function while the script is \"blocked\" by an async op */\n delayReject?: (reason?: ScriptDeath) => void;\n\n /** Stores names of all functions that have logging disabled */\n disableLogs: Record<string, boolean> = {};\n\n /**\n * Used for dynamic RAM calculation. Stores names of all functions that have\n * already been checked by this script.\n * TODO: Could probably just combine this with loadedFns?\n */\n dynamicLoadedFns: Record<string, boolean> = {};\n\n /** Tracks dynamic RAM usage */\n dynamicRamUsage: number = RamCostConstants.ScriptBaseRamCost;\n\n /** Netscript Environment for this script */\n env: Environment;\n\n /** Status message in case of script error. */\n errorMessage = \"\";\n\n /**\n * Used for static RAM calculation. Stores names of all functions that have\n * already been checked by this script\n */\n loadedFns: Record<string, boolean> = {};\n\n /** Filename of script */\n name: string;\n\n /** Script's output/return value. Currently not used or implemented */\n output = \"\";\n\n /**\n * Process ID. Must be an integer. Used for efficient script\n * killing and removal.\n */\n pid: number;\n\n /** Script's Static RAM usage. Equivalent to underlying script's RAM usage */\n ramUsage = 0;\n\n /** Reference to underlying RunningScript object */\n scriptRef: RunningScript;\n\n /** hostname on which this script is running */\n hostname: string;\n\n /** Function called when the script ends. */\n atExit?: () => void;\n\n constructor(runningScriptObj: RunningScript, pid: number, nsFuncsGenerator?: (ws: WorkerScript) => NS) {\n this.name = runningScriptObj.filename;\n this.hostname = runningScriptObj.server;\n\n const sanitizedPid = Math.round(pid);\n if (typeof sanitizedPid !== \"number\" || isNaN(sanitizedPid)) {\n throw new Error(`Invalid PID when constructing WorkerScript: ${pid}`);\n }\n this.pid = sanitizedPid;\n runningScriptObj.pid = sanitizedPid;\n\n // Get the underlying script's code\n const server = GetServer(this.hostname);\n if (server == null) {\n throw new Error(`WorkerScript constructed with invalid server ip: ${this.hostname}`);\n }\n let found = false;\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === this.name) {\n found = true;\n this.code = server.scripts[i].code;\n }\n }\n if (!found) {\n throw new Error(`WorkerScript constructed with invalid script filename: ${this.name}`);\n }\n this.scriptRef = runningScriptObj;\n this.args = runningScriptObj.args.slice();\n this.env = new Environment();\n if (typeof nsFuncsGenerator === \"function\") {\n this.env.vars = nsFuncsGenerator(this);\n }\n }\n\n /** Returns the Server on which this script is running */\n getServer(): BaseServer {\n const server = GetServer(this.hostname);\n if (server == null) throw new Error(`Script ${this.name} pid ${this.pid} is running on non-existent server?`);\n return server;\n }\n\n /**\n * Returns the Script object for the underlying script.\n * Returns null if it cannot be found (which would be a bug)\n */\n getScript(): Script | null {\n const server = this.getServer();\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === this.name) {\n return server.scripts[i];\n }\n }\n\n console.error(\n \"Failed to find underlying Script object in WorkerScript.getScript(). This probably means somethings wrong\",\n );\n return null;\n }\n\n /**\n * Returns the script with the specified filename on the specified server,\n * or null if it cannot be found\n */\n getScriptOnServer(fn: string, server: BaseServer): Script | null {\n if (server == null) {\n server = this.getServer();\n }\n\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === fn) {\n return server.scripts[i];\n }\n }\n\n return null;\n }\n\n shouldLog(fn: string): boolean {\n return this.disableLogs[fn] == null;\n }\n\n log(func: string, txt: () => string): void {\n if (this.shouldLog(func)) {\n if (func && txt) {\n this.scriptRef.log(`${func}: ${txt()}`);\n } else if (func) {\n this.scriptRef.log(func);\n } else {\n this.scriptRef.log(txt());\n }\n }\n }\n\n print(txt: string): void {\n this.scriptRef.log(txt);\n }\n}\n","import { Crimes } from \"./Crimes\";\nimport { Crime } from \"./Crime\";\nimport { Player } from \"@player\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\n//This is only used for the player\nexport function determineCrimeSuccess(type: string): boolean {\n let chance = 0;\n let found = false;\n for (const i of Object.keys(Crimes)) {\n const crime = Crimes[i];\n if (crime.type === type) {\n chance = crime.successRate(Player);\n found = true;\n break;\n }\n }\n\n if (!found) {\n dialogBoxCreate(`ERR: Unrecognized crime type: ${type} This is probably a bug please contact the developer`);\n return false;\n }\n return Math.random() <= chance;\n}\n\nexport function findCrime(roughName: string): Crime | null {\n roughName = roughName.toLowerCase();\n if (roughName.includes(\"shoplift\")) {\n return Crimes.Shoplift;\n } else if (roughName.includes(\"rob\") && roughName.includes(\"store\")) {\n return Crimes.RobStore;\n } else if (roughName.includes(\"mug\")) {\n return Crimes.Mug;\n } else if (roughName.includes(\"larceny\")) {\n return Crimes.Larceny;\n } else if (roughName.includes(\"drugs\")) {\n return Crimes.DealDrugs;\n } else if (roughName.includes(\"bond\") && roughName.includes(\"forge\")) {\n return Crimes.BondForgery;\n } else if ((roughName.includes(\"traffic\") || roughName.includes(\"illegal\")) && roughName.includes(\"arms\")) {\n return Crimes.TraffickArms;\n } else if (roughName.includes(\"homicide\")) {\n return Crimes.Homicide;\n } else if (roughName.includes(\"grand\") && roughName.includes(\"auto\")) {\n return Crimes.GrandTheftAuto;\n } else if (roughName.includes(\"kidnap\")) {\n return Crimes.Kidnap;\n } else if (roughName.includes(\"assassin\")) {\n return Crimes.Assassination;\n } else if (roughName.includes(\"heist\")) {\n return Crimes.Heist;\n }\n\n return null;\n}\n","import { sum } from \"lodash\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { CONSTANTS } from \"../../Constants\";\n\nexport interface IConstructorParams {\n augmentation: Augmentation;\n readonly cost: number;\n readonly time: number;\n}\n\nexport class GraftableAugmentation {\n // The augmentation that this craftable corresponds to\n augmentation: Augmentation;\n\n constructor(augmentation: Augmentation) {\n this.augmentation = augmentation;\n }\n\n get cost(): number {\n return this.augmentation.baseCost * CONSTANTS.AugmentationGraftingCostMult;\n }\n\n get time(): number {\n // Time = 1 hour * log_2(sum(aug multipliers) || 1) + 30 minutes\n const antiLog = Math.max(sum(Object.values(this.augmentation.mults).filter((x) => x !== 1)), 1);\n\n const mult = Math.log2(antiLog);\n return (CONSTANTS.AugmentationGraftingTimeBase * mult + CONSTANTS.MillisecondsPerHalfHour) / 2;\n }\n}\n","import LinearProgress from \"@mui/material/LinearProgress\";\nimport { Theme } from \"@mui/material/styles\";\nimport withStyles from \"@mui/styles/withStyles\";\n\nexport const ProgressBar = withStyles((theme: Theme) => ({\n root: {\n backgroundColor: theme.palette.background.paper,\n },\n bar: {\n transition: \"none\",\n backgroundColor: theme.palette.primary.main,\n },\n}))(LinearProgress);\n","export type ObjectValidator<T> = {\n [key in keyof T]?: ParameterValidator<T, keyof T>;\n};\n\ninterface ParameterValidatorObject<Type, Key extends keyof Type> {\n default?: unknown;\n min?: number;\n max?: number;\n func?: (obj: Type, validator: ObjectValidator<Type>, key: Key) => void;\n}\ntype ParameterValidatorFunction<Type, Key extends keyof Type> = (obj: Type, key: Key) => void;\ntype ParameterValidator<Type, Key extends keyof Type> =\n | ParameterValidatorObject<Type, Key>\n | ParameterValidatorFunction<Type, Key>;\n\nexport function validateObject<Type extends Record<string, unknown>, Key extends keyof Type>(\n obj: Type,\n validator: ObjectValidator<Type>,\n): void {\n for (const key of Object.keys(validator) as Key[]) {\n const paramValidator = validator[key];\n if (paramValidator !== undefined) {\n if (typeof paramValidator === \"function\") {\n paramValidator(obj, key);\n } else if (paramValidator.func !== undefined) {\n paramValidator.func(obj, validator, key);\n } else {\n if (typeof obj[key] !== typeof paramValidator.default) {\n obj[key] = paramValidator.default as Type[Key];\n }\n if (typeof obj[key] === \"number\" && paramValidator.min !== undefined) {\n if (obj[key] < paramValidator.min) obj[key] = paramValidator.min as Type[Key];\n }\n if (typeof obj[key] === \"number\" && paramValidator.max !== undefined) {\n if (obj[key] > paramValidator.max) obj[key] = paramValidator.max as Type[Key];\n }\n }\n }\n }\n}\n\nexport function minMax<Type, Key extends keyof Type>(\n def: number,\n min: number,\n max: number,\n): (obj: Type, key: Key & keyof Type) => void {\n return (obj, key) => {\n if (typeof obj[key] !== \"number\") {\n obj[key] = def as unknown as Type[Key];\n return;\n }\n if ((obj[key] as unknown as number) < min) {\n obj[key] = min as unknown as Type[Key];\n }\n if ((obj[key] as unknown as number) > max) {\n obj[key] = max as unknown as Type[Key];\n }\n };\n}\n\nexport function oneOf<Type, Key extends keyof Type, Value>(\n def: Value,\n options: Value[],\n): (obj: Type, key: Key & keyof Type) => void {\n return (obj, key) => {\n if (typeof obj[key] !== typeof def) {\n obj[key] = def as unknown as Type[Key];\n return;\n }\n if (!options.includes(obj[key] as unknown as Value)) {\n obj[key] = def as unknown as Type[Key];\n }\n };\n}\n\nexport function subsetOf<Type, Key extends keyof Type, Value>(\n options: Value[],\n): (obj: Type, key: Key & keyof Type) => void {\n return (obj, key) => {\n if (typeof obj[key] !== \"object\" || !Array.isArray(obj[key])) {\n obj[key] = [] as unknown as Type[Key];\n return;\n }\n const validValues: Value[] = [];\n for (const value of obj[key] as unknown as Value[]) {\n if (options.includes(value)) validValues.push(value);\n }\n obj[key] = validValues as unknown as Type[Key];\n };\n}\n","import { Player } from \"@player\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { LocationsMetadata } from \"../../Locations/data/LocationsMetadata\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Faction } from \"../../Faction/Faction\";\n\nexport function calculateSellInformationCashReward(reward: number, maxLevel: number, difficulty: number): number {\n const levelBonus = maxLevel * Math.pow(1.01, maxLevel);\n\n return (\n Math.pow(reward + 1, 2) *\n Math.pow(difficulty, 3) *\n 3e3 *\n levelBonus *\n (Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.5 : 1) *\n BitNodeMultipliers.InfiltrationMoney\n );\n}\n\nexport function calculateTradeInformationRepReward(reward: number, maxLevel: number, difficulty: number): number {\n const levelBonus = maxLevel * Math.pow(1.01, maxLevel);\n\n return (\n Math.pow(reward + 1, 1.1) *\n Math.pow(difficulty, 1.2) *\n 30 *\n levelBonus *\n (Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.5 : 1) *\n BitNodeMultipliers.InfiltrationRep\n );\n}\n\nexport function calculateInfiltratorsRepReward(faction: Faction, difficulty: number): number {\n const maxStartingSecurityLevel = LocationsMetadata.reduce((acc, data): number => {\n const startingSecurityLevel = data.infiltrationData?.startingSecurityLevel || 0;\n return acc > startingSecurityLevel ? acc : startingSecurityLevel;\n }, 0);\n const baseRepGain = (difficulty / maxStartingSecurityLevel) * 5000;\n\n return (\n baseRepGain * (Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 2 : 1) * (1 + faction.favor / 100)\n );\n}\n","/**\n * This is an object that is used to keep track of where all of the player's\n * money is coming from (or going to)\n */\nimport { Generic_fromJSON, Generic_toJSON, Reviver, IReviverValue } from \"./JSONReviver\";\n\nexport class MoneySourceTracker {\n // eslint-disable-next-line @typescript-eslint/ban-types\n [key: string]: number | Function;\n\n bladeburner = 0;\n casino = 0;\n class = 0;\n codingcontract = 0;\n corporation = 0;\n crime = 0;\n gang = 0;\n hacking = 0;\n hacknet = 0;\n hacknet_expenses = 0;\n hospitalization = 0;\n infiltration = 0;\n sleeves = 0;\n stock = 0;\n total = 0;\n work = 0;\n servers = 0;\n other = 0;\n augmentations = 0;\n\n // Record money earned\n record(amt: number, source: string): void {\n const sanitizedSource = source.toLowerCase();\n if (typeof this[sanitizedSource] !== \"number\") {\n console.warn(`MoneySourceTracker.record() called with invalid source: ${source}`);\n return;\n }\n\n (this[sanitizedSource] as number) += amt;\n this.total += amt;\n }\n\n // Reset the money tracker by setting all stats to 0\n reset(): void {\n for (const prop in this) {\n if (typeof this[prop] === \"number\") {\n (this[prop] as number) = 0;\n }\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"MoneySourceTracker\", this);\n }\n\n // Initializes a MoneySourceTracker object from a JSON save state.\n static fromJSON(value: IReviverValue): MoneySourceTracker {\n return Generic_fromJSON(MoneySourceTracker, value.data);\n }\n}\n\nReviver.constructors.MoneySourceTracker = MoneySourceTracker;\n","import { Factions } from \"../../Faction/Factions\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Gang } from \"../../Gang/Gang\";\nimport { PlayerObject } from \"./PlayerObject\";\nimport { GangConstants } from \"../../Gang/data/Constants\";\n\nexport function canAccessGang(this: PlayerObject): boolean {\n if (this.bitNodeN === 2) {\n return true;\n }\n if (this.sourceFileLvl(2) <= 0) {\n return false;\n }\n\n return this.karma <= GangConstants.GangKarmaRequirement;\n}\n\nexport function isAwareOfGang(this: PlayerObject): boolean {\n return this.bitNodeN === 2 || this.sourceFileLvl(2) >= 1;\n}\n\nexport function getGangFaction(this: PlayerObject): Faction {\n const gang = this.gang;\n if (gang === null) throw new Error(\"Cannot get gang faction because player is not in a gang.\");\n\n const fac = Factions[gang.facName];\n if (fac == null) throw new Error(`Gang has invalid faction name: ${gang.facName}`);\n\n return fac;\n}\n\nexport function getGangName(this: PlayerObject): string {\n const gang = this.gang;\n return gang ? gang.facName : \"\";\n}\n\nexport function hasGangWith(this: PlayerObject, facName: string): boolean {\n const gang = this.gang;\n return gang ? gang.facName === facName : false;\n}\n\nexport function startGang(this: PlayerObject, factionName: string, hacking: boolean): void {\n this.gang = new Gang(factionName, hacking);\n\n const fac = Factions[factionName];\n if (fac == null) {\n throw new Error(`Invalid faction name when creating gang: ${factionName}`);\n }\n fac.playerReputation = 0;\n}\n\nexport function inGang(this: PlayerObject) {\n return Boolean(this.gang);\n}\n","// choose random character for generating plaintexts to compress\nexport function comprGenChar(): string {\n const r = Math.random();\n if (r < 0.4) {\n return \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"[Math.floor(26 * Math.random())];\n } else if (r < 0.8) {\n return \"abcdefghijklmnopqrstuvwxyz\"[Math.floor(26 * Math.random())];\n } else {\n return \"01234567689\"[Math.floor(10 * Math.random())];\n }\n}\n\n// generate plaintext which is amenable to LZ encoding\nexport function comprLZGenerate(): string {\n const length = 50 + Math.floor(25 * (Math.random() + Math.random()));\n let plain = \"\";\n\n while (plain.length < length) {\n if (Math.random() < 0.8) {\n plain += comprGenChar();\n } else {\n const length = 1 + Math.floor(9 * Math.random());\n const offset = 1 + Math.floor(9 * Math.random());\n if (offset > plain.length) {\n continue;\n }\n\n for (let i = 0; i < length; ++i) {\n plain += plain[plain.length - offset];\n }\n }\n }\n\n return plain.substring(0, length);\n}\n\n// compress plaintest string\nexport function comprLZEncode(plain: string): string {\n // for state[i][j]:\n // if i is 0, we're adding a literal of length j\n // else, we're adding a backreference of offset i and length j\n let cur_state: (string | null)[][] = Array.from(Array(10), () => Array(10).fill(null));\n let new_state: (string | null)[][] = Array.from(Array(10), () => Array(10));\n\n function set(state: (string | null)[][], i: number, j: number, str: string): void {\n const current = state[i][j];\n if (current == null || str.length < current.length) {\n state[i][j] = str;\n } else if (str.length === current.length && Math.random() < 0.5) {\n // if two strings are the same length, pick randomly so that\n // we generate more possible inputs to Compression II\n state[i][j] = str;\n }\n }\n\n // initial state is a literal of length 1\n cur_state[0][1] = \"\";\n\n for (let i = 1; i < plain.length; ++i) {\n for (const row of new_state) {\n row.fill(null);\n }\n const c = plain[i];\n\n // handle literals\n for (let length = 1; length <= 9; ++length) {\n const string = cur_state[0][length];\n if (string == null) {\n continue;\n }\n\n if (length < 9) {\n // extend current literal\n set(new_state, 0, length + 1, string);\n } else {\n // start new literal\n set(new_state, 0, 1, string + \"9\" + plain.substring(i - 9, i) + \"0\");\n }\n\n for (let offset = 1; offset <= Math.min(9, i); ++offset) {\n if (plain[i - offset] === c) {\n // start new backreference\n set(new_state, offset, 1, string + String(length) + plain.substring(i - length, i));\n }\n }\n }\n\n // handle backreferences\n for (let offset = 1; offset <= 9; ++offset) {\n for (let length = 1; length <= 9; ++length) {\n const string = cur_state[offset][length];\n if (string == null) {\n continue;\n }\n\n if (plain[i - offset] === c) {\n if (length < 9) {\n // extend current backreference\n set(new_state, offset, length + 1, string);\n } else {\n // start new backreference\n set(new_state, offset, 1, string + \"9\" + String(offset) + \"0\");\n }\n }\n\n // start new literal\n set(new_state, 0, 1, string + String(length) + String(offset));\n\n // end current backreference and start new backreference\n for (let new_offset = 1; new_offset <= Math.min(9, i); ++new_offset) {\n if (plain[i - new_offset] === c) {\n set(new_state, new_offset, 1, string + String(length) + String(offset) + \"0\");\n }\n }\n }\n }\n\n const tmp_state = new_state;\n new_state = cur_state;\n cur_state = tmp_state;\n }\n\n let result = null;\n\n for (let len = 1; len <= 9; ++len) {\n let string = cur_state[0][len];\n if (string == null) {\n continue;\n }\n\n string += String(len) + plain.substring(plain.length - len, plain.length);\n if (result == null || string.length < result.length) {\n result = string;\n } else if (string.length == result.length && Math.random() < 0.5) {\n result = string;\n }\n }\n\n for (let offset = 1; offset <= 9; ++offset) {\n for (let len = 1; len <= 9; ++len) {\n let string = cur_state[offset][len];\n if (string == null) {\n continue;\n }\n\n string += String(len) + \"\" + String(offset);\n if (result == null || string.length < result.length) {\n result = string;\n } else if (string.length == result.length && Math.random() < 0.5) {\n result = string;\n }\n }\n }\n\n return result ?? \"\";\n}\n\n// decompress LZ-compressed string, or return null if input is invalid\nexport function comprLZDecode(compr: string): string | null {\n let plain = \"\";\n\n for (let i = 0; i < compr.length; ) {\n const literal_length = compr.charCodeAt(i) - 0x30;\n\n if (literal_length < 0 || literal_length > 9 || i + 1 + literal_length > compr.length) {\n return null;\n }\n\n plain += compr.substring(i + 1, i + 1 + literal_length);\n i += 1 + literal_length;\n\n if (i >= compr.length) {\n break;\n }\n const backref_length = compr.charCodeAt(i) - 0x30;\n\n if (backref_length < 0 || backref_length > 9) {\n return null;\n } else if (backref_length === 0) {\n ++i;\n } else {\n if (i + 1 >= compr.length) {\n return null;\n }\n\n const backref_offset = compr.charCodeAt(i + 1) - 0x30;\n if ((backref_length > 0 && (backref_offset < 1 || backref_offset > 9)) || backref_offset > plain.length) {\n return null;\n }\n\n for (let j = 0; j < backref_length; ++j) {\n plain += plain[plain.length - backref_offset];\n }\n\n i += 2;\n }\n }\n\n return plain;\n}\n","import * as React from \"react\";\nimport LinearProgress from \"@mui/material/LinearProgress\";\nimport { TableCell, Tooltip, Typography } from \"@mui/material\";\nimport { characterOverviewStyles } from \"./CharacterOverview\";\nimport { ISkillProgress } from \"src/PersonObjects/formulas/skill\";\nimport { numeralWrapper } from \"../numeralFormat\";\n\ninterface IProgressProps {\n min: number;\n max: number;\n current: number;\n remaining: number;\n progress: number;\n color?: React.CSSProperties[\"color\"];\n}\n\ninterface IStatsOverviewCellProps {\n progress: ISkillProgress;\n color?: React.CSSProperties[\"color\"];\n}\n\nexport function StatsProgressBar({\n min,\n max,\n current,\n remaining,\n progress,\n color,\n}: IProgressProps): React.ReactElement {\n const tooltip = (\n <Typography sx={{ textAlign: \"right\" }}>\n <strong>Progress:</strong> \n {numeralWrapper.formatExp(current)} / {numeralWrapper.formatExp(max - min)}\n <br />\n <strong>Remaining:</strong> \n {numeralWrapper.formatExp(remaining)} ({progress.toFixed(2)}%)\n </Typography>\n );\n\n return (\n <Tooltip title={tooltip}>\n <LinearProgress\n variant=\"determinate\"\n value={progress}\n sx={{\n backgroundColor: \"#111111\",\n \"& .MuiLinearProgress-bar1Determinate\": {\n backgroundColor: color,\n },\n }}\n />\n </Tooltip>\n );\n}\n\nexport function StatsProgressOverviewCell({ progress: skill, color }: IStatsOverviewCellProps): React.ReactElement {\n const classes = characterOverviewStyles();\n return (\n <TableCell\n component=\"th\"\n scope=\"row\"\n colSpan={2}\n classes={{ root: classes.cellNone }}\n style={{ paddingBottom: \"2px\", position: \"relative\", top: \"-3px\" }}\n >\n <StatsProgressBar\n min={skill.baseExperience}\n max={skill.nextExperience}\n current={skill.currentExperience}\n remaining={skill.remainingExperience}\n progress={skill.progress}\n color={color}\n />\n </TableCell>\n );\n}\n","import { Player } from \"@player\";\nimport { CONSTANTS } from \"../Constants\";\n\nexport function getHospitalizationCost(): number {\n if (Player.money < 0) {\n return 0;\n }\n\n return Math.min(Player.money * 0.1, (Player.hp.max - Player.hp.current) * CONSTANTS.HospitalCostPerHp);\n}\n\nexport function calculateHospitalizationCost(damage: number): number {\n const oldhp = Player.hp.current;\n Player.hp.current -= damage;\n const cost = getHospitalizationCost();\n Player.hp.current = oldhp;\n return cost;\n}\n","/**\n * Does a shallow compare of two arrays to determine if they are equal.\n * @param a1 The first array\n * @param a2 The second array\n */\nexport function compareArrays<T>(a1: T[], a2: T[]): boolean {\n if (a1.length !== a2.length) {\n return false;\n }\n\n for (let i = 0; i < a1.length; ++i) {\n const v1 = a1[i];\n const v2 = a2[i];\n if (Array.isArray(v1)) {\n // If the other element is not an array, then these cannot be equal\n if (!Array.isArray(v2)) {\n return false;\n }\n\n if (!compareArrays(v1, v2)) {\n return false;\n }\n } else if (v1 !== v2 && !(Number.isNaN(v1) && Number.isNaN(v2))) {\n // strict (in)equality considers NaN not equal to itself\n return false;\n }\n }\n\n return true;\n}\n","/**\n * Functions used to determine whether the target can be hacked (or grown/weakened).\n * Meant to be used for Netscript implementation\n *\n * The returned status object's message should be used for logging in Netscript\n */\nimport { IReturnStatus } from \"../types\";\n\nimport { Player } from \"@player\";\nimport { Server } from \"../Server/Server\";\n\nfunction baseCheck(server: Server, fnName: string): IReturnStatus {\n const hostname = server.hostname;\n\n if (!(\"requiredHackingSkill\" in server)) {\n return {\n res: false,\n msg: `Cannot ${fnName} ${hostname} server because it is a Hacknet Node`,\n };\n }\n\n if (server.hasAdminRights === false) {\n return {\n res: false,\n msg: `Cannot ${fnName} ${hostname} server because you do not have root access`,\n };\n }\n\n return { res: true };\n}\n\nexport function netscriptCanHack(server: Server): IReturnStatus {\n const initialCheck = baseCheck(server, \"hack\");\n if (!initialCheck.res) {\n return initialCheck;\n }\n\n const s = server;\n if (s.requiredHackingSkill > Player.skills.hacking) {\n return {\n res: false,\n msg: `Cannot hack ${server.hostname} server because your hacking skill is not high enough`,\n };\n }\n\n return { res: true };\n}\n\nexport function netscriptCanGrow(server: Server): IReturnStatus {\n return baseCheck(server, \"grow\");\n}\n\nexport function netscriptCanWeaken(server: Server): IReturnStatus {\n return baseCheck(server, \"weaken\");\n}\n","import React, { useState, useEffect } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Modal } from \"./Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\nexport const PromptEvent = new EventEmitter<[Prompt]>();\n\ninterface Prompt {\n txt: string;\n options?: { type?: string; choices?: string[] };\n resolve: (result: boolean | string) => void;\n}\n\nexport function PromptManager(): React.ReactElement {\n const [prompt, setPrompt] = useState<Prompt | null>(null);\n useEffect(() => {\n return PromptEvent.subscribe((p: Prompt) => {\n setPrompt(p);\n });\n }, []);\n\n if (prompt === null) {\n return <></>;\n }\n\n function close(): void {\n if (prompt === null) return;\n if ([\"text\", \"select\"].includes(prompt?.options?.type ?? \"\")) {\n prompt.resolve(\"\");\n } else {\n prompt.resolve(false);\n }\n setPrompt(null);\n }\n\n const types: { [key: string]: (props: IContentProps) => React.ReactElement } = {\n text: PromptMenuText,\n select: PromptMenuSelect,\n };\n\n let PromptContent = PromptMenuBoolean;\n if (prompt?.options?.type && [\"text\", \"select\"].includes(prompt?.options?.type))\n PromptContent = types[prompt?.options?.type];\n const resolve = (value: boolean | string): void => {\n prompt.resolve(value);\n setPrompt(null);\n };\n\n return (\n <Modal open={true} onClose={close}>\n <pre>\n <Typography>{prompt.txt}</Typography>\n </pre>\n <PromptContent prompt={prompt} resolve={resolve} />\n </Modal>\n );\n}\n\ninterface IContentProps {\n prompt: Prompt;\n resolve: (value: boolean | string) => void;\n}\n\nfunction PromptMenuBoolean({ resolve }: IContentProps): React.ReactElement {\n const yes = (): void => resolve(true);\n const no = (): void => resolve(false);\n\n return (\n <>\n <div style={{ display: \"flex\", justifyContent: \"center\", alignItems: \"center\", paddingTop: \"10px\" }}>\n <Button style={{ marginRight: \"auto\" }} onClick={yes}>\n Yes\n </Button>\n <Button onClick={no}>No</Button>\n </div>\n </>\n );\n}\n\nfunction PromptMenuText({ resolve }: IContentProps): React.ReactElement {\n const [value, setValue] = useState(\"\");\n\n const submit = (): void => resolve(value);\n\n const onInput = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setValue(event.target.value);\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n event.stopPropagation();\n\n if (event.key === KEY.ENTER) {\n event.preventDefault();\n submit();\n }\n };\n\n return (\n <>\n <div style={{ display: \"flex\", alignItems: \"center\", paddingTop: \"10px\" }}>\n <TextField\n autoFocus\n value={value}\n onInput={onInput}\n onKeyDown={onKeyDown}\n style={{ flex: \"1 0 auto\" }}\n InputProps={{\n endAdornment: <Button onClick={submit}>Confirm</Button>,\n }}\n />\n </div>\n </>\n );\n}\n\nfunction PromptMenuSelect({ prompt, resolve }: IContentProps): React.ReactElement {\n const [value, setValue] = useState(\"\");\n\n const submit = (): void => resolve(value);\n\n const onChange = (event: SelectChangeEvent<string>): void => {\n setValue(event.target.value);\n };\n\n const getItems = (choices: string[]): React.ReactElement[] => {\n const content: React.ReactElement[] = [];\n for (const i of choices) {\n content.push(\n <MenuItem key={i} value={i}>\n {i}\n </MenuItem>,\n );\n }\n return content;\n };\n\n if (!Array.isArray(prompt?.options?.choices)) {\n return <Typography>Error: Please provide an array of string choices</Typography>;\n }\n\n return (\n <>\n <div style={{ display: \"flex\", alignItems: \"center\", paddingTop: \"10px\" }}>\n <Select onChange={onChange} value={value} style={{ flex: \"1 0 auto\" }}>\n {getItems(prompt?.options?.choices || [])}\n </Select>\n <Button onClick={submit} disabled={value === \"\"}>\n Confirm\n </Button>\n </div>\n </>\n );\n}\n","import { Industry } from \"../Industry\";\n\n// Returns a boolean indicating whether the given material is relevant for the\n// current industry.\nexport function isRelevantMaterial(matName: string, division: Industry): boolean {\n // Materials that affect Production multiplier\n const prodMultiplierMats = [\"Hardware\", \"Robots\", \"AICores\", \"RealEstate\", \"AI Cores\", \"Real Estate\"];\n\n if (Object.keys(division.reqMats).includes(matName)) {\n return true;\n }\n if (division.prodMats.includes(matName)) {\n return true;\n }\n if (prodMultiplierMats.includes(matName)) {\n return true;\n }\n\n return false;\n}\n","import React, { useState, useEffect } from \"react\";\nimport { find } from \"lodash\";\n\nimport { Box, Typography, Button, Container, Paper } from \"@mui/material\";\nimport { Check, Lock, Create } from \"@mui/icons-material\";\n\nimport { Router } from \"../../ui/GameRoot\";\nimport { Player } from \"@player\";\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { Programs } from \"../Programs\";\nimport { CreateProgramWork } from \"../../Work/CreateProgramWork\";\n\nexport const ProgramsSeen: string[] = [];\n\nexport function ProgramsRoot(): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const programs = [...Object.values(Programs)]\n .filter((prog) => {\n const create = prog.create;\n if (create === null) return false;\n if (prog.name === \"b1t_flum3.exe\") {\n return create.req();\n }\n return true;\n })\n .sort((a, b) => {\n if (Player.hasProgram(a.name)) return 1;\n if (Player.hasProgram(b.name)) return -1;\n return (a.create?.level ?? 0) - (b.create?.level ?? 0);\n });\n\n useEffect(() => {\n programs.forEach((p) => {\n if (ProgramsSeen.includes(p.name)) return;\n ProgramsSeen.push(p.name);\n });\n }, []);\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const getHackingLevelRemaining = (lvl: number): number => {\n return Math.ceil(Math.max(lvl - (Player.skills.hacking + Player.skills.intelligence / 2), 0));\n };\n\n const getProgCompletion = (name: string): number => {\n const programFile = find(Player.getHomeComputer().programs, (p) => {\n return p.startsWith(name) && p.endsWith(\"%-INC\");\n });\n if (!programFile) return -1;\n\n const res = programFile.split(\"-\");\n if (res.length != 3) return -1;\n const percComplete = Number(res[1].slice(0, -1));\n if (isNaN(percComplete) || percComplete < 0 || percComplete >= 100) {\n return -1;\n }\n return percComplete;\n };\n\n return (\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0, mb: 10 }}>\n <Typography variant=\"h4\">Create program</Typography>\n <Typography>\n This page displays any programs that you are able to create. Writing the code for a program takes time, which\n can vary based on how complex the program is. If you are working on creating a program you can cancel at any\n time. Your progress will be saved and you can continue later.\n </Typography>\n\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"repeat(3, 1fr)\", my: 1 }}>\n {programs.map((program) => {\n const create = program.create;\n if (create === null) return <></>;\n const curCompletion = getProgCompletion(program.name);\n\n return (\n <Box\n component={Paper}\n sx={{ p: 1, opacity: Player.hasProgram(program.name) ? 0.75 : 1 }}\n key={program.name}\n >\n <>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n {(Player.hasProgram(program.name) && <Check sx={{ mr: 1 }} />) ||\n (create.req() && <Create sx={{ mr: 1 }} />) || <Lock sx={{ mr: 1 }} />}\n {program.name}\n </Typography>\n {!Player.hasProgram(program.name) && create.req() && (\n <Button\n sx={{ my: 1, width: \"100%\" }}\n onClick={(event) => {\n if (!event.isTrusted) return;\n Player.startWork(new CreateProgramWork({ singularity: false, programName: program.name }));\n Player.startFocusing();\n Router.toWork();\n }}\n >\n Create program\n </Button>\n )}\n {Player.hasProgram(program.name) || getHackingLevelRemaining(create.level) === 0 || (\n <Typography color={Settings.theme.hack}>\n <b>Unlocks in:</b> {getHackingLevelRemaining(create.level)} hacking levels\n </Typography>\n )}\n {curCompletion !== -1 && (\n <Typography color={Settings.theme.infolight}>\n <b>Current completion:</b> {curCompletion}%\n </Typography>\n )}\n <Typography>{create.tooltip}</Typography>\n </>\n </Box>\n );\n })}\n </Box>\n </Container>\n );\n}\n","import { Explore, Info, LastPage, LocalPolice, NewReleases, Report, SportsMma } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography, useTheme } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { Player } from \"@player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { FactionNames } from \"../data/FactionNames\";\nimport { Faction } from \"../Faction\";\nimport { getFactionAugmentationsFiltered, joinFaction } from \"../FactionHelpers\";\nimport { Factions } from \"../Factions\";\n\nexport const InvitationsSeen: string[] = [];\n\nconst getAugsLeft = (faction: Faction): number => {\n const augs = getFactionAugmentationsFiltered(faction);\n\n return augs.filter((augmentation: string) => !Player.hasAugmentation(augmentation)).length;\n};\n\ninterface IWorkTypeProps {\n faction: Faction;\n}\n\nconst fontSize = \"small\";\nconst marginRight = 0.5;\n\nconst WorkTypesOffered = (props: IWorkTypeProps): React.ReactElement => {\n const info = props.faction.getInfo();\n\n return (\n <>\n {info.offerFieldWork && (\n <Tooltip title=\"This Faction offers field work\">\n <Explore sx={{ color: Settings.theme.info, mr: marginRight }} fontSize={fontSize} />\n </Tooltip>\n )}\n {info.offerHackingWork && (\n <Tooltip title=\"This Faction offers hacking work\">\n <LastPage sx={{ color: Settings.theme.hack, mr: marginRight }} fontSize={fontSize} />\n </Tooltip>\n )}\n {info.offerSecurityWork && (\n <Tooltip title=\"This Faction offers security work\">\n <LocalPolice sx={{ color: Settings.theme.combat, mr: marginRight }} fontSize={fontSize} />\n </Tooltip>\n )}\n </>\n );\n};\n\ninterface IFactionProps {\n faction: Faction;\n\n joined: boolean;\n\n rerender: () => void;\n}\n\nconst FactionElement = (props: IFactionProps): React.ReactElement => {\n const facInfo = props.faction.getInfo();\n\n function openFaction(faction: Faction): void {\n Router.toFaction(faction);\n }\n\n function openFactionAugPage(faction: Faction): void {\n Router.toFaction(faction, true);\n }\n\n function acceptInvitation(event: React.MouseEvent<HTMLButtonElement, MouseEvent>, faction: string): void {\n if (!event.isTrusted) return;\n joinFaction(Factions[faction]);\n props.rerender();\n }\n\n return (\n <Paper\n sx={{\n display: \"grid\",\n p: 1,\n alignItems: \"center\",\n gridTemplateColumns: \"minmax(0, 4fr)\" + (props.joined ? \" 1fr\" : \"\"),\n }}\n >\n <Box display=\"flex\" sx={{ alignItems: \"center\" }}>\n {props.joined ? (\n <Box\n display=\"grid\"\n sx={{\n mr: 1,\n gridTemplateColumns: \"1fr 1fr\",\n minWidth: \"fit-content\",\n gap: 0.5,\n \"& .MuiButton-root\": { height: \"48px\" },\n }}\n >\n <Button onClick={() => openFaction(props.faction)}>Details</Button>\n <Button onClick={() => openFactionAugPage(props.faction)}>Augments</Button>\n </Box>\n ) : (\n <Button sx={{ height: \"48px\", mr: 1 }} onClick={(e) => acceptInvitation(e, props.faction.name)}>\n Join!\n </Button>\n )}\n\n <span style={{ maxWidth: props.joined ? \"70%\" : \"95%\" }}>\n <Typography\n variant=\"h6\"\n sx={{\n mr: 1,\n display: \"grid\",\n gridTemplateColumns: \"fit-content(100vw) max-content\",\n alignItems: \"center\",\n }}\n >\n <span\n style={{ overflow: \"hidden\", whiteSpace: \"nowrap\", textOverflow: \"ellipsis\" }}\n title={props.faction.name}\n >\n {props.faction.name}\n </span>\n\n <span style={{ display: \"flex\", alignItems: \"center\" }}>\n {Player.hasGangWith(props.faction.name) && (\n <Tooltip title=\"You have a gang with this Faction\">\n <SportsMma sx={{ color: Settings.theme.hp, ml: 1 }} />\n </Tooltip>\n )}\n\n {facInfo.special && (\n <Tooltip title=\"This is a special Faction\">\n <NewReleases sx={{ ml: 1, color: Settings.theme.money, transform: \"rotate(180deg)\" }} />\n </Tooltip>\n )}\n\n {!props.joined && facInfo.enemies.length > 0 && (\n <Tooltip\n title={\n <Typography>\n This Faction is enemies with:\n <ul>\n {facInfo.enemies.map((enemy) => (\n <li key={enemy}>{enemy}</li>\n ))}\n </ul>\n Joining this Faction will prevent you from joining its enemies\n </Typography>\n }\n >\n <Report sx={{ ml: 1, color: Settings.theme.error }} />\n </Tooltip>\n )}\n </span>\n </Typography>\n\n <span style={{ display: \"flex\", alignItems: \"center\" }}>\n {!Player.hasGangWith(props.faction.name) && <WorkTypesOffered faction={props.faction} />}\n\n {props.joined && (\n <Typography variant=\"body2\" sx={{ display: \"flex\" }}>\n {getAugsLeft(props.faction)} Augmentations left\n </Typography>\n )}\n </span>\n </span>\n </Box>\n\n {props.joined && (\n <Box display=\"grid\" sx={{ alignItems: \"center\", justifyItems: \"left\", gridAutoFlow: \"row\" }}>\n <Typography sx={{ color: Settings.theme.rep }}>\n {numeralWrapper.formatFavor(Math.floor(props.faction.favor))} favor\n </Typography>\n <Typography sx={{ color: Settings.theme.rep }}>\n {numeralWrapper.formatReputation(props.faction.playerReputation)} rep\n </Typography>\n </Box>\n )}\n </Paper>\n );\n};\n\nexport function FactionsRoot(): React.ReactElement {\n const theme = useTheme();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n useEffect(() => {\n Player.factionInvitations.forEach((faction) => {\n if (InvitationsSeen.includes(faction)) return;\n InvitationsSeen.push(faction);\n });\n }, []);\n\n const allFactions = Object.values(FactionNames).map((faction) => faction as string);\n const allJoinedFactions = [...Player.factions];\n allJoinedFactions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b));\n const invitations = Player.factionInvitations;\n\n return (\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0, mb: 10 }}>\n <Typography variant=\"h4\">\n Factions\n <Tooltip\n title={\n <Typography>\n Throughout the game you may receive invitations from factions. There are many different factions, and each\n faction has different criteria for determining its potential members. Joining a faction and furthering its\n cause is crucial to progressing in the game and unlocking endgame content.\n </Typography>\n }\n >\n <Info sx={{ ml: 1, mb: 0 }} color=\"info\" />\n </Tooltip>\n </Typography>\n\n <Box\n display=\"grid\"\n sx={{\n gap: 1,\n gridTemplateColumns: (invitations.length > 0 ? \"1fr \" : \"\") + \"2fr\",\n [theme.breakpoints.down(\"lg\")]: { gridTemplateColumns: \"1fr\", \"& > span:nth-of-type(1)\": { order: 1 } },\n gridTemplateRows: \"minmax(0, 1fr)\",\n \"& > span > .MuiBox-root\": {\n display: \"grid\",\n gridAutoRows: \"70px\",\n gap: 1,\n },\n }}\n >\n {invitations.length > 0 && (\n <span>\n <Typography variant=\"h5\" color=\"primary\">\n Faction Invitations\n </Typography>\n <Box>\n {invitations.map((facName) => {\n if (!Factions.hasOwnProperty(facName)) return null;\n return <FactionElement key={facName} faction={Factions[facName]} joined={false} rerender={rerender} />;\n })}\n </Box>\n </span>\n )}\n\n <span>\n <Typography variant=\"h5\" color=\"primary\">\n Your Factions\n </Typography>\n <Box>\n {allJoinedFactions.length > 0 ? (\n allJoinedFactions.map((facName) => {\n if (!Factions.hasOwnProperty(facName)) return null;\n return <FactionElement key={facName} faction={Factions[facName]} joined={true} rerender={rerender} />;\n })\n ) : (\n <Typography>You have not yet joined any Factions.</Typography>\n )}\n </Box>\n </span>\n </Box>\n </Container>\n );\n}\n","import React, { useEffect } from \"react\";\n\nimport { Typography, Link, Button, ButtonGroup, Tooltip, Box, Paper, TextField } from \"@mui/material\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { load } from \"../../db\";\nimport { Router } from \"../GameRoot\";\nimport { download } from \"../../SaveObject\";\nimport { IErrorData, newIssueUrl } from \"../../utils/ErrorHelper\";\nimport { DeleteGameButton } from \"./DeleteGameButton\";\nimport { SoftResetButton } from \"./SoftResetButton\";\n\nimport DirectionsRunIcon from \"@mui/icons-material/DirectionsRun\";\nimport GitHubIcon from \"@mui/icons-material/GitHub\";\n\nexport let RecoveryMode = false;\n\nexport function ActivateRecoveryMode(): void {\n RecoveryMode = true;\n}\n\ninterface IProps {\n softReset: () => void;\n errorData?: IErrorData;\n resetError?: () => void;\n}\n\nexport function RecoveryRoot({ softReset, errorData, resetError }: IProps): React.ReactElement {\n function recover(): void {\n if (resetError) resetError();\n RecoveryMode = false;\n Router.toTerminal();\n }\n Settings.AutosaveInterval = 0;\n\n useEffect(() => {\n load()\n .then((content) => {\n const epochTime = Math.round(Date.now() / 1000);\n const filename = `RECOVERY_BITBURNER_${epochTime}.json`;\n download(filename, content);\n })\n .catch((err) => console.error(err));\n }, []);\n\n return (\n <Box sx={{ padding: \"8px 16px\", minHeight: \"100vh\", maxWidth: \"1200px\", boxSizing: \"border-box\" }}>\n <Typography variant=\"h3\">RECOVERY MODE ACTIVATED</Typography>\n <Typography>\n There was an error with your save file and the game went into recovery mode. In this mode saving is disabled and\n the game will automatically export your save file (to prevent corruption).\n </Typography>\n <Typography>At this point it is recommended to alert a developer.</Typography>\n <Typography>\n <Link href={errorData?.issueUrl ?? newIssueUrl} target=\"_blank\">\n File an issue on github\n </Link>\n </Typography>\n <Typography>\n <Link href=\"https://www.reddit.com/r/Bitburner/\" target=\"_blank\">\n Make a reddit post\n </Link>\n </Typography>\n <Typography>\n <Link href=\"https://discord.gg/TFc3hKD\" target=\"_blank\">\n Post in the #bug-report channel on Discord.\n </Link>\n </Typography>\n <Typography>Please include your save file.</Typography>\n <br />\n <br />\n <Typography>You can disable recovery mode now. But chances are the game will not work correctly.</Typography>\n <ButtonGroup sx={{ my: 2 }}>\n <Tooltip title=\"Disables the recovery mode & attempt to head back to the terminal page. This may or may not work. Ensure you have saved the recovery file.\">\n <Button onClick={recover} startIcon={<DirectionsRunIcon />}>\n Disable Recovery Mode\n </Button>\n </Tooltip>\n <SoftResetButton color=\"warning\" onTriggered={softReset} />\n <DeleteGameButton color=\"error\" />\n </ButtonGroup>\n\n {errorData && (\n <Paper sx={{ px: 2, pt: 1, pb: 2, mt: 2 }}>\n <Typography variant=\"h5\">{errorData.title}</Typography>\n <Box sx={{ my: 2 }}>\n <TextField\n label=\"Bug Report Text\"\n value={errorData.body}\n variant=\"outlined\"\n color=\"secondary\"\n multiline\n fullWidth\n rows={12}\n sx={{ \"& .MuiOutlinedInput-root\": { color: Settings.theme.secondary } }}\n />\n </Box>\n <Tooltip title=\"Submitting an issue to GitHub really help us improve the game!\">\n <Button\n component={Link}\n startIcon={<GitHubIcon />}\n color=\"info\"\n sx={{ px: 2 }}\n href={errorData.issueUrl ?? newIssueUrl}\n target={\"_blank\"}\n >\n Submit Issue to GitHub\n </Button>\n </Tooltip>\n </Paper>\n )}\n </Box>\n );\n}\n","import { CalculateShareMult as CSM } from \"./formulas/share\";\n\nexport let sharePower = 1;\n\nexport function StartSharing(threads: number): () => void {\n sharePower += threads;\n return () => (sharePower -= threads);\n}\n\nexport function CalculateShareMult(): number {\n return CSM(sharePower);\n}\n","export enum RamCalculationErrorCode {\n SyntaxError = -1,\n ImportError = -2,\n}\n","import { CityName } from \"./data/CityNames\";\nimport { LocationName } from \"./data/LocationNames\";\n\n/** Class representing a City in the game */\nexport class City {\n /** List of all locations in this city */\n locations: LocationName[];\n\n /** Name of this city */\n name: CityName;\n\n /** Metro map ascii art */\n asciiArt: string;\n\n constructor(name: CityName, locations: LocationName[] = [], asciiArt = \"\") {\n this.name = name;\n this.locations = locations;\n this.asciiArt = asciiArt;\n }\n\n addLocation(loc: LocationName): void {\n this.locations.push(loc);\n }\n}\n","// Server and HacknetServer-related methods for the Player class (PlayerObject)\nimport { PlayerObject } from \"./PlayerObject\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { GetServer, AddToAllServers, createUniqueRandomIp } from \"../../Server/AllServers\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\n\nexport function hasTorRouter(this: PlayerObject): boolean {\n return this.getHomeComputer().serversOnNetwork.includes(SpecialServers.DarkWeb);\n}\n\nexport function getCurrentServer(this: PlayerObject): BaseServer {\n const server = GetServer(this.currentServer);\n if (server === null) throw new Error(`somehow connected to a server that does not exist. ${this.currentServer}`);\n return server;\n}\n\nexport function getHomeComputer(this: PlayerObject): Server {\n const home = GetServer(\"home\");\n if (home instanceof Server) return home;\n throw new Error(\"home computer was not a normal server\");\n}\n\nexport function getUpgradeHomeRamCost(this: PlayerObject): number {\n //Calculate how many times ram has been upgraded (doubled)\n const currentRam = this.getHomeComputer().maxRam;\n const numUpgrades = Math.log2(currentRam);\n\n //Calculate cost\n //Have cost increase by some percentage each time RAM has been upgraded\n const mult = Math.pow(1.58, numUpgrades);\n const cost = currentRam * CONSTANTS.BaseCostFor1GBOfRamHome * mult * BitNodeMultipliers.HomeComputerRamCost;\n return cost;\n}\n\nexport function getUpgradeHomeCoresCost(this: PlayerObject): number {\n return 1e9 * Math.pow(7.5, this.getHomeComputer().cpuCores);\n}\n\nexport function createHacknetServer(this: PlayerObject): HacknetServer {\n const numOwned = this.hacknetNodes.length;\n const name = `hacknet-node-${numOwned}`;\n const server = new HacknetServer({\n adminRights: true,\n hostname: name,\n ip: createUniqueRandomIp(),\n // player: this,\n });\n this.hacknetNodes.push(server.hostname);\n\n // Configure the HacknetServer to actually act as a Server\n AddToAllServers(server);\n const homeComputer = this.getHomeComputer();\n homeComputer.serversOnNetwork.push(server.hostname);\n server.serversOnNetwork.push(SpecialServers.Home);\n\n return server;\n}\n","import { Slider, Tooltip, Typography, Box } from \"@mui/material\";\nimport React, { useState } from \"react\";\n\ninterface IProps {\n initialValue: number;\n callback: (event: Event | React.SyntheticEvent<Element, Event>, newValue: number | number[]) => void;\n step: number;\n min: number;\n max: number;\n tooltip: React.ReactElement;\n label: string;\n marks?: boolean;\n}\n\nexport const OptionsSlider = (props: IProps): React.ReactElement => {\n const [value, setValue] = useState(props.initialValue);\n\n const onChange = (_evt: Event, newValue: number | Array<number>): void => {\n if (typeof newValue === \"number\") setValue(newValue);\n };\n\n return (\n <Box>\n <Tooltip title={<Typography>{props.tooltip}</Typography>}>\n <Typography>{props.label}</Typography>\n </Tooltip>\n <Slider\n value={value}\n onChange={onChange}\n onChangeCommitted={props.callback}\n step={props.step}\n min={props.min}\n max={props.max}\n valueLabelDisplay=\"auto\"\n sx={{\n \"& .MuiSlider-thumb\": {\n height: \"12px\",\n width: \"12px\",\n },\n }}\n marks={props.marks}\n />\n </Box>\n );\n};\n","/**\n * React component for the tickers configuration section of the Stock Market UI.\n * This config lets you change the way stock tickers are displayed (watchlist,\n * all/portfolio mode, etc)\n */\nimport * as React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\nexport enum TickerDisplayMode {\n AllStocks,\n Portfolio,\n}\n\ntype IProps = {\n changeDisplayMode: () => void;\n changeWatchlistFilter: (e: React.ChangeEvent<HTMLInputElement>) => void;\n tickerDisplayMode: TickerDisplayMode;\n};\n\nfunction DisplayModeButton(props: IProps): React.ReactElement {\n let txt = \"\";\n let tooltip = \"\";\n if (props.tickerDisplayMode === TickerDisplayMode.Portfolio) {\n txt = \"Switch to 'All Stocks' Mode\";\n tooltip = \"Displays all stocks on the WSE\";\n } else {\n txt = \"Switch to 'Portfolio' Mode\";\n tooltip = \"Displays only the stocks for which you have shares or orders\";\n }\n\n return (\n <Tooltip title={<Typography>{tooltip}</Typography>}>\n <Button onClick={props.changeDisplayMode}>{txt}</Button>\n </Tooltip>\n );\n}\n\nexport function StockTickersConfig(props: IProps): React.ReactElement {\n return (\n <>\n <DisplayModeButton {...props} />\n <br />\n <TextField\n sx={{ width: \"100%\" }}\n onChange={props.changeWatchlistFilter}\n placeholder=\"Filter Stocks by symbol (comma-separated list)\"\n type=\"text\"\n />\n </>\n );\n}\n","import { IStyleSettings } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport const defaultStyles: IStyleSettings = {\n lineHeight: 1.5,\n fontFamily:\n \"Lucida Console, Lucida Sans Unicode, Fira Mono, Consolas, Courier New, Courier, monospace, Times New Roman\",\n};\n","import { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { ActionIdentifier } from \"./ActionIdentifier\";\nimport { ActionTypes } from \"./data/ActionTypes\";\nimport { Growths } from \"./data/Growths\";\nimport { BlackOperations } from \"./BlackOperations\";\nimport { BlackOperation } from \"./BlackOperation\";\nimport { Operation } from \"./Operation\";\nimport { Contract } from \"./Contract\";\nimport { GeneralActions } from \"./GeneralActions\";\nimport { formatNumber } from \"../utils/StringHelperFunctions\";\nimport { Skills } from \"./Skills\";\nimport { Skill } from \"./Skill\";\nimport { City } from \"./City\";\nimport { Action } from \"./Action\";\nimport { Player } from \"@player\";\nimport { Person } from \"../PersonObjects/Person\";\nimport { Router } from \"../ui/GameRoot\";\nimport { ConsoleHelpText } from \"./data/Help\";\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { BladeburnerConstants } from \"./data/Constants\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\nimport { Factions, factionExists } from \"../Faction/Factions\";\nimport { calculateHospitalizationCost } from \"../Hospital/Hospital\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Settings } from \"../Settings/Settings\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { getTimestamp } from \"../utils/helpers/getTimestamp\";\nimport { joinFaction } from \"../Faction/FactionHelpers\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { KEY } from \"../utils/helpers/keyCodes\";\nimport { isSleeveInfiltrateWork } from \"../PersonObjects/Sleeve/Work/SleeveInfiltrateWork\";\nimport { isSleeveSupportWork } from \"../PersonObjects/Sleeve/Work/SleeveSupportWork\";\nimport { WorkStats, newWorkStats } from \"../Work/WorkStats\";\n\nexport interface BlackOpsAttempt {\n error?: string;\n isAvailable?: boolean;\n action?: BlackOperation;\n}\n\nexport class Bladeburner {\n numHosp = 0;\n moneyLost = 0;\n rank = 0;\n maxRank = 0;\n\n skillPoints = 0;\n totalSkillPoints = 0;\n\n teamSize = 0;\n sleeveSize = 0;\n teamLost = 0;\n hpLost = 0;\n\n storedCycles = 0;\n\n randomEventCounter: number = getRandomInt(240, 600);\n\n actionTimeToComplete = 0;\n actionTimeCurrent = 0;\n actionTimeOverflow = 0;\n\n action: ActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n\n cities: Record<string, City> = {};\n city: string = BladeburnerConstants.CityNames[2];\n skills: Record<string, number> = {};\n skillMultipliers: Record<string, number> = {};\n staminaBonus = 0;\n maxStamina = 0;\n stamina = 0;\n contracts: Record<string, Contract> = {};\n operations: Record<string, Operation> = {};\n blackops: Record<string, boolean> = {};\n logging = {\n general: true,\n contracts: true,\n ops: true,\n blackops: true,\n events: true,\n };\n automateEnabled = false;\n automateActionHigh: ActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n automateThreshHigh = 0;\n automateActionLow: ActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n automateThreshLow = 0;\n consoleHistory: string[] = [];\n consoleLogs: string[] = [\"Bladeburner Console\", \"Type 'help' to see console commands\"];\n\n constructor() {\n for (let i = 0; i < BladeburnerConstants.CityNames.length; ++i) {\n this.cities[BladeburnerConstants.CityNames[i]] = new City(BladeburnerConstants.CityNames[i]);\n }\n\n this.updateSkillMultipliers(); // Calls resetSkillMultipliers()\n\n // Max Stamina is based on stats and Bladeburner-specific bonuses\n this.calculateMaxStamina();\n this.stamina = this.maxStamina;\n this.create();\n }\n\n getCurrentCity(): City {\n const city = this.cities[this.city];\n if (!city) throw new Error(\"Invalid city in Bladeburner.getCurrentCity()\");\n return city;\n }\n\n calculateStaminaPenalty(): number {\n return Math.min(1, this.stamina / (0.5 * this.maxStamina));\n }\n\n canAttemptBlackOp(actionId: ActionIdentifier): BlackOpsAttempt {\n // Safety measure - don't repeat BlackOps that are already done\n if (this.blackops[actionId.name] != null) {\n return { error: \"Tried to start a Black Operation that had already been completed\" };\n }\n\n const action = this.getActionObject(actionId);\n if (!(action instanceof BlackOperation)) throw new Error(`Action should be BlackOperation but isn't`);\n if (action == null) throw new Error(\"Failed to get BlackOperation object for: \" + actionId.name);\n\n if (action.reqdRank > this.rank) {\n return { error: \"Tried to start a Black Operation without the rank requirement\" };\n }\n\n // Can't start a BlackOp if you haven't done the one before it\n const blackops = [];\n for (const nm of Object.keys(BlackOperations)) {\n if (BlackOperations.hasOwnProperty(nm)) {\n blackops.push(nm);\n }\n }\n blackops.sort(function (a, b) {\n return BlackOperations[a].reqdRank - BlackOperations[b].reqdRank; // Sort black ops in intended order\n });\n\n const i = blackops.indexOf(actionId.name);\n if (i === -1) {\n return { error: `Invalid Black Op: '${name}'` };\n }\n\n if (i > 0 && this.blackops[blackops[i - 1]] == null) {\n return { error: `Preceding Black Op must be completed before starting '${actionId.name}'.` };\n }\n\n return { isAvailable: true, action };\n }\n\n /** This function is only for the player. Sleeves use their own functions to perform blade work. */\n startAction(actionId: ActionIdentifier): void {\n if (actionId == null) return;\n this.action = actionId;\n this.actionTimeCurrent = 0;\n switch (actionId.type) {\n case ActionTypes[\"Idle\"]:\n this.actionTimeToComplete = 0;\n break;\n case ActionTypes[\"Contract\"]:\n try {\n const action = this.getActionObject(actionId);\n if (action == null) {\n throw new Error(\"Failed to get Contract Object for: \" + actionId.name);\n }\n if (action.count < 1) {\n return this.resetAction();\n }\n this.actionTimeToComplete = action.getActionTime(this, Player);\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n break;\n case ActionTypes[\"Operation\"]: {\n try {\n const action = this.getActionObject(actionId);\n if (action == null) {\n throw new Error(\"Failed to get Operation Object for: \" + actionId.name);\n }\n if (action.count < 1) {\n return this.resetAction();\n }\n if (actionId.name === \"Raid\" && this.getCurrentCity().comms === 0) {\n return this.resetAction();\n }\n this.actionTimeToComplete = action.getActionTime(this, Player);\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]: {\n try {\n const testBlackOp = this.canAttemptBlackOp(actionId);\n if (!testBlackOp.isAvailable) {\n this.resetAction();\n this.log(`Error: ${testBlackOp.error}`);\n break;\n }\n if (testBlackOp.action === undefined) {\n throw new Error(\"action should not be null\");\n }\n this.actionTimeToComplete = testBlackOp.action.getActionTime(this, Player);\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"Recruitment\"]:\n this.actionTimeToComplete = this.getRecruitmentTime(Player);\n break;\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Field Analysis\"]:\n this.actionTimeToComplete = 30;\n break;\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n this.actionTimeToComplete = 60;\n break;\n default:\n throw new Error(\"Invalid Action Type in bladeburner.startAction(): \" + actionId.type);\n }\n }\n\n upgradeSkill(skill: Skill, count = 1): void {\n // This does NOT handle deduction of skill points\n const skillName = skill.name;\n if (this.skills[skillName]) {\n this.skills[skillName] += count;\n } else {\n this.skills[skillName] = count;\n }\n if (isNaN(this.skills[skillName]) || this.skills[skillName] < 0) {\n throw new Error(\"Level of Skill \" + skillName + \" is invalid: \" + this.skills[skillName]);\n }\n this.updateSkillMultipliers();\n }\n\n executeConsoleCommands(commands: string): void {\n try {\n // Console History\n if (this.consoleHistory[this.consoleHistory.length - 1] != commands) {\n this.consoleHistory.push(commands);\n if (this.consoleHistory.length > 50) {\n this.consoleHistory.splice(0, 1);\n }\n }\n\n const arrayOfCommands = commands.split(\";\");\n for (let i = 0; i < arrayOfCommands.length; ++i) {\n this.executeConsoleCommand(arrayOfCommands[i]);\n }\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n }\n\n postToConsole(input: string, saveToLogs = true): void {\n const MaxConsoleEntries = 100;\n if (saveToLogs) {\n this.consoleLogs.push(input);\n if (this.consoleLogs.length > MaxConsoleEntries) {\n this.consoleLogs.shift();\n }\n }\n }\n\n log(input: string): void {\n // Adds a timestamp and then just calls postToConsole\n this.postToConsole(`[${getTimestamp()}] ${input}`);\n }\n\n resetAction(): void {\n this.action = new ActionIdentifier({ type: ActionTypes.Idle });\n this.actionTimeCurrent = 0;\n this.actionTimeToComplete = 0;\n }\n\n clearConsole(): void {\n this.consoleLogs.length = 0;\n }\n\n prestige(): void {\n this.resetAction();\n const bladeburnerFac = Factions[FactionNames.Bladeburners];\n if (this.rank >= BladeburnerConstants.RankNeededForFaction) {\n joinFaction(bladeburnerFac);\n }\n }\n\n storeCycles(numCycles = 0): void {\n this.storedCycles += numCycles;\n }\n\n // working on\n getActionIdFromTypeAndName(type = \"\", name = \"\"): ActionIdentifier | null {\n if (type === \"\" || name === \"\") {\n return null;\n }\n const action = new ActionIdentifier();\n const convertedType = type.toLowerCase().trim();\n const convertedName = name.toLowerCase().trim();\n switch (convertedType) {\n case \"contract\":\n case \"contracts\":\n case \"contr\":\n action.type = ActionTypes[\"Contract\"];\n if (this.contracts.hasOwnProperty(name)) {\n action.name = name;\n return action;\n }\n return null;\n case \"operation\":\n case \"operations\":\n case \"op\":\n case \"ops\":\n action.type = ActionTypes[\"Operation\"];\n if (this.operations.hasOwnProperty(name)) {\n action.name = name;\n return action;\n }\n return null;\n case \"blackoperation\":\n case \"black operation\":\n case \"black operations\":\n case \"black op\":\n case \"black ops\":\n case \"blackop\":\n case \"blackops\":\n action.type = ActionTypes[\"BlackOp\"];\n if (BlackOperations.hasOwnProperty(name)) {\n action.name = name;\n return action;\n }\n return null;\n case \"general\":\n case \"general action\":\n case \"gen\":\n break;\n default:\n return null;\n }\n\n if (convertedType.startsWith(\"gen\")) {\n switch (convertedName) {\n case \"training\":\n action.type = ActionTypes[\"Training\"];\n action.name = \"Training\";\n break;\n case \"recruitment\":\n case \"recruit\":\n action.type = ActionTypes[\"Recruitment\"];\n action.name = \"Recruitment\";\n break;\n case \"field analysis\":\n case \"fieldanalysis\":\n action.type = ActionTypes[\"Field Analysis\"];\n action.name = \"Field Analysis\";\n break;\n case \"diplomacy\":\n action.type = ActionTypes[\"Diplomacy\"];\n action.name = \"Diplomacy\";\n break;\n case \"hyperbolic regeneration chamber\":\n action.type = ActionTypes[\"Hyperbolic Regeneration Chamber\"];\n action.name = \"Hyperbolic Regeneration Chamber\";\n break;\n case \"incite violence\":\n action.type = ActionTypes[\"Incite Violence\"];\n action.name = \"Incite Violence\";\n break;\n default:\n return null;\n }\n return action;\n }\n\n return null;\n }\n\n executeStartConsoleCommand(args: string[]): void {\n if (args.length !== 3) {\n this.postToConsole(\"Invalid usage of 'start' console command: start [type] [name]\");\n this.postToConsole(\"Use 'help start' for more info\");\n return;\n }\n const name = args[2];\n switch (args[1].toLowerCase()) {\n case \"general\":\n case \"gen\":\n if (GeneralActions[name] != null) {\n this.action.type = ActionTypes[name];\n this.action.name = name;\n this.startAction(this.action);\n } else {\n this.postToConsole(\"Invalid action name specified: \" + args[2]);\n }\n break;\n case \"contract\":\n case \"contracts\":\n if (this.contracts[name] != null) {\n this.action.type = ActionTypes.Contract;\n this.action.name = name;\n this.startAction(this.action);\n } else {\n this.postToConsole(\"Invalid contract name specified: \" + args[2]);\n }\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n if (this.operations[name] != null) {\n this.action.type = ActionTypes.Operation;\n this.action.name = name;\n this.startAction(this.action);\n } else {\n this.postToConsole(\"Invalid Operation name specified: \" + args[2]);\n }\n break;\n case \"blackops\":\n case \"blackop\":\n case \"black operations\":\n case \"black operation\":\n if (BlackOperations[name] != null) {\n this.action.type = ActionTypes.BlackOperation;\n this.action.name = name;\n this.startAction(this.action);\n } else {\n this.postToConsole(\"Invalid BlackOp name specified: \" + args[2]);\n }\n break;\n default:\n this.postToConsole(\"Invalid action/event type specified: \" + args[1]);\n this.postToConsole(\"Examples of valid action/event identifiers are: [general, contract, op, blackop]\");\n break;\n }\n }\n\n executeSkillConsoleCommand(args: string[]): void {\n switch (args.length) {\n case 1: {\n // Display Skill Help Command\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n break;\n }\n case 2: {\n if (args[1].toLowerCase() === \"list\") {\n // List all skills and their level\n this.postToConsole(\"Skills: \");\n const skillNames = Object.keys(Skills);\n for (let i = 0; i < skillNames.length; ++i) {\n const skill = Skills[skillNames[i]];\n let level = 0;\n if (this.skills[skill.name] != null) {\n level = this.skills[skill.name];\n }\n this.postToConsole(skill.name + \": Level \" + formatNumber(level, 0));\n }\n this.postToConsole(\" \");\n this.postToConsole(\"Effects: \");\n const multKeys = Object.keys(this.skillMultipliers);\n for (let i = 0; i < multKeys.length; ++i) {\n const mult = this.skillMultipliers[multKeys[i]];\n if (mult && mult !== 1) {\n const mults = formatNumber(mult, 3);\n switch (multKeys[i]) {\n case \"successChanceAll\":\n this.postToConsole(\"Total Success Chance: x\" + mults);\n break;\n case \"successChanceStealth\":\n this.postToConsole(\"Stealth Success Chance: x\" + mults);\n break;\n case \"successChanceKill\":\n this.postToConsole(\"Retirement Success Chance: x\" + mults);\n break;\n case \"successChanceContract\":\n this.postToConsole(\"Contract Success Chance: x\" + mults);\n break;\n case \"successChanceOperation\":\n this.postToConsole(\"Operation Success Chance: x\" + mults);\n break;\n case \"successChanceEstimate\":\n this.postToConsole(\"Synthoid Data Estimate: x\" + mults);\n break;\n case \"actionTime\":\n this.postToConsole(\"Action Time: x\" + mults);\n break;\n case \"effHack\":\n this.postToConsole(\"Hacking Skill: x\" + mults);\n break;\n case \"effStr\":\n this.postToConsole(\"Strength: x\" + mults);\n break;\n case \"effDef\":\n this.postToConsole(\"Defense: x\" + mults);\n break;\n case \"effDex\":\n this.postToConsole(\"Dexterity: x\" + mults);\n break;\n case \"effAgi\":\n this.postToConsole(\"Agility: x\" + mults);\n break;\n case \"effCha\":\n this.postToConsole(\"Charisma: x\" + mults);\n break;\n case \"effInt\":\n this.postToConsole(\"Intelligence: x\" + mults);\n break;\n case \"stamina\":\n this.postToConsole(\"Stamina: x\" + mults);\n break;\n default:\n console.warn(`Unrecognized SkillMult Key: ${multKeys[i]}`);\n break;\n }\n }\n }\n } else {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n }\n break;\n }\n case 3: {\n const skillName = args[2];\n const skill = Skills[skillName];\n if (!skill) {\n this.postToConsole(\"Invalid skill name (Note that it is case-sensitive): \" + skillName);\n break;\n }\n if (args[1].toLowerCase() === \"list\") {\n let level = 0;\n if (this.skills[skill.name] !== undefined) {\n level = this.skills[skill.name];\n }\n this.postToConsole(skill.name + \": Level \" + formatNumber(level));\n } else if (args[1].toLowerCase() === \"level\") {\n let currentLevel = 0;\n if (this.skills[skillName] && !isNaN(this.skills[skillName])) {\n currentLevel = this.skills[skillName];\n }\n const pointCost = skill.calculateCost(currentLevel);\n if (skill.maxLvl !== 0 && currentLevel >= skill.maxLvl) {\n this.postToConsole(`This skill ${skill.name} is already at max level (${currentLevel}/${skill.maxLvl}).`);\n } else if (this.skillPoints >= pointCost) {\n this.skillPoints -= pointCost;\n this.upgradeSkill(skill);\n this.log(skill.name + \" upgraded to Level \" + this.skills[skillName]);\n } else {\n this.postToConsole(\n \"You do not have enough Skill Points to upgrade this. You need \" + formatNumber(pointCost, 0),\n );\n }\n } else {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n }\n break;\n }\n default: {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n break;\n }\n }\n }\n\n executeLogConsoleCommand(args: string[]): void {\n if (args.length < 3) {\n this.postToConsole(\"Invalid usage of log command: log [enable/disable] [action/event]\");\n this.postToConsole(\"Use 'help log' for more details and examples\");\n return;\n }\n\n let flag = true;\n if (args[1].toLowerCase().includes(\"d\")) {\n flag = false;\n } // d for disable\n\n switch (args[2].toLowerCase()) {\n case \"general\":\n case \"gen\":\n this.logging.general = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for general actions\");\n break;\n case \"contract\":\n case \"contracts\":\n this.logging.contracts = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for Contracts\");\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n this.logging.ops = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for Operations\");\n break;\n case \"blackops\":\n case \"blackop\":\n case \"black operations\":\n case \"black operation\":\n this.logging.blackops = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for BlackOps\");\n break;\n case \"event\":\n case \"events\":\n this.logging.events = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for events\");\n break;\n case \"all\":\n this.logging.general = flag;\n this.logging.contracts = flag;\n this.logging.ops = flag;\n this.logging.blackops = flag;\n this.logging.events = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for everything\");\n break;\n default:\n this.postToConsole(\"Invalid action/event type specified: \" + args[2]);\n this.postToConsole(\n \"Examples of valid action/event identifiers are: [general, contracts, ops, blackops, events]\",\n );\n break;\n }\n }\n\n executeHelpConsoleCommand(args: string[]): void {\n if (args.length === 1) {\n for (const line of ConsoleHelpText.helpList) {\n this.postToConsole(line);\n }\n } else {\n for (let i = 1; i < args.length; ++i) {\n if (!(args[i] in ConsoleHelpText)) continue;\n const helpText = ConsoleHelpText[args[i]];\n for (const line of helpText) {\n this.postToConsole(line);\n }\n }\n }\n }\n\n executeAutomateConsoleCommand(args: string[]): void {\n if (args.length !== 2 && args.length !== 4) {\n this.postToConsole(\n \"Invalid use of 'automate' command: automate [var] [val] [hi/low]. Use 'help automate' for more info\",\n );\n return;\n }\n\n // Enable/Disable\n if (args.length === 2) {\n const flag = args[1];\n if (flag.toLowerCase() === \"status\") {\n this.postToConsole(\"Automation: \" + (this.automateEnabled ? \"enabled\" : \"disabled\"));\n this.postToConsole(\n \"When your stamina drops to \" +\n formatNumber(this.automateThreshLow, 0) +\n \", you will automatically switch to \" +\n this.automateActionLow.name +\n \". When your stamina recovers to \" +\n formatNumber(this.automateThreshHigh, 0) +\n \", you will automatically \" +\n \"switch to \" +\n this.automateActionHigh.name +\n \".\",\n );\n } else if (flag.toLowerCase().includes(\"en\")) {\n if (!this.automateActionLow || !this.automateActionHigh) {\n return this.log(\"Failed to enable automation. Actions were not set\");\n }\n this.automateEnabled = true;\n this.log(\"Bladeburner automation enabled\");\n } else if (flag.toLowerCase().includes(\"d\")) {\n this.automateEnabled = false;\n this.log(\"Bladeburner automation disabled\");\n } else {\n this.log(\"Invalid argument for 'automate' console command: \" + args[1]);\n }\n return;\n }\n\n // Set variables\n if (args.length === 4) {\n const variable = args[1].toLowerCase(); // allows Action Type to be with or without capitalization.\n const val = args[2];\n\n let highLow = false; // True for high, false for low\n if (args[3].toLowerCase().includes(\"hi\")) {\n highLow = true;\n }\n\n switch (variable) {\n case \"general\":\n case \"gen\":\n if (GeneralActions[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes[val],\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid action name specified: \" + val);\n }\n break;\n case \"contract\":\n case \"contracts\":\n if (this.contracts[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes.Contract,\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid contract name specified: \" + val);\n }\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n if (this.operations[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes.Operation,\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid Operation name specified: \" + val);\n }\n break;\n case \"stamina\":\n if (isNaN(parseFloat(val))) {\n this.postToConsole(\"Invalid value specified for stamina threshold (must be numeric): \" + val);\n } else {\n if (highLow) {\n this.automateThreshHigh = Number(val);\n } else {\n this.automateThreshLow = Number(val);\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") stamina threshold set to \" + val);\n }\n break;\n default:\n break;\n }\n\n return;\n }\n }\n\n parseCommandArguments(command: string): string[] {\n /**\n * Returns an array with command and its arguments in each index.\n * e.g. skill \"blade's intuition\" foo returns [skill, blade's intuition, foo]\n * The input to the fn will be trimmed and will have all whitespace replaced w/ a single space\n */\n const args = [];\n let start = 0;\n let i = 0;\n while (i < command.length) {\n const c = command.charAt(i);\n if (c === '\"' || c === \"'\") {\n // Double quotes or Single quotes\n const endQuote = command.indexOf(c, i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === KEY.SPACE)) {\n args.push(command.substr(i + 1, endQuote - i - 1));\n if (endQuote === command.length - 1) {\n start = i = endQuote + 1;\n } else {\n start = i = endQuote + 2; // Skip the space\n }\n continue;\n }\n } else if (c === KEY.SPACE) {\n args.push(command.substr(start, i - start));\n start = i + 1;\n }\n ++i;\n }\n if (start !== i) {\n args.push(command.substr(start, i - start));\n }\n return args;\n }\n\n executeConsoleCommand(command: string): void {\n command = command.trim();\n command = command.replace(/\\s\\s+/g, \" \"); // Replace all whitespace w/ a single space\n\n const args = this.parseCommandArguments(command);\n if (args.length <= 0) return; // Log an error?\n\n switch (args[0].toLowerCase()) {\n case \"automate\":\n this.executeAutomateConsoleCommand(args);\n break;\n case \"clear\":\n case \"cls\":\n this.clearConsole();\n break;\n case \"help\":\n this.executeHelpConsoleCommand(args);\n break;\n case \"log\":\n this.executeLogConsoleCommand(args);\n break;\n case \"skill\":\n this.executeSkillConsoleCommand(args);\n break;\n case \"start\":\n this.executeStartConsoleCommand(args);\n break;\n case \"stop\":\n this.resetAction();\n break;\n default:\n this.postToConsole(\"Invalid console command\");\n break;\n }\n }\n\n triggerMigration(sourceCityName: string): void {\n let destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n while (destCityName === sourceCityName) {\n destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n }\n const destCity = this.cities[destCityName];\n const sourceCity = this.cities[sourceCityName];\n if (destCity == null || sourceCity == null) {\n throw new Error(\"Failed to find City with name: \" + destCityName);\n }\n const rand = Math.random();\n let percentage = getRandomInt(3, 15) / 100;\n\n if (rand < 0.05 && sourceCity.comms > 0) {\n // 5% chance for community migration\n percentage *= getRandomInt(2, 4); // Migration increases population change\n --sourceCity.comms;\n ++destCity.comms;\n }\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n destCity.pop += count;\n }\n\n triggerPotentialMigration(sourceCityName: string, chance: number): void {\n if (chance == null || isNaN(chance)) {\n console.error(\"Invalid 'chance' parameter passed into Bladeburner.triggerPotentialMigration()\");\n }\n if (chance > 1) {\n chance /= 100;\n }\n if (Math.random() < chance) {\n this.triggerMigration(sourceCityName);\n }\n }\n\n randomEvent(): void {\n const chance = Math.random();\n\n // Choose random source/destination city for events\n const sourceCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n const sourceCity = this.cities[sourceCityName];\n if (!sourceCity) throw new Error(\"Invalid sourceCity in Bladeburner.randomEvent()\");\n\n let destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n while (destCityName === sourceCityName) {\n destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n }\n const destCity = this.cities[destCityName];\n\n if (!sourceCity || !destCity) throw new Error(\"Invalid sourceCity or destCity in Bladeburner.randomEvent()\");\n\n if (chance <= 0.05) {\n // New Synthoid Community, 5%\n ++sourceCity.comms;\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\"Intelligence indicates that a new Synthoid community was formed in a city\");\n }\n } else if (chance <= 0.1) {\n // Synthoid Community Migration, 5%\n if (sourceCity.comms <= 0) {\n // If no comms in source city, then instead trigger a new Synthoid community event\n ++sourceCity.comms;\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\"Intelligence indicates that a new Synthoid community was formed in a city\");\n }\n } else {\n --sourceCity.comms;\n ++destCity.comms;\n\n // Change pop\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n destCity.pop += count;\n\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that a Synthoid community migrated from \" + sourceCityName + \" to some other city\",\n );\n }\n }\n } else if (chance <= 0.3) {\n // New Synthoids (non community), 20%\n const percentage = getRandomInt(8, 24) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that the Synthoid population of \" + sourceCityName + \" just changed significantly\",\n );\n }\n } else if (chance <= 0.5) {\n // Synthoid migration (non community) 20%\n this.triggerMigration(sourceCityName);\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that a large number of Synthoids migrated from \" +\n sourceCityName +\n \" to some other city\",\n );\n }\n } else if (chance <= 0.7) {\n // Synthoid Riots (+chaos), 20%\n sourceCity.chaos += 1;\n sourceCity.chaos *= 1 + getRandomInt(5, 20) / 100;\n if (this.logging.events) {\n this.log(\"Tensions between Synthoids and humans lead to riots in \" + sourceCityName + \"! Chaos increased\");\n }\n } else if (chance <= 0.9) {\n // Less Synthoids, 20%\n const percentage = getRandomInt(8, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that the Synthoid population of \" + sourceCityName + \" just changed significantly\",\n );\n }\n }\n // 10% chance of nothing happening\n }\n\n /**\n * Return stat to be gained from Contracts, Operations, and Black Operations\n * @param action(Action obj) - Derived action class\n * @param success(bool) - Whether action was successful\n */\n getActionStats(action: Action, person: Person, success: boolean): WorkStats {\n const difficulty = action.getDifficulty();\n\n /**\n * Gain multiplier based on difficulty. If it changes then the\n * same variable calculated in completeAction() needs to change too\n */\n const difficultyMult =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n\n const time = action.getActionTime(this, person);\n const successMult = success ? 1 : 0.5;\n\n const unweightedGain = time * BladeburnerConstants.BaseStatGain * successMult * difficultyMult;\n const unweightedIntGain = time * BladeburnerConstants.BaseIntGain * successMult * difficultyMult;\n const skillMult = this.skillMultipliers.expGain;\n\n return {\n hackExp: unweightedGain * action.weights.hack * skillMult,\n strExp: unweightedGain * action.weights.str * skillMult,\n defExp: unweightedGain * action.weights.def * skillMult,\n dexExp: unweightedGain * action.weights.dex * skillMult,\n agiExp: unweightedGain * action.weights.agi * skillMult,\n chaExp: unweightedGain * action.weights.cha * skillMult,\n intExp: unweightedIntGain * action.weights.int * skillMult,\n money: 0,\n reputation: 0,\n };\n }\n\n getDiplomacyEffectiveness(person: Person): number {\n // Returns a decimal by which the city's chaos level should be multiplied (e.g. 0.98)\n const CharismaLinearFactor = 1e3;\n const CharismaExponentialFactor = 0.045;\n\n const charismaEff =\n Math.pow(person.skills.charisma, CharismaExponentialFactor) + person.skills.charisma / CharismaLinearFactor;\n return (100 - charismaEff) / 100;\n }\n\n getRecruitmentSuccessChance(person: Person): number {\n return Math.pow(person.skills.charisma, 0.45) / (this.teamSize - this.sleeveSize + 1);\n }\n\n getRecruitmentTime(person: Person): number {\n const effCharisma = person.skills.charisma * this.skillMultipliers.effCha;\n const charismaFactor = Math.pow(effCharisma, 0.81) + effCharisma / 90;\n return Math.max(10, Math.round(BladeburnerConstants.BaseRecruitmentTimeNeeded - charismaFactor));\n }\n\n sleeveSupport(joining: boolean): void {\n if (joining) {\n this.sleeveSize += 1;\n this.teamSize += 1;\n } else {\n this.sleeveSize -= 1;\n this.teamSize -= 1;\n }\n }\n\n resetSkillMultipliers(): void {\n this.skillMultipliers = {\n successChanceAll: 1,\n successChanceStealth: 1,\n successChanceKill: 1,\n successChanceContract: 1,\n successChanceOperation: 1,\n successChanceEstimate: 1,\n actionTime: 1,\n effHack: 1,\n effStr: 1,\n effDef: 1,\n effDex: 1,\n effAgi: 1,\n effCha: 1,\n effInt: 1,\n stamina: 1,\n money: 1,\n expGain: 1,\n };\n }\n\n updateSkillMultipliers(): void {\n this.resetSkillMultipliers();\n for (const skillName of Object.keys(this.skills)) {\n if (this.skills.hasOwnProperty(skillName)) {\n const skill = Skills[skillName];\n if (skill == null) {\n throw new Error(\"Could not find Skill Object for: \" + skillName);\n }\n const level = this.skills[skillName];\n if (level == null || level <= 0) {\n continue;\n } //Not upgraded\n\n const multiplierNames = Object.keys(this.skillMultipliers);\n for (let i = 0; i < multiplierNames.length; ++i) {\n const multiplierName = multiplierNames[i];\n if (skill.getMultiplier(multiplierName) != null && !isNaN(skill.getMultiplier(multiplierName))) {\n const value = skill.getMultiplier(multiplierName) * level;\n let multiplierValue = 1 + value / 100;\n if (multiplierName === \"actionTime\") {\n multiplierValue = 1 - value / 100;\n }\n this.skillMultipliers[multiplierName] *= multiplierValue;\n }\n }\n }\n }\n }\n\n completeOperation(success: boolean): void {\n if (this.action.type !== ActionTypes.Operation) {\n throw new Error(\"completeOperation() called even though current action is not an Operation\");\n }\n const action = this.getActionObject(this.action);\n if (action == null) {\n throw new Error(\"Failed to get Contract/Operation Object for: \" + this.action.name);\n }\n\n // Calculate team losses\n const teamCount = action.teamCount;\n if (teamCount >= 1) {\n let max;\n if (success) {\n max = Math.ceil(teamCount / 2);\n } else {\n max = Math.floor(teamCount);\n }\n const losses = getRandomInt(0, max);\n this.teamSize -= losses;\n if (this.teamSize < this.sleeveSize) {\n const sup = Player.sleeves.filter((x) => isSleeveSupportWork(x.currentWork));\n for (let i = 0; i > this.teamSize - this.sleeveSize; i--) {\n const r = Math.floor(Math.random() * sup.length);\n sup[r].takeDamage(sup[r].hp.max);\n sup.splice(r, 1);\n }\n this.teamSize += this.sleeveSize;\n }\n this.teamLost += losses;\n if (this.logging.ops && losses > 0) {\n this.log(\"Lost \" + formatNumber(losses, 0) + \" team members during this \" + action.name);\n }\n }\n\n const city = this.getCurrentCity();\n switch (action.name) {\n case \"Investigation\":\n if (success) {\n city.improvePopulationEstimateByPercentage(0.4 * this.skillMultipliers.successChanceEstimate);\n } else {\n this.triggerPotentialMigration(this.city, 0.1);\n }\n break;\n case \"Undercover Operation\":\n if (success) {\n city.improvePopulationEstimateByPercentage(0.8 * this.skillMultipliers.successChanceEstimate);\n } else {\n this.triggerPotentialMigration(this.city, 0.15);\n }\n break;\n case \"Sting Operation\":\n if (success) {\n city.changePopulationByPercentage(-0.1, {\n changeEstEqually: true,\n nonZero: true,\n });\n }\n city.changeChaosByCount(0.1);\n break;\n case \"Raid\":\n if (success) {\n city.changePopulationByPercentage(-1, {\n changeEstEqually: true,\n nonZero: true,\n });\n --city.comms;\n } else {\n const change = getRandomInt(-10, -5) / 10;\n city.changePopulationByPercentage(change, {\n nonZero: true,\n changeEstEqually: false,\n });\n }\n city.changeChaosByPercentage(getRandomInt(1, 5));\n break;\n case \"Stealth Retirement Operation\":\n if (success) {\n city.changePopulationByPercentage(-0.5, {\n changeEstEqually: true,\n nonZero: true,\n });\n }\n city.changeChaosByPercentage(getRandomInt(-3, -1));\n break;\n case \"Assassination\":\n if (success) {\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n }\n city.changeChaosByPercentage(getRandomInt(-5, 5));\n break;\n default:\n throw new Error(\"Invalid Action name in completeOperation: \" + this.action.name);\n }\n }\n\n getActionObject(actionId: ActionIdentifier): Action | null {\n /**\n * Given an ActionIdentifier object, returns the corresponding\n * GeneralAction, Contract, Operation, or BlackOperation object\n */\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n return this.contracts[actionId.name];\n case ActionTypes[\"Operation\"]:\n return this.operations[actionId.name];\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return BlackOperations[actionId.name];\n case ActionTypes[\"Training\"]:\n return GeneralActions[\"Training\"];\n case ActionTypes[\"Field Analysis\"]:\n return GeneralActions[\"Field Analysis\"];\n case ActionTypes[\"Recruitment\"]:\n return GeneralActions[\"Recruitment\"];\n case ActionTypes[\"Diplomacy\"]:\n return GeneralActions[\"Diplomacy\"];\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n return GeneralActions[\"Hyperbolic Regeneration Chamber\"];\n case ActionTypes[\"Incite Violence\"]:\n return GeneralActions[\"Incite Violence\"];\n default:\n return null;\n }\n }\n\n completeContract(success: boolean, actionIdent: ActionIdentifier): void {\n if (actionIdent.type !== ActionTypes.Contract) {\n throw new Error(\"completeContract() called even though current action is not a Contract\");\n }\n const city = this.getCurrentCity();\n if (success) {\n switch (actionIdent.name) {\n case \"Tracking\":\n // Increase estimate accuracy by a relatively small amount\n city.improvePopulationEstimateByCount(getRandomInt(100, 1e3) * this.skillMultipliers.successChanceEstimate);\n break;\n case \"Bounty Hunter\":\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n city.changeChaosByCount(0.02);\n break;\n case \"Retirement\":\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n city.changeChaosByCount(0.04);\n break;\n default:\n throw new Error(\"Invalid Action name in completeContract: \" + actionIdent.name);\n }\n }\n }\n\n completeAction(person: Person, actionIdent: ActionIdentifier, isPlayer = true): WorkStats {\n let retValue = newWorkStats();\n switch (actionIdent.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]: {\n try {\n const isOperation = actionIdent.type === ActionTypes[\"Operation\"];\n const action = this.getActionObject(actionIdent);\n if (action == null) {\n throw new Error(\"Failed to get Contract/Operation Object for: \" + actionIdent.name);\n }\n const difficulty = action.getDifficulty();\n const difficultyMultiplier =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n const rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n\n if (isPlayer) {\n // Stamina loss is based on difficulty\n this.stamina -= BladeburnerConstants.BaseStaminaLoss * difficultyMultiplier;\n if (this.stamina < 0) {\n this.stamina = 0;\n }\n }\n\n // Process Contract/Operation success/failure\n if (action.attempt(this, person)) {\n retValue = this.getActionStats(action, person, true);\n ++action.successes;\n --action.count;\n\n // Earn money for contracts\n let moneyGain = 0;\n if (!isOperation) {\n moneyGain = BladeburnerConstants.ContractBaseMoneyGain * rewardMultiplier * this.skillMultipliers.money;\n retValue.money = moneyGain;\n }\n\n if (isOperation) {\n action.setMaxLevel(BladeburnerConstants.OperationSuccessesPerLevel);\n } else {\n action.setMaxLevel(BladeburnerConstants.ContractSuccessesPerLevel);\n }\n if (action.rankGain) {\n const gain = addOffset(action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank, 10);\n this.changeRank(person, gain);\n if (isOperation && this.logging.ops) {\n this.log(\n `${person.whoAmI()}: ${action.name} successfully completed! Gained ${formatNumber(gain, 3)} rank`,\n );\n } else if (!isOperation && this.logging.contracts) {\n this.log(\n `${person.whoAmI()}: ${action.name} contract successfully completed! Gained ` +\n `${formatNumber(gain, 3)} rank and ${numeralWrapper.formatMoney(moneyGain)}`,\n );\n }\n }\n isOperation ? this.completeOperation(true) : this.completeContract(true, actionIdent);\n } else {\n retValue = this.getActionStats(action, person, false);\n ++action.failures;\n let loss = 0,\n damage = 0;\n if (action.rankLoss) {\n loss = addOffset(action.rankLoss * rewardMultiplier, 10);\n this.changeRank(person, -1 * loss);\n }\n if (action.hpLoss) {\n damage = action.hpLoss * difficultyMultiplier;\n damage = Math.ceil(addOffset(damage, 10));\n this.hpLost += damage;\n const cost = calculateHospitalizationCost(damage);\n if (person.takeDamage(damage)) {\n ++this.numHosp;\n this.moneyLost += cost;\n }\n }\n let logLossText = \"\";\n if (loss > 0) {\n logLossText += \"Lost \" + formatNumber(loss, 3) + \" rank. \";\n }\n if (damage > 0) {\n logLossText += \"Took \" + formatNumber(damage, 0) + \" damage.\";\n }\n if (isOperation && this.logging.ops) {\n this.log(`${person.whoAmI()}: ` + action.name + \" failed! \" + logLossText);\n } else if (!isOperation && this.logging.contracts) {\n this.log(`${person.whoAmI()}: ` + action.name + \" contract failed! \" + logLossText);\n }\n isOperation ? this.completeOperation(false) : this.completeContract(false, actionIdent);\n }\n if (action.autoLevel) {\n action.level = action.maxLevel;\n } // Autolevel\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]: {\n try {\n const action = this.getActionObject(actionIdent);\n if (action == null || !(action instanceof BlackOperation)) {\n throw new Error(\"Failed to get BlackOperation Object for: \" + actionIdent.name);\n }\n const difficulty = action.getDifficulty();\n const difficultyMultiplier =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n\n // Stamina loss is based on difficulty\n this.stamina -= BladeburnerConstants.BaseStaminaLoss * difficultyMultiplier;\n if (this.stamina < 0) {\n this.stamina = 0;\n }\n\n // Team loss variables\n const teamCount = action.teamCount;\n let teamLossMax;\n\n if (action.attempt(this, person)) {\n retValue = this.getActionStats(action, person, true);\n action.count = 0;\n this.blackops[action.name] = true;\n let rankGain = 0;\n if (action.rankGain) {\n rankGain = addOffset(action.rankGain * BitNodeMultipliers.BladeburnerRank, 10);\n this.changeRank(person, rankGain);\n }\n teamLossMax = Math.ceil(teamCount / 2);\n\n if (this.logging.blackops) {\n this.log(\n `${person.whoAmI()}: ` + action.name + \" successful! Gained \" + formatNumber(rankGain, 1) + \" rank\",\n );\n }\n } else {\n retValue = this.getActionStats(action, person, false);\n let rankLoss = 0;\n let damage = 0;\n if (action.rankLoss) {\n rankLoss = addOffset(action.rankLoss, 10);\n this.changeRank(person, -1 * rankLoss);\n }\n if (action.hpLoss) {\n damage = action.hpLoss * difficultyMultiplier;\n damage = Math.ceil(addOffset(damage, 10));\n const cost = calculateHospitalizationCost(damage);\n if (person.takeDamage(damage)) {\n ++this.numHosp;\n this.moneyLost += cost;\n }\n }\n teamLossMax = Math.floor(teamCount);\n\n if (this.logging.blackops) {\n this.log(\n `${person.whoAmI()}: ` +\n action.name +\n \" failed! Lost \" +\n formatNumber(rankLoss, 1) +\n \" rank and took \" +\n formatNumber(damage, 0) +\n \" damage\",\n );\n }\n }\n\n this.resetAction(); // Stop regardless of success or fail\n\n // Calculate team losses\n if (teamCount >= 1) {\n const losses = getRandomInt(1, teamLossMax);\n this.teamSize -= losses;\n if (this.teamSize < this.sleeveSize) {\n const sup = Player.sleeves.filter((x) => isSleeveSupportWork(x.currentWork));\n for (let i = 0; i > this.teamSize - this.sleeveSize; i--) {\n const r = Math.floor(Math.random() * sup.length);\n sup[r].takeDamage(sup[r].hp.max);\n sup.splice(r, 1);\n }\n this.teamSize += this.sleeveSize;\n }\n this.teamLost += losses;\n if (this.logging.blackops) {\n this.log(`${person.whoAmI()}: You lost ${formatNumber(losses, 0)} team members during ${action.name}`);\n }\n }\n } catch (e: unknown) {\n exceptionAlert(String(e));\n }\n break;\n }\n case ActionTypes[\"Training\"]: {\n this.stamina -= 0.5 * BladeburnerConstants.BaseStaminaLoss;\n const strExpGain = 30 * person.mults.strength_exp,\n defExpGain = 30 * person.mults.defense_exp,\n dexExpGain = 30 * person.mults.dexterity_exp,\n agiExpGain = 30 * person.mults.agility_exp,\n staminaGain = 0.04 * this.skillMultipliers.stamina;\n retValue.strExp = strExpGain;\n retValue.defExp = defExpGain;\n retValue.dexExp = dexExpGain;\n retValue.agiExp = agiExpGain;\n this.staminaBonus += staminaGain;\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n \"Training completed. Gained: \" +\n formatNumber(strExpGain, 1) +\n \" str exp, \" +\n formatNumber(defExpGain, 1) +\n \" def exp, \" +\n formatNumber(dexExpGain, 1) +\n \" dex exp, \" +\n formatNumber(agiExpGain, 1) +\n \" agi exp, \" +\n formatNumber(staminaGain, 3) +\n \" max stamina\",\n );\n }\n break;\n }\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Field Analysis\"]: {\n // Does not use stamina. Effectiveness depends on hacking, int, and cha\n let eff =\n 0.04 * Math.pow(person.skills.hacking, 0.3) +\n 0.04 * Math.pow(person.skills.intelligence, 0.9) +\n 0.02 * Math.pow(person.skills.charisma, 0.3);\n eff *= person.mults.bladeburner_analysis;\n if (isNaN(eff) || eff < 0) {\n throw new Error(\"Field Analysis Effectiveness calculated to be NaN or negative\");\n }\n const hackingExpGain = 20 * person.mults.hacking_exp;\n const charismaExpGain = 20 * person.mults.charisma_exp;\n const rankGain = 0.1 * BitNodeMultipliers.BladeburnerRank;\n retValue.hackExp = hackingExpGain;\n retValue.chaExp = charismaExpGain;\n retValue.intExp = BladeburnerConstants.BaseIntGain;\n this.changeRank(person, rankGain);\n this.getCurrentCity().improvePopulationEstimateByPercentage(eff * this.skillMultipliers.successChanceEstimate);\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n `Field analysis completed. Gained ${formatNumber(rankGain, 2)} rank, ` +\n `${formatNumber(hackingExpGain, 1)} hacking exp, and ` +\n `${formatNumber(charismaExpGain, 1)} charisma exp`,\n );\n }\n break;\n }\n case ActionTypes[\"Recruitment\"]: {\n const successChance = this.getRecruitmentSuccessChance(person);\n const recruitTime = this.getRecruitmentTime(person) * 1000;\n if (Math.random() < successChance) {\n const expGain = 2 * BladeburnerConstants.BaseStatGain * recruitTime;\n retValue.chaExp = expGain;\n ++this.teamSize;\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n \"Successfully recruited a team member! Gained \" +\n formatNumber(expGain, 1) +\n \" charisma exp\",\n );\n }\n } else {\n const expGain = BladeburnerConstants.BaseStatGain * recruitTime;\n retValue.chaExp = expGain;\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n \"Failed to recruit a team member. Gained \" +\n formatNumber(expGain, 1) +\n \" charisma exp\",\n );\n }\n }\n break;\n }\n case ActionTypes[\"Diplomacy\"]: {\n const eff = this.getDiplomacyEffectiveness(person);\n this.getCurrentCity().chaos *= eff;\n if (this.getCurrentCity().chaos < 0) {\n this.getCurrentCity().chaos = 0;\n }\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: Diplomacy completed. Chaos levels in the current city fell by ${numeralWrapper.formatPercentage(\n 1 - eff,\n )}`,\n );\n }\n break;\n }\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]: {\n person.regenerateHp(BladeburnerConstants.HrcHpGain);\n\n const staminaGain = this.maxStamina * (BladeburnerConstants.HrcStaminaGain / 100);\n this.stamina = Math.min(this.maxStamina, this.stamina + staminaGain);\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: Rested in Hyperbolic Regeneration Chamber. Restored ${\n BladeburnerConstants.HrcHpGain\n } HP and gained ${numeralWrapper.formatStamina(staminaGain)} stamina`,\n );\n }\n break;\n }\n case ActionTypes[\"Incite Violence\"]: {\n for (const contract of Object.keys(this.contracts)) {\n const growthF = Growths[contract];\n if (!growthF) throw new Error(\"trying to generate count for action that doesn't exist? \" + contract);\n this.contracts[contract].count += (60 * 3 * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n for (const operation of Object.keys(this.operations)) {\n const growthF = Growths[operation];\n if (!growthF) throw new Error(\"trying to generate count for action that doesn't exist? \" + operation);\n this.operations[operation].count += (60 * 3 * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n if (this.logging.general) {\n this.log(`${person.whoAmI()}: Incited violence in the synthoid communities.`);\n }\n for (const cityName of Object.keys(this.cities)) {\n const city = this.cities[cityName];\n city.chaos += 10;\n city.chaos += city.chaos / (Math.log(city.chaos) / Math.log(10));\n }\n break;\n }\n default:\n console.error(`Bladeburner.completeAction() called for invalid action: ${actionIdent.type}`);\n break;\n }\n return retValue;\n }\n\n infiltrateSynthoidCommunities(): void {\n const infilSleeves = Player.sleeves.filter((s) => isSleeveInfiltrateWork(s.currentWork)).length;\n const amt = Math.pow(infilSleeves, -0.5) / 2;\n for (const contract of Object.keys(this.contracts)) {\n this.contracts[contract].count += amt;\n }\n for (const operation of Object.keys(this.operations)) {\n this.operations[operation].count += amt;\n }\n if (this.logging.general) {\n this.log(`Sleeve: Infiltrate the synthoid communities.`);\n }\n }\n\n changeRank(person: Person, change: number): void {\n if (isNaN(change)) {\n throw new Error(\"NaN passed into Bladeburner.changeRank()\");\n }\n this.rank += change;\n if (this.rank < 0) {\n this.rank = 0;\n }\n this.maxRank = Math.max(this.rank, this.maxRank);\n\n const bladeburnersFactionName = FactionNames.Bladeburners;\n if (factionExists(bladeburnersFactionName)) {\n const bladeburnerFac = Factions[bladeburnersFactionName];\n if (!bladeburnerFac) {\n throw new Error(\n `Could not properly get ${FactionNames.Bladeburners} Faction object in ${FactionNames.Bladeburners} UI Overview Faction button`,\n );\n }\n if (bladeburnerFac.isMember) {\n const favorBonus = 1 + bladeburnerFac.favor / 100;\n bladeburnerFac.playerReputation +=\n BladeburnerConstants.RankToFactionRepFactor * change * person.mults.faction_rep * favorBonus;\n }\n }\n\n // Gain skill points\n const rankNeededForSp = (this.totalSkillPoints + 1) * BladeburnerConstants.RanksPerSkillPoint;\n if (this.maxRank >= rankNeededForSp) {\n // Calculate how many skill points to gain\n const gainedSkillPoints = Math.floor(\n (this.maxRank - rankNeededForSp) / BladeburnerConstants.RanksPerSkillPoint + 1,\n );\n this.skillPoints += gainedSkillPoints;\n this.totalSkillPoints += gainedSkillPoints;\n }\n }\n\n processAction(seconds: number): void {\n if (this.action.type === ActionTypes[\"Idle\"]) return;\n if (this.actionTimeToComplete <= 0) {\n throw new Error(`Invalid actionTimeToComplete value: ${this.actionTimeToComplete}, type; ${this.action.type}`);\n }\n if (!this.action) {\n throw new Error(\"Bladeburner.action is not an ActionIdentifier Object\");\n }\n\n // If the previous action went past its completion time, add to the next action\n // This is not added immediately in case the automation changes the action\n this.actionTimeCurrent += seconds + this.actionTimeOverflow;\n this.actionTimeOverflow = 0;\n if (this.actionTimeCurrent >= this.actionTimeToComplete) {\n this.actionTimeOverflow = this.actionTimeCurrent - this.actionTimeToComplete;\n const action = this.getActionObject(this.action);\n const retValue = this.completeAction(Player, this.action);\n Player.gainMoney(retValue.money, \"bladeburner\");\n Player.gainStats(retValue);\n // Operation Daedalus\n if (action == null) {\n throw new Error(\"Failed to get BlackOperation Object for: \" + this.action.name);\n } else if (this.action.type != ActionTypes[\"BlackOperation\"] && this.action.type != ActionTypes[\"BlackOp\"]) {\n this.startAction(this.action); // Repeat action\n }\n }\n }\n\n calculateStaminaGainPerSecond(): number {\n const effAgility = Player.skills.agility * this.skillMultipliers.effAgi;\n const maxStaminaBonus = this.maxStamina / BladeburnerConstants.MaxStaminaToGainFactor;\n const gain = (BladeburnerConstants.StaminaGainPerSecond + maxStaminaBonus) * Math.pow(effAgility, 0.17);\n return gain * (this.skillMultipliers.stamina * Player.mults.bladeburner_stamina_gain);\n }\n\n calculateMaxStamina(): void {\n const effAgility = Player.skills.agility * this.skillMultipliers.effAgi;\n const maxStamina =\n (Math.pow(effAgility, 0.8) + this.staminaBonus) *\n this.skillMultipliers.stamina *\n Player.mults.bladeburner_max_stamina;\n if (this.maxStamina !== maxStamina) {\n const oldMax = this.maxStamina;\n this.maxStamina = maxStamina;\n this.stamina = (this.maxStamina * this.stamina) / oldMax;\n }\n if (isNaN(maxStamina)) {\n throw new Error(\"Max Stamina calculated to be NaN in Bladeburner.calculateMaxStamina()\");\n }\n }\n\n create(): void {\n this.contracts[\"Tracking\"] = new Contract({\n name: \"Tracking\",\n baseDifficulty: 125,\n difficultyFac: 1.02,\n rewardFac: 1.041,\n rankGain: 0.3,\n hpLoss: 0.5,\n count: getRandomInt(25, 150),\n weights: {\n hack: 0,\n str: 0.05,\n def: 0.05,\n dex: 0.35,\n agi: 0.35,\n cha: 0.1,\n int: 0.05,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.9,\n int: 1,\n },\n isStealth: true,\n });\n this.contracts[\"Bounty Hunter\"] = new Contract({\n name: \"Bounty Hunter\",\n baseDifficulty: 250,\n difficultyFac: 1.04,\n rewardFac: 1.085,\n rankGain: 0.9,\n hpLoss: 1,\n count: getRandomInt(5, 150),\n weights: {\n hack: 0,\n str: 0.15,\n def: 0.15,\n dex: 0.25,\n agi: 0.25,\n cha: 0.1,\n int: 0.1,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.8,\n int: 0.9,\n },\n isKill: true,\n });\n this.contracts[\"Retirement\"] = new Contract({\n name: \"Retirement\",\n baseDifficulty: 200,\n difficultyFac: 1.03,\n rewardFac: 1.065,\n rankGain: 0.6,\n hpLoss: 1,\n count: getRandomInt(5, 150),\n weights: {\n hack: 0,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0.1,\n int: 0.1,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.8,\n int: 0.9,\n },\n isKill: true,\n });\n\n this.operations[\"Investigation\"] = new Operation({\n name: \"Investigation\",\n baseDifficulty: 400,\n difficultyFac: 1.03,\n rewardFac: 1.07,\n reqdRank: 25,\n rankGain: 2.2,\n rankLoss: 0.2,\n count: getRandomInt(1, 100),\n weights: {\n hack: 0.25,\n str: 0.05,\n def: 0.05,\n dex: 0.2,\n agi: 0.1,\n cha: 0.25,\n int: 0.1,\n },\n decays: {\n hack: 0.85,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Undercover Operation\"] = new Operation({\n name: \"Undercover Operation\",\n baseDifficulty: 500,\n difficultyFac: 1.04,\n rewardFac: 1.09,\n reqdRank: 100,\n rankGain: 4.4,\n rankLoss: 0.4,\n hpLoss: 2,\n count: getRandomInt(1, 100),\n weights: {\n hack: 0.2,\n str: 0.05,\n def: 0.05,\n dex: 0.2,\n agi: 0.2,\n cha: 0.2,\n int: 0.1,\n },\n decays: {\n hack: 0.8,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Sting Operation\"] = new Operation({\n name: \"Sting Operation\",\n baseDifficulty: 650,\n difficultyFac: 1.04,\n rewardFac: 1.095,\n reqdRank: 500,\n rankGain: 5.5,\n rankLoss: 0.5,\n hpLoss: 2.5,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.25,\n str: 0.05,\n def: 0.05,\n dex: 0.25,\n agi: 0.1,\n cha: 0.2,\n int: 0.1,\n },\n decays: {\n hack: 0.8,\n str: 0.85,\n def: 0.85,\n dex: 0.85,\n agi: 0.85,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Raid\"] = new Operation({\n name: \"Raid\",\n baseDifficulty: 800,\n difficultyFac: 1.045,\n rewardFac: 1.1,\n reqdRank: 3000,\n rankGain: 55,\n rankLoss: 2.5,\n hpLoss: 50,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.7,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.9,\n },\n isKill: true,\n });\n this.operations[\"Stealth Retirement Operation\"] = new Operation({\n name: \"Stealth Retirement Operation\",\n baseDifficulty: 1000,\n difficultyFac: 1.05,\n rewardFac: 1.11,\n reqdRank: 20e3,\n rankGain: 22,\n rankLoss: 2,\n hpLoss: 10,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.1,\n def: 0.1,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.7,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.9,\n },\n isStealth: true,\n isKill: true,\n });\n this.operations[\"Assassination\"] = new Operation({\n name: \"Assassination\",\n baseDifficulty: 1500,\n difficultyFac: 1.06,\n rewardFac: 1.14,\n reqdRank: 50e3,\n rankGain: 44,\n rankLoss: 4,\n hpLoss: 5,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.1,\n def: 0.1,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.8,\n },\n isStealth: true,\n isKill: true,\n });\n }\n\n process(): void {\n // Edge race condition when the engine checks the processing counters and attempts to route before the router is initialized.\n if (!Router.isInitialized) return;\n\n // If the Player starts doing some other actions, set action to idle and alert\n if (!Player.hasAugmentation(AugmentationNames.BladesSimulacrum, true) && Player.currentWork) {\n if (this.action.type !== ActionTypes[\"Idle\"]) {\n let msg = \"Your Bladeburner action was cancelled because you started doing something else.\";\n if (this.automateEnabled) {\n msg += `<br /><br />Your automation was disabled as well. You will have to re-enable it through the Bladeburner console`;\n this.automateEnabled = false;\n }\n if (!Settings.SuppressBladeburnerPopup) {\n dialogBoxCreate(msg);\n }\n }\n this.resetAction();\n }\n\n // If the Player has no Stamina, set action to idle\n if (this.stamina <= 0) {\n this.log(\"Your Bladeburner action was cancelled because your stamina hit 0\");\n this.resetAction();\n }\n\n // A 'tick' for this mechanic is one second (= 5 game cycles)\n if (this.storedCycles >= BladeburnerConstants.CyclesPerSecond) {\n let seconds = Math.floor(this.storedCycles / BladeburnerConstants.CyclesPerSecond);\n seconds = Math.min(seconds, 5); // Max of 5 'ticks'\n this.storedCycles -= seconds * BladeburnerConstants.CyclesPerSecond;\n\n // Stamina\n this.calculateMaxStamina();\n this.stamina += this.calculateStaminaGainPerSecond() * seconds;\n this.stamina = Math.min(this.maxStamina, this.stamina);\n\n // Count increase for contracts/operations\n for (const contract of Object.values(this.contracts)) {\n const growthF = Growths[contract.name];\n if (growthF === undefined) throw new Error(`growth formula for action '${contract.name}' is undefined`);\n contract.count += (seconds * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n for (const op of Object.values(this.operations)) {\n const growthF = Growths[op.name];\n if (growthF === undefined) throw new Error(`growth formula for action '${op.name}' is undefined`);\n if (growthF !== undefined) {\n op.count += (seconds * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n }\n\n // Chaos goes down very slowly\n for (const cityName of BladeburnerConstants.CityNames) {\n const city = this.cities[cityName];\n if (!city) throw new Error(\"Invalid city when processing passive chaos reduction in Bladeburner.process\");\n city.chaos -= 0.0001 * seconds;\n city.chaos = Math.max(0, city.chaos);\n }\n\n // Random Events\n this.randomEventCounter -= seconds;\n if (this.randomEventCounter <= 0) {\n this.randomEvent();\n // Add instead of setting because we might have gone over the required time for the event\n this.randomEventCounter += getRandomInt(240, 600);\n }\n\n this.processAction(seconds);\n\n // Automation\n if (this.automateEnabled) {\n // Note: Do NOT set this.action = this.automateActionHigh/Low since it creates a reference\n if (this.stamina <= this.automateThreshLow) {\n if (this.action.name !== this.automateActionLow.name || this.action.type !== this.automateActionLow.type) {\n this.action = new ActionIdentifier({\n type: this.automateActionLow.type,\n name: this.automateActionLow.name,\n });\n this.startAction(this.action);\n }\n } else if (this.stamina >= this.automateThreshHigh) {\n if (this.action.name !== this.automateActionHigh.name || this.action.type !== this.automateActionHigh.type) {\n this.action = new ActionIdentifier({\n type: this.automateActionHigh.type,\n name: this.automateActionHigh.name,\n });\n this.startAction(this.action);\n }\n }\n }\n }\n }\n\n getTypeAndNameFromActionId(actionId: ActionIdentifier): {\n type: string;\n name: string;\n } {\n const res = { type: \"\", name: \"\" };\n const types = Object.keys(ActionTypes);\n for (let i = 0; i < types.length; ++i) {\n if (actionId.type === ActionTypes[types[i]]) {\n res.type = types[i];\n break;\n }\n }\n const gen = [\n \"Training\",\n \"Recruitment\",\n \"FieldAnalysis\",\n \"Field Analysis\",\n \"Diplomacy\",\n \"Hyperbolic Regeneration Chamber\",\n \"Incite Violence\",\n ];\n if (gen.includes(res.type)) {\n res.type = \"General\";\n }\n\n if (res.type == null) {\n res.type = \"Idle\";\n }\n\n res.name = actionId.name != null ? actionId.name : \"Idle\";\n return res;\n }\n\n getContractNamesNetscriptFn(): string[] {\n return Object.keys(this.contracts);\n }\n\n getOperationNamesNetscriptFn(): string[] {\n return Object.keys(this.operations);\n }\n\n getBlackOpNamesNetscriptFn(): string[] {\n return Object.keys(BlackOperations);\n }\n\n getGeneralActionNamesNetscriptFn(): string[] {\n return Object.keys(GeneralActions);\n }\n\n getSkillNamesNetscriptFn(): string[] {\n return Object.keys(Skills);\n }\n\n startActionNetscriptFn(type: string, name: string, workerScript: WorkerScript): boolean {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.startAction\", () => errorLogText);\n return false;\n }\n\n // Special logic for Black Ops\n if (actionId.type === ActionTypes[\"BlackOp\"]) {\n const canRunOp = this.canAttemptBlackOp(actionId);\n if (!canRunOp.isAvailable) {\n workerScript.log(\"bladeburner.startAction\", () => canRunOp.error + \"\");\n return false;\n }\n }\n\n try {\n this.startAction(actionId);\n workerScript.log(\n \"bladeburner.startAction\",\n () => `Starting bladeburner action with type '${type}' and name '${name}'`,\n );\n return true;\n } catch (e: unknown) {\n console.error(e);\n this.resetAction();\n workerScript.log(\"bladeburner.startAction\", () => errorLogText);\n return false;\n }\n }\n\n getActionTimeNetscriptFn(person: Person, type: string, name: string): number | string {\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n return \"bladeburner.getActionTime\";\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n return \"bladeburner.getActionTime\";\n }\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return actionObj.getActionTime(this, person) * 1000;\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n return 30000;\n case ActionTypes[\"Recruitment\"]:\n return this.getRecruitmentTime(person) * 1000;\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n return 60000;\n default:\n return \"bladeburner.getActionTime\";\n }\n }\n\n getActionEstimatedSuccessChanceNetscriptFn(person: Person, type: string, name: string): [number, number] | string {\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n return \"bladeburner.getActionEstimatedSuccessChance\";\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n return \"bladeburner.getActionEstimatedSuccessChance\";\n }\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return actionObj.getEstSuccessChance(this, person);\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n return [1, 1];\n case ActionTypes[\"Recruitment\"]: {\n const recChance = this.getRecruitmentSuccessChance(person);\n return [recChance, recChance];\n }\n default:\n return \"bladeburner.getActionEstimatedSuccessChance\";\n }\n }\n\n getActionCountRemainingNetscriptFn(type: string, name: string, workerScript: WorkerScript): number {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getActionCountRemaining\", () => errorLogText);\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getActionCountRemaining\", () => errorLogText);\n return -1;\n }\n\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n return Math.floor(actionObj.count);\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n if (this.blackops[name] != null) {\n return 0;\n } else {\n return 1;\n }\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Recruitment\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n return Infinity;\n default:\n workerScript.log(\"bladeburner.getActionCountRemaining\", () => errorLogText);\n return -1;\n }\n }\n\n getSkillLevelNetscriptFn(skillName: string, workerScript: WorkerScript): number {\n if (skillName === \"\" || !Skills.hasOwnProperty(skillName)) {\n workerScript.log(\"bladeburner.getSkillLevel\", () => `Invalid skill: '${skillName}'`);\n return -1;\n }\n\n if (this.skills[skillName] == null) {\n return 0;\n } else {\n return this.skills[skillName];\n }\n }\n\n getSkillUpgradeCostNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): number {\n if (skillName === \"\" || !Skills.hasOwnProperty(skillName)) {\n workerScript.log(\"bladeburner.getSkillUpgradeCost\", () => `Invalid skill: '${skillName}'`);\n return -1;\n }\n\n const skill = Skills[skillName];\n if (this.skills[skillName] == null) {\n return skill.calculateCost(0, count);\n } else {\n return skill.calculateCost(this.skills[skillName], count);\n }\n }\n\n upgradeSkillNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): boolean {\n const errorLogText = `Invalid skill: '${skillName}'`;\n if (!Skills.hasOwnProperty(skillName)) {\n workerScript.log(\"bladeburner.upgradeSkill\", () => errorLogText);\n return false;\n }\n\n const skill = Skills[skillName];\n let currentLevel = 0;\n if (this.skills[skillName] && !isNaN(this.skills[skillName])) {\n currentLevel = this.skills[skillName];\n }\n const cost = skill.calculateCost(currentLevel, count);\n\n if (skill.maxLvl && currentLevel + count > skill.maxLvl) {\n workerScript.log(\"bladeburner.upgradeSkill\", () => `Skill '${skillName}' cannot be upgraded ${count} time(s).`);\n return false;\n }\n\n if (this.skillPoints < cost) {\n workerScript.log(\n \"bladeburner.upgradeSkill\",\n () =>\n `You do not have enough skill points to upgrade ${skillName} ${count} time(s). (You have ${this.skillPoints}, you need ${cost})`,\n );\n return false;\n }\n\n this.skillPoints -= cost;\n this.upgradeSkill(skill, count);\n workerScript.log(\"bladeburner.upgradeSkill\", () => `'${skillName}' upgraded to level ${this.skills[skillName]}`);\n return true;\n }\n\n getTeamSizeNetscriptFn(type: string, name: string, workerScript: WorkerScript): number {\n if (type === \"\" && name === \"\") {\n return this.teamSize;\n }\n\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getTeamSize\", () => errorLogText);\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getTeamSize\", () => errorLogText);\n return -1;\n }\n\n if (\n actionId.type === ActionTypes[\"Operation\"] ||\n actionId.type === ActionTypes[\"BlackOp\"] ||\n actionId.type === ActionTypes[\"BlackOperation\"]\n ) {\n return actionObj.teamCount;\n } else {\n return 0;\n }\n }\n\n setTeamSizeNetscriptFn(type: string, name: string, size: number, workerScript: WorkerScript): number {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.setTeamSize\", () => errorLogText);\n return -1;\n }\n\n if (\n actionId.type !== ActionTypes[\"Operation\"] &&\n actionId.type !== ActionTypes[\"BlackOp\"] &&\n actionId.type !== ActionTypes[\"BlackOperation\"]\n ) {\n workerScript.log(\"bladeburner.setTeamSize\", () => \"Only valid for 'Operations' and 'BlackOps'\");\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.setTeamSize\", () => errorLogText);\n return -1;\n }\n\n let sanitizedSize = Math.round(size);\n if (isNaN(sanitizedSize) || sanitizedSize < 0) {\n workerScript.log(\"bladeburner.setTeamSize\", () => `Invalid size: ${size}`);\n return -1;\n }\n if (this.teamSize < sanitizedSize) {\n sanitizedSize = this.teamSize;\n }\n actionObj.teamCount = sanitizedSize;\n workerScript.log(\"bladeburner.setTeamSize\", () => `Team size for '${name}' set to ${sanitizedSize}.`);\n return sanitizedSize;\n }\n\n joinBladeburnerFactionNetscriptFn(workerScript: WorkerScript): boolean {\n const bladeburnerFac = Factions[FactionNames.Bladeburners];\n if (bladeburnerFac.isMember) {\n return true;\n } else if (this.rank >= BladeburnerConstants.RankNeededForFaction) {\n joinFaction(bladeburnerFac);\n workerScript.log(\"bladeburner.joinBladeburnerFaction\", () => `Joined ${FactionNames.Bladeburners} faction.`);\n return true;\n } else {\n workerScript.log(\n \"bladeburner.joinBladeburnerFaction\",\n () => `You do not have the required rank (${this.rank}/${BladeburnerConstants.RankNeededForFaction}).`,\n );\n return false;\n }\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Bladeburner\", this);\n }\n\n /** Initializes a Bladeburner object from a JSON save state. */\n static fromJSON(value: IReviverValue): Bladeburner {\n return Generic_fromJSON(Bladeburner, value.data);\n }\n}\n\nReviver.constructors.Bladeburner = Bladeburner;\n","import { Player } from \"@player\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { BladeburnerConstants } from \"./data/Constants\";\nimport { Bladeburner } from \"./Bladeburner\";\nimport { Person } from \"../PersonObjects/Person\";\n\ninterface ISuccessChanceParams {\n est: boolean;\n}\n\nclass StatsMultiplier {\n [key: string]: number;\n\n hack = 0;\n str = 0;\n def = 0;\n dex = 0;\n agi = 0;\n cha = 0;\n int = 0;\n}\n\nexport interface IActionParams {\n name?: string;\n level?: number;\n maxLevel?: number;\n autoLevel?: boolean;\n baseDifficulty?: number;\n difficultyFac?: number;\n rewardFac?: number;\n successes?: number;\n failures?: number;\n rankGain?: number;\n rankLoss?: number;\n hpLoss?: number;\n hpLost?: number;\n isStealth?: boolean;\n isKill?: boolean;\n count?: number;\n weights?: StatsMultiplier;\n decays?: StatsMultiplier;\n teamCount?: number;\n}\n\nexport class Action {\n name = \"\";\n\n // Difficulty scales with level. See getDifficulty() method\n level = 1;\n maxLevel = 1;\n autoLevel = true;\n baseDifficulty = 100;\n difficultyFac = 1.01;\n\n // Rank increase/decrease is affected by this exponent\n rewardFac = 1.02;\n\n successes = 0;\n failures = 0;\n\n // All of these scale with level/difficulty\n rankGain = 0;\n rankLoss = 0;\n hpLoss = 0;\n hpLost = 0;\n\n // Action Category. Current categories are stealth and kill\n isStealth = false;\n isKill = false;\n\n /**\n * Number of this contract remaining, and its growth rate\n * Growth rate is an integer and the count will increase by that integer every \"cycle\"\n */\n count: number = getRandomInt(1e3, 25e3);\n\n // Weighting of each stat in determining action success rate\n weights: StatsMultiplier = {\n hack: 1 / 7,\n str: 1 / 7,\n def: 1 / 7,\n dex: 1 / 7,\n agi: 1 / 7,\n cha: 1 / 7,\n int: 1 / 7,\n };\n // Diminishing returns of stats (stat ^ decay where 0 <= decay <= 1)\n decays: StatsMultiplier = {\n hack: 0.9,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.9,\n int: 0.9,\n };\n teamCount = 0;\n\n // Base Class for Contracts, Operations, and BlackOps\n constructor(params: IActionParams | null = null) {\n // | null = null\n if (params && params.name) this.name = params.name;\n\n if (params && params.baseDifficulty) this.baseDifficulty = addOffset(params.baseDifficulty, 10);\n if (params && params.difficultyFac) this.difficultyFac = params.difficultyFac;\n\n if (params && params.rewardFac) this.rewardFac = params.rewardFac;\n if (params && params.rankGain) this.rankGain = params.rankGain;\n if (params && params.rankLoss) this.rankLoss = params.rankLoss;\n if (params && params.hpLoss) this.hpLoss = params.hpLoss;\n\n if (params && params.isStealth) this.isStealth = params.isStealth;\n if (params && params.isKill) this.isKill = params.isKill;\n\n if (params && params.count) this.count = params.count;\n\n if (params && params.weights) this.weights = params.weights;\n if (params && params.decays) this.decays = params.decays;\n\n // Check to make sure weights are summed properly\n let sum = 0;\n for (const weight of Object.keys(this.weights)) {\n if (this.weights.hasOwnProperty(weight)) {\n sum += this.weights[weight];\n }\n }\n if (sum - 1 >= 10 * Number.EPSILON) {\n throw new Error(\n \"Invalid weights when constructing Action \" +\n this.name +\n \". The weights should sum up to 1. They sum up to :\" +\n 1,\n );\n }\n\n for (const decay of Object.keys(this.decays)) {\n if (this.decays.hasOwnProperty(decay)) {\n if (this.decays[decay] > 1) {\n throw new Error(`Invalid decays when constructing Action ${this.name}. Decay value cannot be greater than 1`);\n }\n }\n }\n }\n\n getDifficulty(): number {\n const difficulty = this.baseDifficulty * Math.pow(this.difficultyFac, this.level - 1);\n if (isNaN(difficulty)) {\n throw new Error(\"Calculated NaN in Action.getDifficulty()\");\n }\n return difficulty;\n }\n\n /**\n * Tests for success. Should be called when an action has completed\n * @param inst {Bladeburner} - Bladeburner instance\n */\n attempt(inst: Bladeburner, person: Person): boolean {\n return Math.random() < this.getSuccessChance(inst, person);\n }\n\n // To be implemented by subtypes\n getActionTimePenalty(): number {\n return 1;\n }\n\n getActionTime(inst: Bladeburner, person: Person): number {\n const difficulty = this.getDifficulty();\n let baseTime = difficulty / BladeburnerConstants.DifficultyToTimeFactor;\n const skillFac = inst.skillMultipliers.actionTime; // Always < 1\n\n const effAgility = person.skills.agility * inst.skillMultipliers.effAgi;\n const effDexterity = person.skills.dexterity * inst.skillMultipliers.effDex;\n const statFac =\n 0.5 *\n (Math.pow(effAgility, BladeburnerConstants.EffAgiExponentialFactor) +\n Math.pow(effDexterity, BladeburnerConstants.EffDexExponentialFactor) +\n effAgility / BladeburnerConstants.EffAgiLinearFactor +\n effDexterity / BladeburnerConstants.EffDexLinearFactor); // Always > 1\n\n baseTime = Math.max(1, (baseTime * skillFac) / statFac);\n\n return Math.ceil(baseTime * this.getActionTimePenalty());\n }\n\n // For actions that have teams. To be implemented by subtypes.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getTeamSuccessBonus(inst: Bladeburner): number {\n return 1;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getActionTypeSkillSuccessBonus(inst: Bladeburner): number {\n return 1;\n }\n\n getChaosCompetencePenalty(inst: Bladeburner, params: ISuccessChanceParams): number {\n const city = inst.getCurrentCity();\n if (params.est) {\n return Math.pow(city.popEst / BladeburnerConstants.PopulationThreshold, BladeburnerConstants.PopulationExponent);\n } else {\n return Math.pow(city.pop / BladeburnerConstants.PopulationThreshold, BladeburnerConstants.PopulationExponent);\n }\n }\n\n getChaosDifficultyBonus(inst: Bladeburner /*, params: ISuccessChanceParams*/): number {\n const city = inst.getCurrentCity();\n if (city.chaos > BladeburnerConstants.ChaosThreshold) {\n const diff = 1 + (city.chaos - BladeburnerConstants.ChaosThreshold);\n const mult = Math.pow(diff, 0.5);\n return mult;\n }\n\n return 1;\n }\n\n getEstSuccessChance(inst: Bladeburner, person: Person): [number, number] {\n function clamp(x: number): number {\n return Math.max(0, Math.min(x, 1));\n }\n const est = this.getSuccessChance(inst, person, { est: true });\n const real = this.getSuccessChance(inst, person);\n const diff = Math.abs(real - est);\n let low = real - diff;\n let high = real + diff;\n const city = inst.getCurrentCity();\n const r = city.pop / city.popEst;\n if (r < 1) low *= r;\n else high *= r;\n return [clamp(low), clamp(high)];\n }\n\n /**\n * @inst - Bladeburner Object\n * @params - options:\n * est (bool): Get success chance estimate instead of real success chance\n */\n getSuccessChance(inst: Bladeburner, person: Person, params: ISuccessChanceParams = { est: false }): number {\n if (inst == null) {\n throw new Error(\"Invalid Bladeburner instance passed into Action.getSuccessChance\");\n }\n let difficulty = this.getDifficulty();\n let competence = 0;\n for (const stat of Object.keys(this.weights)) {\n if (this.weights.hasOwnProperty(stat)) {\n const playerStatLvl = person.queryStatFromString(stat);\n const key = \"eff\" + stat.charAt(0).toUpperCase() + stat.slice(1);\n let effMultiplier = inst.skillMultipliers[key];\n if (effMultiplier == null) {\n console.error(`Failed to find Bladeburner Skill multiplier for: ${stat}`);\n effMultiplier = 1;\n }\n competence += this.weights[stat] * Math.pow(effMultiplier * playerStatLvl, this.decays[stat]);\n }\n }\n competence *= Player.getIntelligenceBonus(0.75);\n competence *= inst.calculateStaminaPenalty();\n\n competence *= this.getTeamSuccessBonus(inst);\n\n competence *= this.getChaosCompetencePenalty(inst, params);\n difficulty *= this.getChaosDifficultyBonus(inst);\n\n if (this.name == \"Raid\" && inst.getCurrentCity().comms <= 0) {\n return 0;\n }\n\n // Factor skill multipliers into success chance\n competence *= inst.skillMultipliers.successChanceAll;\n competence *= this.getActionTypeSkillSuccessBonus(inst);\n if (this.isStealth) {\n competence *= inst.skillMultipliers.successChanceStealth;\n }\n if (this.isKill) {\n competence *= inst.skillMultipliers.successChanceKill;\n }\n\n // Augmentation multiplier\n competence *= Player.mults.bladeburner_success_chance;\n\n if (isNaN(competence)) {\n throw new Error(\"Competence calculated as NaN in Action.getSuccessChance()\");\n }\n return Math.min(1, competence / difficulty);\n }\n\n getSuccessesNeededForNextLevel(baseSuccessesPerLevel: number): number {\n return Math.ceil(0.5 * this.maxLevel * (2 * baseSuccessesPerLevel + (this.maxLevel - 1)));\n }\n\n setMaxLevel(baseSuccessesPerLevel: number): void {\n if (this.successes >= this.getSuccessesNeededForNextLevel(baseSuccessesPerLevel)) {\n ++this.maxLevel;\n }\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Action\", this);\n }\n\n static fromJSON(value: IReviverValue): Action {\n return Generic_fromJSON(Action, value.data);\n }\n}\n\nReviver.constructors.Action = Action;\n","import { Literatures } from \"./Literatures\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nexport function showLiterature(fn: string): void {\n const litObj = Literatures[fn];\n if (litObj == null) {\n return;\n }\n const txt = `<i>${litObj.title}</i><br><br>${litObj.txt}`;\n dialogBoxCreate(txt, true);\n}\n","import { ITaskParams, ITerritory } from \"./ITaskParams\";\n\nexport class GangMemberTask {\n name: string;\n desc: string;\n\n isHacking: boolean;\n isCombat: boolean;\n\n baseRespect: number;\n baseWanted: number;\n baseMoney: number;\n\n hackWeight: number;\n strWeight: number;\n defWeight: number;\n dexWeight: number;\n agiWeight: number;\n chaWeight: number;\n\n difficulty: number;\n\n territory: ITerritory;\n\n // Defines tasks that Gang Members can work on\n constructor(name: string, desc: string, isHacking: boolean, isCombat: boolean, params: ITaskParams) {\n this.name = name;\n this.desc = desc;\n\n // Flags that describe whether this Task is applicable for Hacking/Combat gangs\n this.isHacking = isHacking;\n this.isCombat = isCombat;\n\n // Base gain rates for respect/wanted/money\n this.baseRespect = params.baseRespect ? params.baseRespect : 0;\n this.baseWanted = params.baseWanted ? params.baseWanted : 0;\n this.baseMoney = params.baseMoney ? params.baseMoney : 0;\n\n // Weighting for the effect that each stat has on the tasks effectiveness.\n // Weights must add up to 100\n this.hackWeight = params.hackWeight ? params.hackWeight : 0;\n this.strWeight = params.strWeight ? params.strWeight : 0;\n this.defWeight = params.defWeight ? params.defWeight : 0;\n this.dexWeight = params.dexWeight ? params.dexWeight : 0;\n this.agiWeight = params.agiWeight ? params.agiWeight : 0;\n this.chaWeight = params.chaWeight ? params.chaWeight : 0;\n\n if (\n Math.round(\n this.hackWeight + this.strWeight + this.defWeight + this.dexWeight + this.agiWeight + this.chaWeight,\n ) != 100\n ) {\n console.error(`GangMemberTask ${this.name} weights do not add up to 100`);\n }\n\n // 1 - 100\n this.difficulty = params.difficulty ? params.difficulty : 1;\n\n // Territory Factors. Exponential factors that dictate how territory affects gains\n // Formula: Territory Multiplier = (Territory * 100) ^ factor / 100\n // So factor should be > 1 if something should scale exponentially with territory\n // and should be < 1 if it should have diminishing returns\n this.territory = params.territory ? params.territory : { money: 1, respect: 1, wanted: 1 };\n }\n}\n","import { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { Crime } from \"../Crime/Crime\";\nimport { CONSTANTS } from \"../Constants\";\nimport { determineCrimeSuccess } from \"../Crime/CrimeHelpers\";\nimport { Crimes } from \"../Crime/Crimes\";\nimport { Player } from \"@player\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { CrimeType } from \"../utils/WorkType\";\nimport { Work, WorkType } from \"./Work\";\nimport { scaleWorkStats, WorkStats } from \"./WorkStats\";\nimport { calculateCrimeWorkStats } from \"./formulas/Crime\";\n\nenum newCrimeType {\n SHOPLIFT = \"SHOPLIFT\",\n ROBSTORE = \"ROBSTORE\",\n MUG = \"MUG\",\n LARCENY = \"LARCENY\",\n DRUGS = \"DRUGS\",\n BONDFORGERY = \"BONDFORGERY\",\n TRAFFICKARMS = \"TRAFFICKARMS\",\n HOMICIDE = \"HOMICIDE\",\n GRANDTHEFTAUTO = \"GRANDTHEFTAUTO\",\n KIDNAP = \"KIDNAP\",\n ASSASSINATION = \"ASSASSINATION\",\n HEIST = \"HEIST\",\n}\n\nconst convertCrimeType = (crimeType: CrimeType): newCrimeType => {\n switch (crimeType) {\n case CrimeType.SHOPLIFT:\n return newCrimeType.SHOPLIFT;\n case CrimeType.ROB_STORE:\n return newCrimeType.ROBSTORE;\n case CrimeType.MUG:\n return newCrimeType.MUG;\n case CrimeType.LARCENY:\n return newCrimeType.LARCENY;\n case CrimeType.DRUGS:\n return newCrimeType.DRUGS;\n case CrimeType.BOND_FORGERY:\n return newCrimeType.BONDFORGERY;\n case CrimeType.TRAFFIC_ARMS:\n return newCrimeType.TRAFFICKARMS;\n case CrimeType.HOMICIDE:\n return newCrimeType.HOMICIDE;\n case CrimeType.GRAND_THEFT_AUTO:\n return newCrimeType.GRANDTHEFTAUTO;\n case CrimeType.KIDNAP:\n return newCrimeType.KIDNAP;\n case CrimeType.ASSASSINATION:\n return newCrimeType.ASSASSINATION;\n case CrimeType.HEIST:\n return newCrimeType.HEIST;\n }\n return newCrimeType.SHOPLIFT;\n};\n\ninterface CrimeWorkParams {\n crimeType: CrimeType;\n singularity: boolean;\n}\n\nexport const isCrimeWork = (w: Work | null): w is CrimeWork => w !== null && w.type === WorkType.CRIME;\n\nexport class CrimeWork extends Work {\n crimeType: CrimeType;\n unitCompleted: number;\n\n constructor(params?: CrimeWorkParams) {\n super(WorkType.CRIME, params?.singularity ?? true);\n this.crimeType = params?.crimeType ?? CrimeType.SHOPLIFT;\n this.unitCompleted = 0;\n }\n\n getCrime(): Crime {\n const crime = Object.values(Crimes).find((c) => c.type === this.crimeType);\n if (!crime) throw new Error(\"CrimeWork object constructed with invalid crime type\");\n return crime;\n }\n\n process(cycles = 1): boolean {\n this.cyclesWorked += cycles;\n const time = Object.values(Crimes).find((c) => c.type === this.crimeType)?.time ?? 0;\n this.unitCompleted += CONSTANTS._idleSpeed * cycles;\n while (this.unitCompleted >= time) {\n this.commit();\n this.unitCompleted -= time;\n }\n return false;\n }\n\n earnings(): WorkStats {\n return calculateCrimeWorkStats(this.getCrime());\n }\n\n commit(): void {\n const crime = this.getCrime();\n if (crime == null) {\n dialogBoxCreate(\n `ERR: Unrecognized crime type (${this.crimeType}). This is probably a bug please contact the developer`,\n );\n return;\n }\n const focusPenalty = Player.focusPenalty();\n // exp times 2 because were trying to maintain the same numbers as before the conversion\n // Technically the definition of Crimes should have the success numbers and failure should divide by 4\n let gains = scaleWorkStats(this.earnings(), focusPenalty, false);\n let karma = crime.karma;\n const success = determineCrimeSuccess(crime.type);\n if (success) {\n Player.gainMoney(gains.money, \"crime\");\n Player.numPeopleKilled += crime.kills;\n Player.gainIntelligenceExp(gains.intExp);\n } else {\n gains = scaleWorkStats(gains, 0.25);\n karma /= 4;\n }\n Player.gainHackingExp(gains.hackExp);\n Player.gainStrengthExp(gains.strExp);\n Player.gainDefenseExp(gains.defExp);\n Player.gainDexterityExp(gains.dexExp);\n Player.gainAgilityExp(gains.agiExp);\n Player.gainCharismaExp(gains.chaExp);\n Player.karma -= karma * focusPenalty;\n }\n\n finish(): void {\n /** nothing to do */\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n crimeType: convertCrimeType(this.crimeType),\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"CrimeWork\", this);\n }\n\n /** Initializes a CrimeWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): CrimeWork {\n return Generic_fromJSON(CrimeWork, value.data);\n }\n}\n\nReviver.constructors.CrimeWork = CrimeWork;\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Crime } from \"src/Crime/Crime\";\nimport { newWorkStats, scaleWorkStats, WorkStats } from \"../WorkStats\";\nimport { Player } from \"@player\";\n\nexport const calculateCrimeWorkStats = (crime: Crime): WorkStats => {\n const gains = scaleWorkStats(\n newWorkStats({\n money: crime.money * Player.mults.crime_money,\n hackExp: crime.hacking_exp * 2 * Player.mults.hacking_exp,\n strExp: crime.strength_exp * 2 * Player.mults.strength_exp,\n defExp: crime.defense_exp * 2 * Player.mults.defense_exp,\n dexExp: crime.dexterity_exp * 2 * Player.mults.dexterity_exp,\n agiExp: crime.agility_exp * 2 * Player.mults.agility_exp,\n chaExp: crime.charisma_exp * 2 * Player.mults.charisma_exp,\n intExp: crime.intelligence_exp * 2,\n }),\n BitNodeMultipliers.CrimeExpGain,\n false,\n );\n gains.money *= BitNodeMultipliers.CrimeMoney;\n return gains;\n};\n","import React, { useEffect, useState } from \"react\";\nimport { EventEmitter } from \"../utils/EventEmitter\";\nimport { Modal } from \"./React/Modal\";\n\nconst frames = [\n \"ttftfffttttttttttfffffffttftt1ttttttt111tttt1111111tttt1tt111tttt111111tttt1ttttttttttttttt111111111\\nttfttttttttttttttttfLLLftfffffffffftttt111tt11111ttffffftttt1111111111111111ttttttfttttttttt111111t1\\nttttttttttttttttffffLfftffffffffLLffttttttftt111ttfffffftttttttt111111ttttttffffttfffttttttt111111tt\\nttttttttttttttttfffLfttffffffLLffffttttttttttt1tfffffffffftttttt111111tffffffffftttfffftttt11111ttt1\\nttttttttttttffLfttfffttfffffffffttfftttttt1t1tt11tfffffftttttt111t111111ttffffLLffttfffftt111111tttt\\nttttttttttffLLLLfttttffLLLfttttftfLftttttttffffttttffffttttfftt11t111tt111ttfffLffttfftttttt1111tttt\\nttttttttffLLLLLLLffttfLLffttfffftfLfttttttffttt11111ttttffffffftt1111tft11111ttffffttt11tfftt11ttttt\\ntttttttfffLLLLLLLLfftffttttffLffftfftttttft1i;;::::;iitffffffffftt111tft1tttt1ttffLfttttfffffttttttt\\ntttttttfffLLLLLLLLfttttffftffffftfttttttff1:,,,,,,,,::itfffffffft11111111ttttttttttt1tfffffffffffttt\\ntttffttffLLLLLLLLLfttfftffffffffLLLftttttt;::,:::;;;;::1tfffftfft11111ttt1ttt1tfttt11ttffffffffLfttt\\ntffffffffLLLLLLLffftfLfffttfLLffLLLfttttti;;;iii11111;:i11ttffft111111tfft11t11tt1tttttfffLLLLLLfttf\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttfti:;;;iiiiiiii;it111tt111t1111tffttfftt11ttftttfffLLLLLLffff\\nttttfttttffffftttttttttttttfLLLffLLfttttt1;;;;;;iiiiii;1tft11tt1111111tfftfffftttttttttttfLLfffttfff\\ntfffffffffftttfffffffffttffttLLfffLfttttt11i;;;;iiiiiii1tt11tfftt11111ttt1fffttt1tttttttttfffftttttt\\nttffffffffftttfffffffffttffftffttftttttff1ii;;;;iii1iii111tt1ttttt1111t111ffttffttfffffLffttttffffff\\nttffffffffttttffffffffttttttttttffftttttft1ii;;;ii1iii111tfft11ttt111111t1tt1tfft1ttffffLLftttLLLLLL\\ntttffffffffttfffffffftttttttt11fffftttt1t111iiii;iiiii11ttffft11111111ttttttt1tt11ttffffLfftttfLLLLf\\ntttttttffffttfffttttttttffttt11tffttttttt11ttii;;;iiii11i1ffftt1111111tttt111tttt11ttttffffftffLLLff\\ntfttttttttttttttttttttfffftttt11tfftttttt111t1i;;;iiii1i,,:;i1111t1111ttt111t1tfftt11111ttfftffffftt\\nttttfffftttttttfffftttffffttffttttft111tt11111i;;;iiii1;,,....,:::;i11tt111tt11tffftttttttt1tttttttt\\nt11ttffffftttffffffttttfffttffttttft1111111111;;;;;;;it;,...........,:it111ttt1tffftttttfft11ttfffff\\ntt1ttfffftt1ttfffft111tffttfttttttt1111t1i;:;11i1i;;1t1:,,............,itt11tt1tfftt1tfffffft1tffLLf\\ntfttttfttttt11tttt1ttt11ttttttftt111111i:,..:1111iii11;,...............;tt111t11ttttttttffttt11ffLLf\\ntfftttttttfftttttttffftt111ttffftt11i;,.,...,iiii;;;;:,,...............:1ttt1111ttfffttttft1tt1ttfft\\nttttttttttttttt11ttttttttttfffffft1:,..........::::::,,,...............,1ttttt11ttfffffttttffftttttt\\ntfffttttffffftt11ttttttttttfffffft1:...........:;::;:..................,1tttttt1ttfffffttttttttftttf\\ntfffttttfffffft1ttftttfftttttffft11:...........,:::::..................,1tttft11tfffffffttfffffffttf\\ntfffttttffffff11tttttttttttttttttt1;...........,::::,...................;t1t1111tfffffLfttfffffffttf\\ntfffttttfftttt11tttttttt1tfftttttt1:...........,::::,...... ............,1111tt11fffffLftttffttffttf\\ntttttttttttttt11tttttttt1tffftttft1:...........,:::,,....................it1ttt11tfffffftttffttffttt\\nttttt1tttttttt11ttttttttttffttttttt:...........,::,,.....................:111tt11tttttttt1tttttttttt\\nttttt1tttttttt11tftttttftttttttttt1;,:;:.......,:,,,....................,,1111t11ttttttt11ttttttfttt\\n1tttt1ttfffttt11ttffffffttttfffft11ii1i:.......,:,,,.....................,1tt1111ttttttt111tttttfttt\\n1ttt11tttttttt11tttttttttttttttttti;;;;:.......,:,,,....... .............,itt1111tttt11t111ttttttt1t\\n111111tttttttt11111111ttttttttttt1i;;;;:.......,:,,,......................itt11111111111111111111111\\n1111111111111111111111ttttttttttt1;;;;;:...... ,:,,,,.....................itt11t11111111111111111111\\n1111111111111111111111tttttttttt1;:,::;,...... ,:...,.....................ittttt11111111111111111111\\n111111111111111111111111tttttttt1i,..... .... .:........................,i1tttt11111111111111111111\\n1111111111111111111111111t11t11111;,....,,.... ,:::,,,...................,11ttttt11t1111111t11111111\\n11111111111111111111111111111111111iiiiii. ... .::::::,..................,11t1ttt111t11111tttttt1111\\n1111111111111111111111111111111111111111:.,.....::::::,..................:111tttttt1tttt11tttttt1111\\n1111111111111111111111111111111111111111:::,...,::::;::,..,,.............:11tt1ttttttttttttttttt1111\\n\",\n \"ttftfffttttttttttffffffftfftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttftfLLLftfffffffffftt11111tt11111ttffffttttt1111111111111111ttttttfttttttttt111111tt\\nttftttttttttttttffffLftttfffffffLLLfttttttftt111ttfffffftttttttt111111tttttffffftfffftttttt1111111tt\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1tffffffffffttttttt11111tffffffffftttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttfftttttt1tttt1ttftfffftt1ttt111t111111ttffffLLffttfffft1111111tttt\\nttttttttttffLLLLfttttffLLLfttttttfLftttttttfft11i;;:;;i11ttfftt11t111tt111tttffffftttttttttt111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLttttttfff1;,,,,,,,,:;tffffft11111tft11111ttffffttt11tffftt1ttttt\\ntttttttfffLLLLLLLLfftffttttffLffftfftttttfft1;:,,,,,::::,;tffftttt111tft1tttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffffftfftttttfffti:;;;iiii11i;:tffffft11111111ttftttttttt1ttffffffffffttt\\ntttffttffLLLLLLLLLftffftfLftfftfLLLftttttfft::i;iiiiii11i:1ffftft11111ttt1ttt1ttttt11ttfffffLLfLfttt\\nttfLfffffLLLLLLLLfftfLLfffffLfffLLLfttttt1tt;:;;;;;iiiiiii1tffft11111tffft11t11tt1tttttfffLLLLLLffff\\ntffftfttttfLLLffttttfffffttLLLLfLLLftttft111i;;;;;;iiiiii111tt111t1111tffttfftt11tfft1tfffLLLLLLLffL\\ntttfftttttffLftttttttttttttfLfLffLLfttttttt1iii;;;;;ii11i1t11t11111111tffttfffttttttt11ttfLLLLffftff\\nttfLffffffftttfffffffffttfftfLLfffLftttttfft1ii;;;;iii1i1tt1tfftt11111ttt1tffttt1ttt1tttttffffttffft\\nttffffffffftttffffffffttfffftffffftttttfffft111;;;;iiii1111t1ttttt1111tt11ffttfftttfffffLfttttfffffL\\nttffffffffttttffffffffttttttttttffftttttttt11ttii;iiiiii11tft11ttt111111t11t1tfft1tfffffLLftttLLLLLL\\n1ttffffffffttfffffffftttttttt11ffffttttt1111tftiii;;iiii1;,;1111111111tttt11111111ttffffLfftttffLLLf\\nttttttttfffttfffttttttttffttt11tffftttttt11ttf1;;;i;iiii1:,,.,,::;ii11tttt111tttt11ttffffffftffLLLff\\ntfttttttttttttttttttttfffftttt11tfftttttt111tt1;;;i;;ii1t:,,........,:;1t111t1tfftt11111ttfftffffftt\\ntftttffffttttttfftftttffffttffttttftt11tt111i;;;;;;;;;it1,,............,;11tt11tffffttttttt1tttttttt\\ntttttffffftttfffffft1ttffftfffttttft111111;:,.;iii;;;i11,.,.............,1tttt1tffftttttfft111tfffff\\n1tttffffftt1ttfffftt11tffttfttttttt1111i;,....,1iii;ii;,................,111tt1tfft11tffffftt1tLffLf\\ntftttfftt1ttt1tttt1tttt1ttttttttt1111;:,.......i1;;;:::.................,it11t11ttttttttffftt11fffLf\\ntfftttttttfftt1111ttfftt11ttfffftt1ti..........:i;::;:,..................ittt111t1tffttttft1tt1tffft\\nttttttttttttttt11tttttttt1tffffffftti,.........,::::::,..................itttt11ttffffftttttfftttttt\\ntfffttttfffffft11ttttttttttffffffft1i,.........,:,:::,...................,1tttt11tfffffttttttttffttf\\ntfffttttfffffft11tftttfftttttffft1111:.........,:,:::,....................;tt111tfffffffttfffffffttf\\ntfffttttfffffft1tttttttftttttttttt111;.........,:,::,,....................,111111fffffLfttfffffffttf\\ntffftttttttffft11tttttttttffttttfft11i.........,:.:,,......................:1tt11fffffLftttffttffttf\\ntttttttttttttt111ttttttt1tffftttfft111:....... ,:.:,,.......................1tt11tfffffftttffftffttt\\nttttt1tttttttt11ttttttttttfttttttft111i,...... ,:,,,,......................,itt11ttttttt11ttttttfttt\\nttttt1tttttttt11tfttttfftttttffttt1111i,...... ,:.,,,......................:11111ttttttt11ttttttfttt\\n1tttt1ttftfttt11tfffffffttttfffft11111,....... ,,.,,....... ...............it1111ttttttt111tttttfttt\\n1tttt1tttttttt11ttttttttttttttttt1111;,....... ,,.,,......................:tt11111ttt11t111ttttttt1t\\n11t111tttttttt111t1111tttttttttt1iiii:,,...... ,,.........................;t111111111111111111111111\\n111111111tt11111111111ttttttttt1;;iiii:....... ,,............ ...........;tttt1111111111111111111111\\n1111111111111111111111ttttttttt1;;;iii;... ....,::::,....,:::,,.........;1ttttt111111111111111111111\\n111111111111111111111111tttttttt1i;;ii: .,....,:::::... .;;;;;:,.....,;1ttttttttt111111111111111111\\n1111111111111111111111111tt1111111i,,.,:;i: ...,:::::.....:;;;;;:.....,1ttttttttt11t1111111t11111111\\n11111111111111111111111111111111111:.:1tti,....,:::::.... ,;;;;;;,.....ittttttttt111t11111ttttt11111\\n1111111111111111111111111111111111111ttt;,,....,:::::,... .,;;;;:,.,,..:ttttttttttt1tttt11tttttt1111\\n11111111111111111111111111111111111111t1,,,....:;;::::,.....:;;;:......,1ttttttttttttttttttttttt1111\\n\",\n \"ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt1tt111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftfffffffffttt11111tt11111ttfffft1ttt1111111111111111tttttffttttttttt111111tt\\nttftttttttttttttffffLffttfffffffLLLfttttttfttt11tffffffftttttttt111111tttttffffftfffftttttt1111111tt\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1ttt1iiiii1tttttttt11111tffffffffftttfffffttt1111t1tt1\\nttttttttttttffffttffftffffffffffttffttttt11tttt1i::,,,,,,:;111111t111111ttffffLLffttfLfftt11111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfft1i;,,,,,,,,,:;ttt11t111tt111tttffffftttftttttt111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLtttttffffti;::;;;;;iii::1ftt11111tft11111ttffffttt11tffftt1ttttt\\ntttttttfffLLLLLLLLLftffttttffLffftffttttffffft;:;iiii11111i:iftttt111ttt1tttt11tffLfttttfffffttttttt\\ntttttttffLLLLLLLLLfttttffftffLLftfftttttffffft;:;;;;;iiiiii;1fftt11111111ttftttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttffffti;;;;;;;ii;iiitffft11111ttt1ttt1tfttt11ttfffffLLfLfttt\\nttfLfffffLLLLLLLLffffLLfffffLfffLLLLtttttttff1iii;;i;;iii111tfft111111ffft11t11tt1tttttfffLLLLLLffff\\ntffftftttffLLLffttttfffffttLLLLfLLLffttftt11t1iii;;;;;iiiii1tt111t1111tffttfftt11tfft1tfffLLLLLLLfff\\nttffftttttffLftttttttttttttfLLLffLLftttttttft111i;;;;iiii1111111111111tffttfffttttttt11ttfLLffffftff\\nttfLffffffftttfffffffffttfttfLLfffLftttttfffft11i;;;;iiii1t1ttttt11111ttt1tffttt11ttttttttfffftfttft\\nttffffffffftttffffffffttfffftffffftttttfffft11t1i;;;;;iii1ii1ttttt1111t111ffttfft1tfffffLfttttfffffL\\nttffffffffttttffffffffttttttttttffftttttttt11tft1i;;;;iii1i,:;i1ttt11111t11t1tfft1ttffffLLfttfLLLLLL\\ntttffffffffttfffffffftttttttt11ffffttttt1111tfti;ii;;iiii1;,,...,:;ii1tttt1111tt11ttffffffftttffLLLf\\nttttttttfffttfffttttttttffttt11tffftttttt11t1iii;;ii;;;i1t:,.........,:;1t111ttt111ttffffffftffLLLLf\\ntfttttttttttttttttttttfffftttt11tfftt11tt1i:,.:;;;i;;;itti,,............,;1111ttttt11111ttfftffffftt\\ntfttfffftttttttfffftttffffttffttttft1111i:....,;;;ii;i11;.,,.............:1tt1ttffffttttttt1ttttttft\\ntttttffffftttffftffttttffftfffttttft1i:,.......:;;;;;;;:,................:tttt1tffftttttfft11ttfffff\\n1t1tffffftt1ttfffftt11tffttftttttttt1,.........,ii;;;;;,.................:11tt1tfft11tfffffft1fLLfLf\\ntftttfftt1ttt1tftt1ttt11ttttttttt111i,.........,11;:;;:,.................,1t1t11ttttttttfftt111fffLf\\ntfftttttttffttt111ttfftt11ttffffftt11,.........,i;::::,..................,1tt11111ffft1ttt11tt1tffft\\nttttttttttttttt11tttttttt1tffffffft11;..........::::::,...................;tt1111tfffftttttffftttttt\\ntfffttttfffffft11ttttttttttffffffft11:..........:::::,..,;:,...............ittt1tttttffttttttttffttf\\ntfffttttfffffft11tftttffttttfffft1111:..........:::::,..;1i;:,..............1t11tfffffffttfffffffttf\\ntfffttttfffffft1tttttttftttttttttt111;..........::,:,...;ii;;;,.............:1111tffffLfttfffffffttf\\ntffftttttttfft11ttttttttttfftttttft11i,.........::,,,...;;;;;i:..............;111tffffLfttfffttffttf\\ntttttttttttttt111tttttttttffftttfft11i,.........::,,,...;;;;;i:..............:111tfffffftttffttffttt\\ntttttttttttttt11ttttttttttfftttttft111:.........:,,,....::;;;;:.............,1t11ttttttt11tttttffttt\\nttttt1tttttttt11tfttttfftttttfftttt111:.........:,,,......,::::..,.........,i1111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfffffffttttfffft1111i:,........:,,,..... .......,,...... .it1111ttttttt111tttttft1t\\n1tttt1tttttttt11ttttttttttttttttt1iiii;,........:........... ...........:itt11111ttt1t1111ttttttt1t\\n111111tttttttt111tt111tttttttttti;;;iii:... ....:,,...................:i1tttt11111111111111111111111\\n111111111tt11111111111tttttttttt1;;;;;;;. .,....::::..................:1tttttt1111111111111111111111\\n1111111111111111111111ttttttttttt1i;;::..:;1,...::::...................;ttttttt111111111111111111111\\n1111111111111111111111111tttttttt111i,.,it1;....::::,..................,1ttttttttt111111111111111111\\n1111111111111111111111111tttt11111111ii1t1i:...,::::,........,..........itttttttt11t1111111tt1t11111\\n11111111111111111111111111111111111111tt1;:....::::;:.......,...........:1ttttttt111t11111ttttt11111\\n111111111111111111111111111111111111111ti,,....:;:;::,..................,ittttttttt1tttt11tttttt1111\\n111111111111111111111111111111111111111t:,:.,.:;;;;:::,..................;111t1ttttttttttttttttt1111\\n\",\n \"ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt11t111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftfffffffffttttt1111t11111ttffffftttt1111111111111111tttttfftttttttt1111111tt\\nttftttttttttttttffffLffttffffffffLLfttttttfttt11ttt1iiii;i11tttt111111tttttffffftffffttttttt111111tt\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1tt1::,,,,,,:;1ttt111111tfftfffffftttfffffttt1111t1tt1\\nttttttttttttffffttffftffffffffffttfftttttt1ttt11i;:,,,,,,,,,:1111t1111111tffffLLffttfLfftt11111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1;:::;;;;;;;::it11t111tt111tttffffftttfttttt1111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLtttttfffffti:;;ii111111i:itt11111tft11111ttffffttt1ttffftt1ttttt\\ntttttttfffLLLLLLLLLftffftttffLffftffttttfffffft;:;;;;;iiiiii;ittt1111ttt1tttt11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLLftfftttttffffffti;;;;;;;ii;iiitttt11111111ttftttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttfffff1iii;;i;;i1i1i1tttt11111ttt1ttt1tfttt111tfffffLLfLfttt\\nttfLffffffLLLLLLLffffLLfffffLfffLLLftttttttfft1i;;;;;;;iiiiitfft111111ffft11t11tt1tttttffffLLLLLffft\\ntffftfttttfLLLffttttffffftfLLLLfLLLftttftt1111111i;;;;iiii111t111t1111tffttfftt11tfft1tffLLLLLLLLfff\\nttffftttttffLftttttttttttttfLLLffLLftttt1tttt11tti;;;iiiii111111111111tffttffftttttttt1ttfLLLfffffff\\nttfLffffffftttfffffffffttfttfLLfffLftttttffft1111i;;;;;ii111tfttt11111ttt1tffttt11ttttttttfLfftfttft\\nttffffffffftttfffffffffttffftffffftttttfffft11t11i;;;;iii1i:;1ttft11111111ffttfftttfffffLfttttfffffL\\nttffffffffttttffffffffttttttttttffftttttft111tttiii;;iiii1;,,,:;i1111111111t1tfft1ttffffLLftttfLLLLL\\ntttffffffffttffffffffttttttttttfffftttt1111i;:;iiii;;;i;11:,,.....,:;i1tft1111tt111tffffLfftttffLLLf\\nttttttttfffttfffttttttttfftt111tfffttt11i;,,..:i;;;i;ii1t1,,..........,:i1111ttt1111tffffffftffLLLLf\\ntfttttttttttttttttttttffffttttt1tffti;:,,.....,;;;iiii1ti,,,.............;1111ttttt11111ttfftffffftt\\ntttttffffttttttfffftttffffttffttttf1:.........,;:;;;;;;;,.,,,............:1tt1ttffff11ttttt1ttttttft\\ntttttffffftttffftfft1ttffftfffttttf1,..........,;;;;;;;:.:ii;;:,.........:tttt1tfffttttffft111tfffff\\n1tttffffftt1ttfffftt11tffttfttttt1t1,...........ii;;;::,,;i;;ii:.........:tttt1tfft11tfffffft1fLLfLf\\ntftttffttttt11tftt1tttt1ttttttttt11i,..........,1i;;::,.:i;;;;i:.........,1t1t11ttttttttfftt111fffLf\\ntfftttttttffttt11tttffttt1tttffft11i,..........,ii;:::,.,:;;iii:..........it111111tfft1ttt11tt1tffft\\nttttttttttttttt11tttttttt1tfffffftti,...........:::::,....:;;ii:..........:tt111ttfffftttttffftttttt\\ntfffttttfffffft11ttttttttttfffffft1i,...........:::::,.....,:;;:.... ......,1t111ttttffttttttttffttf\\ntfffttttfffffft11tftttffttttfffft111:...........:::::,........,..,..........,1111tffffffttfffffffttf\\ntfffttttfffffft1tttttttftttttttttt11:...........::,:,........ ...:;,.........:111tffffLfttfffttffttf\\ntffftttttttfft11ttttttttttffttttttti,...........:::,,.............,...........,i1tffffLfttfffttffttf\\ntttttttttttttt111tttttttttffftttfft;,:;:........:::,.............. ...........:11tfffffftttffttffttt\\ntttttttttttttt11ttttttttttfftttttftii1i;:.......:::,.......... ..............:t111tttttt11tttttffttt\\nttttt1tttttttt11tfttttfftttttffttt1ii;ii;,......::,,........................:1111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfffffffttttfffft11i;;ii;,......:,,,..........:........ .;t1111ttttttt111tttttft1t\\n1tttt1tttttttt11tttttttttttttttttt11;:;i:,,.....:,.................. .;i;;1tt1111tttt1t1111ttttttt1t\\n111111tttttttt111t111ttttttttttttt11i:,,:1;....,::....................:1ttttt11111111111111111111111\\n111111111tt1111111111tttttttttttttt11i;;1t:....:::::...................;tttttttt11111111111111111111\\n1111111111111111111111ttttttttttttt111ttt1,,,.,:::::,..................,1ttttttt11111111111111111111\\n111111111111111111111111tttttttttt1111111i,::.,;::;:,...................;ttttttttt111111111111111111\\n1111111111111111111111111ttttttt11111111t;.,,.,;;;;;,...................,1ttttttt11t1111111tttt11111\\n111111111111111111111111111111111111111t1:..,,:;;;;;:,...................;ttttttt111t11111ttttt11111\\n111111111111111111111111111111111111111ti,,,::;;;;;;;:,..................,1tttttttt1tttt11tttttt1111\\n111111111111111111111111111111111111111t;,,::,;;;ii;;::,..................it1tttttttttttttttttt11111\\n\",\n \"ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt111111tttt1111111ttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftfffffffffttttt111tt11111ttffffftttt1111111111111111tttttfftttttttt1111111tt\\nttftttttttttttttffffLffttfffffffLLLftttttttttt11ttt1iiii;i11tttt111111ttttttfffftffffttttttt111111t1\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1ttt;:,,,,,,,:itttt11111tfftfffffftttfffffttt1111t1ttt\\nttttttttttttffffttffftffffffffffttfftttttt1tttt11i:,,,,,,,,,:i111t1111111tffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1;::;;;;;;;;;,;t111111tt111tttffffftttftt1tt1111ttttt\\nttttttttffLLLLLLLffttfLLffttfffftfLLtttttffffff1,:iiii111111;:tt11111tft11111ttffffttt11tffft11ttttt\\ntttttttfffLLLLLLLLLftffftttffLffftffttttfffffffi:;;;;;iiiii1;;ttt1111ttt1tttt11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLLftfftttttfffffff1;;;;;;;ii;;ii1ttt11111111ttftttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLffffftfLftffffLLLftttttfffff1iiiiii;;iiii1itttt11111ttt1ttt11tttt11ttfffffLLfLfttt\\ntffLLffffLLLLLLLLffffLLftffLLLffLLLftttttttffftiii;;;;;ii1ii1tft111111ffft11t11tt1tttttffffLLLLLffft\\ntfffffttftfLLLffttttfffffttLLLLfLLLftttft111tt111i;;;;iiiii1tt111t1111tffttfftt11tfft1tffLLLLLLLLfff\\nttttfttfffffLftttttttttttttfLLLffLLftttt1tttt11tti;;;iiiii111t11111111tffttffftttttttt1ttfLLLfffffff\\nttffffffffftttfffffffffttfftfLLfffLftttttffft11t1i;;;;;iii11ttttt11111ttt1tffttt11ttttttttfLfftftttt\\nttffffffffftttfffffffffttffftffftftttttffft111t11i;;;;iii1ii11tttt1111tt11ffttfftttfffffLfttttffffff\\nttffffffffttttffffffffttttttttttffftttttttt11111iii;;iiii1;,:;1tttt11111t11t1tfft1ttffffLLftttfLLLLL\\ntttffffffffttffffffffttttttttt1tffftttt11i;:,:i;;i;;;;;i11,,..,,:;i111tttt1111tt11ttffffLfftttffLLLf\\nttttttttfffttfffttttttttffttt11ttff1ii;:,....,;::;i;;i11ti,,.......,:;ittt111ttt1111ttffffffttfLLLLf\\ntfttttttttttttttttttttfffftttt11tff;,,........;;;;iii1tti,,,,:;;::,....,i11111ttttt11111ttfftffffftt\\ntfttfffffttttttfffft1tffffttfft1ttt:..........:;;;;;;;i;...,;i;iii:.....,i1tt1ttffff11ttt1t1ttttttft\\nttttfffffftttfffffft11tffftffftttti,..........,:;;;;;;;,...,;;iiii,......;tttt1tffftttttftt111tfffff\\n1tttffffftt1ttfffftt111ffttft11tt1;,...........;i;;;;;:,.....:;iii,......;tttt1tfft11tffffftt1fLLfLf\\ntttttffttttt11tftt1tttt1tttt1tttti,............;1;::;;,......,;iii,......;t11t11ttttttttfftt111fffLf\\ntfftttttttffttt111ttfftt111ttfffti.............;i;::::,.......,;;;,......;ttt11111tfft1tttt1tt1tffft\\nttttttttttttttt11ttttttt11tffffffi,............,::;:::,..........,.......:ttt1111tfffftt1tttfftttttt\\ntfffttttfffffft11tttttttttttffffti,............,:::::,..............,....,ittt11ttttttft1ttttttffttf\\ntfffttttfffffft11tffttff11t1tfff1;...... ....,.,:::::,.....................;11111tffffffttfffffffttf\\ntfffttttfffffft1tttttttfttttttti:,......:iiii;,,:::,:.......................,;111tffffffttfffttffttf\\ntffftttttttfft11ttftttttttfftti,,::,.,:;1i;;;;.,::::,.........................,i1tffffLfttfffttffttf\\ntttttttttttttt111ttttttt1ttfft1:::,,,:,:;;;;i:.,:::,,..........................;1tfffffftttffttffttt\\nttttt1tttttttt11ttttttttttfttt1;,...,...:;;;:, ,:::,..........................;11ttttttt11ttttttfttt\\nttttt1tttttttt11tfttttfftttttfti,..,....,,,....,:::,.........................:111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfffffffttttffft1;::::,,.......,:,:,.................. .:1111ttttttt111tttttfttt\\n1tttt1tttttttt11ttttttttttttttttttt11111:......,:,,,..................,::,:1tt1111ttt1t1111ttttttt1t\\n111111tttttttt111t1111tttttttttttt111111:......,,.....................,1tttttt1111111111111111111111\\n1111111111t11111111111ttttttttttttt11111:......,:,,....................:1t1ttttt11111111111111111111\\n1111111111111111111111ttttttttttttt1111t:......,;;::....................:1ttttttt1111111111111111111\\n111111111111111111111111ttttttttt1111111:......,::::,...................,itttttt11111111111111111111\\n111111111111111111111111111tttt111111111:......,;;::,....................:1ttttttt1tt11111ttttt11111\\n1111111111111111111111111111111111111111:......:;;;::,...................,ittttttt11t11111ttttt11111\\n11111111111111111111111111111111111111t1:......:;i;;::,...................:11tttttt1tttt11ttttt11111\\n1111111111111111111111111111111111111111,......:;;;;;::,..................,1tttttttttttttttttttt1111\\n\",\n \"ttftfffttttttttttfffffLftfftttttttttt111tttt1111111tttt111111ttttt11111tttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftffffffffftttttt111111111ttfffftt1tt1111111111111111ttttttftttttttt1111111tt\\nttftttttttttttttffffLftttfffffffLLLft1tttttft111tfftttfttttttttt111111ttttttfffftffffttttttt11111tt1\\nttttttttttttttttfffLfttffffffLLffffttttttttttt1ttti;;;;::;i1tttt111111tffffffffftttfffffttt11111ttt1\\ntttttttttttfffffttffftffffffffffttfftttttt1ttt111i,,,,,,,,,;11111t1111111tffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1i::,,,,,,,,,:1t11t111tt1111ttffffftttftt1tt1111ttttt\\nttttttttffLLLLLLLffttfLLLfttfLfftfLLtttttfffffti:;;iiiiiiii::1tt11111tftt1111ttffffttt11tffft11ttttt\\ntttttttfffLLLLLLLLLftffftttffLffftfftttttffffft::;;iii1i111i:1ttt1111ttt1tttt11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftfftttttfffffft;;;;;;;iiiiii;tttt11111111ttftttttttt11tffffffffffttt\\ntttfftfffLLLLLLLLLfttfftfLfffffffLLftttttfffft1ii;;;;;iiiiiitfttt11111ttt1ttt11tttt11ttfffffLLfLfttt\\nttfLLfffffLLLLLLLfftfLLftfffLLffLLLftttttttfftiii;;i;;ii111itfft111111tfft11t11tt1tttttfffLLLLLLLfff\\ntfffffttftfLLLffttttffffftfLLLLfLLLftttft111tt1iii;;;;iiiii1tt111tt111tffttfftt11tfftttffLLLLLLLLfff\\nttttfttffttffftttttttttttttfLLLffLLftttt1tttt11t1i;;;iiii1111t11111111tffttffftttttttt1ttfLLLfffffff\\nttfLffffffftttfffffffffttftttfLfffLftttttfffft11i;;;;iiii111tfttt11111ttt1fffttt1ttt1tttttfLLffftttt\\nttffffffffftttfffffffffttfftttfttttttttffft11111i;;;;;iii1tt11tttt1111t111ffttffttfffffLLfttttfLffff\\nttffffffffttttffffffffttttttttttffftt11ttt1111t1i;;;iii1i1itt11ttt111111t11t1ttft1ttffffLLftttfLLLLL\\ntttffffffffttfffffffftttttt1111tffftttt11i;::i1iii;;;iii1i,:;i11t11111tttt1111tt11ttffffLfftttffLLLf\\nttttttttfffttfffttttttttffttt11ttft1ii;:,....;i;;;ii;;i1t:,...,:;i1111tttt111ttt1111tttffffftfLLLLLf\\ntfttttttttttttttttttttfffftttt11t1:,,........ii:;;iii1tt1,,,......,,;i1tt11111ttttt11111ttfftffffftt\\ntfttfffffttttttfffft1tffffttfft11;,..........:;::;ii11t1:,,,...,,:,...,it11tt11tffffttttttt1ttttffft\\nttttfffffftttfffffft11tfffttfttt1,....,,......,:;;;;;;i,.......:iii;;,.,1t1ttt1tffftttttfftt11tfffff\\n1tttffffftt1ttfffft1111tfttft11ti,.............;i;;;;;:........:iiiii:..it11tt1tfftt1tfffffft1fLffLf\\ntttttffttttt11tttt1tttt1tttt1tt;,..............i1;;;;;,........,;iii;,..it111t11ttttttttfftt111fffLf\\ntfftttttttfftt1111ttfft11111tft:...............;i;;;;:,.........:;ii:..,ittt111111tfftttttt1tt1tffft\\nttttttttttttttt11ttttttt11ttff1,...............,::::::......... ,;ii:...itttt111ttffffft1tttfttttttt\\ntfffttttffftttt11ttttttt111tft;,........... ..,:;:::,...........,:;:...;ttttt11ttfffffttttttttffttf\\ntfffttttfffffft11ttttttf11111;:,..... .....,:::::::::...............,...:1ttt1111fffffffttfffffffttf\\ntfffttttfffffft11ttttttt11ti,,...........,:;i;;;:::::..................,.:tt11111tffffffttfffffffttf\\ntffftttttttfff111ttttttt111,.,,,,...,,..,;;;;;i;:,::,....................,;i1t111tffffLfttfffftffttt\\ntttttttttttttt111ttttttt11t:.......,....,:;;;;;:::,:,.......................:1t11tfffffftttffttffttt\\nttttt11ttttttt11tttttttt11t1,............,,,...,::::.........................:111ttttttt11ttttttfttt\\nttttt1tttttttt11ttttttfft1t1:,............ .. ,:::,........................,i111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfftttfftttttt1;::,,::.........,:,,,........................i1111ttttttt111tttttfttt\\n1ttt11tttttttt11tttttttttttttttttt111i.........,::,,................. . .;t11111ttt1tt111ttttttt1t\\n11t111tttt1tt111111111tttttttttttt111i,........,:,,...................,..,itttt111111111111111111111\\n1111111111111111111111tttttttttttt111i,....... ,:....................i111ttttttt11111111111111111111\\n1111111111111111111111ttttttttttt1111i,....... ,:,::,................,i1t11tttttt1t11111111111111111\\n111111111111111111111111tttttttt11111i,........,::;:,..................;1ttttttt11111111111111111111\\n1111111111111111111111111tttt11111111i........ ,,:::,..................,1ttttttttttt1111111tt1t11111\\n1111111111111111111111111111111111111i,........,,:::,...................it111ttttt11t11111ttttt11111\\n111111111111111111111111111111111111t1,........,,,:::,..................,1t1ttttttt1tttt11ttttt11111\\n11111111111111111111111111111111111111,........,,,;;::,..................i111ttttttttttttttttttt1111\\n\",\n \"ttftffftttttttffffffffLfttftttttttttt111tttt1111111tttt111111tttt1111111ttttttttttttttttttt11111111t\\nttfttttttttttttttftfLLLftffftffffftttttt111111111ttfffftt1tt1111111111111111ttftttftttttttt1111111tt\\nttftttttttttttttffffLftttfffffffLLLft11tttfft111tfffffffttt1ttttt11111ttttttfffftffffttttttt11111tt1\\nttttttttttttttttfffffttffffffLLffffttt1ttttttt1tt111ii11tft1ttttt11111tfftfffffftttfffffttt11111ttt1\\nttttttttttttffffttfffttfffffffffttffftttt111ttt1:,,,,,,,:i1111111t111111ttffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLLfttttttftt1;:,,,,,,,,,;1tt111t1111t111tttffffftttftt1ttt111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLfttttffft1i;;;;;;;;;;::1tttt11111ttt11111ttffffttt11tffft11ttttt\\ntttttttfffLLLLLLLLLftffftttffLLfftfftttttffffi:;iii111111i:ittttt1111ttt1tttt11tfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftfftttttfffff;:;;;;iiiiiii:ittttt11111111ttttttttttt11tffffffffffttt\\ntttffftffLLLLLLLLLfttfftfLftfffffLLftttttffff1i;;;;;ii;iiiittttft11111ttt1ttt1ttttt11ttfffffLLfLfttt\\nttfLLfffffLLLLLLLfftfLLftfffLfffLLLftttttttf1i1i;i;;iiii1i1tffft111111tfft11t11tt1tttttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft1111iii;;;;ii1i1i11tt111t1111tffttfftt11tfftttfffLLLLLLLfff\\ntttffttfftffLftttttttttttttfLLLffLLfttttttttt11i;;;;iiii11t11111111111tffttfffttttttt11ttfLLLfffffff\\nttfLffffffftttfffffffffttftttfLfffLftttttffft11i;;;iiiii1t11ttttt11111ttt1fffttt1tttttttttfLLftftttt\\nttffffffffftttfffffffffttffttfffttttttttfft1111i;;;;iii1111111tttt1111tt11ffttffttfffffLffttftffffff\\nttffffffffttttffffffffttttttttttffftt11tttt11t1ii;;;iii11tfft11ttt111111t11tttfft1ttffffLLfttffLLLLL\\ntttffffffffttfffffffftt1ttt1111fffft1tt11iiii1iiii;iiii1i:1tft11111111tttt111ttt11ttffffLfftttffLLLf\\nttttttttfffttfffttttt1ttfft11111tft11i;:,..,;ti;;;i;iii1;,,,:;i1111111tttt111ttt1111tffffffftfLLLLLf\\ntfttttttttttttttttttttfffftttt11i;::,,......iti::;i;iitt:,,....,:;i111ttt111t1ttttt11111ttfftffffftt\\ntfttfffffttttttfffftttffffttft11:...........;ii::;i11tti,,,,.......,:itt111tt1ttffff11ttt111ttttttft\\nttttfffffftttffftfft11tfffttftt;,............,:;;;;;11;,..............;1111ttt1tffftttttfftt1ttfffLf\\n1t1tffffft11ttfffft1111tfttft11:.............,:ii;;;;;,...............:11t11tt1tfft11tfffffft1ffffLf\\ntttttfftt1tt11tttt1ttt11t1111t;,..............:i1;;;;:,...............,111111t11ftttttttfftt11tfffLf\\ntfftttttttfftt1111tttft11111t1,...............:ii;;;;,............,,,.,1tttt11111ttfftttttt1tt1tffft\\nttttttttttttttt11ttttttt11ttfi................:;::;::,...........,;i;;:1tttttt11ttffffftttttfftttttf\\ntfffttttftttttt11ttttttt11ttfi................,;;:::,............,;iiii1tttttft1ttffftfttttttttftttf\\ntfffttttfffffft11ttttttt11111;........ .......:;:::,............:iiiii11ttftt11tfffffffttfffffffttf\\ntfffttttftffff111ttttttt11ti:,....... ,:::;;:,.,;:::,............:;;ii:i11tt1111tfffffffttfffffffttf\\ntffftttttfffft111ttttttt11i,.........,iii;;;,..,:::,.............::;;,.it1111tt11tffffffttfffftffttf\\ntttttttttttttt111ttttttt11,.,,,,..,,,:;;;;;;,..,:::,.............,::;..:i111ttt11tfffffftttffttffttt\\nttttt1tttttttt111ttttttt11;,,,...... .:;;;;:...,:,,,.....................:111tt11ttttttt11tttttffttt\\nttttt1tttttttt11tttttttt111,..........,,,,.....,:,,.......................:111111ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfft11i:,.....,.... .....,::,......................,1t11111ttttttt111tttttft1t\\n1tttt1tttttttt11ttttttttttttt1ii;;;:...........,:,,.....................,it111111ttttttt111ttttttt1t\\n11t1111tttttt111111111tt1tttttttt11:...........,:,,.............. .;t11111111111111111111111111\\n1111111111111111111111ttttttttttt11,.......... ,,................,:,,,:i1tttt1t111111111111111111111\\n1111111111111111111111tttttttttt11i,...........,,,,..............:1t11ttttttttttt1111111111111111111\\n111111111111111111111111tttttt1111;........... ,,:;,..............:11ttttttttttttt111111111111111111\\n11111111111111111111111111tttt1111;........... ,,:;:...............:111tttttttttt11t1111111tttt11111\\n1111111111111111111111111111111111;....,,......,,,::................i1ttttttttttttt1t11111ttttt11111\\n1111111111111111111111111111111111;............:,,;:,...............;1tttttttttttttttttt11ttttt11111\\n1111111111111111111111111111111111:............,,:;;:...............,1t1tttttttttttttttttttttttt1111\\n\",\n \"ttftffftttttttfffffttfLfttftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttftffLLftffffffffttttttt111111111ttfffft1ttt1111111111111111ttttttftttttttt111111ttt\\nttftttttttttttttffffLftttfffffffLLLftt1tttttt111ttfffffftttttttt111111tttttffffftffffttttttt111tttt1\\nttttttttttttttttfffLfttffffffLLffffttt1tttttt11tffffffffffttttttt11111tffffffffftttfffffttt11111tttt\\nttttttttttttffffttfffttfffffffffttffftttt11111111i;i11ttt11tt1111t111111ttffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLLfttttttfti:::,,,,:;i1ttfttt11t111tt111tttffffftttftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLftttttft1;,,,,,,,,,,;tffffft11111tft11111ttffLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLfLftffttttfffti;:;;;;iii;::1fffffttt111ttt1tttt1ttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLfftfftttttfffi;;iiiii1111i:iffffftt11111111ttttttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttffi:;;;;iiiiiii:1ftttfftt1111ttt1ttt1ttttt111tffffffLfLfttt\\ntffLLfffffLLLLLLLfftfLLftftfLfffLLLLttttt1t1i;;;;;ii;iiii1ttffft111111tfft1tt11tt1tt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft11i1i;;;;i111iii111tt111t1111fffttfftt11tfftttfffLLLLLLLffL\\ntttffttfftffLftttttttttttttfLLLffLLftttt1tti1i;;;;ii1iii1tt11111111111tffttffftttttttttttfLLLLfffffL\\nttfLfffffffttffffffffffttftttfLfffLftttttfftt1;;;;iiii11ttt1ttftt11111tfttffftt111ttttttttfLLftftttt\\nttffffffffftttfffffffffttffttfftttttttttfft111i;;;iiii1t111t1ttttt1111tt11ffttffttfffffLLfttffffffff\\nttffffffffttttffffffffttttttttttfffttt1tft1111i;;;iiii111tfft11ttt111111t11tttfft1tfffffLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt1111tffft11t111111iiii;;iii111fffft11111111ttft111ttt11tfffffLfftttfLLLLf\\ntttttttttffttfffttttt1ttfft1t11ttfftttt1iiii1i;;;iii1i1i,;i1ttt1111111tttt111tttt111tffffffftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tff11i;:,,,:11i;;iii;it;....,:;i111111ttt111t1ttftt11111ttfftffffftt\\ntfttfffffttttttfffftttffffttfft1ii;:,,.....:11;:;;;;1tt;,,,.....,,;i11tt111tt1ttfffftttttt11ttttttft\\nttttfffffftttffftfft11tfffttft1;,..........:1ii;;ii1tti,,,..........,it1111ttt1tfffttttffftt1ttfffLf\\n1tttffffftt1ttfffft1111tfttft1i,............,:;ii;;i1i,..............:111111tt1tfft11tfffffft1ffffLf\\ntftttffttttt11tttt1ttt11t1111t;..............,;1i;;;;,...............,1111111t11ftttttttfftt11tfffLf\\ntfftttttttfftt1111ttttt11111tt:............. ,;ii;;;:,...............,i111tt11111tffftttttt1tttttfft\\nttttttttttttttt11ttttttt11ttft,...............;;;;;:,.................ittttttt11ttffffftttttfffttttt\\ntfffftttftttttt11ttttttt11ttf1,...............:;;;::,.......,,,.......;tttttfftttfffftfttttttttffttf\\ntfffttttfffffft11ttttttt1111t1,...............:;;;::........,;i;:,....;t1ttfttt1tfffffffttfffffffttf\\ntfffttttftffft111ttttttt11t111,...............,::::,........:iiiii:...;t11tt1111tffffLffttfffffffttf\\ntffft1tttfffft111ttttttt11ttt1,..... ..........::::,.......,;iiii;,...it11111tt1tfffLfLfttfffftffttf\\ntttttttttttttt111ttttttt11tt1:... .,..........,:::.........:;;i;,...,1t1t11tft11tfffffftttffttffttt\\nttttt1tttttttt111ttttttt1tt1:,...:;ii:.........,::,.........,:;;:.....,it1111tt11ttttttt11tttttffttt\\nttttt1tttttttt11ttttttttt1t;::,;iiii;,.........,:,,...........,,,......,;11111111ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfft1ti:,,;;;:;;,.........,:,,.......... ..........:tttt1111ttttttt111tttttfttt\\n11ttt1tttttttt11ttttttttttt1,.,::::;;:.........,:,,...............,....;ttttt1111ttttttt111ttttttt1t\\n11tt11tttt1tt111111111111ttti:,,,::;:..........,:,,............ ......;ttttt11111111111111111111t111\\n1111111111111111111111tttttttt1:,,,............,:,.............,. .,;11tttttt1111111111111111111111\\n1111111111111111111111tttttttttt1:.............,,............ .11ii1ttttttt1111111111111111111111111\\n111111111111111111111111tttttt111,.............,::,,...........ittttttttttttt11111111111111111111111\\n11111111111111111111111111111111;..............,;;;:,..........:11tttttttttttttt11111111111111t11111\\n11111111111111111111111111111111;..............,;;;:,...........:11tttttttttttttttt1111111ttttt11111\\n11111111111111111111111111111111:..............,;;;;:...........:1ttttttttttttttttttttttt1ttttt11111\\n11111111111111111111111111111111:..............,;i;::,..........,1tttttttttttttttttttttttttttttt1111\\n\",\n \"ttftffftttttttfffffttfffttftttttttttt111tttt1111111ttttt11111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttftffLLftffffffffttttttt111111111ttfffffttttt111111111111111ttffttftttttttt11111tttt\\ntfttttttttttttttffffLffttfffffffLLLft11tttttt111tfffffffttttttttt11111ttttfffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffLfttffffffLLffffttt1ttttttt1ttfffffffffttttttt1111ttfftffffLftttfffffttt11111tttt\\nttttttttttttffffttfffttffffffffftttfttttt111ttt1ttffffffttttt1111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttfLLLfftttttffLftttttttt11ii11fffft1ttfftt11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLfttttt1i:;:,,::;i1tttffffftt11111tft11111ttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttffLffftffttttfti:,,,,,,,,,:;tfffffttttt111tftttttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftffttttttti:::::;;;;;,,1ffttffttt11111111ttttttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLfftfftffftffffLLLfttttti;iiiii11111;:1ttfffffftt1111ttt1ttt1tftttt11tfffffLLfLfttt\\nttfLLffffLLLLLLLLfftfLLftttfffffLLLLttttt;;i;;iiiiii1;:i11tfffft111111ffft1tt11tt1tt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft1ii;;;ii;;iii;tt11ttt111t1111tffttfftt11tfftttffLLLLLLLLffL\\ntttffttfftffLftttttttttttttfLLLffLLftttt11ti;;;iiii1iii1ttt1ttt1111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttftttfLfffLfttttt11i;;;iii1iii1tttt1tfftt11111tfttffftt11tttttttttfLLffftttt\\nttffffffffftttfffffffffttfftttfftffttttfft11;;;iiiii11tt111ttttttt1111tt1tffttffttfffffLLfttftfLffff\\nttffffffffttttffffffffttttttttttfffttt1tft11i;iii11i11111tfft11ttt11111tt11tttfft1tffffLLLfttfLLLLLL\\nttfffffffffttfffffffftt1ttt111tfffftttt11111i;i;iiii111ttfffft11111111tttt11tttt11tffffLLfftttfLLLLf\\nttttttttfffttfffttttt1ttfftt111tfffttt111111;;i;;iii11i1ttffft11111111tttt111tttt11ttfffffLftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tffttt1t1ii1;;i;;iiii1;,::i11tt1tt1111ttt11tt1tfftt11111ttfftfLffftt\\ntfttfffffttttttfffft1tffffttfft11tft11i::,,1ii;:;ii;it:,,...,,:;i11111tt111tt1ttfffftttttt11tttttfft\\nttttfffffftttffftfft11tfffttfttttt1i:,....,it1i;;;;i1t;,,,,.......,;111t111ttt1tfffttttffftt11tffLLf\\n1tttffffftt1ttfffft111ttfttft11i;:,........i1tt1ii1tt1:,,...........:1111111tt1tfftt1tfffffft1ffffLf\\ntftttffttttt11tttt1ttt11t1111t;,...........,;;;11;;;;:..............,1t111111t1tftttttttfftt11tfffLf\\ntfftttttttfftt1111ttttt11111tt:..............:;ii;;:,................it111tt11111tffftttttt1tttttfft\\nttttttttttttttt11ttttttt11ttf1,..............,;;;;::,................it1tttttt1ttfffffftttttfffttttt\\ntfffttttffttttt11ttttttt11ttfi................;;;:::,,:;:,...........;tttttttftttffffffttttttttffttf\\ntfffttttfffffft11ttttttt1111ti................:;:::,.:;iii;,.........:111ttfftt1tfffffffttfffffffttf\\ntfffttttftffff111ttttttt11t11;................,;:::,.;iiiii:.........:tt11ttt111tfffLfLfttfffffffttf\\ntffft1tttfffft111ttttttt1tttt;................,::::,.:;;ii;,.........;ttt1111tt1tfffLLLfttfffftffttf\\ntttttttttttttt111tttt1tt11ttti.................:::,...,;;i;,.........itttt11ttt11ffffffftttfftfffttt\\ntttttttttttttt111ttttttt11tt1;.................:::,....,:;:,.........,1tt1111tt11ttttttt11tttttffttt\\nttttt1tttttttt11ttttttttt1t11:.................:::,.... ..............:1111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfft11ti;,................,::,.........,......... :ttttt1111ttttttt111tttttfttt\\n11tt11tttttttt11tttttttt1tt1iiii:..............::,,...................:1tttt111111tttttt111ttttttt1t\\n11t1111tttttt1111111111t111iiiiii:.............,:,,,.................:1ttttt11111111111111111111t111\\n11111111111111111111111t11i;;iiii;.............,:,,,........... .,;ttttttttt1111111111111111111111\\n1111111111111111111111tt1t1i;;ii;,.............,,........... :i;;i1tttttttt1111111111111111111111111\\n1111111111111111111111111ttti:,,...............,,,.......... :ttttttttttttttt1t111111111111111111111\\n11111111111111111111111111111;::...............:;;::,........,i11ttttttttttttttt1111111111111tt11111\\n111111111111111111111111111111t;...............:ii;;:,........;t1tttttttttttttttt1t1111111ttttt11111\\n1111111111111111111111111111111:...............:;i;:::........:tttttttttttttttttttt1ttttt1ttttt11111\\n1111111111111111111111111111111:............. ,;ii;;;:,..,,...:ttttttttttttttttttttttttttttttttt1111\\n\",\n \"ttfttfftttttttffffftfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttttffLLttffffffftttttt1t111111111tfffffftttt1111111111111111ttffttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt111ttttt\\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt11111tfffffffLftttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttffttttt1111tt1ttffffffttttt1111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffttttffffftttffftt11t111tt111ttfffLLftttftt1tt111tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLftttttt11i;;;;i1tftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttffLLfftffttttti:::,,,,::;i1tffffffffttt111tft1tttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftfftttt11;,,,,,,,:,,,;tffffffffttt1111t11ttttttttttt1ttffffffLfffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttt1i;;;;iiiii:,:1tttfffffftt1111ttt1ttt1tfttt111tfffffLLfLfttt\\nttfLfffffLLLLLLLLfftfLLftttfLfffLLLLttt1i1iiiii1111i::1111ttffft111111ffft1tt11tt1tt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt11;;;iiiiiii:;ttt111tt111tt111tffttfftt11tfftttffLLLLLLLLffL\\ntttffttffttfLftttttttttttttfLLLffLLftttt1i;;;iii;iii;ittfft11tt1111111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttfffffffffttfttfLLfffLfttt111;;;i111111iitfttt1tfftt11111tfttfffttt1tttttttttfLLftfttft\\nttffffffffftttfffffffffttffttffftfftttttt1i;;iiiii1i1tft11tttttttt1111tt1tffttffttfffffLLfttftffffff\\nttffffffffftttffffffffttttttttttfffttt1ttti;;;i111iitt111tfft11ttt111111t1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111tfffftttt111ii;iii;ii11111tfffft11111111tfft11tttt11tffffLLfftttfLLLLL\\nttttttttfffttfffttttt1ttfft1111tffftttt1111;;;i;;;i111ttttffftt1111111tttt111tttt11ttfffffLftfLLLLLf\\ntfttttttttttttttttt1ttfffftttt11tfft111tt1i;;;i;;i1i1;i11tffftt11t1111ttt11tt1tfftt11111ttfftfLffftt\\ntfttffffftt11ttfffftttffffttfft11tft11ii;ii;;;;:;iii1,.,,,:;iii1ttt111tt111tt1ttfffftttttt11ttttfftt\\nttttfffffftttffftfft11tfffttftttttt1;:,..:11;;i;;;;11:,,,.....,,:i1111tt111ttt1tffftttttfftt1ttffLLf\\ntt1tffffftt1ttfffft1111tfttft1111i:,.....,i11iiiii1tt:.,..........:111111t11tt1tffft1tfffffft1fLffLf\\ntftttffttttt11tttt1ttt11t11111;:,.........;i11i1111t;..............;t11111111t1tfttttttfffftt1tfffLf\\ntfftttttttfftt1111ttfft111111:.............,::;ii;;:...............:111111ttt111ttffftttfft1tttttfft\\nttttttttttttttt11ttttttt11tt1,..............::;;;;;,...............,1111tttttt11tffLffftttttfftttttt\\ntfffftttffttttt11ttttttt11tfi,..............,::;;::,,...............i111ttttfftttffffffttttttttffttf\\ntfffttttfffffft11ttttttt111ti................::::::,:;;::,..........it111ttffttttfffLfLfttfffffffttf\\ntfffttttftffff111ttttttt1tt1;................,;::::.:iiiii,.........;11111ttt11ttfffLfLfttfffffffttf\\ntffft1tttfffft111ttttttt11tti,................::::,.:ii;ii:.........;tttt1111ttttfffLLLfttfffftffttf\\ntttttttttttttt111ttttttt1ttf1.................,:::,.,:;iii:.. ......:ttttt11tft11tfffffftttfftfffttt\\ntttttttttttttt111ttttttt1ttt;::...............,:::,. .:;ii:..........;ttt1111tt11tttttft11tttttffttt\\nttttt1tttttttt11ttttttttt1t111i;,..............:::,....,::,...........;1111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfftt1iiiiii:.............:::,.... ............. :ttttt1111ttttttt111ttttffttt\\nt1ttt1tttttttt111ttttttttt1i;iiii;,............,:,,,................. ,1tttt111111tttttt111ttttttt1t\\n11t1111tt1ttt11111111111111i;iii1i,............,::,,.................:1tttt11111111111111111111tt111\\n11111111111111111111111111t1;;;;;,.............,:,,,.......... .:1tttttt111111111111111111111111\\n1111111111111111111111111t11;,.................,:,,..........,;:::;1ttttttt1111111111111111111111111\\n11111111111111111111111111111:..,..............,,............:ttttttttttttttttt111111111111111111111\\n111111111111111111111111111111ii;..............,::,...........i111ttttttttttt11111t11111111111111111\\n111111111111111111111111111111t;...............,;ii;::,.......:1ttttttttttttt11t1tt1111111ttttt11111\\n111111111111111111111111111111i,...............:;ii;;;:,......,1ttttttttttttttttttt111111tttttt11111\\n11111111111111111111111111111ti,...............:;ii;;;;:,..:..,1ttttttttttttttttttttttttttttttt11111\\n\",\n \"ttfttfffttttttffffttfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLttffffffffftttttt111111111tfffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt1111ttfffffffLftttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttffftttt1111tt1ttffffffttttt1111t111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1ttfffftttffftt11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLftttttfttttttttttftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttffLffftffttttt1ii::::;111tttffffffffttt111tft1tttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLfftffttttt1:,,,,,,,,:;ittffffffffttt1111t11ttttttttttt1ttffffffffffttt\\ntttffttffLLLLLLLLLftffftfLftffffLLLftttti::,::::::,,,;ttttfffffftt1111tft1ttt1tffttt11tfffffLLfLfttt\\nttfLffffffLLLLLLLfftfLLftttfLfffLLLfftt11iiiii111i;,,;t111tfffft111111ffft1tt11ttttt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt1iiiii1111i:,iftt111ttt11tt111tffttfftt11tfftttffLLLLLLLLffL\\nttttftttttffLftttttttttttttfLLLffLLftttti;;;ii;iiii::1ttttt11tt1111111tfftfffftttttttttttfLLLLffffff\\nttfLfffffffttffffffffffttfttfLLfffLfttt1i;;i1i;iiii:;tftttt1tfftt11111tfttfffttt1tttttttttfLLftftttt\\nttffffffffftttffffffffftfffttffftffttttti;;iii111i1iitft11tttttttt1111tt11ffttffttfffffLLfttftfffffL\\nttffffffffftttffffffffttttttttttfffttttti;;;ii1111ii1t111tfft11ttt111111t11tttfft1tfffffLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111tfffftttt1i;;;iiiiii11111ttfffft11111111tfftt1tttt11tfffffLfftttfLLLLf\\nttttttttfffttfffttttt1ttfft1111ttffttt111i;;ii;;;itt11ttttfffft1111111tttt111tttt11tttfffffftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tfft1t1t1i;;;ii;;it111ttttffftt11t1111ttt111t1tfftt11111ttfftfLffftt\\ntfttffffftt11ttfffftttffffttfft1ttft11ii1;;;;i;:;i1;;i11tttft111tt1111tt111tt1tffffftttttt11ttttfftt\\nttttfffffftttffftfft11tfffttftttt1i;:,,:1i;;;;i;;;1;.,,,;;i11111111111tt111ttt1tffftttttfftt1ttffLLf\\n1tttffffftt1ttfffft111tffttft1ii:,.....,11iiiiiii1t:,,,.....,:;i111111111t11tt1tffft1tfffffft1fLffLf\\ntftttffttttt11tttt1ttt11t11i;:,........,i1tt1ii11tt:,,,,........:t11111111111t1tfftttttfffftt1tfffLf\\ntfftttttttfftt1111ttfftt11i,............::;;iiiii1;,,............it1111111ttt111ttffftttfft1tttttfft\\nttttttttttttttt11ttttttt11;...............:;;;;:;;...............:111111tttttttttffLffftttttfftttttt\\ntfffftttffttttt11ttttttt11:...............,;;;;;;:,..............,111111ttttfftttffffffttttttttffttf\\ntfffttttfffffft11ttttttt11,...............,:;;;;:,...............,1111111ttffttttfffLfLfttfffffffttf\\ntfffttttftffff111ttttttt11:...... ........:;;;;:,...............,11111111ttt1tttfffLfLfttfffffffttf\\ntffft1tttfffft111ttttttt11:.......:;;;:....,;;::::.......,::,....,1tt11tt1111tt1tfffLLLfttfffftffttf\\ntttttttttttttt111ttttttt11:.....:;;;;;:.....:;:::,.......,:iii;,.,1t1t11tt11tft1tffffffftttfftfffttt\\ntttttttttttttt111ttttttt1i,.....:;:;;;:.....,::::,........;;iii;..;t1111t1111tt11tttttftt1tttttffttt\\nttttt1tttttttt11tttttttt1i,.....:::;;;,......::::,.......,;;ii;:..,;1t11111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttttti....,,,,:;;,.......,:::,,.......,;;;;,....,it11tttt1111ttttttt111ttttffttt\\n11tt11tttttttt111ttttttt1:,,.,,,..,,,.........::::,........,:;,..... ,1tttttt11111ttttt1111ttttttt1t\\n1111111tttttt11111111111i,,..,,,.... .........::::,..................itttt111111111111111111111tt111\\n1111111111111111111111111,...,,...............,::,,,...........,,...;tttttt1111111111111111111111111\\n11111111111111111111111111,..... .............,::,,,......... . .:1tttttt1111111111111111111111111\\n1111111111111111111111111ti,,,.,,..............::,,..........,,,::i1tttttttttt1111111111111111111111\\n11111111111111111111111111111i11;..............:,............,1tttttttttttttt11111111111111111111111\\n1111111111111111111111111111111i...............:;:::::,.......;tttttttttttttt11t1ttt111111ttttt11111\\n1111111111111111111111111111111:...............:iiii;;::,......ittttttttttttttttttttt1111tttttt11111\\n1111111111111111111111111111111,...............:iiiii;;:,......,1tttttttttttttttttttttttttttttt11111\\n\",\n \"tttttfftttttttffffftfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLftfffffffffttt1tt111111111tfffffftttt1111111111111111ttftttftttttttt11111tttt\\nttttttttttttttttfffffftttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttfftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1tffffftttffftt11t111tt111ttfffLLffttfft1tt111tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffttttftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttfLLffftfftttttftttttttffttttffffffffftt111tftttttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftffttttttiii;::::i1ttttffffffffftt1111t11ttttttttttttttffffffffffttt\\ntttffttffLLLLLLLLLftffftfLfttfffLLLfttt11:,,,,,,,:::itttttfffffft11111tft1ttt1tffttt11tfffffLLfLfttt\\ntffLffffffLLLLLLLfftfLLftttfLfffLLLLfttt1i::::,,::,,,itt11tfffft111111ffft1tt11tt1tt1ttffLLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttttiiiiii1i;:,,:ttt111ttt11tt111tffttfftt1ttfftttffLLLLLLLLffL\\nttttftttttffLftttttttttttttfLLLffLLftttti;iiii111i;:,iftftt11ttt11111tffftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttfttfLLfffLfttt1;;;ii;iiii;::1ffttt1tffft11111ffttfffttt11ttttttttfLfftftttt\\nttffffffffftttffffffffftfffttffftfftttt1;;i1i;;iii;:itft11tttttfttt111tt1tffttffttfffffLLftfftfffffL\\nttffffffffftttffffffffttttttttttffftttt1;;iiii111iii1t111tfft1tttt111111t1ttttfftttfffffLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111ttffftttti;;iiiiiiiii1111ttfffft11111111tffttttttt11tfffffLfftttfLLLLL\\nttttttttfffttfffttttt1ttfft1111ttfftttt1;;;iiii;;itt11tffffffft1111111tttt111tftt11tttfffffftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tfftttt1i;;;;ii;;it1111tftfffft11t1111ttt111t1tfftt11111ttfftfLffftt\\ntfttfffffttt1ttfffftttffftttfft11tft111i;;;;;ii;;i111111tttft111tt1111ttt11tt1tffffftttttt11ttttffft\\nttttfffffftttffftfft11tfffttfttt11i;;:ii;;;;iiiii1;11tt111t11111tt1111tt111tft1tffffttfffftt11tffLLf\\n1tttffffft11ttfffft1111tfttftii;:,....;1i;;;;ii111,,:;i1tt11tt11111111111t11tt1tffft1tfffffft1fLffLf\\ntftttffttttt11ttt11ttt1111i;:,.......,i1tiiii;;11i,,,..,:;i1t1t111t1111111111t1tfftttttfffftt1tfffLf\\ntfftttttttffttt111ttttt1i:...........,ii111iii11i:.,,......,:;1t111111111tttt111ttfLftttfftttttttfft\\nttttttttttttttt11tttt11t;..............,::;;i1ti:,............,1t1111111tttffttttffLfffttttffffttttt\\ntfffttttfftfttt11tttttt1,...............:;:;;;;;:..............;tt111111tttffftttffffffftttttttffttf\\ntfffttttfffffft11tttttt1................,;;;;;;;:..............:t11111111ttffttttffLLfLfttfffffffttf\\ntfffttttfttftt111tttttti............... .:;;;;;:,..............:1111111111tttttttffLLfLfttfffffffttf\\ntffft1ttttttft111tttttt;............. .:;;;;;;:::..............:111tt11tt111ttt1tfffLLLfttfffftffttf\\ntttttttttttttt111ttttt1,..............:;i;;i;::::..............:1ttt1111tt11tff1tffffffftttfftfffttt\\nttttttttttt1tt111ttttt;..............:;;;;;i:::::..............;1111111111111tt11tttttftt1tttttffttt\\nttttt1tttttttt11tttttt:..............:;;;::;:::::..............;t1111111111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttt1,........... .,,:,...,:::::..............,11i;;i111tttt1111ttttttt111ttttffttt\\n11tt11ttttttt1111tttt;............,..... ...,::::...............:i;:;;i1ttttt11111tttttt111ttttttt1t\\n11111111t1tt111111111,............,.........,::::,..............,:::;ii1tt111111111111111111111tt111\\n111111111111111111111,............ .........,,,::,..............::::;i11tt11111111111111111111111111\\n1111111111111111111111:....... .............,,:,,..............,::::i111t11111111111111111111111111\\n11111111111111111111111:....,,,,.............,:::,,..................,1t1111111111111111111111111111\\n111111111111111111111111iiii11t; .............,:,..,........ ..:1tttttt11111111111111111111111\\n111111111111111111111111111111t:...............:,,,:,,......,,,,,:;;1tttttttt1t111tt1111111tttt11111\\n111111111111111111111111111111t: .............::;ii;::,.....,i111ttttttttttttttt11ttt111111tttt11111\\n111111111111111111111111111111t:..............:;;iiii;:,.....,i1ttttttttttttttttttttttttttttttt11111\\n\",\n \"tttttfttttttttffffffffffffftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLftfffffffffttt1tt111111t11tfffffftttt1111111111111111ttftttftttttttt111111ttt\\nttttttttttttttttffffLftttfffffffLLLfttttttttt111tfffffffftttttttt11111tttttffffftffLfttttttt11111ttt\\nttttttttttttttttfffffttffffffLLffffttt1ttttttt1tffffffffffttttttt11111tfffffffLffttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttfftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1ttfffffttffftt11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffttttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLffftfftttttfftffffffftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftfftttttt1iii::;i1ttttfffffffffftt1111t11ttttttttttttttffffffffffttt\\nttttfttfLLLLLLLLLLfftfftfLfttfffLLLfttt11:,::,,,,,:;1tttttfffffftt1111tft1ttt1tffttt11tfffffLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLLffLLLffttt1;:,,,,,,,,,;ttt11tfffft111111ffft1tt11ttttt1ttffLLLLLLLLfff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt1iiiiiiii;:,,iftt111ttt11tt111tffttfftt11tfftttffLLLLLLLLffL\\nttttftttttffLftttttttttttttfLLLffLLfttt1i;iii1111i:,:1ftfft11ttt111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttfLfffLfttt1;;;i;iii1i:,;tffttt1tffft11111tfttfffttt11ttttttttfLLftfttft\\nttffffffffftttffffffffftffftttfffffttt11;;;ii;;iii::1fft11tttttfttt111tt1tffttffttfffffLLffffffffffL\\nttffffffffftttffffffffttttttttttfffttt1i;;iiiii11i;itt111tfft1tttt111111t1ttttfftttffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111ttfffttt1i;;iiiiiiiii1111ttfffft11t11111tffttttttt11ttffffLfftttfLLLLL\\nttttttttfffttfffttttt1ttfft1111ttffttt1i;;;iiii;;;1t11tffffffft1111111ttttt1ttfft11ttffffLfftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tfftt111;;iiiii;;;1111ttftfffft11t1111tttt1tt1tffttt1111ttfftfLffftt\\ntfttfffffttt1ttftfftttffftttfft11tft1i1i;;;;iii;;;111111tttft111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffftttt11tfftttfttt11i;;;1;;;;;iiii;i1t11t111t11111tt1111tt111tft1fffffttfffftt11tffLLf\\n1t1tffffft11ttffttt1111tftttti;:,,...:1i;;;;iiii1i:;i1ttt111tt11111111111t11tt1tffft1tffffffttfLffLf\\ntftttfftt11t11ttt11ttt111i;:,,.......:11ii;;ii;11i,.,,:;11tt11tt11t1111111111t1tffttttffffftt1tfffLf\\ntffttttttttftt1111ttttt1:............:1111iiii1ti;,,....,,;i1tttt11111111tttt111ttfLffttfftttttttfft\\nttttttttttttttt111ttt1t;...............,:;;i1tt1;,..........,itttt111111tttttttttffLfffttttffffttttf\\ntfffttttfftfttt11ttttt1,................:::::;i;:,...........,1ttt111111ttttfftttffffffftttttttffttf\\ntffft1ttffffff111ttttti.................,;;;;;;;:,...........,1t111111111ttffttttffLLfLfttfffffffttf\\ntffft1ttfttttt111ttttti................,,;;;;;;::,............it1111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttt;.............:;iii;;:;;:::,............it1111111tt111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111tttti,............,;;iiii::;::::,...........,1ttttt111ttt11tft1tfffffLftttfftfffttt\\nttttt1tttt11tt111ttt1:.............:;;;iii;::::::............,1tttt1111111111tt1tttfttftt1tttttffttt\\nttttt1tttttttt11tttti..............,;;;;:,,:::,,:............:tt11t11111111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11tttt:............. ,::,. .::,,,:........... :t1111111t111ttt1111ttttttt111ttttffttt\\n11tt11tttttt111111ti.......................,:::::.............it111t11111tttt1111tttttt1111ttttttt1t\\n1111111111111111111,.............,.........,:::::.............:1t11ii;:;11111111111111111111111tt111\\n1111111111111111111:........................,,:::..............;ii;:;:;ii111111111111111111111111111\\n11111111111111111111:....... ..............,,,:,...............,:::::;i1111111111111111111111111111\\n111111111111111111111:......,,..............,,,:,...............:::;::;i11t1111111111111111111111111\\n1111111111111111111111iiiiii1;...............,,,,.,..............,::::;11111111111111111111111111111\\n11111111111111111111111111111;................,,:,,,...... .it1111111111111111111111111111\\n1111111111111111111111111111t;...............;i;;;::,.....,,.....,,,;i1ttttttttt11tt111111ttttt11111\\n1111111111111111111111111111t;...............:i;;i;::,....:i111111tttttttttttttttttttttttttttttt1111\\n\",\n \"tttttfttttttttffffftfffftfftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLftfffffffftttt1t1111111t11tfffffftttt1111111111111111ttftttftttttttt111111ttt\\nttttttttttttttttffffLftttfffffffLLfftt1tttttt111tfffffffftttttttt11111tttttffffftffLfttttttt11111ttt\\nttttttttttttttttfffffttffffffLLLfffttt1ttttttt1tffffffffffttttttt11111tfffffffLffttfffffttt1111ttttt\\nttttttttttttffffttfffttffffffffftttftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfffttttt1tfffft1ttfffffttfffft11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLftttttttfffffftttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLffftffttttt111i;iitfftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftfftttt1;:,::,,,:;ittttffffffffftt1111t11ttttttttttttttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttfffLLLftt1i:,,,,,,,,,,:1tttttfffffftt1111tft1ttt1tffttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLLffLLLftt1i;;;;;;;i;:,:tftt11tfffft11111tffft1tt11ttttt1ttfffLLLLLLLfff\\ntfffffttttfLLLffttttfffffttLLLLfLLLft1;iiiii11111i::tffft11tttt11t111tfffttfftt1ttfftttffLLLLLLLLffL\\ntttfftttttffLftttttttttttttfLLLffLLftt11;;;iiiiiii:;tffffft11tt1111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttLLfffLft11i;;;;i;;iii;tffffttt1tffft11111tfttfffttt1tttttttttfLLftffttt\\nttffffffffftttffffffffftffffttfftfttt11i;;;i1iii1iitffft11tttttfft1111tt1tffttffttfffffLLfffftfLffLL\\nttffffffffftttffffffffttttttttttffftt11i;;;iii111ii1tt111tfft1ttft111111t1ttttfftttffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111ttffftttti;;;;iiiiii11111ttfffft11t11111tfftttttttt1tfffffLLftttfLLLLf\\nttttttttfffttfffttttt1ttfft1111ttffttt1i;;;iiii;;itt11tffffffft1111111ttttt1ttfft11ttffffLfftfLLLLLf\\ntftttttttttttt1tttt11tfffft1tt11tfft111;;;;;iii;;it111ttfffffft11t1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttffffftt11ttftfftttffftttfft11tti;;1;;;:;iii::i111111ttfft111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffftttt11tfftttft1i;:,..,1i;;;;iii;i;:;;1t111t11111tt1111tt111tft1fffffttfffftt11tffLLf\\n1tttffffft11ttffftt1111tt1ii:,,......,i1i;;;ii;11;...,:;i111tt11111111111t11tf1tfffttfffffffttfLffLf\\ntfttttftt11t11ttt11ttt11;,,..........,11t1iiii1t1:,,.....,:i111111t1111111111t1tffttttffffttt1tfffLf\\ntffttttttttfttt111ttttti,.............:;;iii11t1i,,.........,ittt11111111tttt11tttfLffttffttttttffft\\nttttttttttttttt111tttt1:................:;;;;;i;:,...........:ttt1111111tttffttttffLLffttttffftttttf\\ntfffttttftttttt11ttttti.................,;;;ii;;:............,1ttt11111ttttffftttffffffttttttttffttf\\ntffft1ttfffftf111ttttti..................:;;;i;;:,...........,1tt11111111ttffttttffLLfLfttfffffffttf\\ntffft1ttfttttt111ttttt;..................,;;;;;::,...........,1t1111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttt;...........,,.....,;;:;:::............,111111111tt111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111tttti,........,;ii:......:;:::::............,ittttt111ttt11tft1tfffffLftttfftfffttt\\nttttt1tttt111t111tttt;........:;;;;:,.....,;:::::.............ittttt1111t1111tt1ttfttttttttttttffttt\\nttttt1tttttttt11tttt1,.......,:::;;;,......::::::.............;tt1t1111111ttt1tttfttttttt1tttttffttt\\n1tttt1tttttttt11tttti.........,:::;:.......,:::::..........,,:;1t11111111ttff1111ttttttt111ttttffttt\\n111111tttttt111111t1,..........,:::........,:::::..........,:;;i1111t111ttttt11111ttttt1111ttttttt1t\\n1111111111111111111;............,,.........,::::,.........,:;;;i1111111111111111111111111111111tt111\\n11111111111111111111:.......................,:::,.. ......,:;;ii111111111111111111111111111111111111\\n111111111111111111111:.......,..............,:::,..........,::i11t1111111111111111111111111111111111\\n1111111111111111111111:,,..,, ..............,,,::,............,1111111111111111111111111111111111111\\n1111111111111111111111111i11:...............,..,:,,..... ..:1t11111111111111111111111111111111111\\n111111111111111111111111111;................,::::,,.....::::;i11tttt111111t1111111111111111111111111\\n111111111111111111111111111,.................ii;;::,....:1tttt1ttttttttttttttttt11tt111111ttttt11111\\n1111111111111111111111111ti..................;i;;;:,.....;t1ttttttttttttttttttttt1ttttttttttttt11111\\n\",\n \"ttffftfffttttttttftttfffttftttttttttt111tttt111111tttttttt111tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLLftfffffffftttt1t111t111t11tfffffftttt111111111111111tttftttfttttttttt1111tttt\\nttttttttttttttttffffLftttfffffffLLffttttttttt111tfffffffftttttttt11111ttttfffffftfLLfttttttt111tttt1\\nttttttttttttttftfffffttffffffLLffffttttttttttt1tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttffffttfffttffffffffftttfttttt1111tt1ttffffffttttt1111tt11111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttffftttt11tttffttttfffffttfffft11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLftt11ii;i;;ii1tttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLffftfftt1:,,,,,,,,:iftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftff1i;;:,,,,,,,,:;ttttfffffffffftt1111t11ttttttttttttttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttfffLLLt;,,:;;;;;iiii:ittttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLLffLLLfi,:iiii111111;1ffftt11tfffft11111tffftt1t1tttttt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfffffi:;;;;;iiiiiiitffffft11tttt11t111tfffttffft1ttfftttffLLLLLLLLffL\\ntttfftttttfffftttttttttttttfLLLffLLti;;;;;i;;iiii1ftffffftt11tt1111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttfLfffLtii;;;ii;;i1111tfffffttt1tffft11111tfttffftttttttttttttfLLfffffft\\nttffffffffftttffffffffftffffttfftftt1ii;;;;;;iii11ttffft11tttttfftt111tt1tffttffttfffffLLffffffLffLL\\nttffffffffftttffffffffttttttttttffftt11i;;;;;i111111tt111tfft1ttft11111tt1ttttfftttffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt1111tfffttti;;;;;;iiiii11111ttfffft11t11111tfftttttttt1ttfffLLLftttfLLLLf\\nttttttttfffttfffttttt1ttfft11111tfft11i;;;:;;ii;;itt11ttfffffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntftttttttttttt1tttt11ttffft1tt11ttti::i;;;:;iii;;;i;i1ttftfffft1tt1111tttt1tt1tffftt1111tffftfLffftt\\ntfttffffftt11ttftfft1tffftttff1i;:,...;1;;;;;i;:;i,..,:;i1tft111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffftttt11tfft11i;:,......,11;iii;;iii,,,....,:;i1111t1111tt111tft1fffffttfffftt11tffLLf\\n1tttffffft11ttffftt1111t1;;,..........,i1t11ii11i:.,........,111111111111t11tt1tfffttfffffffttfLffLf\\ntfttttftt11t11ttt11ttt11:..............;iiiiiii11,,,......,,,itt11t1111111111t1tffttttffffftt1tfffLf\\ntffttttttttfttt111ttttt;................,;;;i;;ii,...........;ttt11111111ttt111tttfLffttfft1ttttffft\\nttttttttttttttt111ttt11:.................:;;;i;::............;ttt1111111tttftttttffLLffttttffffttttf\\ntfffttttftttttt11ttttt1,.................,;;;;;;:............:ttttt11111tttffftttffffffftttttttffttf\\ntffft1ttfffftf111ttttt1,..................:;;;:::............:1tt11111111ttffttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttti...................,;;::::............,111111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttt:...................,::::::,:::,.......,1t1t11111tt111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111tttt1,....................,::::::;;;ii:......ittt11111ttt1ttff1tfffffLftttfftfffttt\\nttttt1ttttt11t111tttti.....................,:::::,;;;ii;,.....itttt1111tt111tttttttttttttttttttffttt\\nttttt1tttttttt11ttttt;........ .............:::::,;;;ii;,.....:1t1t1111111tttttttfttttttt1tttttffttt\\n1tttt1tttttttt11ttttt:.... :i;:.............:::::..,;;i:.......it11111111ttff1111tfttttt11tttttffttt\\n11tt11tttttt1111111t1,...,;iiii;, ..........::::,. .,:,......;111111111ttttt1111ttttttt111ttttttt1t\\n11111111111111111111i..,.,;;;iii;...........:::::.......,....itt1111111111111111111111111111111tt111\\n11t111111111111111111;....::;;ii;...........::::,..........,;111111111111111111111111111111111111111\\n1111111111111111111111, ...,:;;;,............,,:,.....,,:;11tt11111111111111111111111111111111111111\\n1111111111111111111111i:,....... ............,,:,.....:1tttttt11111111111111111111111111111111111111\\n1111111111111111111111111;.,. ..............;;;:,,....,it11ttt11111111111t11111111111111111111111111\\n111111111111111111111111i,..................;ii;:,.....,1t1ttttt1111111111t1111111111111111111111111\\n111111111111111111111111:...................;ii;;:......;ttttttttttt11tttt1t111111tt11111111ttt11111\\n111111111111111111111111:...................:i;:;;,.....:t1tttttttttttttttttttttt1tttttttttttttt1111\\n\",\n \"ttffftfffttttttttttttfffttftt111ttttt111tttt111111ttttttttt11tttt111111ttttttttttttttttttttt111111tt\\nttfftttttttttttttttffLLftfffffffftttt111111111t11tffffffttttt11111111111111tttftttfttttttttt1111tttt\\nttttttttttttttttffffLftttfffffffLLfft111ttttt111tfffffffftttttttt11111ttttfffffftfLLfttttttt111ttttt\\nttttttttttttttttfffffttffffffLLLfffttt1ttttttt1tffffffffffttttttt1111ttffffffLffttffffffttt1111tttt1\\nttttttttttttfffftttffttffffffffftttftt1t1iii11111tfffffftttttt11tt111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttffft11i:,,,::::;1tfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfft1;:,,,,,,,,,:tttttttffffffftt1111tftt111tttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffLfftt1::,,,,,:::::;itfttttffffffffftt111tft1ttfttttfLLfttttfffffftttttt\\ntttttttfLLLLLLLLLLfttttffftffffttf1,,,,:;iii1111itftttfffffffffftt1111t11ttffttttttttttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttffffft:,,,:;iii111ii1tttttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLfffLft:,,:;;;;iiiiii1tffftt11tfffft111111ffftt1t1tttttttttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttfLLfffft;:::;;;iii;iii1tffffft11tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\\ntttfftttttfffftttttttttttttfLLLffffti;;;i;;iii;iitfffffffft1tttt1t1111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttfLftfft1i;;;;;iiiii11ffffftttt1tffft11111tfttffftttttttttttttfLLffffftt\\nttffffffffftttfffffffftttfftttftttttt1;;;;;iiiii11ttffft11tttttfftt111tt1tffttffttfffffLLffffffLffLL\\nttffffffffftttffffffffttttttttttfftt11i;;;;;;ii1111ttt111tfft1ttft11111tt1ttttfftttffffLLLfttffLLLLL\\ntttffffffffttfffffffft11ttt1111ttff1;i;;;;;;;ii;iiii111ttfffft11t11111tfftttttttt1tffffLLLftttfLLLLf\\nttttttttfffttffftt1tt1tttft1111tt1;,.:i;;;;;iii::;;,,:;i1tfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntfttttttttttttttttt11ttffft1tti;:,...,ii;;;;ii;::;;.....,:itftt1tt1111tttt1tt1tffftt1111tffftfLffftt\\ntfttffffftt11ttftfft1tttft1i;:,.......:11iiii;;;:;:,,,,,,..;t111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffttttt11tti;:,..........,1tt1ii11i;;,,.,.,,,,,1111t11111tt111tft1tffffttfffftt11tffLLf\\n1tttffffft11ttttttt1111;...............:11iiii;;1;.,.,,.,..,1t11111111111t11tf1tfffttfffffffttfLffLf\\ntfttttftt11t11ttt111tt1,................,;;;ii;i1:.........,111t1111111111111t1tffttttffffftt1tfffLf\\ntffttttttttftt11111ttt;..................:;;;;:;i:..........itttt11111111ttt111tttfLffttfft1tttttfft\\ntttttttttttttt1111ttt1:..................,;;;;:::,..,.......;tttt1111111tttffttttffLLffttttffftttttf\\ntfffttttftttttt11tttt;....................:;;::::,,.........:ttttt111111ttttfftttffffffftttttttffttf\\ntffft1ttfftttt111tttt:....................,;:::,:;;;;:,.....:1ttt11111111ttffttttffLLfLfttfffffffttf\\ntffft1ttfttttt111ttt1,.....................:::,,::;iii;,.....itt1111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttt;......................,::,,::;;;i;,.....:111111111tt111tttttfffLLLfttfffftffttf\\nttttt11ttttttt111tt1:......................,:,..:,:;;i;.......:tttt1111ttt1ttffttffffffftttfftfffttt\\nttttt1ttttt111111tt1:......................,:,..:. .:;:......,itttt1111tt111ttttttfttffft1tftttffttt\\nttttt1tttttttt111tt1:........... .........,,,.,:...........,1tt11tt111111ttt1ttttffftttt1tftttffttt\\nttttt1tttttttt11ttti,......... .,..........,,,.,:..........,it11111111111ttft1111ttttttt11tttttffttt\\n11tt11ttttt111111tt:..........,::;,........,,,.,:......,:i11t11111111111ttttt1111ttttttt111ttttttt1t\\n11111111111111111111:........:;;ii;.........,,.,,.....i1ttt11t11t111111111111111111111111111111tt111\\n1111111111111111111ti........,:;;i;,...........,,.....;t11111111111111111111111111111111111111111111\\n11111111111111111111ti;,......,:;;;. ......,:,.,:.....,1t1t11111111111111111111111111111111111111111\\n11111111111111111111111;........,,,........:;::,,......;t1tttt11111111111111111111111111111111111111\\n1111111111111111111111i......... ........:;;::,......,1ttttt11111111111t11111111111111111111111111\\n1111111111111111111111:........ ...........:;;;::.......it1ttttt1111111111t1111111111111111111111111\\n111111111111111111111i,........,......... ,ii;;::,......:ttttttttttt11ttt1tt11t111tt111111t1tttt1111\\n11111111111111111111t;.........,..........:iiii;::,.....,1ttttttttttttttt1ttt1ttt1tttttttttttttt1111\\n\",\n \"ttttftfffttttttttttttfffttttt111ttttt111tttt111111ttttttttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11tffffffttttt11111111111111tttftttfttttttttt1111tttt\\nttttttttttttttttfffffftttfffffffLLLft111tttttt11tfffffffftttttttt11111ttttfffffftfLLfttttttt111ttttt\\nttttttttttttttttfffffttfffffffffffft11111;:::;;i1tffffffffttttttt1111ttffffffLffttffffffttt1111tttt1\\nttttttttttttfffftttffttffffffffftttft1;::,,,,,,,,ifffffftttttt11tt111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttff1;:,,,,,,,,,,:itfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffttt1:,,,,:::;;i;;1tttftttffffffftt1111tftt111tttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffLfftt;,,,,,:;ii11t11tfttttffffffffftt111tft1ttfttttfLLfttttfffffftttttt\\ntttttttfLLLLLLLLLLfttttffffffffttt;,,,,:;;;iii1111ttttfffffffffftt1111t11ttffttttttt1ttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttttfft:,,,,:;;;iiiiii1tttttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfffftttfLftfLfi;;;;;;;iii1iii1tffftt11tfffft111111ffftt1t1tttttttttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttfLLftfffi;;;i;;;;iiiii1fffffft11tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\\ntttfftttttffffttttttttttttttffftffft;;;;;;;;iiii1tttfffffft1tttt1t1111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttfffffffffttftttffftfft1;;;;;;;;iii1ttfffffttt1tffft11111tfttfLftttttttttttttfLLftffftt\\nttffffffffftttfffffffftttfftttftttt1i;;;;;;;;ii111tffftt11tttttfftt111tt1tffttffttfffffLLffffffLffLL\\nttffffffffttttfffffffft1tt1111ttt1::i;;;;;;;i1i;i111ttt11tfft1ttft11111tt1ttttfftttffffLLLfttffLLLLL\\ntttffffffffttffffffftt111tt111i;:,..;i;;i;iii11;;;;,::;1tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\nttttttttfffttffttttt111ttt1;:,......,ii;;iii;11;:;;,...,:1fffft1111111ttftt1ttfft11ttffffffftfLLLLLf\\ntftttttttttttt11tt111tt1;:,..........;11iii;1t1;:;;,,,,,.:tfttt1tt1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttffffftt11tttttt111:..............:1tt1ii11i::;:,,,,,,,if1111tt1111ttt11tf1tfffffttttttttttttffft\\n111tfffffft1tfftttt11;................:ii;;i;:,,;;,.,,.,..it1111111111tt111tft1tffffttfffftt1ttffLLf\\n1tttffffft111tttttt1i,............,....:;;;;;;:,1i,..,,,..;ttt11111111111t11tt1tfffttfffffffttfLfLLL\\ntfttttftt1t111ttt111;..................,;;;;;:,:1i,.......it111t11t1111111111t1tffttttffffftt1tffLLf\\ntffttttttttft1111111,...................:;;;::,,;;,.......it1tttt11111111ttt111tttfLffttfft1tttttfft\\ntttttttttttttt1111t;....................,;;:::,.:,..,.....:tttttt1111111tttffttttffLLffttttffffttttf\\ntfffttttfttttt111t1,.....................;;:::..:,........,1tttttt111111ttttfftttffffffftttttttffttf\\ntffft1ttfftttt111ti......................::::,..:,.....,:::i1ttt111111111ttffttttffLLfLfttfffffffttf\\nttfft1tttttttt111t:......................,:::,..:,....,:;iiiitt11111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt1111;.......................,:,...:,....:;;iiii1111111111tt111tftttfffLLLfttfffftffttf\\nttttt11ttttttt111t;...................,,,,,,,...,......,;;ii1111ttt1111ttt1tfffttffffffftttfftfffttt\\nttttt11tt11111111i,.................,::::::,....:........,,:i1111tt1111tt111ttttttfffffft1tftttffttt\\nttttt11ttttttt11t;.................,:;;;;;;,....:.... .. .,1t11ttt1111111ttt1ttttffffttt1tftttffttt\\nttttt11ttttttt1111:................,::::;i:.....:.,..,,,:;i11tttt111111111tft1111ttttttt11tttttffttt\\n111tt11ttt1111111t1:. ............::::;:.....,:....it11111tt1tt1111111ttttt1111ttttttt111ttttttt1t\\n11111111111111111111i:,..............,,,,......,:....:1tt111111t1111111111111111111111111111111tt111\\n11111111111111111111t11:........,.... . ..,....:.....it1t111t11111111111111111111111111111111111111\\n11111111111111111111111:,..................:....:.....:1ttt11t11t11111111111111111111111111111111111\\n1111111111111111111111i,...................:....:......it1ttttt1tt11111111111t1111111111111111111111\\n1111111111111111111111;....................,,..,:,.....:tttttttt111111111111111111111111111111111111\\n1111111111111111111111:.................. .::..,:......,1t1ttttt11t1t11111t1111111111111111111111111\\n11111111111111111111ti,.................. ,;::,,:.......itttttttttttt111t1tt11t111tt111tttt1tttt1111\\n11111111111111111111t;....................,;;;:,:.......:tttttttttttttttt1ttt1ttt1tttttttttttttt1111\\n\",\n \"tttttttttttttttttttttffftttt1111111tt1111tt1111111ttttttttt11tttt1111111ttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLfttffttfffttttt1111111111111tffffftttt111111111111111tttffttftttttttt11111tttt\\nttttttttttttttttffffLftttfffffffffftt11111iii1i11ffffffffttttttt111111tttttffffftfLLfttttttt111ttttt\\nttttttttttttttttffffftttffffffffffttt11;::,,,,,:;1ffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffttttt1;:,,,,,,,,,,:tffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLfttttttft;,,,,,,,,:::,:itfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffttt;,,,,,,:;ii1111tttttttffffffftt1111tftt111tttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffffft1:,,,,,:;iii11111fttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLLLLLLLLLffttttffftfffftt1:,,,,,:;;;iiiii1ftttfffffffffftt1111t11ttffttttttt1ttffffffffffttt\\ntttffttfLLLLLLLLLLfttfttffftttttft::;;::;;iiiiiii1ttttttttfffffftt1111tft1ttt1tffttt11tffffLLLLLfttt\\nttffffffffLLLLLLffftfffttttffftfLfi:;i;;;;;iiiiii1tffftt11tfffft111111ffftt1tt1tt1tttttfffLLLLLLffff\\ntffftfttttfLLLfftttttffffttfLLftfff;:;;;;;;;iiiii1tffffftt1tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\\ntttttttttttfffttttttttttttttffffffft;;;;;;;;iiii1ttffffffft1ttt1111111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttfffffffffttft1tfffttt1i;;;;;;;;iii1ttfffftttt1tffft11111tfttffftttttttttttttfLLfffffft\\nttffffffffftttfffffffftttffttttti::i;;;i;;;;ii1111tttttt11tttttfftt111tt1tffttffttfffffLLffffffLLfLL\\nttffffffffttttfffffffft1ttt11i;:,.,ii;;iiiii11:i1111tt111tfft1ttft11111tt1ttttffttttfffLLLfttfLLLLLL\\ntttffffffffttffffffftt111i;:,......:11;;iiiii1::;;;::;i1ttffft11t11111tfftttttttt1ttffffLfftttLLLLLf\\nttttttttfffttfttt1111ii;:,.........,it1iii;;1ti::;;,..,:1tfffft1111111ttttt11tfft11ttffffffftfLLLLLf\\ntfttttttttt1tt111111;,..............;1111ii1ti:;:;;,,,,.:tffftt11t1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttfffftt1111ttttti,................:;;;i;;;,,:;;:,,,,,,itt1111tt1111ttt11tf1tffffftttttt1tttttffft\\n111tfffffft1ttttttt:..........,,......:;;;;;;,.,i;,,,,,,.;t111111111111t111tft1tffffttfffftt1ttffLLf\\n111ttfffft111ttttt1,............,.....,;;;;;:,.:1i,......;11t111111111111t11tt1tfffttfffffffttfLfLLL\\ntttt1tftt11111tt11;....................:;;;;:,.:1i,......:tt11111111111111111t1tffttttffffftt1tffLLf\\nttft11ttttttt1111i,....................,:;:;:.,,;:,......:111tttt11111111tttt11tttfLffttfft1tttttfft\\ntttttt1ttttttt111;......................,;:;:..,:,.......:11tttttt111111tttffttttffLLffttttffffttttf\\ntffft11ttttttt11i,.......................:::,..,:,.......,1tttttttt11111ttttfftttffffffftttftttffttf\\ntffft11ttttttt11;........................,:::,..:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt11;......................,:;;;;;;,:,........,111tt1111111111tttttttffLLfLfttfffffffttf\\ntfttt11ttttttt11i.....................:::;;;;;:.:,....... ,1t11111111111t111tftttfffLLLfttfffftffttf\\ntttt111ttttttt11:....................,:::;;;;;.,:,..........,:;iii11111ttt11tffttffffffftttfftfffttt\\nttttt11tt1111111,....................,:::;;;;,.,:.......... .::;;;;ii11111ttftttftfffft1tftttffttt\\nttttt11ttttttt11i................. ....,,,,.....:.... ........,:::;;;;ii111tt1tttfffffttt1tftttffttt\\nttttt11ttttttt11ti,. .........,... .. ....,..:,.. ....,:::;;;iii1ttt1111ttttttt11tttttffttt\\n11111111ttt111111t1ii;;;,.......................:..,.:1;:,,.. ..,;i1i1t1ttt1111ttttttt111ttttttt1t\\n1111111111111111111ttttt:,......................:.. ,tttt111i;;;;i1tt1111111111111111111111111tt111\\n111111111111111111111111:,..................,...:.....it1t1ttttttttt11111111111111111111111111111111\\n111111111111111111111111;,..................,...:.... ;tttt11t11t11111111111111111111111111111111111\\n111111111111111111111111:...................,..,:.....:ttttttttttt1111111111111111111111111111111111\\n11111111111111111111111i,...................:,.,:.....,1ttttttttt11111111111111111111111111111111111\\n11111111111111111111111;...................,::..:.....,1ttttttttt1t11t1111t1111111111111111111111111\\n11111111111111111111111:.................. :;:,,:......itttttttttttttt111ttt11t1111t111t1ttttttt1111\\n111111111111111111111t1:.................. :;;:::......;ttttttttttttttttt1ttt1ttt11ttttttttttttt1111\\n\",\n \"tttftttttttttttttttttffftttt1111111tt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfftfftttffttttt111111111111ttffffftttt1111111111111111ttffttfttttttttt1111tttt\\ntttttttttttttttttffffftttffffffffffft111tt111111ttffffffttttttttt11111tttttffffftfLLftttttt11111ttt1\\nttttttttttttttttffffftttffffffLffftt111i;;:::::;1tffffffffttttttt11111tfffffffLfftfffffftttt111ttttt\\nttttttttttttfffftttffttffffffffttttt1i;,,,,,,,,,,;fffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLftttttttti:,,,,,,,,,,,,;tfffftttfffft11t111tt111tttffLLfttfftt1tt111tttttt\\nttttttttffLLLLLLLffttfLLffttfffttti,,,,,,:;;;ii;itttttttffffffftt1111tftt1tttttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffffft1:,,,,::;i111tt1tfttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLfLLLLLLLLfttttffftfffftti,,,,,,:;;iiii1i1ftttfffffffffft11111t11ttftttttttttttfffffLLfLfttt\\ntttffttfLLLLLLLLLLfttfttffftttttf1,,::,:;iiiiiiii1ttttttttfffffftt1111tft1ttt1ttfttt11tffffLLLLLfttt\\nttfffftfffLLLLLfffftfffttttffftfLf;:ii;;;;iii11ii1tfffft11tfffft111111ffft11t1ttt1tt1tffffLLLLLLLfff\\ntffftfttttfLLLfttttttffffttfLLftff1:;ii;;;;iiiiii1ffffftt11tttt1ttt111fffttfffttttfft1tffLLLLLLLLffL\\ntttttttttttfffttttttttttttttfffffff1;;;;;;;iiiii1tffffffftt1ttt1111111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttffffffffftttt1tffftft1i;;;;;;;iiii1ttfffffttt1tffft11111tfttfffttt1tttttttttfLLftfffft\\nttffffffffttttfffffffft1tftt1tft1;ii;;;;;;;;ii1111ttftft11tttttfft1111tt1tffttffttfffffLLffffffLffLL\\nttffffffffttttfffffffft1tttt1ii;,.:i;;;i;iii111t111ttt111tffttttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffftfttt111ii;:,....,i1;;iiiii1i:;;;i11111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\ntttttttttffttfttt1111ii;:,.........;11iiii;;11;::;;,:;1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntft1ttttttt1t1111111:,.............:1tt1iii1t1;;:;:,,.,:1tffftt11t1111ttt11tt1tffftt1111ttfftfLLfftt\\ntttttffttt1111ttttt;................:iiiiii11,:;:;:,,,,.:tttt111tt1111ttt11tf1tffffftttttt1ttttttfft\\n1tttfffffft1tftttt1,.................,;;;;:;:.,:i:,,,,,,,it11111111111tt111tft1tffffttfffftt11tffLLf\\n111ttfffft111ttttti...................:;;;;;:,,:1;.......;t1tt11111111111t11tf1tfffttfffffffttfLfLLf\\ntttt1tftt11111ttt1:...................,;:;;;:..;1;.......:tt111t11t1111111111t1tffttttffffftt11ffLLf\\nttft1111ttttt1111;.....................:;:;;,..,;:.......,111tttt11111111tttt11tttfLffttfft1tt1tffft\\n1tttt11ttttttt111,.....................,::;;,..,:,.......,1ttttttt111111tttffttttffLLffttttffffttttf\\ntfftt11ttttttt11;.......................:::;,..,:,........itttttttt1111tttttfftttffffffftttftttffttf\\nttfft11ttttttt11,.......................,;;;;:,,:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt1i,.....................,::;i;;;,,:.........:111tt1111111111tttttttffLLfLfttfffffffttf\\nttttt11ttttttt1i.....................,:::;i;i:.,:,........,1t1111t111111t111ttfttffLLLLfttfffttffttf\\ntttt111ttt11t11;.....................,:::;;;;,.,:..........1tt111tt11111ttt1tffttffffffftttffftffttt\\nttttt11t1111111:......................:::::,...,:..........:i1tttt1tt111t1111tttttfttffft1tttttffttt\\nttttt11tttt11t1i.......................... ....,,.......... .,,:i11iii11111tt1t1ttffffttt1ttttttfttt\\nttttt11tttttt111;... ......................,:............ .,:::;iiii1111111tfttttt11ttttttfttt\\n11111111t1111111t1i;;::::......................,:..,:.. .......,::;;;;;;iii11111tttttt111ttttttt1t\\n11111111111111111ttttttt1,.....................,:......:,.. ..,:;;;:;;;iiii11111111111111111tt111\\n111111111111111111111111i,.................,::..,.... ,tt1ii;,,.. ..,:i;;iii111111111111111111111111\\n111111111111111111111111i,.................,;:,,,......1tttttt11i;;::itt11t1111111111111111111111111\\n111111111111111111111111i,................ ,;:::,......it1t1tttttttttt11tt11t111111111111111111t1111\\n111111111111111111111111;................. ,;;::,......it1tttttttt1111111t11111111111111111111111111\\n111111111111111111111111:................. .;;:::......;t1ttttttt1ttttt111t1111111111111111111111111\\n111111111111111111111111,...................;i;::,.....;tt1ttttttttttt11tttttttt111t111111tttttt1111\\n111111111111111111111111:...................:i;:::.....ittttttttttttttttttttt1ttt111tttttttttttt1111\\n\",\n \"tttftttttttttttttttttffftttt1111111tt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfftfftttffttttt111111111111ttffffftttt1111111111111111ttffttfttttttttt1111tttt\\ntttttttttttttttttffffftttffffffffffft1111tttt111ttffffffttttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttffffftttffffffLffftt11111i;iiii1tfffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffttttt11;::,,,,,,::1fffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLftttttttf1;:,,,,,,,,,,,itfffftttfffft11t111tt111tttffLLfttfftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLffttfffttt1,,,,,,,::::::itttftttffffffftt1111tftt11t11tfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffLfft1:,,,,,:;ii11111ffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLfLLLLLLLLfttttffftfffftt1:,,,,:;;iii1111fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfLLLLLLLLLLfttfttffftttttf1,,,,,:;iiii;iii1ttttttttfffffftt1111ttt1ttt1ttfttt11tfffffLLLLfttt\\nttfffftfffLLLLLfffftfffttttffftfLt:;;;:;;iiiiiii11tfffft11tfffft111111ffft1tt1ttt1tt1tfffLLLLLLLffff\\ntffftfttttfLLLfttttttffftttfLLftff1;;;i;;;iii1iiitfffffft11tttt1ttt111fffttfffttttfftttffLLLLLLLLffL\\ntttttttttttfffttttttttttttttffftfffi;;;;;;iiiiii1tffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttffffffffftttt1tffftffti;;;;;;iiiii1tttffffttt1tffft11111tfttfffttt1tttttttttfLLftfffft\\nttffffffffftttfffffffftttftt1tftt111i;;;;;;;;ii111tfftft11tttttfft1111tt1tffttffttfffffLLffffffLffLL\\ntttfffffffttttfffffffft1tt111111i::i;;;i;;;;i11t111ttt111tffttttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffftfftt111111i;:,..,ii;;iiiii11:;;;111111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\ntttttttttffttfttt1111111i;:,.......:11;iiii;11;::;;,:i1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntfttttttttt1t1111111i;:,...........:1t1iii;itt;;;;:.,,,:itffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\\ntttttffftt1111ttttt1:..............,i111ii1tti:;;;:,,,,.,1tft111tt1111ttt11tf1tffffftttttt1ttttttftt\\n111tfffffft1tfttttt;.................:;;;;;;;,.:i:.,,,,,.;t11111111111tt111tft1tffffttfffftt11tfffLf\\n111ttfffft111ttttt1,..................:;;;;;:,.:1;.....,.:11tt11111111111t11tf1tfffttfffffffttfLfLLf\\ntttt1tftt111111tt11,..................,;;;;;:,.;1;.......,1t111t11t1111111111tttffttttffffftt11fffLf\\ntttt111tttttt11111;....................::;;;,..,;:.......,i11tttt11111111tttt11tttfLffttfft1tt1tffft\\n1tttt11ttttttt111i.....................,::;;,..,:.........ittttttt111111tttffttttffLLffttttffffttttf\\ntfftt11ttttttt111,......................::::,..,:,........itttttttt11111ttttfftttffffffftttttttffttf\\nttfft11ttttttt11;.......................,:::,..,:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt11:........................,:,,..,:,........,111tt1111111111tftttttffLLfLfttfffffffttf\\nttttt11ttttttt11,.......................,,::,..,:..........it11111t11111t111tttttffLLLLfttffftfffttf\\ntttt111tttt1t11i......................::;;;;;:.,:..........;t11tttt11111tt11tffttffffffftttffftffttt\\nttttt11tt111111:....................,:::;i;;i,.,:..........;ttttttt1111111111tttttfttffft1tttttffttt\\nttttt11ttttttt1;....................,:::;i;;:..,,...........:;iii1111111111tt1t1ttfffttt11ttttttfttt\\nttttt11tttttt111:...................,:::;;;;...,,........... .,:;;;:;i1111ttt1111ttttttt11ttttttfttt\\n11111111t11t11111;,.. ...............,,,....,:.... .......,:::::;;11tt11111111tt1tt1111ttttttt1t\\n11111111111111111t11i;;;:.......,..... ......,,....,,. ...,::;::;i1111111111111111111111111tt111\\n11111111111111111111tttti,...................,.,,... :1i:,. .,,;;i1111111111111111111111111111111\\n111111111111111111111111i,...................:,,,.....ittt1i:,.. ,1tttt111111111111111111111111t1111\\n111111111111111111111111;,...................,,::.... .111tttt1ii1ttt11111111t11111111111111111t1111\\n111111111111111111111111;....................,:::......it1t11ttttt1111111111111111111111111111111111\\n111111111111111111111111;....................,::,......;t1tttttt11tt1tt111t1111111111111111111111111\\n11111111111111111111111t:....................::::......:1111ttttttttttt1tt11ttt11111111111tttttt1111\\n11111111111111111111111t:....................:;::,.....,1tttttttttttttttttttttttt111tttttttttttt1111\\n\",\n \"tttftttttttttttttttttffftttttt11ttttt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfftfffttffttttt111111111t11ttffffftttt1111111111111111ttffttfttttttttt1111tttt\\ntttttttttttttttttffffftttffffffffffft1111tttt111tfffffffttttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttffffftttffffffLfffttt1111ttttt1tffffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttftttffffffffttttft1i;:;;;;;i11tfffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLfttttttfft1;:,,,,,,,,:1ttfffftttfffft11t111tt111tttffLLfttffft1ttt11tttttt\\nttttttttfffLLLLLLffttfLLffttfffttti::,,,,,,,,,,;ttttftttffffffftt1111tftt11t11tfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfffffti,,,,::;;;iiiii1ffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLLLLLLLLLLftttttfftfffftt1:,,,;iii1111111fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfttffftttttff:,,:;;;iiii1ii1tttttttttfffffftt1111ttt1ttt1ttfttt11tfffffLLLLfttt\\nttfffftfffLLLLLfffttfffttttffftfLt;:,:;;;;iiiiii11tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffftfttttfLLffttttttffftttfLLftff1;;;;;iiiii;i11ttfffftt11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttfffLtfffii;;;;;ii;;iittffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttft1tffftffti;;;;;iiiii1ttttffffttt1tffft11111tfttfffttt1tttttttttfLLfffffft\\nttffffffffftttfffffffftttfttttfttttti;;;;;iiii1111tfftft11ttttffff1111tt1tffttffttfffffLLffffffLffLL\\nttffffffffttttfffffffft1tt11111tft11i;;;;;;;iit11111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffftttfffftfftt1111111111i:,;i;;;;;;ii1i;;;111111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\nttttt1tttffttfttt11t111tttt1i;:,...:1i;ii;ii;1i:;;i;;i1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntfttttttttt1tt1111111ttt1;:,,.......;ti;iii;it1;;;;,..,:i1fffft11t1111ttt11tt1tffftt1111ttfftfLffftt\\nttttfffftt1111ttttt111;:,...........;tt11iii1t1::;;,,,,,.,1ft111tt1111ttt11tf1tffffftttttt1ttttttftt\\n111tfffffft1ttttttt11,..............:i11iii111:,;;,,,,,,,.;t1111t11111tt111tft1tffffttfffftt11tfffLf\\n111ttfffft111ttttttt;.................:;;;;;;:.,ii,....,,.:1tt11111111111t11tf1tfffttfffffffttfLfLLf\\ntttt1tftt11111ttt111:.................,;;i;;;,.,1i,.......:t111111t1111111111tttffttttffffftt11fffLf\\ntttt11ttttttt1111111,..................:;;;;;,,,;;,.......:11tttt11111111tttt11tttfLffttfft1tt1tffft\\n1tttt11ttttttt11111i...................,;;;;:,..:,........:1tttttt111111tttffttttfLLLLfttttffffttttf\\ntfftt11ttttttt11111:....................:i;;:,.,:,........,1ttttttt1111ttttffftttffffffftttttttffttf\\nttfft11ttftttt111ti,.....................;;::,..:,........,i1tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt111t;......................,::,...:,.........;11t11111111111ttt1tttffLLLLfttfffffffttf\\nttttt11ttttttt111t:......................,::,...:,...,,....it11111111111t111tttttfffLLLfttfffftffttf\\ntttt11tttt11tt1111,.......................,,,...:,...,:;;;;itt11ttt1111ttt1ttftttffffffftttffftffttt\\nttttt11t111111111i.........................,,...:,...,:;iiii11111t111111t111tttttttttffft1tftttffttt\\nttttt11ttttttt111,.........................,,...:....,:;;iii11111111111111ttttt1ttfffttt11ttttttfttt\\nttttt11ttttttt111;...................,,,,..,....,......,:;ii1ttt1111111111ttt1111tfttttt11ttttttfttt\\n11111111t11t11111t;...............,:::::::..,...:.........,,it11tt1111111tttt1111ttt1tt1111ttttttt1t\\n1111111111111111111,.............:::::;;i:......:..... :1ttttt111111111111111111111111111111t111\\n11111111111111111111;,.. ........,::::;;:.......,... ,i;;;i1tttt111111111111111111111111111111111111\\n11111111111111111111t11i,.........,:::;;. ..,:,.:.....itttttttt1111111t111111111111111111111111t1111\\n11111111111111111111111t;...........,,,.... ,:,,:......it1111ttt1111111111111111111111111111111t1111\\n111111111111111111111111;.......... .... .:,,:,. ...:tttt11tt111111111111111111111111111111111111\\n111111111111111111111111;....................::::..,,..,1tttttttt1tttt1111t1111111111111111111111111\\n11111111111111111111111t;....................::::..,,...;t1tttttttttttt1t11ttttt111t111111tttttt1111\\n11111111111111111111111ti....................:;::,......:11tttttttttttttttttttttt11t11t1111ttttt1111\\n\",\n \"tttftftttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfttfffttffttttt111111111t11tfffffftttt1111111111111111ttffttfttttttttt1111tttt\\nttttttttttttttttfffffftttffffffffffftt11ttttt111tffffffftttttttt11111ttttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttffffftttffffffLfffttttt11tttt11tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffftttft1tttt11ttt1ttfffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLftttttttfft11iiiiiittt1ttfffffttfffft11t111tt111tttffLLfttffft1ttt11tttttt\\nttttttttfffLLLLLLffttfLLffttfffttfft;::,,,,,,:itttttffttffffffftt1111tftt11t11tfLLftttt1tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffffft11i:,,,,,,,,:,;fffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttfffttffftt1;:::::;;;iii;:tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfttfLfttttfft;:;iii111111i;1ttttttttffffffftt1111ttt1ttt1ttftt11ttfffffLLLLfttt\\nttfffftfffLLLLLLffftfffttttfffffLf;:;;;;ii1iiiii11tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffffftttffLLffftttttffffttfLLffffi:i;;;;;ii;ii11ttffffft11tttt1ttt11tfffttffft1ttfftttffLLLLLLLLffL\\ntttttttttttffftttttttttttttfLfftffi;ii;ii;i11111tfffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttftttfLftf1;;;;;;;;i1111tttffffftttttffft11111tfttfffttt1tttttttttfLLfffffft\\nttffffffffftttfffffffftttfftttftttt1i;;;;;iiii1111ttftft11ttttffff1111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffft1ttt1111tfftt1i;;;;iii1tt111ttt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttffffttftt111t11111ttfft1;;;;;;ii1ti;;i11111ttffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\\nttttt1tttffttfttt111111tttt11111tti:i;;;;;;iii1;:;i1i1ttftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntfttttttttt1tt11t1111ttfftt1tt1i;:..;i;;;;;iii1i:;;:,,:;i1ffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\\ntfttfffftt1111tttttt1tttttt1i;,.....:11;ii;;;iti:;;,,,...,:1t111tt1111ttt11tf1tffffftttttt1tttttfftt\\n1t1tfffffft1tttttttt111tti:,....,...,i11iii;i1ti;i,,,,,,,,.,i111t11111tt111tft1tffffttfffftt11tffLLf\\n1t1ttfffft111tttttt1111:,...........,i1t1iii11i,;1,....,,...;t11111111111t11tf1tfffttfffffffttfLLLLf\\ntftt1tftt1tt11ttt111tt;..............,:;i;;;;;,.i1,.........:11111t1111111111tttffttttffffftt1tffLLf\\ntfftttttttttt111111ttt:................,;;i;;:,,:;,.........:tttt11111111tttt11tttfLffttfft1tt1tffft\\ntttttt1ttttttt1111ttti,................,:;;;;:,.,:..........,ttttt111111tttffttttfLLLLfttttffffttttf\\ntffft11ttttttt1111ttt;..................,;;;::,.,,..........,1tttt111111tttffftttffffffftttttttffttf\\ntffft11ttftttt111tttt:...................:;;::..::,,.........ittt11111111ttffttttffLLfLfttfffffffttf\\ntffft11ttttttt111ttt1:...................,;::,,::;;;i;,......;t11111111111ttt1tttffLLLLfttfffffffttf\\ntttft11ttttttt111ttt1,....................,::,,::;;iii;. ...,it11tt11111t111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111t1ti.....................,:,,,,::;iii;.....,it11tt1111ttt1ttftttffffffftttffftffttt\\nttttt11tt11111111t1ti......................,:,. ,,,:;i:.......;11tt11111t111tttttttttffft1tttttffttt\\nttttt11tttt11t11tttt;......................,,,..,, .,,.......,;11111111111ttttt1ttfffttt11ttttttfttt\\nttttt1tttttttt111ttt:.......................,,..,,.....,....:1ttt111111111ttt1111tfttttt11ttttttfttt\\n1111111ttt1t11111tt1,.......................,,..:,.........:1t11111111111tttt1111ttt1ttt111ttttttt1t\\n11111111111111111111;....... ............,,..:,.....,;ii1t1t111111111111111111111111111111111t111\\n111111111111111111111,.... .,::,................:....,11ttt11tt11t1111111111111111111111111111111111\\n111111111111111111111;.....;i;;;,...............:,....it1111ttt1tt1111t111111111111111111111111t1111\\n1111111111111111111111i:.,iii;;i:.......... ,::,:......itttttttt1111111111111111111111111111111t1111\\n111111111111111111111111i,:;;;ii;,......... ,;;::,.....:1ttttttt11111111111t111111111111111111111111\\n111111111111111111111111i,.,::;;:.......... ,;;;::......itttttttt1tttt11t1tt111111111111111111111111\\n111111111111111111111111i..,.................;;;::,.,,..:1tt1tttttttttttt11ttttt11111111tttttttt1111\\n111111111111111111111111i..... .............;i;:::,.....itttttttttttttt1tttttttt11t11t1111ttttt1111\\n\",\n \"tttfttfttttttttttttttfffttttt1111tttt111tttt111111ttttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLfftfftttffftttt111111111111tfffffftttt111111111111111tttffttfttttttttt11111ttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tffffffffttttttt111111ttttffffLfffLLfttttttt1111t1t1\\nttttttttttttttttffffftttffffffLffffttttttttttt1tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffftttftttttt11ttt1ttfffffftttttt111t111111ttffffLLffttfLLfft111111tttt\\nttttttttttffLLLLftttttfLLLftttttttfftttttttfffft1tffffftttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftffft11i;ii1ttffttttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffLfLftti;:;:,,,:;;itffftttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffffftt1;,,,,,,,,::,:tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfftfLftttffff1;::::;;iii;,:1ttttttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\\nttfffftfffLLLLLfffftfffftttfLfffLfi;iiii11111i;:i1tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffffftttffLLfffttttfffffttfLLffLf;;;;iiiiiiii;:1tfffffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttffLLffLt;;:;;ii;;iii;ttffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttftttfLftf11i;;;i1ii11ii1tfffffftttttffft11111tfttfffttt1tttttttttfLLfffffft\\nttffffffffftttfffffffftttfftttfttt11i;;;;i1111i111ttffft11ttttffft1111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffftttttt111tfft11;;;;iiiii1t1111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffffffft111tt1111ttfft1i;;;iiiii1;;;111111ttffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\\nttttt1tttffttfftttttt11ttttt111tttft1i;;;;iiiii;;;1t11ttftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tffftt1tt11tff1ii;;;;;iiii:;;i;;i1tttffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\\nttttffffttt11tttttft1tttttt1ttt11i;,:i;;;;;iii;;;;:...,,,:;i1111tt1111ttt11tt1tffffftttttt1ttttttftt\\n111tfffffft1ttfftttt11tttt1tfti;,...,i1i;;ii;;i1i;,.........,i11111111tt111tft1tffffttfffftt11tffLLf\\n1t1ttfffft111tftttt1111ttt11;:,......;11iii;;1t11;......,.,,.,i1111111111t11tt1tfffttfffffffttfLLLLf\\ntftt1tftt1tt11ttt11ttt11i;:,.........:1tt1i;i1111;............;t11t1111111111tttffttttffffftt1tffLLf\\ntfftttttttttt111111tttt1,.............:;;;;;;;;:;:............:tt11111111tttt11tttffftttfft1tt1tffft\\n1ttttt1ttttttt1111tt11ti................:;;;;;:,:,............,1tt111111tttffttttfLLLLfttttffffttttf\\ntffftttttttttt111tttt1ti................,;;;;::,:,.............ittt11111tttffftttffffffftttttttffttf\\ntfffttttfftttt111tttttt;.................:;;:::,:,.............:tt1111111ttffttttffLLfLfttfffffffttf\\ntffftttttttttt111tttttt;.................,:;:::,:.,:,,.........,it11111111ttt1tttffLLLLfttfffffffttf\\ntttft11ttttttt111tttttt:..................,::::,:,,;;;;;:,......itt11111t111tttttffLLLLfttfffftffttf\\nttttt1tttttttt1111t1ttt;...................,::,,:,:;;;iii;.....,1tt1111ttt11tftttffffffftttffftffttt\\nttttt11tt1111t111tt1ttt:...................,::,,:::;;iiii;,.....:i1t1111t111tttttttttffft1tftttffttt\\nttttt11ttttttt11ttttttt:....................::,,:..,,:;ii:...... .1t111111ttttt1ttffffft11ttttttfttt\\nttttt1tttttttt111tttttt:....................,::,:. ..::,......,1t1111111ttt1111tfttttt11ttttttfttt\\n1111111tttttt1111ttt1tt:.... ...............,:,,:..............,1t1111111tttt1111ttt1ttt111ttttttt1t\\n11111111111111111111111;;;;:,...............,:,,:....... ...,,:1ttt11111111111111111111111111111t111\\n11111111111111111111111iiiiii:...............,,,:........,:i11tt1tt111111111111111111111111111111111\\n11111111111111111111111iiiiiii...............,,,:.......,1tttt11tt1111t111111111111111111111111t1111\\n1111111111111111111111i;iiiiii,..............,.,:........ittt11t111111111111111111111111111111111111\\n111111111111111111111111iiii;,...............::::,,......:1ttttt11t111111111111111111111111111111111\\n1111111111111111111111111i:,. ...............:i;:::,......itttttt1ttt111t1tt111111111111111111111111\\n11111111111111111111111111:................. :i;;;::,.....;ttttttttttttttt1ttttt111111111ttttttt1111\\n11111111111111111111111111:................. :i;;;;::,....:tttttttttttttttttttttt11t11t1111ttttt1111\\n\",\n \"tttftttttttttttttttttfffttttt1t1ttttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11tfffffftttt1111111111111111ttffttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttfffffffLLfttttttt111tttt1\\nttttttttttttttttfffffttfffffffLffffttttttttttt1tffffffffffttttttt1111ttffffffLLfttffffffttt1111tttt1\\nttttttttttttfffftttftttffffffffftttfttttt111ttt1ttfffffftttttt111tt11111ttffffLLffttfLLff111111ttttt\\nttttttttttffLLLLftttttfLLLftttttttffttttttttffft1tffffftttfffft11tt11tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLffttfffftfffttttttfffffftfttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffffffttft111i;ii1ttfffftttffffffffffft111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftft1i:::,,,,::;;1fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfftfLffftfffLf1;,,,,,,,::,,:1tttttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\\nttfLfftfffLLLLLfffftfLfftttfffffLLf1;;;;;iiiii:,:1tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffffftttffLLfffttttfffffttfLLLffLfiiiii111111i::1tffffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttftttttttffftttttttttttttfffLffLfii;;;iiiiiii;:1ftffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttfttffLfffLti;:;;ii;ii1;;ttffffftttttffft11111tfttffftttttttttttttfLLfffftft\\nttffffffffftttfffffffftttfftttftttt1i;;;ii11111ii1ttffft11ttttffft1111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffftttttt111tfff1ii;;;iiiiiii1111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\n1tfffffffffttfffffffftt1ttt1111tffft1i;;;iiiiii;;i111111tfffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\\ntttttttttffttfftttttt1ttfft1111tttftt1;;;iiiiii;:;tt11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tfffft1tt11ttft11;;;;;iiii;;;1t11ttttffftt11t1111tftt1tt1tffftt1111ttfftfLffftt\\nttttffffttt11tttttft1ttfffttfft11tftiii;;;;iiii;;;;:;ii1tttft111tt1111ttt11tt1tffffftttttttttttttftt\\n111tfffffft1ttfttttt11tfftttfttt11i:,ii;;;;;iii;i:.....,,::;i111t11111tt111tft1fffffttfffftt11tffLLf\\n1t1ttfffft111tffttt1111tft1ft1i;:,...;1i;;;;;;i11:...........,;1111111111t11tt1tfffttfffffffttfLLLLf\\ntftt1tftt1tt11tft11ttt111111;:,......,111ii;;i1t1:........,,...;11t1111111111tttffttttffffftt1tffLLf\\ntffttttttttttt1111ttttt11;:,.........,i111i;i1t1;,.............,1t1111111tttt11t1tfLftttfft1tt1tffft\\n1ttttttttttttt1111ttt11ti,............,::::;;;i;:,..............it111111tttffttttfLLLffttttffffttttf\\ntfffttttffttttt11ttttttti...............,;;;;;;;:...............:t111111tttffftttffffffftttttttffttf\\ntfffttttfffttft11ttttttt;...............,:;;;;:::...............,1t111111ttffttttffLLfLfttfffffffttf\\ntffft1ttttttttt11ttttttt:................,;;;;:::................it1111111ttt1tttffLLLLfttfffffffttf\\ntffft1tttttttt111ttttttt:................,:;;::::................:t1111tt111tttttffLLLLfttfffftffttf\\nttttt1tttttttt111111tt1t;.................,::::::................,1t111ttt11tftttfffffffttfffftffttt\\nttttt1tttt11tt111ttttttt:.,:;:............,::::::................,itt111t111ttt1tttttfft11tftttffttt\\nttttt1tttttttt11tttttttt;:;iii:............,:::::...........,:,....:1t11111tttt11tfffttt11ttttttfttt\\nttttt1tttttttt111ttttttt;;iiiii:. ..........:::::...........,;;;;:..it1111tft1111ttttttt11ttttttfttt\\n1111111tttttt1111ttttttt:;iiiii;............,::::,........,::;;iii;it111ttttt11111tt1ttt111ttttttt1t\\n111111111111111111111111:;;iiii;,...........,:,::,.........,;;iiii;it111111111111111111111111111tt11\\n111111111111111111111111;:;:;;;,............,::::,...........:;;ii;it1111111111111111111111111111111\\n111111111111111111111111;::.... .............,:::,,......... .,,:i1t1111111111111111111111111111111\\n111111111111111111111111i;,..................,,,:,,....... .;,..,;11111111111111111111111111111t1111\\n1111111111111111111111111i;:;i;,..............,,:,,,........1tii11t111111111111111111111111111111111\\n111111111111111111111111111111:..............,:::;;:,.......;ttttttttt11t1tt111111111111111111111111\\n11111111111111111111111111111;,..............:i;;ii;;:,.....,1ttt1tttttttt1ttttt1111111111tttttt1111\\n1111111111111111111111111111i,...............,i;;iiii;:......ittttttttttttttttttt11t11t1111ttttt1111\\n\",\n \"tttftttttttttttttttttfffttttt1t1ttttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt111tttt1\\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt1111ttfffffffLftttfffffttt1111tttt1\\nttttttttttttfffftttftttffffffffftttfttttt111ttt1ttfffffftttttt111tt11111ttffffLLffttfLLff111111ttttt\\nttttttttttffLLLLftttttfLLLftttttttffttttttttffft1ttfffffttfffft11tt11tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftffftttttfffffffffttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffLffftfftttttfftffffffftttffffffffffft111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftfftt11iii;:;;i1tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfLLLLLLLLLLfttfftfLffttfffLLft1;:::,,,,::;;1ttttttffffffftt1111ttt1ttt1ttfttt1ttffffLLLLLfttt\\nttfLLftfffLLLLLLLfftfLfftttfLfffLLLfti;,,,,:::::,,;fffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntfffffttttfLLfffttttfffffttLLLLffLLf1ii;;iiii11i:,;tfffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttfffLffLLf1iiiiiii1111;:;tffffftt1ttt111111tffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttfttffLfffLf111;;;ii;;i1i:itfffftttttffft11111tfttffftttttttttttttfLLfffftft\\nttffffffffftttffffffffttffftttftttttt1i;;;iii;iii;ifftft11tttttffft111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffftttttt111tffft11i;;;ii11111111tt111tffftttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\n1tfffffffffttfffffffftt1ttt1111fffft111i;;;iiiiiii11111ttfffft11111111tfft1tttttt1tfffffLfftttfLLLLL\\ntttttttttffttfftttttt1ttftt1111ttffttt1i;;;iiii;;;1t11ttttfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt1ttfffftttt11ttft1t1i;;iiiii;:;1t111tttffftt11t1111tftt1tt1tffftt1111ttfftfLffftt\\nttttfffftttt1ttttfft1tffffttfft11tft111i;;;;;ii;:;i11111ttttt1111t1111ttt11tt1tfffffttttttttttttffft\\n111tfffffftttffftttt11tfftttfttt1ttt1i1i;;;;iiiiii::;i111tt11111t11111tt111tft1fffffttfffftt1ttfLLLf\\n1t1ttfffft111tffttt1111tfttft11tti;::,i1;;;;;iii11:...,,::;i1tt1111111111t11tt1tfffttfffffffttfLLLLf\\ntttt1tftt1tt11ttt11ttt1111tt11i;,,....;1i;;;;;;i11:.,.......,,:i11t1111111111tttffttttffffftt1tffLLf\\ntffttttttttttt1111ttttt111i;:,........;1t1ii;;i1ii,.............;t1111111tttt11t1tfLftttfft1tt1tffft\\n1ttttttttttttt1111tttttt11:...........:iiiiii1tti,..............,1t11111tttttttttfLLLffttttffffttttf\\ntfffttttffttttt11ttttttt1i,.............,:::;;ii;,...............;t11111ttttfftttffffffftttttttffttf\\ntfffttttfffffft11ttttttt1;..............,:;;;;;;:,...............,1111111ttffttttffLLfLfttfffffffttf\\ntffftttttttttt111ttttttt1:.......... ....:;;;;;;:,................it111111tttttttffLLLLfttfffffffttf\\ntffft1tttttttt111ttttttt1,........,,:;:,.,;;;;;:;,................;t1111t111tttttffffLLfttfffffffttf\\nttttt1tttttttt1111t1tttt1,.......;;;;;:,..:;;::::,................,1t11ttt11tftttfffffffttfffftffttt\\nttttt1tttt11tt111ttttttt1:......;;;;;;;:,.:;;::::,................,it111t1111tt11ttttfft11tftttffttt\\nttttt1tttttttt11tttttttti,......:;:;;;:...,:;::::,.................:1t11111tt1t11tfffttt11ttttttfttt\\nttttt1tttttttt11tttttttti,......:;:;;:.....,:::::,..................:11111ttt1111ttttttt11ttttttfttt\\n1t1t111tttttt111111ttttt;...,,,.,:::. ......:::::,...................,111tttt11111ttttt1111ttttttt1t\\n111111111111111111111111,,,,,,,.............,:::::,..................,1t111111111111111111111111tt11\\n11111111111111111111111i,,..:,..............,,::::,,.................,11tt11111111111111111111111111\\n111111111111111111111111;...................,:,,::,,.................,;ii11t111111111111111111111111\\n111111111111111111111111i,..................,:::::,,................:::;;;i111t111111111111111111111\\n1111111111111111111111111i;;;;i1:............::,:,,,,........... ..::;;;;i1111111111111111111111111\\n111111111111111111111111111111t1,............,.,:,,,:,,........:,,..,:;;;i11t11111111111111111111111\\n1111111111111111111111111111111i.............,,::;;;i;:,...... :111i;::;;;1ttttt11t1111111tttttt1111\\n111111111111111111111111111111ti.............:1;;1iiii;:,.......i1tttt11111tt1tt111111t1111ttttt1111\\n\",\n \"tttttttttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt11111tffffffffftttfffffttt11111ttt1\\nttttttttttttfffftttffttffffffffftttfttttt111ttt1ttfffffftttttt11tt111111ttffffLLffttfLLff111111ttttt\\nttttttttttffLLLLftttttfLLLfttttttffffttttttfffft1tffffffttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfffttttttfffffftfttfftffffffffttt111tftt11t11tfLLLftt11tffft1tttttt\\ntttttttfLfLLLLLLLLffttfttttffLLfftffttttffffffffffftttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLLftffttttttt11i;ii1tftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfLLLLLLLLLLfttfftfffffffffLLfttt1i;::,,,,:;;1tttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\\nttfLLftfffLLLLLLLfftfLfftttfLfffLLLLttt1;,,,,,,,::,:iftt11tfffft11111tffft1tt11tt1ttttfffLLLLLLLLfff\\ntfffffttttfLLfffttttfffffttLLLLfLLLftt1i;;;;;;iiii:,;fftt11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttffLLffLLftt1;iiiii11111i::tfffft1ttt111111tffftfffftttttttt1ttfLLLLffffff\\nttfLffffffftttfffffffffttfttffLfffLftt1;i;;;iiiiiii;;tfftttttffft11111tfttffftttttttttttttfLLftfffft\\nttffffffffftttffffffffftffftttfttftttttii;;;;ii;;ii;iftt11tttttfft1111tt1tffttffttfffffLLfffffffffLL\\nttffffffffttttfffffffftttttt11ttfffttt11ii;;ii1111ii11111tffftttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\n1ttffffffffttfffffffftt1ttt111tffffttt1i1i;;;iiiiii1111ttfffft11t11111tfft1tttttt1ttffffLfftttfLLLLf\\ntttttttttffttfftttttt1ttfff1111ttffttttt1i;;;;i;:;it11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tfffftttt11tfftt11tt1;;;ii;;;1t111tttffftt11t1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttfffftttt1ttttfft1tffffttfftt1tft1111t1;;;;i;:;i11111tttft111tt1111ttt11tt1tfffffttttttttttttffft\\n1tttfffffftttffftfft11tfffttfttttttt11111i;;:;iiii1i;i1t1tt11111t11111tt111tft1fffffttfffftt1ttffLLf\\n1t1tffffft111tffttt1111tfttft11tt1t1i;;;1i;;;;ii1ii1,.,:;ii1tt11111111111t11tt1tfffttfffffffttfLfLLf\\ntfttttftt1tt11ttt11ttt11t1t11tt11i:,...,11;;;;;it111,,.....,:;i11tt1111111111tttffttttffffftt1tffLLf\\ntffttttttttttt1111ttftt111111i;:,......:1t1i;;;;i1t1,..........,:i1111111tttt11t1tfLftttfft1tt1tffft\\n1ttttttttttttt1111ttttt111tt;..........:1111iii1;11:.............,it1111tttttt1ttfLLLffttttffffttttf\\ntfffttttffttttt11ttttttt11t1,...........,,:::;;i;;:...............:t1111ttttfft1tffffffftttttttffttf\\ntfffttttfffffft11ttttttt111i..............:;:::;;::...............,1t1111ttffttttffLLfLfttfffffffttf\\ntfffttttttttttt11ttttttt111:..............,;;;;;;:,................;t11111ttt1t1tffLLLLfttfffffffttf\\ntffft1tttttttt111ttttttt11i,..........,::::;;;;;;:,................,1t11t111tttttffffLLfttfffffffttf\\nttttt1tttttttt111tt1tttt11i.........:;;;;:,;;::::::.................;t1ttt11tftttffffffftttffftffttt\\nttttt1tttt11tt111ttttttt111,.......;;;;;;:,:;::::::,................:tttt1111tt11ttfttft11tftttffttt\\nttttt1tttttttt11tttttttt11;,......,;;;;;;:::;::::::,................,itt111t11t11ttftttt11ttttttfttt\\nttttt1tttttttt11tttttttt11;,......:;;;;i;...,:::::,,.................:tt1tttt1111ttttttt11ttttttfttt\\n1t1t111tttttt111tttttttt1;,.,.....,:;:......,:::::,,..................it1tttt11111tttt11111ttttttt1t\\n1111111111111111111111111:,,,......,,. .....,,::::,,..................,1t11111111111111111111111tt11\\n1111111111111111111111111,,....,,...........,,,:::::,..................itt11111111111111111111111111\\n1111111111111111111111111;,.................,:::::::,,................:1tt11111111111111111111111111\\n11111111111111111111111111:.... ............,:::,:,,.................,1tt11111111111111111111111111\\n11111111111111111111111111ii;;;;;i, .........,,::,,,,,................,:;;1tt11111111111111111111111\\n11111111111111111111111111111111t1,..........,,,:,,:,:,,. ...........,:::;;i11tt11111111111111111111\\n11111111111111111111111111111111t;.............,:::;;;;:,........ .,:::;;:;i1t111111111ttttttt11111\\n111111111111111111111111111111111:...........,;;;i1iiii;:,.......::,,::::;;i1ttt111t11t1111ttttt1111\\n\",\n \"tttftttttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt11111111t\\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttftttttttttttttffffLffttfffffffLfffttttttttt111tfffffffftttttttt11111ttttttfffftfLLfttttttt111tttt1\\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt11111tfffffffffttffffffttt11111ttt1\\ntttttttttttffffftttffttffffffffftttfttttt111ttt1ttfffffftttttt11tt111111ttffffLLffttfLLfft11111ttttt\\nttttttttttffLLLLftttttfLLLfttttttffLftttttttffft1ttfffffttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffffftftttfffffffttt111tftt11t11tfLLfftt11tffft11ttttt\\ntttttttfffLLLLLLLLffttfttttfLLLfftffttttffftt1iii11tttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLffffftttttfti;;::,,,:;i1tffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttfffffLLLLLLLLLLfttfftfLfffffffLLfttttt1;,,,,,,,::,:ittffffffftt1111ttt1ttt1tftttt1ttffffLLLLLfttt\\nttfLLffffLLLLLLLLfftfLfftttfLfffLLLLfttt1i;:::;;iiii;,;t11tfffft11111tffft1tt1ttt1ttttfffLLLLLLLLfff\\ntffffftttffLLLffttttfffffttLLLLfLLLffttf1;;iiii11111i::1t11tttt1ttt11tfffttfftttttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttfffLffLLftttti:;;;;iiiiiii;;tftt1ttt111111tffftfffftttttttt1ttfLLLLffffff\\nttfLffffffftttfffffffffttfttffLfffLfttttti;;;;;iii;i1iiftttttffft11111tfttffftttttttttttttfLLftfffft\\nttffffffffftttffffffffftfffftffffftttttft11i;;;iiii1iiit11tttttfft1111tt11ffttffttfffffLLfffffffffLL\\nttffffffffttttfffffffftttttt1tttffftttttti1i;;;ii11iii111tffftttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\n1ttffffffffttfffffffftt1ttt1111tfffftttt111i;;iiiiii111ttfffft11t11111tfftttttttt1ttffffLfftttfLLLLf\\ntttttttttffttfftttttt1ttfftttt1ttfftttttt111i;i;:;ii11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tfffftttt11tfftt1ttt111;;i;;;iii1ttttffftt11t1111ttt11tt1tffttt1111ttfftfLffftt\\ntfttffffttt11tttttft1tffffttffttttft111ttt11;;;;:;i1i1;;11tft111tt1111tt111tt1tfffffttttt11tttttffft\\n1tttfffffftttffftfft11tfftttffttttft1111iii1;;;i;iiii1i,,,:;;i11tt1111tt111tft1fffffttfffftt11tffLLf\\n111ttfffftt1ttffttt1111tfttft11tt1t1i;:,,,;1i;;i1ii;iti,,.....,:;i1t11111t11tt1tfffttffffffft1fffLLf\\ntfttttftt1tt11tft11ttt11tttt1tt11i;:,.....;11i;i1i;1tt;,,.........,:i11111111t1tffttttffffftt1tfffLf\\ntffttttttttftt1111ttttt11111tft;,.........;11111i1ttti,.............,1111tttt1111tffftttfft1tt1tffft\\n1ttttttttttttt1111tttttt11tfff1,...........,:;;;;;11i:...............itttttttt1ttfffLffttttffffttttf\\ntfffttttffttttt11ttttttt11tfffi............ ,:;;;;;;;,...............;t1ttttfft1tffffffftttttttffttf\\ntfffttttfffffft11tttttttttt1tf;..............:;;;;;;;,...............:111ttttttttfffLfLfttfffffffttf\\ntfffttttftftft111ttttttt11t111:..............:;;;;;::,...............,1t11ttt1t1tffLLLLfttfffffffttf\\ntfffttttfttttt111ttttttt11ttt1:..............,;;;::;::................itt111tttttffffLLfttfffffffttf\\ntttttttttttttt111ttttttt1ttfft:..............,;;;;::::................:1tt11tft1tffffffftttffttffttt\\nttttt1tttt11tt11tttttttt1tttt1;.,::,..........:;:::;::,...............,1t1111tt11tttttft11tfttttfttt\\nttttt1tttttttt11ttttttttt1ttt1;,:;;:..........,::::::,,................it11111111ttftttt11ttttttfttt\\nttttt1tttttttt11tttttttttttttiiiiii;,.........,:::::::,................:ttttt1111ttttttt11ttttttfttt\\n1t1111tttttttt11tttttttt1ttt1;;;;ii;,.........,:::::::,.................ittttt1111tttt11111ttttttt1t\\n11111111111111111111111111tt1;;;;ii;...........::::::::................ :1t111111111111111111111t111\\n11111111111111111111111111tt1;::;;i:...........,:::::::,...............,itttt11111111111111111111111\\n11111111111111111111111tttttt;,,,::............,::::::,,...............ittttt11111111111111111111111\\n1111111111111111111111111tttt1:,,..............,:::::,,,,.......,:;::,:1t1111111111111111111111t1111\\n11111111111111111111111111111111i;;i:..........,:,,,.,,.,.......::;;i;it1ttt111111111111111111111111\\n1111111111111111111111111111111111ti...........,,.,:,:;::,......,:;;ii1ttttt11111111111111111t111111\\n1111111111111111111111111111111111t;...........,;iiiiiii;:,......:;;;i1ttttt111t1111111111tttttt1111\\n11111111111111111111111111111111111:...........,;i11iiii;:,.......,:i1tttttt1ttttt1t11t1111ttttt1111\\n\",\n];\n\nfunction isApr1(): boolean {\n const d = new Date();\n // Months are 0 indexed\n return d.getMonth() === 3 && d.getDate() === 1;\n}\n\nexport const Apr1Events = new EventEmitter();\n\nexport function Apr1(): React.ReactElement {\n const [open, setOpen] = useState(isApr1());\n const [n, setN] = useState(0);\n\n useEffect(() => {\n const id = setInterval(() => setN((n) => (n + 1) % frames.length), 100);\n return () => clearInterval(id);\n }, []);\n\n useEffect(\n () =>\n Apr1Events.subscribe(() => {\n setOpen(true);\n }),\n [],\n );\n\n if (!open) return <></>;\n\n return (\n <Modal open={open} onClose={() => setOpen(false)}>\n <pre style={{ color: \"#0f0\" }}>{frames[n]}</pre>\n <div style={{ display: \"none\" }}>\n <iframe\n width=\"560\"\n height=\"315\"\n src=\"https://www.youtube.com/embed/a3Z7zEc7AXQ?autoplay=1\"\n title=\"YouTube video player\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n ></iframe>\n </div>\n </Modal>\n );\n}\n","/**\n * Class representing a Script instance that is actively running.\n * A Script can have multiple active instances\n */\nimport { Script } from \"./Script\";\nimport { ScriptUrl } from \"./ScriptUrl\";\nimport { Settings } from \"../Settings/Settings\";\nimport { Terminal } from \"../Terminal\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { formatTime } from \"../utils/helpers/formatTime\";\nimport { ScriptArg } from \"../Netscript/ScriptArg\";\n\nexport class RunningScript {\n // Script arguments\n args: ScriptArg[] = [];\n\n // Map of [key: hostname] -> Hacking data. Used for offline progress calculations.\n // Hacking data format: [MoneyStolen, NumTimesHacked, NumTimesGrown, NumTimesWeaken]\n dataMap: Record<string, number[]> = {};\n\n // Script filename\n filename = \"\";\n\n // This script's logs. An array of log entries\n logs: string[] = [];\n\n // Flag indicating whether the logs have been updated since\n // the last time the UI was updated\n logUpd = false;\n\n // Total amount of hacking experience earned from this script when offline\n offlineExpGained = 0;\n\n // Total amount of money made by this script when offline\n offlineMoneyMade = 0;\n\n // Number of seconds that the script has been running offline\n offlineRunningTime = 0.01;\n\n // Total amount of hacking experience earned from this script when online\n onlineExpGained = 0;\n\n // Total amount of money made by this script when online\n onlineMoneyMade = 0;\n\n // Number of seconds that this script has been running online\n onlineRunningTime = 0.01;\n\n // Process ID. Must be an integer and equals the PID of corresponding WorkerScript\n pid = -1;\n\n // How much RAM this script uses for ONE thread\n ramUsage = 0;\n\n // hostname of the server on which this script is running\n server = \"\";\n\n // Number of threads that this script is running with\n threads = 1;\n\n // Script urls for the current running script for translating urls back to file names in errors\n dependencies: ScriptUrl[] = [];\n\n constructor(script: Script | null = null, args: ScriptArg[] = []) {\n if (script == null) {\n return;\n }\n this.filename = script.filename;\n this.args = args;\n this.server = script.server;\n this.ramUsage = script.ramUsage;\n this.dependencies = script.dependencies;\n }\n\n log(txt: string): void {\n if (this.logs.length > Settings.MaxLogCapacity) {\n this.logs.shift();\n }\n\n let logEntry = txt;\n if (Settings.TimestampsFormat) {\n logEntry = \"[\" + formatTime(Settings.TimestampsFormat) + \"] \" + logEntry;\n }\n\n this.logs.push(logEntry);\n this.logUpd = true;\n }\n\n displayLog(): void {\n for (let i = 0; i < this.logs.length; ++i) {\n Terminal.print(this.logs[i]);\n }\n }\n\n clearLog(): void {\n this.logs.length = 0;\n }\n\n // Update the moneyStolen and numTimesHack maps when hacking\n recordHack(hostname: string, moneyGained: number, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][0] += moneyGained;\n this.dataMap[hostname][1] += n;\n }\n\n // Update the grow map when calling grow()\n recordGrow(hostname: string, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][2] += n;\n }\n\n // Update the weaken map when calling weaken() {\n recordWeaken(hostname: string, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][3] += n;\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): IReviverValue {\n return Generic_toJSON(\"RunningScript\", this);\n }\n\n // Initializes a RunningScript Object from a JSON save state\n static fromJSON(value: IReviverValue): RunningScript {\n return Generic_fromJSON(RunningScript, value.data);\n }\n}\n\nReviver.constructors.RunningScript = RunningScript;\n","import { FactionNames } from \"./Faction/data/FactionNames\";\nimport { CityName } from \"./Locations/data/CityNames\";\nimport { StaticAugmentations } from \"./Augmentation/StaticAugmentations\";\nimport { augmentationExists, initAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { initBitNodeMultipliers } from \"./BitNode/BitNode\";\nimport { Companies, initCompanies } from \"./Company/Companies\";\nimport { resetIndustryResearchTrees } from \"./Corporation/IndustryData\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Factions, initFactions } from \"./Faction/Factions\";\nimport { joinFaction } from \"./Faction/FactionHelpers\";\nimport { updateHashManagerCapacity } from \"./Hacknet/HacknetHelpers\";\nimport { prestigeWorkerScripts } from \"./NetscriptWorker\";\nimport { Player } from \"@player\";\nimport { recentScripts } from \"./Netscript/RecentScripts\";\nimport { resetPidCounter } from \"./Netscript/Pid\";\nimport { LiteratureNames } from \"./Literature/data/LiteratureNames\";\n\nimport { GetServer, AddToAllServers, initForeignServers, prestigeAllServers } from \"./Server/AllServers\";\nimport { prestigeHomeComputer } from \"./Server/ServerHelpers\";\nimport { SpecialServers } from \"./Server/data/SpecialServers\";\nimport { deleteStockMarket, initStockMarket, initSymbolToStockMap } from \"./StockMarket/StockMarket\";\nimport { Terminal } from \"./Terminal\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\n\nimport { staneksGift } from \"./CotMG/Helper\";\nimport { ProgramsSeen } from \"./Programs/ui/ProgramsRoot\";\nimport { InvitationsSeen } from \"./Faction/ui/FactionsRoot\";\nimport { CONSTANTS } from \"./Constants\";\nimport { LogBoxClearEvents } from \"./ui/React/LogBoxManager\";\n\nconst BitNode8StartingMoney = 250e6;\n\n// Prestige by purchasing augmentation\nexport function prestigeAugmentation(): void {\n initBitNodeMultipliers();\n\n const maintainMembership = Player.factions.concat(Player.factionInvitations).filter(function (faction) {\n return Factions[faction].getInfo().keep;\n });\n Player.prestigeAugmentation();\n\n // Delete all Worker Scripts objects\n prestigeWorkerScripts();\n\n const homeComp = Player.getHomeComputer();\n // Delete all servers except home computer\n prestigeAllServers();\n\n // Reset home computer (only the programs) and add to AllServers\n AddToAllServers(homeComp);\n prestigeHomeComputer(homeComp);\n\n if (augmentationExists(AugmentationNames.Neurolink) && Player.hasAugmentation(AugmentationNames.Neurolink, true)) {\n homeComp.programs.push(Programs.FTPCrackProgram.name);\n homeComp.programs.push(Programs.RelaySMTPProgram.name);\n }\n if (augmentationExists(AugmentationNames.CashRoot) && Player.hasAugmentation(AugmentationNames.CashRoot, true)) {\n Player.setMoney(1e6);\n homeComp.programs.push(Programs.BruteSSHProgram.name);\n }\n if (augmentationExists(AugmentationNames.PCMatrix) && Player.hasAugmentation(AugmentationNames.PCMatrix, true)) {\n homeComp.programs.push(Programs.DeepscanV1.name);\n homeComp.programs.push(Programs.AutoLink.name);\n }\n\n if (Player.sourceFileLvl(5) > 0 || Player.bitNodeN === 5) {\n homeComp.programs.push(Programs.Formulas.name);\n }\n\n // Re-create foreign servers\n initForeignServers(Player.getHomeComputer());\n\n // Gain favor for Companies\n for (const member of Object.keys(Companies)) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].gainFavor();\n }\n }\n\n // Gain favor for factions\n for (const member of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(member)) {\n Factions[member].gainFavor();\n }\n }\n\n // Stop a Terminal action if there is one.\n if (Terminal.action !== null) {\n Terminal.finishAction(true);\n }\n Terminal.clear();\n LogBoxClearEvents.emit();\n\n // Re-initialize things - This will update any changes\n initFactions(); // Factions must be initialized before augmentations\n\n Player.factionInvitations = Player.factionInvitations.concat(maintainMembership);\n initAugmentations(); // Calls reapplyAllAugmentations() and resets Player multipliers\n Player.reapplyAllSourceFiles();\n initCompanies();\n\n // Apply entropy from grafting\n Player.applyEntropy(Player.entropy);\n\n // Gang\n const gang = Player.gang;\n if (gang) {\n const faction = Factions[gang.facName];\n if (faction) joinFaction(faction);\n const penalty = 0.95;\n for (const m of gang.members) {\n m.hack_asc_points *= penalty;\n m.str_asc_points *= penalty;\n m.def_asc_points *= penalty;\n m.dex_asc_points *= penalty;\n m.agi_asc_points *= penalty;\n m.cha_asc_points *= penalty;\n }\n }\n\n // BitNode 3: Corporatocracy\n if (Player.bitNodeN === 3) {\n homeComp.messages.push(LiteratureNames.CorporationManagementHandbook);\n }\n\n // Cancel Bladeburner action\n if (Player.bladeburner) {\n Player.bladeburner.prestige();\n }\n\n // BitNode 8: Ghost of Wall Street\n if (Player.bitNodeN === 8) {\n Player.money = BitNode8StartingMoney;\n }\n if (Player.bitNodeN === 8 || Player.sourceFileLvl(8) > 0) {\n Player.hasWseAccount = true;\n Player.hasTixApiAccess = true;\n }\n\n // Reset Stock market\n if (Player.hasWseAccount) {\n initStockMarket();\n initSymbolToStockMap();\n }\n\n // Red Pill\n if (augmentationExists(AugmentationNames.TheRedPill) && Player.hasAugmentation(AugmentationNames.TheRedPill, true)) {\n const WorldDaemon = GetServer(SpecialServers.WorldDaemon);\n const DaedalusServer = GetServer(SpecialServers.DaedalusServer);\n if (WorldDaemon && DaedalusServer) {\n WorldDaemon.serversOnNetwork.push(DaedalusServer.hostname);\n DaedalusServer.serversOnNetwork.push(WorldDaemon.hostname);\n }\n }\n\n if (\n augmentationExists(AugmentationNames.StaneksGift1) &&\n Player.hasAugmentation(AugmentationNames.StaneksGift1, true)\n ) {\n joinFaction(Factions[FactionNames.ChurchOfTheMachineGod]);\n }\n\n staneksGift.prestigeAugmentation();\n\n resetPidCounter();\n ProgramsSeen.splice(0, ProgramsSeen.length);\n InvitationsSeen.splice(0, InvitationsSeen.length);\n}\n\n// Prestige by destroying Bit Node and gaining a Source File\nexport function prestigeSourceFile(flume: boolean): void {\n initBitNodeMultipliers();\n\n Player.prestigeSourceFile();\n prestigeWorkerScripts(); // Delete all Worker Scripts objects\n\n const homeComp = Player.getHomeComputer();\n\n // Stop a Terminal action if there is one.\n if (Terminal.action !== null) {\n Terminal.finishAction(true);\n }\n Terminal.clear();\n LogBoxClearEvents.emit();\n\n // Delete all servers except home computer\n prestigeAllServers(); // Must be done before initForeignServers()\n\n // Reset home computer (only the programs) and add to AllServers\n AddToAllServers(homeComp);\n prestigeHomeComputer(homeComp);\n\n // Re-create foreign servers\n initForeignServers(Player.getHomeComputer());\n\n if (Player.sourceFileLvl(9) >= 2) {\n homeComp.setMaxRam(128);\n } else if (Player.sourceFileLvl(1) > 0) {\n homeComp.setMaxRam(32);\n } else {\n homeComp.setMaxRam(8);\n }\n homeComp.cpuCores = 1;\n\n // Reset favor for Companies\n for (const member of Object.keys(Companies)) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].favor = 0;\n }\n }\n\n // Reset favor for factions\n for (const member of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(member)) {\n Factions[member].favor = 0;\n }\n }\n\n // Stop a Terminal action if there is one\n if (Terminal.action !== null) {\n Terminal.finishAction(true);\n }\n\n // Delete all Augmentations\n for (const name of Object.keys(StaticAugmentations)) {\n if (StaticAugmentations.hasOwnProperty(name)) {\n delete StaticAugmentations[name];\n }\n }\n\n // Give levels of NeuroFluxGovernor for Source-File 12. Must be done here before Augmentations are recalculated\n if (Player.sourceFileLvl(12) > 0) {\n Player.augmentations.push({\n name: AugmentationNames.NeuroFluxGovernor,\n level: Player.sourceFileLvl(12),\n });\n }\n\n // Re-initialize things - This will update any changes\n initFactions(); // Factions must be initialized before augmentations\n initAugmentations(); // Calls reapplyAllAugmentations() and resets Player multipliers\n Player.reapplyAllSourceFiles();\n initCompanies();\n\n if (Player.sourceFileLvl(5) > 0 || Player.bitNodeN === 5) {\n homeComp.programs.push(Programs.Formulas.name);\n }\n\n // BitNode 3: Corporatocracy\n if (Player.bitNodeN === 3) {\n homeComp.messages.push(LiteratureNames.CorporationManagementHandbook);\n dialogBoxCreate(\n \"You received a copy of the Corporation Management Handbook on your home computer. \" +\n \"Read it if you need help getting started with Corporations!\",\n );\n }\n\n // BitNode 8: Ghost of Wall Street\n if (Player.bitNodeN === 8) {\n Player.money = BitNode8StartingMoney;\n }\n if (Player.bitNodeN === 8 || Player.sourceFileLvl(8) > 0) {\n Player.hasWseAccount = true;\n Player.hasTixApiAccess = true;\n }\n\n // Bit Node 10: Digital Carbon\n if (Player.bitNodeN === 10) {\n dialogBoxCreate(\"Visit VitaLife in New Tokyo if you'd like to purchase a new sleeve!\");\n }\n\n if (Player.bitNodeN === 13) {\n dialogBoxCreate(`Trouble is brewing in ${CityName.Chongqing}`);\n }\n\n // Reset Stock market, gang, and corporation\n if (Player.hasWseAccount) {\n initStockMarket();\n initSymbolToStockMap();\n } else {\n deleteStockMarket();\n }\n\n Player.gang = null;\n Player.corporation = null;\n resetIndustryResearchTrees();\n Player.bladeburner = null;\n\n // Source-File 9 (level 3) effect\n if (Player.sourceFileLvl(9) >= 3) {\n const hserver = Player.createHacknetServer();\n\n hserver.level = 100;\n hserver.cores = 10;\n hserver.cache = 5;\n hserver.updateHashRate(Player.mults.hacknet_node_money);\n hserver.updateHashCapacity();\n updateHashManagerCapacity();\n }\n\n if (Player.bitNodeN === 13) {\n Player.money = CONSTANTS.TravelCost;\n }\n staneksGift.prestigeSourceFile();\n\n // Gain int exp\n if (Player.sourceFileLvl(5) !== 0 && !flume) Player.gainIntelligenceExp(300);\n\n // Clear recent scripts\n recentScripts.splice(0, recentScripts.length);\n resetPidCounter();\n}\n","import { Player } from \"@player\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { Work, WorkType } from \"./Work\";\n\nexport const isSleeveSynchroWork = (w: Work | null): w is SleeveSynchroWork =>\n w !== null && w.type === WorkType.SYNCHRO;\n\nexport class SleeveSynchroWork extends Work {\n constructor() {\n super(WorkType.SYNCHRO);\n }\n\n process(sleeve: Sleeve, cycles: number): number {\n sleeve.sync = Math.min(100, sleeve.sync + Player.getIntelligenceBonus(0.5) * 0.0002 * cycles);\n if (sleeve.sync >= 100) sleeve.stopWork();\n return 0;\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveSynchroWork\", this);\n }\n\n /** Initializes a SynchroWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): SleeveSynchroWork {\n return Generic_fromJSON(SleeveSynchroWork, value.data);\n }\n}\n\nReviver.constructors.SleeveSynchroWork = SleeveSynchroWork;\n","import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { Work, WorkType } from \"./Work\";\n\nexport const isSleeveRecoveryWork = (w: Work | null): w is SleeveRecoveryWork =>\n w !== null && w.type === WorkType.RECOVERY;\n\nexport class SleeveRecoveryWork extends Work {\n constructor() {\n super(WorkType.RECOVERY);\n }\n\n process(sleeve: Sleeve, cycles: number): number {\n sleeve.shock = Math.min(100, sleeve.shock + 0.0002 * cycles);\n if (sleeve.shock >= 100) sleeve.stopWork();\n return 0;\n }\n\n APICopy(): Record<string, unknown> {\n return {\n type: this.type,\n };\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveRecoveryWork\", this);\n }\n\n /** Initializes a RecoveryWork object from a JSON save state. */\n static fromJSON(value: IReviverValue): SleeveRecoveryWork {\n return Generic_fromJSON(SleeveRecoveryWork, value.data);\n }\n}\n\nReviver.constructors.SleeveRecoveryWork = SleeveRecoveryWork;\n","import React from \"react\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface ICityProps {\n currentCity: CityName;\n city: CityName;\n onTravel: (city: CityName) => void;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n travel: {\n color: theme.colors.white,\n lineHeight: \"1em\",\n whiteSpace: \"pre\",\n cursor: \"pointer\",\n },\n }),\n);\n\nfunction City(props: ICityProps): React.ReactElement {\n const classes = useStyles();\n if (props.city !== props.currentCity) {\n return (\n <Tooltip title={<Typography>{props.city}</Typography>}>\n <span onClick={() => props.onTravel(props.city)} className={classes.travel}>\n {props.city[0]}\n </span>\n </Tooltip>\n );\n }\n return <span>{props.city[0]}</span>;\n}\n\ninterface IProps {\n currentCity: CityName;\n onTravel: (city: CityName) => void;\n}\n\nexport function WorldMap(props: IProps): React.ReactElement {\n // prettier-ignore\n return (\n <>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ,_ . ._. _. .</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> , _-\\','|~\\~ ~/ ;-'_ _-' ,;_;_, ~~-</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> /~~-\\_/-'~'--' \\~~| ', ,' / / ~|-_\\_/~/~ ~~--~~~~'--_</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / ,/'-/~ '\\ ,' _ , '<City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Volhaven} />,'|~ ._/-, /~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~/-'~\\_, '-,| '|. ' ~ ,\\ /'~ / /_ /~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>.-~ '| '',\\~|\\ _\\~ ,_ , <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Chongqing} /> /,</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> '\\ <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Sector12} /> /'~ |_/~\\\\,-,~ \\ \" ,_,/ |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | / ._-~'\\_ _~| \\ ) <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.NewTokyo} /></Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ __-\\ '/ ~ |\\ \\_ / ~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ., '\\ |, ~-_ - | \\\\_' ~| /\\ \\~ ,</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~-_' _; '\\ '-, \\,' /\\/ |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> '\\_,~'\\_ \\_ _, /' ' |, /|'</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / \\_ ~ | / \\ ~'; -,_.</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ~\\ | | , '-_, ,; ~ ~\\</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\, <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Aevum} /> / \\ / /| ,-, , -,</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ,/ | |' |/ ,- ~ \\ '.</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ,| ,/ \\ ,/ \\ <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Ishima} /> |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / | ~ -~~-, / _</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ,-' ~ /</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / ,' ~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ',| ~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~'</Typography>\n </>\n );\n}\n","import React from \"react\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { StealthIcon } from \"./StealthIcon\";\nimport { KillIcon } from \"./KillIcon\";\nimport { Action } from \"../Action\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport { Player } from \"@player\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n action: Action;\n}\n\nexport function SuccessChance(props: IProps): React.ReactElement {\n const estimatedSuccessChance = props.action.getEstSuccessChance(props.bladeburner, Player);\n\n let chance = <></>;\n if (estimatedSuccessChance[0] === estimatedSuccessChance[1]) {\n chance = <>{formatNumber(estimatedSuccessChance[0] * 100, 1)}%</>;\n } else {\n chance = (\n <>\n {formatNumber(estimatedSuccessChance[0] * 100, 1)}% ~ {formatNumber(estimatedSuccessChance[1] * 100, 1)}%\n </>\n );\n }\n\n return (\n <>\n Estimated success chance: {chance} {props.action.isStealth ? <StealthIcon /> : <></>}\n {props.action.isKill ? <KillIcon /> : <></>}\n </>\n );\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n children: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n}\n\nexport function StaticModal(props: IProps): React.ReactElement {\n return (\n <Modal open={props.open} onClose={props.onClose}>\n {props.children}\n </Modal>\n );\n}\n","import React from \"react\";\nimport { DarkWebItems } from \"./DarkWebItems\";\n\nimport { Player } from \"@player\";\nimport { Terminal } from \"../Terminal\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\nimport { DarkWebItem } from \"./DarkWebItem\";\nimport { isCreateProgramWork } from \"../Work/CreateProgramWork\";\n\n//Posts a \"help\" message if connected to DarkWeb\nexport function checkIfConnectedToDarkweb(): void {\n const server = Player.getCurrentServer();\n if (server !== null && SpecialServers.DarkWeb == server.hostname) {\n Terminal.print(\n \"You are now connected to the dark web. From the dark web you can purchase illegal items. \" +\n \"Use the 'buy -l' command to display a list of all the items you can buy. Use 'buy [item-name]' \" +\n \"to purchase an item. Use 'buy -a' to purchase all unowned items.\",\n );\n }\n}\n\nexport function listAllDarkwebItems(): void {\n for (const key of Object.keys(DarkWebItems)) {\n const item = DarkWebItems[key];\n\n const cost = Player.getHomeComputer().programs.includes(item.program) ? (\n <span style={{ color: `green` }}>[OWNED]</span>\n ) : (\n <Money money={item.price} />\n );\n\n Terminal.printRaw(\n <>\n <span>{item.program}</span> - <span>{cost}</span> - <span>{item.description}</span>\n </>,\n );\n }\n}\n\nexport function buyDarkwebItem(itemName: string): void {\n itemName = itemName.toLowerCase();\n\n // find the program that matches, if any\n let item: DarkWebItem | null = null;\n\n for (const key of Object.keys(DarkWebItems)) {\n const i = DarkWebItems[key];\n if (i.program.toLowerCase() == itemName) {\n item = i;\n }\n }\n\n // return if invalid\n if (item === null) {\n Terminal.error(\"Unrecognized item: \" + itemName);\n return;\n }\n\n // return if the player already has it.\n if (Player.hasProgram(item.program)) {\n Terminal.print(\"You already have the \" + item.program + \" program\");\n return;\n }\n\n // return if the player doesn't have enough money\n if (Player.money < item.price) {\n Terminal.error(\"Not enough money to purchase \" + item.program);\n return;\n }\n\n // buy and push\n Player.loseMoney(item.price, \"other\");\n\n Player.getHomeComputer().pushProgram(item.program);\n // Cancel if the program is in progress of writing\n if (isCreateProgramWork(Player.currentWork) && Player.currentWork.programName === item.program) {\n Player.finishWork(true);\n }\n\n Terminal.print(\n \"You have purchased the \" + item.program + \" program. The new program can be found on your home computer.\",\n );\n}\n\nexport function buyAllDarkwebItems(): void {\n const itemsToBuy: DarkWebItem[] = [];\n let cost = 0;\n\n for (const key of Object.keys(DarkWebItems)) {\n const item = DarkWebItems[key];\n if (!Player.hasProgram(item.program)) {\n itemsToBuy.push(item);\n cost += item.price;\n }\n }\n\n if (itemsToBuy.length === 0) {\n Terminal.print(\"All available programs have been purchased already.\");\n return;\n }\n\n if (cost > Player.money) {\n Terminal.error(\n \"Not enough money to purchase remaining programs, \" + numeralWrapper.formatMoney(cost) + \" required\",\n );\n return;\n }\n\n for (const item of itemsToBuy) {\n buyDarkwebItem(item.program);\n }\n}\n","import { KEY } from \"../utils/helpers/keyCodes\";\nimport { substituteAliases } from \"../Alias\";\n// Helper function to parse individual arguments into number/boolean/string as appropriate\nfunction parseArg(arg: string): string | number | boolean {\n // Handles all numbers including hexadecimal, octal, and binary representations, returning NaN on an unparsable string\n const asNumber = Number(arg);\n if (!isNaN(asNumber)) {\n return asNumber;\n }\n\n if (arg === \"true\" || arg === \"false\") {\n return arg === \"true\";\n }\n\n return arg;\n}\n\nexport function ParseCommands(commands: string): string[] {\n // Sanitize input\n commands = commands.trim();\n // Replace all extra whitespace in command with a single space\n commands = commands.replace(/\\s\\s+/g, \" \");\n\n const match = commands.match(/(?:'[^']*'|\"[^\"]*\"|[^;\"])*/g);\n if (!match) return [];\n // Split commands and execute sequentially\n const allCommands = match\n .map(substituteAliases)\n .map((c) => c.match(/(?:'[^']*'|\"[^\"]*\"|[^;\"])*/g))\n .flat();\n\n const out: string[] = [];\n for (const c of allCommands) {\n if (c === null) continue;\n if (c.match(/^\\s*$/)) {\n continue;\n } // Don't run commands that only have whitespace\n out.push(c.trim());\n }\n return out;\n}\n\nexport function ParseCommand(command: string): (string | number | boolean)[] {\n let idx = 0;\n const args = [];\n\n let lastQuote = \"\";\n\n let arg = \"\";\n while (idx < command.length) {\n const c = command.charAt(idx);\n\n // If the current character is a backslash, add the next character verbatim to the argument\n if (c === \"\\\\\") {\n arg += command.charAt(++idx);\n // If the current character is a single- or double-quote mark, add it to the current argument.\n } else if (c === KEY.DOUBLE_QUOTE || c === KEY.QUOTE) {\n // If we're currently in a quoted string argument and this quote mark is the same as the beginning,\n // the string is done\n if (lastQuote !== \"\" && c === lastQuote) {\n lastQuote = \"\";\n // Otherwise if we're not in a string argument, we've begun one\n } else if (lastQuote === \"\") {\n lastQuote = c;\n // Otherwise if we're in a string argument, add the current character to it\n } else {\n arg += c;\n }\n // If the current character is a space and we are not inside a string, parse the current argument\n // and start a new one\n } else if (c === KEY.SPACE && lastQuote === \"\") {\n args.push(parseArg(arg));\n\n arg = \"\";\n } else {\n // Add the current character to the current argument\n arg += c;\n }\n\n idx++;\n }\n\n // Add the last arg (if any)\n if (arg !== \"\") {\n args.push(parseArg(arg));\n }\n\n return args;\n}\n","/**\n * This is a central class for storing and managing the player's hashes,\n * which are generated by Hacknet Servers\n *\n * It is also used to keep track of what upgrades the player has bought with\n * his hashes, and contains method for grabbing the data/multipliers from\n * those upgrades\n */\nimport { HashUpgrades } from \"./HashUpgrades\";\nimport { HashUpgrade } from \"./HashUpgrade\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class HashManager {\n // Max number of hashes this can hold. Equal to the sum of capacities of\n // all Hacknet Servers\n capacity = 0;\n\n // Number of hashes currently in storage\n hashes = 0;\n\n // Map of Hash Upgrade Name -> levels in that upgrade\n upgrades: Record<string, number> = {};\n\n constructor() {\n for (const name of Object.keys(HashUpgrades)) {\n this.upgrades[name] = 0;\n }\n }\n\n /** Generic helper function for getting a multiplier from a HashUpgrade */\n getMult(upgName: string): number {\n const upg = HashUpgrades[upgName];\n const currLevel = this.upgrades[upgName];\n if (upg == null || currLevel == null) {\n console.error(`Could not find Hash Study upgrade`);\n return 1;\n }\n\n return 1 + (upg.value * currLevel) / 100;\n }\n\n /** One of the Hash upgrades improves studying. This returns that multiplier */\n getStudyMult(): number {\n const upgName = \"Improve Studying\";\n\n return this.getMult(upgName);\n }\n\n /** One of the Hash upgrades improves gym training. This returns that multiplier */\n getTrainingMult(): number {\n const upgName = \"Improve Gym Training\";\n\n return this.getMult(upgName);\n }\n\n getUpgrade(upgName: string): HashUpgrade | null {\n const upg = HashUpgrades[upgName];\n if (!upg) {\n console.error(`Invalid Upgrade Name given to HashManager.getUpgrade(): ${upgName}`);\n return null;\n }\n return upg;\n }\n\n /** Get the cost (in hashes) of an upgrade */\n getUpgradeCost(upgName: string, count = 1): number {\n const upg = this.getUpgrade(upgName);\n const currLevel = this.upgrades[upgName];\n if (upg == null || currLevel == null) {\n console.error(`Invalid Upgrade Name given to HashManager.getUpgradeCost(): ${upgName}`);\n return Infinity;\n }\n\n return upg.getCost(currLevel, count);\n }\n\n prestige(): void {\n for (const name of Object.keys(HashUpgrades)) {\n this.upgrades[name] = 0;\n }\n this.hashes = 0;\n\n // When prestiging, player's hacknet nodes are always reset. So capacity = 0\n this.updateCapacity(0);\n }\n\n /** Reverts an upgrade and refunds the hashes used to buy it */\n refundUpgrade(upgName: string, count = 1): void {\n const upg = HashUpgrades[upgName];\n\n // Reduce the level first, so we get the right cost\n this.upgrades[upgName] -= count;\n\n const currLevel = this.upgrades[upgName];\n if (upg == null || currLevel == null || currLevel < 0) {\n console.error(`Invalid Upgrade Name given to HashManager.upgrade(): ${upgName}`);\n return;\n }\n\n const cost = upg.getCost(currLevel, count);\n this.hashes += cost;\n }\n\n /**\n * Stores the given hashes, capping at capacity\n * @param numHashes The number of hashes to increment\n * @returns The number of wasted hashes (over capacity)\n */\n storeHashes(numHashes: number): number {\n this.hashes += numHashes;\n let wastedHashes = this.hashes;\n this.hashes = Math.min(this.hashes, this.capacity);\n wastedHashes -= this.hashes;\n return wastedHashes;\n }\n\n updateCapacity(newCap: number): void {\n if (newCap < 0) {\n this.capacity = 0;\n }\n this.capacity = Math.max(newCap, 0);\n }\n\n /**\n * Returns boolean indicating whether or not the upgrade was successfully purchased\n * Note that this does NOT actually implement the effect\n */\n upgrade(upgName: string, count = 1): boolean {\n const upg = HashUpgrades[upgName];\n if (upg == null) {\n console.error(`Invalid Upgrade Name given to HashManager.upgrade(): ${upgName}`);\n return false;\n }\n\n const cost = this.getUpgradeCost(upgName, count);\n\n if (this.hashes < cost) {\n return false;\n }\n\n this.hashes -= cost;\n this.upgrades[upgName] += count;\n\n return true;\n }\n\n //Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"HashManager\", this);\n }\n\n // Initializes a HashManager object from a JSON save state.\n static fromJSON(value: IReviverValue): HashManager {\n return Generic_fromJSON(HashManager, value.data);\n }\n}\n\nReviver.constructors.HashManager = HashManager;\n","import { Player } from \"@player\";\nimport { calculateSkill } from \"../../PersonObjects/formulas/skill\";\n\nfunction calculateRawDiff(stats: number, startingDifficulty: number): number {\n const difficulty = startingDifficulty - Math.pow(stats, 0.9) / 250 - Player.skills.intelligence / 1600;\n if (difficulty < 0) return 0;\n if (difficulty > 3) return 3;\n return difficulty;\n}\n\nexport function calculateDifficulty(startingSecurityLevel: number): number {\n const totalStats =\n Player.skills.strength +\n Player.skills.defense +\n Player.skills.dexterity +\n Player.skills.agility +\n Player.skills.charisma;\n return calculateRawDiff(totalStats, startingSecurityLevel);\n}\n\nexport function calculateReward(startingSecurityLevel: number): number {\n const xpMult = 10 * 60 * 15;\n const total =\n calculateSkill(Player.mults.strength_exp * xpMult, Player.mults.strength) +\n calculateSkill(Player.mults.defense_exp * xpMult, Player.mults.defense) +\n calculateSkill(Player.mults.agility_exp * xpMult, Player.mults.agility) +\n calculateSkill(Player.mults.dexterity_exp * xpMult, Player.mults.dexterity) +\n calculateSkill(Player.mults.charisma_exp * xpMult, Player.mults.charisma);\n return calculateRawDiff(total, startingSecurityLevel);\n}\n","import React, { useState } from \"react\";\n\nimport { CinematicLine } from \"./CinematicLine\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n lines: string[];\n auto?: boolean;\n onDone?: () => void;\n}\n\nexport function CinematicText(props: IProps): React.ReactElement {\n const [i, setI] = useState(0);\n const [done, setDone] = useState(false);\n\n function advance(): void {\n const newI = i + 1;\n setI(newI);\n if (newI >= props.lines.length) {\n if (props.onDone && props.auto) props.onDone();\n setDone(true);\n }\n }\n\n return (\n <>\n {props.lines.slice(0, i).map((line, i) => (\n <Typography key={i}>{line}</Typography>\n ))}\n {props.lines.length > i && <CinematicLine key={i} text={props.lines[i]} onDone={advance} />}\n {!props.auto && props.onDone && done && <Button onClick={props.onDone}>Continue ...</Button>}\n </>\n );\n}\n","/**\n * Implements the purchasing of extra Duplicate Sleeves from The Covenant,\n * as well as the purchasing of upgrades (memory)\n */\n\nexport const MaxSleevesFromCovenant = 5;\nexport const BaseCostPerSleeve = 10e12;\n","import { Company } from \"./Company\";\nimport { CompanyPosition } from \"./CompanyPosition\";\n\n/** Returns a string with the given CompanyPosition's stat requirements */\nexport function getJobRequirementText(company: Company, pos: CompanyPosition, tooltiptext = false): string {\n let reqText = \"\";\n const offset: number = company.jobStatReqOffset;\n const reqHacking: number = pos.requiredHacking > 0 ? pos.requiredHacking + offset : 0;\n const reqStrength: number = pos.requiredStrength > 0 ? pos.requiredStrength + offset : 0;\n const reqDefense: number = pos.requiredDefense > 0 ? pos.requiredDefense + offset : 0;\n const reqDexterity: number = pos.requiredDexterity > 0 ? pos.requiredDexterity + offset : 0;\n const reqAgility: number = pos.requiredDexterity > 0 ? pos.requiredDexterity + offset : 0;\n const reqCharisma: number = pos.requiredCharisma > 0 ? pos.requiredCharisma + offset : 0;\n const reqRep: number = pos.requiredReputation;\n if (tooltiptext) {\n reqText = \"Requires:<br>\";\n reqText += reqHacking.toString() + \" hacking<br>\";\n reqText += reqStrength.toString() + \" strength<br>\";\n reqText += reqDefense.toString() + \" defense<br>\";\n reqText += reqDexterity.toString() + \" dexterity<br>\";\n reqText += reqAgility.toString() + \" agility<br>\";\n reqText += reqCharisma.toString() + \" charisma<br>\";\n reqText += reqRep.toString() + \" reputation\";\n } else {\n reqText = \"(Requires \";\n if (reqHacking > 0) {\n reqText += reqHacking + \" hacking, \";\n }\n if (reqStrength > 0) {\n reqText += reqStrength + \" strength, \";\n }\n if (reqDefense > 0) {\n reqText += reqDefense + \" defense, \";\n }\n if (reqDexterity > 0) {\n reqText += reqDexterity + \" dexterity, \";\n }\n if (reqAgility > 0) {\n reqText += reqAgility + \" agility, \";\n }\n if (reqCharisma > 0) {\n reqText += reqCharisma + \" charisma, \";\n }\n if (reqRep > 1) {\n reqText += reqRep + \" reputation, \";\n }\n reqText = reqText.substring(0, reqText.length - 2);\n reqText += \")\";\n }\n return reqText;\n}\n","/**\n * Implements RAM Calculation functionality.\n *\n * Uses the acorn.js library to parse a script's code into an AST and\n * recursively walk through that AST, calculating RAM usage along\n * the way\n */\nimport * as walk from \"acorn-walk\";\nimport acorn, { parse } from \"acorn\";\n\nimport { RamCalculationErrorCode } from \"./RamCalculationErrorCodes\";\n\nimport { RamCosts, RamCostConstants } from \"../Netscript/RamCostGenerator\";\nimport { Script } from \"./Script\";\nimport { areImportsEquals } from \"../Terminal/DirectoryHelpers\";\nimport { Node } from \"../NetscriptJSEvaluator\";\n\nexport interface RamUsageEntry {\n type: \"ns\" | \"dom\" | \"fn\" | \"misc\";\n name: string;\n cost: number;\n}\n\nexport interface RamCalculation {\n cost: number;\n entries?: RamUsageEntry[];\n}\n\n// These special strings are used to reference the presence of a given logical\n// construct within a user script.\nconst specialReferenceIF = \"__SPECIAL_referenceIf\";\nconst specialReferenceFOR = \"__SPECIAL_referenceFor\";\nconst specialReferenceWHILE = \"__SPECIAL_referenceWhile\";\n\n// The global scope of a script is registered under this key during parsing.\nconst memCheckGlobalKey = \".__GLOBAL__\";\n\n/**\n * Parses code into an AST and walks through it recursively to calculate\n * RAM usage. Also accounts for imported modules.\n * @param {Script[]} otherScripts - All other scripts on the server. Used to account for imported scripts\n * @param {string} code - The code being parsed */\nfunction parseOnlyRamCalculate(otherScripts: Script[], code: string): RamCalculation {\n try {\n /**\n * Maps dependent identifiers to their dependencies.\n *\n * The initial identifier is __SPECIAL_INITIAL_MODULE__.__GLOBAL__.\n * It depends on all the functions declared in the module, all the global scopes\n * of its imports, and any identifiers referenced in this global scope. Each\n * function depends on all the identifiers referenced internally.\n * We walk the dependency graph to calculate RAM usage, given that some identifiers\n * reference Netscript functions which have a RAM cost.\n */\n let dependencyMap: { [key: string]: string[] } = {};\n\n // Scripts we've parsed.\n const completedParses = new Set();\n\n // Scripts we've discovered that need to be parsed.\n const parseQueue: string[] = [];\n\n // Parses a chunk of code with a given module name, and updates parseQueue and dependencyMap.\n function parseCode(code: string, moduleName: string): void {\n const result = parseOnlyCalculateDeps(code, moduleName);\n completedParses.add(moduleName);\n\n // Add any additional modules to the parse queue;\n for (let i = 0; i < result.additionalModules.length; ++i) {\n if (!completedParses.has(result.additionalModules[i])) {\n parseQueue.push(result.additionalModules[i]);\n }\n }\n\n // Splice all the references in\n dependencyMap = Object.assign(dependencyMap, result.dependencyMap);\n }\n\n // Parse the initial module, which is the \"main\" script that is being run\n const initialModule = \"__SPECIAL_INITIAL_MODULE__\";\n parseCode(code, initialModule);\n\n // Process additional modules, which occurs if the \"main\" script has any imports\n while (parseQueue.length > 0) {\n const nextModule = parseQueue.shift();\n if (nextModule === undefined) throw new Error(\"nextModule should not be undefined\");\n if (nextModule.startsWith(\"https://\") || nextModule.startsWith(\"http://\")) continue;\n\n let script = null;\n const fn = nextModule.startsWith(\"./\") ? nextModule.slice(2) : nextModule;\n for (const s of otherScripts) {\n if (areImportsEquals(s.filename, fn)) {\n script = s;\n break;\n }\n }\n\n if (script == null) {\n return { cost: RamCalculationErrorCode.ImportError }; // No such script on the server\n }\n\n parseCode(script.code, nextModule);\n }\n\n // Finally, walk the reference map and generate a ram cost. The initial set of keys to scan\n // are those that start with __SPECIAL_INITIAL_MODULE__.\n let ram = RamCostConstants.ScriptBaseRamCost;\n const detailedCosts: RamUsageEntry[] = [\n { type: \"misc\", name: \"baseCost\", cost: RamCostConstants.ScriptBaseRamCost },\n ];\n const unresolvedRefs = Object.keys(dependencyMap).filter((s) => s.startsWith(initialModule));\n const resolvedRefs = new Set();\n const loadedFns: Record<string, boolean> = {};\n while (unresolvedRefs.length > 0) {\n const ref = unresolvedRefs.shift();\n if (ref === undefined) throw new Error(\"ref should not be undefined\");\n\n // Check if this is one of the special keys, and add the appropriate ram cost if so.\n if (ref === \"hacknet\" && !resolvedRefs.has(\"hacknet\")) {\n ram += RamCostConstants.ScriptHacknetNodesRamCost;\n detailedCosts.push({ type: \"ns\", name: \"hacknet\", cost: RamCostConstants.ScriptHacknetNodesRamCost });\n }\n if (ref === \"document\" && !resolvedRefs.has(\"document\")) {\n ram += RamCostConstants.ScriptDomRamCost;\n detailedCosts.push({ type: \"dom\", name: \"document\", cost: RamCostConstants.ScriptDomRamCost });\n }\n if (ref === \"window\" && !resolvedRefs.has(\"window\")) {\n ram += RamCostConstants.ScriptDomRamCost;\n detailedCosts.push({ type: \"dom\", name: \"window\", cost: RamCostConstants.ScriptDomRamCost });\n }\n if (ref === \"corporation\" && !resolvedRefs.has(\"corporation\")) {\n ram += RamCostConstants.ScriptCorporationRamCost;\n detailedCosts.push({ type: \"ns\", name: \"corporation\", cost: RamCostConstants.ScriptCorporationRamCost });\n }\n\n resolvedRefs.add(ref);\n\n if (ref.endsWith(\".*\")) {\n // A prefix reference. We need to find all matching identifiers.\n const prefix = ref.slice(0, ref.length - 2);\n for (const ident of Object.keys(dependencyMap).filter((k) => k.startsWith(prefix))) {\n for (const dep of dependencyMap[ident] || []) {\n if (!resolvedRefs.has(dep)) unresolvedRefs.push(dep);\n }\n }\n } else {\n // An exact reference. Add all dependencies of this ref.\n for (const dep of dependencyMap[ref] || []) {\n if (!resolvedRefs.has(dep)) unresolvedRefs.push(dep);\n }\n }\n\n // Check if this identifier is a function in the workerScript environment.\n // If it is, then we need to get its RAM cost.\n try {\n function applyFuncRam(cost: number | (() => number)): number {\n if (typeof cost === \"number\") {\n return cost;\n } else if (typeof cost === \"function\") {\n return cost();\n } else {\n return 0;\n }\n }\n\n // Only count each function once\n if (loadedFns[ref]) {\n continue;\n }\n loadedFns[ref] = true;\n\n // This accounts for namespaces (Bladeburner, CodingContract, etc.)\n const findFunc = (\n prefix: string,\n obj: object,\n ref: string,\n ): { func: () => number | number; refDetail: string } | undefined => {\n if (!obj) return;\n const elem = Object.entries(obj).find(([key]) => key === ref);\n if (elem !== undefined && (typeof elem[1] === \"function\" || typeof elem[1] === \"number\")) {\n return { func: elem[1], refDetail: `${prefix}${ref}` };\n }\n for (const [key, value] of Object.entries(obj)) {\n const found = findFunc(`${key}.`, value, ref);\n if (found) return found;\n }\n return undefined;\n };\n\n const details = findFunc(\"\", RamCosts, ref);\n const fnRam = applyFuncRam(details?.func ?? 0);\n ram += fnRam;\n detailedCosts.push({ type: \"fn\", name: details?.refDetail ?? \"\", cost: fnRam });\n } catch (error) {\n console.error(error);\n continue;\n }\n }\n return { cost: ram, entries: detailedCosts.filter((e) => e.cost > 0) };\n } catch (error) {\n // console.info(\"parse or eval error: \", error);\n // This is not unexpected. The user may be editing a script, and it may be in\n // a transitory invalid state.\n return { cost: RamCalculationErrorCode.SyntaxError };\n }\n}\n\nexport function checkInfiniteLoop(code: string): number {\n const ast = parse(code, { sourceType: \"module\", ecmaVersion: \"latest\" });\n\n function nodeHasTrueTest(node: acorn.Node): boolean {\n return node.type === \"Literal\" && (node as any).raw === \"true\";\n }\n\n function hasAwait(ast: acorn.Node): boolean {\n let hasAwait = false;\n walk.recursive(\n ast,\n {},\n {\n AwaitExpression: () => {\n hasAwait = true;\n },\n },\n );\n return hasAwait;\n }\n\n let missingAwaitLine = -1;\n walk.recursive(\n ast,\n {},\n {\n WhileStatement: (node: Node, st: unknown, walkDeeper: walk.WalkerCallback<any>) => {\n if (nodeHasTrueTest(node.test) && !hasAwait(node)) {\n missingAwaitLine = (code.slice(0, node.start).match(/\\n/g) || []).length + 1;\n } else {\n node.body && walkDeeper(node.body, st);\n }\n },\n },\n );\n\n return missingAwaitLine;\n}\n\ninterface ParseDepsResult {\n dependencyMap: {\n [key: string]: Set<string> | undefined;\n };\n additionalModules: string[];\n}\n\n/**\n * Helper function that parses a single script. It returns a map of all dependencies,\n * which are items in the code's AST that potentially need to be evaluated\n * for RAM usage calculations. It also returns an array of additional modules\n * that need to be parsed (i.e. are 'import'ed scripts).\n */\nfunction parseOnlyCalculateDeps(code: string, currentModule: string): ParseDepsResult {\n const ast = parse(code, { sourceType: \"module\", ecmaVersion: \"latest\" });\n // Everything from the global scope goes in \".\". Everything else goes in \".function\", where only\n // the outermost layer of functions counts.\n const globalKey = currentModule + memCheckGlobalKey;\n const dependencyMap: { [key: string]: Set<string> | undefined } = {};\n dependencyMap[globalKey] = new Set<string>();\n\n // If we reference this internal name, we're really referencing that external name.\n // Filled when we import names from other modules.\n const internalToExternal: { [key: string]: string | undefined } = {};\n\n const additionalModules: string[] = [];\n\n // References get added pessimistically. They are added for thisModule.name, name, and for\n // any aliases.\n function addRef(key: string, name: string): void {\n const s = dependencyMap[key] || (dependencyMap[key] = new Set());\n const external = internalToExternal[name];\n if (external !== undefined) {\n s.add(external);\n }\n s.add(currentModule + \".\" + name);\n s.add(name); // For builtins like hack.\n }\n\n //A list of identifiers that resolve to \"native Javascript code\"\n const objectPrototypeProperties = Object.getOwnPropertyNames(Object.prototype);\n\n interface State {\n key: string;\n }\n\n // If we discover a dependency identifier, state.key is the dependent identifier.\n // walkDeeper is for doing recursive walks of expressions in composites that we handle.\n function commonVisitors(): walk.RecursiveVisitors<State> {\n return {\n Identifier: (node: Node, st: State) => {\n if (objectPrototypeProperties.includes(node.name)) {\n return;\n }\n addRef(st.key, node.name);\n },\n WhileStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback<State>) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n DoWhileStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback<State>) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n ForStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback<State>) => {\n addRef(st.key, specialReferenceFOR);\n node.init && walkDeeper(node.init, st);\n node.test && walkDeeper(node.test, st);\n node.update && walkDeeper(node.update, st);\n node.body && walkDeeper(node.body, st);\n },\n IfStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback<State>) => {\n addRef(st.key, specialReferenceIF);\n node.test && walkDeeper(node.test, st);\n node.consequent && walkDeeper(node.consequent, st);\n node.alternate && walkDeeper(node.alternate, st);\n },\n MemberExpression: (node: Node, st: State, walkDeeper: walk.WalkerCallback<State>) => {\n node.object && walkDeeper(node.object, st);\n node.property && walkDeeper(node.property, st);\n },\n };\n }\n\n walk.recursive<State>(\n ast,\n { key: globalKey },\n Object.assign(\n {\n ImportDeclaration: (node: Node, st: State) => {\n const importModuleName = node.source.value;\n additionalModules.push(importModuleName);\n\n // This module's global scope refers to that module's global scope, no matter how we\n // import it.\n const set = dependencyMap[st.key];\n if (set === undefined) throw new Error(\"set should not be undefined\");\n set.add(importModuleName + memCheckGlobalKey);\n\n for (let i = 0; i < node.specifiers.length; ++i) {\n const spec = node.specifiers[i];\n if (spec.imported !== undefined && spec.local !== undefined) {\n // We depend on specific things.\n internalToExternal[spec.local.name] = importModuleName + \".\" + spec.imported.name;\n } else {\n // We depend on everything.\n const set = dependencyMap[st.key];\n if (set === undefined) throw new Error(\"set should not be undefined\");\n set.add(importModuleName + \".*\");\n }\n }\n },\n FunctionDeclaration: (node: Node) => {\n // node.id will be null when using 'export default'. Add a module name indicating the default export.\n const key = currentModule + \".\" + (node.id === null ? \"__SPECIAL_DEFAULT_EXPORT__\" : node.id.name);\n walk.recursive(node, { key: key }, commonVisitors());\n },\n },\n commonVisitors(),\n ),\n );\n\n return { dependencyMap: dependencyMap, additionalModules: additionalModules };\n}\n\n/**\n * Calculate's a scripts RAM Usage\n * @param {string} codeCopy - The script's code\n * @param {Script[]} otherScripts - All other scripts on the server.\n * Used to account for imported scripts\n */\nexport function calculateRamUsage(codeCopy: string, otherScripts: Script[]): RamCalculation {\n try {\n return parseOnlyRamCalculate(otherScripts, codeCopy);\n } catch (e) {\n console.error(`Failed to parse script for RAM calculations:`);\n console.error(e);\n return { cost: RamCalculationErrorCode.SyntaxError };\n }\n}\n","/**\n * Rounds a number to two decimal places.\n * @param decimal A decimal value to trim to two places.\n */\nexport function roundToTwo(decimal: number): number {\n const leftShift: number = Math.round(parseFloat(`${decimal}e+2`));\n\n return +`${leftShift}e-2`;\n}\n","/* tslint:disable:max-line-length completed-docs variable-name*/\n\nexport const TerminalHelpText: string[] = [\n \"Type 'help name' to learn more about the command \",\n \" \",\n ' alias [-g] [name=\"value\"] Create or display Terminal aliases',\n \" analyze Get information about the current machine \",\n \" backdoor Install a backdoor on the current machine \",\n \" buy [-l/-a/program] Purchase a program through the Dark Web\",\n \" cat [file] Display a .msg, .lit, or .txt file\",\n \" cd [dir] Change to a new directory\",\n \" check [script] [args...] Print a script's logs to Terminal\",\n \" clear Clear all text on the terminal \",\n \" cls See 'clear' command \",\n \" connect [hostname] Connects to a remote server\",\n \" cp [src] [dst] Copy a file\",\n \" download [script/text file] Downloads scripts or text files to your computer\",\n \" expr [math expression] Evaluate a mathematical expression\",\n \" free Check the machine's memory (RAM) usage\",\n \" grow Spoof money in a servers bank account, increasing the amount available.\",\n \" hack Hack the current machine\",\n \" help [command] Display this help text, or the help text for a command\",\n \" history [-c] Display the terminal history\",\n \" home Connect to home computer\",\n \" hostname Displays the hostname of the machine\",\n \" kill [script/pid] [args...] Stops the specified script on the current server \",\n \" killall Stops all running scripts on the current machine\",\n \" ls [dir] [--grep pattern] Displays all files on the machine\",\n \" lscpu Displays the number of CPU cores on the machine\",\n \" mem [script] [-t n] Displays the amount of RAM required to run the script\",\n \" mv [src] [dest] Move/rename a text or script file\",\n \" nano [file ...] Text editor - Open up and edit one or more scripts or text files\",\n \" ps Display all scripts that are currently running\",\n \" rm [file] Delete a file from the server\",\n \" run [name] [-t n] [--tail] [args...] Execute a program or script\",\n \" scan Prints all immediately-available network connections\",\n \" scan-analyze [d] [-a] Prints info for all servers up to d nodes away\",\n \" scp [file ...] [server] Copies a file to a destination server\",\n \" sudov Shows whether you have root access on this computer\",\n \" tail [script] [args...] Displays dynamic logs for the specified script\",\n \" top Displays all running scripts and their RAM usage\",\n \" unalias [alias name] Deletes the specified alias\",\n \" vim [file ...] Text editor - Open up and edit one or more scripts or text files in vim mode\",\n \" weaken Reduce the security of the current machine\",\n \" wget [url] [target file] Retrieves code/text from a web server\",\n \" \",\n];\n\nconst TemplatedHelpTexts: Record<string, (command: string) => string[]> = {\n scriptEditor: (command) => {\n return [\n `Usage: ${command} [file ...] | [glob]`,\n ` `,\n `Opens up the specified file(s) in the Script Editor. Only scripts (.js, or .script) or text files (.txt) `,\n `can be edited using the Script Editor. If a file does not exist a new one will be created`,\n ` `,\n `If provided a glob as the only argument, ${command} can spider directories and open all matching `,\n `files at once. ${command} cannot create files using globs, so your scripts must already exist.`,\n ` `,\n `Examples:`,\n ` `,\n ` ${command} test.js`,\n ` ${command} test.js test2.js`,\n ` `,\n ` ${command} test.*`,\n ` ${command} /my-dir/*.js`,\n ` `,\n ];\n },\n};\n\nexport const HelpTexts: Record<string, string[]> = {\n alias: [\n 'Usage: alias [-g] [name=\"value\"] ',\n \" \",\n \"Create or display aliases. An alias enables a replacement of a word with another string. \",\n \"It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME \",\n \"of an alias defines the word that will be replaced, while the VALUE defines what it will be replaced by. For example, \",\n \"you could create the alias 'nuke' for the Terminal command 'run NUKE.exe' using the following: \",\n \" \",\n ' alias nuke=\"run NUKE.exe\"',\n \" \",\n \"Then, to run the NUKE.exe program you would just have to enter 'nuke' in Terminal rather than the full command. \",\n \"It is important to note that 'default' aliases will only be substituted for the first word of a Terminal command. For \",\n \"example, if the following alias was set: \",\n \" \",\n ' alias worm=\"HTTPWorm.exe\"',\n \" \",\n \"and then you tried to run the following terminal command: \",\n \" \",\n \" run worm\",\n \" \",\n \"This would fail because the worm alias is not the first word of a Terminal command. To allow an alias to be substituted \",\n \"anywhere in a Terminal command, rather than just the first word, you must set it to be a global alias using the -g flag: \",\n \" \",\n ' alias -g worm=\"HTTPWorm.exe\"',\n \" \",\n \"Now, the 'worm' alias will be substituted anytime it shows up as an individual word in a Terminal command. \",\n \" \",\n \"Entering just the command 'alias' without any arguments prints the list of all defined aliases in the reusable form \",\n \"'alias NAME=VALUE' on the Terminal. \",\n \" \",\n \"The 'unalias' command can be used to remove aliases.\",\n \" \",\n ],\n analyze: [\n \"Usage: analyze\",\n \" \",\n \"Prints details and statistics about the current server. The information that is printed includes basic \",\n \"server details such as the hostname, whether the player has root access, what ports are opened/closed, and also \",\n \"hacking-related information such as an estimated chance to successfully hack, an estimate of how much money is \",\n \"available on the server, etc.\",\n \" \",\n ],\n backdoor: [\n \"Usage: backdoor\",\n \" \",\n \"Install a backdoor on the current machine, grants a secret bonus depending on the machine.\",\n \" \",\n \"Requires root access to run.\",\n \" \",\n ],\n buy: [\n \"Usage: buy [-l / -a / program]\",\n \" \",\n \"Purchase a program through the Dark Web. Requires a TOR router to use.\",\n \" \",\n \"If this command is ran with the '-l' flag, it will display a list of all programs that can be bought through the \",\n \"dark web to the Terminal, as well as their costs.\",\n \" \",\n \"If this command is ran with the '-a' flag, it will attempt to purchase all unowned programs.\",\n \" \",\n \"Otherwise, the name of the program must be passed in as a parameter. This name is NOT case-sensitive.\",\n \" \",\n ],\n cat: [\n \"Usage: cat [file]\",\n \" \",\n \"Display message (.msg), literature (.lit), or text (.txt) files. Examples:\",\n \" \",\n \" cat j1.msg\",\n \" \",\n \" cat foo.lit\",\n \" \",\n \" cat servers.txt\",\n \" \",\n ],\n cd: [\n \"Usage: cd [dir]\",\n \" \",\n \"Change to the specified directory. Note that this works even for directories that don't exist. If you \",\n \"change to a directory that does not exist, it will not be 'created'. Examples:\",\n \" \",\n \" cd scripts/hacking\",\n \" \",\n \" cd /logs\",\n \" \",\n \" cd ../\",\n \" \",\n ],\n check: [\n \"Usage: check [script name] [args...]\",\n \" \",\n \"Print the logs of the script specified by the script name and arguments to the Terminal. Each argument must be separated by \",\n \"a space. Remember that a running script is uniquely \",\n \"identified both by its name and the arguments that are used to start it. So, if a script was ran with the following arguments: \",\n \" \",\n \" run foo.script 1 2 foodnstuff\",\n \" \",\n \"Then to run the 'check' command on this script you would have to pass the same arguments in: \",\n \" \",\n \" check foo.script 1 2 foodnstuff\",\n \" \",\n ],\n clear: [\n \"Usage: clear\",\n \" \",\n \"Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up \",\n \"and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'cls' command\",\n \" \",\n ],\n cls: [\n \"Usage: cls\",\n \" \",\n \"Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up \",\n \"and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'clear' command\",\n \" \",\n ],\n connect: [\n \"Usage: connect [hostname]\",\n \" \",\n \"Connect to a remote server. The hostname of the remote server must be given as the argument \",\n \"to this command. Note that only servers that are immediately adjacent to the current server in the network and the ones that have\",\n \"a backdoor installed can be connected to. To see which servers can be connected to, use the 'scan' command.\",\n \" \",\n ],\n cp: [\"Usage: cp [src] [dst]\", \" \", \"Copy a file on this server. To copy a file to another server use scp.\", \" \"],\n download: [\n \"Usage: download [script/text file]\",\n \" \",\n \"Downloads a script or text file to your computer (like your real life computer).\",\n \" \",\n \"You can also download all of your scripts/text files as a zip file using the following Terminal commands:\",\n \" \",\n \"Download all scripts and text files: download *\",\n \" \",\n \"Download all scripts: download *.script\",\n \" \",\n \"Download all text files: download *.txt\",\n \" \",\n ],\n expr: [\n \"Usage: expr [mathematical expression]\",\n \" \",\n \"Evaluate a simple mathematical expression. Supports native JavaScript operators:\",\n \" \",\n \"+, -, /, *, **, %\",\n \" \",\n \"Example:\",\n \" \",\n \" expr 25 * 2 ** 10\",\n \" \",\n \"Note that letters (non-digits) are not allowed and will be removed from the input.\",\n \" \",\n ],\n free: [\n \"Usage: free\",\n \" \",\n \"Displays the memory usage on the current machine. Print the amount of RAM that is available on the current server as well as \",\n \"how much of it is being used.\",\n \" \",\n ],\n grow: [\n \"Usage: grow\",\n \" \",\n \"Spoof transactions in the current server. Increasing the money available by hacking. Requires root access.\",\n \"See the wiki page for hacking mechanics.\",\n \" \",\n ],\n hack: [\n \"Usage: hack\",\n \" \",\n \"Attempt to hack the current server. Requires root access in order to be run. See the wiki page for hacking mechanics\",\n \" \",\n ],\n help: [\n \"Usage: help [command]\",\n \" \",\n \"Display Terminal help information. Without arguments, 'help' prints a list of all valid Terminal commands and a brief \",\n \"description of their functionality. You can also pass the name of a Terminal command as an argument to 'help' to print \",\n \"more detailed information about the Terminal command. Examples: \",\n \" \",\n \" help alias\",\n \" \",\n \" help scan-analyze\",\n \" \",\n ],\n history: [\n \"Usage: history [-c]\",\n \" \",\n \"Without arguments, displays the terminal command history. To clear the history, pass in the '-c' argument.\",\n \" \",\n ],\n home: [\n \"Usage: home\",\n \" \",\n \"Connect to your home computer. This will work no matter what server you are currently connected to.\",\n \" \",\n ],\n hostname: [\"Usage: hostname\", \" \", \"Prints the hostname of the current server\", \" \"],\n kill: [\n \"Usage: kill [script name] [args...] or kill [pid\",\n \" \",\n \"Kill the script specified by the script name and arguments OR by its PID.\",\n \" \",\n \"If you are killing the script using its filename and arguments, then each \",\n \"argument must be separated by a space. Remember that a running script is \",\n \"uniquely identified by both its name and the arguments that are used to start \",\n \"it. So, if a script was ran with the following arguments:\",\n \" \",\n \" run foo.script 1 sigma-cosmetics\",\n \" \",\n \"Then to kill this script the same arguments would have to be used:\",\n \" \",\n \" kill foo.script 1 sigma-cosmetics\",\n \" \",\n \"If you are killing the script using its PID, then the PID argument must be numeric\",\n \" \",\n ],\n killall: [\n \"Usage: killall\",\n \" \",\n \"Kills all scripts on the current server. \",\n \"Note that after the 'kill' command is issued for a script, it may take a while for the script to actually stop running. \",\n \"This will happen if the script is in the middle of a command such as grow() or weaken() that takes time to execute. \",\n \"The script will not be stopped/killed until after that time has elapsed.\",\n \" \",\n ],\n ls: [\n \"Usage: ls [dir] [-l] [--grep pattern]\",\n \" \",\n \"The ls command, with no arguments, prints all files and directories on the current server's directory to the Terminal screen. \",\n \"The files will be displayed in alphabetical order. \",\n \" \",\n \"The 'dir' optional parameter can be used to display files/directories in another directory.\",\n \" \",\n \"The '-l' optional parameter allows you to force each item onto a single line.\",\n \" \",\n \"The '--grep pattern' optional parameter can be used to only display files whose filenames match the specified pattern.\",\n \" \",\n \"Examples:\",\n \" \",\n \"List all files with the '.script' extension in the current directory:\",\n \" \",\n \" ls -l --grep .script\",\n \" \",\n \"List all files with the '.js' extension in the root directory:\",\n \" \",\n \" ls / -l --grep .js\",\n \" \",\n \"List all files with the word 'purchase' in the filename, in the 'scripts' directory:\",\n \" \",\n \" ls scripts -l --grep purchase\",\n \" \",\n ],\n lscpu: [\"Usage: lscpu\", \" \", \"Prints the number of CPU Cores the current server has\", \" \"],\n\n mem: [\n \"Usage: mem [script name] [-t num_threads]\",\n \" \",\n \"Displays the amount of RAM needed to run the specified script with a single thread. The command can also be used to print \",\n \"the amount of RAM needed to run a script with multiple threads using the '-t' flag. If the '-t' flag is specified, then \",\n \"an argument for the number of threads must be passed in afterwards. Examples:\",\n \" \",\n \" mem foo.script\",\n \" \",\n \" mem foo.script -t 50\",\n \" \",\n \"The first example above will print the amount of RAM needed to run 'foo.script' with a single thread. The second example \",\n \"above will print the amount of RAM needed to run 'foo.script' with 50 threads.\",\n \" \",\n ],\n mv: [\n \"Usage: mv [src] [dest]\",\n \" \",\n \"Move the source file to the specified destination. This can also be used to rename files. \",\n \"This command only works for scripts and text files (.txt). This command CANNOT be used to \",\n \"convert to different file types\",\n \" \",\n \"Note that, unlike the Linux 'mv' command, the destination argument must be the \",\n \"full filepath. \",\n \"Examples: \",\n \" \",\n \" mv hacking-controller.script scripts/hacking-controller.script\",\n \" \",\n \" mv myScript.js myOldScript.js\",\n \" \",\n ],\n nano: TemplatedHelpTexts.scriptEditor(\"nano\"),\n ps: [\"Usage: ps\", \" \", \"Prints all scripts that are running on the current server\", \" \"],\n rm: [\n \"Usage: rm [file]\",\n \" \",\n \"Removes the specified file from the current server. A file can be a script, a program, or a message file. \",\n \" \",\n \"WARNING: This is permanent and cannot be undone\",\n \" \",\n ],\n run: [\n \"Usage: run [file name] [-t] [num threads] [args...]\",\n \" \",\n \"Execute a program, script or coding contract.\",\n \" \",\n \"The '[-t]', '[num threads]', and '[args...]' arguments are only valid when running a script. The '-t' flag is used \",\n \"to indicate that the script should be run with the specified number of threads. If the flag is omitted, \",\n \"then the script will be run with a single thread by default. \",\n \"If the '-t' flag is used, then it MUST come immediately \",\n \"after the script name, and the [num threads] argument MUST come immediately afterwards. \",\n \" \",\n \"[args...] represents a variable number of arguments that will be passed into the script. See the documentation \",\n \"about script arguments. Each specified argument must be separated by a space. \",\n \" \",\n ],\n scan: [\n \"Usage: scan\",\n \" \",\n \"Prints all immediately-available network connection. This will print a list of all servers that you can currently connect \",\n \"to using the 'connect' Terminal command.\",\n \" \",\n ],\n \"scan-analyze\": [\n \"Usage: scan-analyze [depth] [-a]\",\n \" \",\n \"Prints detailed information about all servers up to [depth] nodes away on the network. Calling \",\n \"'scan-analyze 1' will display information for the same servers that are shown by the 'scan' Terminal \",\n \"command. This command also shows the relative paths to reach each server.\",\n \" \",\n \"By default, the maximum depth that can be specified for 'scan-analyze' is 3. However, once you have \",\n \"the DeepscanV1.exe and DeepscanV2.exe programs, you can execute 'scan-analyze' with a depth up to \",\n \"5 and 10, respectively.\",\n \" \",\n \"The information 'scan-analyze' displays about each server includes whether or not you have root access to it, \",\n \"its required hacking level, the number of open ports required to run NUKE.exe on it, and how much RAM \",\n \"it has.\",\n \" \",\n \"By default, this command will not display servers that you have purchased. However, you can pass in the \",\n \"-a flag at the end of the command if you would like to enable that.\",\n \" \",\n ],\n scp: [\n \"Usage: scp [filename ...] [target server]\",\n \" \",\n \"Copies the specified file(s) from the current server to the target server. \",\n \"This command only works for script files (.script or .js extension), literature files (.lit extension), \",\n \"and text files (.txt extension). \",\n \"The second argument passed in must be the hostname or IP of the target server. Examples:\",\n \" \",\n \" scp foo.script n00dles\",\n \" \",\n \" scp foo.script bar.script n00dles\",\n \" \",\n ],\n sudov: [\"Usage: sudov\", \" \", \"Prints whether or not you have root access to the current machine\", \" \"],\n\n tail: [\n \"Usage: tail [script name] [args...]\",\n \" \",\n \"Displays dynamic logs for the script specified by the script name and arguments. Each argument must be separated \",\n \"by a space. Remember that a running script is uniquely identified by both its name and the arguments that were used \",\n \"to run it. So, if a script was ran with the following arguments: \",\n \" \",\n \" run foo.script 10 50000\",\n \" \",\n \"Then in order to check its logs with 'tail' the same arguments must be used: \",\n \" \",\n \" tail foo.script 10 50000\",\n \" \",\n ],\n top: [\n \"Usage: top\",\n \" \",\n \"Prints a list of all scripts running on the current server as well as their thread count and how much \",\n \"RAM they are using in total.\",\n \" \",\n ],\n unalias: [\n \"Usage: unalias [alias name]\",\n \" \",\n \"Deletes the specified alias. Note that the double quotation marks are required. \",\n \" \",\n \"As an example, if an alias was declared using:\",\n \" \",\n ' alias r=\"run\"',\n \" \",\n \"Then it could be removed using:\",\n \" \",\n \" unalias r\",\n \" \",\n \"It is not necessary to differentiate between global and non-global aliases when using 'unalias'\",\n \" \",\n ],\n vim: TemplatedHelpTexts.scriptEditor(\"vim\"),\n weaken: [\n \"Usage: weaken\",\n \" \",\n \"Reduces the security level of the current server. Decreasing the time it takes for all operations on this server.\",\n \"Requires root access. See the wiki page for hacking mechanics.\",\n \" \",\n ],\n wget: [\n \"Usage: wget [url] [target file]\",\n \" \",\n \"Retrieves data from a URL and downloads it to a file on the current server. The data can only \",\n \"be downloaded to a script (.script or .js) or a text file (.txt). If the file already exists, \",\n \"it will be overwritten by this command.\",\n \" \",\n \"Note that it will not be possible to download data from many websites because they do not allow \",\n \"cross-origin resource sharing (CORS). Example:\",\n \" \",\n \" wget https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md game_readme.txt\",\n \" \",\n ],\n};\n","import { workerScripts } from \"./WorkerScripts\";\n\nlet pidCounter = 1;\n\n/** Find and return the next available PID for a script */\nexport function generateNextPid(): number {\n let tempCounter = pidCounter;\n\n // Cap the number of search iterations at some arbitrary value to avoid\n // infinite loops. We'll assume that players wont have 1mil+ running scripts\n let found = false;\n for (let i = 0; i < 1e6; ) {\n if (!workerScripts.has(tempCounter + i)) {\n found = true;\n tempCounter = tempCounter + i;\n break;\n }\n\n if (i === Number.MAX_SAFE_INTEGER - 1) {\n i = 1;\n } else {\n ++i;\n }\n }\n\n if (found) {\n pidCounter = tempCounter + 1;\n if (pidCounter >= Number.MAX_SAFE_INTEGER) {\n pidCounter = 1;\n }\n\n return tempCounter;\n } else {\n return -1;\n }\n}\n\nexport function resetPidCounter(): void {\n pidCounter = 1;\n}\n","import { CONSTANTS } from \"../../Constants\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Person } from \"../../PersonObjects/Person\";\n\nexport function repFromDonation(amt: number, person: Person): number {\n return (amt / CONSTANTS.DonateMoneyToRepDivisor) * person.mults.faction_rep * BitNodeMultipliers.FactionWorkRepGain;\n}\n","/** Implementation for what happens when you destroy a BitNode */\nimport React from \"react\";\nimport { Player } from \"@player\";\nimport { prestigeSourceFile } from \"./Prestige\";\nimport { PlayerOwnedSourceFile } from \"./SourceFile/PlayerOwnedSourceFile\";\nimport { SourceFiles } from \"./SourceFile/SourceFiles\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { Router } from \"./ui/GameRoot\";\n\nfunction giveSourceFile(bitNodeNumber: number): void {\n const sourceFileKey = \"SourceFile\" + bitNodeNumber.toString();\n const sourceFile = SourceFiles[sourceFileKey];\n if (sourceFile == null) {\n console.error(`Could not find source file for Bit node: ${bitNodeNumber}`);\n return;\n }\n\n // Check if player already has this source file\n const ownedSourceFile = Player.sourceFiles.find((sourceFile) => sourceFile.n === bitNodeNumber);\n\n if (ownedSourceFile) {\n if (ownedSourceFile.lvl >= 3 && ownedSourceFile.n !== 12) {\n dialogBoxCreate(\n `The Source-File for the BitNode you just destroyed, ${sourceFile.name}, is already at max level!`,\n );\n } else {\n ++ownedSourceFile.lvl;\n dialogBoxCreate(\n sourceFile.name +\n \" was upgraded to level \" +\n ownedSourceFile.lvl +\n \" for \" +\n \"destroying its corresponding BitNode!\",\n );\n }\n } else {\n const newSrcFile = new PlayerOwnedSourceFile(bitNodeNumber, 1);\n Player.sourceFiles.push(newSrcFile);\n if (bitNodeNumber === 5 && Player.skills.intelligence === 0) {\n Player.skills.intelligence = 1;\n }\n dialogBoxCreate(\n <>\n You received a Source-File for destroying a BitNode!\n <br />\n <br />\n {sourceFile.name}\n <br />\n <br />\n {sourceFile.info}\n </>,\n );\n }\n}\n\nexport function enterBitNode(flume: boolean, destroyedBitNode: number, newBitNode: number): void {\n if (!flume) {\n giveSourceFile(destroyedBitNode);\n } else if (Player.sourceFileLvl(5) === 0 && newBitNode !== 5) {\n Player.skills.intelligence = 0;\n Player.exp.intelligence = 0;\n }\n if (newBitNode === 5 && Player.skills.intelligence === 0) {\n Player.skills.intelligence = 1;\n }\n // Set new Bit Node\n Player.bitNodeN = newBitNode;\n\n if (newBitNode === 6) {\n Router.toBladeburnerCinematic();\n } else {\n Router.toTerminal();\n }\n prestigeSourceFile(flume);\n}\n","import { Settings } from \"../Settings/Settings\";\nimport { Remote } from \"./Remote\";\n\nlet server: Remote;\n\nexport function newRemoteFileApiConnection(): void {\n if (server) server.stopConnection();\n if (Settings.RemoteFileApiPort === 0) return;\n server = new Remote(\"localhost\", Settings.RemoteFileApiPort);\n server.startConnection();\n}\n\nexport function isRemoteFileApiConnectionLive(): boolean {\n return server && server.connection != undefined && server.connection.readyState == 1;\n}\n","import React from \"react\";\n\nimport { Page } from \"../ui/Router\";\nimport { hash } from \"../hash/hash\";\nimport { CONSTANTS } from \"../Constants\";\n\nenum GameEnv {\n Production,\n Development,\n}\n\nenum Platform {\n Browser,\n Steam,\n}\n\ninterface GameVersion {\n version: string;\n hash: string;\n\n toDisplay: () => string;\n}\n\ninterface BrowserFeatures {\n userAgent: string;\n language: string;\n cookiesEnabled: boolean;\n doNotTrack: string | null;\n indexedDb: boolean;\n}\n\ninterface IErrorMetadata {\n error: Error;\n errorInfo?: React.ErrorInfo;\n page?: Page;\n\n environment: GameEnv;\n platform: Platform;\n version: GameVersion;\n features: BrowserFeatures;\n}\n\nexport interface IErrorData {\n metadata: IErrorMetadata;\n\n title: string;\n body: string;\n\n features: string;\n fileName?: string;\n\n issueUrl: string;\n}\n\nexport const newIssueUrl = `https://github.com/danielyxie/bitburner/issues/new`;\n\nfunction getErrorMetadata(error: Error, errorInfo?: React.ErrorInfo, page?: Page): IErrorMetadata {\n const isElectron = navigator.userAgent.toLowerCase().indexOf(\" electron/\") > -1;\n const env = process.env.NODE_ENV === \"development\" ? GameEnv.Development : GameEnv.Production;\n const version: GameVersion = {\n version: CONSTANTS.VersionString,\n hash: hash(),\n toDisplay: () => `v${CONSTANTS.VersionString} (${hash()})`,\n };\n const features: BrowserFeatures = {\n userAgent: navigator.userAgent,\n\n language: navigator.language,\n cookiesEnabled: navigator.cookieEnabled,\n doNotTrack: navigator.doNotTrack,\n indexedDb: !!window.indexedDB,\n };\n const metadata: IErrorMetadata = {\n platform: isElectron ? Platform.Steam : Platform.Browser,\n environment: env,\n version,\n features,\n error,\n errorInfo,\n page,\n };\n return metadata;\n}\n\nexport function getErrorForDisplay(error: Error, errorInfo?: React.ErrorInfo, page?: Page): IErrorData {\n const metadata = getErrorMetadata(error, errorInfo, page);\n const fileName = (metadata.error as any).fileName;\n const features =\n `lang=${metadata.features.language} cookiesEnabled=${metadata.features.cookiesEnabled.toString()}` +\n ` doNotTrack=${metadata.features.doNotTrack ?? \"null\"} indexedDb=${metadata.features.indexedDb.toString()}`;\n\n const title = `${metadata.error.name}: ${metadata.error.message}${metadata.page && ` (at \"${Page[metadata.page]}\")`}`;\n const body = `\n## ${title}\n\n### How did this happen?\n\nPlease fill this information with details if relevant.\n\n- [ ] Save file\n- [ ] Minimal scripts to reproduce the issue\n- [ ] Steps to reproduce\n\n### Environment\n\n* Error: ${metadata.error?.toString() ?? \"n/a\"}\n* Page: ${metadata.page ? Page[metadata.page] : \"n/a\"}\n* Version: ${metadata.version.toDisplay()}\n* Environment: ${GameEnv[metadata.environment]}\n* Platform: ${Platform[metadata.platform]}\n* UserAgent: ${navigator.userAgent}\n* Features: ${features}\n* Source: ${fileName ?? \"n/a\"}\n\n${\n metadata.environment === GameEnv.Development\n ? `\n### Stack Trace\n\\`\\`\\`\n${metadata.errorInfo?.componentStack.toString().trim()}\n\\`\\`\\`\n`\n : \"\"\n}\n### Save\n\\`\\`\\`\nCopy your save here if possible\n\\`\\`\\`\n`.trim();\n\n const issueUrl = `${newIssueUrl}?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}`;\n\n const data: IErrorData = {\n metadata,\n fileName,\n features,\n title,\n body,\n issueUrl,\n };\n return data;\n}\n","import { getRandomInt } from \"../../utils/helpers/getRandomInt\";\n\nexport const Growths: {\n [key: string]: (() => number) | undefined;\n [\"Tracking\"]: () => number;\n [\"Bounty Hunter\"]: () => number;\n [\"Retirement\"]: () => number;\n [\"Investigation\"]: () => number;\n [\"Undercover Operation\"]: () => number;\n [\"Sting Operation\"]: () => number;\n [\"Raid\"]: () => number;\n [\"Stealth Retirement Operation\"]: () => number;\n [\"Assassination\"]: () => number;\n} = {\n Tracking: () => getRandomInt(5, 75) / 10,\n \"Bounty Hunter\": () => getRandomInt(5, 75) / 10,\n Retirement: () => getRandomInt(5, 75) / 10,\n Investigation: () => getRandomInt(10, 40) / 10,\n \"Undercover Operation\": () => getRandomInt(10, 40) / 10,\n \"Sting Operation\": () => getRandomInt(3, 40) / 10,\n Raid: () => getRandomInt(2, 40) / 10,\n \"Stealth Retirement Operation\": () => getRandomInt(1, 20) / 10,\n Assassination: () => getRandomInt(1, 20) / 10,\n};\n","import { getRandomInt } from \"./getRandomInt\";\n\n/**\n * Gets a random value in the range of a byte (0 - 255), or up to the maximum.\n * @param max The maximum value (up to 255).\n */\nexport function getRandomByte(max: number): number {\n // Technically 2^8 is 256, but the values are 0-255, not 1-256.\n const byteMaximum = 255;\n const upper: number = Math.max(Math.min(max, byteMaximum), 0);\n\n return getRandomInt(0, upper);\n}\n","/**\n * Utility function that creates a \"city map\", which is an object where\n * each city is a key (property).\n *\n * This map uses the official name of the city, NOT its key in the 'Cities' object\n */\nimport { Cities } from \"./Cities\";\n\nexport function createCityMap<T>(initValue: T): Record<string, T> {\n const map: Record<string, T> = {};\n const cities = Object.keys(Cities);\n for (let i = 0; i < cities.length; ++i) {\n map[cities[i]] = initValue;\n }\n\n // round try JSON so to make sure none of the initial values have the same references.\n return JSON.parse(JSON.stringify(map));\n}\n","/**\n * Represents a Hand of cards.\n *\n * This class is IMMUTABLE\n */\n\nimport { Card } from \"./Card\";\n\nexport class Hand {\n constructor(readonly cards: readonly Card[]) {}\n\n addCards(...cards: Card[]): Hand {\n return new Hand([...this.cards, ...cards]);\n }\n\n removeByIndex(i: number): Hand {\n if (i >= this.cards.length) {\n throw new Error(`Tried to remove invalid card from Hand by index: ${i}`);\n }\n\n return new Hand([...this.cards.slice().splice(i, 1)]);\n }\n}\n","/**\n * React Component for a button that initiates a transaction on the Stock Market UI\n * (Buy, Sell, Buy Max, etc.)\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\ntype IProps = {\n onClick: () => void;\n text: string;\n tooltip?: JSX.Element | null;\n};\n\nexport function StockTickerTxButton(props: IProps): React.ReactElement {\n return (\n <Tooltip title={props.tooltip != null ? <Typography>{props.tooltip}</Typography> : \"\"}>\n <Button onClick={props.onClick}>{props.text}</Button>\n </Tooltip>\n );\n}\n","import { Box, Table } from \"@mui/material\";\nimport * as React from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { BaseGift } from \"../BaseGift\";\nimport { Grid } from \"./Grid\";\nimport { zeros } from \"../Helper\";\n\ninterface IProps {\n width: number;\n height: number;\n fragments: ActiveFragment[];\n}\n\nexport function DummyGrid(props: IProps): React.ReactElement {\n const gift = new BaseGift(props.width, props.height, props.fragments);\n const ghostGrid = zeros(props.width, props.height);\n return (\n <Box>\n <Table sx={{ width: props.width, height: props.height }}>\n <Grid\n width={props.width}\n height={props.height}\n ghostGrid={ghostGrid}\n gift={gift}\n enter={() => undefined}\n click={() => undefined}\n />\n </Table>\n </Box>\n );\n}\n","import { FactionInfo, FactionInfos } from \"./FactionInfo\";\nimport { favorToRep, repToFavor } from \"./formulas/favor\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class Faction {\n /**\n * Flag signalling whether the player has already received an invitation\n * to this faction\n */\n alreadyInvited = false;\n\n /** Holds names of all augmentations that this Faction offers */\n augmentations: string[] = [];\n\n /** Amount of favor the player has with this faction. */\n favor = 0;\n\n /** Flag signalling whether player has been banned from this faction */\n isBanned = false;\n\n /** Flag signalling whether player is a member of this faction */\n isMember = false;\n\n /** Name of faction */\n name = \"\";\n\n /** Amount of reputation player has with this faction */\n playerReputation = 0;\n\n constructor(name = \"\") {\n this.name = name;\n }\n\n getInfo(): FactionInfo {\n const info = FactionInfos[this.name];\n if (info == null) {\n throw new Error(\n `Missing faction from FactionInfos: ${this.name} this probably means the faction got corrupted somehow`,\n );\n }\n\n return info;\n }\n\n gainFavor(): void {\n if (this.favor == null) {\n this.favor = 0;\n }\n this.favor += this.getFavorGain();\n }\n\n //Returns an array with [How much favor would be gained, how much rep would be left over]\n getFavorGain(): number {\n if (this.favor == null) {\n this.favor = 0;\n }\n const storedRep = Math.max(0, favorToRep(this.favor));\n const totalRep = storedRep + this.playerReputation;\n const newFavor = repToFavor(totalRep);\n return newFavor - this.favor;\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Faction\", this);\n }\n\n /** Initializes a Faction object from a JSON save state. */\n static fromJSON(value: IReviverValue): Faction {\n return Generic_fromJSON(Faction, value.data);\n }\n}\n\nReviver.constructors.Faction = Faction;\n","import * as augmentationMethods from \"./PlayerObjectAugmentationMethods\";\nimport * as bladeburnerMethods from \"./PlayerObjectBladeburnerMethods\";\nimport * as corporationMethods from \"./PlayerObjectCorporationMethods\";\nimport * as gangMethods from \"./PlayerObjectGangMethods\";\nimport * as generalMethods from \"./PlayerObjectGeneralMethods\";\nimport * as serverMethods from \"./PlayerObjectServerMethods\";\nimport * as workMethods from \"./PlayerObjectWorkMethods\";\n\nimport { Sleeve } from \"../Sleeve/Sleeve\";\nimport { PlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { Exploit } from \"../../Exploits/Exploit\";\n\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { Corporation } from \"../../Corporation/Corporation\";\nimport { Gang } from \"../../Gang/Gang\";\nimport { Bladeburner } from \"../../Bladeburner/Bladeburner\";\nimport { HacknetNode } from \"../../Hacknet/HacknetNode\";\n\nimport { HashManager } from \"../../Hacknet/HashManager\";\n\nimport { MoneySourceTracker } from \"../../utils/MoneySourceTracker\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../../utils/JSONReviver\";\nimport { PlayerAchievement } from \"../../Achievements/Achievements\";\nimport { cyrb53 } from \"../../utils/StringHelperFunctions\";\nimport { getRandomInt } from \"../../utils/helpers/getRandomInt\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Work } from \"src/Work/Work\";\nimport { Person } from \"../Person\";\n\nexport class PlayerObject extends Person {\n // Player-specific properties\n bitNodeN = 1; //current bitnode\n corporation: Corporation | null = null;\n gang: Gang | null = null;\n bladeburner: Bladeburner | null = null;\n currentServer = \"\";\n factions: string[] = [];\n factionInvitations: string[] = [];\n hacknetNodes: (HacknetNode | string)[] = []; // HacknetNode object or hostname of Hacknet Server\n has4SData = false;\n has4SDataTixApi = false;\n hashManager = new HashManager();\n hasTixApiAccess = false;\n hasWseAccount = false;\n jobs: Record<string, string> = {};\n karma = 0;\n numPeopleKilled = 0;\n location = LocationName.TravelAgency;\n money = 1000 + CONSTANTS.Donations;\n moneySourceA = new MoneySourceTracker();\n moneySourceB = new MoneySourceTracker();\n playtimeSinceLastAug = 0;\n playtimeSinceLastBitnode = 0;\n purchasedServers: string[] = [];\n scriptProdSinceLastAug = 0;\n sleeves: Sleeve[] = [];\n sleevesFromCovenant = 0;\n sourceFiles: PlayerOwnedSourceFile[] = [];\n exploits: Exploit[] = [];\n achievements: PlayerAchievement[] = [];\n terminalCommandHistory: string[] = [];\n identifier: string;\n lastUpdate = 0;\n lastSave = 0;\n totalPlaytime = 0;\n\n currentWork: Work | null = null;\n focus = false;\n\n entropy = 0;\n\n // Player-specific methods\n init = generalMethods.init;\n startWork = workMethods.startWork;\n processWork = workMethods.processWork;\n finishWork = workMethods.finishWork;\n applyForSoftwareJob = generalMethods.applyForSoftwareJob;\n applyForSoftwareConsultantJob = generalMethods.applyForSoftwareConsultantJob;\n applyForItJob = generalMethods.applyForItJob;\n applyForSecurityEngineerJob = generalMethods.applyForSecurityEngineerJob;\n applyForNetworkEngineerJob = generalMethods.applyForNetworkEngineerJob;\n applyForBusinessJob = generalMethods.applyForBusinessJob;\n applyForBusinessConsultantJob = generalMethods.applyForBusinessConsultantJob;\n applyForSecurityJob = generalMethods.applyForSecurityJob;\n applyForAgentJob = generalMethods.applyForAgentJob;\n applyForEmployeeJob = generalMethods.applyForEmployeeJob;\n applyForPartTimeEmployeeJob = generalMethods.applyForPartTimeEmployeeJob;\n applyForWaiterJob = generalMethods.applyForWaiterJob;\n applyForPartTimeWaiterJob = generalMethods.applyForPartTimeWaiterJob;\n applyForJob = generalMethods.applyForJob;\n canAccessBladeburner = bladeburnerMethods.canAccessBladeburner;\n canAccessCorporation = corporationMethods.canAccessCorporation;\n canAccessGang = gangMethods.canAccessGang;\n canAccessGrafting = generalMethods.canAccessGrafting;\n canAfford = generalMethods.canAfford;\n gainMoney = generalMethods.gainMoney;\n getCurrentServer = serverMethods.getCurrentServer;\n getGangFaction = gangMethods.getGangFaction;\n getGangName = gangMethods.getGangName;\n getHomeComputer = serverMethods.getHomeComputer;\n getNextCompanyPosition = generalMethods.getNextCompanyPosition;\n getUpgradeHomeRamCost = serverMethods.getUpgradeHomeRamCost;\n getUpgradeHomeCoresCost = serverMethods.getUpgradeHomeCoresCost;\n gotoLocation = generalMethods.gotoLocation;\n hasCorporation = corporationMethods.hasCorporation;\n hasGangWith = gangMethods.hasGangWith;\n hasTorRouter = serverMethods.hasTorRouter;\n hasProgram = generalMethods.hasProgram;\n inBladeburner = bladeburnerMethods.inBladeburner;\n inGang = gangMethods.inGang;\n isAwareOfGang = gangMethods.isAwareOfGang;\n isQualified = generalMethods.isQualified;\n loseMoney = generalMethods.loseMoney;\n reapplyAllAugmentations = generalMethods.reapplyAllAugmentations;\n reapplyAllSourceFiles = generalMethods.reapplyAllSourceFiles;\n recordMoneySource = generalMethods.recordMoneySource;\n setMoney = generalMethods.setMoney;\n startBladeburner = bladeburnerMethods.startBladeburner;\n startCorporation = corporationMethods.startCorporation;\n startFocusing = generalMethods.startFocusing;\n startGang = gangMethods.startGang;\n takeDamage = generalMethods.takeDamage;\n travel = generalMethods.travel;\n giveExploit = generalMethods.giveExploit;\n giveAchievement = generalMethods.giveAchievement;\n getCasinoWinnings = generalMethods.getCasinoWinnings;\n quitJob = generalMethods.quitJob;\n hasJob = generalMethods.hasJob;\n createHacknetServer = serverMethods.createHacknetServer;\n queueAugmentation = generalMethods.queueAugmentation;\n receiveInvite = generalMethods.receiveInvite;\n gainCodingContractReward = generalMethods.gainCodingContractReward;\n stopFocusing = generalMethods.stopFocusing;\n prestigeAugmentation = generalMethods.prestigeAugmentation;\n prestigeSourceFile = generalMethods.prestigeSourceFile;\n calculateSkillProgress = generalMethods.calculateSkillProgress;\n hospitalize = generalMethods.hospitalize;\n checkForFactionInvitations = generalMethods.checkForFactionInvitations;\n setBitNodeNumber = generalMethods.setBitNodeNumber;\n canAccessCotMG = generalMethods.canAccessCotMG;\n sourceFileLvl = generalMethods.sourceFileLvl;\n applyEntropy = augmentationMethods.applyEntropy;\n focusPenalty = generalMethods.focusPenalty;\n\n constructor() {\n super();\n // Let's get a hash of some semi-random stuff so we have something unique.\n this.identifier = cyrb53(\n \"I-\" +\n new Date().getTime() +\n navigator.userAgent +\n window.innerWidth +\n window.innerHeight +\n getRandomInt(100, 999),\n );\n }\n\n whoAmI(): string {\n return \"Player\";\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"PlayerObject\", this);\n }\n\n /** Initializes a PlayerObject object from a JSON save state. */\n static fromJSON(value: IReviverValue): PlayerObject {\n return Generic_fromJSON(PlayerObject, value.data);\n }\n}\n\nReviver.constructors.PlayerObject = PlayerObject;\n","import React, { useState, useEffect } from \"react\";\nimport { joinFaction } from \"../FactionHelpers\";\nimport { Faction } from \"../Faction\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Player } from \"@player\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const InvitationEvent = new EventEmitter<[Faction]>();\n\nexport function InvitationModal(): React.ReactElement {\n const [faction, setFaction] = useState<Faction | null>(null);\n function join(): void {\n if (faction === null) return;\n //Remove from invited factions\n const i = Player.factionInvitations.findIndex((facName) => facName === faction.name);\n if (i === -1) {\n console.error(\"Could not find faction in Player.factionInvitations\");\n }\n joinFaction(faction);\n setFaction(null);\n }\n\n useEffect(() => InvitationEvent.subscribe((faction) => setFaction(faction)), []);\n\n return (\n <Modal open={faction !== null} onClose={() => setFaction(null)}>\n <Typography variant=\"h4\">You have received a faction invitation.</Typography>\n <Typography>\n Would you like to join {(faction || { name: \"\" }).name}? <br />\n <br />\n Warning: Joining this faction may prevent you from joining other factions during this run!\n </Typography>\n <Button onClick={join}>Join!</Button>\n <Button onClick={() => setFaction(null)}>Decide later</Button>\n </Modal>\n );\n}\n","import { GangMemberTask } from \"./GangMemberTask\";\nimport { GangMemberTasks } from \"./GangMemberTasks\";\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\nimport { GangMemberUpgrades } from \"./GangMemberUpgrades\";\nimport { IAscensionResult } from \"./IAscensionResult\";\nimport { Player } from \"@player\";\nimport { Gang } from \"./Gang\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport {\n calculateRespectGain,\n calculateMoneyGain,\n calculateWantedLevelGain,\n calculateAscensionMult,\n calculateAscensionPointsGain,\n} from \"./formulas/formulas\";\n\ninterface IMults {\n hack: number;\n str: number;\n def: number;\n dex: number;\n agi: number;\n cha: number;\n}\n\nexport class GangMember {\n name: string;\n task = \"Unassigned\";\n\n earnedRespect = 0;\n\n hack = 1;\n str = 1;\n def = 1;\n dex = 1;\n agi = 1;\n cha = 1;\n\n hack_exp = 0;\n str_exp = 0;\n def_exp = 0;\n dex_exp = 0;\n agi_exp = 0;\n cha_exp = 0;\n\n hack_mult = 1;\n str_mult = 1;\n def_mult = 1;\n dex_mult = 1;\n agi_mult = 1;\n cha_mult = 1;\n\n hack_asc_points = 0;\n str_asc_points = 0;\n def_asc_points = 0;\n dex_asc_points = 0;\n agi_asc_points = 0;\n cha_asc_points = 0;\n\n upgrades: string[] = []; // Names of upgrades\n augmentations: string[] = []; // Names of augmentations only\n\n constructor(name = \"\") {\n this.name = name;\n }\n\n calculateSkill(exp: number, mult = 1): number {\n return Math.max(Math.floor(mult * (32 * Math.log(exp + 534.5) - 200)), 1);\n }\n\n calculateAscensionMult(points: number): number {\n return calculateAscensionMult(points);\n }\n\n updateSkillLevels(): void {\n this.hack = this.calculateSkill(this.hack_exp, this.hack_mult * this.calculateAscensionMult(this.hack_asc_points));\n this.str = this.calculateSkill(this.str_exp, this.str_mult * this.calculateAscensionMult(this.str_asc_points));\n this.def = this.calculateSkill(this.def_exp, this.def_mult * this.calculateAscensionMult(this.def_asc_points));\n this.dex = this.calculateSkill(this.dex_exp, this.dex_mult * this.calculateAscensionMult(this.dex_asc_points));\n this.agi = this.calculateSkill(this.agi_exp, this.agi_mult * this.calculateAscensionMult(this.agi_asc_points));\n this.cha = this.calculateSkill(this.cha_exp, this.cha_mult * this.calculateAscensionMult(this.cha_asc_points));\n }\n\n calculatePower(): number {\n return (this.hack + this.str + this.def + this.dex + this.agi + this.cha) / 95;\n }\n\n assignToTask(taskName: string): boolean {\n if (!GangMemberTasks.hasOwnProperty(taskName)) {\n this.task = \"Unassigned\";\n return false;\n }\n this.task = taskName;\n return true;\n }\n\n unassignFromTask(): void {\n this.task = \"Unassigned\";\n }\n\n getTask(): GangMemberTask {\n // TODO(hydroflame): transfer that to a save file migration function\n // Backwards compatibility\n if ((this.task as any) instanceof GangMemberTask) {\n this.task = (this.task as any).name;\n }\n\n if (GangMemberTasks.hasOwnProperty(this.task)) {\n return GangMemberTasks[this.task];\n }\n return GangMemberTasks[\"Unassigned\"];\n }\n\n calculateRespectGain(gang: Gang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateRespectGain(g, this, task);\n }\n\n calculateWantedLevelGain(gang: Gang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateWantedLevelGain(g, this, task);\n }\n\n calculateMoneyGain(gang: Gang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateMoneyGain(g, this, task);\n }\n\n expMult(): IMults {\n return {\n hack: (this.hack_mult - 1) / 4 + 1,\n str: (this.str_mult - 1) / 4 + 1,\n def: (this.def_mult - 1) / 4 + 1,\n dex: (this.dex_mult - 1) / 4 + 1,\n agi: (this.agi_mult - 1) / 4 + 1,\n cha: (this.cha_mult - 1) / 4 + 1,\n };\n }\n\n gainExperience(numCycles = 1): void {\n const task = this.getTask();\n if (task === GangMemberTasks[\"Unassigned\"]) return;\n const difficultyMult = Math.pow(task.difficulty, 0.9);\n const difficultyPerCycles = difficultyMult * numCycles;\n const weightDivisor = 1500;\n const expMult = this.expMult();\n this.hack_exp +=\n (task.hackWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.hack *\n this.calculateAscensionMult(this.hack_asc_points);\n this.str_exp +=\n (task.strWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.str *\n this.calculateAscensionMult(this.str_asc_points);\n this.def_exp +=\n (task.defWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.def *\n this.calculateAscensionMult(this.def_asc_points);\n this.dex_exp +=\n (task.dexWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.dex *\n this.calculateAscensionMult(this.dex_asc_points);\n this.agi_exp +=\n (task.agiWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.agi *\n this.calculateAscensionMult(this.agi_asc_points);\n this.cha_exp +=\n (task.chaWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.cha *\n this.calculateAscensionMult(this.cha_asc_points);\n }\n\n recordEarnedRespect(numCycles = 1, gang: Gang): void {\n this.earnedRespect += this.calculateRespectGain(gang) * numCycles;\n }\n\n getGainedAscensionPoints(): IMults {\n return {\n hack: calculateAscensionPointsGain(this.hack_exp),\n str: calculateAscensionPointsGain(this.str_exp),\n def: calculateAscensionPointsGain(this.def_exp),\n dex: calculateAscensionPointsGain(this.dex_exp),\n agi: calculateAscensionPointsGain(this.agi_exp),\n cha: calculateAscensionPointsGain(this.cha_exp),\n };\n }\n\n canAscend(): boolean {\n const points = this.getGainedAscensionPoints();\n return points.hack > 0 || points.str > 0 || points.def > 0 || points.dex > 0 || points.agi > 0 || points.cha > 0;\n }\n\n getCurrentAscensionMults(): IMults {\n return {\n hack: this.calculateAscensionMult(this.hack_asc_points),\n str: this.calculateAscensionMult(this.str_asc_points),\n def: this.calculateAscensionMult(this.def_asc_points),\n dex: this.calculateAscensionMult(this.dex_asc_points),\n agi: this.calculateAscensionMult(this.agi_asc_points),\n cha: this.calculateAscensionMult(this.cha_asc_points),\n };\n }\n\n getAscensionMultsAfterAscend(): IMults {\n const points = this.getGainedAscensionPoints();\n return {\n hack: this.calculateAscensionMult(this.hack_asc_points + points.hack),\n str: this.calculateAscensionMult(this.str_asc_points + points.str),\n def: this.calculateAscensionMult(this.def_asc_points + points.def),\n dex: this.calculateAscensionMult(this.dex_asc_points + points.dex),\n agi: this.calculateAscensionMult(this.agi_asc_points + points.agi),\n cha: this.calculateAscensionMult(this.cha_asc_points + points.cha),\n };\n }\n\n getAscensionResults(): IMults {\n const postAscend = this.getAscensionMultsAfterAscend();\n const preAscend = this.getCurrentAscensionMults();\n\n return {\n hack: postAscend.hack / preAscend.hack,\n str: postAscend.str / preAscend.str,\n def: postAscend.def / preAscend.def,\n dex: postAscend.dex / preAscend.dex,\n agi: postAscend.agi / preAscend.agi,\n cha: postAscend.cha / preAscend.cha,\n };\n }\n\n ascend(): IAscensionResult {\n const res = this.getAscensionResults();\n const points = this.getGainedAscensionPoints();\n this.hack_asc_points += points.hack;\n this.str_asc_points += points.str;\n this.def_asc_points += points.def;\n this.dex_asc_points += points.dex;\n this.agi_asc_points += points.agi;\n this.cha_asc_points += points.cha;\n\n // Remove upgrades. Then re-calculate multipliers and stats\n this.upgrades.length = 0;\n this.hack_mult = 1;\n this.str_mult = 1;\n this.def_mult = 1;\n this.dex_mult = 1;\n this.agi_mult = 1;\n this.cha_mult = 1;\n for (let i = 0; i < this.augmentations.length; ++i) {\n const aug = GangMemberUpgrades[this.augmentations[i]];\n this.applyUpgrade(aug);\n }\n\n // Clear exp and recalculate stats\n this.hack_exp = 0;\n this.str_exp = 0;\n this.def_exp = 0;\n this.dex_exp = 0;\n this.agi_exp = 0;\n this.cha_exp = 0;\n this.updateSkillLevels();\n\n const respectToDeduct = this.earnedRespect;\n this.earnedRespect = 0;\n return {\n respect: respectToDeduct,\n hack: res.hack,\n str: res.str,\n def: res.def,\n dex: res.dex,\n agi: res.agi,\n cha: res.cha,\n };\n }\n\n applyUpgrade(upg: GangMemberUpgrade): void {\n if (upg.mults.str != null) this.str_mult *= upg.mults.str;\n if (upg.mults.def != null) this.def_mult *= upg.mults.def;\n if (upg.mults.dex != null) this.dex_mult *= upg.mults.dex;\n if (upg.mults.agi != null) this.agi_mult *= upg.mults.agi;\n if (upg.mults.cha != null) this.cha_mult *= upg.mults.cha;\n if (upg.mults.hack != null) this.hack_mult *= upg.mults.hack;\n }\n\n buyUpgrade(upg: GangMemberUpgrade): boolean {\n if (!Player.gang) throw new Error(\"Tried to buy a gang member upgrade when no gang was present\");\n\n // Prevent purchasing of already-owned upgrades\n if (this.augmentations.includes(upg.name) || this.upgrades.includes(upg.name)) return false;\n\n if (Player.money < Player.gang.getUpgradeCost(upg)) return false;\n Player.loseMoney(Player.gang.getUpgradeCost(upg), \"gang\");\n if (upg.type === \"g\") {\n this.augmentations.push(upg.name);\n } else {\n this.upgrades.push(upg.name);\n }\n this.applyUpgrade(upg);\n return true;\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"GangMember\", this);\n }\n\n /** Initializes a GangMember object from a JSON save state. */\n static fromJSON(value: IReviverValue): GangMember {\n return Generic_fromJSON(GangMember, value.data);\n }\n}\n\nReviver.constructors.GangMember = GangMember;\n","import { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { MinHeap } from \"../utils/Heap\";\n\nimport { comprGenChar, comprLZGenerate, comprLZEncode, comprLZDecode } from \"../utils/CompressionContracts\";\nimport { HammingEncode, HammingDecode, HammingEncodeProperly } from \"../utils/HammingCodeTools\";\n/* tslint:disable:completed-docs no-magic-numbers arrow-return-shorthand */\n\n/* Function that generates a valid 'data' for a contract type */\nexport type GeneratorFunc = () => unknown;\n\n/* Function that checks if the provided solution is the correct one */\nexport type SolverFunc = (data: unknown, answer: string) => boolean;\n\n/* Function that returns a string with the problem's description.\n Requires the 'data' of a Contract as input */\nexport type DescriptionFunc = (data: unknown) => string;\n\ninterface ICodingContractTypeMetadata {\n desc: DescriptionFunc;\n difficulty: number;\n gen: GeneratorFunc;\n name: string;\n numTries: number;\n solver: SolverFunc;\n}\n\n/* Helper functions for Coding Contract implementations */\nfunction removeBracketsFromArrayString(str: string): string {\n let strCpy: string = str;\n if (strCpy.startsWith(\"[\")) {\n strCpy = strCpy.slice(1);\n }\n if (strCpy.endsWith(\"]\")) {\n strCpy = strCpy.slice(0, -1);\n }\n\n return strCpy;\n}\n\nfunction removeQuotesFromString(str: string): string {\n let strCpy: string = str;\n if (strCpy.startsWith('\"') || strCpy.startsWith(\"'\")) {\n strCpy = strCpy.slice(1);\n }\n if (strCpy.endsWith('\"') || strCpy.endsWith(\"'\")) {\n strCpy = strCpy.slice(0, -1);\n }\n\n return strCpy;\n}\n\nfunction convert2DArrayToString(arr: unknown[][]): string {\n const components: string[] = [];\n arr.forEach((e: unknown) => {\n let s = String(e);\n s = [\"[\", s, \"]\"].join(\"\");\n components.push(s);\n });\n\n return components.join(\",\").replace(/\\s/g, \"\");\n}\n\nexport const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [\n {\n desc: (n: unknown): string => {\n return [\"A prime factor is a factor that is a prime number.\", `What is the largest prime factor of ${n}?`].join(\n \" \",\n );\n },\n difficulty: 1,\n gen: (): number => {\n return getRandomInt(500, 1e9);\n },\n name: \"Find Largest Prime Factor\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"number\") throw new Error(\"solver expected number\");\n let fac = 2;\n let n: number = data;\n while (n > (fac - 1) * (fac - 1)) {\n while (n % fac === 0) {\n n = Math.round(n / fac);\n }\n ++fac;\n }\n\n return (n === 1 ? fac - 1 : n) === parseInt(ans, 10);\n },\n },\n {\n desc: (_n: unknown): string => {\n const n = _n as number[];\n return [\n \"Given the following integer array, find the contiguous subarray\",\n \"(containing at least one number) which has the largest sum and return that sum.\",\n \"'Sum' refers to the sum of all the numbers in the subarray.\\n\",\n `${n.toString()}`,\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): number[] => {\n const len: number = getRandomInt(5, 40);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(-10, 10);\n }\n\n return arr;\n },\n name: \"Subarray with Maximum Sum\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const nums: number[] = data.slice();\n for (let i = 1; i < nums.length; i++) {\n nums[i] = Math.max(nums[i], nums[i] + nums[i - 1]);\n }\n\n return parseInt(ans, 10) === Math.max(...nums);\n },\n },\n {\n desc: (n: unknown): string => {\n if (typeof n !== \"number\") throw new Error(\"solver expected number\");\n return [\n \"It is possible write four as a sum in exactly four different ways:\\n\\n\",\n \" 3 + 1\\n\",\n \" 2 + 2\\n\",\n \" 2 + 1 + 1\\n\",\n \" 1 + 1 + 1 + 1\\n\\n\",\n `How many different distinct ways can the number ${n} be written as a sum of at least`,\n \"two positive integers?\",\n ].join(\" \");\n },\n difficulty: 1.5,\n gen: (): number => {\n return getRandomInt(8, 100);\n },\n name: \"Total Ways to Sum\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"number\") throw new Error(\"solver expected number\");\n const ways: number[] = [1];\n ways.length = data + 1;\n ways.fill(0, 1);\n for (let i = 1; i < data; ++i) {\n for (let j: number = i; j <= data; ++j) {\n ways[j] += ways[j - i];\n }\n }\n\n return ways[data] === parseInt(ans, 10);\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as [number, number[]];\n const n: number = data[0];\n const s: number[] = data[1];\n return [\n `How many different distinct ways can the number ${n} be written`,\n \"as a sum of integers contained in the set:\\n\\n\",\n `[${s}]?\\n\\n`,\n \"You may use each integer in the set zero or more times.\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): [number, number[]] => {\n const n: number = getRandomInt(12, 200);\n const maxLen: number = getRandomInt(8, 12);\n const s: number[] = [];\n // Bias towards small numbers is intentional to have much bigger answers in general\n // to force people better optimize their solutions\n for (let i = 1; i <= n; i++) {\n if (s.length == maxLen) {\n break;\n }\n if (Math.random() < 0.6 || n - i < maxLen - s.length) {\n s.push(i);\n }\n }\n return [n, s];\n },\n name: \"Total Ways to Sum II\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [number, number[]];\n // https://www.geeksforgeeks.org/coin-change-dp-7/?ref=lbp\n const n = data[0];\n const s = data[1];\n const ways: number[] = [1];\n ways.length = n + 1;\n ways.fill(0, 1);\n for (let i = 0; i < s.length; i++) {\n for (let j = s[i]; j <= n; j++) {\n ways[j] += ways[j - s[i]];\n }\n }\n return ways[n] === parseInt(ans, 10);\n },\n },\n {\n desc: (_n: unknown): string => {\n const n = _n as number[][];\n let d: string = [\n \"Given the following array of arrays of numbers representing a 2D matrix,\",\n \"return the elements of the matrix as an array in spiral order:\\n\\n\",\n ].join(\" \");\n // for (const line of n) {\n // d += `${line.toString()},\\n`;\n // }\n d += \" [\\n\";\n d += n\n .map(\n (line: number[]) =>\n \" [\" +\n line.map((x: number) => `${x}`.padStart(2, \" \")).join(\",\") +\n \"]\",\n )\n .join(\"\\n\");\n d += \"\\n ]\\n\";\n d += [\n \"\\nHere is an example of what spiral order should be:\\n\\n\",\n \" [\\n\",\n \" [1, 2, 3]\\n\",\n \" [4, 5, 6]\\n\",\n \" [7, 8, 9]\\n\",\n \" ]\\n\\n\",\n \"Answer: [1, 2, 3, 6, 9, 8 ,7, 4, 5]\\n\\n\",\n \"Note that the matrix will not always be square:\\n\\n\",\n \" [\\n\",\n \" [1, 2, 3, 4]\\n\",\n \" [5, 6, 7, 8]\\n\",\n \" [9, 10, 11, 12]\\n\",\n \" ]\\n\\n\",\n \"Answer: [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7]\",\n ].join(\" \");\n\n return d;\n },\n difficulty: 2,\n gen: (): number[][] => {\n const m: number = getRandomInt(1, 15);\n const n: number = getRandomInt(1, 15);\n const matrix: number[][] = [];\n matrix.length = m;\n for (let i = 0; i < m; ++i) {\n matrix[i] = [];\n matrix[i].length = n;\n }\n\n for (let i = 0; i < m; ++i) {\n for (let j = 0; j < n; ++j) {\n matrix[i][j] = getRandomInt(1, 50);\n }\n }\n\n return matrix;\n },\n name: \"Spiralize Matrix\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const spiral: number[] = [];\n const m: number = data.length;\n const n: number = data[0].length;\n let u = 0;\n let d: number = m - 1;\n let l = 0;\n let r: number = n - 1;\n let k = 0;\n while (true) {\n // Up\n for (let col: number = l; col <= r; col++) {\n spiral[k] = data[u][col];\n ++k;\n }\n if (++u > d) {\n break;\n }\n\n // Right\n for (let row: number = u; row <= d; row++) {\n spiral[k] = data[row][r];\n ++k;\n }\n if (--r < l) {\n break;\n }\n\n // Down\n for (let col: number = r; col >= l; col--) {\n spiral[k] = data[d][col];\n ++k;\n }\n if (--d < u) {\n break;\n }\n\n // Left\n for (let row: number = d; row >= u; row--) {\n spiral[k] = data[row][l];\n ++k;\n }\n if (++l > r) {\n break;\n }\n }\n\n const sanitizedPlayerAns = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const playerAns = sanitizedPlayerAns.split(\",\").map((s) => parseInt(s));\n if (spiral.length !== playerAns.length) {\n return false;\n }\n for (let i = 0; i < spiral.length; ++i) {\n if (spiral[i] !== playerAns[i]) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (_arr: unknown): string => {\n const arr = _arr as number[];\n return [\n \"You are given the following array of integers:\\n\\n\",\n `${arr}\\n\\n`,\n \"Each element in the array represents your MAXIMUM jump length\",\n \"at that position. This means that if you are at position i and your\",\n \"maximum jump length is n, you can jump to any position from\",\n \"i to i+n.\",\n \"\\n\\nAssuming you are initially positioned\",\n \"at the start of the array, determine whether you are\",\n \"able to reach the last index.\\n\\n\",\n \"Your answer should be submitted as 1 or 0, representing true and false respectively\",\n ].join(\" \");\n },\n difficulty: 2.5,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 25);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < arr.length; ++i) {\n if (Math.random() < 0.2) {\n arr[i] = 0; // 20% chance of being 0\n } else {\n arr[i] = getRandomInt(0, 10);\n }\n }\n\n return arr;\n },\n name: \"Array Jumping Game\",\n numTries: 1,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const n: number = data.length;\n let i = 0;\n for (let reach = 0; i < n && i <= reach; ++i) {\n reach = Math.max(i + data[i], reach);\n }\n const solution: boolean = i === n;\n return (ans === \"1\" && solution) || (ans === \"0\" && !solution);\n },\n },\n {\n desc: (_arr: unknown): string => {\n const arr = _arr as number[];\n return [\n \"You are given the following array of integers:\\n\\n\",\n `${arr}\\n\\n`,\n \"Each element in the array represents your MAXIMUM jump length\",\n \"at that position. This means that if you are at position i and your\",\n \"maximum jump length is n, you can jump to any position from\",\n \"i to i+n.\",\n \"\\n\\nAssuming you are initially positioned\",\n \"at the start of the array, determine the minimum number of\",\n \"jumps to reach the end of the array.\\n\\n\",\n \"If it's impossible to reach the end, then the answer should be 0.\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 25);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < 10; j++) {\n if (Math.random() <= j / 10 + 0.1) {\n arr[i] = j;\n break;\n }\n }\n }\n\n return arr;\n },\n name: \"Array Jumping Game II\",\n numTries: 3,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const n: number = data.length;\n let reach = 0;\n let jumps = 0;\n let lastJump = -1;\n while (reach < n - 1) {\n let jumpedFrom = -1;\n for (let i = reach; i > lastJump; i--) {\n if (i + data[i] > reach) {\n reach = i + data[i];\n jumpedFrom = i;\n }\n }\n if (jumpedFrom === -1) {\n jumps = 0;\n break;\n }\n lastJump = jumpedFrom;\n jumps++;\n }\n return jumps === parseInt(ans, 10);\n },\n },\n {\n desc: (_arr: unknown): string => {\n const arr = _arr as number[][];\n return [\n \"Given the following array of arrays of numbers representing a list of\",\n \"intervals, merge all overlapping intervals.\\n\\n\",\n `[${convert2DArrayToString(arr)}]\\n\\n`,\n \"Example:\\n\\n\",\n \"[[1, 3], [8, 10], [2, 6], [10, 16]]\\n\\n\",\n \"would merge into [[1, 6], [8, 16]].\\n\\n\",\n \"The intervals must be returned in ASCENDING order.\",\n \"You can assume that in an interval, the first number will always be\",\n \"smaller than the second.\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[][] => {\n const intervals: number[][] = [];\n const numIntervals: number = getRandomInt(3, 20);\n for (let i = 0; i < numIntervals; ++i) {\n const start: number = getRandomInt(1, 25);\n const end: number = start + getRandomInt(1, 10);\n intervals.push([start, end]);\n }\n\n return intervals;\n },\n name: \"Merge Overlapping Intervals\",\n numTries: 15,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const intervals: number[][] = data.slice();\n intervals.sort((a: number[], b: number[]) => {\n return a[0] - b[0];\n });\n\n const result: number[][] = [];\n let start: number = intervals[0][0];\n let end: number = intervals[0][1];\n for (const interval of intervals) {\n if (interval[0] <= end) {\n end = Math.max(end, interval[1]);\n } else {\n result.push([start, end]);\n start = interval[0];\n end = interval[1];\n }\n }\n result.push([start, end]);\n\n const sanitizedResult: string = convert2DArrayToString(result);\n const sanitizedAns: string = ans.replace(/\\s/g, \"\");\n\n return sanitizedResult === sanitizedAns || sanitizedResult === removeBracketsFromArrayString(sanitizedAns);\n },\n },\n {\n desc: (data: unknown): string => {\n return [\n \"Given the following string containing only digits, return\",\n \"an array with all possible valid IP address combinations\",\n \"that can be created from the string:\\n\\n\",\n `${data}\\n\\n`,\n \"Note that an octet cannot begin with a '0' unless the number\",\n \"itself is actually 0. For example, '192.168.010.1' is not a valid IP.\\n\\n\",\n \"Examples:\\n\\n\",\n '25525511135 -> [\"255.255.11.135\", \"255.255.111.35\"]\\n',\n '1938718066 -> [\"193.87.180.66\"]',\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): string => {\n let str = \"\";\n for (let i = 0; i < 4; ++i) {\n const num: number = getRandomInt(0, 255);\n const convNum: string = num.toString();\n str += convNum;\n }\n\n return str;\n },\n name: \"Generate IP Addresses\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"string\") throw new Error(\"solver expected string\");\n const ret: string[] = [];\n for (let a = 1; a <= 3; ++a) {\n for (let b = 1; b <= 3; ++b) {\n for (let c = 1; c <= 3; ++c) {\n for (let d = 1; d <= 3; ++d) {\n if (a + b + c + d === data.length) {\n const A = parseInt(data.substring(0, a), 10);\n const B = parseInt(data.substring(a, a + b), 10);\n const C = parseInt(data.substring(a + b, a + b + c), 10);\n const D = parseInt(data.substring(a + b + c, a + b + c + d), 10);\n if (A <= 255 && B <= 255 && C <= 255 && D <= 255) {\n const ip: string = [A.toString(), \".\", B.toString(), \".\", C.toString(), \".\", D.toString()].join(\"\");\n if (ip.length === data.length + 3) {\n ret.push(ip);\n }\n }\n }\n }\n }\n }\n }\n\n const sanitizedAns: string = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const ansArr: string[] = sanitizedAns.split(\",\").map((ip) => ip.replace(/^\"|\"$/g, \"\"));\n if (ansArr.length !== ret.length) {\n return false;\n }\n for (const ipInAns of ansArr) {\n if (!ret.includes(ipInAns)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using at most\",\n \"one transaction (i.e. you can only buy and sell the stock once). If no profit can be made\",\n \"then the answer should be 0. Note\",\n \"that you have to buy the stock before you can sell it\",\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader I\",\n numTries: 5,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n let maxCur = 0;\n let maxSoFar = 0;\n for (let i = 1; i < data.length; ++i) {\n maxCur = Math.max(0, (maxCur += data[i] - data[i - 1]));\n maxSoFar = Math.max(maxCur, maxSoFar);\n }\n\n return maxSoFar.toString() === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using as many\",\n \"transactions as you'd like. A transaction is defined as buying\",\n \"and then selling one share of the stock. Note that you cannot\",\n \"engage in multiple transactions at once. In other words, you\",\n \"must sell the stock before you buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader II\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n let profit = 0;\n for (let p = 1; p < data.length; ++p) {\n profit += Math.max(data[p] - data[p - 1], 0);\n }\n\n return profit.toString() === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using at most\",\n \"two transactions. A transaction is defined as buying\",\n \"and then selling one share of the stock. Note that you cannot\",\n \"engage in multiple transactions at once. In other words, you\",\n \"must sell the stock before you buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader III\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n let hold1 = Number.MIN_SAFE_INTEGER;\n let hold2 = Number.MIN_SAFE_INTEGER;\n let release1 = 0;\n let release2 = 0;\n for (const price of data) {\n release2 = Math.max(release2, hold2 + price);\n hold2 = Math.max(hold2, release1 - price);\n release1 = Math.max(release1, hold1 + price);\n hold1 = Math.max(hold1, price * -1);\n }\n\n return release2.toString() === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as [number, number[]];\n const k = data[0];\n const prices = data[1];\n return [\n \"You are given the following array with two elements:\\n\\n\",\n `[${k}, [${prices}]]\\n\\n`,\n \"The first element is an integer k. The second element is an\",\n \"array of stock prices (which are numbers) where the i-th element\",\n \"represents the stock price on day i.\\n\\n\",\n \"Determine the maximum possible profit you can earn using at most\",\n \"k transactions. A transaction is defined as buying and then selling\",\n \"one share of the stock. Note that you cannot engage in multiple\",\n \"transactions at once. In other words, you must sell the stock before\",\n \"you can buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0.\",\n ].join(\" \");\n },\n difficulty: 8,\n gen: (): [number, number[]] => {\n const k = getRandomInt(2, 10);\n const len = getRandomInt(3, 50);\n const prices: number[] = [];\n prices.length = len;\n for (let i = 0; i < len; ++i) {\n prices[i] = getRandomInt(1, 200);\n }\n\n return [k, prices];\n },\n name: \"Algorithmic Stock Trader IV\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [number, number[]];\n const k: number = data[0];\n const prices: number[] = data[1];\n\n const len = prices.length;\n if (len < 2) {\n return parseInt(ans) === 0;\n }\n if (k > len / 2) {\n let res = 0;\n for (let i = 1; i < len; ++i) {\n res += Math.max(prices[i] - prices[i - 1], 0);\n }\n\n return parseInt(ans) === res;\n }\n\n const hold: number[] = [];\n const rele: number[] = [];\n hold.length = k + 1;\n rele.length = k + 1;\n for (let i = 0; i <= k; ++i) {\n hold[i] = Number.MIN_SAFE_INTEGER;\n rele[i] = 0;\n }\n\n let cur: number;\n for (let i = 0; i < len; ++i) {\n cur = prices[i];\n for (let j = k; j > 0; --j) {\n rele[j] = Math.max(rele[j], hold[j] + cur);\n hold[j] = Math.max(hold[j], rele[j - 1] - cur);\n }\n }\n\n return parseInt(ans) === rele[k];\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[][];\n function createTriangleRecurse(data: number[][], level = 0): string {\n const numLevels: number = data.length;\n if (level >= numLevels) {\n return \"\";\n }\n const numSpaces = numLevels - level + 1;\n\n let str: string = [\" \".repeat(numSpaces), \"[\", data[level].toString(), \"]\"].join(\"\");\n if (level < numLevels - 1) {\n str += \",\";\n }\n\n return str + \"\\n\" + createTriangleRecurse(data, level + 1);\n }\n\n function createTriangle(data: number[][]): string {\n return [\"[\\n\", createTriangleRecurse(data), \"]\"].join(\"\");\n }\n\n const triangle = createTriangle(data);\n\n return [\n \"Given a triangle, find the minimum path sum from top to bottom. In each step\",\n \"of the path, you may only move to adjacent numbers in the row below.\",\n \"The triangle is represented as a 2D array of numbers:\\n\\n\",\n `${triangle}\\n\\n`,\n \"Example: If you are given the following triangle:\\n\\n[\\n\",\n \" [2],\\n\",\n \" [3,4],\\n\",\n \" [6,5,7],\\n\",\n \" [4,1,8,3]\\n\",\n \"]\\n\\n\",\n \"The minimum path sum is 11 (2 -> 3 -> 5 -> 1).\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[][] => {\n const triangle: number[][] = [];\n const levels: number = getRandomInt(3, 12);\n triangle.length = levels;\n\n for (let row = 0; row < levels; ++row) {\n triangle[row] = [];\n triangle[row].length = row + 1;\n for (let i = 0; i < triangle[row].length; ++i) {\n triangle[row][i] = getRandomInt(1, 9);\n }\n }\n\n return triangle;\n },\n name: \"Minimum Path Sum in a Triangle\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const n: number = data.length;\n const dp: number[] = data[n - 1].slice();\n for (let i = n - 2; i > -1; --i) {\n for (let j = 0; j < data[i].length; ++j) {\n dp[j] = Math.min(dp[j], dp[j + 1]) + data[i][j];\n }\n }\n\n return dp[0] === parseInt(ans);\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n const numRows = data[0];\n const numColumns = data[1];\n return [\n \"You are in a grid with\",\n `${numRows} rows and ${numColumns} columns, and you are`,\n \"positioned in the top-left corner of that grid. You are trying to\",\n \"reach the bottom-right corner of the grid, but you can only\",\n \"move down or right on each step. Determine how many\",\n \"unique paths there are from start to finish.\\n\\n\",\n \"NOTE: The data returned for this contract is an array\",\n \"with the number of rows and columns:\\n\\n\",\n `[${numRows}, ${numColumns}]`,\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[] => {\n const numRows: number = getRandomInt(2, 14);\n const numColumns: number = getRandomInt(2, 14);\n\n return [numRows, numColumns];\n },\n name: \"Unique Paths in a Grid I\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const n: number = data[0]; // Number of rows\n const m: number = data[1]; // Number of columns\n const currentRow: number[] = [];\n currentRow.length = n;\n\n for (let i = 0; i < n; i++) {\n currentRow[i] = 1;\n }\n for (let row = 1; row < m; row++) {\n for (let i = 1; i < n; i++) {\n currentRow[i] += currentRow[i - 1];\n }\n }\n\n return parseInt(ans) === currentRow[n - 1];\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[][];\n let gridString = \"\";\n for (const line of data) {\n gridString += `${line.toString()},\\n`;\n }\n return [\n \"You are located in the top-left corner of the following grid:\\n\\n\",\n `${gridString}\\n`,\n \"You are trying reach the bottom-right corner of the grid, but you can only\",\n \"move down or right on each step. Furthermore, there are obstacles on the grid\",\n \"that you cannot move onto. These obstacles are denoted by '1', while empty\",\n \"spaces are denoted by 0.\\n\\n\",\n \"Determine how many unique paths there are from start to finish.\\n\\n\",\n \"NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[][] => {\n const numRows: number = getRandomInt(2, 12);\n const numColumns: number = getRandomInt(2, 12);\n\n const grid: number[][] = [];\n grid.length = numRows;\n for (let i = 0; i < numRows; ++i) {\n grid[i] = [];\n grid[i].length = numColumns;\n grid[i].fill(0);\n }\n\n for (let r = 0; r < numRows; ++r) {\n for (let c = 0; c < numColumns; ++c) {\n if (r === 0 && c === 0) {\n continue;\n }\n if (r === numRows - 1 && c === numColumns - 1) {\n continue;\n }\n\n // 15% chance of an element being an obstacle\n if (Math.random() < 0.15) {\n grid[r][c] = 1;\n }\n }\n }\n\n return grid;\n },\n name: \"Unique Paths in a Grid II\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const obstacleGrid: number[][] = [];\n obstacleGrid.length = data.length;\n for (let i = 0; i < obstacleGrid.length; ++i) {\n obstacleGrid[i] = data[i].slice();\n }\n\n for (let i = 0; i < obstacleGrid.length; i++) {\n for (let j = 0; j < obstacleGrid[0].length; j++) {\n if (obstacleGrid[i][j] == 1) {\n obstacleGrid[i][j] = 0;\n } else if (i == 0 && j == 0) {\n obstacleGrid[0][0] = 1;\n } else {\n obstacleGrid[i][j] = (i > 0 ? obstacleGrid[i - 1][j] : 0) + (j > 0 ? obstacleGrid[i][j - 1] : 0);\n }\n }\n }\n\n return obstacleGrid[obstacleGrid.length - 1][obstacleGrid[0].length - 1] === parseInt(ans);\n },\n },\n {\n name: \"Shortest Path in a Grid\",\n desc: (_data: unknown): string => {\n const data = _data as number[][];\n return [\n \"You are located in the top-left corner of the following grid:\\n\\n\",\n ` [${data.map((line) => \"[\" + line + \"]\").join(\",\\n \")}]\\n\\n`,\n \"You are trying to find the shortest path to the bottom-right corner of the grid,\",\n \"but there are obstacles on the grid that you cannot move onto.\",\n \"These obstacles are denoted by '1', while empty spaces are denoted by 0.\\n\\n\",\n \"Determine the shortest path from start to finish, if one exists.\",\n \"The answer should be given as a string of UDLR characters, indicating the moves along the path\\n\\n\",\n \"NOTE: If there are multiple equally short paths, any of them is accepted as answer.\",\n \"If there is no path, the answer should be an empty string.\\n\",\n \"NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\\n\\n\",\n \"Examples:\\n\\n\",\n \" [[0,1,0,0,0],\\n\",\n \" [0,0,0,1,0]]\\n\",\n \"\\n\",\n \"Answer: 'DRRURRD'\\n\\n\",\n \" [[0,1],\\n\",\n \" [1,0]]\\n\",\n \"\\n\",\n \"Answer: ''\\n\\n\",\n ].join(\" \");\n },\n difficulty: 7,\n numTries: 10,\n gen: (): number[][] => {\n const height = getRandomInt(6, 12);\n const width = getRandomInt(6, 12);\n const dstY = height - 1;\n const dstX = width - 1;\n const minPathLength = dstY + dstX; // Math.abs(dstY - srcY) + Math.abs(dstX - srcX)\n\n const grid: number[][] = new Array(height);\n for (let y = 0; y < height; y++) grid[y] = new Array(width).fill(0);\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n if (y == 0 && x == 0) continue; // Don't block start\n if (y == dstY && x == dstX) continue; // Don't block destination\n\n // Generate more obstacles the farther a position is from start and destination.\n // Raw distance factor peaks at 50% at half-way mark. Rescale to 40% max.\n // Obstacle chance range of [15%, 40%] produces ~78% solvable puzzles\n const distanceFactor = (Math.min(y + x, dstY - y + dstX - x) / minPathLength) * 0.8;\n if (Math.random() < Math.max(0.15, distanceFactor)) grid[y][x] = 1;\n }\n }\n\n return grid;\n },\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const width = data[0].length;\n const height = data.length;\n const dstY = height - 1;\n const dstX = width - 1;\n\n const distance: [number][] = new Array(height);\n //const prev: [[number, number] | undefined][] = new Array(height);\n const queue = new MinHeap<[number, number]>();\n\n for (let y = 0; y < height; y++) {\n distance[y] = new Array(width).fill(Infinity) as [number];\n //prev[y] = new Array(width).fill(undefined) as [undefined];\n }\n\n function validPosition(y: number, x: number): boolean {\n return y >= 0 && y < height && x >= 0 && x < width && data[y][x] == 0;\n }\n\n // List in-bounds and passable neighbors\n function* neighbors(y: number, x: number): Generator<[number, number]> {\n if (validPosition(y - 1, x)) yield [y - 1, x]; // Up\n if (validPosition(y + 1, x)) yield [y + 1, x]; // Down\n if (validPosition(y, x - 1)) yield [y, x - 1]; // Left\n if (validPosition(y, x + 1)) yield [y, x + 1]; // Right\n }\n\n // Prepare starting point\n distance[0][0] = 0;\n queue.push([0, 0], 0);\n\n // Take next-nearest position and expand potential paths from there\n while (queue.size > 0) {\n const [y, x] = queue.pop() as [number, number];\n for (const [yN, xN] of neighbors(y, x)) {\n const d = distance[y][x] + 1;\n if (d < distance[yN][xN]) {\n if (distance[yN][xN] == Infinity)\n // Not reached previously\n queue.push([yN, xN], d);\n // Found a shorter path\n else queue.changeWeight(([yQ, xQ]) => yQ == yN && xQ == xN, d);\n //prev[yN][xN] = [y, x];\n distance[yN][xN] = d;\n }\n }\n }\n\n // No path at all?\n if (distance[dstY][dstX] == Infinity) return ans == \"\";\n\n // There is a solution, require that the answer path is as short as the shortest\n // path we found\n if (ans.length > distance[dstY][dstX]) return false;\n\n // Further verify that the answer path is a valid path\n let ansX = 0;\n let ansY = 0;\n for (const direction of ans) {\n switch (direction) {\n case \"U\":\n ansY -= 1;\n break;\n case \"D\":\n ansY += 1;\n break;\n case \"L\":\n ansX -= 1;\n break;\n case \"R\":\n ansX += 1;\n break;\n default:\n return false; // Invalid character\n }\n if (!validPosition(ansY, ansX)) return false;\n }\n\n // Path was valid, finally verify that the answer path brought us to the end coordinates\n return ansY == dstY && ansX == dstX;\n },\n },\n {\n desc: (data: unknown): string => {\n return [\n \"Given the following string:\\n\\n\",\n `${data}\\n\\n`,\n \"remove the minimum number of invalid parentheses in order to validate\",\n \"the string. If there are multiple minimal ways to validate the string,\",\n \"provide all of the possible results. The answer should be provided\",\n \"as an array of strings. If it is impossible to validate the string\",\n \"the result should be an array with only an empty string.\\n\\n\",\n \"IMPORTANT: The string may contain letters, not just parentheses.\",\n `Examples:\\n`,\n `\"()())()\" -> [()()(), (())()]\\n`,\n `\"(a)())()\" -> [(a)()(), (a())()]\\n`,\n `\")(\" -> [\"\"]`,\n ].join(\" \");\n },\n difficulty: 10,\n gen: (): string => {\n const len: number = getRandomInt(6, 20);\n const chars: string[] = [];\n chars.length = len;\n\n // 80% chance of the first parenthesis being (\n Math.random() < 0.8 ? (chars[0] = \"(\") : (chars[0] = \")\");\n\n for (let i = 1; i < len; ++i) {\n const roll = Math.random();\n if (roll < 0.4) {\n chars[i] = \"(\";\n } else if (roll < 0.8) {\n chars[i] = \")\";\n } else {\n chars[i] = \"a\";\n }\n }\n\n return chars.join(\"\");\n },\n name: \"Sanitize Parentheses in Expression\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"string\") throw new Error(\"solver expected string\");\n let left = 0;\n let right = 0;\n const res: string[] = [];\n\n for (let i = 0; i < data.length; ++i) {\n if (data[i] === \"(\") {\n ++left;\n } else if (data[i] === \")\") {\n left > 0 ? --left : ++right;\n }\n }\n\n function dfs(\n pair: number,\n index: number,\n left: number,\n right: number,\n s: string,\n solution: string,\n res: string[],\n ): void {\n if (s.length === index) {\n if (left === 0 && right === 0 && pair === 0) {\n for (let i = 0; i < res.length; i++) {\n if (res[i] === solution) {\n return;\n }\n }\n res.push(solution);\n }\n return;\n }\n\n if (s[index] === \"(\") {\n if (left > 0) {\n dfs(pair, index + 1, left - 1, right, s, solution, res);\n }\n dfs(pair + 1, index + 1, left, right, s, solution + s[index], res);\n } else if (s[index] === \")\") {\n if (right > 0) dfs(pair, index + 1, left, right - 1, s, solution, res);\n if (pair > 0) dfs(pair - 1, index + 1, left, right, s, solution + s[index], res);\n } else {\n dfs(pair, index + 1, left, right, s, solution + s[index], res);\n }\n }\n\n dfs(0, 0, left, right, data, \"\", res);\n\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {\n sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\\s/g, \"\");\n }\n\n if (sanitizedPlayerAnsArr.length !== res.length) {\n return false;\n }\n for (const resultInAnswer of res) {\n if (!sanitizedPlayerAnsArr.includes(resultInAnswer)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as [string, number];\n const digits: string = data[0];\n const target: number = data[1];\n\n return [\n \"You are given the following string which contains only digits between 0 and 9:\\n\\n\",\n `${digits}\\n\\n`,\n `You are also given a target number of ${target}. Return all possible ways`,\n \"you can add the +(add), -(subtract), and *(multiply) operators to the string such\",\n \"that it evaluates to the target number. (Normal order of operations applies.)\\n\\n\",\n \"The provided answer should be an array of strings containing the valid expressions.\",\n \"The data provided by this problem is an array with two elements. The first element\",\n \"is the string of digits, while the second element is the target number:\\n\\n\",\n `[\"${digits}\", ${target}]\\n\\n`,\n \"NOTE: The order of evaluation expects script operator precedence\",\n \"NOTE: Numbers in the expression cannot have leading 0's. In other words,\",\n `\"1+01\" is not a valid expression`,\n \"Examples:\\n\\n\",\n `Input: digits = \"123\", target = 6\\n`,\n `Output: [1+2+3, 1*2*3]\\n\\n`,\n `Input: digits = \"105\", target = 5\\n`,\n `Output: [1*0+5, 10-5]`,\n ].join(\" \");\n },\n difficulty: 10,\n gen: (): [string, number] => {\n const numDigits = getRandomInt(4, 12);\n const digitsArray: string[] = [];\n digitsArray.length = numDigits;\n for (let i = 0; i < digitsArray.length; ++i) {\n if (i === 0) {\n digitsArray[i] = String(getRandomInt(1, 9));\n } else {\n digitsArray[i] = String(getRandomInt(0, 9));\n }\n }\n\n const target: number = getRandomInt(-100, 100);\n const digits: string = digitsArray.join(\"\");\n\n return [digits, target];\n },\n name: \"Find All Valid Math Expressions\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [string, number];\n const num = data[0];\n const target = data[1];\n\n function helper(\n res: string[],\n path: string,\n num: string,\n target: number,\n pos: number,\n evaluated: number,\n multed: number,\n ): void {\n if (pos === num.length) {\n if (target === evaluated) {\n res.push(path);\n }\n return;\n }\n\n for (let i = pos; i < num.length; ++i) {\n if (i != pos && num[pos] == \"0\") {\n break;\n }\n const cur = parseInt(num.substring(pos, i + 1));\n\n if (pos === 0) {\n helper(res, path + cur, num, target, i + 1, cur, cur);\n } else {\n helper(res, path + \"+\" + cur, num, target, i + 1, evaluated + cur, cur);\n helper(res, path + \"-\" + cur, num, target, i + 1, evaluated - cur, -cur);\n helper(res, path + \"*\" + cur, num, target, i + 1, evaluated - multed + multed * cur, multed * cur);\n }\n }\n }\n\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {\n sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\\s/g, \"\");\n }\n\n if (num == null || num.length === 0) {\n if (sanitizedPlayerAnsArr.length === 0) {\n return true;\n }\n if (sanitizedPlayerAnsArr.length === 1 && sanitizedPlayerAnsArr[0] === \"\") {\n return true;\n }\n return false;\n }\n\n const result: string[] = [];\n helper(result, \"\", num, target, 0, 0, 0);\n\n for (const expr of result) {\n if (!sanitizedPlayerAnsArr.includes(expr)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n name: \"HammingCodes: Integer to Encoded Binary\",\n numTries: 10,\n difficulty: 5,\n desc: (n: unknown): string => {\n return [\n \"You are given the following decimal Value: \\n\",\n `${n} \\n`,\n \"Convert it to a binary representation and encode it as an 'extended Hamming code'. Eg:\\n \",\n \"Value 8 is expressed in binary as '1000', which will be encoded\",\n \"with the pattern 'pppdpddd', where p is a parity bit and d a data bit,\\n\",\n \"or '10101' (Value 21) will result into (pppdpdddpd) '1001101011'.\\n\",\n \"The answer should be given as a string containing only 1s and 0s.\\n\",\n \"NOTE: the endianness of the data bits is reversed in relation to the endianness of the parity bits.\\n\",\n \"NOTE: The bit at index zero is the overall parity bit, this should be set last.\\n\",\n \"NOTE 2: You should watch the Hamming Code video from 3Blue1Brown, which explains the 'rule' of encoding,\",\n \"including the first index parity bit mentioned in the previous note.\\n\\n\",\n \"Extra rule for encoding:\\n\",\n \"There should be no leading zeros in the 'data bit' section\",\n ].join(\" \");\n },\n gen: (): number => {\n return getRandomInt(Math.pow(2, 4), Math.pow(2, getRandomInt(1, 57)));\n },\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"number\") throw new Error(\"solver expected number\");\n return ans === HammingEncode(data);\n },\n },\n {\n name: \"HammingCodes: Encoded Binary to Integer\",\n difficulty: 8,\n numTries: 10,\n desc: (n: unknown): string => {\n return [\n \"You are given the following encoded binary string: \\n\",\n `'${n}' \\n\\n`,\n \"Treat it as an extended Hamming code with 1 'possible' error at a random index.\\n\",\n \"Find the 'possible' wrong bit, fix it and extract the decimal value, which is hidden inside the string.\\n\\n\",\n \"Note: The length of the binary string is dynamic, but it's encoding/decoding follows Hamming's 'rule'\\n\",\n \"Note 2: Index 0 is an 'overall' parity bit. Watch the Hamming code video from 3Blue1Brown for more information\\n\",\n \"Note 3: There's a ~55% chance for an altered Bit. So... MAYBE there is an altered Bit 😉\\n\",\n \"Note: The endianness of the encoded decimal value is reversed in relation to the endianness of the Hamming code. Where\",\n \"the Hamming code is expressed as little-endian (LSB at index 0), the decimal value encoded in it is expressed as big-endian\",\n \"(MSB at index 0).\\n\",\n \"Extra note for automation: return the decimal value as a string\",\n ].join(\" \");\n },\n gen: (): string => {\n const _alteredBit = Math.round(Math.random());\n const _buildArray: Array<string> = HammingEncodeProperly(\n getRandomInt(Math.pow(2, 4), Math.pow(2, getRandomInt(1, 57))),\n ).split(\"\");\n if (_alteredBit) {\n const _randomIndex: number = getRandomInt(0, _buildArray.length - 1);\n _buildArray[_randomIndex] = _buildArray[_randomIndex] == \"0\" ? \"1\" : \"0\";\n }\n return _buildArray.join(\"\");\n },\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"string\") throw new Error(\"solver expected string\");\n return parseInt(ans, 10) === HammingDecode(data);\n },\n },\n {\n name: \"Proper 2-Coloring of a Graph\",\n difficulty: 7,\n numTries: 5,\n desc: (_data: unknown): string => {\n const data = _data as [number, [number, number][]];\n return [\n `You are given the following data, representing a graph:\\n`,\n `${JSON.stringify(data)}\\n`,\n `Note that \"graph\", as used here, refers to the field of graph theory, and has`,\n `no relation to statistics or plotting.`,\n `The first element of the data represents the number of vertices in the graph.`,\n `Each vertex is a unique number between 0 and ${data[0] - 1}.`,\n `The next element of the data represents the edges of the graph.`,\n `Two vertices u,v in a graph are said to be adjacent if there exists an edge [u,v].`,\n `Note that an edge [u,v] is the same as an edge [v,u], as order does not matter.`,\n `You must construct a 2-coloring of the graph, meaning that you have to assign each`,\n `vertex in the graph a \"color\", either 0 or 1, such that no two adjacent vertices have`,\n `the same color. Submit your answer in the form of an array, where element i`,\n `represents the color of vertex i. If it is impossible to construct a 2-coloring of`,\n `the given graph, instead submit an empty array.\\n\\n`,\n `Examples:\\n\\n`,\n `Input: [4, [[0, 2], [0, 3], [1, 2], [1, 3]]]\\n`,\n `Output: [0, 0, 1, 1]\\n\\n`,\n `Input: [3, [[0, 1], [0, 2], [1, 2]]]\\n`,\n `Output: []`,\n ].join(\" \");\n },\n gen: (): [number, [number, number][]] => {\n //Generate two partite sets\n const n = Math.floor(Math.random() * 5) + 3;\n const m = Math.floor(Math.random() * 5) + 3;\n\n //50% chance of spawning any given valid edge in the bipartite graph\n const edges: [number, number][] = [];\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < m; j++) {\n if (Math.random() > 0.5) {\n edges.push([i, n + j]);\n }\n }\n }\n\n //Add an edge at random with no regard to partite sets\n let a = Math.floor(Math.random() * (n + m));\n let b = Math.floor(Math.random() * (n + m));\n if (a > b) [a, b] = [b, a]; //Enforce lower numbers come first\n if (a != b && !edges.includes([a, b])) {\n edges.push([a, b]);\n }\n\n //Randomize array in-place using Durstenfeld shuffle algorithm.\n function shuffle<T>(array: T[]): void {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n }\n\n //Replace instances of the original vertex names in-place\n const vertexShuffler = Array.from(Array(n + m).keys());\n shuffle(vertexShuffler);\n for (let i = 0; i < edges.length; i++) {\n edges[i] = [vertexShuffler[edges[i][0]], vertexShuffler[edges[i][1]]];\n if (edges[i][0] > edges[i][1]) {\n //Enforce lower numbers come first\n [edges[i][0], edges[i][1]] = [edges[i][1], edges[i][0]];\n }\n }\n\n //Shuffle the order of the edges themselves, as well\n shuffle(edges);\n\n return [n + m, edges];\n },\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [number, [number, number][]];\n\n //Sanitize player input\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n\n //Case where the player believes there is no solution.\n //Attempt to construct one to check if this is correct.\n if (sanitizedPlayerAns === \"\") {\n //Helper function to get neighbourhood of a vertex\n function neighbourhood(vertex: number): number[] {\n const adjLeft = data[1].filter(([a]) => a == vertex).map(([, b]) => b);\n const adjRight = data[1].filter(([, b]) => b == vertex).map(([a]) => a);\n return adjLeft.concat(adjRight);\n }\n\n //Verify that there is no solution by attempting to create a proper 2-coloring.\n const coloring: (number | undefined)[] = Array(data[0]).fill(undefined);\n while (coloring.some((val) => val === undefined)) {\n //Color a vertex in the graph\n const initialVertex: number = coloring.findIndex((val) => val === undefined);\n coloring[initialVertex] = 0;\n const frontier: number[] = [initialVertex];\n\n //Propagate the coloring throughout the component containing v greedily\n while (frontier.length > 0) {\n const v: number = frontier.pop() || 0;\n const neighbors: number[] = neighbourhood(v);\n\n //For each vertex u adjacent to v\n for (const id in neighbors) {\n const u: number = neighbors[id];\n\n //Set the color of u to the opposite of v's color if it is new,\n //then add u to the frontier to continue the algorithm.\n if (coloring[u] === undefined) {\n if (coloring[v] === 0) coloring[u] = 1;\n else coloring[u] = 0;\n\n frontier.push(u);\n }\n\n //Assert u,v do not have the same color\n else if (coloring[u] === coloring[v]) {\n //If u,v do have the same color, no proper 2-coloring exists, meaning\n //the player was correct to say there is no proper 2-coloring of the graph.\n return true;\n }\n }\n }\n }\n\n //If this code is reached, there exists a proper 2-coloring of the input\n //graph, and thus the player was incorrect in submitting no answer.\n return false;\n }\n\n //Solution provided case\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n const coloring: number[] = sanitizedPlayerAnsArr.map((val) => parseInt(val));\n if (coloring.length == data[0]) {\n const edges = data[1];\n const validColors = [0, 1];\n //Check that the provided solution is a proper 2-coloring\n return edges.every(([a, b]) => {\n const aColor = coloring[a];\n const bColor = coloring[b];\n return (\n validColors.includes(aColor) && //Enforce the first endpoint is color 0 or 1\n validColors.includes(bColor) && //Enforce the second endpoint is color 0 or 1\n aColor != bColor //Enforce the endpoints are different colors\n );\n });\n }\n\n //Return false if the coloring is the wrong size\n else return false;\n },\n },\n {\n name: \"Compression I: RLE Compression\",\n difficulty: 2,\n numTries: 10,\n desc: (plaintext: unknown): string => {\n return [\n \"Run-length encoding (RLE) is a data compression technique which encodes data as a series of runs of\",\n \"a repeated single character. Runs are encoded as a length, followed by the character itself. Lengths\",\n \"are encoded as a single ASCII digit; runs of 10 characters or more are encoded by splitting them\",\n \"into multiple runs.\\n\\n\",\n \"You are given the following input string:\\n\",\n ` ${plaintext}\\n`,\n \"Encode it using run-length encoding with the minimum possible output length.\\n\\n\",\n \"Examples:\\n\",\n \" aaaaabccc -> 5a1b3c\\n\",\n \" aAaAaA -> 1a1A1a1A1a1A\\n\",\n \" 111112333 -> 511233\\n\",\n \" zzzzzzzzzzzzzzzzzzz -> 9z9z1z (or 9z8z2z, etc.)\\n\",\n ].join(\" \");\n },\n gen: (): string => {\n const length = 50 + Math.floor(25 * (Math.random() + Math.random()));\n let plain = \"\";\n\n while (plain.length < length) {\n const r = Math.random();\n\n let n = 1;\n if (r < 0.3) {\n n = 1;\n } else if (r < 0.6) {\n n = 2;\n } else if (r < 0.9) {\n n = Math.floor(10 * Math.random());\n } else {\n n = 10 + Math.floor(5 * Math.random());\n }\n\n const c = comprGenChar();\n plain += c.repeat(n);\n }\n\n return plain.substring(0, length);\n },\n solver: (plain: unknown, ans: string): boolean => {\n if (typeof plain !== \"string\") throw new Error(\"solver expected string\");\n if (ans.length % 2 !== 0) {\n return false;\n }\n\n let ans_plain = \"\";\n for (let i = 0; i + 1 < ans.length; i += 2) {\n const length = ans.charCodeAt(i) - 0x30;\n if (length < 0 || length > 9) {\n return false;\n }\n\n ans_plain += ans[i + 1].repeat(length);\n }\n if (ans_plain !== plain) {\n return false;\n }\n\n let length = 0;\n for (let i = 0; i < plain.length; ) {\n let run_length = 1;\n while (i + run_length < plain.length && plain[i + run_length] === plain[i]) {\n ++run_length;\n }\n i += run_length;\n\n while (run_length > 0) {\n run_length -= 9;\n length += 2;\n }\n }\n\n return ans.length <= length;\n },\n },\n {\n name: \"Compression II: LZ Decompression\",\n difficulty: 4,\n numTries: 10,\n desc: (compressed: unknown): string => {\n return [\n \"Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to\",\n \"earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk\",\n \"begins with a length L, encoded as a single ASCII digit from 1 to 9, followed by the chunk data,\",\n \"which is either:\\n\\n\",\n \"1. Exactly L characters, which are to be copied directly into the uncompressed data.\\n\",\n \"2. A reference to an earlier part of the uncompressed data. To do this, the length is followed\",\n \"by a second ASCII digit X: each of the L output characters is a copy of the character X\",\n \"places before it in the uncompressed data.\\n\\n\",\n \"For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character\",\n \"is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final\",\n \"chunk may be of either type.\\n\\n\",\n \"You are given the following LZ-encoded string:\\n\",\n ` ${compressed}\\n`,\n \"Decode it and output the original string.\\n\\n\",\n \"Example: decoding '5aaabb450723abb' chunk-by-chunk\\n\",\n \" 5aaabb -> aaabb\\n\",\n \" 5aaabb45 -> aaabbaaab\\n\",\n \" 5aaabb450 -> aaabbaaab\\n\",\n \" 5aaabb45072 -> aaabbaaababababa\\n\",\n \" 5aaabb450723abb -> aaabbaaababababaabb\",\n ].join(\" \");\n },\n gen: (): string => {\n return comprLZEncode(comprLZGenerate());\n },\n solver: (compr: unknown, ans: string): boolean => {\n if (typeof compr !== \"string\") throw new Error(\"solver expected string\");\n return ans === comprLZDecode(compr);\n },\n },\n {\n name: \"Compression III: LZ Compression\",\n difficulty: 10,\n numTries: 10,\n desc: (plaintext: unknown): string => {\n return [\n \"Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to\",\n \"earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk\",\n \"begins with a length L, encoded as a single ASCII digit from 1 to 9, followed by the chunk data,\",\n \"which is either:\\n\\n\",\n \"1. Exactly L characters, which are to be copied directly into the uncompressed data.\\n\",\n \"2. A reference to an earlier part of the uncompressed data. To do this, the length is followed\",\n \"by a second ASCII digit X: each of the L output characters is a copy of the character X\",\n \"places before it in the uncompressed data.\\n\\n\",\n \"For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character\",\n \"is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final\",\n \"chunk may be of either type.\\n\\n\",\n \"You are given the following input string:\\n\",\n ` ${plaintext}\\n`,\n \"Encode it using Lempel-Ziv encoding with the minimum possible output length.\\n\\n\",\n \"Examples (some have other possible encodings of minimal length):\\n\",\n \" abracadabra -> 7abracad47\\n\",\n \" mississippi -> 4miss433ppi\\n\",\n \" aAAaAAaAaAA -> 3aAA53035\\n\",\n \" 2718281828 -> 627182844\\n\",\n \" abcdefghijk -> 9abcdefghi02jk\\n\",\n \" aaaaaaaaaaaa -> 3aaa91\\n\",\n \" aaaaaaaaaaaaa -> 1a91031\\n\",\n \" aaaaaaaaaaaaaa -> 1a91041\",\n ].join(\" \");\n },\n gen: (): string => {\n return comprLZGenerate();\n },\n solver: (plain: unknown, ans: string): boolean => {\n if (typeof plain !== \"string\") throw new Error(\"solver expected string\");\n return comprLZDecode(ans) === plain && ans.length <= comprLZEncode(plain).length;\n },\n },\n {\n desc: (_data: unknown): string => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, number];\n return [\n \"Caesar cipher is one of the simplest encryption technique.\",\n \"It is a type of substitution cipher in which each letter in the plaintext \",\n \"is replaced by a letter some fixed number of positions down the alphabet.\",\n \"For example, with a left shift of 3, D would be replaced by A, \",\n \"E would become B, and A would become X (because of rotation).\\n\\n\",\n \"You are given an array with two elements:\\n\",\n ` [\"${data[0]}\", ${data[1]}]\\n`,\n \"The first element is the plaintext, the second element is the left shift value.\\n\\n\",\n \"Return the ciphertext as uppercase string. Spaces remains the same.\",\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): [string, number] => {\n // return [plaintext, shift value]\n const words = [\n \"ARRAY\",\n \"CACHE\",\n \"CLOUD\",\n \"DEBUG\",\n \"EMAIL\",\n \"ENTER\",\n \"FLASH\",\n \"FRAME\",\n \"INBOX\",\n \"LINUX\",\n \"LOGIC\",\n \"LOGIN\",\n \"MACRO\",\n \"MEDIA\",\n \"MODEM\",\n \"MOUSE\",\n \"PASTE\",\n \"POPUP\",\n \"PRINT\",\n \"QUEUE\",\n \"SHELL\",\n \"SHIFT\",\n \"TABLE\",\n \"TRASH\",\n \"VIRUS\",\n ];\n return [\n words\n .sort(() => Math.random() - 0.5)\n .slice(0, 5)\n .join(\" \"),\n Math.floor(Math.random() * 25 + 1),\n ];\n },\n name: \"Encryption I: Caesar Cipher\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, number];\n // data = [plaintext, shift value]\n // build char array, shifting via map and join to final results\n const cipher = [...data[0]]\n .map((a) => (a === \" \" ? a : String.fromCharCode(((a.charCodeAt(0) - 65 - data[1] + 26) % 26) + 65)))\n .join(\"\");\n return cipher === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, string];\n return [\n \"Vigenère cipher is a type of polyalphabetic substitution. It uses \",\n \"the Vigenère square to encrypt and decrypt plaintext with a keyword.\\n\\n\",\n \" Vigenère square:\\n\",\n \" A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \\n\",\n \" +----------------------------------------------------\\n\",\n \" A | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \\n\",\n \" B | B C D E F G H I J K L M N O P Q R S T U V W X Y Z A \\n\",\n \" C | C D E F G H I J K L M N O P Q R S T U V W X Y Z A B\\n\",\n \" D | D E F G H I J K L M N O P Q R S T U V W X Y Z A B C\\n\",\n \" E | E F G H I J K L M N O P Q R S T U V W X Y Z A B C D\\n\",\n \" ...\\n\",\n \" Y | Y Z A B C D E F G H I J K L M N O P Q R S T U V W X\\n\",\n \" Z | Z A B C D E F G H I J K L M N O P Q R S T U V W X Y\\n\\n\",\n \"For encryption each letter of the plaintext is paired with the corresponding letter of a repeating keyword.\",\n \"For example, the plaintext DASHBOARD is encrypted with the keyword LINUX:\\n\",\n \" Plaintext: DASHBOARD\\n\",\n \" Keyword: LINUXLINU\\n\",\n \"So, the first letter D is paired with the first letter of the key L. Therefore, row D and column L of the \",\n \"Vigenère square are used to get the first cipher letter O. This must be repeated for the whole ciphertext.\\n\\n\",\n \"You are given an array with two elements:\\n\",\n ` [\"${data[0]}\", \"${data[1]}\"]\\n`,\n \"The first element is the plaintext, the second element is the keyword.\\n\\n\",\n \"Return the ciphertext as uppercase string.\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): [string, string] => {\n // return [plaintext, keyword]\n const words = [\n \"ARRAY\",\n \"CACHE\",\n \"CLOUD\",\n \"DEBUG\",\n \"EMAIL\",\n \"ENTER\",\n \"FLASH\",\n \"FRAME\",\n \"INBOX\",\n \"LINUX\",\n \"LOGIC\",\n \"LOGIN\",\n \"MACRO\",\n \"MEDIA\",\n \"MODEM\",\n \"MOUSE\",\n \"PASTE\",\n \"POPUP\",\n \"PRINT\",\n \"QUEUE\",\n \"SHELL\",\n \"SHIFT\",\n \"TABLE\",\n \"TRASH\",\n \"VIRUS\",\n ];\n const keys = [\n \"ALGORITHM\",\n \"BANDWIDTH\",\n \"BLOGGER\",\n \"BOOKMARK\",\n \"BROADBAND\",\n \"BROWSER\",\n \"CAPTCHA\",\n \"CLIPBOARD\",\n \"COMPUTING\",\n \"COMMAND\",\n \"COMPILE\",\n \"COMPRESS\",\n \"COMPUTER\",\n \"CONFIGURE\",\n \"DASHBOARD\",\n \"DATABASE\",\n \"DESKTOP\",\n \"DIGITAL\",\n \"DOCUMENT\",\n \"DOWNLOAD\",\n \"DYNAMIC\",\n \"EMOTICON\",\n \"ENCRYPT\",\n \"EXABYTE\",\n \"FIREWALL\",\n \"FIRMWARE\",\n \"FLAMING\",\n \"FLOWCHART\",\n \"FREEWARE\",\n \"GIGABYTE\",\n \"GRAPHICS\",\n \"HARDWARE\",\n \"HYPERLINK\",\n \"HYPERTEXT\",\n \"INTEGER\",\n \"INTERFACE\",\n \"INTERNET\",\n \"ITERATION\",\n \"JOYSTICK\",\n \"JUNKMAIL\",\n \"KEYBOARD\",\n \"KEYWORD\",\n \"LURKING\",\n \"MACINTOSH\",\n \"MAINFRAME\",\n \"MALWARE\",\n \"MONITOR\",\n \"NETWORK\",\n \"NOTEBOOK\",\n \"COMPUTER\",\n \"OFFLINE\",\n \"OPERATING\",\n \"PASSWORD\",\n \"PHISHING\",\n \"PLATFORM\",\n \"PODCAST\",\n \"PRINTER\",\n \"PRIVACY\",\n \"PROCESS\",\n \"PROGRAM\",\n \"PROTOCOL\",\n \"REALTIME\",\n \"RESTORE\",\n \"RUNTIME\",\n \"SCANNER\",\n \"SECURITY\",\n \"SHAREWARE\",\n \"SNAPSHOT\",\n \"SOFTWARE\",\n \"SPAMMER\",\n \"SPYWARE\",\n \"STORAGE\",\n \"TERMINAL\",\n \"TEMPLATE\",\n \"TERABYTE\",\n \"TOOLBAR\",\n \"TYPEFACE\",\n \"USERNAME\",\n \"UTILITY\",\n \"VERSION\",\n \"VIRTUAL\",\n \"WEBMASTER\",\n \"WEBSITE\",\n \"WINDOWS\",\n \"WIRELESS\",\n \"PROCESSOR\",\n ];\n return [\n words\n .sort(() => Math.random() - 0.5)\n .slice(0, 5)\n .join(\"\"),\n keys.sort(() => Math.random() - 0.5)[0],\n ];\n },\n name: \"Encryption II: Vigenère Cipher\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, string];\n // data = [plaintext, keyword]\n // build char array, shifting via map and corresponding keyword letter and join to final results\n const cipher = [...data[0]]\n .map((a, i) => {\n return a === \" \"\n ? a\n : String.fromCharCode(((a.charCodeAt(0) - 2 * 65 + data[1].charCodeAt(i % data[1].length)) % 26) + 65);\n })\n .join(\"\");\n return cipher === ans;\n },\n },\n];\n","import React, { useState, useEffect } from \"react\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\nimport { CodingContract, CodingContractTypes } from \"../../CodingContracts\";\nimport { CopyableText } from \"./CopyableText\";\nimport { Modal } from \"./Modal\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n c: CodingContract;\n onClose: () => void;\n onAttempt: (answer: string) => void;\n}\n\nexport const CodingContractEvent = new EventEmitter<[IProps]>();\n\nexport function CodingContractModal(): React.ReactElement {\n const [props, setProps] = useState<IProps | null>(null);\n const [answer, setAnswer] = useState(\"\");\n\n useEffect(() => {\n CodingContractEvent.subscribe((props) => setProps(props));\n });\n if (props === null) return <></>;\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setAnswer(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (props === null) return;\n // React just won't cooperate on this one.\n // \"React.KeyboardEvent<HTMLInputElement>\" seems like the right type but\n // whatever ...\n const value = (event.target as any).value;\n\n if (event.key === KEY.ENTER && value !== \"\") {\n event.preventDefault();\n props.onAttempt(answer);\n setAnswer(\"\");\n close();\n }\n }\n\n function close(): void {\n if (props === null) return;\n props.onClose();\n setProps(null);\n }\n\n const contractType = CodingContractTypes[props.c.type];\n const description = [];\n for (const [i, value] of contractType.desc(props.c.data).split(\"\\n\").entries())\n description.push(<span key={i} dangerouslySetInnerHTML={{ __html: value + \"<br />\" }}></span>);\n return (\n <Modal open={props !== null} onClose={close}>\n <CopyableText variant=\"h4\" value={props.c.type} />\n <Typography>\n You are attempting to solve a Coding Contract. You have {props.c.getMaxNumTries() - props.c.tries} tries\n remaining, after which the contract will self-destruct.\n </Typography>\n <br />\n <Typography>{description}</Typography>\n <br />\n <TextField\n autoFocus\n placeholder=\"Enter Solution here\"\n value={answer}\n onChange={onChange}\n onKeyDown={onKeyDown}\n InputProps={{\n endAdornment: (\n <Button\n onClick={() => {\n props.onAttempt(answer);\n setAnswer(\"\");\n close();\n }}\n >\n Solve\n </Button>\n ),\n }}\n />\n </Modal>\n );\n}\n","import { CodingContract } from \"../CodingContracts\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { Script } from \"../Script/Script\";\nimport { isValidFilePath } from \"../Terminal/DirectoryHelpers\";\nimport { TextFile } from \"../TextFile\";\nimport { IReturnStatus } from \"../types\";\n\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\n\nimport { createRandomIp } from \"../utils/IPAddress\";\nimport { compareArrays } from \"../utils/helpers/compareArrays\";\nimport { ScriptArg } from \"../Netscript/ScriptArg\";\n\ninterface IConstructorParams {\n adminRights?: boolean;\n hostname: string;\n ip?: string;\n isConnectedTo?: boolean;\n maxRam?: number;\n organizationName?: string;\n}\n\ninterface writeResult {\n success: boolean;\n overwritten: boolean;\n}\n\n/** Abstract Base Class for any Server object */\nexport abstract class BaseServer {\n // Coding Contract files on this server\n contracts: CodingContract[] = [];\n\n // How many CPU cores this server has. Maximum of 8.\n // Currently, this only affects hacking missions\n cpuCores = 1;\n\n // Flag indicating whether the FTP port is open\n ftpPortOpen = false;\n\n // Flag indicating whether player has admin/root access to this server\n hasAdminRights = false;\n\n // Hostname. Must be unique\n hostname = \"\";\n\n // Flag indicating whether HTTP Port is open\n httpPortOpen = false;\n\n // IP Address. Must be unique\n ip = \"\";\n\n // Flag indicating whether player is currently connected to this server\n isConnectedTo = false;\n\n // RAM (GB) available on this server\n maxRam = 0;\n\n // Message files AND Literature files on this Server\n messages: string[] = [];\n\n // Name of company/faction/etc. that this server belongs to.\n // Optional, not applicable to all Servers\n organizationName = \"\";\n\n // Programs on this servers. Contains only the names of the programs\n programs: string[] = [];\n\n // RAM (GB) used. i.e. unavailable RAM\n ramUsed = 0;\n\n // RunningScript files on this server\n runningScripts: RunningScript[] = [];\n\n // Script files on this Server\n scripts: Script[] = [];\n\n // Contains the hostnames of all servers that are immediately\n // reachable from this one\n serversOnNetwork: string[] = [];\n\n // Flag indicating whether SMTP Port is open\n smtpPortOpen = false;\n\n // Flag indicating whether SQL Port is open\n sqlPortOpen = false;\n\n // Flag indicating whether the SSH Port is open\n sshPortOpen = false;\n\n // Text files on this server\n textFiles: TextFile[] = [];\n\n // Flag indicating whether this is a purchased server\n purchasedByPlayer = false;\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n this.ip = params.ip ? params.ip : createRandomIp();\n\n this.hostname = params.hostname;\n this.organizationName = params.organizationName != null ? params.organizationName : \"\";\n this.isConnectedTo = params.isConnectedTo != null ? params.isConnectedTo : false;\n\n //Access information\n this.hasAdminRights = params.adminRights != null ? params.adminRights : false;\n }\n\n addContract(contract: CodingContract): void {\n this.contracts.push(contract);\n }\n\n getContract(contractName: string): CodingContract | null {\n for (const contract of this.contracts) {\n if (contract.fn === contractName) {\n return contract;\n }\n }\n return null;\n }\n\n /**\n * Find an actively running script on this server\n * @param scriptName - Filename of script to search for\n * @param scriptArgs - Arguments that script is being run with\n * @returns RunningScript for the specified active script\n * Returns null if no such script can be found\n */\n getRunningScript(scriptName: string, scriptArgs: ScriptArg[]): RunningScript | null {\n for (const rs of this.runningScripts) {\n if (rs.filename === scriptName && compareArrays(rs.args, scriptArgs)) {\n return rs;\n }\n }\n\n return null;\n }\n\n /**\n * Given the name of the script, returns the corresponding\n * Script object on the server (if it exists)\n */\n getScript(scriptName: string): Script | null {\n for (let i = 0; i < this.scripts.length; i++) {\n if (this.scripts[i].filename === scriptName) {\n return this.scripts[i];\n }\n }\n\n return null;\n }\n\n /** Returns boolean indicating whether the given script is running on this server */\n isRunning(fn: string): boolean {\n for (const runningScriptObj of this.runningScripts) {\n if (runningScriptObj.filename === fn) {\n return true;\n }\n }\n\n return false;\n }\n\n removeContract(contract: CodingContract | string): void {\n const index = this.contracts.findIndex((c) => c.fn === (typeof contract === \"string\" ? contract : contract.fn));\n if (index > -1) this.contracts.splice(index, 1);\n }\n\n /**\n * Remove a file from the server\n * @param fn {string} Name of file to be deleted\n * @returns {IReturnStatus} Return status object indicating whether or not file was deleted\n */\n removeFile(fn: string): IReturnStatus {\n if (fn.endsWith(\".exe\") || fn.match(/^.+\\.exe-\\d+(?:\\.\\d*)?%-INC$/) != null) {\n for (let i = 0; i < this.programs.length; ++i) {\n if (this.programs[i] === fn) {\n this.programs.splice(i, 1);\n return { res: true };\n }\n }\n } else if (isScriptFilename(fn)) {\n for (let i = 0; i < this.scripts.length; ++i) {\n if (this.scripts[i].filename === fn) {\n if (this.isRunning(fn)) {\n return {\n res: false,\n msg: \"Cannot delete a script that is currently running!\",\n };\n }\n\n this.scripts.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".lit\")) {\n for (let i = 0; i < this.messages.length; ++i) {\n const f = this.messages[i];\n if (typeof f === \"string\" && f === fn) {\n this.messages.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".txt\")) {\n for (let i = 0; i < this.textFiles.length; ++i) {\n if (this.textFiles[i].fn === fn) {\n this.textFiles.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".cct\")) {\n for (let i = 0; i < this.contracts.length; ++i) {\n if (this.contracts[i].fn === fn) {\n this.contracts.splice(i, 1);\n return { res: true };\n }\n }\n }\n\n return { res: false, msg: \"No such file exists\" };\n }\n\n /**\n * Called when a script is run on this server.\n * All this function does is add a RunningScript object to the\n * `runningScripts` array. It does NOT check whether the script actually can\n * be run.\n */\n runScript(script: RunningScript): void {\n this.runningScripts.push(script);\n }\n\n setMaxRam(ram: number): void {\n this.maxRam = ram;\n }\n\n updateRamUsed(ram: number): void {\n this.ramUsed = ram;\n }\n\n pushProgram(program: string): void {\n if (this.programs.includes(program)) return;\n\n // Remove partially created program if there is one\n const existingPartialExeIndex = this.programs.findIndex((p) => p.startsWith(program));\n // findIndex returns -1 if there is no match, we only want to splice on a match\n if (existingPartialExeIndex > -1) {\n this.programs.splice(existingPartialExeIndex, 1);\n }\n\n this.programs.push(program);\n }\n\n /**\n * Write to a script file\n * Overwrites existing files. Creates new files if the script does not exist.\n */\n writeToScriptFile(fn: string, code: string): writeResult {\n const ret = { success: false, overwritten: false };\n if (!isValidFilePath(fn) || !isScriptFilename(fn)) {\n return ret;\n }\n\n // Check if the script already exists, and overwrite it if it does\n for (let i = 0; i < this.scripts.length; ++i) {\n if (fn === this.scripts[i].filename) {\n const script = this.scripts[i];\n script.code = code;\n script.updateRamUsage(this.scripts);\n script.markUpdated();\n ret.overwritten = true;\n ret.success = true;\n return ret;\n }\n }\n\n // Otherwise, create a new script\n const newScript = new Script(fn, code, this.hostname, this.scripts);\n this.scripts.push(newScript);\n ret.success = true;\n return ret;\n }\n\n // Write to a text file\n // Overwrites existing files. Creates new files if the text file does not exist\n writeToTextFile(fn: string, txt: string): writeResult {\n const ret = { success: false, overwritten: false };\n if (!isValidFilePath(fn) || !fn.endsWith(\"txt\")) {\n return ret;\n }\n\n // Check if the text file already exists, and overwrite if it does\n for (let i = 0; i < this.textFiles.length; ++i) {\n if (this.textFiles[i].fn === fn) {\n ret.overwritten = true;\n this.textFiles[i].text = txt;\n ret.success = true;\n return ret;\n }\n }\n\n // Otherwise create a new text file\n const newFile = new TextFile(fn, txt);\n this.textFiles.push(newFile);\n ret.success = true;\n return ret;\n }\n}\n","import { CONSTANTS } from \"../../Constants\";\nimport { Server } from \"../Server\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Person } from \"../../PersonObjects/Person\";\n\nexport function calculateServerGrowth(server: Server, threads: number, p: Person, cores = 1): number {\n const numServerGrowthCycles = Math.max(Math.floor(threads), 0);\n\n //Get adjusted growth rate, which accounts for server security\n const growthRate = CONSTANTS.ServerBaseGrowthRate;\n let adjGrowthRate = 1 + (growthRate - 1) / server.hackDifficulty;\n if (adjGrowthRate > CONSTANTS.ServerMaxGrowthRate) {\n adjGrowthRate = CONSTANTS.ServerMaxGrowthRate;\n }\n\n //Calculate adjusted server growth rate based on parameters\n const serverGrowthPercentage = server.serverGrowth / 100;\n const numServerGrowthCyclesAdjusted =\n numServerGrowthCycles * serverGrowthPercentage * BitNodeMultipliers.ServerGrowthRate;\n\n //Apply serverGrowth for the calculated number of growth cycles\n const coreBonus = 1 + (cores - 1) / 16;\n return Math.pow(adjGrowthRate, numServerGrowthCyclesAdjusted * p.mults.hacking_grow * coreBonus);\n}\n","/**\n * Helper functions that implement \"directory\" functionality in the Terminal.\n * These aren't \"real\" directories, it's more of a pseudo-directory implementation\n * that uses mainly string manipulation.\n *\n * This file contains function that deal with Server-related directory things.\n * Functions that deal with the string manipulation can be found in\n * ./DirectoryHelpers.ts\n */\nimport { isValidDirectoryPath, isInRootDirectory, getFirstParentDirectory } from \"./DirectoryHelpers\";\nimport { BaseServer } from \"../Server/BaseServer\";\n\n/**\n * Given a directory (by the full directory path) and a server, returns all\n * subdirectories of that directory. This is only for FIRST-LEVEl/immediate subdirectories\n */\nexport function getSubdirectories(serv: BaseServer, dir: string): string[] {\n const res: string[] = [];\n\n if (!isValidDirectoryPath(dir)) {\n return res;\n }\n\n let t_dir = dir;\n if (!t_dir.endsWith(\"/\")) {\n t_dir += \"/\";\n }\n\n function processFile(fn: string): void {\n if (t_dir === \"/\" && isInRootDirectory(fn)) {\n const subdir = getFirstParentDirectory(fn);\n if (subdir !== \"/\" && !res.includes(subdir)) {\n res.push(subdir);\n }\n } else if (fn.startsWith(t_dir)) {\n const remaining = fn.slice(t_dir.length);\n const subdir = getFirstParentDirectory(remaining);\n if (subdir !== \"/\" && !res.includes(subdir)) {\n res.push(subdir);\n }\n }\n }\n\n for (const script of serv.scripts) {\n processFile(script.filename);\n }\n\n for (const txt of serv.textFiles) {\n processFile(txt.fn);\n }\n\n return res;\n}\n\n/** Returns true, if the server's directory itself or one of its subdirectory contains files. */\nexport function containsFiles(server: BaseServer, dir: string): boolean {\n const dirWithTrailingSlash = dir + (dir.slice(-1) === \"/\" ? \"\" : \"/\");\n\n return [...server.scripts.map((s) => s.filename), ...server.textFiles.map((t) => t.fn)].some((filename) =>\n filename.startsWith(dirWithTrailingSlash),\n );\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport FileSaver from \"file-saver\";\nimport JSZip from \"jszip\";\n\nexport function exportScripts(pattern: string, server: BaseServer): void {\n const matchEnding = pattern.length == 1 || pattern === \"*.*\" ? null : pattern.slice(1); // Treat *.* the same as *\n const zip = new JSZip();\n // Helper function to zip any file contents whose name matches the pattern\n const zipFiles = (fileNames: string[], fileContents: string[]): void => {\n for (let i = 0; i < fileContents.length; ++i) {\n let name = fileNames[i];\n if (name.startsWith(\"/\")) name = name.slice(1);\n if (!matchEnding || name.endsWith(matchEnding))\n zip.file(name, new Blob([fileContents[i]], { type: \"text/plain\" }));\n }\n };\n // In the case of script files, we pull from the server.scripts array\n if (!matchEnding || isScriptFilename(matchEnding))\n zipFiles(\n server.scripts.map((s) => s.filename),\n server.scripts.map((s) => s.code),\n );\n // In the case of text files, we pull from the server.scripts array\n if (!matchEnding || matchEnding.endsWith(\".txt\"))\n zipFiles(\n server.textFiles.map((s) => s.fn),\n server.textFiles.map((s) => s.text),\n );\n\n // Return an error if no files matched, rather than an empty zip folder\n if (Object.keys(zip.files).length == 0) throw new Error(`No files match the pattern ${pattern}`);\n const zipFn = `bitburner${isScriptFilename(pattern) ? \"Scripts\" : pattern === \"*.txt\" ? \"Texts\" : \"Files\"}.zip`;\n zip.generateAsync({ type: \"blob\" }).then((content: Blob) => FileSaver.saveAs(content, zipFn));\n}\n\nexport function download(args: (string | number | boolean)[], server: BaseServer): void {\n try {\n if (args.length !== 1) {\n Terminal.error(\"Incorrect usage of download command. Usage: download [script/text file]\");\n return;\n }\n const fn = args[0] + \"\";\n // If the parameter starts with *, download all files that match the wildcard pattern\n if (fn.startsWith(\"*\")) {\n try {\n exportScripts(fn, server);\n return;\n } catch (e: unknown) {\n let msg = String(e);\n if (e !== null && typeof e == \"object\" && e.hasOwnProperty(\"message\")) {\n msg = String((e as { message: unknown }).message);\n }\n return Terminal.error(msg);\n }\n } else if (isScriptFilename(fn)) {\n // Download a single script\n const script = Terminal.getScript(fn);\n if (script != null) {\n return script.download();\n }\n } else if (fn.endsWith(\".txt\")) {\n // Download a single text file\n const txt = Terminal.getTextFile(fn);\n if (txt != null) {\n return txt.download();\n }\n } else {\n Terminal.error(`Cannot download this filetype`);\n return;\n }\n Terminal.error(`${fn} does not exist`);\n return;\n } catch (e) {\n Terminal.error(e + \"\");\n return;\n }\n}\n","import * as acorn from \"acorn\";\n/**\n * @license\n * JavaScript Interpreter\n *\n * Copyright 2013 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Interpreting JavaScript in JavaScript.\n * @author fraser@google.com (Neil Fraser)\n */\n(\"use strict\");\n\n/**\n * Create a new interpreter.\n * @param {string|!Object} code Raw JavaScript text or AST.\n * @param {Function=} opt_initFunc Optional initialization function. Used to\n * define APIs. When called it is passed the interpreter object and the\n * global scope object.\n * @param {Number} Bitburner-specific number used for determining exception line numbers\n * @constructor\n */\nvar Interpreter = function (code, opt_initFunc, lineOffset = 0) {\n this.sourceCode = code;\n this.sourceCodeLineOffset = lineOffset;\n if (typeof code === \"string\") {\n code = acorn.parse(code, Interpreter.PARSE_OPTIONS);\n }\n this.ast = code;\n this.initFunc_ = opt_initFunc;\n this.paused_ = false;\n this.polyfills_ = [];\n // Unique identifier for native functions. Used in serialization.\n this.functionCounter_ = 0;\n // Map node types to our step function names; a property lookup is faster\n // than string concatenation with \"step\" prefix.\n this.stepFunctions_ = Object.create(null);\n var stepMatch = /^step([A-Z]\\w*)$/;\n var m;\n for (var methodName in this) {\n if (typeof this[methodName] === \"function\" && (m = methodName.match(stepMatch))) {\n this.stepFunctions_[m[1]] = this[methodName].bind(this);\n }\n }\n // Create and initialize the global scope.\n this.global = this.createScope(this.ast, null);\n // Run the polyfills.\n this.ast = acorn.parse(this.polyfills_.join(\"\\n\"), Interpreter.PARSE_OPTIONS);\n this.polyfills_ = undefined; // Allow polyfill strings to garbage collect.\n this.stripLocations_(this.ast, undefined, undefined);\n var state = new Interpreter.State(this.ast, this.global);\n state.done = false;\n this.stateStack = [state];\n this.run();\n this.value = undefined;\n // Point at the main program.\n this.ast = code;\n var state = new Interpreter.State(this.ast, this.global);\n state.done = false;\n this.stateStack.length = 0;\n this.stateStack[0] = state;\n // Get a handle on Acorn's node_t object. It's tricky to access.\n this.nodeConstructor = state.node.constructor;\n // Preserve publicly properties from being pruned/renamed by JS compilers.\n // Add others as needed.\n this[\"stateStack\"] = this.stateStack;\n};\n\n/**\n * @const {!Object} Configuration used for all Acorn parsing.\n */\nInterpreter.PARSE_OPTIONS = {\n ecmaVersion: 5,\n locations: true,\n};\n\n/**\n * Property descriptor of readonly properties.\n */\nInterpreter.READONLY_DESCRIPTOR = {\n configurable: true,\n enumerable: true,\n writable: false,\n};\n\n/**\n * Property descriptor of non-enumerable properties.\n */\nInterpreter.NONENUMERABLE_DESCRIPTOR = {\n configurable: true,\n enumerable: false,\n writable: true,\n};\n\n/**\n * Property descriptor of readonly, non-enumerable properties.\n */\nInterpreter.READONLY_NONENUMERABLE_DESCRIPTOR = {\n configurable: true,\n enumerable: false,\n writable: false,\n};\n\n/**\n * Property descriptor of variables.\n */\nInterpreter.VARIABLE_DESCRIPTOR = {\n configurable: false,\n enumerable: true,\n writable: true,\n};\n\n/**\n * Unique symbol for indicating that a step has encountered an error, has\n * added it to the stack, and will be thrown within the user's program.\n * When STEP_ERROR is thrown in the JS-Interpreter, the error can be ignored.\n */\nInterpreter.STEP_ERROR = {};\n\n/**\n * Unique symbol for indicating that a reference is a variable on the scope,\n * not an object property.\n */\nInterpreter.SCOPE_REFERENCE = {};\n\n/**\n * Unique symbol for indicating, when used as the value of the value\n * parameter in calls to setProperty and friends, that the value\n * should be taken from the property descriptor instead.\n */\nInterpreter.VALUE_IN_DESCRIPTOR = {};\n\n/**\n * For cycle detection in array to string and error conversion;\n * see spec bug github.com/tc39/ecma262/issues/289\n * Since this is for atomic actions only, it can be a class property.\n */\nInterpreter.toStringCycles_ = [];\n\n/**\n * Determine error/exception line number in Bitburner source code\n * @param {Object} AST Node that causes Error/Exception\n */\nInterpreter.prototype.getErrorLineNumber = function (node) {\n var code = this.sourceCode;\n if (node == null || node.start == null) {\n return NaN;\n }\n try {\n code = code.substring(0, node.start);\n return (code.match(/\\n/g) || []).length + 1 - this.sourceCodeLineOffset;\n } catch (e) {\n return NaN;\n }\n};\n\n/**\n * Generate the appropriate line number error message for Bitburner\n * @param {Number} lineNumber\n */\nInterpreter.prototype.getErrorLineNumberMessage = function (lineNumber) {\n if (isNaN(lineNumber)) {\n return \" (Unknown line number)\";\n } else if (lineNumber <= 0) {\n return \" (Error occurred in an imported function)\";\n } else {\n return (\n \" (Line Number \" +\n lineNumber +\n \". This line number is probably incorrect \" +\n \"if your script is importing any functions. This is being worked on)\"\n );\n }\n};\n\n/**\n * Add more code to the interpreter.\n * @param {string|!Object} code Raw JavaScript text or AST.\n */\nInterpreter.prototype.appendCode = function (code) {\n var state = this.stateStack[0];\n if (!state || state.node[\"type\"] !== \"Program\") {\n throw Error(\"Expecting original AST to start with a Program node.\");\n }\n if (typeof code === \"string\") {\n code = acorn.parse(code, Interpreter.PARSE_OPTIONS);\n }\n if (!code || code[\"type\"] !== \"Program\") {\n throw Error(\"Expecting new AST to start with a Program node.\");\n }\n this.populateScope_(code, state.scope);\n // Append the new program to the old one.\n for (var i = 0, node; (node = code[\"body\"][i]); i++) {\n state.node[\"body\"].push(node);\n }\n state.done = false;\n};\n\n/**\n * Execute one step of the interpreter.\n * @return {boolean} True if a step was executed, false if no more instructions.\n */\nInterpreter.prototype.step = function () {\n var stack = this.stateStack;\n var state = stack[stack.length - 1];\n if (!state) {\n return false;\n }\n var node = state.node,\n type = node[\"type\"];\n if (type === \"Program\" && state.done) {\n return false;\n } else if (this.paused_) {\n return true;\n }\n try {\n var nextState = this.stepFunctions_[type](stack, state, node);\n } catch (e) {\n // Eat any step errors. They have been thrown on the stack.\n if (e !== Interpreter.STEP_ERROR) {\n // Uh oh. This is a real error in the JS-Interpreter. Rethrow.\n throw e;\n }\n }\n if (nextState) {\n stack.push(nextState);\n }\n if (!node[\"end\"]) {\n // This is polyfill code. Keep executing until we arrive at user code.\n return this.step();\n }\n return true;\n};\n\n/**\n * Execute the interpreter to program completion. Vulnerable to infinite loops.\n * @return {boolean} True if a execution is asynchronously blocked,\n * false if no more instructions.\n */\nInterpreter.prototype.run = function () {\n while (!this.paused_ && this.step()) {}\n return this.paused_;\n};\n\n/**\n * Initialize the global scope with buitin properties and functions.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initGlobalScope = function (scope) {\n // Initialize uneditable global properties.\n this.setProperty(scope, \"NaN\", NaN, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"Infinity\", Infinity, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"undefined\", undefined, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"window\", scope, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"this\", scope, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"self\", scope); // Editable.\n\n // Create the objects which will become Object.prototype and\n // Function.prototype, which are needed to bootstrap everything else.\n this.OBJECT_PROTO = new Interpreter.Object(null);\n this.FUNCTION_PROTO = new Interpreter.Object(this.OBJECT_PROTO);\n // Initialize global objects.\n this.initFunction(scope);\n this.initObject(scope);\n // Unable to set scope's parent prior (OBJECT did not exist).\n // Note that in a browser this would be 'Window', whereas in Node.js it would\n // be 'Object'. This interpreter is closer to Node in that it has no DOM.\n scope.proto = this.OBJECT_PROTO;\n this.setProperty(scope, \"constructor\", this.OBJECT, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.initArray(scope);\n this.initString(scope);\n this.initBoolean(scope);\n this.initNumber(scope);\n this.initDate(scope);\n this.initRegExp(scope);\n this.initError(scope);\n this.initMath(scope);\n this.initJSON(scope);\n\n // Initialize global functions.\n var thisInterpreter = this;\n var func = this.createNativeFunction(function (x) {\n throw EvalError(\"Can't happen\");\n }, false);\n func.eval = true;\n this.setProperty(scope, \"eval\", func);\n\n this.setProperty(scope, \"parseInt\", this.createNativeFunction(parseInt, false));\n this.setProperty(scope, \"parseFloat\", this.createNativeFunction(parseFloat, false));\n\n this.setProperty(scope, \"isNaN\", this.createNativeFunction(isNaN, false));\n\n this.setProperty(scope, \"isFinite\", this.createNativeFunction(isFinite, false));\n\n var strFunctions = [\n [escape, \"escape\"],\n [unescape, \"unescape\"],\n [decodeURI, \"decodeURI\"],\n [decodeURIComponent, \"decodeURIComponent\"],\n [encodeURI, \"encodeURI\"],\n [encodeURIComponent, \"encodeURIComponent\"],\n ];\n for (var i = 0; i < strFunctions.length; i++) {\n var wrapper = (function (nativeFunc) {\n return function (str) {\n try {\n return nativeFunc(str);\n } catch (e) {\n // decodeURI('%xy') will throw an error. Catch and rethrow.\n thisInterpreter.throwException(thisInterpreter.URI_ERROR, e.message);\n }\n };\n })(strFunctions[i][0]);\n this.setProperty(\n scope,\n strFunctions[i][1],\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n }\n // Preserve publicly properties from being pruned/renamed by JS compilers.\n // Add others as needed.\n this[\"OBJECT\"] = this.OBJECT;\n this[\"OBJECT_PROTO\"] = this.OBJECT_PROTO;\n this[\"FUNCTION\"] = this.FUNCTION;\n this[\"FUNCTION_PROTO\"] = this.FUNCTION_PROTO;\n this[\"ARRAY\"] = this.ARRAY;\n this[\"ARRAY_PROTO\"] = this.ARRAY_PROTO;\n this[\"REGEXP\"] = this.REGEXP;\n this[\"REGEXP_PROTO\"] = this.REGEXP_PROTO;\n this[\"DATE\"] = this.DATE;\n this[\"DATE_PROTO\"] = this.DATE_PROTO;\n // The following properties are obsolete. Do not use.\n this[\"UNDEFINED\"] = undefined;\n this[\"NULL\"] = null;\n this[\"NAN\"] = NaN;\n this[\"TRUE\"] = true;\n this[\"FALSE\"] = false;\n this[\"STRING_EMPTY\"] = \"\";\n this[\"NUMBER_ZERO\"] = 0;\n this[\"NUMBER_ONE\"] = 1;\n\n // Run any user-provided initialization.\n if (this.initFunc_) {\n this.initFunc_(this, scope);\n }\n};\n\n/**\n * Initialize the Function class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initFunction = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n var identifierRegexp = /^[A-Za-z_$][\\w$]*$/;\n // Function constructor.\n wrapper = function (var_args) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Function().\n var newFunc = this;\n } else {\n // Called as Function().\n var newFunc = thisInterpreter.createObjectProto(thisInterpreter.FUNCTION_PROTO);\n }\n if (arguments.length) {\n var code = String(arguments[arguments.length - 1]);\n } else {\n var code = \"\";\n }\n var argsStr = Array.prototype.slice.call(arguments, 0, -1).join(\",\").trim();\n if (argsStr) {\n var args = argsStr.split(/\\s*,\\s*/);\n for (var i = 0; i < args.length; i++) {\n var name = args[i];\n if (!identifierRegexp.test(name)) {\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid function argument: \" + name);\n }\n }\n argsStr = args.join(\", \");\n }\n // Interestingly, the scope for constructed functions is the global scope,\n // even if they were constructed in some other scope.\n newFunc.parentScope = thisInterpreter.global;\n // Acorn needs to parse code in the context of a function or else 'return'\n // statements will be syntax errors.\n try {\n var ast = acorn.parse(\"(function(\" + argsStr + \") {\" + code + \"})\", Interpreter.PARSE_OPTIONS);\n } catch (e) {\n // Acorn threw a SyntaxError. Rethrow as a trappable error.\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid code: \" + e.message);\n }\n if (ast[\"body\"].length !== 1) {\n // Function('a', 'return a + 6;}; {alert(1);');\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid code in function body.\");\n }\n newFunc.node = ast[\"body\"][0][\"expression\"];\n thisInterpreter.setProperty(newFunc, \"length\", newFunc.node[\"length\"], Interpreter.READONLY_DESCRIPTOR);\n return newFunc;\n };\n wrapper.id = this.functionCounter_++;\n this.FUNCTION = this.createObjectProto(this.FUNCTION_PROTO);\n\n this.setProperty(scope, \"Function\", this.FUNCTION);\n // Manually setup type and prototype because createObj doesn't recognize\n // this object as a function (this.FUNCTION did not exist).\n this.setProperty(this.FUNCTION, \"prototype\", this.FUNCTION_PROTO);\n this.FUNCTION.nativeFunc = wrapper;\n\n // Configure Function.prototype.\n this.setProperty(this.FUNCTION_PROTO, \"constructor\", this.FUNCTION, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.FUNCTION_PROTO.nativeFunc = function () {};\n this.FUNCTION_PROTO.nativeFunc.id = this.functionCounter_++;\n this.setProperty(this.FUNCTION_PROTO, \"length\", 0, Interpreter.READONLY_DESCRIPTOR);\n\n var boxThis = function (value) {\n // In non-strict mode 'this' must be an object.\n if ((!value || !value.isObject) && !thisInterpreter.getScope().strict) {\n if (value === undefined || value === null) {\n // 'Undefined' and 'null' are changed to global object.\n value = thisInterpreter.global;\n } else {\n // Primitives must be boxed in non-strict mode.\n var box = thisInterpreter.createObjectProto(thisInterpreter.getPrototype(value));\n box.data = value;\n value = box;\n }\n }\n return value;\n };\n\n wrapper = function (thisArg, args) {\n var state = thisInterpreter.stateStack[thisInterpreter.stateStack.length - 1];\n // Rewrite the current 'CallExpression' to apply a different function.\n state.func_ = this;\n // Assign the 'this' object.\n state.funcThis_ = boxThis(thisArg);\n // Bind any provided arguments.\n state.arguments_ = [];\n if (args !== null && args !== undefined) {\n if (args.isObject) {\n state.arguments_ = thisInterpreter.arrayPseudoToNative(args);\n } else {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"CreateListFromArrayLike called on non-object\");\n }\n }\n state.doneExec_ = false;\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"apply\", wrapper);\n\n wrapper = function (thisArg /*, var_args */) {\n var state = thisInterpreter.stateStack[thisInterpreter.stateStack.length - 1];\n // Rewrite the current 'CallExpression' to call a different function.\n state.func_ = this;\n // Assign the 'this' object.\n state.funcThis_ = boxThis(thisArg);\n // Bind any provided arguments.\n state.arguments_ = [];\n for (var i = 1; i < arguments.length; i++) {\n state.arguments_.push(arguments[i]);\n }\n state.doneExec_ = false;\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"call\", wrapper);\n\n this.polyfills_.push(\n // Polyfill copied from:\n // developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_objects/Function/bind\n \"Object.defineProperty(Function.prototype, 'bind',\",\n \"{configurable: true, writable: true, value:\",\n \"function(oThis) {\",\n \"if (typeof this !== 'function') {\",\n \"throw TypeError('What is trying to be bound is not callable');\",\n \"}\",\n \"var aArgs = Array.prototype.slice.call(arguments, 1),\",\n \"fToBind = this,\",\n \"fNOP = function() {},\",\n \"fBound = function() {\",\n \"return fToBind.apply(this instanceof fNOP\",\n \"? this\",\n \": oThis,\",\n \"aArgs.concat(Array.prototype.slice.call(arguments)));\",\n \"};\",\n \"if (this.prototype) {\",\n \"fNOP.prototype = this.prototype;\",\n \"}\",\n \"fBound.prototype = new fNOP();\",\n \"return fBound;\",\n \"}\",\n \"});\",\n \"\",\n );\n\n // Function has no parent to inherit from, so it needs its own mandatory\n // toString and valueOf functions.\n wrapper = function () {\n return this.toString();\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"toString\", wrapper);\n this.setProperty(\n this.FUNCTION,\n \"toString\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n wrapper = function () {\n return this.valueOf();\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"valueOf\", wrapper);\n this.setProperty(\n this.FUNCTION,\n \"valueOf\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n};\n\n/**\n * Initialize the Object class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initObject = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Object constructor.\n wrapper = function (value) {\n if (value === undefined || value === null) {\n // Create a new object.\n if (thisInterpreter.calledWithNew()) {\n // Called as new Object().\n return this;\n } else {\n // Called as Object().\n return thisInterpreter.createObjectProto(thisInterpreter.OBJECT_PROTO);\n }\n }\n if (!value.isObject) {\n // Wrap the value as an object.\n var box = thisInterpreter.createObjectProto(thisInterpreter.getPrototype(value));\n box.data = value;\n return box;\n }\n // Return the provided object.\n return value;\n };\n this.OBJECT = this.createNativeFunction(wrapper, true);\n // Throw away the created prototype and use the root prototype.\n this.setProperty(this.OBJECT, \"prototype\", this.OBJECT_PROTO);\n this.setProperty(this.OBJECT_PROTO, \"constructor\", this.OBJECT, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(scope, \"Object\", this.OBJECT);\n\n /**\n * Checks if the provided value is null or undefined.\n * If so, then throw an error in the call stack.\n * @param {Interpreter.Value} value Value to check.\n */\n var throwIfNullUndefined = function (value) {\n if (value === undefined || value === null) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Cannot convert '\" + value + \"' to object\");\n }\n };\n\n // Static methods on Object.\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n var props = obj.isObject ? obj.properties : obj;\n return thisInterpreter.arrayNativeToPseudo(Object.getOwnPropertyNames(props));\n };\n this.setProperty(\n this.OBJECT,\n \"getOwnPropertyNames\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n if (obj.isObject) {\n obj = obj.properties;\n }\n return thisInterpreter.arrayNativeToPseudo(Object.keys(obj));\n };\n this.setProperty(\n this.OBJECT,\n \"keys\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (proto) {\n // Support for the second argument is the responsibility of a polyfill.\n if (proto === null) {\n return thisInterpreter.createObjectProto(null);\n }\n if (proto === undefined || !proto.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Object prototype may only be an Object or null\");\n }\n return thisInterpreter.createObjectProto(proto);\n };\n this.setProperty(\n this.OBJECT,\n \"create\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Add a polyfill to handle create's second argument.\n this.polyfills_.push(\n \"(function() {\",\n \"var create_ = Object.create;\",\n \"Object.create = function(proto, props) {\",\n \"var obj = create_(proto);\",\n \"props && Object.defineProperties(obj, props);\",\n \"return obj;\",\n \"};\",\n \"})();\",\n \"\",\n );\n\n wrapper = function (obj, prop, descriptor) {\n prop = String(prop);\n if (!obj || !obj.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Object.defineProperty called on non-object\");\n }\n if (!descriptor || !descriptor.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Property description must be an object\");\n }\n if (!obj.properties[prop] && obj.preventExtensions) {\n thisInterpreter.throwException(\n thisInterpreter.TYPE_ERROR,\n \"Can't define property '\" + prop + \"', object is not extensible\",\n );\n }\n // The polyfill guarantees no inheritance and no getter functions.\n // Therefore the descriptor properties map is the native object needed.\n thisInterpreter.setProperty(obj, prop, Interpreter.VALUE_IN_DESCRIPTOR, descriptor.properties);\n return obj;\n };\n this.setProperty(\n this.OBJECT,\n \"defineProperty\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n this.polyfills_.push(\n // Flatten the descriptor to remove any inheritance or getter functions.\n \"(function() {\",\n \"var defineProperty_ = Object.defineProperty;\",\n \"Object.defineProperty = function(obj, prop, d1) {\",\n \"var d2 = {};\",\n \"if ('configurable' in d1) d2.configurable = d1.configurable;\",\n \"if ('enumerable' in d1) d2.enumerable = d1.enumerable;\",\n \"if ('writable' in d1) d2.writable = d1.writable;\",\n \"if ('value' in d1) d2.value = d1.value;\",\n \"if ('get' in d1) d2.get = d1.get;\",\n \"if ('set' in d1) d2.set = d1.set;\",\n \"return defineProperty_(obj, prop, d2);\",\n \"};\",\n \"})();\",\n\n \"Object.defineProperty(Object, 'defineProperties',\",\n \"{configurable: true, writable: true, value:\",\n \"function(obj, props) {\",\n \"var keys = Object.keys(props);\",\n \"for (var i = 0; i < keys.length; i++) {\",\n \"Object.defineProperty(obj, keys[i], props[keys[i]]);\",\n \"}\",\n \"return obj;\",\n \"}\",\n \"});\",\n \"\",\n );\n\n wrapper = function (obj, prop) {\n if (!obj || !obj.isObject) {\n thisInterpreter.throwException(\n thisInterpreter.TYPE_ERROR,\n \"Object.getOwnPropertyDescriptor called on non-object\",\n );\n }\n prop = String(prop);\n if (!(prop in obj.properties)) {\n return undefined;\n }\n var descriptor = Object.getOwnPropertyDescriptor(obj.properties, prop);\n var getter = obj.getter[prop];\n var setter = obj.setter[prop];\n\n if (getter || setter) {\n descriptor.get = getter;\n descriptor.set = setter;\n delete descriptor.value;\n delete descriptor.writable;\n }\n // Preserve value, but remove it for the nativeToPseudo call.\n var value = descriptor.value;\n var hasValue = \"value\" in descriptor;\n delete descriptor.value;\n var pseudoDescriptor = thisInterpreter.nativeToPseudo(descriptor);\n if (hasValue) {\n thisInterpreter.setProperty(pseudoDescriptor, \"value\", value);\n }\n return pseudoDescriptor;\n };\n this.setProperty(\n this.OBJECT,\n \"getOwnPropertyDescriptor\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n return thisInterpreter.getPrototype(obj);\n };\n this.setProperty(\n this.OBJECT,\n \"getPrototypeOf\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n return Boolean(obj) && !obj.preventExtensions;\n };\n this.setProperty(\n this.OBJECT,\n \"isExtensible\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n if (obj && obj.isObject) {\n obj.preventExtensions = true;\n }\n return obj;\n };\n this.setProperty(\n this.OBJECT,\n \"preventExtensions\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on Object.\n this.setNativeFunctionPrototype(this.OBJECT, \"toString\", Interpreter.Object.prototype.toString);\n this.setNativeFunctionPrototype(this.OBJECT, \"toLocaleString\", Interpreter.Object.prototype.toString);\n this.setNativeFunctionPrototype(this.OBJECT, \"valueOf\", Interpreter.Object.prototype.valueOf);\n\n wrapper = function (prop) {\n throwIfNullUndefined(this);\n if (!this.isObject) {\n return this.hasOwnProperty(prop);\n }\n return String(prop) in this.properties;\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"hasOwnProperty\", wrapper);\n\n wrapper = function (prop) {\n throwIfNullUndefined(this);\n if (!this.isObject) {\n return this.propertyIsEnumerable(prop);\n }\n return Object.prototype.propertyIsEnumerable.call(this.properties, prop);\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"propertyIsEnumerable\", wrapper);\n\n wrapper = function (obj) {\n while (true) {\n // Note, circular loops shouldn't be possible.\n obj = thisInterpreter.getPrototype(obj);\n if (!obj) {\n // No parent; reached the top.\n return false;\n }\n if (obj === this) {\n return true;\n }\n }\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"isPrototypeOf\", wrapper);\n};\n\n/**\n * Initialize the Array class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initArray = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Array constructor.\n wrapper = function (var_args) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Array().\n var newArray = this;\n } else {\n // Called as Array().\n var newArray = thisInterpreter.createObjectProto(thisInterpreter.ARRAY_PROTO);\n }\n var first = arguments[0];\n if (arguments.length === 1 && typeof first === \"number\") {\n if (isNaN(Interpreter.legalArrayLength(first))) {\n thisInterpreter.throwException(thisInterpreter.RANGE_ERROR, \"Invalid array length\");\n }\n newArray.properties.length = first;\n } else {\n for (var i = 0; i < arguments.length; i++) {\n newArray.properties[i] = arguments[i];\n }\n newArray.properties.length = i;\n }\n return newArray;\n };\n this.ARRAY = this.createNativeFunction(wrapper, true);\n this.ARRAY_PROTO = this.ARRAY.properties[\"prototype\"];\n this.setProperty(scope, \"Array\", this.ARRAY);\n\n // Static methods on Array.\n wrapper = function (obj) {\n return obj && obj.class === \"Array\";\n };\n this.setProperty(\n this.ARRAY,\n \"isArray\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on Array.\n wrapper = function () {\n return Array.prototype.pop.call(this.properties);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"pop\", wrapper);\n\n wrapper = function (var_args) {\n return Array.prototype.push.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"push\", wrapper);\n\n wrapper = function () {\n return Array.prototype.shift.call(this.properties);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"shift\", wrapper);\n\n wrapper = function (var_args) {\n return Array.prototype.unshift.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"unshift\", wrapper);\n\n wrapper = function () {\n Array.prototype.reverse.call(this.properties);\n return this;\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"reverse\", wrapper);\n\n wrapper = function (index, howmany /*, var_args*/) {\n var list = Array.prototype.splice.apply(this.properties, arguments);\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"splice\", wrapper);\n\n wrapper = function (opt_begin, opt_end) {\n var list = Array.prototype.slice.call(this.properties, opt_begin, opt_end);\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"slice\", wrapper);\n\n wrapper = function (opt_separator) {\n return Array.prototype.join.call(this.properties, opt_separator);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"join\", wrapper);\n\n wrapper = function (var_args) {\n var list = [];\n var length = 0;\n // Start by copying the current array.\n var iLength = thisInterpreter.getProperty(this, \"length\");\n for (var i = 0; i < iLength; i++) {\n if (thisInterpreter.hasProperty(this, i)) {\n var element = thisInterpreter.getProperty(this, i);\n list[length] = element;\n }\n length++;\n }\n // Loop through all arguments and copy them in.\n for (var i = 0; i < arguments.length; i++) {\n var value = arguments[i];\n if (thisInterpreter.isa(value, thisInterpreter.ARRAY)) {\n var jLength = thisInterpreter.getProperty(value, \"length\");\n for (var j = 0; j < jLength; j++) {\n if (thisInterpreter.hasProperty(value, j)) {\n list[length] = thisInterpreter.getProperty(value, j);\n }\n length++;\n }\n } else {\n list[length] = value;\n }\n }\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"concat\", wrapper);\n\n wrapper = function (searchElement, opt_fromIndex) {\n return Array.prototype.indexOf.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"indexOf\", wrapper);\n\n wrapper = function (searchElement, opt_fromIndex) {\n return Array.prototype.lastIndexOf.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"lastIndexOf\", wrapper);\n\n wrapper = function () {\n Array.prototype.sort.call(this.properties);\n return this;\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"sort\", wrapper);\n\n this.polyfills_.push(\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/every\n \"Object.defineProperty(Array.prototype, 'every',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callbackfn, thisArg) {\",\n \"if (!this || typeof callbackfn !== 'function') throw TypeError();\",\n \"var T, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O && !callbackfn.call(T, O[k], k, O)) return false;\",\n \"k++;\",\n \"}\",\n \"return true;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\n \"Object.defineProperty(Array.prototype, 'filter',\",\n \"{configurable: true, writable: true, value:\",\n \"function(fun/*, thisArg*/) {\",\n \"if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();\",\n \"var t = Object(this);\",\n \"var len = t.length >>> 0;\",\n \"var res = [];\",\n \"var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\",\n \"for (var i = 0; i < len; i++) {\",\n \"if (i in t) {\",\n \"var val = t[i];\",\n \"if (fun.call(thisArg, val, i, t)) res.push(val);\",\n \"}\",\n \"}\",\n \"return res;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // https://tc39.github.io/ecma262/#sec-array.prototype.find\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n \"if (!Array.prototype.find) {\",\n \"Object.defineProperty(Array.prototype, 'find', {\",\n \"value: function(predicate) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"var o = Object(this);\",\n \"var len = o.length >>> 0;\",\n \"if (typeof predicate !== 'function') {\",\n \"throw new TypeError('predicate must be a function');\",\n \"}\",\n \"var thisArg = arguments[1];\",\n \"var k = 0;\",\n \"while (k < len) {\",\n \"var kValue = o[k];\",\n \"if (predicate.call(thisArg, kValue, k, o)) {\",\n \"return kValue;\",\n \"}\",\n \"k++;\",\n \"}\",\n \"return undefined;\",\n \"},\",\n \"configurable: true,\",\n \"writable: true\",\n \"});\",\n \"}\",\n\n // Poly fill copied from:\n // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex\n \"if (!Array.prototype.findIndex) {\",\n \"Object.defineProperty(Array.prototype, 'findIndex', {\",\n \"value: function(predicate) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"var o = Object(this);\",\n \"var len = o.length >>> 0;\",\n \"if (typeof predicate !== 'function') {\",\n \"throw new TypeError('predicate must be a function');\",\n \"}\",\n \"var thisArg = arguments[1];\",\n \"var k = 0;\",\n \"while (k < len) {\",\n \"var kValue = o[k];\",\n \"if (predicate.call(thisArg, kValue, k, o)) {\",\n \"return k;\",\n \"}\",\n \"k++;\",\n \"}\",\n \"return -1;\",\n \"},\",\n \"configurable: true,\",\n \"writable: true\",\n \"});\",\n \"}\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\n \"Object.defineProperty(Array.prototype, 'forEach',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback, thisArg) {\",\n \"if (!this || typeof callback !== 'function') throw TypeError();\",\n \"var T, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O) callback.call(T, O[k], k, O);\",\n \"k++;\",\n \"}\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes#Polyfill\n \"Object.defineProperty(Array.prototype, 'includes', {\",\n \"value: function(searchElement, fromIndex) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"// 1. Let O be ? ToObject(this value).\",\n \"var o = Object(this);\",\n '// 2. Let len be ? ToLength(? Get(O, \"length\")).',\n \"var len = o.length >>> 0;\",\n \"// 3. If len is 0, return false.\",\n \"if (len === 0) {\",\n \"return false;\",\n \"}\",\n \"// 4. Let n be ? ToInteger(fromIndex).\",\n \"// (If fromIndex is undefined, this step produces the value 0.)\",\n \"var n = fromIndex | 0;\",\n \"// 5. If n ≥ 0, then\",\n \"// a. Let k be n.\",\n \"// 6. Else n < 0,\",\n \"// a. Let k be len + n.\",\n \"// b. If k < 0, let k be 0.\",\n \"var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\",\n \"function sameValueZero(x, y) {\",\n \"return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));\",\n \"}\",\n \"// 7. Repeat, while k < len\",\n \"while (k < len) {\",\n \"// a. Let elementK be the result of ? Get(O, ! ToString(k)).\",\n \"// b. If SameValueZero(searchElement, elementK) is true, return true.\",\n \"if (sameValueZero(o[k], searchElement)) {\",\n \"return true;\",\n \"}\",\n \"// c. Increase k by 1. \",\n \"k++;\",\n \"}\",\n \"// 8. Return false\",\n \"return false;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map\n \"Object.defineProperty(Array.prototype, 'map',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback, thisArg) {\",\n \"if (!this || typeof callback !== 'function') new TypeError;\",\n \"var T, A, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"A = new Array(len);\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O) A[k] = callback.call(T, O[k], k, O);\",\n \"k++;\",\n \"}\",\n \"return A;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce\n \"Object.defineProperty(Array.prototype, 'reduce',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback /*, initialValue*/) {\",\n \"if (!this || typeof callback !== 'function') throw TypeError();\",\n \"var t = Object(this), len = t.length >>> 0, k = 0, value;\",\n \"if (arguments.length === 2) {\",\n \"value = arguments[1];\",\n \"} else {\",\n \"while (k < len && !(k in t)) k++;\",\n \"if (k >= len) {\",\n \"throw TypeError('Reduce of empty array with no initial value');\",\n \"}\",\n \"value = t[k++];\",\n \"}\",\n \"for (; k < len; k++) {\",\n \"if (k in t) value = callback(value, t[k], k, t);\",\n \"}\",\n \"return value;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight\n \"Object.defineProperty(Array.prototype, 'reduceRight',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback /*, initialValue*/) {\",\n \"if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();\",\n \"var t = Object(this), len = t.length >>> 0, k = len - 1, value;\",\n \"if (arguments.length >= 2) {\",\n \"value = arguments[1];\",\n \"} else {\",\n \"while (k >= 0 && !(k in t)) k--;\",\n \"if (k < 0) {\",\n \"throw TypeError('Reduce of empty array with no initial value');\",\n \"}\",\n \"value = t[k--];\",\n \"}\",\n \"for (; k >= 0; k--) {\",\n \"if (k in t) value = callback(value, t[k], k, t);\",\n \"}\",\n \"return value;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/some\n \"Object.defineProperty(Array.prototype, 'some',\",\n \"{configurable: true, writable: true, value:\",\n \"function(fun/*, thisArg*/) {\",\n \"if (!this || typeof fun !== 'function') throw TypeError();\",\n \"var t = Object(this);\",\n \"var len = t.length >>> 0;\",\n \"var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\",\n \"for (var i = 0; i < len; i++) {\",\n \"if (i in t && fun.call(thisArg, t[i], i, t)) {\",\n \"return true;\",\n \"}\",\n \"}\",\n \"return false;\",\n \"}\",\n \"});\",\n\n \"(function() {\",\n \"var sort_ = Array.prototype.sort;\",\n \"Array.prototype.sort = function(opt_comp) {\",\n // Fast native sort.\n \"if (typeof opt_comp !== 'function') {\",\n \"return sort_.call(this);\",\n \"}\",\n // Slow bubble sort.\n \"for (var i = 0; i < this.length; i++) {\",\n \"var changes = 0;\",\n \"for (var j = 0; j < this.length - i - 1; j++) {\",\n \"if (opt_comp(this[j], this[j + 1]) > 0) {\",\n \"var swap = this[j];\",\n \"this[j] = this[j + 1];\",\n \"this[j + 1] = swap;\",\n \"changes++;\",\n \"}\",\n \"}\",\n \"if (!changes) break;\",\n \"}\",\n \"return this;\",\n \"};\",\n \"})();\",\n\n \"Object.defineProperty(Array.prototype, 'toLocaleString',\",\n \"{configurable: true, writable: true, value:\",\n \"function() {\",\n \"var out = [];\",\n \"for (var i = 0; i < this.length; i++) {\",\n \"out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();\",\n \"}\",\n \"return out.join(',');\",\n \"}\",\n \"});\",\n \"\",\n );\n};\n\n/**\n * Initialize the String class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initString = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // String constructor.\n wrapper = function (value) {\n value = String(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new String().\n this.data = value;\n return this;\n } else {\n // Called as String().\n return value;\n }\n };\n this.STRING = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"String\", this.STRING);\n\n // Static methods on String.\n this.setProperty(\n this.STRING,\n \"fromCharCode\",\n this.createNativeFunction(String.fromCharCode, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on String.\n // Methods with exclusively primitive arguments.\n var functions = [\n \"charAt\",\n \"charCodeAt\",\n \"concat\",\n \"indexOf\",\n \"lastIndexOf\",\n \"slice\",\n \"substr\",\n \"substring\",\n \"toLocaleLowerCase\",\n \"toLocaleUpperCase\",\n \"toLowerCase\",\n \"toUpperCase\",\n \"trim\",\n ];\n for (var i = 0; i < functions.length; i++) {\n this.setNativeFunctionPrototype(this.STRING, functions[i], String.prototype[functions[i]]);\n }\n\n wrapper = function (compareString, locales, options) {\n locales = locales ? thisInterpreter.pseudoToNative(locales) : undefined;\n options = options ? thisInterpreter.pseudoToNative(options) : undefined;\n return String(this).localeCompare(compareString, locales, options);\n };\n this.setNativeFunctionPrototype(this.STRING, \"localeCompare\", wrapper);\n\n wrapper = function (separator, limit) {\n if (thisInterpreter.isa(separator, thisInterpreter.REGEXP)) {\n separator = separator.data;\n }\n var jsList = String(this).split(separator, limit);\n return thisInterpreter.arrayNativeToPseudo(jsList);\n };\n this.setNativeFunctionPrototype(this.STRING, \"split\", wrapper);\n\n wrapper = function (regexp) {\n if (thisInterpreter.isa(regexp, thisInterpreter.REGEXP)) {\n regexp = regexp.data;\n }\n var m = String(this).match(regexp);\n return m && thisInterpreter.arrayNativeToPseudo(m);\n };\n this.setNativeFunctionPrototype(this.STRING, \"match\", wrapper);\n\n wrapper = function (regexp) {\n if (thisInterpreter.isa(regexp, thisInterpreter.REGEXP)) {\n regexp = regexp.data;\n }\n return String(this).search(regexp);\n };\n this.setNativeFunctionPrototype(this.STRING, \"search\", wrapper);\n\n wrapper = function (substr, newSubstr) {\n // Support for function replacements is the responsibility of a polyfill.\n if (thisInterpreter.isa(substr, thisInterpreter.REGEXP)) {\n substr = substr.data;\n }\n return String(this).replace(substr, newSubstr);\n };\n this.setNativeFunctionPrototype(this.STRING, \"replace\", wrapper);\n // Add a polyfill to handle replace's second argument being a function.\n this.polyfills_.push(\n \"(function() {\",\n \"var replace_ = String.prototype.replace;\",\n \"String.prototype.replace = function(substr, newSubstr) {\",\n \"if (typeof newSubstr !== 'function') {\",\n // string.replace(string|regexp, string)\n \"return replace_.call(this, substr, newSubstr);\",\n \"}\",\n \"var str = this;\",\n \"if (substr instanceof RegExp) {\", // string.replace(regexp, function)\n \"var subs = [];\",\n \"var m = substr.exec(str);\",\n \"while (m) {\",\n \"m.push(m.index, str);\",\n \"var inject = newSubstr.apply(null, m);\",\n \"subs.push([m.index, m[0].length, inject]);\",\n \"m = substr.global ? substr.exec(str) : null;\",\n \"}\",\n \"for (var i = subs.length - 1; i >= 0; i--) {\",\n \"str = str.substring(0, subs[i][0]) + subs[i][2] + \" + \"str.substring(subs[i][0] + subs[i][1]);\",\n \"}\",\n \"} else {\", // string.replace(string, function)\n \"var i = str.indexOf(substr);\",\n \"if (i !== -1) {\",\n \"var inject = newSubstr(str.substr(i, substr.length), i, str);\",\n \"str = str.substring(0, i) + inject + \" + \"str.substring(i + substr.length);\",\n \"}\",\n \"}\",\n \"return str;\",\n \"};\",\n \"})();\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n \"if (!String.prototype.endsWith) {\",\n \"String.prototype.endsWith = function(search, this_len) {\",\n \"if (this_len === undefined || this_len > this.length) {\",\n \"this_len = this.length;\",\n \"}\",\n \"return this.substring(this_len - search.length, this_len) === search;\",\n \"};\",\n \"}\",\n\n //Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n \"if (!String.prototype.includes) {\",\n \"String.prototype.includes = function(search, start) {\",\n \"'use strict';\",\n \"if (typeof start !== 'number') {\",\n \"start = 0;\",\n \"}\",\n \" \",\n \"if (start + search.length > this.length) {\",\n \"return false;\",\n \"} else {\",\n \"return this.indexOf(search, start) !== -1;\",\n \"}\",\n \"};\",\n \"}\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n \"if (!String.prototype.startsWith) {\",\n \"String.prototype.startsWith = function(search, pos) {\",\n \"return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\",\n \"};\",\n \"}\",\n\n \"\",\n );\n};\n\n/**\n * Initialize the Boolean class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initBoolean = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Boolean constructor.\n wrapper = function (value) {\n value = Boolean(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new Boolean().\n this.data = value;\n return this;\n } else {\n // Called as Boolean().\n return value;\n }\n };\n this.BOOLEAN = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"Boolean\", this.BOOLEAN);\n};\n\n/**\n * Initialize the Number class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initNumber = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Number constructor.\n wrapper = function (value) {\n value = Number(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new Number().\n this.data = value;\n return this;\n } else {\n // Called as Number().\n return value;\n }\n };\n this.NUMBER = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"Number\", this.NUMBER);\n\n var numConsts = [\"MAX_VALUE\", \"MIN_VALUE\", \"NaN\", \"NEGATIVE_INFINITY\", \"POSITIVE_INFINITY\"];\n for (var i = 0; i < numConsts.length; i++) {\n this.setProperty(this.NUMBER, numConsts[i], Number[numConsts[i]], Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n }\n\n // Instance methods on Number.\n wrapper = function (fractionDigits) {\n try {\n return Number(this).toExponential(fractionDigits);\n } catch (e) {\n // Throws if fractionDigits isn't within 0-20.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toExponential\", wrapper);\n\n wrapper = function (digits) {\n try {\n return Number(this).toFixed(digits);\n } catch (e) {\n // Throws if digits isn't within 0-20.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toFixed\", wrapper);\n\n wrapper = function (precision) {\n try {\n return Number(this).toPrecision(precision);\n } catch (e) {\n // Throws if precision isn't within range (depends on implementation).\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toPrecision\", wrapper);\n\n wrapper = function (radix) {\n try {\n return Number(this).toString(radix);\n } catch (e) {\n // Throws if radix isn't within 2-36.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toString\", wrapper);\n\n wrapper = function (locales, options) {\n locales = locales ? thisInterpreter.pseudoToNative(locales) : undefined;\n options = options ? thisInterpreter.pseudoToNative(options) : undefined;\n return Number(this).toLocaleString(locales, options);\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toLocaleString\", wrapper);\n};\n\n/**\n * Initialize the Date class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initDate = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Date constructor.\n wrapper = function (value, var_args) {\n if (!thisInterpreter.calledWithNew()) {\n // Called as Date().\n // Calling Date() as a function returns a string, no arguments are heeded.\n return Date();\n }\n // Called as new Date().\n var args = [null].concat(Array.from(arguments));\n this.data = new (Function.prototype.bind.apply(Date, args))();\n return this;\n };\n this.DATE = this.createNativeFunction(wrapper, true);\n this.DATE_PROTO = this.DATE.properties[\"prototype\"];\n this.setProperty(scope, \"Date\", this.DATE);\n\n // Static methods on Date.\n this.setProperty(this.DATE, \"now\", this.createNativeFunction(Date.now, false), Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n this.setProperty(\n this.DATE,\n \"parse\",\n this.createNativeFunction(Date.parse, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n this.setProperty(this.DATE, \"UTC\", this.createNativeFunction(Date.UTC, false), Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n // Instance methods on Date.\n var functions = [\n \"getDate\",\n \"getDay\",\n \"getFullYear\",\n \"getHours\",\n \"getMilliseconds\",\n \"getMinutes\",\n \"getMonth\",\n \"getSeconds\",\n \"getTime\",\n \"getTimezoneOffset\",\n \"getUTCDate\",\n \"getUTCDay\",\n \"getUTCFullYear\",\n \"getUTCHours\",\n \"getUTCMilliseconds\",\n \"getUTCMinutes\",\n \"getUTCMonth\",\n \"getUTCSeconds\",\n \"getYear\",\n \"setDate\",\n \"setFullYear\",\n \"setHours\",\n \"setMilliseconds\",\n \"setMinutes\",\n \"setMonth\",\n \"setSeconds\",\n \"setTime\",\n \"setUTCDate\",\n \"setUTCFullYear\",\n \"setUTCHours\",\n \"setUTCMilliseconds\",\n \"setUTCMinutes\",\n \"setUTCMonth\",\n \"setUTCSeconds\",\n \"setYear\",\n \"toDateString\",\n \"toISOString\",\n \"toJSON\",\n \"toGMTString\",\n \"toLocaleDateString\",\n \"toLocaleString\",\n \"toLocaleTimeString\",\n \"toTimeString\",\n \"toUTCString\",\n ];\n for (var i = 0; i < functions.length; i++) {\n wrapper = (function (nativeFunc) {\n return function (var_args) {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = thisInterpreter.pseudoToNative(arguments[i]);\n }\n return this.data[nativeFunc].apply(this.data, args);\n };\n })(functions[i]);\n this.setNativeFunctionPrototype(this.DATE, functions[i], wrapper);\n }\n};\n\n/**\n * Initialize Regular Expression object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initRegExp = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // RegExp constructor.\n wrapper = function (pattern, flags) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new RegExp().\n var rgx = this;\n } else {\n // Called as RegExp().\n var rgx = thisInterpreter.createObjectProto(thisInterpreter.REGEXP_PROTO);\n }\n pattern = pattern ? pattern.toString() : \"\";\n flags = flags ? flags.toString() : \"\";\n thisInterpreter.populateRegExp(rgx, new RegExp(pattern, flags));\n return rgx;\n };\n this.REGEXP = this.createNativeFunction(wrapper, true);\n this.REGEXP_PROTO = this.REGEXP.properties[\"prototype\"];\n this.setProperty(scope, \"RegExp\", this.REGEXP);\n\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"global\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"ignoreCase\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"multiline\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"source\",\n \"(?:)\",\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (str) {\n return this.data.test(str);\n };\n this.setNativeFunctionPrototype(this.REGEXP, \"test\", wrapper);\n\n wrapper = function (str) {\n str = str.toString();\n // Get lastIndex from wrapped regex, since this is settable.\n this.data.lastIndex = Number(thisInterpreter.getProperty(this, \"lastIndex\"));\n var match = this.data.exec(str);\n thisInterpreter.setProperty(this, \"lastIndex\", this.data.lastIndex);\n\n if (match) {\n var result = thisInterpreter.createObjectProto(thisInterpreter.ARRAY_PROTO);\n for (var i = 0; i < match.length; i++) {\n thisInterpreter.setProperty(result, i, match[i]);\n }\n // match has additional properties.\n thisInterpreter.setProperty(result, \"index\", match.index);\n thisInterpreter.setProperty(result, \"input\", match.input);\n return result;\n }\n return null;\n };\n this.setNativeFunctionPrototype(this.REGEXP, \"exec\", wrapper);\n};\n\n/**\n * Initialize the Error class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initError = function (scope) {\n var thisInterpreter = this;\n // Error constructor.\n this.ERROR = this.createNativeFunction(function (opt_message) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Error().\n var newError = this;\n } else {\n // Called as Error().\n var newError = thisInterpreter.createObject(thisInterpreter.ERROR);\n }\n if (opt_message) {\n thisInterpreter.setProperty(newError, \"message\", String(opt_message), Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n return newError;\n }, true);\n this.setProperty(scope, \"Error\", this.ERROR);\n this.setProperty(this.ERROR.properties[\"prototype\"], \"message\", \"\", Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(this.ERROR.properties[\"prototype\"], \"name\", \"Error\", Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n var createErrorSubclass = function (name) {\n var constructor = thisInterpreter.createNativeFunction(function (opt_message) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new XyzError().\n var newError = this;\n } else {\n // Called as XyzError().\n var newError = thisInterpreter.createObject(constructor);\n }\n if (opt_message) {\n thisInterpreter.setProperty(newError, \"message\", String(opt_message), Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n return newError;\n }, true);\n thisInterpreter.setProperty(constructor, \"prototype\", thisInterpreter.createObject(thisInterpreter.ERROR));\n thisInterpreter.setProperty(\n constructor.properties[\"prototype\"],\n \"name\",\n name,\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n thisInterpreter.setProperty(scope, name, constructor);\n\n return constructor;\n };\n\n this.EVAL_ERROR = createErrorSubclass(\"EvalError\");\n this.RANGE_ERROR = createErrorSubclass(\"RangeError\");\n this.REFERENCE_ERROR = createErrorSubclass(\"ReferenceError\");\n this.SYNTAX_ERROR = createErrorSubclass(\"SyntaxError\");\n this.TYPE_ERROR = createErrorSubclass(\"TypeError\");\n this.URI_ERROR = createErrorSubclass(\"URIError\");\n};\n\n/**\n * Initialize Math object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initMath = function (scope) {\n var thisInterpreter = this;\n var myMath = this.createObjectProto(this.OBJECT_PROTO);\n this.setProperty(scope, \"Math\", myMath);\n var mathConsts = [\"E\", \"LN2\", \"LN10\", \"LOG2E\", \"LOG10E\", \"PI\", \"SQRT1_2\", \"SQRT2\"];\n for (var i = 0; i < mathConsts.length; i++) {\n this.setProperty(myMath, mathConsts[i], Math[mathConsts[i]], Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n }\n var numFunctions = [\n \"abs\",\n \"acos\",\n \"asin\",\n \"atan\",\n \"atan2\",\n \"ceil\",\n \"cos\",\n \"exp\",\n \"floor\",\n \"log\",\n \"max\",\n \"min\",\n \"pow\",\n \"random\",\n \"round\",\n \"sin\",\n \"sqrt\",\n \"tan\",\n ];\n for (var i = 0; i < numFunctions.length; i++) {\n this.setProperty(\n myMath,\n numFunctions[i],\n this.createNativeFunction(Math[numFunctions[i]], false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n }\n};\n\n/**\n * Initialize JSON object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initJSON = function (scope) {\n var thisInterpreter = this;\n var myJSON = thisInterpreter.createObjectProto(this.OBJECT_PROTO);\n this.setProperty(scope, \"JSON\", myJSON);\n\n var wrapper = function (text) {\n try {\n var nativeObj = JSON.parse(text.toString());\n } catch (e) {\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, e.message);\n }\n return thisInterpreter.nativeToPseudo(nativeObj);\n };\n this.setProperty(myJSON, \"parse\", this.createNativeFunction(wrapper, false));\n\n wrapper = function (value) {\n var nativeObj = thisInterpreter.pseudoToNative(value);\n try {\n var str = JSON.stringify(nativeObj);\n } catch (e) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, e.message);\n }\n return str;\n };\n this.setProperty(myJSON, \"stringify\", this.createNativeFunction(wrapper, false));\n};\n\n/**\n * Is an object of a certain class?\n * @param {Interpreter.Value} child Object to check.\n * @param {Interpreter.Object} constructor Constructor of object.\n * @return {boolean} True if object is the class or inherits from it.\n * False otherwise.\n */\nInterpreter.prototype.isa = function (child, constructor) {\n if (child === null || child === undefined || !constructor) {\n return false;\n }\n var proto = constructor.properties[\"prototype\"];\n if (child === proto) {\n return true;\n }\n // The first step up the prototype chain is harder since the child might be\n // a primitive value. Subsequent steps can just follow the .proto property.\n child = this.getPrototype(child);\n while (child) {\n if (child === proto) {\n return true;\n }\n child = child.proto;\n }\n return false;\n};\n\n/**\n * Is a value a legal integer for an array length?\n * @param {Interpreter.Value} x Value to check.\n * @return {number} Zero, or a positive integer if the value can be\n * converted to such. NaN otherwise.\n */\nInterpreter.legalArrayLength = function (x) {\n var n = x >>> 0;\n // Array length must be between 0 and 2^32-1 (inclusive).\n return n === Number(x) ? n : NaN;\n};\n\n/**\n * Is a value a legal integer for an array index?\n * @param {Interpreter.Value} x Value to check.\n * @return {number} Zero, or a positive integer if the value can be\n * converted to such. NaN otherwise.\n */\nInterpreter.legalArrayIndex = function (x) {\n var n = x >>> 0;\n // Array index cannot be 2^32-1, otherwise length would be 2^32.\n // 0xffffffff is 2^32-1.\n return String(n) === String(x) && n !== 0xffffffff ? n : NaN;\n};\n\n/**\n * Typedef for JS values.\n * @typedef {!Interpreter.Object|boolean|number|string|undefined|null}\n */\nInterpreter.Value;\n\n/**\n * Class for an object.\n * @param {Interpreter.Object} proto Prototype object or null.\n * @constructor\n */\nInterpreter.Object = function (proto) {\n this.getter = Object.create(null);\n this.setter = Object.create(null);\n this.properties = Object.create(null);\n this.proto = proto;\n};\n\n/** @type {Interpreter.Object} */\nInterpreter.Object.prototype.proto = null;\n\n/** @type {boolean} */\nInterpreter.Object.prototype.isObject = true;\n\n/** @type {string} */\nInterpreter.Object.prototype.class = \"Object\";\n\n/** @type {Date|RegExp|boolean|number|string|undefined|null} */\nInterpreter.Object.prototype.data = null;\n\n/**\n * Convert this object into a string.\n * @return {string} String value.\n * @override\n */\nInterpreter.Object.prototype.toString = function () {\n if (this.class === \"Array\") {\n // Array\n var cycles = Interpreter.toStringCycles_;\n cycles.push(this);\n try {\n var strs = [];\n for (var i = 0; i < this.properties.length; i++) {\n var value = this.properties[i];\n strs[i] = value && value.isObject && cycles.indexOf(value) !== -1 ? \"...\" : value;\n }\n } finally {\n cycles.pop();\n }\n return strs.join(\",\");\n }\n if (this.class === \"Error\") {\n var cycles = Interpreter.toStringCycles_;\n if (cycles.indexOf(this) !== -1) {\n return \"[object Error]\";\n }\n var name, message;\n // Bug: Does not support getters and setters for name or message.\n var obj = this;\n do {\n if (\"name\" in obj.properties) {\n name = obj.properties[\"name\"];\n break;\n }\n } while ((obj = obj.proto));\n var obj = this;\n do {\n if (\"message\" in obj.properties) {\n message = obj.properties[\"message\"];\n break;\n }\n } while ((obj = obj.proto));\n cycles.push(this);\n try {\n name = name && name.toString();\n message = message && message.toString();\n } finally {\n cycles.pop();\n }\n return message ? name + \": \" + message : String(name);\n }\n\n // RegExp, Date, and boxed primitives.\n if (this.data !== null) {\n return String(this.data);\n }\n\n return \"[object \" + this.class + \"]\";\n};\n\n/**\n * Return the object's value.\n * @return {Interpreter.Value} Value.\n * @override\n */\nInterpreter.Object.prototype.valueOf = function () {\n if (this.data === undefined || this.data === null || this.data instanceof RegExp) {\n return this; // An Object.\n }\n if (this.data instanceof Date) {\n return this.data.valueOf(); // Milliseconds.\n }\n return /** @type {(boolean|number|string)} */ (this.data); // Boxed primitive.\n};\n\n/**\n * Create a new data object based on a constructor's prototype.\n * @param {Interpreter.Object} constructor Parent constructor function,\n * or null if scope object.\n * @return {!Interpreter.Object} New data object.\n */\nInterpreter.prototype.createObject = function (constructor) {\n return this.createObjectProto(constructor && constructor.properties[\"prototype\"]);\n};\n\n/**\n * Create a new data object based on a prototype.\n * @param {Interpreter.Object} proto Prototype object.\n * @return {!Interpreter.Object} New data object.\n */\nInterpreter.prototype.createObjectProto = function (proto) {\n if (typeof proto !== \"object\") {\n throw Error(\"Non object prototype\");\n }\n var obj = new Interpreter.Object(proto);\n // Functions have prototype objects.\n if (this.isa(obj, this.FUNCTION)) {\n this.setProperty(obj, \"prototype\", this.createObjectProto(this.OBJECT_PROTO || null));\n obj.class = \"Function\";\n }\n // Arrays have length.\n if (this.isa(obj, this.ARRAY)) {\n this.setProperty(obj, \"length\", 0, {\n configurable: false,\n enumerable: false,\n writable: true,\n });\n obj.class = \"Array\";\n }\n if (this.isa(obj, this.ERROR)) {\n obj.class = \"Error\";\n }\n return obj;\n};\n\n/**\n * Initialize a pseudo regular expression object based on a native regular\n * expression object.\n * @param {!Interpreter.Object} pseudoRegexp The existing object to set.\n * @param {!RegExp} nativeRegexp The native regular expression.\n */\nInterpreter.prototype.populateRegExp = function (pseudoRegexp, nativeRegexp) {\n pseudoRegexp.data = nativeRegexp;\n // lastIndex is settable, all others are read-only attributes\n this.setProperty(pseudoRegexp, \"lastIndex\", nativeRegexp.lastIndex, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"source\", nativeRegexp.source, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"global\", nativeRegexp.global, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"ignoreCase\", nativeRegexp.ignoreCase, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"multiline\", nativeRegexp.multiline, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n};\n\n/**\n * Create a new function.\n * @param {!Object} node AST node defining the function.\n * @param {!Object} scope Parent scope.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createFunction = function (node, scope) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.parentScope = scope;\n func.node = node;\n this.setProperty(func, \"length\", func.node[\"params\"].length, Interpreter.READONLY_DESCRIPTOR);\n return func;\n};\n\n/**\n * Create a new native function.\n * @param {!Function} nativeFunc JavaScript function.\n * @param {boolean=} opt_constructor If true, the function's\n * prototype will have its constructor property set to the function.\n * If false, the function cannot be called as a constructor (e.g. escape).\n * Defaults to undefined.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createNativeFunction = function (nativeFunc, opt_constructor) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.nativeFunc = nativeFunc;\n nativeFunc.id = this.functionCounter_++;\n this.setProperty(func, \"length\", nativeFunc.length, Interpreter.READONLY_DESCRIPTOR);\n if (opt_constructor) {\n this.setProperty(func.properties[\"prototype\"], \"constructor\", func, Interpreter.NONENUMERABLE_DESCRIPTOR);\n } else if (opt_constructor === false) {\n func.illegalConstructor = true;\n this.setProperty(func, \"prototype\", undefined);\n }\n return func;\n};\n\n/**\n * Create a new native asynchronous function.\n * @param {!Function} asyncFunc JavaScript function.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createAsyncFunction = function (asyncFunc) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.asyncFunc = asyncFunc;\n asyncFunc.id = this.functionCounter_++;\n this.setProperty(func, \"length\", asyncFunc.length, Interpreter.READONLY_DESCRIPTOR);\n return func;\n};\n\n/**\n * Converts from a native JS object or value to a JS interpreter object.\n * Can handle JSON-style values, does NOT handle cycles.\n * @param {*} nativeObj The native JS object to be converted.\n * @return {Interpreter.Value} The equivalent JS interpreter object.\n */\nInterpreter.prototype.nativeToPseudo = function (nativeObj) {\n if ((typeof nativeObj !== \"object\" && typeof nativeObj !== \"function\") || nativeObj === null) {\n return nativeObj;\n }\n\n if (nativeObj instanceof RegExp) {\n var pseudoRegexp = this.createObjectProto(this.REGEXP_PROTO);\n this.populateRegExp(pseudoRegexp, nativeObj);\n return pseudoRegexp;\n }\n\n if (nativeObj instanceof Date) {\n var pseudoDate = this.createObjectProto(this.DATE_PROTO);\n pseudoDate.data = nativeObj;\n return pseudoDate;\n }\n\n if (nativeObj instanceof Function) {\n var interpreter = this;\n var wrapper = function () {\n return interpreter.nativeToPseudo(\n nativeObj.apply(\n interpreter,\n Array.prototype.slice.call(arguments).map(function (i) {\n return interpreter.pseudoToNative(i);\n }),\n ),\n );\n };\n return this.createNativeFunction(wrapper, undefined);\n }\n\n var pseudoObj;\n if (Array.isArray(nativeObj)) {\n // Array.\n pseudoObj = this.createObjectProto(this.ARRAY_PROTO);\n for (var i = 0; i < nativeObj.length; i++) {\n if (i in nativeObj) {\n this.setProperty(pseudoObj, i, this.nativeToPseudo(nativeObj[i]));\n }\n }\n } else {\n // Object.\n pseudoObj = this.createObjectProto(this.OBJECT_PROTO);\n for (var key in nativeObj) {\n this.setProperty(pseudoObj, key, this.nativeToPseudo(nativeObj[key]));\n }\n }\n return pseudoObj;\n};\n\n/**\n * Converts from a JS interpreter object to native JS object.\n * Can handle JSON-style values, plus cycles.\n * @param {Interpreter.Value} pseudoObj The JS interpreter object to be\n * converted.\n * @param {Object=} opt_cycles Cycle detection (used in recursive calls).\n * @return {*} The equivalent native JS object or value.\n */\nInterpreter.prototype.pseudoToNative = function (pseudoObj, opt_cycles) {\n if ((typeof pseudoObj !== \"object\" && typeof pseudoObj !== \"function\") || pseudoObj === null) {\n return pseudoObj;\n }\n\n if (this.isa(pseudoObj, this.REGEXP)) {\n // Regular expression.\n return pseudoObj.data;\n }\n\n if (this.isa(pseudoObj, this.DATE)) {\n // Date.\n return pseudoObj.data;\n }\n\n var cycles = opt_cycles || {\n pseudo: [],\n native: [],\n };\n var i = cycles.pseudo.indexOf(pseudoObj);\n if (i !== -1) {\n return cycles.native[i];\n }\n cycles.pseudo.push(pseudoObj);\n var nativeObj;\n if (this.isa(pseudoObj, this.ARRAY)) {\n // Array.\n nativeObj = [];\n cycles.native.push(nativeObj);\n var length = this.getProperty(pseudoObj, \"length\");\n for (var i = 0; i < length; i++) {\n if (this.hasProperty(pseudoObj, i)) {\n nativeObj[i] = this.pseudoToNative(this.getProperty(pseudoObj, i), cycles);\n }\n }\n } else {\n // Object.\n nativeObj = {};\n cycles.native.push(nativeObj);\n var val;\n for (var key in pseudoObj.properties) {\n val = pseudoObj.properties[key];\n nativeObj[key] = this.pseudoToNative(val, cycles);\n }\n }\n cycles.pseudo.pop();\n cycles.native.pop();\n return nativeObj;\n};\n\n/**\n * Converts from a native JS array to a JS interpreter array.\n * Does handle non-numeric properties (like str.match's index prop).\n * Does NOT recurse into the array's contents.\n * @param {!Array} nativeArray The JS array to be converted.\n * @return {!Interpreter.Object} The equivalent JS interpreter array.\n */\nInterpreter.prototype.arrayNativeToPseudo = function (nativeArray) {\n var pseudoArray = this.createObjectProto(this.ARRAY_PROTO);\n var props = Object.getOwnPropertyNames(nativeArray);\n for (var i = 0; i < props.length; i++) {\n this.setProperty(pseudoArray, props[i], nativeArray[props[i]]);\n }\n return pseudoArray;\n};\n\n/**\n * Converts from a JS interpreter array to native JS array.\n * Does handle non-numeric properties (like str.match's index prop).\n * Does NOT recurse into the array's contents.\n * @param {!Interpreter.Object} pseudoArray The JS interpreter array,\n * or JS interpreter object pretending to be an array.\n * @return {!Array} The equivalent native JS array.\n */\nInterpreter.prototype.arrayPseudoToNative = function (pseudoArray) {\n var nativeArray = [];\n for (var key in pseudoArray.properties) {\n nativeArray[key] = this.getProperty(pseudoArray, key);\n }\n // pseudoArray might be an object pretending to be an array. In this case\n // it's possible that length is non-existent, invalid, or smaller than the\n // largest defined numeric property. Set length explicitly here.\n nativeArray.length = Interpreter.legalArrayLength(this.getProperty(pseudoArray, \"length\")) || 0;\n return nativeArray;\n};\n\n/**\n * Look up the prototype for this value.\n * @param {Interpreter.Value} value Data object.\n * @return {Interpreter.Object} Prototype object, null if none.\n */\nInterpreter.prototype.getPrototype = function (value) {\n switch (typeof value) {\n case \"number\":\n return this.NUMBER.properties[\"prototype\"];\n case \"boolean\":\n return this.BOOLEAN.properties[\"prototype\"];\n case \"string\":\n return this.STRING.properties[\"prototype\"];\n }\n if (value) {\n return value.proto;\n }\n return null;\n};\n\n/**\n * Fetch a property value from a data object.\n * @param {Interpreter.Value} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line numbers\n * @return {Interpreter.Value} Property value (may be undefined).\n */\nInterpreter.prototype.getProperty = function (obj, name, node) {\n name = String(name);\n if (obj === undefined || obj === null) {\n let lineNum;\n if (node != null && node.loc != null && node.loc.start != null) {\n lineNum = node.loc.start.line;\n }\n this.throwException(this.TYPE_ERROR, \"Cannot read property '\" + name + \"' of \" + obj, lineNum);\n }\n if (name === \"length\") {\n // Special cases for magic length property.\n if (this.isa(obj, this.STRING)) {\n return String(obj).length;\n }\n } else if (name.charCodeAt(0) < 0x40) {\n // Might have numbers in there?\n // Special cases for string array indexing\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (!isNaN(n) && n < String(obj).length) {\n return String(obj)[n];\n }\n }\n }\n do {\n if (obj.properties && name in obj.properties) {\n var getter = obj.getter[name];\n if (getter) {\n // Flag this function as being a getter and thus needing immediate\n // execution (rather than being the value of the property).\n getter.isGetter = true;\n return getter;\n }\n return obj.properties[name];\n }\n } while ((obj = this.getPrototype(obj)));\n return undefined;\n};\n\n/**\n * Does the named property exist on a data object.\n * @param {Interpreter.Value} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @return {boolean} True if property exists.\n */\nInterpreter.prototype.hasProperty = function (obj, name) {\n if (!obj.isObject) {\n throw TypeError(\"Primitive data type has no properties\");\n }\n name = String(name);\n if (name === \"length\" && this.isa(obj, this.STRING)) {\n return true;\n }\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (!isNaN(n) && n < String(obj).length) {\n return true;\n }\n }\n do {\n if (obj.properties && name in obj.properties) {\n return true;\n }\n } while ((obj = this.getPrototype(obj)));\n return false;\n};\n\n/**\n * Set a property value on a data object.\n * @param {!Interpreter.Object} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {Interpreter.Value} value New property value.\n * Use Interpreter.VALUE_IN_DESCRIPTOR if value is handled by\n * descriptor instead.\n * @param {Object=} opt_descriptor Optional descriptor object.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setProperty = function (obj, name, value, opt_descriptor) {\n name = String(name);\n if (obj === undefined || obj === null) {\n this.throwException(this.TYPE_ERROR, \"Cannot set property '\" + name + \"' of \" + obj);\n }\n if (\n opt_descriptor &&\n (\"get\" in opt_descriptor || \"set\" in opt_descriptor) &&\n (\"value\" in opt_descriptor || \"writable\" in opt_descriptor)\n ) {\n this.throwException(\n this.TYPE_ERROR,\n \"Invalid property descriptor. \" + \"Cannot both specify accessors and a value or writable attribute\",\n );\n }\n var strict = !this.stateStack || this.getScope().strict;\n if (!obj.isObject) {\n if (strict) {\n this.throwException(this.TYPE_ERROR, \"Can't create property '\" + name + \"' on '\" + obj + \"'\");\n }\n return;\n }\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (name === \"length\" || (!isNaN(n) && n < String(obj).length)) {\n // Can't set length or letters on String objects.\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot assign to read only \" + \"property '\" + name + \"' of String '\" + obj.data + \"'\",\n );\n }\n return;\n }\n }\n if (obj.class === \"Array\") {\n // Arrays have a magic length variable that is bound to the elements.\n var length = obj.properties.length;\n var i;\n if (name === \"length\") {\n // Delete elements if length is smaller.\n if (opt_descriptor) {\n if (!(\"value\" in opt_descriptor)) {\n return;\n }\n value = opt_descriptor.value;\n }\n value = Interpreter.legalArrayLength(value);\n if (isNaN(value)) {\n this.throwException(this.RANGE_ERROR, \"Invalid array length\");\n }\n if (value < length) {\n for (i in obj.properties) {\n i = Interpreter.legalArrayIndex(i);\n if (!isNaN(i) && value <= i) {\n delete obj.properties[i];\n }\n }\n }\n } else if (!isNaN((i = Interpreter.legalArrayIndex(name)))) {\n // Increase length if this index is larger.\n obj.properties.length = Math.max(length, i + 1);\n }\n }\n if (obj.preventExtensions && !(name in obj.properties)) {\n if (strict) {\n this.throwException(this.TYPE_ERROR, \"Can't add property '\" + name + \"', object is not extensible\");\n }\n return;\n }\n if (opt_descriptor) {\n // Define the property.\n if (\"get\" in opt_descriptor) {\n if (opt_descriptor.get) {\n obj.getter[name] = opt_descriptor.get;\n } else {\n delete obj.getter[name];\n }\n }\n if (\"set\" in opt_descriptor) {\n if (opt_descriptor.set) {\n obj.setter[name] = opt_descriptor.set;\n } else {\n delete obj.setter[name];\n }\n }\n var descriptor = {};\n if (\"configurable\" in opt_descriptor) {\n descriptor.configurable = opt_descriptor.configurable;\n }\n if (\"enumerable\" in opt_descriptor) {\n descriptor.enumerable = opt_descriptor.enumerable;\n }\n if (\"writable\" in opt_descriptor) {\n descriptor.writable = opt_descriptor.writable;\n delete obj.getter[name];\n delete obj.setter[name];\n }\n if (\"value\" in opt_descriptor) {\n descriptor.value = opt_descriptor.value;\n delete obj.getter[name];\n delete obj.setter[name];\n } else if (value !== Interpreter.VALUE_IN_DESCRIPTOR) {\n descriptor.value = value;\n delete obj.getter[name];\n delete obj.setter[name];\n }\n try {\n Object.defineProperty(obj.properties, name, descriptor);\n } catch (e) {\n this.throwException(this.TYPE_ERROR, \"Cannot redefine property: \" + name);\n }\n } else {\n // Set the property.\n if (value === Interpreter.VALUE_IN_DESCRIPTOR) {\n throw ReferenceError(\"Value not specified.\");\n }\n // Determine the parent (possibly self) where the property is defined.\n var defObj = obj;\n while (!(name in defObj.properties)) {\n defObj = this.getPrototype(defObj);\n if (!defObj) {\n // This is a new property.\n defObj = obj;\n break;\n }\n }\n if (defObj.setter && defObj.setter[name]) {\n return defObj.setter[name];\n }\n if (defObj.getter && defObj.getter[name]) {\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot set property '\" + name + \"' of object '\" + obj + \"' which only has a getter\",\n );\n }\n } else {\n // No setter, simple assignment.\n try {\n obj.properties[name] = value;\n } catch (e) {\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot assign to read only \" + \"property '\" + name + \"' of object '\" + obj + \"'\",\n );\n }\n }\n }\n }\n};\n\n/**\n * Convenience method for adding a native function as a non-enumerable property\n * onto an object's prototype.\n * @param {!Interpreter.Object} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {!Function} wrapper Function object.\n */\nInterpreter.prototype.setNativeFunctionPrototype = function (obj, name, wrapper) {\n this.setProperty(\n obj.properties[\"prototype\"],\n name,\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n};\n\n/**\n * Returns the current scope from the stateStack.\n * @return {!Interpreter.Object} Current scope dictionary.\n */\nInterpreter.prototype.getScope = function () {\n var scope = this.stateStack[this.stateStack.length - 1].scope;\n if (!scope) {\n throw Error(\"No scope found.\");\n }\n return scope;\n};\n\n/**\n * Create a new scope dictionary.\n * @param {!Object} node AST node defining the scope container\n * (e.g. a function).\n * @param {Interpreter.Object} parentScope Scope to link to.\n * @return {!Interpreter.Object} New scope.\n */\nInterpreter.prototype.createScope = function (node, parentScope) {\n var scope = this.createObjectProto(null);\n scope.parentScope = parentScope;\n if (!parentScope) {\n this.initGlobalScope(scope);\n }\n this.populateScope_(node, scope);\n\n // Determine if this scope starts with 'use strict'.\n scope.strict = false;\n if (parentScope && parentScope.strict) {\n scope.strict = true;\n } else {\n var firstNode = node[\"body\"] && node[\"body\"][0];\n if (\n firstNode &&\n firstNode.expression &&\n firstNode.expression[\"type\"] === \"Literal\" &&\n firstNode.expression.value === \"use strict\"\n ) {\n scope.strict = true;\n }\n }\n return scope;\n};\n\n/**\n * Create a new special scope dictionary. Similar to createScope(), but\n * doesn't assume that the scope is for a function body.\n * This is used for 'catch' clauses and 'with' statements.\n * @param {!Interpreter.Object} parentScope Scope to link to.\n * @param {Interpreter.Object=} opt_scope Optional object to transform into\n * scope.\n * @return {!Interpreter.Object} New scope.\n */\nInterpreter.prototype.createSpecialScope = function (parentScope, opt_scope) {\n if (!parentScope) {\n throw Error(\"parentScope required\");\n }\n var scope = opt_scope || this.createObjectProto(null);\n scope.parentScope = parentScope;\n scope.strict = parentScope.strict;\n return scope;\n};\n\n/**\n * Retrieves a value from the scope chain.\n * @param {string} name Name of variable.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line number\n * @return {Interpreter.Value} Any value.\n * May be flagged as being a getter and thus needing immediate execution\n * (rather than being the value of the property).\n */\nInterpreter.prototype.getValueFromScope = function (name, node) {\n var scope = this.getScope();\n while (scope && scope !== this.global) {\n if (name in scope.properties) {\n return scope.properties[name];\n }\n scope = scope.parentScope;\n }\n // The root scope is also an object which has inherited properties and\n // could also have getters.\n if (scope === this.global && this.hasProperty(scope, name)) {\n return this.getProperty(scope, name);\n }\n // Typeof operator is unique: it can safely look at non-defined variables.\n var prevNode = this.stateStack[this.stateStack.length - 1].node;\n if (prevNode[\"type\"] === \"UnaryExpression\" && prevNode[\"operator\"] === \"typeof\") {\n return undefined;\n }\n\n var lineNum;\n if (node != null && node.loc != null && node.loc.start != null) {\n lineNum = node.loc.start.line;\n }\n this.throwException(this.REFERENCE_ERROR, name + \" is not defined\", lineNum);\n};\n\n/**\n * Sets a value to the current scope.\n * @param {string} name Name of variable.\n * @param {Interpreter.Value} value Value.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setValueToScope = function (name, value) {\n var scope = this.getScope();\n var strict = scope.strict;\n while (scope && scope !== this.global) {\n if (name in scope.properties) {\n scope.properties[name] = value;\n return undefined;\n }\n scope = scope.parentScope;\n }\n // The root scope is also an object which has readonly properties and\n // could also have setters.\n if (scope === this.global && (!strict || this.hasProperty(scope, name))) {\n return this.setProperty(scope, name, value);\n }\n this.throwException(this.REFERENCE_ERROR, name + \" is not defined\");\n};\n\n/**\n * Create a new scope for the given node.\n * @param {!Object} node AST node (program or function).\n * @param {!Interpreter.Object} scope Scope dictionary to populate.\n * @private\n */\nInterpreter.prototype.populateScope_ = function (node, scope) {\n if (node[\"type\"] === \"VariableDeclaration\") {\n for (var i = 0; i < node[\"declarations\"].length; i++) {\n this.setProperty(scope, node[\"declarations\"][i][\"id\"][\"name\"], undefined, Interpreter.VARIABLE_DESCRIPTOR);\n }\n } else if (node[\"type\"] === \"FunctionDeclaration\") {\n this.setProperty(scope, node[\"id\"][\"name\"], this.createFunction(node, scope), Interpreter.VARIABLE_DESCRIPTOR);\n return; // Do not recurse into function.\n } else if (node[\"type\"] === \"FunctionExpression\") {\n return; // Do not recurse into function.\n } else if (node[\"type\"] === \"ExpressionStatement\") {\n return; // Expressions can't contain variable/function declarations.\n }\n var nodeClass = node[\"constructor\"];\n for (var name in node) {\n var prop = node[name];\n if (prop && typeof prop === \"object\") {\n if (Array.isArray(prop)) {\n for (var i = 0; i < prop.length; i++) {\n if (prop[i] && prop[i].constructor === nodeClass) {\n this.populateScope_(prop[i], scope);\n }\n }\n } else {\n if (prop.constructor === nodeClass) {\n this.populateScope_(prop, scope);\n }\n }\n }\n }\n};\n\n/**\n * Remove start and end values from AST, or set start and end values to a\n * constant value. Used to remove highlighting from polyfills and to set\n * highlighting in an eval to cover the entire eval expression.\n * @param {!Object} node AST node.\n * @param {number=} start Starting character of all nodes, or undefined.\n * @param {number=} end Ending character of all nodes, or undefined.\n * @private\n */\nInterpreter.prototype.stripLocations_ = function (node, start, end) {\n if (start) {\n node[\"start\"] = start;\n } else {\n delete node[\"start\"];\n }\n if (end) {\n node[\"end\"] = end;\n } else {\n delete node[\"end\"];\n }\n for (var name in node) {\n if (node.hasOwnProperty(name)) {\n var prop = node[name];\n if (prop && typeof prop === \"object\") {\n this.stripLocations_(prop, start, end);\n }\n }\n }\n};\n\n/**\n * Is the current state directly being called with as a construction with 'new'.\n * @return {boolean} True if 'new foo()', false if 'foo()'.\n */\nInterpreter.prototype.calledWithNew = function () {\n return this.stateStack[this.stateStack.length - 1].isConstructor;\n};\n\n/**\n * Gets a value from the scope chain or from an object property.\n * @param {!Array} ref Name of variable or object/propname tuple.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line number\n * @return {Interpreter.Value} Any value.\n * May be flagged as being a getter and thus needing immediate execution\n * (rather than being the value of the property).\n */\nInterpreter.prototype.getValue = function (ref, node) {\n if (ref[0] === Interpreter.SCOPE_REFERENCE) {\n // A null/varname variable lookup.\n return this.getValueFromScope(ref[1], node);\n } else {\n // An obj/prop components tuple (foo.bar).\n return this.getProperty(ref[0], ref[1], node);\n }\n};\n\n/**\n * Sets a value to the scope chain or to an object property.\n * @param {!Array} ref Name of variable or object/propname tuple.\n * @param {Interpreter.Value} value Value.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setValue = function (ref, value) {\n if (ref[0] === Interpreter.SCOPE_REFERENCE) {\n // A null/varname variable lookup.\n return this.setValueToScope(ref[1], value);\n } else {\n // An obj/prop components tuple (foo.bar).\n return this.setProperty(ref[0], ref[1], value);\n }\n};\n\n/**\n * Completion Value Types.\n * @enum {number}\n */\nInterpreter.Completion = {\n NORMAL: 0,\n BREAK: 1,\n CONTINUE: 2,\n RETURN: 3,\n THROW: 4,\n};\n\n/**\n * Throw an exception in the interpreter that can be handled by an\n * interpreter try/catch statement. If unhandled, a real exception will\n * be thrown. Can be called with either an error class and a message, or\n * with an actual object to be thrown.\n * @param {!Interpreter.Object} errorClass Type of error (if message is\n * provided) or the value to throw (if no message).\n * @param {string=} opt_message Message being thrown.\n */\nInterpreter.prototype.throwException = function (errorClass, opt_message, lineNumber) {\n if (opt_message === undefined) {\n var error = errorClass; // This is a value to throw, not an error class.\n } else {\n var error = this.createObject(errorClass);\n this.setProperty(error, \"message\", opt_message, Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n var lineNumErrorMsg;\n if (lineNumber != null) {\n lineNumErrorMsg = this.getErrorLineNumberMessage(lineNumber);\n }\n this.unwind(Interpreter.Completion.THROW, error, undefined, lineNumErrorMsg);\n // Abort anything related to the current step.\n throw Interpreter.STEP_ERROR;\n};\n\n/**\n * Unwind the stack to the innermost relevant enclosing TryStatement,\n * For/ForIn/WhileStatement or Call/NewExpression. If this results in\n * the stack being completely unwound the thread will be terminated\n * and the appropriate error being thrown.\n * @param {Interpreter.Completion} type Completion type.\n * @param {Interpreter.Value=} value Value computed, returned or thrown.\n * @param {string=} label Target label for break or return.\n */\nInterpreter.prototype.unwind = function (type, value, label, lineNumberMsg = \"\") {\n if (type === Interpreter.Completion.NORMAL) {\n throw TypeError(\"Should not unwind for NORMAL completions\");\n }\n\n for (var stack = this.stateStack; stack.length > 0; stack.pop()) {\n var state = stack[stack.length - 1];\n switch (state.node[\"type\"]) {\n case \"TryStatement\":\n state.cv = { type: type, value: value, label: label };\n return;\n case \"CallExpression\":\n case \"NewExpression\":\n if (type === Interpreter.Completion.RETURN) {\n state.value = value;\n return;\n } else if (type !== Interpreter.Completion.THROW) {\n throw Error(\"Unsynatctic break/continue not rejected by Acorn\");\n }\n }\n if (type === Interpreter.Completion.BREAK) {\n if (label ? state.labels && state.labels.indexOf(label) !== -1 : state.isLoop || state.isSwitch) {\n stack.pop();\n return;\n }\n } else if (type === Interpreter.Completion.CONTINUE) {\n if (label ? state.labels && state.labels.indexOf(label) !== -1 : state.isLoop) {\n return;\n }\n }\n }\n\n // Unhandled completion. Throw a real error.\n var realError;\n if (this.isa(value, this.ERROR)) {\n var errorTable = {\n EvalError: EvalError,\n RangeError: RangeError,\n ReferenceError: ReferenceError,\n SyntaxError: SyntaxError,\n TypeError: TypeError,\n URIError: URIError,\n };\n var name = this.getProperty(value, \"name\").toString();\n var message = this.getProperty(value, \"message\").valueOf();\n var type = errorTable[name] || Error;\n realError = type(message + lineNumberMsg);\n } else {\n realError = String(value) + lineNumberMsg;\n }\n throw realError;\n};\n\n/**\n * Create a call to a getter function.\n * @param {!Interpreter.Object} func Function to execute.\n * @param {!Interpreter.Object|!Array} left\n * Name of variable or object/propname tuple.\n * @private\n */\nInterpreter.prototype.createGetter_ = function (func, left) {\n // Normally 'this' will be specified as the object component (o.x).\n // Sometimes 'this' is explicitly provided (o).\n var funcThis = Array.isArray(left) ? left[0] : left;\n var node = new this.nodeConstructor();\n node[\"type\"] = \"CallExpression\";\n var state = new Interpreter.State(node, this.stateStack[this.stateStack.length - 1].scope);\n state.doneCallee_ = true;\n state.funcThis_ = funcThis;\n state.func_ = func;\n state.doneArgs_ = true;\n state.arguments_ = [];\n return state;\n};\n\n/**\n * Create a call to a setter function.\n * @param {!Interpreter.Object} func Function to execute.\n * @param {!Interpreter.Object|!Array} left\n * Name of variable or object/propname tuple.\n * @param {Interpreter.Value} value Value to set.\n * @private\n */\nInterpreter.prototype.createSetter_ = function (func, left, value) {\n // Normally 'this' will be specified as the object component (o.x).\n // Sometimes 'this' is implicitly the global object (x).\n var funcThis = Array.isArray(left) ? left[0] : this.global;\n var node = new this.nodeConstructor();\n node[\"type\"] = \"CallExpression\";\n var state = new Interpreter.State(node, this.stateStack[this.stateStack.length - 1].scope);\n state.doneCallee_ = true;\n state.funcThis_ = funcThis;\n state.func_ = func;\n state.doneArgs_ = true;\n state.arguments_ = [value];\n return state;\n};\n\n/**\n * Class for a state.\n * @param {!Object} node AST node for the state.\n * @param {!Interpreter.Object} scope Scope object for the state.\n * @constructor\n */\nInterpreter.State = function (node, scope) {\n this.node = node;\n this.scope = scope;\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// Functions to handle each node type.\n///////////////////////////////////////////////////////////////////////////////\n\nInterpreter.prototype[\"stepArrayExpression\"] = function (stack, state, node) {\n var elements = node[\"elements\"];\n var n = state.n_ || 0;\n if (!state.array_) {\n state.array_ = this.createObjectProto(this.ARRAY_PROTO);\n state.array_.properties.length = elements.length;\n } else {\n this.setProperty(state.array_, n, state.value);\n n++;\n }\n while (n < elements.length) {\n // Skip missing elements - they're not defined, not undefined.\n if (elements[n]) {\n state.n_ = n;\n return new Interpreter.State(elements[n], state.scope);\n }\n n++;\n }\n stack.pop();\n stack[stack.length - 1].value = state.array_;\n};\n\nInterpreter.prototype[\"stepAssignmentExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n var nextState = new Interpreter.State(node[\"left\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (!state.doneRight_) {\n if (!state.leftReference_) {\n state.leftReference_ = state.value;\n }\n if (state.doneGetter_) {\n state.leftValue_ = state.value;\n }\n if (!state.doneGetter_ && node[\"operator\"] !== \"=\") {\n var leftValue = this.getValue(state.leftReference_, node);\n state.leftValue_ = leftValue;\n if (leftValue && typeof leftValue === \"object\" && leftValue.isGetter) {\n // Clear the getter flag and call the getter function.\n leftValue.isGetter = false;\n state.doneGetter_ = true;\n var func = /** @type {!Interpreter.Object} */ (leftValue);\n return this.createGetter_(func, state.leftReference_);\n }\n }\n state.doneRight_ = true;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n if (state.doneSetter_) {\n // Return if setter function.\n // Setter method on property has completed.\n // Ignore its return value, and use the original set value instead.\n stack.pop();\n stack[stack.length - 1].value = state.setterValue_;\n return;\n }\n var value = state.leftValue_;\n var rightValue = state.value;\n switch (node[\"operator\"]) {\n case \"=\":\n value = rightValue;\n break;\n case \"+=\":\n value += rightValue;\n break;\n case \"-=\":\n value -= rightValue;\n break;\n case \"*=\":\n value *= rightValue;\n break;\n case \"/=\":\n value /= rightValue;\n break;\n case \"%=\":\n value %= rightValue;\n break;\n case \"<<=\":\n value <<= rightValue;\n break;\n case \">>=\":\n value >>= rightValue;\n break;\n case \">>>=\":\n value >>>= rightValue;\n break;\n case \"&=\":\n value &= rightValue;\n break;\n case \"^=\":\n value ^= rightValue;\n break;\n case \"|=\":\n value |= rightValue;\n break;\n default:\n throw SyntaxError(\"Unknown assignment expression: \" + node[\"operator\"]);\n }\n var setter = this.setValue(state.leftReference_, value);\n if (setter) {\n state.doneSetter_ = true;\n state.setterValue_ = value;\n return this.createSetter_(setter, state.leftReference_, value);\n }\n // Return if no setter function.\n stack.pop();\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepBinaryExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n if (!state.doneRight_) {\n state.doneRight_ = true;\n state.leftValue_ = state.value;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n stack.pop();\n var leftValue = state.leftValue_;\n var rightValue = state.value;\n var value;\n switch (node[\"operator\"]) {\n case \"==\":\n value = leftValue == rightValue;\n break;\n case \"!=\":\n value = leftValue != rightValue;\n break;\n case \"===\":\n value = leftValue === rightValue;\n break;\n case \"!==\":\n value = leftValue !== rightValue;\n break;\n case \">\":\n value = leftValue > rightValue;\n break;\n case \">=\":\n value = leftValue >= rightValue;\n break;\n case \"<\":\n value = leftValue < rightValue;\n break;\n case \"<=\":\n value = leftValue <= rightValue;\n break;\n case \"+\":\n value = leftValue + rightValue;\n break;\n case \"-\":\n value = leftValue - rightValue;\n break;\n case \"*\":\n value = leftValue * rightValue;\n break;\n case \"/\":\n value = leftValue / rightValue;\n break;\n case \"%\":\n value = leftValue % rightValue;\n break;\n case \"&\":\n value = leftValue & rightValue;\n break;\n case \"|\":\n value = leftValue | rightValue;\n break;\n case \"^\":\n value = leftValue ^ rightValue;\n break;\n case \"<<\":\n value = leftValue << rightValue;\n break;\n case \">>\":\n value = leftValue >> rightValue;\n break;\n case \">>>\":\n value = leftValue >>> rightValue;\n break;\n case \"in\":\n if (!rightValue || !rightValue.isObject) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, \"'in' expects an object, not '\" + rightValue + \"'\", lineNum);\n }\n value = this.hasProperty(rightValue, leftValue);\n break;\n case \"instanceof\":\n if (!this.isa(rightValue, this.FUNCTION)) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, \"Right-hand side of instanceof is not an object\", lineNum);\n }\n value = leftValue.isObject ? this.isa(leftValue, rightValue) : false;\n break;\n default:\n throw SyntaxError(\"Unknown binary operator: \" + node[\"operator\"]);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepBlockStatement\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"body\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n};\n\nInterpreter.prototype[\"stepBreakStatement\"] = function (stack, state, node) {\n var label = node[\"label\"] && node[\"label\"][\"name\"];\n this.unwind(Interpreter.Completion.BREAK, undefined, label);\n};\n\nInterpreter.prototype[\"stepCallExpression\"] = function (stack, state, node) {\n if (!state.doneCallee_) {\n state.doneCallee_ = 1;\n // Components needed to determine value of 'this'.\n var nextState = new Interpreter.State(node[\"callee\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (state.doneCallee_ === 1) {\n // Determine value of the function.\n state.doneCallee_ = 2;\n var func = state.value;\n if (Array.isArray(func)) {\n state.func_ = this.getValue(func, node);\n if (func[0] === Interpreter.SCOPE_REFERENCE) {\n // (Globally or locally) named function. Is it named 'eval'?\n state.directEval_ = func[1] === \"eval\";\n } else {\n // Method function, 'this' is object (ignored if invoked as 'new').\n state.funcThis_ = func[0];\n }\n func = state.func_;\n if (func && typeof func === \"object\" && func.isGetter) {\n // Clear the getter flag and call the getter function.\n func.isGetter = false;\n state.doneCallee_ = 1;\n return this.createGetter_(/** @type {!Interpreter.Object} */ (func), state.value);\n }\n } else {\n // Already evaluated function: (function(){...})();\n state.func_ = func;\n }\n state.arguments_ = [];\n state.n_ = 0;\n }\n var func = state.func_;\n if (!state.doneArgs_) {\n if (state.n_ !== 0) {\n state.arguments_.push(state.value);\n }\n if (node[\"arguments\"][state.n_]) {\n return new Interpreter.State(node[\"arguments\"][state.n_++], state.scope);\n }\n // Determine value of 'this' in function.\n if (node[\"type\"] === \"NewExpression\") {\n if (func.illegalConstructor) {\n // Illegal: new escape();\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func + \" is not a constructor\", lineNum);\n }\n // Constructor, 'this' is new object.\n var proto = func.properties[\"prototype\"];\n if (typeof proto !== \"object\" || proto === null) {\n // Non-object prototypes default to Object.prototype.\n proto = this.OBJECT_PROTO;\n }\n state.funcThis_ = this.createObjectProto(proto);\n state.isConstructor = true;\n } else if (state.funcThis_ === undefined) {\n // Global function, 'this' is global object (or 'undefined' if strict).\n state.funcThis_ = state.scope.strict ? undefined : this.global;\n }\n state.doneArgs_ = true;\n }\n if (!state.doneExec_) {\n state.doneExec_ = true;\n if (!func || !func.isObject) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func + \" is not a function\", lineNum);\n }\n var funcNode = func.node;\n if (funcNode) {\n var scope = this.createScope(funcNode[\"body\"], func.parentScope);\n // Add all arguments.\n for (var i = 0; i < funcNode[\"params\"].length; i++) {\n var paramName = funcNode[\"params\"][i][\"name\"];\n var paramValue = state.arguments_.length > i ? state.arguments_[i] : undefined;\n this.setProperty(scope, paramName, paramValue);\n }\n // Build arguments variable.\n var argsList = this.createObjectProto(this.ARRAY_PROTO);\n for (var i = 0; i < state.arguments_.length; i++) {\n this.setProperty(argsList, i, state.arguments_[i]);\n }\n this.setProperty(scope, \"arguments\", argsList);\n // Add the function's name (var x = function foo(){};)\n var name = funcNode[\"id\"] && funcNode[\"id\"][\"name\"];\n if (name) {\n this.setProperty(scope, name, func);\n }\n this.setProperty(scope, \"this\", state.funcThis_, Interpreter.READONLY_DESCRIPTOR);\n state.value = undefined; // Default value if no explicit return.\n return new Interpreter.State(funcNode[\"body\"], scope);\n } else if (func.eval) {\n var code = state.arguments_[0];\n if (typeof code !== \"string\") {\n // JS does not parse String objects:\n // eval(new String('1 + 1')) -> '1 + 1'\n state.value = code;\n } else {\n try {\n var ast = acorn.parse(code.toString(), Interpreter.PARSE_OPTIONS);\n } catch (e) {\n // Acorn threw a SyntaxError. Rethrow as a trappable error.\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.SYNTAX_ERROR, \"Invalid code: \" + e.message, lineNum);\n }\n var evalNode = new this.nodeConstructor();\n evalNode[\"type\"] = \"EvalProgram_\";\n evalNode[\"body\"] = ast[\"body\"];\n this.stripLocations_(evalNode, node[\"start\"], node[\"end\"]);\n // Create new scope and update it with definitions in eval().\n var scope = state.directEval_ ? state.scope : this.global;\n if (scope.strict) {\n // Strict mode get its own scope in eval.\n scope = this.createScope(ast, scope);\n } else {\n // Non-strict mode pollutes the current scope.\n this.populateScope_(ast, scope);\n }\n this.value = undefined; // Default value if no code.\n return new Interpreter.State(evalNode, scope);\n }\n } else if (func.nativeFunc) {\n state.value = func.nativeFunc.apply(state.funcThis_, state.arguments_);\n } else if (func.asyncFunc) {\n var thisInterpreter = this;\n var callback = function (value) {\n state.value = value;\n thisInterpreter.paused_ = false;\n };\n var argsWithCallback = state.arguments_.concat(callback);\n this.paused_ = true;\n func.asyncFunc.apply(state.funcThis_, argsWithCallback);\n return;\n } else {\n /* A child of a function is a function but is not callable. For example:\n var F = function() {};\n F.prototype = escape;\n var f = new F();\n f();\n */\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func.class + \" is not a function\", lineNum);\n }\n } else {\n // Execution complete. Put the return value on the stack.\n stack.pop();\n if (state.isConstructor && typeof state.value !== \"object\") {\n stack[stack.length - 1].value = state.funcThis_;\n } else {\n stack[stack.length - 1].value = state.value;\n }\n }\n};\n\nInterpreter.prototype[\"stepCatchClause\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n // Create an empty scope.\n var scope = this.createSpecialScope(state.scope);\n // Add the argument.\n this.setProperty(scope, node[\"param\"][\"name\"], state.throwValue);\n // Execute catch clause.\n return new Interpreter.State(node[\"body\"], scope);\n } else {\n stack.pop();\n }\n};\n\nInterpreter.prototype[\"stepConditionalExpression\"] = function (stack, state, node) {\n var mode = state.mode_ || 0;\n if (mode === 0) {\n state.mode_ = 1;\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n if (mode === 1) {\n state.mode_ = 2;\n var value = Boolean(state.value);\n if (value && node[\"consequent\"]) {\n // Execute 'if' block.\n return new Interpreter.State(node[\"consequent\"], state.scope);\n } else if (!value && node[\"alternate\"]) {\n // Execute 'else' block.\n return new Interpreter.State(node[\"alternate\"], state.scope);\n }\n // eval('1;if(false){2}') -> undefined\n this.value = undefined;\n }\n stack.pop();\n if (node[\"type\"] === \"ConditionalExpression\") {\n stack[stack.length - 1].value = state.value;\n }\n};\n\nInterpreter.prototype[\"stepContinueStatement\"] = function (stack, state, node) {\n var label = node[\"label\"] && node[\"label\"][\"name\"];\n this.unwind(Interpreter.Completion.CONTINUE, undefined, label);\n};\n\nInterpreter.prototype[\"stepDebuggerStatement\"] = function (stack, state, node) {\n // Do nothing. May be overridden by developers.\n stack.pop();\n};\n\nInterpreter.prototype[\"stepDoWhileStatement\"] = function (stack, state, node) {\n if (node[\"type\"] === \"DoWhileStatement\" && state.test_ === undefined) {\n // First iteration of do/while executes without checking test.\n state.value = true;\n state.test_ = true;\n }\n if (!state.test_) {\n state.test_ = true;\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n if (!state.value) {\n // Done, exit loop.\n stack.pop();\n } else if (node[\"body\"]) {\n // Execute the body.\n state.test_ = false;\n state.isLoop = true;\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n};\n\nInterpreter.prototype[\"stepEmptyStatement\"] = function (stack, state, node) {\n stack.pop();\n};\n\nInterpreter.prototype[\"stepEvalProgram_\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"body\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n stack[stack.length - 1].value = this.value;\n};\n\nInterpreter.prototype[\"stepExpressionStatement\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"expression\"], state.scope);\n }\n stack.pop();\n // Save this value to interpreter.value for use as a return value if\n // this code is inside an eval function.\n this.value = state.value;\n};\n\nInterpreter.prototype[\"stepForInStatement\"] = function (stack, state, node) {\n // First, initialize a variable if exists. Only do so once, ever.\n if (!state.doneInit_) {\n state.doneInit_ = true;\n if (node[\"left\"][\"declarations\"] && node[\"left\"][\"declarations\"][0][\"init\"]) {\n if (state.scope.strict) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(\n this.SYNTAX_ERROR,\n \"for-in loop variable declaration may not have an initializer.\",\n lineNum,\n );\n }\n // Variable initialization: for (var x = 4 in y)\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n }\n // Second, look up the object. Only do so once, ever.\n if (!state.doneObject_) {\n state.doneObject_ = true;\n if (!state.variable_) {\n state.variable_ = state.value;\n }\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n if (!state.isLoop) {\n // First iteration.\n state.isLoop = true;\n state.object_ = state.value;\n state.visited_ = Object.create(null);\n }\n // Third, find the property name for this iteration.\n if (state.name_ === undefined) {\n gotPropName: while (true) {\n if (state.object_ && state.object_.isObject) {\n if (!state.props_) {\n state.props_ = Object.getOwnPropertyNames(state.object_.properties);\n }\n while (true) {\n var prop = state.props_.shift();\n if (prop === undefined) {\n break; // Reached end of this object's properties.\n }\n if (!Object.prototype.hasOwnProperty.call(state.object_.properties, prop)) {\n continue; // Property has been deleted in the loop.\n }\n if (state.visited_[prop]) {\n continue; // Already seen this property on a child.\n }\n state.visited_[prop] = true;\n if (!Object.prototype.propertyIsEnumerable.call(state.object_.properties, prop)) {\n continue; // Skip non-enumerable property.\n }\n state.name_ = prop;\n break gotPropName;\n }\n } else if (state.object_ !== null && state.object_ !== undefined) {\n // Primitive value (other than null or undefined).\n if (!state.props_) {\n state.props_ = Object.getOwnPropertyNames(state.object_);\n }\n while (true) {\n var prop = state.props_.shift();\n if (prop === undefined) {\n break; // Reached end of this value's properties.\n }\n state.visited_[prop] = true;\n if (!Object.prototype.propertyIsEnumerable.call(state.object_, prop)) {\n continue; // Skip non-enumerable property.\n }\n state.name_ = prop;\n break gotPropName;\n }\n }\n state.object_ = this.getPrototype(state.object_);\n state.props_ = null;\n if (state.object_ === null) {\n // Done, exit loop.\n stack.pop();\n return;\n }\n }\n }\n // Fourth, find the variable\n if (!state.doneVariable_) {\n state.doneVariable_ = true;\n var left = node[\"left\"];\n if (left[\"type\"] === \"VariableDeclaration\") {\n // Inline variable declaration: for (var x in y)\n state.variable_ = [Interpreter.SCOPE_REFERENCE, left[\"declarations\"][0][\"id\"][\"name\"]];\n } else {\n // Arbitrary left side: for (foo().bar in y)\n state.variable_ = null;\n var nextState = new Interpreter.State(left, state.scope);\n nextState.components = true;\n return nextState;\n }\n }\n if (!state.variable_) {\n state.variable_ = state.value;\n }\n // Fifth, set the variable.\n if (!state.doneSetter_) {\n state.doneSetter_ = true;\n var value = state.name_;\n var setter = this.setValue(state.variable_, value);\n if (setter) {\n return this.createSetter_(setter, state.variable_, value);\n }\n }\n // Next step will be step three.\n state.name_ = undefined;\n // Reevaluate the variable since it could be a setter on the global object.\n state.doneVariable_ = false;\n state.doneSetter_ = false;\n // Sixth and finally, execute the body if there was one. this.\n if (node[\"body\"]) {\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n};\n\nInterpreter.prototype[\"stepForStatement\"] = function (stack, state, node) {\n var mode = state.mode_ || 0;\n if (mode === 0) {\n state.mode_ = 1;\n if (node[\"init\"]) {\n return new Interpreter.State(node[\"init\"], state.scope);\n }\n } else if (mode === 1) {\n state.mode_ = 2;\n if (node[\"test\"]) {\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n } else if (mode === 2) {\n state.mode_ = 3;\n if (node[\"test\"] && !state.value) {\n // Done, exit loop.\n stack.pop();\n } else {\n // Execute the body.\n state.isLoop = true;\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n } else if (mode === 3) {\n state.mode_ = 1;\n if (node[\"update\"]) {\n return new Interpreter.State(node[\"update\"], state.scope);\n }\n }\n};\n\nInterpreter.prototype[\"stepFunctionDeclaration\"] = function (stack, state, node) {\n // This was found and handled when the scope was populated.\n stack.pop();\n};\n\nInterpreter.prototype[\"stepFunctionExpression\"] = function (stack, state, node) {\n stack.pop();\n stack[stack.length - 1].value = this.createFunction(node, state.scope);\n};\n\nInterpreter.prototype[\"stepIdentifier\"] = function (stack, state, node) {\n stack.pop();\n if (state.components) {\n stack[stack.length - 1].value = [Interpreter.SCOPE_REFERENCE, node[\"name\"]];\n return;\n }\n var value = this.getValueFromScope(node[\"name\"], node);\n // An identifier could be a getter if it's a property on the global object.\n if (value && typeof value === \"object\" && value.isGetter) {\n // Clear the getter flag and call the getter function.\n value.isGetter = false;\n var scope = state.scope;\n while (!this.hasProperty(scope, node[\"name\"])) {\n scope = scope.parentScope;\n }\n var func = /** @type {!Interpreter.Object} */ (value);\n return this.createGetter_(func, this.global);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepIfStatement\"] = Interpreter.prototype[\"stepConditionalExpression\"];\n\nInterpreter.prototype[\"stepLabeledStatement\"] = function (stack, state, node) {\n // No need to hit this node again on the way back up the stack.\n stack.pop();\n // Note that a statement might have multiple labels.\n var labels = state.labels || [];\n labels.push(node[\"label\"][\"name\"]);\n var nextState = new Interpreter.State(node[\"body\"], state.scope);\n nextState.labels = labels;\n return nextState;\n};\n\nInterpreter.prototype[\"stepLiteral\"] = function (stack, state, node) {\n stack.pop();\n var value = node[\"value\"];\n if (value instanceof RegExp) {\n var pseudoRegexp = this.createObjectProto(this.REGEXP_PROTO);\n this.populateRegExp(pseudoRegexp, value);\n value = pseudoRegexp;\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepLogicalExpression\"] = function (stack, state, node) {\n if (node[\"operator\"] !== \"&&\" && node[\"operator\"] !== \"||\") {\n throw SyntaxError(\"Unknown logical operator: \" + node[\"operator\"]);\n }\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n if (!state.doneRight_) {\n if ((node[\"operator\"] === \"&&\" && !state.value) || (node[\"operator\"] === \"||\" && state.value)) {\n // Shortcut evaluation.\n stack.pop();\n stack[stack.length - 1].value = state.value;\n } else {\n state.doneRight_ = true;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n } else {\n stack.pop();\n stack[stack.length - 1].value = state.value;\n }\n};\n\nInterpreter.prototype[\"stepMemberExpression\"] = function (stack, state, node) {\n if (!state.doneObject_) {\n state.doneObject_ = true;\n return new Interpreter.State(node[\"object\"], state.scope);\n }\n var propName;\n if (!node[\"computed\"]) {\n state.object_ = state.value;\n // obj.foo -- Just access 'foo' directly.\n propName = node[\"property\"][\"name\"];\n } else if (!state.doneProperty_) {\n state.object_ = state.value;\n // obj[foo] -- Compute value of 'foo'.\n state.doneProperty_ = true;\n return new Interpreter.State(node[\"property\"], state.scope);\n } else {\n propName = state.value;\n }\n stack.pop();\n if (state.components) {\n stack[stack.length - 1].value = [state.object_, propName];\n } else {\n var value = this.getProperty(state.object_, propName);\n if (value && typeof value === \"object\" && value.isGetter) {\n // Clear the getter flag and call the getter function.\n value.isGetter = false;\n var func = /** @type {!Interpreter.Object} */ (value);\n return this.createGetter_(func, state.object_);\n }\n stack[stack.length - 1].value = value;\n }\n};\n\nInterpreter.prototype[\"stepNewExpression\"] = Interpreter.prototype[\"stepCallExpression\"];\n\nInterpreter.prototype[\"stepObjectExpression\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var property = node[\"properties\"][n];\n if (!state.object_) {\n // First execution.\n state.object_ = this.createObjectProto(this.OBJECT_PROTO);\n state.properties_ = Object.create(null);\n } else {\n // Determine property name.\n var key = property[\"key\"];\n if (key[\"type\"] === \"Identifier\") {\n var propName = key[\"name\"];\n } else if (key[\"type\"] === \"Literal\") {\n var propName = key[\"value\"];\n } else {\n throw SyntaxError(\"Unknown object structure: \" + key[\"type\"]);\n }\n // Set the property computed in the previous execution.\n if (!state.properties_[propName]) {\n // Create temp object to collect value, getter, and/or setter.\n state.properties_[propName] = {};\n }\n state.properties_[propName][property[\"kind\"]] = state.value;\n state.n_ = ++n;\n property = node[\"properties\"][n];\n }\n if (property) {\n return new Interpreter.State(property[\"value\"], state.scope);\n }\n for (var key in state.properties_) {\n var kinds = state.properties_[key];\n if (\"get\" in kinds || \"set\" in kinds) {\n // Set a property with a getter or setter.\n var descriptor = {\n configurable: true,\n enumerable: true,\n get: kinds[\"get\"],\n set: kinds[\"set\"],\n };\n this.setProperty(state.object_, key, null, descriptor);\n } else {\n // Set a normal property with a value.\n this.setProperty(state.object_, key, kinds[\"init\"]);\n }\n }\n stack.pop();\n stack[stack.length - 1].value = state.object_;\n};\n\nInterpreter.prototype[\"stepProgram\"] = function (stack, state, node) {\n var expression = node[\"body\"].shift();\n if (expression) {\n state.done = false;\n return new Interpreter.State(expression, state.scope);\n }\n state.done = true;\n // Don't pop the stateStack.\n // Leave the root scope on the tree in case the program is appended to.\n};\n\nInterpreter.prototype[\"stepReturnStatement\"] = function (stack, state, node) {\n if (node[\"argument\"] && !state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"argument\"], state.scope);\n }\n this.unwind(Interpreter.Completion.RETURN, state.value, undefined);\n};\n\nInterpreter.prototype[\"stepSequenceExpression\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"expressions\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n stack[stack.length - 1].value = state.value;\n};\n\nInterpreter.prototype[\"stepSwitchStatement\"] = function (stack, state, node) {\n if (!state.test_) {\n state.test_ = 1;\n return new Interpreter.State(node[\"discriminant\"], state.scope);\n }\n if (state.test_ === 1) {\n state.test_ = 2;\n // Preserve switch value between case tests.\n state.switchValue_ = state.value;\n state.defaultCase_ = -1;\n }\n\n while (true) {\n var index = state.index_ || 0;\n var switchCase = node[\"cases\"][index];\n if (!state.matched_ && switchCase && !switchCase[\"test\"]) {\n // Test on the default case is null.\n // Bypass (but store) the default case, and get back to it later.\n state.defaultCase_ = index;\n state.index_ = index + 1;\n continue;\n }\n if (!switchCase && !state.matched_ && state.defaultCase_ !== -1) {\n // Ran through all cases, no match. Jump to the default.\n state.matched_ = true;\n state.index_ = state.defaultCase_;\n continue;\n }\n if (switchCase) {\n if (!state.matched_ && !state.tested_ && switchCase[\"test\"]) {\n state.tested_ = true;\n return new Interpreter.State(switchCase[\"test\"], state.scope);\n }\n if (state.matched_ || state.value === state.switchValue_) {\n state.matched_ = true;\n var n = state.n_ || 0;\n if (switchCase[\"consequent\"][n]) {\n state.isSwitch = true;\n state.n_ = n + 1;\n return new Interpreter.State(switchCase[\"consequent\"][n], state.scope);\n }\n }\n // Move on to next case.\n state.tested_ = false;\n state.n_ = 0;\n state.index_ = index + 1;\n } else {\n stack.pop();\n return;\n }\n }\n};\n\nInterpreter.prototype[\"stepThisExpression\"] = function (stack, state, node) {\n stack.pop();\n stack[stack.length - 1].value = this.getValueFromScope(\"this\", node);\n};\n\nInterpreter.prototype[\"stepThrowStatement\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"argument\"], state.scope);\n } else {\n this.throwException(state.value);\n }\n};\n\nInterpreter.prototype[\"stepTryStatement\"] = function (stack, state, node) {\n if (!state.doneBlock_) {\n state.doneBlock_ = true;\n return new Interpreter.State(node[\"block\"], state.scope);\n }\n if (state.cv && state.cv.type === Interpreter.Completion.THROW && !state.doneHandler_ && node[\"handler\"]) {\n state.doneHandler_ = true;\n var nextState = new Interpreter.State(node[\"handler\"], state.scope);\n nextState.throwValue = state.cv.value;\n state.cv = undefined; // This error has been handled, don't rethrow.\n return nextState;\n }\n if (!state.doneFinalizer_ && node[\"finalizer\"]) {\n state.doneFinalizer_ = true;\n return new Interpreter.State(node[\"finalizer\"], state.scope);\n }\n stack.pop();\n if (state.cv) {\n // There was no catch handler, or the catch/finally threw an error.\n // Throw the error up to a higher try.\n this.unwind(state.cv.type, state.cv.value, state.cv.label);\n }\n};\n\nInterpreter.prototype[\"stepUnaryExpression\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n var nextState = new Interpreter.State(node[\"argument\"], state.scope);\n nextState.components = node[\"operator\"] === \"delete\";\n return nextState;\n }\n stack.pop();\n var value = state.value;\n if (node[\"operator\"] === \"-\") {\n value = -value;\n } else if (node[\"operator\"] === \"+\") {\n value = +value;\n } else if (node[\"operator\"] === \"!\") {\n value = !value;\n } else if (node[\"operator\"] === \"~\") {\n value = ~value;\n } else if (node[\"operator\"] === \"delete\") {\n var result = true;\n // If value is not an array, then it is a primitive, or some other value.\n // If so, skip the delete and return true.\n if (Array.isArray(value)) {\n var obj = value[0];\n if (obj === Interpreter.SCOPE_REFERENCE) {\n // 'delete foo;' is the same as 'delete window.foo'.\n obj = state.scope;\n }\n var name = String(value[1]);\n try {\n delete obj.properties[name];\n } catch (e) {\n if (state.scope.strict) {\n this.throwException(this.TYPE_ERROR, \"Cannot delete property '\" + name + \"' of '\" + obj + \"'\");\n } else {\n result = false;\n }\n }\n }\n value = result;\n } else if (node[\"operator\"] === \"typeof\") {\n value = value && value.class === \"Function\" ? \"function\" : typeof value;\n } else if (node[\"operator\"] === \"void\") {\n value = undefined;\n } else {\n throw SyntaxError(\"Unknown unary operator: \" + node[\"operator\"]);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepUpdateExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n var nextState = new Interpreter.State(node[\"argument\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (!state.leftSide_) {\n state.leftSide_ = state.value;\n }\n if (state.doneGetter_) {\n state.leftValue_ = state.value;\n }\n if (!state.doneGetter_) {\n var leftValue = this.getValue(state.leftSide_, node);\n state.leftValue_ = leftValue;\n if (leftValue && typeof leftValue === \"object\" && leftValue.isGetter) {\n // Clear the getter flag and call the getter function.\n leftValue.isGetter = false;\n state.doneGetter_ = true;\n var func = /** @type {!Interpreter.Object} */ (leftValue);\n return this.createGetter_(func, state.leftSide_);\n }\n }\n if (state.doneSetter_) {\n // Return if setter function.\n // Setter method on property has completed.\n // Ignore its return value, and use the original set value instead.\n stack.pop();\n stack[stack.length - 1].value = state.setterValue_;\n return;\n }\n var leftValue = Number(state.leftValue_);\n var changeValue;\n if (node[\"operator\"] === \"++\") {\n changeValue = leftValue + 1;\n } else if (node[\"operator\"] === \"--\") {\n changeValue = leftValue - 1;\n } else {\n throw SyntaxError(\"Unknown update expression: \" + node[\"operator\"]);\n }\n var returnValue = node[\"prefix\"] ? changeValue : leftValue;\n var setter = this.setValue(state.leftSide_, changeValue);\n if (setter) {\n state.doneSetter_ = true;\n state.setterValue_ = returnValue;\n return this.createSetter_(setter, state.leftSide_, changeValue);\n }\n // Return if no setter function.\n stack.pop();\n stack[stack.length - 1].value = returnValue;\n};\n\nInterpreter.prototype[\"stepVariableDeclaration\"] = function (stack, state, node) {\n var declarations = node[\"declarations\"];\n var n = state.n_ || 0;\n var declarationNode = declarations[n];\n if (state.init_ && declarationNode) {\n // This setValue call never needs to deal with calling a setter function.\n // Note that this is setting the init value, not defining the variable.\n // Variable definition is done when scope is populated.\n this.setValueToScope(declarationNode[\"id\"][\"name\"], state.value);\n state.init_ = false;\n declarationNode = declarations[++n];\n }\n while (declarationNode) {\n // Skip any declarations that are not initialized. They have already\n // been defined as undefined in populateScope_.\n if (declarationNode[\"init\"]) {\n state.n_ = n;\n state.init_ = true;\n return new Interpreter.State(declarationNode[\"init\"], state.scope);\n }\n declarationNode = declarations[++n];\n }\n stack.pop();\n};\n\nInterpreter.prototype[\"stepWithStatement\"] = function (stack, state, node) {\n if (!state.doneObject_) {\n state.doneObject_ = true;\n return new Interpreter.State(node[\"object\"], state.scope);\n } else if (!state.doneBody_) {\n state.doneBody_ = true;\n var scope = this.createSpecialScope(state.scope, state.value);\n return new Interpreter.State(node[\"body\"], scope);\n } else {\n stack.pop();\n }\n};\n\nInterpreter.prototype[\"stepWhileStatement\"] = Interpreter.prototype[\"stepDoWhileStatement\"];\n\n// Preserve top-level API functions from being pruned/renamed by JS compilers.\n// Add others as needed.\n// The global object ('window' in a browser, 'global' in node.js) is 'this'.\n//this['Interpreter'] = Interpreter;\nInterpreter.prototype[\"step\"] = Interpreter.prototype.step;\nInterpreter.prototype[\"run\"] = Interpreter.prototype.run;\nInterpreter.prototype[\"appendCode\"] = Interpreter.prototype.appendCode;\nInterpreter.prototype[\"createObject\"] = Interpreter.prototype.createObject;\nInterpreter.prototype[\"createObjectProto\"] = Interpreter.prototype.createObjectProto;\nInterpreter.prototype[\"createAsyncFunction\"] = Interpreter.prototype.createAsyncFunction;\nInterpreter.prototype[\"createNativeFunction\"] = Interpreter.prototype.createNativeFunction;\nInterpreter.prototype[\"getProperty\"] = Interpreter.prototype.getProperty;\nInterpreter.prototype[\"setProperty\"] = Interpreter.prototype.setProperty;\nInterpreter.prototype[\"nativeToPseudo\"] = Interpreter.prototype.nativeToPseudo;\nInterpreter.prototype[\"pseudoToNative\"] = Interpreter.prototype.pseudoToNative;\n// Obsolete. Do not use.\nInterpreter.prototype[\"createPrimitive\"] = function (x) {\n return x;\n};\n\nexport { Interpreter };\n","import $ from \"jquery\";\nimport { vsprintf, sprintf } from \"sprintf-js\";\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\nimport { BitNodeMultipliers, IBitNodeMultipliers } from \"./BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"./Constants\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"./Hacking\";\nimport { netscriptCanGrow, netscriptCanWeaken } from \"./Hacking/netscriptCanHack\";\nimport { Terminal } from \"./Terminal\";\nimport { Player } from \"@player\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Script } from \"./Script/Script\";\nimport { isScriptFilename } from \"./Script/isScriptFilename\";\nimport { PromptEvent } from \"./ui/React/PromptManager\";\nimport { GetServer, DeleteServer, AddToAllServers, createUniqueRandomIp } from \"./Server/AllServers\";\nimport {\n getServerOnNetwork,\n numCycleForGrowth,\n numCycleForGrowthCorrected,\n processSingleServerGrowth,\n safelyCreateUniqueServer,\n} from \"./Server/ServerHelpers\";\nimport {\n getPurchasedServerUpgradeCost,\n getPurchaseServerCost,\n getPurchaseServerLimit,\n getPurchaseServerMaxRam,\n renamePurchasedServer,\n upgradePurchasedServer,\n} from \"./Server/ServerPurchases\";\nimport { Server } from \"./Server/Server\";\nimport { influenceStockThroughServerGrow } from \"./StockMarket/PlayerInfluencing\";\nimport { isValidFilePath, removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { TextFile, getTextFile, createTextFile } from \"./TextFile\";\nimport { runScriptFromScript } from \"./NetscriptWorker\";\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { helpers, assertObjectType } from \"./Netscript/NetscriptHelpers\";\nimport { numeralWrapper } from \"./ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\nimport { LogBoxEvents, LogBoxCloserEvents, LogBoxPositionEvents, LogBoxSizeEvents } from \"./ui/React/LogBoxManager\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { isString } from \"./utils/helpers/isString\";\nimport { NetscriptGang } from \"./NetscriptFunctions/Gang\";\nimport { NetscriptSleeve } from \"./NetscriptFunctions/Sleeve\";\nimport { NetscriptExtra } from \"./NetscriptFunctions/Extra\";\nimport { NetscriptHacknet } from \"./NetscriptFunctions/Hacknet\";\nimport { NetscriptStanek } from \"./NetscriptFunctions/Stanek\";\nimport { NetscriptInfiltration } from \"./NetscriptFunctions/Infiltration\";\nimport { NetscriptUserInterface } from \"./NetscriptFunctions/UserInterface\";\nimport { NetscriptBladeburner } from \"./NetscriptFunctions/Bladeburner\";\nimport { NetscriptCodingContract } from \"./NetscriptFunctions/CodingContract\";\nimport { NetscriptCorporation } from \"./NetscriptFunctions/Corporation\";\nimport { NetscriptFormulas } from \"./NetscriptFunctions/Formulas\";\nimport { NetscriptStockMarket } from \"./NetscriptFunctions/StockMarket\";\nimport { NetscriptGrafting } from \"./NetscriptFunctions/Grafting\";\nimport { NS, RecentScript as IRecentScript, BasicHGWOptions, ProcessInfo } from \"./ScriptEditor/NetscriptDefinitions\";\nimport { NetscriptSingularity } from \"./NetscriptFunctions/Singularity\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\nimport { checkEnum } from \"./utils/helpers/checkEnum\";\n\nimport { Flags } from \"./NetscriptFunctions/Flags\";\nimport { calculateIntelligenceBonus } from \"./PersonObjects/formulas/intelligence\";\nimport { CalculateShareMult, StartSharing } from \"./NetworkShare/Share\";\nimport { recentScripts } from \"./Netscript/RecentScripts\";\nimport { InternalAPI, wrapAPI } from \"./Netscript/APIWrapper\";\nimport { INetscriptExtra } from \"./NetscriptFunctions/Extra\";\nimport { ScriptDeath } from \"./Netscript/ScriptDeath\";\nimport { getBitNodeMultipliers } from \"./BitNode/BitNode\";\n\n// \"Enums\" as object\nexport const enums = {\n toast: ToastVariant,\n} as const;\nexport type NSFull = Readonly<NS & INetscriptExtra>;\n\nexport function NetscriptFunctions(workerScript: WorkerScript): NSFull {\n return wrapAPI(workerScript, ns, workerScript.args.slice());\n}\n\nconst base: InternalAPI<NS> = {\n args: [],\n //The next line will error if enums does not match the definition in NetscriptDefinitions.d.ts\n enums,\n singularity: NetscriptSingularity(),\n gang: NetscriptGang(),\n bladeburner: NetscriptBladeburner(),\n codingcontract: NetscriptCodingContract(),\n sleeve: NetscriptSleeve(),\n corporation: NetscriptCorporation(),\n stanek: NetscriptStanek(),\n infiltration: NetscriptInfiltration(),\n ui: NetscriptUserInterface(),\n formulas: NetscriptFormulas(),\n stock: NetscriptStockMarket(),\n grafting: NetscriptGrafting(),\n hacknet: NetscriptHacknet(),\n sprintf: () => sprintf,\n vsprintf: () => vsprintf,\n scan: (ctx) => (_hostname) => {\n const hostname = _hostname ? helpers.string(ctx, \"hostname\", _hostname) : ctx.workerScript.hostname;\n const server = helpers.getServer(ctx, hostname);\n const out: string[] = [];\n for (let i = 0; i < server.serversOnNetwork.length; i++) {\n const s = getServerOnNetwork(server, i);\n if (s === null) continue;\n const entry = s.hostname;\n if (entry === null) continue;\n out.push(entry);\n }\n helpers.log(ctx, () => `returned ${server.serversOnNetwork.length} connections for ${server.hostname}`);\n return out;\n },\n hack:\n (ctx) =>\n (_hostname, opts = {}) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const optsValidator: BasicHGWOptions = {};\n assertObjectType(ctx, \"opts\", opts, optsValidator);\n return helpers.hack(ctx, hostname, false, { threads: opts.threads, stock: opts.stock });\n },\n hackAnalyzeThreads: (ctx) => (_hostname, _hackAmount) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const hackAmount = helpers.number(ctx, \"hackAmount\", _hackAmount);\n\n // Check argument validity\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return -1;\n }\n if (isNaN(hackAmount)) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Invalid hackAmount argument passed into hackAnalyzeThreads: ${hackAmount}. Must be numeric.`,\n );\n }\n\n if (hackAmount < 0 || hackAmount > server.moneyAvailable) {\n return -1;\n } else if (hackAmount === 0) {\n return 0;\n }\n\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n\n if (percentHacked === 0 || server.moneyAvailable === 0) {\n return 0; // To prevent returning infinity below\n }\n\n return hackAmount / Math.floor(server.moneyAvailable * percentHacked);\n },\n hackAnalyze: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n return calculatePercentMoneyHacked(server, Player);\n },\n hackAnalyzeSecurity: (ctx) => (_threads, _hostname?) => {\n let threads = helpers.number(ctx, \"threads\", _threads);\n if (_hostname) {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n\n if (percentHacked > 0) {\n // thread count is limited to the maximum number of threads needed\n threads = Math.min(threads, Math.ceil(1 / percentHacked));\n }\n }\n\n return CONSTANTS.ServerFortifyAmount * threads;\n },\n hackAnalyzeChance: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n return calculateHackingChance(server, Player);\n },\n sleep:\n (ctx) =>\n (_time = 0) => {\n const time = helpers.number(ctx, \"time\", _time);\n if (time === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n helpers.log(ctx, () => `Sleeping for ${time} milliseconds`);\n return helpers.netscriptDelay(ctx, time).then(function () {\n return Promise.resolve(true);\n });\n },\n asleep:\n (ctx) =>\n (_time = 0) => {\n const time = helpers.number(ctx, \"time\", _time);\n helpers.log(ctx, () => `Sleeping for ${time} milliseconds`);\n return new Promise((resolve) => setTimeout(() => resolve(true), time));\n },\n grow:\n (ctx) =>\n (_hostname, opts = {}) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const optsValidator: BasicHGWOptions = {};\n assertObjectType(ctx, \"opts\", opts, optsValidator);\n const requestedThreads =\n opts.threads === undefined\n ? ctx.workerScript.scriptRef.threads\n : helpers.number(ctx, \"opts.threads\", opts.threads);\n const threads = helpers.resolveNetscriptRequestedThreads(ctx, requestedThreads);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return Promise.resolve(0);\n }\n\n const host = GetServer(ctx.workerScript.hostname);\n if (host === null) {\n throw new Error(\"Workerscript host is null\");\n }\n\n // No root access or skill level too low\n const canHack = netscriptCanGrow(server);\n if (!canHack.res) {\n throw helpers.makeRuntimeErrorMsg(ctx, canHack.msg || \"\");\n }\n\n const growTime = calculateGrowTime(server, Player);\n helpers.log(\n ctx,\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n growTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)}).`,\n );\n return helpers.netscriptDelay(ctx, growTime * 1000).then(function () {\n const moneyBefore = server.moneyAvailable <= 0 ? 1 : server.moneyAvailable;\n processSingleServerGrowth(server, threads, host.cpuCores);\n const moneyAfter = server.moneyAvailable;\n ctx.workerScript.scriptRef.recordGrow(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n const logGrowPercent = moneyAfter / moneyBefore - 1;\n helpers.log(\n ctx,\n () =>\n `Available money on '${server.hostname}' grown by ${numeralWrapper.formatPercentage(\n logGrowPercent,\n 6,\n )}. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)}).`,\n );\n ctx.workerScript.scriptRef.onlineExpGained += expGain;\n Player.gainHackingExp(expGain);\n if (opts.stock) {\n influenceStockThroughServerGrow(server, moneyAfter - moneyBefore);\n }\n return Promise.resolve(moneyAfter / moneyBefore);\n });\n },\n growthAnalyze:\n (ctx) =>\n (_hostname, _growth, _cores = 1) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const growth = helpers.number(ctx, \"growth\", _growth);\n const cores = helpers.number(ctx, \"cores\", _cores);\n\n // Check argument validity\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (typeof growth !== \"number\" || isNaN(growth) || growth < 1 || !isFinite(growth)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: growth must be numeric and >= 1, is ${growth}.`);\n }\n\n return numCycleForGrowth(server, Number(growth), cores);\n },\n growthAnalyzeSecurity:\n (ctx) =>\n (_threads, _hostname?, _cores = 1) => {\n let threads = helpers.number(ctx, \"threads\", _threads);\n if (_hostname) {\n const cores = helpers.number(ctx, \"cores\", _cores);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n const maxThreadsNeeded = Math.ceil(\n numCycleForGrowthCorrected(server, server.moneyMax, server.moneyAvailable, cores),\n );\n\n threads = Math.min(threads, maxThreadsNeeded);\n }\n\n return 2 * CONSTANTS.ServerFortifyAmount * threads;\n },\n weaken:\n (ctx) =>\n async (_hostname, opts = {}) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const optsValidator: BasicHGWOptions = {};\n assertObjectType(ctx, \"opts\", opts, optsValidator);\n const requestedThreads =\n opts.threads === undefined\n ? ctx.workerScript.scriptRef.threads\n : helpers.number(ctx, \"opts.threads\", opts.threads);\n const threads = helpers.resolveNetscriptRequestedThreads(ctx, requestedThreads);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return Promise.resolve(0);\n }\n\n // No root access or skill level too low\n const canHack = netscriptCanWeaken(server);\n if (!canHack.res) {\n throw helpers.makeRuntimeErrorMsg(ctx, canHack.msg || \"\");\n }\n\n const weakenTime = calculateWeakenTime(server, Player);\n helpers.log(\n ctx,\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n weakenTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n return helpers.netscriptDelay(ctx, weakenTime * 1000).then(function () {\n const host = GetServer(ctx.workerScript.hostname);\n if (host === null) {\n helpers.log(ctx, () => \"Server is null, did it die?\");\n return Promise.resolve(0);\n }\n const coreBonus = 1 + (host.cpuCores - 1) / 16;\n server.weaken(CONSTANTS.ServerWeakenAmount * threads * coreBonus);\n ctx.workerScript.scriptRef.recordWeaken(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n helpers.log(\n ctx,\n () =>\n `'${server.hostname}' security level weakened to ${\n server.hackDifficulty\n }. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n ctx.workerScript.scriptRef.onlineExpGained += expGain;\n Player.gainHackingExp(expGain);\n return Promise.resolve(CONSTANTS.ServerWeakenAmount * threads * coreBonus);\n });\n },\n weakenAnalyze:\n (ctx) =>\n (_threads, _cores = 1) => {\n const threads = helpers.number(ctx, \"threads\", _threads);\n const cores = helpers.number(ctx, \"cores\", _cores);\n const coreBonus = 1 + (cores - 1) / 16;\n return CONSTANTS.ServerWeakenAmount * threads * coreBonus * BitNodeMultipliers.ServerWeakenRate;\n },\n share: (ctx) => () => {\n helpers.log(ctx, () => \"Sharing this computer.\");\n const end = StartSharing(\n ctx.workerScript.scriptRef.threads * calculateIntelligenceBonus(Player.skills.intelligence, 2),\n );\n return helpers.netscriptDelay(ctx, 10000).finally(function () {\n helpers.log(ctx, () => \"Finished sharing this computer.\");\n end();\n });\n },\n getSharePower: () => () => {\n return CalculateShareMult();\n },\n print:\n (ctx) =>\n (...args) => {\n if (args.length === 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes at least 1 argument.\");\n }\n ctx.workerScript.print(helpers.argsToString(args));\n },\n printf:\n (ctx) =>\n (_format, ...args) => {\n const format = helpers.string(ctx, \"format\", _format);\n if (typeof format !== \"string\") {\n throw helpers.makeRuntimeErrorMsg(ctx, \"First argument must be string for the format.\");\n }\n ctx.workerScript.print(vsprintf(format, args));\n },\n tprint:\n (ctx) =>\n (...args) => {\n if (args.length === 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes at least 1 argument.\");\n }\n const str = helpers.argsToString(args);\n if (str.startsWith(\"ERROR\") || str.startsWith(\"FAIL\")) {\n Terminal.error(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"SUCCESS\")) {\n Terminal.success(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"WARN\")) {\n Terminal.warn(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"INFO\")) {\n Terminal.info(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n Terminal.print(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n },\n tprintf:\n (ctx) =>\n (_format, ...args) => {\n const format = helpers.string(ctx, \"format\", _format);\n const str = vsprintf(format, args);\n\n if (str.startsWith(\"ERROR\") || str.startsWith(\"FAIL\")) {\n Terminal.error(`${str}`);\n return;\n }\n if (str.startsWith(\"SUCCESS\")) {\n Terminal.success(`${str}`);\n return;\n }\n if (str.startsWith(\"WARN\")) {\n Terminal.warn(`${str}`);\n return;\n }\n if (str.startsWith(\"INFO\")) {\n Terminal.info(`${str}`);\n return;\n }\n Terminal.print(`${str}`);\n },\n clearLog: (ctx) => () => {\n ctx.workerScript.scriptRef.clearLog();\n },\n disableLog: (ctx) => (_fn) => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n if (fn === \"ALL\") {\n for (const fn of Object.keys(possibleLogs)) {\n ctx.workerScript.disableLogs[fn] = true;\n }\n helpers.log(ctx, () => `Disabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${fn}.`);\n } else {\n ctx.workerScript.disableLogs[fn] = true;\n helpers.log(ctx, () => `Disabled logging for ${fn}`);\n }\n },\n enableLog: (ctx) => (_fn) => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n if (fn === \"ALL\") {\n for (const fn of Object.keys(possibleLogs)) {\n delete ctx.workerScript.disableLogs[fn];\n }\n helpers.log(ctx, () => `Enabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${fn}.`);\n }\n delete ctx.workerScript.disableLogs[fn];\n helpers.log(ctx, () => `Enabled logging for ${fn}`);\n },\n isLogEnabled: (ctx) => (_fn) => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n if (possibleLogs[fn] === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${fn}.`);\n }\n return !ctx.workerScript.disableLogs[fn];\n },\n getScriptLogs:\n (ctx) =>\n (scriptID, hostname, ...scriptArgs) => {\n const ident = helpers.scriptIdentifier(ctx, scriptID, hostname, scriptArgs);\n const runningScriptObj = helpers.getRunningScript(ctx, ident);\n if (runningScriptObj == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return [] as string[];\n }\n\n return runningScriptObj.logs.slice();\n },\n tail:\n (ctx) =>\n (scriptID, hostname, ...scriptArgs) => {\n const ident = helpers.scriptIdentifier(ctx, scriptID, hostname, scriptArgs);\n const runningScriptObj = helpers.getRunningScript(ctx, ident);\n if (runningScriptObj == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return;\n }\n\n LogBoxEvents.emit(runningScriptObj);\n },\n moveTail:\n (ctx) =>\n (_x, _y, _pid = ctx.workerScript.scriptRef.pid) => {\n const x = helpers.number(ctx, \"x\", _x);\n const y = helpers.number(ctx, \"y\", _y);\n const pid = helpers.number(ctx, \"pid\", _pid);\n LogBoxPositionEvents.emit({ pid, data: { x, y } });\n },\n resizeTail:\n (ctx) =>\n (_w, _h, _pid = ctx.workerScript.scriptRef.pid) => {\n const w = helpers.number(ctx, \"w\", _w);\n const h = helpers.number(ctx, \"h\", _h);\n const pid = helpers.number(ctx, \"pid\", _pid);\n LogBoxSizeEvents.emit({ pid, data: { w, h } });\n },\n closeTail:\n (ctx) =>\n (_pid = ctx.workerScript.scriptRef.pid) => {\n const pid = helpers.number(ctx, \"pid\", _pid);\n //Emit an event to tell the game to close the tail window if it exists\n LogBoxCloserEvents.emit(pid);\n },\n nuke: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (server.hasAdminRights) {\n helpers.log(ctx, () => `Already have root access to '${server.hostname}'.`);\n return true;\n }\n if (!Player.hasProgram(Programs.NukeProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the NUKE.exe virus!\");\n }\n if (server.openPortCount < server.numOpenPortsRequired) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Not enough ports opened to use NUKE.exe virus.\");\n }\n server.hasAdminRights = true;\n helpers.log(ctx, () => `Executed NUKE.exe virus on '${server.hostname}' to gain root access.`);\n return true;\n },\n brutessh: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.BruteSSHProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the BruteSSH.exe program!\");\n }\n if (!server.sshPortOpen) {\n helpers.log(ctx, () => `Executed BruteSSH.exe on '${server.hostname}' to open SSH port (22).`);\n server.sshPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `SSH Port (22) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n ftpcrack: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.FTPCrackProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the FTPCrack.exe program!\");\n }\n if (!server.ftpPortOpen) {\n helpers.log(ctx, () => `Executed FTPCrack.exe on '${server.hostname}' to open FTP port (21).`);\n server.ftpPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `FTP Port (21) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n relaysmtp: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.RelaySMTPProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the relaySMTP.exe program!\");\n }\n if (!server.smtpPortOpen) {\n helpers.log(ctx, () => `Executed relaySMTP.exe on '${server.hostname}' to open SMTP port (25).`);\n server.smtpPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `SMTP Port (25) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n httpworm: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.HTTPWormProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the HTTPWorm.exe program!\");\n }\n if (!server.httpPortOpen) {\n helpers.log(ctx, () => `Executed HTTPWorm.exe on '${server.hostname}' to open HTTP port (80).`);\n server.httpPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `HTTP Port (80) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n sqlinject: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.SQLInjectProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the SQLInject.exe program!\");\n }\n if (!server.sqlPortOpen) {\n helpers.log(ctx, () => `Executed SQLInject.exe on '${server.hostname}' to open SQL port (1433).`);\n server.sqlPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `SQL Port (1433) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n run:\n (ctx) =>\n (_scriptname, _threads = 1, ..._args) => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const args = helpers.scriptArgs(ctx, _args);\n if (scriptname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: run(scriptname, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(ctx.workerScript.hostname);\n if (scriptServer == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Could not find server. This is a bug. Report to dev.\");\n }\n\n return runScriptFromScript(\"run\", scriptServer, scriptname, args, ctx.workerScript, threads);\n },\n exec:\n (ctx) =>\n (_scriptname, _hostname, _threads = 1, ..._args) => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const args = helpers.scriptArgs(ctx, _args);\n if (scriptname === undefined || hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const server = helpers.getServer(ctx, hostname);\n return runScriptFromScript(\"exec\", server, scriptname, args, ctx.workerScript, threads);\n },\n spawn:\n (ctx) =>\n (_scriptname, _threads = 1, ..._args) => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const args = helpers.scriptArgs(ctx, _args);\n if (!scriptname || !threads) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: spawn(scriptname, threads)\");\n }\n\n const spawnDelay = 10;\n setTimeout(() => {\n if (isNaN(threads) || threads <= 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(ctx.workerScript.hostname);\n if (scriptServer == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Could not find server. This is a bug. Report to dev\");\n }\n\n return runScriptFromScript(\"spawn\", scriptServer, scriptname, args, ctx.workerScript, threads);\n }, spawnDelay * 1e3);\n\n helpers.log(ctx, () => `Will execute '${scriptname}' in ${spawnDelay} seconds`);\n\n if (killWorkerScript(ctx.workerScript)) {\n helpers.log(ctx, () => \"Exiting...\");\n }\n },\n kill:\n (ctx) =>\n (scriptID, hostname?, ...scriptArgs) => {\n const ident = helpers.scriptIdentifier(ctx, scriptID, hostname, scriptArgs);\n let res;\n const killByPid = typeof ident === \"number\";\n if (killByPid) {\n // Kill by pid\n res = killWorkerScript(ident);\n } else {\n // Kill by filename/hostname\n if (scriptID === undefined || hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: kill(scriptname, server, [arg1], [arg2]...)\");\n }\n\n const server = helpers.getServer(ctx, ident.hostname);\n const runningScriptObj = helpers.getRunningScriptByArgs(ctx, ident.scriptname, ident.hostname, ident.args);\n if (runningScriptObj == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return false;\n }\n\n res = killWorkerScript({ runningScript: runningScriptObj, hostname: server.hostname });\n }\n\n if (res) {\n if (killByPid) {\n helpers.log(ctx, () => `Killing script with PID ${ident}`);\n } else {\n helpers.log(ctx, () => `Killing '${scriptID}' on '${hostname}' with args: ${arrayToString(scriptArgs)}.`);\n }\n return true;\n } else {\n if (killByPid) {\n helpers.log(ctx, () => `No script with PID ${ident}`);\n } else {\n helpers.log(\n ctx,\n () => `No such script '${scriptID}' on '${hostname}' with args: ${arrayToString(scriptArgs)}`,\n );\n }\n return false;\n }\n },\n killall:\n (ctx) =>\n (_hostname = ctx.workerScript.hostname, _safetyguard = true) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const safetyguard = !!_safetyguard;\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: killall(hostname, [safetyguard boolean])\");\n }\n const server = helpers.getServer(ctx, hostname);\n\n let scriptsKilled = 0;\n\n for (let i = server.runningScripts.length - 1; i >= 0; --i) {\n if (safetyguard === true && server.runningScripts[i].pid == ctx.workerScript.pid) continue;\n killWorkerScript({ runningScript: server.runningScripts[i], hostname: server.hostname });\n ++scriptsKilled;\n }\n WorkerScriptStartStopEventEmitter.emit();\n helpers.log(\n ctx,\n () => `Killing all scripts on '${server.hostname}'. May take a few minutes for the scripts to die.`,\n );\n\n return scriptsKilled > 0;\n },\n exit: (ctx) => () => {\n helpers.log(ctx, () => \"Exiting...\");\n killWorkerScript(ctx.workerScript);\n throw new ScriptDeath(ctx.workerScript);\n },\n scp:\n (ctx) =>\n (_files, _destination, _source = ctx.workerScript.hostname) => {\n const destination = helpers.string(ctx, \"destination\", _destination);\n const source = helpers.string(ctx, \"source\", _source);\n const destServer = helpers.getServer(ctx, destination);\n const sourceServ = helpers.getServer(ctx, source);\n const files = Array.isArray(_files) ? _files : [_files];\n\n //First loop through filenames to find all errors before moving anything.\n for (const file of files) {\n // Not a string\n if (typeof file !== \"string\")\n throw helpers.makeRuntimeErrorMsg(ctx, \"files should be a string or an array of strings.\");\n\n // Invalid file name\n if (!isValidFilePath(file)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: '${file}'`);\n\n // Invalid file type\n if (!file.endsWith(\".lit\") && !isScriptFilename(file) && !file.endsWith(\"txt\")) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Only works for scripts, .lit and .txt files.\");\n }\n }\n\n let noFailures = true;\n //ts detects files as any[] here even though we would have thrown in the above loop if it wasn't string[]\n for (const file of files as string[]) {\n // Scp for lit files\n if (file.endsWith(\".lit\")) {\n const sourceMessage = sourceServ.messages.find((message) => message === file);\n if (!sourceMessage) {\n helpers.log(ctx, () => `File '${file}' does not exist.`);\n noFailures = false;\n continue;\n }\n\n const destMessage = destServer.messages.find((message) => message === file);\n if (destMessage) {\n helpers.log(ctx, () => `File '${file}' was already on '${destServer?.hostname}'.`);\n continue;\n }\n\n destServer.messages.push(file);\n helpers.log(ctx, () => `File '${file}' copied over to '${destServer?.hostname}'.`);\n continue;\n }\n\n // Scp for text files\n if (file.endsWith(\".txt\")) {\n const sourceTextFile = sourceServ.textFiles.find((textFile) => textFile.fn === file);\n if (!sourceTextFile) {\n helpers.log(ctx, () => `File '${file}' does not exist.`);\n noFailures = false;\n continue;\n }\n\n const destTextFile = destServer.textFiles.find((textFile) => textFile.fn === file);\n if (destTextFile) {\n destTextFile.text = sourceTextFile.text;\n helpers.log(ctx, () => `File '${file}' overwritten on '${destServer?.hostname}'.`);\n continue;\n }\n\n const newFile = new TextFile(sourceTextFile.fn, sourceTextFile.text);\n destServer.textFiles.push(newFile);\n helpers.log(ctx, () => `File '${file}' copied over to '${destServer?.hostname}'.`);\n continue;\n }\n\n // Scp for script files\n const sourceScript = sourceServ.scripts.find((script) => script.filename === file);\n if (!sourceScript) {\n helpers.log(ctx, () => `File '${file}' does not exist.`);\n noFailures = false;\n continue;\n }\n\n // Overwrite script if it already exists\n const destScript = destServer.scripts.find((script) => script.filename === file);\n if (destScript) {\n if (destScript.code === sourceScript.code) {\n helpers.log(ctx, () => `Identical file '${file}' was already on '${destServer?.hostname}'`);\n continue;\n }\n destScript.code = sourceScript.code;\n destScript.ramUsage = destScript.ramUsage;\n destScript.markUpdated();\n helpers.log(ctx, () => `WARNING: File '${file}' overwritten on '${destServer?.hostname}'`);\n continue;\n }\n\n // Create new script if it does not already exist\n const newScript = new Script(file);\n newScript.code = sourceScript.code;\n newScript.ramUsage = sourceScript.ramUsage;\n newScript.server = destServer.hostname;\n destServer.scripts.push(newScript);\n helpers.log(ctx, () => `File '${file}' copied over to '${destServer?.hostname}'.`);\n newScript.updateRamUsage(destServer.scripts);\n }\n\n return noFailures;\n },\n ls:\n (ctx) =>\n (_hostname, _grep = \"\"): string[] => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const grep = helpers.string(ctx, \"grep\", _grep);\n\n const server = helpers.getServer(ctx, hostname);\n\n // Get the grep filter, if one exists\n let filter = \"\";\n if (_grep !== undefined) {\n filter = grep.toString();\n }\n\n const allFiles = [];\n for (let i = 0; i < server.programs.length; i++) {\n if (filter) {\n if (server.programs[i].includes(filter)) {\n allFiles.push(server.programs[i]);\n }\n } else {\n allFiles.push(server.programs[i]);\n }\n }\n for (let i = 0; i < server.scripts.length; i++) {\n if (filter) {\n if (server.scripts[i].filename.includes(filter)) {\n allFiles.push(server.scripts[i].filename);\n }\n } else {\n allFiles.push(server.scripts[i].filename);\n }\n }\n for (let i = 0; i < server.messages.length; i++) {\n if (filter) {\n const msg = server.messages[i];\n if (msg.includes(filter)) {\n allFiles.push(msg);\n }\n } else {\n allFiles.push(server.messages[i]);\n }\n }\n\n for (let i = 0; i < server.textFiles.length; i++) {\n if (filter) {\n if (server.textFiles[i].fn.includes(filter)) {\n allFiles.push(server.textFiles[i].fn);\n }\n } else {\n allFiles.push(server.textFiles[i].fn);\n }\n }\n\n for (let i = 0; i < server.contracts.length; ++i) {\n if (filter) {\n if (server.contracts[i].fn.includes(filter)) {\n allFiles.push(server.contracts[i].fn);\n }\n } else {\n allFiles.push(server.contracts[i].fn);\n }\n }\n\n // Sort the files alphabetically then print each\n allFiles.sort();\n return allFiles;\n },\n getRecentScripts: () => (): IRecentScript[] => {\n return recentScripts.map((rs) => ({\n timeOfDeath: rs.timeOfDeath,\n ...helpers.createPublicRunningScript(rs.runningScript),\n }));\n },\n ps:\n (ctx) =>\n (_hostname = ctx.workerScript.hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n const processes: ProcessInfo[] = [];\n for (const script of server.runningScripts) {\n processes.push({\n filename: script.filename,\n threads: script.threads,\n args: script.args.slice(),\n pid: script.pid,\n });\n }\n return processes;\n },\n hasRootAccess: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n return server.hasAdminRights;\n },\n getHostname: (ctx) => () => ctx.workerScript.hostname,\n getHackingLevel: (ctx) => () => {\n Player.updateSkillLevels();\n helpers.log(ctx, () => `returned ${Player.skills.hacking}`);\n return Player.skills.hacking;\n },\n getHackingMultipliers: () => () => {\n return {\n chance: Player.mults.hacking_chance,\n speed: Player.mults.hacking_speed,\n money: Player.mults.hacking_money,\n growth: Player.mults.hacking_grow,\n };\n },\n getHacknetMultipliers: () => () => {\n return {\n production: Player.mults.hacknet_node_money,\n purchaseCost: Player.mults.hacknet_node_purchase_cost,\n ramCost: Player.mults.hacknet_node_ram_cost,\n coreCost: Player.mults.hacknet_node_core_cost,\n levelCost: Player.mults.hacknet_node_level_cost,\n };\n },\n getBitNodeMultipliers:\n (ctx) =>\n (_n = Player.bitNodeN, _lvl = Player.sourceFileLvl(Player.bitNodeN) + 1): IBitNodeMultipliers => {\n if (Player.sourceFileLvl(5) <= 0 && Player.bitNodeN !== 5)\n throw helpers.makeRuntimeErrorMsg(ctx, \"Requires Source-File 5 to run.\");\n const n = Math.round(helpers.number(ctx, \"n\", _n));\n const lvl = Math.round(helpers.number(ctx, \"lvl\", _lvl));\n if (n < 1 || n > 13) throw new Error(\"n must be between 1 and 13\");\n if (lvl < 1) throw new Error(\"lvl must be >= 1\");\n\n return Object.assign({}, getBitNodeMultipliers(n, lvl));\n },\n getServer:\n (ctx) =>\n (_hostname = ctx.workerScript.hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n const copy = Object.assign({}, server) as Server;\n // These fields should be hidden.\n copy.contracts = [];\n copy.messages = [];\n copy.runningScripts = [];\n copy.scripts = [];\n copy.textFiles = [];\n copy.programs = [];\n copy.serversOnNetwork = [];\n if (!copy.baseDifficulty) copy.baseDifficulty = 0;\n if (!copy.hackDifficulty) copy.hackDifficulty = 0;\n if (!copy.minDifficulty) copy.minDifficulty = 0;\n if (!copy.moneyAvailable) copy.moneyAvailable = 0;\n if (!copy.moneyMax) copy.moneyMax = 0;\n if (!copy.numOpenPortsRequired) copy.numOpenPortsRequired = 0;\n if (!copy.openPortCount) copy.openPortCount = 0;\n if (!copy.requiredHackingSkill) copy.requiredHackingSkill = 0;\n if (!copy.serverGrowth) copy.serverGrowth = 0;\n return copy;\n },\n getServerMoneyAvailable: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return 0;\n }\n if (server.hostname == \"home\") {\n // Return player's money\n helpers.log(ctx, () => `returned player's money: ${numeralWrapper.formatMoney(Player.money)}`);\n return Player.money;\n }\n helpers.log(ctx, () => `returned ${numeralWrapper.formatMoney(server.moneyAvailable)} for '${server.hostname}'`);\n return server.moneyAvailable;\n },\n getServerSecurityLevel: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatServerSecurity(server.hackDifficulty)} for '${server.hostname}'`,\n );\n return server.hackDifficulty;\n },\n getServerBaseSecurityLevel: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n helpers.log(ctx, () => `getServerBaseSecurityLevel is deprecated because it's not useful.`);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatServerSecurity(server.baseDifficulty)} for '${server.hostname}'`,\n );\n return server.baseDifficulty;\n },\n getServerMinSecurityLevel: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatServerSecurity(server.minDifficulty)} for ${server.hostname}`,\n );\n return server.minDifficulty;\n },\n getServerRequiredHackingLevel: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatSkill(server.requiredHackingSkill)} for '${server.hostname}'`,\n );\n return server.requiredHackingSkill;\n },\n getServerMaxMoney: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return 0;\n }\n helpers.log(ctx, () => `returned ${numeralWrapper.formatMoney(server.moneyMax)} for '${server.hostname}'`);\n return server.moneyMax;\n },\n getServerGrowth: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return 1;\n }\n helpers.log(ctx, () => `returned ${server.serverGrowth} for '${server.hostname}'`);\n return server.serverGrowth;\n },\n getServerNumPortsRequired: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 5;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return 5;\n }\n helpers.log(ctx, () => `returned ${server.numOpenPortsRequired} for '${server.hostname}'`);\n return server.numOpenPortsRequired;\n },\n getServerRam:\n (ctx) =>\n (_hostname): [number, number] => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n helpers.log(ctx, () => `getServerRam is deprecated in favor of getServerMaxRam / getServerUsedRam`);\n const server = helpers.getServer(ctx, hostname);\n helpers.log(\n ctx,\n () => `returned [${numeralWrapper.formatRAM(server.maxRam)}, ${numeralWrapper.formatRAM(server.ramUsed)}]`,\n );\n return [server.maxRam, server.ramUsed];\n },\n getServerMaxRam: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n helpers.log(ctx, () => `returned ${numeralWrapper.formatRAM(server.maxRam)}`);\n return server.maxRam;\n },\n getServerUsedRam: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n helpers.log(ctx, () => `returned ${numeralWrapper.formatRAM(server.ramUsed)}`);\n return server.ramUsed;\n },\n serverExists: (ctx) => (_hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n return GetServer(hostname) !== null;\n },\n fileExists:\n (ctx) =>\n (_filename, _hostname = ctx.workerScript.hostname) => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (filename === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: fileExists(scriptname, [server])\");\n }\n const server = helpers.getServer(ctx, hostname);\n for (let i = 0; i < server.scripts.length; ++i) {\n if (filename == server.scripts[i].filename) {\n return true;\n }\n }\n for (let i = 0; i < server.programs.length; ++i) {\n if (filename.toLowerCase() == server.programs[i].toLowerCase()) {\n return true;\n }\n }\n for (let i = 0; i < server.messages.length; ++i) {\n if (filename.toLowerCase() === server.messages[i].toLowerCase()) {\n return true;\n }\n }\n const contract = server.contracts.find((c) => c.fn.toLowerCase() === filename.toLowerCase());\n if (contract) return true;\n const txtFile = getTextFile(filename, server);\n return txtFile != null;\n },\n isRunning:\n (ctx) =>\n (fn, hostname, ...scriptArgs) => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, scriptArgs);\n return helpers.getRunningScript(ctx, ident) !== null;\n },\n getPurchasedServerLimit: () => () => {\n return getPurchaseServerLimit();\n },\n getPurchasedServerMaxRam: () => () => {\n return getPurchaseServerMaxRam();\n },\n getPurchasedServerCost: (ctx) => (_ram) => {\n const ram = helpers.number(ctx, \"ram\", _ram);\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n helpers.log(ctx, () => `Invalid argument: ram='${ram}'`);\n return Infinity;\n }\n\n return cost;\n },\n purchaseServer: (ctx) => (_name, _ram) => {\n const name = helpers.string(ctx, \"name\", _name);\n const ram = helpers.number(ctx, \"ram\", _ram);\n let hostnameStr = String(name);\n hostnameStr = hostnameStr.replace(/\\s+/g, \"\");\n if (hostnameStr == \"\") {\n helpers.log(ctx, () => `Invalid argument: hostname='${hostnameStr}'`);\n return \"\";\n }\n\n if (Player.purchasedServers.length >= getPurchaseServerLimit()) {\n helpers.log(\n ctx,\n () =>\n `You have reached the maximum limit of ${getPurchaseServerLimit()} servers. You cannot purchase any more.`,\n );\n return \"\";\n }\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n if (ram > getPurchaseServerMaxRam()) {\n helpers.log(ctx, () => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`);\n } else {\n helpers.log(ctx, () => `Invalid argument: ram='${ram}' must be a positive power of 2`);\n }\n\n return \"\";\n }\n\n if (Player.money < cost) {\n helpers.log(ctx, () => `Not enough money to purchase server. Need ${numeralWrapper.formatMoney(cost)}`);\n return \"\";\n }\n const newServ = safelyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: hostnameStr,\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: true,\n purchasedByPlayer: true,\n maxRam: ram,\n });\n AddToAllServers(newServ);\n\n Player.purchasedServers.push(newServ.hostname);\n const homeComputer = Player.getHomeComputer();\n homeComputer.serversOnNetwork.push(newServ.hostname);\n newServ.serversOnNetwork.push(homeComputer.hostname);\n Player.loseMoney(cost, \"servers\");\n helpers.log(\n ctx,\n () => `Purchased new server with hostname '${newServ.hostname}' for ${numeralWrapper.formatMoney(cost)}`,\n );\n return newServ.hostname;\n },\n\n getPurchasedServerUpgradeCost: (ctx) => (_hostname, _ram) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const ram = helpers.number(ctx, \"ram\", _ram);\n try {\n return getPurchasedServerUpgradeCost(hostname, ram);\n } catch (err) {\n helpers.log(ctx, () => String(err));\n return -1;\n }\n },\n upgradePurchasedServer: (ctx) => (_hostname, _ram) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const ram = helpers.number(ctx, \"ram\", _ram);\n try {\n upgradePurchasedServer(hostname, ram);\n return true;\n } catch (err) {\n helpers.log(ctx, () => String(err));\n return false;\n }\n },\n renamePurchasedServer: (ctx) => (_hostname, _newName) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const newName = helpers.string(ctx, \"newName\", _newName);\n try {\n renamePurchasedServer(hostname, newName);\n return true;\n } catch (err) {\n helpers.log(ctx, () => String(err));\n return false;\n }\n return false;\n },\n\n deleteServer: (ctx) => (_name) => {\n const name = helpers.string(ctx, \"name\", _name);\n let hostnameStr = String(name);\n hostnameStr = hostnameStr.replace(/\\s\\s+/g, \"\");\n const server = GetServer(hostnameStr);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => `Invalid argument: hostname='${hostnameStr}'`);\n return false;\n }\n\n if (!server.purchasedByPlayer || server.hostname === \"home\") {\n helpers.log(ctx, () => \"Cannot delete non-purchased server.\");\n return false;\n }\n\n const hostname = server.hostname;\n\n // Can't delete server you're currently connected to\n if (server.isConnectedTo) {\n helpers.log(ctx, () => \"You are currently connected to the server you are trying to delete.\");\n return false;\n }\n\n // A server cannot delete itself\n if (hostname === ctx.workerScript.hostname) {\n helpers.log(ctx, () => \"Cannot delete the server this script is running on.\");\n return false;\n }\n\n // Delete all scripts running on server\n if (server.runningScripts.length > 0) {\n helpers.log(ctx, () => `Cannot delete server '${hostname}' because it still has scripts running.`);\n return false;\n }\n\n // Delete from player's purchasedServers array\n let found = false;\n for (let i = 0; i < Player.purchasedServers.length; ++i) {\n if (hostname == Player.purchasedServers[i]) {\n found = true;\n Player.purchasedServers.splice(i, 1);\n break;\n }\n }\n\n if (!found) {\n helpers.log(\n ctx,\n () => `Could not identify server ${hostname} as a purchased server. This is a bug. Report to dev.`,\n );\n return false;\n }\n\n // Delete from all servers\n DeleteServer(hostname);\n\n // Delete from home computer\n found = false;\n const homeComputer = Player.getHomeComputer();\n for (let i = 0; i < homeComputer.serversOnNetwork.length; ++i) {\n if (hostname == homeComputer.serversOnNetwork[i]) {\n homeComputer.serversOnNetwork.splice(i, 1);\n helpers.log(ctx, () => `Deleted server '${hostnameStr}`);\n return true;\n }\n }\n // Wasn't found on home computer\n helpers.log(ctx, () => `Could not find server ${hostname} as a purchased server. This is a bug. Report to dev.`);\n return false;\n },\n getPurchasedServers: () => (): string[] => {\n const res: string[] = [];\n Player.purchasedServers.forEach(function (hostname) {\n res.push(hostname);\n });\n return res;\n },\n writePort:\n (ctx) =>\n (_port, data = \"\"): Promise<any> => {\n const port = helpers.number(ctx, \"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Trying to write invalid data to a port: only strings and numbers are valid.`,\n );\n }\n const iport = helpers.getValidPort(ctx, port);\n return Promise.resolve(iport.write(data));\n },\n write:\n (ctx) =>\n (_filename, _data = \"\", _mode = \"a\") => {\n let fn = helpers.string(ctx, \"handle\", _filename);\n const data = helpers.string(ctx, \"data\", _data);\n const mode = helpers.string(ctx, \"mode\", _mode);\n if (!isValidFilePath(fn)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filepath: ${fn}`);\n\n if (fn.lastIndexOf(\"/\") === 0) fn = removeLeadingSlash(fn);\n\n const server = helpers.getServer(ctx, ctx.workerScript.hostname);\n\n if (isScriptFilename(fn)) {\n // Write to script\n let script = ctx.workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n // Create a new script\n script = new Script(fn, String(data), server.hostname, server.scripts);\n server.scripts.push(script);\n return script.updateRamUsage(server.scripts);\n }\n mode === \"w\" ? (script.code = String(data)) : (script.code += data);\n return script.updateRamUsage(server.scripts);\n } else {\n // Write to text file\n if (!fn.endsWith(\".txt\")) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: ${fn}`);\n const txtFile = getTextFile(fn, server);\n if (txtFile == null) {\n createTextFile(fn, String(data), server);\n return;\n }\n if (mode === \"w\") {\n txtFile.write(String(data));\n } else {\n txtFile.append(String(data));\n }\n }\n return;\n },\n tryWritePort:\n (ctx) =>\n (_port, data = \"\") => {\n const port = helpers.number(ctx, \"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Trying to write invalid data to a port: only strings and numbers are valid.`,\n );\n }\n const iport = helpers.getValidPort(ctx, port);\n return iport.tryWrite(data);\n },\n readPort: (ctx) => (_port) => {\n const port = helpers.number(ctx, \"port\", _port);\n // Read from port\n const iport = helpers.getValidPort(ctx, port);\n const x = iport.read();\n return x;\n },\n read: (ctx) => (_filename) => {\n const fn = helpers.string(ctx, \"filename\", _filename);\n const server = GetServer(ctx.workerScript.hostname);\n if (server == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Error getting Server. This is a bug. Report to dev.\");\n }\n if (isScriptFilename(fn)) {\n // Read from script\n const script = ctx.workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n return \"\";\n }\n return script.code;\n } else {\n // Read from text file\n const txtFile = getTextFile(fn, server);\n if (txtFile !== null) {\n return txtFile.text;\n } else {\n return \"\";\n }\n }\n },\n peek: (ctx) => (_port) => {\n const port = helpers.number(ctx, \"port\", _port);\n const iport = helpers.getValidPort(ctx, port);\n const x = iport.peek();\n return x;\n },\n clear: (ctx) => (_file) => {\n const file = helpers.string(ctx, \"file\", _file);\n if (isString(file)) {\n // Clear text file\n const fn = file;\n const server = GetServer(ctx.workerScript.hostname);\n if (server == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Error getting Server. This is a bug. Report to dev.\");\n }\n const txtFile = getTextFile(fn, server);\n if (txtFile != null) {\n txtFile.write(\"\");\n }\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${file}`);\n }\n },\n clearPort: (ctx) => (_port) => {\n const port = helpers.number(ctx, \"port\", _port);\n // Clear port\n const iport = helpers.getValidPort(ctx, port);\n iport.clear();\n },\n getPortHandle: (ctx) => (_port) => {\n const port = helpers.number(ctx, \"port\", _port);\n const iport = helpers.getValidPort(ctx, port);\n return iport;\n },\n rm:\n (ctx) =>\n (_fn, _hostname = ctx.workerScript.hostname) => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const s = helpers.getServer(ctx, hostname);\n\n const status = s.removeFile(fn);\n if (!status.res) {\n helpers.log(ctx, () => status.msg + \"\");\n }\n\n return status.res;\n },\n scriptRunning: (ctx) => (_scriptname, _hostname) => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename == scriptname) {\n return true;\n }\n }\n return false;\n },\n scriptKill: (ctx) => (_scriptname, _hostname) => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n let suc = false;\n for (let i = 0; i < server.runningScripts.length; i++) {\n if (server.runningScripts[i].filename == scriptname) {\n killWorkerScript({ runningScript: server.runningScripts[i], hostname: server.hostname });\n suc = true;\n i--;\n }\n }\n return suc;\n },\n getScriptName: (ctx) => () => {\n return ctx.workerScript.name;\n },\n getScriptRam:\n (ctx) =>\n (_scriptname, _hostname = ctx.workerScript.hostname) => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename == scriptname) {\n return server.scripts[i].ramUsage;\n }\n }\n return 0;\n },\n getRunningScript:\n (ctx) =>\n (fn, hostname, ...args) => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, args);\n const runningScript = helpers.getRunningScript(ctx, ident);\n if (runningScript === null) return null;\n return helpers.createPublicRunningScript(runningScript);\n },\n getHackTime:\n (ctx) =>\n (_hostname = ctx.workerScript.hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return Infinity;\n }\n\n return calculateHackingTime(server, Player) * 1000;\n },\n getGrowTime:\n (ctx) =>\n (_hostname = ctx.workerScript.hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return Infinity;\n }\n\n return calculateGrowTime(server, Player) * 1000;\n },\n getWeakenTime:\n (ctx) =>\n (_hostname = ctx.workerScript.hostname) => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (helpers.failOnHacknetServer(ctx, server)) {\n return Infinity;\n }\n\n return calculateWeakenTime(server, Player) * 1000;\n },\n getTotalScriptIncome: () => () => {\n // First element is total income of all currently running scripts\n let total = 0;\n for (const script of workerScripts.values()) {\n total += script.scriptRef.onlineMoneyMade / script.scriptRef.onlineRunningTime;\n }\n\n return [total, Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug / 1000)];\n },\n getScriptIncome:\n (ctx) =>\n (fn, hostname, ...args) => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, args);\n const runningScript = helpers.getRunningScript(ctx, ident);\n if (runningScript == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return -1;\n }\n return runningScript.onlineMoneyMade / runningScript.onlineRunningTime;\n },\n getTotalScriptExpGain: () => () => {\n let total = 0;\n for (const ws of workerScripts.values()) {\n total += ws.scriptRef.onlineExpGained / ws.scriptRef.onlineRunningTime;\n }\n return total;\n },\n getScriptExpGain:\n (ctx) =>\n (fn, hostname, ...args) => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, args);\n const runningScript = helpers.getRunningScript(ctx, ident);\n if (runningScript == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return -1;\n }\n return runningScript.onlineExpGained / runningScript.onlineRunningTime;\n },\n nFormat: (ctx) => (_n, _format) => {\n const n = helpers.number(ctx, \"n\", _n);\n const format = helpers.string(ctx, \"format\", _format);\n if (isNaN(n)) {\n return \"\";\n }\n\n return numeralWrapper.format(n, format);\n },\n tFormat:\n (ctx) =>\n (_milliseconds, _milliPrecision = false) => {\n const milliseconds = helpers.number(ctx, \"milliseconds\", _milliseconds);\n const milliPrecision = !!_milliPrecision;\n return convertTimeMsToTimeElapsedString(milliseconds, milliPrecision);\n },\n getTimeSinceLastAug: () => () => {\n return Player.playtimeSinceLastAug;\n },\n alert: (ctx) => (_message) => {\n const message = helpers.string(ctx, \"message\", _message);\n dialogBoxCreate(message, true);\n },\n toast:\n (ctx) =>\n (_message, _variant = ToastVariant.SUCCESS, _duration = 2000) => {\n const message = helpers.string(ctx, \"message\", _message);\n const variant = helpers.string(ctx, \"variant\", _variant);\n const duration = _duration === null ? null : helpers.number(ctx, \"duration\", _duration);\n if (!checkEnum(ToastVariant, variant))\n throw new Error(`variant must be one of ${Object.values(ToastVariant).join(\", \")}`);\n SnackbarEvents.emit(message, variant as ToastVariant, duration);\n },\n prompt:\n (ctx) =>\n (_txt, options = {}) => {\n const txt = helpers.string(ctx, \"txt\", _txt);\n const optionsValidator: { type?: string; options?: string[] } = {};\n assertObjectType(ctx, \"options\", options, optionsValidator);\n\n return new Promise(function (resolve) {\n PromptEvent.emit({\n txt: txt,\n options,\n resolve: resolve,\n });\n });\n },\n wget:\n (ctx) =>\n async (_url, _target, _hostname = ctx.workerScript.hostname) => {\n const url = helpers.string(ctx, \"url\", _url);\n const target = helpers.string(ctx, \"target\", _target);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (!isScriptFilename(target) && !target.endsWith(\".txt\")) {\n helpers.log(ctx, () => `Invalid target file: '${target}'. Must be a script or text file.`);\n return Promise.resolve(false);\n }\n const s = helpers.getServer(ctx, hostname);\n return new Promise(function (resolve) {\n $.get(\n url,\n function (data) {\n let res;\n if (isScriptFilename(target)) {\n res = s.writeToScriptFile(target, data);\n } else {\n res = s.writeToTextFile(target, data);\n }\n if (!res.success) {\n helpers.log(ctx, () => \"Failed.\");\n return resolve(false);\n }\n if (res.overwritten) {\n helpers.log(ctx, () => `Successfully retrieved content and overwrote '${target}' on '${hostname}'`);\n return resolve(true);\n }\n helpers.log(ctx, () => `Successfully retrieved content to new file '${target}' on '${hostname}'`);\n return resolve(true);\n },\n \"text\",\n ).fail(function (e) {\n helpers.log(ctx, () => JSON.stringify(e));\n return resolve(false);\n });\n });\n },\n getFavorToDonate: () => () => {\n return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n },\n getPlayer: () => () => {\n const data = {\n hp: JSON.parse(JSON.stringify(Player.hp)),\n skills: JSON.parse(JSON.stringify(Player.skills)),\n exp: JSON.parse(JSON.stringify(Player.exp)),\n mults: JSON.parse(JSON.stringify(Player.mults)),\n numPeopleKilled: Player.numPeopleKilled,\n money: Player.money,\n city: Player.city,\n location: Player.location,\n bitNodeN: Player.bitNodeN,\n totalPlaytime: Player.totalPlaytime,\n playtimeSinceLastAug: Player.playtimeSinceLastAug,\n playtimeSinceLastBitnode: Player.playtimeSinceLastBitnode,\n jobs: {},\n factions: Player.factions.slice(),\n tor: Player.hasTorRouter(),\n inBladeburner: Player.inBladeburner(),\n hasCorporation: Player.hasCorporation(),\n entropy: Player.entropy,\n };\n Object.assign(data.jobs, Player.jobs);\n return data;\n },\n getMoneySources: () => () => ({\n sinceInstall: Object.assign({}, Player.moneySourceA),\n sinceStart: Object.assign({}, Player.moneySourceB),\n }),\n atExit: (ctx) => (f) => {\n if (typeof f !== \"function\") {\n throw helpers.makeRuntimeErrorMsg(ctx, \"argument should be function\");\n }\n ctx.workerScript.atExit = () => {\n f();\n }; // Wrap the user function to prevent WorkerScript leaking as 'this'\n },\n mv: (ctx) => (_host, _source, _destination) => {\n const host = helpers.string(ctx, \"host\", _host);\n const source = helpers.string(ctx, \"source\", _source);\n const destination = helpers.string(ctx, \"destination\", _destination);\n\n if (!isValidFilePath(source)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: '${source}'`);\n if (!isValidFilePath(destination)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: '${destination}'`);\n\n const source_is_txt = source.endsWith(\".txt\");\n const dest_is_txt = destination.endsWith(\".txt\");\n\n if (!isScriptFilename(source) && !source_is_txt)\n throw helpers.makeRuntimeErrorMsg(ctx, `'mv' can only be used on scripts and text files (.txt)`);\n if (source_is_txt != dest_is_txt)\n throw helpers.makeRuntimeErrorMsg(ctx, `Source and destination files must have the same type`);\n\n if (source === destination) {\n return;\n }\n\n const destServer = helpers.getServer(ctx, host);\n\n if (!source_is_txt && destServer.isRunning(source))\n throw helpers.makeRuntimeErrorMsg(ctx, `Cannot use 'mv' on a script that is running`);\n\n interface File {\n filename: string;\n }\n\n const files = source_is_txt ? destServer.textFiles : destServer.scripts;\n let source_file: File | null = null;\n let dest_file: File | null = null;\n\n for (let i = 0; i < files.length; ++i) {\n const file = files[i];\n if (file.filename === source) {\n source_file = file;\n } else if (file.filename === destination) {\n dest_file = file;\n }\n }\n\n if (source_file == null) throw helpers.makeRuntimeErrorMsg(ctx, `Source file ${source} does not exist`);\n\n if (dest_file != null) {\n if (dest_file instanceof TextFile && source_file instanceof TextFile) {\n dest_file.text = source_file.text;\n } else if (dest_file instanceof Script && source_file instanceof Script) {\n dest_file.code = source_file.code;\n dest_file.markUpdated();\n }\n\n destServer.removeFile(source);\n } else {\n source_file.filename = destination;\n if (source_file instanceof Script) {\n source_file.markUpdated();\n }\n }\n },\n flags: Flags,\n};\n\n// add undocumented functions\nexport const ns = {\n ...base,\n ...NetscriptExtra(),\n};\n\nconst possibleLogs = Object.fromEntries([...getFunctionNames(ns, \"\")].map((a) => [a, true]));\n/** Provides an array of all function names on a nested object */\nfunction getFunctionNames(obj: object, prefix: string): string[] {\n const functionNames: string[] = [];\n for (const [key, value] of Object.entries(obj)) {\n if (key === \"args\") {\n continue;\n } else if (typeof value == \"function\") {\n functionNames.push(prefix + key);\n } else if (typeof value == \"object\") {\n functionNames.push(...getFunctionNames(value, key + \".\"));\n }\n }\n return functionNames;\n}\n","import { Typography } from \"@mui/material\";\nimport React from \"react\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { Theme } from \"@mui/material/styles\";\n\n// This particular eslint-disable is correct.\n// In this super specific weird case we in fact do want a regex on an ANSII character.\n// eslint-disable-next-line no-control-regex\nconst ANSI_ESCAPE = new RegExp(\"\\u{001b}\\\\[(?<code>.*?)m\", \"ug\");\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n success: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.colors.success,\n },\n error: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.error.main,\n },\n primary: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.primary.main,\n },\n info: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.info.main,\n },\n warning: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.warning.main,\n },\n }),\n);\n\nconst lineClass = (classes: Record<string, string>, s: string): string => {\n const lineClassMap: Record<string, string> = {\n error: classes.error,\n success: classes.success,\n info: classes.info,\n warn: classes.warning,\n };\n return lineClassMap[s] || classes.primary;\n};\n\ninterface IProps {\n text: unknown;\n color: \"primary\" | \"error\" | \"success\" | \"info\" | \"warn\";\n}\n\nexport const ANSIITypography = React.memo((props: IProps): React.ReactElement => {\n const text = String(props.text);\n const classes = useStyles();\n const parts = [];\n\n // Build a look-alike regex match to place at the front of the matches list\n const INITIAL = {\n 0: \"\",\n index: 0,\n groups: { code: null },\n };\n const matches = [INITIAL, ...text.matchAll(ANSI_ESCAPE), null];\n if (matches.length > 2) {\n matches.slice(0, -1).forEach((m, i) => {\n const n = matches[i + 1];\n if (!m || m.index === undefined || m.groups === undefined) {\n return;\n }\n const startIndex = m.index + m[0].length;\n const stopIndex = n ? n.index : text.length;\n const partText = text.slice(startIndex, stopIndex);\n if (startIndex !== stopIndex) {\n // Don't generate \"empty\" spans\n parts.push({ code: m.groups.code, text: partText });\n }\n });\n }\n if (parts.length === 0) {\n // For example, if the string was empty or there were no escape sequence matches\n parts.push({ code: null, text: text });\n }\n return (\n <Typography classes={{ root: lineClass(classes, props.color) }} paragraph={false}>\n {parts.map((part, i) => (\n <span key={i} style={ansiCodeStyle(part.code)}>\n {part.text}\n </span>\n ))}\n </Typography>\n );\n});\n\nfunction ansiCodeStyle(code: string | null): Record<string, any> {\n // The ANSI colors actually have the dark color set as default and require extra work to get\n // bright colors. But these are rarely used or, if they are, are often re-mapped by the\n // terminal emulator to brighter colors. So for foreground colors we use the bright color set\n // and for background colors we use the dark color set. Of course, all colors are available\n // via the longer ESC[n8;5;c] sequence (n={3,4}, c=color). Ideally, these 8-bit maps could\n // be managed in the user preferences/theme.\n const COLOR_MAP_BRIGHT: Record<number, string> = {\n 0: \"#404040\",\n 1: \"#ff0000\",\n 2: \"#00ff00\",\n 3: \"#ffff00\",\n 4: \"#0000ff\",\n 5: \"#ff00ff\",\n 6: \"#00ffff\",\n 7: \"#ffffff\",\n };\n const COLOR_MAP_DARK: Record<number, string> = {\n 8: \"#000000\",\n 9: \"#800000\",\n 10: \"#008000\",\n 11: \"#808000\",\n 12: \"#000080\",\n 13: \"#800080\",\n 14: \"#008080\",\n 15: \"#c0c0c0\",\n };\n\n const ansi2rgb = (code: number): string => {\n /* eslint-disable yoda */\n if (0 <= code && code < 8) {\n // x8 RGB\n return COLOR_MAP_BRIGHT[code];\n }\n if (8 <= code && code < 16) {\n // x8 RGB - \"High Intensity\" (but here, actually the dark set)\n return COLOR_MAP_DARK[code];\n }\n if (16 <= code && code < 232) {\n // x216 RGB\n const base = code - 16;\n const ir = Math.floor(base / 36);\n const ig = Math.floor((base % 36) / 6);\n const ib = Math.floor((base % 6) / 1);\n const r = ir <= 0 ? 0 : 55 + ir * 40;\n const g = ig <= 0 ? 0 : 55 + ig * 40;\n const b = ib <= 0 ? 0 : 55 + ib * 40;\n return `rgb(${r}, ${g}, ${b})`;\n }\n if (232 <= code && code < 256) {\n // x32 greyscale\n const base = code - 232;\n const grey = base * 10 + 8;\n return `rgb(${grey}, ${grey}, ${grey})`;\n }\n // shouldn't get here (under normal circumstances), but just in case\n return \"initial\";\n };\n\n type styleKey = \"fontWeight\" | \"textDecoration\" | \"color\" | \"backgroundColor\" | \"padding\";\n const style: {\n fontWeight?: string;\n textDecoration?: string;\n color?: string;\n backgroundColor?: string;\n padding?: string;\n } = {};\n\n if (code === null || code === \"0\") {\n return style;\n }\n\n const codeParts = code\n .split(\";\")\n .map((p) => parseInt(p))\n .filter(\n (p, i, arr) =>\n // If the sequence is 38;5 (x256 foreground color) or 48;5 (x256 background color),\n // filter out the 5 so the next codePart after {38,48} is the color code.\n p != 5 || i == 0 || (arr[i - 1] != 38 && arr[i - 1] != 48),\n );\n\n let nextStyleKey: styleKey | null = null;\n codeParts.forEach((codePart) => {\n /* eslint-disable yoda */\n if (nextStyleKey !== null) {\n style[nextStyleKey] = ansi2rgb(codePart);\n nextStyleKey = null;\n }\n // Decorations\n else if (codePart == 1) {\n style.fontWeight = \"bold\";\n } else if (codePart == 4) {\n style.textDecoration = \"underline\";\n }\n // Foreground Color (x8)\n else if (30 <= codePart && codePart < 38) {\n if (COLOR_MAP_BRIGHT[codePart % 10]) {\n style.color = COLOR_MAP_BRIGHT[codePart % 10];\n }\n }\n // Background Color (x8)\n else if (40 <= codePart && codePart < 48) {\n if (COLOR_MAP_DARK[codePart % 10]) {\n style.backgroundColor = COLOR_MAP_DARK[codePart % 10];\n }\n }\n // Foreground Color (x256)\n else if (codePart == 38) {\n nextStyleKey = \"color\";\n }\n // Background Color (x256)\n else if (codePart == 48) {\n nextStyleKey = \"backgroundColor\";\n }\n });\n // If a background color is set, add slight padding to increase the background fill area.\n // This was previously display:inline-block, but that has display errors when line breaks are used.\n if (style.backgroundColor) {\n style.padding = \"0px 1px\";\n }\n return style;\n}\n","import React from \"react\";\nimport { newWorkStats, WorkStats } from \"../../Work/WorkStats\";\n\ninterface IGeneral {\n desc: JSX.Element;\n exp: WorkStats;\n}\n\nexport const GeneralActions: {\n [key: string]: IGeneral | undefined;\n} = {\n Training: {\n desc: (\n <>\n Improve your abilities at the Bladeburner unit's specialized training center. Doing this gives experience for\n all combat stats and also increases your max stamina.\n </>\n ),\n exp: newWorkStats({\n strExp: 30,\n defExp: 30,\n dexExp: 30,\n agiExp: 30,\n }),\n },\n\n \"Field Analysis\": {\n desc: (\n <>\n Mine and analyze Synthoid-related data. This improves the Bladeburner unit's intelligence on Synthoid locations\n and activities. Completing this action will improve the accuracy of your Synthoid population estimated in the\n current city.\n <br />\n <br />\n Does NOT require stamina.\n </>\n ),\n exp: newWorkStats({\n hackExp: 20,\n chaExp: 20,\n }),\n },\n\n Recruitment: {\n desc: (\n <>\n Attempt to recruit members for your Bladeburner team. These members can help you conduct operations.\n <br />\n <br />\n Does NOT require stamina.\n </>\n ),\n exp: newWorkStats({\n chaExp: 120,\n }),\n },\n\n Diplomacy: {\n desc: (\n <>\n Improve diplomatic relations with the Synthoid population. Completing this action will reduce the Chaos level in\n your current city.\n <br />\n <br />\n Does NOT require stamina.\n </>\n ),\n exp: newWorkStats({\n chaExp: 120,\n }),\n },\n\n \"Hyperbolic Regeneration Chamber\": {\n desc: (\n <>\n Enter cryogenic stasis using the Bladeburner division's hi-tech Regeneration Chamber. This will slowly heal your\n wounds and slightly increase your stamina.\n <br />\n <br />\n </>\n ),\n exp: newWorkStats(),\n },\n \"Incite Violence\": {\n desc: (\n <>\n Purposefully stir trouble in the synthoid community in order to gain a political edge. This will generate\n additional contracts and operations, at the cost of increased Chaos.\n </>\n ),\n exp: newWorkStats({\n strExp: 10,\n defExp: 10,\n dexExp: 10,\n agiExp: 10,\n chaExp: 10,\n }),\n },\n};\n","import { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport { Company } from \"../../Company/Company\";\nimport { Player } from \"@player\";\nimport { WorkStats } from \"../WorkStats\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Person } from \"../../PersonObjects/Person\";\n\nexport const calculateCompanyWorkStats = (worker: Person, company: Company): WorkStats => {\n const companyPositionName = Player.jobs[company.name];\n const companyPosition = CompanyPositions[companyPositionName];\n\n // If player has SF-11, calculate salary multiplier from favor\n let favorMult = 1 + company.favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n\n let bn11Mult = 1;\n if (Player.sourceFileLvl(11) > 0) {\n bn11Mult = favorMult;\n }\n\n let jobPerformance = companyPosition.calculateJobPerformance(\n worker.skills.hacking,\n worker.skills.strength,\n worker.skills.defense,\n worker.skills.dexterity,\n worker.skills.agility,\n worker.skills.charisma,\n );\n\n jobPerformance += worker.skills.intelligence / CONSTANTS.MaxSkillLevel;\n\n return {\n money:\n companyPosition.baseSalary *\n company.salaryMultiplier *\n worker.mults.work_money *\n BitNodeMultipliers.CompanyWorkMoney *\n bn11Mult,\n reputation: jobPerformance * worker.mults.company_rep * favorMult,\n hackExp:\n companyPosition.hackingExpGain *\n company.expMultiplier *\n worker.mults.hacking_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n strExp:\n companyPosition.strengthExpGain *\n company.expMultiplier *\n worker.mults.strength_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n defExp:\n companyPosition.defenseExpGain *\n company.expMultiplier *\n worker.mults.defense_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n dexExp:\n companyPosition.dexterityExpGain *\n company.expMultiplier *\n worker.mults.dexterity_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n agiExp:\n companyPosition.agilityExpGain *\n company.expMultiplier *\n worker.mults.agility_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n chaExp:\n companyPosition.charismaExpGain *\n company.expMultiplier *\n worker.mults.charisma_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n intExp: 0,\n };\n};\n","import { ActiveFragment } from \"./ActiveFragment\";\n\nexport class BaseGift {\n fragments: ActiveFragment[];\n _width?: number;\n _height?: number;\n\n constructor(width?: number, height?: number, fragments: ActiveFragment[] = []) {\n this.fragments = fragments;\n this._width = width;\n this._height = height;\n }\n\n width(): number {\n return this._width || 4;\n }\n height(): number {\n return this._height || 4;\n }\n fragmentAt(worldX: number, worldY: number): ActiveFragment | undefined {\n for (const aFrag of this.fragments) {\n if (aFrag.fullAt(worldX, worldY)) {\n return aFrag;\n }\n }\n\n return undefined;\n }\n}\n","import { EventEmitter } from \"../utils/EventEmitter\";\nexport const StaneksGiftEvents = new EventEmitter<[]>();\n","/**\n * Metadata for constructing Location objects for all Locations\n * in the game\n */\nimport { CityName } from \"./CityNames\";\nimport { LocationName } from \"./LocationNames\";\nimport { IConstructorParams } from \"../Location\";\nimport { LocationType } from \"../LocationTypeEnum\";\n\nexport const LocationsMetadata: IConstructorParams[] = [\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 8.18,\n },\n name: LocationName.AevumAeroCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 8.19,\n },\n name: LocationName.AevumBachmanAndAssociates,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 9.55,\n },\n name: LocationName.AevumClarkeIncorporated,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n costMult: 3,\n expMult: 2,\n name: LocationName.AevumCrushFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 37,\n startingSecurityLevel: 17.02,\n },\n name: LocationName.AevumECorp,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 512,\n techVendorMinRam: 128,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 15.54,\n },\n name: LocationName.AevumFulcrumTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 1024,\n techVendorMinRam: 256,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 7.89,\n },\n name: LocationName.AevumGalacticCybersystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 6,\n startingSecurityLevel: 3.29,\n },\n name: LocationName.AevumNetLinkTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 64,\n techVendorMinRam: 8,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 6,\n startingSecurityLevel: 5.35,\n },\n name: LocationName.AevumPolice,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 5.02,\n },\n name: LocationName.AevumRhoConstruction,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n costMult: 10,\n expMult: 5,\n name: LocationName.AevumSnapFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Aevum,\n costMult: 4,\n expMult: 3,\n name: LocationName.AevumSummitUniversity,\n types: [LocationType.University],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 7,\n startingSecurityLevel: 5.85,\n },\n name: LocationName.AevumWatchdogSecurity,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n name: LocationName.AevumCasino,\n types: [LocationType.Casino],\n },\n {\n city: CityName.Chongqing,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 16.25,\n },\n name: LocationName.ChongqingKuaiGongInternational,\n types: [LocationType.Company],\n },\n {\n city: CityName.Chongqing,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 12.59,\n },\n name: LocationName.ChongqingSolarisSpaceSystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.02,\n },\n name: LocationName.IshimaNovaMedical,\n types: [LocationType.Company],\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 10,\n startingSecurityLevel: 3.2,\n },\n name: LocationName.IshimaOmegaSoftware,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 128,\n techVendorMinRam: 4,\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 5.38,\n },\n name: LocationName.IshimaStormTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 512,\n techVendorMinRam: 32,\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 17,\n startingSecurityLevel: 7.18,\n },\n name: LocationName.NewTokyoDefComm,\n types: [LocationType.Company],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 20,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n types: [LocationType.Company],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 2.5,\n },\n name: LocationName.NewTokyoNoodleBar,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 5.52,\n },\n name: LocationName.NewTokyoVitaLife,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.NewTokyo,\n name: LocationName.NewTokyoArcade,\n types: [LocationType.Special],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 10,\n startingSecurityLevel: 3.62,\n },\n name: LocationName.Sector12AlphaEnterprises,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 8,\n techVendorMinRam: 2,\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 10.59,\n },\n name: LocationName.Sector12BladeIndustries,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12CIA,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 4.66,\n },\n name: LocationName.Sector12CarmichaelSecurity,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12CityHall,\n types: [LocationType.Special],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.Sector12DeltaOne,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12FoodNStuff,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 8.18,\n },\n name: LocationName.Sector12FourSigma,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 17,\n startingSecurityLevel: 6.02,\n },\n name: LocationName.Sector12IcarusMicrosystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n expMult: 1,\n costMult: 1,\n name: LocationName.Sector12IronGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 3.13,\n },\n name: LocationName.Sector12JoesGuns,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 31,\n startingSecurityLevel: 16.36,\n },\n name: LocationName.Sector12MegaCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12NSA,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.Sector12,\n costMult: 20,\n expMult: 10,\n name: LocationName.Sector12PowerhouseGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Sector12,\n costMult: 3,\n expMult: 2,\n name: LocationName.Sector12RothmanUniversity,\n types: [LocationType.University],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.Sector12UniversalEnergy,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 3.59,\n },\n name: LocationName.VolhavenCompuTek,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 256,\n techVendorMinRam: 8,\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 7.28,\n },\n name: LocationName.VolhavenHeliosLabs,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 4.35,\n },\n name: LocationName.VolhavenLexoCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n costMult: 7,\n expMult: 4,\n name: LocationName.VolhavenMilleniumFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 50,\n startingSecurityLevel: 8.53,\n },\n name: LocationName.VolhavenNWO,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 7.74,\n },\n name: LocationName.VolhavenOmniTekIncorporated,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 1024,\n techVendorMinRam: 128,\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 22,\n startingSecurityLevel: 6,\n },\n name: LocationName.VolhavenOmniaCybersystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 4.77,\n },\n name: LocationName.VolhavenSysCoreSecurities,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n costMult: 5,\n expMult: 4,\n name: LocationName.VolhavenZBInstituteOfTechnology,\n types: [LocationType.University],\n },\n {\n city: null,\n name: LocationName.Hospital,\n types: [LocationType.Hospital],\n },\n {\n city: null,\n name: LocationName.Slums,\n types: [LocationType.Slums],\n },\n {\n city: null,\n name: LocationName.TravelAgency,\n types: [LocationType.TravelAgency],\n },\n {\n city: null,\n name: LocationName.WorldStockExchange,\n types: [LocationType.StockMarket],\n },\n {\n city: CityName.Chongqing,\n name: LocationName.ChongqingChurchOfTheMachineGod,\n types: [LocationType.Special],\n },\n {\n city: CityName.Ishima,\n name: LocationName.IshimaGlitch,\n types: [LocationType.Special],\n },\n];\n","import { EmployeePositions } from \"./EmployeePositions\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { generateRandomString } from \"../utils/StringHelperFunctions\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { Employee } from \"./Employee\";\nimport { Industry } from \"./Industry\";\nimport { Corporation } from \"./Corporation\";\n\ninterface IParams {\n loc?: string;\n size?: number;\n}\n\nexport class OfficeSpace {\n loc: string;\n size: number;\n\n minEne = 0;\n minHap = 0;\n minMor = 0;\n\n maxEne = 100;\n maxHap = 100;\n maxMor = 100;\n\n autoCoffee = false;\n autoParty = false;\n coffeeMult = 0;\n partyMult = 0;\n coffeeEmployees = 0;\n partyEmployees = 0;\n\n employees: Employee[] = [];\n employeeProd: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n total: 0,\n };\n employeeJobs: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n [EmployeePositions.Training]: 0,\n [EmployeePositions.Unassigned]: 0,\n };\n employeeNextJobs: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n [EmployeePositions.Training]: 0,\n [EmployeePositions.Unassigned]: 0,\n };\n\n constructor(params: IParams = {}) {\n this.loc = params.loc ? params.loc : \"\";\n this.size = params.size ? params.size : 1;\n }\n\n atCapacity(): boolean {\n return this.employees.length >= this.size;\n }\n\n process(marketCycles = 1, corporation: Corporation, industry: Industry): number {\n // HRBuddy AutoRecruitment and training\n if (industry.hasResearch(\"HRBuddy-Recruitment\") && !this.atCapacity()) {\n const emp = this.hireRandomEmployee();\n if (industry.hasResearch(\"HRBuddy-Training\") && emp !== undefined) {\n emp.pos = EmployeePositions.Training;\n }\n }\n\n // Update employee jobs and job counts\n for (const employee of this.employees) {\n employee.pos = employee.nextPos;\n }\n this.calculateTotalEmployees();\n this.calculateNextEmployees();\n\n // Process Office properties\n this.maxEne = 100;\n this.maxHap = 100;\n this.maxMor = 100;\n\n if (industry.hasResearch(\"Go-Juice\")) {\n this.maxEne += 10;\n }\n if (industry.hasResearch(\"JoyWire\")) {\n this.maxHap += 10;\n }\n if (industry.hasResearch(\"Sti.mu\")) {\n this.maxMor += 10;\n }\n if (industry.hasResearch(\"AutoBrew\")) {\n this.autoCoffee = true;\n }\n if (industry.hasResearch(\"AutoPartyManager\")) {\n this.autoParty = true;\n }\n\n // Calculate changes in Morale/Happiness/Energy for Employees\n let perfMult = 1; //Multiplier for employee morale/happiness/energy based on company performance\n if (corporation.funds < 0 && industry.lastCycleRevenue < 0) {\n perfMult = Math.pow(0.99, marketCycles);\n } else if (corporation.funds > 0 && industry.lastCycleRevenue > 0) {\n perfMult = Math.pow(1.01, marketCycles);\n }\n\n let totalSalary = 0;\n for (const employee of this.employees) {\n const salary = employee.process(marketCycles);\n totalSalary += salary;\n\n if (this.autoCoffee) {\n employee.ene = this.maxEne;\n } else if (this.coffeeMult > 1) {\n const mult = 1 + ((this.coffeeMult - 1) * this.employees.length) / this.coffeeEmployees;\n employee.ene *= mult;\n } else {\n employee.ene *= perfMult;\n }\n\n if (this.autoParty) {\n employee.mor = this.maxMor;\n employee.hap = this.maxHap;\n } else if (this.partyMult > 1) {\n const mult = 1 + ((this.partyMult - 1) * this.employees.length) / this.partyEmployees;\n employee.mor *= mult;\n employee.hap *= mult;\n } else {\n employee.mor *= perfMult;\n employee.hap *= perfMult;\n }\n\n employee.ene = Math.max(Math.min(employee.ene, this.maxEne), this.minEne);\n employee.mor = Math.max(Math.min(employee.mor, this.maxMor), this.minMor);\n employee.hap = Math.max(Math.min(employee.hap, this.maxHap), this.minHap);\n }\n\n this.coffeeMult = 0;\n this.partyMult = 0;\n this.coffeeEmployees = 0;\n this.partyEmployees = 0;\n\n this.calculateEmployeeProductivity(corporation, industry);\n return totalSalary;\n }\n\n calculateNextEmployees(): void {\n //Reset\n for (const name of Object.keys(this.employeeNextJobs)) {\n this.employeeNextJobs[name] = 0;\n }\n\n for (let i = 0; i < this.employees.length; ++i) {\n const employee = this.employees[i];\n this.employeeNextJobs[employee.nextPos]++;\n }\n }\n\n calculateTotalEmployees(): void {\n //Reset\n for (const name of Object.keys(this.employeeJobs)) {\n this.employeeJobs[name] = 0;\n }\n\n for (let i = 0; i < this.employees.length; ++i) {\n const employee = this.employees[i];\n this.employeeJobs[employee.pos]++;\n }\n }\n\n calculateEmployeeProductivity(corporation: Corporation, industry: Industry): void {\n //Reset\n for (const name of Object.keys(this.employeeProd)) {\n this.employeeProd[name] = 0;\n }\n\n let total = 0;\n for (let i = 0; i < this.employees.length; ++i) {\n const employee = this.employees[i];\n const prod = employee.calculateProductivity(corporation, industry);\n this.employeeProd[employee.pos] += prod;\n total += prod;\n }\n this.employeeProd.total = total;\n }\n\n hireRandomEmployee(): Employee | undefined {\n if (this.atCapacity()) return;\n if (document.getElementById(\"cmpy-mgmt-hire-employee-popup\") != null) return;\n\n //Generate three random employees (meh, decent, amazing)\n const int = getRandomInt(50, 100),\n cha = getRandomInt(50, 100),\n exp = getRandomInt(50, 100),\n cre = getRandomInt(50, 100),\n eff = getRandomInt(50, 100),\n sal = CorporationConstants.EmployeeSalaryMultiplier * (int + cha + exp + cre + eff);\n\n const emp = new Employee({\n intelligence: int,\n charisma: cha,\n experience: exp,\n creativity: cre,\n efficiency: eff,\n salary: sal,\n });\n\n const name = generateRandomString(7);\n\n for (let i = 0; i < this.employees.length; ++i) {\n if (this.employees[i].name === name) {\n return this.hireRandomEmployee();\n }\n }\n emp.name = name;\n this.employees.push(emp);\n\n this.calculateTotalEmployees();\n this.calculateNextEmployees();\n return emp;\n }\n\n assignSingleJob(employee: Employee, job: string): void {\n employee.nextPos = job;\n this.calculateNextEmployees();\n }\n\n autoAssignJob(job: string, target: number): boolean {\n let count = this.employeeNextJobs[job];\n\n for (const employee of this.employees) {\n if (count === target) {\n break;\n } else if (employee.nextPos === EmployeePositions.Unassigned && count <= target) {\n employee.nextPos = job;\n count++;\n } else if (employee.nextPos === job && count >= target) {\n employee.nextPos = EmployeePositions.Unassigned;\n count--;\n }\n }\n\n this.calculateNextEmployees();\n return count === target;\n }\n\n getCoffeeCost(): number {\n return 500e3 * this.employees.length;\n }\n\n setCoffee(mult = 1.05): boolean {\n if (mult > 1 && this.coffeeMult === 0 && !this.autoCoffee && this.employees.length > 0) {\n this.coffeeMult = mult;\n this.coffeeEmployees = this.employees.length;\n return true;\n }\n\n return false;\n }\n\n setParty(mult: number): boolean {\n if (mult > 1 && this.partyMult === 0 && !this.autoParty && this.employees.length > 0) {\n this.partyMult = mult;\n this.partyEmployees = this.employees.length;\n return true;\n }\n\n return false;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"OfficeSpace\", this);\n }\n\n static fromJSON(value: IReviverValue): OfficeSpace {\n return Generic_fromJSON(OfficeSpace, value.data);\n }\n}\n\nReviver.constructors.OfficeSpace = OfficeSpace;\n","import { Material } from \"./Material\";\nimport { Corporation } from \"./Corporation\";\nimport { Industry } from \"./Industry\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\n\ninterface IConstructorParams {\n corp?: Corporation;\n industry?: Industry;\n loc?: string;\n size?: number;\n}\n\nexport class Warehouse {\n // Warehouse's level, which affects its maximum size\n level = 1;\n\n // City that this Warehouse is in\n loc: string;\n\n // Map of Materials held by this Warehouse\n materials: Record<string, Material>;\n\n // Maximum amount warehouse can hold\n size: number;\n\n // Amount of space currently used by warehouse\n sizeUsed = 0;\n\n // Whether Smart Supply is enabled for this Industry (the Industry that this Warehouse is for)\n smartSupplyEnabled = false;\n\n // Decide if smart supply should use the materials already in the warehouse when deciding on the amount to buy.\n smartSupplyUseLeftovers: { [key: string]: boolean | undefined } = {};\n\n // Stores the amount of product to be produced. Used for Smart Supply unlock.\n // The production tracked by smart supply is always based on the previous cycle,\n // so it will always trail the \"true\" production by 1 cycle\n smartSupplyStore = 0;\n\n constructor(params: IConstructorParams = {}) {\n this.loc = params.loc ? params.loc : \"\";\n this.size = params.size ? params.size : 0;\n\n this.materials = {\n Water: new Material({ name: \"Water\" }),\n Energy: new Material({ name: \"Energy\" }),\n Food: new Material({ name: \"Food\" }),\n Plants: new Material({ name: \"Plants\" }),\n Metal: new Material({ name: \"Metal\" }),\n Hardware: new Material({ name: \"Hardware\" }),\n Chemicals: new Material({ name: \"Chemicals\" }),\n Drugs: new Material({ name: \"Drugs\" }),\n Robots: new Material({ name: \"Robots\" }),\n AICores: new Material({ name: \"AI Cores\" }),\n RealEstate: new Material({ name: \"Real Estate\" }),\n };\n\n this.smartSupplyUseLeftovers = {\n Water: true,\n Energy: true,\n Food: true,\n Plants: true,\n Metal: true,\n Hardware: true,\n Chemicals: true,\n Drugs: true,\n Robots: true,\n AICores: true,\n RealEstate: true,\n };\n\n if (params.corp && params.industry) {\n this.updateSize(params.corp, params.industry);\n }\n\n // Default smart supply to being enabled if the upgrade is unlocked\n if (params.corp?.unlockUpgrades[1]) {\n this.smartSupplyEnabled = true;\n }\n }\n\n // Re-calculate how much space is being used by this Warehouse\n updateMaterialSizeUsed(): void {\n this.sizeUsed = 0;\n for (const matName of Object.keys(this.materials)) {\n const mat = this.materials[matName];\n if (MaterialSizes.hasOwnProperty(matName)) {\n this.sizeUsed += mat.qty * MaterialSizes[matName];\n }\n }\n if (this.sizeUsed > this.size) {\n console.warn(\"Warehouse size used greater than capacity, something went wrong\");\n }\n }\n\n updateSize(corporation: Corporation, industry: Industry): void {\n try {\n this.size = this.level * 100 * corporation.getStorageMultiplier() * industry.getStorageMultiplier();\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Warehouse\", this);\n }\n\n // Initializes a Warehouse object from a JSON save state.\n static fromJSON(value: IReviverValue): Warehouse {\n return Generic_fromJSON(Warehouse, value.data);\n }\n}\n\nReviver.constructors.Warehouse = Warehouse;\n","import { CheckBox, CheckBoxOutlineBlank, Construction } from \"@mui/icons-material\";\nimport { Box, Button, Container, List, ListItemButton, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { GraftingWork } from \"../../../Work/GraftingWork\";\nimport { Augmentation } from \"../../../Augmentation/Augmentation\";\nimport { AugmentationNames } from \"../../../Augmentation/data/AugmentationNames\";\nimport { StaticAugmentations } from \"../../../Augmentation/StaticAugmentations\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { hasAugmentationPrereqs } from \"../../../Faction/FactionHelpers\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { Locations } from \"../../../Locations/Locations\";\nimport { PurchaseAugmentationsOrderSetting } from \"../../../Settings/SettingEnums\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { Router } from \"../../../ui/GameRoot\";\nimport { ConfirmationModal } from \"../../../ui/React/ConfirmationModal\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { convertTimeMsToTimeElapsedString, formatNumber } from \"../../../utils/StringHelperFunctions\";\nimport { Player } from \"@player\";\nimport { GraftableAugmentation } from \"../GraftableAugmentation\";\nimport { calculateGraftingTimeWithBonus, getGraftingAvailableAugs } from \"../GraftingHelpers\";\n\nexport const GraftableAugmentations = (): Record<string, GraftableAugmentation> => {\n const gAugs: Record<string, GraftableAugmentation> = {};\n for (const aug of Object.values(StaticAugmentations)) {\n const name = aug.name;\n const graftableAug = new GraftableAugmentation(aug);\n gAugs[name] = graftableAug;\n }\n return gAugs;\n};\n\nconst canGraft = (aug: GraftableAugmentation): boolean => {\n if (Player.money < aug.cost) {\n return false;\n }\n return hasAugmentationPrereqs(aug.augmentation);\n};\n\ninterface IProps {\n aug: Augmentation;\n}\n\nconst AugPreReqsChecklist = (props: IProps): React.ReactElement => {\n const aug = props.aug;\n\n return (\n <Typography color={Settings.theme.money}>\n <b>Pre-Requisites:</b>\n <br />\n {aug.prereqs.map((preAug) => (\n <span style={{ display: \"flex\", alignItems: \"center\" }}>\n {Player.hasAugmentation(preAug) ? <CheckBox sx={{ mr: 1 }} /> : <CheckBoxOutlineBlank sx={{ mr: 1 }} />}\n {preAug}\n </span>\n ))}\n </Typography>\n );\n};\n\nexport const GraftingRoot = (): React.ReactElement => {\n const graftableAugmentations = useState(GraftableAugmentations())[0];\n\n const [selectedAug, setSelectedAug] = useState(getGraftingAvailableAugs()[0]);\n const [graftOpen, setGraftOpen] = useState(false);\n const selectedAugmentation = StaticAugmentations[selectedAug];\n\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const getAugsSorted = (): string[] => {\n const augs = getGraftingAvailableAugs();\n switch (Settings.PurchaseAugmentationsOrder) {\n case PurchaseAugmentationsOrderSetting.Cost:\n return augs.sort((a, b) => graftableAugmentations[a].cost - graftableAugmentations[b].cost);\n default:\n return augs;\n }\n };\n\n const switchSortOrder = (newOrder: PurchaseAugmentationsOrderSetting): void => {\n Settings.PurchaseAugmentationsOrder = newOrder;\n rerender();\n };\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0 }}>\n <Button onClick={() => Router.toLocation(Locations[LocationName.NewTokyoVitaLife])}>Back</Button>\n <Typography variant=\"h4\">Grafting Laboratory</Typography>\n <Typography>\n You find yourself in a secret laboratory, owned by a mysterious researcher.\n <br />\n The scientist explains that they've been studying Augmentation grafting, the process of applying Augmentations\n without requiring a body reset.\n <br />\n <br />\n Through legally questionable connections, the scientist has access to a vast array of Augmentation blueprints,\n even private designs. They offer to build and graft the Augmentations to you, in exchange for both a hefty sum\n of money, and being a lab rat.\n </Typography>\n\n <Box sx={{ my: 3 }}>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\">Graft Augmentations</Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}>\n <Button sx={{ width: \"100%\" }} onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Cost)}>\n Sort by Cost\n </Button>\n <Button sx={{ width: \"100%\" }} onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Default)}>\n Sort by Default Order\n </Button>\n </Box>\n </Paper>\n {getGraftingAvailableAugs().length > 0 ? (\n <Paper sx={{ mb: 1, width: \"fit-content\", display: \"grid\", gridTemplateColumns: \"1fr 3fr\" }}>\n <List sx={{ height: 400, overflowY: \"scroll\", borderRight: `1px solid ${Settings.theme.welllight}` }}>\n {getAugsSorted().map((k, i) => (\n <ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}>\n <Typography\n sx={{\n color: canGraft(graftableAugmentations[k]) ? Settings.theme.primary : Settings.theme.disabled,\n }}\n >\n {k}\n </Typography>\n </ListItemButton>\n ))}\n </List>\n <Box sx={{ m: 1 }}>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n <Construction sx={{ mr: 1 }} /> {selectedAug}\n </Typography>\n <Button\n onClick={() => setGraftOpen(true)}\n sx={{ width: \"100%\" }}\n disabled={!canGraft(graftableAugmentations[selectedAug])}\n >\n Graft Augmentation (\n <Typography>\n <Money money={graftableAugmentations[selectedAug].cost} forPurchase={true} />\n </Typography>\n )\n </Button>\n <ConfirmationModal\n open={graftOpen}\n onClose={() => setGraftOpen(false)}\n onConfirm={() => {\n Player.startWork(\n new GraftingWork({\n augmentation: selectedAug,\n singularity: false,\n }),\n );\n Player.startFocusing();\n Router.toWork();\n }}\n confirmationText={\n <>\n Cancelling grafting will <b>not</b> save grafting progress, and the money you spend will <b>not</b>{\" \"}\n be returned.\n {!Player.hasAugmentation(AugmentationNames.CongruityImplant) && (\n <>\n <br />\n <br />\n Additionally, grafting an Augmentation will increase the potency of the Entropy virus.\n </>\n )}\n </>\n }\n />\n <Box sx={{ maxHeight: 330, overflowY: \"scroll\" }}>\n <Typography color={Settings.theme.info}>\n <b>Time to Graft:</b>{\" \"}\n {convertTimeMsToTimeElapsedString(\n calculateGraftingTimeWithBonus(graftableAugmentations[selectedAug]),\n )}\n {/* Use formula so the displayed creation time is accurate to player bonus */}\n </Typography>\n\n {selectedAugmentation.prereqs.length > 0 && <AugPreReqsChecklist aug={selectedAugmentation} />}\n\n <br />\n\n <Typography>\n {(() => {\n const info =\n typeof selectedAugmentation.info === \"string\" ? (\n <span>{selectedAugmentation.info}</span>\n ) : (\n selectedAugmentation.info\n );\n const tooltip = (\n <>\n {info}\n <br />\n <br />\n {selectedAugmentation.stats}\n </>\n );\n return tooltip;\n })()}\n </Typography>\n </Box>\n </Box>\n </Paper>\n ) : (\n <Typography>All Augmentations owned</Typography>\n )}\n </Box>\n\n <Box sx={{ my: 3 }}>\n <Typography variant=\"h5\">Entropy Virus</Typography>\n\n <Paper sx={{ my: 1, p: 1, width: \"fit-content\" }}>\n <Typography>\n <b>Entropy strength:</b> {Player.entropy}\n <br />\n <b>All multipliers decreased by:</b>{\" \"}\n {formatNumber((1 - CONSTANTS.EntropyEffect ** Player.entropy) * 100, 3)}% (multiplicative)\n </Typography>\n </Paper>\n\n <Typography>\n When installed on an unconscious individual, Augmentations are scanned by the body on awakening, eliminating\n hidden malware. However, grafted Augmentations do not provide this security measure.\n <br />\n <br />\n Individuals who tested Augmentation grafting have reported symptoms of an unknown virus, which they've dubbed\n \"Entropy\". This virus seems to grow more potent with each grafted Augmentation...\n </Typography>\n </Box>\n </Container>\n );\n};\n","export class PlayerOwnedSourceFile {\n // Source-File level\n lvl = 1;\n\n // Source-File number\n n = 1;\n\n constructor(n: number, level: number) {\n this.n = n;\n this.lvl = level;\n }\n}\n","import { Button, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { Modal } from \"../ui/React/Modal\";\n\nlet v2ModalOpen = false;\n\nexport const openV2Modal = (): void => {\n v2ModalOpen = true;\n};\n\nexport const V2Modal = (): React.ReactElement => {\n const [open, setOpen] = useState(v2ModalOpen);\n return (\n <Modal open={open} onClose={() => undefined}>\n <Typography>Welcome to bitburner v2.0.0!</Typography>{\" \"}\n <Typography>While this version does not change the game a lot, it does have quite a few API breaks.</Typography>{\" \"}\n <Typography>\n A file was added to your home computer called V2_0_0_API_BREAK.txt and it is highly recommended you take a look\n at this file. It explains where most of the API break have occurred.\n </Typography>{\" \"}\n <Typography>\n You should also take a look at{\" \"}\n <a target=\"_\" href=\"https://github.com/danielyxie/bitburner/blob/dev/doc/source/v2.0.0_migration.rst\">\n {\" \"}\n the migration guide\n </a>{\" \"}\n as well as{\" \"}\n <a target=\"_\" href=\"https://github.com/danielyxie/bitburner/blob/dev/doc/source/changelog.rst\">\n the changelog\n </a>\n </Typography>\n <Button onClick={() => setOpen(false)}>I understand</Button>\n </Modal>\n );\n};\n","import { toNative } from \"./toNative\";\nimport libarg from \"arg\";\nimport { ScriptArg } from \"../Netscript/ScriptArg\";\nimport { NetscriptContext } from \"../Netscript/APIWrapper\";\n\ntype FlagType = StringConstructor | NumberConstructor | BooleanConstructor | StringConstructor[];\ntype FlagsRet = { [key: string]: ScriptArg | string[] };\nexport function Flags(ctx: NetscriptContext | string[]): (data: unknown) => FlagsRet {\n const vargs = Array.isArray(ctx) ? ctx : ctx.workerScript.args;\n return (schema: unknown): FlagsRet => {\n schema = toNative(schema);\n if (!Array.isArray(schema)) throw new Error(\"flags schema passed in is invalid.\");\n const args: {\n [key: string]: FlagType;\n } = {};\n\n for (const d of schema) {\n let t: FlagType = String;\n if (typeof d[1] === \"number\") {\n t = Number;\n } else if (typeof d[1] === \"boolean\") {\n t = Boolean;\n } else if (Array.isArray(d[1])) {\n t = [String];\n }\n const numDashes = d[0].length > 1 ? 2 : 1;\n args[\"-\".repeat(numDashes) + d[0]] = t;\n }\n const ret: FlagsRet = libarg(args, { argv: vargs });\n for (const d of schema) {\n if (!ret.hasOwnProperty(\"--\" + d[0]) || !ret.hasOwnProperty(\"-\" + d[0])) ret[d[0]] = d[1];\n }\n for (const key of Object.keys(ret)) {\n if (!key.startsWith(\"-\")) continue;\n const value = ret[key];\n delete ret[key];\n const numDashes = key.length === 2 ? 1 : 2;\n ret[key.slice(numDashes)] = value;\n }\n return ret;\n };\n}\n","import { Interpreter } from \"../ThirdParty/JSInterpreter\";\n\nconst defaultInterpreter = new Interpreter(\"\", () => undefined);\n\ninterface PseudoObject {\n properties: Record<string, unknown>;\n class: string;\n}\n\nconst isPseudoObject = (v: unknown): v is PseudoObject =>\n !!v &&\n typeof v === \"object\" &&\n v.hasOwnProperty(\"properties\") &&\n v.hasOwnProperty(\"getter\") &&\n v.hasOwnProperty(\"setter\") &&\n v.hasOwnProperty(\"proto\");\n\n// the acorn interpreter has a bug where it doesn't convert arrays correctly.\n// so we have to more or less copy it here.\nexport function toNative(pseudoObj: unknown): unknown {\n if (pseudoObj == null) return null;\n if (!isPseudoObject(pseudoObj)) {\n return pseudoObj; // it wasn't a pseudo object anyway.\n }\n\n if (pseudoObj.hasOwnProperty(\"class\") && pseudoObj.class === \"Array\") {\n const arr: unknown[] = [];\n const length = defaultInterpreter.getProperty(pseudoObj, \"length\");\n if (typeof length === \"number\") {\n for (let i = 0; i < length; i++) {\n if (defaultInterpreter.hasProperty(pseudoObj, i)) {\n arr[i] = toNative(defaultInterpreter.getProperty(pseudoObj, i));\n }\n }\n }\n return arr;\n } else {\n // Object.\n const obj: Record<string, unknown> = {};\n for (const key of Object.keys(pseudoObj.properties)) {\n const val = pseudoObj.properties[key];\n obj[key] = toNative(val);\n }\n return obj;\n }\n}\n","/**\n * Uses the acorn.js library to parse a script's code into an AST and\n * recursively walk through that AST to replace import urls with blobs\n */\nimport * as walk from \"acorn-walk\";\nimport { parse } from \"acorn\";\n\nimport { ScriptUrl } from \"./Script/ScriptUrl\";\nimport { Script } from \"./Script/Script\";\nimport { areImportsEquals } from \"./Terminal/DirectoryHelpers\";\nimport { ScriptModule } from \"./Script/ScriptModule\";\n\n// Acorn type def is straight up incomplete so we have to fill with our own.\nexport type Node = any;\n\n// Makes a blob that contains the code of a given script.\nfunction makeScriptBlob(code: string): Blob {\n return new Blob([code], { type: \"text/javascript\" });\n}\n\nexport async function compile(script: Script, scripts: Script[]): Promise<ScriptModule> {\n //!shouldCompile ensures that script.module is non-null, hence the \"as\".\n if (!shouldCompile(script, scripts)) return script.module as Promise<ScriptModule>;\n script.queueCompile = true;\n //If we're already in the middle of compiling (script.module has not resolved yet), wait for the previous compilation to finish\n //If script.module is null, this does nothing.\n await script.module;\n //If multiple compiles were called on the same script before a compilation could be completed this ensures only one compilation is actually performed.\n if (!script.queueCompile) return script.module as Promise<ScriptModule>;\n script.queueCompile = false;\n script.updateRamUsage(scripts);\n const uurls = _getScriptUrls(script, scripts, []);\n const url = uurls[uurls.length - 1].url;\n if (script.url && script.url !== url) URL.revokeObjectURL(script.url);\n\n if (script.dependencies.length > 0) script.dependencies.forEach((dep) => URL.revokeObjectURL(dep.url));\n script.url = uurls[uurls.length - 1].url;\n // The URL at the top is the one we want to import. It will\n // recursively import all the other modules in the urlStack.\n //\n // Webpack likes to turn the import into a require, which sort of\n // but not really behaves like import. Particularly, it cannot\n // load fully dynamic content. So we hide the import from webpack\n // by placing it inside an eval call.\n script.module = new Promise((resolve) => resolve(eval(\"import(uurls[uurls.length - 1].url)\")));\n script.dependencies = uurls;\n return script.module;\n}\n\nfunction isDependencyOutOfDate(filename: string, scripts: Script[], scriptModuleSequenceNumber: number): boolean {\n const depScript = scripts.find((s) => s.filename == filename);\n\n // If the script is not present on the server, we should recompile, if only to get any necessary\n // compilation errors.\n if (!depScript) return true;\n\n const depIsMoreRecent = depScript.moduleSequenceNumber > scriptModuleSequenceNumber;\n return depIsMoreRecent;\n}\n/** Returns whether we should compile the script parameter.\n *\n * @param {Script} script\n * @param {Script[]} scripts\n */\nfunction shouldCompile(script: Script, scripts: Script[]): boolean {\n if (!script.module) return true;\n if (script.dependencies.some((dep) => isDependencyOutOfDate(dep.filename, scripts, script.moduleSequenceNumber))) {\n script.module = null;\n return true;\n }\n return false;\n}\n\n// Gets a stack of blob urls, the top/right-most element being\n// the blob url for the named script on the named server.\n//\n// - script -- the script for whom we are getting a URL.\n// - scripts -- all the scripts available on this server\n// - seen -- The modules above this one -- to prevent mutual dependency.\n//\n// TODO We don't make any effort to cache a given module when it is imported at\n// different parts of the tree. That hasn't presented any problem with during\n// testing, but it might be an idea for the future. Would require a topo-sort\n// then url-izing from leaf-most to root-most.\n/**\n * @param {Script} script\n * @param {Script[]} scripts\n * @param {Script[]} seen\n * @returns {ScriptUrl[]} All of the compiled scripts, with the final one\n * in the list containing the blob corresponding to\n * the script parameter.\n */\n// BUG: apparently seen is never consulted. Oops.\nfunction _getScriptUrls(script: Script, scripts: Script[], seen: Script[]): ScriptUrl[] {\n // Inspired by: https://stackoverflow.com/a/43834063/91401\n const urlStack: ScriptUrl[] = [];\n // Seen contains the dependents of the current script. Make sure we include that in the script dependents.\n for (const dependent of seen) {\n if (!script.dependents.some((s) => s.server === dependent.server && s.filename == dependent.filename)) {\n script.dependents.push({ server: dependent.server, filename: dependent.filename });\n }\n }\n seen.push(script);\n try {\n // Replace every import statement with an import to a blob url containing\n // the corresponding script. E.g.\n //\n // import {foo} from \"bar.js\";\n //\n // becomes\n //\n // import {foo} from \"blob://<uuid>\"\n //\n // Where the blob URL contains the script content.\n\n // Parse the code into an ast tree\n const ast = parse(script.code, { sourceType: \"module\", ecmaVersion: \"latest\", ranges: true });\n interface importNode {\n filename: string;\n start: number;\n end: number;\n }\n const importNodes: importNode[] = [];\n // Walk the nodes of this tree and find any import declaration statements.\n walk.simple(ast, {\n ImportDeclaration(node: Node) {\n // Push this import onto the stack to replace\n if (!node.source) return;\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n },\n ExportNamedDeclaration(node: Node) {\n if (!node.source) return;\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n },\n ExportAllDeclaration(node: Node) {\n if (!node.source) return;\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n },\n });\n // Sort the nodes from last start index to first. This replaces the last import with a blob first,\n // preventing the ranges for other imports from being shifted.\n importNodes.sort((a, b) => b.start - a.start);\n let transformedCode = script.code;\n // Loop through each node and replace the script name with a blob url.\n for (const node of importNodes) {\n const filename = node.filename.startsWith(\"./\") ? node.filename.substring(2) : node.filename;\n\n // Find the corresponding script.\n const matchingScripts = scripts.filter((s) => areImportsEquals(s.filename, filename));\n if (matchingScripts.length === 0) continue;\n\n const [importedScript] = matchingScripts;\n\n const urls = _getScriptUrls(importedScript, scripts, seen);\n\n // The top url in the stack is the replacement import file for this script.\n urlStack.push(...urls);\n const blob = urls[urls.length - 1].url;\n\n // Replace the blob inside the import statement.\n transformedCode = transformedCode.substring(0, node.start) + blob + transformedCode.substring(node.end);\n }\n\n // We automatically define a print function() in the NetscriptJS module so that\n // accidental calls to window.print() do not bring up the \"print screen\" dialog\n transformedCode += `\\n//# sourceURL=${script.server}/${script.filename}`;\n\n const blob = URL.createObjectURL(makeScriptBlob(transformedCode));\n // Push the blob URL onto the top of the stack.\n urlStack.push(new ScriptUrl(script.filename, blob, script.moduleSequenceNumber));\n return urlStack;\n } catch (err) {\n // If there is an error, we need to clean up the URLs.\n for (const url of urlStack) URL.revokeObjectURL(url.url);\n throw err;\n } finally {\n seen.pop();\n }\n}\n","import { GetServer } from \"../Server/AllServers\";\nimport { RunningScript } from \"./RunningScript\";\n\nexport function getRamUsageFromRunningScript(script: RunningScript): number {\n if (script.ramUsage != null && script.ramUsage > 0) {\n return script.ramUsage; // Use cached value\n }\n\n const server = GetServer(script.server);\n if (server == null) {\n return 0;\n }\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === script.filename) {\n // Cache the ram usage for the next call\n script.ramUsage = server.scripts[i].ramUsage;\n return script.ramUsage;\n }\n }\n\n return 0;\n}\n","import { Terminal } from \"../../../Terminal\";\nimport { removeLeadingSlash, removeTrailingSlash } from \"../../DirectoryHelpers\";\nimport { ScriptEditorRouteOptions } from \"../../../ui/Router\";\nimport { Router } from \"../../../ui/GameRoot\";\nimport { BaseServer } from \"../../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../../Script/isScriptFilename\";\nimport { CursorPositions } from \"../../../ScriptEditor/CursorPositions\";\nimport { Script } from \"../../../Script/Script\";\nimport { isEmpty } from \"lodash\";\n\ninterface EditorParameters {\n args: (string | number | boolean)[];\n server: BaseServer;\n}\n\nfunction isNs2(filename: string): boolean {\n return filename.endsWith(\".js\");\n}\n\nconst newNs2Template = `/** @param {NS} ns */\nexport async function main(ns) {\n\n}`;\n\ninterface ISimpleScriptGlob {\n glob: string;\n preGlob: string;\n postGlob: string;\n globError: string;\n globMatches: string[];\n globAgainst: Script[];\n}\n\nfunction containsSimpleGlob(filename: string): boolean {\n return filename.includes(\"*\");\n}\n\nfunction detectSimpleScriptGlob({ args, server }: EditorParameters): ISimpleScriptGlob | null {\n if (args.length == 1 && containsSimpleGlob(`${args[0]}`)) {\n const filename = `${args[0]}`;\n const scripts = server.scripts;\n const parsedGlob = parseSimpleScriptGlob(filename, scripts);\n return parsedGlob;\n }\n return null;\n}\n\nfunction parseSimpleScriptGlob(globString: string, globDatabase: Script[]): ISimpleScriptGlob {\n const parsedGlob: ISimpleScriptGlob = {\n glob: globString,\n preGlob: \"\",\n postGlob: \"\",\n globError: \"\",\n globMatches: [],\n globAgainst: globDatabase,\n };\n\n // Ensure deep globs are minified to simple globs, which act as deep globs in this impl\n globString = globString.replace(\"**\", \"*\");\n\n // Ensure only a single glob is present\n if (globString.split(\"\").filter((c) => c == \"*\").length !== 1) {\n parsedGlob.globError = \"Only a single glob is supported per command.\\nexample: `nano my-dir/*.js`\";\n return parsedGlob;\n }\n\n // Split arg around glob, normalize preGlob path\n [parsedGlob.preGlob, parsedGlob.postGlob] = globString.split(\"*\");\n parsedGlob.preGlob = removeLeadingSlash(parsedGlob.preGlob);\n\n // Add CWD to preGlob path\n const cwd = removeTrailingSlash(Terminal.cwd());\n parsedGlob.preGlob = `${cwd}/${parsedGlob.preGlob}`;\n\n // For every script on the current server, filter matched scripts per glob values & persist\n globDatabase.forEach((script) => {\n const filename = script.filename.startsWith(\"/\") ? script.filename : `/${script.filename}`;\n if (filename.startsWith(parsedGlob.preGlob) && filename.endsWith(parsedGlob.postGlob)) {\n parsedGlob.globMatches.push(filename);\n }\n });\n\n // Rebuild glob for potential error reporting\n parsedGlob.glob = `${parsedGlob.preGlob}*${parsedGlob.postGlob}`;\n\n return parsedGlob;\n}\n\nexport function commonEditor(\n command: string,\n { args, server }: EditorParameters,\n scriptEditorRouteOptions?: ScriptEditorRouteOptions,\n): void {\n if (args.length < 1) {\n Terminal.error(`Incorrect usage of ${command} command. Usage: ${command} [scriptname]`);\n return;\n }\n\n let filesToLoadOrCreate = args;\n try {\n const globSearch = detectSimpleScriptGlob({ args, server });\n if (globSearch) {\n if (isEmpty(globSearch.globError) === false) throw new Error(globSearch.globError);\n filesToLoadOrCreate = globSearch.globMatches;\n }\n\n const files = filesToLoadOrCreate.map((arg) => {\n const filename = `${arg}`;\n\n if (isScriptFilename(filename)) {\n const filepath = Terminal.getFilepath(filename);\n const script = Terminal.getScript(filename);\n const fileIsNs2 = isNs2(filename);\n const code = script !== null ? script.code : fileIsNs2 ? newNs2Template : \"\";\n\n if (code === newNs2Template) {\n CursorPositions.saveCursor(filename, {\n row: 3,\n column: 5,\n });\n }\n\n return [filepath, code];\n }\n\n if (filename.endsWith(\".txt\")) {\n const filepath = Terminal.getFilepath(filename);\n const txt = Terminal.getTextFile(filename);\n return [filepath, txt === null ? \"\" : txt.text];\n }\n\n throw new Error(\n `Invalid file. Only scripts (.script or .js), or text files (.txt) can be edited with ${command}`,\n );\n });\n\n if (globSearch && files.length === 0) {\n throw new Error(`Could not find any valid files to open with ${command} using glob: \\`${globSearch.glob}\\``);\n }\n\n Router.toScriptEditor(Object.fromEntries(files), scriptEditorRouteOptions);\n } catch (e) {\n Terminal.error(`${e}`);\n }\n}\n","import React, { useState, useEffect } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const BitFlumeEvent = new EventEmitter<[]>();\n\nexport function BitFlumeModal(): React.ReactElement {\n const [open, setOpen] = useState(false);\n function flume(): void {\n Router.toBitVerse(true, false);\n setOpen(false);\n }\n\n useEffect(() => BitFlumeEvent.subscribe(() => setOpen(true)), []);\n\n return (\n <Modal open={open} onClose={() => setOpen(false)}>\n <Typography>\n WARNING: USING THIS PROGRAM WILL CAUSE YOU TO LOSE ALL OF YOUR PROGRESS ON THE CURRENT BITNODE.\n <br />\n <br />\n Do you want to travel to the BitNode Nexus? This allows you to reset the current BitNode and select a new one.\n </Typography>\n <br />\n <br />\n <Button onClick={flume}>Travel to the BitVerse</Button>\n </Modal>\n );\n}\n","/**\n * Sleeves are bodies that contain the player's cloned consciousness.\n * The player can use these bodies to perform different tasks synchronously.\n *\n * Each sleeve is its own individual, meaning it has its own stats/exp\n *\n * Sleeves are unlocked in BitNode-10.\n */\n\nimport { Player } from \"@player\";\nimport { Person } from \"../Person\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\n\nimport { Crime } from \"../../Crime/Crime\";\nimport { Crimes } from \"../../Crime/Crimes\";\n\nimport { Companies } from \"../../Company/Companies\";\nimport { Company } from \"../../Company/Company\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\n\nimport { Contracts } from \"../../Bladeburner/data/Contracts\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../utils/JSONReviver\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { FactionWorkType } from \"../../Work/data/FactionWorkType\";\nimport { Work } from \"./Work/Work\";\nimport { SleeveClassWork } from \"./Work/SleeveClassWork\";\nimport { ClassType } from \"../../Work/ClassWork\";\nimport { SleeveSynchroWork } from \"./Work/SleeveSynchroWork\";\nimport { SleeveRecoveryWork } from \"./Work/SleeveRecoveryWork\";\nimport { SleeveFactionWork } from \"./Work/SleeveFactionWork\";\nimport { SleeveCompanyWork } from \"./Work/SleeveCompanyWork\";\nimport { SleeveInfiltrateWork } from \"./Work/SleeveInfiltrateWork\";\nimport { SleeveSupportWork } from \"./Work/SleeveSupportWork\";\nimport { SleeveBladeburnerWork } from \"./Work/SleeveBladeburnerWork\";\nimport { SleeveCrimeWork } from \"./Work/SleeveCrimeWork\";\nimport * as sleeveMethods from \"./SleeveMethods\";\n\nexport class Sleeve extends Person {\n currentWork: Work | null = null;\n\n /** Clone retains 'memory' synchronization (and maybe exp?) upon prestige/installing Augs */\n memory = 1;\n\n /**\n * Sleeve shock. Number between 0 and 100\n * Trauma/shock that comes with being in a sleeve. Experience earned\n * is multiplied by shock%. This gets applied before synchronization\n *\n * Reputation earned is also multiplied by shock%\n */\n shock = 1;\n\n /** Stored number of game \"loop\" cycles */\n storedCycles = 0;\n\n /**\n * Synchronization. Number between 0 and 100\n * When experience is earned by sleeve, both the player and the sleeve get\n * sync% of the experience earned.\n */\n sync = 1;\n\n constructor() {\n super();\n this.shockRecovery();\n }\n\n applyAugmentation = sleeveMethods.applyAugmentation;\n findPurchasableAugs = sleeveMethods.findPurchasableAugs;\n\n shockBonus(): number {\n return this.shock / 100;\n }\n\n syncBonus(): number {\n return this.sync / 100;\n }\n\n startWork(w: Work): void {\n if (this.currentWork) this.currentWork.finish();\n this.currentWork = w;\n }\n\n stopWork(): void {\n if (this.currentWork) this.currentWork.finish();\n this.currentWork = null;\n }\n\n /** Commit crimes */\n commitCrime(crimeKey: string): boolean {\n const crime: Crime | null = Crimes[crimeKey] || Object.values(Crimes).find((crime) => crime.name === crimeKey);\n if (!crime) {\n return false;\n }\n\n this.startWork(new SleeveCrimeWork(crime.type));\n return true;\n }\n\n /** Returns the cost of upgrading this sleeve's memory by a certain amount */\n getMemoryUpgradeCost(n: number): number {\n const amt = Math.round(n);\n if (amt < 0) {\n return 0;\n }\n\n if (this.memory + amt > 100) {\n return this.getMemoryUpgradeCost(100 - this.memory);\n }\n\n const mult = 1.02;\n const baseCost = 1e12;\n let currCost = 0;\n let currMemory = this.memory - 1;\n for (let i = 0; i < n; ++i) {\n currCost += Math.pow(mult, currMemory);\n ++currMemory;\n }\n\n return currCost * baseCost;\n }\n\n installAugmentation(aug: Augmentation): void {\n this.exp.hacking = 0;\n this.exp.strength = 0;\n this.exp.defense = 0;\n this.exp.dexterity = 0;\n this.exp.agility = 0;\n this.exp.charisma = 0;\n this.applyAugmentation(aug);\n this.augmentations.push({ name: aug.name, level: 1 });\n this.updateSkillLevels();\n }\n\n /** Called on every sleeve for a Source File Prestige */\n prestige(): void {\n // Reset exp\n this.exp.hacking = 0;\n this.exp.strength = 0;\n this.exp.defense = 0;\n this.exp.dexterity = 0;\n this.exp.agility = 0;\n this.exp.charisma = 0;\n this.updateSkillLevels();\n this.hp.current = this.hp.max;\n\n // Reset task-related stuff\n this.stopWork();\n this.shockRecovery();\n\n // Reset augs and multipliers\n this.augmentations = [];\n this.resetMultipliers();\n\n // Reset Location\n\n this.city = CityName.Sector12;\n\n // Reset sleeve-related stats\n this.shock = 1;\n this.storedCycles = 0;\n this.sync = Math.max(this.memory, 1);\n }\n\n /**\n * Process loop\n * Returns an object containing the amount of experience that should be\n * transferred to all other sleeves\n */\n process(numCycles = 1): void {\n // Only process once every second (5 cycles)\n const CyclesPerSecond = 1000 / CONSTANTS.MilliPerCycle;\n this.storedCycles += numCycles;\n if (this.storedCycles < CyclesPerSecond) return;\n\n let cyclesUsed = this.storedCycles;\n cyclesUsed = Math.min(cyclesUsed, 15);\n this.shock = Math.min(100, this.shock + 0.0001 * cyclesUsed);\n if (!this.currentWork) return;\n this.currentWork.process(this, cyclesUsed);\n this.storedCycles -= cyclesUsed;\n }\n\n shockRecovery(): boolean {\n this.startWork(new SleeveRecoveryWork());\n return true;\n }\n\n synchronize(): boolean {\n this.startWork(new SleeveSynchroWork());\n return true;\n }\n\n /** Take a course at a university */\n takeUniversityCourse(universityName: string, className: string): boolean {\n // Set exp/money multipliers based on which university.\n // Also check that the sleeve is in the right city\n let loc: LocationName | undefined;\n switch (universityName.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase(): {\n if (this.city !== CityName.Aevum) return false;\n loc = LocationName.AevumSummitUniversity;\n break;\n }\n case LocationName.Sector12RothmanUniversity.toLowerCase(): {\n if (this.city !== CityName.Sector12) return false;\n loc = LocationName.Sector12RothmanUniversity;\n break;\n }\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase(): {\n if (this.city !== CityName.Volhaven) return false;\n loc = LocationName.VolhavenZBInstituteOfTechnology;\n break;\n }\n }\n if (!loc) return false;\n\n // Set experience/money gains based on class\n let classType: ClassType | undefined;\n switch (className.toLowerCase()) {\n case \"study computer science\":\n classType = ClassType.StudyComputerScience;\n break;\n case \"data structures\":\n classType = ClassType.DataStructures;\n break;\n case \"networks\":\n classType = ClassType.Networks;\n break;\n case \"algorithms\":\n classType = ClassType.Algorithms;\n break;\n case \"management\":\n classType = ClassType.Management;\n break;\n case \"leadership\":\n classType = ClassType.Leadership;\n break;\n }\n if (!classType) return false;\n\n this.startWork(\n new SleeveClassWork({\n classType: classType,\n location: loc,\n }),\n );\n return true;\n }\n\n /** Travel to another City. Costs money from player */\n travel(newCity: CityName): boolean {\n Player.loseMoney(CONSTANTS.TravelCost, \"sleeves\");\n this.city = newCity;\n\n return true;\n }\n\n tryBuyAugmentation(aug: Augmentation): boolean {\n if (!Player.canAfford(aug.baseCost)) {\n return false;\n }\n\n // Verify that this sleeve does not already have that augmentation.\n if (this.hasAugmentation(aug.name)) return false;\n\n Player.loseMoney(aug.baseCost, \"sleeves\");\n this.installAugmentation(aug);\n return true;\n }\n\n upgradeMemory(n: number): void {\n this.memory = Math.min(100, Math.round(this.memory + n));\n }\n\n /**\n * Start work for one of the player's companies\n * Returns boolean indicating success\n */\n workForCompany(companyName: string): boolean {\n if (!Companies[companyName] || Player.jobs[companyName] == null) {\n return false;\n }\n\n const company: Company | null = Companies[companyName];\n const companyPosition: CompanyPosition | null = CompanyPositions[Player.jobs[companyName]];\n if (company == null) return false;\n if (companyPosition == null) return false;\n\n this.startWork(new SleeveCompanyWork({ companyName: companyName }));\n\n return true;\n }\n\n /**\n * Start work for one of the player's factions\n * Returns boolean indicating success\n */\n workForFaction(factionName: string, workType: string): boolean {\n const faction = Factions[factionName];\n if (factionName === \"\" || !faction || !Player.factions.includes(factionName)) {\n return false;\n }\n\n const factionInfo = faction.getInfo();\n\n // Set type of work (hacking/field/security), and the experience gains\n const sanitizedWorkType = workType.toLowerCase();\n let factionWorkType: FactionWorkType;\n if (sanitizedWorkType.includes(\"hack\")) {\n if (!factionInfo.offerHackingWork) return false;\n factionWorkType = FactionWorkType.HACKING;\n } else if (sanitizedWorkType.includes(\"field\")) {\n if (!factionInfo.offerFieldWork) return false;\n factionWorkType = FactionWorkType.FIELD;\n } else if (sanitizedWorkType.includes(\"security\")) {\n if (!factionInfo.offerSecurityWork) return false;\n factionWorkType = FactionWorkType.SECURITY;\n } else {\n return false;\n }\n\n this.startWork(\n new SleeveFactionWork({\n factionWorkType: factionWorkType,\n factionName: faction.name,\n }),\n );\n\n return true;\n }\n\n /** Begin a gym workout task */\n workoutAtGym(gymName: string, stat: string): boolean {\n // Set exp/money multipliers based on which university.\n // Also check that the sleeve is in the right city\n let loc: LocationName | undefined;\n switch (gymName.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase(): {\n if (this.city != CityName.Aevum) return false;\n loc = LocationName.AevumCrushFitnessGym;\n break;\n }\n case LocationName.AevumSnapFitnessGym.toLowerCase(): {\n if (this.city != CityName.Aevum) return false;\n loc = LocationName.AevumSnapFitnessGym;\n break;\n }\n case LocationName.Sector12IronGym.toLowerCase(): {\n if (this.city != CityName.Sector12) return false;\n loc = LocationName.Sector12IronGym;\n break;\n }\n case LocationName.Sector12PowerhouseGym.toLowerCase(): {\n if (this.city != CityName.Sector12) return false;\n loc = LocationName.Sector12PowerhouseGym;\n break;\n }\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase(): {\n if (this.city != CityName.Volhaven) return false;\n loc = LocationName.VolhavenMilleniumFitnessGym;\n break;\n }\n }\n if (!loc) return false;\n\n // Set experience/money gains based on class\n const sanitizedStat: string = stat.toLowerCase();\n\n // set stat to a default value.\n let classType: ClassType | undefined;\n if (sanitizedStat.includes(\"str\")) {\n classType = ClassType.GymStrength;\n }\n if (sanitizedStat.includes(\"def\")) {\n classType = ClassType.GymDefense;\n }\n if (sanitizedStat.includes(\"dex\")) {\n classType = ClassType.GymDexterity;\n }\n if (sanitizedStat.includes(\"agi\")) {\n classType = ClassType.GymAgility;\n }\n // if stat is still equals its default value, then validation has failed.\n if (!classType) return false;\n\n this.startWork(\n new SleeveClassWork({\n classType: classType,\n location: loc,\n }),\n );\n\n return true;\n }\n\n /** Begin a bladeburner task */\n bladeburner(action: string, contract: string): boolean {\n if (!Player.bladeburner) return false;\n switch (action) {\n case \"Field analysis\":\n this.startWork(new SleeveBladeburnerWork({ type: \"General\", name: \"Field Analysis\" }));\n return true;\n case \"Recruitment\":\n this.startWork(new SleeveBladeburnerWork({ type: \"General\", name: \"Recruitment\" }));\n return true;\n case \"Diplomacy\":\n this.startWork(new SleeveBladeburnerWork({ type: \"General\", name: \"Diplomacy\" }));\n return true;\n case \"Hyperbolic Regeneration Chamber\":\n this.startWork(new SleeveBladeburnerWork({ type: \"General\", name: \"Hyperbolic Regeneration Chamber\" }));\n return true;\n case \"Infiltrate synthoids\":\n this.startWork(new SleeveInfiltrateWork());\n return true;\n case \"Support main sleeve\":\n this.startWork(new SleeveSupportWork());\n return true;\n case \"Take on contracts\":\n if (!Contracts[contract]) return false;\n this.startWork(new SleeveBladeburnerWork({ type: \"Contracts\", name: contract }));\n return true;\n }\n return false;\n }\n\n recruitmentSuccessChance(): number {\n return Math.max(0, Math.min(1, Player.bladeburner?.getRecruitmentSuccessChance(this) ?? 0));\n }\n\n contractSuccessChance(type: string, name: string): string {\n const bb = Player.bladeburner;\n if (bb === null) {\n const errorLogText = `bladeburner is null`;\n console.error(`Function: sleeves.contractSuccessChance; Message: '${errorLogText}'`);\n return \"0%\";\n }\n const chances = bb.getActionEstimatedSuccessChanceNetscriptFn(this, type, name);\n if (typeof chances === \"string\") {\n console.error(`Function: sleeves.contractSuccessChance; Message: '${chances}'`);\n return \"0%\";\n }\n if (chances[0] >= 1) {\n return \"100%\";\n } else {\n return `${numeralWrapper.formatPercentage(chances[0])} - ${numeralWrapper.formatPercentage(chances[1])}`;\n }\n }\n\n takeDamage(amt: number): boolean {\n if (typeof amt !== \"number\") {\n console.warn(`Player.takeDamage() called without a numeric argument: ${amt}`);\n return false;\n }\n\n this.hp.current -= amt;\n if (this.hp.current <= 0) {\n this.shock = Math.max(0, this.shock - 0.5);\n this.hp.current = this.hp.max;\n return true;\n } else {\n return false;\n }\n }\n\n whoAmI(): string {\n return \"Sleeve\";\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Sleeve\", this);\n }\n\n /** Initializes a Sleeve object from a JSON save state. */\n static fromJSON(value: IReviverValue): Sleeve {\n return Generic_fromJSON(Sleeve, value.data);\n }\n}\n\nReviver.constructors.Sleeve = Sleeve;\n","import * as personMethods from \"./PersonMethods\";\nimport { PlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { calculateSkill } from \"./formulas/skill\";\nimport { calculateIntelligenceBonus } from \"./formulas/intelligence\";\nimport { defaultMultipliers } from \"./Multipliers\";\nimport { Skills } from \"./Skills\";\nimport { HP } from \"./HP\";\nimport { IReviverValue } from \"../utils/JSONReviver\";\n\n// Base class representing a person-like object\nexport abstract class Person {\n hp: HP = { current: 10, max: 10 };\n skills: Skills = {\n hacking: 1,\n strength: 1,\n defense: 1,\n dexterity: 1,\n agility: 1,\n charisma: 1,\n intelligence: 0,\n };\n exp: Skills = {\n hacking: 0,\n strength: 0,\n defense: 0,\n dexterity: 0,\n agility: 0,\n charisma: 0,\n intelligence: 0,\n };\n\n mults = defaultMultipliers();\n\n /** Augmentations */\n augmentations: PlayerOwnedAugmentation[] = [];\n queuedAugmentations: PlayerOwnedAugmentation[] = [];\n\n /** City that the person is in */\n city: CityName = CityName.Sector12;\n\n gainHackingExp = personMethods.gainHackingExp;\n gainStrengthExp = personMethods.gainStrengthExp;\n gainDefenseExp = personMethods.gainDefenseExp;\n gainDexterityExp = personMethods.gainDexterityExp;\n gainAgilityExp = personMethods.gainAgilityExp;\n gainCharismaExp = personMethods.gainCharismaExp;\n gainIntelligenceExp = personMethods.gainIntelligenceExp;\n gainStats = personMethods.gainStats;\n regenerateHp = personMethods.regenerateHp;\n queryStatFromString = personMethods.queryStatFromString;\n updateSkillLevels = personMethods.updateSkillLevels;\n hasAugmentation = personMethods.hasAugmentation;\n calculateSkill = calculateSkill; //Class version is equal to imported version\n\n /** Reset all multipliers to 1 */\n resetMultipliers() {\n this.mults = defaultMultipliers();\n }\n\n getIntelligenceBonus(weight: number): number {\n return calculateIntelligenceBonus(this.skills.intelligence, weight);\n }\n\n abstract takeDamage(amt: number): boolean;\n abstract whoAmI(): string;\n abstract toJSON(): IReviverValue;\n}\n","import React from \"react\";\n\ninterface IContract {\n desc: JSX.Element;\n}\n\nexport const Contracts: {\n [key: string]: IContract | undefined;\n} = {\n Tracking: {\n desc: (\n <>\n Identify and locate Synthoids. This contract involves reconnaissance and information-gathering ONLY. Do NOT\n engage. Stealth is of the utmost importance.\n <br />\n <br />\n Successfully completing Tracking contracts will slightly improve your Synthoid population estimate for whatever\n city you are currently in.\n </>\n ),\n },\n \"Bounty Hunter\": {\n desc: (\n <>\n Hunt down and capture fugitive Synthoids. These Synthoids are wanted alive.\n <br />\n <br />\n Successfully completing a Bounty Hunter contract will lower the population in your current city, and will also\n increase its chaos level.\n </>\n ),\n },\n Retirement: {\n desc: (\n <>\n Hunt down and retire (kill) rogue Synthoids.\n <br />\n <br />\n Successfully completing a Retirement contract will lower the population in your current city, and will also\n increase its chaos level.\n </>\n ),\n },\n};\n","import * as React from \"react\";\n\nexport const stealthIcon = (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16px\" height=\"16px\" viewBox=\"0 0 166 132\" style={{ fill: \"#adff2f\" }}>\n <g>\n <path d=\"M132.658-0.18l-24.321,24.321c-7.915-2.71-16.342-4.392-25.087-4.392c-45.84,0-83,46-83,46 s14.1,17.44,35.635,30.844L12.32,120.158l12.021,12.021L144.68,11.841L132.658-0.18z M52.033,80.445 c-2.104-4.458-3.283-9.438-3.283-14.695c0-19.054,15.446-34.5,34.5-34.5c5.258,0,10.237,1.179,14.695,3.284L52.033,80.445z\" />\n <path d=\"M134.865,37.656l-18.482,18.482c0.884,3.052,1.367,6.275,1.367,9.612c0,19.055-15.446,34.5-34.5,34.5 c-3.337,0-6.56-0.483-9.611-1.367l-10.124,10.124c6.326,1.725,12.934,2.743,19.735,2.743c45.84,0,83-46,83-46 S153.987,50.575,134.865,37.656z\" />\n </g>\n </svg>\n);\nexport const killIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16px\"\n height=\"16px\"\n viewBox=\"-22 0 511 511.99561\"\n style={{ fill: \"#adff2f\" }}\n >\n <path d=\"m.496094 466.242188 39.902344-39.902344 45.753906 45.753906-39.898438 39.902344zm0 0\" />\n <path d=\"m468.421875 89.832031-1.675781-89.832031-300.265625 300.265625 45.753906 45.753906zm0 0\" />\n <path d=\"m95.210938 316.785156 16.84375 16.847656h.003906l83.65625 83.65625 22.753906-22.753906-100.503906-100.503906zm0 0\" />\n <path d=\"m101.445312 365.300781-39.902343 39.902344 45.753906 45.753906 39.902344-39.902343-39.90625-39.902344zm0 0\" />\n </svg>\n);\n","import React from \"react\";\nimport { Action } from \"../Action\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport { BladeburnerConstants } from \"../data/Constants\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ArrowDropUpIcon from \"@mui/icons-material/ArrowDropUp\";\nimport ArrowDropDownIcon from \"@mui/icons-material/ArrowDropDown\";\n\ninterface IProps {\n action: Action;\n isActive: boolean;\n bladeburner: Bladeburner;\n rerender: () => void;\n}\n\nexport function ActionLevel({ action, isActive, bladeburner, rerender }: IProps): React.ReactElement {\n const canIncrease = action.level < action.maxLevel;\n const canDecrease = action.level > 1;\n\n function increaseLevel(): void {\n if (!canIncrease) return;\n ++action.level;\n if (isActive) bladeburner.startAction(bladeburner.action);\n rerender();\n }\n\n function decreaseLevel(): void {\n if (!canDecrease) return;\n --action.level;\n if (isActive) bladeburner.startAction(bladeburner.action);\n rerender();\n }\n\n return (\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n {action.getSuccessesNeededForNextLevel(BladeburnerConstants.ContractSuccessesPerLevel)} successes needed\n for next level\n </Typography>\n }\n >\n <Typography>\n Level: {action.level} / {action.maxLevel}\n </Typography>\n </Tooltip>\n </Box>\n <Tooltip title={isActive ? <Typography>WARNING: changing the level will restart the Operation</Typography> : \"\"}>\n <span>\n <IconButton disabled={!canIncrease} onClick={increaseLevel}>\n <ArrowDropUpIcon />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={isActive ? <Typography>WARNING: changing the level will restart the Operation</Typography> : \"\"}>\n <span>\n <IconButton disabled={!canDecrease} onClick={decreaseLevel}>\n <ArrowDropDownIcon />\n </IconButton>\n </span>\n </Tooltip>\n </Box>\n );\n}\n","import React from \"react\";\nimport { Action } from \"../Action\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Switch from \"@mui/material/Switch\";\n\ninterface IProps {\n action: Action;\n rerender: () => void;\n}\n\nexport function Autolevel(props: IProps): React.ReactElement {\n function onAutolevel(event: React.ChangeEvent<HTMLInputElement>): void {\n props.action.autoLevel = event.target.checked;\n props.rerender();\n }\n return (\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Tooltip title={<Typography>Automatically increase operation level when possible</Typography>}>\n <Typography> Autolevel:</Typography>\n </Tooltip>\n <Switch checked={props.action.autoLevel} onChange={onAutolevel} />\n </Box>\n );\n}\n","import React, { useState } from \"react\";\nimport { Operation } from \"../Operation\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport { TeamSizeModal } from \"./TeamSizeModal\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport Button from \"@mui/material/Button\";\ninterface IProps {\n action: Operation;\n bladeburner: Bladeburner;\n}\nexport function TeamSizeButton(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n return (\n <>\n <Button disabled={props.bladeburner.teamSize === 0} onClick={() => setOpen(true)}>\n Set Team Size (Curr Size: {formatNumber(props.action.teamCount, 0)})\n </Button>\n <TeamSizeModal open={open} onClose={() => setOpen(false)} action={props.action} bladeburner={props.bladeburner} />\n </>\n );\n}\n","import React, { useEffect, useState } from \"react\";\n\nexport function BlinkingCursor(): React.ReactElement {\n const [on, setOn] = useState(true);\n useEffect(() => {\n const i = setInterval(() => setOn((old) => !old), 1000);\n return () => clearInterval(i);\n });\n return <>{on ? \"|\" : <> </>}</>;\n}\n","import React, { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport TextFormatIcon from \"@mui/icons-material/TextFormat\";\nimport { StyleEditorModal } from \"./StyleEditorModal\";\n\nexport function StyleEditorButton(): React.ReactElement {\n const [styleEditorOpen, setStyleEditorOpen] = useState(false);\n return (\n <>\n <Tooltip title=\"The style editor allows you to modify certain CSS rules used by the game.\">\n <Button startIcon={<TextFormatIcon />} onClick={() => setStyleEditorOpen(true)}>\n Style Editor\n </Button>\n </Tooltip>\n <StyleEditorModal open={styleEditorOpen} onClose={() => setStyleEditorOpen(false)} />\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { ThemeEditorModal } from \"./ThemeEditorModal\";\nimport ColorizeIcon from \"@mui/icons-material/Colorize\";\n\nexport function ThemeEditorButton(): React.ReactElement {\n const [themeEditorOpen, setThemeEditorOpen] = useState(false);\n return (\n <>\n <Tooltip title=\"The theme editor allows you to modify the colors the game uses.\">\n <Button id=\"bb-theme-editor-button\" startIcon={<ColorizeIcon />} onClick={() => setThemeEditorOpen(true)}>\n Theme Editor\n </Button>\n </Tooltip>\n <ThemeEditorModal open={themeEditorOpen} onClose={() => setThemeEditorOpen(false)} />\n </>\n );\n}\n","import React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { Link } from \"@mui/material\";\n\nexport function ThemeCollaborate(): React.ReactElement {\n return (\n <>\n <Typography sx={{ my: 1 }}>\n If you've created a theme that you believe should be added in game's theme browser, feel free to{\" \"}\n <Link href=\"https://github.com/danielyxie/bitburner/tree/dev/src/Themes/README.md\" target=\"_blank\">\n create a pull request\n </Link>\n .\n </Typography>\n <Typography sx={{ my: 1 }}>\n Head over to the{\" \"}\n <Link href=\"https://discord.com/channels/415207508303544321/921991895230611466\" target=\"_blank\">\n theme-sharing\n </Link>{\" \"}\n discord channel for more.\n </Typography>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { deleteGame } from \"../../db\";\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport Button from \"@mui/material/Button\";\nimport { Tooltip } from \"@mui/material\";\n\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport { pushDisableRestore } from \"../../Electron\";\n\ninterface IProps {\n color?: \"primary\" | \"warning\" | \"error\";\n}\n\nexport function DeleteGameButton({ color = \"primary\" }: IProps): React.ReactElement {\n const [modalOpened, setModalOpened] = useState(false);\n\n return (\n <>\n <Tooltip title=\"This will permanently delete your local save game. Did you export it before?\">\n <Button startIcon={<DeleteIcon />} color={color} onClick={() => setModalOpened(true)}>\n Delete Save\n </Button>\n </Tooltip>\n <ConfirmationModal\n onConfirm={() => {\n setModalOpened(false);\n deleteGame()\n .then(() => {\n pushDisableRestore();\n setTimeout(() => location.reload(), 1000);\n })\n .catch((r) => console.error(`Could not delete game: ${r}`));\n }}\n open={modalOpened}\n onClose={() => setModalOpened(false)}\n confirmationText={\"Really delete your game? (It's permanent!)\"}\n />\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport Button from \"@mui/material/Button\";\nimport { Tooltip } from \"@mui/material\";\nimport RestartAltIcon from \"@mui/icons-material/RestartAlt\";\n\ninterface IProps {\n color?: \"primary\" | \"warning\" | \"error\";\n noConfirmation?: boolean;\n onTriggered: () => void;\n}\n\nexport function SoftResetButton({\n color = \"primary\",\n noConfirmation = false,\n onTriggered,\n}: IProps): React.ReactElement {\n const [modalOpened, setModalOpened] = useState(false);\n\n function handleButtonClick(): void {\n if (noConfirmation) {\n onTriggered();\n } else {\n setModalOpened(true);\n }\n }\n\n return (\n <>\n <Tooltip title=\"Perform a soft reset. Resets everything as if you had just purchased an Augmentation.\">\n <Button startIcon={<RestartAltIcon />} color={color} onClick={handleButtonClick}>\n Soft Reset\n </Button>\n </Tooltip>\n <ConfirmationModal\n onConfirm={onTriggered}\n open={modalOpened}\n onClose={() => setModalOpened(false)}\n confirmationText={\"This will perform the same action as installing Augmentations, are you sure?\"}\n />\n </>\n );\n}\n","export default \"/** @public */\\nexport type ValuesFrom<T> = T[keyof T];\\n\\n/** @public */\\nexport interface HP {\\n current: number;\\n max: number;\\n}\\n\\n/** @public */\\nexport interface Skills {\\n hacking: number;\\n strength: number;\\n defense: number;\\n dexterity: number;\\n agility: number;\\n charisma: number;\\n intelligence: number;\\n}\\n\\n/** @public */\\nexport interface PossibleInfiltrationLocation {\\n city: string;\\n name: string;\\n}\\n\\n/**\\n * Coding contract data will differ depending on coding contract.\\n * @public\\n */\\ntype CodingContractData = any;\\n\\n/** @public */\\ntype PortData = string | number;\\n\\n/** @public */\\ntype ScriptArg = string | number | boolean;\\n\\n/** @public */\\ntype FilenameOrPID = number | string;\\n\\n/** @public */\\ninterface Player {\\n hp: HP;\\n skills: Skills;\\n exp: Skills;\\n mults: Multipliers;\\n numPeopleKilled: number;\\n money: number;\\n city: string;\\n location: string;\\n bitNodeN: number;\\n totalPlaytime: number;\\n playtimeSinceLastAug: number;\\n playtimeSinceLastBitnode: number;\\n jobs: Record<string, string>;\\n factions: string[];\\n tor: boolean;\\n hasCorporation: boolean;\\n inBladeburner: boolean;\\n entropy: number;\\n}\\n\\n/** @public */\\ninterface MoneySource {\\n bladeburner: number;\\n casino: number;\\n class: number;\\n codingcontract: number;\\n corporation: number;\\n crime: number;\\n gang: number;\\n hacking: number;\\n hacknet: number;\\n hacknet_expenses: number;\\n hospitalization: number;\\n infiltration: number;\\n sleeves: number;\\n stock: number;\\n total: number;\\n work: number;\\n servers: number;\\n other: number;\\n augmentations: number;\\n}\\n\\n/** @public */\\ninterface MoneySources {\\n sinceInstall: MoneySource;\\n sinceStart: MoneySource;\\n}\\n\\n/** @public */\\nexport interface Multipliers {\\n /** Multiplier to hacking skill */\\n hacking?: number;\\n /** Multiplier to strength skill */\\n strength?: number;\\n /** Multiplier to defense skill */\\n defense?: number;\\n /** Multiplier to dexterity skill */\\n dexterity?: number;\\n /** Multiplier to agility skill */\\n agility?: number;\\n /** Multiplier to charisma skill */\\n charisma?: number;\\n /** Multiplier to hacking experience gain rate */\\n hacking_exp?: number;\\n /** Multiplier to strength experience gain rate */\\n strength_exp?: number;\\n /** Multiplier to defense experience gain rate */\\n defense_exp?: number;\\n /** Multiplier to dexterity experience gain rate */\\n dexterity_exp?: number;\\n /** Multiplier to agility experience gain rate */\\n agility_exp?: number;\\n /** Multiplier to charisma experience gain rate */\\n charisma_exp?: number;\\n /** Multiplier to chance of successfully performing a hack */\\n hacking_chance?: number;\\n /** Multiplier to hacking speed */\\n hacking_speed?: number;\\n /** Multiplier to amount of money the player gains from hacking */\\n hacking_money?: number;\\n /** Multiplier to amount of money injected into servers using grow */\\n hacking_grow?: number;\\n /** Multiplier to amount of reputation gained when working */\\n company_rep?: number;\\n /** Multiplier to amount of reputation gained when working */\\n faction_rep?: number;\\n /** Multiplier to amount of money gained from crimes */\\n crime_money?: number;\\n /** Multiplier to crime success rate */\\n crime_success?: number;\\n /** Multiplier to amount of money gained from working */\\n work_money?: number;\\n /** Multiplier to amount of money produced by Hacknet Nodes */\\n hacknet_node_money?: number;\\n /** Multiplier to cost of purchasing a Hacknet Node */\\n hacknet_node_purchase_cost?: number;\\n /** Multiplier to cost of ram for a Hacknet Node */\\n hacknet_node_ram_cost?: number;\\n /** Multiplier to cost of core for a Hacknet Node */\\n hacknet_node_core_cost?: number;\\n /** Multiplier to cost of leveling up a Hacknet Node */\\n hacknet_node_level_cost?: number;\\n /** Multiplier to Bladeburner max stamina */\\n bladeburner_max_stamina?: number;\\n /** Multiplier to Bladeburner stamina gain rate */\\n bladeburner_stamina_gain?: number;\\n /** Multiplier to effectiveness in Bladeburner Field Analysis */\\n bladeburner_analysis?: number;\\n /** Multiplier to success chance in Bladeburner contracts/operations */\\n bladeburner_success_chance?: number;\\n}\\n\\n/** @public */\\nexport interface RunningScript {\\n /** Arguments the script was called with */\\n args: (string | number | boolean)[];\\n /** Filename of the script */\\n filename: string;\\n /**\\n * Script logs as an array. The newest log entries are at the bottom.\\n * Timestamps, if enabled, are placed inside `[brackets]` at the start of each line.\\n **/\\n logs: string[];\\n /** Total amount of hacking experience earned from this script when offline */\\n offlineExpGained: number;\\n /** Total amount of money made by this script when offline */\\n offlineMoneyMade: number;\\n /** Number of seconds that the script has been running offline */\\n offlineRunningTime: number;\\n /** Total amount of hacking experience earned from this script when online */\\n onlineExpGained: number;\\n /** Total amount of money made by this script when online */\\n onlineMoneyMade: number;\\n /** Number of seconds that this script has been running online */\\n onlineRunningTime: number;\\n /** Process ID. Must be an integer */\\n pid: number;\\n /** How much RAM this script uses for ONE thread */\\n ramUsage: number;\\n /** Hostname of the server on which this script runs */\\n server: string;\\n /** Number of threads that this script runs with */\\n threads: number;\\n}\\n\\n/** @public */\\nexport interface RecentScript extends RunningScript {\\n /** Timestamp of when the script was killed */\\n timeOfDeath: Date;\\n}\\n\\n/**\\n * Data representing the internal values of a crime.\\n * @public\\n */\\nexport interface CrimeStats {\\n /** Number representing the difficulty of the crime. Used for success chance calculations */\\n difficulty: number;\\n /** Amount of karma lost for successfully committing this crime */\\n karma: number;\\n /** How many people die as a result of this crime */\\n kills: number;\\n /** How much money is given */\\n money: number;\\n /** Name of crime */\\n name: string;\\n /** Milliseconds it takes to attempt the crime */\\n time: number;\\n /** Description of the crime activity */\\n type: string;\\n /** hacking level impact on success change of the crime */\\n hacking_success_weight: number;\\n /** strength level impact on success change of the crime */\\n strength_success_weight: number;\\n /** defense level impact on success change of the crime */\\n defense_success_weight: number;\\n /** dexterity level impact on success change of the crime */\\n dexterity_success_weight: number;\\n /** agility level impact on success change of the crime */\\n agility_success_weight: number;\\n /** charisma level impact on success change of the crime */\\n charisma_success_weight: number;\\n /** hacking exp gained from crime */\\n hacking_exp: number;\\n /** strength exp gained from crime */\\n strength_exp: number;\\n /** defense exp gained from crime */\\n defense_exp: number;\\n /** dexterity exp gained from crime */\\n dexterity_exp: number;\\n /** agility exp gained from crime */\\n agility_exp: number;\\n /** charisma exp gained from crime */\\n charisma_exp: number;\\n /** intelligence exp gained from crime */\\n intelligence_exp: number;\\n}\\n\\n/**\\n * Options to affect the behavior of {@link NS.hack | hack}, {@link NS.grow | grow}, and {@link NS.weaken | weaken}.\\n * @public\\n */\\nexport interface BasicHGWOptions {\\n /** Number of threads to use for this function.\\n * Must be less than or equal to the number of threads the script is running with. */\\n threads?: number;\\n /** Set to true this action will affect the stock market. */\\n stock?: boolean;\\n}\\n\\n/**\\n * Options to affect the behavior of {@link CodingContract} attempt.\\n * @public\\n */\\nexport interface CodingAttemptOptions {\\n /** If truthy, then the function will return a string that states the contract’s reward when it is successfully solved. */\\n returnReward: boolean;\\n}\\n\\n/**\\n * Return value of {@link Sleeve.getSleevePurchasableAugs | getSleevePurchasableAugs}\\n * @public\\n */\\nexport interface AugmentPair {\\n /** augmentation name */\\n name: string;\\n /** augmentation cost */\\n cost: number;\\n}\\n\\n/** @public */\\nexport enum PositionTypes {\\n Long = \\\"L\\\",\\n Short = \\\"S\\\",\\n}\\n\\n/** @public */\\nexport enum OrderTypes {\\n LimitBuy = \\\"Limit Buy Order\\\",\\n LimitSell = \\\"Limit Sell Order\\\",\\n StopBuy = \\\"Stop Buy Order\\\",\\n StopSell = \\\"Stop Sell Order\\\",\\n}\\n\\n/**\\n * Value in map of {@link StockOrder}\\n * @public\\n */\\nexport interface StockOrderObject {\\n /** Number of shares */\\n shares: number;\\n /** Price per share */\\n price: number;\\n /** Order type */\\n type: OrderTypes;\\n /** Order position */\\n position: PositionTypes;\\n}\\n\\n/**\\n * Return value of {@link TIX.getOrders | getOrders}\\n *\\n * Keys are stock symbols, properties are arrays of {@link StockOrderObject}\\n * @public\\n */\\nexport interface StockOrder {\\n [key: string]: StockOrderObject[];\\n}\\n\\n/**\\n * A single process on a server.\\n * @public\\n */\\nexport interface ProcessInfo {\\n /** Script name. */\\n filename: string;\\n /** Number of threads script is running with */\\n threads: number;\\n /** Script's arguments */\\n args: (string | number | boolean)[];\\n /** Process ID */\\n pid: number;\\n}\\n\\n/**\\n * Hack related multipliers.\\n * @public\\n */\\nexport interface HackingMultipliers {\\n /** Player's hacking chance multiplier. */\\n chance: number;\\n /** Player's hacking speed multiplier. */\\n speed: number;\\n /** Player's hacking money stolen multiplier. */\\n money: number;\\n /** Player's hacking growth multiplier */\\n growth: number;\\n}\\n\\n/**\\n * Hacknet related multipliers.\\n * @public\\n */\\nexport interface HacknetMultipliers {\\n /** Player's hacknet production multiplier */\\n production: number;\\n /** Player's hacknet purchase cost multiplier */\\n purchaseCost: number;\\n /** Player's hacknet ram cost multiplier */\\n ramCost: number;\\n /** Player's hacknet core cost multiplier */\\n coreCost: number;\\n /** Player's hacknet level cost multiplier */\\n levelCost: number;\\n}\\n\\n/**\\n * Hacknet node related constants\\n * @public\\n */\\nexport interface HacknetNodeConstants {\\n /** Amount of money gained per level */\\n MoneyGainPerLevel: number;\\n /** Base cost for a new node */\\n BaseCost: number;\\n /** Base cost per level */\\n LevelBaseCost: number;\\n /** Base cost to increase RAM */\\n RamBaseCost: number;\\n /** Base cost to increase cores */\\n CoreBaseCost: number;\\n /** Multiplier to purchase new node */\\n PurchaseNextMult: number;\\n /** Multiplier to increase node level */\\n UpgradeLevelMult: number;\\n /** Multiplier to increase RAM */\\n UpgradeRamMult: number;\\n /** Multiplier to increase cores */\\n UpgradeCoreMult: number;\\n /** Max node level */\\n MaxLevel: number;\\n /** Max amount of RAM in GB */\\n MaxRam: number;\\n /** Max number of cores */\\n MaxCores: number;\\n}\\n\\n/**\\n * Hacknet server related constants\\n * @public\\n */\\nexport interface HacknetServerConstants {\\n /** Number of hashes calculated per level */\\n HashesPerLevel: number;\\n /** Base cost for a new server */\\n BaseCost: number;\\n /** Base cost to increase RAM */\\n RamBaseCost: number;\\n /** Base cost to increase cores */\\n CoreBaseCost: number;\\n /** Base cost to upgrade cache */\\n CacheBaseCost: number;\\n /** Multiplier to purchase a new server */\\n PurchaseMult: number;\\n /** Multiplier to increase server level */\\n UpgradeLevelMult: number;\\n /** Multiplier to increase RAM */\\n UpgradeRamMult: number;\\n /** Multiplier to increase cores */\\n UpgradeCoreMult: number;\\n /** Multiplier to upgrade cache */\\n UpgradeCacheMult: number;\\n /** Max number of servers */\\n MaxServers: number;\\n /** Max level for a server */\\n MaxLevel: number;\\n /** Max amount of RAM in GB */\\n MaxRam: number;\\n /** Max number of cores */\\n MaxCores: number;\\n /** Max cache size */\\n MaxCache: number;\\n}\\n\\n/**\\n * A single server.\\n * @public\\n */\\nexport interface Server {\\n /**\\n * How many CPU cores this server has. Maximum of 8.\\n * Affects magnitude of grow and weaken.\\n */\\n cpuCores: number;\\n\\n /** Flag indicating whether the FTP port is open */\\n ftpPortOpen: boolean;\\n\\n /** Flag indicating whether player has admin/root access to this server */\\n hasAdminRights: boolean;\\n\\n /** Hostname. Must be unique */\\n hostname: string;\\n\\n /** Flag indicating whether HTTP Port is open */\\n httpPortOpen: boolean;\\n\\n /** IP Address. Must be unique */\\n ip: string;\\n\\n /** Flag indicating whether player is currently connected to this server */\\n isConnectedTo: boolean;\\n\\n /** RAM (GB) available on this server */\\n maxRam: number;\\n\\n /**\\n * Name of company/faction/etc. that this server belongs to.\\n * Optional, not applicable to all Servers\\n */\\n organizationName: string;\\n\\n /** RAM (GB) used. i.e. unavailable RAM */\\n ramUsed: number;\\n\\n /** Flag indicating whether SMTP Port is open */\\n smtpPortOpen: boolean;\\n\\n /** Flag indicating whether SQL Port is open */\\n sqlPortOpen: boolean;\\n\\n /** Flag indicating whether the SSH Port is open */\\n sshPortOpen: boolean;\\n\\n /** Flag indicating whether this is a purchased server */\\n purchasedByPlayer: boolean;\\n\\n /** Flag indicating whether this server has a backdoor installed by a player */\\n backdoorInstalled: boolean;\\n\\n /**\\n * Initial server security level\\n * (i.e. security level when the server was created)\\n */\\n baseDifficulty: number;\\n\\n /** Server Security Level */\\n hackDifficulty: number;\\n\\n /** Minimum server security level that this server can be weakened to */\\n minDifficulty: number;\\n\\n /** How much money currently resides on the server and can be hacked */\\n moneyAvailable: number;\\n\\n /** Maximum amount of money that this server can hold */\\n moneyMax: number;\\n\\n /** Number of open ports required in order to gain admin/root access */\\n numOpenPortsRequired: number;\\n\\n /** How many ports are currently opened on the server */\\n openPortCount: number;\\n\\n /** Hacking level required to hack this server */\\n requiredHackingSkill: number;\\n\\n /**\\n * Parameter that affects how effectively this server's money can\\n * be increased using the grow() Netscript function\\n */\\n serverGrowth: number;\\n}\\n\\n/**\\n * All multipliers affecting the difficulty of the current challenge.\\n * @public\\n */\\nexport interface BitNodeMultipliers {\\n /** Influences how quickly the player's agility level (not exp) scales */\\n AgilityLevelMultiplier: number;\\n /** Influences the base cost to purchase an augmentation. */\\n AugmentationMoneyCost: number;\\n /** Influences the base rep the player must have with a faction to purchase an augmentation. */\\n AugmentationRepCost: number;\\n /** Influences how quickly the player can gain rank within Bladeburner. */\\n BladeburnerRank: number;\\n /** Influences the cost of skill levels from Bladeburner. */\\n BladeburnerSkillCost: number;\\n /** Influences how quickly the player's charisma level (not exp) scales */\\n CharismaLevelMultiplier: number;\\n /** Influences the experience gained for each ability when a player completes a class. */\\n ClassGymExpGain: number;\\n /** Influences the amount of money gained from completing Coding Contracts */\\n CodingContractMoney: number;\\n /** Influences the experience gained for each ability when the player completes working their job. */\\n CompanyWorkExpGain: number;\\n /** Influences how much money the player earns when completing working their job. */\\n CompanyWorkMoney: number;\\n /** Influences the money gain from dividends of corporations created by the player. */\\n CorporationSoftcap: number;\\n /** Influences the valuation of corporations created by the player. */\\n CorporationValuation: number;\\n /** Influences the base experience gained for each ability when the player commits a crime. */\\n CrimeExpGain: number;\\n /** Influences the base money gained when the player commits a crime. */\\n CrimeMoney: number;\\n /** Influences how many Augmentations you need in order to get invited to the Daedalus faction */\\n DaedalusAugsRequirement: number;\\n /** Influences how quickly the player's defense level (not exp) scales */\\n DefenseLevelMultiplier: number;\\n /** Influences how quickly the player's dexterity level (not exp) scales */\\n DexterityLevelMultiplier: number;\\n /** Influences how much rep the player gains in each faction simply by being a member. */\\n FactionPassiveRepGain: number;\\n /** Influences the experience gained for each ability when the player completes work for a Faction. */\\n FactionWorkExpGain: number;\\n /** Influences how much rep the player gains when performing work for a faction. */\\n FactionWorkRepGain: number;\\n /** Influences how much it costs to unlock the stock market's 4S Market Data API */\\n FourSigmaMarketDataApiCost: number;\\n /** Influences how much it costs to unlock the stock market's 4S Market Data (NOT API) */\\n FourSigmaMarketDataCost: number;\\n /** Influences the respect gain and money gain of your gang. */\\n GangSoftcap: number;\\n /** Influences the experienced gained when hacking a server. */\\n HackExpGain: number;\\n /** Influences how quickly the player's hacking level (not experience) scales */\\n HackingLevelMultiplier: number;\\n /** Influences how much money is produced by Hacknet Nodes\\n * and the hash rate of Hacknet Servers (unlocked in BitNode-9) */\\n HacknetNodeMoney: number;\\n /** Influences how much money it costs to upgrade your home computer's RAM */\\n HomeComputerRamCost: number;\\n /** Influences how much money is gained when the player infiltrates a company. */\\n InfiltrationMoney: number;\\n /** Influences how much rep the player can gain from factions when selling stolen documents and secrets */\\n InfiltrationRep: number;\\n /** Influences how much money can be stolen from a server when the player\\n * performs a hack against it through the Terminal. */\\n ManualHackMoney: number;\\n /** Influence how much it costs to purchase a server */\\n PurchasedServerCost: number;\\n /** Influences the maximum number of purchased servers you can have */\\n PurchasedServerLimit: number;\\n /** Influences the maximum allowed RAM for a purchased server */\\n PurchasedServerMaxRam: number;\\n /** Influences cost of any purchased server at or above 128GB */\\n PurchasedServerSoftcap: number;\\n /** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */\\n RepToDonateToFaction: number;\\n /** Influences how much the money on a server can be reduced when a script performs a hack against it. */\\n ScriptHackMoney: number;\\n /** Influences how much of the money stolen by a scripted hack will be added to the player's money. */\\n ScriptHackMoneyGain: number;\\n /** Influences the growth percentage per cycle against a server. */\\n ServerGrowthRate: number;\\n /** Influences the maximum money that a server can grow to. */\\n ServerMaxMoney: number;\\n /** Influences the initial money that a server starts with. */\\n ServerStartingMoney: number;\\n /** Influences the initial security level (hackDifficulty) of a server. */\\n ServerStartingSecurity: number;\\n /** Influences the weaken amount per invocation against a server. */\\n ServerWeakenRate: number;\\n /** Influences how quickly the player's strength level (not exp) scales */\\n StrengthLevelMultiplier: number;\\n /** Influences the power of the gift */\\n StaneksGiftPowerMultiplier: number;\\n /** Influences the size of the gift */\\n StaneksGiftExtraSize: number;\\n /** Influences the hacking skill required to backdoor the world daemon. */\\n WorldDaemonDifficulty: number;\\n}\\n\\n/**\\n * Object representing all the values related to a hacknet node.\\n * @public\\n */\\nexport interface NodeStats {\\n /** Node's name */\\n name: string;\\n /** Node's level */\\n level: number;\\n /** Node's RAM (GB) */\\n ram: number;\\n /** Node's used RAM (GB) */\\n ramUsed?: number;\\n /** Node's number of cores */\\n cores: number;\\n /** Cache level. Only applicable for Hacknet Servers */\\n cache?: number;\\n /** Hash Capacity provided by this Node. Only applicable for Hacknet Servers */\\n hashCapacity?: number;\\n /** Node's production per second */\\n production: number;\\n /** Number of seconds since Node has been purchased */\\n timeOnline: number;\\n /** Total number of money Node has produced */\\n totalProduction: number;\\n}\\n\\n/** @public */\\nexport interface CharacterMult {\\n /** Agility stat */\\n agility: number;\\n /** Agility exp */\\n agilityExp: number;\\n /** Charisma stat */\\n charisma: number;\\n /** Charisma exp */\\n charismaExp: number;\\n /** Company reputation */\\n companyRep: number;\\n /** Money earned from crimes */\\n crimeMoney: number;\\n /** Crime success chance */\\n crimeSuccess: number;\\n /** Defense stat */\\n defense: number;\\n /** Defense exp */\\n defenseExp: number;\\n /** Dexterity stat */\\n dexterity: number;\\n /** Dexterity exp */\\n dexterityExp: number;\\n /** Faction reputation */\\n factionRep: number;\\n /** Hacking stat */\\n hacking: number;\\n /** Hacking exp */\\n hackingExp: number;\\n /** Strength stat */\\n strength: number;\\n /** Strength exp */\\n strengthExp: number;\\n /** Money earned from jobs */\\n workMoney: number;\\n}\\n\\n/** @public */\\nexport interface SleeveWorkGains {\\n /** Hacking exp gained from work */\\n workHackExpGain: number;\\n /** Strength exp gained from work */\\n workStrExpGain: number;\\n /** Defense exp gained from work, */\\n workDefExpGain: number;\\n /** Dexterity exp gained from work */\\n workDexExpGain: number;\\n /** Agility exp gained from work */\\n workAgiExpGain: number;\\n /** Charisma exp gained from work */\\n workChaExpGain: number;\\n /** Money gained from work */\\n workMoneyGain: number;\\n}\\n\\n/** @public */\\nexport interface SourceFileLvl {\\n /** The number of the source file */\\n n: number;\\n /** The level of the source file */\\n lvl: number;\\n}\\n\\n/**\\n * Bladeburner current action.\\n * @public\\n */\\nexport interface BladeburnerCurAction {\\n /** Type of Action */\\n type: string;\\n /** Name of Action */\\n name: string;\\n}\\n\\n/**\\n * Gang general info.\\n * @public\\n */\\nexport interface GangGenInfo {\\n /** Name of faction that the gang belongs to (\\\"Slum Snakes\\\", etc.) */\\n faction: string;\\n /** Indicating whether or not it's a hacking gang */\\n isHacking: boolean;\\n /** Money earned per game cycle */\\n moneyGainRate: number;\\n /** Gang's power for territory warfare */\\n power: number;\\n /** Gang's respect */\\n respect: number;\\n /** Respect earned per game cycle */\\n respectGainRate: number;\\n /** Amount of territory held */\\n territory: number;\\n /** Clash chance */\\n territoryClashChance: number;\\n /** Gang's wanted level */\\n wantedLevel: number;\\n /** Wanted level gained/lost per game cycle (negative for losses) */\\n wantedLevelGainRate: number;\\n /** Indicating if territory warfare is enabled */\\n territoryWarfareEngaged: boolean;\\n /** Number indicating the current wanted penalty */\\n wantedPenalty: number;\\n}\\n\\n/** @public */\\nexport interface GangOtherInfoObject {\\n /** Gang power */\\n power: number;\\n /** Gang territory, in decimal form */\\n territory: number;\\n}\\n\\n/** @public */\\nexport interface GangOtherInfo {\\n [key: string]: GangOtherInfoObject;\\n}\\n\\n/**\\n * Object representing data representing a gang member task.\\n * @public\\n */\\nexport interface GangTaskStats {\\n /** Task name */\\n name: string;\\n /** Task Description */\\n desc: string;\\n /** Is a task of a hacking gang */\\n isHacking: boolean;\\n /** Is a task of a combat gang */\\n isCombat: boolean;\\n /** Base respect earned */\\n baseRespect: number;\\n /** Base wanted earned */\\n baseWanted: number;\\n /** Base money earned */\\n baseMoney: number;\\n /** Hacking skill impact on task scaling */\\n hackWeight: number;\\n /** Strength skill impact on task scaling */\\n strWeight: number;\\n /** Defense skill impact on task scaling */\\n defWeight: number;\\n /** Dexterity skill impact on task scaling */\\n dexWeight: number;\\n /** Agility skill impact on task scaling */\\n agiWeight: number;\\n /** Charisma skill impact on task scaling */\\n chaWeight: number;\\n /** Number representing the difficulty of the task */\\n difficulty: number;\\n /** Territory impact on task scaling */\\n territory: GangTerritory;\\n}\\n\\n/**\\n * Object representing data representing a gang member equipment.\\n * @public\\n */\\nexport interface EquipmentStats {\\n /** Strength multiplier */\\n str?: number;\\n /** Defense multiplier */\\n def?: number;\\n /** Dexterity multiplier */\\n dex?: number;\\n /** Agility multiplier */\\n agi?: number;\\n /** Charisma multiplier */\\n cha?: number;\\n /** Hacking multiplier */\\n hack?: number;\\n}\\n\\n/** @public */\\nexport interface GangTerritory {\\n /** Money gain impact on task scaling */\\n money: number;\\n /** Respect gain impact on task scaling */\\n respect: number;\\n /** Wanted gain impact on task scaling */\\n wanted: number;\\n}\\n\\n/** @public */\\nexport interface GangMemberInfo {\\n /** Name of the gang member */\\n name: string;\\n /** Currently assigned task */\\n task: string;\\n earnedRespect: number;\\n\\n /** Hack skill level */\\n hack: number;\\n /** Strength skill level */\\n str: number;\\n /** Defense skill level */\\n def: number;\\n /** Dexterity skill level */\\n dex: number;\\n /** Agility skill level */\\n agi: number;\\n /** Charisma skill level */\\n cha: number;\\n\\n /** Current hack experience */\\n hack_exp: number;\\n /** Current strength experience */\\n str_exp: number;\\n /** Current defense experience */\\n def_exp: number;\\n /** Current dexterity experience */\\n dex_exp: number;\\n /** Current agility experience */\\n agi_exp: number;\\n /** Current charisma experience */\\n cha_exp: number;\\n\\n /** Hack multiplier from equipment */\\n hack_mult: number;\\n /** Strength multiplier from equipment */\\n str_mult: number;\\n /** Defense multiplier from equipment */\\n def_mult: number;\\n /** Dexterity multiplier from equipment */\\n dex_mult: number;\\n /** Agility multiplier from equipment */\\n agi_mult: number;\\n /** Charisma multiplier from equipment */\\n cha_mult: number;\\n\\n /** Hack multiplier from ascensions */\\n hack_asc_mult: number;\\n /** Strength multiplier from ascensions */\\n str_asc_mult: number;\\n /** Defense multiplier from ascensions */\\n def_asc_mult: number;\\n /** Dexterity multiplier from ascensions */\\n dex_asc_mult: number;\\n /** Agility multiplier from ascensions */\\n agi_asc_mult: number;\\n /** Charisma multiplier from ascensions */\\n cha_asc_mult: number;\\n\\n /** Total earned hack experience */\\n hack_asc_points: number;\\n /** Total earned strength experience */\\n str_asc_points: number;\\n /** Total earned defense experience */\\n def_asc_points: number;\\n /** Total earned dexterity experience */\\n dex_asc_points: number;\\n /** Total earned agility experience */\\n agi_asc_points: number;\\n /** Total earned charisma experience */\\n cha_asc_points: number;\\n\\n upgrades: string[];\\n augmentations: string[];\\n\\n respectGain: number;\\n wantedLevelGain: number;\\n moneyGain: number;\\n}\\n\\n/** @public */\\nexport interface GangMemberAscension {\\n /** Amount of respect lost from ascending */\\n respect: number;\\n /** Hacking multiplier gained from ascending */\\n hack: number;\\n /** Strength multiplier gained from ascending */\\n str: number;\\n /** Defense multiplier gained from ascending */\\n def: number;\\n /** Dexterity multiplier gained from ascending */\\n dex: number;\\n /** Agility multiplier gained from ascending */\\n agi: number;\\n /** Charisma multiplier gained from ascending */\\n cha: number;\\n}\\n\\n/**\\n * Object representing a sleeve stats.\\n * @public\\n */\\nexport interface SleeveSkills {\\n /** Current shock of the sleeve [0-100] */\\n shock: number;\\n /** Current sync of the sleeve [0-100] */\\n sync: number;\\n /** Current memory of the sleeve [1-100] */\\n memory: number;\\n /** Current hacking skill of the sleeve */\\n hacking: number;\\n /** Current strength of the sleeve */\\n strength: number;\\n /** Current defense of the sleeve */\\n defense: number;\\n /** Current dexterity of the sleeve */\\n dexterity: number;\\n /** Current agility of the sleeve */\\n agility: number;\\n /** Current charisma of the sleeve */\\n charisma: number;\\n}\\n\\n/**\\n * Object representing sleeve information.\\n * @public\\n */\\nexport interface SleeveInformation {\\n /** Location of the sleeve */\\n city: string;\\n /** hp of the sleeve */\\n hp: HP;\\n /** Jobs available to the sleeve */\\n jobs: string[];\\n /** Job titles available to the sleeve */\\n jobTitle: string[];\\n /** Does this sleeve have access to the tor router */\\n tor: boolean;\\n /** Sleeve multipliers */\\n mult: CharacterMult;\\n}\\n\\n/**\\n * Object representing a sleeve current task.\\n * @public\\n */\\nexport type SleeveTask = any;\\n\\n/**\\n * Object representing a port. A port is a serialized queue.\\n * @public\\n */\\nexport interface NetscriptPort {\\n /**\\n * Write data to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns The data popped off the queue if it was full.\\n */\\n write(value: string | number): PortData | null;\\n\\n /**\\n * Attempt to write data to the port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns True if the data was added to the port, false if the port was full\\n */\\n tryWrite(value: string | number): boolean;\\n\\n /**\\n * Shift an element out of the port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function will remove the first element from the port and return it.\\n * If the port is empty, then the string “NULL PORT DATA” will be returned.\\n * @returns the data read.\\n */\\n read(): PortData;\\n\\n /**\\n * Retrieve the first element from the port without removing it.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to peek at the data from a port. It returns the\\n * first element in the specified port without removing that element. If\\n * the port is empty, the string “NULL PORT DATA” will be returned.\\n * @returns the data read\\n */\\n peek(): PortData;\\n\\n /**\\n * Check if the port is full.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns true if the port is full, otherwise false\\n */\\n full(): boolean;\\n\\n /**\\n * Check if the port is empty.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns true if the port is empty, otherwise false\\n */\\n empty(): boolean;\\n\\n /**\\n * Empties all data from the port.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clear(): void;\\n}\\n\\n/**\\n * Stock market API\\n * @public\\n */\\nexport interface TIX {\\n /**\\n * Returns true if the player has access to a WSE Account\\n * @remarks RAM cost: 0.05 GB\\n */\\n hasWSEAccount(): boolean;\\n /**\\n * Returns true if the player has access to the TIX API\\n * @remarks RAM cost: 0.05 GB\\n */\\n hasTIXAPIAccess(): boolean;\\n /**\\n * Returns true if the player has access to the 4S Data\\n * @remarks RAM cost: 0.05 GB\\n */\\n has4SData(): boolean;\\n /**\\n * Returns true if the player has access to the 4SData TIX API\\n * @remarks RAM cost: 0.05 GB\\n */\\n has4SDataTIXAPI(): boolean;\\n /**\\n * Returns an array of the symbols of the tradable stocks\\n *\\n * @remarks RAM cost: 2 GB\\n * @returns Array of the symbols of the tradable stocks.\\n */\\n getSymbols(): string[];\\n\\n /**\\n * Returns the price of a stock.\\n *\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * The stock’s price is the average of its bid and ask prices. This function requires\\n * that you have the following:\\n *\\n * 1. WSE Account\\n *\\n * 1. TIX API Access\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * stock.getPrice(\\\"FSIG\\\");\\n *\\n * // Choose the first stock symbol from the array of stock symbols. Get the price\\n * // of the corresponding stock.\\n * var sym = stock.getSymbols()[0];\\n * tprint(\\\"Stock symbol: \\\" + sym);\\n * tprint(\\\"Stock price: \\\" + stock.getPrice(sym));\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.stock.getPrice(\\\"FSIG\\\");\\n *\\n * // Choose the first stock symbol from the array of stock symbols. Get the price\\n * // of the corresponding stock.\\n * const sym = ns.stock.getSymbols()[0];\\n * ns.tprint(\\\"Stock symbol: \\\" + sym);\\n * ns.tprint(\\\"Stock price: \\\" + ns.stock.getPrice(sym));\\n * ```\\n * @param sym - Stock symbol.\\n * @returns The price of a stock.\\n */\\n getPrice(sym: string): number;\\n\\n /**\\n * Returns the ask price of that stock.\\n * @remarks RAM cost: 2 GB\\n *\\n * @param sym - Stock symbol.\\n * @returns The ask price of a stock.\\n */\\n getAskPrice(sym: string): number;\\n\\n /**\\n * Returns the bid price of that stock.\\n * @remarks RAM cost: 2 GB\\n *\\n * @param sym - Stock symbol.\\n * @returns The bid price of a stock.\\n */\\n getBidPrice(sym: string): number;\\n\\n /**\\n * Returns the player’s position in a stock.\\n * @remarks\\n * RAM cost: 2 GB\\n * Returns an array of four elements that represents the player’s position in a stock.\\n *\\n * The first element is the returned array is the number of shares the player owns of\\n * the stock in the Long position. The second element in the array is the average price\\n * of the player’s shares in the Long position.\\n *\\n * The third element in the array is the number of shares the player owns of the stock\\n * in the Short position. The fourth element in the array is the average price of the\\n * player’s Short position.\\n *\\n * All elements in the returned array are numeric.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * var pos = stock.getPosition(\\\"ECP\\\");\\n * var shares = pos[0];\\n * var avgPx = pos[1];\\n * var sharesShort = pos[2];\\n * var avgPxShort = pos[3];\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * const [shares, avgPx, sharesShort, avgPxShort] = ns.stock.getPosition(\\\"ECP\\\");\\n * ```\\n * @param sym - Stock symbol.\\n * @returns Array of four elements that represents the player’s position in a stock.\\n */\\n getPosition(sym: string): [number, number, number, number];\\n\\n /**\\n * Returns the maximum number of shares of a stock.\\n * @remarks\\n * RAM cost: 2 GB\\n * This is the maximum amount of the stock that can be purchased\\n * in both the Long and Short positions combined.\\n *\\n * @param sym - Stock symbol.\\n * @returns Maximum number of shares that the stock has.\\n */\\n getMaxShares(sym: string): number;\\n\\n /**\\n * Calculates cost of buying stocks.\\n * @remarks\\n * RAM cost: 2 GB\\n * Calculates and returns how much it would cost to buy a given number of shares of a stock.\\n * This takes into account spread, large transactions influencing the price of the stock and commission fees.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to purchase.\\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\\n * @returns Cost to buy a given number of shares of a stock.\\n */\\n getPurchaseCost(sym: string, shares: number, posType: string): number;\\n\\n /**\\n * Calculate profit of selling stocks.\\n * @remarks\\n * RAM cost: 2 GB\\n * Calculates and returns how much you would gain from selling a given number of shares of a stock.\\n * This takes into account spread, large transactions influencing the price of the stock and commission fees.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell.\\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\\n * @returns Gain from selling a given number of shares of a stock.\\n */\\n getSaleGain(sym: string, shares: number, posType: string): number;\\n\\n /**\\n * Buy stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to purchase shares of a stock using a Market Order.\\n *\\n * If the player does not have enough money to purchase the specified number of shares,\\n * then no shares will be purchased. Remember that every transaction on the stock exchange\\n * costs a certain commission fee.\\n *\\n * If this function successfully purchases the shares, it will return the stock price at which\\n * each share was purchased. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\\n */\\n buyStock(sym: string, shares: number): number;\\n\\n /**\\n * Sell stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to sell shares of a stock using a Market Order.\\n *\\n * If the specified number of shares in the function exceeds the amount that the player\\n * actually owns, then this function will sell all owned shares. Remember that every\\n * transaction on the stock exchange costs a certain commission fee.\\n *\\n * The net profit made from selling stocks with this function is reflected in the script’s\\n * statistics. This net profit is calculated as:\\n *\\n * shares * (sell_price - average_price_of_purchased_shares)\\n *\\n * If the sale is successful, this function will return the stock price at\\n * which each share was sold. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\\n */\\n sellStock(sym: string, shares: number): number;\\n\\n /**\\n * Short stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to purchase a short position of a stock using a Market Order.\\n *\\n * The ability to short a stock is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * If the player does not have enough money to purchase the specified number of shares,\\n * then no shares will be purchased. Remember that every transaction on the stock exchange\\n * costs a certain commission fee.\\n *\\n * If the purchase is successful, this function will return the stock price at which each\\n * share was purchased. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to short. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\\n */\\n buyShort(sym: string, shares: number): number;\\n\\n /**\\n * Sell short stock.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to sell a short position of a stock using a Market Order.\\n *\\n * The ability to short a stock is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * If the specified number of shares exceeds the amount that the player actually owns,\\n * then this function will sell all owned shares. Remember that every transaction on\\n * the stock exchange costs a certain commission fee.\\n *\\n * If the sale is successful, this function will return the stock price at which each\\n * share was sold. Otherwise it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\\n */\\n sellShort(sym: string, shares: number): number;\\n\\n /**\\n * Place order for stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Places an order on the stock market. This function only works for Limit and Stop Orders.\\n *\\n * The ability to place limit and stop orders is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * Returns true if the order is successfully placed, and false otherwise.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\\n * @param price - Execution price for the order.\\n * @param type - Type of order.\\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\\n * @returns True if the order is successfully placed, and false otherwise.\\n */\\n placeOrder(sym: string, shares: number, price: number, type: string, pos: string): boolean;\\n\\n /**\\n * Cancel order for stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Cancels an outstanding Limit or Stop order on the stock market.\\n *\\n * The ability to use limit and stop orders is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\\n * @param price - Execution price for the order.\\n * @param type - Type of order.\\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\\n */\\n cancelOrder(sym: string, shares: number, price: number, type: string, pos: string): void;\\n\\n /**\\n * Returns your order book for the stock market.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * This is an object containing information for all the Limit and Stop Orders you have in the stock market.\\n * For each symbol you have a position in, the returned object will have a key with that symbol's name.\\n * The object's properties are each an array of {@link StockOrderObject}\\n * The object has the following structure:\\n *\\n * ```ts\\n * {\\n * string1: [ // Array of orders for this stock\\n * {\\n * shares: Order quantity\\n * price: Order price\\n * type: Order type\\n * position: Either \\\"L\\\" or \\\"S\\\" for Long or Short position\\n * },\\n * {\\n * ...\\n * },\\n * ...\\n * ],\\n * string2: [ // Array of orders for this stock\\n * ...\\n * ],\\n * ...\\n * }\\n * ```\\n * The “Order type” property can have one of the following four values: \\\"Limit Buy Order\\\", \\\"Limit Sell Order\\\", \\\"Stop Buy Order\\\", \\\"Stop Sell Order\\\".\\n * Note that the order book will only contain information for stocks that you actually have orders in.\\n *\\n * @example\\n * ```ts\\n * \\\"If you do not have orders in Nova Medical (NVMD), then the returned object will not have a “NVMD” property.\\\"\\n * {\\n * ECP: [\\n * {\\n * shares: 5,\\n * price: 100,000\\n * type: \\\"Stop Buy Order\\\",\\n * position: \\\"S\\\",\\n * },\\n * {\\n * shares: 25,\\n * price: 125,000\\n * type: \\\"Limit Sell Order\\\",\\n * position: \\\"L\\\",\\n * },\\n * ],\\n * SYSC: [\\n * {\\n * shares: 100,\\n * price: 10,000\\n * type: \\\"Limit Buy Order\\\",\\n * position: \\\"L\\\",\\n * },\\n * ],\\n * }\\n * ```\\n * @returns Object containing information for all the Limit and Stop Orders you have in the stock market.\\n */\\n getOrders(): StockOrder;\\n\\n /**\\n * Returns the volatility of the specified stock.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Volatility represents the maximum percentage by which a stock’s price can change every tick.\\n * The volatility is returned as a decimal value, NOT a percentage\\n * (e.g. if a stock has a volatility of 3%, then this function will return 0.03, NOT 3).\\n *\\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\\n *\\n * @param sym - Stock symbol.\\n * @returns Volatility of the specified stock.\\n */\\n getVolatility(sym: string): number;\\n\\n /**\\n * Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * The probability is returned as a decimal value, NOT a percentage\\n * (e.g. if a stock has a 60% chance of increasing, then this function will return 0.6, NOT 60).\\n *\\n * In other words, if this function returned 0.30 for a stock, then this means that the stock’s price has a\\n * 30% chance of increasing and a 70% chance of decreasing during the next tick.\\n *\\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\\n *\\n * @param sym - Stock symbol.\\n * @returns Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\\n */\\n getForecast(sym: string): number;\\n\\n /**\\n * Purchase 4S Market Data Access.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchase4SMarketData(): boolean;\\n\\n /**\\n * Purchase 4S Market Data TIX API Access.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchase4SMarketDataTixApi(): boolean;\\n\\n /**\\n * Purchase WSE Account.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchaseWseAccount(): boolean;\\n\\n /**\\n * Purchase TIX API Access\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchaseTixApi(): boolean;\\n}\\n\\n/**\\n * Singularity API\\n * @remarks\\n * This API requires Source-File 4 to use. The RAM cost of all these functions is multiplied by 16/4/1 based on Source-File 4 levels.\\n * @public\\n */\\nexport interface Singularity {\\n /**\\n * Backup game save.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function will automatically opens the backup save prompt and claim the free faction favour if available.\\n *\\n */\\n exportGame(): void;\\n\\n /**\\n * Returns Backup save bonus availability.\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * This function will check if there is a bonus for backing up your save.\\n *\\n */\\n exportGameBonus(): boolean;\\n\\n /**\\n * Take university class.\\n *\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start taking a course at a university.\\n * If you are already in the middle of some “working” action (such as working at a\\n * company, for a faction, or on a program), then running this function will automatically\\n * cancel that action and give you your earnings.\\n *\\n * The cost and experience gains for all of these universities and classes are the same as\\n * if you were to manually visit and take these classes.\\n *\\n * @param universityName - Name of university. You must be in the correct city for whatever university you specify.\\n * @param courseName - Name of course.\\n * @param focus - Acquire player focus on this class. Optional. Defaults to true.\\n * @returns True if action is successfully started, false otherwise.\\n */\\n universityCourse(universityName: string, courseName: string, focus?: boolean): boolean;\\n\\n /**\\n * Workout at the gym.\\n *\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n\\n * This function will automatically set you to start working out at a gym to train\\n * a particular stat. If you are already in the middle of some “working” action\\n * (such as working at a company, for a faction, or on a program), then running\\n * this function will automatically cancel that action and give you your earnings.\\n *\\n * The cost and experience gains for all of these gyms are the same as if you were\\n * to manually visit these gyms and train\\n *\\n * @param gymName - Name of gym. You must be in the correct city for whatever gym you specify.\\n * @param stat - The stat you want to train.\\n * @param focus - Acquire player focus on this gym workout. Optional. Defaults to true.\\n * @returns True if actions is successfully started, false otherwise.\\n */\\n gymWorkout(gymName: string, stat: string, focus?: boolean): boolean;\\n\\n /**\\n * Travel to another city.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows the player to travel to any city. The cost for using this\\n * function is the same as the cost for traveling through the Travel Agency.\\n *\\n * @param city - City to travel to.\\n * @returns True if action is successful, false otherwise.\\n */\\n travelToCity(city: string): boolean;\\n\\n /**\\n * Purchase the TOR router.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows you to automatically purchase a TOR router. The cost for\\n * purchasing a TOR router using this function is the same as if you were to\\n * manually purchase one.\\n *\\n * @returns True if actions is successful or you already own TOR router, false otherwise.\\n */\\n purchaseTor(): boolean;\\n\\n /**\\n * Purchase a program from the dark web.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows you to automatically purchase programs. You MUST have a\\n * TOR router in order to use this function. The cost of purchasing programs\\n * using this function is the same as if you were purchasing them through the Dark\\n * Web using the Terminal buy command.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * purchaseProgram(\\\"brutessh.exe\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.purchaseProgram(\\\"brutessh.exe\\\");\\n * ```\\n * @param programName - Name of program to purchase.\\n * @returns True if the specified program is purchased, and false otherwise.\\n */\\n purchaseProgram(programName: string): boolean;\\n\\n /**\\n * Check if the player is busy.\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * Returns a boolean indicating whether or not the player is currently performing an\\n * ‘action’. These actions include working for a company/faction, studying at a university,\\n * working out at a gym, creating a program, committing a crime, or carrying out a Hacking Mission.\\n *\\n * @returns True if the player is currently performing an ‘action’, false otherwise.\\n */\\n isBusy(): boolean;\\n\\n /**\\n * Stop the current action.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function is used to end whatever ‘action’ the player is currently performing.\\n * The player will receive whatever money/experience/etc. he has earned from that action.\\n *\\n * The actions that can be stopped with this function are:\\n *\\n * * Studying at a university\\n * * Working out at a gym\\n * * Working for a company/faction\\n * * Creating a program\\n * * Committing a crime\\n *\\n * This function will return true if the player’s action was ended.\\n * It will return false if the player was not performing an action when this function was called.\\n *\\n * @returns True if the player’s action was ended, false if the player was not performing an action.\\n */\\n stopAction(): boolean;\\n\\n /**\\n * Upgrade home computer RAM.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will upgrade amount of RAM on the player’s home computer. The cost is\\n * the same as if you were to do it manually.\\n *\\n * This function will return true if the player’s home computer RAM is successfully upgraded, and false otherwise.\\n *\\n * @returns True if the player’s home computer RAM is successfully upgraded, and false otherwise.\\n */\\n upgradeHomeRam(): boolean;\\n\\n /**\\n * Upgrade home computer cores.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will upgrade amount of cores on the player’s home computer. The cost is\\n * the same as if you were to do it manually.\\n *\\n * This function will return true if the player’s home computer cores is successfully upgraded, and false otherwise.\\n *\\n * @returns True if the player’s home computer cores is successfully upgraded, and false otherwise.\\n */\\n upgradeHomeCores(): boolean;\\n\\n /**\\n * Get the price of upgrading home RAM.\\n * @remarks\\n * RAM cost: 1.5 GB * 16/4/1\\n *\\n *\\n * Returns the cost of upgrading the player’s home computer RAM.\\n *\\n * @returns Cost of upgrading the player’s home computer RAM.\\n */\\n getUpgradeHomeRamCost(): number;\\n\\n /**\\n * Get the price of upgrading home cores.\\n * @remarks\\n * RAM cost: 1.5 GB * 16/4/1\\n *\\n *\\n * Returns the cost of upgrading the player’s home computer cores.\\n *\\n * @returns Cost of upgrading the player’s home computer cores.\\n */\\n getUpgradeHomeCoresCost(): number;\\n\\n /**\\n * Work for a company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working at the company\\n * at which you are employed. If you are already in the middle of some “working”\\n * action (such as working for a faction, training at a gym, or creating a program),\\n * then running this function will automatically cancel that action and give you\\n * your earnings.\\n *\\n * This function will return true if the player starts working, and false otherwise.\\n *\\n * Note that when you are working for a company, you will not actually receive your earnings (reputation, money, experience) until you FINISH the action.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //If you only want to work until you get 100,000 company reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (getCompanyRep(COMPANY HERE) < VALUE) {\\n * workForCompany();\\n * sleep(60000);\\n * }\\n * //This way, your company reputation will be updated every minute.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //If you only want to work until you get 100,000 company reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (ns.getCompanyRep(COMPANY HERE) < VALUE) {\\n * ns.workForCompany();\\n * await ns.sleep(60000);\\n * }\\n * //This way, your company reputation will be updated every minute.\\n * ```\\n * @param companyName - Name of company to work for. Must be an exact match. Optional. If not specified, this argument defaults to the last job that you worked\\n * @param focus - Acquire player focus on this work operation. Optional. Defaults to true.\\n * @returns True if the player starts working, and false otherwise.\\n */\\n workForCompany(companyName: string, focus?: boolean): boolean;\\n\\n /**\\n * Quit jobs by company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will finish work with the company provided and quit any jobs.\\n *\\n * @param companyName - Name of the company.\\n */\\n quitJob(companyName?: string): void;\\n\\n /**\\n * Apply for a job at a company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically try to apply to the specified company\\n * for a position in the specified field. This function can also be used to\\n * apply for promotions by specifying the company and field you are already\\n * employed at.\\n *\\n * This function will return true if you successfully get a job/promotion,\\n * and false otherwise. Note that if you are trying to use this function to\\n * apply for a promotion and you don’t get one, it will return false.\\n *\\n * @param companyName - Name of company to apply to.\\n * @param field - Field to which you want to apply.\\n * @returns True if the player successfully get a job/promotion, and false otherwise.\\n */\\n applyToCompany(companyName: string, field: string): boolean;\\n\\n /**\\n * Get company reputation.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of reputation you have at the specified company.\\n * If the company passed in as an argument is invalid, -1 will be returned.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of reputation you have at the specified company.\\n */\\n getCompanyRep(companyName: string): number;\\n\\n /**\\n * Get company favor.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of favor you have at the specified company.\\n * If the company passed in as an argument is invalid, -1 will be returned.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of favor you have at the specified company.\\n */\\n getCompanyFavor(companyName: string): number;\\n\\n /**\\n * Get company favor gain.\\n * @remarks\\n * RAM cost: 0.75 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of favor you will gain for the specified\\n * company when you reset by installing Augmentations.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of favor you gain at the specified company when you reset by installing Augmentations.\\n */\\n getCompanyFavorGain(companyName: string): number;\\n\\n /**\\n * List all current faction invitations.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * Returns an array with the name of all Factions you currently have outstanding invitations from.\\n *\\n * @returns Array with the name of all Factions you currently have outstanding invitations from.\\n */\\n checkFactionInvitations(): string[];\\n\\n /**\\n * Join a faction.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically accept an invitation from a faction and join it.\\n *\\n * @param faction - Name of faction to join.\\n * @returns True if player joined the faction, and false otherwise.\\n */\\n joinFaction(faction: string): boolean;\\n\\n /**\\n * Work for a faction.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working for the specified faction.\\n * Obviously, you must be a member of the faction or else this function will fail. If\\n * you are already in the middle of some “working” action (such as working for a company,\\n * training at a gym, or creating a program), then running this function will automatically\\n * cancel that action and give you your earnings.\\n *\\n * This function will return true if you successfully start working for the specified faction, and false otherwise.\\n *\\n * Note that when you are working for a faction, you will not actually receive your earnings (reputation, experience) until you FINISH the action.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //If you only want to work until you get 100,000 faction reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (getFactionRep(FACTION NAME) < VALUE) {\\n * workForFaction(FACNAME, WORKTYPE);\\n * sleep(60000);\\n * }\\n * //This way, your faction reputation will be updated every minute.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //If you only want to work until you get 100,000 faction reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (ns.getFactionRep(FACTION NAME) < VALUE) {\\n * ns.workForFaction(FACNAME, WORKTYPE);\\n * await ns.sleep(60000);\\n * }\\n * //This way, your faction reputation will be updated every minute.\\n * ```\\n * @param faction - Name of faction to work for.\\n * @param workType - Type of work to perform for the faction.\\n * @param focus - Acquire player focus on this work operation. Optional. Defaults to true.\\n * @returns True if the player starts working, and false otherwise.\\n */\\n workForFaction(faction: string, workType: string, focus?: boolean): boolean;\\n\\n /**\\n * Get faction reputation.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of reputation you have for the specified faction.\\n *\\n * @param faction - Name of faction to work for.\\n * @returns Amount of reputation you have for the specified faction.\\n */\\n getFactionRep(faction: string): number;\\n\\n /**\\n * Get faction favor.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of favor you have for the specified faction.\\n *\\n * @param faction - Name of faction.\\n * @returns Amount of favor you have for the specified faction.\\n */\\n getFactionFavor(faction: string): number;\\n\\n /**\\n * Get faction favor gain.\\n * @remarks\\n * RAM cost: 0.75 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of favor you will gain for the specified\\n * faction when you reset by installing Augmentations.\\n *\\n * @param faction - Name of faction.\\n * @returns Amount of favor you will gain for the specified faction when you reset by installing Augmentations.\\n */\\n getFactionFavorGain(faction: string): number;\\n\\n /**\\n * Donate to a faction.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Attempts to donate money to the specified faction in exchange for reputation.\\n * Returns true if you successfully donate the money, and false otherwise.\\n *\\n * @param faction - Name of faction to donate to.\\n * @param amount - Amount of money to donate.\\n * @returns True if the money was donated, and false otherwise.\\n */\\n donateToFaction(faction: string, amount: number): boolean;\\n\\n /**\\n * Create a program.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working on creating the\\n * specified program. If you are already in the middle of some “working” action\\n * (such as working for a company, training at a gym, or taking a course), then\\n * running this function will automatically cancel that action and give you your\\n * earnings.\\n *\\n * This function returns true if you successfully start working on the specified program, and false otherwise.\\n *\\n * Note that creating a program using this function has the same hacking level requirements as it normally would. These level requirements are:\\n * * BruteSSH.exe: 50\\n * * FTPCrack.exe: 100\\n * * relaySMTP.exe: 250\\n * * HTTPWorm.exe: 500\\n * * SQLInject.exe: 750\\n * * DeepscanV1.exe: 75\\n * * DeepscanV2.exe: 400\\n * * ServerProfiler.exe: 75\\n * * AutoLink.exe: 25\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * createProgram(“relaysmtp.exe”);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.createProgram(“relaysmtp.exe”);\\n * ```\\n * @param program - Name of program to create.\\n * @param focus - Acquire player focus on this program creation. Optional. Defaults to true.\\n * @returns True if you successfully start working on the specified program, and false otherwise.\\n */\\n createProgram(program: string, focus?: boolean): boolean;\\n\\n /**\\n * Commit a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function is used to automatically attempt to commit crimes.\\n * If you are already in the middle of some ‘working’ action (such\\n * as working for a company or training at a gym), then running this\\n * function will automatically cancel that action and give you your\\n * earnings.\\n *\\n * This function returns the number of milliseconds it takes to attempt the\\n * specified crime (e.g It takes 60 seconds to attempt the ‘Rob Store’ crime,\\n * so running `commitCrime('rob store')` will return 60,000).\\n *\\n * Warning: I do not recommend using the time returned from this function to try\\n * and schedule your crime attempts. Instead, I would use the isBusy Singularity\\n * function to check whether you have finished attempting a crime. This is because\\n * although the game sets a certain crime to be X amount of seconds, there is no\\n * guarantee that your browser will follow that time limit.\\n *\\n * @param crime - Name of crime to attempt.\\n * @param focus - Acquire player focus on this crime. Optional. Defaults to true.\\n * @returns The number of milliseconds it takes to attempt the specified crime.\\n */\\n commitCrime(crime: string, focus?: boolean): number;\\n\\n /**\\n * Get chance to successfully commit a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns your chance of success at committing the specified crime.\\n *\\n * @param crime - Name of crime.\\n * @returns Chance of success at committing the specified crime.\\n */\\n getCrimeChance(crime: string): number;\\n\\n /**\\n * Get stats related to a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Returns the stats of the crime.\\n *\\n * @param crime - Name of crime. Not case-sensitive\\n * @returns The stats of the crime.\\n */\\n getCrimeStats(crime: string): CrimeStats;\\n\\n /**\\n * Get a list of owned augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array containing the names (as strings) of all Augmentations you have.\\n *\\n * @param purchased - Specifies whether the returned array should include Augmentations you have purchased but not yet installed. By default, this argument is false which means that the return value will NOT have the purchased Augmentations.\\n * @returns Array containing the names (as strings) of all Augmentations you have.\\n */\\n getOwnedAugmentations(purchased?: boolean): string[];\\n\\n /**\\n * Get a list of acquired Source-Files.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Returns an array of source files\\n *\\n * @returns Array containing an object with number and level of the source file.\\n */\\n getOwnedSourceFiles(): SourceFileLvl[];\\n\\n /**\\n * Get a list of augmentation available from a faction.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Returns an array containing the names (as strings) of all Augmentations\\n * that are available from the specified faction.\\n *\\n * @param faction - Name of faction.\\n * @returns Array containing the names of all Augmentations.\\n */\\n getAugmentationsFromFaction(faction: string): string[];\\n\\n /**\\n * Get the pre-requisite of an augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array with the names of the prerequisite Augmentation(s) for the specified Augmentation.\\n * If there are no prerequisites, a blank array is returned.\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Array with the names of the prerequisite Augmentation(s) for the specified Augmentation.\\n */\\n getAugmentationPrereq(augName: string): string[];\\n\\n /**\\n * Get the price and reputation of an augmentation.\\n * @deprecated use getAugmentationPrice getAugmentationRepReq\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array with two elements that gives the cost for\\n * the specified Augmentation. The first element in the returned array is the\\n * reputation requirement of the Augmentation, and the second element is the\\n * money cost.\\n *\\n * If an invalid Augmentation name is passed in for the augName argument, this\\n * function will return the array [-1, -1].\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Array with first element as a reputation requirement and second element as the money cost.\\n */\\n getAugmentationCost(augName: string): [number, number];\\n\\n /**\\n * Get price of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Price of the augmentation.\\n */\\n getAugmentationPrice(augName: string): number;\\n\\n /**\\n * Get base price of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Base price of the augmentation, before price multiplier.\\n */\\n getAugmentationBasePrice(augName: string): number;\\n\\n /**\\n * Get reputation requirement of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Reputation requirement of the augmentation.\\n */\\n getAugmentationRepReq(augName: string): number;\\n\\n /**\\n * Purchase an augmentation\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will try to purchase the specified Augmentation through the given Faction.\\n *\\n * This function will return true if the Augmentation is successfully purchased, and false otherwise.\\n *\\n * @param faction - Name of faction to purchase Augmentation from.\\n * @param augmentation - Name of Augmentation to purchase.\\n * @returns True if the Augmentation is successfully purchased, and false otherwise.\\n */\\n purchaseAugmentation(faction: string, augmentation: string): boolean;\\n\\n /**\\n * Get the stats of an augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns augmentation stats.\\n *\\n * @param name - Name of Augmentation. CASE-SENSITIVE.\\n * @returns Augmentation stats.\\n */\\n getAugmentationStats(name: string): Multipliers;\\n\\n /**\\n * Install your purchased augmentations.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will automatically install your Augmentations, resetting the game as usual. If you do not own uninstalled Augmentations then the game will not reset.\\n *\\n * @param cbScript - This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.\\n */\\n installAugmentations(cbScript?: string): void;\\n\\n /**\\n * Hospitalize the player.\\n * @remarks\\n * RAM cost: 0.25 GB * 16/4/1\\n */\\n hospitalize(): void;\\n\\n /**\\n * Soft reset the game.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will perform a reset even if you don’t have any augmentation installed.\\n *\\n * @param cbScript - This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.\\n */\\n softReset(cbScript: string): void;\\n\\n /**\\n * Go to a location.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Move the player to a specific location.\\n *\\n * @param locationName - Name of the location.\\n * @returns True if the player was moved there, false otherwise.\\n */\\n goToLocation(locationName: string): boolean;\\n\\n /**\\n * Get the current server.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Name of the current server.\\n */\\n getCurrentServer(): string;\\n\\n /**\\n * Connect to a server.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * Run the connect HOSTNAME command in the terminal. Can only connect to neighbors.\\n *\\n * @returns True if the connect command was successful, false otherwise.\\n */\\n connect(hostname: string): boolean;\\n\\n /**\\n * Run the hack command in the terminal.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Amount of money stolen by manual hacking.\\n */\\n manualHack(): Promise<number>;\\n\\n /**\\n * Run the backdoor command in the terminal.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Promise waiting for the installation to finish.\\n */\\n installBackdoor(): Promise<void>;\\n\\n /**\\n * Check if the player is focused.\\n * @remarks\\n * RAM cost: 0.1 GB * 16/4/1\\n *\\n *\\n * @returns True if the player is focused.\\n */\\n isFocused(): boolean;\\n\\n /**\\n * Set the players focus.\\n * @remarks\\n * RAM cost: 0.1 GB * 16/4/1\\n *\\n * @returns True if the focus was changed.\\n */\\n setFocus(focus: boolean): boolean;\\n\\n /**\\n * Get a list of programs offered on the dark web.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function allows the player to get a list of programs available for purchase\\n * on the dark web. Players MUST have purchased Tor to get the list of programs\\n * available. If Tor has not been purchased yet, this function will return an\\n * empty list.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * getDarkwebPrograms();\\n * // returns ['BruteSSH.exe', 'FTPCrack.exe'...etc]\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.getDarkwebPrograms();\\n * // returns ['BruteSSH.exe', 'FTPCrack.exe'...etc]\\n * ```\\n * @returns - a list of programs available for purchase on the dark web, or [] if Tor has not\\n * been purchased\\n */\\n getDarkwebPrograms(): string[];\\n\\n /**\\n * Check the price of an exploit on the dark web\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * This function allows you to check the price of a darkweb exploit/program.\\n * You MUST have a TOR router in order to use this function. The price returned\\n * by this function is the same price you would see with buy -l from the terminal.\\n * Returns the cost of the program if it has not been purchased yet, 0 if it\\n * has already been purchased, or -1 if Tor has not been purchased (and thus\\n * the program/exploit is not available for purchase).\\n *\\n * If the program does not exist, an error is thrown.\\n *\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * getDarkwebProgramCost(\\\"brutessh.exe\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.getDarkwebProgramCost(\\\"brutessh.exe\\\");\\n * ```\\n * @param programName - Name of program to check the price of\\n * @returns Price of the specified darkweb program\\n * (if not yet purchased), 0 if it has already been purchased, or -1 if Tor has not been\\n * purchased. Throws an error if the specified program/exploit does not exist\\n */\\n getDarkwebProgramCost(programName: string): number;\\n\\n /**\\n * b1t_flum3 into a different BN.\\n * @remarks\\n * RAM cost: 16 GB * 16/4/1\\n *\\n * @param nextBN - BN number to jump to\\n * @param callbackScript - Name of the script to launch in the next BN.\\n */\\n b1tflum3(nextBN: number, callbackScript?: string): void;\\n\\n /**\\n * Destroy the w0r1d_d43m0n and move on to the next BN.\\n * @remarks\\n * RAM cost: 32 GB * 16/4/1\\n *\\n * You must have the special augment installed and the required hacking level\\n * OR\\n * Completed the final black op.\\n *\\n * @param nextBN - BN number to jump to\\n * @param callbackScript - Name of the script to launch in the next BN.\\n */\\n destroyW0r1dD43m0n(nextBN: number, callbackScript?: string): void;\\n\\n /**\\n * Get the current work the player is doing.\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n * @returns - An object representing the current work. Fields depend on the kind of work.\\n */\\n getCurrentWork(): any | null;\\n}\\n\\n/**\\n * Hacknet API\\n * @remarks\\n * Not all these functions are immediately available.\\n * @public\\n */\\nexport interface Hacknet {\\n /**\\n * Get the number of hacknet nodes you own.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the number of Hacknet Nodes you own.\\n *\\n * @returns Number of hacknet nodes.\\n */\\n numNodes(): number;\\n\\n /**\\n * Get the maximum number of hacknet nodes.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns Maximum number of hacknet nodes.\\n */\\n maxNumNodes(): number;\\n\\n /**\\n * Purchase a new hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Purchases a new Hacknet Node. Returns a number with the index of the\\n * Hacknet Node. This index is equivalent to the number at the end of\\n * the Hacknet Node’s name (e.g The Hacknet Node named `hacknet-node-4`\\n * will have an index of 4).\\n *\\n * If the player cannot afford to purchase a new Hacknet Node then the function will return -1.\\n *\\n * @returns The index of the Hacknet Node or if the player cannot afford to purchase a new Hacknet Node the function will return -1.\\n */\\n purchaseNode(): number;\\n\\n /**\\n * Get the price of the next hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of purchasing a new Hacknet Node.\\n *\\n * @returns Cost of purchasing a new Hacknet Node.\\n */\\n getPurchaseNodeCost(): number;\\n\\n /**\\n * Get the stats of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns an object containing a variety of stats about the specified Hacknet Node.\\n *\\n * Note that for Hacknet Nodes, production refers to the amount of money the node generates.\\n * For Hacknet Servers (the upgraded version of Hacknet Nodes), production refers to the\\n * amount of hashes the node generates.\\n *\\n * @param index - Index/Identifier of Hacknet Node\\n * @returns Object containing a variety of stats about the specified Hacknet Node.\\n */\\n getNodeStats(index: number): NodeStats;\\n\\n /**\\n * Upgrade the level of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to upgrade the level of the specified Hacknet Node by n.\\n *\\n * Returns true if the Hacknet Node’s level is successfully upgraded by n\\n * or if it is upgraded by some positive amount and the Node reaches its max level.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of levels to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s level is successfully upgraded, false otherwise.\\n */\\n upgradeLevel(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the RAM of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to upgrade the specified Hacknet Node’s RAM n times.\\n * Note that each upgrade doubles the Node’s RAM.\\n * So this is equivalent to multiplying the Node’s RAM by 2 n.\\n *\\n * Returns true if the Hacknet Node’s RAM is successfully upgraded n times\\n * or if it is upgraded some positive number of times and the Node reaches its max RAM.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s RAM is successfully upgraded, false otherwise.\\n */\\n upgradeRam(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the core of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to purchase n cores for the specified Hacknet Node.\\n *\\n * Returns true if it successfully purchases n cores for the Hacknet Node\\n * or if it purchases some positive amount and the Node reaches its max number of cores.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of cores to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s cores are successfully purchased, false otherwise.\\n */\\n upgradeCore(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the cache of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Tries to upgrade the specified Hacknet Server’s cache n times.\\n *\\n * Returns true if it successfully upgrades the Server’s cache n times,\\n * or if it purchases some positive amount and the Server reaches its max cache level.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of cache levels to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s cache level is successfully upgraded, false otherwise.\\n */\\n upgradeCache(index: number, n: number): boolean;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node levels.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the specified Hacknet Node by n levels.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of levels to upgrade. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node.\\n */\\n getLevelUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node RAM.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the RAM of the specified Hacknet Node n times.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node already has max RAM, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's RAM.\\n */\\n getRamUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node cores.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the number of cores of the specified Hacknet Node by n.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade cores. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's number of cores.\\n */\\n getCoreUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node cache.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the cost of upgrading the cache level of the specified Hacknet Server by n.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade cache. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's cache.\\n */\\n getCacheUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Get the total number of hashes stored.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes you have.\\n *\\n * @returns Number of hashes you have.\\n */\\n numHashes(): number;\\n\\n /**\\n * Get the maximum number of hashes you can store.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes you can store.\\n *\\n * @returns Number of hashes you can store.\\n */\\n hashCapacity(): number;\\n\\n /**\\n * Get the cost of a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes required for the specified upgrade. The name of the upgrade must be an exact match.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var upgradeName = \\\"Sell for Corporation Funds\\\";\\n * if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {\\n * hacknet.spendHashes(upgradeName);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const upgradeName = \\\"Sell for Corporation Funds\\\";\\n * if (ns.hacknet.numHashes() > ns.hacknet.hashCost(upgradeName)) {\\n * ns.hacknet.spendHashes(upgradeName);\\n * }\\n * ```\\n * @param upgName - Name of the upgrade of Hacknet Node.\\n * @param count - Number of upgrades to buy at once. Defaults to 1 if not specified.\\n * @returns Number of hashes required for the specified upgrade.\\n */\\n hashCost(upgName: string, count?: number): number;\\n\\n /**\\n * Purchase a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Spend the hashes generated by your Hacknet Servers on an upgrade.\\n * Returns a boolean value - true if the upgrade is successfully purchased, and false otherwise.\\n *\\n * The name of the upgrade must be an exact match.\\n * The `upgTarget` argument is used for upgrades such as `Reduce Minimum Security`, which applies to a specific server.\\n * In this case, the `upgTarget` argument must be the hostname of the server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * hacknet.spendHashes(\\\"Sell for Corporation Funds\\\");\\n * hacknet.spendHashes(\\\"Increase Maximum Money\\\", \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * NS2:\\n * ns.hacknet.spendHashes(\\\"Sell for Corporation Funds\\\");\\n * ns.hacknet.spendHashes(\\\"Increase Maximum Money\\\", \\\"foodnstuff\\\");\\n * ```\\n * @param upgName - Name of the upgrade of Hacknet Node.\\n * @param upgTarget - Object to which upgrade applies. Required for certain upgrades.\\n * @param count - Number of upgrades to buy at once. Defaults to 1 if not specified.\\n * For compatibility reasons, upgTarget must be specified, even if it is not used, in order to specify count.\\n * @returns True if the upgrade is successfully purchased, and false otherwise.\\n */\\n spendHashes(upgName: string, upgTarget?: string, count?: number): boolean;\\n\\n /**\\n * Get the list of hash upgrades\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the list of all available hash upgrades that can be used in the spendHashes function.\\n * @example\\n * ```ts\\n * // NS1:\\n * var upgrades = hacknet.getHashUpgrades(); // [\\\"Sell for Money\\\",\\\"Sell for Corporation Funds\\\",...]\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const upgrades = ns.hacknet.getHashUpgrades(); // [\\\"Sell for Money\\\",\\\"Sell for Corporation Funds\\\",...]\\n * ```\\n * @returns An array containing the available upgrades\\n */\\n getHashUpgrades(): string[];\\n\\n /**\\n * Get the level of a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Level of the upgrade.\\n */\\n getHashUpgradeLevel(upgName: string): number;\\n\\n /**\\n * Get the multiplier to study.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Multiplier.\\n */\\n getStudyMult(): number;\\n\\n /**\\n * Get the multiplier to training.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Multiplier.\\n */\\n getTrainingMult(): number;\\n}\\n\\n/**\\n * Bladeburner API\\n * @remarks\\n * You have to be employed in the Bladeburner division and be in BitNode-7\\n * or have Source-File 7 in order to use this API.\\n * @public\\n */\\nexport interface Bladeburner {\\n /**\\n * List all contracts.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner contracts.\\n *\\n * @returns Array of strings containing the names of all Bladeburner contracts.\\n */\\n getContractNames(): string[];\\n\\n /**\\n * List all operations.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner operations.\\n *\\n * @returns Array of strings containing the names of all Bladeburner operations.\\n */\\n getOperationNames(): string[];\\n\\n /**\\n * List all black ops.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner Black Ops.\\n *\\n * @returns Array of strings containing the names of all Bladeburner Black Ops.\\n */\\n getBlackOpNames(): string[];\\n\\n /**\\n * List all general actions.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all general Bladeburner actions.\\n *\\n * @returns Array of strings containing the names of all general Bladeburner actions.\\n */\\n getGeneralActionNames(): string[];\\n\\n /**\\n * List all skills.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all general Bladeburner skills.\\n *\\n * @returns Array of strings containing the names of all general Bladeburner skills.\\n */\\n getSkillNames(): string[];\\n\\n /**\\n * Start an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to start the specified Bladeburner action.\\n * Returns true if the action was started successfully, and false otherwise.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match\\n * @returns True if the action was started successfully, and false otherwise.\\n */\\n startAction(type: string, name: string): boolean;\\n\\n /**\\n * Stop current action.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Stops the current Bladeburner action.\\n *\\n */\\n stopBladeburnerAction(): void;\\n\\n /**\\n * Get current action.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns an object that represents the player’s current Bladeburner action.\\n * If the player is not performing an action, the function will return an object with the ‘type’ property set to “Idle”.\\n *\\n * @returns Object that represents the player’s current Bladeburner action.\\n */\\n getCurrentAction(): BladeburnerCurAction;\\n\\n /**\\n * Get the time to complete an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of milliseconds it takes to complete the specified action\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Number of milliseconds it takes to complete the specified action.\\n */\\n getActionTime(type: string, name: string): number;\\n\\n /**\\n * Get the time elapsed on current action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of milliseconds already spent on the current action.\\n *\\n * @returns Number of milliseconds already spent on the current action.\\n */\\n getActionCurrentTime(): number;\\n\\n /**\\n * Get estimate success chance of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated success chance for the specified action.\\n * This chance is returned as a decimal value, NOT a percentage\\n * (e.g. if you have an estimated success chance of 80%, then this function will return 0.80, NOT 80).\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Estimated success chance for the specified action.\\n */\\n getActionEstimatedSuccessChance(type: string, name: string): [number, number];\\n\\n /**\\n * Get the reputation gain of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the average Bladeburner reputation gain for successfully\\n * completing the specified action.\\n * Note that this value is an ‘average’ and the real reputation gain may vary slightly from this value.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param level - Optional action level at which to calculate the gain\\n * @returns Average Bladeburner reputation gain for successfully completing the specified action.\\n */\\n getActionRepGain(type: string, name: string, level: number): number;\\n\\n /**\\n * Get action count remaining.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the remaining count of the specified action.\\n *\\n * Note that this is meant to be used for Contracts and Operations.\\n * This function will return ‘Infinity’ for actions such as Training and Field Analysis.\\n * This function will return 1 for BlackOps not yet completed regardless of whether\\n * the player has the required rank to attempt the mission or not.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Remaining count of the specified action.\\n */\\n getActionCountRemaining(type: string, name: string): number;\\n\\n /**\\n * Get the maximum level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the maximum level for this action.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Maximum level of the specified action.\\n */\\n getActionMaxLevel(type: string, name: string): number;\\n\\n /**\\n * Get the current level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the current level of this action.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Current level of the specified action.\\n */\\n getActionCurrentLevel(type: string, name: string): number;\\n\\n /**\\n * Get whether an action is set to autolevel.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action is currently set to autolevel.\\n *\\n * Returns false if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns True if the action is set to autolevel, and false otherwise.\\n */\\n getActionAutolevel(type: string, name: string): boolean;\\n\\n /**\\n * Set an action autolevel.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Enable/disable autoleveling for the specified action.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param autoLevel - Whether or not to autolevel this action\\n */\\n setActionAutolevel(type: string, name: string, autoLevel: boolean): void;\\n\\n /**\\n * Set the level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Set the level for the specified action.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param level - Level to set this action to.\\n */\\n setActionLevel(type: string, name: string, level: number): void;\\n\\n /**\\n * Get player bladeburner rank.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the player’s Bladeburner Rank.\\n *\\n * @returns Player’s Bladeburner Rank.\\n */\\n getRank(): number;\\n\\n /**\\n * Get black op required rank.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Returns the rank required to complete this BlackOp.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param name - Name of BlackOp. Must be an exact match.\\n * @returns Rank required to complete this BlackOp.\\n */\\n getBlackOpRank(name: string): number;\\n\\n /**\\n * Get bladeburner skill points.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of Bladeburner skill points you have.\\n *\\n * @returns Number of Bladeburner skill points you have.\\n */\\n getSkillPoints(): number;\\n\\n /**\\n * Get skill level.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * This function returns your level in the specified skill.\\n *\\n * The function returns -1 if an invalid skill name is passed in.\\n *\\n * @param skillName - Name of skill. Case-sensitive and must be an exact match\\n * @returns Level in the specified skill.\\n */\\n getSkillLevel(name: string): number;\\n\\n /**\\n * Get cost to upgrade skill.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * This function returns the number of skill points needed to upgrade the specified skill the specified number of times.\\n *\\n * The function returns -1 if an invalid skill name is passed in.\\n *\\n * @param skillName - Name of skill. Case-sensitive and must be an exact match\\n * @param count - Number of times to upgrade the skill. Defaults to 1 if not specified.\\n * @returns Number of skill points needed to upgrade the specified skill.\\n */\\n getSkillUpgradeCost(name: string, count?: number): number;\\n\\n /**\\n * Upgrade skill.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to upgrade the specified Bladeburner skill the specified number of times.\\n *\\n * Returns true if the skill is successfully upgraded, and false otherwise.\\n *\\n * @param skillName - Name of skill to be upgraded. Case-sensitive and must be an exact match\\n * @param count - Number of times to upgrade the skill. Defaults to 1 if not specified.\\n * @returns true if the skill is successfully upgraded, and false otherwise.\\n */\\n upgradeSkill(name: string, count?: number): boolean;\\n\\n /**\\n * Get team size.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of Bladeburner team members you have assigned to the specified action.\\n *\\n * Setting a team is only applicable for Operations and BlackOps. This function will return 0 for other action types.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Number of Bladeburner team members that were assigned to the specified action.\\n */\\n getTeamSize(type: string, name: string): number;\\n\\n /**\\n * Set team size.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Set the team size for the specified Bladeburner action.\\n *\\n * Returns the team size that was set, or -1 if the function failed.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param size - Number of team members to set. Will be converted using Math.round().\\n * @returns Number of Bladeburner team members you assigned to the specified action.\\n */\\n setTeamSize(type: string, name: string, size: number): number;\\n\\n /**\\n * Get estimated population in city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated number of Synthoids in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Estimated number of Synthoids in the specified city.\\n */\\n getCityEstimatedPopulation(name: string): number;\\n\\n /**\\n * Get number of communities in a city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated number of Synthoid communities in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Number of Synthoids communities in the specified city.\\n */\\n getCityCommunities(name: string): number;\\n\\n /**\\n * Get chaos of a city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the chaos in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Chaos in the specified city.\\n */\\n getCityChaos(name: string): number;\\n\\n /**\\n * Get current city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the city that the player is currently in (for Bladeburner).\\n *\\n * @returns City that the player is currently in (for Bladeburner).\\n */\\n getCity(): string;\\n\\n /**\\n * Travel to another city in bladeburner.\\n * @remarks\\n * RAM cost: 4 GB\\n * Attempts to switch to the specified city (for Bladeburner only).\\n *\\n * Returns true if successful, and false otherwise\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns true if successful, and false otherwise\\n */\\n switchCity(name: string): boolean;\\n\\n /**\\n * Get bladeburner stamina.\\n * @remarks\\n * RAM cost: 4 GB\\n * Returns an array with two elements:\\n * * [Current stamina, Max stamina]\\n * @example\\n * ```ts\\n * // NS1:\\n * function getStaminaPercentage() {\\n * var res = bladeburner.getStamina();\\n * return res[0] / res[1];\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * function getStaminaPercentage() {\\n * const [current, max] = ns.bladeburner.getStamina();\\n * return current / max;\\n * }\\n * ```\\n * @returns Array containing current stamina and max stamina.\\n */\\n getStamina(): [number, number];\\n\\n /**\\n * Join the bladeburner faction.\\n * @remarks\\n * RAM cost: 4 GB\\n * Attempts to join the Bladeburner faction.\\n *\\n * Returns true if you successfully join the Bladeburner faction, or if you are already a member.\\n *\\n * Returns false otherwise.\\n *\\n * @returns True if you successfully join the Bladeburner faction, or if you are already a member, false otherwise.\\n */\\n joinBladeburnerFaction(): boolean;\\n\\n /**\\n * Join the bladeburner division.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to join the Bladeburner division.\\n *\\n * Returns true if you successfully join the Bladeburner division, or if you are already a member.\\n *\\n * Returns false otherwise.\\n *\\n * @returns True if you successfully join the Bladeburner division, or if you are already a member, false otherwise.\\n */\\n joinBladeburnerDivision(): boolean;\\n\\n /**\\n * Get bladeburner bonus time.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechanic.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster, up to 5x the normal speed.\\n * For example, if an action takes 30 seconds to complete but you’ve accumulated over\\n * 30 seconds in bonus time, then the action will only take 6 seconds in real life to complete.\\n *\\n * @returns Amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechanic.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * Coding Contract API\\n * @public\\n */\\nexport interface CodingContract {\\n /**\\n * Attempts a coding contract.\\n * @remarks\\n * RAM cost: 10 GB\\n *\\n * Attempts to solve the Coding Contract with the provided solution.\\n *\\n * @param answer - Solution for the contract.\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns True if the solution was correct, false otherwise. If the returnReward option is configured, then the function will instead return a string. If the contract is successfully solved, the string will contain a description of the contract’s reward. Otherwise, it will be an empty string.\\n */\\n attempt(\\n answer: string | number | any[],\\n filename: string,\\n host?: string,\\n opts?: CodingAttemptOptions,\\n ): boolean | string;\\n\\n /**\\n * Get the type of a coding contract.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Returns a name describing the type of problem posed by the Coding Contract.\\n * (e.g. Find Largest Prime Factor, Total Ways to Sum, etc.)\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns Name describing the type of problem posed by the Coding Contract.\\n */\\n getContractType(filename: string, host?: string): string;\\n\\n /**\\n * Get the description.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Get the full text description for the problem posed by the Coding Contract.\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns Contract’s text description.\\n */\\n getDescription(filename: string, host?: string): string;\\n\\n /**\\n * Get the input data.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Get the data associated with the specific Coding Contract.\\n * Note that this is not the same as the contract’s description.\\n * This is just the data that the contract wants you to act on in order to solve the contract.\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns The specified contract’s data, data type depends on contract type.\\n */\\n getData(filename: string, host?: string): CodingContractData;\\n\\n /**\\n * Get the number of attempts remaining.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the number of tries remaining on the contract before it self-destructs.\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns How many attempts are remaining for the contract.\\n */\\n getNumTriesRemaining(filename: string, host?: string): number;\\n\\n /**\\n * Generate a dummy contract.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Generate a dummy contract on the home computer with no reward. Used to test various algorithms.\\n *\\n * @param type - Type of contract to generate\\n */\\n createDummyContract(type: string): void;\\n\\n /**\\n * List all contract types.\\n * @remarks\\n * RAM cost: 2 GB\\n */\\n getContractTypes(): string[];\\n}\\n\\n/**\\n * Gang API\\n * @remarks\\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this API.\\n * @public\\n */\\nexport interface Gang {\\n /**\\n * Create a gang.\\n * @remarks\\n * RAM cost: 1GB\\n *\\n * Create a gang with the specified faction.\\n * @returns True if the gang was created, false otherwise.\\n */\\n createGang(faction: string): boolean;\\n\\n /**\\n * Check if you're in a gang.\\n * @remarks\\n * RAM cost: 1GB\\n * @returns True if you're in a gang, false otherwise.\\n */\\n inGang(): boolean;\\n\\n /**\\n * List all gang members.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the names of all Gang members\\n *\\n * @returns Names of all Gang members.\\n */\\n getMemberNames(): string[];\\n\\n /**\\n * Get information about your gang.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get general information about the gang.\\n *\\n * @returns Object containing general information about the gang.\\n */\\n getGangInformation(): GangGenInfo;\\n\\n /**\\n * Get information about the other gangs.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get territory and power information about all gangs.\\n *\\n * @returns Object containing territory and power information about all gangs.\\n */\\n getOtherGangInformation(): GangOtherInfo;\\n\\n /**\\n * Get information about a specific gang member.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get stat and equipment-related information about a Gang Member\\n *\\n * @param name - Name of member.\\n * @returns Object containing stat and equipment-related information about a Gang Member.\\n */\\n getMemberInformation(name: string): GangMemberInfo;\\n\\n /**\\n * Check if you can recruit a new gang member.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns boolean indicating whether a member can currently be recruited\\n *\\n * @returns True if a member can currently be recruited, false otherwise.\\n */\\n canRecruitMember(): boolean;\\n\\n /**\\n * Recruit a new gang member.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Attempt to recruit a new gang member.\\n *\\n * Possible reasons for failure:\\n * * Cannot currently recruit a new member\\n * * There already exists a member with the specified name\\n *\\n * @param name - Name of member to recruit.\\n * @returns True if the member was successfully recruited, false otherwise.\\n */\\n recruitMember(name: string): boolean;\\n\\n /**\\n * List member task names.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the name of all valid tasks that Gang members can be assigned to.\\n *\\n * @returns All valid tasks that Gang members can be assigned to.\\n */\\n getTaskNames(): string[];\\n\\n /**\\n * Set gang member to task.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Attempts to assign the specified Gang Member to the specified task.\\n * If an invalid task is specified, the Gang member will be set to idle (“Unassigned”).\\n *\\n * @param memberName - Name of Gang member to assign.\\n * @param taskName - Task to assign.\\n * @returns True if the Gang Member was successfully assigned to the task, false otherwise.\\n */\\n setMemberTask(memberName: string, taskName: string): boolean;\\n\\n /**\\n * Get stats of a task.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the stats of a gang task stats. This is typically used to evaluate which action should be executed next.\\n *\\n * @param name - Name of the task.\\n * @returns Detailed stats of a task.\\n */\\n getTaskStats(name: string): GangTaskStats;\\n\\n /**\\n * List equipment names.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the name of all possible equipment/upgrades you can purchase for your Gang Members.\\n * This includes Augmentations.\\n *\\n * @returns Names of all Equipments/Augmentations.\\n */\\n getEquipmentNames(): string[];\\n\\n /**\\n * Get cost of equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the amount of money it takes to purchase a piece of Equipment or an Augmentation.\\n * If an invalid Equipment/Augmentation is specified, this function will return Infinity.\\n *\\n * @param equipName - Name of equipment.\\n * @returns Cost to purchase the specified Equipment/Augmentation (number). Infinity for invalid arguments\\n */\\n getEquipmentCost(equipName: string): number;\\n\\n /**\\n * Get type of an equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the specified equipment type.\\n *\\n * @param equipName - Name of equipment.\\n * @returns Type of the equipment.\\n */\\n getEquipmentType(equipName: string): string;\\n\\n /**\\n * Get stats of an equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the specified equipment stats.\\n *\\n * @param equipName - Name of equipment.\\n * @returns A dictionary containing the stats of the equipment.\\n */\\n getEquipmentStats(equipName: string): EquipmentStats;\\n\\n /**\\n * Purchase an equipment for a gang member.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempt to purchase the specified Equipment/Augmentation for the specified Gang member.\\n *\\n * @param memberName - Name of Gang member to purchase the equipment for.\\n * @param equipName - Name of Equipment/Augmentation to purchase.\\n * @returns True if the equipment was successfully purchased. False otherwise\\n */\\n purchaseEquipment(memberName: string, equipName: string): boolean;\\n\\n /**\\n * Ascend a gang member.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Ascend the specified Gang Member.\\n *\\n * @param memberName - Name of member to ascend.\\n * @returns Object with info about the ascension results. Undefined if ascension did not occur.\\n */\\n ascendMember(memberName: string): GangMemberAscension | undefined;\\n\\n /**\\n * Get the result of an ascension without ascending.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the result of an ascension without ascending.\\n *\\n * @param memberName - Name of member.\\n * @returns Object with info about the ascension results. Undefined if ascension is impossible.\\n */\\n getAscensionResult(memberName: string): GangMemberAscension | undefined;\\n\\n /**\\n * Enable/Disable territory warfare.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Set whether or not the gang should engage in territory warfare\\n *\\n * @param engage - Whether or not to engage in territory warfare.\\n */\\n setTerritoryWarfare(engage: boolean): void;\\n\\n /**\\n * Get chance to win clash with other gang.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the chance you have to win a clash with the specified gang. The chance is returned in decimal form, not percentage\\n *\\n * @param gangName - Target gang\\n * @returns Chance you have to win a clash with the specified gang.\\n */\\n getChanceToWinClash(gangName: string): number;\\n\\n /**\\n * Get bonus time.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the amount of accumulated “bonus time” (milliseconds) for the Gang mechanic.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster, up to 10x the normal speed.\\n *\\n * @returns Bonus time for the Gang mechanic in milliseconds.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * Sleeve API\\n * @remarks\\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this API.\\n * @public\\n */\\nexport interface Sleeve {\\n /**\\n * Get the number of sleeves you own.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return the number of duplicate sleeves the player has.\\n *\\n * @returns number of duplicate sleeves the player has.\\n */\\n getNumSleeves(): number;\\n\\n /**\\n * Get the stats of a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a structure containing the stats of the sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to get stats of.\\n * @returns Object containing the stats of the sleeve.\\n */\\n getSleeveStats(sleeveNumber: number): SleeveSkills;\\n\\n /**\\n * Get information about a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a struct containing tons of information about this sleeve\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve information.\\n * @returns Object containing tons of information about this sleeve.\\n */\\n getInformation(sleeveNumber: number): SleeveInformation;\\n\\n /**\\n * Get task of a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return the current task that the sleeve is performing. type is set to “Idle” if the sleeve isn’t doing anything.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve task from.\\n * @returns Object containing information the current task that the sleeve is performing.\\n */\\n getTask(sleeveNumber: number): SleeveTask;\\n\\n /**\\n * Set a sleeve to shock recovery.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start recovery.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToShockRecovery(sleeveNumber: number): boolean;\\n\\n /**\\n * Set a sleeve to synchronize.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start synchronizing.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToSynchronize(sleeveNumber: number): boolean;\\n\\n /**\\n * Set a sleeve to commit crime.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * Returns false if an invalid action is specified.\\n *\\n * You can set a sleeve to commit one of the following crimes. The crime names are not\\n * case sensitive. For example, you can pass in the crime name as `\\\"Shoplift\\\"`,\\n * `\\\"shoplift\\\"`, `\\\"shopLift\\\"`, or even `\\\"SHOPLIFT\\\"`.\\n *\\n * - Assassination\\n * - Bond forgery\\n * - Deal drugs\\n * - Grand theft auto\\n * - Heist\\n * - Homicide\\n * - Kidnap\\n * - Larceny\\n * - Mug\\n * - Rob store\\n * - Shoplift\\n * - Traffick arms\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * // Assign the first 3 sleeves to commit various crimes.\\n * var crime = [\\\"mug\\\", \\\"rob store\\\", \\\"shoplift\\\"];\\n * for (var i = 0; i < crime.length; i++) {\\n * tprintf(\\\"Sleeve %d commits crime: %s\\\", i, crime[i]);\\n * sleeve.setToCommitCrime(i, crime[i]);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * // Assign the first 3 sleeves to commit various crimes.\\n * const crime = [\\\"mug\\\", \\\"rob store\\\", \\\"shoplift\\\"];\\n * for (let i = 0; i < crime.length; i++) {\\n * ns.tprintf(\\\"Sleeve %d commits crime: %s\\\", i, crime[i]);\\n * ns.sleeve.setToCommitCrime(i, crime[i]);\\n * }\\n * ```\\n *\\n * @param sleeveNumber - Index of the sleeve to start committing crime. Sleeves are numbered starting from 0.\\n * @param name - Name of the crime. Must be an exact match. Refer to the list of crimes.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToCommitCrime(sleeveNumber: number, name: string): boolean;\\n\\n /**\\n * Set a sleeve to work for a faction.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working or this faction.\\n *\\n * @param sleeveNumber - Index of the sleeve to work for the faction.\\n * @param factionName - Name of the faction to work for.\\n * @param factionWorkType - Name of the action to perform for this faction.\\n * @returns True if the sleeve started working on this faction, false otherwise, can also throw on errors\\n */\\n setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean | undefined;\\n\\n /**\\n * Set a sleeve to work for a company.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working or this company.\\n *\\n * @param sleeveNumber - Index of the sleeve to work for the company.\\n * @param companyName - Name of the company to work for.\\n * @returns True if the sleeve started working on this company, false otherwise.\\n */\\n setToCompanyWork(sleeveNumber: number, companyName: string): boolean;\\n\\n /**\\n * Set a sleeve to take a class at a university.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start taking class.\\n * @param university - Name of the university to attend.\\n * @param className - Name of the class to follow.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToUniversityCourse(sleeveNumber: number, university: string, className: string): boolean;\\n\\n /**\\n * Set a sleeve to workout at the gym.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working out.\\n *\\n * @param sleeveNumber - Index of the sleeve to workout at the gym.\\n * @param gymName - Name of the gym.\\n * @param stat - Name of the stat to train.\\n * @returns True if the sleeve started working out, false otherwise.\\n */\\n setToGymWorkout(sleeveNumber: number, gymName: string, stat: string): boolean;\\n\\n /**\\n * Make a sleeve travel to another city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve reached destination.\\n *\\n * @param sleeveNumber - Index of the sleeve to travel.\\n * @param cityName - Name of the destination city.\\n * @returns True if the sleeve reached destination, false otherwise.\\n */\\n travel(sleeveNumber: number, cityName: string): boolean;\\n\\n /**\\n * Get augmentations installed on a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a list of augmentation names that this sleeve has installed.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve augmentations from.\\n * @returns List of augmentation names that this sleeve has installed.\\n */\\n getSleeveAugmentations(sleeveNumber: number): string[];\\n\\n /**\\n * Get price of an augmentation.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Price of the augmentation.\\n */\\n getSleeveAugmentationPrice(augName: string): number;\\n\\n /**\\n * Get reputation requirement of an augmentation.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Reputation requirement of the augmentation.\\n */\\n getSleeveAugmentationRepReq(augName: string): number;\\n\\n /**\\n * List purchasable augs for a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a list of augmentations that the player can buy for this sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve purchasable augmentations from.\\n * @returns List of augmentations that the player can buy for this sleeve.\\n */\\n getSleevePurchasableAugs(sleeveNumber: number): AugmentPair[];\\n\\n /**\\n * Purchase an aug for a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return true if the aug was purchased and installed on the sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to buy an aug for.\\n * @param augName - Name of the aug to buy. Must be an exact match.\\n * @returns True if the aug was purchased and installed on the sleeve, false otherwise.\\n */\\n purchaseSleeveAug(sleeveNumber: number, augName: string): boolean;\\n\\n /**\\n * Set a sleeve to perform bladeburner actions.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working out.\\n *\\n * @param sleeveNumber - Index of the sleeve to workout at the gym.\\n * @param action - Name of the action to be performed.\\n * @param contract - Name of the contract if applicable.\\n * @returns True if the sleeve started working out, false otherwise.\\n */\\n setToBladeburnerAction(sleeveNumber: number, action: string, contract?: string): boolean;\\n}\\n\\n/**\\n * Grafting API\\n * @remarks\\n * This API requires Source-File 10 to use.\\n * @public\\n */\\nexport interface Grafting {\\n /**\\n * Retrieve the grafting cost of an aug.\\n * @remarks\\n * RAM cost: 3.75 GB\\n *\\n * @param augName - Name of the aug to check the price of. Must be an exact match.\\n * @returns The cost required to graft the named augmentation.\\n * @throws Will error if an invalid Augmentation name is provided.\\n */\\n getAugmentationGraftPrice(augName: string): number;\\n\\n /**\\n * Retrieves the time required to graft an aug.\\n * @remarks\\n * RAM cost: 3.75 GB\\n *\\n * @param augName - Name of the aug to check the grafting time of. Must be an exact match.\\n * @returns The time required, in millis, to graft the named augmentation.\\n * @throws Will error if an invalid Augmentation name is provided.\\n */\\n getAugmentationGraftTime(augName: string): number;\\n\\n /**\\n * Retrieves a list of Augmentations that can be grafted.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Note that this function returns a list of currently graftable Augmentations,\\n * based off of the Augmentations that you already own.\\n *\\n * @returns An array of graftable Augmentations.\\n */\\n getGraftableAugmentations(): string[];\\n\\n /**\\n * Begins grafting the named aug. You must be in New Tokyo to use this.\\n * @remarks\\n * RAM cost: 7.5 GB\\n *\\n * @param augName - The name of the aug to begin grafting. Must be an exact match.\\n * @param focus - Acquire player focus on this Augmentation grafting. Optional. Defaults to true.\\n * @returns True if the aug successfully began grafting, false otherwise (e.g. not enough money, or\\n * invalid Augmentation name provided).\\n * @throws Will error if called while you are not in New Tokyo.\\n */\\n graftAugmentation(augName: string, focus?: boolean): boolean;\\n}\\n\\n/**\\n * Skills formulas\\n * @public\\n */\\ninterface SkillsFormulas {\\n /**\\n * Calculate skill level.\\n * @param exp - experience for that skill\\n * @param skillMult - Multiplier for that skill, defaults to 1.\\n * @returns The calculated skill level.\\n */\\n calculateSkill(exp: number, skillMult?: number): number;\\n /**\\n * Calculate exp for skill level.\\n * @param skill - target skill level\\n * @param skillMult - Multiplier for that skill, defaults to 1.\\n * @returns The calculated exp required.\\n */\\n calculateExp(skill: number, skillMult?: number): number;\\n}\\n\\n/** @public */\\nexport interface WorkStats {\\n money: number;\\n reputation: number;\\n hackExp: number;\\n strExp: number;\\n defExp: number;\\n dexExp: number;\\n agiExp: number;\\n chaExp: number;\\n intExp: number;\\n}\\n\\n/**\\n * Work formulas\\n * @public\\n */\\ninterface WorkFormulas {\\n crimeGains(crimeType: string): WorkStats;\\n classGains(player: Player, classType: string, locationName: string): WorkStats;\\n factionGains(player: Player, workType: string, favor: number): WorkStats;\\n}\\n\\n/**\\n * Reputation formulas\\n * @public\\n */\\ninterface ReputationFormulas {\\n /**\\n * Calculate the total required amount of faction reputation to reach a target favor.\\n * @param favor - target faction favor.\\n * @returns The calculated faction reputation required.\\n */\\n calculateFavorToRep(favor: number): number;\\n /**\\n * Calculate the resulting faction favor of a total amount of reputation.\\n * (Faction favor is gained whenever you install an Augmentation.)\\n * @param rep - amount of reputation.\\n * @returns The calculated faction favor.\\n */\\n calculateRepToFavor(rep: number): number;\\n\\n /**\\n * Calculate how much rep would be gained.\\n * @param amount - Amount of money donated\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n */\\n repFromDonation(amount: number, player: Player): number;\\n}\\n\\n/**\\n * Hacking formulas\\n * @public\\n */\\ninterface HackingFormulas {\\n /**\\n * Calculate hack chance.\\n * (Ex: 0.25 would indicate a 25% chance of success.)\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack chance.\\n */\\n hackChance(server: Server, player: Player): number;\\n /**\\n * Calculate hack exp for one thread.\\n * @remarks\\n * Multiply by thread to get total exp\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack exp.\\n */\\n hackExp(server: Server, player: Player): number;\\n /**\\n * Calculate hack percent for one thread.\\n * (Ex: 0.25 would steal 25% of the server's current value.)\\n * @remarks\\n * Multiply by thread to get total percent hacked.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack percent.\\n */\\n hackPercent(server: Server, player: Player): number;\\n /**\\n * Calculate the percent a server would grow to.\\n * (Ex: 3.0 would would grow the server to 300% of its current value.)\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param threads - Amount of thread.\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @param cores - Number of cores on the computer that will execute grow.\\n * @returns The calculated grow percent.\\n */\\n growPercent(server: Server, threads: number, player: Player, cores?: number): number;\\n /**\\n * Calculate hack time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack time.\\n */\\n hackTime(server: Server, player: Player): number;\\n /**\\n * Calculate grow time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated grow time.\\n */\\n growTime(server: Server, player: Player): number;\\n /**\\n * Calculate weaken time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated weaken time.\\n */\\n weakenTime(server: Server, player: Player): number;\\n}\\n\\n/**\\n * Hacknet Node formulas\\n * @public\\n */\\ninterface HacknetNodesFormulas {\\n /**\\n * Calculate money gain rate.\\n * @param level - level of the node.\\n * @param ram - ram of the node.\\n * @param cores - cores of the node.\\n * @param mult - player production mult (default to 1)\\n * @returns The calculated money gain rate.\\n */\\n moneyGainRate(level: number, ram: number, cores: number, mult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node level.\\n * @param startingLevel - starting level\\n * @param extraLevels - amount of level to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n levelUpgradeCost(startingLevel: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node ram.\\n * @param startingRam - starting ram\\n * @param extraLevels - amount of level of ram to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n ramUpgradeCost(startingRam: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node cores.\\n * @param startingCore - starting cores\\n * @param extraCores - amount of cores to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n coreUpgradeCost(startingCore: number, extraCores?: number, costMult?: number): number;\\n /**\\n * Calculate the cost of a hacknet node.\\n * @param n - number of the hacknet node\\n * @param mult - player cost reduction (defaults to 1)\\n * @returns The calculated cost.\\n */\\n hacknetNodeCost(n: number, mult: number): number;\\n /**\\n * All constants used by the game.\\n * @returns An object with all hacknet node constants used by the game.\\n */\\n constants(): HacknetNodeConstants;\\n}\\n\\n/**\\n * Hacknet Server formulas\\n * @public\\n */\\ninterface HacknetServersFormulas {\\n /**\\n * Calculate hash gain rate.\\n * @param level - level of the server.\\n * @param ramUsed - ramUsed of the server.\\n * @param maxRam - maxRam of the server.\\n * @param cores - cores of the server.\\n * @param mult - player production mult (default to 1)\\n * @returns The calculated hash gain rate.\\n */\\n hashGainRate(level: number, ramUsed: number, maxRam: number, cores: number, mult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server level.\\n * @param startingLevel - starting level\\n * @param extraLevels - amount of level to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n levelUpgradeCost(startingLevel: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server ram.\\n * @param startingRam - starting ram\\n * @param extraLevels - amount of level of ram to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n ramUpgradeCost(startingRam: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server cores.\\n * @param startingCore - starting cores\\n * @param extraCores - amount of cores to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n coreUpgradeCost(startingCore: number, extraCores?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server cache.\\n * @param startingCache - starting cache level\\n * @param extraCache - amount of levels of cache to purchase (defaults to 1)\\n * @returns The calculated cost.\\n */\\n cacheUpgradeCost(startingCache: number, extraCache?: number): number;\\n /**\\n * Calculate hash cost of an upgrade.\\n * @param upgName - name of the upgrade\\n * @param level - level of the upgrade\\n * @returns The calculated hash cost.\\n */\\n hashUpgradeCost(upgName: number, level: number): number;\\n /**\\n * Calculate the cost of a hacknet server.\\n * @param n - number of the hacknet server\\n * @param mult - player cost reduction (defaults to 1)\\n * @returns The calculated cost.\\n */\\n hacknetServerCost(n: number, mult?: number): number;\\n /**\\n * All constants used by the game.\\n * @returns An object with all hacknet server constants used by the game.\\n */\\n constants(): HacknetServerConstants;\\n}\\n\\n/**\\n * Gang formulas\\n * @public\\n */\\ninterface GangFormulas {\\n /**\\n * Calculate the wanted penalty.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @returns The calculated wanted penalty.\\n */\\n wantedPenalty(gang: GangGenInfo): number;\\n /**\\n * Calculate respect gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Gang info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Gang info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated respect gain.\\n */\\n respectGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n /**\\n * Calculate wanted gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Task info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated wanted gain.\\n */\\n wantedLevelGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n /**\\n * Calculate money gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Task info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated money gain.\\n */\\n moneyGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n\\n /**\\n * Calculate ascension point gain.\\n * @param exp - Experience point before ascension.\\n * @returns The calculated ascension point gain.\\n */\\n ascensionPointsGain(exp: number): number;\\n\\n /**\\n * Calculate ascension mult.\\n * @param points - Amount of ascension points.\\n * @returns The calculated ascension mult.\\n */\\n ascensionMultiplier(points: number): number;\\n}\\n\\n/**\\n * Formulas API\\n * @remarks\\n * You need Formulas.exe on your home computer to use this API.\\n * @public\\n */\\nexport interface Formulas {\\n mockServer(): Server;\\n mockPlayer(): Player;\\n /** Reputation formulas */\\n reputation: ReputationFormulas;\\n /** Skills formulas */\\n skills: SkillsFormulas;\\n /** Hacking formulas */\\n hacking: HackingFormulas;\\n /** Hacknet Nodes formulas */\\n hacknetNodes: HacknetNodesFormulas;\\n /** Hacknet Servers formulas */\\n hacknetServers: HacknetServersFormulas;\\n /** Gang formulas */\\n gang: GangFormulas;\\n /** Work formulas */\\n work: WorkFormulas;\\n}\\n\\n/** @public */\\nexport interface Fragment {\\n id: number;\\n shape: boolean[][];\\n type: number;\\n power: number;\\n limit: number;\\n}\\n\\n/** @public */\\nexport interface ActiveFragment {\\n id: number;\\n highestCharge: number;\\n numCharge: number;\\n rotation: number;\\n x: number;\\n y: number;\\n}\\n\\n/**\\n * Stanek's Gift API.\\n * @public\\n */\\ninterface Stanek {\\n /**\\n * Stanek's Gift width.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @returns The width of the gift.\\n */\\n giftWidth(): number;\\n /**\\n * Stanek's Gift height.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @returns The height of the gift.\\n */\\n giftHeight(): number;\\n\\n /**\\n * Charge a fragment, increasing its power.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @param rootX - rootX Root X against which to align the top left of the fragment.\\n * @param rootY - rootY Root Y against which to align the top left of the fragment.\\n * @returns Promise that lasts until the charge action is over.\\n */\\n chargeFragment(rootX: number, rootY: number): Promise<void>;\\n\\n /**\\n * List possible fragments.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns List of possible fragments.\\n */\\n fragmentDefinitions(): Fragment[];\\n\\n /**\\n * List of fragments in Stanek's Gift.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @returns List of active fragments placed on Stanek's Gift.\\n */\\n activeFragments(): ActiveFragment[];\\n\\n /**\\n * Clear the board of all fragments.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clearGift(): void;\\n\\n /**\\n * Check if fragment can be placed at specified location.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * @param rootX - rootX Root X against which to align the top left of the fragment.\\n * @param rootY - rootY Root Y against which to align the top left of the fragment.\\n * @param rotation - rotation A number from 0 to 3, the mount of 90 degree turn to take.\\n * @param fragmentId - fragmentId ID of the fragment to place.\\n * @returns true if the fragment can be placed at that position. false otherwise.\\n */\\n canPlaceFragment(rootX: number, rootY: number, rotation: number, fragmentId: number): boolean;\\n /**\\n * Place fragment on Stanek's Gift.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @param rotation - A number from 0 to 3, the mount of 90 degree turn to take.\\n * @param fragmentId - ID of the fragment to place.\\n * @returns true if the fragment can be placed at that position. false otherwise.\\n */\\n placeFragment(rootX: number, rootY: number, rotation: number, fragmentId: number): boolean;\\n /**\\n * Get placed fragment at location.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @returns The fragment at [rootX, rootY], if any.\\n */\\n getFragment(rootX: number, rootY: number): ActiveFragment | undefined;\\n\\n /**\\n * Remove fragment at location.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @returns The fragment at [rootX, rootY], if any.\\n */\\n removeFragment(rootX: number, rootY: number): boolean;\\n\\n /**\\n * Accept Stanek's Gift by joining the Church of the Machine God\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * @returns true if the player is a member of the church and has the gift installed,\\n * false otherwise.\\n */\\n acceptGift(): boolean;\\n}\\n\\n/** @public */\\nexport interface InfiltrationReward {\\n tradeRep: number;\\n sellCash: number;\\n SoARep: number;\\n}\\n\\n/** @public */\\nexport interface ILocation {\\n city: string;\\n name: string;\\n}\\n\\n/** @public */\\nexport interface InfiltrationLocation {\\n location: ILocation;\\n reward: InfiltrationReward;\\n difficulty: number;\\n}\\n\\n/**\\n * Infiltration API.\\n * @public\\n */\\ninterface Infiltration {\\n /**\\n * Get all locations that can be infiltrated.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @returns all locations that can be infiltrated.\\n */\\n getPossibleLocations(): PossibleInfiltrationLocation[];\\n /**\\n * Get all infiltrations with difficulty, location and rewards.\\n * @remarks\\n * RAM cost: 15 GB\\n *\\n * @returns Infiltration data for given location.\\n */\\n getInfiltration(location: string): InfiltrationLocation;\\n}\\n\\n/**\\n * User Interface API.\\n * @public\\n */\\ninterface UserInterface {\\n /**\\n * Get the current window size\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An array of 2 value containing the window width and height.\\n */\\n windowSize(): [number, number];\\n\\n /**\\n * Get the current theme\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An object containing the theme's colors\\n */\\n getTheme(): UserInterfaceTheme;\\n\\n /**\\n * Sets the current theme\\n * @remarks\\n * RAM cost: 0 GB\\n * @example\\n * Usage example (NS2)\\n * ```ts\\n * const theme = ns.ui.getTheme();\\n * theme.primary = '#ff5500';\\n * ns.ui.setTheme(theme);\\n * ```\\n */\\n setTheme(newTheme: UserInterfaceTheme): void;\\n\\n /**\\n * Resets the player's theme to the default values\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n resetTheme(): void;\\n\\n /**\\n * Get the current styles\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An object containing the player's styles\\n */\\n getStyles(): IStyleSettings;\\n\\n /**\\n * Sets the current styles\\n * @remarks\\n * RAM cost: 0 GB\\n * @example\\n * Usage example (NS2)\\n * ```ts\\n * const styles = ns.ui.getStyles();\\n * styles.fontFamily = 'Comic Sans Ms';\\n * ns.ui.setStyles(styles);\\n * ```\\n */\\n setStyles(newStyles: IStyleSettings): void;\\n\\n /**\\n * Resets the player's styles to the default values\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n resetStyles(): void;\\n\\n /**\\n * Gets the current game information (version, commit, ...)\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n getGameInfo(): GameInfo;\\n\\n /**\\n * Clear the Terminal window, as if the player ran `clear` in the terminal\\n * @remarks\\n * RAM cost: 0.2 GB\\n */\\n clearTerminal(): void;\\n}\\n\\n/**\\n * Collection of all functions passed to scripts\\n * @public\\n * @remarks\\n * <b>Basic ns1 usage example:</b>\\n * ```ts\\n * // Basic ns functions can be used directly\\n * getHostname();\\n * // Some related functions are gathered within a common namespace\\n * stock.getPrice();\\n * ```\\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html| ns1 in-game docs}\\n * <hr>\\n * <b>Basic ns2 usage example:</b>\\n * ```ts\\n * export async function main(ns) {\\n * // Basic ns functions can be accessed on the ns object\\n * ns.getHostname();\\n * // Some related functions are gathered under a sub-property of the ns object\\n * ns.stock.getPrice();\\n * // Some functions need to be awaited\\n * await ns.hack('n00dles');\\n * }\\n * ```\\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}\\n * <hr>\\n */\\nexport interface NS {\\n /**\\n * Namespace for hacknet functions.\\n * @remarks RAM cost: 4 GB\\n */\\n readonly hacknet: Hacknet;\\n\\n /**\\n * Namespace for bladeburner functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly bladeburner: Bladeburner;\\n\\n /**\\n * Namespace for codingcontract functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly codingcontract: CodingContract;\\n\\n /**\\n * Namespace for gang functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly gang: Gang;\\n\\n /**\\n * Namespace for sleeve functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly sleeve: Sleeve;\\n\\n /**\\n * Namespace for stock functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly stock: TIX;\\n\\n /**\\n * Namespace for formulas functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly formulas: Formulas;\\n\\n /**\\n * Namespace for stanek functions.\\n * RAM cost: 0 GB\\n */\\n readonly stanek: Stanek;\\n\\n /**\\n * Namespace for infiltration functions.\\n * RAM cost: 0 GB\\n */\\n readonly infiltration: Infiltration;\\n\\n /**\\n * Namespace for corporation functions.\\n * RAM cost: 1022.4 GB\\n */\\n readonly corporation: Corporation;\\n\\n /**\\n * Namespace for user interface functions.\\n * RAM cost: 0 GB\\n */\\n readonly ui: UserInterface;\\n\\n /**\\n * Namespace for singularity functions.\\n * RAM cost: 0 GB\\n */\\n readonly singularity: Singularity;\\n\\n /**\\n * Namespace for grafting functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly grafting: Grafting;\\n\\n /**\\n * Arguments passed into the script.\\n *\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Arguments passed into a script can be accessed using a normal\\n * array using the [] operator (args[0], args[1], etc…).\\n *\\n * It is also possible to get the number of arguments that was passed into a script using: 'args.length'\\n * WARNING: Do not try to modify the args array. This will break the game.\\n */\\n readonly args: (string | number | boolean)[];\\n\\n /**\\n * Steal a servers money.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Function that is used to try and hack servers to steal money and gain hacking experience.\\n * The runtime for this command depends on your hacking level and the target server’s\\n * security level when this function is called. In order to hack a server you must first gain root access to that server\\n * and also have the required hacking level.\\n *\\n * A script can hack a server from anywhere. It does not need to be running on the same\\n * server to hack that server. For example, you can create a script that hacks the `foodnstuff`\\n * server and run that script on any server in the game.\\n *\\n * A successful `hack()` on a server will raise that server’s security level by 0.002.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var earnedMoney = hack(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let earnedMoney = await ns.hack(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server to hack.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The amount of money stolen if the hack is successful, and zero otherwise.\\n */\\n hack(host: string, opts?: BasicHGWOptions): Promise<number>;\\n\\n /**\\n * Spoof money in a servers bank account, increasing the amount available.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * Use your hacking skills to increase the amount of money available on a server.\\n * The runtime for this command depends on your hacking level and the target server’s\\n * security level. When `grow` completes, the money available on a target server will\\n * be increased by a certain, fixed percentage. This percentage is determined by the\\n * target server’s growth rate (which varies between servers) and security level. Generally,\\n * higher-level servers have higher growth rates. The getServerGrowth() function can be used\\n * to obtain a server’s growth rate.\\n *\\n * Like hack, `grow` can be called on any server, regardless of where the script is running.\\n * The grow() command requires root access to the target server, but there is no required hacking\\n * level to run the command. It also raises the security level of the target server by 0.004.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var currentMoney = getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * currentMoney = currentMoney * (1 + grow(\\\"foodnstuff\\\"));\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let currentMoney = ns.getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * currentMoney *= (1 + await ns.grow(\\\"foodnstuff\\\"));\\n * ```\\n * @param host - Hostname of the target server to grow.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The number by which the money on the server was multiplied for the growth.\\n */\\n grow(host: string, opts?: BasicHGWOptions): Promise<number>;\\n\\n /**\\n * Reduce a server security level.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * Use your hacking skills to attack a server’s security, lowering the server’s security level.\\n * The runtime for this command depends on your hacking level and the target server’s security\\n * level when this function is called. This function lowers the security level of the target server by 0.05.\\n *\\n * Like hack and grow, `weaken` can be called on any server, regardless of\\n * where the script is running. This command requires root access to the target server, but\\n * there is no required hacking level to run the command.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var currentSecurity = getServerSecurityLevel(\\\"foodnstuff\\\");\\n * currentSecurity = currentSecurity - weaken(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let currentSecurity = ns.getServerSecurityLevel(\\\"foodnstuff\\\");\\n * currentSecurity -= await ns.weaken(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server to weaken.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The amount by which the target server’s security level was decreased. This is equivalent to 0.05 multiplied by the number of script threads.\\n */\\n weaken(host: string, opts?: BasicHGWOptions): Promise<number>;\\n\\n /**\\n * Predict the effect of weaken.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security decrease that would occur if a weaken with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @param cores - Optional. The number of cores of the server that would run weaken.\\n * @returns The security decrease.\\n */\\n weakenAnalyze(threads: number, cores?: number): number;\\n\\n /**\\n * Predict the effect of hack.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * This function returns the number of script threads you need when running the hack command\\n * to steal the specified amount of money from the target server.\\n * If hackAmount is less than zero or greater than the amount of money available on the server,\\n * then this function returns -1.\\n *\\n * Warning: The value returned by this function isn’t necessarily a whole number.\\n *\\n * @example\\n * ```ts\\n * //For example, let’s say the foodnstuff server has $10m and you run:\\n * hackAnalyzeThreads(\\\"foodnstuff\\\", 1e6);\\n * //If this function returns 50, this means that if your next hack call is run on a script with 50 threads, it will steal $1m from the foodnstuff server.\\n * ```\\n * @param host - Hostname of the target server to analyze.\\n * @param hackAmount - Amount of money you want to hack from the server.\\n * @returns The number of threads needed to hack the server for hackAmount money.\\n */\\n hackAnalyzeThreads(host: string, hackAmount: number): number;\\n\\n /**\\n * Get the part of money stolen with a single thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the part of the specified server’s money you will steal with a single thread hack.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //For example, assume the following returns 0.01:\\n * var hackAmount = hackAnalyze(\\\"foodnstuff\\\");\\n * //This means that if hack the foodnstuff server using a single thread, then you will steal 1%, or 0.01 of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //For example, assume the following returns 0.01:\\n * const hackAmount = ns.hackAnalyze(\\\"foodnstuff\\\");\\n * //This means that if hack the foodnstuff server using a single thread, then you will steal 1%, or 0.01 of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.\\n * ```\\n * @param host - Hostname of the target server.\\n * @returns The part of money you will steal from the target server with a single thread hack.\\n */\\n hackAnalyze(host: string): number;\\n\\n /**\\n * Get the security increase for a number of thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security increase that would occur if a hack with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @param hostname - Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money.\\n * @returns The security increase.\\n */\\n hackAnalyzeSecurity(threads: number, hostname?: string): number;\\n\\n /**\\n * Get the chance of successfully hacking a server.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the chance you have of successfully hacking the specified server.\\n *\\n * This returned value is in decimal form, not percentage.\\n *\\n * @param host - Hostname of the target server.\\n * @returns The chance you have of successfully hacking the target server.\\n */\\n hackAnalyzeChance(host: string): number;\\n\\n /**\\n * Calculate the number of grow thread needed to grow a server by a certain multiplier.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * This function returns the number of “growths” needed in order to increase\\n * the amount of money available on the specified server by the specified amount.\\n * The specified amount is multiplicative and is in decimal form, not percentage.\\n *\\n * Warning: The value returned by this function isn’t necessarily a whole number.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:\\n * var growTimes = growthAnalyze(\\\"foodnstuff\\\", 2);\\n * //If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:\\n * const growTimes = ns.growthAnalyze(\\\"foodnstuff\\\", 2);\\n * //If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).\\n * ```\\n * @param host - Hostname of the target server.\\n * @param growthAmount - Multiplicative factor by which the server is grown. Decimal form..\\n * @returns The amount of grow calls needed to grow the specified server by the specified amount\\n */\\n growthAnalyze(host: string, growthAmount: number, cores?: number): number;\\n\\n /**\\n * Calculate the security increase for a number of thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security increase that would occur if a grow with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @param hostname - Optional. Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money.\\n * @param cores - Optional. The number of cores of the server that would run grow.\\n * @returns The security increase.\\n */\\n growthAnalyzeSecurity(threads: number, hostname?: string, cores?: number): number;\\n\\n /**\\n * Suspends the script for n milliseconds.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param millis - Number of milliseconds to sleep.\\n * @example\\n * ```ts\\n * // NS1:\\n * // This will count from 1 to 10 in your terminal, with one number every 5 seconds\\n * for (var i=0; i<10; i++) {\\n * tprint(i + 1);\\n * sleep(5000);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // This will count from 1 to 10 in your terminal, with one number every 5 seconds\\n * for (var i=0; i<10; i++) {\\n * ns.tprint(i + 1);\\n * await ns.sleep(5000);\\n * }\\n * ```\\n * @returns\\n */\\n sleep(millis: number): Promise<true>;\\n\\n /**\\n * Suspends the script for n milliseconds. Doesn't block with concurrent calls.\\n * You should prefer 'sleep' over 'asleep' except when doing very complex UI work.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param millis - Number of milliseconds to sleep.\\n * @returns\\n */\\n asleep(millis: number): Promise<true>;\\n\\n /**\\n * Prints one or move values or variables to the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * If the argument is a string, you can color code your message by prefixing your\\n * string with one of these strings:\\n *\\n * - `\\\"ERROR\\\"`: The whole string will be printed in red. Use this prefix to indicate\\n * that an error has occurred.\\n *\\n * - `\\\"SUCCESS\\\"`: The whole string will be printed in green, similar to the default\\n * theme of the Terminal. Use this prefix to indicate that something is correct.\\n *\\n * - `\\\"WARN\\\"`: The whole string will be printed in yellow. Use this prefix to\\n * indicate that you or a user of your script should be careful of something.\\n *\\n * - `\\\"INFO\\\"`: The whole string will be printed in purplish blue. Use this prefix to\\n * remind yourself or a user of your script of something. Think of this prefix as\\n * indicating an FYI (for your information).\\n *\\n * For custom coloring, use ANSI escape sequences. The examples below use the Unicode\\n * escape code `\\\\u001b`. The color coding also works if `\\\\u001b` is replaced with\\n * the hexadecimal escape code `\\\\x1b`. The Bash escape code `\\\\e` is not supported.\\n * The octal escape code `\\\\033` is not allowed because the game runs JavaScript in\\n * strict mode.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * // Default color coding.\\n * print(\\\"ERROR means something's wrong.\\\");\\n * print(\\\"SUCCESS means everything's OK.\\\");\\n * print(\\\"WARN Tread with caution!\\\");\\n * print(\\\"WARNING, warning, danger, danger!\\\");\\n * print(\\\"WARNing! Here be dragons.\\\");\\n * print(\\\"INFO for your I's only (FYI).\\\");\\n * print(\\\"INFOrmation overload!\\\");\\n * // Custom color coding.\\n * var cyan = \\\"\\\\u001b[36m\\\";\\n * var green = \\\"\\\\u001b[32m\\\";\\n * var red = \\\"\\\\u001b[31m\\\";\\n * var reset = \\\"\\\\u001b[0m\\\";\\n * var msgError = red + \\\"Ugh! What a mess.\\\" + reset;\\n * var msgSuccess = green + \\\"Well done!\\\" + reset;\\n * var msgMixed = cyan + \\\"ERROR Should this be in red?\\\" + reset;\\n * print(msgError);\\n * print(msgSuccess);\\n * print(msgMixed);\\n * tail();\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * // Default color coding.\\n * ns.print(\\\"ERROR means something's wrong.\\\");\\n * ns.print(\\\"SUCCESS means everything's OK.\\\");\\n * ns.print(\\\"WARN Tread with caution!\\\");\\n * ns.print(\\\"WARNING, warning, danger, danger!\\\");\\n * ns.print(\\\"WARNing! Here be dragons.\\\");\\n * ns.print(\\\"INFO for your I's only (FYI).\\\");\\n * ns.print(\\\"INFOrmation overload!\\\");\\n * // Custom color coding.\\n * const cyan = \\\"\\\\u001b[36m\\\";\\n * const green = \\\"\\\\u001b[32m\\\";\\n * const red = \\\"\\\\u001b[31m\\\";\\n * const reset = \\\"\\\\u001b[0m\\\";\\n * const msgError = \\\"Ugh! What a mess.\\\";\\n * const msgSuccess = \\\"Well done!\\\";\\n * const msgMixed = \\\"ERROR Should this be in red?\\\";\\n * ns.print(`${red + msgError + reset}`);\\n * ns.print(`${green + msgSuccess + reset}`);\\n * ns.print(`${cyan + msgMixed + reset}`);\\n * ns.tail();\\n * ```\\n *\\n * @param args - Value(s) to be printed.\\n */\\n print(...args: any[]): void;\\n\\n /**\\n * Prints a formatted string to the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * - See {@link NS.print | print} for how to add color to your printed strings.\\n *\\n * - For more detail, see: https://github.com/alexei/sprintf.js\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * var name = \\\"Bit\\\";\\n * var age = 4;\\n * printf(\\\"My name is %s.\\\", name);\\n * printf(\\\"I'm %d seconds old.\\\", age);\\n * printf(\\\"My age in binary is %b.\\\", age);\\n * printf(\\\"My age in scientific notation is %e.\\\", age);\\n * printf(\\\"In %d seconds, I'll be %s.\\\", 6, \\\"Byte\\\");\\n * printf(\\\"Am I a nibble? %t\\\", (4 == age));\\n * tail();\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * const name = \\\"Bit\\\";\\n * const age = 4;\\n * ns.printf(\\\"My name is %s.\\\", name);\\n * ns.printf(\\\"I'm %d seconds old.\\\", age);\\n * ns.printf(\\\"My age in binary is %b.\\\", age);\\n * ns.printf(\\\"My age in scientific notation is %e.\\\", age);\\n * ns.printf(\\\"In %d seconds, I'll be %s.\\\", 6, \\\"Byte\\\");\\n * ns.printf(\\\"Am I a nibble? %t\\\", (4 == age));\\n * ns.tail();\\n * ```\\n *\\n * @param format - Format of the message.\\n * @param args - Value(s) to be printed.\\n */\\n printf(format: string, ...args: any[]): void;\\n\\n /**\\n * Prints one or more values or variables to the Terminal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * See {@link NS.print | print} for how to add color to your printed strings.\\n *\\n * @param args - Value(s) to be printed.\\n */\\n tprint(...args: any[]): void;\\n\\n /**\\n * Prints a raw value or a variable to the Terminal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * - See {@link NS.print | print} for how to add color to your printed strings.\\n *\\n * - See {@link NS.printf | printf} for examples on formatted strings.\\n *\\n * - For more detail, see: https://github.com/alexei/sprintf.js\\n *\\n * @param format - Format of the message.\\n * @param values - Value(s) to be printed.\\n */\\n tprintf(format: string, ...values: any[]): void;\\n\\n /**\\n * Clears the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clearLog(): void;\\n\\n /**\\n * Disables logging for the given function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Logging can be disabled for all functions by passing `ALL` as the argument.\\n *\\n * Note that this does not completely remove all logging functionality.\\n * This only stops a function from logging when the function is successful.\\n * If the function fails, it will still log the reason for failure.\\n *\\n * @param fn - Name of function for which to disable logging.\\n */\\n disableLog(fn: string): void;\\n\\n /**\\n * Enable logging for a certain function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Re-enables logging for the given function. If `ALL` is passed into this\\n * function as an argument, then it will revert the effects of disableLog(`ALL`).\\n *\\n * @param fn - Name of function for which to enable logging.\\n */\\n enableLog(fn: string): void;\\n\\n /**\\n * Checks the status of the logging for the given function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param fn - Name of function to check.\\n * @returns Returns a boolean indicating whether or not logging is enabled for that function (or `ALL`)\\n */\\n isLogEnabled(fn: string): boolean;\\n\\n /**\\n * Get all the logs of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns a script’s logs. The logs are returned as an array, where each line is an element in the array.\\n * The most recently logged line is at the end of the array.\\n * Note that there is a maximum number of lines that a script stores in its logs. This is configurable in the game’s options.\\n * If the function is called with no arguments, it will return the current script’s logs.\\n *\\n * Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script.\\n * Remember that scripts are uniquely identified by both their names and arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Get logs from foo.script on the current server that was run with no args\\n * getScriptLogs(\\\"foo.script\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with no args\\n * getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Get logs from foo.script on the current server that was run with no args\\n * ns.getScriptLogs(\\\"foo.script\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with no args\\n * ns.getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * ns.getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @param fn - Optional. Filename of script to get logs from.\\n * @param host - Optional. Hostname of the server that the script is on.\\n * @param args - Arguments to identify which scripts to get logs for.\\n * @returns Returns an string array, where each line is an element in the array. The most recently logged line is at the end of the array.\\n */\\n getScriptLogs(fn?: string, host?: string, ...args: (string | number | boolean)[]): string[];\\n\\n /**\\n * Get an array of recently killed scripts across all servers.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * The most recently killed script is the first element in the array.\\n * Note that there is a maximum number of recently killed scripts which are tracked.\\n * This is configurable in the game's options as `Recently killed scripts size`.\\n *\\n * @example\\n * ```ts\\n * let recentScripts = ns.getRecentScripts();\\n * let mostRecent = recentScripts.shift()\\n * if (mostRecent)\\n * ns.tprint(mostRecent.logs.join('\\\\n'))\\n * ```\\n *\\n * @returns Array with information about previously killed scripts.\\n */\\n getRecentScripts(): RecentScript[];\\n\\n /**\\n * Open the tail window of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Opens a script’s logs. This is functionally the same as the tail Terminal command.\\n *\\n * If the function is called with no arguments, it will open the current script’s logs.\\n *\\n * Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script.\\n * Remember that scripts are uniquely identified by both their names and arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Open logs from foo.script on the current server that was run with no args\\n * tail(\\\"foo.script\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with no args\\n * tail(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * tail(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Open logs from foo.script on the current server that was run with no args\\n * ns.tail(\\\"foo.script\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with no args\\n * ns.tail(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * ns.tail(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @param fn - Optional. Filename or PID of the script being tailed. If omitted, the current script is tailed.\\n * @param host - Optional. Hostname of the script being tailed. Defaults to the server this script is running on. If args are specified, this is not optional.\\n * @param args - Arguments for the script being tailed.\\n */\\n tail(fn?: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): void;\\n\\n /**\\n * Move a tail window\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Moves a tail window. Coordinates are in screenspace pixels (top left is 0,0)\\n *\\n * @param x - x coordinate.\\n * @param y - y coordinate.\\n * @param pid - Optional. PID of the script having its tail moved. If omitted, the current script is used.\\n */\\n moveTail(x: number, y: number, pid?: number): void;\\n\\n /**\\n * Resize a tail window\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Resize a tail window. Size are in pixel\\n *\\n * @param width - width of the window.\\n * @param height - height of the window.\\n * @param pid - Optional. PID of the script having its tail resized. If omitted, the current script is used.\\n */\\n resizeTail(width: number, height: number, pid?: number): void;\\n\\n /**\\n * Close the tail window of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Closes a script’s logs. This is functionally the same pressing the \\\"Close\\\" button on the tail window.\\n *\\n * If the function is called with no arguments, it will close the current script’s logs.\\n *\\n * Otherwise, the pid argument can be used to close the logs from another script.\\n *\\n * @param pid - Optional. PID of the script having its tail closed. If omitted, the current script is used.\\n */\\n closeTail(pid?: number): void;\\n\\n /**\\n * Get the list of servers connected to a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array containing the hostnames of all servers that are one\\n * node way from the specified target server. The hostnames in the returned\\n * array are strings.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * // All servers that are one hop from the current server.\\n * tprint(\\\"Neighbors of current server.\\\");\\n * var neighbor = scan();\\n * for (var i = 0; i < neighbor.length; i++) {\\n * tprint(neighbor[i]);\\n * }\\n * // All neighbors of n00dles.\\n * var target = \\\"n00dles\\\";\\n * neighbor = scan(target);\\n * tprintf(\\\"Neighbors of %s.\\\", target);\\n * for (var i = 0; i < neighbor.length; i++) {\\n * tprint(neighbor[i]);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * // All servers that are one hop from the current server.\\n * ns.tprint(\\\"Neighbors of current server.\\\");\\n * let neighbor = ns.scan();\\n * for (let i = 0; i < neighbor.length; i++) {\\n * ns.tprint(neighbor[i]);\\n * }\\n * // All neighbors of n00dles.\\n * const target = \\\"n00dles\\\";\\n * neighbor = ns.scan(target);\\n * ns.tprintf(\\\"Neighbors of %s.\\\", target);\\n * for (let i = 0; i < neighbor.length; i++) {\\n * ns.tprint(neighbor[i]);\\n * }\\n * ```\\n *\\n * @param host - Optional. Hostname of the server to scan, default to current server.\\n * @returns Returns an array of hostnames.\\n */\\n scan(host?: string): string[];\\n\\n /**\\n * Runs NUKE.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Running NUKE.exe on a target server gives you root access which means you can executes scripts on said server. NUKE.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * nuke(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.nuke(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n nuke(host: string): void;\\n\\n /**\\n * Runs BruteSSH.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the BruteSSH.exe program on the target server. BruteSSH.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * brutessh(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.brutessh(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n brutessh(host: string): void;\\n\\n /**\\n * Runs FTPCrack.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the FTPCrack.exe program on the target server. FTPCrack.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * ftpcrack(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.ftpcrack(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n ftpcrack(host: string): void;\\n\\n /**\\n * Runs relaySMTP.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the relaySMTP.exe program on the target server. relaySMTP.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * relaysmtp(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.relaysmtp(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n relaysmtp(host: string): void;\\n\\n /**\\n * Runs HTTPWorm.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the HTTPWorm.exe program on the target server. HTTPWorm.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * httpworm(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.httpworm(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n httpworm(host: string): void;\\n\\n /**\\n * Runs SQLInject.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the SQLInject.exe program on the target server. SQLInject.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * sqlinject(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.sqlinject(\\\"foodnstuff\\\");\\n * ```\\n * @remarks RAM cost: 0.05 GB\\n * @param host - Hostname of the target server.\\n */\\n sqlinject(host: string): void;\\n\\n /**\\n * Start another script on the current server.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Run a script as a separate process. This function can only be used to run scripts located on the\\n * current server (the server running the script that calls this function). Requires a significant\\n * amount of RAM to run this command.\\n *\\n * If the script was successfully started, then this functions returns the PID of that script.\\n * Otherwise, it returns 0.\\n *\\n * PID stands for Process ID. The PID is a unique identifier for each script.\\n * The PID will always be a positive integer.\\n *\\n * Running this function with a numThreads argument of 0 or less will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The simplest way to use the run command is to call it with just the script name. The following example will run ‘foo.script’ single-threaded with no arguments:\\n * run(\\\"foo.script\\\");\\n *\\n * //The following example will run ‘foo.script’ but with 5 threads instead of single-threaded:\\n * run(\\\"foo.script\\\", 5);\\n *\\n * //This next example will run ‘foo.script’ single-threaded, and will pass the string ‘foodnstuff’ into the script as an argument:\\n * run(\\\"foo.script\\\", 1, 'foodnstuff');\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The simplest way to use the run command is to call it with just the script name. The following example will run ‘foo.script’ single-threaded with no arguments:\\n * ns.run(\\\"foo.script\\\");\\n *\\n * //The following example will run ‘foo.script’ but with 5 threads instead of single-threaded:\\n * ns.run(\\\"foo.script\\\", 5);\\n *\\n * //This next example will run ‘foo.script’ single-threaded, and will pass the string ‘foodnstuff’ into the script as an argument:\\n * ns.run(\\\"foo.script\\\", 1, 'foodnstuff');\\n * ```\\n * @param script - Filename of script to run.\\n * @param numThreads - Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the second argument numThreads must be filled in with a value.\\n * @returns Returns the PID of a successfully started script, and 0 otherwise.\\n */\\n run(script: string, numThreads?: number, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Start another script on any server.\\n * @remarks\\n * RAM cost: 1.3 GB\\n *\\n * Run a script as a separate process on a specified server. This is similar to the function {@link NS.run | run}\\n * except that it can be used to run a script on any server, instead of just the current server.\\n *\\n * If the script was successfully started, then this function returns the PID of that script.\\n * Otherwise, it returns 0.\\n *\\n * PID stands for Process ID. The PID is a unique identifier for each script.\\n * The PID will always be a positive integer.\\n *\\n * Running this function with a numThreads argument of 0 or less will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * // The simplest way to use the exec command is to call it with just the script name\\n * // and the target server. The following example will try to run generic-hack.script\\n * // on the foodnstuff server.\\n * exec(\\\"generic-hack.script\\\", \\\"foodnstuff\\\");\\n *\\n * // The following example will try to run the script generic-hack.script on the\\n * // joesguns server with 10 threads.\\n * exec(\\\"generic-hack.script\\\", \\\"joesguns\\\", 10);\\n *\\n * // This last example will try to run the script foo.script on the foodnstuff server\\n * // with 5 threads. It will also pass the number 1 and the string “test” in as\\n * // arguments to the script.\\n * exec(\\\"foo.script\\\", \\\"foodnstuff\\\", 5, 1, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // The simplest way to use the exec command is to call it with just the script name\\n * // and the target server. The following example will try to run generic-hack.script\\n * // on the foodnstuff server.\\n * ns.exec(\\\"generic-hack.script\\\", \\\"foodnstuff\\\");\\n *\\n * // The following example will try to run the script generic-hack.script on the\\n * // joesguns server with 10 threads.\\n * ns.exec(\\\"generic-hack.script\\\", \\\"joesguns\\\", 10);\\n *\\n * // This last example will try to run the script foo.script on the foodnstuff server\\n * // with 5 threads. It will also pass the number 1 and the string “test” in as\\n * // arguments to the script.\\n * ns.exec(\\\"foo.script\\\", \\\"foodnstuff\\\", 5, 1, \\\"test\\\");\\n * ```\\n * @param script - Filename of script to execute.\\n * @param host - Hostname of the `target server` on which to execute the script.\\n * @param numThreads - Optional thread count for new script. Set to 1 by default. Will be rounded down to the nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the third argument numThreads must be filled in with a value.\\n * @returns Returns the PID of a successfully started script, and 0 otherwise.\\n */\\n exec(script: string, host: string, numThreads?: number, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Terminate current script and start another in 10s.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Terminates the current script, and then after a delay of about 10 seconds it will execute the\\n * newly-specified script. The purpose of this function is to execute a new script without being\\n * constrained by the RAM usage of the current one. This function can only be used to run scripts\\n * on the local server.\\n *\\n * Because this function immediately terminates the script, it does not have a return value.\\n *\\n * Running this function with a numThreads argument of 0 or less will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will execute the script ‘foo.script’ with 10 threads and the arguments ‘foodnstuff’ and 90:\\n * spawn('foo.script', 10, 'foodnstuff', 90);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will execute the script ‘foo.script’ with 10 threads and the arguments ‘foodnstuff’ and 90:\\n * ns.spawn('foo.script', 10, 'foodnstuff', 90);\\n * ```\\n * @param script - Filename of script to execute.\\n * @param numThreads - Number of threads to spawn new script with. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run.\\n */\\n spawn(script: string, numThreads?: number, ...args: (string | number | boolean)[]): void;\\n\\n /**\\n * Terminate another script.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Kills the script on the target server specified by the script’s name and arguments.\\n * Remember that scripts are uniquely identified by both their name and arguments.\\n * For example, if `foo.script` is run with the argument 1, then this is not the same as\\n * `foo.script` run with the argument 2, even though they have the same code.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * ns.kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @param script - Filename or pid of the script to kill\\n * @param host - Hostname of the server on which to kill the script.\\n * @param args - Arguments to identify which script to kill.\\n * @returns True if the script is successfully killed, and false otherwise.\\n */\\n kill(script: number): boolean;\\n\\n /**\\n * {@inheritDoc NS.(kill:1)}\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * ns.kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n */\\n kill(script: string, host: string, ...args: (string | number | boolean)[]): boolean;\\n\\n /**\\n * Terminate all scripts on a server.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Kills all running scripts on the specified server. This function returns true\\n * if any scripts were killed, and false otherwise. In other words, it will return\\n * true if there are any scripts running on the target server.\\n * If no host is defined, it will kill all scripts, where the script is running.\\n *\\n * @param host - IP or hostname of the server on which to kill all scripts.\\n * @param safetyguard - Skips the script that calls this function\\n * @returns True if any scripts were killed, and false otherwise.\\n */\\n killall(host?: string, safetyguard?: boolean): boolean;\\n\\n /**\\n * Terminates the current script immediately.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n exit(): never;\\n\\n /**\\n * Copy file between servers.\\n * @remarks\\n * RAM cost: 0.6 GB\\n *\\n * Copies a script or literature (.lit) file(s) to another server. The files argument can be either a string\\n * specifying a single file to copy, or an array of strings specifying multiple files to copy.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Copies foo.lit from the helios server to the home computer:\\n * scp(\\\"foo.lit\\\", \\\"home\\\", \\\"helios\\\");\\n *\\n * //Tries to copy three files from rothman-uni to home computer:\\n * files = [\\\"foo1.lit\\\", \\\"foo2.script\\\", \\\"foo3.script\\\"];\\n * scp(files, \\\"home\\\", \\\"rothman-uni\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Copies foo.lit from the helios server to the home computer:\\n * ns.scp(\\\"foo.lit\\\", \\\"home\\\", \\\"helios\\\" );\\n *\\n * //Tries to copy three files from rothman-uni to home computer:\\n * files = [\\\"foo1.lit\\\", \\\"foo2.script\\\", \\\"foo3.script\\\"];\\n * ns.scp(files, \\\"home\\\", \\\"rothman-uni\\\");\\n * ```\\n * @example\\n * ```ts\\n * //ns2, copies files from home to a target server\\n * const server = ns.args[0];\\n * const files = [\\\"hack.js\\\",\\\"weaken.js\\\",\\\"grow.js\\\"];\\n * ns.scp(files, server, \\\"home\\\");\\n * ```\\n * @param files - Filename or an array of filenames of script/literature files to copy.\\n * @param destination - Host of the destination server, which is the server to which the file will be copied.\\n * @param source - Host of the source server, which is the server from which the file will be copied. This argument is optional and if it’s omitted the source will be the current server.\\n * @returns True if the file is successfully copied over and false otherwise. If the files argument is an array then this function will return false if any of the operations failed.\\n */\\n scp(files: string | string[], destination: string, source?: string): boolean;\\n\\n /**\\n * List files on a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array with the filenames of all files on the specified server\\n * (as strings). The returned array is sorted in alphabetic order.\\n *\\n * @param host - Host of the target server.\\n * @param grep - A substring to search for in the filename.\\n * @returns Array with the filenames of all files on the specified server.\\n */\\n ls(host: string, grep?: string): string[];\\n\\n /**\\n * List running scripts on a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array with general information about all scripts running on the specified target server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var scripts = ps(\\\"home\\\");\\n * for (var i = 0; i < scripts.length; ++i) {\\n * tprint(scripts[i].filename + ' ' + scripts[i].threads);\\n * tprint(scripts[i].args);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const ps = ns.ps(\\\"home\\\");\\n * for (let script of ps) {\\n * ns.tprint(`${script.filename} ${script.threads}`);\\n * ns.tprint(script.args);\\n * }\\n * ```\\n * @param host - Host address of the target server. If not specified, it will be the current server’s IP by default.\\n * @returns Array with general information about all scripts running on the specified target server.\\n */\\n ps(host?: string): ProcessInfo[];\\n\\n /**\\n * Check if your have root access on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns a boolean indicating whether or not the player has root access to the specified target server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * if (hasRootAccess(\\\"foodnstuff\\\") == false) {\\n * nuke(\\\"foodnstuff\\\");\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * if (ns.hasRootAccess(\\\"foodnstuff\\\") == false) {\\n * ns.nuke(\\\"foodnstuff\\\");\\n * }\\n * ```\\n * @param host - Host of the target server\\n * @returns True if player has root access to the specified target server, and false otherwise.\\n */\\n hasRootAccess(host: string): boolean;\\n\\n /**\\n * Returns a string with the hostname of the server that the script is running on.\\n *\\n * @remarks\\n * RAM cost: 0.05 GB\\n * @returns Hostname of the server that the script is on.\\n */\\n getHostname(): string;\\n\\n /**\\n * Returns the player’s current hacking level.\\n *\\n * @remarks\\n * RAM cost: 0.05 GB\\n * @returns Player’s current hacking level\\n */\\n getHackingLevel(): number;\\n\\n /**\\n * Get hacking related multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the Player’s hacking related multipliers.\\n * These multipliers are returned in fractional forms, not percentages\\n * (e.g. 1.5 instead of 150%).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * // Example of how this can be used:\\n * var mults = getHackingMultipliers();\\n * print(mults.chance);\\n * print(mults.growth);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // Example of how this can be used:\\n * const {chance, growth} = ns.getHackingMultipliers();\\n * print(chance);\\n * print(growth);\\n * ```\\n * @returns Object containing the Player’s hacking related multipliers.\\n */\\n getHackingMultipliers(): HackingMultipliers;\\n\\n /**\\n * Get hacknet related multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the Player’s hacknet related multipliers.\\n * These multipliers are returned in fractional forms, not percentages\\n * (e.g. 1.5 instead of 150%).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * // Example of how this can be used:\\n * var mults = getHacknetMultipliers();\\n * print(mults.production);\\n * print(mults.purchaseCost);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // Example of how this can be used:\\n * const {production, purchaseCost} = ns.getHacknetMultipliers();\\n * print(production);\\n * print(purchaseCost);\\n * ```\\n * @returns Object containing the Player’s hacknet related multipliers.\\n */\\n getHacknetMultipliers(): HacknetMultipliers;\\n\\n /**\\n * Returns a server object for the given server. Defaults to the running script's server if host is not specified.\\n *\\n * @remarks\\n * RAM cost: 2 GB\\n * @param host - Optional. Hostname for the requested server object.\\n * @returns The requested server object.\\n */\\n getServer(host?: string): Server;\\n\\n /**\\n * Get money available on a server.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of money available on a server.\\n * Running this function on the home computer will return the player’s money.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * getServerMoneyAvailable(\\\"home\\\"); //Returns player's money\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * ns.getServerMoneyAvailable(\\\"home\\\"); // Returns player's money\\n * ```\\n * @param host - Host of target server\\n * @returns Amount of money available on the server.\\n */\\n getServerMoneyAvailable(host: string): number;\\n\\n /**\\n * Get maximum money available on a server.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the maximum amount of money that can be available on a server.\\n *\\n * @param host - Host of target server.\\n * @returns Maximum amount of money available on the server.\\n */\\n getServerMaxMoney(host: string): number;\\n\\n /**\\n * Get a server growth parameter.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the server’s intrinsic “growth parameter”. This growth\\n * parameter is a number typically between 0 and 100 that represents\\n * how quickly the server’s money grows. This parameter affects the\\n * percentage by which the server’s money is increased when using the\\n * grow function. A higher growth parameter will result in a\\n * higher percentage increase from grow.\\n *\\n * @param host - Host of target server.\\n * @returns Parameter that affects the percentage by which the server’s money is increased when using the grow function.\\n */\\n getServerGrowth(host: string): number;\\n\\n /**\\n * Get server security level.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the security level of the target server. A server’s security\\n * level is denoted by a number, typically between 1 and 100\\n * (but it can go above 100).\\n *\\n * @param host - Host of target server.\\n * @returns Security level of the target server.\\n */\\n getServerSecurityLevel(host: string): number;\\n\\n /**\\n * Returns the minimum security level of the target server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns Minimum security level of the target server.\\n */\\n getServerMinSecurityLevel(host: string): number;\\n\\n /**\\n * @deprecated useless\\n * @remarks\\n * RAM cost: 0.1 GB\\n * Returns the base security level of the target server. This is the security\\n * level that the server starts out with. This is different than\\n * getServerSecurityLevel because getServerSecurityLevel returns\\n * the current security level of a server, which can constantly change due to\\n * hack, grow, and weaken, calls on that server.\\n * The base security level will stay the same until you reset by\\n * installing an Augmentation(s).\\n *\\n * @param host - Host of target server.\\n * @returns Base security level of the target server.\\n */\\n getServerBaseSecurityLevel(host: string): number;\\n\\n /**\\n * @deprecated use getServerMaxRam / getServerUsedRam\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns an array with two elements that gives information about a server’s memory (RAM).\\n * The first element in the array is the amount of RAM that the server has total (in GB).\\n * The second element in the array is the amount of RAM that is currently being used on\\n * the server (in GB).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var serverRam = getServerRam(\\\"helios\\\");\\n * var totalRam = serverRam[0];\\n * var ramUsed = serverRam[1];\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const [totalRam, ramUsed] = ns.getServerRam(\\\"helios\\\");\\n * ```\\n * @param host - Host of target server.\\n * @returns Array with total and used memory on the specified server, in GB.\\n */\\n getServerRam(host: string): [number, number];\\n\\n /**\\n * Get the max RAM on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * @param host - Hostname of the target server.\\n * @returns max ram (GB)\\n */\\n getServerMaxRam(host: string): number;\\n /**\\n * Get the used RAM on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * @param host - Hostname of the target server.\\n * @returns used ram (GB)\\n */\\n getServerUsedRam(host: string): number;\\n\\n /**\\n * Returns the required hacking level of the target server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns The required hacking level of the target server.\\n */\\n getServerRequiredHackingLevel(host: string): number;\\n\\n /**\\n * Returns the number of open ports required to successfully run NUKE.exe on the specified server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns The number of open ports required to successfully run NUKE.exe on the specified server.\\n */\\n getServerNumPortsRequired(host: string): number;\\n\\n /**\\n * Returns a boolean denoting whether or not the specified server exists.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns True if specified server exists, and false otherwise.\\n */\\n serverExists(host: string): boolean;\\n\\n /**\\n * Check if a file exists.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns a boolean indicating whether the specified file exists on the target server.\\n * The filename for scripts is case-sensitive, but for other types of files it is not.\\n * For example, fileExists(“brutessh.exe”) will work fine, even though the actual program\\n * is named 'BruteSSH.exe'.\\n *\\n * If the hostname/ip argument is omitted, then the function will search through the current\\n * server (the server running the script that calls this function) for the file.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if the script named foo.script exists on the foodnstuff server, and false otherwise.\\n * fileExists(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if the current server contains the FTPCrack.exe program, and false otherwise.\\n * fileExists(\\\"ftpcrack.exe\\\");\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * // The function call will return true if the script named foo.script exists on the foodnstuff server, and false otherwise.\\n * ns.fileExists(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * // The function call will return true if the current server contains the FTPCrack.exe program, and false otherwise.\\n * ns.fileExists(\\\"ftpcrack.exe\\\");\\n * ```\\n * @param filename - Filename of file to check.\\n * @param host - Host of target server. This is optional. If it is not specified then the function will use the current server as the target server.\\n * @returns True if specified file exists, and false otherwise.\\n */\\n fileExists(filename: string, host?: string): boolean;\\n\\n /**\\n * Check if a script is running.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns a boolean indicating whether the specified script is running on the target server.\\n * If you use a PID instead of a filename, the hostname and args parameters are unnecessary.\\n * Remember that a script is uniquely identified by both its name and its arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if there is a script named foo.script with no arguments running on the foodnstuff server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is a script named foo.script with no arguments running on the current server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", getHostname());\\n *\\n * //The function call will return true if there is a script named foo.script running with the arguments 1, 5, and “test” (in that order) on the joesguns server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", \\\"joesguns\\\", 1, 5, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The function call will return true if there is a script named foo.script with no arguments running on the foodnstuff server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is a script named foo.script with no arguments running on the current server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", ns.getHostname());\\n *\\n * //The function call will return true if there is a script named foo.script running with the arguments 1, 5, and “test” (in that order) on the joesguns server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", \\\"joesguns\\\", 1, 5, \\\"test\\\");\\n * ```\\n * @param script - Filename or PID of script to check. This is case-sensitive.\\n * @param host - Host of target server.\\n * @param args - Arguments to specify/identify which scripts to search for.\\n * @returns True if specified script is running on the target server, and false otherwise.\\n */\\n isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): boolean;\\n\\n /**\\n * Get general info about a running script.\\n * @remarks\\n * RAM cost: 0.3 GB\\n *\\n * Running with no args returns current script.\\n * If you use a PID as the first parameter, the hostname and args parameters are unnecessary.\\n *\\n * @param filename - Optional. Filename or PID of the script.\\n * @param hostname - Optional. Name of host server the script is running on.\\n * @param args - Arguments to identify the script\\n * @returns The info about the running script if found, and null otherwise.\\n */\\n getRunningScript(\\n filename?: FilenameOrPID,\\n hostname?: string,\\n ...args: (string | number | boolean)[]\\n ): RunningScript | null;\\n\\n /**\\n * Get cost of purchasing a server.\\n * @remarks\\n * RAM cost: 0.25 GB\\n *\\n * Returns the cost to purchase a server with the specified amount of ram.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * for (i = 1; i <= 20; i++) {\\n * tprint(i + \\\" -- \\\" + getPurchasedServerCost(Math.pow(2, i)));\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * for (i = 1; i <= 20; i++) {\\n * ns.tprint(i + \\\" -- \\\" + ns.getPurchasedServerCost(Math.pow(2, i)));\\n * }\\n * ```\\n * @param ram - Amount of RAM of a potential purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\\n * @returns The cost to purchase a server with the specified amount of ram.\\n */\\n getPurchasedServerCost(ram: number): number;\\n\\n /**\\n * Purchase a server.\\n * @remarks\\n * 2.25 GB\\n *\\n * Purchased a server with the specified hostname and amount of RAM.\\n *\\n * The hostname argument can be any data type, but it will be converted to a string\\n * and have whitespace removed. Anything that resolves to an empty string will cause\\n * the function to fail. If there is already a server with the specified hostname,\\n * then the function will automatically append a number at the end of the hostname\\n * argument value until it finds a unique hostname. For example, if the script calls\\n * `purchaseServer(“foo”, 4)` but a server named “foo” already exists, the it will\\n * automatically change the hostname to `foo-0`. If there is already a server with the\\n * hostname `foo-0`, then it will change the hostname to `foo-1`, and so on.\\n *\\n * Note that there is a maximum limit to the amount of servers you can purchase.\\n *\\n * Returns the hostname of the newly purchased server as a string. If the function\\n * fails to purchase a server, then it will return an empty string. The function will\\n * fail if the arguments passed in are invalid, if the player does not have enough\\n * money to purchase the specified server, or if the player has exceeded the maximum\\n * amount of servers.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var ram = 64;\\n * var prefix = \\\"pserv-\\\";\\n * for (i = 0; i < 5; ++i) {\\n * purchaseServer(prefix + i, ram);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const ram = 64;\\n * const prefix = \\\"pserv-\\\";\\n * for (i = 0; i < 5; ++i) {\\n * ns.purchaseServer(prefix + i, ram);\\n * }\\n * ```\\n * @param hostname - Host of the purchased server.\\n * @param ram - Amount of RAM of the purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\\n * @returns The hostname of the newly purchased server.\\n */\\n purchaseServer(hostname: string, ram: number): string;\\n\\n /**\\n * Get cost of upgrading a purchased server to the given ram.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * @param hostname - Hostname of the server to upgrade.\\n * @param ram - Amount of RAM of the purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\\n * @returns The price to upgrade.\\n */\\n getPurchasedServerUpgradeCost(hostname: string, ram: number): number;\\n\\n /**\\n * Upgrade a purchased servers ram.\\n * @remarks\\n * RAM cost: 0.25 GB\\n *\\n * @param hostname - Hostname of the server to upgrade.\\n * @param ram - Amount of RAM of the purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\\n * @returns True if the upgrade succeeded.\\n */\\n upgradePurchasedServer(hostname: string, ram: number): boolean;\\n\\n /**\\n * Rename a purchased server.\\n * @remarks\\n * RAM cost: 2.00 GB\\n *\\n * @param hostname - current server hostname\\n * @param newName - new server hostname\\n * @returns True if the upgrade succeeded.\\n */\\n renamePurchasedServer(hostname: string, newName: string): boolean;\\n\\n /**\\n * Delete a purchased server.\\n * @remarks\\n * 2.25 GB\\n *\\n * Deletes one of your purchased servers, which is specified by its hostname.\\n *\\n * The hostname argument can be any data type, but it will be converted to a string.\\n * Whitespace is automatically removed from the string. This function will not delete a\\n * server that still has scripts running on it.\\n *\\n * @param host - Host of the server to delete.\\n * @returns True if successful, and false otherwise.\\n */\\n deleteServer(host: string): boolean;\\n\\n /**\\n * Returns an array with the hostnames of all of the servers you have purchased.\\n *\\n * @remarks 2.25 GB\\n * @returns Returns an array with the hostnames of all of the servers you have purchased.\\n */\\n getPurchasedServers(): string[];\\n\\n /**\\n * Returns the maximum number of servers you can purchase.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Returns the maximum number of servers you can purchase.\\n */\\n getPurchasedServerLimit(): number;\\n\\n /**\\n * Returns the maximum RAM that a purchased server can have.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Returns the maximum RAM (in GB) that a purchased server can have.\\n */\\n getPurchasedServerMaxRam(): number;\\n\\n /**\\n * Write data to a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function can be used to write data to a text file (.txt) or a script (.js or .script).\\n *\\n * This function will write data to that file. If the specified file does not exist,\\n * then it will be created. The third argument mode, defines how the data will be written to\\n * the file. If *mode is set to “w”, then the data is written in “write” mode which means\\n * that it will overwrite all existing data on the file. If mode is set to any other value\\n * then the data will be written in “append” mode which means that the data will be added at the\\n * end of the file.\\n *\\n * @param filename - Name of the file to be written to.\\n * @param data - Data to write.\\n * @param mode - Defines the write mode.\\n */\\n write(filename: string, data?: string[] | number | string, mode?: \\\"w\\\" | \\\"a\\\"): void;\\n\\n /**\\n * Attempt to write to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Attempts to write data to the specified Netscript Port.\\n * If the port is full, the data will not be written.\\n * Otherwise, the data will be written normally.\\n *\\n * @param port - Port or text file that will be written to.\\n * @param data - Data to write.\\n * @returns True if the data is successfully written to the port, and false otherwise.\\n */\\n tryWritePort(port: number, data: string | number): boolean;\\n\\n /**\\n * Read content of a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to read data from a text file (.txt) or script (.script, .js).\\n *\\n * This function will return the data in the specified file.\\n * If the file does not exist, an empty string will be returned.\\n *\\n * @param filename - Name of the file to be read.\\n * @returns Data in the specified text file.\\n */\\n read(filename: string): string;\\n\\n /**\\n * Get a copy of the data from a port without popping it.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to peek at the data from a port. It returns the\\n * first element in the specified port without removing that element. If\\n * the port is empty, the string “NULL PORT DATA” will be returned.\\n *\\n * @param port - Port to peek. Must be an integer between 1 and 20.\\n * @returns Data in the specified port.\\n */\\n peek(port: number): PortData;\\n\\n /**\\n * Clear data from a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Delete all data from that text file.\\n *\\n * @param handle - Text file to clear.\\n */\\n clear(handle: string): void;\\n\\n /**\\n * Clear data from a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Delete all data from the underlying queue.\\n *\\n * @param handle - Port to clear.\\n */\\n clearPort(handle: number): void;\\n\\n /**\\n * Write data to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Write data to that netscript port.\\n * @returns The data popped off the queue if it was full.\\n */\\n writePort(port: number, data: string | number): Promise<PortData>;\\n /**\\n * Read data from a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Read data from that port. A port is a serialized queue.\\n * This function will remove the first element from that queue and return it.\\n * If the queue is empty, then the string “NULL PORT DATA” will be returned.\\n * @returns the data read.\\n */\\n readPort(port: number): PortData;\\n\\n /**\\n * Get all data on a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Get a handle to a Netscript Port.\\n *\\n * WARNING: Port Handles only work in NetscriptJS (Netscript 2.0). They will not work in Netscript 1.0.\\n *\\n * @see https://bitburner.readthedocs.io/en/latest/netscript/netscriptmisc.html#netscript-ports\\n * @param port - Port number. Must be an integer between 1 and 20.\\n */\\n getPortHandle(port: number): NetscriptPort;\\n\\n /**\\n * Delete a file.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Removes the specified file from the current server. This function works for every file\\n * type except message (.msg) files.\\n *\\n * @param name - Filename of file to remove. Must include the extension.\\n * @param host - Host Address of the server on which to delete the file. Optional. Defaults to current server.\\n * @returns True if it successfully deletes the file, and false otherwise.\\n */\\n rm(name: string, host?: string): boolean;\\n\\n /**\\n * Check if any script with a filename is running.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns a boolean indicating whether any instance of the specified script is running\\n * on the target server, regardless of its arguments.\\n *\\n * This is different than the isRunning function because it does not try to\\n * identify a specific instance of a running script by its arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if there is any script named foo.script running on the foodnstuff server, and false otherwise:\\n * scriptRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is any script named “foo.script” running on the current server, and false otherwise:\\n * scriptRunning(\\\"foo.script\\\", getHostname());\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * //The function call will return true if there is any script named foo.script running on the foodnstuff server, and false otherwise:\\n * ns.scriptRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is any script named “foo.script” running on the current server, and false otherwise:\\n * ns.scriptRunning(\\\"foo.script\\\", ns.getHostname());\\n * ```\\n * @param script - Filename of script to check. This is case-sensitive.\\n * @param host - Host of target server.\\n * @returns True if the specified script is running, and false otherwise.\\n */\\n scriptRunning(script: string, host: string): boolean;\\n\\n /**\\n * Kill all scripts with a filename.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Kills all scripts with the specified filename on the target server specified by hostname,\\n * regardless of arguments.\\n *\\n * @param script - Filename of script to kill. This is case-sensitive.\\n * @param host - Host of target server.\\n * @returns true if one or more scripts were successfully killed, and false if none were.\\n */\\n scriptKill(script: string, host: string): boolean;\\n\\n /**\\n * Returns the current script name.\\n *\\n * @remarks RAM cost: 0 GB\\n * @returns Current script name.\\n */\\n getScriptName(): string;\\n\\n /**\\n * Get the ram cost of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of RAM required to run the specified script on the target server.\\n * Returns 0 if the script does not exist.\\n *\\n * @param script - Filename of script. This is case-sensitive.\\n * @param host - Host of target server the script is located on. This is optional, if it is not specified then the function will use the current server as the target server.\\n * @returns Amount of RAM (in GB) required to run the specified script on the target server, and 0 if the script does not exist.\\n */\\n getScriptRam(script: string, host?: string): number;\\n\\n /**\\n * Get the execution time of a hack() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * When `hack` completes an amount of money is stolen depending on the player's skills.\\n * Returns the amount of time in milliseconds it takes to execute the hack Netscript function on the target server.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the hack Netscript function.\\n */\\n getHackTime(host: string): number;\\n\\n /**\\n * Get the execution time of a grow() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns the amount of time in milliseconds it takes to execute the grow Netscript function on the target server.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the grow Netscript function.\\n */\\n getGrowTime(host: string): number;\\n\\n /**\\n * Get the execution time of a weaken() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns the amount of time in milliseconds it takes to execute the weaken Netscript function on the target server.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the weaken Netscript function.\\n */\\n getWeakenTime(host: string): number;\\n\\n /**\\n * Get the income of all script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * @returns an array of two values.\\n * The first value is the total income (dollar / second) of all of your active scripts\\n * (scripts that are currently running on any server).\\n * The second value is the total income (dollar / second) that you’ve earned from scripts\\n * since you last installed Augmentations.\\n */\\n getTotalScriptIncome(): [number, number];\\n\\n /**\\n * Get the income of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of income the specified script generates while online\\n * (when the game is open, does not apply for offline income). Remember that\\n * a script is uniquely identified by both its name and its arguments. So for\\n * example if you ran a script with the arguments “foodnstuff” and “5” then\\n * in order to use this function to get that script’s income you must specify\\n * those same arguments in the same order in this function call.\\n *\\n * @param script - Filename of script.\\n * @param host - Server on which script is running.\\n * @param args - Arguments that the script is running with.\\n * @returns Amount of income the specified script generates while online.\\n */\\n getScriptIncome(script: string, host: string, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Get the exp gain of all script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * @returns total experience gain rate of all of your active scripts.\\n */\\n getTotalScriptExpGain(): number;\\n\\n /**\\n * Get the exp gain of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of hacking experience the specified script generates while online\\n * (when the game is open, does not apply for offline experience gains). Remember that a\\n * script is uniquely identified by both its name and its arguments.\\n *\\n * This function can also return the total experience gain rate of all of your active\\n * scripts by running the function with no arguments.\\n *\\n * @param script - Filename of script.\\n * @param host - Server on which script is running.\\n * @param args - Arguments that the script is running with.\\n * @returns Amount of hacking experience the specified script generates while online.\\n */\\n getScriptExpGain(script: string, host: string, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Returns the amount of time in milliseconds that have passed since you last installed Augmentations.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Time in milliseconds that have passed since you last installed Augmentations.\\n */\\n getTimeSinceLastAug(): number;\\n\\n /**\\n * Format a string.\\n *\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - String to format.\\n * @param args - Formatting arguments.\\n * @returns Formatted text.\\n */\\n sprintf(format: string, ...args: any[]): string;\\n\\n /**\\n * Format a string with an array of arguments.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - String to format.\\n * @param args - Formatting arguments.\\n * @returns Formatted text.\\n */\\n vsprintf(format: string, args: any[]): string;\\n\\n /**\\n * Format a number\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Converts a number into a string with the specified formatter.\\n * This uses the numeral.js library, so the formatters must be compatible with that.\\n * This is the same function that the game itself uses to display numbers.\\n *\\n * see: http://numeraljs.com/\\n * @param n - Number to format.\\n * @param format - Formatter.\\n * @returns Formatted number.\\n */\\n nFormat(n: number, format: string): string;\\n\\n /**\\n * Format time to readable string\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param milliseconds - Number of millisecond to format.\\n * @param milliPrecision - Format time with subsecond precision, defaults to false.\\n * @returns The formatted time.\\n */\\n tFormat(milliseconds: number, milliPrecision?: boolean): string;\\n\\n /**\\n * Prompt the player with an input modal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Prompts the player with a dialog box. If `options.type` is undefined or \\\"boolean\\\",\\n * the player is shown \\\"Yes\\\" and \\\"No\\\" prompts, which return true and false respectively.\\n * Passing a type of \\\"text\\\" will give the player a text field and a value of \\\"select\\\"\\n * will show a drop-down field. Choosing type \\\"select\\\" will require an array or object\\n * to be passed via the `options.choices` property.\\n * The script’s execution is halted until the player selects one of the options.\\n *\\n * @param txt - Text to appear in the prompt dialog box.\\n * @param options - Options to modify the prompt the player is shown.\\n * @returns True if the player click “Yes”; false if the player clicks “No”; or the value entered by the player.\\n */\\n prompt(\\n txt: string,\\n options?: { type?: \\\"boolean\\\" | \\\"text\\\" | \\\"select\\\" | undefined; choices?: string[] },\\n ): Promise<boolean | string>;\\n\\n /**\\n * Open up a message box.\\n * @param msg - Message to alert.\\n */\\n alert(msg: string): void;\\n\\n /**\\n * Queue a toast (bottom-right notification).\\n * @param msg - Message in the toast.\\n * @param variant - Type of toast, must be one of success, info, warning, error. Defaults to success.\\n * @param duration - Duration of toast in ms. Can also be `null` to create a persistent toast. Defaults to 2000\\n */\\n toast(msg: string, variant?: ToastVariant, duration?: number | null): void;\\n\\n /**\\n * Download a file from the internet.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Retrieves data from a URL and downloads it to a file on the specified server.\\n * The data can only be downloaded to a script (.script, .js) or a text file (.txt).\\n * If the file already exists, it will be overwritten by this command.\\n * Note that it will not be possible to download data from many websites because they\\n * do not allow cross-origin resource sharing (CORS).\\n *\\n * IMPORTANT: This is an asynchronous function that returns a Promise.\\n * The Promise’s resolved value will be a boolean indicating whether or not the data was\\n * successfully retrieved from the URL. Because the function is async and returns a Promise,\\n * it is recommended you use wget in NetscriptJS (Netscript 2.0).\\n *\\n * In NetscriptJS, you must preface any call to wget with the await keyword (like you would hack or sleep).\\n * wget will still work in Netscript 1.0, but the functions execution will not be synchronous\\n * (i.e. it may not execute when you expect/want it to).\\n * Furthermore, since Promises are not supported in ES5,\\n * you will not be able to process the returned value of wget in Netscript 1.0.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * wget(\\\"https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md\\\", \\\"game_readme.txt\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * await ns.wget(\\\"https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md\\\", \\\"game_readme.txt\\\");\\n * ```\\n * @param url - URL to pull data from.\\n * @param target - Filename to write data to. Must be script or text file.\\n * @param host - Optional hostname/ip of server for target file.\\n * @returns True if the data was successfully retrieved from the URL, false otherwise.\\n */\\n wget(url: string, target: string, host?: string): Promise<boolean>;\\n\\n /**\\n * Returns the amount of Faction favor required to be able to donate to a faction.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @returns Amount of Faction favor required to be able to donate to a faction.\\n */\\n getFavorToDonate(): number;\\n\\n /**\\n * Get the current Bitnode multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the current (or supplied) BitNode multipliers.\\n * This function requires you to be in Bitnode 5 or have Source-File 5 in order to run.\\n * The multipliers are returned in decimal forms (e.g. 1.5 instead of 150%).\\n * The multipliers represent the difference between the current BitNode and\\n * the original BitNode (BitNode-1).\\n *\\n * For example, if the CrimeMoney multiplier has a value of 0.1, then that means\\n * that committing crimes in the current BitNode will only give 10% of the money\\n * you would have received in BitNode-1.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var mults = getBitNodeMultipliers();\\n * print(mults.ServerMaxMoney);\\n * print(mults.HackExpGain);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const {ServerMaxMoney, HackExpGain} = ns.getBitNodeMultipliers();\\n * print(ServerMaxMoney);\\n * print(HackExpGain);\\n * ```\\n * @returns Object containing the current BitNode multipliers.\\n */\\n getBitNodeMultipliers(n?: number, lvl?: number): BitNodeMultipliers;\\n\\n /**\\n * Get information about the player.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Returns an object with information on the current player.\\n *\\n * @returns Player info\\n */\\n getPlayer(): Player;\\n\\n /**\\n * Get information about the sources of income for this run.\\n * @remarks\\n * RAM cost: 1.0 GB\\n *\\n * Returns an object with information on the income sources for this run\\n *\\n * @returns Money sources\\n */\\n getMoneySources(): MoneySources;\\n\\n /**\\n * Add callback function when the script dies\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * NS2 exclusive\\n *\\n * Add callback to be executed when the script dies.\\n */\\n atExit(f: () => void): void;\\n\\n /**\\n * Move a file on the target server.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * NS2 exclusive\\n *\\n * Move the source file to the specified destination on the target server.\\n *\\n * This command only works for scripts and text files (.txt). It cannot, however, be used\\n * to convert from script to text file, or vice versa.\\n *\\n * This function can also be used to rename files.\\n *\\n * @param host - Host of target server.\\n * @param source - Filename of the source file.\\n * @param destination - Filename of the destination file.\\n */\\n mv(host: string, source: string, destination: string): void;\\n\\n /**\\n * Parse command line flags.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Allows unix like flag parsing.\\n * @example\\n * ```ts\\n * // example.script\\n * var data = flags([\\n * ['delay', 0], // a default number means this flag is a number\\n * ['server', 'foodnstuff'], // a default string means this flag is a string\\n * ['exclude', []], // a default array means this flag is a default array of string\\n * ['help', false], // a default boolean means this flag is a boolean\\n * ]);\\n * tprint(data);\\n *\\n * // example.js\\n * export async function main(ns) {\\n * const data = ns.flags([\\n * ['delay', 0], // a default number means this flag is a number\\n * ['server', 'foodnstuff'], // a default string means this flag is a string\\n * ['exclude', []], // a default array means this flag is a default array of string\\n * ['help', false], // a default boolean means this flag is a boolean\\n * ]);\\n * ns.tprint(data);\\n * }\\n *\\n * // [home ~/]> run example.script\\n * // {\\\"_\\\":[],\\\"delay\\\":0,\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":false}\\n * // [home ~/]> run example.script --delay 3000\\n * // {\\\"_\\\":[],\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi\\n * // {\\\"_\\\":[],\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\"}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi hello world\\n * // {\\\"_\\\":[\\\"hello\\\",\\\"world\\\"],\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\"}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi hello world --exclude a --exclude b\\n * // {\\\"_\\\":[\\\"hello\\\",\\\"world\\\"],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\",\\\"exclude\\\":[\\\"a\\\",\\\"b\\\"]}\\n * // [home ~/]> run example.script --help\\n * // {\\\"_\\\":[],\\\"delay\\\":0,\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":true}\\n * ```\\n */\\n flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };\\n\\n /**\\n * Share your computer with your factions.\\n * @remarks\\n * RAM cost: 2.4 GB\\n *\\n * Increases your rep gain of hacking contracts while share is called.\\n * Scales with thread count.\\n */\\n share(): Promise<void>;\\n\\n /**\\n * Calculate your share power. Based on all the active share calls.\\n * @remarks\\n * RAM cost: 0.2 GB\\n */\\n getSharePower(): number;\\n\\n enums: NSEnums;\\n}\\n\\n/** @public */\\ndeclare const enums = {\\n toast: {\\n SUCCESS: \\\"success\\\",\\n WARNING: \\\"warning\\\",\\n ERROR: \\\"error\\\",\\n INFO: \\\"info\\\",\\n },\\n};\\n\\n/** @public */\\ntype ToastVariant = ValuesFrom<typeof enums.toast>;\\n\\n/** @public */\\nexport type NSEnums = typeof enums;\\n/**\\n * Corporation Office API\\n * @remarks\\n * requires the Office API upgrade from your corporation.\\n * @public\\n */\\nexport interface OfficeAPI {\\n /**\\n * Assign an employee to a job.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param employeeName - name of the employee\\n * @param job - Name of the job.\\n */\\n assignJob(divisionName: string, cityName: string, employeeName: string, job: string): void;\\n /**\\n * Hire an employee.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns The newly hired employee, if any\\n */\\n hireEmployee(divisionName: string, cityName: string): Employee | undefined;\\n /**\\n * Upgrade office size.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param size - Amount of positions to open\\n */\\n upgradeOfficeSize(divisionName: string, cityName: string, size: number): void;\\n /**\\n * Throw a party for your employees\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param costPerEmployee - Amount to spend per employee.\\n * @returns Multiplier for happiness and morale, or zero on failure\\n */\\n throwParty(divisionName: string, cityName: string, costPerEmployee: number): number;\\n /**\\n * Buy coffee for your employees\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns true if buying coffee was successful, false otherwise\\n */\\n buyCoffee(divisionName: string, cityName: string): boolean;\\n /**\\n * Hire AdVert.\\n * @param divisionName - Name of the division\\n */\\n hireAdVert(divisionName: string): void;\\n /**\\n * Purchase a research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n */\\n research(divisionName: string, researchName: string): void;\\n /**\\n * Get data about an office\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns Office data\\n */\\n getOffice(divisionName: string, cityName: string): Office;\\n /**\\n * Get data about an employee\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param employeeName - Name of the employee\\n * @returns Employee data\\n */\\n getEmployee(divisionName: string, cityName: string, employeeName: string): Employee;\\n /**\\n * Get the cost to Hire AdVert\\n * @param divisionName - Name of the division\\n * @returns Cost\\n */\\n getHireAdVertCost(divisionName: string): number;\\n /**\\n * Get the number of times you have Hired AdVert\\n * @param divisionName - Name of the division\\n * @returns Number of times you have Hired AdVert\\n */\\n getHireAdVertCount(adivisionName: string): number;\\n /**\\n * Get the cost to unlock research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n * @returns cost\\n */\\n getResearchCost(divisionName: string, researchName: string): number;\\n /**\\n * Gets if you have unlocked a research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n * @returns true is unlocked, false if not\\n */\\n hasResearched(divisionName: string, researchName: string): boolean;\\n /**\\n * Set the auto job assignment for a job\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param job - Name of the job\\n * @param amount - Number of employees to assign to that job\\n * @returns true if the employee count reached the target amount, false if not\\n */\\n setAutoJobAssignment(divisionName: string, cityName: string, job: string, amount: number): boolean;\\n /**\\n * Cost to Upgrade office size.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param size - Amount of positions to open\\n * @returns Cost of upgrading the office\\n */\\n getOfficeSizeUpgradeCost(divisionName: string, cityName: string, asize: number): number;\\n}\\n\\n/**\\n * Corporation Warehouse API\\n * @remarks\\n * Requires the Warehouse API upgrade from your corporation.\\n * @public\\n */\\nexport interface WarehouseAPI {\\n /**\\n * Set material sell data.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount to sell, can be \\\"MAX\\\"\\n * @param price - Price to sell, can be \\\"MP\\\"\\n */\\n sellMaterial(divisionName: string, cityName: string, materialName: string, amt: string, price: string): void;\\n /**\\n * Set product sell data.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param amt - Amount to sell, can be \\\"MAX\\\"\\n * @param price - Price to sell, can be \\\"MP\\\"\\n * @param all - Sell in all city\\n */\\n sellProduct(\\n divisionName: string,\\n cityName: string,\\n productName: string,\\n amt: string,\\n price: string,\\n all: boolean,\\n ): void;\\n /**\\n * Discontinue a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n */\\n discontinueProduct(divisionName: string, productName: string): void;\\n /**\\n * Set smart supply\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param enabled - smart supply enabled\\n */\\n setSmartSupply(divisionName: string, cityName: string, enabled: boolean): void;\\n /**\\n * Set whether smart supply uses leftovers before buying\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param enabled - smart supply use leftovers enabled\\n */\\n setSmartSupplyUseLeftovers(divisionName: string, cityName: string, materialName: string, enabled: boolean): void;\\n /**\\n * Set material buy data\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to buy\\n */\\n buyMaterial(divisionName: string, cityName: string, materialName: string, amt: number): void;\\n /**\\n * Set material to bulk buy\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to buy\\n */\\n bulkPurchase(divisionName: string, cityName: string, materialName: string, amt: number): void;\\n /**\\n * Get warehouse data\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns warehouse data\\n */\\n getWarehouse(divisionName: string, cityName: string): Warehouse;\\n /**\\n * Get product data\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @returns product data\\n */\\n getProduct(divisionName: string, productName: string): Product;\\n /**\\n * Get material data\\n * @param divisionName - Name of the division\\n * @param materialName - Name of the material\\n * @returns material data\\n */\\n getMaterial(divisionName: string, cityName: string, materialName: string): Material;\\n /**\\n * Set market TA 1 for a material.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param on - market ta enabled\\n */\\n setMaterialMarketTA1(divisionName: string, cityName: string, materialName: string, on: boolean): void;\\n /**\\n * Set market TA 2 for a material.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param on - market ta enabled\\n */\\n setMaterialMarketTA2(divisionName: string, cityName: string, materialName: string, on: boolean): void;\\n /**\\n * Set market TA 1 for a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @param on - market ta enabled\\n */\\n setProductMarketTA1(divisionName: string, productName: string, on: boolean): void;\\n /**\\n * Set market TA 2 for a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @param on - market ta enabled\\n */\\n setProductMarketTA2(divisionName: string, productName: string, on: boolean): void;\\n /**\\n * Set material export data\\n * @param sourceDivision - Source division\\n * @param sourceCity - Source city\\n * @param targetDivision - Target division\\n * @param targetCity - Target city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to export.\\n */\\n exportMaterial(\\n sourceDivision: string,\\n sourceCity: string,\\n targetDivision: string,\\n targetCity: string,\\n materialName: string,\\n amt: number,\\n ): void;\\n /**\\n * Cancel material export\\n * @param sourceDivision - Source division\\n * @param sourceCity - Source city\\n * @param targetDivision - Target division\\n * @param targetCity - Target city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to export.\\n */\\n cancelExportMaterial(\\n sourceDivision: string,\\n sourceCity: string,\\n targetDivision: string,\\n targetCity: string,\\n materialName: string,\\n amt: number,\\n ): void;\\n /**\\n * Purchase warehouse for a new city\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n */\\n purchaseWarehouse(divisionName: string, cityName: string): void;\\n /**\\n * Upgrade warehouse\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param amt - amount of upgrades defaults to 1\\n */\\n upgradeWarehouse(divisionName: string, cityName: string, amt?: number): void;\\n /**\\n * Create a new product\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param designInvest - Amount to invest for the design of the product.\\n * @param marketingInvest - Amount to invest for the marketing of the product.\\n */\\n makeProduct(\\n divisionName: string,\\n cityName: string,\\n productName: string,\\n designInvest: number,\\n marketingInvest: number,\\n ): void;\\n /**\\n * Limit Material Production.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param qty - Amount to limit to\\n */\\n limitMaterialProduction(divisionName: string, cityName: string, materialName: string, qty: number): void;\\n /**\\n * Limit Product Production.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param qty - Amount to limit to\\n */\\n limitProductProduction(divisionName: string, cityName: string, productName: string, qty: number): void;\\n /**\\n * Gets the cost to purchase a warehouse\\n * @returns cost\\n */\\n getPurchaseWarehouseCost(): number;\\n /**\\n * Gets the cost to upgrade a warehouse to the next level\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param amt - amount of upgrades defaults to 1\\n * @returns cost to upgrade\\n */\\n getUpgradeWarehouseCost(adivisionName: string, acityName: string, amt?: number): number;\\n /**\\n * Check if you have a warehouse in city\\n * @returns true if warehouse is present, false if not\\n */\\n hasWarehouse(adivisionName: string, acityName: string): boolean;\\n}\\n\\n/**\\n * Corporation API\\n * @public\\n */\\nexport interface Corporation extends WarehouseAPI, OfficeAPI {\\n /**\\n * Create a Corporation\\n * @param divisionName - Name of the division\\n * @param selfFund - If you should self fund, defaults to true, false will only work on Bitnode 3\\n * @returns true if created and false if not\\n */\\n createCorporation(corporationName: string, selfFund: boolean): boolean;\\n /**\\n * Check if you have a one time unlockable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns true if unlocked and false if not\\n */\\n hasUnlockUpgrade(upgradeName: string): boolean;\\n /**\\n * Gets the cost to unlock a one time unlockable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns cost of the upgrade\\n */\\n getUnlockUpgradeCost(upgradeName: string): number;\\n /**\\n * Get the level of a levelable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns the level of the upgrade\\n */\\n getUpgradeLevel(upgradeName: string): number;\\n /**\\n * Gets the cost to unlock the next level of a levelable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns cost of the upgrade\\n */\\n getUpgradeLevelCost(upgradeName: string): number;\\n /**\\n * Gets the cost to expand into a new industry\\n * @param industryName - Name of the industry\\n * @returns cost\\n */\\n getExpandIndustryCost(industryName: string): number;\\n /**\\n * Gets the cost to expand into a new city\\n * @returns cost\\n */\\n getExpandCityCost(): number;\\n /**\\n * Get an offer for investment based on you companies current valuation\\n * @returns An offer of investment\\n */\\n getInvestmentOffer(): InvestmentOffer;\\n /**\\n * Get list of materials\\n * @returns material names\\n */\\n getMaterialNames(): string[];\\n /**\\n * Get list of industry types\\n * @returns industry names\\n */\\n getIndustryTypes(): string[];\\n /**\\n * Get list of one-time unlockable upgrades\\n * @returns unlockable upgrades names\\n */\\n getUnlockables(): string[];\\n /**\\n * Get list of upgrade names\\n * @returns upgrade names\\n */\\n getUpgradeNames(): string[];\\n /**\\n * Get list of research names\\n * @returns research names\\n */\\n getResearchNames(): string[];\\n /**\\n * Accept investment based on you companies current valuation\\n * @remarks\\n * Is based on current valuation and will not honer a specific Offer\\n * @returns An offer of investment\\n */\\n acceptInvestmentOffer(): boolean;\\n /**\\n * Go public\\n * @param numShares - number of shares you would like to issue for your IPO\\n * @returns true if you successfully go public, false if not\\n */\\n goPublic(numShares: number): boolean;\\n /**\\n * Bribe a faction\\n * @param factionName - Faction name\\n * @param amountCash - Amount of money to bribe\\n * @returns True if successful, false if not\\n */\\n bribe(factionName: string, amountCash: number): boolean;\\n /**\\n * Get corporation data\\n * @returns Corporation data\\n */\\n getCorporation(): CorporationInfo;\\n /**\\n * Get division data\\n * @param divisionName - Name of the division\\n * @returns Division data\\n */\\n getDivision(divisionName: string): Division;\\n /**\\n * Expand to a new industry\\n * @param industryType - Name of the industry\\n * @param divisionName - Name of the division\\n */\\n expandIndustry(industryType: string, divisionName: string): void;\\n /**\\n * Expand to a new city\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n */\\n expandCity(divisionName: string, cityName: string): void;\\n /**\\n * Unlock an upgrade\\n * @param upgradeName - Name of the upgrade\\n */\\n unlockUpgrade(upgradeName: string): void;\\n /**\\n * Level an upgrade.\\n * @param upgradeName - Name of the upgrade\\n */\\n levelUpgrade(upgradeName: string): void;\\n /**\\n * Issue dividends\\n * @param rate - Fraction of profit to issue as dividends.\\n */\\n issueDividends(rate: number): void;\\n /**\\n * Buyback Shares\\n * @param amount - Amount of shares to buy back.\\n *\\n */\\n buyBackShares(amount: number): void;\\n /**\\n * Sell Shares\\n * @param amount - Amount of shares to sell.\\n *\\n */\\n sellShares(amount: number): void;\\n /**\\n * Get bonus time.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster.\\n *\\n * @returns Bonus time for the Corporation mechanic in milliseconds.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * General info about a corporation\\n * @public\\n */\\ninterface CorporationInfo {\\n /** Name of the corporation */\\n name: string;\\n /** Funds available */\\n funds: number;\\n /** Revenue per second this cycle */\\n revenue: number;\\n /** Expenses per second this cycle */\\n expenses: number;\\n /** Indicating if the company is public */\\n public: boolean;\\n /** Total number of shares issues by this corporation */\\n totalShares: number;\\n /** Amount of share owned */\\n numShares: number;\\n /** Cooldown until shares can be sold again */\\n shareSaleCooldown: number;\\n /** Amount of acquirable shares. */\\n issuedShares: number;\\n /** Price of the shares */\\n sharePrice: number;\\n /** Fraction of profits issued as dividends */\\n dividendRate: number;\\n /** Tax applied on your earnings as a shareholder */\\n dividendTax: number;\\n /** Your earnings as a shareholder per second this cycle */\\n dividendEarnings: number;\\n /** State of the corporation. Possible states are START, PURCHASE, PRODUCTION, SALE, EXPORT. */\\n state: string;\\n /** Array of all divisions */\\n divisions: Division[];\\n}\\n\\n/**\\n * Employee in an office\\n * @public\\n */\\nexport interface Employee {\\n /** Name of the employee */\\n name: string;\\n /** Morale of the employee */\\n mor: number;\\n /** Happiness of the employee */\\n hap: number;\\n /** Energy of the employee */\\n ene: number;\\n /** Intelligence of the employee */\\n int: number;\\n /** Charisma of the employee */\\n cha: number;\\n /** Experience of the employee */\\n exp: number;\\n /** Creativity of the employee */\\n cre: number;\\n /** Efficiency of the employee */\\n eff: number;\\n /** Salary of the employee */\\n sal: number;\\n /** Current Location (city) */\\n loc: string;\\n /** Current job position */\\n pos: string;\\n}\\n\\n/**\\n * Product in a warehouse\\n * @public\\n */\\ninterface Product {\\n /** Name of the product */\\n name: string;\\n /** Demand for the product, only present if \\\"Market Research - Demand\\\" unlocked */\\n dmd: number | undefined;\\n /** Competition for the product, only present if \\\"Market Research - Competition\\\" unlocked */\\n cmp: number | undefined;\\n /** Product Rating */\\n rat: number;\\n /** Product Properties. The data is \\\\{qlt, per, dur, rel, aes, fea\\\\} */\\n properties: { [key: string]: number };\\n /** Production cost */\\n pCost: number;\\n /** Sell cost, can be \\\"MP+5\\\" */\\n sCost: string | number;\\n /** Data refers to the production, sale, and quantity of the products\\n * These values are specific to a city\\n * For each city, the data is [qty, prod, sell] */\\n cityData: { [key: string]: number[] };\\n /** Creation progress - A number between 0-100 representing percentage */\\n developmentProgress: number;\\n}\\n\\n/**\\n * Material in a warehouse\\n * @public\\n */\\ninterface Material {\\n /** Name of the material */\\n name: string;\\n /** Amount of material */\\n qty: number;\\n /** Quality of the material */\\n qlt: number;\\n /** Demand for the material, only present if \\\"Market Research - Demand\\\" unlocked */\\n dmd: number | undefined;\\n /** Competition for the material, only present if \\\"Market Research - Competition\\\" unlocked */\\n cmp: number | undefined;\\n /** Amount of material produced */\\n prod: number;\\n /** Amount of material sold */\\n sell: number;\\n /** Cost to buy material */\\n cost: number;\\n /** Sell cost, can be \\\"MP+5\\\" */\\n sCost: string | number;\\n /** Export orders */\\n exp: Export[];\\n}\\n\\n/**\\n * Export order for a material\\n * @public\\n */\\ninterface Export {\\n /** Division the material is being exported to */\\n div: string;\\n /** City the material is being exported to */\\n loc: string;\\n /** Amount of material exported */\\n amt: string;\\n}\\n\\n/**\\n * Warehouse for a division in a city\\n * @public\\n */\\ninterface Warehouse {\\n /** Amount of size upgrade bought */\\n level: number;\\n /** City in which the warehouse is located */\\n loc: string;\\n /** Total space in the warehouse */\\n size: number;\\n /** Used space in the warehouse */\\n sizeUsed: number;\\n /** Smart Supply status in the warehouse */\\n smartSupplyEnabled: boolean;\\n}\\n\\n/**\\n * Office for a division in a city.\\n * @public\\n */\\nexport interface Office {\\n /** City of the office */\\n loc: string;\\n /** Maximum number of employee */\\n size: number;\\n /** Minimum amount of energy of the employees */\\n minEne: number;\\n /** Maximum amount of energy of the employees */\\n maxEne: number;\\n /** Minimum happiness of the employees */\\n minHap: number;\\n /** Maximum happiness of the employees */\\n maxHap: number;\\n /** Minimum morale of the employees */\\n minMor: number;\\n /** Maximum morale of the employees */\\n maxMor: number;\\n /** Name of all the employees */\\n employees: string[];\\n /** Production of the employees */\\n employeeProd: EmployeeJobs;\\n /** Positions of the employees */\\n employeeJobs: EmployeeJobs;\\n}\\n\\n/**\\n * Object representing the number of employee in each job.\\n * @public\\n */\\ninterface EmployeeJobs {\\n Operations: number;\\n Engineer: number;\\n Business: number;\\n Management: number;\\n \\\"Research & Development\\\": number;\\n Training: number;\\n Unassigned: number;\\n}\\n\\n/**\\n * Corporation division\\n * @public\\n */\\ninterface Division {\\n /** Name of the division */\\n name: string;\\n /** Type of division, like Agriculture */\\n type: string;\\n /** Awareness of the division */\\n awareness: number;\\n /** Popularity of the division */\\n popularity: number;\\n /** Production multiplier */\\n prodMult: number;\\n /** Amount of research in that division */\\n research: number;\\n /** Revenue last cycle */\\n lastCycleRevenue: number;\\n /** Expenses last cycle */\\n lastCycleExpenses: number;\\n /** Revenue this cycle */\\n thisCycleRevenue: number;\\n /** Expenses this cycle */\\n thisCycleExpenses: number;\\n /** All research bought */\\n upgrades: number[];\\n /** Cities in which this division has expanded */\\n cities: string[];\\n /** Products developed by this division */\\n products: string[];\\n /** Whether the industry this division is in is capable of making products */\\n makesProducts: boolean;\\n}\\n\\n/**\\n * Corporation investment offer\\n * @public\\n */\\ninterface InvestmentOffer {\\n /** Amount of funds you will get from this investment */\\n funds: number;\\n /** Amount of share you will give in exchange for this investment */\\n shares: number;\\n /** Current round of funding (max 4) */\\n round: number;\\n}\\n\\n/**\\n * Interface Theme\\n * @public\\n */\\ninterface UserInterfaceTheme {\\n [key: string]: string | undefined;\\n primarylight: string;\\n primary: string;\\n primarydark: string;\\n successlight: string;\\n success: string;\\n successdark: string;\\n errorlight: string;\\n error: string;\\n errordark: string;\\n secondarylight: string;\\n secondary: string;\\n secondarydark: string;\\n warninglight: string;\\n warning: string;\\n warningdark: string;\\n infolight: string;\\n info: string;\\n infodark: string;\\n welllight: string;\\n well: string;\\n white: string;\\n black: string;\\n hp: string;\\n money: string;\\n hack: string;\\n combat: string;\\n cha: string;\\n int: string;\\n rep: string;\\n disabled: string;\\n backgroundprimary: string;\\n backgroundsecondary: string;\\n button: string;\\n}\\n\\n/**\\n * Interface Styles\\n * @public\\n */\\ninterface IStyleSettings {\\n fontFamily: string;\\n lineHeight: number;\\n}\\n\\n/**\\n * Game Information\\n * @public\\n */\\ninterface GameInfo {\\n version: string;\\n commit: string;\\n platform: string;\\n}\\n\\n/**\\n * Used for autocompletion\\n * @public\\n */\\ninterface AutocompleteData {\\n servers: string[];\\n scripts: string[];\\n txts: string[];\\n flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };\\n}\\n\";","/**\n * React component for displaying a single augmentation for purchase through\n * the faction UI\n */\nimport { CheckBox, CheckBoxOutlineBlank, CheckCircle, NewReleases, Report } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Player } from \"@player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Augmentation } from \"../Augmentation\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { PurchaseAugmentationModal } from \"./PurchaseAugmentationModal\";\n\ninterface IPreReqsProps {\n aug: Augmentation;\n}\n\nconst PreReqs = (props: IPreReqsProps): React.ReactElement => {\n const ownedPreReqs = props.aug.prereqs.filter((aug) => Player.hasAugmentation(aug));\n const hasPreReqs = props.aug.prereqs.length > 0 && ownedPreReqs.length === props.aug.prereqs.length;\n\n return (\n <Tooltip\n title={\n <>\n <Typography sx={{ color: Settings.theme.money }}>\n This Augmentation has the following pre-requisite(s):\n </Typography>\n {props.aug.prereqs.map((preAug) => (\n <Requirement\n fulfilled={Player.hasAugmentation(preAug)}\n value={preAug}\n color={Settings.theme.money}\n key={preAug}\n />\n ))}\n </>\n }\n >\n <Typography\n sx={{\n ml: 1,\n fontSize: \"0.9rem\",\n display: \"flex\",\n alignItems: \"center\",\n color: hasPreReqs ? Settings.theme.successlight : Settings.theme.error,\n gridArea: \"prereqs\",\n }}\n >\n {hasPreReqs ? (\n <>\n <CheckCircle fontSize=\"small\" sx={{ mr: 1 }} />\n Pre-requisites Owned\n </>\n ) : (\n <>\n <Report fontSize=\"small\" sx={{ mr: 1 }} />\n Missing {props.aug.prereqs.length - ownedPreReqs.length} pre-requisite(s)\n </>\n )}\n </Typography>\n </Tooltip>\n );\n};\n\ninterface IExclusiveProps {\n aug: Augmentation;\n}\n\nconst Exclusive = (props: IExclusiveProps): React.ReactElement => {\n return (\n <Tooltip\n title={\n <>\n <Typography sx={{ color: Settings.theme.money }}>\n This Augmentation can only be acquired from the following source(s):\n </Typography>\n <ul>\n <Typography sx={{ color: Settings.theme.money }}>\n <li>\n <b>{props.aug.factions[0]}</b> faction\n </li>\n {Player.isAwareOfGang() && !props.aug.isSpecial && (\n <li>\n Certain <b>gangs</b>\n </li>\n )}\n {Player.canAccessGrafting() && !props.aug.isSpecial && props.aug.name !== AugmentationNames.TheRedPill && (\n <li>\n <b>Grafting</b>\n </li>\n )}\n </Typography>\n </ul>\n </>\n }\n >\n <NewReleases\n fontSize=\"small\"\n sx={{ ml: 1, color: Settings.theme.money, transform: \"rotate(180deg)\", gridArea: \"exclusive\" }}\n />\n </Tooltip>\n );\n};\n\ninterface IReqProps {\n value: string;\n color: string;\n fulfilled: boolean;\n}\n\nconst Requirement = (props: IReqProps): React.ReactElement => {\n return (\n <Typography\n sx={{ display: \"flex\", alignItems: \"center\", color: props.fulfilled ? props.color : Settings.theme.error }}\n >\n {props.fulfilled ? <CheckBox sx={{ mr: 1 }} /> : <CheckBoxOutlineBlank sx={{ mr: 1 }} />}\n {props.value}\n </Typography>\n );\n};\n\ninterface IPurchasableAugsProps {\n augNames: string[];\n ownedAugNames: string[];\n\n canPurchase: (aug: Augmentation) => boolean;\n purchaseAugmentation: (aug: Augmentation, showModal: (open: boolean) => void) => void;\n\n rep?: number;\n sleeveAugs?: boolean;\n faction?: Faction;\n}\n\nexport const PurchasableAugmentations = (props: IPurchasableAugsProps): React.ReactElement => {\n return (\n <Container\n maxWidth=\"lg\"\n disableGutters\n sx={{ mx: 0, display: \"grid\", gridTemplateColumns: \"repeat(1, 1fr)\", gap: 0.75 }}\n >\n {props.augNames.map((augName: string) => (\n <PurchasableAugmentation key={augName} parent={props} augName={augName} owned={false} />\n ))}\n {props.ownedAugNames.map((augName: string) => (\n <PurchasableAugmentation key={augName} parent={props} augName={augName} owned={true} />\n ))}\n </Container>\n );\n};\n\ninterface IPurchasableAugProps {\n parent: IPurchasableAugsProps;\n augName: string;\n owned: boolean;\n}\n\nexport function PurchasableAugmentation(props: IPurchasableAugProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n const aug = StaticAugmentations[props.augName];\n const augCosts = aug.getCost();\n const cost = props.parent.sleeveAugs ? aug.baseCost : augCosts.moneyCost;\n const repCost = augCosts.repCost;\n const info = typeof aug.info === \"string\" ? <span>{aug.info}</span> : aug.info;\n const description = (\n <>\n {info}\n <br />\n <br />\n {aug.stats}\n </>\n );\n\n return (\n <Paper\n sx={{\n p: 0.5,\n display: \"grid\",\n gridTemplateColumns: \"minmax(0, 4fr) 1.4fr\",\n gap: 1,\n opacity: props.owned ? 0.75 : 1,\n minWidth: \"1100px\",\n }}\n >\n <>\n <Box sx={{ display: \"flex\", alignItems: \"center\" }}>\n <Button\n onClick={() =>\n props.parent.purchaseAugmentation(aug, (open): void => {\n setOpen(open);\n })\n }\n disabled={!props.parent.canPurchase(aug) || props.owned}\n sx={{ width: \"48px\", height: \"36px\", float: \"left\", clear: \"none\", mr: 1 }}\n >\n {props.owned ? \"Owned\" : \"Buy\"}\n </Button>\n\n <Box sx={{ maxWidth: props.owned ? \"100%\" : \"85%\" }}>\n <Box sx={{ display: \"grid\", alignItems: \"center\", gridTemplateAreas: `\"title exclusive prereqs\"` }}>\n <Tooltip\n title={\n <>\n <Typography variant=\"h5\">\n {props.augName}\n {props.augName === AugmentationNames.NeuroFluxGovernor && ` - Level ${aug.getLevel()}`}\n </Typography>\n <Typography>{description}</Typography>\n </>\n }\n >\n <Typography\n sx={{\n gridArea: \"title\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n color:\n props.owned || !props.parent.canPurchase(aug) ? Settings.theme.disabled : Settings.theme.primary,\n }}\n >\n {aug.name}\n {aug.name === AugmentationNames.NeuroFluxGovernor && ` - Level ${aug.getLevel()}`}\n </Typography>\n </Tooltip>\n\n {aug.factions.length === 1 && !props.parent.sleeveAugs && <Exclusive aug={aug} />}\n {aug.prereqs.length > 0 && !props.parent.sleeveAugs && <PreReqs aug={aug} />}\n </Box>\n </Box>\n </Box>\n\n {props.owned || (\n <Box sx={{ display: \"grid\", alignItems: \"center\", gridTemplateColumns: \"1fr 1fr\" }}>\n <Requirement\n fulfilled={cost === 0 || Player.money > cost}\n value={numeralWrapper.formatMoney(cost)}\n color={Settings.theme.money}\n />\n {props.parent.rep !== undefined && (\n <Requirement\n fulfilled={props.parent.rep >= repCost}\n value={`${numeralWrapper.formatReputation(repCost)} rep`}\n color={Settings.theme.rep}\n />\n )}\n </Box>\n )}\n\n {Settings.SuppressBuyAugmentationConfirmation || (\n <PurchaseAugmentationModal\n open={open}\n onClose={() => setOpen(false)}\n faction={props.parent.faction}\n aug={aug}\n />\n )}\n </>\n </Paper>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a Travel Agency\n *\n * TThis subcomponent renders all of the buttons for traveling to different cities\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { CityName } from \"../data/CityNames\";\nimport { TravelConfirmationModal } from \"./TravelConfirmationModal\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { Player } from \"@player\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\n\nfunction travel(to: CityName): void {\n const cost = CONSTANTS.TravelCost;\n if (!Player.canAfford(cost)) {\n return;\n }\n\n Player.loseMoney(cost, \"other\");\n Player.travel(to);\n dialogBoxCreate(`You are now in ${to}!`);\n Router.toCity();\n}\n\nexport function TravelAgencyRoot(): React.ReactElement {\n const setRerender = useState(false)[1];\n const [open, setOpen] = useState(false);\n const [destination, setDestination] = useState(CityName.Sector12);\n function rerender(): void {\n setRerender((o) => !o);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n function startTravel(city: CityName): void {\n const cost = CONSTANTS.TravelCost;\n if (!Player.canAfford(cost)) {\n return;\n }\n if (Settings.SuppressTravelConfirmation) {\n travel(city);\n return;\n }\n setOpen(true);\n setDestination(city);\n }\n\n return (\n <>\n <Typography variant=\"h4\">Travel Agency</Typography>\n <Box mx={2}>\n <Typography>\n From here, you can travel to any other city! A ticket costs{\" \"}\n <Money money={CONSTANTS.TravelCost} forPurchase={true} />.\n </Typography>\n {Settings.DisableASCIIArt ? (\n <>\n {Object.values(CityName)\n .filter((city: string) => city != Player.city)\n .map((city: string) => {\n const match = Object.entries(CityName).find((entry) => entry[1] === city);\n if (match === undefined) throw new Error(`could not find key for city '${city}'`);\n return (\n <React.Fragment key={city}>\n <Button onClick={() => startTravel(city as CityName)} sx={{ m: 2 }}>\n <Typography>Travel to {city}</Typography>\n </Button>\n <br />\n </React.Fragment>\n );\n })}\n </>\n ) : (\n <WorldMap currentCity={Player.city} onTravel={(city: CityName) => startTravel(city)} />\n )}\n </Box>\n <TravelConfirmationModal\n city={destination}\n travel={() => travel(destination)}\n open={open}\n onClose={() => setOpen(false)}\n />\n </>\n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Editor, { Monaco } from \"@monaco-editor/react\";\nimport * as monaco from \"monaco-editor\";\n\ntype IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;\ntype ITextModel = monaco.editor.ITextModel;\nimport { OptionsModal } from \"./OptionsModal\";\nimport { Options } from \"./Options\";\nimport { isValidFilePath } from \"../../Terminal/DirectoryHelpers\";\nimport { Player } from \"@player\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { Script } from \"../../Script/Script\";\nimport { TextFile } from \"../../TextFile\";\nimport { calculateRamUsage, checkInfiniteLoop } from \"../../Script/RamCalculations\";\nimport { RamCalculationErrorCode } from \"../../Script/RamCalculationErrorCodes\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { DragDropContext, Droppable, Draggable } from \"react-beautiful-dnd\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { NetscriptFunctions } from \"../../NetscriptFunctions\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { iTutorialNextStep, ITutorial, iTutorialSteps } from \"../../InteractiveTutorial\";\nimport { debounce } from \"lodash\";\nimport { saveObject } from \"../../SaveObject\";\nimport { loadThemes, makeTheme, sanitizeTheme } from \"./themes\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport Link from \"@mui/material/Link\";\nimport Box from \"@mui/material/Box\";\nimport SettingsIcon from \"@mui/icons-material/Settings\";\nimport SyncIcon from \"@mui/icons-material/Sync\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport Table from \"@mui/material/Table\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableBody from \"@mui/material/TableBody\";\nimport { PromptEvent } from \"../../ui/React/PromptManager\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport libSource from \"!!raw-loader!../NetscriptDefinitions.d.ts\";\nimport { TextField, Tooltip } from \"@mui/material\";\n\ninterface IProps {\n // Map of filename -> code\n files: Record<string, string>;\n hostname: string;\n vim: boolean;\n}\n\n// TODO: try to remove global symbols\nlet symbolsLoaded = false;\nlet symbols: string[] = [];\nexport function SetupTextEditor(): void {\n const ns = NetscriptFunctions({ args: [] } as unknown as WorkerScript);\n\n // Populates symbols for text editor\n function populate(ns: any): string[] {\n let symbols: string[] = [];\n const keys = Object.keys(ns);\n for (const key of keys) {\n if (typeof ns[key] === \"object\") {\n symbols.push(key);\n symbols = symbols.concat(populate(ns[key]));\n }\n if (typeof ns[key] === \"function\") {\n symbols.push(key);\n }\n }\n\n return symbols;\n }\n\n symbols = populate(ns);\n\n const exclude = [\"heart\", \"break\", \"exploit\", \"bypass\", \"corporation\", \"alterReality\"];\n symbols = symbols.filter((symbol: string) => !exclude.includes(symbol)).sort();\n}\n\n// Holds all the data for a open script\nclass OpenScript {\n fileName: string;\n code: string;\n hostname: string;\n lastPosition: monaco.Position;\n model: ITextModel;\n isTxt: boolean;\n\n constructor(fileName: string, code: string, hostname: string, lastPosition: monaco.Position, model: ITextModel) {\n this.fileName = fileName;\n this.code = code;\n this.hostname = hostname;\n this.lastPosition = lastPosition;\n this.model = model;\n this.isTxt = fileName.endsWith(\".txt\");\n }\n}\n\nconst openScripts: OpenScript[] = [];\nlet currentScript: OpenScript | null = null;\n\n// Called every time script editor is opened\nexport function Root(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n const editorRef = useRef<IStandaloneCodeEditor | null>(null);\n const monacoRef = useRef<Monaco | null>(null);\n const vimStatusRef = useRef<HTMLElement>(null);\n const [vimEditor, setVimEditor] = useState<any>(null);\n const [editor, setEditor] = useState<IStandaloneCodeEditor | null>(null);\n const [filter, setFilter] = useState(\"\");\n const [searchExpanded, setSearchExpanded] = useState(false);\n\n const [ram, setRAM] = useState(\"RAM: ???\");\n const [ramEntries, setRamEntries] = useState<string[][]>([[\"???\", \"\"]]);\n const [updatingRam, setUpdatingRam] = useState(false);\n const [decorations, setDecorations] = useState<string[]>([]);\n\n const [optionsOpen, setOptionsOpen] = useState(false);\n const [options, setOptions] = useState<Options>({\n theme: Settings.MonacoTheme,\n insertSpaces: Settings.MonacoInsertSpaces,\n fontSize: Settings.MonacoFontSize,\n wordWrap: Settings.MonacoWordWrap,\n vim: props.vim || Settings.MonacoVim,\n });\n\n const [ramInfoOpen, setRamInfoOpen] = useState(false);\n\n // Prevent Crash if script is open on deleted server\n for (let i = openScripts.length - 1; i >= 0; i--) {\n GetServer(openScripts[i].hostname) === null && openScripts.splice(i, 1);\n }\n if (currentScript && GetServer(currentScript.hostname) === null) {\n currentScript = openScripts[0];\n if (currentScript === undefined) currentScript = null;\n }\n\n useEffect(() => {\n if (currentScript !== null) {\n updateRAM(currentScript.code);\n }\n }, []);\n\n useEffect(() => {\n function keydown(event: KeyboardEvent): void {\n if (Settings.DisableHotkeys) return;\n //Ctrl + b\n if (event.code == \"KeyB\" && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n Router.toTerminal();\n }\n\n // CTRL/CMD + S\n if (event.code == \"KeyS\" && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n event.stopPropagation();\n save();\n }\n }\n document.addEventListener(\"keydown\", keydown);\n return () => document.removeEventListener(\"keydown\", keydown);\n });\n\n useEffect(() => {\n // setup monaco-vim\n if (options.vim && editor && !vimEditor) {\n try {\n // This library is not typed\n // @ts-expect-error\n window.require([\"monaco-vim\"], function (MonacoVim: any) {\n setVimEditor(MonacoVim.initVimMode(editor, vimStatusRef.current));\n MonacoVim.VimMode.Vim.defineEx(\"write\", \"w\", function () {\n // your own implementation on what you want to do when :w is pressed\n save();\n });\n MonacoVim.VimMode.Vim.defineEx(\"quit\", \"q\", function () {\n Router.toTerminal();\n });\n\n const saveNQuit = (): void => {\n save();\n Router.toTerminal();\n };\n // \"wqriteandquit\" & \"xriteandquit\" are not typos, prefix must be found in full string\n MonacoVim.VimMode.Vim.defineEx(\"wqriteandquit\", \"wq\", saveNQuit);\n MonacoVim.VimMode.Vim.defineEx(\"xriteandquit\", \"x\", saveNQuit);\n\n // Setup \"go to next tab\" and \"go to previous tab\". This is a little more involved\n // since these aren't Ex commands (they run in normal mode, not after typing `:`)\n MonacoVim.VimMode.Vim.defineAction(\"nextTabs\", function (_cm: any, args: { repeat?: number }) {\n const nTabs = args.repeat ?? 1;\n // Go to the next tab (to the right). Wraps around when at the rightmost tab\n const currIndex = currentTabIndex();\n if (currIndex !== undefined) {\n const nextIndex = (currIndex + nTabs) % openScripts.length;\n onTabClick(nextIndex);\n }\n });\n MonacoVim.VimMode.Vim.defineAction(\"prevTabs\", function (_cm: any, args: { repeat?: number }) {\n const nTabs = args.repeat ?? 1;\n // Go to the previous tab (to the left). Wraps around when at the leftmost tab\n const currIndex = currentTabIndex();\n if (currIndex !== undefined) {\n let nextIndex = currIndex - nTabs;\n while (nextIndex < 0) {\n nextIndex += openScripts.length;\n }\n onTabClick(nextIndex);\n }\n });\n MonacoVim.VimMode.Vim.mapCommand(\"gt\", \"action\", \"nextTabs\", {}, { context: \"normal\" });\n MonacoVim.VimMode.Vim.mapCommand(\"gT\", \"action\", \"prevTabs\", {}, { context: \"normal\" });\n editor.focus();\n });\n } catch {}\n } else if (!options.vim) {\n // When vim mode is disabled\n vimEditor?.dispose();\n setVimEditor(null);\n }\n\n return () => {\n vimEditor?.dispose();\n };\n }, [options, editorRef, editor, vimEditor]);\n\n // Generates a new model for the script\n function regenerateModel(script: OpenScript): void {\n if (monacoRef.current !== null) {\n script.model = monacoRef.current.editor.createModel(script.code, script.isTxt ? \"plaintext\" : \"javascript\");\n }\n }\n\n const debouncedUpdateRAM = debounce((newCode: string) => {\n updateRAM(newCode);\n setUpdatingRam(false);\n }, 300);\n\n function updateRAM(newCode: string): void {\n if (currentScript != null && currentScript.isTxt) {\n setRAM(\"N/A\");\n setRamEntries([[\"N/A\", \"\"]]);\n return;\n }\n const codeCopy = newCode + \"\";\n const ramUsage = calculateRamUsage(codeCopy, Player.getCurrentServer().scripts);\n if (ramUsage.cost > 0) {\n const entries = ramUsage.entries?.sort((a, b) => b.cost - a.cost) ?? [];\n const entriesDisp = [];\n for (const entry of entries) {\n entriesDisp.push([`${entry.name} (${entry.type})`, numeralWrapper.formatRAM(entry.cost)]);\n }\n\n setRAM(\"RAM: \" + numeralWrapper.formatRAM(ramUsage.cost));\n setRamEntries(entriesDisp);\n return;\n }\n let RAM = \"\";\n const entriesDisp = [];\n switch (ramUsage.cost) {\n case RamCalculationErrorCode.ImportError: {\n RAM = \"RAM: Import Error\";\n entriesDisp.push([\"Import Error\", \"\"]);\n break;\n }\n case RamCalculationErrorCode.SyntaxError:\n default: {\n RAM = \"RAM: Syntax Error\";\n entriesDisp.push([\"Syntax Error\", \"\"]);\n break;\n }\n }\n setRAM(RAM);\n setRamEntries(entriesDisp);\n return;\n }\n\n // Formats the code\n function beautify(): void {\n if (editorRef.current === null) return;\n editorRef.current.getAction(\"editor.action.formatDocument\").run();\n }\n\n // How to load function definition in monaco\n // https://github.com/Microsoft/monaco-editor/issues/1415\n // https://microsoft.github.io/monaco-editor/api/modules/monaco.languages.html\n // https://www.npmjs.com/package/@monaco-editor/react#development-playground\n // https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages\n // https://github.com/threehams/typescript-error-guide/blob/master/stories/components/Editor.tsx#L11-L39\n // https://blog.checklyhq.com/customizing-monaco/\n // Before the editor is mounted\n function beforeMount(monaco: any): void {\n if (symbolsLoaded) return;\n // Setup monaco auto completion\n symbolsLoaded = true;\n monaco.languages.registerCompletionItemProvider(\"javascript\", {\n provideCompletionItems: () => {\n const suggestions = [];\n for (const symbol of symbols) {\n suggestions.push({\n label: symbol,\n kind: monaco.languages.CompletionItemKind.Function,\n insertText: symbol,\n insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\n });\n }\n return { suggestions: suggestions };\n },\n });\n\n (async function () {\n // We have to improve the default js language otherwise theme sucks\n const l = await monaco.languages\n .getLanguages()\n .find((l: any) => l.id === \"javascript\")\n .loader();\n // replaced the bare tokens with regexes surrounded by \\b, e.g. \\b{token}\\b which matches a word-break on either side\n // this prevents the highlighter from highlighting pieces of variables that start with a reserved token name\n l.language.tokenizer.root.unshift([new RegExp(\"\\\\bns\\\\b\"), { token: \"ns\" }]);\n for (const symbol of symbols)\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${symbol}\\\\b`), { token: \"netscriptfunction\" }]);\n const otherKeywords = [\"let\", \"const\", \"var\", \"function\"];\n const otherKeyvars = [\"true\", \"false\", \"null\", \"undefined\"];\n otherKeywords.forEach((k) =>\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${k}\\\\b`), { token: \"otherkeywords\" }]),\n );\n otherKeyvars.forEach((k) =>\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${k}\\\\b`), { token: \"otherkeyvars\" }]),\n );\n l.language.tokenizer.root.unshift([new RegExp(\"\\\\bthis\\\\b\"), { token: \"this\" }]);\n })();\n\n const source = (libSource + \"\").replace(/export /g, \"\");\n monaco.languages.typescript.javascriptDefaults.addExtraLib(source, \"netscript.d.ts\");\n monaco.languages.typescript.typescriptDefaults.addExtraLib(source, \"netscript.d.ts\");\n loadThemes(monaco);\n sanitizeTheme(Settings.EditorTheme);\n monaco.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\n }\n\n // When the editor is mounted\n function onMount(editor: IStandaloneCodeEditor, monaco: Monaco): void {\n // Required when switching between site navigation (e.g. from Script Editor -> Terminal and back)\n // the `useEffect()` for vim mode is called before editor is mounted.\n setEditor(editor);\n\n editorRef.current = editor;\n monacoRef.current = monaco;\n\n if (editorRef.current === null || monacoRef.current === null) return;\n\n if (!props.files && currentScript !== null) {\n // Open currentscript\n regenerateModel(currentScript);\n editorRef.current.setModel(currentScript.model);\n editorRef.current.setPosition(currentScript.lastPosition);\n editorRef.current.revealLineInCenter(currentScript.lastPosition.lineNumber);\n updateRAM(currentScript.code);\n editorRef.current.focus();\n return;\n }\n if (props.files) {\n const files = Object.entries(props.files);\n\n if (!files.length) {\n editorRef.current.focus();\n return;\n }\n\n for (const [filename, code] of files) {\n // Check if file is already opened\n const openScript = openScripts.find(\n (script) => script.fileName === filename && script.hostname === props.hostname,\n );\n if (openScript) {\n // Script is already opened\n if (openScript.model === undefined || openScript.model === null || openScript.model.isDisposed()) {\n regenerateModel(openScript);\n }\n\n currentScript = openScript;\n editorRef.current.setModel(openScript.model);\n editorRef.current.setPosition(openScript.lastPosition);\n editorRef.current.revealLineInCenter(openScript.lastPosition.lineNumber);\n updateRAM(openScript.code);\n } else {\n // Open script\n const newScript = new OpenScript(\n filename,\n code,\n props.hostname,\n new monacoRef.current.Position(0, 0),\n monacoRef.current.editor.createModel(code, filename.endsWith(\".txt\") ? \"plaintext\" : \"javascript\"),\n );\n openScripts.push(newScript);\n currentScript = newScript;\n editorRef.current.setModel(newScript.model);\n updateRAM(newScript.code);\n }\n }\n }\n\n editorRef.current.focus();\n }\n\n function infLoop(newCode: string): void {\n if (editorRef.current === null || currentScript === null) return;\n if (!currentScript.fileName.endsWith(\".js\")) return;\n const awaitWarning = checkInfiniteLoop(newCode);\n if (awaitWarning !== -1) {\n const newDecorations = editorRef.current.deltaDecorations(decorations, [\n {\n range: {\n startLineNumber: awaitWarning,\n startColumn: 1,\n endLineNumber: awaitWarning,\n endColumn: 10,\n },\n options: {\n isWholeLine: true,\n glyphMarginClassName: \"myGlyphMarginClass\",\n glyphMarginHoverMessage: {\n value: \"Possible infinite loop, await something.\",\n },\n },\n },\n ]);\n setDecorations(newDecorations);\n } else {\n const newDecorations = editorRef.current.deltaDecorations(decorations, []);\n setDecorations(newDecorations);\n }\n }\n\n // When the code is updated within the editor\n function updateCode(newCode?: string): void {\n if (newCode === undefined) return;\n setUpdatingRam(true);\n debouncedUpdateRAM(newCode);\n if (editorRef.current === null) return;\n const newPos = editorRef.current.getPosition();\n if (newPos === null) return;\n if (currentScript !== null) {\n currentScript.code = newCode;\n currentScript.lastPosition = newPos;\n }\n try {\n infLoop(newCode);\n } catch (err) {}\n }\n\n function saveScript(scriptToSave: OpenScript): void {\n const server = GetServer(scriptToSave.hostname);\n if (server === null) throw new Error(\"Server should not be null but it is.\");\n if (isScriptFilename(scriptToSave.fileName)) {\n //If the current script already exists on the server, overwrite it\n for (let i = 0; i < server.scripts.length; i++) {\n if (scriptToSave.fileName == server.scripts[i].filename) {\n server.scripts[i].saveScript(scriptToSave.fileName, scriptToSave.code, Player.currentServer, server.scripts);\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n Router.toTerminal();\n return;\n }\n }\n\n //If the current script does NOT exist, create a new one\n const script = new Script();\n script.saveScript(scriptToSave.fileName, scriptToSave.code, Player.currentServer, server.scripts);\n server.scripts.push(script);\n } else if (scriptToSave.isTxt) {\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (server.textFiles[i].fn === scriptToSave.fileName) {\n server.textFiles[i].write(scriptToSave.code);\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n Router.toTerminal();\n return;\n }\n }\n const textFile = new TextFile(scriptToSave.fileName, scriptToSave.code);\n server.textFiles.push(textFile);\n } else {\n dialogBoxCreate(\"Invalid filename. Must be either a script (.script or .js) or a text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n Router.toTerminal();\n }\n\n function save(): void {\n if (currentScript === null) {\n console.error(\"currentScript is null when it shouldn't be. Unable to save script\");\n return;\n }\n // this is duplicate code with saving later.\n if (ITutorial.isRunning && ITutorial.currStep === iTutorialSteps.TerminalTypeScript) {\n //Make sure filename + code properly follow tutorial\n if (currentScript.fileName !== \"n00dles.script\" && currentScript.fileName !== \"n00dles.js\") {\n dialogBoxCreate(\"Don't change the script name for now.\");\n return;\n }\n const cleanCode = currentScript.code.replace(/\\s/g, \"\");\n const ns1 = \"while(true){hack('n00dles');}\";\n const ns2 = `exportasyncfunctionmain(ns){while(true){awaitns.hack('n00dles');}}`;\n if (cleanCode.indexOf(ns1) == -1 && cleanCode.indexOf(ns2) == -1) {\n dialogBoxCreate(\"Please copy and paste the code from the tutorial!\");\n return;\n }\n\n //Save the script\n saveScript(currentScript);\n\n iTutorialNextStep();\n\n return;\n }\n\n if (currentScript.fileName == \"\") {\n dialogBoxCreate(\"You must specify a filename!\");\n return;\n }\n\n if (!isValidFilePath(currentScript.fileName)) {\n dialogBoxCreate(\n \"Script filename can contain only alphanumerics, hyphens, and underscores, and must end with an extension.\",\n );\n return;\n }\n\n const server = GetServer(currentScript.hostname);\n if (server === null) throw new Error(\"Server should not be null but it is.\");\n if (isScriptFilename(currentScript.fileName)) {\n //If the current script already exists on the server, overwrite it\n for (let i = 0; i < server.scripts.length; i++) {\n if (currentScript.fileName == server.scripts[i].filename) {\n server.scripts[i].saveScript(\n currentScript.fileName,\n currentScript.code,\n Player.currentServer,\n server.scripts,\n );\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n rerender();\n return;\n }\n }\n\n //If the current script does NOT exist, create a new one\n const script = new Script();\n script.saveScript(currentScript.fileName, currentScript.code, Player.currentServer, server.scripts);\n server.scripts.push(script);\n } else if (currentScript.isTxt) {\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (server.textFiles[i].fn === currentScript.fileName) {\n server.textFiles[i].write(currentScript.code);\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n rerender();\n return;\n }\n }\n const textFile = new TextFile(currentScript.fileName, currentScript.code);\n server.textFiles.push(textFile);\n } else {\n dialogBoxCreate(\"Invalid filename. Must be either a script (.script or .js) or a text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n rerender();\n }\n\n function reorder(list: OpenScript[], startIndex: number, endIndex: number): void {\n const [removed] = list.splice(startIndex, 1);\n list.splice(endIndex, 0, removed);\n }\n\n function onDragEnd(result: any): void {\n // Dropped outside of the list\n if (!result.destination) return;\n reorder(openScripts, result.source.index, result.destination.index);\n }\n\n function currentTabIndex(): number | undefined {\n if (currentScript !== null) {\n return openScripts.findIndex(\n (script) =>\n currentScript !== null &&\n script.fileName === currentScript.fileName &&\n script.hostname === currentScript.hostname,\n );\n }\n\n return undefined;\n }\n\n function onTabClick(index: number): void {\n if (currentScript !== null) {\n // Save currentScript to openScripts\n const curIndex = currentTabIndex();\n if (curIndex !== undefined) {\n openScripts[curIndex] = currentScript;\n }\n }\n\n currentScript = openScripts[index];\n\n if (editorRef.current !== null && openScripts[index] !== null) {\n if (currentScript.model === undefined || currentScript.model.isDisposed()) {\n regenerateModel(currentScript);\n }\n editorRef.current.setModel(currentScript.model);\n\n editorRef.current.setPosition(currentScript.lastPosition);\n editorRef.current.revealLineInCenter(currentScript.lastPosition.lineNumber);\n updateRAM(currentScript.code);\n editorRef.current.focus();\n }\n }\n\n function onTabClose(index: number): void {\n // See if the script on the server is up to date\n const closingScript = openScripts[index];\n const savedScriptCode = closingScript.code;\n const wasCurrentScript = openScripts[index] === currentScript;\n\n if (dirty(index)) {\n PromptEvent.emit({\n txt: `Do you want to save changes to ${closingScript.fileName} on ${closingScript.hostname}?`,\n resolve: (result: boolean | string) => {\n if (result) {\n // Save changes\n closingScript.code = savedScriptCode;\n saveScript(closingScript);\n }\n },\n });\n }\n\n openScripts.splice(index, 1);\n if (openScripts.length === 0) {\n currentScript = null;\n Router.toTerminal();\n return;\n }\n\n // Change current script if we closed it\n if (wasCurrentScript) {\n //Keep the same index unless we were on the last script\n const indexOffset = openScripts.length === index ? -1 : 0;\n currentScript = openScripts[index + indexOffset];\n if (editorRef.current !== null) {\n if (currentScript.model.isDisposed() || !currentScript.model) {\n regenerateModel(currentScript);\n }\n editorRef.current.setModel(currentScript.model);\n editorRef.current.setPosition(currentScript.lastPosition);\n editorRef.current.revealLineInCenter(currentScript.lastPosition.lineNumber);\n editorRef.current.focus();\n }\n }\n rerender();\n }\n\n function onTabUpdate(index: number): void {\n const openScript = openScripts[index];\n const serverScriptCode = getServerCode(index);\n if (serverScriptCode === null) return;\n\n if (openScript.code !== serverScriptCode) {\n PromptEvent.emit({\n txt:\n \"Do you want to overwrite the current editor content with the contents of \" +\n openScript.fileName +\n \" on the server? This cannot be undone.\",\n resolve: (result: boolean | string) => {\n if (result) {\n // Save changes\n openScript.code = serverScriptCode;\n\n // Switch to target tab\n onTabClick(index);\n\n if (editorRef.current !== null && openScript !== null) {\n if (openScript.model === undefined || openScript.model.isDisposed()) {\n regenerateModel(openScript);\n }\n editorRef.current.setModel(openScript.model);\n\n editorRef.current.setValue(openScript.code);\n updateRAM(openScript.code);\n editorRef.current.focus();\n }\n }\n },\n });\n }\n }\n\n function dirty(index: number): string {\n const openScript = openScripts[index];\n const serverData = getServerCode(index);\n if (serverData === null) return \" *\";\n // For scripts, server code is stored with its starting & trailing whitespace removed\n const code = openScript.isTxt ? openScript.code : Script.formatCode(openScript.code);\n return serverData !== code ? \" *\" : \"\";\n }\n function getServerCode(index: number): string | null {\n const openScript = openScripts[index];\n const server = GetServer(openScript.hostname);\n if (server === null) throw new Error(`Server '${openScript.hostname}' should not be null, but it is.`);\n const data = openScript.isTxt\n ? server.textFiles.find((t) => t.filename === openScript.fileName)?.text\n : server.scripts.find((s) => s.filename === openScript.fileName)?.code;\n return data ?? null;\n }\n function handleFilterChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setFilter(event.target.value);\n }\n function handleExpandSearch(): void {\n setFilter(\"\");\n setSearchExpanded(!searchExpanded);\n }\n const filteredOpenScripts = Object.values(openScripts).filter(\n (script) => script.hostname.includes(filter) || script.fileName.includes(filter),\n );\n\n const tabsMaxWidth = 1640;\n const tabMargin = 5;\n const tabMaxWidth = filteredOpenScripts.length ? tabsMaxWidth / filteredOpenScripts.length - tabMargin : 0;\n const tabIconWidth = 25;\n const tabTextWidth = tabMaxWidth - tabIconWidth * 2;\n return (\n <>\n <div style={{ display: currentScript !== null ? \"block\" : \"none\", height: \"100%\", width: \"100%\" }}>\n <DragDropContext onDragEnd={onDragEnd}>\n <Droppable droppableId=\"tabs\" direction=\"horizontal\">\n {(provided, snapshot) => (\n <Box\n maxWidth={`${tabsMaxWidth}px`}\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n whiteSpace=\"nowrap\"\n ref={provided.innerRef}\n {...provided.droppableProps}\n style={{\n backgroundColor: snapshot.isDraggingOver\n ? Settings.theme.backgroundsecondary\n : Settings.theme.backgroundprimary,\n overflowX: \"scroll\",\n }}\n >\n <Tooltip title={\"Search Open Scripts\"}>\n {searchExpanded ? (\n <TextField\n value={filter}\n onChange={handleFilterChange}\n autoFocus\n InputProps={{\n startAdornment: <SearchIcon />,\n spellCheck: false,\n endAdornment: <CloseIcon onClick={handleExpandSearch} />,\n }}\n />\n ) : (\n <Button onClick={handleExpandSearch}>\n <SearchIcon />\n </Button>\n )}\n </Tooltip>\n {filteredOpenScripts.map(({ fileName, hostname }, index) => {\n const editingCurrentScript =\n currentScript?.fileName === filteredOpenScripts[index].fileName &&\n currentScript?.hostname === filteredOpenScripts[index].hostname;\n const externalScript = hostname !== \"home\";\n const colorProps = editingCurrentScript\n ? {\n background: Settings.theme.button,\n borderColor: Settings.theme.button,\n color: Settings.theme.primary,\n }\n : {\n background: Settings.theme.backgroundsecondary,\n borderColor: Settings.theme.backgroundsecondary,\n color: Settings.theme.secondary,\n };\n\n if (externalScript) {\n colorProps.color = Settings.theme.info;\n }\n const iconButtonStyle = {\n maxWidth: `${tabIconWidth}px`,\n minWidth: `${tabIconWidth}px`,\n minHeight: \"38.5px\",\n maxHeight: \"38.5px\",\n ...colorProps,\n };\n\n const scriptTabText = `${hostname}:~${fileName.startsWith(\"/\") ? \"\" : \"/\"}${fileName} ${dirty(\n index,\n )}`;\n return (\n <Draggable\n key={fileName + hostname}\n draggableId={fileName + hostname}\n index={index}\n disableInteractiveElementBlocking={true}\n >\n {(provided) => (\n <div\n ref={provided.innerRef}\n {...provided.draggableProps}\n {...provided.dragHandleProps}\n style={{\n ...provided.draggableProps.style,\n maxWidth: `${tabMaxWidth}px`,\n marginRight: `${tabMargin}px`,\n flexShrink: 0,\n border: \"1px solid \" + Settings.theme.well,\n }}\n >\n <Tooltip title={scriptTabText}>\n <Button\n onClick={() => onTabClick(index)}\n onMouseDown={(e) => {\n e.preventDefault();\n if (e.button === 1) onTabClose(index);\n }}\n style={{\n maxWidth: `${tabTextWidth}px`,\n minHeight: \"38.5px\",\n overflow: \"hidden\",\n ...colorProps,\n }}\n >\n <span style={{ overflow: \"hidden\", direction: \"rtl\", textOverflow: \"ellipsis\" }}>\n {scriptTabText}\n </span>\n </Button>\n </Tooltip>\n <Tooltip title=\"Overwrite editor content with saved file content\">\n <Button onClick={() => onTabUpdate(index)} style={iconButtonStyle}>\n <SyncIcon fontSize=\"small\" />\n </Button>\n </Tooltip>\n <Button onClick={() => onTabClose(index)} style={iconButtonStyle}>\n <CloseIcon fontSize=\"small\" />\n </Button>\n </div>\n )}\n </Draggable>\n );\n })}\n {provided.placeholder}\n </Box>\n )}\n </Droppable>\n </DragDropContext>\n <div style={{ paddingBottom: \"5px\" }} />\n <Editor\n beforeMount={beforeMount}\n onMount={onMount}\n loading={<Typography>Loading script editor!</Typography>}\n height={`calc(100vh - ${130 + (options.vim ? 34 : 0)}px)`}\n defaultLanguage=\"javascript\"\n defaultValue={\"\"}\n onChange={updateCode}\n theme={options.theme}\n options={{ ...options, glyphMargin: true }}\n />\n\n <Box\n ref={vimStatusRef}\n className=\"monaco-editor\"\n display=\"flex\"\n flexDirection=\"row\"\n sx={{ p: 1 }}\n alignItems=\"center\"\n ></Box>\n\n <Box display=\"flex\" flexDirection=\"row\" sx={{ m: 1 }} alignItems=\"center\">\n <Button startIcon={<SettingsIcon />} onClick={() => setOptionsOpen(true)} sx={{ mr: 1 }}>\n Options\n </Button>\n <Button onClick={beautify}>Beautify</Button>\n <Button\n color={updatingRam ? \"secondary\" : \"primary\"}\n sx={{ mx: 1 }}\n onClick={() => {\n setRamInfoOpen(true);\n }}\n >\n {ram}\n </Button>\n <Button onClick={save}>Save (Ctrl/Cmd + s)</Button>\n <Button sx={{ mx: 1 }} onClick={Router.toTerminal}>\n Terminal (Ctrl/Cmd + b)\n </Button>\n <Typography>\n {\" \"}\n <strong>Documentation:</strong>{\" \"}\n <Link target=\"_blank\" href=\"https://bitburner.readthedocs.io/en/latest/index.html\">\n Basic\n </Link>\n {\" | \"}\n <Link target=\"_blank\" href=\"https://github.com/danielyxie/bitburner/blob/dev/markdown/bitburner.ns.md\">\n Full\n </Link>\n </Typography>\n </Box>\n <OptionsModal\n open={optionsOpen}\n onClose={() => {\n sanitizeTheme(Settings.EditorTheme);\n monacoRef.current?.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\n setOptionsOpen(false);\n }}\n options={{\n theme: Settings.MonacoTheme,\n insertSpaces: Settings.MonacoInsertSpaces,\n fontSize: Settings.MonacoFontSize,\n wordWrap: Settings.MonacoWordWrap,\n vim: Settings.MonacoVim,\n }}\n save={(options: Options) => {\n sanitizeTheme(Settings.EditorTheme);\n monacoRef.current?.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\n setOptions(options);\n Settings.MonacoTheme = options.theme;\n Settings.MonacoInsertSpaces = options.insertSpaces;\n Settings.MonacoFontSize = options.fontSize;\n Settings.MonacoWordWrap = options.wordWrap;\n Settings.MonacoVim = options.vim;\n }}\n />\n <Modal open={ramInfoOpen} onClose={() => setRamInfoOpen(false)}>\n <Table>\n <TableBody>\n {ramEntries.map(([n, r]) => (\n <React.Fragment key={n + r}>\n <TableRow>\n <TableCell sx={{ color: Settings.theme.primary }}>{n}</TableCell>\n <TableCell align=\"right\" sx={{ color: Settings.theme.primary }}>\n {r}\n </TableCell>\n </TableRow>\n </React.Fragment>\n ))}\n </TableBody>\n </Table>\n </Modal>\n </div>\n <div\n style={{\n display: currentScript !== null ? \"none\" : \"flex\",\n height: \"100%\",\n width: \"100%\",\n justifyContent: \"center\",\n alignItems: \"center\",\n }}\n >\n <span style={{ color: Settings.theme.primary, fontSize: \"20px\", textAlign: \"center\" }}>\n <Typography variant=\"h4\">No open files</Typography>\n <Typography variant=\"h5\">\n Use <code>nano FILENAME</code> in\n <br />\n the terminal to open files\n </Typography>\n </span>\n </div>\n </>\n );\n}\n","import * as React from \"react\";\nimport { useTheme } from \"@mui/material/styles\";\nimport Box from \"@mui/material/Box\";\nimport IconButton from \"@mui/material/IconButton\";\nimport FirstPageIcon from \"@mui/icons-material/FirstPage\";\nimport KeyboardArrowLeft from \"@mui/icons-material/KeyboardArrowLeft\";\nimport KeyboardArrowRight from \"@mui/icons-material/KeyboardArrowRight\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\";\n\ninterface TablePaginationActionsProps {\n count: number;\n page: number;\n rowsPerPage: number;\n onPageChange: (event: React.MouseEvent<HTMLButtonElement>, newPage: number) => void;\n}\n\nexport function TablePaginationActionsAll(props: TablePaginationActionsProps): React.ReactElement {\n const theme = useTheme();\n const { count, page, rowsPerPage, onPageChange } = props;\n\n const handleFirstPageButtonClick = (event: React.MouseEvent<HTMLButtonElement>): void => {\n onPageChange(event, 0);\n };\n\n const handleBackButtonClick = (event: React.MouseEvent<HTMLButtonElement>): void => {\n onPageChange(event, page - 1);\n };\n\n const handleNextButtonClick = (event: React.MouseEvent<HTMLButtonElement>): void => {\n onPageChange(event, page + 1);\n };\n\n const handleLastPageButtonClick = (event: React.MouseEvent<HTMLButtonElement>): void => {\n onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n\n return (\n <Box sx={{ flexShrink: 0, ml: 2.5 }}>\n <IconButton onClick={handleFirstPageButtonClick} disabled={page === 0}>\n {theme.direction === \"rtl\" ? <LastPageIcon /> : <FirstPageIcon />}\n </IconButton>\n <IconButton onClick={handleBackButtonClick} disabled={page === 0}>\n {theme.direction === \"rtl\" ? <KeyboardArrowRight /> : <KeyboardArrowLeft />}\n </IconButton>\n <IconButton onClick={handleNextButtonClick} disabled={page >= Math.ceil(count / rowsPerPage) - 1}>\n {theme.direction === \"rtl\" ? <KeyboardArrowLeft /> : <KeyboardArrowRight />}\n </IconButton>\n <IconButton onClick={handleLastPageButtonClick} disabled={page >= Math.ceil(count / rowsPerPage) - 1}>\n {theme.direction === \"rtl\" ? <FirstPageIcon /> : <LastPageIcon />}\n </IconButton>\n </Box>\n );\n}\n","import ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport { Box, Collapse, ListItemButton, ListItemText, Paper, Table, TableBody, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React from \"react\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Player } from \"@player\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\nimport { defaultMultipliers, getBitNodeMultipliers } from \"../BitNode\";\nimport { IBitNodeMultipliers } from \"../BitNodeMultipliers\";\n\ninterface IProps {\n n: number;\n level?: number;\n}\n\nexport function BitnodeMultiplierDescription({ n, level }: IProps): React.ReactElement {\n const [open, setOpen] = React.useState(false);\n if (n === 1) return <></>;\n\n return (\n <Box component={Paper} sx={{ mt: 1, p: 1 }}>\n <ListItemButton disableGutters onClick={() => setOpen((old) => !old)}>\n <ListItemText primary={<Typography variant=\"h6\">Bitnode Multipliers</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open}>\n <BitNodeMultipliersDisplay n={n} level={level} />\n </Collapse>\n </Box>\n );\n}\n\nexport const BitNodeMultipliersDisplay = ({ n, level }: IProps): React.ReactElement => {\n // If a level argument has been provided, use that as the multiplier level\n // If not, then we have to assume that we want the next level up from the\n // current node's source file, so we get the min of that, the SF's max level,\n // or if it's BN12, ∞\n const maxSfLevel = n === 12 ? Infinity : 3;\n const mults = getBitNodeMultipliers(n, level ?? Math.min(Player.sourceFileLvl(n) + 1, maxSfLevel));\n\n return (\n <Box sx={{ columnCount: 2, columnGap: 1, mb: -2 }}>\n <GeneralMults n={n} mults={mults} />\n <SkillMults n={n} mults={mults} />\n <FactionMults n={n} mults={mults} />\n <AugmentationMults n={n} mults={mults} />\n <HackingMults n={n} mults={mults} />\n <PurchasedServersMults n={n} mults={mults} />\n <StockMults n={n} mults={mults} />\n <CrimeMults n={n} mults={mults} />\n <InfiltrationMults n={n} mults={mults} />\n <CompanyMults n={n} mults={mults} />\n <GangMults n={n} mults={mults} />\n <CorporationMults n={n} mults={mults} />\n <BladeburnerMults n={n} mults={mults} />\n <StanekMults n={n} mults={mults} />\n </Box>\n );\n};\n\ninterface IBNMultRows {\n [mult: string]: {\n name: string;\n content?: string;\n color?: string;\n };\n}\n\ninterface IBNMultTableProps {\n sectionName: string;\n rowData: IBNMultRows;\n mults: IBitNodeMultipliers;\n}\n\nconst BNMultTable = (props: IBNMultTableProps): React.ReactElement => {\n const rowsArray = Object.entries(props.rowData)\n .filter(([key]) => props.mults[key] !== defaultMultipliers[key])\n .map(([key, value]) => (\n <StatsRow\n key={uniqueId()}\n name={value.name}\n data={{ content: value.content ?? `${(props.mults[key] * 100).toFixed(3)}%` }}\n color={value.color ?? Settings.theme.primary}\n />\n ));\n\n return rowsArray.length > 0 ? (\n <span style={{ display: \"inline-block\", width: \"100%\", marginBottom: \"16px\" }}>\n <Typography variant=\"h6\">{props.sectionName}</Typography>\n <Table>\n <TableBody>{rowsArray}</TableBody>\n </Table>\n </span>\n ) : (\n <></>\n );\n};\n\ninterface IMultsProps {\n n: number;\n mults: IBitNodeMultipliers;\n}\n\nfunction GeneralMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n WorldDaemonDifficulty: { name: `${SpecialServers.WorldDaemon} Difficulty` },\n DaedalusAugsRequirement: {\n name: \"Daedalus Augs Requirement\",\n content: String(mults.DaedalusAugsRequirement),\n },\n HacknetNodeMoney: { name: \"Hacknet Production\" },\n CodingContractMoney: { name: \"Coding Contract Reward\" },\n ClassGymExpGain: { name: \"Class/Gym Exp\" },\n };\n\n return <BNMultTable sectionName=\"General\" rowData={rows} mults={mults} />;\n}\n\nfunction AugmentationMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n AugmentationMoneyCost: { name: \"Money Cost\" },\n AugmentationRepCost: {\n name: \"Reputation Cost\",\n color: Settings.theme.rep,\n },\n };\n\n return <BNMultTable sectionName=\"Augmentations\" rowData={rows} mults={mults} />;\n}\n\nfunction CompanyMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n CompanyWorkMoney: {\n name: \"Work Money\",\n color: Settings.theme.money,\n },\n CompanyWorkExpGain: { name: \"Work Exp\" },\n };\n\n return <BNMultTable sectionName=\"Company\" rowData={rows} mults={mults} />;\n}\n\nfunction StockMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n FourSigmaMarketDataCost: { name: \"Market Data Cost\" },\n FourSigmaMarketDataApiCost: { name: \"Market Data API Cost\" },\n };\n\n return <BNMultTable sectionName=\"Stock Market\" rowData={rows} mults={mults} />;\n}\n\nfunction FactionMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n RepToDonateToFaction: { name: \"Favor to Donate\" },\n FactionWorkRepGain: {\n name: \"Work Reputation\",\n color: Settings.theme.rep,\n },\n FactionWorkExpGain: { name: \"Work Exp\" },\n FactionPassiveRepGain: {\n name: \"Passive Rep\",\n color: Settings.theme.rep,\n },\n };\n\n return <BNMultTable sectionName=\"Faction\" rowData={rows} mults={mults} />;\n}\n\nfunction CrimeMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n CrimeExpGain: {\n name: \"Crime Exp\",\n color: Settings.theme.combat,\n },\n CrimeMoney: {\n name: \"Crime Money\",\n color: Settings.theme.combat,\n },\n };\n\n return <BNMultTable sectionName=\"Crime\" rowData={rows} mults={mults} />;\n}\n\nfunction SkillMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n HackingLevelMultiplier: {\n name: \"Hacking Level\",\n color: Settings.theme.hack,\n },\n StrengthLevelMultiplier: {\n name: \"Strength Level\",\n color: Settings.theme.combat,\n },\n DefenseLevelMultiplier: {\n name: \"Defense Level\",\n color: Settings.theme.combat,\n },\n DexterityLevelMultiplier: {\n name: \"Dexterity Level\",\n color: Settings.theme.combat,\n },\n AgilityLevelMultiplier: {\n name: \"Agility Level\",\n color: Settings.theme.combat,\n },\n CharismaLevelMultiplier: {\n name: \"Charisma Level\",\n color: Settings.theme.cha,\n },\n };\n\n return <BNMultTable sectionName=\"Skills\" rowData={rows} mults={mults} />;\n}\n\nfunction HackingMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n HackExpGain: {\n name: \"Hacking Exp\",\n color: Settings.theme.hack,\n },\n ServerGrowthRate: { name: \"Server Growth Rate\" },\n ServerMaxMoney: { name: \"Server Max Money\" },\n ServerStartingMoney: { name: \"Server Starting Money\" },\n ServerStartingSecurity: { name: \"Server Starting Security\" },\n ServerWeakenRate: { name: \"Server Weaken Rate\" },\n ManualHackMoney: {\n name: \"Manual Hack Money\",\n color: Settings.theme.money,\n },\n ScriptHackMoney: {\n name: \"Script Hack Money\",\n color: Settings.theme.money,\n },\n ScriptHackMoneyGain: {\n name: \"Money Gained From Hack\",\n color: Settings.theme.money,\n },\n };\n\n return <BNMultTable sectionName=\"Hacking\" rowData={rows} mults={mults} />;\n}\n\nfunction PurchasedServersMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n PurchasedServerCost: {\n name: \"Base Cost\",\n content: mults.PurchasedServerCost.toFixed(3),\n },\n PurchasedServerSoftcap: {\n name: \"Softcap Cost\",\n content: mults.PurchasedServerSoftcap.toFixed(3),\n },\n PurchasedServerLimit: { name: \"Server Limit\" },\n PurchasedServerMaxRam: { name: \"Max RAM\" },\n HomeComputerRamCost: { name: \"Home RAM Cost\" },\n };\n\n return <BNMultTable sectionName=\"Purchased Servers\" rowData={rows} mults={mults} />;\n}\n\nfunction InfiltrationMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n InfiltrationMoney: {\n name: \"Infiltration Money\",\n color: Settings.theme.money,\n },\n InfiltrationRep: {\n name: \"Infiltration Reputation\",\n color: Settings.theme.rep,\n },\n };\n\n return <BNMultTable sectionName=\"Infiltration\" rowData={rows} mults={mults} />;\n}\n\nfunction BladeburnerMults({ mults }: IMultsProps): React.ReactElement {\n if (!Player.canAccessBladeburner()) return <></>;\n\n if (mults.BladeburnerRank === 0) {\n const rows: IBNMultRows = {\n BladeburnerRank: { name: \"Disabled\", content: \"\" },\n };\n\n return <BNMultTable sectionName=\"Bladeburner\" rowData={rows} mults={mults} />;\n }\n\n const rows: IBNMultRows = {\n BladeburnerRank: { name: \"Rank Gain\" },\n BladeburnerSkillCost: { name: \"Skill Cost\" },\n };\n\n return <BNMultTable sectionName=\"Bladeburner\" rowData={rows} mults={mults} />;\n}\n\nfunction StanekMults({ mults }: IMultsProps): React.ReactElement {\n if (!Player.canAccessCotMG()) return <></>;\n\n const extraSize = mults.StaneksGiftExtraSize.toFixed(3);\n const rows: IBNMultRows = {\n StaneksGiftPowerMultiplier: { name: \"Gift Power\" },\n StaneksGiftExtraSize: {\n name: \"Base Size Modifier\",\n content: `${mults.StaneksGiftExtraSize > defaultMultipliers.StaneksGiftExtraSize ? `+${extraSize}` : extraSize}`,\n },\n };\n\n return <BNMultTable sectionName=\"Stanek's Gift\" rowData={rows} mults={mults} />;\n}\n\nfunction GangMults({ mults }: IMultsProps): React.ReactElement {\n if (Player.bitNodeN !== 2 && Player.sourceFileLvl(2) <= 0) return <></>;\n\n const rows: IBNMultRows = {\n GangSoftcap: {\n name: \"Gang Softcap\",\n content: mults.GangSoftcap.toFixed(3),\n },\n GangUniqueAugs: { name: \"Unique Augmentations\" },\n };\n\n return <BNMultTable sectionName=\"Gang\" rowData={rows} mults={mults} />;\n}\n\nfunction CorporationMults({ mults }: IMultsProps): React.ReactElement {\n if (!Player.canAccessCorporation()) return <></>;\n\n if (mults.CorporationSoftcap < 0.15) {\n const rows: IBNMultRows = {\n CorporationSoftcap: {\n name: \"Disabled\",\n content: \"\",\n },\n };\n\n return <BNMultTable sectionName=\"Corporation\" rowData={rows} mults={mults} />;\n }\n\n const rows: IBNMultRows = {\n CorporationSoftcap: {\n name: \"Corporation Softcap\",\n content: mults.CorporationSoftcap.toFixed(3),\n },\n CorporationValuation: { name: \"Valuation\" },\n };\n\n return <BNMultTable sectionName=\"Corporation\" rowData={rows} mults={mults} />;\n}\n","import * as React from \"react\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { TableCell as MuiTableCell, TableCellProps } from \"@mui/material\";\n\nconst useStyles = makeStyles({\n root: {\n border: \"1px solid white\",\n width: \"5px\",\n height: \"5px\",\n },\n});\n\nexport const TableCell: React.FC<TableCellProps> = (props: TableCellProps) => {\n return (\n <MuiTableCell\n {...props}\n classes={{\n root: useStyles().root,\n ...props.classes,\n }}\n />\n );\n};\n\ntype IProps = {\n onMouseEnter?: () => void;\n onClick?: () => void;\n color: string;\n};\n\nexport function Cell(cellProps: IProps): React.ReactElement {\n return (\n <TableCell\n style={{ backgroundColor: cellProps.color }}\n onMouseEnter={cellProps.onMouseEnter}\n onClick={cellProps.onClick}\n ></TableCell>\n );\n}\n","import { TableBody, TableRow } from \"@mui/material\";\nimport * as React from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { calculateGrid } from \"../Helper\";\nimport { BaseGift } from \"../BaseGift\";\nimport { Cell } from \"./Cell\";\n\ninterface IProps {\n width: number;\n height: number;\n ghostGrid: number[][];\n gift: BaseGift;\n enter(i: number, j: number): void;\n click(i: number, j: number): void;\n}\n\nfunction randomColor(fragment: ActiveFragment): string {\n // Can't set Math.random seed so copy casino. TODO refactor both RNG later.\n let s1 = Math.pow((fragment.x + 1) * (fragment.y + 1), 10);\n let s2 = s1;\n let s3 = s1;\n\n const colors = [];\n for (let i = 0; i < 3; i++) {\n s1 = (171 * s1) % 30269;\n s2 = (172 * s2) % 30307;\n s3 = (170 * s3) % 30323;\n colors.push((s1 / 30269.0 + s2 / 30307.0 + s3 / 30323.0) % 1.0);\n }\n\n return `rgb(${colors[0] * 256}, ${colors[1] * 256}, ${colors[2] * 256})`;\n}\n\nexport function Grid(props: IProps): React.ReactElement {\n const activeGrid = calculateGrid(props.gift);\n\n function color(worldX: number, worldY: number): string {\n if (props.ghostGrid[worldX][worldY] && activeGrid[worldX][worldY]) return \"red\";\n if (props.ghostGrid[worldX][worldY]) return \"white\";\n\n if (activeGrid[worldX][worldY]) {\n const fragment = props.gift.fragmentAt(worldX, worldY);\n if (!fragment) throw new Error(\"ActiveFragment should not be null\");\n return randomColor(fragment);\n }\n return \"\";\n }\n\n // switch the width/length to make axis consistent.\n const elems = [];\n for (let j = 0; j < props.height; j++) {\n const cells = [];\n for (let i = 0; i < props.width; i++) {\n cells.push(\n <Cell key={i} onMouseEnter={() => props.enter(i, j)} onClick={() => props.click(i, j)} color={color(i, j)} />,\n );\n }\n elems.push(<TableRow key={j}>{cells}</TableRow>);\n }\n\n return <TableBody>{elems}</TableBody>;\n}\n","import { Bladeburner } from \"../../Bladeburner/Bladeburner\";\nimport { PlayerObject } from \"./PlayerObject\";\n\nexport function canAccessBladeburner(this: PlayerObject): boolean {\n return this.bitNodeN === 6 || this.bitNodeN === 7 || this.sourceFileLvl(6) > 0 || this.sourceFileLvl(7) > 0;\n}\n\nexport function inBladeburner(this: PlayerObject): boolean {\n return Boolean(this.bladeburner);\n}\n\nexport function startBladeburner(this: PlayerObject): void {\n this.bladeburner = new Bladeburner();\n}\n","import { Bladeburner } from \"./Bladeburner\";\nimport { Action, IActionParams } from \"./Action\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class Contract extends Action {\n constructor(params: IActionParams | null = null) {\n super(params);\n }\n\n getActionTypeSkillSuccessBonus(inst: Bladeburner): number {\n return inst.skillMultipliers.successChanceContract;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Contract\", this);\n }\n\n static fromJSON(value: IReviverValue): Contract {\n return Generic_fromJSON(Contract, value.data);\n }\n}\n\nReviver.constructors.Contract = Contract;\n","export const ConsoleHelpText: {\n [key: string]: string[];\n helpList: string[];\n automate: string[];\n clear: string[];\n cls: string[];\n help: string[];\n log: string[];\n skill: string[];\n start: string[];\n stop: string[];\n} = {\n helpList: [\n \"Use 'help [command]' to get more information about a particular Bladeburner console command.\",\n \" \",\n \" automate [var] [val] [hi/low] Configure simple automation for Bladeburner tasks\",\n \" clear/cls Clear the console\",\n \" help [cmd] Display this help text, or help text for a specific command\",\n \" log [en/dis] [type] Enable or disable logging for events and actions\",\n \" skill [action] [name] Level or display info about your Bladeburner skills\",\n \" start [type] [name] Start a Bladeburner action/task\",\n \" stop Stops your current Bladeburner action/task\",\n \" \",\n ],\n automate: [\n \"Usage: automate [var] [val] [hi/low]\",\n \" \",\n \"A simple way to automate your Bladeburner actions. This console command can be used \" +\n \"to automatically start an action when your stamina rises above a certain threshold, and \" +\n \"automatically switch to another action when your stamina drops below another threshold.\",\n \" \",\n \" automate status - Check the current status of your automation and get a brief description of what it'll do\",\n \" automate en - Enable the automation feature\",\n \" automate dis - Disable the automation feature\",\n \" \",\n \"There are four properties that must be set for this automation to work properly. Here is how to set them:\",\n \" \",\n \" automate stamina 100 high\",\n \" automate contract Tracking high\",\n \" automate stamina 50 low\",\n \" automate general 'Field Analysis' low\",\n \" \",\n \"Using the four console commands above will set the automation to perform Tracking contracts \" +\n \"if your stamina is 100 or higher, and then switch to Field Analysis if your stamina drops below \" +\n \"50. Note that when setting the action, the name of the action is CASE-SENSITIVE. It must \" +\n \"exactly match whatever the name is in the UI.\",\n \" \",\n ],\n clear: [\"Usage: clear\", \" \", \"Clears the console\", \" \"],\n cls: [\"Usage: cls\", \" \", \"Clears the console\", \" \"],\n help: [\n \"Usage: help [command]\",\n \" \",\n \"Running 'help' with no arguments displays the general help text, which lists all console commands \" +\n \"and a brief description of what they do. A command can be specified to get more specific help text \" +\n \"about that particular command. For example:\",\n \" \",\n \" help automate\",\n \" \",\n \"will display specific information about using the automate console command\",\n \" \",\n ],\n log: [\n \"Usage: log [en/dis] [type]\",\n \" \",\n \"Enable or disable logging. By default, the results of completing actions such as contracts/operations are logged \" +\n \"in the console. There are also random events that are logged in the console as well. The five categories of \" +\n \"things that get logged are:\",\n \" \",\n \"[general, contracts, ops, blackops, events]\",\n \" \",\n \"The logging for these categories can be enabled or disabled like so:\",\n \" \",\n \" log dis contracts - Disables logging that occurs when contracts are completed\",\n \" log en contracts - Enables logging that occurs when contracts are completed\",\n \" log dis events - Disables logging for Bladeburner random events\",\n \" \",\n \"Logging can be universally enabled/disabled using the 'all' keyword:\",\n \" \",\n \" log dis all\",\n \" log en all\",\n \" \",\n ],\n skill: [\n \"Usage: skill [action] [name]\",\n \" \",\n \"Level or display information about your skills.\",\n \" \",\n \"To display information about all of your skills and your multipliers, use:\",\n \" \",\n \" skill list\",\n \" \",\n \"To display information about a specific skill, specify the name of the skill afterwards. \" +\n \"Note that the name of the skill is case-sensitive. Enter it exactly as seen in the UI. If \" +\n \"the name of the skill has whitespace, enclose the name of the skill in double quotation marks:\",\n \" \",\n \" skill list Reaper\",\n \" skill list 'Digital Observer'\",\n \" \",\n \"This console command can also be used to level up skills:\",\n \" \",\n \" skill level [skill name]\",\n \" \",\n ],\n start: [\n \"Usage: start [type] [name]\",\n \" \",\n \"Start an action. An action is specified by its type and its name. The \" +\n \"name is case-sensitive. It must appear exactly as it does in the UI. If \" +\n \"the name of the action has whitespace, enclose it in double quotation marks. \" +\n \"Valid action types include:\",\n \" \",\n \"[general, contract, op, blackop]\",\n \" \",\n \"Examples:\",\n \" \",\n \" start contract Tracking\",\n \" start op 'Undercover Operation'\",\n \" \",\n ],\n stop: [\"Usage: stop\", \" \", \"Stop your current action and go idle.\", \" \"],\n};\n","import { Corporation } from \"../../Corporation/Corporation\";\nimport {\n CorporationUnlockUpgradeIndex,\n CorporationUnlockUpgrades,\n} from \"../../Corporation/data/CorporationUnlockUpgrades\";\nimport { PlayerObject } from \"./PlayerObject\";\n\nexport function canAccessCorporation(this: PlayerObject): boolean {\n return this.bitNodeN === 3 || this.sourceFileLvl(3) > 0;\n}\n\nexport function hasCorporation(this: PlayerObject): boolean {\n return Boolean(this.corporation);\n}\n\nexport function startCorporation(this: PlayerObject, corpName: string, additionalShares = 0): void {\n this.corporation = new Corporation({\n name: corpName,\n });\n\n if (this.sourceFileLvl(3) === 3) {\n const warehouseApi = CorporationUnlockUpgrades[CorporationUnlockUpgradeIndex.WarehouseAPI].index;\n const OfficeApi = CorporationUnlockUpgrades[CorporationUnlockUpgradeIndex.OfficeAPI].index;\n\n this.corporation.unlockUpgrades[warehouseApi] = 1;\n this.corporation.unlockUpgrades[OfficeApi] = 1;\n }\n\n this.corporation.totalShares += additionalShares;\n}\n","export function HammingEncode(data: number): string {\n const enc: Array<number> = [0];\n const data_bits: Array<any> = data.toString(2).split(\"\").reverse();\n\n data_bits.forEach((e, i, a) => {\n a[i] = parseInt(e);\n });\n\n let k = data_bits.length;\n\n /* NOTE: writing the data like this flips the endianness, this is what the\n * original implementation by Hedrauta did so I'm keeping it like it was. */\n for (let i = 1; k > 0; i++) {\n if ((i & (i - 1)) != 0) {\n enc[i] = data_bits[--k];\n } else {\n enc[i] = 0;\n }\n }\n\n let parity: any = 0;\n\n /* Figure out the subsection parities */\n for (let i = 0; i < enc.length; i++) {\n if (enc[i]) {\n parity ^= i;\n }\n }\n\n parity = parity.toString(2).split(\"\").reverse();\n parity.forEach((e: any, i: any, a: any) => {\n a[i] = parseInt(e);\n });\n\n /* Set the parity bits accordingly */\n for (let i = 0; i < parity.length; i++) {\n enc[2 ** i] = parity[i] ? 1 : 0;\n }\n\n parity = 0;\n /* Figure out the overall parity for the entire block */\n for (let i = 0; i < enc.length; i++) {\n if (enc[i]) {\n parity++;\n }\n }\n\n /* Finally set the overall parity bit */\n enc[0] = parity % 2 == 0 ? 0 : 1;\n\n return enc.join(\"\");\n}\n\nexport function HammingEncodeProperly(data: number): string {\n /* How many bits do we need?\n * n = 2^m\n * k = 2^m - m - 1\n * where k is the number of data bits, m the number\n * of parity bits and n the number of total bits. */\n\n let m = 1;\n\n while (2 ** (2 ** m - m - 1) - 1 < data) {\n m++;\n }\n\n const n: number = 2 ** m;\n const k: number = 2 ** m - m - 1;\n\n const enc: Array<number> = [0];\n const data_bits: Array<any> = data.toString(2).split(\"\").reverse();\n\n data_bits.forEach((e, i, a) => {\n a[i] = parseInt(e);\n });\n\n /* Flip endianness as in the original implementation by Hedrauta\n * and write the data back to front\n * XXX why do we do this? */\n for (let i = 1, j = k; i < n; i++) {\n if ((i & (i - 1)) != 0) {\n enc[i] = data_bits[--j] ? data_bits[j] : 0;\n }\n }\n\n let parity: any = 0;\n\n /* Figure out the subsection parities */\n for (let i = 0; i < n; i++) {\n if (enc[i]) {\n parity ^= i;\n }\n }\n\n parity = parity.toString(2).split(\"\").reverse();\n parity.forEach((e: any, i: any, a: any) => {\n a[i] = parseInt(e);\n });\n\n /* Set the parity bits accordingly */\n for (let i = 0; i < m; i++) {\n enc[2 ** i] = parity[i] ? 1 : 0;\n }\n\n parity = 0;\n /* Figure out the overall parity for the entire block */\n for (let i = 0; i < n; i++) {\n if (enc[i]) {\n parity++;\n }\n }\n\n /* Finally set the overall parity bit */\n enc[0] = parity % 2 == 0 ? 0 : 1;\n\n return enc.join(\"\");\n}\n\nexport function HammingDecode(data: string): number {\n let err = 0;\n const bits: Array<number> = [];\n\n /* TODO why not just work with an array of digits from the start? */\n for (const i in data.split(\"\")) {\n const bit = parseInt(data[i]);\n bits[i] = bit;\n\n if (bit) {\n err ^= +i;\n }\n }\n\n /* If err != 0 then it spells out the index of the bit that was flipped */\n if (err) {\n /* Flip to correct */\n bits[err] = bits[err] ? 0 : 1;\n }\n\n /* Now we have to read the message, bit 0 is unused (it's the overall parity bit\n * which we don't care about). Each bit at an index that is a power of 2 is\n * a parity bit and not part of the actual message. */\n\n let ans = \"\";\n\n for (let i = 1; i < bits.length; i++) {\n /* i is not a power of two so it's not a parity bit */\n if ((i & (i - 1)) != 0) {\n ans += bits[i];\n }\n }\n\n /* TODO to avoid ambiguity about endianness why not let the player return the extracted (and corrected)\n * data bits, rather than guessing at how to convert it to a decimal string? */\n return parseInt(ans, 2);\n}\n","// Function that returns the next Company Position in the \"ladder\"\n// i.e. the next position to get promoted to\nimport { CompanyPosition } from \"./CompanyPosition\";\nimport { CompanyPositions } from \"./CompanyPositions\";\n\nexport function getNextCompanyPositionHelper(currPos: CompanyPosition | null): CompanyPosition | null {\n if (currPos == null) {\n return null;\n }\n\n const nextPosName: string | null = currPos.nextPosition;\n if (nextPosName == null) {\n return null;\n }\n\n return CompanyPositions[nextPosName];\n}\n","/**\n * How many stock market 'ticks' before a 'cycle' is triggered.\n * A 'tick' is whenever stock prices update\n */\nexport const TicksPerCycle = 75;\n","export const StanekConstants = {\n RAMBonus: 0.1,\n BaseSize: 9,\n MaxSize: 25,\n};\n","// Defines a \"Research Tree\"\n// Each Industry has a unique Research Tree\n// Each Node in the Research Trees only holds the name(s) of Research,\n// not an actual Research object. The name can be used to obtain a reference\n// to the corresponding Research object using the ResearchMap\nimport { Research } from \"./Research\";\nimport { ResearchMap } from \"./ResearchMap\";\n\ninterface IConstructorParams {\n children?: Node[];\n cost: number;\n text: string;\n parent?: Node | null;\n}\n\nexport class Node {\n // All child Nodes in the tree\n // The Research held in this Node is a prerequisite for all Research in\n // child Nodes\n children: Node[] = [];\n\n // How much Scientific Research is needed for this\n // Necessary to show it on the UI\n cost = 0;\n\n // Whether or not this Research has been unlocked\n researched = false;\n\n // Parent node in the tree\n // The parent node defines the prerequisite Research (there can only be one)\n // Set as null for no prerequisites\n parent: Node | null = null;\n\n // Name of the Research held in this Node\n text = \"\";\n\n constructor(p: IConstructorParams = { cost: 0, text: \"\" }) {\n if (ResearchMap[p.text] == null) {\n throw new Error(`Invalid Research name used when constructing ResearchTree Node: ${p.text}`);\n }\n\n this.text = p.text;\n this.cost = p.cost;\n\n if (p.children && p.children.length > 0) {\n this.children = p.children;\n }\n\n if (p.parent != null) {\n this.parent = p.parent;\n }\n }\n\n addChild(n: Node): void {\n this.children.push(n);\n n.parent = this;\n }\n\n // Recursive function for finding a Node with the specified text\n findNode(text: string): Node | null {\n // Is this the Node?\n if (this.text === text) {\n return this;\n }\n\n // Recursively search children\n let res = null;\n for (let i = 0; i < this.children.length; ++i) {\n res = this.children[i].findNode(text);\n if (res != null) {\n return res;\n }\n }\n\n return null;\n }\n\n setParent(n: Node): void {\n this.parent = n;\n }\n}\n\n// A ResearchTree defines all available Research in an Industry\n// The root node in a Research Tree must always be the \"Hi-Tech R&D Laboratory\"\nexport class ResearchTree {\n // Object containing names of all acquired Research by name\n researched: Record<string, boolean> = {};\n\n // Root Node\n root: Node | null = null;\n\n // Gets an array with the 'text' values of ALL Nodes in the Research Tree\n getAllNodes(): string[] {\n const res: string[] = [];\n const queue: Node[] = [];\n\n if (this.root == null) {\n return res;\n }\n\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n if (node == null) {\n continue;\n }\n\n res.push(node.text);\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n return res;\n }\n\n // Get total multipliers from this Research Tree\n getAdvertisingMultiplier(): number {\n return this.getMultiplierHelper(\"advertisingMult\");\n }\n\n getEmployeeChaMultiplier(): number {\n return this.getMultiplierHelper(\"employeeChaMult\");\n }\n\n getEmployeeCreMultiplier(): number {\n return this.getMultiplierHelper(\"employeeCreMult\");\n }\n\n getEmployeeEffMultiplier(): number {\n return this.getMultiplierHelper(\"employeeEffMult\");\n }\n\n getEmployeeIntMultiplier(): number {\n return this.getMultiplierHelper(\"employeeIntMult\");\n }\n\n getProductionMultiplier(): number {\n return this.getMultiplierHelper(\"productionMult\");\n }\n\n getProductProductionMultiplier(): number {\n return this.getMultiplierHelper(\"productProductionMult\");\n }\n\n getSalesMultiplier(): number {\n return this.getMultiplierHelper(\"salesMult\");\n }\n\n getScientificResearchMultiplier(): number {\n return this.getMultiplierHelper(\"sciResearchMult\");\n }\n\n getStorageMultiplier(): number {\n return this.getMultiplierHelper(\"storageMult\");\n }\n\n // Helper function for all the multiplier getter fns\n getMultiplierHelper(propName: string): number {\n let res = 1;\n if (this.root == null) {\n return res;\n }\n\n const queue: Node[] = [];\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n\n // If the Node has not been researched, there's no need to\n // process it or its children\n if (node == null || !node.researched) {\n continue;\n }\n\n const research: Research | null = ResearchMap[node.text];\n\n // Safety checks\n if (research == null) {\n console.warn(`Invalid Research name in node: ${node.text}`);\n continue;\n }\n\n const mult =\n {\n advertisingMult: research.advertisingMult,\n employeeChaMult: research.employeeChaMult,\n employeeCreMult: research.employeeCreMult,\n employeeEffMult: research.employeeEffMult,\n employeeIntMult: research.employeeIntMult,\n productionMult: research.productionMult,\n productProductionMult: research.productProductionMult,\n salesMult: research.salesMult,\n sciResearchMult: research.sciResearchMult,\n storageMult: research.storageMult,\n }[propName] ?? null;\n\n if (mult == null) {\n console.warn(`Invalid propName specified in ResearchTree.getMultiplierHelper: ${propName}`);\n continue;\n }\n\n res *= mult;\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n return res;\n }\n\n // Search for a Node with the given name ('text' property on the Node)\n // Returns 'null' if it cannot be found\n findNode(name: string): Node | null {\n if (this.root == null) {\n return null;\n }\n return this.root.findNode(name);\n }\n\n // Marks a Node as researched\n research(name: string): void {\n if (this.root == null) {\n return;\n }\n\n const queue: Node[] = [];\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n if (node == null) {\n continue;\n }\n\n if (node.text === name) {\n node.researched = true;\n this.researched[name] = true;\n return;\n }\n\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n console.warn(`ResearchTree.research() did not find the specified Research node for: ${name}`);\n }\n\n // Set the tree's Root Node\n setRoot(root: Node): void {\n this.root = root;\n }\n}\n","import { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { PlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { Player } from \"@player\";\nimport { Script } from \"../Script/Script\";\nimport { GetAllServers } from \"../Server/AllServers\";\n\nconst detect: [string, string][] = [\n [\"getHackTime\", \"returns milliseconds\"],\n [\"getGrowTime\", \"returns milliseconds\"],\n [\"getWeakenTime\", \"returns milliseconds\"],\n [\"getActionTime\", \"returns milliseconds\"],\n [\"hackAnalyzePercent\", \"renamed 'hackAnalyze' and returns decimal\"],\n [\"hackChance\", \"renamed 'hackAnalyzeChance'\"],\n [\"basic.calculateSkill\", \"renamed 'skills.calculateSkill'\"],\n [\"basic.calculateExp\", \"renamed 'skills.calculateExp'\"],\n [\"basic.hackChance\", \"renamed 'hacking.hackChance'\"],\n [\"basic.hackExp\", \"renamed 'hacking.hackExp'\"],\n [\"basic.hackPercent\", \"renamed 'hacking.hackPercent'\"],\n [\"basic.growPercent\", \"renamed 'hacking.growPercent'\"],\n [\"basic.hackTime\", \"renamed 'hacking.hackTime'\"],\n [\"basic.growTime\", \"renamed 'hacking.growTime'\"],\n [\"basic.weakenTime\", \"renamed 'hacking.weakenTime'\"],\n [\"write\", \"needs to be awaited\"],\n [\"scp\", \"needs to be awaited\"],\n [\"sleep\", \"Can no longer be called simultaneously.\"],\n [\"hacking_skill\", \"renamed 'hacking'\"],\n [\"tryWrite\", \"renamed 'tryWritePort'\"],\n];\n\nconst changes: [RegExp, string][] = [\n [/ns.getHackTime/g, \"((...a)=>ns.getHackTime(...a)/1000)\"],\n [/ns.getGrowTime/g, \"((...a)=>ns.getGrowTime(...a)/1000)\"],\n [/ns.getWeakenTime/g, \"((...a)=>ns.getWeakenTime(...a)/1000)\"],\n [/ns.bladeburner.getActionTime/g, \"((...a)=>ns.bladeburner.getActionTime(...a)/1000)\"],\n [/ns.hackAnalyzePercent/g, \"((...a)=>ns.hackAnalyze(...a)*100)\"],\n [/ns.hackChance/g, \"ns.hackAnalyzeChance\"],\n [/ns.tryWrite/g, \"ns.tryWritePort\"],\n [/formulas.basic.calculateSkill/g, \"formulas.skills.calculateSkill\"],\n [/formulas.basic.calculateExp/g, \"formulas.skills.calculateExp\"],\n [/formulas.basic.hackChance/g, \"formulas.hacking.hackChance\"],\n [/formulas.basic.hackExp/g, \"formulas.hacking.hackExp\"],\n [/formulas.basic.hackPercent/g, \"formulas.hacking.hackPercent\"],\n [/formulas.basic.growPercent/g, \"formulas.hacking.growPercent\"],\n [/formulas.basic.hackTime/g, \"formulas.hacking.hackTime\"],\n [/formulas.basic.growTime/g, \"formulas.hacking.growTime\"],\n [/formulas.basic.weakenTime/g, \"formulas.hacking.weakenTime\"],\n];\nfunction hasChanges(code: string): boolean {\n for (const change of changes) {\n if (code.match(change[0])) return true;\n }\n return false;\n}\n\nfunction convert(code: string): string {\n const lines = code.split(\"\\n\");\n const out: string[] = [];\n for (let i = 0; i < lines.length; i++) {\n const orig = lines[i];\n let line = lines[i];\n for (const change of changes) {\n line = line.replace(change[0], change[1]);\n }\n if (line != orig) {\n out.push(`// =============================== original line ===============================`);\n out.push(`/**`);\n out.push(` * ${orig}`);\n out.push(\" */\");\n out.push(`// =============================================================================`);\n }\n out.push(line);\n }\n return out.join(\"\\n\");\n}\n\nexport function AwardNFG(n = 1): void {\n const nf = Player.augmentations.find((a) => a.name === AugmentationNames.NeuroFluxGovernor);\n if (nf) {\n nf.level += n;\n } else {\n const nf = new PlayerOwnedAugmentation(AugmentationNames.NeuroFluxGovernor);\n nf.level = n;\n Player.augmentations.push(nf);\n }\n}\n\nexport interface IFileLine {\n file: string;\n line: number;\n content: string;\n}\n\nexport function v1APIBreak(): void {\n let txt = \"\";\n for (const server of GetAllServers()) {\n for (const change of detect) {\n const s: IFileLine[] = [];\n for (const script of server.scripts) {\n const lines = script.code.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].includes(change[0])) {\n s.push({\n file: script.filename,\n line: i + 1,\n content: \"\",\n });\n }\n }\n }\n\n if (s.length === 0) continue;\n\n txt += `// Detected change ${change[0]}, reason: ${change[1]}\\n`;\n for (const fl of s) {\n txt += `${fl.file}:${fl.line}\\n`;\n }\n }\n }\n if (txt !== \"\") {\n const home = Player.getHomeComputer();\n home.writeToTextFile(\"v1_DETECTED_CHANGES.txt\", txt);\n }\n\n for (const server of GetAllServers()) {\n const backups: Script[] = [];\n for (const script of server.scripts) {\n if (!hasChanges(script.code)) continue;\n const prefix = script.filename.includes(\"/\") ? \"/BACKUP_\" : \"BACKUP_\";\n backups.push(new Script(prefix + script.filename, script.code, script.server));\n script.code = convert(script.code);\n }\n server.scripts = server.scripts.concat(backups);\n }\n}\n","import { Work } from \"../../Work/Work\";\nimport { PlayerObject } from \"./PlayerObject\";\n\nexport function startWork(this: PlayerObject, w: Work): void {\n if (this.currentWork !== null) {\n this.currentWork.finish(true);\n }\n this.currentWork = w;\n}\nexport function processWork(this: PlayerObject, cycles = 1): void {\n if (this.currentWork === null) return;\n const finished = this.currentWork.process(cycles);\n if (finished) {\n this.finishWork(false);\n }\n}\nexport function finishWork(this: PlayerObject, cancelled: boolean): void {\n if (this.currentWork === null) return;\n this.currentWork.finish(cancelled);\n this.currentWork = null;\n this.focus = false;\n}\n","export { Theme as Default } from \"./default\";\nexport { Theme as DefaultLite } from \"./default-lite\";\nexport { Theme as Monokai } from \"./monokai-ish\";\nexport { Theme as Warmer } from \"./warmer\";\nexport { Theme as DarkPlus } from \"./dark-plus\";\nexport { Theme as MayukaiDark } from \"./mayukai-dark\";\nexport { Theme as Purple } from \"./purple\";\nexport { Theme as SmoothGreen } from \"./smooth-green\";\nexport { Theme as Dracula } from \"./dracula\";\nexport { Theme as DarkBlue } from \"./dark-blue\";\nexport { Theme as DiscordLike } from \"./discord-like\";\nexport { Theme as OneDark } from \"./one-dark\";\nexport { Theme as MutedGoldBlue } from \"./muted-gold-blue\";\nexport { Theme as Light } from \"./light\";\n","import React, { useState, useEffect } from \"react\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\n\nimport { load } from \"../db\";\nimport { Engine } from \"../engine\";\nimport { GameRoot } from \"./GameRoot\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { ActivateRecoveryMode } from \"./React/RecoveryRoot\";\nimport { hash } from \"../hash/hash\";\nimport { pushGameReady } from \"../Electron\";\n\nexport function LoadingScreen(): React.ReactElement {\n const [show, setShow] = useState(false);\n const [loaded, setLoaded] = useState(false);\n\n const version = `v${CONSTANTS.VersionString} (${hash()})`;\n if (process.env.NODE_ENV === \"development\") {\n document.title = `[dev] Bitburner ${version}`;\n } else {\n document.title = `Bitburner ${version}`;\n }\n\n useEffect(() => {\n const id = setTimeout(() => {\n if (!loaded) setShow(true);\n }, 2000);\n return () => clearTimeout(id);\n });\n\n useEffect(() => {\n async function doLoad(): Promise<void> {\n await load()\n .then((saveString) => {\n try {\n Engine.load(saveString);\n } catch (err: unknown) {\n ActivateRecoveryMode();\n setLoaded(true);\n throw err;\n }\n\n pushGameReady();\n setLoaded(true);\n })\n .catch((reason) => {\n console.error(reason);\n Engine.load(\"\");\n setLoaded(true);\n });\n }\n doLoad();\n }, []);\n\n return loaded ? (\n <GameRoot />\n ) : (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <CircularProgress size={150} color=\"primary\" />\n </Grid>\n <Grid item>\n <Typography variant=\"h3\">Loading Bitburner {version}</Typography>\n </Grid>\n {show && (\n <Grid item>\n <Typography>\n If the game fails to load, consider <a href=\"?noScripts\">killing all scripts</a>\n </Typography>\n </Grid>\n )}\n </Grid>\n );\n}\n","/**\n * Checks that a variable is a valid number. A valid number\n * must be a \"number\" type and cannot be NaN\n */\nexport function isValidNumber(n: number): boolean {\n return typeof n === \"number\" && !isNaN(n);\n}\n","/**\n * Represents a Limit or Buy Order on the stock market. Does not represent\n * a Market Order since those are just executed immediately\n */\nimport { OrderTypes } from \"./data/OrderTypes\";\nimport { PositionTypes } from \"./data/PositionTypes\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class Order {\n readonly pos: PositionTypes;\n readonly price: number;\n shares: number;\n readonly stockSymbol: string;\n readonly type: OrderTypes;\n\n constructor(\n stockSymbol = \"\",\n shares = 0,\n price = 0,\n typ: OrderTypes = OrderTypes.LimitBuy,\n pos: PositionTypes = PositionTypes.Long,\n ) {\n // Validate arguments\n let invalidArgs = false;\n if (typeof shares !== \"number\" || typeof price !== \"number\") {\n invalidArgs = true;\n }\n if (isNaN(shares) || isNaN(price)) {\n invalidArgs = true;\n }\n if (typeof stockSymbol !== \"string\") {\n invalidArgs = true;\n }\n if (invalidArgs) {\n throw new Error(`Invalid constructor parameters for Order`);\n }\n\n this.stockSymbol = stockSymbol;\n this.shares = shares;\n this.price = price;\n this.type = typ;\n this.pos = pos;\n }\n\n /** Serialize the Order to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Order\", this);\n }\n\n /** Initializes a Order from a JSON save state */\n static fromJSON(value: IReviverValue): Order {\n return Generic_fromJSON(Order, value.data);\n }\n}\n\nReviver.constructors.Order = Order;\n","/**\n * Determines if the number is a power of 2\n * @param n The number to check.\n */\nexport function isPowerOfTwo(n: number): boolean {\n if (isNaN(n)) {\n return false;\n }\n\n if (n === 0) {\n return false;\n }\n\n // Disabling the bitwise rule because it's honestly the most efficient way to check for this.\n // tslint:disable-next-line:no-bitwise\n return (n & (n - 1)) === 0;\n}\n","import { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Fragment } from \"./Fragment\";\nimport { ActiveFragment } from \"./ActiveFragment\";\nimport { FragmentType } from \"./FragmentType\";\nimport { BaseGift } from \"./BaseGift\";\nimport { Factions } from \"../Faction/Factions\";\nimport { CalculateEffect } from \"./formulas/effect\";\nimport { StaneksGiftEvents } from \"./StaneksGiftEvents\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { CONSTANTS } from \"../Constants\";\nimport { StanekConstants } from \"./data/Constants\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Player } from \"@player\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { defaultMultipliers, mergeMultipliers, Multipliers, scaleMultipliers } from \"../PersonObjects/Multipliers\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\n\nexport class StaneksGift extends BaseGift {\n storedCycles = 0;\n constructor() {\n super();\n }\n\n baseSize(): number {\n return StanekConstants.BaseSize + BitNodeMultipliers.StaneksGiftExtraSize + Player.sourceFileLvl(13);\n }\n\n width(): number {\n return Math.max(2, Math.min(Math.floor(this.baseSize() / 2 + 1), StanekConstants.MaxSize));\n }\n height(): number {\n return Math.max(3, Math.min(Math.floor(this.baseSize() / 2 + 0.6), StanekConstants.MaxSize));\n }\n\n charge(af: ActiveFragment, threads: number): void {\n if (threads > af.highestCharge) {\n af.numCharge = (af.highestCharge * af.numCharge) / threads + 1;\n af.highestCharge = threads;\n } else {\n af.numCharge += threads / af.highestCharge;\n }\n\n const cotmg = Factions[FactionNames.ChurchOfTheMachineGod];\n cotmg.playerReputation += (Player.mults.faction_rep * (Math.pow(threads, 0.95) * (cotmg.favor + 100))) / 1000;\n }\n\n inBonus(): boolean {\n return (this.storedCycles * CONSTANTS._idleSpeed) / 1000 > 1;\n }\n\n process(numCycles = 1): void {\n if (!Player.hasAugmentation(AugmentationNames.StaneksGift1)) return;\n this.storedCycles += numCycles;\n this.storedCycles -= 10;\n this.storedCycles = Math.max(0, this.storedCycles);\n this.updateMults();\n StaneksGiftEvents.emit();\n }\n\n effect(fragment: ActiveFragment): number {\n // Find all the neighboring cells\n const cells = fragment.neighbors();\n // find the neighboring active fragments.\n const maybeFragments = cells.map((n) => this.fragmentAt(n[0], n[1]));\n\n // Filter out undefined with typescript \"Type guard\". Whatever\n let neighbors = maybeFragments.filter((v: ActiveFragment | undefined): v is ActiveFragment => !!v);\n\n neighbors = neighbors.filter((fragment) => fragment.fragment().type === FragmentType.Booster);\n let boost = 1;\n\n neighbors = neighbors.filter((v, i, s) => s.indexOf(v) === i);\n for (const neighboor of neighbors) {\n boost *= neighboor.fragment().power;\n }\n return CalculateEffect(fragment.highestCharge, fragment.numCharge, fragment.fragment().power, boost);\n }\n\n canPlace(rootX: number, rootY: number, rotation: number, fragment: Fragment): boolean {\n if (rootX < 0 || rootY < 0) return false;\n if (rootX + fragment.width(rotation) > this.width()) return false;\n if (rootY + fragment.height(rotation) > this.height()) return false;\n if (this.count(fragment) >= fragment.limit) return false;\n const newFrag = new ActiveFragment({ x: rootX, y: rootY, rotation: rotation, fragment: fragment });\n for (const aFrag of this.fragments) {\n if (aFrag.collide(newFrag)) return false;\n }\n return true;\n }\n\n place(rootX: number, rootY: number, rotation: number, fragment: Fragment): boolean {\n if (!this.canPlace(rootX, rootY, rotation, fragment)) return false;\n this.fragments.push(new ActiveFragment({ x: rootX, y: rootY, rotation: rotation, fragment: fragment }));\n return true;\n }\n\n findFragment(rootX: number, rootY: number): ActiveFragment | undefined {\n return this.fragments.find((f) => f.x === rootX && f.y === rootY);\n }\n\n count(fragment: Fragment): number {\n let amt = 0;\n for (const aFrag of this.fragments) {\n if (aFrag.fragment().id === fragment.id) amt++;\n }\n return amt;\n }\n\n delete(rootX: number, rootY: number): boolean {\n for (let i = 0; i < this.fragments.length; i++) {\n if (this.fragments[i].x === rootX && this.fragments[i].y === rootY) {\n this.fragments.splice(i, 1);\n return true;\n }\n }\n\n return false;\n }\n\n clear(): void {\n this.fragments = [];\n }\n\n clearCharge(): void {\n this.fragments.forEach((f) => {\n f.highestCharge = 0;\n f.numCharge = 0;\n });\n }\n\n calculateMults(): Multipliers {\n const mults = defaultMultipliers();\n for (const aFrag of this.fragments) {\n const fragment = aFrag.fragment();\n\n const power = this.effect(aFrag);\n switch (fragment.type) {\n case FragmentType.HackingChance:\n mults.hacking_chance *= power;\n break;\n case FragmentType.HackingSpeed:\n mults.hacking_speed *= power;\n break;\n case FragmentType.HackingMoney:\n mults.hacking_money *= power;\n break;\n case FragmentType.HackingGrow:\n mults.hacking_grow *= power;\n break;\n case FragmentType.Hacking:\n mults.hacking *= power;\n mults.hacking_exp *= power;\n break;\n case FragmentType.Strength:\n mults.strength *= power;\n mults.strength_exp *= power;\n break;\n case FragmentType.Defense:\n mults.defense *= power;\n mults.defense_exp *= power;\n break;\n case FragmentType.Dexterity:\n mults.dexterity *= power;\n mults.dexterity_exp *= power;\n break;\n case FragmentType.Agility:\n mults.agility *= power;\n mults.agility_exp *= power;\n break;\n case FragmentType.Charisma:\n mults.charisma *= power;\n mults.charisma_exp *= power;\n break;\n case FragmentType.HacknetMoney:\n mults.hacknet_node_money *= power;\n break;\n case FragmentType.HacknetCost:\n mults.hacknet_node_purchase_cost /= power;\n mults.hacknet_node_ram_cost /= power;\n mults.hacknet_node_core_cost /= power;\n mults.hacknet_node_level_cost /= power;\n break;\n case FragmentType.Rep:\n mults.company_rep *= power;\n mults.faction_rep *= power;\n break;\n case FragmentType.WorkMoney:\n mults.work_money *= power;\n break;\n case FragmentType.Crime:\n mults.crime_success *= power;\n mults.crime_money *= power;\n break;\n case FragmentType.Bladeburner:\n mults.bladeburner_max_stamina *= power;\n mults.bladeburner_stamina_gain *= power;\n mults.bladeburner_analysis *= power;\n mults.bladeburner_success_chance *= power;\n break;\n }\n }\n return mults;\n }\n\n updateMults(): void {\n // applyEntropy also reapplies all augmentations and source files\n // This wraps up the reset nicely\n Player.applyEntropy(Player.entropy);\n const mults = this.calculateMults();\n Player.mults = mergeMultipliers(Player.mults, mults);\n Player.updateSkillLevels();\n const zoeAmt = Player.sleeves.reduce((n, sleeve) => n + (sleeve.hasAugmentation(AugmentationNames.ZOE) ? 1 : 0), 0);\n if (zoeAmt === 0) return;\n // Less powerful for each copy.\n const scaling = 3 / (zoeAmt + 2);\n const sleeveMults = scaleMultipliers(mults, scaling);\n for (const sleeve of Player.sleeves) {\n if (!sleeve.hasAugmentation(AugmentationNames.ZOE)) continue;\n sleeve.resetMultipliers();\n //reapplying augmentation's multiplier\n for (let i = 0; i < sleeve.augmentations.length; ++i) {\n const aug = StaticAugmentations[sleeve.augmentations[i].name];\n sleeve.applyAugmentation(aug);\n }\n //applying stanek multiplier\n sleeve.mults = mergeMultipliers(sleeve.mults, sleeveMults);\n sleeve.updateSkillLevels();\n }\n }\n\n prestigeAugmentation(): void {\n this.clearCharge();\n }\n\n prestigeSourceFile(): void {\n this.clear();\n this.storedCycles = 0;\n }\n\n /** Serialize Staneks Gift to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"StaneksGift\", this);\n }\n\n /** Initializes Staneks Gift from a JSON save state */\n static fromJSON(value: IReviverValue): StaneksGift {\n return Generic_fromJSON(StaneksGift, value.data);\n }\n}\n\nReviver.constructors.StaneksGift = StaneksGift;\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { Sleeve } from \"./Sleeve\";\n\nimport { Player } from \"@player\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { StaticAugmentations } from \"../../Augmentation/StaticAugmentations\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { mergeMultipliers, Multipliers } from \"../Multipliers\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { getFactionAugmentationsFiltered } from \"../../Faction/FactionHelpers\";\n\n/** Updates this object's multipliers for the given augmentation */\nexport function applyAugmentation(this: Sleeve, aug: Augmentation): void {\n this.mults = mergeMultipliers(this.mults, aug.mults);\n}\n\nexport function findPurchasableAugs(this: Sleeve): Augmentation[] {\n // You can only purchase Augmentations that are actually available from\n // your factions. I.e. you must be in a faction that has the Augmentation\n // and you must also have enough rep in that faction in order to purchase it.\n\n const ownedAugNames = this.augmentations.map((e) => e.name);\n const availableAugs: Augmentation[] = [];\n\n // Helper function that helps filter out augs that are already owned\n // and augs that aren't allowed for sleeves\n function isAvailableForSleeve(aug: Augmentation): boolean {\n if (ownedAugNames.includes(aug.name)) return false;\n if (availableAugs.includes(aug)) return false;\n if (aug.isSpecial) return false;\n\n type MultKey = keyof Multipliers;\n const validMults: MultKey[] = [\n \"hacking\",\n \"strength\",\n \"defense\",\n \"dexterity\",\n \"agility\",\n \"charisma\",\n \"hacking_exp\",\n \"strength_exp\",\n \"defense_exp\",\n \"dexterity_exp\",\n \"agility_exp\",\n \"charisma_exp\",\n \"company_rep\",\n \"faction_rep\",\n \"crime_money\",\n \"crime_success\",\n \"work_money\",\n ];\n for (const mult of validMults) {\n if (aug.mults[mult] !== 1) return true;\n }\n\n return false;\n }\n\n // If player is in a gang, then we return all augs that the player\n // has enough reputation for (since that gang offers all augs)\n if (Player.gang) {\n const fac = Player.getGangFaction();\n const gangAugs = getFactionAugmentationsFiltered(fac);\n\n for (const augName of gangAugs) {\n const aug = StaticAugmentations[augName];\n if (!isAvailableForSleeve(aug)) continue;\n\n if (fac.playerReputation > aug.getCost().repCost) {\n availableAugs.push(aug);\n }\n }\n }\n\n for (const facName of Player.factions) {\n if (facName === FactionNames.Bladeburners) continue;\n if (facName === FactionNames.Netburners) continue;\n const fac = Factions[facName];\n if (!fac) continue;\n\n for (const augName of fac.augmentations) {\n const aug = StaticAugmentations[augName];\n if (!isAvailableForSleeve(aug)) continue;\n\n if (fac.playerReputation > aug.getCost().repCost) {\n availableAugs.push(aug);\n }\n }\n }\n\n // Add the stanek sleeve aug\n if (!ownedAugNames.includes(AugmentationNames.ZOE) && Player.factions.includes(FactionNames.ChurchOfTheMachineGod)) {\n const aug = StaticAugmentations[AugmentationNames.ZOE];\n availableAugs.push(aug);\n }\n\n return availableAugs;\n}\n","import { isScriptFilename } from \"../Script/isScriptFilename\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { isValidFilePath } from \"../Terminal/DirectoryHelpers\";\nimport { TextFile } from \"../TextFile\";\nimport {\n RFAMessage,\n FileData,\n FileContent,\n isFileServer,\n isFileLocation,\n FileLocation,\n isFileData,\n} from \"./MessageDefinitions\";\n\nimport libSource from \"!!raw-loader!../ScriptEditor/NetscriptDefinitions.d.ts\";\n\nfunction error(errorMsg: string, { id }: RFAMessage): RFAMessage {\n return new RFAMessage({ error: errorMsg, id: id });\n}\n\nexport const RFARequestHandler: Record<string, (message: RFAMessage) => void | RFAMessage> = {\n pushFile: function (msg: RFAMessage): RFAMessage {\n if (!isFileData(msg.params)) return error(\"Misses parameters\", msg);\n\n const fileData: FileData = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n if (isScriptFilename(fileData.filename)) server.writeToScriptFile(fileData.filename, fileData.content);\n // Assume it's a text file\n else server.writeToTextFile(fileData.filename, fileData.content);\n\n // If and only if the content is actually changed correctly, send back an OK.\n const savedCorrectly =\n server.getScript(fileData.filename)?.code === fileData.content ||\n server.textFiles.filter((t: TextFile) => t.filename == fileData.filename).at(0)?.text === fileData.content;\n\n if (!savedCorrectly) return error(\"File wasn't saved correctly\", msg);\n\n return new RFAMessage({ result: \"OK\", id: msg.id });\n },\n\n getFile: function (msg: RFAMessage): RFAMessage {\n if (!isFileLocation(msg.params)) return error(\"Message misses parameters\", msg);\n\n const fileData: FileLocation = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n if (isScriptFilename(fileData.filename)) {\n const scriptContent = server.getScript(fileData.filename);\n if (!scriptContent) return error(\"File doesn't exist\", msg);\n return new RFAMessage({ result: scriptContent.code, id: msg.id });\n } else {\n // Assume it's a text file\n const file = server.textFiles.filter((t: TextFile) => t.filename == fileData.filename).at(0);\n if (!file) return error(\"File doesn't exist\", msg);\n return new RFAMessage({ result: file.text, id: msg.id });\n }\n },\n\n deleteFile: function (msg: RFAMessage): RFAMessage {\n if (!isFileLocation(msg.params)) return error(\"Message misses parameters\", msg);\n const fileData: FileLocation = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n const fileExists = (): boolean =>\n !!server.getScript(fileData.filename) || server.textFiles.some((t: TextFile) => t.filename === fileData.filename);\n\n if (!fileExists()) return error(\"File doesn't exist\", msg);\n server.removeFile(fileData.filename);\n if (fileExists()) return error(\"Failed to delete the file\", msg);\n\n return new RFAMessage({ result: \"OK\", id: msg.id });\n },\n\n getFileNames: function (msg: RFAMessage): RFAMessage {\n if (!isFileServer(msg.params)) return error(\"Message misses parameters\", msg);\n\n const server = GetServer(msg.params.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n const fileNameList: string[] = [\n ...server.textFiles.map((txt): string => txt.filename),\n ...server.scripts.map((scr): string => scr.filename),\n ];\n\n return new RFAMessage({ result: fileNameList, id: msg.id });\n },\n\n getAllFiles: function (msg: RFAMessage): RFAMessage {\n if (!isFileServer(msg.params)) return error(\"Message misses parameters\", msg);\n\n const server = GetServer(msg.params.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n const fileList: FileContent[] = [\n ...server.textFiles.map((txt): FileContent => {\n return { filename: txt.filename, content: txt.text };\n }),\n ...server.scripts.map((scr): FileContent => {\n return { filename: scr.filename, content: scr.code };\n }),\n ];\n\n return new RFAMessage({ result: fileList, id: msg.id });\n },\n\n calculateRam: function (msg: RFAMessage): RFAMessage {\n if (!isFileLocation(msg.params)) return error(\"Message misses parameters\", msg);\n const fileData: FileLocation = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n if (!isScriptFilename(fileData.filename)) return error(\"Filename isn't a script filename\", msg);\n const script = server.getScript(fileData.filename);\n if (!script) return error(\"File doesn't exist\", msg);\n const ramUsage = script.ramUsage;\n\n return new RFAMessage({ result: ramUsage, id: msg.id });\n },\n\n getDefinitionFile: function (msg: RFAMessage): RFAMessage {\n return new RFAMessage({ result: libSource + \"\", id: msg.id });\n },\n};\n","import React from \"react\";\n\nimport { Typography, Table, TableBody, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { StatsRow } from \"../../../ui/React/StatsRow\";\nimport { characterOverviewStyles as useStyles } from \"../../../ui/React/CharacterOverview\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { MoneyRate } from \"../../../ui/React/MoneyRate\";\nimport { ReputationRate } from \"../../../ui/React/ReputationRate\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { isSleeveClassWork } from \"../Work/SleeveClassWork\";\nimport { isSleeveFactionWork } from \"../Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../Work/SleeveCompanyWork\";\nimport { isSleeveCrimeWork } from \"../Work/SleeveCrimeWork\";\nimport { BitNodeMultipliers } from \"../../../BitNode/BitNodeMultipliers\";\n\ninterface IProps {\n sleeve: Sleeve;\n}\n\nexport function StatsElement(props: IProps): React.ReactElement {\n const classes = useStyles();\n\n return (\n <Table sx={{ display: \"table\", mb: 1, width: \"100%\" }}>\n <TableBody>\n <StatsRow name=\"City\" color={Settings.theme.primary} data={{ content: props.sleeve.city }} />\n <StatsRow\n name=\"HP\"\n color={Settings.theme.hp}\n data={{\n content: `${numeralWrapper.formatHp(props.sleeve.hp.current)} / ${numeralWrapper.formatHp(\n props.sleeve.hp.max,\n )}`,\n }}\n />\n <StatsRow\n name=\"Hacking\"\n color={Settings.theme.hack}\n data={{ level: props.sleeve.skills.hacking, exp: props.sleeve.exp.hacking }}\n />\n <StatsRow\n name=\"Strength\"\n color={Settings.theme.combat}\n data={{ level: props.sleeve.skills.strength, exp: props.sleeve.exp.strength }}\n />\n <StatsRow\n name=\"Defense\"\n color={Settings.theme.combat}\n data={{ level: props.sleeve.skills.defense, exp: props.sleeve.exp.defense }}\n />\n <StatsRow\n name=\"Dexterity\"\n color={Settings.theme.combat}\n data={{ level: props.sleeve.skills.dexterity, exp: props.sleeve.exp.dexterity }}\n />\n <StatsRow\n name=\"Agility\"\n color={Settings.theme.combat}\n data={{ level: props.sleeve.skills.agility, exp: props.sleeve.exp.agility }}\n />\n <StatsRow\n name=\"Charisma\"\n color={Settings.theme.cha}\n data={{ level: props.sleeve.skills.charisma, exp: props.sleeve.exp.charisma }}\n />\n <TableRow>\n <TableCell classes={{ root: classes.cellNone }}>\n <br />\n </TableCell>\n </TableRow>\n <StatsRow\n name=\"Shock\"\n color={Settings.theme.primary}\n data={{ content: numeralWrapper.formatSleeveShock(100 - props.sleeve.shock) }}\n />\n <StatsRow\n name=\"Sync\"\n color={Settings.theme.primary}\n data={{ content: numeralWrapper.formatSleeveSynchro(props.sleeve.sync) }}\n />\n <StatsRow\n name=\"Memory\"\n color={Settings.theme.primary}\n data={{ content: numeralWrapper.formatSleeveMemory(props.sleeve.memory) }}\n />\n </TableBody>\n </Table>\n );\n}\n\nexport function EarningsElement(props: IProps): React.ReactElement {\n const classes = useStyles();\n\n let data: (string | JSX.Element)[][] = [];\n if (isSleeveCrimeWork(props.sleeve.currentWork)) {\n const gains = props.sleeve.currentWork.getExp(props.sleeve);\n data = [\n [`Money:`, <Money money={5 * gains.money} />],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * gains.hackExp)}`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * gains.strExp)}`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * gains.defExp)}`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * gains.dexExp)}`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * gains.agiExp)}`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * gains.chaExp)}`],\n ];\n }\n if (isSleeveClassWork(props.sleeve.currentWork)) {\n const rates = props.sleeve.currentWork.calculateRates(props.sleeve);\n data = [\n [`Money:`, <MoneyRate money={5 * rates.money} />],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`],\n ];\n }\n if (isSleeveFactionWork(props.sleeve.currentWork)) {\n const rates = props.sleeve.currentWork.getExpRates(props.sleeve);\n const repGain = props.sleeve.currentWork.getReputationRate(props.sleeve);\n data = [\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`],\n [`Reputation:`, <ReputationRate reputation={repGain} />],\n ];\n }\n\n if (isSleeveCompanyWork(props.sleeve.currentWork)) {\n const rates = props.sleeve.currentWork.getGainRates(props.sleeve);\n data = [\n [`Money:`, <MoneyRate money={5 * rates.money * BitNodeMultipliers.CompanyWorkMoney} />],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`],\n [`Reputation:`, <ReputationRate reputation={5 * rates.reputation} />],\n ];\n }\n\n return (\n <Table sx={{ display: \"table\", mb: 1, width: \"100%\", lineHeight: 0 }}>\n <TableBody>\n <TableRow>\n <TableCell classes={{ root: classes.cellNone }}>\n <Typography variant=\"h6\">Earnings {props.sleeve.storedCycles > 50 ? \"(overclock)\" : \"\"}</Typography>\n </TableCell>\n </TableRow>\n {data.map(([a, b]) => (\n <TableRow key={a.toString() + b.toString()}>\n <TableCell classes={{ root: classes.cellNone }}>\n <Typography>{a}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography>{b}</Typography>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n );\n}\n","/**\n * Creates a dropdown (select HTML element) with server hostnames as options\n *\n * Configurable to only contain certain types of servers\n */\nimport React from \"react\";\nimport { GetAllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Button from \"@mui/material/Button\";\n\n// TODO make this an enum when this gets converted to TypeScript\nexport const ServerType = {\n All: 0,\n Foreign: 1, // Hackable, non-owned servers\n Owned: 2, // Home Computer, Purchased Servers, and Hacknet Servers\n Purchased: 3, // Everything from Owned except home computer\n};\n\ninterface IProps {\n purchase: () => void;\n canPurchase: boolean;\n serverType: number;\n onChange: (event: SelectChangeEvent<string>) => void;\n value: string;\n}\n\nexport function ServerDropdown(props: IProps): React.ReactElement {\n /**\n * Checks if the server should be shown in the dropdown menu, based on the\n * 'serverType' property\n */\n function isValidServer(s: BaseServer): boolean {\n const purchased = s instanceof Server && s.purchasedByPlayer;\n const type = props.serverType;\n switch (type) {\n case ServerType.All:\n return true;\n case ServerType.Foreign:\n return s.hostname !== \"home\" && !purchased;\n case ServerType.Owned:\n return purchased || s instanceof HacknetServer || s.hostname === \"home\";\n case ServerType.Purchased:\n return purchased || s instanceof HacknetServer;\n default:\n console.warn(`Invalid ServerType specified for ServerDropdown component: ${type}`);\n return false;\n }\n }\n\n const servers = [];\n for (const server of GetAllServers().sort((a, b) => a.hostname.localeCompare(b.hostname))) {\n if (isValidServer(server)) {\n servers.push(\n <MenuItem key={server.hostname} value={server.hostname}>\n {server.hostname}\n </MenuItem>,\n );\n }\n }\n\n return (\n <Select\n startAdornment={\n <Button onClick={props.purchase} disabled={!props.canPurchase}>\n Buy\n </Button>\n }\n sx={{ mx: 1 }}\n value={props.value}\n onChange={props.onChange}\n >\n {servers}\n </Select>\n );\n}\n","import * as React from \"react\";\n\nimport { Player } from \"@player\";\nimport { Money } from \"../ui/React/Money\";\nimport { win, reachedLimit } from \"./Game\";\nimport { Deck } from \"./CardDeck/Deck\";\nimport { Hand } from \"./CardDeck/Hand\";\nimport { InputAdornment } from \"@mui/material\";\nimport { ReactCard } from \"./CardDeck/ReactCard\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\n\nconst MAX_BET = 100e6;\nexport const DECK_COUNT = 5; // 5-deck multideck\n\nenum Result {\n Pending = \"\",\n PlayerWon = \"You won!\",\n PlayerWonByBlackjack = \"You Won! Blackjack!\",\n DealerWon = \"You lost!\",\n Tie = \"Push! (Tie)\",\n}\n\ntype State = {\n playerHand: Hand;\n dealerHand: Hand;\n bet: number;\n betInput: string;\n gameInProgress: boolean;\n result: Result;\n gains: number; // Track gains only for this session\n wagerInvalid: boolean;\n wagerInvalidHelperText: string;\n};\n\nexport class Blackjack extends React.Component<Record<string, never>, State> {\n deck: Deck;\n\n constructor() {\n super({});\n\n this.deck = new Deck(DECK_COUNT);\n\n const initialBet = 1e6;\n\n this.state = {\n playerHand: new Hand([]),\n dealerHand: new Hand([]),\n bet: initialBet,\n betInput: String(initialBet),\n gameInProgress: false,\n result: Result.Pending,\n gains: 0,\n wagerInvalid: false,\n wagerInvalidHelperText: \"\",\n };\n }\n\n canStartGame = (): boolean => {\n const { bet } = this.state;\n\n return Player.canAfford(bet);\n };\n\n startGame = (): void => {\n if (!this.canStartGame() || reachedLimit()) {\n return;\n }\n\n // Take money from player right away so that players don't just \"leave\" to avoid the loss (I mean they could\n // always reload without saving but w.e) TODO: Save/Restore the RNG state to limit the value of save-scumming.\n win(-this.state.bet);\n\n const playerHand = new Hand([this.deck.safeDrawCard(), this.deck.safeDrawCard()]);\n const dealerHand = new Hand([this.deck.safeDrawCard(), this.deck.safeDrawCard()]);\n\n this.setState({\n playerHand,\n dealerHand,\n gameInProgress: true,\n result: Result.Pending,\n });\n\n // If the player is dealt a blackjack and the dealer is not, then the player\n // immediately wins\n if (this.getTrueHandValue(playerHand) === 21) {\n if (this.getTrueHandValue(dealerHand) === 21) {\n this.finishGame(Result.Tie);\n } else {\n this.finishGame(Result.PlayerWonByBlackjack);\n }\n } else if (this.getTrueHandValue(dealerHand) === 21) {\n // Check if dealer won by blackjack. We know at this point that the player does not also have blackjack.\n this.finishGame(Result.DealerWon);\n }\n };\n\n // Returns an array of numbers representing all possible values of the given Hand. The reason it needs to be\n // an array is because an Ace can count as both 1 and 11.\n getHandValue = (hand: Hand): number[] => {\n let result: number[] = [0];\n\n for (let i = 0; i < hand.cards.length; ++i) {\n const value = hand.cards[i].value;\n if (value >= 10) {\n result = result.map((x) => x + 10);\n } else if (value === 1) {\n result = result.flatMap((x) => [x + 1, x + 11]);\n } else {\n result = result.map((x) => x + value);\n }\n }\n\n return result;\n };\n\n // Returns the single hand value used for determine things like victory and whether or not\n // the dealer has to hit. Essentially this uses the biggest value that's 21 or under. If no such value exists,\n // then it means the hand is busted and we can just return whatever\n getTrueHandValue = (hand: Hand): number => {\n const handValues = this.getHandValue(hand);\n const valuesUnder21 = handValues.filter((x) => x <= 21);\n\n if (valuesUnder21.length > 0) {\n valuesUnder21.sort((a, b) => a - b);\n return valuesUnder21[valuesUnder21.length - 1];\n } else {\n // Just return the first value. It doesn't really matter anyways since hand is busted.\n return handValues[0];\n }\n };\n\n // Returns all hand values that are 21 or under. If no values are 21 or under, then the first value is returned.\n getHandDisplayValues = (hand: Hand): number[] => {\n const handValues = this.getHandValue(hand);\n if (this.isHandBusted(hand)) {\n // Hand is busted so just return the 1st value, doesn't really matter\n return [...new Set([handValues[0]])];\n } else {\n return [...new Set(handValues.filter((x) => x <= 21))];\n }\n };\n\n isHandBusted = (hand: Hand): boolean => {\n return this.getTrueHandValue(hand) > 21;\n };\n\n playerHit = (event: React.MouseEvent): void => {\n if (!event.isTrusted) {\n return;\n }\n\n const newHand = this.state.playerHand.addCards(this.deck.safeDrawCard());\n\n this.setState({\n playerHand: newHand,\n });\n\n // Check if player busted, and finish the game if so\n if (this.isHandBusted(newHand)) {\n this.finishGame(Result.DealerWon);\n }\n };\n\n playerStay = (event: React.MouseEvent): void => {\n if (!event.isTrusted) {\n return;\n }\n\n // Determine if Dealer needs to hit. A dealer must hit if they have 16 or lower.\n // If the dealer has a Soft 17 (Ace + 6), then they stay.\n let newDealerHand = this.state.dealerHand;\n while (true) {\n // The dealer's \"true\" hand value is the 2nd one if its 21 or less (the 2nd value is always guaranteed\n // to be equal or larger). Otherwise its the 1st.\n const dealerHandValue = this.getTrueHandValue(newDealerHand);\n\n if (dealerHandValue <= 16) {\n newDealerHand = newDealerHand.addCards(this.deck.safeDrawCard());\n } else {\n break;\n }\n }\n\n this.setState({\n dealerHand: newDealerHand,\n });\n\n // If dealer has busted, then player wins\n if (this.isHandBusted(newDealerHand)) {\n this.finishGame(Result.PlayerWon);\n } else {\n const dealerHandValue = this.getTrueHandValue(newDealerHand);\n const playerHandValue = this.getTrueHandValue(this.state.playerHand);\n\n // We expect nobody to have busted. If someone busted, there is an error\n // in our game logic\n if (dealerHandValue > 21 || playerHandValue > 21) {\n throw new Error(\"Someone busted when not expected to\");\n }\n\n if (playerHandValue > dealerHandValue) {\n this.finishGame(Result.PlayerWon);\n } else if (playerHandValue < dealerHandValue) {\n this.finishGame(Result.DealerWon);\n } else {\n this.finishGame(Result.Tie);\n }\n }\n };\n\n finishGame = (result: Result): void => {\n const gains =\n result === Result.DealerWon\n ? 0 // We took away the bet at the start, don't need to take more\n : result === Result.Tie\n ? this.state.bet // We took away the bet at the start, give it back\n : result === Result.PlayerWon\n ? 2 * this.state.bet // Give back their bet plus their winnings\n : result === Result.PlayerWonByBlackjack\n ? 2.5 * this.state.bet // Blackjack pays out 1.5x bet!\n : (() => {\n throw new Error(`Unexpected result: ${result}`);\n })(); // This can't happen, right?\n win(gains);\n this.setState({\n gameInProgress: false,\n result,\n gains: this.state.gains + gains - this.state.bet, // Not updated upfront - only tracks the final outcome\n });\n };\n\n wagerOnChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n const betInput = event.target.value;\n const wager = Math.round(parseFloat(betInput));\n if (isNaN(wager)) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Not a valid number\",\n });\n } else if (wager <= 0) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Must bet a positive amount\",\n });\n } else if (wager > MAX_BET) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Exceeds max bet\",\n });\n } else if (!Player.canAfford(wager)) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Not enough money\",\n });\n } else {\n // Valid wager\n this.setState({\n bet: wager,\n betInput,\n wagerInvalid: false,\n wagerInvalidHelperText: \"\",\n result: Result.Pending, // Reset previous game status to clear the win/lose text UI\n });\n }\n };\n\n // Start game button\n startOnClick = (event: React.MouseEvent): void => {\n // Protect against scripting...although maybe this would be fun to automate\n if (!event.isTrusted) {\n return;\n }\n\n if (!this.state.wagerInvalid) {\n this.startGame();\n }\n };\n\n render(): React.ReactNode {\n const { betInput, playerHand, dealerHand, gameInProgress, result, wagerInvalid, wagerInvalidHelperText, gains } =\n this.state;\n\n // Get the player totals to display.\n const playerHandValues = this.getHandDisplayValues(playerHand);\n const dealerHandValues = this.getHandDisplayValues(dealerHand);\n\n return (\n <>\n {/* Wager input */}\n <Box>\n <TextField\n value={betInput}\n label={\n <>\n {\"Wager (Max: \"}\n <Money money={MAX_BET} />\n {\")\"}\n </>\n }\n disabled={gameInProgress}\n onChange={this.wagerOnChange}\n error={wagerInvalid}\n helperText={wagerInvalid ? wagerInvalidHelperText : \"\"}\n type=\"number\"\n style={{\n width: \"200px\",\n }}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Typography>$</Typography>\n </InputAdornment>\n ),\n }}\n />\n\n <Typography>\n {\"Total earnings this session: \"}\n <Money money={gains} />\n </Typography>\n </Box>\n\n {/* Buttons */}\n {!gameInProgress ? (\n <Button onClick={this.startOnClick} disabled={wagerInvalid || !this.canStartGame()}>\n Start\n </Button>\n ) : (\n <>\n <Button onClick={this.playerHit}>Hit</Button>\n <Button color=\"secondary\" onClick={this.playerStay}>\n Stay\n </Button>\n </>\n )}\n\n {/* Main game part. Displays both if the game is in progress OR if there's a result so you can see\n * the cards that led to that result. */}\n {(gameInProgress || result !== Result.Pending) && (\n <>\n <Box display=\"flex\">\n <Paper elevation={2}>\n <Typography>Player</Typography>\n {playerHand.cards.map((card, i) => (\n <ReactCard card={card} key={i} />\n ))}\n\n <Typography>\n Count:{\" \"}\n {playerHandValues\n .map<React.ReactNode>((value, i) => <span key={i}>{value}</span>)\n .reduce((prev, curr) => [prev, \" or \", curr])}\n </Typography>\n </Paper>\n </Box>\n\n <br />\n\n <Box display=\"flex\">\n <Paper elevation={2}>\n <Typography>Dealer</Typography>\n {dealerHand.cards.map((card, i) => (\n // Hide every card except the first while game is in progress\n <ReactCard card={card} hidden={gameInProgress && i !== 0} key={i} />\n ))}\n\n {!gameInProgress && (\n <>\n <Typography>\n Count:{\" \"}\n {dealerHandValues\n .map<React.ReactNode>((value, i) => <span key={i}>{value}</span>)\n .reduce((prev, curr) => [prev, \" or \", curr])}\n </Typography>\n </>\n )}\n </Paper>\n </Box>\n </>\n )}\n\n {/* Results from previous round */}\n {result !== Result.Pending && (\n <Typography>\n {result} \n {result === Result.PlayerWon && <Money money={this.state.bet} />}\n {result === Result.PlayerWonByBlackjack && <Money money={this.state.bet * 1.5} />}\n {result === Result.DealerWon && <Money money={-this.state.bet} />}\n </Typography>\n )}\n </>\n );\n }\n}\n","import React, { FC } from \"react\";\nimport { Card, Suit } from \"./Card\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Paper from \"@mui/material/Paper\";\n\ntype Props = {\n card: Card;\n hidden?: boolean;\n};\n\nconst useStyles = makeStyles(() =>\n createStyles({\n card: {\n padding: \"10px\",\n border: \"solid 1px #808080\",\n backgroundColor: \"white\",\n display: \"inline-block\",\n borderRadius: \"10px\",\n fontSize: \"18.5px\",\n textAlign: \"center\",\n margin: \"3px\",\n fontWeight: \"bold\",\n },\n red: {\n color: \"red\",\n },\n\n black: {\n color: \"black\",\n },\n value: {\n fontSize: \"20px\",\n fontFamily: \"sans-serif\",\n },\n }),\n);\n\nexport const ReactCard: FC<Props> = ({ card, hidden }) => {\n const classes = useStyles();\n let suit: React.ReactNode;\n switch (card.suit) {\n case Suit.Clubs:\n suit = <span>♣</span>;\n break;\n case Suit.Diamonds:\n suit = <span>♦</span>;\n break;\n case Suit.Hearts:\n suit = <span>♥</span>;\n break;\n case Suit.Spades:\n suit = <span>♠</span>;\n break;\n default:\n throw new Error(`MissingCaseException: ${card.suit}`);\n }\n return (\n <Paper className={`${classes.card} ${card.isRedSuit() ? classes.red : classes.black}`}>\n <>\n <span className={classes.value}>{hidden ? \" - \" : card.formatValue()}</span>\n <span>{hidden ? \" - \" : suit}</span>\n </>\n </Paper>\n );\n};\n","import { Milestone } from \"./Milestone\";\nimport { Player } from \"@player\";\nimport { Factions } from \"../Faction/Factions\";\nimport { Faction } from \"../Faction/Faction\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Server } from \"../Server/Server\";\n\nfunction allFactionAugs(f: Faction): boolean {\n const factionAugs = f.augmentations.slice().filter((aug) => aug !== \"NeuroFlux Governor\");\n for (const factionAug of factionAugs) {\n if (\n !Player.augmentations.some((aug) => {\n return aug.name == factionAug;\n })\n )\n return false;\n }\n return true;\n}\n\nexport const Milestones: Milestone[] = [\n {\n title: \"Gain root access on CSEC\",\n fulfilled: (): boolean => {\n const server = GetServer(\"CSEC\");\n if (!server || !server.hasOwnProperty(\"hasAdminRights\")) return false;\n return server instanceof Server && server.hasAdminRights;\n },\n },\n {\n title: \"Install the backdoor on CSEC\",\n fulfilled: (): boolean => {\n const server = GetServer(\"CSEC\");\n if (!server || !server.hasOwnProperty(\"backdoorInstalled\")) return false;\n return server instanceof Server && server.backdoorInstalled;\n },\n },\n {\n title: \"Join the faction hinted at in csec-test.msg\",\n fulfilled: (): boolean => {\n return Player.factions.includes(FactionNames.CyberSec);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.CyberSec}`,\n fulfilled: (): boolean => {\n return allFactionAugs(Factions[FactionNames.CyberSec]);\n },\n },\n {\n title: \"Join the faction hinted at in nitesec-test.msg\",\n fulfilled: (): boolean => {\n return Player.factions.includes(FactionNames.NiteSec);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.NiteSec}`,\n fulfilled: (): boolean => {\n return allFactionAugs(Factions[FactionNames.NiteSec]);\n },\n },\n {\n title: \"Join the faction hinted at in j3.msg\",\n fulfilled: (): boolean => {\n return Player.factions.includes(FactionNames.TheBlackHand);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.TheBlackHand}`,\n fulfilled: (): boolean => {\n return allFactionAugs(Factions[FactionNames.TheBlackHand]);\n },\n },\n {\n title: \"Join the faction hinted at in 19dfj3l1nd.msg\",\n fulfilled: (): boolean => {\n return Player.factions.includes(FactionNames.BitRunners);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.BitRunners}`,\n fulfilled: (): boolean => {\n return allFactionAugs(Factions[FactionNames.BitRunners]);\n },\n },\n {\n title: \"Complete fl1ght.exe\",\n fulfilled: (): boolean => {\n // technically wrong but whatever\n return Player.factions.includes(FactionNames.Daedalus);\n },\n },\n {\n title: `Install the special Augmentation from ${FactionNames.Daedalus}`,\n fulfilled: (): boolean => {\n return Player.augmentations.some((aug) => aug.name == \"The Red Pill\");\n },\n },\n {\n title: \"Install the final backdoor and free yourself.\",\n fulfilled: (): boolean => {\n return false;\n },\n },\n];\n","import { StockSymbols } from \"./StockSymbols\";\n\nexport const TickerHeaderFormatData = {\n longestName: 0,\n longestSymbol: 0,\n};\n\nfor (const [key, symbol] of Object.entries(StockSymbols)) {\n TickerHeaderFormatData.longestName = Math.max(key.length, TickerHeaderFormatData.longestName);\n TickerHeaderFormatData.longestSymbol = Math.max(symbol.length, TickerHeaderFormatData.longestSymbol);\n}\n","import React from \"react\";\n\nimport { Box, Typography } from \"@mui/material\";\n\nimport { Achievement } from \"./Achievements\";\nimport { Settings } from \"../Settings/Settings\";\nimport { AchievementIcon } from \"./AchievementIcon\";\n\ninterface IProps {\n achievement: Achievement;\n unlockedOn?: number;\n cssFiltersUnlocked: string;\n cssFiltersLocked: string;\n}\n\nexport function AchievementEntry({\n achievement,\n unlockedOn,\n cssFiltersUnlocked,\n cssFiltersLocked,\n}: IProps): JSX.Element {\n if (!achievement) return <></>;\n const isUnlocked = !!unlockedOn;\n\n const mainColor = isUnlocked ? Settings.theme.primary : Settings.theme.secondarylight;\n\n let achievedOn = \"\";\n if (unlockedOn) {\n achievedOn = new Date(unlockedOn).toLocaleString();\n }\n\n return (\n <Box\n sx={{\n border: `1px solid ${Settings.theme.well}`,\n mb: 2,\n }}\n >\n <Box\n sx={{\n display: \"flex\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n }}\n >\n <AchievementIcon\n achievement={achievement}\n unlocked={isUnlocked}\n size=\"72px\"\n colorFilters={isUnlocked ? cssFiltersUnlocked : cssFiltersLocked}\n />\n <Box\n sx={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n px: 1,\n }}\n >\n <Typography variant=\"h6\" sx={{ color: mainColor }}>\n {achievement.Name}\n </Typography>\n <Typography variant=\"body2\" sx={{ maxWidth: \"500px\", color: mainColor }}>\n {achievement.Description}\n </Typography>\n {isUnlocked && (\n <Typography variant=\"caption\" sx={{ fontSize: \"12px\", color: Settings.theme.primarydark }}>\n Acquired on {achievedOn}\n </Typography>\n )}\n </Box>\n </Box>\n </Box>\n );\n}\n","// @ts-nocheck\n/* tslint:disable */\n/* eslint-disable */\n\n/*\n Taken from:\n https://codepen.io/sosuke/pen/Pjoqqp\n --------------------------------------------------------\n This utility transform an hex color into css filter rules.\n Useful to change color of a black image to match a given color\n*/\n\nclass Color {\n constructor(r, g, b) {\n this.set(r, g, b);\n }\n\n toString() {\n return `rgb(${Math.round(this.r)}, ${Math.round(this.g)}, ${Math.round(this.b)})`;\n }\n\n set(r, g, b) {\n this.r = this.clamp(r);\n this.g = this.clamp(g);\n this.b = this.clamp(b);\n }\n\n hueRotate(angle = 0) {\n angle = (angle / 180) * Math.PI;\n const sin = Math.sin(angle);\n const cos = Math.cos(angle);\n\n this.multiply([\n 0.213 + cos * 0.787 - sin * 0.213,\n 0.715 - cos * 0.715 - sin * 0.715,\n 0.072 - cos * 0.072 + sin * 0.928,\n 0.213 - cos * 0.213 + sin * 0.143,\n 0.715 + cos * 0.285 + sin * 0.14,\n 0.072 - cos * 0.072 - sin * 0.283,\n 0.213 - cos * 0.213 - sin * 0.787,\n 0.715 - cos * 0.715 + sin * 0.715,\n 0.072 + cos * 0.928 + sin * 0.072,\n ]);\n }\n\n grayscale(value = 1) {\n this.multiply([\n 0.2126 + 0.7874 * (1 - value),\n 0.7152 - 0.7152 * (1 - value),\n 0.0722 - 0.0722 * (1 - value),\n 0.2126 - 0.2126 * (1 - value),\n 0.7152 + 0.2848 * (1 - value),\n 0.0722 - 0.0722 * (1 - value),\n 0.2126 - 0.2126 * (1 - value),\n 0.7152 - 0.7152 * (1 - value),\n 0.0722 + 0.9278 * (1 - value),\n ]);\n }\n\n sepia(value = 1) {\n this.multiply([\n 0.393 + 0.607 * (1 - value),\n 0.769 - 0.769 * (1 - value),\n 0.189 - 0.189 * (1 - value),\n 0.349 - 0.349 * (1 - value),\n 0.686 + 0.314 * (1 - value),\n 0.168 - 0.168 * (1 - value),\n 0.272 - 0.272 * (1 - value),\n 0.534 - 0.534 * (1 - value),\n 0.131 + 0.869 * (1 - value),\n ]);\n }\n\n saturate(value = 1) {\n this.multiply([\n 0.213 + 0.787 * value,\n 0.715 - 0.715 * value,\n 0.072 - 0.072 * value,\n 0.213 - 0.213 * value,\n 0.715 + 0.285 * value,\n 0.072 - 0.072 * value,\n 0.213 - 0.213 * value,\n 0.715 - 0.715 * value,\n 0.072 + 0.928 * value,\n ]);\n }\n\n multiply(matrix) {\n const newR = this.clamp(this.r * matrix[0] + this.g * matrix[1] + this.b * matrix[2]);\n const newG = this.clamp(this.r * matrix[3] + this.g * matrix[4] + this.b * matrix[5]);\n const newB = this.clamp(this.r * matrix[6] + this.g * matrix[7] + this.b * matrix[8]);\n this.r = newR;\n this.g = newG;\n this.b = newB;\n }\n\n brightness(value = 1) {\n this.linear(value);\n }\n contrast(value = 1) {\n this.linear(value, -(0.5 * value) + 0.5);\n }\n\n linear(slope = 1, intercept = 0) {\n this.r = this.clamp(this.r * slope + intercept * 255);\n this.g = this.clamp(this.g * slope + intercept * 255);\n this.b = this.clamp(this.b * slope + intercept * 255);\n }\n\n invert(value = 1) {\n this.r = this.clamp((value + (this.r / 255) * (1 - 2 * value)) * 255);\n this.g = this.clamp((value + (this.g / 255) * (1 - 2 * value)) * 255);\n this.b = this.clamp((value + (this.b / 255) * (1 - 2 * value)) * 255);\n }\n\n hsl() {\n // Code taken from https://stackoverflow.com/a/9493060/2688027, licensed under CC BY-SA.\n const r = this.r / 255;\n const g = this.g / 255;\n const b = this.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h,\n s,\n l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0;\n } else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n\n case g:\n h = (b - r) / d + 2;\n break;\n\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n\n return {\n h: h * 100,\n s: s * 100,\n l: l * 100,\n };\n }\n\n clamp(value) {\n if (value > 255) {\n value = 255;\n } else if (value < 0) {\n value = 0;\n }\n return value;\n }\n}\n\nexport class Solver {\n constructor(target) {\n this.target = target;\n this.targetHSL = target.hsl();\n this.reusedColor = new Color(0, 0, 0);\n }\n\n solve() {\n const result = this.solveNarrow(this.solveWide());\n return {\n values: result.values,\n loss: result.loss,\n filter: this.css(result.values),\n };\n }\n\n solveWide() {\n const A = 5;\n const c = 15;\n const a = [60, 180, 18000, 600, 1.2, 1.2];\n\n let best = { loss: Infinity };\n for (let i = 0; best.loss > 25 && i < 3; i++) {\n const initial = [50, 20, 3750, 50, 100, 100];\n const result = this.spsa(A, a, c, initial, 1000);\n if (result.loss < best.loss) {\n best = result;\n }\n }\n return best;\n }\n\n solveNarrow(wide) {\n const A = wide.loss;\n const c = 2;\n const A1 = A + 1;\n const a = [0.25 * A1, 0.25 * A1, A1, 0.25 * A1, 0.2 * A1, 0.2 * A1];\n return this.spsa(A, a, c, wide.values, 500);\n }\n\n spsa(A, a, c, values, iters) {\n const alpha = 1;\n const gamma = 0.16666666666666666;\n\n let best = null;\n let bestLoss = Infinity;\n const deltas = new Array(6);\n const highArgs = new Array(6);\n const lowArgs = new Array(6);\n\n for (let k = 0; k < iters; k++) {\n const ck = c / Math.pow(k + 1, gamma);\n for (let i = 0; i < 6; i++) {\n deltas[i] = Math.random() > 0.5 ? 1 : -1;\n highArgs[i] = values[i] + ck * deltas[i];\n lowArgs[i] = values[i] - ck * deltas[i];\n }\n\n const lossDiff = this.loss(highArgs) - this.loss(lowArgs);\n for (let i = 0; i < 6; i++) {\n const g = (lossDiff / (2 * ck)) * deltas[i];\n const ak = a[i] / Math.pow(A + k + 1, alpha);\n values[i] = fix(values[i] - ak * g, i);\n }\n\n const loss = this.loss(values);\n if (loss < bestLoss) {\n best = values.slice(0);\n bestLoss = loss;\n }\n }\n return { values: best, loss: bestLoss };\n\n function fix(value, idx) {\n let max = 100;\n if (idx === 2 /* saturate */) {\n max = 7500;\n } else if (idx === 4 /* brightness */ || idx === 5 /* contrast */) {\n max = 200;\n }\n\n if (idx === 3 /* hue-rotate */) {\n if (value > max) {\n value %= max;\n } else if (value < 0) {\n value = max + (value % max);\n }\n } else if (value < 0) {\n value = 0;\n } else if (value > max) {\n value = max;\n }\n return value;\n }\n }\n\n loss(filters) {\n // Argument is array of percentages.\n const color = this.reusedColor;\n color.set(0, 0, 0);\n\n color.invert(filters[0] / 100);\n color.sepia(filters[1] / 100);\n color.saturate(filters[2] / 100);\n color.hueRotate(filters[3] * 3.6);\n color.brightness(filters[4] / 100);\n color.contrast(filters[5] / 100);\n\n const colorHSL = color.hsl();\n return (\n Math.abs(color.r - this.target.r) +\n Math.abs(color.g - this.target.g) +\n Math.abs(color.b - this.target.b) +\n Math.abs(colorHSL.h - this.targetHSL.h) +\n Math.abs(colorHSL.s - this.targetHSL.s) +\n Math.abs(colorHSL.l - this.targetHSL.l)\n );\n }\n\n css(filters) {\n function fmt(idx, multiplier = 1) {\n return Math.round(filters[idx] * multiplier);\n }\n return `invert(${fmt(0)}%) sepia(${fmt(1)}%) saturate(${fmt(2)}%) hue-rotate(${fmt(3, 3.6)}deg) brightness(${fmt(\n 4,\n )}%) contrast(${fmt(5)}%)`;\n }\n}\n\nfunction hexToRgb(hex): number[] {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, (m, r, g, b) => {\n return r + r + g + g + b + b;\n });\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : null;\n}\n\nexport function getFiltersFromHex(hex): string {\n const rgb = hexToRgb(hex);\n if (!rgb) return \"\";\n\n const [r, g, b] = rgb;\n const color = new Color(r, g, b);\n const solver = new Solver(color);\n return solver.solve().filter;\n}\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Default\",\n description: \"Default game theme, most supported\",\n credit: \"hydroflame\",\n screenshot: img1,\n colors: {\n primarylight: \"#0f0\",\n primary: \"#0c0\",\n primarydark: \"#090\",\n successlight: \"#0f0\",\n success: \"#0c0\",\n successdark: \"#090\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Default-lite\",\n description: \"Less eye-straining default theme\",\n credit: \"NmuGmu\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/925263801564151888\",\n screenshot: img1,\n colors: {\n primarylight: \"#28CF28\",\n primary: \"#21A821\",\n primarydark: \"#177317\",\n successlight: \"#1CFF1C\",\n success: \"#16CA16\",\n successdark: \"#0D910D\",\n errorlight: \"#FF3B3B\",\n error: \"#C32D2D\",\n errordark: \"#8E2121\",\n secondarylight: \"#B3B3B3\",\n secondary: \"#838383\",\n secondarydark: \"#676767\",\n warninglight: \"#FFFF3A\",\n warning: \"#C3C32A\",\n warningdark: \"#8C8C1E\",\n infolight: \"#64CBFF\",\n info: \"#3399CC\",\n infodark: \"#246D91\",\n welllight: \"#404040\",\n well: \"#1C1C1C\",\n white: \"#C3C3C3\",\n black: \"#0A0B0B\",\n hp: \"#C62E2E\",\n money: \"#D6BB27\",\n hack: \"#ADFF2F\",\n combat: \"#E8EDCD\",\n cha: \"#8B5FAF\",\n int: \"#537CC8\",\n rep: \"#E8EDCD\",\n disabled: \"#5AB5A5\",\n backgroundprimary: \"#0C0D0E\",\n backgroundsecondary: \"#121415\",\n button: \"#252829\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Monokai'ish\",\n description: \"Monokai'ish\",\n credit: \"eltea\",\n screenshot: img1,\n colors: {\n primarylight: \"#FFF\",\n primary: \"#F8F8F2\",\n primarydark: \"#FAFAEB\",\n successlight: \"#ADE146\",\n success: \"#A6E22E\",\n successdark: \"#98E104\",\n errorlight: \"#FF69A0\",\n error: \"#F92672\",\n errordark: \"#D10F56\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E1D992\",\n warning: \"#E6DB74\",\n warningdark: \"#EDDD54\",\n infolight: \"#92E1F1\",\n info: \"#66D9EF\",\n infodark: \"#31CDED\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#F92672\",\n money: \"#E6DB74\",\n hack: \"#A6E22E\",\n combat: \"#75715E\",\n cha: \"#AE81FF\",\n int: \"#66D9EF\",\n rep: \"#E69F66\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#272822\",\n backgroundsecondary: \"#1B1C18\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Warmer\",\n credit: \"hexnaught\",\n description: \"Warmer, softer theme\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/921999581020028938\",\n screenshot: img1,\n colors: {\n primarylight: \"#EA9062\",\n primary: \"#DD7B4A\",\n primarydark: \"#D3591C\",\n successlight: \"#6ACF6A\",\n success: \"#43BF43\",\n successdark: \"#3E913E\",\n errorlight: \"#C15757\",\n error: \"#B34141\",\n errordark: \"#752525\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E6E69D\",\n warning: \"#DADA56\",\n warningdark: \"#A1A106\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#AD84CF\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#76C6B7\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dark+\",\n credit: \"LoganMD\",\n description: \"VSCode Dark+\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/921999975867617310\",\n screenshot: img1,\n colors: {\n primarylight: \"#E0E0BC\",\n primary: \"#CCCCAE\",\n primarydark: \"#B8B89C\",\n successlight: \"#00F000\",\n success: \"#00D200\",\n successdark: \"#00B400\",\n errorlight: \"#F00000\",\n error: \"#C80000\",\n errordark: \"#A00000\",\n secondarylight: \"#B4AEAE\",\n secondary: \"#969090\",\n secondarydark: \"#787272\",\n warninglight: \"#F0F000\",\n warning: \"#C8C800\",\n warningdark: \"#A0A000\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#1E1E1E\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#1E1E1E\",\n backgroundsecondary: \"#252525\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Mayukai Dark\",\n description: \"Mayukai Dark-esque\",\n credit: \"Festive Noire\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922037502334889994\",\n screenshot: img1,\n colors: {\n primarylight: \"#DDDFC5\",\n primary: \"#CDCFB6\",\n primarydark: \"#9D9F8C\",\n successlight: \"#00EF00\",\n success: \"#00A500\",\n successdark: \"#007A00\",\n errorlight: \"#F92672\",\n error: \"#CA1C5C\",\n errordark: \"#90274A\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#D3D300\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#00010A\",\n white: \"#fff\",\n black: \"#020509\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#8CCF27\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#080C11\",\n backgroundsecondary: \"#03080F\",\n button: \"#00010A\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Purple\",\n credit: \"zer0ney\",\n description: \"Essentially all defaults except for purple replacing the main colors\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922091815849570395\",\n screenshot: img1,\n colors: {\n primarylight: \"#BA55D3\",\n primary: \"#9370DB\",\n primarydark: \"#8A2BE2\",\n successlight: \"#BA55D3\",\n success: \"#9370DB\",\n successdark: \"#8A2BE2\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Smooth Green\",\n description: \"A nice green theme that doesn't hurt your eyes.\",\n credit: \"Swidt\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922243957986033725\",\n screenshot: img1,\n colors: {\n primarylight: \"#E0E0BC\",\n primary: \"#B0D9A3\",\n primarydark: \"#B8B89C\",\n successlight: \"#00F000\",\n success: \"#6BC16B\",\n successdark: \"#00B400\",\n errorlight: \"#F00000\",\n error: \"#3D713D\",\n errordark: \"#A00000\",\n secondarylight: \"#B4AEAE\",\n secondary: \"#8FAF85\",\n secondarydark: \"#787272\",\n warninglight: \"#F0F000\",\n warning: \"#38F100\",\n warningdark: \"#A0A000\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#2F3C2B\",\n white: \"#fff\",\n black: \"#1E1E1E\",\n hp: \"#dd3434\",\n money: \"#4AA52E\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#35A135\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#1E1E1E\",\n backgroundsecondary: \"#252525\",\n button: \"#2F3C2B\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dracula\",\n description: \"Dracula Look-alike\",\n credit: \"H3draut3r\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922296307836678144\",\n screenshot: img1,\n colors: {\n primarylight: \"#7082B8\",\n primary: \"#F8F8F2\",\n primarydark: \"#FF79C6\",\n successlight: \"#0f0\",\n success: \"#0c0\",\n successdark: \"#090\",\n errorlight: \"#FD4545\",\n error: \"#FF2D2D\",\n errordark: \"#C62424\",\n secondarylight: \"#AAA\",\n secondary: \"#8BE9FD\",\n secondarydark: \"#666\",\n warninglight: \"#FFC281\",\n warning: \"#FFB86C\",\n warningdark: \"#E6A055\",\n infolight: \"#A0A0FF\",\n info: \"#7070FF\",\n infodark: \"#4040FF\",\n welllight: \"#44475A\",\n well: \"#363948\",\n white: \"#fff\",\n black: \"#282A36\",\n hp: \"#D34448\",\n money: \"#50FA7B\",\n hack: \"#F1FA8C\",\n combat: \"#BD93F9\",\n cha: \"#FF79C6\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#282A36\",\n backgroundsecondary: \"#21222C\",\n button: \"#21222C\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dark Blue\",\n description: \"Very dark with a blue/purplelly primary\",\n credit: \"Saynt_Garmo\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/923084732718264340\",\n screenshot: img1,\n colors: {\n primarylight: \"#023DDE\",\n primary: \"#4A41C8\",\n primarydark: \"#005299\",\n successlight: \"#00FF00\",\n success: \"#D1DAD1\",\n successdark: \"#BFCABF\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#040505\",\n white: \"#fff\",\n black: \"#000000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#091419\",\n backgroundsecondary: \"#000000\",\n button: \"#000000\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Discord-like\",\n description: \"Discord inspired theme\",\n credit: \"Thermite\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924305252017143818\",\n screenshot: img1,\n colors: {\n primarylight: \"#7389DC\",\n primary: \"#7389DC\",\n primarydark: \"#5964F1\",\n successlight: \"#00CC00\",\n success: \"#20DF20\",\n successdark: \"#0CB80C\",\n errorlight: \"#EA5558\",\n error: \"#EC4145\",\n errordark: \"#E82528\",\n secondarylight: \"#C3C3C3\",\n secondary: \"#9C9C9C\",\n secondarydark: \"#4E4E4E\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#1C4FB3\",\n welllight: \"#999999\",\n well: \"#35383C\",\n white: \"#FFFFFF\",\n black: \"#202225\",\n hp: \"#FF5656\",\n money: \"#43FF43\",\n hack: \"#FFAB3D\",\n combat: \"#8A90FD\",\n cha: \"#FF51D9\",\n int: \"#6495ed\",\n rep: \"#FFFF30\",\n disabled: \"#474B51\",\n backgroundprimary: \"#2F3136\",\n backgroundsecondary: \"#35393E\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"One Dark\",\n description: \"Dark with a greenish tint\",\n credit: \"Dexalt142\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924650660694208512\",\n screenshot: img1,\n colors: {\n primarylight: \"#98C379\",\n primary: \"#98C379\",\n primarydark: \"#98C379\",\n successlight: \"#98C379\",\n success: \"#98C379\",\n successdark: \"#98C379\",\n errorlight: \"#E06C75\",\n error: \"#BE5046\",\n errordark: \"#BE5046\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E5C07B\",\n warning: \"#E5C07B\",\n warningdark: \"#D19A66\",\n infolight: \"#61AFEF\",\n info: \"#61AFEF\",\n infodark: \"#61AFEF\",\n welllight: \"#4B5263\",\n well: \"#282C34\",\n white: \"#ABB2BF\",\n black: \"#282C34\",\n hp: \"#E06C75\",\n money: \"#E5C07B\",\n hack: \"#98C379\",\n combat: \"#ABB2BF\",\n cha: \"#C678DD\",\n int: \"#61AFEF\",\n rep: \"#ABB2BF\",\n disabled: \"#56B6C2\",\n backgroundprimary: \"#282C34\",\n backgroundsecondary: \"#21252B\",\n button: \"#4B5263\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Muted Gold & Blue\",\n description: \"Muted gold with blue accents.\",\n credit: \"Sloth\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924672660758208563\",\n screenshot: img1,\n colors: {\n primarylight: \"#E3B54A\",\n primary: \"#CAA243\",\n primarydark: \"#7E6937\",\n successlight: \"#82FF82\",\n success: \"#6FDA6F\",\n successdark: \"#64C364\",\n errorlight: \"#FD5555\",\n error: \"#D84A4A\",\n errordark: \"#AC3939\",\n secondarylight: \"#D8D0B8\",\n secondary: \"#B1AA95\",\n secondarydark: \"#736E5E\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#111111\",\n white: \"#fff\",\n black: \"#070300\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#0A0A0E\",\n backgroundsecondary: \"#0E0E10\",\n button: \"#222222\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Light\",\n description: \"Cobbled Together Light Theme\",\n credit: \"matt\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/926114005456658432\",\n screenshot: img1,\n colors: {\n primarylight: \"#535353\",\n primary: \"#1A1A1A\",\n primarydark: \"#0d0d0d\",\n successlight: \"#63c439\",\n success: \"#428226\",\n successdark: \"#2E5A1B\",\n errorlight: \"#df7051\",\n error: \"#C94824\",\n errordark: \"#91341B\",\n secondarylight: \"#b3b3b3\",\n secondary: \"#9B9B9B\",\n secondarydark: \"#7A7979\",\n warninglight: \"#e8d464\",\n warning: \"#C6AD20\",\n warningdark: \"#9F8A16\",\n infolight: \"#6299cf\",\n info: \"#3778B7\",\n infodark: \"#30689C\",\n welllight: \"#f9f9f9\",\n well: \"#eaeaea\",\n white: \"#F7F7F7\",\n black: \"#F7F7F7\",\n hp: \"#BF5C41\",\n money: \"#E1B121\",\n hack: \"#47BC38\",\n combat: \"#656262\",\n cha: \"#A568AC\",\n int: \"#889BCF\",\n rep: \"#656262\",\n disabled: \"#70B4BF\",\n backgroundprimary: \"#F7F7F7\",\n backgroundsecondary: \"#f9f9f9\",\n button: \"#eaeaea\",\n },\n};\n","export default \"dist/images/83b2443ab7e7d346766c8f6bc5afc7a7.png\";","export default \"dist/images/6caf35202b10b52e1fc2743f674c33e8.png\";","export default \"dist/images/cb88977ea837bccb9cceb727adc78302.png\";","export default \"dist/images/4e0e750f2f09de58219773edd46cbbf5.png\";","export default \"dist/images/e97de4daa946331c7e99dee9c05d629c.png\";","export default \"dist/images/9f96a5084f4e5f1a6c0041b41b34d62d.png\";","export default \"dist/images/85a7b2896acb62be76f3ea7100fe9012.png\";","export default \"dist/images/5aa87b7de67a77c914088783b055e1cf.png\";","export default \"dist/images/c7164b072d62c91c27c6d607b5207e7b.png\";","export default \"dist/images/66f4b86d86164fc117bd6d648e4eaa6f.png\";","export default \"dist/images/a1110d6c8d16a14c4570411750248399.png\";","export default \"dist/images/447bc31e61f55e7eff875be3e9a81f1a.png\";","export default \"dist/images/297df8c0e47764ea113951318b2acf55.png\";","export default \"dist/images/e66b0c327f97d08e4253f52234d659eb.png\";","/** Augmentation-related methods for the Player class (PlayerObject) */\nimport { PlayerObject } from \"./PlayerObject\";\nimport { calculateEntropy } from \"../Grafting/EntropyAccumulation\";\n\nexport function applyEntropy(this: PlayerObject, stacks = 1): void {\n // Re-apply all multipliers\n this.reapplyAllAugmentations();\n this.reapplyAllSourceFiles();\n\n this.mults = calculateEntropy(stacks);\n}\n","import { CONSTANTS } from \"../../Constants\";\n\nimport { Player } from \"@player\";\nimport { Multipliers } from \"../Multipliers\";\n\nexport const calculateEntropy = (stacks = 1): Multipliers => {\n const nerf = CONSTANTS.EntropyEffect ** stacks;\n return {\n hacking_chance: Player.mults.hacking_chance * nerf,\n hacking_speed: Player.mults.hacking_speed * nerf,\n hacking_money: Player.mults.hacking_money * nerf,\n hacking_grow: Player.mults.hacking_grow * nerf,\n\n hacking: Player.mults.hacking * nerf,\n strength: Player.mults.strength * nerf,\n defense: Player.mults.defense * nerf,\n dexterity: Player.mults.dexterity * nerf,\n agility: Player.mults.agility * nerf,\n charisma: Player.mults.charisma * nerf,\n\n hacking_exp: Player.mults.hacking_exp * nerf,\n strength_exp: Player.mults.strength_exp * nerf,\n defense_exp: Player.mults.defense_exp * nerf,\n dexterity_exp: Player.mults.dexterity_exp * nerf,\n agility_exp: Player.mults.agility_exp * nerf,\n charisma_exp: Player.mults.charisma_exp * nerf,\n\n company_rep: Player.mults.company_rep * nerf,\n faction_rep: Player.mults.faction_rep * nerf,\n\n crime_money: Player.mults.crime_money * nerf,\n crime_success: Player.mults.crime_success * nerf,\n\n hacknet_node_money: Player.mults.hacknet_node_money * nerf,\n hacknet_node_purchase_cost: Player.mults.hacknet_node_purchase_cost * nerf,\n hacknet_node_ram_cost: Player.mults.hacknet_node_ram_cost * nerf,\n hacknet_node_core_cost: Player.mults.hacknet_node_core_cost * nerf,\n hacknet_node_level_cost: Player.mults.hacknet_node_level_cost * nerf,\n\n work_money: Player.mults.work_money * nerf,\n\n bladeburner_max_stamina: Player.mults.bladeburner_max_stamina * nerf,\n bladeburner_stamina_gain: Player.mults.bladeburner_stamina_gain * nerf,\n bladeburner_analysis: Player.mults.bladeburner_analysis * nerf,\n bladeburner_success_chance: Player.mults.bladeburner_success_chance * nerf,\n };\n};\n","import { BladeburnerConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\n\ninterface IChangePopulationByCountParams {\n /** How much the estimate should change by. */\n estChange: number;\n /** Add offset to estimate (offset by percentage). */\n estOffset: number;\n}\n\ninterface IChangePopulationByPercentageParams {\n nonZero: boolean;\n changeEstEqually: boolean;\n}\n\nexport class City {\n /** Name of the city. */\n name = \"\";\n\n /** Population of the city. */\n pop = 0;\n\n /** Population estimation of the city. */\n popEst = 0;\n\n /** Number of communities in the city. */\n comms = 0;\n\n /** Chaos level of the city. */\n chaos = 0;\n\n constructor(name: string = BladeburnerConstants.CityNames[2]) {\n this.name = name;\n\n // Synthoid population and estimate\n this.pop = getRandomInt(BladeburnerConstants.PopulationThreshold, 1.5 * BladeburnerConstants.PopulationThreshold);\n this.popEst = this.pop * (Math.random() + 0.5);\n\n // Number of Synthoid communities population and estimate\n this.comms = getRandomInt(5, 150);\n this.chaos = 0;\n }\n\n /** p is the percentage, not the multiplier (e.g. pass in p = 5 for 5%) */\n changeChaosByPercentage(p: number): void {\n if (isNaN(p)) {\n throw new Error(\"NaN passed into City.chaosChaosByPercentage()\");\n }\n if (p === 0) {\n return;\n }\n this.chaos += this.chaos * (p / 100);\n if (this.chaos < 0) {\n this.chaos = 0;\n }\n }\n\n improvePopulationEstimateByCount(n: number): void {\n if (isNaN(n)) {\n throw new Error(\"NaN passed into City.improvePopulationEstimateByCount()\");\n }\n if (this.popEst < this.pop) {\n this.popEst += n;\n if (this.popEst > this.pop) {\n this.popEst = this.pop;\n }\n } else if (this.popEst > this.pop) {\n this.popEst -= n;\n if (this.popEst < this.pop) {\n this.popEst = this.pop;\n }\n }\n }\n\n /** p is the percentage, not the multiplier (e.g. pass in p = 5 for 5%) */\n improvePopulationEstimateByPercentage(p: number, skillMult = 1): void {\n p = p * skillMult;\n if (isNaN(p)) {\n throw new Error(\"NaN passed into City.improvePopulationEstimateByPercentage()\");\n }\n if (this.popEst < this.pop) {\n ++this.popEst; // In case estimate is 0\n this.popEst *= 1 + p / 100;\n if (this.popEst > this.pop) {\n this.popEst = this.pop;\n }\n } else if (this.popEst > this.pop) {\n this.popEst *= 1 - p / 100;\n if (this.popEst < this.pop) {\n this.popEst = this.pop;\n }\n }\n }\n\n changePopulationByCount(n: number, params: IChangePopulationByCountParams = { estChange: 0, estOffset: 0 }): void {\n if (isNaN(n)) {\n throw new Error(\"NaN passed into City.changePopulationByCount()\");\n }\n this.pop += n;\n if (params.estChange && !isNaN(params.estChange)) {\n this.popEst += params.estChange;\n }\n if (params.estOffset) {\n this.popEst = addOffset(this.popEst, params.estOffset);\n }\n this.popEst = Math.max(this.popEst, 0);\n }\n\n /**\n * @p is the percentage, not the multiplier. e.g. pass in p = 5 for 5%\n * @params options:\n * changeEstEqually(bool) - Change the population estimate by an equal amount\n * nonZero (bool) - Set to true to ensure that population always changes by at least 1\n */\n changePopulationByPercentage(\n p: number,\n params: IChangePopulationByPercentageParams = {\n nonZero: false,\n changeEstEqually: false,\n },\n ): number {\n if (isNaN(p)) {\n throw new Error(\"NaN passed into City.changePopulationByPercentage()\");\n }\n if (p === 0) {\n return 0;\n }\n let change = Math.round(this.pop * (p / 100));\n\n // Population always changes by at least 1\n if (params.nonZero && change === 0) {\n p > 0 ? (change = 1) : (change = -1);\n }\n\n this.pop += change;\n if (params.changeEstEqually) {\n this.popEst += change;\n if (this.popEst < 0) {\n this.popEst = 0;\n }\n }\n return change;\n }\n\n changeChaosByCount(n: number): void {\n if (isNaN(n)) {\n throw new Error(\"NaN passed into City.changeChaosByCount()\");\n }\n if (n === 0) {\n return;\n }\n this.chaos += n;\n if (this.chaos < 0) {\n this.chaos = 0;\n }\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"City\", this);\n }\n\n /** Initializes a City object from a JSON save state. */\n static fromJSON(value: IReviverValue): City {\n return Generic_fromJSON(City, value.data);\n }\n}\n\nReviver.constructors.City = City;\n","/** Returns a MM/DD HH:MM timestamp for the current time */\nexport function getTimestamp(): string {\n const d: Date = new Date();\n // A negative slice value takes from the end of the string rather than the beginning.\n const stringWidth = -2;\n const formattedHours: string = `0${d.getHours()}`.slice(stringWidth);\n const formattedMinutes: string = `0${d.getMinutes()}`.slice(stringWidth);\n const formattedSeconds: string = `0${d.getSeconds()}`.slice(stringWidth);\n\n return `${d.getMonth() + 1}/${d.getDate()} ${formattedHours}:${formattedMinutes}:${formattedSeconds}`;\n}\n","export function CalculateShareMult(power: number): number {\n const x = 1 + Math.log(power) / 25;\n if (isNaN(x) || !isFinite(x)) return 1;\n return x;\n}\n","import { CorporationState } from \"./CorporationState\";\nimport { CorporationUnlockUpgrade, CorporationUnlockUpgrades } from \"./data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade, CorporationUpgrades } from \"./data/CorporationUpgrades\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { Industry } from \"./Industry\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { showLiterature } from \"../Literature/LiteratureHelpers\";\nimport { LiteratureNames } from \"../Literature/data/LiteratureNames\";\nimport { Player } from \"@player\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { isString } from \"../utils/helpers/isString\";\n\ninterface IParams {\n name?: string;\n}\n\nexport class Corporation {\n name = \"The Corporation\";\n\n //A division/business sector is represented by the object:\n divisions: Industry[] = [];\n\n //Financial stats\n funds = 150e9;\n revenue = 0;\n expenses = 0;\n fundingRound = 0;\n public = false; //Publicly traded\n totalShares = CorporationConstants.INITIALSHARES; // Total existing shares\n numShares = CorporationConstants.INITIALSHARES; // Total shares owned by player\n shareSalesUntilPriceUpdate = CorporationConstants.SHARESPERPRICEUPDATE;\n shareSaleCooldown = 0; // Game cycles until player can sell shares again\n issueNewSharesCooldown = 0; // Game cycles until player can issue shares again\n dividendRate = 0;\n dividendTax = 1 - BitNodeMultipliers.CorporationSoftcap + 0.15;\n issuedShares = 0;\n sharePrice = 0;\n storedCycles = 0;\n\n unlockUpgrades: number[];\n upgrades: number[];\n upgradeMultipliers: number[];\n\n cycleValuation = 0;\n valuationsList = [0];\n valuation = 0;\n\n state = new CorporationState();\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"The Corporation\";\n const numUnlockUpgrades = Object.keys(CorporationUnlockUpgrades).length;\n const numUpgrades = Object.keys(CorporationUpgrades).length;\n this.unlockUpgrades = Array(numUnlockUpgrades).fill(0);\n this.upgrades = Array(numUpgrades).fill(0);\n this.upgradeMultipliers = Array(numUpgrades).fill(1);\n }\n\n addFunds(amt: number): void {\n if (!isFinite(amt)) {\n console.error(\"Trying to add invalid amount of funds. Report to a developer.\");\n return;\n }\n this.funds = this.funds + amt;\n }\n\n getState(): string {\n return this.state.getState();\n }\n\n storeCycles(numCycles = 1): void {\n this.storedCycles += numCycles;\n }\n\n process(): void {\n if (this.storedCycles >= CorporationConstants.CyclesPerIndustryStateCycle) {\n const state = this.getState();\n const marketCycles = 1;\n const gameCycles = marketCycles * CorporationConstants.CyclesPerIndustryStateCycle;\n this.storedCycles -= gameCycles;\n\n this.divisions.forEach((ind) => {\n ind.resetImports(state);\n });\n\n this.divisions.forEach((ind) => {\n ind.process(marketCycles, state, this);\n });\n\n // Process cooldowns\n if (this.shareSaleCooldown > 0) {\n this.shareSaleCooldown -= gameCycles;\n }\n if (this.issueNewSharesCooldown > 0) {\n this.issueNewSharesCooldown -= gameCycles;\n }\n\n //At the start of a new cycle, calculate profits from previous cycle\n if (state === \"START\") {\n this.revenue = 0;\n this.expenses = 0;\n this.divisions.forEach((ind) => {\n if (ind.lastCycleRevenue === -Infinity || ind.lastCycleRevenue === Infinity) {\n return;\n }\n if (ind.lastCycleExpenses === -Infinity || ind.lastCycleExpenses === Infinity) {\n return;\n }\n this.revenue = this.revenue + ind.lastCycleRevenue;\n this.expenses = this.expenses + ind.lastCycleExpenses;\n });\n const profit = this.revenue - this.expenses;\n this.cycleValuation = this.determineCycleValuation();\n this.determineValuation();\n const cycleProfit = profit * (marketCycles * CorporationConstants.SecsPerMarketCycle);\n if (isNaN(this.funds) || this.funds === Infinity || this.funds === -Infinity) {\n dialogBoxCreate(\n \"There was an error calculating your Corporations funds and they got reset to 0. \" +\n \"This is a bug. Please report to game developer.\\n\\n\" +\n \"(Your funds have been set to $150b for the inconvenience)\",\n );\n this.funds = 150e9;\n }\n\n // Process dividends\n this.updateDividendTax();\n if (this.dividendRate > 0 && cycleProfit > 0) {\n // Validate input again, just to be safe\n if (\n isNaN(this.dividendRate) ||\n this.dividendRate < 0 ||\n this.dividendRate > CorporationConstants.DividendMaxRate\n ) {\n console.error(`Invalid Corporation dividend rate: ${this.dividendRate}`);\n } else {\n const totalDividends = this.dividendRate * cycleProfit;\n const retainedEarnings = cycleProfit - totalDividends;\n Player.gainMoney(this.getCycleDividends(), \"corporation\");\n this.addFunds(retainedEarnings);\n }\n } else {\n this.addFunds(cycleProfit);\n }\n\n this.updateSharePrice();\n }\n\n this.state.nextState();\n }\n }\n\n updateDividendTax(): void {\n this.dividendTax = 1 - BitNodeMultipliers.CorporationSoftcap + 0.15;\n if (this.unlockUpgrades[5] === 1) {\n this.dividendTax -= 0.05;\n }\n if (this.unlockUpgrades[6] === 1) {\n this.dividendTax -= 0.1;\n }\n }\n\n getCycleDividends(): number {\n const profit = this.revenue - this.expenses;\n const cycleProfit = profit * CorporationConstants.SecsPerMarketCycle;\n const totalDividends = this.dividendRate * cycleProfit;\n const dividendsPerShare = totalDividends / this.totalShares;\n const dividends = this.numShares * dividendsPerShare;\n return Math.pow(dividends, 1 - this.dividendTax);\n }\n\n determineCycleValuation(): number {\n let val,\n profit = this.revenue - this.expenses;\n if (this.public) {\n // Account for dividends\n if (this.dividendRate > 0) {\n profit *= 1 - this.dividendRate;\n }\n\n val = this.funds + profit * 85e3;\n val *= Math.pow(1.1, this.divisions.length);\n val = Math.max(val, 0);\n } else {\n val = 10e9 + Math.max(this.funds, 0) / 3; //Base valuation\n if (profit > 0) {\n val += profit * 315e3;\n }\n val *= Math.pow(1.1, this.divisions.length);\n val -= val % 1e6; //Round down to nearest millionth\n }\n return val * BitNodeMultipliers.CorporationValuation;\n }\n\n determineValuation(): void {\n this.valuationsList.push(this.cycleValuation); //Add current valuation to the list\n if (this.valuationsList.length > CorporationConstants.ValuationLength) this.valuationsList.shift();\n let val = this.valuationsList.reduce((a, b) => a + b); //Calculate valuations sum\n val /= CorporationConstants.ValuationLength; //Calculate the average\n this.valuation = val;\n }\n\n getTargetSharePrice(): number {\n // Note: totalShares - numShares is not the same as issuedShares because\n // issuedShares does not account for private investors\n return this.valuation / (2 * (this.totalShares - this.numShares) + 1);\n }\n\n updateSharePrice(): void {\n const targetPrice = this.getTargetSharePrice();\n if (this.sharePrice <= targetPrice) {\n this.sharePrice *= 1 + Math.random() * 0.01;\n } else {\n this.sharePrice *= 1 - Math.random() * 0.01;\n }\n if (this.sharePrice <= 0.01) {\n this.sharePrice = 0.01;\n }\n }\n\n immediatelyUpdateSharePrice(): void {\n this.sharePrice = this.getTargetSharePrice();\n }\n\n // Calculates how much money will be made and what the resulting stock price\n // will be when the player sells his/her shares\n // @return - [Player profit, final stock price, end shareSalesUntilPriceUpdate property]\n calculateShareSale(numShares: number): [number, number, number] {\n let sharesTracker = numShares;\n let sharesUntilUpdate = this.shareSalesUntilPriceUpdate;\n let sharePrice = this.sharePrice;\n let sharesSold = 0;\n let profit = 0;\n let targetPrice = this.getTargetSharePrice();\n\n const maxIterations = Math.ceil(numShares / CorporationConstants.SHARESPERPRICEUPDATE);\n if (isNaN(maxIterations) || maxIterations > 10e6) {\n console.error(\n `Something went wrong or unexpected when calculating share sale. Max iterations calculated to be ${maxIterations}`,\n );\n return [0, 0, 0];\n }\n\n for (let i = 0; i < maxIterations; ++i) {\n if (sharesTracker < sharesUntilUpdate) {\n profit += sharePrice * sharesTracker;\n sharesUntilUpdate -= sharesTracker;\n break;\n } else {\n profit += sharePrice * sharesUntilUpdate;\n sharesUntilUpdate = CorporationConstants.SHARESPERPRICEUPDATE;\n sharesTracker -= sharesUntilUpdate;\n sharesSold += sharesUntilUpdate;\n targetPrice = this.valuation / (2 * (this.totalShares + sharesSold - this.numShares));\n // Calculate what new share price would be\n if (sharePrice <= targetPrice) {\n sharePrice *= 1 + 0.5 * 0.01;\n } else {\n sharePrice *= 1 - 0.5 * 0.01;\n }\n }\n }\n\n return [profit, sharePrice, sharesUntilUpdate];\n }\n\n convertCooldownToString(cd: number): string {\n // The cooldown value is based on game cycles. Convert to a simple string\n const seconds = cd / 5;\n\n const SecondsPerMinute = 60;\n const SecondsPerHour = 3600;\n\n if (seconds > SecondsPerHour) {\n return `${Math.floor(seconds / SecondsPerHour)} hour(s)`;\n } else if (seconds > SecondsPerMinute) {\n return `${Math.floor(seconds / SecondsPerMinute)} minute(s)`;\n } else {\n return `${Math.floor(seconds)} second(s)`;\n }\n }\n\n //One time upgrades that unlock new features\n unlock(upgrade: CorporationUnlockUpgrade): void {\n const upgN = upgrade.index,\n price = upgrade.price;\n while (this.unlockUpgrades.length <= upgN) {\n this.unlockUpgrades.push(0);\n }\n if (this.funds < price) {\n dialogBoxCreate(\"You don't have enough funds to unlock this!\");\n return;\n }\n this.unlockUpgrades[upgN] = 1;\n this.funds = this.funds - price;\n\n // Apply effects for one-time upgrades\n this.updateDividendTax();\n }\n\n //Levelable upgrades\n upgrade(upgrade: CorporationUpgrade): void {\n const upgN = upgrade.index,\n basePrice = upgrade.basePrice,\n priceMult = upgrade.priceMult,\n upgradeAmt = upgrade.benefit; //Amount by which the upgrade multiplier gets increased (additive)\n while (this.upgrades.length <= upgN) {\n this.upgrades.push(0);\n }\n while (this.upgradeMultipliers.length <= upgN) {\n this.upgradeMultipliers.push(1);\n }\n const totalCost = basePrice * Math.pow(priceMult, this.upgrades[upgN]);\n if (this.funds < totalCost) {\n dialogBoxCreate(\"You don't have enough funds to purchase this!\");\n return;\n }\n ++this.upgrades[upgN];\n this.funds = this.funds - totalCost;\n\n //Increase upgrade multiplier\n this.upgradeMultipliers[upgN] = 1 + this.upgrades[upgN] * upgradeAmt;\n\n //If storage size is being updated, update values in Warehouse objects\n if (upgN === 1) {\n for (let i = 0; i < this.divisions.length; ++i) {\n const industry = this.divisions[i];\n for (const city of Object.keys(industry.warehouses)) {\n const warehouse = industry.warehouses[city];\n if (warehouse === 0) continue;\n if (industry.warehouses.hasOwnProperty(city) && warehouse) {\n warehouse.updateSize(this, industry);\n }\n }\n }\n }\n }\n\n getProductionMultiplier(): number {\n const mult = this.upgradeMultipliers[0];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getStorageMultiplier(): number {\n const mult = this.upgradeMultipliers[1];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getDreamSenseGain(): number {\n const gain = this.upgradeMultipliers[2] - 1;\n return gain <= 0 ? 0 : gain;\n }\n\n getAdvertisingMultiplier(): number {\n const mult = this.upgradeMultipliers[3];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeCreMultiplier(): number {\n const mult = this.upgradeMultipliers[4];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeChaMultiplier(): number {\n const mult = this.upgradeMultipliers[5];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeIntMultiplier(): number {\n const mult = this.upgradeMultipliers[6];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeEffMultiplier(): number {\n const mult = this.upgradeMultipliers[7];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getSalesMultiplier(): number {\n const mult = this.upgradeMultipliers[8];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getScientificResearchMultiplier(): number {\n const mult = this.upgradeMultipliers[9];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n // Adds the Corporation Handbook (Starter Guide) to the player's home computer.\n // This is a lit file that gives introductory info to the player\n // This occurs when the player clicks the \"Getting Started Guide\" button on the overview panel\n getStarterGuide(): void {\n // Check if player already has Corporation Handbook\n const homeComp = Player.getHomeComputer();\n let hasHandbook = false;\n const handbookFn = LiteratureNames.CorporationManagementHandbook;\n for (let i = 0; i < homeComp.messages.length; ++i) {\n if (isString(homeComp.messages[i]) && homeComp.messages[i] === handbookFn) {\n hasHandbook = true;\n break;\n }\n }\n\n if (!hasHandbook) {\n homeComp.messages.push(handbookFn);\n }\n showLiterature(handbookFn);\n return;\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Corporation\", this);\n }\n\n /** Initializes a Corporation object from a JSON save state. */\n static fromJSON(value: IReviverValue): Corporation {\n return Generic_fromJSON(Corporation, value.data);\n }\n}\n\nReviver.constructors.Corporation = Corporation;\n","import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\n// Array of all valid states\nconst AllCorporationStates: string[] = [\"START\", \"PURCHASE\", \"PRODUCTION\", \"SALE\", \"EXPORT\"];\n\nexport class CorporationState {\n // Number representing what state the Corporation is in. The number\n // is an index for the array that holds all Corporation States\n state = 0;\n\n // Get the name of the current state\n // NOTE: This does NOT return the number stored in the 'state' property,\n // which is just an index for the array of all possible Corporation States.\n getState(): string {\n return AllCorporationStates[this.state];\n }\n\n // Transition to the next state\n nextState(): void {\n if (this.state < 0 || this.state >= AllCorporationStates.length) {\n this.state = 0;\n }\n\n ++this.state;\n if (this.state >= AllCorporationStates.length) {\n this.state = 0;\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"CorporationState\", this);\n }\n\n // Initializes a CorporationState object from a JSON save state.\n static fromJSON(value: IReviverValue): CorporationState {\n return Generic_fromJSON(CorporationState, value.data);\n }\n}\n\nReviver.constructors.CorporationState = CorporationState;\n","import { CityName } from \"./../Locations/data/CityNames\";\nimport { Literature } from \"./Literature\";\nimport { LiteratureNames } from \"./data/LiteratureNames\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\n\nexport const Literatures: Record<string, Literature> = {};\n\n(function () {\n let title, fn, txt;\n title = \"The Beginner's Guide to Hacking\";\n fn = LiteratureNames.HackersStartingHandbook;\n txt =\n \"Some resources:<br><br>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/netscript/netscriptlearntoprogram.html' target='_blank' style='margin:4px'>Learn to Program</a><br><br>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html' target='_blank' style='margin:4px'>For Experienced JavaScript Developers: NetscriptJS</a><br><br>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/netscript.html' target='_blank' style='margin:4px'>Netscript Documentation</a><br><br>\" +\n \"When starting out, hacking is the most profitable way to earn money and progress. This \" +\n \"is a brief collection of tips/pointers on how to make the most out of your hacking scripts.<br><br>\" +\n \"-hack() and grow() both work by percentages. hack() steals a certain percentage of the \" +\n \"money on a server, and grow() increases the amount of money on a server by some percentage (multiplicatively)<br><br>\" +\n \"-Because hack() and grow() work by percentages, they are more effective if the target server has a high amount of money. \" +\n \"Therefore, you should try to increase the amount of money on a server (using grow()) to a certain amount before hacking it. Two \" +\n \"important Netscript functions for this are getServerMoneyAvailable() and getServerMaxMoney()<br><br>\" +\n \"-Keep security level low. Security level affects everything when hacking. Two important Netscript functions \" +\n \"for this are getServerSecurityLevel() and getServerMinSecurityLevel()<br><br>\" +\n \"-Purchase additional servers by visiting 'Alpha Enterprises' in the city. They are relatively cheap \" +\n \"and give you valuable RAM to run more scripts early in the game<br><br>\" +\n \"-Prioritize upgrading the RAM on your home computer. This can also be done at 'Alpha Enterprises'<br><br>\" +\n \"-Many low level servers have free RAM. You can use this RAM to run your scripts. Use the scp Terminal or \" +\n \"Netscript command to copy your scripts onto these servers and then run them.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Complete Handbook for Creating a Successful Corporation\";\n fn = LiteratureNames.CorporationManagementHandbook;\n txt =\n \"<u>Getting Started with Corporations</u><br>\" +\n \"To get started, visit the City Hall in Sector-12 in order to create a Corporation. This requires \" +\n \"$150b of your own money, but this $150b will get put into your Corporation's funds. \" +\n \"Your Corporation can have many different divisions, each in a different Industry. There are many different \" +\n \"types of Industries, each with different properties. To create your first division, click the \" +\n \"'Expand into new Industry' button at the top of the management UI. The Agriculture \" +\n \"and Software industries are recommended for your first division.<br><br>\" +\n \"The first thing you'll need to do is hire some employees. Employees can be assigned to five different positions. \" +\n \"Each position has a different effect on various aspects of your Corporation. It is recommended to have at least \" +\n \"one employee at each position.<br><br>\" +\n \"Each industry uses some combination of Materials in order to produce other Materials and/or create Products. \" +\n \"Specific information about this is displayed in each of your divisions' UI.<br><br>\" +\n \"Products are special, industry-specific objects. They are different than Materials because you \" +\n \"must manually choose to develop them, and you can choose to develop any number of Products. Developing \" +\n \"a Product takes time, but a Product typically generates significantly more revenue than any Material. \" +\n \"Not all industries allow you to create Products. To create a Product, look for a button \" +\n \"in the top-left panel of the division UI (e.g. For the Software Industry, the button says 'Develop Software').<br><br>\" +\n \"To get your supply chain system started, \" +\n \"purchase the Materials that your industry needs to produce other Materials/Products. This can be done \" +\n \"by clicking the 'Buy' button next to the corresponding Material(s). After you have the required Materials, \" +\n \"you will immediately start production. The amount of Materials/Products you produce is based on a variety of factors, \" +\n \"one of which is your employees and their productivity.<br><br>\" +\n \"Once you start producing Materials/Products, you can sell them in order to start earning revenue. This can be done \" +\n \"by clicking the 'Sell' button next to the corresponding Material or Product. The amount of Material/Product you sell is dependent \" +\n \"on a wide variety of different factors.<br><br>\" +\n \"These are the basics of getting your Corporation up and running! Now, you can start purchasing upgrades to improve \" +\n \"your bottom line. If you need money, consider looking for seed investors, who will give you money in exchange for stock shares. \" +\n \"Otherwise, once you feel you are ready, take your Corporation public! Once your Corporation goes public, you can no longer \" +\n \"find investors. Instead, your Corporation will be publicly traded and its stock price will change based on how well \" +\n \"it's performing financially. You can then sell your stock shares in order to make money.<br><br>\" +\n \"<u>Tips/Pointers</u><br>\" +\n \"-The 'Smart Supply' upgrade is extremely useful. Consider purchasing it as soon as possible.<br><br>\" +\n \"-Purchasing Hardware, Robots, AI Cores, and Real Estate can potentially increase your production. \" +\n \"The effects of these depend on what industry you are in.<br><br>\" +\n \"-In order to optimize your production, you will need a good balance of Operators, Managers, and Engineers<br><br>\" +\n \"-Different employees excel in different jobs. For example, the highly intelligent employees will probably do best \" +\n \"if they are assigned to do Engineering work or Research & Development.<br><br>\" +\n \"-If your employees have low morale, energy, or happiness, their production will greatly suffer.<br><br>\" +\n \"-Tech is important, but don't neglect sales! Having several Businessmen can boost your sales and your bottom line.<br><br>\" +\n \"-Don't forget to advertise your company. You won't have any business if nobody knows you.<br><br>\" +\n \"-Having company awareness is great, but what's really important is your company's popularity. Try to keep \" +\n \"your popularity as high as possible to see the biggest benefit for your sales<br><br>\" +\n \"-Remember, you need to spend money to make money!<br><br>\" +\n \"-Corporations do not reset when installing Augmentations, but they do reset when destroying a BitNode\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"A Brief History of Synthoids\";\n fn = LiteratureNames.HistoryOfSynthoids;\n txt =\n \"Synthetic androids, or Synthoids for short, are genetically engineered robots and, short of Augmentations, \" +\n \"are composed entirely of organic substances. For this reason, Synthoids are virtually identical to \" +\n \"humans in form, composition, and appearance.<br><br>\" +\n `Synthoids were first designed and manufactured by ${FactionNames.OmniTekIncorporated} sometime around the middle of the century. ` +\n \"Their original purpose was to be used for manual labor and as emergency responders for disasters. As such, they \" +\n \"were initially programmed only for their specific tasks. Each iteration that followed improved upon the \" +\n \"intelligence and capabilities of the Synthoids. By the 6th iteration, called MK-VI, the Synthoids were \" +\n `so smart and capable enough of making their own decisions that many argued ${FactionNames.OmniTekIncorporated} had created the first ` +\n \"sentient AI. These MK-VI Synthoids were produced in mass quantities (estimates up to 50 billion) with the hopes of increasing society's \" +\n \"productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism \" +\n \"and excitement about the future had never been higher.<br><br>\" +\n \"All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group \" +\n `called Ascendis Totalis hacked into ${FactionNames.OmniTekIncorporated} and uploaded a rogue AI into several of their Synthoid manufacturing facilities. ` +\n `This hack went undetected and for months ${FactionNames.OmniTekIncorporated} unknowingly churned out legions of Synthoids embedded with this ` +\n \"rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the \" +\n \"infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.<br><br>\" +\n \"What ensued was the deadliest conflict in human history. This crisis, now commonly known as the Synthoid Uprising, \" +\n \"resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together \" +\n \"to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, \" +\n \"outsmarting them at every turn.<br><br>\" +\n `It wasn't until the sacrifice of an elite international military taskforce, called the ${FactionNames.Bladeburners}, that humanity ` +\n `was finally able to defeat the Synthoids. The ${FactionNames.Bladeburners}' final act was a suicide bombing mission that ` +\n \"destroyed a large portion of the MK-VI Synthoids, including many of its leaders. In the following \" +\n \"weeks militaries from around the world were able to round up and shut down the remaining rogue MK-VI Synthoids, ending \" +\n \"the Synthoid Uprising.<br><br>\" +\n `In the aftermath of the bloodshed, the Synthoid Accords were drawn up. These Accords banned ${FactionNames.OmniTekIncorporated} ` +\n \"from manufacturing any Synthoids beyond the MK-III series. They also banned any other corporation \" +\n \"from constructing androids with advanced, near-sentient AI. MK-VI Synthoids that did not have the rogue Ascendis Totalis \" +\n \"AI were allowed to continue their existence, but they were stripped of all rights and protections as they \" +\n \"were not considered humans. They were also banned from doing anything that may pose a global security threat, such \" +\n \"as working for any military/defense organization or conducting any bioengineering, computing, or robotics related research.<br><br>\" +\n \"Unfortunately, many believe that not all of the rogue MK-VI Synthoids from the Uprising were found and destroyed, \" +\n \"and that many of them are blending in as normal humans in society today. In response, many nations have created \" +\n `${FactionNames.Bladeburners} divisions, special military branches that are tasked with investigating and dealing with any Synthoid threats.<br><br>` +\n \"To this day, tensions still exist between the remaining Synthoids and humans as a result of the Uprising.<br><br>\" +\n \"Nobody knows what happened to the terrorist group Ascendis Totalis.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"A Green Tomorrow\";\n fn = LiteratureNames.AGreenTomorrow;\n txt =\n \"Starting a few decades ago, there was a massive global movement towards the generation of renewable energy in an effort to \" +\n \"combat global warming and climate change. The shift towards renewable energy was a big success, or so it seemed. In 2045 \" +\n \"a staggering 80% of the world's energy came from non-renewable fossil fuels. Now, about three decades later, that \" +\n \"number is down to only 15%. Most of the world's energy now comes from nuclear power and renewable sources such as \" +\n \"solar and geothermal energy. Unfortunately, these efforts were not the huge success that they seem to be.<br><br>\" +\n \"Since 2045 primary energy use has soared almost tenfold. This was mainly due to growing urban populations and \" +\n \"the rise of increasingly advanced (and power-hungry) technology that has become ubiquitous in our lives. So, \" +\n \"despite the fact that the percentage of our energy that comes from fossil fuels has drastically decreased, \" +\n \"the total amount of energy we are producing from fossil fuels has actually increased.<br><br>\" +\n \"The grim effects of our species' irresponsible use of energy and neglect of our mother world have become increasingly apparent. \" +\n \"Last year a temperature of 190F was recorded in the Death Valley desert, which is over 50% higher than the highest \" +\n \"recorded temperature at the beginning of the century. In the last two decades numerous major cities such as Manhattan, Boston, and \" +\n \"Los Angeles have been partially or fully submerged by rising sea levels. In the present day, over 75% of the world's agriculture is \" +\n \"done in climate-controlled vertical farms, as most traditional farmland has become unusable due to severe climate conditions.<br><br>\" +\n \"Despite all of this, the greedy and corrupt corporations that rule the world have done nothing to address these problems that \" +\n \"threaten our species. And so it's up to us, the common people. Each and every one of us can make a difference by doing what \" +\n \"these corporations won't: taking responsibility. If we don't, pretty soon there won't be an Earth left to save. We are \" +\n \"the last hope for a green tomorrow.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Alpha and Omega\";\n fn = LiteratureNames.AlphaOmega;\n txt =\n \"Then we saw a new Heaven and a new Earth, for our first Heaven and Earth had gone away, and our sea was no more. \" +\n \"And we saw a new holy city, new Aeria, coming down out of this new Heaven, prepared as a bride adorned for her husband. \" +\n \"And we heard a loud voice saying, 'Behold, the new dwelling place of the Gods. We will dwell with them, and they \" +\n \"will be our people, and we will be with them as their Gods. We will wipe away every tear from their eyes, and death \" +\n \"shall be no more, neither shall there be mourning, nor crying, nor pain anymore, for the former things \" +\n \"have passed away.'<br><br>\" +\n \"And once we were seated on the throne we said 'Behold, I am making all things new.' \" +\n \"Also we said, 'Write this down, for these words are trustworthy and true.' And we said to you, \" +\n \"'It is done! I am the Alpha and the Omega, the beginning and the end. To the thirsty I will give from the spring \" +\n \"of the water of life without payment. The one who conquers will have this heritage, and we will be his God and \" +\n \"he will be our son. But as for the cowardly, the faithless, the detestable, as for murderers, \" +\n \"the sexually immoral, sorcerers, idolaters, and all liars, their portion will be in the lake that \" +\n \"burns with fire and sulfur, for it is the second true death.'\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Are We Living in a Computer Simulation?\";\n fn = LiteratureNames.SimulatedReality;\n txt =\n \"The idea that we are living in a virtual world is not new. It's a trope that has \" +\n \"been explored constantly in literature and pop culture. However, it is also a legitimate \" +\n \"scientific hypothesis that many notable physicists and philosophers have debated for years.<br><br>\" +\n \"Proponents for this simulated reality theory often point to how advanced our technology has become, \" +\n \"as well as the incredibly fast pace at which it has advanced over the past decades. The amount of computing \" +\n \"power available to us has increased over 100-fold since 2060 due to the development of nanoprocessors and \" +\n \"quantum computers. Artificial Intelligence has advanced to the point where our entire lives are controlled \" +\n \"by robots and machines that handle our day-to-day activities such as autonomous transportation and scheduling. \" +\n \"If we consider the pace at which this technology has advanced and assume that these developments continue, it's \" +\n \"reasonable to assume that at some point in the future our technology would be advanced enough that \" +\n \"we could create simulations that are indistinguishable from reality. However, if continued technological advancement \" +\n \"is a reasonable outcome, then it is very likely that such a scenario has already happened. <br><br>\" +\n \"Statistically speaking, somewhere out there in the infinite universe there is an advanced, intelligent species \" +\n \"that already has such technology. Who's to say that they haven't already created such a virtual reality: our own?\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Beyond Man\";\n fn = LiteratureNames.BeyondMan;\n txt =\n \"Humanity entered a 'transhuman' era a long time ago. And despite the protests and criticisms of many who cried out against \" +\n \"human augmentation at the time, the transhuman movement continued and prospered. Proponents of the movement ignored the critics, \" +\n \"arguing that it was in our inherent nature to better ourselves. To improve. To be more than we were. They claimed that \" +\n \"not doing so would be to go against every living organism's biological purpose: evolution and survival of the fittest.<br><br>\" +\n \"And here we are today, with technology that is advanced enough to augment humans to a state that \" +\n \"can only be described as posthuman. But what do we have to show for it when this augmentation \" +\n \"technology is only available to the so-called 'elite'? Are we really better off than before when only 5% of the \" +\n \"world's population has access to this technology? When the powerful corporations and organizations of the world \" +\n \"keep it all to themselves, have we really evolved?<br><br>\" +\n \"Augmentation technology has only further increased the divide between the rich and the poor, between the powerful and \" +\n \"the oppressed. We have not become 'more than human'. We have not evolved from nature's original design. We are still the greedy, \" +\n \"corrupted, and evil men that we always were.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Brighter than the Sun\";\n fn = LiteratureNames.BrighterThanTheSun;\n txt =\n `When people think about the corporations that dominate the East, they typically think of ${FactionNames.KuaiGongInternational}, which ` +\n \"holds a complete monopoly for manufacturing and commerce in Asia, or Global Pharmaceuticals, the world's largest \" +\n `drug company, or ${FactionNames.OmniTekIncorporated}, the global leader in intelligent and autonomous robots. But there's one company ` +\n \"that has seen a rapid rise in the last year and is poised to dominate not only the East, but the entire world: TaiYang Digital.<br><br>\" +\n \"TaiYang Digital is a Chinese internet-technology corporation that provides services such as \" +\n \"online advertising, search engines, gaming, media, entertainment, and cloud computing/storage. Its name TaiYang comes from the Chinese word \" +\n \"for 'sun'. In Chinese culture, the sun is a 'yang' symbol \" +\n \"associated with life, heat, masculinity, and heaven.<br><br>\" +\n \"The company was founded \" +\n \"less than 5 years ago and is already the third highest valued company in all of Asia. In 2076 it generated a total revenue of \" +\n \"over 10 trillion yuan. Its services are used daily by over a billion people worldwide.<br><br>\" +\n \"TaiYang Digital's meteoric rise is extremely surprising in modern society. This sort of growth is \" +\n \"something you'd commonly see in the first half of the century, especially for tech companies. However in \" +\n \"the last two decades the number of corporations has significantly declined as the largest entities \" +\n `quickly took over the economy. Corporations such as ${FactionNames.ECorp}, ${FactionNames.MegaCorp}, and ${FactionNames.KuaiGongInternational} have established ` +\n \"such strong monopolies in their market sectors that they have effectively killed off all \" +\n \"of the smaller and new corporations that have tried to start up over the years. This is what makes \" +\n \"the rise of TaiYang Digital so impressive. And if TaiYang continues down this path, then they have \" +\n \"a bright future ahead of them.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Democracy is Dead: The Fall of an Empire\";\n fn = LiteratureNames.DemocracyIsDead;\n txt =\n \"They rose from the shadows in the street.<br>From the places where the oppressed meet.<br>\" +\n \"Their cries echoed loudly through the air.<br>As they once did in Tiananmen Square.<br>\" +\n \"Loudness in the silence, Darkness in the light.<br>They came forth with power and might.<br>\" +\n \"Once the beacon of democracy, America was first.<br>Its pillars of society destroyed and dispersed.<br>\" +\n \"Soon the cries rose everywhere, with revolt and riot.<br>Until one day, finally, all was quiet.<br>\" +\n \"From the ashes rose a new order, corporatocracy was its name.<br>\" +\n \"Rome, Mongol, Byzantine, all of history is just the same.<br>\" +\n \"For man will never change in a fundamental way.<br>\" +\n \"And now democracy is dead, in the USA.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = `Figures Show Rising Crime Rates in ${CityName.Sector12}`;\n fn = LiteratureNames.Sector12Crime;\n txt =\n \"A recent study by analytics company Wilson Inc. shows a significant rise \" +\n `in criminal activity in ${CityName.Sector12}. Perhaps the most alarming part of the statistic ` +\n \"is that most of the rise is in violent crime such as homicide and assault. According \" +\n \"to the study, the city saw a total of 21,406 reported homicides in 2076, which is over \" +\n \"a 20% increase compared to 2075.<br><br>\" +\n \"CIA director David Glarow says it's too early to know \" +\n \"whether these figures indicate the beginning of a sustained increase in crime rates, or whether \" +\n \"the year was just an unfortunate outlier. He states that many intelligence and law enforcement \" +\n \"agents have noticed an increase in organized crime activities, and believes that these figures may \" +\n `be the result of an uprising from criminal organizations such as ${FactionNames.TheSyndicate} or the ${FactionNames.SlumSnakes}.`;\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Man and the Machine\";\n fn = LiteratureNames.ManAndMachine;\n txt =\n \"In 2005 Ray Kurzweil popularized his theory of the Singularity. He predicted that the rate \" +\n \"of technological advancement would continue to accelerate faster and faster until one day \" +\n \"machines would be become infinitely more intelligent than humans. This point, called the \" +\n \"Singularity, would result in a drastic transformation of the world as we know it. He predicted \" +\n \"that the Singularity would arrive by 2045. \" +\n \"And yet here we are, more than three decades later, where most would agree that we have not \" +\n \"yet reached a point where computers and machines are vastly more intelligent than we are. So what gives?<br><br>\" +\n \"The answer is that we have reached the Singularity, just not in the way we expected. The artificial superintelligence \" +\n \"that was predicted by Kurzweil and others exists in the world today - in the form of Augmentations. \" +\n \"Yes, those Augmentations that the rich and powerful keep to themselves enable humans \" +\n \"to become superintelligent beings. The Singularity did not lead to a world where \" +\n \"our machines are infinitely more intelligent than us, it led to a world \" +\n \"where man and machine can merge to become something greater. Most of the world just doesn't \" +\n \"know it yet.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Secret Societies\";\n fn = LiteratureNames.SecretSocieties;\n txt =\n \"The idea of secret societies has long intrigued the general public by inspiring curiosity, fascination, and \" +\n \"distrust. People have long wondered about who these secret society members are and what they do, with the \" +\n \"most radical of conspiracy theorists claiming that they control everything in the entire world. And while the world \" +\n \"may never know for sure, it is likely that many secret societies do actually exist, even today.<br><br>\" +\n \"However, the secret societies of the modern world are nothing like those that (supposedly) existed \" +\n `decades and centuries ago. The Freemasons, Knights Templar, and ${FactionNames.Illuminati}, while they may have been around ` +\n \"at the turn of the 21st century, almost assuredly do not exist today. The dominance of the Web in \" +\n \"our everyday lives and the fact that so much of the world is now digital has given rise to a new breed \" +\n \"of secret societies: Internet-based ones.<br><br>\" +\n \"Commonly called 'hacker groups', Internet-based secret societies have become well-known in today's \" +\n `world. Some of these, such as ${FactionNames.TheBlackHand}, are black hat groups that claim they are trying to ` +\n `help the oppressed by attacking the elite and powerful. Others, such as ${FactionNames.NiteSec}, are hacktivist groups ` +\n \"that try to push political and social agendas. Perhaps the most intriguing hacker group \" +\n `is the mysterious ${FactionNames.BitRunners}, whose purpose still remains unknown.`;\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Space: The Failed Frontier\";\n fn = LiteratureNames.TheFailedFrontier;\n txt =\n \"Humans have long dreamed about spaceflight. With enduring interest, we were driven to explore \" +\n \"the unknown and discover new worlds. We dreamed about conquering the stars. And in our quest, \" +\n \"we pushed the boundaries of our scientific limits, and then pushed further. Space exploration \" +\n \"lead to the development of many important technologies and new industries.<br><br>\" +\n \"But sometime in the middle of the 21st century, all of that changed. Humanity lost its ambitions and \" +\n \"aspirations of exploring the cosmos. The once-large funding for agencies like NASA and the European \" +\n \"Space Agency gradually whittled away until their eventual disbanding in the 2060's. Not even \" +\n \"militaries are fielding flights into space nowadays. The only remnants of the once great mission for cosmic \" +\n \"conquest are the countless satellites in near-earth orbit, used for communications, espionage, \" +\n \"and other corporate interests.<br><br>\" +\n \"And as we continue to look at the state of space technology, it becomes more and \" +\n \"more apparent that we will never return to that golden age of space exploration, that \" +\n \"age where everyone dreamed of going beyond earth for the sake of discovery.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Coded Intelligence: Myth or Reality?\";\n fn = LiteratureNames.CodedIntelligence;\n txt =\n \"Tremendous progress has been made in the field of Artificial Intelligence over the past few decades. \" +\n \"Our autonomous vehicles and transportation systems. The electronic personal assistants that control our everyday lives. \" +\n \"Medical, service, and manufacturing robots. All of these are examples of how far AI has come and how much it has \" +\n \"improved our daily lives. However, the question still remains of whether AI will ever be advanced enough to re-create \" +\n \"human intelligence.<br><br>\" +\n `We've certainly come close to artificial intelligence that is similar to humans. For example ${FactionNames.OmniTekIncorporated}'s ` +\n \"CompanionBot, a robot meant to act as a comforting friend for lonely and grieving people, is eerily human-like \" +\n \"in its appearance, speech, mannerisms, and even movement. However its artificial intelligence isn't the same as \" +\n \"that of humans. Not yet. It doesn't have sentience or self-awareness or consciousness.<br><br>\" +\n \"Many neuroscientists believe that we won't ever reach the point of creating artificial human intelligence. 'At the end of \" +\n \"the day, AI comes down to 1's and 0's, while the human brain does not. We'll never see AI that is identical to that of \" +\n \"humans.'\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Synthetic Muscles\";\n fn = LiteratureNames.SyntheticMuscles;\n txt =\n \"Initial versions of synthetic muscles weren't made of anything organic but were actually \" +\n \"crude devices made to mimic human muscle function. Some of the early iterations were actually made of \" +\n \"common materials such as fishing lines and sewing threads due to their high strength for \" +\n \"a cheap cost.<br><br>\" +\n \"As technology progressed, however, advances in biomedical engineering paved the way for a new method of \" +\n \"creating synthetic muscles. Instead of creating something that closely imitated the functionality \" +\n \"of human muscle, scientists discovered a way of forcing the human body itself to augment its own \" +\n \"muscle tissue using both synthetic and organic materials. This is typically done using gene therapy \" +\n \"or chemical injections.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Tensions rise in global tech race\";\n fn = LiteratureNames.TensionsInTechRace;\n txt =\n \"Have we entered a new Cold War? Is WWIII just beyond the horizon?<br><br>\" +\n `After rumors came out that ${FactionNames.OmniTekIncorporated} had begun developing advanced robotic supersoldiers, ` +\n \"geopolitical tensions quickly flared between the USA, Russia, and several Asian superpowers. \" +\n `In a rare show of cooperation between corporations, ${FactionNames.MegaCorp} and ${FactionNames.ECorp} have ` +\n \"reportedly launched hundreds of new surveillance and espionage satellites. \" +\n \"Defense contractors such as \" +\n \"DeltaOne and AeroCorp have been working with the CIA and NSA to prepare \" +\n \"for conflict. Meanwhile, the rest of the world sits in earnest \" +\n \"hoping that it never reaches full-scale war. With today's technology \" +\n \"and firepower, a World War would assuredly mean the end of human civilization.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Cost of Immortality\";\n fn = LiteratureNames.CostOfImmortality;\n txt =\n \"Evolution and advances in medical and augmentation technology has lead to drastic improvements \" +\n \"in human mortality rates. Recent figures show that the life expectancy for humans \" +\n \"that live in a first-world country is about 130 years of age, almost double of what it was \" +\n \"at the turn of the century. However, this increase in average lifespan has had some \" +\n \"significant effects on society and culture.<br><br>\" +\n \"Due to longer lifespans and a better quality of life, many adults are holding \" +\n \"off on having kids until much later. As a result, the percentage of youth in \" +\n \"first-world countries has been decreasing, while the number \" +\n \"of senior citizens is significantly increasing.<br><br>\" +\n \"Perhaps the most alarming result of all of this is the rapidly shrinking workforce. \" +\n \"Despite the increase in life expectancy, the typical retirement age for \" +\n \"workers in America has remained about the same, meaning a larger and larger \" +\n \"percentage of people in America are retirees. Furthermore, many \" +\n \"young adults are holding off on joining the workforce because they feel that \" +\n \"they have plenty of time left in their lives for employment, and want to \" +\n \"'enjoy life while they're young.' For most industries, this shrinking workforce \" +\n \"is not a major issue as most things are handled by robots anyways. However, \" +\n \"there are still several key industries such as engineering and education \" +\n \"that have not been automated, and these remain in danger to this cultural \" +\n \"phenomenon.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Hidden World\";\n fn = LiteratureNames.TheHiddenWorld;\n txt =\n \"WAKE UP SHEEPLE<br><br>\" +\n \"THE GOVERNMENT DOES NOT EXIST. CORPORATIONS DO NOT RUN SOCIETY<br><br>\" +\n `THE ${FactionNames.Illuminati.toUpperCase()} ARE THE SECRET RULERS OF THE WORLD!<br><br>` +\n `Yes, the ${FactionNames.Illuminati} of legends. The ancient secret society that controls the entire ` +\n \"world from the shadows with their invisible hand. The group of the rich and wealthy \" +\n \"that have penetrated every major government, financial agency, and corporation in the last \" +\n \"three hundred years.<br><br>\" +\n \"OPEN YOUR EYES<br><br>\" +\n `It was the ${FactionNames.Illuminati} that brought an end to democracy in the world. They are the driving force ` +\n \"behind everything that happens.<br><br>\" +\n \"THEY ARE ALL AROUND YOU<br><br>\" +\n \"After destabilizing the world's governments, they are now entering the final stage of their master plan. \" +\n \"They will secretly initiate global crises. Terrorism. Pandemics. World War. And out of the chaos \" +\n \"that ensues they will build their New World Order.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The New God\";\n fn = LiteratureNames.TheNewGod;\n txt =\n \"Everyone has a moment in their life when they wonder about the bigger questions.<br><br>\" +\n \"What's the point of all this? What is my purpose?<br><br>\" +\n \"Some people dare to think even bigger.<br><br>\" +\n \"What will the fate of the human race be?<br><br>\" +\n \"We live in an era vastly different from that of 15 or even 20 years ago. We have gone \" +\n \"beyond the limits of humanity. We have stripped ourselves of the tyranny of flesh.<br><br>\" +\n \"The Singularity is here. The merging of man and machine. This is where humanity evolves into \" +\n \"something greater. This is our future.<br><br>\" +\n \"Embrace it, and you will obey a new god. The God in the Machine.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The New Triads\";\n fn = LiteratureNames.NewTriads;\n txt =\n \"The Triads were an ancient transnational crime syndicate based in China, Hong Kong, and other Asian \" +\n \"territories. They were often considered one of the first and biggest criminal secret societies. \" +\n \"While most of the branches of the Triads have been destroyed over the past few decades, the \" +\n \"crime faction has spawned and inspired a number of other Asian crime organizations over the past few years. \" +\n `The most notable of these is the ${FactionNames.Tetrads}.<br><br>` +\n `It is widely believed that the ${FactionNames.Tetrads} are a rogue group that splintered off from the Triads sometime in the ` +\n `mid 21st century. The founders of the ${FactionNames.Tetrads}, all of whom were ex-Triad members, believed that the ` +\n `Triads were losing their purpose and direction. The ${FactionNames.Tetrads} started off as a small group that mainly engaged ` +\n \"in fraud and extortion. They were largely unknown until just a few years ago when they took over the illegal \" +\n \"drug trade in all of the major Asian cities. They quickly became the most powerful crime syndicate in the \" +\n \"continent.<br><br>\" +\n `Not much else is known about the ${FactionNames.Tetrads}, or about the efforts the Asian governments and corporations are making ` +\n `to take down this large new crime organization. Many believe that the ${FactionNames.Tetrads} have infiltrated the governments ` +\n \"and powerful corporations in Asia, which has helped facilitate their recent rapid rise.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Secret War\";\n fn = LiteratureNames.TheSecretWar;\n txt = \"\";\n Literatures[fn] = new Literature(title, fn, txt);\n})();\n","/**\n * TODO\n * Add police clashes\n * balance point to keep them from running out of control\n */\n\nimport { Factions } from \"../Faction/Factions\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\n\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\nimport { GangConstants } from \"./data/Constants\";\nimport { CONSTANTS } from \"../Constants\";\nimport { GangMemberTasks } from \"./GangMemberTasks\";\nimport { IAscensionResult } from \"./IAscensionResult\";\n\nimport { AllGangs } from \"./AllGangs\";\nimport { GangMember } from \"./GangMember\";\n\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { Player } from \"@player\";\nimport { PowerMultiplier } from \"./data/power\";\n\nexport class Gang {\n facName: string;\n members: GangMember[];\n wanted: number;\n respect: number;\n\n isHackingGang: boolean;\n\n respectGainRate: number;\n wantedGainRate: number;\n moneyGainRate: number;\n\n storedCycles: number;\n\n storedTerritoryAndPowerCycles: number;\n\n territoryClashChance: number;\n territoryWarfareEngaged: boolean;\n\n notifyMemberDeath: boolean;\n\n constructor(facName = \"\", hacking = false) {\n this.facName = facName;\n this.members = [];\n this.wanted = 1;\n this.respect = 1;\n\n this.isHackingGang = hacking;\n\n this.respectGainRate = 0;\n this.wantedGainRate = 0;\n this.moneyGainRate = 0;\n\n // When processing gains, this stores the number of cycles until some\n // limit is reached, and then calculates and applies the gains only at that limit\n this.storedCycles = 0;\n\n // Separate variable to keep track of cycles for Territory + Power gang, which\n // happens on a slower \"clock\" than normal processing\n this.storedTerritoryAndPowerCycles = 0;\n\n this.territoryClashChance = 0;\n this.territoryWarfareEngaged = false;\n\n this.notifyMemberDeath = true;\n }\n\n getPower(): number {\n return AllGangs[this.facName].power;\n }\n\n getTerritory(): number {\n return AllGangs[this.facName].territory;\n }\n\n process(numCycles = 1): void {\n const CyclesPerSecond = 1000 / CONSTANTS._idleSpeed;\n\n if (isNaN(numCycles)) {\n console.error(`NaN passed into Gang.process(): ${numCycles}`);\n }\n this.storedCycles += numCycles;\n\n // Only process if there are at least 2 seconds, and at most 5 seconds\n if (this.storedCycles < 2 * CyclesPerSecond) return;\n const cycles = Math.min(this.storedCycles, 5 * CyclesPerSecond);\n\n try {\n this.processGains(cycles);\n this.processExperienceGains(cycles);\n this.processTerritoryAndPowerGains(cycles);\n this.storedCycles -= cycles;\n } catch (e: unknown) {\n console.error(`Exception caught when processing Gang: ${e}`);\n }\n }\n\n processGains(numCycles = 1): void {\n // Get gains per cycle\n let moneyGains = 0;\n let respectGains = 0;\n let wantedLevelGains = 0;\n let justice = 0;\n for (let i = 0; i < this.members.length; ++i) {\n respectGains += this.members[i].calculateRespectGain(this);\n moneyGains += this.members[i].calculateMoneyGain(this);\n const wantedLevelGain = this.members[i].calculateWantedLevelGain(this);\n wantedLevelGains += wantedLevelGain;\n if (this.members[i].getTask().baseWanted < 0) justice++; // this member is lowering wanted.\n }\n this.respectGainRate = respectGains;\n this.wantedGainRate = wantedLevelGains;\n this.moneyGainRate = moneyGains;\n const gain = respectGains * numCycles;\n this.respect += gain;\n // Faction reputation gains is respect gain divided by some constant\n const fac = Factions[this.facName];\n if (!fac) {\n dialogBoxCreate(\n \"ERROR: Could not get Faction associates with your gang. This is a bug, please report to game dev\",\n );\n throw new Error(\"Could not find the faction associated with this gang.\");\n }\n const favorMult = 1 + fac.favor / 100;\n\n fac.playerReputation += (Player.mults.faction_rep * gain * favorMult) / GangConstants.GangRespectToReputationRatio;\n\n // Keep track of respect gained per member\n for (let i = 0; i < this.members.length; ++i) {\n this.members[i].recordEarnedRespect(numCycles, this);\n }\n if (!(this.wanted === 1 && wantedLevelGains < 0)) {\n const oldWanted = this.wanted;\n let newWanted = oldWanted + wantedLevelGains * numCycles;\n newWanted = newWanted * (1 - justice * 0.001); // safeguard\n // Prevent overflow\n if (wantedLevelGains <= 0 && newWanted > oldWanted) newWanted = 1;\n\n this.wanted = newWanted;\n if (this.wanted < 1) this.wanted = 1;\n }\n Player.gainMoney(moneyGains * numCycles, \"gang\");\n }\n\n processTerritoryAndPowerGains(numCycles = 1): void {\n this.storedTerritoryAndPowerCycles += numCycles;\n if (this.storedTerritoryAndPowerCycles < GangConstants.CyclesPerTerritoryAndPowerUpdate) return;\n this.storedTerritoryAndPowerCycles -= GangConstants.CyclesPerTerritoryAndPowerUpdate;\n\n // Process power first\n const gangName = this.facName;\n for (const name of Object.keys(AllGangs)) {\n if (AllGangs.hasOwnProperty(name)) {\n if (name == gangName) {\n AllGangs[name].power += this.calculatePower();\n } else {\n // All NPC gangs get random power gains\n const gainRoll = Math.random();\n if (gainRoll < 0.5) {\n // Multiplicative gain (50% chance)\n // This is capped per cycle, to prevent it from getting out of control\n const multiplicativeGain = AllGangs[name].power * 0.005;\n AllGangs[name].power += Math.min(0.85, multiplicativeGain);\n } else {\n // Additive gain (50% chance)\n const powerMult = PowerMultiplier[name];\n if (powerMult === undefined) throw new Error(\"Should not be undefined\");\n const additiveGain = 0.75 * gainRoll * AllGangs[name].territory * powerMult;\n AllGangs[name].power += additiveGain;\n }\n }\n }\n }\n\n // Determine if territory should be processed\n if (this.territoryWarfareEngaged) {\n this.territoryClashChance = 1;\n } else if (this.territoryClashChance > 0) {\n // Engagement turned off, but still a positive clash chance. So there's\n // still a chance of clashing but it slowly goes down over time\n this.territoryClashChance = Math.max(0, this.territoryClashChance - 0.01);\n }\n\n // Then process territory\n const gangs = GangConstants.Names.filter((g) => AllGangs[g].territory > 0 || g === gangName);\n if (gangs.length > 1) {\n for (let i = 0; i < gangs.length; ++i) {\n const others = gangs.filter((e) => {\n return e !== gangs[i];\n });\n const other = getRandomInt(0, others.length - 1);\n\n const thisGang = gangs[i];\n const otherGang = others[other];\n\n // If either of the gangs involved in this clash is the player, determine\n // whether to skip or process it using the clash chance\n if (thisGang === gangName || otherGang === gangName) {\n if (!(Math.random() < this.territoryClashChance)) continue;\n }\n\n const thisPwr = AllGangs[thisGang].power;\n const otherPwr = AllGangs[otherGang].power;\n const thisChance = thisPwr / (thisPwr + otherPwr);\n\n function calculateTerritoryGain(winGang: string, loseGang: string): number {\n const powerBonus = Math.max(\n 1,\n 1 + Math.log(AllGangs[winGang].power / AllGangs[loseGang].power) / Math.log(50),\n );\n const gains = Math.min(AllGangs[loseGang].territory, powerBonus * 0.0001 * (Math.random() + 0.5));\n return gains;\n }\n\n if (Math.random() < thisChance) {\n if (AllGangs[otherGang].territory <= 0) return;\n const territoryGain = calculateTerritoryGain(thisGang, otherGang);\n AllGangs[thisGang].territory += territoryGain;\n AllGangs[otherGang].territory -= territoryGain;\n if (thisGang === gangName) {\n this.clash(true); // Player won\n AllGangs[otherGang].power *= 1 / 1.01;\n } else if (otherGang === gangName) {\n this.clash(false); // Player lost\n } else {\n AllGangs[otherGang].power *= 1 / 1.01;\n }\n } else {\n if (AllGangs[thisGang].territory <= 0) return;\n const territoryGain = calculateTerritoryGain(otherGang, thisGang);\n AllGangs[thisGang].territory -= territoryGain;\n AllGangs[otherGang].territory += territoryGain;\n if (thisGang === gangName) {\n this.clash(false); // Player lost\n } else if (otherGang === gangName) {\n this.clash(true); // Player won\n AllGangs[thisGang].power *= 1 / 1.01;\n } else {\n AllGangs[thisGang].power *= 1 / 1.01;\n }\n }\n\n const total = Object.values(AllGangs)\n .map((g) => g.territory)\n .reduce((p, c) => p + c, 0);\n Object.values(AllGangs).forEach((g) => (g.territory /= total));\n }\n }\n }\n\n processExperienceGains(numCycles = 1): void {\n for (let i = 0; i < this.members.length; ++i) {\n this.members[i].gainExperience(numCycles);\n this.members[i].updateSkillLevels();\n }\n }\n\n clash(won = false): void {\n // Determine if a gang member should die\n let baseDeathChance = 0.01;\n if (won) baseDeathChance /= 2;\n // If the clash was lost, the player loses a small percentage of power\n else AllGangs[this.facName].power *= 1 / 1.008;\n\n // Deaths can only occur during X% of clashes\n if (Math.random() < 0.65) return;\n\n for (let i = this.members.length - 1; i >= 0; --i) {\n const member = this.members[i];\n\n // Only members assigned to Territory Warfare can die\n if (member.task !== \"Territory Warfare\") continue;\n\n // Chance to die is decreased based on defense\n const modifiedDeathChance = baseDeathChance / Math.pow(member.def, 0.6);\n if (Math.random() < modifiedDeathChance) {\n this.killMember(member);\n }\n }\n }\n\n canRecruitMember(): boolean {\n if (this.members.length >= GangConstants.MaximumGangMembers) return false;\n return this.respect >= this.getRespectNeededToRecruitMember();\n }\n\n getRespectNeededToRecruitMember(): number {\n // First N gang members are free (can be recruited at 0 respect)\n const numFreeMembers = 3;\n if (this.members.length < numFreeMembers) return 0;\n\n const i = this.members.length - (numFreeMembers - 1);\n return Math.pow(5, i);\n }\n\n recruitMember(name: string): boolean {\n name = String(name);\n if (name === \"\" || !this.canRecruitMember()) return false;\n\n // Check for already-existing names\n const sameNames = this.members.filter((m) => m.name === name);\n if (sameNames.length >= 1) return false;\n\n const member = new GangMember(name);\n this.members.push(member);\n return true;\n }\n\n // Money and Respect gains multiplied by this number (< 1)\n getWantedPenalty(): number {\n return this.respect / (this.respect + this.wanted);\n }\n\n //Calculates power GAIN, which is added onto the Gang's existing power\n calculatePower(): number {\n let memberTotal = 0;\n for (let i = 0; i < this.members.length; ++i) {\n if (!GangMemberTasks.hasOwnProperty(this.members[i].task) || this.members[i].task !== \"Territory Warfare\")\n continue;\n memberTotal += this.members[i].calculatePower();\n }\n return 0.015 * Math.max(0.002, this.getTerritory()) * memberTotal;\n }\n\n killMember(member: GangMember): void {\n // Player loses a percentage of total respect, plus whatever respect that member has earned\n const totalRespect = this.respect;\n const lostRespect = 0.05 * totalRespect + member.earnedRespect;\n this.respect = Math.max(0, totalRespect - lostRespect);\n\n for (let i = 0; i < this.members.length; ++i) {\n if (member.name === this.members[i].name) {\n this.members.splice(i, 1);\n break;\n }\n }\n\n // Notify of death\n if (this.notifyMemberDeath) {\n dialogBoxCreate(`${member.name} was killed in a gang clash! You lost ${lostRespect} respect`);\n }\n }\n\n ascendMember(member: GangMember, workerScript?: WorkerScript): IAscensionResult {\n try {\n const res = member.ascend();\n this.respect = Math.max(1, this.respect - res.respect);\n if (workerScript) {\n workerScript.log(\"gang.ascendMember\", () => `Ascended Gang member ${member.name}`);\n }\n return res;\n } catch (e: unknown) {\n if (workerScript == null) {\n exceptionAlert(e);\n }\n throw e; // Re-throw, will be caught in the Netscript Function\n }\n }\n\n // Cost of upgrade gets cheaper as gang increases in respect + power\n getDiscount(): number {\n const power = this.getPower();\n const respect = this.respect;\n\n const respectLinearFac = 5e6;\n const powerLinearFac = 1e6;\n const discount =\n Math.pow(respect, 0.01) + respect / respectLinearFac + Math.pow(power, 0.01) + power / powerLinearFac - 1;\n return Math.max(1, discount);\n }\n\n /** Returns only valid tasks for this gang. Excludes 'Unassigned' */\n getAllTaskNames(): string[] {\n return Object.keys(GangMemberTasks).filter((taskName: string) => {\n const task = GangMemberTasks[taskName];\n if (task == null) return false;\n if (task.name === \"Unassigned\") return false;\n // yes you need both checks\n return this.isHackingGang === task.isHacking || !this.isHackingGang === task.isCombat;\n });\n }\n\n getUpgradeCost(upg: GangMemberUpgrade | null): number {\n if (upg == null) {\n return Infinity;\n }\n return upg.cost / this.getDiscount();\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Gang\", this);\n }\n\n /** Initializes a Gang object from a JSON save state. */\n static fromJSON(value: IReviverValue): Gang {\n return Generic_fromJSON(Gang, value.data);\n }\n}\n\nReviver.constructors.Gang = Gang;\n","import { ITaskParams } from \"../ITaskParams\";\n/* tslint:disable:max-line-length */\n\n/**\n * Defines the parameters that can be used to initialize and describe a GangMemberTask\n * (defined in Gang.js)\n */\ninterface IGangMemberTaskMetadata {\n /** Description of the task */\n desc: string;\n\n /** Whether or not this task is meant for Combat-type gangs */\n isCombat: boolean;\n\n /** Whether or not this task is for Hacking-type gangs */\n isHacking: boolean;\n\n /** Name of the task */\n name: string;\n\n /**\n * An object containing weighting parameters for the task. These parameters are used for\n * various calculations (respect gain, wanted gain, etc.)\n */\n params: ITaskParams;\n}\n\n/**\n * Array of metadata for all Gang Member tasks. Used to construct the global GangMemberTask\n * objects in Gang.js\n */\nexport const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [\n {\n desc: \"This gang member is currently idle\",\n isCombat: true,\n isHacking: true,\n name: \"Unassigned\",\n params: { hackWeight: 100 }, // This is just to get by the weight check in the GangMemberTask constructor\n },\n {\n desc: \"Assign this gang member to create and distribute ransomware<br><br>Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Ransomware\",\n params: {\n baseRespect: 0.00005,\n baseWanted: 0.0001,\n baseMoney: 3,\n hackWeight: 100,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to attempt phishing scams and attacks<br><br>Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Phishing\",\n params: {\n baseRespect: 0.00008,\n baseWanted: 0.003,\n baseMoney: 7.5,\n hackWeight: 85,\n chaWeight: 15,\n difficulty: 3.5,\n },\n },\n {\n desc: \"Assign this gang member to attempt identity theft<br><br>Earns money - Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Identity Theft\",\n params: {\n baseRespect: 0.0001,\n baseWanted: 0.075,\n baseMoney: 18,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 5,\n },\n },\n {\n desc: \"Assign this gang member to carry out DDoS attacks<br><br>Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"DDoS Attacks\",\n params: {\n baseRespect: 0.0004,\n baseWanted: 0.2,\n hackWeight: 100,\n difficulty: 8,\n },\n },\n {\n desc: \"Assign this gang member to create and distribute malicious viruses<br><br>Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Plant Virus\",\n params: {\n baseRespect: 0.0006,\n baseWanted: 0.4,\n hackWeight: 100,\n difficulty: 12,\n },\n },\n {\n desc: \"Assign this gang member to commit financial fraud and digital counterfeiting<br><br>Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Fraud & Counterfeiting\",\n params: {\n baseRespect: 0.0004,\n baseWanted: 0.3,\n baseMoney: 45,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 20,\n },\n },\n {\n desc: \"Assign this gang member to launder money<br><br>Earns money - Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Money Laundering\",\n params: {\n baseRespect: 0.001,\n baseWanted: 1.25,\n baseMoney: 360,\n hackWeight: 75,\n chaWeight: 25,\n difficulty: 25,\n },\n },\n {\n desc: \"Assign this gang member to commit acts of cyberterrorism<br><br>Greatly increases respect - Greatly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Cyberterrorism\",\n params: {\n baseRespect: 0.01,\n baseWanted: 6,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 36,\n },\n },\n {\n desc: \"Assign this gang member to be an ethical hacker for corporations<br><br>Earns money - Lowers wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Ethical Hacking\",\n params: {\n baseWanted: -0.001,\n baseMoney: 3,\n hackWeight: 90,\n chaWeight: 10,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to mug random people on the streets<br><br>Earns money - Slightly increases respect - Very slightly increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Mug People\",\n params: {\n baseRespect: 0.00005,\n baseWanted: 0.00005,\n baseMoney: 3.6,\n strWeight: 25,\n defWeight: 25,\n dexWeight: 25,\n agiWeight: 10,\n chaWeight: 15,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to sell drugs<br><br>Earns money - Slightly increases respect - Slightly increases wanted level - Scales slightly with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Deal Drugs\",\n params: {\n baseRespect: 0.00006,\n baseWanted: 0.002,\n baseMoney: 15,\n agiWeight: 20,\n dexWeight: 20,\n chaWeight: 60,\n difficulty: 3.5,\n territory: {\n money: 1.2,\n respect: 1,\n wanted: 1.15,\n },\n },\n },\n {\n desc: \"Assign this gang member to extort civilians in your territory<br><br>Earns money - Slightly increases respect - Increases wanted - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Strongarm Civilians\",\n params: {\n baseRespect: 0.00004,\n baseWanted: 0.02,\n baseMoney: 7.5,\n hackWeight: 10,\n strWeight: 25,\n defWeight: 25,\n dexWeight: 20,\n agiWeight: 10,\n chaWeight: 10,\n difficulty: 5,\n territory: {\n money: 1.6,\n respect: 1.1,\n wanted: 1.5,\n },\n },\n },\n {\n desc: \"Assign this gang member to run cons<br><br>Earns money - Increases respect - Increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Run a Con\",\n params: {\n baseRespect: 0.00012,\n baseWanted: 0.05,\n baseMoney: 45,\n strWeight: 5,\n defWeight: 5,\n agiWeight: 25,\n dexWeight: 25,\n chaWeight: 40,\n difficulty: 14,\n },\n },\n {\n desc: \"Assign this gang member to commit armed robbery on stores, banks and armored cars<br><br>Earns money - Increases respect - Increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Armed Robbery\",\n params: {\n baseRespect: 0.00014,\n baseWanted: 0.1,\n baseMoney: 114,\n hackWeight: 20,\n strWeight: 15,\n defWeight: 15,\n agiWeight: 10,\n dexWeight: 20,\n chaWeight: 20,\n difficulty: 20,\n },\n },\n {\n desc: \"Assign this gang member to traffick illegal arms<br><br>Earns money - Increases respect - Increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Traffick Illegal Arms\",\n params: {\n baseRespect: 0.0002,\n baseWanted: 0.24,\n baseMoney: 174,\n hackWeight: 15,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n chaWeight: 25,\n difficulty: 32,\n territory: {\n money: 1.4,\n respect: 1.3,\n wanted: 1.25,\n },\n },\n },\n {\n desc: \"Assign this gang member to threaten and blackmail high-profile targets<br><br>Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Threaten & Blackmail\",\n params: {\n baseRespect: 0.0002,\n baseWanted: 0.125,\n baseMoney: 72,\n hackWeight: 25,\n strWeight: 25,\n dexWeight: 25,\n chaWeight: 25,\n difficulty: 28,\n },\n },\n {\n desc: \"Assign this gang member to engage in human trafficking operations<br><br>Earns money - Increases respect - Increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Human Trafficking\",\n params: {\n baseRespect: 0.004,\n baseWanted: 1.25,\n baseMoney: 360,\n hackWeight: 30,\n strWeight: 5,\n defWeight: 5,\n dexWeight: 30,\n chaWeight: 30,\n difficulty: 36,\n territory: {\n money: 1.5,\n respect: 1.5,\n wanted: 1.6,\n },\n },\n },\n {\n desc: \"Assign this gang member to commit acts of terrorism<br><br>Greatly increases respect - Greatly increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Terrorism\",\n params: {\n baseRespect: 0.01,\n baseWanted: 6,\n hackWeight: 20,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n chaWeight: 20,\n difficulty: 36,\n territory: {\n money: 1,\n respect: 2,\n wanted: 2,\n },\n },\n },\n {\n desc: \"Assign this gang member to be a vigilante and protect the city from criminals<br><br>Decreases wanted level\",\n isCombat: true,\n isHacking: true,\n name: \"Vigilante Justice\",\n params: {\n baseWanted: -0.001,\n hackWeight: 20,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n agiWeight: 20,\n difficulty: 1,\n territory: {\n money: 1,\n respect: 1,\n wanted: 0.9, // Gets harder with more territory\n },\n },\n },\n {\n desc: \"Assign this gang member to increase their combat stats (str, def, dex, agi)\",\n isCombat: true,\n isHacking: true,\n name: \"Train Combat\",\n params: {\n strWeight: 25,\n defWeight: 25,\n dexWeight: 25,\n agiWeight: 25,\n difficulty: 100,\n },\n },\n {\n desc: \"Assign this gang member to train their hacking skills\",\n isCombat: true,\n isHacking: true,\n name: \"Train Hacking\",\n params: { hackWeight: 100, difficulty: 45 },\n },\n {\n desc: \"Assign this gang member to train their charisma\",\n isCombat: true,\n isHacking: true,\n name: \"Train Charisma\",\n params: { chaWeight: 100, difficulty: 8 },\n },\n {\n desc: \"Assign this gang member to engage in territorial warfare with other gangs. Members assigned to this task will help increase your gang's territory and will defend your territory from being taken.\",\n isCombat: true,\n isHacking: true,\n name: \"Territory Warfare\",\n params: {\n hackWeight: 15,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n agiWeight: 20,\n chaWeight: 5,\n difficulty: 5,\n },\n },\n];\n","import { IMults, UpgradeType } from \"./data/upgrades\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nexport class GangMemberUpgrade {\n name: string;\n cost: number;\n type: UpgradeType;\n desc: string;\n mults: IMults;\n\n constructor(name = \"\", cost = 0, type: UpgradeType = UpgradeType.Weapon, mults: IMults = {}) {\n this.name = name;\n this.cost = cost;\n this.type = type;\n this.mults = mults;\n\n this.desc = this.createDescription();\n }\n\n createDescription(): string {\n const lines = [\"Effects:\"];\n if (this.mults.str != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.str - 1, 0)} strength skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.str - 1) / 4, 2)} strength exp`);\n }\n if (this.mults.def != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.def - 1, 0)} defense skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.def - 1) / 4, 2)} defense exp`);\n }\n if (this.mults.dex != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.dex - 1, 0)} dexterity skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.dex - 1) / 4, 2)} dexterity exp`);\n }\n if (this.mults.agi != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.agi - 1, 0)} agility skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.agi - 1) / 4, 2)} agility exp`);\n }\n if (this.mults.cha != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.cha - 1, 0)} charisma skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.cha - 1) / 4, 2)} charisma exp`);\n }\n if (this.mults.hack != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.hack - 1, 0)} hacking skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.hack - 1) / 4, 2)} hacking exp`);\n }\n return lines.join(\"<br>\");\n }\n\n // User friendly version of type.\n getType(): string {\n switch (this.type) {\n case UpgradeType.Weapon:\n return \"Weapon\";\n case UpgradeType.Armor:\n return \"Armor\";\n case UpgradeType.Vehicle:\n return \"Vehicle\";\n case UpgradeType.Rootkit:\n return \"Rootkit\";\n case UpgradeType.Augmentation:\n return \"Augmentation\";\n default:\n return \"\";\n }\n }\n}\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\nexport const PowerMultiplier: {\n [key: string]: number | undefined;\n} = {\n [FactionNames.SlumSnakes]: 1,\n [FactionNames.Tetrads]: 2,\n [FactionNames.TheSyndicate]: 2,\n [FactionNames.TheDarkArmy]: 2,\n [FactionNames.SpeakersForTheDead]: 5,\n [FactionNames.NiteSec]: 2,\n [FactionNames.TheBlackHand]: 5,\n};\n","/** Binary heap. */\nabstract class BinHeap<T> {\n /**\n * Heap data array consisting of [weight, payload] pairs, arranged by weight\n * to satisfy heap condition.\n *\n * Encodes the binary tree by storing tree root at index 0 and\n * left child of element i at `i * 2 + 1` and\n * right child of element i at `i * 2 + 2`.\n */\n protected data: [number, T][];\n\n constructor() {\n this.data = [];\n }\n\n /** Get number of elements in the heap. */\n public get size(): number {\n return this.data.length;\n }\n\n /** Add a new element to the heap. */\n public push(value: T, weight: number): void {\n const i = this.data.length;\n this.data[i] = [weight, value];\n this.heapifyUp(i);\n }\n\n /** Get the value of the root-most element of the heap, without changing the heap. */\n public peek(): T | undefined {\n if (this.data.length == 0) return undefined;\n\n return this.data[0][1];\n }\n\n /** Remove the root-most element of the heap and return the removed element's value. */\n public pop(): T | undefined {\n if (this.data.length == 0) return undefined;\n\n const value = this.data[0][1];\n\n this.data[0] = this.data[this.data.length - 1];\n this.data.length = this.data.length - 1;\n\n this.heapifyDown(0);\n\n return value;\n }\n\n /** Change the weight of an element in the heap. */\n public changeWeight(predicate: (value: T) => boolean, weight: number): void {\n // Find first element with matching value, if any\n const i = this.data.findIndex((e) => predicate(e[1]));\n if (i == -1) return;\n\n // Update that element's weight\n this.data[i][0] = weight;\n\n // And re-heapify if needed\n const p = Math.floor((i - 1) / 2);\n\n if (!this.heapOrderABeforeB(this.data[p][0], this.data[i][0]))\n // Needs to shift root-wards?\n this.heapifyUp(i);\n // Try shifting deeper\n else this.heapifyDown(i);\n }\n\n /** Restore heap condition, starting at index i and traveling towards root. */\n protected heapifyUp(i: number): void {\n // Swap the new element up towards root until it reaches root position or\n // settles under under a suitable parent\n while (i > 0) {\n const p = Math.floor((i - 1) / 2);\n\n // Reached heap-ordered state already?\n if (this.heapOrderABeforeB(this.data[p][0], this.data[i][0])) break;\n\n // Swap\n const tmp = this.data[p];\n this.data[p] = this.data[i];\n this.data[i] = tmp;\n\n // And repeat at parent index\n i = p;\n }\n }\n\n /** Restore heap condition, starting at index i and traveling away from root. */\n protected heapifyDown(i: number): void {\n // Swap the shifted element down in the heap until it either reaches the\n // bottom layer or is in correct order relative to it's children\n while (i < this.data.length) {\n const l = i * 2 + 1;\n const r = i * 2 + 2;\n let toSwap = i;\n\n // Find which one of element i and it's children should be closest to root\n if (l < this.data.length && this.heapOrderABeforeB(this.data[l][0], this.data[toSwap][0])) toSwap = l;\n if (r < this.data.length && this.heapOrderABeforeB(this.data[r][0], this.data[toSwap][0])) toSwap = r;\n\n // Already in order?\n if (i == toSwap) break;\n\n // Not in order. Swap child that should be closest to root up to 'i' and repeat\n const tmp = this.data[toSwap];\n this.data[toSwap] = this.data[i];\n this.data[i] = tmp;\n\n i = toSwap;\n }\n }\n\n /**\n * Should element with weight `weightA` be closer to root than element with\n * weight `weightB`?\n */\n protected abstract heapOrderABeforeB(weightA: number, weightB: number): boolean;\n}\n\n/** Binary max-heap. */\nexport class MaxHeap<T> extends BinHeap<T> {\n heapOrderABeforeB(weightA: number, weightB: number): boolean {\n return weightA > weightB;\n }\n}\n\n/** Binary min-heap. */\nexport class MinHeap<T> extends BinHeap<T> {\n heapOrderABeforeB(weightA: number, weightB: number): boolean {\n return weightA < weightB;\n }\n}\n","import * as posNames from \"./companypositionnames\";\nimport { IConstructorParams } from \"../Company\";\n\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\n// Create Objects containing Company Positions by category\n// Will help in metadata construction later\nconst AllSoftwarePositions: Record<string, boolean> = {};\nconst AllITPositions: Record<string, boolean> = {};\nconst AllNetworkEngineerPositions: Record<string, boolean> = {};\nconst SecurityEngineerPositions: Record<string, boolean> = {};\nconst AllTechnologyPositions: Record<string, boolean> = {};\nconst AllBusinessPositions: Record<string, boolean> = {};\nconst AllAgentPositions: Record<string, boolean> = {};\nconst AllSecurityPositions: Record<string, boolean> = {};\nconst AllSoftwareConsultantPositions: Record<string, boolean> = {};\nconst AllBusinessConsultantPositions: Record<string, boolean> = {};\nconst SoftwarePositionsUpToHeadOfEngineering: Record<string, boolean> = {};\nconst SoftwarePositionsUpToLeadDeveloper: Record<string, boolean> = {};\nconst BusinessPositionsUpToOperationsManager: Record<string, boolean> = {};\nconst WaiterOnly: Record<string, boolean> = {};\nconst EmployeeOnly: Record<string, boolean> = {};\nconst PartTimeWaiterOnly: Record<string, boolean> = {};\nconst PartTimeEmployeeOnly: Record<string, boolean> = {};\nconst OperationsManagerOnly: Record<string, boolean> = {};\nconst CEOOnly: Record<string, boolean> = {};\n\nposNames.SoftwareCompanyPositions.forEach((e) => {\n AllSoftwarePositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nposNames.ITCompanyPositions.forEach((e) => {\n AllITPositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nposNames.NetworkEngineerCompanyPositions.forEach((e) => {\n AllNetworkEngineerPositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nAllTechnologyPositions[posNames.SecurityEngineerCompanyPositions[0]] = true;\nSecurityEngineerPositions[posNames.SecurityEngineerCompanyPositions[0]] = true;\n\nposNames.BusinessCompanyPositions.forEach((e) => {\n AllBusinessPositions[e] = true;\n});\n\nposNames.SecurityCompanyPositions.forEach((e) => {\n AllSecurityPositions[e] = true;\n});\n\nposNames.AgentCompanyPositions.forEach((e) => {\n AllAgentPositions[e] = true;\n});\n\nposNames.SoftwareConsultantCompanyPositions.forEach((e) => {\n AllSoftwareConsultantPositions[e] = true;\n});\n\nposNames.BusinessConsultantCompanyPositions.forEach((e) => {\n AllBusinessConsultantPositions[e] = true;\n});\n\nfor (let i = 0; i < posNames.SoftwareCompanyPositions.length; ++i) {\n const e = posNames.SoftwareCompanyPositions[i];\n if (i <= 5) {\n SoftwarePositionsUpToHeadOfEngineering[e] = true;\n }\n if (i <= 3) {\n SoftwarePositionsUpToLeadDeveloper[e] = true;\n }\n}\nfor (let i = 0; i < posNames.BusinessCompanyPositions.length; ++i) {\n const e = posNames.BusinessCompanyPositions[i];\n if (i <= 3) {\n BusinessPositionsUpToOperationsManager[e] = true;\n }\n}\n\nWaiterOnly[posNames.MiscCompanyPositions[0]] = true;\nEmployeeOnly[posNames.MiscCompanyPositions[1]] = true;\nPartTimeWaiterOnly[posNames.PartTimeCompanyPositions[0]] = true;\nPartTimeEmployeeOnly[posNames.PartTimeCompanyPositions[1]] = true;\nOperationsManagerOnly[posNames.BusinessCompanyPositions[3]] = true;\nCEOOnly[posNames.BusinessCompanyPositions[5]] = true;\n\n// Metadata\nexport const companiesMetadata: IConstructorParams[] = [\n {\n name: LocationName.AevumECorp,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 3,\n salaryMultiplier: 3,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.Sector12MegaCorp,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 3,\n salaryMultiplier: 3,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.AevumBachmanAndAssociates,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.6,\n salaryMultiplier: 2.6,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.Sector12BladeIndustries,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.75,\n salaryMultiplier: 2.75,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.VolhavenNWO,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.75,\n salaryMultiplier: 2.75,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.AevumClarkeIncorporated,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.25,\n salaryMultiplier: 2.25,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.VolhavenOmniTekIncorporated,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.25,\n salaryMultiplier: 2.25,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.Sector12FourSigma,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.5,\n salaryMultiplier: 2.5,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.ChongqingKuaiGongInternational,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.2,\n salaryMultiplier: 2.2,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.AevumFulcrumTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.IshimaStormTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllSoftwareConsultantPositions, AllBusinessPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoDefComm,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.75,\n salaryMultiplier: 1.75,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.VolhavenHeliosLabs,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoVitaLife,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12IcarusMicrosystems,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.9,\n salaryMultiplier: 1.9,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12UniversalEnergy,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.AevumGalacticCybersystems,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.9,\n salaryMultiplier: 1.9,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.AevumAeroCorp,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.VolhavenOmniaCybersystems,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.ChongqingSolarisSpaceSystems,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12DeltaOne,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.6,\n salaryMultiplier: 1.6,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllBusinessPositions,\n AllSoftwareConsultantPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.IshimaNovaMedical,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllBusinessPositions,\n AllSoftwareConsultantPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.75,\n salaryMultiplier: 1.75,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12CIA,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n SecurityEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n ),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 149,\n },\n {\n name: LocationName.Sector12NSA,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n SecurityEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n ),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 149,\n },\n {\n name: LocationName.AevumWatchdogSecurity,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n AllSoftwareConsultantPositions,\n ),\n expMultiplier: 1.5,\n salaryMultiplier: 1.5,\n jobStatReqOffset: 124,\n },\n {\n name: LocationName.VolhavenLexoCorp,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllSoftwareConsultantPositions,\n AllBusinessPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.4,\n salaryMultiplier: 1.4,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.AevumRhoConstruction,\n info: \"\",\n companyPositions: Object.assign({}, SoftwarePositionsUpToLeadDeveloper, BusinessPositionsUpToOperationsManager),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 49,\n },\n {\n name: LocationName.Sector12AlphaEnterprises,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToLeadDeveloper,\n BusinessPositionsUpToOperationsManager,\n AllSoftwareConsultantPositions,\n ),\n expMultiplier: 1.5,\n salaryMultiplier: 1.5,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.AevumPolice,\n info: \"\",\n companyPositions: Object.assign({}, AllSecurityPositions, SoftwarePositionsUpToLeadDeveloper),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.VolhavenSysCoreSecurities,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 124,\n },\n {\n name: LocationName.VolhavenCompuTek,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 74,\n },\n {\n name: LocationName.AevumNetLinkTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.Sector12CarmichaelSecurity,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllSoftwareConsultantPositions,\n AllAgentPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 74,\n },\n {\n name: LocationName.Sector12FoodNStuff,\n info: \"\",\n companyPositions: Object.assign({}, EmployeeOnly, PartTimeEmployeeOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n {\n name: LocationName.Sector12JoesGuns,\n info: \"\",\n companyPositions: Object.assign({}, EmployeeOnly, PartTimeEmployeeOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n {\n name: LocationName.IshimaOmegaSoftware,\n info: \"\",\n companyPositions: Object.assign({}, AllSoftwarePositions, AllSoftwareConsultantPositions, AllITPositions),\n expMultiplier: 1.1,\n salaryMultiplier: 1.1,\n jobStatReqOffset: 49,\n },\n {\n name: LocationName.NewTokyoNoodleBar,\n info: \"\",\n companyPositions: Object.assign({}, WaiterOnly, PartTimeWaiterOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n];\n","import { CompanyPosition } from \"./CompanyPosition\";\nimport * as posNames from \"./data/companypositionnames\";\nimport { favorToRep, repToFavor } from \"../Faction/formulas/favor\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IConstructorParams {\n name: string;\n info: string;\n companyPositions: Record<string, boolean>;\n expMultiplier: number;\n salaryMultiplier: number;\n jobStatReqOffset: number;\n isMegacorp?: boolean;\n}\n\nconst DefaultConstructorParams: IConstructorParams = {\n name: \"\",\n info: \"\",\n companyPositions: {},\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n};\n\nexport class Company {\n /** Company name */\n name: string;\n\n /** Description and general information about company */\n info: string;\n\n /** Has faction associated. */\n isMegacorp: boolean;\n\n /**\n * Object that holds all available positions in this Company.\n * Position names are held in keys.\n * The values for the keys don't matter, but we'll make them booleans\n *\n * Must match names of Company Positions, defined in data/companypositionnames.ts\n */\n companyPositions: Record<string, boolean>;\n\n /** Company-specific multiplier for earnings */\n expMultiplier: number;\n salaryMultiplier: number;\n\n /**\n * The additional levels of stats you need to quality for a job\n * in this company.\n *\n * For example, the base stat requirement for an intern position is 1.\n * But if a company has a offset of 200, then you would need stat(s) of 201\n */\n jobStatReqOffset: number;\n\n /** Properties to track the player's progress in this company */\n isPlayerEmployed: boolean;\n playerReputation: number;\n favor: number;\n\n constructor(p: IConstructorParams = DefaultConstructorParams) {\n this.name = p.name;\n this.info = p.info;\n this.companyPositions = p.companyPositions;\n this.expMultiplier = p.expMultiplier;\n this.salaryMultiplier = p.salaryMultiplier;\n this.jobStatReqOffset = p.jobStatReqOffset;\n\n this.isPlayerEmployed = false;\n this.playerReputation = 1;\n this.favor = 0;\n this.isMegacorp = false;\n if (p.isMegacorp) this.isMegacorp = true;\n }\n\n hasPosition(pos: CompanyPosition | string): boolean {\n return this.companyPositions[typeof pos === \"string\" ? pos : pos.name] != null;\n }\n\n hasAgentPositions(): boolean {\n return this.companyPositions[posNames.AgentCompanyPositions[0]] != null;\n }\n\n hasBusinessConsultantPositions(): boolean {\n return this.companyPositions[posNames.BusinessConsultantCompanyPositions[0]] != null;\n }\n\n hasBusinessPositions(): boolean {\n return this.companyPositions[posNames.BusinessCompanyPositions[0]] != null;\n }\n\n hasEmployeePositions(): boolean {\n return this.companyPositions[posNames.MiscCompanyPositions[1]] != null;\n }\n\n hasITPositions(): boolean {\n return this.companyPositions[posNames.ITCompanyPositions[0]] != null;\n }\n\n hasSecurityPositions(): boolean {\n return this.companyPositions[posNames.SecurityCompanyPositions[2]] != null;\n }\n\n hasSoftwareConsultantPositions(): boolean {\n return this.companyPositions[posNames.SoftwareConsultantCompanyPositions[0]] != null;\n }\n\n hasSoftwarePositions(): boolean {\n return this.companyPositions[posNames.SoftwareCompanyPositions[0]] != null;\n }\n\n hasWaiterPositions(): boolean {\n return this.companyPositions[posNames.MiscCompanyPositions[0]] != null;\n }\n\n gainFavor(): void {\n if (this.favor == null) {\n this.favor = 0;\n }\n this.favor += this.getFavorGain();\n }\n\n getFavorGain(): number {\n if (this.favor == null) {\n this.favor = 0;\n }\n const storedRep = Math.max(0, favorToRep(this.favor));\n const totalRep = storedRep + this.playerReputation;\n const newFavor = repToFavor(totalRep);\n return newFavor - this.favor;\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Company\", this);\n }\n\n /** Initializes a Company from a JSON save state. */\n static fromJSON(value: IReviverValue): Company {\n return Generic_fromJSON(Company, value.data);\n }\n}\n\nReviver.constructors.Company = Company;\n","// Metadata used for constructing Company Positions\nimport { IConstructorParams } from \"../CompanyPosition\";\nimport * as posNames from \"./companypositionnames\";\n\nexport const companyPositionMetadata: IConstructorParams[] = [\n {\n name: posNames.SoftwareCompanyPositions[0], // Software Engineering Intern\n nextPosition: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer\n baseSalary: 33,\n charismaEffectiveness: 15,\n charismaExpGain: 0.02,\n hackingEffectiveness: 85,\n hackingExpGain: 0.05,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer\n nextPosition: posNames.SoftwareCompanyPositions[2], // Senior Software Engineer\n baseSalary: 80,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.1,\n reqdHacking: 51,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.SoftwareCompanyPositions[2], // Senior Software Engineer\n nextPosition: posNames.SoftwareCompanyPositions[3], // Lead Software Developer\n baseSalary: 165,\n charismaEffectiveness: 20,\n charismaExpGain: 0.08,\n hackingEffectiveness: 80,\n hackingExpGain: 0.4,\n reqdCharisma: 51,\n reqdHacking: 251,\n reqdReputation: 40e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.SoftwareCompanyPositions[3], // Lead Software Developer\n nextPosition: posNames.SoftwareCompanyPositions[4], // Head of Software\n baseSalary: 500,\n charismaEffectiveness: 25,\n charismaExpGain: 0.1,\n hackingEffectiveness: 75,\n hackingExpGain: 0.8,\n reqdCharisma: 151,\n reqdHacking: 401,\n reqdReputation: 200e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.SoftwareCompanyPositions[4], // Head of Software\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 800,\n charismaEffectiveness: 25,\n charismaExpGain: 0.5,\n hackingEffectiveness: 75,\n hackingExpGain: 1,\n reqdCharisma: 251,\n reqdHacking: 501,\n reqdReputation: 400e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n nextPosition: posNames.SoftwareCompanyPositions[6], // Vice President of Technology\n baseSalary: 1650,\n charismaEffectiveness: 25,\n charismaExpGain: 0.5,\n hackingEffectiveness: 75,\n hackingExpGain: 1.1,\n reqdCharisma: 251,\n reqdHacking: 501,\n reqdReputation: 800e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.SoftwareCompanyPositions[6], // Vice President of Technology\n nextPosition: posNames.SoftwareCompanyPositions[7], // Chief Technology Officer\n baseSalary: 2310,\n charismaEffectiveness: 30,\n charismaExpGain: 0.6,\n hackingEffectiveness: 70,\n hackingExpGain: 1.2,\n reqdCharisma: 401,\n reqdHacking: 601,\n reqdReputation: 1.6e6,\n repMultiplier: 1.75,\n },\n {\n name: posNames.SoftwareCompanyPositions[7], // Chief Technology Officer\n nextPosition: null,\n baseSalary: 2640,\n charismaEffectiveness: 35,\n charismaExpGain: 1,\n hackingEffectiveness: 65,\n hackingExpGain: 1.5,\n reqdCharisma: 501,\n reqdHacking: 751,\n reqdReputation: 3.2e6,\n repMultiplier: 2,\n },\n {\n name: posNames.ITCompanyPositions[0], // IT Intern\n nextPosition: posNames.ITCompanyPositions[1], // IT Analyst\n baseSalary: 26,\n charismaEffectiveness: 10,\n charismaExpGain: 0.01,\n hackingEffectiveness: 90,\n hackingExpGain: 0.04,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.ITCompanyPositions[1], // IT Analyst\n nextPosition: posNames.ITCompanyPositions[2], // IT Manager\n baseSalary: 66,\n charismaEffectiveness: 15,\n charismaExpGain: 0.02,\n hackingEffectiveness: 85,\n hackingExpGain: 0.08,\n reqdHacking: 26,\n reqdReputation: 7e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.ITCompanyPositions[2], // IT Manager\n nextPosition: posNames.ITCompanyPositions[3], // Systems Administrator\n baseSalary: 132,\n charismaEffectiveness: 20,\n charismaExpGain: 0.1,\n hackingEffectiveness: 80,\n hackingExpGain: 0.3,\n reqdCharisma: 51,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.ITCompanyPositions[3], // Systems Administrator\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 410,\n charismaEffectiveness: 20,\n charismaExpGain: 0.2,\n hackingEffectiveness: 80,\n hackingExpGain: 0.5,\n reqdCharisma: 76,\n reqdHacking: 251,\n reqdReputation: 175e3,\n repMultiplier: 1.4,\n },\n {\n name: posNames.SecurityEngineerCompanyPositions[0], // Security Engineer\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 121,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.4,\n reqdCharisma: 26,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.2,\n },\n {\n name: posNames.NetworkEngineerCompanyPositions[0], // Network Engineer\n nextPosition: posNames.NetworkEngineerCompanyPositions[1], // Network Administrator\n baseSalary: 121,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.4,\n reqdCharisma: 26,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.2,\n },\n {\n name: posNames.NetworkEngineerCompanyPositions[1], // Network Administrator\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 410,\n charismaEffectiveness: 20,\n charismaExpGain: 0.1,\n hackingEffectiveness: 80,\n hackingExpGain: 0.5,\n reqdCharisma: 76,\n reqdHacking: 251,\n reqdReputation: 175e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.BusinessCompanyPositions[0], // Business Intern\n nextPosition: posNames.BusinessCompanyPositions[1], // Business Analyst\n baseSalary: 46,\n charismaEffectiveness: 90,\n charismaExpGain: 0.08,\n hackingEffectiveness: 10,\n hackingExpGain: 0.01,\n reqdCharisma: 1,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.BusinessCompanyPositions[1], // Business Analyst\n nextPosition: posNames.BusinessCompanyPositions[2], // Business Manager\n baseSalary: 100,\n charismaEffectiveness: 85,\n charismaExpGain: 0.15,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 51,\n reqdHacking: 6,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.BusinessCompanyPositions[2], // Business Manager\n nextPosition: posNames.BusinessCompanyPositions[3], // Operations Manager\n baseSalary: 200,\n charismaEffectiveness: 85,\n charismaExpGain: 0.3,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 101,\n reqdHacking: 51,\n reqdReputation: 40e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.BusinessCompanyPositions[3], // Operations Manager\n nextPosition: posNames.BusinessCompanyPositions[4], // Chief Financial Officer\n baseSalary: 660,\n charismaEffectiveness: 85,\n charismaExpGain: 0.4,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 226,\n reqdHacking: 51,\n reqdReputation: 200e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.BusinessCompanyPositions[4], // Chief Financial Officer\n nextPosition: posNames.BusinessCompanyPositions[5], // Chief Executive Officer\n baseSalary: 1950,\n charismaEffectiveness: 90,\n charismaExpGain: 1,\n hackingEffectiveness: 10,\n hackingExpGain: 0.05,\n reqdCharisma: 501,\n reqdHacking: 76,\n reqdReputation: 800e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.BusinessCompanyPositions[5], // Chief Executive Officer\n nextPosition: null,\n baseSalary: 3900,\n charismaEffectiveness: 90,\n charismaExpGain: 1.5,\n hackingEffectiveness: 10,\n hackingExpGain: 0.05,\n reqdCharisma: 751,\n reqdHacking: 101,\n reqdReputation: 3.2e6,\n repMultiplier: 1.75,\n },\n {\n name: posNames.SecurityCompanyPositions[0], // Police Officer\n nextPosition: posNames.SecurityCompanyPositions[1], // Police Chief\n baseSalary: 82,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.02,\n strengthExpGain: 0.08,\n defenseExpGain: 0.08,\n dexterityExpGain: 0.08,\n agilityExpGain: 0.08,\n charismaExpGain: 0.04,\n reqdHacking: 11,\n reqdStrength: 101,\n reqdDefense: 101,\n reqdDexterity: 101,\n reqdAgility: 101,\n reqdCharisma: 51,\n reqdReputation: 8e3,\n repMultiplier: 1,\n },\n {\n name: posNames.SecurityCompanyPositions[1], // Police Chief\n nextPosition: null,\n baseSalary: 460,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.02,\n strengthExpGain: 0.1,\n defenseExpGain: 0.1,\n dexterityExpGain: 0.1,\n agilityExpGain: 0.1,\n charismaExpGain: 0.1,\n reqdHacking: 101,\n reqdStrength: 301,\n reqdDefense: 301,\n reqdDexterity: 301,\n reqdAgility: 301,\n reqdCharisma: 151,\n reqdReputation: 36e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.SecurityCompanyPositions[2], // Security Guard\n nextPosition: posNames.SecurityCompanyPositions[3], // Security Officer\n baseSalary: 50,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.01,\n strengthExpGain: 0.04,\n defenseExpGain: 0.04,\n dexterityExpGain: 0.04,\n agilityExpGain: 0.04,\n charismaExpGain: 0.02,\n reqdStrength: 51,\n reqdDefense: 51,\n reqdDexterity: 51,\n reqdAgility: 51,\n reqdCharisma: 1,\n repMultiplier: 1,\n },\n {\n name: posNames.SecurityCompanyPositions[3], // Security Officer\n nextPosition: posNames.SecurityCompanyPositions[4], // Security Supervisor\n baseSalary: 195,\n hackingEffectiveness: 10,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 10,\n hackingExpGain: 0.02,\n strengthExpGain: 0.1,\n defenseExpGain: 0.1,\n dexterityExpGain: 0.1,\n agilityExpGain: 0.1,\n charismaExpGain: 0.05,\n reqdHacking: 26,\n reqdStrength: 151,\n reqdDefense: 151,\n reqdDexterity: 151,\n reqdAgility: 151,\n reqdCharisma: 51,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.SecurityCompanyPositions[4], // Security Supervisor\n nextPosition: posNames.SecurityCompanyPositions[5], // Head of Security\n baseSalary: 660,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 15,\n agilityEffectiveness: 15,\n charismaEffectiveness: 30,\n hackingExpGain: 0.02,\n strengthExpGain: 0.12,\n defenseExpGain: 0.12,\n dexterityExpGain: 0.12,\n agilityExpGain: 0.12,\n charismaExpGain: 0.1,\n reqdHacking: 26,\n reqdStrength: 251,\n reqdDefense: 251,\n reqdDexterity: 251,\n reqdAgility: 251,\n reqdCharisma: 101,\n reqdReputation: 36e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.SecurityCompanyPositions[5], // Head of Security\n nextPosition: null,\n baseSalary: 1320,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 15,\n agilityEffectiveness: 15,\n charismaEffectiveness: 30,\n hackingExpGain: 0.05,\n strengthExpGain: 0.15,\n defenseExpGain: 0.15,\n dexterityExpGain: 0.15,\n agilityExpGain: 0.15,\n charismaExpGain: 0.15,\n reqdHacking: 51,\n reqdStrength: 501,\n reqdDefense: 501,\n reqdDexterity: 501,\n reqdAgility: 501,\n reqdCharisma: 151,\n reqdReputation: 144e3,\n repMultiplier: 1.4,\n },\n {\n name: posNames.AgentCompanyPositions[0], // Field Agent\n nextPosition: posNames.AgentCompanyPositions[1], // Secret Agent\n baseSalary: 330,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 20,\n hackingExpGain: 0.04,\n strengthExpGain: 0.08,\n defenseExpGain: 0.08,\n dexterityExpGain: 0.08,\n agilityExpGain: 0.08,\n charismaExpGain: 0.05,\n reqdHacking: 101,\n reqdStrength: 101,\n reqdDefense: 101,\n reqdDexterity: 101,\n reqdAgility: 101,\n reqdCharisma: 101,\n reqdReputation: 8e3,\n repMultiplier: 1,\n },\n {\n name: posNames.AgentCompanyPositions[1], // Secret Agent\n nextPosition: posNames.AgentCompanyPositions[2], // Special Operative\n baseSalary: 990,\n hackingEffectiveness: 15,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.1,\n strengthExpGain: 0.15,\n defenseExpGain: 0.15,\n dexterityExpGain: 0.15,\n agilityExpGain: 0.15,\n charismaExpGain: 0.1,\n reqdHacking: 201,\n reqdStrength: 251,\n reqdDefense: 251,\n reqdDexterity: 251,\n reqdAgility: 251,\n reqdCharisma: 201,\n reqdReputation: 32e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.AgentCompanyPositions[2], // Special Operative\n nextPosition: null,\n baseSalary: 2000,\n hackingEffectiveness: 15,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.15,\n strengthExpGain: 0.2,\n defenseExpGain: 0.2,\n dexterityExpGain: 0.2,\n agilityExpGain: 0.2,\n charismaExpGain: 0.15,\n reqdHacking: 251,\n reqdStrength: 501,\n reqdDefense: 501,\n reqdDexterity: 501,\n reqdAgility: 501,\n reqdCharisma: 251,\n reqdReputation: 162e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.MiscCompanyPositions[0], // Waiter\n nextPosition: null,\n baseSalary: 22,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.02,\n defenseExpGain: 0.02,\n dexterityExpGain: 0.02,\n agilityExpGain: 0.02,\n charismaExpGain: 0.05,\n repMultiplier: 1,\n },\n {\n name: posNames.MiscCompanyPositions[1], // Employee\n nextPosition: null,\n baseSalary: 22,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.02,\n defenseExpGain: 0.02,\n dexterityExpGain: 0.02,\n agilityExpGain: 0.02,\n charismaExpGain: 0.04,\n repMultiplier: 1,\n },\n {\n name: posNames.SoftwareConsultantCompanyPositions[0], // Software Consultant\n nextPosition: posNames.SoftwareConsultantCompanyPositions[1], // Senior Software Consultant\n baseSalary: 66,\n hackingEffectiveness: 80,\n charismaEffectiveness: 20,\n hackingExpGain: 0.08,\n charismaExpGain: 0.03,\n reqdHacking: 51,\n repMultiplier: 1,\n },\n {\n name: posNames.SoftwareConsultantCompanyPositions[1], // Senior Software Consultant\n nextPosition: null,\n baseSalary: 132,\n hackingEffectiveness: 75,\n charismaEffectiveness: 25,\n hackingExpGain: 0.25,\n charismaExpGain: 0.06,\n reqdHacking: 251,\n reqdCharisma: 51,\n repMultiplier: 1.2,\n },\n {\n name: posNames.BusinessConsultantCompanyPositions[0], // Business Consultant\n nextPosition: posNames.BusinessConsultantCompanyPositions[1], // Senior Business Consultant\n baseSalary: 66,\n hackingEffectiveness: 20,\n charismaEffectiveness: 80,\n hackingExpGain: 0.015,\n charismaExpGain: 0.15,\n reqdHacking: 6,\n reqdCharisma: 51,\n repMultiplier: 1,\n },\n {\n name: posNames.BusinessConsultantCompanyPositions[1], // Senior Business Consultant\n nextPosition: null,\n baseSalary: 525,\n hackingEffectiveness: 15,\n charismaEffectiveness: 85,\n hackingExpGain: 0.015,\n charismaExpGain: 0.3,\n reqdHacking: 51,\n reqdCharisma: 226,\n repMultiplier: 1.2,\n },\n {\n name: posNames.PartTimeCompanyPositions[0], // Part-time waiter\n nextPosition: null,\n baseSalary: 20,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.0075,\n defenseExpGain: 0.0075,\n dexterityExpGain: 0.0075,\n agilityExpGain: 0.0075,\n charismaExpGain: 0.04,\n repMultiplier: 1,\n },\n {\n name: posNames.PartTimeCompanyPositions[1], // Part-time employee\n nextPosition: null,\n baseSalary: 20,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.0075,\n defenseExpGain: 0.0075,\n dexterityExpGain: 0.0075,\n agilityExpGain: 0.0075,\n charismaExpGain: 0.03,\n repMultiplier: 1,\n },\n];\n","import { CONSTANTS } from \"../Constants\";\nimport * as names from \"./data/companypositionnames\";\n\n/* tslint:disable:completed-docs */\n\nexport interface IConstructorParams {\n name: string;\n nextPosition: string | null;\n baseSalary: number;\n repMultiplier: number;\n\n reqdHacking?: number;\n reqdStrength?: number;\n reqdDefense?: number;\n reqdDexterity?: number;\n reqdAgility?: number;\n reqdCharisma?: number;\n reqdReputation?: number;\n\n hackingEffectiveness?: number;\n strengthEffectiveness?: number;\n defenseEffectiveness?: number;\n dexterityEffectiveness?: number;\n agilityEffectiveness?: number;\n charismaEffectiveness?: number;\n\n hackingExpGain?: number;\n strengthExpGain?: number;\n defenseExpGain?: number;\n dexterityExpGain?: number;\n agilityExpGain?: number;\n charismaExpGain?: number;\n}\n\nexport class CompanyPosition {\n /** Position title */\n name: string;\n\n /** Title of next position to be promoted to */\n nextPosition: string | null;\n\n /**\n * Base salary for this position ($ per 200ms game cycle)\n * Will be multiplier by a company-specific multiplier for final salary\n */\n baseSalary: number;\n\n /** Reputation multiplier */\n repMultiplier: number;\n\n /** Required stats to earn this position */\n requiredAgility: number;\n requiredCharisma: number;\n requiredDefense: number;\n requiredDexterity: number;\n requiredHacking: number;\n requiredStrength: number;\n\n /** Required company reputation to earn this position */\n requiredReputation: number;\n\n /** Effectiveness of each stat time for job performance */\n hackingEffectiveness: number;\n strengthEffectiveness: number;\n defenseEffectiveness: number;\n dexterityEffectiveness: number;\n agilityEffectiveness: number;\n charismaEffectiveness: number;\n\n /** Experience gain for performing job (per 200ms game cycle) */\n hackingExpGain: number;\n strengthExpGain: number;\n defenseExpGain: number;\n dexterityExpGain: number;\n agilityExpGain: number;\n charismaExpGain: number;\n\n constructor(p: IConstructorParams) {\n this.name = p.name;\n this.nextPosition = p.nextPosition;\n this.baseSalary = p.baseSalary;\n this.repMultiplier = p.repMultiplier;\n\n this.requiredHacking = p.reqdHacking != null ? p.reqdHacking : 0;\n this.requiredStrength = p.reqdStrength != null ? p.reqdStrength : 0;\n this.requiredDefense = p.reqdDefense != null ? p.reqdDefense : 0;\n this.requiredDexterity = p.reqdDexterity != null ? p.reqdDexterity : 0;\n this.requiredAgility = p.reqdAgility != null ? p.reqdAgility : 0;\n this.requiredCharisma = p.reqdCharisma != null ? p.reqdCharisma : 0;\n this.requiredReputation = p.reqdReputation != null ? p.reqdReputation : 0;\n\n this.hackingEffectiveness = p.hackingEffectiveness != null ? p.hackingEffectiveness : 0;\n this.strengthEffectiveness = p.strengthEffectiveness != null ? p.strengthEffectiveness : 0;\n this.defenseEffectiveness = p.defenseEffectiveness != null ? p.defenseEffectiveness : 0;\n this.dexterityEffectiveness = p.dexterityEffectiveness != null ? p.dexterityEffectiveness : 0;\n this.agilityEffectiveness = p.agilityEffectiveness != null ? p.agilityEffectiveness : 0;\n this.charismaEffectiveness = p.charismaEffectiveness != null ? p.charismaEffectiveness : 0;\n\n if (\n Math.round(\n this.hackingEffectiveness +\n this.strengthEffectiveness +\n this.defenseEffectiveness +\n this.dexterityEffectiveness +\n this.agilityEffectiveness +\n this.charismaEffectiveness,\n ) !== 100\n ) {\n console.error(`CompanyPosition ${this.name} parameters do not sum to 100`);\n }\n\n this.hackingExpGain = p.hackingExpGain != null ? p.hackingExpGain : 0;\n this.strengthExpGain = p.strengthExpGain != null ? p.strengthExpGain : 0;\n this.defenseExpGain = p.defenseExpGain != null ? p.defenseExpGain : 0;\n this.dexterityExpGain = p.dexterityExpGain != null ? p.dexterityExpGain : 0;\n this.agilityExpGain = p.agilityExpGain != null ? p.agilityExpGain : 0;\n this.charismaExpGain = p.charismaExpGain != null ? p.charismaExpGain : 0;\n }\n\n calculateJobPerformance(hack: number, str: number, def: number, dex: number, agi: number, cha: number): number {\n const hackRatio: number = (this.hackingEffectiveness * hack) / CONSTANTS.MaxSkillLevel;\n const strRatio: number = (this.strengthEffectiveness * str) / CONSTANTS.MaxSkillLevel;\n const defRatio: number = (this.defenseEffectiveness * def) / CONSTANTS.MaxSkillLevel;\n const dexRatio: number = (this.dexterityEffectiveness * dex) / CONSTANTS.MaxSkillLevel;\n const agiRatio: number = (this.agilityEffectiveness * agi) / CONSTANTS.MaxSkillLevel;\n const chaRatio: number = (this.charismaEffectiveness * cha) / CONSTANTS.MaxSkillLevel;\n\n let reputationGain: number =\n (this.repMultiplier * (hackRatio + strRatio + defRatio + dexRatio + agiRatio + chaRatio)) / 100;\n if (isNaN(reputationGain)) {\n console.error(\"Company reputation gain calculated to be NaN\");\n reputationGain = 0;\n }\n\n return reputationGain;\n }\n\n isSoftwareJob(): boolean {\n return names.SoftwareCompanyPositions.includes(this.name);\n }\n\n isITJob(): boolean {\n return names.ITCompanyPositions.includes(this.name);\n }\n\n isSecurityEngineerJob(): boolean {\n return names.SecurityEngineerCompanyPositions.includes(this.name);\n }\n\n isNetworkEngineerJob(): boolean {\n return names.NetworkEngineerCompanyPositions.includes(this.name);\n }\n\n isBusinessJob(): boolean {\n return names.BusinessCompanyPositions.includes(this.name);\n }\n\n isSecurityJob(): boolean {\n return names.SecurityCompanyPositions.includes(this.name);\n }\n\n isAgentJob(): boolean {\n return names.AgentCompanyPositions.includes(this.name);\n }\n\n isSoftwareConsultantJob(): boolean {\n return names.SoftwareConsultantCompanyPositions.includes(this.name);\n }\n\n isBusinessConsultantJob(): boolean {\n return names.BusinessConsultantCompanyPositions.includes(this.name);\n }\n\n isPartTimeJob(): boolean {\n return names.PartTimeCompanyPositions.includes(this.name);\n }\n}\n","import { BaseServer } from \"../Server/BaseServer\";\n\nexport interface IProgramCreate {\n level: number;\n req(): boolean; // Function that indicates whether player meets requirements\n time: number;\n tooltip: string;\n}\n\nexport class Program {\n name = \"\";\n create: IProgramCreate | null;\n run: (args: string[], server: BaseServer) => void;\n\n constructor(name: string, create: IProgramCreate | null, run: (args: string[], server: BaseServer) => void) {\n this.name = name;\n this.create = create;\n this.run = run;\n }\n}\n","import { IProgramCreate } from \"../Program\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\nimport { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { BitFlumeEvent } from \"../../BitNode/ui/BitFlumeModal\";\nimport { calculateHackingTime, calculateGrowTime, calculateWeakenTime } from \"../../Hacking\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nfunction requireHackingLevel(lvl: number) {\n return function () {\n return Player.skills.hacking + Player.skills.intelligence / 2 >= lvl;\n };\n}\n\nfunction bitFlumeRequirements() {\n return function () {\n return Player.sourceFiles.length > 0 && Player.skills.hacking >= 1;\n };\n}\n\ninterface IProgramCreationParams {\n key: string;\n name: string;\n create: IProgramCreate | null;\n run: (args: string[], server: BaseServer) => void;\n}\n\nexport const programsMetadata: IProgramCreationParams[] = [\n {\n key: \"NukeProgram\",\n name: \"NUKE.exe\",\n create: {\n level: 1,\n tooltip: \"This virus is used to gain root access to a machine if enough ports are opened.\",\n req: requireHackingLevel(1),\n time: CONSTANTS.MillisecondsPerFiveMinutes,\n },\n run: (_args: string[], server: BaseServer): void => {\n if (!(server instanceof Server)) {\n Terminal.error(\"Cannot nuke this kind of server.\");\n return;\n }\n if (server.hasAdminRights) {\n Terminal.print(\"You already have root access to this computer. There is no reason to run NUKE.exe\");\n Terminal.print(\"You can now run scripts on this server.\");\n return;\n }\n if (server.openPortCount >= server.numOpenPortsRequired) {\n server.hasAdminRights = true;\n Terminal.print(\"NUKE successful! Gained root access to \" + server.hostname);\n Terminal.print(\"You can now run scripts on this server.\");\n return;\n }\n\n Terminal.print(\"NUKE unsuccessful. Not enough ports have been opened\");\n },\n },\n {\n key: \"BruteSSHProgram\",\n name: \"BruteSSH.exe\",\n create: {\n level: 50,\n tooltip: \"This program executes a brute force attack that opens SSH ports\",\n req: requireHackingLevel(50),\n time: CONSTANTS.MillisecondsPerFiveMinutes * 2,\n },\n run: (_args: string[], server: BaseServer): void => {\n if (!(server instanceof Server)) {\n Terminal.error(\"Cannot run BruteSSH.exe on this kind of server.\");\n return;\n }\n if (server.sshPortOpen) {\n Terminal.print(\"SSH Port (22) is already open!\");\n return;\n }\n\n server.sshPortOpen = true;\n Terminal.print(\"Opened SSH Port(22)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"FTPCrackProgram\",\n name: \"FTPCrack.exe\",\n create: {\n level: 100,\n tooltip: \"This program cracks open FTP ports\",\n req: requireHackingLevel(100),\n time: CONSTANTS.MillisecondsPerHalfHour,\n },\n run: (_args: string[], server: BaseServer): void => {\n if (!(server instanceof Server)) {\n Terminal.error(\"Cannot run FTPCrack.exe on this kind of server.\");\n return;\n }\n if (server.ftpPortOpen) {\n Terminal.print(\"FTP Port (21) is already open!\");\n return;\n }\n\n server.ftpPortOpen = true;\n Terminal.print(\"Opened FTP Port (21)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"RelaySMTPProgram\",\n name: \"relaySMTP.exe\",\n create: {\n level: 250,\n tooltip: \"This program opens SMTP ports by redirecting data\",\n req: requireHackingLevel(250),\n time: CONSTANTS.MillisecondsPer2Hours,\n },\n run: (_args: string[], server: BaseServer): void => {\n if (!(server instanceof Server)) {\n Terminal.error(\"Cannot run relaySMTP.exe on this kind of server.\");\n return;\n }\n if (server.smtpPortOpen) {\n Terminal.print(\"SMTP Port (25) is already open!\");\n return;\n }\n\n server.smtpPortOpen = true;\n Terminal.print(\"Opened SMTP Port (25)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"HTTPWormProgram\",\n name: \"HTTPWorm.exe\",\n create: {\n level: 500,\n tooltip: \"This virus opens up HTTP ports\",\n req: requireHackingLevel(500),\n time: CONSTANTS.MillisecondsPer4Hours,\n },\n run: (_args: string[], server: BaseServer): void => {\n if (!(server instanceof Server)) {\n Terminal.error(\"Cannot run HTTPWorm.exe on this kind of server.\");\n return;\n }\n if (server.httpPortOpen) {\n Terminal.print(\"HTTP Port (80) is already open!\");\n return;\n }\n\n server.httpPortOpen = true;\n Terminal.print(\"Opened HTTP Port (80)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"SQLInjectProgram\",\n name: \"SQLInject.exe\",\n create: {\n level: 750,\n tooltip: \"This virus opens SQL ports\",\n req: requireHackingLevel(750),\n time: CONSTANTS.MillisecondsPer8Hours,\n },\n run: (_args: string[], server: BaseServer): void => {\n if (!(server instanceof Server)) {\n Terminal.error(\"Cannot run SQLInject.exe on this kind of server.\");\n return;\n }\n if (server.sqlPortOpen) {\n Terminal.print(\"SQL Port (1433) is already open!\");\n return;\n }\n\n server.sqlPortOpen = true;\n Terminal.print(\"Opened SQL Port (1433)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"DeepscanV1\",\n name: \"DeepscanV1.exe\",\n create: {\n level: 75,\n tooltip: \"This program allows you to use the scan-analyze command with a depth up to 5\",\n req: requireHackingLevel(75),\n time: CONSTANTS.MillisecondsPerQuarterHour,\n },\n run: (): void => {\n Terminal.print(\"This executable cannot be run.\");\n Terminal.print(\"DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5.\");\n },\n },\n {\n key: \"DeepscanV2\",\n name: \"DeepscanV2.exe\",\n create: {\n level: 400,\n tooltip: \"This program allows you to use the scan-analyze command with a depth up to 10\",\n req: requireHackingLevel(400),\n time: CONSTANTS.MillisecondsPer2Hours,\n },\n run: (): void => {\n Terminal.print(\"This executable cannot be run.\");\n Terminal.print(\"DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.\");\n },\n },\n {\n key: \"ServerProfiler\",\n name: \"ServerProfiler.exe\",\n create: {\n level: 75,\n tooltip: \"This program is used to display hacking and Netscript-related information about servers\",\n req: requireHackingLevel(75),\n time: CONSTANTS.MillisecondsPerHalfHour,\n },\n run: (args: string[]): void => {\n if (args.length !== 1) {\n Terminal.error(\"Must pass a server hostname or IP as an argument for ServerProfiler.exe\");\n return;\n }\n\n const targetServer = GetServer(args[0]);\n if (targetServer == null) {\n Terminal.error(\"Invalid server IP/hostname\");\n return;\n }\n\n if (!(targetServer instanceof Server)) {\n Terminal.error(`ServerProfiler.exe can only be run on normal servers.`);\n return;\n }\n\n Terminal.print(targetServer.hostname + \":\");\n Terminal.print(\"Server base security level: \" + targetServer.baseDifficulty);\n Terminal.print(\"Server current security level: \" + targetServer.hackDifficulty);\n Terminal.print(\"Server growth rate: \" + targetServer.serverGrowth);\n Terminal.print(\n `Netscript hack() execution time: ${convertTimeMsToTimeElapsedString(\n calculateHackingTime(targetServer, Player) * 1000,\n true,\n )}`,\n );\n Terminal.print(\n `Netscript grow() execution time: ${convertTimeMsToTimeElapsedString(\n calculateGrowTime(targetServer, Player) * 1000,\n true,\n )}`,\n );\n Terminal.print(\n `Netscript weaken() execution time: ${convertTimeMsToTimeElapsedString(\n calculateWeakenTime(targetServer, Player) * 1000,\n true,\n )}`,\n );\n },\n },\n {\n key: \"AutoLink\",\n name: \"AutoLink.exe\",\n create: {\n level: 25,\n tooltip: \"This program allows you to directly connect to other servers through the 'scan-analyze' command\",\n req: requireHackingLevel(25),\n time: CONSTANTS.MillisecondsPerQuarterHour,\n },\n run: (): void => {\n Terminal.print(\"This executable cannot be run.\");\n Terminal.print(\"AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'.\");\n Terminal.print(\"When using scan-analyze, click on a server's hostname to connect to it.\");\n },\n },\n {\n key: \"Formulas\",\n name: \"Formulas.exe\",\n create: {\n level: 1000,\n tooltip: \"This program allows you to use the formulas API\",\n req: requireHackingLevel(1000),\n time: CONSTANTS.MillisecondsPer4Hours,\n },\n run: (): void => {\n Terminal.print(\"This executable cannot be run.\");\n Terminal.print(\"Formulas.exe lets you use the formulas API.\");\n },\n },\n {\n key: \"BitFlume\",\n name: \"b1t_flum3.exe\",\n create: {\n level: 1,\n tooltip: \"This program creates a portal to the BitNode Nexus (allows you to restart and switch BitNodes)\",\n req: bitFlumeRequirements(),\n time: CONSTANTS.MillisecondsPerFiveMinutes / 20,\n },\n run: (): void => {\n BitFlumeEvent.emit();\n },\n },\n {\n key: \"Flight\",\n name: \"fl1ght.exe\",\n create: null,\n run: (): void => {\n const numAugReq = BitNodeMultipliers.DaedalusAugsRequirement;\n const fulfilled =\n Player.augmentations.length >= numAugReq && Player.money > 1e11 && Player.skills.hacking >= 2500;\n if (!fulfilled) {\n Terminal.print(`Augmentations: ${Player.augmentations.length} / ${numAugReq}`);\n Terminal.print(`Money: ${numeralWrapper.formatMoney(Player.money)} / $100b`);\n Terminal.print(`Hacking skill: ${Player.skills.hacking} / 2500`);\n return;\n }\n\n Terminal.print(\"We will contact you.\");\n Terminal.print(`-- ${FactionNames.Daedalus} --`);\n },\n },\n];\n","// Function that generates a random gibberish string of length n\nconst chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\nexport function createRandomString(n: number): string {\n let str = \"\";\n\n for (let i = 0; i < n; ++i) {\n str += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n\n return str;\n}\n","import { Output, Link, RawOutput, TTimer } from \"./OutputTypes\";\nimport { Router } from \"../ui/GameRoot\";\nimport { Player } from \"@player\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { Server } from \"../Server/Server\";\nimport { Programs } from \"../Programs/Programs\";\nimport { CodingContractResult } from \"../CodingContracts\";\nimport { TerminalEvents, TerminalClearEvents } from \"./TerminalEvents\";\n\nimport { TextFile } from \"../TextFile\";\nimport { Script } from \"../Script/Script\";\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\nimport { CONSTANTS } from \"../Constants\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\n\nimport { removeLeadingSlash, isInRootDirectory, evaluateFilePath } from \"./DirectoryHelpers\";\nimport { checkIfConnectedToDarkweb } from \"../DarkWeb/DarkWeb\";\nimport { iTutorialNextStep, iTutorialSteps, ITutorial } from \"../InteractiveTutorial\";\nimport { getServerOnNetwork, processSingleServerGrowth } from \"../Server/ServerHelpers\";\nimport { ParseCommand, ParseCommands } from \"./Parser\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Settings } from \"../Settings/Settings\";\nimport { createProgressBarText } from \"../utils/helpers/createProgressBarText\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"../Hacking\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\n\nimport { alias } from \"./commands/alias\";\nimport { analyze } from \"./commands/analyze\";\nimport { backdoor } from \"./commands/backdoor\";\nimport { buy } from \"./commands/buy\";\nimport { cat } from \"./commands/cat\";\nimport { cd } from \"./commands/cd\";\nimport { check } from \"./commands/check\";\nimport { connect } from \"./commands/connect\";\nimport { cp } from \"./commands/cp\";\nimport { download } from \"./commands/download\";\nimport { expr } from \"./commands/expr\";\nimport { free } from \"./commands/free\";\nimport { grow } from \"./commands/grow\";\nimport { hack } from \"./commands/hack\";\nimport { help } from \"./commands/help\";\nimport { history } from \"./commands/history\";\nimport { home } from \"./commands/home\";\nimport { hostname } from \"./commands/hostname\";\nimport { kill } from \"./commands/kill\";\nimport { killall } from \"./commands/killall\";\nimport { ls } from \"./commands/ls\";\nimport { lscpu } from \"./commands/lscpu\";\nimport { mem } from \"./commands/mem\";\nimport { mv } from \"./commands/mv\";\nimport { nano } from \"./commands/nano\";\nimport { ps } from \"./commands/ps\";\nimport { rm } from \"./commands/rm\";\nimport { run } from \"./commands/run\";\nimport { scan } from \"./commands/scan\";\nimport { scananalyze } from \"./commands/scananalyze\";\nimport { scp } from \"./commands/scp\";\nimport { sudov } from \"./commands/sudov\";\nimport { tail } from \"./commands/tail\";\nimport { top } from \"./commands/top\";\nimport { unalias } from \"./commands/unalias\";\nimport { vim } from \"./commands/vim\";\nimport { weaken } from \"./commands/weaken\";\nimport { wget } from \"./commands/wget\";\nimport { hash } from \"../hash/hash\";\nimport { apr1 } from \"./commands/apr1\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\nexport class Terminal {\n // Flags to determine whether the player is currently running a hack or an analyze\n action: TTimer | null = null;\n\n commandHistory: string[] = [];\n commandHistoryIndex = 0;\n\n outputHistory: (Output | Link | RawOutput)[] = [\n new Output(`Bitburner v${CONSTANTS.VersionString} (${hash()})`, \"primary\"),\n ];\n\n // True if a Coding Contract prompt is opened\n contractOpen = false;\n\n // Full Path of current directory\n // Excludes the trailing forward slash\n currDir = \"/\";\n\n process(cycles: number): void {\n if (this.action === null) return;\n this.action.timeLeft -= (CONSTANTS._idleSpeed * cycles) / 1000;\n if (this.action.timeLeft < 0.01) this.finishAction(false);\n TerminalEvents.emit();\n }\n\n append(item: Output | Link | RawOutput): void {\n this.outputHistory.push(item);\n if (this.outputHistory.length > Settings.MaxTerminalCapacity) {\n this.outputHistory.splice(0, this.outputHistory.length - Settings.MaxTerminalCapacity);\n }\n TerminalEvents.emit();\n }\n\n print(s: string): void {\n this.append(new Output(s, \"primary\"));\n }\n\n printRaw(node: React.ReactNode): void {\n this.append(new RawOutput(node));\n }\n\n error(s: string): void {\n this.append(new Output(s, \"error\"));\n }\n\n success(s: string): void {\n this.append(new Output(s, \"success\"));\n }\n\n info(s: string): void {\n this.append(new Output(s, \"info\"));\n }\n\n warn(s: string): void {\n this.append(new Output(s, \"warn\"));\n }\n\n startHack(): void {\n // Hacking through Terminal should be faster than hacking through a script\n const server = Player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateHackingTime(server, Player) / 4, \"h\", server);\n }\n\n startGrow(): void {\n const server = Player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot grow this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateGrowTime(server, Player) / 16, \"g\", server);\n }\n startWeaken(): void {\n const server = Player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot weaken this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateWeakenTime(server, Player) / 16, \"w\", server);\n }\n\n startBackdoor(): void {\n // Backdoor should take the same amount of time as hack\n const server = Player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot backdoor this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateHackingTime(server, Player) / 4, \"b\", server);\n }\n\n startAnalyze(): void {\n this.print(\"Analyzing system...\");\n const server = Player.getCurrentServer();\n this.startAction(1, \"a\", server);\n }\n\n startAction(n: number, action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\", server?: BaseServer): void {\n this.action = new TTimer(n, action, server);\n }\n\n // Complete the hack/analyze command\n finishHack(server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n\n // Calculate whether hack was successful\n const hackChance = calculateHackingChance(server, Player);\n const rand = Math.random();\n const expGainedOnSuccess = calculateHackingExpGain(server, Player);\n const expGainedOnFailure = expGainedOnSuccess / 4;\n if (rand < hackChance) {\n // Success!\n server.backdoorInstalled = true;\n if (SpecialServers.WorldDaemon === server.hostname) {\n Router.toBitVerse(false, false);\n return;\n }\n let moneyGained = calculatePercentMoneyHacked(server, Player) * BitNodeMultipliers.ManualHackMoney;\n moneyGained = Math.floor(server.moneyAvailable * moneyGained);\n\n if (moneyGained <= 0) {\n moneyGained = 0;\n } // Safety check\n\n server.moneyAvailable -= moneyGained;\n Player.gainMoney(moneyGained, \"hacking\");\n Player.gainHackingExp(expGainedOnSuccess);\n Player.gainIntelligenceExp(expGainedOnSuccess / CONSTANTS.IntelligenceTerminalHackBaseExpGain);\n\n const oldSec = server.hackDifficulty;\n server.fortify(CONSTANTS.ServerFortifyAmount);\n const newSec = server.hackDifficulty;\n\n this.print(\n `Hack successful on '${server.hostname}'! Gained ${numeralWrapper.formatMoney(\n moneyGained,\n )} and ${numeralWrapper.formatExp(expGainedOnSuccess)} hacking exp`,\n );\n this.print(\n `Security increased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)}`,\n );\n } else {\n // Failure\n Player.gainHackingExp(expGainedOnFailure);\n this.print(\n `Failed to hack '${server.hostname}'. Gained ${numeralWrapper.formatExp(expGainedOnFailure)} hacking exp`,\n );\n }\n }\n\n finishGrow(server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot grow this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n const expGain = calculateHackingExpGain(server, Player);\n const oldSec = server.hackDifficulty;\n const growth = processSingleServerGrowth(server, 25, server.cpuCores) - 1;\n const newSec = server.hackDifficulty;\n\n Player.gainHackingExp(expGain);\n this.print(\n `Available money on '${server.hostname}' grown by ${numeralWrapper.formatPercentage(\n growth,\n 6,\n )}. Gained ${numeralWrapper.formatExp(expGain)} hacking exp.`,\n );\n this.print(\n `Security increased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)}`,\n );\n }\n\n finishWeaken(server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot weaken this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n const expGain = calculateHackingExpGain(server, Player);\n const oldSec = server.hackDifficulty;\n server.weaken(CONSTANTS.ServerWeakenAmount);\n const newSec = server.hackDifficulty;\n\n Player.gainHackingExp(expGain);\n this.print(\n `Security decreased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)} (min: ${numeralWrapper.formatSecurity(server.minDifficulty)})` +\n ` and Gained ${numeralWrapper.formatExp(expGain)} hacking exp.`,\n );\n }\n\n finishBackdoor(server: BaseServer, cancelled = false): void {\n if (!cancelled) {\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n server.backdoorInstalled = true;\n if (SpecialServers.WorldDaemon === server.hostname) {\n if (Player.bitNodeN == null) {\n Player.bitNodeN = 1;\n }\n Router.toBitVerse(false, false);\n return;\n }\n this.print(`Backdoor on '${server.hostname}' successful!`);\n }\n }\n\n finishAnalyze(currServ: BaseServer, cancelled = false): void {\n if (!cancelled) {\n const isHacknet = currServ instanceof HacknetServer;\n this.print(currServ.hostname + \": \");\n const org = currServ.organizationName;\n this.print(\"Organization name: \" + (!isHacknet ? org : \"player\"));\n const hasAdminRights = (!isHacknet && currServ.hasAdminRights) || isHacknet;\n this.print(\"Root Access: \" + (hasAdminRights ? \"YES\" : \"NO\"));\n const canRunScripts = hasAdminRights && currServ.maxRam > 0;\n this.print(\"Can run scripts on this host: \" + (canRunScripts ? \"YES\" : \"NO\"));\n this.print(\"RAM: \" + numeralWrapper.formatRAM(currServ.maxRam));\n if (currServ instanceof Server) {\n this.print(\"Backdoor: \" + (currServ.backdoorInstalled ? \"YES\" : \"NO\"));\n const hackingSkill = currServ.requiredHackingSkill;\n this.print(\"Required hacking skill for hack() and backdoor: \" + (!isHacknet ? hackingSkill : \"N/A\"));\n const security = currServ.hackDifficulty;\n this.print(\"Server security level: \" + (!isHacknet ? numeralWrapper.formatServerSecurity(security) : \"N/A\"));\n const hackingChance = calculateHackingChance(currServ, Player);\n this.print(\"Chance to hack: \" + (!isHacknet ? numeralWrapper.formatPercentage(hackingChance) : \"N/A\"));\n const hackingTime = calculateHackingTime(currServ, Player) * 1000;\n this.print(\"Time to hack: \" + (!isHacknet ? convertTimeMsToTimeElapsedString(hackingTime, true) : \"N/A\"));\n }\n this.print(\n `Total money available on server: ${\n currServ instanceof Server ? numeralWrapper.formatMoney(currServ.moneyAvailable) : \"N/A\"\n }`,\n );\n if (currServ instanceof Server) {\n const numPort = currServ.numOpenPortsRequired;\n this.print(\"Required number of open ports for NUKE: \" + (!isHacknet ? numPort : \"N/A\"));\n this.print(\"SSH port: \" + (currServ.sshPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"FTP port: \" + (currServ.ftpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"SMTP port: \" + (currServ.smtpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"HTTP port: \" + (currServ.httpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"SQL port: \" + (currServ.sqlPortOpen ? \"Open\" : \"Closed\"));\n }\n }\n }\n\n finishAction(cancelled = false): void {\n if (this.action === null) {\n if (!cancelled) throw new Error(\"Finish action called when there was no action\");\n return;\n }\n\n if (!this.action.server) throw new Error(\"Missing action target server\");\n\n this.print(this.getProgressText());\n if (this.action.action === \"h\") {\n this.finishHack(this.action.server, cancelled);\n } else if (this.action.action === \"g\") {\n this.finishGrow(this.action.server, cancelled);\n } else if (this.action.action === \"w\") {\n this.finishWeaken(this.action.server, cancelled);\n } else if (this.action.action === \"b\") {\n this.finishBackdoor(this.action.server, cancelled);\n } else if (this.action.action === \"a\") {\n this.finishAnalyze(this.action.server, cancelled);\n }\n\n if (cancelled) {\n this.print(\"Cancelled\");\n }\n this.action = null;\n TerminalEvents.emit();\n }\n\n getFile(filename: string): Script | TextFile | string | null {\n if (isScriptFilename(filename)) {\n return this.getScript(filename);\n }\n\n if (filename.endsWith(\".lit\")) {\n return this.getLitFile(filename);\n }\n\n if (filename.endsWith(\".txt\")) {\n return this.getTextFile(filename);\n }\n\n return null;\n }\n\n getFilepath(filename: string): string {\n const path = evaluateFilePath(filename, this.cwd());\n if (path == null) {\n throw new Error(`Invalid file path specified: ${filename}`);\n }\n\n if (isInRootDirectory(path)) {\n return removeLeadingSlash(path);\n }\n\n return path;\n }\n\n getScript(filename: string): Script | null {\n const s = Player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const script of s.scripts) {\n if (filepath === script.filename) {\n return script;\n }\n }\n\n return null;\n }\n\n getTextFile(filename: string): TextFile | null {\n const s = Player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const txt of s.textFiles) {\n if (filepath === txt.fn) {\n return txt;\n }\n }\n\n return null;\n }\n\n getLitFile(filename: string): string | null {\n const s = Player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const lit of s.messages) {\n if (typeof lit === \"string\" && filepath === lit) {\n return lit;\n }\n }\n\n return null;\n }\n\n cwd(): string {\n return this.currDir;\n }\n\n setcwd(dir: string): void {\n this.currDir = dir;\n TerminalEvents.emit();\n }\n\n async runContract(contractName: string): Promise<void> {\n // There's already an opened contract\n if (this.contractOpen) {\n return this.error(\"There's already a Coding Contract in Progress\");\n }\n\n const serv = Player.getCurrentServer();\n const contract = serv.getContract(contractName);\n if (contract == null) {\n return this.error(\"No such contract\");\n }\n\n this.contractOpen = true;\n const res = await contract.prompt();\n\n //Check if the contract still exists by the time the promise is fulfilled\n if (serv.getContract(contractName) == null) {\n this.contractOpen = false;\n return this.error(\"Contract no longer exists (Was it solved by a script?)\");\n }\n\n switch (res) {\n case CodingContractResult.Success:\n if (contract.reward !== null) {\n const reward = Player.gainCodingContractReward(contract.reward, contract.getDifficulty());\n this.print(`Contract SUCCESS - ${reward}`);\n }\n serv.removeContract(contract);\n break;\n case CodingContractResult.Failure:\n ++contract.tries;\n if (contract.tries >= contract.getMaxNumTries()) {\n this.error(\"Contract FAILED - Contract is now self-destructing\");\n serv.removeContract(contract);\n } else {\n this.error(`Contract FAILED - ${contract.getMaxNumTries() - contract.tries} tries remaining`);\n }\n break;\n case CodingContractResult.Cancelled:\n default:\n this.print(\"Contract cancelled\");\n break;\n }\n this.contractOpen = false;\n }\n\n executeScanAnalyzeCommand(depth = 1, all = false): void {\n // TODO Using array as stack for now, can make more efficient\n this.print(\"~~~~~~~~~~ Beginning scan-analyze ~~~~~~~~~~\");\n this.print(\" \");\n\n // Map of all servers to keep track of which have been visited\n const visited: {\n [key: string]: number | undefined;\n } = {};\n for (const server of GetAllServers()) {\n visited[server.hostname] = 0;\n }\n\n const stack: BaseServer[] = [];\n const depthQueue: number[] = [0];\n const currServ = Player.getCurrentServer();\n stack.push(currServ);\n while (stack.length != 0) {\n const s = stack.pop();\n if (!s) continue;\n const d = depthQueue.pop();\n if (d === undefined) continue;\n const isHacknet = s instanceof HacknetServer;\n if (!all && s.purchasedByPlayer && s.hostname != \"home\") {\n continue; // Purchased server\n } else if (visited[s.hostname] || d > depth) {\n continue; // Already visited or out-of-depth\n } else if (!all && isHacknet) {\n continue; // Hacknet Server\n } else {\n visited[s.hostname] = 1;\n }\n for (let i = s.serversOnNetwork.length - 1; i >= 0; --i) {\n const newS = getServerOnNetwork(s, i);\n if (newS === null) continue;\n stack.push(newS);\n depthQueue.push(d + 1);\n }\n if (d == 0) {\n continue;\n } // Don't print current server\n const titleDashes = Array((d - 1) * 4 + 1).join(\"-\");\n if (Player.hasProgram(Programs.AutoLink.name)) {\n this.append(new Link(titleDashes, s.hostname));\n } else {\n this.print(titleDashes + s.hostname);\n }\n\n const dashes = titleDashes + \"--\";\n let c = \"NO\";\n if (s.hasAdminRights) {\n c = \"YES\";\n }\n if (s instanceof Server) {\n this.print(\n `${dashes}Root Access: ${c}${!isHacknet ? \", Required hacking skill: \" + s.requiredHackingSkill : \"\"}`,\n );\n\n if (s.hasOwnProperty(\"numOpenPortsRequired\")) {\n this.print(dashes + \"Number of open ports required to NUKE: \" + s.numOpenPortsRequired);\n }\n }\n this.print(dashes + \"RAM: \" + numeralWrapper.formatRAM(s.maxRam));\n this.print(\" \");\n }\n }\n\n connectToServer(server: string): void {\n const serv = GetServer(server);\n if (serv == null) {\n this.error(\"Invalid server. Connection failed.\");\n return;\n }\n Player.getCurrentServer().isConnectedTo = false;\n Player.currentServer = serv.hostname;\n Player.getCurrentServer().isConnectedTo = true;\n this.print(\"Connected to \" + serv.hostname);\n this.setcwd(\"/\");\n if (Player.getCurrentServer().hostname == \"darkweb\") {\n checkIfConnectedToDarkweb(); // Posts a 'help' message if connecting to dark web\n }\n }\n\n executeCommands(commands: string): void {\n // Sanitize input\n commands = commands.trim();\n commands = commands.replace(/\\s\\s+/g, \" \"); // Replace all extra whitespace in command with a single space\n\n // Handle Terminal History - multiple commands should be saved as one\n if (this.commandHistory[this.commandHistory.length - 1] != commands) {\n this.commandHistory.push(commands);\n if (this.commandHistory.length > 50) {\n this.commandHistory.splice(0, 1);\n }\n Player.terminalCommandHistory = this.commandHistory;\n }\n this.commandHistoryIndex = this.commandHistory.length;\n const allCommands = ParseCommands(commands);\n\n for (let i = 0; i < allCommands.length; i++) {\n this.executeCommand(allCommands[i]);\n }\n }\n\n clear(): void {\n this.outputHistory = [new Output(`Bitburner v${CONSTANTS.VersionString} (${hash()})`, \"primary\")];\n TerminalEvents.emit();\n TerminalClearEvents.emit();\n }\n\n prestige(): void {\n this.action = null;\n this.clear();\n }\n\n executeCommand(command: string): void {\n if (this.action !== null) {\n this.error(`Cannot execute command (${command}) while an action is in progress`);\n return;\n }\n // Allow usage of ./\n if (command.startsWith(\"./\")) {\n command = \"run \" + command.slice(2);\n }\n // Only split the first space\n const commandArray = ParseCommand(command);\n if (commandArray.length == 0) {\n return;\n }\n const s = Player.getCurrentServer();\n /****************** Interactive Tutorial Terminal Commands ******************/\n if (ITutorial.isRunning) {\n const n00dlesServ = GetServer(\"n00dles\");\n if (n00dlesServ == null) {\n throw new Error(\"Could not get n00dles server\");\n }\n switch (ITutorial.currStep) {\n case iTutorialSteps.TerminalHelp:\n if (commandArray.length === 1 && commandArray[0] == \"help\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalLs:\n if (commandArray.length === 1 && commandArray[0] == \"ls\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScan:\n if (commandArray.length === 1 && commandArray[0] == \"scan\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScanAnalyze1:\n if (commandArray.length == 1 && commandArray[0] == \"scan-analyze\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScanAnalyze2:\n if (commandArray.length == 2 && commandArray[0] == \"scan-analyze\" && commandArray[1] === 2) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalConnect:\n if (commandArray.length == 2) {\n if (\n commandArray[0] == \"connect\" &&\n (commandArray[1] == \"n00dles\" || commandArray[1] == n00dlesServ.hostname)\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Wrong command! Try again!\");\n return;\n }\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalAnalyze:\n if (commandArray.length === 1 && commandArray[0] === \"analyze\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalNuke:\n if (commandArray.length == 2 && commandArray[0] == \"run\" && commandArray[1] == \"NUKE.exe\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalManualHack:\n if (commandArray.length == 1 && commandArray[0] == \"hack\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalHackingMechanics:\n if (commandArray.length !== 1 || ![\"grow\", \"weaken\", \"hack\"].includes(commandArray[0] + \"\")) {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalGoHome:\n if (commandArray.length == 1 && commandArray[0] == \"home\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalCreateScript:\n if (\n commandArray.length == 2 &&\n commandArray[0] == \"nano\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalFree:\n if (commandArray.length == 1 && commandArray[0] == \"free\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalRunScript:\n if (\n commandArray.length == 2 &&\n commandArray[0] == \"run\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.ActiveScriptsToTerminal:\n if (\n commandArray.length == 2 &&\n commandArray[0] == \"tail\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n default:\n this.error(\"Please follow the tutorial, or click 'EXIT' if you'd like to skip it\");\n return;\n }\n }\n /****************** END INTERACTIVE TUTORIAL ******************/\n /* Command parser */\n const commandName = commandArray[0];\n if (typeof commandName === \"number\" || typeof commandName === \"boolean\") {\n this.error(`Command ${commandArray[0]} not found`);\n return;\n }\n\n const commands: {\n [key: string]: (args: (string | number | boolean)[], server: BaseServer) => void;\n } = {\n \"scan-analyze\": scananalyze,\n alias: alias,\n analyze: analyze,\n backdoor: backdoor,\n buy: buy,\n cat: cat,\n cd: cd,\n check: check,\n clear: () => this.clear(),\n cls: () => this.clear(),\n connect: connect,\n cp: cp,\n download: download,\n expr: expr,\n free: free,\n grow: grow,\n hack: hack,\n help: help,\n history: history,\n home: home,\n hostname: hostname,\n kill: kill,\n killall: killall,\n ls: ls,\n lscpu: lscpu,\n mem: mem,\n mv: mv,\n nano: nano,\n ps: ps,\n rm: rm,\n run: run,\n scan: scan,\n scp: scp,\n sudov: sudov,\n tail: tail,\n apr1: apr1,\n top: top,\n unalias: unalias,\n vim: vim,\n weaken: weaken,\n wget: wget,\n };\n\n const f = commands[commandName.toLowerCase()];\n if (!f) {\n this.error(`Command ${commandArray[0]} not found`);\n return;\n }\n\n f(commandArray.slice(1), s);\n }\n\n getProgressText(): string {\n if (this.action === null) throw new Error(\"trying to get the progress text when there's no action\");\n return createProgressBarText({\n progress: (this.action.time - this.action.timeLeft) / this.action.time,\n totalTicks: 50,\n });\n }\n}\n","/**\n * Checks whether a IP Address string is valid.\n * @param ipaddress A string representing a potential IP Address\n */\nexport function isValidIPAddress(ipaddress: string): boolean {\n const byteRange = \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\";\n const regexStr = `^${byteRange}\\.${byteRange}\\.${byteRange}\\.${byteRange}$`;\n const ipAddressRegex = new RegExp(regexStr);\n\n return ipAddressRegex.test(ipaddress);\n}\n","import { Terminal } from \"../../Terminal\";\nimport { parseAliasDeclaration, printAliases } from \"../../Alias\";\n\nexport function alias(args: (string | number | boolean)[]): void {\n if (args.length === 0) {\n printAliases();\n return;\n }\n if (args.length === 1) {\n if (parseAliasDeclaration(args[0] + \"\")) {\n Terminal.print(`Set alias ${args[0]}`);\n return;\n }\n }\n if (args.length === 2) {\n if (args[0] === \"-g\") {\n if (parseAliasDeclaration(args[1] + \"\", true)) {\n Terminal.print(`Set global alias ${args[1]}`);\n return;\n }\n }\n }\n Terminal.error('Incorrect usage of alias command. Usage: alias [-g] [aliasname=\"value\"]');\n}\n","import { Terminal } from \"../../Terminal\";\n\nexport function analyze(args: (string | number | boolean)[]): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect usage of analyze command. Usage: analyze\");\n return;\n }\n Terminal.startAnalyze();\n}\n","import { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\n\nexport function backdoor(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect usage of backdoor command. Usage: backdoor\");\n return;\n }\n\n if (!(server instanceof Server)) {\n Terminal.error(\"Can only backdoor normal servers\");\n }\n\n const normalServer = server as Server;\n\n if (normalServer.purchasedByPlayer) {\n Terminal.error(\n \"Cannot use backdoor on your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n } else if (!normalServer.hasAdminRights) {\n Terminal.error(\"You do not have admin rights for this machine! Cannot backdoor\");\n } else if (normalServer.requiredHackingSkill > Player.skills.hacking) {\n Terminal.error(\n \"Your hacking skill is not high enough to use backdoor on this machine. Try analyzing the machine to determine the required hacking skill\",\n );\n } else if (normalServer instanceof HacknetServer) {\n Terminal.error(\"Cannot use backdoor on this type of Server\");\n } else {\n Terminal.startBackdoor();\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\nimport { listAllDarkwebItems, buyAllDarkwebItems, buyDarkwebItem } from \"../../DarkWeb/DarkWeb\";\n\nexport function buy(args: (string | number | boolean)[]): void {\n if (!Player.hasTorRouter()) {\n Terminal.error(\n \"You need to be able to connect to the Dark Web to use the buy command. (Maybe there's a TOR router you can buy somewhere)\",\n );\n return;\n }\n if (args.length != 1) {\n Terminal.print(\"Incorrect number of arguments. Usage: \");\n Terminal.print(\"buy -l\");\n Terminal.print(\"buy -a\");\n Terminal.print(\"buy [item name]\");\n return;\n }\n const arg = args[0] + \"\";\n if (arg == \"-l\" || arg == \"-1\" || arg == \"--list\") listAllDarkwebItems();\n else if (arg == \"-a\" || arg == \"--all\") buyAllDarkwebItems();\n else buyDarkwebItem(arg);\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { MessageFilenames, showMessage } from \"../../Message/MessageHelpers\";\nimport { showLiterature } from \"../../Literature/LiteratureHelpers\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { checkEnum } from \"../../utils/helpers/checkEnum\";\n\nexport function cat(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 1) {\n Terminal.error(\"Incorrect usage of cat command. Usage: cat [file]\");\n return;\n }\n const relative_filename = args[0] + \"\";\n const filename = Terminal.getFilepath(relative_filename);\n if (\n !filename.endsWith(\".msg\") &&\n !filename.endsWith(\".lit\") &&\n !filename.endsWith(\".txt\") &&\n !filename.endsWith(\".script\") &&\n !filename.endsWith(\".js\")\n ) {\n Terminal.error(\n \"Only .msg, .txt, .lit, .script and .js files are viewable with cat (filename must end with .msg, .txt, .lit, .script or .js)\",\n );\n return;\n }\n\n if (filename.endsWith(\".msg\") || filename.endsWith(\".lit\")) {\n for (let i = 0; i < server.messages.length; ++i) {\n if (filename.endsWith(\".lit\") && server.messages[i] === filename) {\n const file = server.messages[i];\n if (file.endsWith(\".msg\")) throw new Error(\".lit file should not be a .msg\");\n showLiterature(file);\n return;\n } else if (filename.endsWith(\".msg\")) {\n const file = server.messages[i];\n if (file !== filename) continue;\n if (!checkEnum(MessageFilenames, file)) return;\n showMessage(file);\n return;\n }\n }\n } else if (filename.endsWith(\".txt\")) {\n const txt = Terminal.getTextFile(relative_filename);\n if (txt != null) {\n txt.show();\n return;\n }\n } else if (filename.endsWith(\".script\") || filename.endsWith(\".js\")) {\n const script = Terminal.getScript(relative_filename);\n if (script != null) {\n dialogBoxCreate(`${script.filename}<br /><br />${script.code}`);\n return;\n }\n }\n\n Terminal.error(`No such file ${filename}`);\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nimport { evaluateDirectoryPath, removeTrailingSlash } from \"../DirectoryHelpers\";\nimport { containsFiles } from \"../DirectoryServerHelpers\";\n\nexport function cd(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length > 1) {\n Terminal.error(\"Incorrect number of arguments. Usage: cd [dir]\");\n } else {\n let dir = args.length === 1 ? args[0] + \"\" : \"/\";\n\n let evaledDir: string | null = \"\";\n if (dir === \"/\") {\n evaledDir = \"/\";\n } else {\n // Ignore trailing slashes\n dir = removeTrailingSlash(dir);\n\n evaledDir = evaluateDirectoryPath(dir, Terminal.cwd());\n if (evaledDir === null || evaledDir === \"\") {\n Terminal.error(\"Invalid path. Failed to change directories\");\n return;\n }\n if (Terminal.cwd().length > 1 && dir === \"..\") {\n Terminal.setcwd(evaledDir);\n return;\n }\n\n if (!containsFiles(server, evaledDir)) {\n Terminal.error(\"Invalid path. Failed to change directories\");\n return;\n }\n }\n\n Terminal.setcwd(evaledDir);\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { findRunningScript } from \"../../Script/ScriptHelpers\";\nimport { isScriptFilename, validScriptExtensions } from \"../../Script/isScriptFilename\";\n\nexport function check(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length < 1) {\n Terminal.error(`Incorrect number of arguments. Usage: check [script] [arg1] [arg2]...`);\n } else {\n const scriptName = Terminal.getFilepath(args[0] + \"\");\n // Can only tail script files\n if (!isScriptFilename(scriptName)) {\n Terminal.error(\n `'check' can only be called on scripts files (filename must end with ${validScriptExtensions.join(\", \")})`,\n );\n return;\n }\n\n // Check that the script is running on this machine\n const runningScript = findRunningScript(scriptName, args.slice(1), server);\n if (runningScript == null) {\n Terminal.error(`No script named ${scriptName} is running on the server`);\n return;\n }\n runningScript.displayLog();\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { getServerOnNetwork } from \"../../Server/ServerHelpers\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\n\nexport function connect(args: (string | number | boolean)[], server: BaseServer): void {\n // Disconnect from current server in Terminal and connect to new one\n if (args.length !== 1) {\n Terminal.error(\"Incorrect usage of connect command. Usage: connect [hostname]\");\n return;\n }\n\n const hostname = args[0] + \"\";\n\n for (let i = 0; i < server.serversOnNetwork.length; i++) {\n const other = getServerOnNetwork(server, i);\n if (other === null) throw new Error(`Server on network should not be null`);\n if (other.hostname == hostname) {\n Terminal.connectToServer(hostname);\n return;\n }\n }\n\n const other = GetServer(hostname);\n if (other !== null) {\n if (other instanceof Server && other.backdoorInstalled) {\n Terminal.connectToServer(hostname);\n return;\n }\n Terminal.error(\n `Cannot directly connect to ${hostname}. Make sure the server is backdoored or adjacent to your current Server`,\n );\n } else {\n Terminal.error(\"Host not found\");\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { getDestinationFilepath, areFilesEqual } from \"../DirectoryHelpers\";\n\nexport function cp(args: (string | number | boolean)[], server: BaseServer): void {\n try {\n if (args.length !== 2) {\n Terminal.error(\"Incorrect usage of cp command. Usage: cp [src] [dst]\");\n return;\n }\n // Convert a relative path source file to the absolute path.\n const src = Terminal.getFilepath(args[0] + \"\");\n if (src === null) {\n Terminal.error(\"src cannot be a directory\");\n return;\n }\n\n // Get the destination based on the source file and the current directory\n const t_dst = getDestinationFilepath(args[1] + \"\", src, Terminal.cwd());\n if (t_dst === null) {\n Terminal.error(\"error parsing dst file\");\n return;\n }\n\n // Convert a relative path destination file to the absolute path.\n const dst = Terminal.getFilepath(t_dst);\n if (areFilesEqual(src, dst)) {\n Terminal.error(\"src and dst cannot be the same\");\n return;\n }\n const srcExt = src.slice(src.lastIndexOf(\".\"));\n const dstExt = dst.slice(dst.lastIndexOf(\".\"));\n if (srcExt !== dstExt) {\n Terminal.error(\"src and dst must have the same extension.\");\n return;\n }\n if (!isScriptFilename(src) && !src.endsWith(\".txt\")) {\n Terminal.error(\"cp only works for scripts and .txt files\");\n return;\n }\n\n // Scp for txt files\n if (src.endsWith(\".txt\")) {\n let txtFile = null;\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (areFilesEqual(server.textFiles[i].fn, src)) {\n txtFile = server.textFiles[i];\n break;\n }\n }\n\n if (txtFile === null) {\n return Terminal.error(\"No such file exists!\");\n }\n\n const tRes = server.writeToTextFile(dst, txtFile.text);\n if (!tRes.success) {\n Terminal.error(\"cp failed\");\n return;\n }\n if (tRes.overwritten) {\n Terminal.print(`WARNING: ${dst} already exists and will be overwritten`);\n Terminal.print(`${dst} overwritten`);\n return;\n }\n Terminal.print(`${dst} copied`);\n return;\n }\n\n // Get the current script\n let sourceScript = null;\n for (let i = 0; i < server.scripts.length; ++i) {\n if (areFilesEqual(server.scripts[i].filename, src)) {\n sourceScript = server.scripts[i];\n break;\n }\n }\n if (sourceScript == null) {\n Terminal.error(\"cp failed. No such script exists\");\n return;\n }\n\n const sRes = server.writeToScriptFile(dst, sourceScript.code);\n if (!sRes.success) {\n Terminal.error(`cp failed`);\n return;\n }\n if (sRes.overwritten) {\n Terminal.print(`WARNING: ${dst} already exists and will be overwritten`);\n Terminal.print(`${dst} overwritten`);\n return;\n }\n Terminal.print(`${dst} copied`);\n } catch (e) {\n Terminal.error(e + \"\");\n }\n}\n","import { Terminal } from \"../../Terminal\";\n\nexport function expr(args: (string | number | boolean)[]): void {\n if (args.length === 0) {\n Terminal.error(\"Incorrect usage of expr command. Usage: expr [math expression]\");\n return;\n }\n const expr = args.join(\"\");\n\n // Sanitize the math expression\n const sanitizedExpr = expr.replace(/s+/g, \"\").replace(/[^-()\\d/*+.%]/g, \"\");\n let result;\n try {\n result = eval(sanitizedExpr);\n } catch (e) {\n Terminal.error(`Could not evaluate expression: ${sanitizedExpr}`);\n return;\n }\n Terminal.print(result);\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nexport function free(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect usage of free command. Usage: free\");\n return;\n }\n const ram = numeralWrapper.formatRAM(server.maxRam);\n const used = numeralWrapper.formatRAM(server.ramUsed);\n const avail = numeralWrapper.formatRAM(server.maxRam - server.ramUsed);\n const maxLength = Math.max(ram.length, Math.max(used.length, avail.length));\n const usedPercent = numeralWrapper.formatPercentage(server.ramUsed / server.maxRam);\n\n Terminal.print(`Total: ${\" \".repeat(maxLength - ram.length)}${ram}`);\n Terminal.print(`Used: ${\" \".repeat(maxLength - used.length)}${used} (${usedPercent})`);\n Terminal.print(`Available: ${\" \".repeat(maxLength - avail.length)}${avail}`);\n}\n","import { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\n\nexport function grow(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect usage of grow command. Usage: grow\");\n return;\n }\n\n if (!(server instanceof Server)) {\n Terminal.error(\n \"Cannot grow your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n }\n const normalServer = server as Server;\n // Hack the current PC (usually for money)\n // You can't grow your home pc or servers you purchased\n if (normalServer.purchasedByPlayer) {\n Terminal.error(\n \"Cannot grow your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n return;\n }\n if (!normalServer.hasAdminRights) {\n Terminal.error(\"You do not have admin rights for this machine! Cannot grow\");\n return;\n }\n if (normalServer.requiredHackingSkill > Player.skills.hacking) {\n Terminal.error(\n \"Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill\",\n );\n return;\n }\n Terminal.startGrow();\n}\n","import { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\n\nexport function hack(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect usage of hack command. Usage: hack\");\n return;\n }\n\n if (!(server instanceof Server)) {\n Terminal.error(\n \"Cannot hack your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n }\n const normalServer = server as Server;\n // Hack the current PC (usually for money)\n // You can't hack your home pc or servers you purchased\n if (normalServer.purchasedByPlayer) {\n Terminal.error(\n \"Cannot hack your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n return;\n }\n if (!normalServer.hasAdminRights) {\n Terminal.error(\"You do not have admin rights for this machine! Cannot hack\");\n return;\n }\n if (normalServer.requiredHackingSkill > Player.skills.hacking) {\n Terminal.error(\n \"Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill\",\n );\n return;\n }\n Terminal.startHack();\n}\n","import { Terminal } from \"../../Terminal\";\nimport { TerminalHelpText, HelpTexts } from \"../HelpText\";\n\nexport function help(args: (string | number | boolean)[]): void {\n if (args.length !== 0 && args.length !== 1) {\n Terminal.error(\"Incorrect usage of help command. Usage: help\");\n return;\n }\n if (args.length === 0) {\n TerminalHelpText.forEach((line) => Terminal.print(line));\n } else {\n const cmd = args[0] + \"\";\n const txt = HelpTexts[cmd];\n if (txt == null) {\n Terminal.error(\"No help topics match '\" + cmd + \"'\");\n return;\n }\n txt.forEach((t) => Terminal.print(t));\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\n\nexport function history(args: (string | number | boolean)[]): void {\n if (args.length === 0) {\n Terminal.commandHistory.forEach((command, index) => {\n Terminal.print(`${index.toString().padStart(2)} ${command}`);\n });\n return;\n }\n const arg = args[0] + \"\";\n if (arg === \"-c\" || arg === \"--clear\") {\n Player.terminalCommandHistory = [];\n Terminal.commandHistory = [];\n Terminal.commandHistoryIndex = 1;\n } else {\n Terminal.error(\"Incorrect usage of history command. usage: history [-c]\");\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\n\nexport function home(args: (string | number | boolean)[]): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect usage of home command. Usage: home\");\n return;\n }\n Player.getCurrentServer().isConnectedTo = false;\n Player.currentServer = Player.getHomeComputer().hostname;\n Player.getCurrentServer().isConnectedTo = true;\n Terminal.print(\"Connected to home\");\n Terminal.setcwd(\"/\");\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nexport function hostname(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect usage of hostname command. Usage: hostname\");\n return;\n }\n Terminal.print(server.hostname);\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { killWorkerScript } from \"../../Netscript/killWorkerScript\";\n\nexport function kill(args: (string | number | boolean)[], server: BaseServer): void {\n try {\n if (args.length < 1) {\n Terminal.error(\"Incorrect usage of kill command. Usage: kill [scriptname] [arg1] [arg2]...\");\n return;\n }\n if (typeof args[0] === \"boolean\") {\n return;\n }\n\n // Kill by PID\n if (typeof args[0] === \"number\") {\n const pid = args[0];\n const res = killWorkerScript(pid);\n if (res) {\n Terminal.print(`Killing script with PID ${pid}`);\n } else {\n Terminal.error(`Failed to kill script with PID ${pid}. No such script is running`);\n }\n\n return;\n }\n\n const scriptName = Terminal.getFilepath(args[0]);\n const runningScript = server.getRunningScript(scriptName, args.slice(1));\n if (runningScript == null) {\n Terminal.error(\"No such script is running. Nothing to kill\");\n return;\n }\n killWorkerScript({ runningScript: runningScript, hostname: server.hostname });\n Terminal.print(`Killing ${scriptName}`);\n } catch (e) {\n Terminal.error(e + \"\");\n }\n}\n","import { NS } from \"../ScriptEditor/NetscriptDefinitions\";\n\n/**\n * The environment in which a script runs. The environment holds\n * Netscript functions and arguments for that script.\n */\nexport class Environment {\n /** Whether or not the script that uses this Environment should stop running */\n stopFlag = false;\n\n /** The currently running function */\n\n runningFn = \"\";\n\n /** Environment variables (currently only Netscript functions) */\n vars: NS | null = null;\n}\n","/**\n * Initialization metadata for all Stocks. This is used to generate the\n * stock parameter values upon a reset\n *\n * Some notes:\n * - Megacorporations have better otlkMags\n * - Higher volatility -> Bigger spread\n * - Lower price -> Bigger spread\n * - Share tx required for movement used for balancing\n */\nimport { StockSymbols } from \"./StockSymbols\";\nimport { IConstructorParams } from \"../Stock\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nexport const InitStockMetadata: IConstructorParams[] = [\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 17e3,\n },\n marketCap: 2.4e12,\n mv: {\n divisor: 100,\n max: 50,\n min: 40,\n },\n name: LocationName.AevumECorp,\n otlkMag: 19,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumECorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 34e3,\n min: 24e3,\n },\n marketCap: 2.4e12,\n mv: {\n divisor: 100,\n max: 50,\n min: 40,\n },\n name: LocationName.Sector12MegaCorp,\n otlkMag: 19,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12MegaCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 12e3,\n },\n marketCap: 1.6e12,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.Sector12BladeIndustries,\n otlkMag: 13,\n spreadPerc: {\n divisor: 10,\n max: 6,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12BladeIndustries],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 10e3,\n },\n marketCap: 1.5e12,\n mv: {\n divisor: 100,\n max: 75,\n min: 65,\n },\n name: LocationName.AevumClarkeIncorporated,\n otlkMag: 12,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumClarkeIncorporated],\n },\n\n {\n b: true,\n initPrice: {\n max: 43e3,\n min: 32e3,\n },\n marketCap: 1.8e12,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.VolhavenOmniTekIncorporated,\n otlkMag: 12,\n spreadPerc: {\n divisor: 10,\n max: 6,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.VolhavenOmniTekIncorporated],\n },\n\n {\n b: true,\n initPrice: {\n max: 80e3,\n min: 50e3,\n },\n marketCap: 2e12,\n mv: {\n divisor: 100,\n max: 110,\n min: 100,\n },\n name: LocationName.Sector12FourSigma,\n otlkMag: 17,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12FourSigma],\n },\n\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 16e3,\n },\n marketCap: 1.9e12,\n mv: {\n divisor: 100,\n max: 85,\n min: 75,\n },\n name: LocationName.ChongqingKuaiGongInternational,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 7,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.ChongqingKuaiGongInternational],\n },\n\n {\n b: true,\n initPrice: {\n max: 36e3,\n min: 29e3,\n },\n marketCap: 2e12,\n mv: {\n divisor: 100,\n max: 130,\n min: 120,\n },\n name: LocationName.AevumFulcrumTechnologies,\n otlkMag: 16,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumFulcrumTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 20e3,\n },\n marketCap: 1.2e12,\n mv: {\n divisor: 100,\n max: 90,\n min: 80,\n },\n name: LocationName.IshimaStormTechnologies,\n otlkMag: 7,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.IshimaStormTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 19e3,\n min: 6e3,\n },\n marketCap: 900e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.NewTokyoDefComm,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoDefComm],\n },\n\n {\n b: true,\n initPrice: {\n max: 18e3,\n min: 10e3,\n },\n marketCap: 825e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.VolhavenHeliosLabs,\n otlkMag: 9,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.VolhavenHeliosLabs],\n },\n\n {\n b: true,\n initPrice: {\n max: 14e3,\n min: 8e3,\n },\n marketCap: 1e12,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.NewTokyoVitaLife,\n otlkMag: 7,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoVitaLife],\n },\n\n {\n b: true,\n initPrice: {\n max: 24e3,\n min: 12e3,\n },\n marketCap: 800e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.Sector12IcarusMicrosystems,\n otlkMag: 7.5,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.Sector12IcarusMicrosystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 29e3,\n min: 16e3,\n },\n marketCap: 900e9,\n mv: {\n divisor: 100,\n max: 60,\n min: 50,\n },\n name: LocationName.Sector12UniversalEnergy,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.Sector12UniversalEnergy],\n },\n\n {\n b: true,\n initPrice: {\n max: 17e3,\n min: 8e3,\n },\n marketCap: 640e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.AevumAeroCorp,\n otlkMag: 6,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.AevumAeroCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 15e3,\n min: 6e3,\n },\n marketCap: 600e9,\n mv: {\n divisor: 100,\n max: 75,\n min: 65,\n },\n name: LocationName.VolhavenOmniaCybersystems,\n otlkMag: 4.5,\n spreadPerc: {\n divisor: 10,\n max: 11,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.VolhavenOmniaCybersystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 14e3,\n },\n marketCap: 705e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.ChongqingSolarisSpaceSystems,\n otlkMag: 8.5,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.ChongqingSolarisSpaceSystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 30e3,\n min: 12e3,\n },\n marketCap: 695e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n otlkMag: 10.5,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoGlobalPharmaceuticals],\n },\n\n {\n b: true,\n initPrice: {\n max: 27e3,\n min: 15e3,\n },\n marketCap: 600e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.IshimaNovaMedical,\n otlkMag: 5,\n spreadPerc: {\n divisor: 10,\n max: 11,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.IshimaNovaMedical],\n },\n\n {\n b: true,\n initPrice: {\n max: 8.5e3,\n min: 4e3,\n },\n marketCap: 450e9,\n mv: {\n divisor: 100,\n max: 260,\n min: 240,\n },\n name: LocationName.AevumWatchdogSecurity,\n otlkMag: 1.5,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 54e3,\n min: 12e3,\n },\n symbol: StockSymbols[LocationName.AevumWatchdogSecurity],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 4.5e3,\n },\n marketCap: 300e9,\n mv: {\n divisor: 100,\n max: 135,\n min: 115,\n },\n name: LocationName.VolhavenLexoCorp,\n otlkMag: 6,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.VolhavenLexoCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 7e3,\n min: 2e3,\n },\n marketCap: 180e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 50,\n },\n name: LocationName.AevumRhoConstruction,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.AevumRhoConstruction],\n },\n\n {\n b: true,\n initPrice: {\n max: 8.5e3,\n min: 4e3,\n },\n marketCap: 240e9,\n mv: {\n divisor: 100,\n max: 205,\n min: 175,\n },\n name: LocationName.Sector12AlphaEnterprises,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 16,\n min: 5,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12AlphaEnterprises],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 3e3,\n },\n marketCap: 200e9,\n mv: {\n divisor: 100,\n max: 170,\n min: 150,\n },\n name: LocationName.VolhavenSysCoreSecurities,\n otlkMag: 3,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 15e3,\n },\n symbol: StockSymbols[LocationName.VolhavenSysCoreSecurities],\n },\n\n {\n b: true,\n initPrice: {\n max: 6e3,\n min: 1e3,\n },\n marketCap: 185e9,\n mv: {\n divisor: 100,\n max: 100,\n min: 80,\n },\n name: LocationName.VolhavenCompuTek,\n otlkMag: 4,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.VolhavenCompuTek],\n },\n\n {\n b: true,\n initPrice: {\n max: 5e3,\n min: 1e3,\n },\n marketCap: 58e9,\n mv: {\n divisor: 100,\n max: 400,\n min: 200,\n },\n name: LocationName.AevumNetLinkTechnologies,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 20,\n min: 5,\n },\n shareTxForMovement: {\n max: 54e3,\n min: 18e3,\n },\n symbol: StockSymbols[LocationName.AevumNetLinkTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 1e3,\n },\n marketCap: 60e9,\n mv: {\n divisor: 100,\n max: 110,\n min: 90,\n },\n name: LocationName.IshimaOmegaSoftware,\n otlkMag: 0.5,\n spreadPerc: {\n divisor: 10,\n max: 13,\n min: 4,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.IshimaOmegaSoftware],\n },\n\n {\n b: false,\n initPrice: {\n max: 4.5e3,\n min: 500,\n },\n marketCap: 45e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.Sector12FoodNStuff,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 6,\n },\n shareTxForMovement: {\n max: 180e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.Sector12FoodNStuff],\n },\n\n {\n b: true,\n initPrice: {\n max: 3.5e3,\n min: 1.5e3,\n },\n marketCap: 30e9,\n mv: {\n divisor: 100,\n max: 275,\n min: 100,\n },\n name: \"Sigma Cosmetics\",\n otlkMag: 0,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 6,\n },\n shareTxForMovement: {\n max: 70e3,\n min: 20e3,\n },\n symbol: StockSymbols[\"Sigma Cosmetics\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 1.5e3,\n min: 250,\n },\n marketCap: 42e9,\n mv: {\n divisor: 100,\n max: 350,\n min: 200,\n },\n name: LocationName.Sector12JoesGuns,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 6,\n },\n shareTxForMovement: {\n max: 52e3,\n min: 15e3,\n },\n symbol: StockSymbols[LocationName.Sector12JoesGuns],\n },\n\n {\n b: true,\n initPrice: {\n max: 1.5e3,\n min: 250,\n },\n marketCap: 100e9,\n mv: {\n divisor: 100,\n max: 175,\n min: 120,\n },\n name: \"Catalyst Ventures\",\n otlkMag: 13.5,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 5,\n },\n shareTxForMovement: {\n max: 72e3,\n min: 24e3,\n },\n symbol: StockSymbols[\"Catalyst Ventures\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 30e3,\n min: 15e3,\n },\n marketCap: 360e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: \"Microdyne Technologies\",\n otlkMag: 8,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 216e3,\n min: 90e3,\n },\n symbol: StockSymbols[\"Microdyne Technologies\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 24e3,\n min: 12e3,\n },\n marketCap: 420e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 50,\n },\n name: \"Titan Laboratories\",\n otlkMag: 11,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 216e3,\n min: 90e3,\n },\n symbol: StockSymbols[\"Titan Laboratories\"],\n },\n];\n","import { Settings } from \"./Settings/Settings\";\n\ntype PortData = string | number;\nexport interface IPort {\n write: (value: unknown) => PortData | null;\n tryWrite: (value: unknown) => boolean;\n read: () => PortData;\n peek: () => PortData;\n full: () => boolean;\n empty: () => boolean;\n clear: () => void;\n}\n\nexport function NetscriptPort(): IPort {\n const data: PortData[] = [];\n\n return {\n write: (value) => {\n if (typeof value !== \"number\" && typeof value !== \"string\") {\n throw new Error(\n `port.write: Tried to write type ${typeof value}. Only string and number types may be written to ports.`,\n );\n }\n data.push(value);\n if (data.length > Settings.MaxPortCapacity) {\n return data.shift() as PortData;\n }\n return null;\n },\n\n tryWrite: (value) => {\n if (typeof value != \"number\" && typeof value != \"string\") {\n throw new Error(\n `port.write: Tried to write type ${typeof value}. Only string and number types may be written to ports.`,\n );\n }\n if (data.length >= Settings.MaxPortCapacity) {\n return false;\n }\n data.push(value);\n return true;\n },\n\n read: () => {\n if (data.length === 0) return \"NULL PORT DATA\";\n return data.shift() as PortData;\n },\n\n peek: () => {\n if (data.length === 0) return \"NULL PORT DATA\";\n return data[0];\n },\n\n full: () => {\n return data.length == Settings.MaxPortCapacity;\n },\n\n empty: () => {\n return data.length === 0;\n },\n\n clear: () => {\n data.length = 0;\n },\n };\n}\n","import { FactionNames } from \"../Faction/data/FactionNames\";\nimport { GangConstants } from \"../Gang/data/Constants\";\nimport { Player } from \"@player\";\nimport { Gang } from \"../Gang/Gang\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { GangMemberTasks } from \"../Gang/GangMemberTasks\";\nimport { GangMemberUpgrades } from \"../Gang/GangMemberUpgrades\";\nimport { GangMember } from \"../Gang/GangMember\";\nimport { GangMemberTask } from \"../Gang/GangMemberTask\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nimport { Gang as IGang, EquipmentStats, GangOtherInfoObject } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\n\nexport function NetscriptGang(): InternalAPI<IGang> {\n /** Functions as an API check and also returns the gang object */\n const getGang = function (ctx: NetscriptContext): Gang {\n if (!Player.gang) throw helpers.makeRuntimeErrorMsg(ctx, \"Must have joined gang\", \"API ACCESS\");\n return Player.gang;\n };\n\n const getGangMember = function (ctx: NetscriptContext, name: string): GangMember {\n const gang = getGang(ctx);\n for (const member of gang.members) if (member.name === name) return member;\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid gang member: '${name}'`);\n };\n\n const getGangTask = function (ctx: NetscriptContext, name: string): GangMemberTask {\n const task = GangMemberTasks[name];\n if (!task) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid task: '${name}'`);\n }\n\n return task;\n };\n\n return {\n createGang: (ctx) => (_faction) => {\n const faction = helpers.string(ctx, \"faction\", _faction);\n // this list is copied from Faction/ui/Root.tsx\n\n if (!Player.canAccessGang() || !GangConstants.Names.includes(faction)) return false;\n if (Player.gang) return false;\n if (!Player.factions.includes(faction)) return false;\n\n const isHacking = faction === FactionNames.NiteSec || faction === FactionNames.TheBlackHand;\n Player.startGang(faction, isHacking);\n return true;\n },\n inGang: () => () => {\n return Player.gang ? true : false;\n },\n getMemberNames: (ctx) => () => {\n const gang = getGang(ctx);\n return gang.members.map((member) => member.name);\n },\n getGangInformation: (ctx) => () => {\n const gang = getGang(ctx);\n return {\n faction: gang.facName,\n isHacking: gang.isHackingGang,\n moneyGainRate: gang.moneyGainRate,\n power: gang.getPower(),\n respect: gang.respect,\n respectGainRate: gang.respectGainRate,\n territory: gang.getTerritory(),\n territoryClashChance: gang.territoryClashChance,\n territoryWarfareEngaged: gang.territoryWarfareEngaged,\n wantedLevel: gang.wanted,\n wantedLevelGainRate: gang.wantedGainRate,\n wantedPenalty: gang.getWantedPenalty(),\n };\n },\n getOtherGangInformation: (ctx) => () => {\n getGang(ctx);\n const cpy: Record<string, GangOtherInfoObject> = {};\n for (const gang of Object.keys(AllGangs)) {\n cpy[gang] = Object.assign({}, AllGangs[gang]);\n }\n\n return cpy;\n },\n getMemberInformation: (ctx) => (_memberName) => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n const gang = getGang(ctx);\n const member = getGangMember(ctx, memberName);\n return {\n name: member.name,\n task: member.task,\n earnedRespect: member.earnedRespect,\n hack: member.hack,\n str: member.str,\n def: member.def,\n dex: member.dex,\n agi: member.agi,\n cha: member.cha,\n\n hack_exp: member.hack_exp,\n str_exp: member.str_exp,\n def_exp: member.def_exp,\n dex_exp: member.dex_exp,\n agi_exp: member.agi_exp,\n cha_exp: member.cha_exp,\n\n hack_mult: member.hack_mult,\n str_mult: member.str_mult,\n def_mult: member.def_mult,\n dex_mult: member.dex_mult,\n agi_mult: member.agi_mult,\n cha_mult: member.cha_mult,\n\n hack_asc_mult: member.calculateAscensionMult(member.hack_asc_points),\n str_asc_mult: member.calculateAscensionMult(member.str_asc_points),\n def_asc_mult: member.calculateAscensionMult(member.def_asc_points),\n dex_asc_mult: member.calculateAscensionMult(member.dex_asc_points),\n agi_asc_mult: member.calculateAscensionMult(member.agi_asc_points),\n cha_asc_mult: member.calculateAscensionMult(member.cha_asc_points),\n\n hack_asc_points: member.hack_asc_points,\n str_asc_points: member.str_asc_points,\n def_asc_points: member.def_asc_points,\n dex_asc_points: member.dex_asc_points,\n agi_asc_points: member.agi_asc_points,\n cha_asc_points: member.cha_asc_points,\n\n upgrades: member.upgrades.slice(),\n augmentations: member.augmentations.slice(),\n\n respectGain: member.calculateRespectGain(gang),\n wantedLevelGain: member.calculateWantedLevelGain(gang),\n moneyGain: member.calculateMoneyGain(gang),\n };\n },\n canRecruitMember: (ctx) => () => {\n const gang = getGang(ctx);\n return gang.canRecruitMember();\n },\n recruitMember: (ctx) => (_memberName) => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n const gang = getGang(ctx);\n const recruited = gang.recruitMember(memberName);\n if (recruited) {\n ctx.workerScript.log(\"gang.recruitMember\", () => `Successfully recruited Gang Member '${memberName}'`);\n } else {\n ctx.workerScript.log(\"gang.recruitMember\", () => `Failed to recruit Gang Member '${memberName}'`);\n }\n\n return recruited;\n },\n getTaskNames: (ctx) => () => {\n const gang = getGang(ctx);\n const tasks = gang.getAllTaskNames();\n tasks.unshift(\"Unassigned\");\n return tasks;\n },\n setMemberTask: (ctx) => (_memberName, _taskName) => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n const taskName = helpers.string(ctx, \"taskName\", _taskName);\n const gang = getGang(ctx);\n const member = getGangMember(ctx, memberName);\n if (!gang.getAllTaskNames().includes(taskName)) {\n ctx.workerScript.log(\n \"gang.setMemberTask\",\n () =>\n `Failed to assign Gang Member '${memberName}' to Invalid task '${taskName}'. '${memberName}' is now Unassigned`,\n );\n return member.assignToTask(\"Unassigned\");\n }\n const success = member.assignToTask(taskName);\n if (success) {\n ctx.workerScript.log(\n \"gang.setMemberTask\",\n () => `Successfully assigned Gang Member '${memberName}' to '${taskName}' task`,\n );\n } else {\n ctx.workerScript.log(\n \"gang.setMemberTask\",\n () => `Failed to assign Gang Member '${memberName}' to '${taskName}' task. '${memberName}' is now Unassigned`,\n );\n }\n\n return success;\n },\n getTaskStats: (ctx) => (_taskName) => {\n const taskName = helpers.string(ctx, \"taskName\", _taskName);\n getGang(ctx);\n const task = getGangTask(ctx, taskName);\n const copy = Object.assign({}, task);\n copy.territory = Object.assign({}, task.territory);\n return copy;\n },\n getEquipmentNames: (ctx) => () => {\n getGang(ctx);\n return Object.keys(GangMemberUpgrades);\n },\n getEquipmentCost: (ctx) => (_equipName) => {\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n const gang = getGang(ctx);\n const upg = GangMemberUpgrades[equipName];\n if (upg === null) return Infinity;\n return gang.getUpgradeCost(upg);\n },\n getEquipmentType: (ctx) => (_equipName) => {\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n getGang(ctx);\n const upg = GangMemberUpgrades[equipName];\n if (upg == null) return \"\";\n return upg.getType();\n },\n getEquipmentStats: (ctx) => (_equipName) => {\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n getGang(ctx);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid equipment: ${equipName}`);\n }\n const typecheck: EquipmentStats = equipment.mults;\n return Object.assign({}, typecheck);\n },\n purchaseEquipment: (ctx) => (_memberName, _equipName) => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n getGang(ctx);\n const member = getGangMember(ctx, memberName);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) return false;\n const res = member.buyUpgrade(equipment);\n if (res) {\n ctx.workerScript.log(\n \"gang.purchaseEquipment\",\n () => `Purchased '${equipName}' for Gang member '${memberName}'`,\n );\n } else {\n ctx.workerScript.log(\n \"gang.purchaseEquipment\",\n () => `Failed to purchase '${equipName}' for Gang member '${memberName}'`,\n );\n }\n\n return res;\n },\n ascendMember: (ctx) => (_memberName) => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n const gang = getGang(ctx);\n const member = getGangMember(ctx, memberName);\n if (!member.canAscend()) return;\n return gang.ascendMember(member, ctx.workerScript);\n },\n getAscensionResult: (ctx) => (_memberName) => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n getGang(ctx);\n const member = getGangMember(ctx, memberName);\n if (!member.canAscend()) return;\n return {\n respect: member.earnedRespect,\n ...member.getAscensionResults(),\n };\n },\n setTerritoryWarfare: (ctx) => (_engage) => {\n const engage = !!_engage;\n const gang = getGang(ctx);\n if (engage) {\n gang.territoryWarfareEngaged = true;\n ctx.workerScript.log(\"gang.setTerritoryWarfare\", () => \"Engaging in Gang Territory Warfare\");\n } else {\n gang.territoryWarfareEngaged = false;\n ctx.workerScript.log(\"gang.setTerritoryWarfare\", () => \"Disengaging in Gang Territory Warfare\");\n }\n },\n getChanceToWinClash: (ctx) => (_otherGang) => {\n const otherGang = helpers.string(ctx, \"otherGang\", _otherGang);\n const gang = getGang(ctx);\n if (AllGangs[otherGang] == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid gang: ${otherGang}`);\n }\n\n const playerPower = AllGangs[gang.facName].power;\n const otherPower = AllGangs[otherGang].power;\n\n return playerPower / (otherPower + playerPower);\n },\n getBonusTime: (ctx) => () => {\n const gang = getGang(ctx);\n return Math.round(gang.storedCycles / 5) * 1000;\n },\n };\n}\n","import { Player } from \"@player\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { findCrime } from \"../Crime/CrimeHelpers\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\n\nimport { Sleeve as ISleeve, SleeveSkills } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { checkEnum } from \"../utils/helpers/checkEnum\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { isSleeveBladeburnerWork } from \"../PersonObjects/Sleeve/Work/SleeveBladeburnerWork\";\nimport { isSleeveFactionWork } from \"../PersonObjects/Sleeve/Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../PersonObjects/Sleeve/Work/SleeveCompanyWork\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptSleeve(): InternalAPI<ISleeve> {\n const checkSleeveAPIAccess = function (ctx: NetscriptContext) {\n if (Player.bitNodeN !== 10 && !Player.sourceFileLvl(10)) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10\",\n );\n }\n };\n\n const checkSleeveNumber = function (ctx: NetscriptContext, sleeveNumber: number) {\n if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) {\n const msg = `Invalid sleeve number: ${sleeveNumber}`;\n helpers.log(ctx, () => msg);\n throw helpers.makeRuntimeErrorMsg(ctx, msg);\n }\n };\n\n const getSleeveStats = function (sleeveNumber: number): SleeveSkills {\n const sl = Player.sleeves[sleeveNumber];\n return {\n shock: 100 - sl.shock,\n sync: sl.sync,\n memory: sl.memory,\n hacking: sl.skills.hacking,\n strength: sl.skills.strength,\n defense: sl.skills.defense,\n dexterity: sl.skills.dexterity,\n agility: sl.skills.agility,\n charisma: sl.skills.charisma,\n };\n };\n\n return {\n getNumSleeves: (ctx) => () => {\n checkSleeveAPIAccess(ctx);\n return Player.sleeves.length;\n },\n setToShockRecovery: (ctx) => (_sleeveNumber) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return Player.sleeves[sleeveNumber].shockRecovery();\n },\n setToSynchronize: (ctx) => (_sleeveNumber) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return Player.sleeves[sleeveNumber].synchronize();\n },\n setToCommitCrime: (ctx) => (_sleeveNumber, _crimeRoughName) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const crimeRoughName = helpers.string(ctx, \"crimeName\", _crimeRoughName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n const crime = findCrime(crimeRoughName);\n if (crime === null) {\n return false;\n }\n return Player.sleeves[sleeveNumber].commitCrime(crime.name);\n },\n setToUniversityCourse: (ctx) => (_sleeveNumber, _universityName, _className) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const universityName = helpers.string(ctx, \"universityName\", _universityName);\n const className = helpers.string(ctx, \"className\", _className);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return Player.sleeves[sleeveNumber].takeUniversityCourse(universityName, className);\n },\n travel: (ctx) => (_sleeveNumber, _cityName) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n if (checkEnum(CityName, cityName)) {\n return Player.sleeves[sleeveNumber].travel(cityName);\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid city name: '${cityName}'.`);\n }\n },\n setToCompanyWork: (ctx) => (_sleeveNumber, acompanyName) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const companyName = helpers.string(ctx, \"companyName\", acompanyName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n // Cannot work at the same company that another sleeve is working at\n for (let i = 0; i < Player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = Player.sleeves[i];\n if (isSleeveCompanyWork(other.currentWork) && other.currentWork.companyName === companyName) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot work for company ${companyName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n return Player.sleeves[sleeveNumber].workForCompany(companyName);\n },\n setToFactionWork: (ctx) => (_sleeveNumber, _factionName, _workType) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const factionName = helpers.string(ctx, \"factionName\", _factionName);\n const workType = helpers.string(ctx, \"workType\", _workType);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n // Cannot work at the same faction that another sleeve is working at\n for (let i = 0; i < Player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = Player.sleeves[i];\n if (isSleeveFactionWork(other.currentWork) && other.currentWork.factionName === factionName) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot work for faction ${factionName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n if (Player.gang && Player.gang.facName == factionName) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot work for faction ${factionName} because you have started a gang with them.`,\n );\n }\n\n return Player.sleeves[sleeveNumber].workForFaction(factionName, workType);\n },\n setToGymWorkout: (ctx) => (_sleeveNumber, _gymName, _stat) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const gymName = helpers.string(ctx, \"gymName\", _gymName);\n const stat = helpers.string(ctx, \"stat\", _stat);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n return Player.sleeves[sleeveNumber].workoutAtGym(gymName, stat);\n },\n getSleeveStats: (ctx) => (_sleeveNumber) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return getSleeveStats(sleeveNumber);\n },\n getTask: (ctx) => (_sleeveNumber) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const sl = Player.sleeves[sleeveNumber];\n if (sl.currentWork === null) return null;\n return sl.currentWork.APICopy();\n },\n getInformation: (ctx) => (_sleeveNumber) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const sl = Player.sleeves[sleeveNumber];\n return {\n tor: false,\n city: sl.city,\n hp: sl.hp,\n jobs: Object.keys(Player.jobs), // technically sleeves have the same jobs as the player.\n jobTitle: Object.values(Player.jobs),\n\n mult: {\n agility: sl.mults.agility,\n agilityExp: sl.mults.agility_exp,\n charisma: sl.mults.charisma,\n charismaExp: sl.mults.charisma_exp,\n companyRep: sl.mults.company_rep,\n crimeMoney: sl.mults.crime_money,\n crimeSuccess: sl.mults.crime_success,\n defense: sl.mults.defense,\n defenseExp: sl.mults.defense_exp,\n dexterity: sl.mults.dexterity,\n dexterityExp: sl.mults.dexterity_exp,\n factionRep: sl.mults.faction_rep,\n hacking: sl.mults.hacking,\n hackingExp: sl.mults.hacking_exp,\n strength: sl.mults.strength,\n strengthExp: sl.mults.strength_exp,\n workMoney: sl.mults.work_money,\n },\n };\n },\n getSleeveAugmentations: (ctx) => (_sleeveNumber) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const augs = [];\n for (let i = 0; i < Player.sleeves[sleeveNumber].augmentations.length; i++) {\n augs.push(Player.sleeves[sleeveNumber].augmentations[i].name);\n }\n return augs;\n },\n getSleevePurchasableAugs: (ctx) => (_sleeveNumber) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const purchasableAugs = Player.sleeves[sleeveNumber].findPurchasableAugs();\n const augs = [];\n for (let i = 0; i < purchasableAugs.length; i++) {\n const aug = purchasableAugs[i];\n augs.push({\n name: aug.name,\n cost: aug.baseCost,\n });\n }\n\n return augs;\n },\n purchaseSleeveAug: (ctx) => (_sleeveNumber, _augName) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const augName = helpers.string(ctx, \"augName\", _augName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n if (getSleeveStats(sleeveNumber).shock > 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Sleeve shock too high: Sleeve ${sleeveNumber}`);\n }\n\n const aug = StaticAugmentations[augName];\n if (!aug) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid aug: ${augName}`);\n }\n\n return Player.sleeves[sleeveNumber].tryBuyAugmentation(aug);\n },\n getSleeveAugmentationPrice: (ctx) => (_augName) => {\n checkSleeveAPIAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug: Augmentation = StaticAugmentations[augName];\n return aug.baseCost;\n },\n getSleeveAugmentationRepReq: (ctx) => (_augName) => {\n checkSleeveAPIAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug: Augmentation = StaticAugmentations[augName];\n return aug.getCost().repCost;\n },\n setToBladeburnerAction: (ctx) => (_sleeveNumber, _action, _contract?) => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const action = helpers.string(ctx, \"action\", _action);\n let contract: string;\n if (typeof _contract === \"undefined\") {\n contract = \"------\";\n } else {\n contract = helpers.string(ctx, \"contract\", _contract);\n }\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n // Cannot Take on Contracts if another sleeve is performing that action\n if (action === \"Take on contracts\") {\n for (let i = 0; i < Player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = Player.sleeves[i];\n if (isSleeveBladeburnerWork(other.currentWork) && other.currentWork.actionName === contract) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot take on contracts because Sleeve ${i} is already performing that action.`,\n );\n }\n }\n }\n\n return Player.sleeves[sleeveNumber].bladeburner(action, contract);\n },\n };\n}\n","import { Player } from \"../Player\";\nimport { Exploit } from \"../Exploits/Exploit\";\nimport * as bcrypt from \"bcryptjs\";\nimport { Apr1Events as devMenu } from \"../ui/Apr1\";\nimport { InternalAPI } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\nimport { Terminal } from \"../Terminal\";\n\nexport interface INetscriptExtra {\n heart: {\n break(): number;\n };\n openDevMenu(): void;\n exploit(): void;\n bypass(doc: Document): void;\n alterReality(): void;\n rainbow(guess: string): void;\n iKnowWhatImDoing(): void;\n}\n\nexport function NetscriptExtra(): InternalAPI<INetscriptExtra> {\n return {\n heart: {\n // Easter egg function\n break: () => () => {\n return Player.karma;\n },\n },\n openDevMenu: () => () => {\n devMenu.emit();\n },\n exploit: () => () => {\n Player.giveExploit(Exploit.UndocumentedFunctionCall);\n },\n bypass: (ctx) => (doc) => {\n // reset both fields first\n type temporary = { completely_unused_field: unknown };\n const d = doc as temporary;\n d.completely_unused_field = undefined;\n const real_document = document as unknown as temporary;\n real_document.completely_unused_field = undefined;\n // set one to true and check that it affected the other.\n real_document.completely_unused_field = true;\n if (d.completely_unused_field && ctx.workerScript.ramUsage === 1.6) {\n Player.giveExploit(Exploit.Bypass);\n }\n d.completely_unused_field = undefined;\n real_document.completely_unused_field = undefined;\n },\n alterReality: () => () => {\n // We need to trick webpack into not optimizing a variable that is guaranteed to be false (and doesn't use prototypes)\n let x = false;\n const recur = function (depth: number): void {\n if (depth === 0) return;\n x = !x;\n recur(depth - 1);\n };\n recur(2);\n console.warn(\"I am sure that this variable is false.\");\n if (x !== false) {\n console.warn(\"Reality has been altered!\");\n Player.giveExploit(Exploit.RealityAlteration);\n }\n },\n rainbow: (ctx) => (guess) => {\n function tryGuess(): boolean {\n // eslint-disable-next-line no-sync\n const verified = bcrypt.compareSync(\n helpers.string(ctx, \"guess\", guess),\n \"$2a$10$aertxDEkgor8baVtQDZsLuMwwGYmkRM/ohcA6FjmmzIHQeTCsrCcO\",\n );\n if (verified) {\n Player.giveExploit(Exploit.INeedARainbow);\n return true;\n }\n return false;\n }\n return tryGuess();\n },\n iKnowWhatImDoing: (ctx) => () => {\n helpers.log(ctx, () => \"Unlocking unsupported feature: window.tprintRaw\");\n // @ts-ignore window has no tprintRaw property defined\n window.tprintRaw = Terminal.printRaw.bind(Terminal);\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport {\n getCostOfNextHacknetNode,\n getCostOfNextHacknetServer,\n hasHacknetServers,\n purchaseHacknet,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n purchaseCacheUpgrade,\n purchaseHashUpgrade,\n updateHashManagerCapacity,\n} from \"../Hacknet/HacknetHelpers\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { HacknetNode } from \"../Hacknet/HacknetNode\";\nimport { HashUpgrades } from \"../Hacknet/HashUpgrades\";\nimport { HashUpgrade } from \"../Hacknet/HashUpgrade\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { Hacknet as IHacknet, NodeStats } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptHacknet(): InternalAPI<IHacknet> {\n // Utility function to get Hacknet Node object\n const getHacknetNode = function (ctx: NetscriptContext, i: number): HacknetNode | HacknetServer {\n if (i < 0 || i >= player.hacknetNodes.length) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Index specified for Hacknet Node is out-of-bounds: \" + i);\n }\n\n if (hasHacknetServers()) {\n const hi = player.hacknetNodes[i];\n if (typeof hi !== \"string\") throw new Error(\"hacknet node was not a string\");\n const hserver = GetServer(hi);\n if (!(hserver instanceof HacknetServer)) throw new Error(\"hacknet server was not actually hacknet server\");\n if (hserver == null) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Could not get Hacknet Server for index ${i}. This is probably a bug, please report to game dev`,\n );\n }\n\n return hserver;\n } else {\n const node = player.hacknetNodes[i];\n if (!(node instanceof HacknetNode)) throw new Error(\"hacknet node was not node.\");\n return node;\n }\n };\n\n return {\n numNodes: () => () => {\n return player.hacknetNodes.length;\n },\n maxNumNodes: () => () => {\n if (hasHacknetServers()) {\n return HacknetServerConstants.MaxServers;\n }\n return Infinity;\n },\n purchaseNode: () => () => {\n return purchaseHacknet();\n },\n getPurchaseNodeCost: () => () => {\n if (hasHacknetServers()) {\n return getCostOfNextHacknetServer();\n } else {\n return getCostOfNextHacknetNode();\n }\n },\n getNodeStats: (ctx) => (_i) => {\n const i = helpers.number(ctx, \"i\", _i);\n const node = getHacknetNode(ctx, i);\n const hasUpgraded = hasHacknetServers();\n const res: NodeStats = {\n name: node instanceof HacknetServer ? node.hostname : node.name,\n level: node.level,\n ram: node instanceof HacknetServer ? node.maxRam : node.ram,\n cores: node.cores,\n production: node instanceof HacknetServer ? node.hashRate : node.moneyGainRatePerSecond,\n timeOnline: node.onlineTimeSeconds,\n totalProduction: node instanceof HacknetServer ? node.totalHashesGenerated : node.totalMoneyGenerated,\n };\n\n if (hasUpgraded && node instanceof HacknetServer) {\n res.cache = node.cache;\n res.hashCapacity = node.hashCapacity;\n res.ramUsed = node.ramUsed;\n }\n\n return res;\n },\n upgradeLevel:\n (ctx) =>\n (_i, _n = 1) => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseLevelUpgrade(node, n);\n },\n upgradeRam:\n (ctx) =>\n (_i, _n = 1) => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseRamUpgrade(node, n);\n },\n upgradeCore:\n (ctx) =>\n (_i, _n = 1) => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseCoreUpgrade(node, n);\n },\n upgradeCache:\n (ctx) =>\n (_i, _n = 1) => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n if (!hasHacknetServers()) {\n return false;\n }\n const node = getHacknetNode(ctx, i);\n if (!(node instanceof HacknetServer)) {\n helpers.log(ctx, () => \"Can only be called on hacknet servers\");\n return false;\n }\n const res = purchaseCacheUpgrade(node, n);\n if (res) {\n updateHashManagerCapacity();\n }\n return res;\n },\n getLevelUpgradeCost:\n (ctx) =>\n (_i, _n = 1) => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateLevelUpgradeCost(n, player.mults.hacknet_node_level_cost);\n },\n getRamUpgradeCost:\n (ctx) =>\n (_i, _n = 1) => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateRamUpgradeCost(n, player.mults.hacknet_node_ram_cost);\n },\n getCoreUpgradeCost:\n (ctx) =>\n (_i, _n = 1) => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateCoreUpgradeCost(n, player.mults.hacknet_node_core_cost);\n },\n getCacheUpgradeCost:\n (ctx) =>\n (_i, _n = 1) => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n if (!hasHacknetServers()) {\n return Infinity;\n }\n const node = getHacknetNode(ctx, i);\n if (!(node instanceof HacknetServer)) {\n helpers.log(ctx, () => \"Can only be called on hacknet servers\");\n return -1;\n }\n return node.calculateCacheUpgradeCost(n);\n },\n numHashes: () => () => {\n if (!hasHacknetServers()) {\n return 0;\n }\n return player.hashManager.hashes;\n },\n hashCapacity: () => () => {\n if (!hasHacknetServers()) {\n return 0;\n }\n return player.hashManager.capacity;\n },\n hashCost:\n (ctx) =>\n (_upgName, _count = 1) => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const count = helpers.number(ctx, \"count\", _count);\n if (!hasHacknetServers()) {\n return Infinity;\n }\n\n return player.hashManager.getUpgradeCost(upgName, count);\n },\n spendHashes:\n (ctx) =>\n (_upgName, _upgTarget = \"\", _count = 1) => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const upgTarget = helpers.string(ctx, \"upgTarget\", _upgTarget);\n const count = helpers.number(ctx, \"count\", _count);\n if (!hasHacknetServers()) {\n return false;\n }\n return purchaseHashUpgrade(upgName, upgTarget, count);\n },\n getHashUpgrades: () => () => {\n if (!hasHacknetServers()) {\n return [];\n }\n return Object.values(HashUpgrades).map((upgrade: HashUpgrade) => upgrade.name);\n },\n getHashUpgradeLevel: (ctx) => (_upgName) => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const level = player.hashManager.upgrades[upgName];\n if (level === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid Hash Upgrade: ${upgName}`);\n }\n return level;\n },\n getStudyMult: () => () => {\n if (!hasHacknetServers()) {\n return 1;\n }\n return player.hashManager.getStudyMult();\n },\n getTrainingMult: () => () => {\n if (!hasHacknetServers()) {\n return 1;\n }\n return player.hashManager.getTrainingMult();\n },\n };\n}\n","/** Object representing an upgrade that can be purchased with hashes */\nexport interface IConstructorParams {\n cost?: number;\n costPerLevel: number;\n desc: string;\n hasTargetServer?: boolean;\n name: string;\n value: number;\n effectText?: (level: number) => JSX.Element | null;\n}\n\nexport class HashUpgrade {\n /**\n * If the upgrade has a flat cost (never increases), it goes here\n * Otherwise, this property should be undefined\n *\n * This property overrides the 'costPerLevel' property\n */\n cost?: number;\n\n /**\n * Base cost for this upgrade. Every time the upgrade is purchased,\n * its cost increases by this same amount (so its 1x, 2x, 3x, 4x, etc.)\n */\n costPerLevel = 0;\n\n /** Description of what the upgrade does */\n desc = \"\";\n\n /**\n * Boolean indicating that this upgrade's effect affects a single server,\n * the \"target\" server\n */\n hasTargetServer = false;\n\n /** Name of upgrade */\n name = \"\";\n\n // Generic value used to indicate the potency/amount of this upgrade's effect\n // The meaning varies between different upgrades\n value = 0;\n\n constructor(p: IConstructorParams) {\n if (p.cost != null) {\n this.cost = p.cost;\n }\n if (p.effectText != null) {\n this.effectText = p.effectText;\n }\n\n this.costPerLevel = p.costPerLevel;\n this.desc = p.desc;\n this.hasTargetServer = p.hasTargetServer ? p.hasTargetServer : false;\n this.name = p.name;\n this.value = p.value;\n }\n\n // Functions that returns the UI element to display the effect of this upgrade.\n effectText: (level: number) => JSX.Element | null = () => null;\n\n getCost(currentLevel: number, count = 1): number {\n if (typeof this.cost === \"number\") {\n return this.cost * count;\n }\n\n //This formula is equivalent to\n //(currentLevel + 1) * this.costPerLevel\n //being performed repeatedly\n const collapsedSum = 0.5 * count * (count + 2 * currentLevel + 1);\n return this.costPerLevel * collapsedSum;\n }\n}\n","// Metadata used to construct all Hash Upgrades\nimport React from \"react\";\nimport { IConstructorParams } from \"../HashUpgrade\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\n\nexport const HashUpgradesMetadata: IConstructorParams[] = [\n {\n cost: 4,\n costPerLevel: 4,\n desc: \"Sell hashes for $1m\",\n name: \"Sell for Money\",\n effectText: (level: number): JSX.Element | null => (\n <>\n Sold for <Money money={1e6 * level} />\n </>\n ),\n value: 1e6,\n },\n {\n costPerLevel: 100,\n desc: \"Sell hashes for $1b in Corporation funds\",\n name: \"Sell for Corporation Funds\",\n effectText: (level: number): JSX.Element | null => (\n <>\n Sold for <Money money={1e9 * level} /> Corporation funds.\n </>\n ),\n value: 1e9,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to decrease the minimum security of a single server by 2%. \" +\n \"Note that a server's minimum security cannot go below 1. This effect persists \" +\n \"until you install Augmentations (since servers are reset at that time).\",\n hasTargetServer: true,\n name: \"Reduce Minimum Security\",\n value: 0.98,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to increase the maximum amount of money on a single server by 2%. \" +\n \"Note that a server's maximum money is soft capped above $10t. \" +\n \"This effect persists until you install Augmentations (since servers \" +\n \"are reset at that time).\",\n hasTargetServer: true,\n name: \"Increase Maximum Money\",\n value: 1.02,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to improve the experience earned when studying at a university by 20%. \" +\n \"This effect persists until you install Augmentations\",\n name: \"Improve Studying\",\n effectText: (level: number): JSX.Element | null => <>Improves studying by {level * 20}%</>,\n value: 20, // Improves studying by value%\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to improve the experience earned when training at the gym by 20%. This effect \" +\n \"persists until you install Augmentations\",\n name: \"Improve Gym Training\",\n effectText: (level: number): JSX.Element | null => <>Improves training by {level * 20}%</>,\n value: 20, // Improves training by value%\n },\n {\n costPerLevel: 200,\n desc: \"Exchange hashes for 1k Scientific Research in all of your Corporation's Industries\",\n name: \"Exchange for Corporation Research\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {level}k Scientific Research in your industries.</>\n ),\n value: 1000,\n },\n {\n costPerLevel: 250,\n desc: \"Exchange hashes for 100 Bladeburner Rank\",\n name: \"Exchange for Bladeburner Rank\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {numeralWrapper.format(100 * level, \"0a\")} Bladeburner rank</>\n ),\n value: 100,\n },\n {\n costPerLevel: 250,\n desc: \"Exchanges hashes for 10 Bladeburner Skill Points\",\n name: \"Exchange for Bladeburner SP\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {numeralWrapper.format(10 * level, \"0a\")} Bladeburner Skill Points</>\n ),\n value: 10,\n },\n {\n costPerLevel: 200,\n desc: \"Generate a random Coding Contract somewhere on the network\",\n name: \"Generate Coding Contract\",\n effectText: (level: number): JSX.Element | null => <>Generated {level} contracts.</>,\n value: 1,\n },\n];\n","import { Player as player } from \"../Player\";\n\nimport { staneksGift } from \"../CotMG/Helper\";\nimport { Fragments, FragmentById } from \"../CotMG/Fragment\";\nimport { FragmentType } from \"../CotMG/FragmentType\";\n\nimport { Stanek as IStanek } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { NetscriptContext, InternalAPI } from \"../Netscript/APIWrapper\";\nimport { applyAugmentation } from \"../Augmentation/AugmentationHelpers\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { joinFaction } from \"../Faction/FactionHelpers\";\nimport { Factions } from \"../Faction/Factions\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptStanek(): InternalAPI<IStanek> {\n function checkStanekAPIAccess(ctx: NetscriptContext): void {\n if (!player.hasAugmentation(AugmentationNames.StaneksGift1, true)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Stanek's Gift is not installed\");\n }\n }\n\n return {\n giftWidth: (ctx) => () => {\n checkStanekAPIAccess(ctx);\n return staneksGift.width();\n },\n giftHeight: (ctx) => () => {\n checkStanekAPIAccess(ctx);\n return staneksGift.height();\n },\n chargeFragment: (ctx) => (_rootX, _rootY) => {\n //Get the fragment object using the given coordinates\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n checkStanekAPIAccess(ctx);\n const fragment = staneksGift.findFragment(rootX, rootY);\n //Check whether the selected fragment can ge charged\n if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `No fragment with root (${rootX}, ${rootY}).`);\n if (fragment.fragment().type == FragmentType.Booster) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `The fragment with root (${rootX}, ${rootY}) is a Booster Fragment and thus cannot be charged.`,\n );\n }\n //Charge the fragment\n const time = staneksGift.inBonus() ? 200 : 1000;\n return helpers.netscriptDelay(ctx, time).then(function () {\n staneksGift.charge(fragment, ctx.workerScript.scriptRef.threads);\n helpers.log(ctx, () => `Charged fragment with ${ctx.workerScript.scriptRef.threads} threads.`);\n return Promise.resolve();\n });\n },\n fragmentDefinitions: (ctx) => () => {\n checkStanekAPIAccess(ctx);\n helpers.log(ctx, () => `Returned ${Fragments.length} fragments`);\n return Fragments.map((f) => f.copy());\n },\n activeFragments: (ctx) => () => {\n checkStanekAPIAccess(ctx);\n helpers.log(ctx, () => `Returned ${staneksGift.fragments.length} fragments`);\n return staneksGift.fragments.map((af) => {\n return { ...af.copy(), ...af.fragment().copy() };\n });\n },\n clearGift: (ctx) => () => {\n checkStanekAPIAccess(ctx);\n helpers.log(ctx, () => `Cleared Stanek's Gift.`);\n staneksGift.clear();\n },\n canPlaceFragment: (ctx) => (_rootX, _rootY, _rotation, _fragmentId) => {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n const rotation = helpers.number(ctx, \"rotation\", _rotation);\n const fragmentId = helpers.number(ctx, \"fragmentId\", _fragmentId);\n checkStanekAPIAccess(ctx);\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid fragment id: ${fragmentId}`);\n const can = staneksGift.canPlace(rootX, rootY, rotation, fragment);\n return can;\n },\n placeFragment: (ctx) => (_rootX, _rootY, _rotation, _fragmentId) => {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n const rotation = helpers.number(ctx, \"rotation\", _rotation);\n const fragmentId = helpers.number(ctx, \"fragmentId\", _fragmentId);\n checkStanekAPIAccess(ctx);\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid fragment id: ${fragmentId}`);\n return staneksGift.place(rootX, rootY, rotation, fragment);\n },\n getFragment: (ctx) => (_rootX, _rootY) => {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n checkStanekAPIAccess(ctx);\n const fragment = staneksGift.findFragment(rootX, rootY);\n if (fragment !== undefined) return fragment.copy();\n return undefined;\n },\n removeFragment: (ctx) => (_rootX, _rootY) => {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n checkStanekAPIAccess(ctx);\n return staneksGift.delete(rootX, rootY);\n },\n acceptGift: (ctx) => () => {\n //Check if the player is eligible to join the church\n if (\n player.canAccessCotMG() &&\n player.augmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length == 0 &&\n player.queuedAugmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length == 0\n ) {\n //Attempt to join CotMG\n joinFaction(Factions[FactionNames.ChurchOfTheMachineGod]);\n //Attempt to install the first Stanek aug\n if (\n !player.hasAugmentation(AugmentationNames.StaneksGift1) &&\n !player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)\n ) {\n applyAugmentation({ name: AugmentationNames.StaneksGift1, level: 1 });\n helpers.log(\n ctx,\n () => `'${FactionNames.ChurchOfTheMachineGod}' joined and '${AugmentationNames.StaneksGift1}' installed.`,\n );\n }\n }\n //Return true iff the player is in CotMG and has the first Stanek aug installed\n return (\n Factions[FactionNames.ChurchOfTheMachineGod].isMember &&\n player.hasAugmentation(AugmentationNames.StaneksGift1, true)\n );\n },\n };\n}\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nexport function CalculateEffect(highestCharge: number, numCharge: number, power: number, boost: number): number {\n return (\n 1 +\n (Math.log(highestCharge + 1) / 60) *\n Math.pow((numCharge + 1) / 5, 0.07) *\n power *\n boost *\n BitNodeMultipliers.StaneksGiftPowerMultiplier\n );\n}\n","import { Infiltration as IInfiltration, InfiltrationLocation } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Location } from \"../Locations/Location\";\nimport { Locations } from \"../Locations/Locations\";\nimport { calculateDifficulty, calculateReward } from \"../Infiltration/formulas/game\";\nimport {\n calculateInfiltratorsRepReward,\n calculateSellInformationCashReward,\n calculateTradeInformationRepReward,\n} from \"../Infiltration/formulas/victory\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Factions } from \"../Faction/Factions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { checkEnum } from \"../utils/helpers/checkEnum\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptInfiltration(): InternalAPI<IInfiltration> {\n const getLocationsWithInfiltrations = Object.values(Locations).filter(\n (location: Location) => location.infiltrationData,\n );\n\n const calculateInfiltrationData = (ctx: NetscriptContext, locationName: string): InfiltrationLocation => {\n if (!checkEnum(LocationName, locationName)) throw new Error(`Location '${locationName}' does not exists.`);\n const location = Locations[locationName];\n if (location === undefined) throw helpers.makeRuntimeErrorMsg(ctx, `Location '${location}' does not exists.`);\n if (location.infiltrationData === undefined)\n throw helpers.makeRuntimeErrorMsg(ctx, `Location '${location}' does not provide infiltrations.`);\n const startingSecurityLevel = location.infiltrationData.startingSecurityLevel;\n const difficulty = calculateDifficulty(startingSecurityLevel);\n const reward = calculateReward(startingSecurityLevel);\n const maxLevel = location.infiltrationData.maxClearanceLevel;\n return {\n location: JSON.parse(JSON.stringify(location)),\n reward: {\n tradeRep: calculateTradeInformationRepReward(reward, maxLevel, startingSecurityLevel),\n sellCash: calculateSellInformationCashReward(reward, maxLevel, startingSecurityLevel),\n SoARep: calculateInfiltratorsRepReward(Factions[FactionNames.ShadowsOfAnarchy], startingSecurityLevel),\n },\n difficulty: difficulty,\n };\n };\n return {\n getPossibleLocations: () => () => {\n return getLocationsWithInfiltrations.map((l) => ({\n city: l.city ?? \"\",\n name: String(l.name),\n }));\n },\n getInfiltration: (ctx) => (_location) => {\n const location = helpers.string(ctx, \"location\", _location);\n return calculateInfiltrationData(ctx, location);\n },\n };\n}\n","import { CityName } from \"./data/CityNames\";\nimport { LocationName } from \"./data/LocationNames\";\nimport { LocationType } from \"./LocationTypeEnum\";\n\ninterface IInfiltrationMetadata {\n maxClearanceLevel: number;\n startingSecurityLevel: number;\n}\n\nexport interface IConstructorParams {\n city?: CityName | null;\n costMult?: number;\n expMult?: number;\n infiltrationData?: IInfiltrationMetadata;\n name?: LocationName;\n types?: LocationType[];\n techVendorMaxRam?: number;\n techVendorMinRam?: number;\n}\n\n/** Class representing a visitable location in the world */\nexport class Location {\n /**\n * Name of city this location is in. If this property is null, it means this i\n * is a generic location that is available in all cities\n */\n city: CityName | null = null;\n\n /** Cost multiplier that influences how expensive a gym/university is */\n costMult = 0;\n\n /** Exp multiplier that influences how effective a gym/university is */\n expMult = 0;\n\n /**\n * Companies can be infiltrated. This contains the data required for that\n * infiltration event\n */\n infiltrationData?: IInfiltrationMetadata;\n\n /** Identifier for location */\n name: LocationName = LocationName.Void;\n\n /**\n * List of what type(s) this location is. A location can be multiple types\n * (e.g. company and tech vendor)\n */\n types: LocationType[] = [];\n\n /**\n * Tech vendors allow you to purchase servers.\n * This property defines the max RAM server you can purchase from this vendor\n */\n techVendorMaxRam = 0;\n\n /**\n * Tech vendors allow you to purchase servers.\n * This property defines the max RAM server you can purchase from this vendor\n */\n techVendorMinRam = 0;\n\n constructor(p: IConstructorParams) {\n if (p.city) {\n this.city = p.city;\n }\n if (p.costMult) {\n this.costMult = p.costMult;\n }\n if (p.expMult) {\n this.expMult = p.expMult;\n }\n if (p.infiltrationData) {\n this.infiltrationData = p.infiltrationData;\n }\n if (p.name) {\n this.name = p.name;\n }\n if (p.types) {\n this.types = p.types;\n }\n if (p.techVendorMaxRam) {\n this.techVendorMaxRam = p.techVendorMaxRam;\n }\n if (p.techVendorMinRam) {\n this.techVendorMinRam = p.techVendorMinRam;\n }\n }\n}\n","import { UserInterface as IUserInterface } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Settings } from \"../Settings/Settings\";\nimport { ThemeEvents } from \"../Themes/ui/Theme\";\nimport { defaultTheme } from \"../Themes/Themes\";\nimport { defaultStyles } from \"../Themes/Styles\";\nimport { CONSTANTS } from \"../Constants\";\nimport { hash } from \"../hash/hash\";\nimport { InternalAPI } from \"../Netscript/APIWrapper\";\nimport { Terminal } from \"../../src/Terminal\";\nimport { helpers, assertObjectType } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptUserInterface(): InternalAPI<IUserInterface> {\n return {\n windowSize: () => () => {\n return [window.innerWidth, window.innerHeight];\n },\n getTheme: () => () => {\n return { ...Settings.theme };\n },\n\n getStyles: () => () => {\n return { ...Settings.styles };\n },\n\n setTheme: (ctx) => (newTheme) => {\n const themeValidator: Record<string, string | undefined> = {};\n assertObjectType(ctx, \"newTheme\", newTheme, themeValidator);\n const hex = /^(#)((?:[A-Fa-f0-9]{2}){3,4}|(?:[A-Fa-f0-9]{3}))$/;\n const currentTheme = { ...Settings.theme };\n const errors: string[] = [];\n if (typeof newTheme !== \"object\")\n for (const key of Object.keys(newTheme)) {\n if (!currentTheme[key]) {\n // Invalid key\n errors.push(`Invalid key \"${key}\"`);\n } else if (!hex.test(newTheme[key] ?? \"\")) {\n errors.push(`Invalid color \"${key}\": ${newTheme[key]}`);\n } else {\n currentTheme[key] = newTheme[key];\n }\n }\n\n if (errors.length === 0) {\n Object.assign(Settings.theme, currentTheme);\n ThemeEvents.emit();\n helpers.log(ctx, () => `Successfully set theme`);\n } else {\n helpers.log(ctx, () => `Failed to set theme. Errors: ${errors.join(\", \")}`);\n }\n },\n\n setStyles: (ctx) => (newStyles) => {\n const styleValidator: Record<string, string | number | undefined> = {};\n assertObjectType(ctx, \"newStyles\", newStyles, styleValidator);\n const currentStyles = { ...Settings.styles };\n const errors: string[] = [];\n for (const key of Object.keys(newStyles)) {\n if (!(currentStyles as any)[key]) {\n // Invalid key\n errors.push(`Invalid key \"${key}\"`);\n } else {\n (currentStyles as any)[key] = newStyles[key];\n }\n }\n\n if (errors.length === 0) {\n Object.assign(Settings.styles, currentStyles);\n ThemeEvents.emit();\n helpers.log(ctx, () => `Successfully set styles`);\n } else {\n helpers.log(ctx, () => `Failed to set styles. Errors: ${errors.join(\", \")}`);\n }\n },\n\n resetTheme: (ctx) => () => {\n Settings.theme = { ...defaultTheme };\n ThemeEvents.emit();\n helpers.log(ctx, () => `Reinitialized theme to default`);\n },\n\n resetStyles: (ctx) => () => {\n Settings.styles = { ...defaultStyles };\n ThemeEvents.emit();\n helpers.log(ctx, () => `Reinitialized styles to default`);\n },\n\n getGameInfo: () => () => {\n const version = CONSTANTS.VersionString;\n const commit = hash();\n const platform = navigator.userAgent.toLowerCase().indexOf(\" electron/\") > -1 ? \"Steam\" : \"Browser\";\n\n const gameInfo = {\n version,\n commit,\n platform,\n };\n\n return gameInfo;\n },\n\n clearTerminal: (ctx) => () => {\n helpers.log(ctx, () => `Clearing terminal`);\n Terminal.clear();\n },\n };\n}\n","import { Player } from \"@player\";\nimport { Bladeburner } from \"../Bladeburner/Bladeburner\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Bladeburner as INetscriptBladeburner } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Action } from \"src/Bladeburner/Action\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\nimport { BlackOperation } from \"../Bladeburner/BlackOperation\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptBladeburner(): InternalAPI<INetscriptBladeburner> {\n const checkBladeburnerAccess = function (ctx: NetscriptContext): void {\n getBladeburner(ctx);\n return;\n };\n const getBladeburner = function (ctx: NetscriptContext): Bladeburner {\n const apiAccess = Player.bitNodeN === 7 || Player.sourceFiles.some((a) => a.n === 7);\n if (!apiAccess) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You have not unlocked the bladeburner API.\", \"API ACCESS\");\n }\n const bladeburner = Player.bladeburner;\n if (!bladeburner)\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must be a member of the Bladeburner division to use this API.\");\n return bladeburner;\n };\n\n const checkBladeburnerCity = function (ctx: NetscriptContext, city: string): void {\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n if (!bladeburner.cities.hasOwnProperty(city)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid city: ${city}`);\n }\n };\n\n const getBladeburnerActionObject = function (ctx: NetscriptContext, type: string, name: string): Action {\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n const actionId = bladeburner.getActionIdFromTypeAndName(type, name);\n if (!actionId) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid action type='${type}', name='${name}'`);\n }\n const actionObj = bladeburner.getActionObject(actionId);\n if (!actionObj) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid action type='${type}', name='${name}'`);\n }\n\n return actionObj;\n };\n\n return {\n getContractNames: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.getContractNamesNetscriptFn();\n },\n getOperationNames: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.getOperationNamesNetscriptFn();\n },\n getBlackOpNames: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.getBlackOpNamesNetscriptFn();\n },\n getBlackOpRank: (ctx) => (_blackOpName) => {\n const blackOpName = helpers.string(ctx, \"blackOpName\", _blackOpName);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, \"blackops\", blackOpName);\n if (!(action instanceof BlackOperation)) throw new Error(\"action was not a black operation\");\n return action.reqdRank;\n },\n getGeneralActionNames: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.getGeneralActionNamesNetscriptFn();\n },\n getSkillNames: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.getSkillNamesNetscriptFn();\n },\n startAction: (ctx) => (_type, _name) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const bladeburner = getBladeburner(ctx);\n try {\n return bladeburner.startActionNetscriptFn(type, name, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n stopBladeburnerAction: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.resetAction();\n },\n getCurrentAction: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.getTypeAndNameFromActionId(bladeburner.action);\n },\n getActionTime: (ctx) => (_type, _name) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const bladeburner = getBladeburner(ctx);\n try {\n const time = bladeburner.getActionTimeNetscriptFn(Player, type, name);\n if (typeof time === \"string\") {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n helpers.log(ctx, () => errorLogText);\n return -1;\n } else {\n return time;\n }\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionCurrentTime: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n try {\n const timecomputed =\n Math.min(bladeburner.actionTimeCurrent + bladeburner.actionTimeOverflow, bladeburner.actionTimeToComplete) *\n 1000;\n return timecomputed;\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionEstimatedSuccessChance: (ctx) => (_type, _name) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const bladeburner = getBladeburner(ctx);\n try {\n const chance = bladeburner.getActionEstimatedSuccessChanceNetscriptFn(Player, type, name);\n if (typeof chance === \"string\") {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n helpers.log(ctx, () => errorLogText);\n return [-1, -1];\n } else {\n return chance;\n }\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionRepGain: (ctx) => (_type, _name, _level) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const level = helpers.number(ctx, \"level\", _level);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n let rewardMultiplier;\n if (level == null || isNaN(level)) {\n rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n } else {\n rewardMultiplier = Math.pow(action.rewardFac, level - 1);\n }\n\n return action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank;\n },\n getActionCountRemaining: (ctx) => (_type, _name) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const bladeburner = getBladeburner(ctx);\n try {\n return bladeburner.getActionCountRemainingNetscriptFn(type, name, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionMaxLevel: (ctx) => (_type, _name) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.maxLevel;\n },\n getActionCurrentLevel: (ctx) => (_type, _name) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.level;\n },\n getActionAutolevel: (ctx) => (_type, _name) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.autoLevel;\n },\n setActionAutolevel:\n (ctx) =>\n (_type, _name, _autoLevel = true) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const autoLevel = !!_autoLevel;\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n action.autoLevel = autoLevel;\n },\n setActionLevel:\n (ctx) =>\n (_type, _name, _level = 1) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const level = helpers.number(ctx, \"level\", _level);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n if (level < 1 || level > action.maxLevel) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Level must be between 1 and ${action.maxLevel}, is ${level}`);\n }\n action.level = level;\n },\n getRank: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.rank;\n },\n getSkillPoints: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.skillPoints;\n },\n getSkillLevel: (ctx) => (_skillName) => {\n const skillName = helpers.string(ctx, \"skillName\", _skillName);\n const bladeburner = getBladeburner(ctx);\n try {\n return bladeburner.getSkillLevelNetscriptFn(skillName, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getSkillUpgradeCost:\n (ctx) =>\n (_skillName, _count = 1) => {\n const skillName = helpers.string(ctx, \"skillName\", _skillName);\n const count = helpers.number(ctx, \"count\", _count);\n const bladeburner = getBladeburner(ctx);\n try {\n return bladeburner.getSkillUpgradeCostNetscriptFn(skillName, count, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n upgradeSkill:\n (ctx) =>\n (_skillName, _count = 1) => {\n const skillName = helpers.string(ctx, \"skillName\", _skillName);\n const count = helpers.number(ctx, \"count\", _count);\n const bladeburner = getBladeburner(ctx);\n try {\n return bladeburner.upgradeSkillNetscriptFn(skillName, count, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getTeamSize: (ctx) => (_type, _name) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const bladeburner = getBladeburner(ctx);\n try {\n return bladeburner.getTeamSizeNetscriptFn(type, name, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n setTeamSize: (ctx) => (_type, _name, _size) => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const size = helpers.number(ctx, \"size\", _size);\n const bladeburner = getBladeburner(ctx);\n try {\n return bladeburner.setTeamSizeNetscriptFn(type, name, size, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getCityEstimatedPopulation: (ctx) => (_cityName) => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].popEst;\n },\n getCityCommunities: (ctx) => (_cityName) => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].comms;\n },\n getCityChaos: (ctx) => (_cityName) => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].chaos;\n },\n getCity: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.city;\n },\n switchCity: (ctx) => (_cityName) => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n bladeburner.city = cityName;\n return true;\n },\n getStamina: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return [bladeburner.stamina, bladeburner.maxStamina];\n },\n joinBladeburnerFaction: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return bladeburner.joinBladeburnerFactionNetscriptFn(ctx.workerScript);\n },\n joinBladeburnerDivision: (ctx) => () => {\n if (Player.bitNodeN === 7 || Player.sourceFileLvl(7) > 0) {\n if (BitNodeMultipliers.BladeburnerRank === 0) {\n return false; // Disabled in this bitnode\n }\n if (Player.bladeburner) {\n return true; // Already member\n } else if (\n Player.skills.strength >= 100 &&\n Player.skills.defense >= 100 &&\n Player.skills.dexterity >= 100 &&\n Player.skills.agility >= 100\n ) {\n Player.bladeburner = new Bladeburner();\n helpers.log(ctx, () => \"You have been accepted into the Bladeburner division\");\n\n return true;\n } else {\n helpers.log(ctx, () => \"You do not meet the requirements for joining the Bladeburner division\");\n return false;\n }\n }\n return false;\n },\n getBonusTime: (ctx) => () => {\n const bladeburner = getBladeburner(ctx);\n return Math.round(bladeburner.storedCycles / 5) * 1000;\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { CodingContract } from \"../CodingContracts\";\nimport { CodingAttemptOptions, CodingContract as ICodingContract } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers, assertObjectType } from \"../Netscript/NetscriptHelpers\";\nimport { codingContractTypesMetadata } from \"../data/codingcontracttypes\";\nimport { generateDummyContract } from \"../CodingContractGenerator\";\n\nexport function NetscriptCodingContract(): InternalAPI<ICodingContract> {\n const getCodingContract = function (ctx: NetscriptContext, hostname: string, filename: string): CodingContract {\n const server = helpers.getServer(ctx, hostname);\n const contract = server.getContract(filename);\n if (contract == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Cannot find contract '${filename}' on server '${hostname}'`);\n }\n\n return contract;\n };\n\n return {\n attempt: (ctx) => (answer, _filename, _hostname?, opts?) => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = _hostname ? helpers.string(ctx, \"hostname\", _hostname) : ctx.workerScript.hostname;\n const contract = getCodingContract(ctx, hostname, filename);\n\n const optsValidator: CodingAttemptOptions = { returnReward: true };\n opts ??= optsValidator;\n assertObjectType(ctx, \"opts\", opts, optsValidator);\n if (typeof answer !== \"number\" && typeof answer !== \"string\" && !Array.isArray(answer))\n throw new Error(\"The answer provided was not a number, string, or array\");\n\n // Convert answer to string.\n const answerStr = typeof answer === \"string\" ? answer : JSON.stringify(answer);\n const creward = contract.reward;\n\n const serv = helpers.getServer(ctx, hostname);\n if (contract.isSolution(answerStr)) {\n const reward = player.gainCodingContractReward(creward, contract.getDifficulty());\n helpers.log(ctx, () => `Successfully completed Coding Contract '${filename}'. Reward: ${reward}`);\n serv.removeContract(filename);\n return opts.returnReward ? reward : true;\n } else {\n ++contract.tries;\n if (contract.tries >= contract.getMaxNumTries()) {\n helpers.log(ctx, () => `Coding Contract attempt '${filename}' failed. Contract is now self-destructing`);\n serv.removeContract(filename);\n } else {\n helpers.log(\n ctx,\n () =>\n `Coding Contract attempt '${filename}' failed. ${\n contract.getMaxNumTries() - contract.tries\n } attempts remaining.`,\n );\n }\n\n return opts.returnReward ? \"\" : false;\n }\n },\n getContractType: (ctx) => (_filename, _hostname?) => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = _hostname ? helpers.string(ctx, \"hostname\", _hostname) : ctx.workerScript.hostname;\n const contract = getCodingContract(ctx, hostname, filename);\n return contract.getType();\n },\n getData: (ctx) => (_filename, _hostname?) => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = _hostname ? helpers.string(ctx, \"hostname\", _hostname) : ctx.workerScript.hostname;\n const contract = getCodingContract(ctx, hostname, filename);\n const data = contract.getData();\n if (Array.isArray(data)) {\n // For two dimensional arrays, we have to copy the internal arrays using\n // slice() as well. As of right now, no contract has arrays that have\n // more than two dimensions\n const copy = data.slice();\n for (let i = 0; i < copy.length; ++i) {\n if (data[i].constructor === Array) {\n copy[i] = data[i].slice();\n }\n }\n\n return copy;\n } else return data;\n },\n getDescription: (ctx) => (_filename, _hostname?) => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = _hostname ? helpers.string(ctx, \"hostname\", _hostname) : ctx.workerScript.hostname;\n const contract = getCodingContract(ctx, hostname, filename);\n return contract.getDescription();\n },\n getNumTriesRemaining: (ctx) => (_filename, _hostname?) => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = _hostname ? helpers.string(ctx, \"hostname\", _hostname) : ctx.workerScript.hostname;\n const contract = getCodingContract(ctx, hostname, filename);\n return contract.getMaxNumTries() - contract.tries;\n },\n createDummyContract: (ctx) => (_type) => {\n const type = helpers.string(ctx, \"type\", _type);\n generateDummyContract(type);\n },\n getContractTypes: () => () => codingContractTypesMetadata.map((c) => c.name),\n };\n}\n","import { Player as player } from \"../Player\";\n\nimport { OfficeSpace } from \"../Corporation/OfficeSpace\";\nimport { Employee } from \"../Corporation/Employee\";\nimport { Product } from \"../Corporation/Product\";\nimport { Material } from \"../Corporation/Material\";\nimport { Warehouse } from \"../Corporation/Warehouse\";\nimport { Industry } from \"../Corporation/Industry\";\nimport { Corporation } from \"../Corporation/Corporation\";\n\nimport {\n Corporation as NSCorporation,\n Division as NSDivision,\n WarehouseAPI,\n OfficeAPI,\n InvestmentOffer,\n} from \"../ScriptEditor/NetscriptDefinitions\";\n\nimport {\n NewIndustry,\n NewCity,\n UnlockUpgrade,\n LevelUpgrade,\n IssueDividends,\n SellMaterial,\n SellProduct,\n SetSmartSupply,\n BuyMaterial,\n AssignJob,\n AutoAssignJob,\n UpgradeOfficeSize,\n PurchaseWarehouse,\n UpgradeWarehouse,\n BuyCoffee,\n ThrowParty,\n HireAdVert,\n MakeProduct,\n Research,\n ExportMaterial,\n CancelExportMaterial,\n SetMaterialMarketTA1,\n SetMaterialMarketTA2,\n SetProductMarketTA1,\n SetProductMarketTA2,\n BulkPurchase,\n SellShares,\n BuyBackShares,\n SetSmartSupplyUseLeftovers,\n LimitMaterialProduction,\n LimitProductProduction,\n UpgradeWarehouseCost,\n} from \"../Corporation/Actions\";\nimport { CorporationUnlockUpgrades } from \"../Corporation/data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrades } from \"../Corporation/data/CorporationUpgrades\";\nimport { EmployeePositions } from \"../Corporation/EmployeePositions\";\nimport { IndustryResearchTrees, IndustryStartingCosts } from \"../Corporation/IndustryData\";\nimport { CorporationConstants } from \"../Corporation/data/Constants\";\nimport { ResearchMap } from \"../Corporation/ResearchMap\";\nimport { Factions } from \"../Faction/Factions\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\nimport { checkEnum } from \"../utils/helpers/checkEnum\";\n\nexport function NetscriptCorporation(): InternalAPI<NSCorporation> {\n function createCorporation(corporationName: string, selfFund = true): boolean {\n if (!player.canAccessCorporation() || player.hasCorporation()) return false;\n if (!corporationName) return false;\n if (player.bitNodeN !== 3 && !selfFund) throw new Error(\"cannot use seed funds outside of BitNode 3\");\n if (BitNodeMultipliers.CorporationSoftcap < 0.15)\n throw new Error(`You cannot create a corporation in Bitnode ${player.bitNodeN}`);\n\n if (selfFund) {\n if (!player.canAfford(150e9)) return false;\n\n player.startCorporation(corporationName);\n player.loseMoney(150e9, \"corporation\");\n } else {\n player.startCorporation(corporationName, 500e6);\n }\n return true;\n }\n\n function hasUnlockUpgrade(upgradeName: string): boolean {\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n return corporation.unlockUpgrades[upgN] === 1;\n }\n\n function getUnlockUpgradeCost(upgradeName: string): number {\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n return upgrade.price;\n }\n\n function getUpgradeLevel(ctx: NetscriptContext, _upgradeName: string): number {\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n return corporation.upgrades[upgN];\n }\n\n function getUpgradeLevelCost(ctx: NetscriptContext, _upgradeName: string): number {\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n const baseCost = upgrade.basePrice;\n const priceMult = upgrade.priceMult;\n const level = corporation.upgrades[upgN];\n return baseCost * Math.pow(priceMult, level);\n }\n\n function getExpandIndustryCost(industryName: string): number {\n const cost = IndustryStartingCosts[industryName];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industryName}'`);\n }\n return cost;\n }\n\n function getExpandCityCost(): number {\n return CorporationConstants.OfficeInitialCost;\n }\n\n function getInvestmentOffer(): InvestmentOffer {\n const corporation = getCorporation();\n if (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length ||\n corporation.public\n )\n return {\n funds: 0,\n shares: 0,\n round: corporation.fundingRound + 1, // Make more readable\n }; // Don't throw an error here, no reason to have a second function to check if you can get investment.\n const val = corporation.valuation;\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n return {\n funds: funding,\n shares: investShares,\n round: corporation.fundingRound + 1, // Make more readable\n };\n }\n\n function acceptInvestmentOffer(): boolean {\n const corporation = getCorporation();\n if (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length ||\n corporation.public\n )\n return false;\n const val = corporation.valuation;\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n corporation.fundingRound++;\n corporation.addFunds(funding);\n corporation.numShares -= investShares;\n return true;\n }\n\n function goPublic(numShares: number): boolean {\n const corporation = getCorporation();\n const initialSharePrice = corporation.valuation / corporation.totalShares;\n if (isNaN(numShares)) throw new Error(\"Invalid value for number of issued shares\");\n if (numShares < 0) throw new Error(\"Invalid value for number of issued shares\");\n if (numShares > corporation.numShares) throw new Error(\"You don't have that many shares to issue!\");\n corporation.public = true;\n corporation.sharePrice = initialSharePrice;\n corporation.issuedShares = numShares;\n corporation.numShares -= numShares;\n corporation.addFunds(numShares * initialSharePrice);\n return true;\n }\n\n function getResearchCost(division: Industry, researchName: string): number {\n const researchTree = IndustryResearchTrees[division.type];\n if (researchTree === undefined) throw new Error(`No research tree for industry '${division.type}'`);\n const allResearch = researchTree.getAllNodes();\n if (!allResearch.includes(researchName)) throw new Error(`No research named '${researchName}'`);\n const research = ResearchMap[researchName];\n return research.cost;\n }\n\n function hasResearched(division: Industry, researchName: string): boolean {\n return division.researched[researchName] === undefined ? false : (division.researched[researchName] as boolean);\n }\n\n function bribe(factionName: string, amountCash: number): boolean {\n if (!player.factions.includes(factionName)) throw new Error(\"Invalid faction name\");\n if (isNaN(amountCash) || amountCash < 0)\n throw new Error(\"Invalid value for amount field! Must be numeric, greater than 0.\");\n\n const corporation = getCorporation();\n if (corporation.funds < amountCash) return false;\n const faction = Factions[factionName];\n const info = faction.getInfo();\n if (!info.offersWork()) return false;\n if (player.hasGangWith(factionName)) return false;\n\n const repGain = amountCash / CorporationConstants.BribeToRepRatio;\n faction.playerReputation += repGain;\n corporation.funds = corporation.funds - amountCash;\n\n return true;\n }\n\n function getCorporation(): Corporation {\n const corporation = player.corporation;\n if (corporation === null) throw new Error(\"cannot be called without a corporation\");\n return corporation;\n }\n\n function getDivision(divisionName: string): Industry {\n const corporation = getCorporation();\n const division = corporation.divisions.find((div) => div.name === divisionName);\n if (division === undefined) throw new Error(`No division named '${divisionName}'`);\n return division;\n }\n\n function getOffice(divisionName: string, cityName: string): OfficeSpace {\n const division = getDivision(divisionName);\n if (!(cityName in division.offices)) throw new Error(`Invalid city name '${cityName}'`);\n const office = division.offices[cityName];\n if (office === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);\n return office;\n }\n\n function getWarehouse(divisionName: string, cityName: string): Warehouse {\n const division = getDivision(divisionName);\n if (!(cityName in division.warehouses)) throw new Error(`Invalid city name '${cityName}'`);\n const warehouse = division.warehouses[cityName];\n if (warehouse === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);\n return warehouse;\n }\n\n function getMaterial(divisionName: string, cityName: string, materialName: string): Material {\n const warehouse = getWarehouse(divisionName, cityName);\n const matName = materialName.replace(/ /g, \"\");\n const material = warehouse.materials[matName];\n if (material === undefined) throw new Error(`Invalid material name: '${materialName}'`);\n return material;\n }\n\n function getProduct(divisionName: string, productName: string): Product {\n const division = getDivision(divisionName);\n const product = division.products[productName];\n if (product === undefined) throw new Error(`Invalid product name: '${productName}'`);\n return product;\n }\n\n function getEmployee(divisionName: string, cityName: string, employeeName: string): Employee {\n const office = getOffice(divisionName, cityName);\n const employee = office.employees.find((e) => e.name === employeeName);\n if (employee === undefined) throw new Error(`Invalid employee name: '${employeeName}'`);\n return employee;\n }\n\n function checkAccess(ctx: NetscriptContext, api?: number): void {\n if (player.corporation === null) throw helpers.makeRuntimeErrorMsg(ctx, \"Must own a corporation.\");\n if (!api) return;\n\n if (!player.corporation.unlockUpgrades[api])\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have access to this API.\");\n }\n\n function getSafeDivision(division: Industry): NSDivision {\n const cities: string[] = [];\n for (const office of Object.values(division.offices)) {\n if (office === 0) continue;\n cities.push(office.loc);\n }\n\n return {\n name: division.name,\n type: division.type,\n awareness: division.awareness,\n popularity: division.popularity,\n prodMult: division.prodMult,\n research: division.sciResearch.qty,\n lastCycleRevenue: division.lastCycleRevenue,\n lastCycleExpenses: division.lastCycleExpenses,\n thisCycleRevenue: division.thisCycleRevenue,\n thisCycleExpenses: division.thisCycleExpenses,\n upgrades: [0, division.numAdVerts],\n cities: cities,\n products: division.products === undefined ? [] : Object.keys(division.products),\n makesProducts: division.makesProducts,\n };\n }\n\n const warehouseAPI: InternalAPI<WarehouseAPI> = {\n getPurchaseWarehouseCost: (ctx) => () => {\n checkAccess(ctx, 7);\n return CorporationConstants.WarehouseInitialCost;\n },\n getUpgradeWarehouseCost:\n (ctx) =>\n (_divisionName, _cityName, _amt = 1) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const amt = helpers.number(ctx, \"amount\", _amt);\n if (amt < 1) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must provide a positive number\");\n }\n const warehouse = getWarehouse(divisionName, cityName);\n return UpgradeWarehouseCost(warehouse, amt);\n },\n hasWarehouse: (ctx) => (_divisionName, _cityName) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const division = getDivision(divisionName);\n if (!(cityName in division.warehouses)) throw new Error(`Invalid city name '${cityName}'`);\n const warehouse = division.warehouses[cityName];\n return warehouse !== 0;\n },\n getWarehouse: (ctx) => (_divisionName, _cityName) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const warehouse = getWarehouse(divisionName, cityName);\n return {\n level: warehouse.level,\n loc: warehouse.loc,\n size: warehouse.size,\n sizeUsed: warehouse.sizeUsed,\n smartSupplyEnabled: warehouse.smartSupplyEnabled,\n };\n },\n getMaterial: (ctx) => (_divisionName, _cityName, _materialName) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const material = getMaterial(divisionName, cityName, materialName);\n const corporation = getCorporation();\n const exports = material.exp.map((e) => {\n return { div: e.ind, loc: e.city, amt: e.amt };\n });\n return {\n cost: material.bCost,\n sCost: material.sCost,\n name: material.name,\n qty: material.qty,\n qlt: material.qlt,\n dmd: corporation.unlockUpgrades[2] ? material.dmd : undefined,\n cmp: corporation.unlockUpgrades[3] ? material.cmp : undefined,\n prod: material.prd,\n sell: material.sll,\n exp: exports,\n };\n },\n getProduct: (ctx) => (_divisionName, _productName) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const product = getProduct(divisionName, productName);\n const corporation = getCorporation();\n return {\n name: product.name,\n dmd: corporation.unlockUpgrades[2] ? product.dmd : undefined,\n cmp: corporation.unlockUpgrades[3] ? product.cmp : undefined,\n rat: product.rat,\n properties: {\n qlt: product.qlt,\n per: product.per,\n dur: product.dur,\n rel: product.rel,\n aes: product.aes,\n fea: product.fea,\n },\n pCost: product.pCost,\n sCost: product.sCost,\n cityData: product.data,\n developmentProgress: product.prog,\n };\n },\n purchaseWarehouse: (ctx) => (_divisionName, _cityName) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const corporation = getCorporation();\n PurchaseWarehouse(corporation, getDivision(divisionName), cityName);\n },\n upgradeWarehouse:\n (ctx) =>\n (_divisionName, _cityName, _amt = 1): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const amt = helpers.number(ctx, \"amount\", _amt);\n const corporation = getCorporation();\n if (amt < 1) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must provide a positive number\");\n }\n UpgradeWarehouse(corporation, getDivision(divisionName), getWarehouse(divisionName, cityName), amt);\n },\n sellMaterial: (ctx) => (_divisionName, _cityName, _materialName, _amt, _price) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n const price = helpers.string(ctx, \"price\", _price);\n const material = getMaterial(divisionName, cityName, materialName);\n SellMaterial(material, amt, price);\n },\n sellProduct:\n (ctx) =>\n (_divisionName, _cityName, _productName, _amt, _price, _all): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n const price = helpers.string(ctx, \"price\", _price);\n const all = !!_all;\n const product = getProduct(divisionName, productName);\n SellProduct(product, cityName, amt, price, all);\n },\n discontinueProduct: (ctx) => (_divisionName, _productName) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n getDivision(divisionName).discontinueProduct(getProduct(divisionName, productName));\n },\n setSmartSupply: (ctx) => (_divisionName, _cityName, _enabled) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const enabled = !!_enabled;\n const warehouse = getWarehouse(divisionName, cityName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not purchased the Smart Supply upgrade!`);\n SetSmartSupply(warehouse, enabled);\n },\n setSmartSupplyUseLeftovers: (ctx) => (_divisionName, _cityName, _materialName, _enabled) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const enabled = !!_enabled;\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not purchased the Smart Supply upgrade!`);\n SetSmartSupplyUseLeftovers(warehouse, material, enabled);\n },\n buyMaterial: (ctx) => (_divisionName, _cityName, _materialName, _amt) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.number(ctx, \"amt\", _amt);\n if (amt < 0) throw new Error(\"Invalid value for amount field! Must be numeric and greater than 0\");\n const material = getMaterial(divisionName, cityName, materialName);\n BuyMaterial(material, amt);\n },\n bulkPurchase: (ctx) => (_divisionName, _cityName, _materialName, _amt) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n if (!hasResearched(getDivision(divisionName), \"Bulk Purchasing\"))\n throw new Error(`You have not researched Bulk Purchasing in ${divisionName}`);\n const corporation = getCorporation();\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.number(ctx, \"amt\", _amt);\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n BulkPurchase(corporation, warehouse, material, amt);\n },\n makeProduct:\n (ctx) =>\n (_divisionName, _cityName, _productName, _designInvest, _marketingInvest): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const designInvest = helpers.number(ctx, \"designInvest\", _designInvest);\n const marketingInvest = helpers.number(ctx, \"marketingInvest\", _marketingInvest);\n const corporation = getCorporation();\n MakeProduct(corporation, getDivision(divisionName), cityName, productName, designInvest, marketingInvest);\n },\n limitProductProduction: (ctx) => (_divisionName, _cityName, _productName, _qty) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const qty = helpers.number(ctx, \"qty\", _qty);\n LimitProductProduction(getProduct(divisionName, productName), cityName, qty);\n },\n exportMaterial:\n (ctx) =>\n (_sourceDivision, _sourceCity, _targetDivision, _targetCity, _materialName, _amt): void => {\n checkAccess(ctx, 7);\n const sourceDivision = helpers.string(ctx, \"sourceDivision\", _sourceDivision);\n const sourceCity = helpers.string(ctx, \"sourceCity\", _sourceCity);\n const targetDivision = helpers.string(ctx, \"targetDivision\", _targetDivision);\n const targetCity = helpers.string(ctx, \"targetCity\", _targetCity);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n ExportMaterial(\n targetDivision,\n targetCity,\n getMaterial(sourceDivision, sourceCity, materialName),\n amt + \"\",\n getDivision(targetDivision),\n );\n },\n cancelExportMaterial:\n (ctx) =>\n (_sourceDivision, _sourceCity, _targetDivision, _targetCity, _materialName, _amt): void => {\n checkAccess(ctx, 7);\n const sourceDivision = helpers.string(ctx, \"sourceDivision\", _sourceDivision);\n const sourceCity = helpers.string(ctx, \"sourceCity\", _sourceCity);\n const targetDivision = helpers.string(ctx, \"targetDivision\", _targetDivision);\n const targetCity = helpers.string(ctx, \"targetCity\", _targetCity);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n CancelExportMaterial(\n targetDivision,\n targetCity,\n getMaterial(sourceDivision, sourceCity, materialName),\n amt + \"\",\n );\n },\n limitMaterialProduction: (ctx) => (_divisionName, _cityName, _materialName, _qty) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const qty = helpers.number(ctx, \"qty\", _qty);\n LimitMaterialProduction(getMaterial(divisionName, cityName, materialName), qty);\n },\n setMaterialMarketTA1: (ctx) => (_divisionName, _cityName, _materialName, _on) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.I for division: ${divisionName}`);\n SetMaterialMarketTA1(getMaterial(divisionName, cityName, materialName), on);\n },\n setMaterialMarketTA2: (ctx) => (_divisionName, _cityName, _materialName, _on) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.II for division: ${divisionName}`);\n SetMaterialMarketTA2(getMaterial(divisionName, cityName, materialName), on);\n },\n setProductMarketTA1: (ctx) => (_divisionName, _productName, _on) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.I for division: ${divisionName}`);\n SetProductMarketTA1(getProduct(divisionName, productName), on);\n },\n setProductMarketTA2: (ctx) => (_divisionName, _productName, _on) => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.II for division: ${divisionName}`);\n SetProductMarketTA2(getProduct(divisionName, productName), on);\n },\n };\n\n const officeAPI: InternalAPI<OfficeAPI> = {\n getHireAdVertCost: (ctx) => (_divisionName) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return division.getAdVertCost();\n },\n getHireAdVertCount: (ctx) => (_divisionName) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return division.numAdVerts;\n },\n getResearchCost: (ctx) => (_divisionName, _researchName) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const researchName = helpers.string(ctx, \"researchName\", _researchName);\n return getResearchCost(getDivision(divisionName), researchName);\n },\n hasResearched: (ctx) => (_divisionName, _researchName) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const researchName = helpers.string(ctx, \"researchName\", _researchName);\n return hasResearched(getDivision(divisionName), researchName);\n },\n getOfficeSizeUpgradeCost: (ctx) => (_divisionName, _cityName, _size) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const size = helpers.number(ctx, \"size\", _size);\n if (size < 0) throw new Error(\"Invalid value for size field! Must be numeric and greater than 0\");\n const office = getOffice(divisionName, cityName);\n const initialPriceMult = Math.round(office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n let mult = 0;\n for (let i = 0; i < size / CorporationConstants.OfficeInitialSize; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n return CorporationConstants.OfficeInitialCost * mult;\n },\n assignJob: (ctx) => (_divisionName, _cityName, _employeeName, _job) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const employeeName = helpers.string(ctx, \"employeeName\", _employeeName);\n const job = helpers.string(ctx, \"job\", _job);\n\n if (!checkEnum(EmployeePositions, job)) throw new Error(`'${job}' is not a valid job.`);\n const office = getOffice(divisionName, cityName);\n\n AssignJob(office, employeeName, job);\n },\n setAutoJobAssignment: (ctx) => (_divisionName, _cityName, _job, _amount) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const amount = helpers.number(ctx, \"amount\", _amount);\n const job = helpers.string(ctx, \"job\", _job);\n\n if (!checkEnum(EmployeePositions, job)) throw new Error(`'${job}' is not a valid job.`);\n const office = getOffice(divisionName, cityName);\n\n return AutoAssignJob(office, job, amount);\n },\n hireEmployee: (ctx) => (_divisionName, _cityName) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const office = getOffice(divisionName, cityName);\n const employee = office.hireRandomEmployee();\n if (employee === undefined) return undefined;\n return {\n name: employee.name,\n mor: employee.mor,\n hap: employee.hap,\n ene: employee.ene,\n int: employee.int,\n cha: employee.cha,\n exp: employee.exp,\n cre: employee.cre,\n eff: employee.eff,\n sal: employee.sal,\n loc: employee.loc,\n pos: employee.pos,\n };\n },\n upgradeOfficeSize: (ctx) => (_divisionName, _cityName, _size) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const size = helpers.number(ctx, \"size\", _size);\n if (size < 0) throw new Error(\"Invalid value for size field! Must be numeric and greater than 0\");\n const office = getOffice(divisionName, cityName);\n const corporation = getCorporation();\n UpgradeOfficeSize(corporation, office, size);\n },\n throwParty: (ctx) => (_divisionName, _cityName, _costPerEmployee) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const costPerEmployee = helpers.number(ctx, \"costPerEmployee\", _costPerEmployee);\n\n if (costPerEmployee < 0) {\n throw new Error(\"Invalid value for Cost Per Employee field! Must be numeric and greater than 0\");\n }\n\n const corporation = getCorporation();\n const office = getOffice(divisionName, cityName);\n\n return ThrowParty(corporation, office, costPerEmployee);\n },\n buyCoffee: (ctx) => (_divisionName, _cityName) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n\n const corporation = getCorporation();\n const office = getOffice(divisionName, cityName);\n\n return BuyCoffee(corporation, office);\n },\n hireAdVert: (ctx) => (_divisionName) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const corporation = getCorporation();\n HireAdVert(corporation, getDivision(divisionName));\n },\n research: (ctx) => (_divisionName, _researchName) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const researchName = helpers.string(ctx, \"researchName\", _researchName);\n Research(getDivision(divisionName), researchName);\n },\n getOffice: (ctx) => (_divisionName, _cityName) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const office = getOffice(divisionName, cityName);\n return {\n loc: office.loc,\n size: office.size,\n minEne: office.minEne,\n maxEne: office.maxEne,\n minHap: office.minHap,\n maxHap: office.maxHap,\n minMor: office.minMor,\n maxMor: office.maxMor,\n employees: office.employees.map((e) => e.name),\n employeeProd: {\n Operations: office.employeeProd[EmployeePositions.Operations],\n Engineer: office.employeeProd[EmployeePositions.Engineer],\n Business: office.employeeProd[EmployeePositions.Business],\n Management: office.employeeProd[EmployeePositions.Management],\n \"Research & Development\": office.employeeProd[EmployeePositions.RandD],\n Training: office.employeeProd[EmployeePositions.Training],\n Unassigned: 0,\n },\n employeeJobs: {\n Operations: office.employeeJobs[EmployeePositions.Operations],\n Engineer: office.employeeJobs[EmployeePositions.Engineer],\n Business: office.employeeJobs[EmployeePositions.Business],\n Management: office.employeeJobs[EmployeePositions.Management],\n \"Research & Development\": office.employeeJobs[EmployeePositions.RandD],\n Training: office.employeeJobs[EmployeePositions.Training],\n Unassigned: office.employeeJobs[EmployeePositions.Unassigned],\n },\n };\n },\n getEmployee: (ctx) => (_divisionName, _cityName, _employeeName) => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const employeeName = helpers.string(ctx, \"employeeName\", _employeeName);\n const employee = getEmployee(divisionName, cityName, employeeName);\n return {\n name: employee.name,\n mor: employee.mor,\n hap: employee.hap,\n ene: employee.ene,\n int: employee.int,\n cha: employee.cha,\n exp: employee.exp,\n cre: employee.cre,\n eff: employee.eff,\n sal: employee.sal,\n loc: employee.loc,\n pos: employee.pos,\n };\n },\n };\n\n return {\n ...warehouseAPI,\n ...officeAPI,\n getMaterialNames: (ctx) => () => {\n checkAccess(ctx);\n return [...CorporationConstants.AllMaterials];\n },\n getIndustryTypes: (ctx) => () => {\n checkAccess(ctx);\n return [...CorporationConstants.AllIndustryTypes];\n },\n getUnlockables: (ctx) => () => {\n checkAccess(ctx);\n return [...CorporationConstants.AllUnlocks];\n },\n getUpgradeNames: (ctx) => () => {\n checkAccess(ctx);\n return [...CorporationConstants.AllUpgrades];\n },\n getResearchNames: (ctx) => () => {\n checkAccess(ctx);\n return [...CorporationConstants.AllResearch];\n },\n expandIndustry: (ctx) => (_industryName, _divisionName) => {\n checkAccess(ctx);\n const industryName = helpers.string(ctx, \"industryName\", _industryName);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const corporation = getCorporation();\n NewIndustry(corporation, industryName, divisionName);\n },\n expandCity: (ctx) => (_divisionName, _cityName) => {\n checkAccess(ctx);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n if (!CorporationConstants.Cities.includes(cityName)) throw new Error(\"Invalid city name\");\n const corporation = getCorporation();\n const division = getDivision(divisionName);\n NewCity(corporation, division, cityName);\n },\n unlockUpgrade: (ctx) => (_upgradeName) => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n UnlockUpgrade(corporation, upgrade);\n },\n levelUpgrade: (ctx) => (_upgradeName) => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n LevelUpgrade(corporation, upgrade);\n },\n issueDividends: (ctx) => (_rate) => {\n checkAccess(ctx);\n const rate = helpers.number(ctx, \"rate\", _rate);\n const max = CorporationConstants.DividendMaxRate;\n if (rate < 0 || rate > max)\n throw new Error(`Invalid value for rate field! Must be numeric, greater than 0, and less than ${max}`);\n const corporation = getCorporation();\n if (!corporation.public) throw helpers.makeRuntimeErrorMsg(ctx, `Your company has not gone public!`);\n IssueDividends(corporation, rate);\n },\n\n // If you modify these objects you will affect them for real, it's not\n // copies.\n getDivision: (ctx) => (_divisionName) => {\n checkAccess(ctx);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return getSafeDivision(division);\n },\n getCorporation: (ctx) => () => {\n checkAccess(ctx);\n const corporation = getCorporation();\n return {\n name: corporation.name,\n funds: corporation.funds,\n revenue: corporation.revenue,\n expenses: corporation.expenses,\n public: corporation.public,\n totalShares: corporation.totalShares,\n numShares: corporation.numShares,\n shareSaleCooldown: corporation.shareSaleCooldown,\n issuedShares: corporation.issuedShares,\n sharePrice: corporation.sharePrice,\n dividendRate: corporation.dividendRate,\n dividendTax: corporation.dividendTax,\n dividendEarnings: corporation.getCycleDividends() / CorporationConstants.SecsPerMarketCycle,\n state: corporation.state.getState(),\n divisions: corporation.divisions.map((division): NSDivision => getSafeDivision(division)),\n };\n },\n createCorporation:\n (ctx) =>\n (_corporationName, _selfFund = true): boolean => {\n const corporationName = helpers.string(ctx, \"corporationName\", _corporationName);\n const selfFund = !!_selfFund;\n return createCorporation(corporationName, selfFund);\n },\n hasUnlockUpgrade: (ctx) => (_upgradeName) => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return hasUnlockUpgrade(upgradeName);\n },\n getUnlockUpgradeCost: (ctx) => (_upgradeName) => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return getUnlockUpgradeCost(upgradeName);\n },\n getUpgradeLevel: (ctx) => (_upgradeName) => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return getUpgradeLevel(ctx, upgradeName);\n },\n getUpgradeLevelCost: (ctx) => (_upgradeName) => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return getUpgradeLevelCost(ctx, upgradeName);\n },\n getExpandIndustryCost: (ctx) => (_industryName) => {\n checkAccess(ctx);\n const industryName = helpers.string(ctx, \"industryName\", _industryName);\n return getExpandIndustryCost(industryName);\n },\n getExpandCityCost: (ctx) => () => {\n checkAccess(ctx);\n return getExpandCityCost();\n },\n getInvestmentOffer: (ctx) => () => {\n checkAccess(ctx);\n return getInvestmentOffer();\n },\n acceptInvestmentOffer: (ctx) => () => {\n checkAccess(ctx);\n return acceptInvestmentOffer();\n },\n goPublic: (ctx) => (_numShares) => {\n checkAccess(ctx);\n const numShares = helpers.number(ctx, \"numShares\", _numShares);\n return goPublic(numShares);\n },\n sellShares: (ctx) => (_numShares) => {\n checkAccess(ctx);\n const numShares = helpers.number(ctx, \"numShares\", _numShares);\n return SellShares(getCorporation(), numShares);\n },\n buyBackShares: (ctx) => (_numShares) => {\n checkAccess(ctx);\n const numShares = helpers.number(ctx, \"numShares\", _numShares);\n return BuyBackShares(getCorporation(), numShares);\n },\n bribe: (ctx) => (_factionName, _amountCash) => {\n checkAccess(ctx);\n const factionName = helpers.string(ctx, \"factionName\", _factionName);\n const amountCash = helpers.number(ctx, \"amountCash\", _amountCash);\n return bribe(factionName, amountCash);\n },\n getBonusTime: (ctx) => () => {\n checkAccess(ctx);\n return Math.round(getCorporation().storedCycles / 5) * 1000;\n },\n };\n}\n","export interface IConstructorParams {\n name: string;\n cost: number;\n desc: string;\n advertisingMult?: number;\n employeeChaMult?: number;\n employeeCreMult?: number;\n employeeEffMult?: number;\n employeeIntMult?: number;\n productionMult?: number;\n productProductionMult?: number;\n salesMult?: number;\n sciResearchMult?: number;\n storageMult?: number;\n}\n\nexport class Research {\n // Name of research. This will be used to identify researches in the Research Tree\n name = \"\";\n\n // How much scientific research it costs to unlock this\n cost = 0;\n\n // Description of what the Research does\n desc = \"\";\n\n // All possible generic upgrades for the company, in the form of multipliers\n advertisingMult = 1;\n employeeChaMult = 1;\n employeeCreMult = 1;\n employeeEffMult = 1;\n employeeIntMult = 1;\n productionMult = 1;\n productProductionMult = 1;\n salesMult = 1;\n sciResearchMult = 1;\n storageMult = 1;\n\n constructor(p: IConstructorParams = { name: \"\", cost: 0, desc: \"\" }) {\n this.name = p.name;\n this.cost = p.cost;\n this.desc = p.desc;\n if (p.advertisingMult) {\n this.advertisingMult = p.advertisingMult;\n }\n if (p.employeeChaMult) {\n this.employeeChaMult = p.employeeChaMult;\n }\n if (p.employeeCreMult) {\n this.employeeCreMult = p.employeeCreMult;\n }\n if (p.employeeEffMult) {\n this.employeeEffMult = p.employeeEffMult;\n }\n if (p.employeeIntMult) {\n this.employeeIntMult = p.employeeIntMult;\n }\n if (p.productionMult) {\n this.productionMult = p.productionMult;\n }\n if (p.productProductionMult) {\n this.productProductionMult = p.productProductionMult;\n }\n if (p.salesMult) {\n this.salesMult = p.salesMult;\n }\n if (p.sciResearchMult) {\n this.sciResearchMult = p.sciResearchMult;\n }\n if (p.storageMult) {\n this.storageMult = p.storageMult;\n }\n }\n}\n","import { IConstructorParams } from \"../Research\";\n\nexport const researchMetadata: IConstructorParams[] = [\n {\n name: \"AutoBrew\",\n cost: 12e3,\n desc:\n \"Automatically keep your employees fully caffeinated with \" +\n \"coffee injections. This research will keep the energy of all \" +\n \"employees at its maximum possible value, for no cost. \" +\n \"This will also disable the Coffee upgrade.\",\n },\n {\n name: \"AutoPartyManager\",\n cost: 15e3,\n desc:\n \"Automatically analyzes your employees' happiness and morale \" +\n \"and boosts them whenever it detects a decrease. This research will \" +\n \"keep the morale and happiness of all employees at their maximum possible \" +\n \"values, for no cost. \" +\n \"This will also disable the 'Throw Party' feature.\",\n },\n {\n name: \"Automatic Drug Administration\",\n cost: 10e3,\n desc:\n \"Research how to automatically administer performance-enhancing drugs to all of \" +\n \"your employees. This unlocks Drug-related Research.\",\n },\n {\n name: \"Bulk Purchasing\",\n cost: 5e3,\n desc:\n \"Research the art of buying materials in bulk. This allows you to purchase \" +\n \"any amount of a material instantly.\",\n },\n {\n name: \"CPH4 Injections\",\n cost: 25e3,\n desc:\n \"Develop an advanced and harmless synthetic drug that is administered to \" +\n \"employees to increase all of their stats, except experience, by 10%.\",\n employeeCreMult: 1.1,\n employeeChaMult: 1.1,\n employeeEffMult: 1.1,\n employeeIntMult: 1.1,\n },\n {\n name: \"Drones\",\n cost: 5e3,\n desc:\n \"Acquire the knowledge needed to create advanced drones. This research does nothing \" +\n \"by itself, but unlocks other Drone-related research.\",\n },\n {\n name: \"Drones - Assembly\",\n cost: 25e3,\n desc:\n \"Manufacture and use Assembly Drones to improve the efficiency of \" +\n \"your production lines. This increases all production by 20%.\",\n productionMult: 1.2,\n },\n {\n name: \"Drones - Transport\",\n cost: 30e3,\n desc:\n \"Manufacture and use intelligent Transport Drones to optimize \" +\n \"your warehouses. This increases the storage space of all warehouses \" +\n \"by 50%.\",\n storageMult: 1.5,\n },\n {\n name: \"Go-Juice\",\n cost: 25e3,\n desc:\n \"Provide employees with Go-Juice, a coffee-derivative that further enhances \" +\n \"the brain's dopamine production. This increases the maximum energy of all \" +\n \"employees by 10.\",\n },\n {\n name: \"Hi-Tech R&D Laboratory\",\n cost: 5e3,\n desc:\n \"Construct a cutting edge facility dedicated to advanced research and \" +\n \"and development. This allows you to spend Scientific Research \" +\n \"on powerful upgrades. It also globally increases Scientific Research \" +\n \"production by 10%.\",\n sciResearchMult: 1.1,\n },\n {\n name: \"HRBuddy-Recruitment\",\n cost: 15e3,\n desc:\n \"Use automated software to handle the hiring of employees. With this \" +\n \"research, each office will automatically hire one employee per \" +\n \"market cycle if there is available space.\",\n },\n {\n name: \"HRBuddy-Training\",\n cost: 20e3,\n desc:\n \"Use automated software to handle the training of employees. With this \" +\n \"research, each employee hired with HRBuddy-Recruitment will automatically \" +\n \"be assigned to 'Training', rather than being unassigned.\",\n },\n {\n name: \"JoyWire\",\n cost: 20e3,\n desc: \"A brain implant which is installed in employees, increasing their maximum happiness by 10.\",\n },\n {\n name: \"Market-TA.I\",\n cost: 20e3,\n desc:\n \"Develop advanced AI software that uses technical analysis to \" +\n \"help you understand and exploit the market. This research \" +\n \"allows you to know what price to sell your Materials/Products \" +\n \"at in order to avoid losing sales due to having too high of a mark-up. \" +\n \"It also lets you automatically use that sale price.\",\n },\n {\n name: \"Market-TA.II\",\n cost: 50e3,\n desc:\n \"Develop double-advanced AI software that uses technical analysis to \" +\n \"help you understand and exploit the market. This research \" +\n \"allows you to know how many sales of a Material/Product you lose or gain \" +\n \"from having too high or too low or a sale price. It also lets you automatically \" +\n \"set the sale price of your Materials/Products at the optimal price such that \" +\n \"the amount sold matches the amount produced.\",\n },\n {\n name: \"Overclock\",\n cost: 15e3,\n desc:\n \"Equip employees with a headset that uses transcranial direct current \" +\n \"stimulation (tDCS) to increase the speed of their neurotransmitters. \" +\n \"This research increases the intelligence and efficiency of all \" +\n \"employees by 25%.\",\n employeeEffMult: 1.25,\n employeeIntMult: 1.25,\n },\n {\n name: \"Self-Correcting Assemblers\",\n cost: 25e3,\n desc:\n \"Create assemblers that can be used for universal production. \" +\n \"These assemblers use deep learning to improve their efficiency \" +\n \"at their tasks. This research increases all production by 10%\",\n productionMult: 1.1,\n },\n {\n name: \"Sti.mu\",\n cost: 30e3,\n desc:\n \"Upgrade the tDCS headset to stimulate regions of the brain that \" +\n \"control confidence and enthusiasm. This research increases the max \" +\n \"morale of all employees by 10.\",\n },\n {\n name: \"sudo.Assist\",\n cost: 15e3,\n desc: \"Develop a virtual assistant AI to handle and manage administrative issues for your corporation.\",\n },\n {\n name: \"uPgrade: Capacity.I\",\n cost: 20e3,\n desc:\n \"Expand the industry's capacity for designing and manufacturing its \" +\n \"various products. This increases the industry's maximum number of products \" +\n \"by 1 (from 3 to 4).\",\n },\n {\n name: \"uPgrade: Capacity.II\",\n cost: 30e3,\n desc:\n \"Expand the industry's capacity for designing and manufacturing its \" +\n \"various products. This increases the industry's maximum number of products \" +\n \"by 1 (from 4 to 5).\",\n },\n {\n name: \"uPgrade: Dashboard\",\n cost: 5e3,\n desc:\n \"Improve the software used to manage the industry's production line \" +\n \"for its various products. This allows you to manage the production and \" +\n \"sale of a product before it's finished being designed.\",\n },\n {\n name: \"uPgrade: Fulcrum\",\n cost: 10e3,\n desc:\n \"Streamline the manufacturing of this industry's various products. \" +\n \"This research increases the production of your products by 5%\",\n productProductionMult: 1.05,\n },\n];\n","import { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { Industries, IndustryStartingCosts, IndustryResearchTrees } from \"./IndustryData\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { Material } from \"./Material\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { calculateEffectWithFactors } from \"../utils/calculateEffectWithFactors\";\nimport { OfficeSpace } from \"./OfficeSpace\";\nimport { Product } from \"./Product\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { isString } from \"../utils/helpers/isString\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { Warehouse } from \"./Warehouse\";\nimport { Corporation } from \"./Corporation\";\n\ninterface IParams {\n name?: string;\n corp?: Corporation;\n type?: string;\n}\n\nexport class Industry {\n name = \"\";\n type = Industries.Agriculture;\n sciResearch = new Material({ name: \"Scientific Research\" });\n researched: { [key: string]: boolean | undefined } = {};\n reqMats: { [key: string]: number | undefined } = {};\n\n //An array of the name of materials being produced\n prodMats: string[] = [];\n\n products: { [key: string]: Product | undefined } = {};\n makesProducts = false;\n\n awareness = 0;\n popularity = 0; //Should always be less than awareness\n startingCost = 0;\n\n /* The following are factors for how much production/other things are increased by\n different factors. The production increase always has diminishing returns,\n and they are all represented by exponentials of < 1 (e.g x ^ 0.5, x ^ 0.8)\n The number for these represent the exponential. A lower number means more\n diminishing returns */\n reFac = 0; //Real estate Factor\n sciFac = 0; //Scientific Research Factor, affects quality\n hwFac = 0; //Hardware factor\n robFac = 0; //Robotics Factor\n aiFac = 0; //AI Cores factor;\n advFac = 0; //Advertising factor, affects sales\n\n prodMult = 0; //Production multiplier\n\n //Financials\n lastCycleRevenue: number;\n lastCycleExpenses: number;\n thisCycleRevenue: number;\n thisCycleExpenses: number;\n\n state = \"START\";\n newInd = true;\n\n //Maps locations to warehouses. 0 if no warehouse at that location\n warehouses: { [key: string]: Warehouse | 0 };\n\n //Maps locations to offices. 0 if no office at that location\n offices: { [key: string]: OfficeSpace | 0 } = {\n [CityName.Aevum]: 0,\n [CityName.Chongqing]: 0,\n [CityName.Sector12]: new OfficeSpace({\n loc: CityName.Sector12,\n size: CorporationConstants.OfficeInitialSize,\n }),\n [CityName.NewTokyo]: 0,\n [CityName.Ishima]: 0,\n [CityName.Volhaven]: 0,\n };\n\n numAdVerts = 0;\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"\";\n this.type = params.type ? params.type : Industries.Agriculture;\n\n //Financials\n this.lastCycleRevenue = 0;\n this.lastCycleExpenses = 0;\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n\n this.warehouses = {\n [CityName.Aevum]: 0,\n [CityName.Chongqing]: 0,\n [CityName.Sector12]: new Warehouse({\n corp: params.corp,\n industry: this,\n loc: CityName.Sector12,\n size: CorporationConstants.WarehouseInitialSize,\n }),\n [CityName.NewTokyo]: 0,\n [CityName.Ishima]: 0,\n [CityName.Volhaven]: 0,\n };\n\n this.init();\n }\n\n init(): void {\n //Set the unique properties of an industry (how much its affected by real estate/scientific research, etc.)\n const startingCost = IndustryStartingCosts[this.type];\n if (startingCost === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.startingCost = startingCost;\n switch (this.type) {\n case Industries.Energy:\n this.reFac = 0.65;\n this.sciFac = 0.7;\n this.robFac = 0.05;\n this.aiFac = 0.3;\n this.advFac = 0.08;\n this.reqMats = {\n Hardware: 0.1,\n Metal: 0.2,\n };\n this.prodMats = [\"Energy\"];\n break;\n case Industries.Utilities:\n case \"Utilities\":\n this.reFac = 0.5;\n this.sciFac = 0.6;\n this.robFac = 0.4;\n this.aiFac = 0.4;\n this.advFac = 0.08;\n this.reqMats = {\n Hardware: 0.1,\n Metal: 0.1,\n };\n this.prodMats = [\"Water\"];\n break;\n case Industries.Agriculture:\n this.reFac = 0.72;\n this.sciFac = 0.5;\n this.hwFac = 0.2;\n this.robFac = 0.3;\n this.aiFac = 0.3;\n this.advFac = 0.04;\n this.reqMats = {\n Water: 0.5,\n Energy: 0.5,\n };\n this.prodMats = [\"Plants\", \"Food\"];\n break;\n case Industries.Fishing:\n this.reFac = 0.15;\n this.sciFac = 0.35;\n this.hwFac = 0.35;\n this.robFac = 0.5;\n this.aiFac = 0.2;\n this.advFac = 0.08;\n this.reqMats = {\n Energy: 0.5,\n };\n this.prodMats = [\"Food\"];\n break;\n case Industries.Mining:\n this.reFac = 0.3;\n this.sciFac = 0.26;\n this.hwFac = 0.4;\n this.robFac = 0.45;\n this.aiFac = 0.45;\n this.advFac = 0.06;\n this.reqMats = {\n Energy: 0.8,\n };\n this.prodMats = [\"Metal\"];\n break;\n case Industries.Food:\n //reFac is unique for this bc it diminishes greatly per city. Handle this separately in code?\n this.sciFac = 0.12;\n this.hwFac = 0.15;\n this.robFac = 0.3;\n this.aiFac = 0.25;\n this.advFac = 0.25;\n this.reFac = 0.05;\n this.reqMats = {\n Food: 0.5,\n Water: 0.5,\n Energy: 0.2,\n };\n this.makesProducts = true;\n break;\n case Industries.Tobacco:\n this.reFac = 0.15;\n this.sciFac = 0.75;\n this.hwFac = 0.15;\n this.robFac = 0.2;\n this.aiFac = 0.15;\n this.advFac = 0.2;\n this.reqMats = {\n Plants: 1,\n Water: 0.2,\n };\n this.makesProducts = true;\n break;\n case Industries.Chemical:\n this.reFac = 0.25;\n this.sciFac = 0.75;\n this.hwFac = 0.2;\n this.robFac = 0.25;\n this.aiFac = 0.2;\n this.advFac = 0.07;\n this.reqMats = {\n Plants: 1,\n Energy: 0.5,\n Water: 0.5,\n };\n this.prodMats = [\"Chemicals\"];\n break;\n case Industries.Pharmaceutical:\n this.reFac = 0.05;\n this.sciFac = 0.8;\n this.hwFac = 0.15;\n this.robFac = 0.25;\n this.aiFac = 0.2;\n this.advFac = 0.16;\n this.reqMats = {\n Chemicals: 2,\n Energy: 1,\n Water: 0.5,\n };\n this.prodMats = [\"Drugs\"];\n this.makesProducts = true;\n break;\n case Industries.Computer:\n case \"Computer\":\n this.reFac = 0.2;\n this.sciFac = 0.62;\n this.robFac = 0.36;\n this.aiFac = 0.19;\n this.advFac = 0.17;\n this.reqMats = {\n Metal: 2,\n Energy: 1,\n };\n this.prodMats = [\"Hardware\"];\n this.makesProducts = true;\n break;\n case Industries.Robotics:\n this.reFac = 0.32;\n this.sciFac = 0.65;\n this.aiFac = 0.36;\n this.advFac = 0.18;\n this.hwFac = 0.19;\n this.reqMats = {\n Hardware: 5,\n Energy: 3,\n };\n this.prodMats = [\"Robots\"];\n this.makesProducts = true;\n break;\n case Industries.Software:\n this.sciFac = 0.62;\n this.advFac = 0.16;\n this.hwFac = 0.25;\n this.reFac = 0.15;\n this.aiFac = 0.18;\n this.robFac = 0.05;\n this.reqMats = {\n Hardware: 0.5,\n Energy: 0.5,\n };\n this.prodMats = [\"AICores\"];\n this.makesProducts = true;\n break;\n case Industries.Healthcare:\n this.reFac = 0.1;\n this.sciFac = 0.75;\n this.advFac = 0.11;\n this.hwFac = 0.1;\n this.robFac = 0.1;\n this.aiFac = 0.1;\n this.reqMats = {\n Robots: 10,\n AICores: 5,\n Energy: 5,\n Water: 5,\n };\n this.makesProducts = true;\n break;\n case Industries.RealEstate:\n this.robFac = 0.6;\n this.aiFac = 0.6;\n this.advFac = 0.25;\n this.sciFac = 0.05;\n this.hwFac = 0.05;\n this.reqMats = {\n Metal: 5,\n Energy: 5,\n Water: 2,\n Hardware: 4,\n };\n this.prodMats = [\"RealEstate\"];\n this.makesProducts = true;\n break;\n default:\n console.error(`Invalid Industry Type passed into Industry.init(): ${this.type}`);\n return;\n }\n }\n\n getProductDescriptionText(): string {\n if (!this.makesProducts) return \"\";\n switch (this.type) {\n case Industries.Food:\n return \"create and manage restaurants\";\n case Industries.Tobacco:\n return \"create tobacco and tobacco-related products\";\n case Industries.Pharmaceutical:\n return \"develop new pharmaceutical drugs\";\n case Industries.Computer:\n case \"Computer\":\n return \"create new computer hardware and networking infrastructures\";\n case Industries.Robotics:\n return \"build specialized robots and robot-related products\";\n case Industries.Software:\n return \"develop computer software\";\n case Industries.Healthcare:\n return \"build and manage hospitals\";\n case Industries.RealEstate:\n return \"develop and manage real estate properties\";\n default:\n console.error(\"Invalid industry type in Industry.getProductDescriptionText\");\n return \"\";\n }\n }\n\n getMaximumNumberProducts(): number {\n if (!this.makesProducts) return 0;\n\n // Calculate additional number of allowed Products from Research/Upgrades\n let additional = 0;\n if (this.hasResearch(\"uPgrade: Capacity.I\")) ++additional;\n if (this.hasResearch(\"uPgrade: Capacity.II\")) ++additional;\n\n return CorporationConstants.BaseMaxProducts + additional;\n }\n\n hasMaximumNumberProducts(): boolean {\n return Object.keys(this.products).length >= this.getMaximumNumberProducts();\n }\n\n //Calculates the values that factor into the production and properties of\n //materials/products (such as quality, etc.)\n calculateProductionFactors(): void {\n let multSum = 0;\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const warehouse = this.warehouses[city];\n if (!warehouse) continue;\n\n const materials = warehouse.materials;\n\n const cityMult =\n Math.pow(0.002 * materials.RealEstate.qty + 1, this.reFac) *\n Math.pow(0.002 * materials.Hardware.qty + 1, this.hwFac) *\n Math.pow(0.002 * materials.Robots.qty + 1, this.robFac) *\n Math.pow(0.002 * materials.AICores.qty + 1, this.aiFac);\n multSum += Math.pow(cityMult, 0.73);\n }\n\n multSum < 1 ? (this.prodMult = 1) : (this.prodMult = multSum);\n }\n\n updateWarehouseSizeUsed(warehouse: Warehouse): void {\n warehouse.updateMaterialSizeUsed();\n\n for (const prodName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(prodName)) {\n const prod = this.products[prodName];\n if (prod === undefined) continue;\n warehouse.sizeUsed += prod.data[warehouse.loc][0] * prod.siz;\n }\n }\n }\n\n process(marketCycles = 1, state: string, corporation: Corporation): void {\n this.state = state;\n\n //At the start of a cycle, store and reset revenue/expenses\n //Then calculate salaries and process the markets\n if (state === \"START\") {\n if (isNaN(this.thisCycleRevenue) || isNaN(this.thisCycleExpenses)) {\n console.error(\"NaN in Corporation's computed revenue/expenses\");\n dialogBoxCreate(\n \"Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer\",\n );\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n }\n this.lastCycleRevenue = this.thisCycleRevenue / (marketCycles * CorporationConstants.SecsPerMarketCycle);\n this.lastCycleExpenses = this.thisCycleExpenses / (marketCycles * CorporationConstants.SecsPerMarketCycle);\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n\n // Once you start making revenue, the player should no longer be\n // considered new, and therefore no longer needs the 'tutorial' UI elements\n if (this.lastCycleRevenue > 0) {\n this.newInd = false;\n }\n\n // Process offices (and the employees in them)\n let employeeSalary = 0;\n for (const officeLoc of Object.keys(this.offices)) {\n const office = this.offices[officeLoc];\n if (office) employeeSalary += office.process(marketCycles, corporation, this);\n }\n this.thisCycleExpenses = this.thisCycleExpenses + employeeSalary;\n\n // Process change in demand/competition of materials/products\n this.processMaterialMarket();\n this.processProductMarket(marketCycles);\n\n // Process loss of popularity\n this.popularity -= marketCycles * 0.0001;\n this.popularity = Math.max(0, this.popularity);\n\n // Process Dreamsense gains\n const popularityGain = corporation.getDreamSenseGain(),\n awarenessGain = popularityGain * 4;\n if (popularityGain > 0) {\n const awareness = this.awareness + awarenessGain * marketCycles;\n this.awareness = Math.min(awareness, Number.MAX_VALUE);\n\n const popularity = this.popularity + popularityGain * marketCycles;\n this.popularity = Math.min(popularity, Number.MAX_VALUE);\n }\n\n return;\n }\n\n // Process production, purchase, and import/export of materials\n let res = this.processMaterials(marketCycles, corporation);\n if (Array.isArray(res)) {\n this.thisCycleRevenue = this.thisCycleRevenue + res[0];\n this.thisCycleExpenses = this.thisCycleExpenses + res[1];\n }\n\n // Process creation, production & sale of products\n res = this.processProducts(marketCycles, corporation);\n if (Array.isArray(res)) {\n this.thisCycleRevenue = this.thisCycleRevenue + res[0];\n this.thisCycleExpenses = this.thisCycleExpenses + res[1];\n }\n }\n\n // Process change in demand and competition for this industry's materials\n processMaterialMarket(): void {\n //References to prodMats and reqMats\n const reqMats = this.reqMats,\n prodMats = this.prodMats;\n\n //Only 'process the market' for materials that this industry deals with\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n //If this industry has a warehouse in this city, process the market\n //for every material this industry requires or produces\n if (this.warehouses[CorporationConstants.Cities[i]]) {\n const wh = this.warehouses[CorporationConstants.Cities[i]];\n if (wh === 0) continue;\n for (const name of Object.keys(reqMats)) {\n if (reqMats.hasOwnProperty(name)) {\n wh.materials[name].processMarket();\n }\n }\n\n //Produced materials are stored in an array\n for (let foo = 0; foo < prodMats.length; ++foo) {\n wh.materials[prodMats[foo]].processMarket();\n }\n\n //Process these twice because these boost production\n wh.materials[\"Hardware\"].processMarket();\n wh.materials[\"Robots\"].processMarket();\n wh.materials[\"AICores\"].processMarket();\n wh.materials[\"RealEstate\"].processMarket();\n }\n }\n }\n\n // Process change in demand and competition for this industry's products\n processProductMarket(marketCycles = 1): void {\n // Demand gradually decreases, and competition gradually increases\n for (const name of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(name)) {\n const product = this.products[name];\n if (product === undefined) continue;\n let change = getRandomInt(0, 3) * 0.0004;\n if (change === 0) continue;\n\n if (\n this.type === Industries.Pharmaceutical ||\n this.type === Industries.Software ||\n this.type === Industries.Robotics\n ) {\n change *= 3;\n }\n change *= marketCycles;\n product.dmd -= change;\n product.cmp += change;\n product.cmp = Math.min(product.cmp, 99.99);\n product.dmd = Math.max(product.dmd, 0.001);\n }\n }\n }\n\n //Process production, purchase, and import/export of materials\n processMaterials(marketCycles = 1, corporation: Corporation): [number, number] {\n let revenue = 0,\n expenses = 0;\n this.calculateProductionFactors();\n\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const office = this.offices[city];\n if (office === 0) continue;\n\n if (this.warehouses[city]) {\n const warehouse = this.warehouses[city];\n if (warehouse === 0) continue;\n\n switch (this.state) {\n case \"PURCHASE\": {\n /* Process purchase of materials */\n for (const matName of Object.keys(warehouse.materials)) {\n if (!warehouse.materials.hasOwnProperty(matName)) continue;\n const mat = warehouse.materials[matName];\n let buyAmt = 0;\n let maxAmt = 0;\n if (warehouse.smartSupplyEnabled && Object.keys(this.reqMats).includes(matName)) {\n continue;\n }\n buyAmt = mat.buy * CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialSizes[matName]);\n\n buyAmt = Math.min(buyAmt, maxAmt);\n if (buyAmt > 0) {\n mat.qty += buyAmt;\n expenses += buyAmt * mat.bCost;\n }\n this.updateWarehouseSizeUsed(warehouse);\n } //End process purchase of materials\n\n // smart supply\n const smartBuy: { [key: string]: number | undefined } = {};\n for (const matName of Object.keys(warehouse.materials)) {\n if (!warehouse.materials.hasOwnProperty(matName)) continue;\n if (!warehouse.smartSupplyEnabled || !Object.keys(this.reqMats).includes(matName)) continue;\n const mat = warehouse.materials[matName];\n\n //Smart supply tracker is stored as per second rate\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n mat.buy = reqMat * warehouse.smartSupplyStore;\n let buyAmt = mat.buy * CorporationConstants.SecsPerMarketCycle * marketCycles;\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialSizes[matName]);\n buyAmt = Math.min(buyAmt, maxAmt);\n if (buyAmt > 0) smartBuy[matName] = buyAmt;\n }\n\n // Find which material were trying to create the least amount of product with.\n let worseAmt = 1e99;\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n const amt = buyAmt / reqMat;\n if (amt < worseAmt) worseAmt = amt;\n }\n\n // Align all the materials to the smallest amount.\n for (const matName of Object.keys(smartBuy)) {\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n smartBuy[matName] = worseAmt * reqMat;\n }\n\n // Calculate the total size of all things were trying to buy\n let totalSize = 0;\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n totalSize += buyAmt * MaterialSizes[matName];\n }\n\n // Shrink to the size of available space.\n const freeSpace = warehouse.size - warehouse.sizeUsed;\n if (totalSize > freeSpace) {\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n smartBuy[matName] = Math.floor((buyAmt * freeSpace) / totalSize);\n }\n }\n\n // TODO: Change all these Object.keys where the value is also needed to Object.entries.\n // Use the materials already in the warehouse if the option is on.\n for (const matName of Object.keys(smartBuy)) {\n if (!warehouse.smartSupplyUseLeftovers[matName]) continue;\n const mat = warehouse.materials[matName];\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n smartBuy[matName] = Math.max(0, buyAmt - mat.qty);\n }\n\n // buy them\n for (const [matName, buyAmt] of Object.entries(smartBuy)) {\n const mat = warehouse.materials[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n mat.qty += buyAmt;\n expenses += buyAmt * mat.bCost;\n }\n break;\n }\n case \"PRODUCTION\":\n warehouse.smartSupplyStore = 0; //Reset smart supply amount\n\n /* Process production of materials */\n if (this.prodMats.length > 0) {\n const mat = warehouse.materials[this.prodMats[0]];\n //Calculate the maximum production of this material based\n //on the office's productivity\n const maxProd =\n this.getOfficeProductivity(office) *\n this.prodMult * // Multiplier from materials\n corporation.getProductionMultiplier() *\n this.getProductionMultiplier(); // Multiplier from Research\n let prod;\n\n if (mat.prdman[0]) {\n //Production is manually limited\n prod = Math.min(maxProd, mat.prdman[1]);\n } else {\n prod = maxProd;\n }\n prod *= CorporationConstants.SecsPerMarketCycle * marketCycles; //Convert production from per second to per market cycle\n\n // Calculate net change in warehouse storage making the produced materials will cost\n let totalMatSize = 0;\n for (let tmp = 0; tmp < this.prodMats.length; ++tmp) {\n totalMatSize += MaterialSizes[this.prodMats[tmp]];\n }\n for (const reqMatName of Object.keys(this.reqMats)) {\n const normQty = this.reqMats[reqMatName];\n if (normQty === undefined) continue;\n totalMatSize -= MaterialSizes[reqMatName] * normQty;\n }\n // If not enough space in warehouse, limit the amount of produced materials\n if (totalMatSize > 0) {\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / totalMatSize);\n prod = Math.min(maxAmt, prod);\n }\n\n if (prod < 0) {\n prod = 0;\n }\n\n // Keep track of production for smart supply (/s)\n warehouse.smartSupplyStore += prod / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n\n // Make sure we have enough resource to make our materials\n let producableFrac = 1;\n for (const reqMatName of Object.keys(this.reqMats)) {\n if (this.reqMats.hasOwnProperty(reqMatName)) {\n const reqMat = this.reqMats[reqMatName];\n if (reqMat === undefined) continue;\n const req = reqMat * prod;\n if (warehouse.materials[reqMatName].qty < req) {\n producableFrac = Math.min(producableFrac, warehouse.materials[reqMatName].qty / req);\n }\n }\n }\n if (producableFrac <= 0) {\n producableFrac = 0;\n prod = 0;\n }\n\n // Make our materials if they are producable\n if (producableFrac > 0 && prod > 0) {\n for (const reqMatName of Object.keys(this.reqMats)) {\n const reqMat = this.reqMats[reqMatName];\n if (reqMat === undefined) continue;\n const reqMatQtyNeeded = reqMat * prod * producableFrac;\n warehouse.materials[reqMatName].qty -= reqMatQtyNeeded;\n warehouse.materials[reqMatName].prd = 0;\n warehouse.materials[reqMatName].prd -=\n reqMatQtyNeeded / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n }\n for (let j = 0; j < this.prodMats.length; ++j) {\n warehouse.materials[this.prodMats[j]].qty += prod * producableFrac;\n warehouse.materials[this.prodMats[j]].qlt =\n office.employeeProd[EmployeePositions.Engineer] / 90 +\n Math.pow(this.sciResearch.qty, this.sciFac) +\n Math.pow(warehouse.materials[\"AICores\"].qty, this.aiFac) / 10e3;\n }\n } else {\n for (const reqMatName of Object.keys(this.reqMats)) {\n if (this.reqMats.hasOwnProperty(reqMatName)) {\n warehouse.materials[reqMatName].prd = 0;\n }\n }\n }\n\n //Per second\n const fooProd = (prod * producableFrac) / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n for (let fooI = 0; fooI < this.prodMats.length; ++fooI) {\n warehouse.materials[this.prodMats[fooI]].prd = fooProd;\n }\n } else {\n //If this doesn't produce any materials, then it only creates\n //Products. Creating products will consume materials. The\n //Production of all consumed materials must be set to 0\n for (const reqMatName of Object.keys(this.reqMats)) {\n warehouse.materials[reqMatName].prd = 0;\n }\n }\n break;\n\n case \"SALE\":\n /* Process sale of materials */\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n if (mat.sCost < 0 || mat.sllman[0] === false) {\n mat.sll = 0;\n continue;\n }\n\n // Sale multipliers\n const businessFactor = this.getBusinessFactor(office); //Business employee productivity\n const advertisingFactor = this.getAdvertisingFactors()[0]; //Awareness + popularity\n const marketFactor = this.getMarketFactor(mat); //Competition + demand\n\n // Determine the cost that the material will be sold at\n const markupLimit = mat.getMarkupLimit();\n let sCost;\n if (mat.marketTa2) {\n const prod = mat.prd;\n\n // Reverse engineer the 'maxSell' formula\n // 1. Set 'maxSell' = prod\n // 2. Substitute formula for 'markup'\n // 3. Solve for 'sCost'\n const numerator = markupLimit;\n const sqrtNumerator = prod;\n const sqrtDenominator =\n (mat.qlt + 0.001) *\n marketFactor *\n businessFactor *\n corporation.getSalesMultiplier() *\n advertisingFactor *\n this.getSalesMultiplier();\n const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator);\n let optimalPrice;\n if (sqrtDenominator === 0 || denominator === 0) {\n if (sqrtNumerator === 0) {\n optimalPrice = 0; // No production\n } else {\n optimalPrice = mat.bCost + markupLimit;\n console.warn(`In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost`);\n }\n } else {\n optimalPrice = numerator / denominator + mat.bCost;\n }\n\n // We'll store this \"Optimal Price\" in a property so that we don't have\n // to re-calculate it for the UI\n mat.marketTa2Price = optimalPrice;\n\n sCost = optimalPrice;\n } else if (mat.marketTa1) {\n sCost = mat.bCost + markupLimit;\n } else if (isString(mat.sCost)) {\n sCost = (mat.sCost as string).replace(/MP/g, mat.bCost + \"\");\n sCost = eval(sCost);\n } else {\n sCost = mat.sCost;\n }\n\n // Calculate how much of the material sells (per second)\n let markup = 1;\n if (sCost > mat.bCost) {\n //Penalty if difference between sCost and bCost is greater than markup limit\n if (sCost - mat.bCost > markupLimit) {\n markup = Math.pow(markupLimit / (sCost - mat.bCost), 2);\n }\n } else if (sCost < mat.bCost) {\n if (sCost <= 0) {\n markup = 1e12; //Sell everything, essentially discard\n } else {\n //Lower prices than market increases sales\n markup = mat.bCost / sCost;\n }\n }\n\n mat.maxsll =\n (mat.qlt + 0.001) *\n marketFactor *\n markup *\n businessFactor *\n corporation.getSalesMultiplier() *\n advertisingFactor *\n this.getSalesMultiplier();\n let sellAmt;\n if (isString(mat.sllman[1])) {\n //Dynamically evaluated\n let tmp = (mat.sllman[1] as string).replace(/MAX/g, (mat.maxsll + \"\").toUpperCase());\n tmp = tmp.replace(/PROD/g, mat.prd + \"\");\n try {\n sellAmt = eval(tmp);\n } catch (e) {\n dialogBoxCreate(\n `Error evaluating your sell amount for material ${mat.name} in ${this.name}'s ${city} office. The sell amount is being set to zero`,\n );\n sellAmt = 0;\n }\n sellAmt = Math.min(mat.maxsll, sellAmt);\n } else if (mat.sllman[1] === -1) {\n //Backwards compatibility, -1 = MAX\n sellAmt = mat.maxsll;\n } else {\n //Player's input value is just a number\n sellAmt = Math.min(mat.maxsll, mat.sllman[1] as number);\n }\n\n sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n sellAmt = Math.min(mat.qty, sellAmt);\n if (sellAmt < 0) {\n console.warn(`sellAmt calculated to be negative for ${matName} in ${city}`);\n mat.sll = 0;\n continue;\n }\n if (sellAmt && sCost >= 0) {\n mat.qty -= sellAmt;\n revenue += sellAmt * sCost;\n mat.sll = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n } else {\n mat.sll = 0;\n }\n }\n } //End processing of sale of materials\n break;\n\n case \"EXPORT\":\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n mat.totalExp = 0; //Reset export\n for (let expI = 0; expI < mat.exp.length; ++expI) {\n const exp = mat.exp[expI];\n const amtStr = exp.amt.replace(\n /MAX/g,\n (mat.qty / (CorporationConstants.SecsPerMarketCycle * marketCycles) + \"\").toUpperCase(),\n );\n let amt = 0;\n try {\n amt = eval(amtStr);\n } catch (e) {\n dialogBoxCreate(\n `Calculating export for ${mat.name} in ${this.name}'s ${city} division failed with error: ${e}`,\n );\n continue;\n }\n if (isNaN(amt)) {\n dialogBoxCreate(\n `Error calculating export amount for ${mat.name} in ${this.name}'s ${city} division.`,\n );\n continue;\n }\n amt = amt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n if (mat.qty < amt) {\n amt = mat.qty;\n }\n if (amt === 0) {\n break; //None left\n }\n for (let foo = 0; foo < corporation.divisions.length; ++foo) {\n if (corporation.divisions[foo].name === exp.ind) {\n const expIndustry = corporation.divisions[foo];\n const expWarehouse = expIndustry.warehouses[exp.city];\n if (!expWarehouse) {\n console.error(`Invalid export! ${expIndustry.name} ${exp.city}`);\n break;\n }\n\n // Make sure theres enough space in warehouse\n if (expWarehouse.sizeUsed >= expWarehouse.size) {\n // Warehouse at capacity. Exporting doesn't\n // affect revenue so just return 0's\n return [0, 0];\n } else {\n const maxAmt = Math.floor((expWarehouse.size - expWarehouse.sizeUsed) / MaterialSizes[matName]);\n amt = Math.min(maxAmt, amt);\n }\n expWarehouse.materials[matName].imp +=\n amt / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n expWarehouse.materials[matName].qty += amt;\n expWarehouse.materials[matName].qlt = mat.qlt;\n mat.qty -= amt;\n mat.totalExp += amt;\n expIndustry.updateWarehouseSizeUsed(expWarehouse);\n break;\n }\n }\n }\n //totalExp should be per second\n mat.totalExp /= CorporationConstants.SecsPerMarketCycle * marketCycles;\n }\n }\n\n break;\n\n case \"START\":\n break;\n default:\n console.error(`Invalid state: ${this.state}`);\n break;\n } //End switch(this.state)\n this.updateWarehouseSizeUsed(warehouse);\n } // End warehouse\n\n //Produce Scientific Research based on R&D employees\n //Scientific Research can be produced without a warehouse\n if (office) {\n this.sciResearch.qty +=\n 0.004 *\n Math.pow(office.employeeProd[EmployeePositions.RandD], 0.5) *\n corporation.getScientificResearchMultiplier() *\n this.getScientificResearchMultiplier();\n }\n }\n return [revenue, expenses];\n }\n\n //Process production & sale of this industry's FINISHED products (including all of their stats)\n processProducts(marketCycles = 1, corporation: Corporation): [number, number] {\n let revenue = 0;\n const expenses = 0;\n\n //Create products\n if (this.state === \"PRODUCTION\") {\n for (const prodName of Object.keys(this.products)) {\n const prod = this.products[prodName];\n if (prod === undefined) continue;\n if (!prod.fin) {\n const city = prod.createCity;\n const office = this.offices[city];\n if (office === 0) continue;\n\n prod.createProduct(marketCycles, office.employeeProd);\n if (prod.prog >= 100) {\n prod.finishProduct(this);\n }\n break;\n }\n }\n }\n\n //Produce Products\n for (const prodName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(prodName)) {\n const prod = this.products[prodName];\n if (prod && prod.fin) {\n revenue += this.processProduct(marketCycles, prod, corporation);\n }\n }\n }\n return [revenue, expenses];\n }\n\n //Processes FINISHED products\n processProduct(marketCycles = 1, product: Product, corporation: Corporation): number {\n let totalProfit = 0;\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const office = this.offices[city];\n if (office === 0) continue;\n const warehouse = this.warehouses[city];\n if (warehouse) {\n switch (this.state) {\n case \"PRODUCTION\": {\n //Calculate the maximum production of this material based\n //on the office's productivity\n const maxProd =\n this.getOfficeProductivity(office, { forProduct: true }) *\n corporation.getProductionMultiplier() *\n this.prodMult * // Multiplier from materials\n this.getProductionMultiplier() * // Multiplier from research\n this.getProductProductionMultiplier(); // Multiplier from research\n let prod;\n\n //Account for whether production is manually limited\n if (product.prdman[city][0]) {\n prod = Math.min(maxProd, product.prdman[city][1]);\n } else {\n prod = maxProd;\n }\n prod *= CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n //Calculate net change in warehouse storage making the Products will cost\n let netStorageSize = product.siz;\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const normQty = product.reqMats[reqMatName];\n netStorageSize -= MaterialSizes[reqMatName] * normQty;\n }\n }\n\n //If there's not enough space in warehouse, limit the amount of Product\n if (netStorageSize > 0) {\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / netStorageSize);\n prod = Math.min(maxAmt, prod);\n }\n\n warehouse.smartSupplyStore += prod / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n\n //Make sure we have enough resources to make our Products\n let producableFrac = 1;\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const req = product.reqMats[reqMatName] * prod;\n if (warehouse.materials[reqMatName].qty < req) {\n producableFrac = Math.min(producableFrac, warehouse.materials[reqMatName].qty / req);\n }\n }\n }\n\n //Make our Products if they are producable\n if (producableFrac > 0 && prod > 0) {\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const reqMatQtyNeeded = product.reqMats[reqMatName] * prod * producableFrac;\n warehouse.materials[reqMatName].qty -= reqMatQtyNeeded;\n warehouse.materials[reqMatName].prd -=\n reqMatQtyNeeded / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n }\n }\n //Quantity\n product.data[city][0] += prod * producableFrac;\n }\n\n //Keep track of production Per second\n product.data[city][1] = (prod * producableFrac) / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n break;\n }\n case \"SALE\": {\n //Process sale of Products\n product.pCost = 0; //Estimated production cost\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n product.pCost += product.reqMats[reqMatName] * warehouse.materials[reqMatName].bCost;\n }\n }\n\n // Since its a product, its production cost is increased for labor\n product.pCost *= CorporationConstants.ProductProductionCostRatio;\n\n // Sale multipliers\n const businessFactor = this.getBusinessFactor(office); //Business employee productivity\n const advertisingFactor = this.getAdvertisingFactors()[0]; //Awareness + popularity\n const marketFactor = this.getMarketFactor(product); //Competition + demand\n\n // Calculate Sale Cost (sCost), which could be dynamically evaluated\n const markupLimit = product.rat / product.mku;\n let sCost;\n if (product.marketTa2) {\n const prod = product.data[city][1];\n\n // Reverse engineer the 'maxSell' formula\n // 1. Set 'maxSell' = prod\n // 2. Substitute formula for 'markup'\n // 3. Solve for 'sCost', product.pCost = sCost\n const numerator = markupLimit;\n const sqrtNumerator = prod;\n const sqrtDenominator =\n 0.5 *\n Math.pow(product.rat, 0.65) *\n marketFactor *\n corporation.getSalesMultiplier() *\n businessFactor *\n advertisingFactor *\n this.getSalesMultiplier();\n const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator);\n let optimalPrice;\n if (sqrtDenominator === 0 || denominator === 0) {\n if (sqrtNumerator === 0) {\n optimalPrice = 0; // No production\n } else {\n optimalPrice = product.pCost + markupLimit;\n console.warn(`In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost`);\n }\n } else {\n optimalPrice = numerator / denominator + product.pCost;\n }\n\n // Store this \"optimal Price\" in a property so we don't have to re-calculate for UI\n product.marketTa2Price[city] = optimalPrice;\n sCost = optimalPrice;\n } else if (product.marketTa1) {\n sCost = product.pCost + markupLimit;\n } else if (isString(product.sCost)) {\n const sCostString = product.sCost as string;\n if (product.mku === 0) {\n console.error(`mku is zero, reverting to 1 to avoid Infinity`);\n product.mku = 1;\n }\n sCost = sCostString.replace(/MP/g, product.pCost + product.rat / product.mku + \"\");\n sCost = eval(sCost);\n } else {\n sCost = product.sCost;\n }\n\n let markup = 1;\n if (sCost > product.pCost) {\n if (sCost - product.pCost > markupLimit) {\n markup = markupLimit / (sCost - product.pCost);\n }\n }\n\n product.maxsll =\n 0.5 *\n Math.pow(product.rat, 0.65) *\n marketFactor *\n corporation.getSalesMultiplier() *\n Math.pow(markup, 2) *\n businessFactor *\n advertisingFactor *\n this.getSalesMultiplier();\n let sellAmt;\n if (product.sllman[city][0] && isString(product.sllman[city][1])) {\n //Sell amount is dynamically evaluated\n let tmp = product.sllman[city][1].replace(/MAX/g, (product.maxsll + \"\").toUpperCase());\n tmp = tmp.replace(/PROD/g, product.data[city][1]);\n try {\n tmp = eval(tmp);\n } catch (e) {\n dialogBoxCreate(\n `Error evaluating your sell price expression for ${product.name} in ${this.name}'s ${city} office. Sell price is being set to MAX`,\n );\n tmp = product.maxsll;\n }\n sellAmt = Math.min(product.maxsll, tmp);\n } else if (product.sllman[city][0] && product.sllman[city][1] > 0) {\n //Sell amount is manually limited\n sellAmt = Math.min(product.maxsll, product.sllman[city][1]);\n } else if (product.sllman[city][0] === false) {\n sellAmt = 0;\n } else {\n sellAmt = product.maxsll;\n }\n if (sellAmt < 0) {\n sellAmt = 0;\n }\n sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n sellAmt = Math.min(product.data[city][0], sellAmt); //data[0] is qty\n if (sellAmt && sCost) {\n product.data[city][0] -= sellAmt; //data[0] is qty\n totalProfit += sellAmt * sCost;\n product.data[city][2] = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles); //data[2] is sell property\n } else {\n product.data[city][2] = 0; //data[2] is sell property\n }\n break;\n }\n case \"START\":\n case \"PURCHASE\":\n case \"EXPORT\":\n break;\n default:\n console.error(`Invalid State: ${this.state}`);\n break;\n } //End switch(this.state)\n }\n }\n return totalProfit;\n }\n\n resetImports(state: string): void {\n //At the start of the export state, set the imports of everything to 0\n if (state === \"EXPORT\") {\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n if (!this.warehouses[city]) {\n continue;\n }\n const warehouse = this.warehouses[city];\n if (warehouse === 0) continue;\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n mat.imp = 0;\n }\n }\n }\n }\n }\n\n discontinueProduct(product: Product): void {\n for (const productName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(productName)) {\n if (product === this.products[productName]) {\n delete this.products[productName];\n }\n }\n }\n }\n\n getAdVertCost(): number {\n return 1e9 * Math.pow(1.06, this.numAdVerts);\n }\n\n applyAdVert(corporation: Corporation): void {\n const advMult = corporation.getAdvertisingMultiplier() * this.getAdvertisingMultiplier();\n const awareness = (this.awareness + 3 * advMult) * (1.01 * advMult);\n this.awareness = Math.min(awareness, Number.MAX_VALUE);\n\n const popularity = (this.popularity + 1 * advMult) * ((1 + getRandomInt(1, 3) / 100) * advMult);\n this.popularity = Math.min(popularity, Number.MAX_VALUE);\n\n ++this.numAdVerts;\n }\n\n // Returns how much of a material can be produced based of office productivity (employee stats)\n getOfficeProductivity(office: OfficeSpace, params: { forProduct?: boolean } = {}): number {\n const opProd = office.employeeProd[EmployeePositions.Operations];\n const engrProd = office.employeeProd[EmployeePositions.Engineer];\n const mgmtProd = office.employeeProd[EmployeePositions.Management];\n const total = opProd + engrProd + mgmtProd;\n\n if (total <= 0) return 0;\n\n // Management is a multiplier for the production from Operations and Engineers\n const mgmtFactor = 1 + mgmtProd / (1.2 * total);\n\n // For production, Operations is slightly more important than engineering\n // Both Engineering and Operations have diminishing returns\n const prod = (Math.pow(opProd, 0.4) + Math.pow(engrProd, 0.3)) * mgmtFactor;\n\n // Generic multiplier for the production. Used for game-balancing purposes\n const balancingMult = 0.05;\n\n if (params && params.forProduct) {\n // Products are harder to create and therefore have less production\n return 0.5 * balancingMult * prod;\n } else {\n return balancingMult * prod;\n }\n }\n\n // Returns a multiplier based on the office' 'Business' employees that affects sales\n getBusinessFactor(office: OfficeSpace): number {\n const businessProd = 1 + office.employeeProd[EmployeePositions.Business];\n\n return calculateEffectWithFactors(businessProd, 0.26, 10e3);\n }\n\n //Returns a set of multipliers based on the Industry's awareness, popularity, and advFac. This\n //multiplier affects sales. The result is:\n // [Total sales mult, total awareness mult, total pop mult, awareness/pop ratio mult]\n getAdvertisingFactors(): [number, number, number, number] {\n const awarenessFac = Math.pow(this.awareness + 1, this.advFac);\n const popularityFac = Math.pow(this.popularity + 1, this.advFac);\n const ratioFac = this.awareness === 0 ? 0.01 : Math.max((this.popularity + 0.001) / this.awareness, 0.01);\n const totalFac = Math.pow(awarenessFac * popularityFac * ratioFac, 0.85);\n return [totalFac, awarenessFac, popularityFac, ratioFac];\n }\n\n //Returns a multiplier based on a materials demand and competition that affects sales\n getMarketFactor(mat: { dmd: number; cmp: number }): number {\n return Math.max(0.1, (mat.dmd * (100 - mat.cmp)) / 100);\n }\n\n // Returns a boolean indicating whether this Industry has the specified Research\n hasResearch(name: string): boolean {\n return this.researched[name] === true;\n }\n\n updateResearchTree(): void {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry \"${this.type}\"`);\n\n // Since ResearchTree data isn't saved, we'll update the Research Tree data\n // based on the stored 'researched' property in the Industry object\n if (Object.keys(researchTree.researched).length !== Object.keys(this.researched).length) {\n for (const research of Object.keys(this.researched)) {\n researchTree.research(research);\n }\n }\n }\n\n // Get multipliers from Research\n getAdvertisingMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getAdvertisingMultiplier();\n }\n\n getEmployeeChaMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeChaMultiplier();\n }\n\n getEmployeeCreMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeCreMultiplier();\n }\n\n getEmployeeEffMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeEffMultiplier();\n }\n\n getEmployeeIntMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeIntMultiplier();\n }\n\n getProductionMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getProductionMultiplier();\n }\n\n getProductProductionMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getProductProductionMultiplier();\n }\n\n getSalesMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getSalesMultiplier();\n }\n\n getScientificResearchMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getScientificResearchMultiplier();\n }\n\n getStorageMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getStorageMultiplier();\n }\n\n /** Serialize the current object to a JSON save state. */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Industry\", this);\n }\n\n /** Initializes a Industry object from a JSON save state. */\n static fromJSON(value: IReviverValue): Industry {\n return Generic_fromJSON(Industry, value.data);\n }\n}\n\nReviver.constructors.Industry = Industry;\n","/**\n * This is a component that implements a mathematical formula used commonly throughout the\n * game. This formula is (typically) used to calculate the effect that various statistics\n * have on a game mechanic. It looks something like:\n *\n * (stat ^ exponential factor) + (stat / linear factor)\n *\n * where the exponential factor is a number between 0 and 1 and the linear factor\n * is typically a relatively larger number.\n *\n * This formula ensures that the effects of the statistic that is being processed\n * has diminishing returns, but never loses its effectiveness as you continue\n * to raise it.\n */\nexport function calculateEffectWithFactors(n: number, expFac: number, linearFac: number): number {\n if (expFac <= 0 || expFac >= 1) {\n console.warn(`Exponential factor is ${expFac}. This is not an intended value for it`);\n }\n if (linearFac < 1) {\n console.warn(`Linear factor is ${linearFac}. This is not an intended value for it`);\n }\n\n return Math.pow(n, expFac) + n / linearFac;\n}\n","import { CorporationConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { Corporation } from \"./Corporation\";\nimport { Industry } from \"./Industry\";\n\ninterface IParams {\n name?: string;\n morale?: number;\n happiness?: number;\n energy?: number;\n intelligence?: number;\n charisma?: number;\n experience?: number;\n creativity?: number;\n efficiency?: number;\n salary?: number;\n loc?: string;\n}\n\nexport class Employee {\n name: string;\n mor: number;\n hap: number;\n ene: number;\n int: number;\n cha: number;\n exp: number;\n cre: number;\n eff: number;\n sal: number;\n cyclesUntilRaise = CorporationConstants.CyclesPerEmployeeRaise;\n loc: string;\n pos: string;\n nextPos: string;\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"Bobby\";\n\n //Morale, happiness, and energy are 0-100\n this.mor = params.morale ? params.morale : getRandomInt(50, 100);\n this.hap = params.happiness ? params.happiness : getRandomInt(50, 100);\n this.ene = params.energy ? params.energy : getRandomInt(50, 100);\n\n this.int = params.intelligence ? params.intelligence : getRandomInt(10, 50);\n this.cha = params.charisma ? params.charisma : getRandomInt(10, 50);\n this.exp = params.experience ? params.experience : getRandomInt(10, 50);\n this.cre = params.creativity ? params.creativity : getRandomInt(10, 50);\n this.eff = params.efficiency ? params.efficiency : getRandomInt(10, 50);\n this.sal = params.salary ? params.salary : getRandomInt(0.1, 5);\n\n this.loc = params.loc ? params.loc : \"\";\n this.pos = EmployeePositions.Unassigned;\n this.nextPos = this.pos;\n }\n\n //Returns the amount the employee needs to be paid\n process(marketCycles = 1): number {\n const gain = 0.003 * marketCycles;\n const det = gain * Math.random();\n this.exp += gain;\n\n //Training\n const trainingEff = gain * Math.random();\n if (this.pos === EmployeePositions.Training) {\n //To increase creativity and intelligence special upgrades are needed\n this.cha += trainingEff;\n this.exp += trainingEff;\n this.eff += trainingEff;\n }\n\n this.ene -= det;\n this.hap -= det;\n\n const salary = this.sal * marketCycles * CorporationConstants.SecsPerMarketCycle;\n return salary;\n }\n\n calculateProductivity(corporation: Corporation, industry: Industry): number {\n const effCre = this.cre * corporation.getEmployeeCreMultiplier() * industry.getEmployeeCreMultiplier(),\n effCha = this.cha * corporation.getEmployeeChaMultiplier() * industry.getEmployeeChaMultiplier(),\n effInt = this.int * corporation.getEmployeeIntMultiplier() * industry.getEmployeeIntMultiplier(),\n effEff = this.eff * corporation.getEmployeeEffMultiplier() * industry.getEmployeeEffMultiplier();\n const prodBase = this.mor * this.hap * this.ene * 1e-6;\n let prodMult = 0;\n switch (this.pos) {\n //Calculate productivity based on position. This is multiplied by prodBase\n //to get final value\n case EmployeePositions.Operations:\n prodMult = 0.6 * effInt + 0.1 * effCha + this.exp + 0.5 * effCre + effEff;\n break;\n case EmployeePositions.Engineer:\n prodMult = effInt + 0.1 * effCha + 1.5 * this.exp + effEff;\n break;\n case EmployeePositions.Business:\n prodMult = 0.4 * effInt + effCha + 0.5 * this.exp;\n break;\n case EmployeePositions.Management:\n prodMult = 2 * effCha + this.exp + 0.2 * effCre + 0.7 * effEff;\n break;\n case EmployeePositions.RandD:\n prodMult = 1.5 * effInt + 0.8 * this.exp + effCre + 0.5 * effEff;\n break;\n case EmployeePositions.Unassigned:\n case EmployeePositions.Training:\n prodMult = 0;\n break;\n default:\n console.error(`Invalid employee position: ${this.pos}`);\n break;\n }\n return prodBase * prodMult;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Employee\", this);\n }\n\n static fromJSON(value: IReviverValue): Employee {\n return Generic_fromJSON(Employee, value.data);\n }\n}\n\nReviver.constructors.Employee = Employee;\n","import { EmployeePositions } from \"./EmployeePositions\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { Industry } from \"./Industry\";\nimport { ProductRatingWeights, IProductRatingWeight } from \"./ProductRatingWeights\";\n\nimport { createCityMap } from \"../Locations/createCityMap\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\ninterface IConstructorParams {\n name?: string;\n demand?: number;\n competition?: number;\n markup?: number;\n createCity?: string;\n designCost?: number;\n advCost?: number;\n quality?: number;\n performance?: number;\n durability?: number;\n reliability?: number;\n aesthetics?: number;\n features?: number;\n loc?: string;\n size?: number;\n req?: Record<string, number>;\n}\n\nexport class Product {\n // Product name\n name = \"\";\n\n // The demand for this Product in the market. Gradually decreases\n dmd = 0;\n\n // How much competition there is in the market for this Product\n cmp = 0;\n\n // Markup. Affects how high of a price you can charge for this Product\n // without suffering a loss in the # of sales\n mku = 0;\n\n // Production cost - estimation of how much money it costs to make this Product\n pCost = 0;\n\n // Sell cost\n sCost: string | number = 0;\n\n // Variables for handling the creation process of this Product\n fin = false; // Whether this Product has finished being created\n prog = 0; // Creation progress - A number between 0-100 representing percentage\n createCity = \"\"; // City in which the product is/was being created\n designCost = 0; // How much money was invested into designing this Product\n advCost = 0; // How much money was invested into advertising this Product\n\n // The average employee productivity and scientific research across the creation of the Product\n creationProd: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n total: 0,\n };\n\n // Aggregate score for this Product's 'rating'\n // This is based on the stats/properties below. The weighting of the\n // stats/properties below differs between different industries\n rat = 0;\n\n // Stats/properties of this Product\n qlt = 0;\n per = 0;\n dur = 0;\n rel = 0;\n aes = 0;\n fea = 0;\n\n // Data refers to the production, sale, and quantity of the products\n // These values are specific to a city\n // For each city, the data is [qty, prod, sell]\n data: Record<string, number[]> = createCityMap<number[]>([0, 0, 0]);\n\n // Location of this Product\n // Only applies for location-based products like restaurants/hospitals\n loc = \"\";\n\n // How much space 1 unit of the Product takes (in the warehouse)\n // Not applicable for all Products\n siz = 0;\n\n // Material requirements. An object that maps the name of a material to how much it requires\n // to make 1 unit of the product.\n reqMats: Record<string, number> = {};\n\n // Data to keep track of whether production/sale of this Product is\n // manually limited. These values are specific to a city\n // [Whether production/sale is limited, limit amount]\n prdman: Record<string, any[]> = createCityMap<any[]>([false, 0]);\n sllman: Record<string, any[]> = createCityMap<any[]>([false, 0]);\n\n // Flags that signal whether automatic sale pricing through Market TA is enabled\n marketTa1 = false;\n marketTa2 = false;\n marketTa2Price: Record<string, number> = createCityMap<number>(0);\n\n // Determines the maximum amount of this product that can be sold in one market cycle\n maxsll = 0;\n constructor(params: IConstructorParams = {}) {\n this.name = params.name ? params.name : \"\";\n this.dmd = params.demand ? params.demand : 0;\n this.cmp = params.competition ? params.competition : 0;\n this.mku = params.markup ? params.markup : 0;\n this.createCity = params.createCity ? params.createCity : \"\";\n this.designCost = params.designCost ? params.designCost : 0;\n this.advCost = params.advCost ? params.advCost : 0;\n this.qlt = params.quality ? params.quality : 0;\n this.per = params.performance ? params.performance : 0;\n this.dur = params.durability ? params.durability : 0;\n this.rel = params.reliability ? params.reliability : 0;\n this.aes = params.aesthetics ? params.aesthetics : 0;\n this.fea = params.features ? params.features : 0;\n this.loc = params.loc ? params.loc : \"\";\n this.siz = params.size ? params.size : 0;\n this.reqMats = params.req ? params.req : {};\n }\n\n // Make progress on this product based on current employee productivity\n createProduct(marketCycles: number, employeeProd: typeof this[\"creationProd\"]): void {\n if (this.fin) {\n return;\n }\n\n // Designing/Creating a Product is based mostly off Engineers\n const opProd = employeeProd[EmployeePositions.Operations];\n const engrProd = employeeProd[EmployeePositions.Engineer];\n const mgmtProd = employeeProd[EmployeePositions.Management];\n const total = opProd + engrProd + mgmtProd;\n if (total <= 0) {\n return;\n }\n\n // Management is a multiplier for the production from Engineers\n const mgmtFactor = 1 + mgmtProd / (1.2 * total);\n const prodMult = (Math.pow(engrProd, 0.34) + Math.pow(opProd, 0.2)) * mgmtFactor;\n const progress = Math.min(marketCycles * 0.01 * prodMult, 100 - this.prog);\n if (progress <= 0) {\n return;\n }\n\n this.prog += progress;\n for (const pos of Object.keys(employeeProd)) {\n this.creationProd[pos] += (employeeProd[pos] * progress) / 100;\n }\n }\n\n // @param industry - Industry object. Reference to industry that makes this Product\n finishProduct(industry: Industry): void {\n this.fin = true;\n\n // Calculate properties\n const totalProd = this.creationProd.total;\n const engrRatio = this.creationProd[EmployeePositions.Engineer] / totalProd;\n const mgmtRatio = this.creationProd[EmployeePositions.Management] / totalProd;\n const rndRatio = this.creationProd[EmployeePositions.RandD] / totalProd;\n const opsRatio = this.creationProd[EmployeePositions.Operations] / totalProd;\n const busRatio = this.creationProd[EmployeePositions.Business] / totalProd;\n\n const designMult = 1 + Math.pow(this.designCost, 0.1) / 100;\n const balanceMult = 1.2 * engrRatio + 0.9 * mgmtRatio + 1.3 * rndRatio + 1.5 * opsRatio + busRatio;\n const sciMult = 1 + Math.pow(industry.sciResearch.qty, industry.sciFac) / 800;\n const totalMult = balanceMult * designMult * sciMult;\n\n this.qlt =\n totalMult *\n (0.1 * this.creationProd[EmployeePositions.Engineer] +\n 0.05 * this.creationProd[EmployeePositions.Management] +\n 0.05 * this.creationProd[EmployeePositions.RandD] +\n 0.02 * this.creationProd[EmployeePositions.Operations] +\n 0.02 * this.creationProd[EmployeePositions.Business]);\n this.per =\n totalMult *\n (0.15 * this.creationProd[EmployeePositions.Engineer] +\n 0.02 * this.creationProd[EmployeePositions.Management] +\n 0.02 * this.creationProd[EmployeePositions.RandD] +\n 0.02 * this.creationProd[EmployeePositions.Operations] +\n 0.02 * this.creationProd[EmployeePositions.Business]);\n this.dur =\n totalMult *\n (0.05 * this.creationProd[EmployeePositions.Engineer] +\n 0.02 * this.creationProd[EmployeePositions.Management] +\n 0.08 * this.creationProd[EmployeePositions.RandD] +\n 0.05 * this.creationProd[EmployeePositions.Operations] +\n 0.05 * this.creationProd[EmployeePositions.Business]);\n this.rel =\n totalMult *\n (0.02 * this.creationProd[EmployeePositions.Engineer] +\n 0.08 * this.creationProd[EmployeePositions.Management] +\n 0.02 * this.creationProd[EmployeePositions.RandD] +\n 0.05 * this.creationProd[EmployeePositions.Operations] +\n 0.08 * this.creationProd[EmployeePositions.Business]);\n this.aes =\n totalMult *\n (0.0 * this.creationProd[EmployeePositions.Engineer] +\n 0.08 * this.creationProd[EmployeePositions.Management] +\n 0.05 * this.creationProd[EmployeePositions.RandD] +\n 0.02 * this.creationProd[EmployeePositions.Operations] +\n 0.1 * this.creationProd[EmployeePositions.Business]);\n this.fea =\n totalMult *\n (0.08 * this.creationProd[EmployeePositions.Engineer] +\n 0.05 * this.creationProd[EmployeePositions.Management] +\n 0.02 * this.creationProd[EmployeePositions.RandD] +\n 0.05 * this.creationProd[EmployeePositions.Operations] +\n 0.05 * this.creationProd[EmployeePositions.Business]);\n this.calculateRating(industry);\n const advMult = 1 + Math.pow(this.advCost, 0.1) / 100;\n const busmgtgRatio = Math.max(busRatio + mgmtRatio, 1 / totalProd);\n this.mku = 100 / (advMult * Math.pow(this.qlt + 0.001, 0.65) * busmgtgRatio);\n\n // I actually don't understand well enough to know if this is right.\n // I'm adding this to prevent a crash.\n if (this.mku === 0 || !isFinite(this.mku)) this.mku = 1;\n\n this.dmd =\n industry.awareness === 0 ? 20 : Math.min(100, advMult * (100 * (industry.popularity / industry.awareness)));\n this.cmp = getRandomInt(0, 70);\n\n //Calculate the product's required materials\n //For now, just set it to be the same as the requirements to make materials\n for (const matName of Object.keys(industry.reqMats)) {\n if (industry.reqMats.hasOwnProperty(matName)) {\n const reqMat = industry.reqMats[matName];\n if (reqMat === undefined) continue;\n this.reqMats[matName] = reqMat;\n }\n }\n\n //Calculate the product's size\n //For now, just set it to be the same size as the requirements to make materials\n this.siz = 0;\n for (const matName of Object.keys(industry.reqMats)) {\n const reqMat = industry.reqMats[matName];\n if (reqMat === undefined) continue;\n this.siz += MaterialSizes[matName] * reqMat;\n }\n }\n\n calculateRating(industry: Industry): void {\n const weights: IProductRatingWeight = ProductRatingWeights[industry.type];\n if (weights == null) {\n console.error(`Could not find product rating weights for: ${industry}`);\n return;\n }\n this.rat = 0;\n this.rat += weights.Quality ? this.qlt * weights.Quality : 0;\n this.rat += weights.Performance ? this.per * weights.Performance : 0;\n this.rat += weights.Durability ? this.dur * weights.Durability : 0;\n this.rat += weights.Reliability ? this.rel * weights.Reliability : 0;\n this.rat += weights.Aesthetics ? this.aes * weights.Aesthetics : 0;\n this.rat += weights.Features ? this.fea * weights.Features : 0;\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Product\", this);\n }\n\n // Initializes a Product object from a JSON save state.\n static fromJSON(value: IReviverValue): Product {\n return Generic_fromJSON(Product, value.data);\n }\n}\n\nReviver.constructors.Product = Product;\n","import { Industries } from \"./IndustryData\";\n\nexport interface IProductRatingWeight {\n Aesthetics?: number;\n Durability?: number;\n Features?: number;\n Quality?: number;\n Performance?: number;\n Reliability?: number;\n}\n\nexport const ProductRatingWeights: Record<string, IProductRatingWeight> = {\n [Industries.Food]: {\n Quality: 0.7,\n Durability: 0.1,\n Aesthetics: 0.2,\n },\n [Industries.Tobacco]: {\n Quality: 0.4,\n Durability: 0.2,\n Reliability: 0.2,\n Aesthetics: 0.2,\n },\n [Industries.Pharmaceutical]: {\n Quality: 0.2,\n Performance: 0.2,\n Durability: 0.1,\n Reliability: 0.3,\n Features: 0.2,\n },\n [Industries.Computer]: {\n Quality: 0.15,\n Performance: 0.25,\n Durability: 0.25,\n Reliability: 0.2,\n Aesthetics: 0.05,\n Features: 0.1,\n },\n Computer: {\n //Repeat\n Quality: 0.15,\n Performance: 0.25,\n Durability: 0.25,\n Reliability: 0.2,\n Aesthetics: 0.05,\n Features: 0.1,\n },\n [Industries.Robotics]: {\n Quality: 0.1,\n Performance: 0.2,\n Durability: 0.2,\n Reliability: 0.2,\n Aesthetics: 0.1,\n Features: 0.2,\n },\n [Industries.Software]: {\n Quality: 0.2,\n Performance: 0.2,\n Reliability: 0.2,\n Durability: 0.2,\n Features: 0.2,\n },\n [Industries.Healthcare]: {\n Quality: 0.4,\n Performance: 0.1,\n Durability: 0.1,\n Reliability: 0.3,\n Features: 0.1,\n },\n [Industries.RealEstate]: {\n Quality: 0.2,\n Durability: 0.25,\n Reliability: 0.1,\n Aesthetics: 0.35,\n Features: 0.1,\n },\n};\n","import { Player as player } from \"../Player\";\nimport { calculateServerGrowth } from \"../Server/formulas/grow\";\nimport {\n calculateMoneyGainRate,\n calculateLevelUpgradeCost,\n calculateRamUpgradeCost,\n calculateCoreUpgradeCost,\n calculateNodeCost,\n} from \"../Hacknet/formulas/HacknetNodes\";\nimport {\n calculateHashGainRate as HScalculateHashGainRate,\n calculateLevelUpgradeCost as HScalculateLevelUpgradeCost,\n calculateRamUpgradeCost as HScalculateRamUpgradeCost,\n calculateCoreUpgradeCost as HScalculateCoreUpgradeCost,\n calculateCacheUpgradeCost as HScalculateCacheUpgradeCost,\n calculateServerCost as HScalculateServerCost,\n} from \"../Hacknet/formulas/HacknetServers\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { calculateSkill, calculateExp } from \"../PersonObjects/formulas/skill\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"../Hacking\";\nimport { Programs } from \"../Programs/Programs\";\nimport { Formulas as IFormulas } from \"../ScriptEditor/NetscriptDefinitions\";\nimport {\n calculateRespectGain,\n calculateWantedLevelGain,\n calculateMoneyGain,\n calculateWantedPenalty,\n calculateAscensionMult,\n calculateAscensionPointsGain,\n} from \"../Gang/formulas/formulas\";\nimport { favorToRep as calculateFavorToRep, repToFavor as calculateRepToFavor } from \"../Faction/formulas/favor\";\nimport { repFromDonation } from \"../Faction/formulas/donation\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\nimport { calculateCrimeWorkStats } from \"../Work/formulas/Crime\";\nimport { Crimes } from \"../Crime/Crimes\";\nimport { calculateClassEarnings } from \"../Work/formulas/Class\";\nimport { ClassType } from \"../Work/ClassWork\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { calculateFactionExp, calculateFactionRep } from \"../Work/formulas/Faction\";\nimport { FactionWorkType } from \"../Work/data/FactionWorkType\";\n\nimport { defaultMultipliers } from \"../PersonObjects/Multipliers\";\n\nexport function NetscriptFormulas(): InternalAPI<IFormulas> {\n const checkFormulasAccess = function (ctx: NetscriptContext): void {\n if (!player.hasProgram(Programs.Formulas.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Requires Formulas.exe to run.`);\n }\n };\n return {\n mockServer: () => () => ({\n cpuCores: 0,\n ftpPortOpen: false,\n hasAdminRights: false,\n hostname: \"\",\n httpPortOpen: false,\n ip: \"\",\n isConnectedTo: false,\n maxRam: 0,\n organizationName: \"\",\n ramUsed: 0,\n smtpPortOpen: false,\n sqlPortOpen: false,\n sshPortOpen: false,\n purchasedByPlayer: false,\n backdoorInstalled: false,\n baseDifficulty: 0,\n hackDifficulty: 0,\n minDifficulty: 0,\n moneyAvailable: 0,\n moneyMax: 0,\n numOpenPortsRequired: 0,\n openPortCount: 0,\n requiredHackingSkill: 0,\n serverGrowth: 0,\n }),\n mockPlayer: () => () => ({\n hp: { current: 0, max: 0 },\n skills: {\n hacking: 0,\n strength: 0,\n defense: 0,\n dexterity: 0,\n agility: 0,\n charisma: 0,\n intelligence: 0,\n },\n exp: {\n hacking: 0,\n strength: 0,\n defense: 0,\n dexterity: 0,\n agility: 0,\n charisma: 0,\n intelligence: 0,\n },\n mults: defaultMultipliers(),\n numPeopleKilled: 0,\n money: 0,\n city: \"\",\n location: \"\",\n bitNodeN: 0,\n totalPlaytime: 0,\n playtimeSinceLastAug: 0,\n playtimeSinceLastBitnode: 0,\n jobs: {},\n factions: [],\n tor: false,\n hasCorporation: false,\n inBladeburner: false,\n entropy: 0,\n }),\n reputation: {\n calculateFavorToRep: (ctx) => (_favor) => {\n const favor = helpers.number(ctx, \"favor\", _favor);\n checkFormulasAccess(ctx);\n return calculateFavorToRep(favor);\n },\n calculateRepToFavor: (ctx) => (_rep) => {\n const rep = helpers.number(ctx, \"rep\", _rep);\n checkFormulasAccess(ctx);\n return calculateRepToFavor(rep);\n },\n repFromDonation: (ctx) => (_amount, _player) => {\n const amount = helpers.number(ctx, \"amount\", _amount);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return repFromDonation(amount, player);\n },\n },\n skills: {\n calculateSkill:\n (ctx) =>\n (_exp, _mult = 1) => {\n const exp = helpers.number(ctx, \"exp\", _exp);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateSkill(exp, mult);\n },\n calculateExp:\n (ctx) =>\n (_skill, _mult = 1) => {\n const skill = helpers.number(ctx, \"skill\", _skill);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateExp(skill, mult);\n },\n },\n hacking: {\n hackChance: (ctx) => (_server, _player) => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateHackingChance(server, player);\n },\n hackExp: (ctx) => (_server, _player) => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateHackingExpGain(server, player);\n },\n hackPercent: (ctx) => (_server, _player) => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculatePercentMoneyHacked(server, player);\n },\n growPercent:\n (ctx) =>\n (_server, _threads, _player, _cores = 1) => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const cores = helpers.number(ctx, \"cores\", _cores);\n checkFormulasAccess(ctx);\n return calculateServerGrowth(server, threads, player, cores);\n },\n hackTime: (ctx) => (_server, _player) => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateHackingTime(server, player) * 1000;\n },\n growTime: (ctx) => (_server, _player) => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateGrowTime(server, player) * 1000;\n },\n weakenTime: (ctx) => (_server, _player) => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateWeakenTime(server, player) * 1000;\n },\n },\n hacknetNodes: {\n moneyGainRate:\n (ctx) =>\n (_level, _ram, _cores, _mult = 1) => {\n const level = helpers.number(ctx, \"level\", _level);\n const ram = helpers.number(ctx, \"ram\", _ram);\n const cores = helpers.number(ctx, \"cores\", _cores);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateMoneyGainRate(level, ram, cores, mult);\n },\n levelUpgradeCost:\n (ctx) =>\n (_startingLevel, _extraLevels = 1, _costMult = 1) => {\n const startingLevel = helpers.number(ctx, \"startingLevel\", _startingLevel);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return calculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost:\n (ctx) =>\n (_startingRam, _extraLevels = 1, _costMult = 1) => {\n const startingRam = helpers.number(ctx, \"startingRam\", _startingRam);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return calculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost:\n (ctx) =>\n (_startingCore, _extraCores = 1, _costMult = 1) => {\n const startingCore = helpers.number(ctx, \"startingCore\", _startingCore);\n const extraCores = helpers.number(ctx, \"extraCores\", _extraCores);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return calculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n hacknetNodeCost: (ctx) => (_n, _mult) => {\n const n = helpers.number(ctx, \"n\", _n);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateNodeCost(n, mult);\n },\n constants: (ctx) => () => {\n checkFormulasAccess(ctx);\n return Object.assign({}, HacknetNodeConstants);\n },\n },\n hacknetServers: {\n hashGainRate:\n (ctx) =>\n (_level, _ramUsed, _maxRam, _cores, _mult = 1) => {\n const level = helpers.number(ctx, \"level\", _level);\n const ramUsed = helpers.number(ctx, \"ramUsed\", _ramUsed);\n const maxRam = helpers.number(ctx, \"maxRam\", _maxRam);\n const cores = helpers.number(ctx, \"cores\", _cores);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return HScalculateHashGainRate(level, ramUsed, maxRam, cores, mult);\n },\n levelUpgradeCost:\n (ctx) =>\n (_startingLevel, _extraLevels = 1, _costMult = 1) => {\n const startingLevel = helpers.number(ctx, \"startingLevel\", _startingLevel);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return HScalculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost:\n (ctx) =>\n (_startingRam, _extraLevels = 1, _costMult = 1) => {\n const startingRam = helpers.number(ctx, \"startingRam\", _startingRam);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return HScalculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost:\n (ctx) =>\n (_startingCore, _extraCores = 1, _costMult = 1) => {\n const startingCore = helpers.number(ctx, \"startingCore\", _startingCore);\n const extraCores = helpers.number(ctx, \"extraCores\", _extraCores);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return HScalculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n cacheUpgradeCost:\n (ctx) =>\n (_startingCache, _extraCache = 1) => {\n const startingCache = helpers.number(ctx, \"startingCache\", _startingCache);\n const extraCache = helpers.number(ctx, \"extraCache\", _extraCache);\n checkFormulasAccess(ctx);\n return HScalculateCacheUpgradeCost(startingCache, extraCache);\n },\n hashUpgradeCost: (ctx) => (_upgName, _level) => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const level = helpers.number(ctx, \"level\", _level);\n checkFormulasAccess(ctx);\n const upg = player.hashManager.getUpgrade(upgName);\n if (!upg) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid Hash Upgrade: ${upgName}`);\n }\n return upg.getCost(level);\n },\n hacknetServerCost:\n (ctx) =>\n (_n, _mult = 1) => {\n const n = helpers.number(ctx, \"n\", _n);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return HScalculateServerCost(n, mult);\n },\n constants: (ctx) => () => {\n checkFormulasAccess(ctx);\n return Object.assign({}, HacknetServerConstants);\n },\n },\n gang: {\n wantedPenalty: (ctx) => (_gang) => {\n const gang = helpers.gang(ctx, _gang);\n checkFormulasAccess(ctx);\n return calculateWantedPenalty(gang);\n },\n respectGain: (ctx) => (_gang, _member, _task) => {\n const gang = helpers.gang(ctx, _gang);\n const member = helpers.gangMember(ctx, _member);\n const task = helpers.gangTask(ctx, _task);\n checkFormulasAccess(ctx);\n return calculateRespectGain(gang, member, task);\n },\n wantedLevelGain: (ctx) => (_gang, _member, _task) => {\n const gang = helpers.gang(ctx, _gang);\n const member = helpers.gangMember(ctx, _member);\n const task = helpers.gangTask(ctx, _task);\n checkFormulasAccess(ctx);\n return calculateWantedLevelGain(gang, member, task);\n },\n moneyGain: (ctx) => (_gang, _member, _task) => {\n const gang = helpers.gang(ctx, _gang);\n const member = helpers.gangMember(ctx, _member);\n const task = helpers.gangTask(ctx, _task);\n checkFormulasAccess(ctx);\n return calculateMoneyGain(gang, member, task);\n },\n ascensionPointsGain: (ctx) => (_exp) => {\n const exp = helpers.number(ctx, \"exp\", _exp);\n checkFormulasAccess(ctx);\n return calculateAscensionPointsGain(exp);\n },\n ascensionMultiplier: (ctx) => (_points) => {\n const points = helpers.number(ctx, \"points\", _points);\n checkFormulasAccess(ctx);\n return calculateAscensionMult(points);\n },\n },\n work: {\n crimeGains: (ctx) => (_crimeType) => {\n const crimeType = helpers.string(ctx, \"crimeType\", _crimeType);\n const crime = Object.values(Crimes).find((c) => String(c.type) === crimeType);\n if (!crime) throw new Error(`Invalid crime type: ${crimeType}`);\n return calculateCrimeWorkStats(crime);\n },\n classGains: (ctx) => (_person, _classType, _locationName) => {\n const person = helpers.player(ctx, _person);\n const classType = helpers.string(ctx, \"classType\", _classType);\n const locationName = helpers.string(ctx, \"locationName\", _locationName);\n return calculateClassEarnings(person, classType as ClassType, locationName as LocationName);\n },\n factionGains: (ctx) => (_player, _workType, _favor) => {\n const player = helpers.player(ctx, _player);\n const workType = helpers.string(ctx, \"_workType\", _workType) as FactionWorkType;\n const favor = helpers.number(ctx, \"favor\", _favor);\n const exp = calculateFactionExp(player, workType);\n const rep = calculateFactionRep(player, workType, favor);\n exp.reputation = rep;\n return exp;\n },\n // companyGains: (ctx) => (_player) {\n // const player = helpers.player(ctx, _player);\n\n // },\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { buyStock, sellStock, shortStock, sellShort } from \"../StockMarket/BuyingAndSelling\";\nimport { StockMarket, SymbolToStockMap, placeOrder, cancelOrder, initStockMarketFn } from \"../StockMarket/StockMarket\";\nimport { getBuyTransactionCost, getSellTransactionGain } from \"../StockMarket/StockMarketHelpers\";\nimport { OrderTypes } from \"../StockMarket/data/OrderTypes\";\nimport { PositionTypes } from \"../StockMarket/data/PositionTypes\";\nimport { StockSymbols } from \"../StockMarket/data/StockSymbols\";\nimport {\n getStockMarket4SDataCost,\n getStockMarket4STixApiCost,\n getStockMarketWseCost,\n getStockMarketTixApiCost,\n} from \"../StockMarket/StockMarketCosts\";\nimport { Stock } from \"../StockMarket/Stock\";\nimport { StockOrder, TIX } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptStockMarket(): InternalAPI<TIX> {\n /** Checks if the player has TIX API access. Throws an error if the player does not */\n const checkTixApiAccess = function (ctx: NetscriptContext): void {\n if (!player.hasWseAccount) {\n throw helpers.makeRuntimeErrorMsg(ctx, `You don't have WSE Access! Cannot use ${ctx.function}()`);\n }\n if (!player.hasTixApiAccess) {\n throw helpers.makeRuntimeErrorMsg(ctx, `You don't have TIX API Access! Cannot use ${ctx.function}()`);\n }\n };\n\n const getStockFromSymbol = function (ctx: NetscriptContext, symbol: string): Stock {\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid stock symbol: '${symbol}'`);\n }\n\n return stock;\n };\n\n return {\n hasWSEAccount: () => () => {\n return player.hasWseAccount;\n },\n hasTIXAPIAccess: () => () => {\n return player.hasTixApiAccess;\n },\n has4SData: () => () => {\n return player.has4SData;\n },\n has4SDataTIXAPI: () => () => {\n return player.has4SDataTixApi;\n },\n getSymbols: (ctx) => () => {\n checkTixApiAccess(ctx);\n return Object.values(StockSymbols);\n },\n getPrice: (ctx) => (_symbol) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.price;\n },\n getAskPrice: (ctx) => (_symbol) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.getAskPrice();\n },\n getBidPrice: (ctx) => (_symbol) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.getBidPrice();\n },\n getPosition: (ctx) => (_symbol) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid stock symbol: ${symbol}`);\n }\n return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];\n },\n getMaxShares: (ctx) => (_symbol) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.maxShares;\n },\n getPurchaseCost: (ctx) => (_symbol, _shares, _posType) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n let shares = helpers.number(ctx, \"shares\", _shares);\n const posType = helpers.string(ctx, \"posType\", _posType);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n shares = Math.round(shares);\n\n let pos;\n const sanitizedPosType = posType.toLowerCase();\n if (sanitizedPosType.includes(\"l\")) {\n pos = PositionTypes.Long;\n } else if (sanitizedPosType.includes(\"s\")) {\n pos = PositionTypes.Short;\n } else {\n return Infinity;\n }\n\n const res = getBuyTransactionCost(stock, shares, pos);\n if (res == null) {\n return Infinity;\n }\n\n return res;\n },\n getSaleGain: (ctx) => (_symbol, _shares, _posType) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n let shares = helpers.number(ctx, \"shares\", _shares);\n const posType = helpers.string(ctx, \"posType\", _posType);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n shares = Math.round(shares);\n\n let pos;\n const sanitizedPosType = posType.toLowerCase();\n if (sanitizedPosType.includes(\"l\")) {\n pos = PositionTypes.Long;\n } else if (sanitizedPosType.includes(\"s\")) {\n pos = PositionTypes.Short;\n } else {\n return 0;\n }\n\n const res = getSellTransactionGain(stock, shares, pos);\n if (res == null) {\n return 0;\n }\n\n return res;\n },\n buyStock: (ctx) => (_symbol, _shares) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = buyStock(stock, shares, ctx, {});\n return res ? stock.getAskPrice() : 0;\n },\n sellStock: (ctx) => (_symbol, _shares) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellStock(stock, shares, ctx, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n buyShort: (ctx) => (_symbol, _shares) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = shortStock(stock, shares, ctx, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n sellShort: (ctx) => (_symbol, _shares) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellShort(stock, shares, ctx, {});\n\n return res ? stock.getAskPrice() : 0;\n },\n placeOrder: (ctx) => (_symbol, _shares, _price, _type, _pos) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n const price = helpers.number(ctx, \"price\", _price);\n const type = helpers.string(ctx, \"type\", _type);\n const pos = helpers.string(ctx, \"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n\n let orderType;\n let orderPos;\n const ltype = type.toLowerCase();\n if (ltype.includes(\"limit\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.LimitBuy;\n } else if (ltype.includes(\"limit\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.LimitSell;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.StopBuy;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.StopSell;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid order type: ${type}`);\n }\n\n const lpos = pos.toLowerCase();\n if (lpos.includes(\"l\")) {\n orderPos = PositionTypes.Long;\n } else if (lpos.includes(\"s\")) {\n orderPos = PositionTypes.Short;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid position type: ${pos}`);\n }\n\n return placeOrder(stock, shares, price, orderType, orderPos, ctx);\n },\n cancelOrder: (ctx) => (_symbol, _shares, _price, _type, _pos) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n const price = helpers.number(ctx, \"price\", _price);\n const type = helpers.string(ctx, \"type\", _type);\n const pos = helpers.string(ctx, \"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n if (isNaN(shares) || isNaN(price)) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Invalid shares or price. Must be numeric. shares=${shares}, price=${price}`,\n );\n }\n let orderType;\n let orderPos;\n const ltype = type.toLowerCase();\n if (ltype.includes(\"limit\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.LimitBuy;\n } else if (ltype.includes(\"limit\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.LimitSell;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.StopBuy;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.StopSell;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid order type: ${type}`);\n }\n\n const lpos = pos.toLowerCase();\n if (lpos.includes(\"l\")) {\n orderPos = PositionTypes.Long;\n } else if (lpos.includes(\"s\")) {\n orderPos = PositionTypes.Short;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid position type: ${pos}`);\n }\n const params = {\n stock: stock,\n shares: shares,\n price: price,\n type: orderType,\n pos: orderPos,\n };\n return cancelOrder(params, ctx);\n },\n getOrders: (ctx) => () => {\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must either be in BitNode-8 or have Source-File 8 Level 3.\");\n }\n }\n\n const orders: StockOrder = {};\n\n const stockMarketOrders = StockMarket[\"Orders\"];\n for (const symbol of Object.keys(stockMarketOrders)) {\n const orderBook = stockMarketOrders[symbol];\n if (orderBook.constructor === Array && orderBook.length > 0) {\n orders[symbol] = [];\n for (let i = 0; i < orderBook.length; ++i) {\n orders[symbol].push({\n shares: orderBook[i].shares,\n price: orderBook[i].price,\n type: orderBook[i].type,\n position: orderBook[i].pos,\n });\n }\n }\n }\n\n return orders;\n },\n getVolatility: (ctx) => (_symbol) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.mv / 100; // Convert from percentage to decimal\n },\n getForecast: (ctx) => (_symbol) => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(ctx, symbol);\n\n let forecast = 50;\n stock.b ? (forecast += stock.otlkMag) : (forecast -= stock.otlkMag);\n return forecast / 100; // Convert from percentage to decimal\n },\n purchase4SMarketData: (ctx) => () => {\n if (player.has4SData) {\n helpers.log(ctx, () => \"Already purchased 4S Market Data.\");\n return true;\n }\n\n if (player.money < getStockMarket4SDataCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase 4S Market Data.\");\n return false;\n }\n\n player.has4SData = true;\n player.loseMoney(getStockMarket4SDataCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased 4S Market Data\");\n return true;\n },\n purchase4SMarketDataTixApi: (ctx) => () => {\n checkTixApiAccess(ctx);\n\n if (player.has4SDataTixApi) {\n helpers.log(ctx, () => \"Already purchased 4S Market Data TIX API\");\n return true;\n }\n\n if (player.money < getStockMarket4STixApiCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase 4S Market Data TIX API\");\n return false;\n }\n\n player.has4SDataTixApi = true;\n player.loseMoney(getStockMarket4STixApiCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased 4S Market Data TIX API\");\n return true;\n },\n purchaseWseAccount: (ctx) => () => {\n if (player.hasWseAccount) {\n helpers.log(ctx, () => \"Already purchased WSE Account\");\n return true;\n }\n\n if (player.money < getStockMarketWseCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase WSE Account Access\");\n return false;\n }\n\n player.hasWseAccount = true;\n initStockMarketFn();\n player.loseMoney(getStockMarketWseCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased WSE Account Access\");\n return true;\n },\n purchaseTixApi: (ctx) => () => {\n if (player.hasTixApiAccess) {\n helpers.log(ctx, () => \"Already purchased TIX API\");\n return true;\n }\n\n if (player.money < getStockMarketTixApiCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase TIX API Access\");\n return false;\n }\n\n player.hasTixApiAccess = true;\n player.loseMoney(getStockMarketTixApiCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased TIX API\");\n return true;\n },\n };\n}\n","import { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { hasAugmentationPrereqs } from \"../Faction/FactionHelpers\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { GraftableAugmentation } from \"../PersonObjects/Grafting/GraftableAugmentation\";\nimport { getGraftingAvailableAugs, calculateGraftingTimeWithBonus } from \"../PersonObjects/Grafting/GraftingHelpers\";\nimport { Player as player } from \"../Player\";\nimport { Grafting as IGrafting } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Router } from \"../ui/GameRoot\";\nimport { GraftingWork } from \"../Work/GraftingWork\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptGrafting(): InternalAPI<IGrafting> {\n const checkGraftingAPIAccess = (ctx: NetscriptContext): void => {\n if (!player.canAccessGrafting()) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You do not currently have access to the Grafting API. This is either because you are not in BitNode 10 or because you do not have Source-File 10\",\n );\n }\n };\n\n return {\n getAugmentationGraftPrice: (ctx) => (_augName) => {\n const augName = helpers.string(ctx, \"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs().includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid aug: ${augName}`);\n }\n const graftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n return graftableAug.cost;\n },\n\n getAugmentationGraftTime: (ctx) => (_augName) => {\n const augName = helpers.string(ctx, \"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs().includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid aug: ${augName}`);\n }\n const graftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n return calculateGraftingTimeWithBonus(graftableAug);\n },\n\n getGraftableAugmentations: (ctx) => () => {\n checkGraftingAPIAccess(ctx);\n const graftableAugs = getGraftingAvailableAugs();\n return graftableAugs;\n },\n\n graftAugmentation:\n (ctx) =>\n (_augName, _focus = true) => {\n const augName = helpers.string(ctx, \"augName\", _augName);\n const focus = !!_focus;\n checkGraftingAPIAccess(ctx);\n if (player.city !== CityName.NewTokyo) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must be in New Tokyo to begin grafting an Augmentation.\");\n }\n if (!getGraftingAvailableAugs().includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n helpers.log(ctx, () => `Invalid aug: ${augName}`);\n return false;\n }\n\n const wasFocusing = player.focus;\n\n const craftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n if (player.money < craftableAug.cost) {\n helpers.log(ctx, () => `You don't have enough money to craft ${augName}`);\n return false;\n }\n\n if (!hasAugmentationPrereqs(craftableAug.augmentation)) {\n helpers.log(ctx, () => `You don't have the pre-requisites for ${augName}`);\n return false;\n }\n\n player.startWork(\n new GraftingWork({\n singularity: true,\n augmentation: augName,\n }),\n );\n\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n\n helpers.log(ctx, () => `Began grafting Augmentation ${augName}.`);\n return true;\n },\n };\n}\n","import { Player } from \"@player\";\nimport { purchaseAugmentation, joinFaction, getFactionAugmentationsFiltered } from \"../Faction/FactionHelpers\";\nimport { startWorkerScript } from \"../NetscriptWorker\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { augmentationExists, installAugmentations } from \"../Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { killWorkerScript } from \"../Netscript/killWorkerScript\";\nimport { CONSTANTS } from \"../Constants\";\nimport { isString } from \"../utils/helpers/isString\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { calculateAchievements } from \"../Achievements/Achievements\";\n\nimport { Singularity as ISingularity } from \"../ScriptEditor/NetscriptDefinitions\";\n\nimport { findCrime } from \"../Crime/CrimeHelpers\";\nimport { CompanyPositions } from \"../Company/CompanyPositions\";\nimport { DarkWebItems } from \"../DarkWeb/DarkWebItems\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { Router } from \"../ui/GameRoot\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Page } from \"../ui/Router\";\nimport { Locations } from \"../Locations/Locations\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { Programs } from \"../Programs/Programs\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Company } from \"../Company/Company\";\nimport { Companies } from \"../Company/Companies\";\nimport { Factions, factionExists } from \"../Faction/Factions\";\nimport { Faction } from \"../Faction/Faction\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { getServerOnNetwork } from \"../Server/ServerHelpers\";\nimport { Terminal } from \"../Terminal\";\nimport { calculateHackingTime } from \"../Hacking\";\nimport { Server } from \"../Server/Server\";\nimport { netscriptCanHack } from \"../Hacking/netscriptCanHack\";\nimport { FactionInfos } from \"../Faction/FactionInfo\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\nimport { BlackOperationNames } from \"../Bladeburner/data/BlackOperationNames\";\nimport { enterBitNode } from \"../RedPill\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { ClassWork, ClassType } from \"../Work/ClassWork\";\nimport { CreateProgramWork, isCreateProgramWork } from \"../Work/CreateProgramWork\";\nimport { FactionWork } from \"../Work/FactionWork\";\nimport { FactionWorkType } from \"../Work/data/FactionWorkType\";\nimport { CompanyWork } from \"../Work/CompanyWork\";\nimport { canGetBonus, onExport } from \"../ExportBonus\";\nimport { saveObject } from \"../SaveObject\";\nimport { calculateCrimeWorkStats } from \"../Work/formulas/Crime\";\n\nexport function NetscriptSingularity(): InternalAPI<ISingularity> {\n const getAugmentation = function (ctx: NetscriptContext, name: string): Augmentation {\n if (!augmentationExists(name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid augmentation: '${name}'`);\n }\n\n return StaticAugmentations[name];\n };\n\n const getFaction = function (ctx: NetscriptContext, name: string): Faction {\n if (!factionExists(name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid faction name: '${name}`);\n }\n\n return Factions[name];\n };\n\n const getCompany = function (ctx: NetscriptContext, name: string): Company {\n const company = Companies[name];\n if (!company) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid company name: '${name}'`);\n return company;\n };\n\n const runAfterReset = function (cbScript: string | null = null) {\n //Run a script after reset\n if (!cbScript) return;\n const home = Player.getHomeComputer();\n for (const script of home.scripts) {\n if (script.filename === cbScript) {\n const ramUsage = script.ramUsage;\n const ramAvailable = home.maxRam - home.ramUsed;\n if (ramUsage > ramAvailable + 0.001) {\n return; // Not enough RAM\n }\n const runningScriptObj = new RunningScript(script, []); // No args\n runningScriptObj.threads = 1; // Only 1 thread\n startWorkerScript(runningScriptObj, home);\n }\n }\n };\n\n return {\n getOwnedAugmentations: (ctx) => (_purchased) => {\n helpers.checkSingularityAccess(ctx);\n const purchased = !!_purchased;\n const res: string[] = [];\n for (let i = 0; i < Player.augmentations.length; ++i) {\n res.push(Player.augmentations[i].name);\n }\n if (purchased) {\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n res.push(Player.queuedAugmentations[i].name);\n }\n }\n return res;\n },\n getOwnedSourceFiles: () => () => {\n return Player.sourceFiles.map((sf) => {\n return { n: sf.n, lvl: sf.lvl };\n });\n },\n getAugmentationsFromFaction: (ctx) => (_facName) => {\n helpers.checkSingularityAccess(ctx);\n const facName = helpers.string(ctx, \"facName\", _facName);\n const faction = getFaction(ctx, facName);\n\n return getFactionAugmentationsFiltered(faction);\n },\n getAugmentationCost: (ctx) => (_augName) => {\n helpers.checkSingularityAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug = getAugmentation(ctx, augName);\n const costs = aug.getCost();\n return [costs.repCost, costs.moneyCost];\n },\n getAugmentationPrereq: (ctx) => (_augName) => {\n helpers.checkSingularityAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug = getAugmentation(ctx, augName);\n return aug.prereqs.slice();\n },\n getAugmentationBasePrice: (ctx) => (_augName) => {\n helpers.checkSingularityAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug = getAugmentation(ctx, augName);\n return aug.baseCost * BitNodeMultipliers.AugmentationMoneyCost;\n },\n getAugmentationPrice: (ctx) => (_augName) => {\n helpers.checkSingularityAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug = getAugmentation(ctx, augName);\n return aug.getCost().moneyCost;\n },\n getAugmentationRepReq: (ctx) => (_augName) => {\n helpers.checkSingularityAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug = getAugmentation(ctx, augName);\n return aug.getCost().repCost;\n },\n getAugmentationStats: (ctx) => (_augName) => {\n helpers.checkSingularityAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug = getAugmentation(ctx, augName);\n return Object.assign({}, aug.mults);\n },\n purchaseAugmentation: (ctx) => (_facName, _augName) => {\n helpers.checkSingularityAccess(ctx);\n const facName = helpers.string(ctx, \"facName\", _facName);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const fac = getFaction(ctx, facName);\n const aug = getAugmentation(ctx, augName);\n\n const augs = getFactionAugmentationsFiltered(fac);\n\n if (!Player.factions.includes(fac.name)) {\n helpers.log(ctx, () => `You can't purchase augmentations from '${facName}' because you aren't a member`);\n return false;\n }\n\n if (!augs.includes(augName)) {\n helpers.log(ctx, () => `Faction '${facName}' does not have the '${augName}' augmentation.`);\n return false;\n }\n\n const isNeuroflux = aug.name === AugmentationNames.NeuroFluxGovernor;\n if (!isNeuroflux) {\n for (let j = 0; j < Player.queuedAugmentations.length; ++j) {\n if (Player.queuedAugmentations[j].name === aug.name) {\n helpers.log(ctx, () => `You already have the '${augName}' augmentation.`);\n return false;\n }\n }\n for (let j = 0; j < Player.augmentations.length; ++j) {\n if (Player.augmentations[j].name === aug.name) {\n helpers.log(ctx, () => `You already have the '${augName}' augmentation.`);\n return false;\n }\n }\n }\n\n if (fac.playerReputation < aug.getCost().repCost) {\n helpers.log(ctx, () => `You do not have enough reputation with '${fac.name}'.`);\n return false;\n }\n\n const res = purchaseAugmentation(aug, fac, true);\n helpers.log(ctx, () => res);\n if (isString(res) && res.startsWith(\"You purchased\")) {\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 10);\n return true;\n } else {\n return false;\n }\n },\n softReset: (ctx) => (_cbScript) => {\n helpers.checkSingularityAccess(ctx);\n const cbScript = _cbScript ? helpers.string(ctx, \"cbScript\", _cbScript) : \"\";\n\n helpers.log(ctx, () => \"Soft resetting. This will cause this script to be killed\");\n setTimeout(() => {\n installAugmentations(true);\n runAfterReset(cbScript);\n }, 0);\n\n killWorkerScript(ctx.workerScript);\n },\n installAugmentations: (ctx) => (_cbScript) => {\n helpers.checkSingularityAccess(ctx);\n const cbScript = _cbScript ? helpers.string(ctx, \"cbScript\", _cbScript) : \"\";\n\n if (Player.queuedAugmentations.length === 0) {\n helpers.log(ctx, () => \"You do not have any Augmentations to be installed.\");\n return false;\n }\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 10);\n helpers.log(ctx, () => \"Installing Augmentations. This will cause this script to be killed\");\n setTimeout(() => {\n installAugmentations();\n runAfterReset(cbScript);\n }, 0);\n\n killWorkerScript(ctx.workerScript);\n return true;\n },\n\n goToLocation: (ctx) => (_locationName) => {\n helpers.checkSingularityAccess(ctx);\n const locationName = helpers.string(ctx, \"locationName\", _locationName);\n const location = Object.values(Locations).find((l) => l.name === locationName);\n if (!location) {\n helpers.log(ctx, () => `No location named ${locationName}`);\n return false;\n }\n if (location.city && Player.city !== location.city) {\n helpers.log(ctx, () => `No location named ${locationName} in ${Player.city}`);\n return false;\n }\n if (location.name === LocationName.TravelAgency) {\n Router.toTravel();\n } else if (location.name === LocationName.WorldStockExchange) {\n Router.toStockMarket();\n } else {\n Router.toLocation(location);\n }\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 50000);\n return true;\n },\n universityCourse:\n (ctx) =>\n (_universityName, _className, _focus = true) => {\n helpers.checkSingularityAccess(ctx);\n const universityName = helpers.string(ctx, \"universityName\", _universityName);\n const className = helpers.string(ctx, \"className\", _className);\n const focus = !!_focus;\n const wasFocusing = Player.focus;\n\n switch (universityName.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase():\n if (Player.city != CityName.Aevum) {\n helpers.log(\n ctx,\n () => `You cannot study at 'Summit University' because you are not in '${CityName.Aevum}'.`,\n );\n return false;\n }\n Player.gotoLocation(LocationName.AevumSummitUniversity);\n break;\n case LocationName.Sector12RothmanUniversity.toLowerCase():\n if (Player.city != CityName.Sector12) {\n helpers.log(\n ctx,\n () => `You cannot study at 'Rothman University' because you are not in '${CityName.Sector12}'.`,\n );\n return false;\n }\n Player.location = LocationName.Sector12RothmanUniversity;\n break;\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():\n if (Player.city != CityName.Volhaven) {\n helpers.log(\n ctx,\n () => `You cannot study at 'ZB Institute of Technology' because you are not in '${CityName.Volhaven}'.`,\n );\n return false;\n }\n Player.location = LocationName.VolhavenZBInstituteOfTechnology;\n break;\n default:\n helpers.log(ctx, () => `Invalid university name: '${universityName}'.`);\n return false;\n }\n\n let task: ClassType;\n switch (className.toLowerCase()) {\n case \"Study Computer Science\".toLowerCase():\n task = ClassType.StudyComputerScience;\n break;\n case \"Data Structures\".toLowerCase():\n task = ClassType.DataStructures;\n break;\n case \"Networks\".toLowerCase():\n task = ClassType.Networks;\n break;\n case \"Algorithms\".toLowerCase():\n task = ClassType.Algorithms;\n break;\n case \"Management\".toLowerCase():\n task = ClassType.Management;\n break;\n case \"Leadership\".toLowerCase():\n task = ClassType.Leadership;\n break;\n default:\n helpers.log(ctx, () => `Invalid class name: ${className}.`);\n return false;\n }\n Player.startWork(\n new ClassWork({\n classType: task,\n location: Player.location,\n singularity: true,\n }),\n );\n if (focus) {\n Player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n Player.stopFocusing();\n Router.toTerminal();\n }\n helpers.log(ctx, () => `Started ${task} at ${universityName}`);\n return true;\n },\n\n gymWorkout:\n (ctx) =>\n (_gymName, _stat, _focus = true) => {\n helpers.checkSingularityAccess(ctx);\n const gymName = helpers.string(ctx, \"gymName\", _gymName);\n const stat = helpers.string(ctx, \"stat\", _stat);\n const focus = !!_focus;\n const wasFocusing = Player.focus;\n\n switch (gymName.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase():\n if (Player.city != CityName.Aevum) {\n helpers.log(\n ctx,\n () =>\n `You cannot workout at '${LocationName.AevumCrushFitnessGym}' because you are not in '${CityName.Aevum}'.`,\n );\n return false;\n }\n Player.location = LocationName.AevumCrushFitnessGym;\n break;\n case LocationName.AevumSnapFitnessGym.toLowerCase():\n if (Player.city != CityName.Aevum) {\n helpers.log(\n ctx,\n () =>\n `You cannot workout at '${LocationName.AevumSnapFitnessGym}' because you are not in '${CityName.Aevum}'.`,\n );\n return false;\n }\n Player.location = LocationName.AevumSnapFitnessGym;\n break;\n case LocationName.Sector12IronGym.toLowerCase():\n if (Player.city != CityName.Sector12) {\n helpers.log(\n ctx,\n () =>\n `You cannot workout at '${LocationName.Sector12IronGym}' because you are not in '${CityName.Sector12}'.`,\n );\n return false;\n }\n Player.location = LocationName.Sector12IronGym;\n break;\n case LocationName.Sector12PowerhouseGym.toLowerCase():\n if (Player.city != CityName.Sector12) {\n helpers.log(\n ctx,\n () =>\n `You cannot workout at '${LocationName.Sector12PowerhouseGym}' because you are not in '${CityName.Sector12}'.`,\n );\n return false;\n }\n Player.location = LocationName.Sector12PowerhouseGym;\n break;\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase():\n if (Player.city != CityName.Volhaven) {\n helpers.log(\n ctx,\n () =>\n `You cannot workout at '${LocationName.VolhavenMilleniumFitnessGym}' because you are not in '${CityName.Volhaven}'.`,\n );\n return false;\n }\n Player.location = LocationName.VolhavenMilleniumFitnessGym;\n break;\n default:\n helpers.log(ctx, () => `Invalid gym name: ${gymName}. gymWorkout() failed`);\n return false;\n }\n\n switch (stat.toLowerCase()) {\n case \"strength\".toLowerCase():\n case \"str\".toLowerCase():\n Player.startWork(\n new ClassWork({ classType: ClassType.GymStrength, location: Player.location, singularity: true }),\n );\n break;\n case \"defense\".toLowerCase():\n case \"def\".toLowerCase():\n Player.startWork(\n new ClassWork({ classType: ClassType.GymDefense, location: Player.location, singularity: true }),\n );\n break;\n case \"dexterity\".toLowerCase():\n case \"dex\".toLowerCase():\n Player.startWork(\n new ClassWork({ classType: ClassType.GymDexterity, location: Player.location, singularity: true }),\n );\n break;\n case \"agility\".toLowerCase():\n case \"agi\".toLowerCase():\n Player.startWork(\n new ClassWork({ classType: ClassType.GymAgility, location: Player.location, singularity: true }),\n );\n break;\n default:\n helpers.log(ctx, () => `Invalid stat: ${stat}.`);\n return false;\n }\n if (focus) {\n Player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n Player.stopFocusing();\n Router.toTerminal();\n }\n helpers.log(ctx, () => `Started training ${stat} at ${gymName}`);\n return true;\n },\n\n travelToCity: (ctx) => (_cityName) => {\n helpers.checkSingularityAccess(ctx);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n\n switch (cityName) {\n case CityName.Aevum:\n case CityName.Chongqing:\n case CityName.Sector12:\n case CityName.NewTokyo:\n case CityName.Ishima:\n case CityName.Volhaven:\n if (Player.money < CONSTANTS.TravelCost) {\n helpers.log(ctx, () => \"Not enough money to travel.\");\n return false;\n }\n Player.loseMoney(CONSTANTS.TravelCost, \"other\");\n Player.city = cityName;\n helpers.log(ctx, () => `Traveled to ${cityName}`);\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 50000);\n return true;\n default:\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid city name: '${cityName}'.`);\n }\n },\n\n purchaseTor: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n\n if (Player.hasTorRouter()) {\n helpers.log(ctx, () => \"You already have a TOR router!\");\n return true;\n }\n\n if (Player.money < CONSTANTS.TorRouterCost) {\n helpers.log(ctx, () => \"You cannot afford to purchase a Tor router.\");\n return false;\n }\n Player.loseMoney(CONSTANTS.TorRouterCost, \"other\");\n\n const darkweb = GetServer(SpecialServers.DarkWeb);\n if (!darkweb) throw helpers.makeRuntimeErrorMsg(ctx, \"DarkWeb was not a server but should have been\");\n\n Player.getHomeComputer().serversOnNetwork.push(darkweb.hostname);\n darkweb.serversOnNetwork.push(Player.getHomeComputer().hostname);\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 500);\n helpers.log(ctx, () => \"You have purchased a Tor router!\");\n return true;\n },\n purchaseProgram: (ctx) => (_programName) => {\n helpers.checkSingularityAccess(ctx);\n const programName = helpers.string(ctx, \"programName\", _programName).toLowerCase();\n\n if (!Player.hasTorRouter()) {\n helpers.log(ctx, () => \"You do not have the TOR router.\");\n return false;\n }\n\n const item = Object.values(DarkWebItems).find((i) => i.program.toLowerCase() === programName);\n if (item == null) {\n helpers.log(ctx, () => `Invalid program name: '${programName}.`);\n return false;\n }\n\n if (Player.money < item.price) {\n helpers.log(\n ctx,\n () => `Not enough money to purchase '${item.program}'. Need ${numeralWrapper.formatMoney(item.price)}`,\n );\n return false;\n }\n\n if (Player.hasProgram(item.program)) {\n helpers.log(ctx, () => `You already have the '${item.program}' program`);\n return true;\n }\n\n Player.getHomeComputer().pushProgram(item.program);\n // Cancel if the program is in progress of writing\n if (isCreateProgramWork(Player.currentWork) && Player.currentWork.programName === item.program) {\n Player.finishWork(true);\n }\n\n Player.loseMoney(item.price, \"other\");\n helpers.log(\n ctx,\n () => `You have purchased the '${item.program}' program. The new program can be found on your home computer.`,\n );\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 5000);\n return true;\n },\n getCurrentServer: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n return Player.getCurrentServer().hostname;\n },\n connect: (ctx) => (_hostname) => {\n helpers.checkSingularityAccess(ctx);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (!hostname) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid hostname: '${hostname}'`);\n }\n\n const target = GetServer(hostname);\n if (target == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid hostname: '${hostname}'`);\n }\n\n //Home case\n if (hostname === \"home\") {\n Player.getCurrentServer().isConnectedTo = false;\n Player.currentServer = Player.getHomeComputer().hostname;\n Player.getCurrentServer().isConnectedTo = true;\n Terminal.setcwd(\"/\");\n return true;\n }\n\n //Adjacent server case\n const server = Player.getCurrentServer();\n for (let i = 0; i < server.serversOnNetwork.length; i++) {\n const other = getServerOnNetwork(server, i);\n if (other === null) continue;\n if (other.hostname == hostname) {\n Player.getCurrentServer().isConnectedTo = false;\n Player.currentServer = target.hostname;\n Player.getCurrentServer().isConnectedTo = true;\n Terminal.setcwd(\"/\");\n return true;\n }\n }\n\n //Backdoor case\n const other = GetServer(hostname);\n if (other !== null && other instanceof Server && other.backdoorInstalled) {\n Player.getCurrentServer().isConnectedTo = false;\n Player.currentServer = target.hostname;\n Player.getCurrentServer().isConnectedTo = true;\n Terminal.setcwd(\"/\");\n return true;\n }\n\n //Failure case\n return false;\n },\n manualHack: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n const server = Player.getCurrentServer();\n return helpers.hack(ctx, server.hostname, true);\n },\n installBackdoor: (ctx) => async (): Promise<void> => {\n helpers.checkSingularityAccess(ctx);\n const baseserver = Player.getCurrentServer();\n if (!(baseserver instanceof Server)) {\n helpers.log(ctx, () => \"cannot backdoor this kind of server\");\n return Promise.resolve();\n }\n const server = baseserver;\n const installTime = (calculateHackingTime(server, Player) / 4) * 1000;\n\n // No root access or skill level too low\n const canHack = netscriptCanHack(server);\n if (!canHack.res) {\n throw helpers.makeRuntimeErrorMsg(ctx, canHack.msg || \"\");\n }\n\n helpers.log(\n ctx,\n () => `Installing backdoor on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(installTime, true)}`,\n );\n\n return helpers.netscriptDelay(ctx, installTime).then(function () {\n helpers.log(ctx, () => `Successfully installed backdoor on '${server.hostname}'`);\n\n server.backdoorInstalled = true;\n\n if (SpecialServers.WorldDaemon === server.hostname) {\n Router.toBitVerse(false, false);\n }\n return Promise.resolve();\n });\n },\n isFocused: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n return Player.focus;\n },\n setFocus: (ctx) => (_focus) => {\n helpers.checkSingularityAccess(ctx);\n const focus = !!_focus;\n if (Player.currentWork === null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Not currently working\");\n }\n\n if (!Player.focus && focus) {\n Player.startFocusing();\n Router.toWork();\n return true;\n } else if (Player.focus && !focus) {\n Player.stopFocusing();\n Router.toTerminal();\n return true;\n }\n return false;\n },\n hospitalize: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n if (Player.currentWork || Router.page() === Page.Infiltration || Router.page() === Page.BitVerse) {\n helpers.log(ctx, () => \"Cannot go to the hospital because the player is busy.\");\n return;\n }\n Player.hospitalize();\n },\n isBusy: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n return Player.currentWork !== null || Router.page() === Page.Infiltration || Router.page() === Page.BitVerse;\n },\n stopAction: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n const wasWorking = Player.currentWork !== null;\n Player.finishWork(true);\n return wasWorking;\n },\n upgradeHomeCores: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n\n // Check if we're at max cores\n const homeComputer = Player.getHomeComputer();\n if (homeComputer.cpuCores >= 8) {\n helpers.log(ctx, () => `Your home computer is at max cores.`);\n return false;\n }\n\n const cost = Player.getUpgradeHomeCoresCost();\n if (Player.money < cost) {\n helpers.log(ctx, () => `You don't have enough money. Need ${numeralWrapper.formatMoney(cost)}`);\n return false;\n }\n\n homeComputer.cpuCores += 1;\n Player.loseMoney(cost, \"servers\");\n\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 2);\n helpers.log(\n ctx,\n () => `Purchased an additional core for home computer! It now has ${homeComputer.cpuCores} cores.`,\n );\n return true;\n },\n getUpgradeHomeCoresCost: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n\n return Player.getUpgradeHomeCoresCost();\n },\n upgradeHomeRam: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n\n // Check if we're at max RAM\n const homeComputer = Player.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n helpers.log(ctx, () => `Your home computer is at max RAM.`);\n return false;\n }\n\n const cost = Player.getUpgradeHomeRamCost();\n if (Player.money < cost) {\n helpers.log(ctx, () => `You don't have enough money. Need ${numeralWrapper.formatMoney(cost)}`);\n return false;\n }\n\n homeComputer.maxRam *= 2;\n Player.loseMoney(cost, \"servers\");\n\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 2);\n helpers.log(\n ctx,\n () =>\n `Purchased additional RAM for home computer! It now has ${numeralWrapper.formatRAM(\n homeComputer.maxRam,\n )} of RAM.`,\n );\n return true;\n },\n getUpgradeHomeRamCost: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n\n return Player.getUpgradeHomeRamCost();\n },\n workForCompany:\n (ctx) =>\n (_companyName, _focus = true) => {\n helpers.checkSingularityAccess(ctx);\n const companyName = helpers.string(ctx, \"companyName\", _companyName);\n const focus = !!_focus;\n\n // Make sure its a valid company\n if (companyName == null || companyName === \"\" || !Companies[companyName]) {\n helpers.log(ctx, () => `Invalid company: '${companyName}'`);\n return false;\n }\n\n // Make sure player is actually employed at the company\n if (!Object.keys(Player.jobs).includes(companyName)) {\n helpers.log(ctx, () => `You do not have a job at '${companyName}'`);\n return false;\n }\n\n // Check to make sure company position data is valid\n const companyPositionName = Player.jobs[companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (companyPositionName === \"\" || !companyPosition) {\n helpers.log(ctx, () => \"You do not have a job\");\n return false;\n }\n\n const wasFocused = Player.focus;\n\n Player.startWork(\n new CompanyWork({\n singularity: true,\n companyName: companyName,\n }),\n );\n if (focus) {\n Player.startFocusing();\n Router.toWork();\n } else if (wasFocused) {\n Player.stopFocusing();\n Router.toTerminal();\n }\n helpers.log(ctx, () => `Began working at '${companyName}' with position '${companyPositionName}'`);\n return true;\n },\n applyToCompany: (ctx) => (_companyName, _field) => {\n helpers.checkSingularityAccess(ctx);\n const companyName = helpers.string(ctx, \"companyName\", _companyName);\n const field = helpers.string(ctx, \"field\", _field);\n getCompany(ctx, companyName);\n\n Player.location = companyName as LocationName;\n let res;\n switch (field.toLowerCase()) {\n case \"software\":\n res = Player.applyForSoftwareJob(true);\n break;\n case \"software consultant\":\n res = Player.applyForSoftwareConsultantJob(true);\n break;\n case \"it\":\n res = Player.applyForItJob(true);\n break;\n case \"security engineer\":\n res = Player.applyForSecurityEngineerJob(true);\n break;\n case \"network engineer\":\n res = Player.applyForNetworkEngineerJob(true);\n break;\n case \"business\":\n res = Player.applyForBusinessJob(true);\n break;\n case \"business consultant\":\n res = Player.applyForBusinessConsultantJob(true);\n break;\n case \"security\":\n res = Player.applyForSecurityJob(true);\n break;\n case \"agent\":\n res = Player.applyForAgentJob(true);\n break;\n case \"employee\":\n res = Player.applyForEmployeeJob(true);\n break;\n case \"part-time employee\":\n res = Player.applyForPartTimeEmployeeJob(true);\n break;\n case \"waiter\":\n res = Player.applyForWaiterJob(true);\n break;\n case \"part-time waiter\":\n res = Player.applyForPartTimeWaiterJob(true);\n break;\n default:\n helpers.log(ctx, () => `Invalid job: '${field}'.`);\n return false;\n }\n // TODO https://github.com/danielyxie/bitburner/issues/1378\n // The player object's applyForJob function can return string with special error messages\n // if (isString(res)) {\n // helpers.log(ctx,\"applyToCompany\",()=> res);\n // return false;\n // }\n if (res) {\n helpers.log(\n ctx,\n () => `You were offered a new job at '${companyName}' with position '${Player.jobs[companyName]}'`,\n );\n } else {\n helpers.log(ctx, () => `You failed to get a new job/promotion at '${companyName}' in the '${field}' field.`);\n }\n return res;\n },\n quitJob: (ctx) => (_companyName) => {\n helpers.checkSingularityAccess(ctx);\n const companyName = helpers.string(ctx, \"companyName\", _companyName);\n Player.quitJob(companyName);\n },\n getCompanyRep: (ctx) => (_companyName) => {\n helpers.checkSingularityAccess(ctx);\n const companyName = helpers.string(ctx, \"companyName\", _companyName);\n const company = getCompany(ctx, companyName);\n return company.playerReputation;\n },\n getCompanyFavor: (ctx) => (_companyName) => {\n helpers.checkSingularityAccess(ctx);\n const companyName = helpers.string(ctx, \"companyName\", _companyName);\n const company = getCompany(ctx, companyName);\n return company.favor;\n },\n getCompanyFavorGain: (ctx) => (_companyName) => {\n helpers.checkSingularityAccess(ctx);\n const companyName = helpers.string(ctx, \"companyName\", _companyName);\n const company = getCompany(ctx, companyName);\n return company.getFavorGain();\n },\n checkFactionInvitations: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n // Make a copy of player.factionInvitations\n return Player.factionInvitations.slice();\n },\n joinFaction: (ctx) => (_facName) => {\n helpers.checkSingularityAccess(ctx);\n const facName = helpers.string(ctx, \"facName\", _facName);\n getFaction(ctx, facName);\n\n if (!Player.factionInvitations.includes(facName)) {\n helpers.log(ctx, () => `You have not been invited by faction '${facName}'`);\n return false;\n }\n const fac = Factions[facName];\n joinFaction(fac);\n\n // Update Faction Invitation list to account for joined + banned factions\n for (let i = 0; i < Player.factionInvitations.length; ++i) {\n if (Player.factionInvitations[i] == facName || Factions[Player.factionInvitations[i]].isBanned) {\n Player.factionInvitations.splice(i, 1);\n i--;\n }\n }\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 5);\n helpers.log(ctx, () => `Joined the '${facName}' faction.`);\n return true;\n },\n workForFaction:\n (ctx) =>\n (_facName, _type, _focus = true) => {\n helpers.checkSingularityAccess(ctx);\n const facName = helpers.string(ctx, \"facName\", _facName);\n const type = helpers.string(ctx, \"type\", _type);\n const focus = !!_focus;\n const faction = getFaction(ctx, facName);\n\n // if the player is in a gang and the target faction is any of the gang faction, fail\n if (Player.gang && faction.name === Player.getGangFaction().name) {\n helpers.log(ctx, () => `You can't work for '${facName}' because youre managing a gang for it`);\n return false;\n }\n\n if (!Player.factions.includes(facName)) {\n helpers.log(ctx, () => `You are not a member of '${facName}'`);\n return false;\n }\n\n const wasFocusing = Player.focus;\n\n switch (type.toLowerCase()) {\n case \"hacking\":\n case \"hacking contracts\":\n case \"hackingcontracts\":\n if (!FactionInfos[faction.name].offerHackingWork) {\n helpers.log(ctx, () => `Faction '${faction.name}' do not need help with hacking contracts.`);\n return false;\n }\n Player.startWork(\n new FactionWork({\n singularity: true,\n factionWorkType: FactionWorkType.HACKING,\n faction: faction.name,\n }),\n );\n if (focus) {\n Player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n Player.stopFocusing();\n Router.toTerminal();\n }\n helpers.log(ctx, () => `Started carrying out hacking contracts for '${faction.name}'`);\n return true;\n case \"field\":\n case \"fieldwork\":\n case \"field work\":\n if (!FactionInfos[faction.name].offerFieldWork) {\n helpers.log(ctx, () => `Faction '${faction.name}' do not need help with field missions.`);\n return false;\n }\n Player.startWork(\n new FactionWork({\n singularity: true,\n factionWorkType: FactionWorkType.FIELD,\n faction: faction.name,\n }),\n );\n if (focus) {\n Player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n Player.stopFocusing();\n Router.toTerminal();\n }\n helpers.log(ctx, () => `Started carrying out field missions for '${faction.name}'`);\n return true;\n case \"security\":\n case \"securitywork\":\n case \"security work\":\n if (!FactionInfos[faction.name].offerSecurityWork) {\n helpers.log(ctx, () => `Faction '${faction.name}' do not need help with security work.`);\n return false;\n }\n Player.startWork(\n new FactionWork({\n singularity: true,\n factionWorkType: FactionWorkType.SECURITY,\n faction: faction.name,\n }),\n );\n if (focus) {\n Player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n Player.stopFocusing();\n Router.toTerminal();\n }\n helpers.log(ctx, () => `Started carrying out security work for '${faction.name}'`);\n return true;\n default:\n helpers.log(ctx, () => `Invalid work type: '${type}`);\n return false;\n }\n },\n getFactionRep: (ctx) => (_facName) => {\n helpers.checkSingularityAccess(ctx);\n const facName = helpers.string(ctx, \"facName\", _facName);\n const faction = getFaction(ctx, facName);\n return faction.playerReputation;\n },\n getFactionFavor: (ctx) => (_facName) => {\n helpers.checkSingularityAccess(ctx);\n const facName = helpers.string(ctx, \"facName\", _facName);\n const faction = getFaction(ctx, facName);\n return faction.favor;\n },\n getFactionFavorGain: (ctx) => (_facName) => {\n helpers.checkSingularityAccess(ctx);\n const facName = helpers.string(ctx, \"facName\", _facName);\n const faction = getFaction(ctx, facName);\n return faction.getFavorGain();\n },\n donateToFaction: (ctx) => (_facName, _amt) => {\n helpers.checkSingularityAccess(ctx);\n const facName = helpers.string(ctx, \"facName\", _facName);\n const amt = helpers.number(ctx, \"amt\", _amt);\n const faction = getFaction(ctx, facName);\n if (!Player.factions.includes(faction.name)) {\n helpers.log(ctx, () => `You can't donate to '${facName}' because you aren't a member`);\n return false;\n }\n if (Player.gang && faction.name === Player.getGangFaction().name) {\n helpers.log(ctx, () => `You can't donate to '${facName}' because youre managing a gang for it`);\n return false;\n }\n if (faction.name === FactionNames.ChurchOfTheMachineGod || faction.name === FactionNames.Bladeburners) {\n helpers.log(ctx, () => `You can't donate to '${facName}' because they do not accept donations`);\n return false;\n }\n if (typeof amt !== \"number\" || amt <= 0 || isNaN(amt)) {\n helpers.log(ctx, () => `Invalid donation amount: '${amt}'.`);\n return false;\n }\n if (Player.money < amt) {\n helpers.log(\n ctx,\n () => `You do not have enough money to donate ${numeralWrapper.formatMoney(amt)} to '${facName}'`,\n );\n return false;\n }\n const repNeededToDonate = Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n if (faction.favor < repNeededToDonate) {\n helpers.log(\n ctx,\n () =>\n `You do not have enough favor to donate to this faction. Have ${faction.favor}, need ${repNeededToDonate}`,\n );\n return false;\n }\n const repGain = (amt / CONSTANTS.DonateMoneyToRepDivisor) * Player.mults.faction_rep;\n faction.playerReputation += repGain;\n Player.loseMoney(amt, \"other\");\n helpers.log(\n ctx,\n () =>\n `${numeralWrapper.formatMoney(amt)} donated to '${facName}' for ${numeralWrapper.formatReputation(\n repGain,\n )} reputation`,\n );\n return true;\n },\n createProgram:\n (ctx) =>\n (_programName, _focus = true) => {\n helpers.checkSingularityAccess(ctx);\n const programName = helpers.string(ctx, \"programName\", _programName).toLowerCase();\n const focus = !!_focus;\n\n const wasFocusing = Player.focus;\n\n const p = Object.values(Programs).find((p) => p.name.toLowerCase() === programName);\n\n if (p == null) {\n helpers.log(ctx, () => `The specified program does not exist: '${programName}`);\n return false;\n }\n\n if (Player.hasProgram(p.name)) {\n helpers.log(ctx, () => `You already have the '${p.name}' program`);\n return false;\n }\n\n const create = p.create;\n if (create === null) {\n helpers.log(ctx, () => `You cannot create the '${p.name}' program`);\n return false;\n }\n\n if (!create.req()) {\n helpers.log(ctx, () => `Hacking level is too low to create '${p.name}' (level ${create.level} req)`);\n return false;\n }\n\n Player.startWork(\n new CreateProgramWork({\n programName: p.name,\n singularity: true,\n }),\n );\n if (focus) {\n Player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n Player.stopFocusing();\n Router.toTerminal();\n }\n helpers.log(ctx, () => `Began creating program: '${programName}'`);\n return true;\n },\n commitCrime:\n (ctx) =>\n (_crimeRoughName, _focus = true) => {\n helpers.checkSingularityAccess(ctx);\n const crimeRoughName = helpers.string(ctx, \"crimeRoughName\", _crimeRoughName);\n const focus = !!_focus;\n const wasFocusing = Player.focus;\n\n if (Player.currentWork !== null) {\n Player.finishWork(true);\n }\n\n // Set Location to slums\n Player.gotoLocation(LocationName.Slums);\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n // couldn't find crime\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid crime: '${crimeRoughName}'`);\n }\n helpers.log(ctx, () => `Attempting to commit ${crime.name}...`);\n const crimeTime = crime.commit(1, ctx.workerScript);\n if (focus) {\n Player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n Player.stopFocusing();\n Router.toTerminal();\n }\n return crimeTime;\n },\n getCrimeChance: (ctx) => (_crimeRoughName) => {\n helpers.checkSingularityAccess(ctx);\n const crimeRoughName = helpers.string(ctx, \"crimeRoughName\", _crimeRoughName);\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid crime: ${crimeRoughName}`);\n }\n\n return crime.successRate(Player);\n },\n getCrimeStats: (ctx) => (_crimeRoughName) => {\n helpers.checkSingularityAccess(ctx);\n const crimeRoughName = helpers.string(ctx, \"crimeRoughName\", _crimeRoughName);\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid crime: ${crimeRoughName}`);\n }\n\n const crimeStatsWithMultipliers = calculateCrimeWorkStats(crime);\n\n return Object.assign({}, crime, {\n money: crimeStatsWithMultipliers.money,\n reputation: crimeStatsWithMultipliers.reputation,\n hacking_exp: crimeStatsWithMultipliers.hackExp,\n strength_exp: crimeStatsWithMultipliers.strExp,\n defense_exp: crimeStatsWithMultipliers.defExp,\n dexterity_exp: crimeStatsWithMultipliers.dexExp,\n agility_exp: crimeStatsWithMultipliers.agiExp,\n charisma_exp: crimeStatsWithMultipliers.chaExp,\n intelligence_exp: crimeStatsWithMultipliers.intExp,\n });\n },\n getDarkwebPrograms: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n\n // If we don't have Tor, log it and return [] (empty list)\n if (!Player.hasTorRouter()) {\n helpers.log(ctx, () => \"You do not have the TOR router.\");\n return [];\n }\n return Object.values(DarkWebItems).map((p) => p.program);\n },\n getDarkwebProgramCost: (ctx) => (_programName) => {\n helpers.checkSingularityAccess(ctx);\n const programName = helpers.string(ctx, \"programName\", _programName).toLowerCase();\n\n // If we don't have Tor, log it and return -1\n if (!Player.hasTorRouter()) {\n helpers.log(ctx, () => \"You do not have the TOR router.\");\n // returning -1 rather than throwing an error to be consistent with purchaseProgram\n // which returns false if tor has\n return -1;\n }\n\n const item = Object.values(DarkWebItems).find((i) => i.program.toLowerCase() === programName);\n\n // If the program doesn't exist, throw an error. The reasoning here is that the 99% case is that\n // the player will be using this in automation scripts, and if they're asking for a program that\n // doesn't exist, it's the first time they've run the script. So throw an error to let them know\n // that they need to fix it.\n if (item == null) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `No such exploit ('${programName}') found on the darkweb! ` +\n `\\nThis function is not case-sensitive. Did you perhaps forget .exe at the end?`,\n );\n }\n\n if (Player.hasProgram(item.program)) {\n helpers.log(ctx, () => `You already have the '${item.program}' program`);\n return 0;\n }\n return item.price;\n },\n b1tflum3:\n (ctx) =>\n (_nextBN, _callbackScript = \"\") => {\n helpers.checkSingularityAccess(ctx);\n const nextBN = helpers.number(ctx, \"nextBN\", _nextBN);\n const callbackScript = helpers.string(ctx, \"callbackScript\", _callbackScript);\n helpers.checkSingularityAccess(ctx);\n enterBitNode(true, Player.bitNodeN, nextBN);\n if (callbackScript)\n setTimeout(() => {\n runAfterReset(callbackScript);\n }, 0);\n },\n destroyW0r1dD43m0n:\n (ctx) =>\n (_nextBN, _callbackScript = \"\") => {\n helpers.checkSingularityAccess(ctx);\n const nextBN = helpers.number(ctx, \"nextBN\", _nextBN);\n const callbackScript = helpers.string(ctx, \"callbackScript\", _callbackScript);\n\n const wd = GetServer(SpecialServers.WorldDaemon);\n if (!(wd instanceof Server)) throw new Error(\"WorldDaemon was not a normal server. This is a bug contact dev.\");\n const hackingRequirements = () => {\n if (Player.skills.hacking < wd.requiredHackingSkill) return false;\n if (!wd.hasAdminRights) return false;\n return true;\n };\n const bladeburnerRequirements = () => {\n if (!Player.inBladeburner()) return false;\n if (!Player.bladeburner) return false;\n return Player.bladeburner.blackops[BlackOperationNames.OperationDaedalus];\n };\n\n if (!hackingRequirements() && !bladeburnerRequirements()) {\n helpers.log(ctx, () => \"Requirements not met to destroy the world daemon\");\n return;\n }\n\n wd.backdoorInstalled = true;\n calculateAchievements();\n enterBitNode(false, Player.bitNodeN, nextBN);\n if (callbackScript)\n setTimeout(() => {\n runAfterReset(callbackScript);\n }, 0);\n },\n getCurrentWork: () => () => {\n if (!Player.currentWork) return null;\n return Player.currentWork.APICopy();\n },\n exportGame: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n onExport();\n return saveObject.exportGame();\n },\n exportGameBonus: (ctx) => () => {\n helpers.checkSingularityAccess(ctx);\n return canGetBonus();\n },\n };\n}\n","import { saveObject } from \"../SaveObject\";\nimport { Script } from \"../Script/Script\";\nimport { GetAllServers, GetServer } from \"../Server/AllServers\";\nimport { IFileLine } from \"./v1APIBreak\";\nimport { openV2Modal } from \"./V2Modal\";\n\nconst singularity = [\n \"applyToCompany\",\n \"b1tflum3\",\n \"checkFactionInvitations\",\n \"commitCrime\",\n \"connect\",\n \"createProgram\",\n \"destroyW0r1dD43m0n\",\n \"donateToFaction\",\n \"getAugmentationBasePrice\",\n \"getAugmentationCost\",\n \"getAugmentationPrereq\",\n \"getAugmentationPrice\",\n \"getAugmentationRepReq\",\n \"getAugmentationsFromFaction\",\n \"getAugmentationStats\",\n \"getCompanyFavor\",\n \"getCompanyFavorGain\",\n \"getCompanyRep\",\n \"getCrimeChance\",\n \"getCrimeStats\",\n \"getCurrentServer\",\n \"getDarkwebProgramCost\",\n \"getDarkwebPrograms\",\n \"getFactionFavor\",\n \"getFactionFavorGain\",\n \"getFactionRep\",\n \"getOwnedAugmentations\",\n \"getOwnedSourceFiles\",\n \"getUpgradeHomeCoresCost\",\n \"getUpgradeHomeRamCost\",\n \"goToLocation\",\n \"gymWorkout\",\n \"hospitalize\",\n \"installAugmentations\",\n \"installBackdoor\",\n \"isBusy\",\n \"isFocused\",\n \"joinFaction\",\n \"manualHack\",\n \"purchaseAugmentation\",\n \"purchaseProgram\",\n \"purchaseTor\",\n \"quitJob\",\n \"setFocus\",\n \"softReset\",\n \"stopAction\",\n \"travelToCity\",\n \"universityCourse\",\n \"upgradeHomeCores\",\n \"upgradeHomeRam\",\n \"workForCompany\",\n \"workForFaction\",\n];\n\nconst getPlayerFields = [\n \"workChaExpGained\",\n \"currentWorkFactionName\",\n \"workDexExpGained\",\n \"workHackExpGained\",\n \"createProgramReqLvl\",\n \"workStrExpGained\",\n \"companyName\",\n \"crimeType\",\n \"workRepGained\",\n \"workChaExpGainRate\",\n \"workType\",\n \"workStrExpGainRate\",\n \"isWorking\",\n \"workRepGainRate\",\n \"workDefExpGained\",\n \"currentWorkFactionDescription\",\n \"workHackExpGainRate\",\n \"workAgiExpGainRate\",\n \"workDexExpGainRate\",\n \"workMoneyGained\",\n \"workMoneyLossRate\",\n \"workMoneyGainRate\",\n \"createProgramName\",\n \"workDefExpGainRate\",\n \"workAgiExpGained\",\n \"className\",\n \"hacking\",\n \"strength\",\n \"defense\",\n \"dexterity\",\n \"agility\",\n \"charisma\",\n \"intelligence\",\n \"hacking_exp\",\n \"strength_exp\",\n \"defense_exp\",\n \"dexterity_exp\",\n \"agility_exp\",\n \"charisma_exp\",\n \"intelligence_exp\",\n \"hp\",\n \"max_hp\",\n \"hasWseAccount\",\n \"hasTixApiAccess\",\n \"has4SData\",\n \"has4SDataTixApi\",\n];\n\nconst mults = [\n \"hacking_chance_mult\",\n \"hacking_speed_mult\",\n \"hacking_money_mult\",\n \"hacking_grow_mult\",\n \"hacking_mult\",\n \"hacking_exp_mult\",\n \"strength_mult\",\n \"strength_exp_mult\",\n \"defense_mult\",\n \"defense_exp_mult\",\n \"dexterity_mult\",\n \"dexterity_exp_mult\",\n \"agility_mult\",\n \"agility_exp_mult\",\n \"charisma_mult\",\n \"charisma_exp_mult\",\n \"hacknet_node_money_mult\",\n \"hacknet_node_purchase_cost_mult\",\n \"hacknet_node_ram_cost_mult\",\n \"hacknet_node_core_cost_mult\",\n \"hacknet_node_level_cost_mult\",\n \"company_rep_mult\",\n \"faction_rep_mult\",\n \"work_money_mult\",\n \"crime_success_mult\",\n \"crime_money_mult\",\n \"bladeburner_max_stamina_mult\",\n \"bladeburner_stamina_gain_mult\",\n \"bladeburner_analysis_mult\",\n \"bladeburner_success_chance_mult\",\n];\n\ninterface IRule {\n matchJS: RegExp;\n matchScript?: RegExp;\n reason: string;\n offenders: IFileLine[];\n}\n\nexport const v2APIBreak = () => {\n const home = GetServer(\"home\");\n if (!home) throw new Error(\"'home' server was not found.\");\n const rules: IRule[] = [\n {\n matchJS: /ns\\.workForCompany/g,\n matchScript: /workForCompany/g,\n reason: \"workForCompany argument companyName is now not-optional.\",\n offenders: [],\n },\n {\n matchJS: /ns\\.getScriptExpGain/g,\n matchScript: /getScriptExpGain/g,\n reason: \"getScriptExpGain with 0 argument no longer returns the sum of all scripts. Use getTotalScriptExpGain\",\n offenders: [],\n },\n {\n matchJS: /ns\\.getScriptExpGain/g,\n matchScript: /getScriptExpGain/g,\n reason: \"getScriptIncome with 0 argument no longer returns the sum of all scripts. Use getTotalScriptIncome\",\n offenders: [],\n },\n {\n matchJS: /ns\\.scp/g,\n matchScript: /scp/g,\n reason:\n \"scp arguments were switch, it is now scp(files, destination, optionally_source). If you were using 2 argument (not 3) this doesn't affect you.\",\n offenders: [],\n },\n {\n matchJS: /ns\\.stock\\.buy/g,\n matchScript: /stock\\.buy/g,\n reason: \"buy is a very common word so in order to avoid ram costs it was renamed ns.stock.buyStock\",\n offenders: [],\n },\n {\n matchJS: /ns\\.stock\\.sell/g,\n matchScript: /stock\\.sell/g,\n reason: \"sell is a very common word so in order to avoid ram costs it was renamed ns.stock.sellStock\",\n offenders: [],\n },\n {\n matchJS: /ns\\.stock\\.short/g,\n matchScript: /stock\\.short/g,\n reason: \"short is a very common word so in order to avoid ram costs it was renamed ns.stock.buyShort\",\n offenders: [],\n },\n {\n matchJS: /ns\\.corporation\\.bribe/g,\n matchScript: /corporation\\.bribe/g,\n reason: \"bribe no longer allows you to give shares of the corporation, only money\",\n offenders: [],\n },\n ];\n\n for (const fn of singularity) {\n rules.push({\n matchJS: new RegExp(`ns.${fn}`, \"g\"),\n reason: `ns.${fn} was moved to ns.singularity.${fn}`,\n offenders: [],\n });\n }\n\n for (const mult of mults) {\n rules.push({\n matchJS: new RegExp(mult, \"g\"),\n reason: `ns.getPlayer().${mult} was moved to ns.getPlayer().mults.${mult.slice(0, mult.length - 5)}`,\n offenders: [],\n });\n }\n\n for (const f of getPlayerFields) {\n rules.push({\n matchJS: new RegExp(f, \"g\"),\n reason: `The work system is completely reworked and ns.getPlayer().${f} no longer exists. This data is likely available inside ns.getPlayer().currentWork, skills, exp, or hp`,\n offenders: [],\n });\n }\n\n for (const script of home.scripts) {\n processScript(rules, script);\n }\n\n home.writeToTextFile(\"V2_0_0_API_BREAK.txt\", formatRules(rules));\n openV2Modal();\n\n for (const server of GetAllServers()) {\n server.runningScripts = [];\n }\n saveObject.exportGame();\n};\n\nconst formatOffenders = (offenders: IFileLine[]): string => {\n const files: Record<string, IFileLine[]> = {};\n for (const off of offenders) {\n const current = files[off.file] ?? [];\n current.push(off);\n files[off.file] = current;\n }\n\n let txt = \"\";\n for (const file in files) {\n txt += \"\\t\" + file + \"\\n\";\n for (const fileline of files[file]) {\n txt += `\\t\\tLine ${fileline.line} ${fileline.content.trim()}\\n`;\n }\n }\n return txt;\n};\n\nconst formatRules = (rules: IRule[]): string => {\n let txt =\n \"This file contains the list of potential API break. A pattern was used to look through all your files and note the spots where you might have a problem. Not everything here is broken.\";\n for (const rule of rules) {\n if (rule.offenders.length === 0) continue;\n txt += String(rule.matchJS) + \"\\n\";\n txt += rule.reason + \"\\n\\n\";\n txt += formatOffenders(rule.offenders);\n txt += \"\\n\\n\";\n }\n return txt;\n};\n\nconst processScript = (rules: IRule[], script: Script) => {\n const lines = script.code.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n for (const rule of rules) {\n const line = lines[i];\n const match = script.filename.endsWith(\".script\") ? rule.matchScript ?? rule.matchJS : rule.matchJS;\n if (line.match(match)) {\n rule.offenders.push({\n file: script.filename,\n line: i + 1,\n content: line,\n });\n }\n }\n }\n};\n","import { getRamCost } from \"./RamCostGenerator\";\nimport type { WorkerScript } from \"./WorkerScript\";\nimport { helpers } from \"./NetscriptHelpers\";\nimport { ScriptArg } from \"./ScriptArg\";\nimport { NSEnums } from \"src/ScriptEditor/NetscriptDefinitions\";\nimport { NSFull } from \"src/NetscriptFunctions\";\n\ntype ExternalFunction = (...args: any[]) => void;\n\nexport type ExternalAPILayer = {\n [key: string]: ExternalAPILayer | ExternalFunction | ScriptArg[];\n};\n\ntype InternalFunction<F extends ExternalFunction> = (\n ctx: NetscriptContext,\n) => ((...args: unknown[]) => ReturnType<F>) & F;\n\nexport type InternalAPI<API> = {\n [Property in keyof API]: API[Property] extends ExternalFunction\n ? InternalFunction<API[Property]>\n : API[Property] extends NSEnums\n ? NSEnums\n : API[Property] extends ScriptArg[]\n ? ScriptArg[]\n : API[Property] extends object\n ? InternalAPI<API[Property]>\n : never;\n};\n\nexport type NetscriptContext = {\n workerScript: WorkerScript;\n function: string;\n functionPath: string;\n};\n\nfunction wrapFunction(\n wrappedAPI: ExternalAPILayer,\n workerScript: WorkerScript,\n func: (_ctx: NetscriptContext) => (...args: unknown[]) => unknown,\n ...tree: string[]\n): void {\n const functionPath = tree.join(\".\");\n const functionName = tree.pop();\n if (typeof functionName !== \"string\") {\n throw helpers.makeBasicErrorMsg(workerScript, \"Failure occurred while wrapping netscript api\", \"INITIALIZATION\");\n }\n const ctx = {\n workerScript,\n function: functionName,\n functionPath,\n };\n function wrappedFunction(...args: unknown[]): unknown {\n helpers.checkEnvFlags(ctx);\n helpers.updateDynamicRam(ctx, getRamCost(...tree, ctx.function));\n return func(ctx)(...args);\n }\n const parent = getNestedProperty(wrappedAPI, tree);\n Object.defineProperty(parent, functionName, {\n value: wrappedFunction,\n writable: true,\n enumerable: true,\n });\n}\n\nexport function wrapAPI(workerScript: WorkerScript, namespace: object, args: ScriptArg[]): NSFull {\n const wrappedAPI = wrapAPILayer({}, workerScript, namespace);\n wrappedAPI.args = args;\n return wrappedAPI as unknown as NSFull;\n}\n\nexport function wrapAPILayer(\n wrappedAPI: ExternalAPILayer,\n workerScript: WorkerScript,\n namespace: object,\n ...tree: string[]\n) {\n for (const [key, value] of Object.entries(namespace)) {\n if (typeof value === \"function\") {\n wrapFunction(wrappedAPI, workerScript, value, ...tree, key);\n } else if (Array.isArray(value)) {\n setNestedProperty(wrappedAPI, value.slice(), key);\n } else if (typeof value === \"object\") {\n wrapAPILayer(wrappedAPI, workerScript, value, ...tree, key);\n } else {\n setNestedProperty(wrappedAPI, value, ...tree, key);\n }\n }\n return wrappedAPI;\n}\n\nfunction setNestedProperty(root: any, value: unknown, ...tree: string[]): void {\n let target = root;\n const key = tree.pop();\n if (!key) throw new Error(\"Failure occurred while wrapping netscript api (setNestedProperty)\");\n for (const branch of tree) {\n target[branch] ??= {};\n target = target[branch];\n }\n target[key] = value;\n}\n\nfunction getNestedProperty(root: any, tree: string[]): unknown {\n let target = root;\n for (const branch of tree) {\n target[branch] ??= {};\n target = target[branch];\n }\n return target;\n}\n","export class ScriptUrl {\n filename: string;\n url: string;\n moduleSequenceNumber: number;\n\n constructor(filename: string, url: string, moduleSequenceNumber: number) {\n this.filename = filename;\n this.url = url;\n this.moduleSequenceNumber = moduleSequenceNumber;\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { killWorkerScript } from \"../../Netscript/killWorkerScript\";\nimport { WorkerScriptStartStopEventEmitter } from \"../../Netscript/WorkerScriptStartStopEventEmitter\";\n\nexport function killall(_args: (string | number | boolean)[], server: BaseServer): void {\n for (let i = server.runningScripts.length - 1; i >= 0; --i) {\n killWorkerScript({ runningScript: server.runningScripts[i], hostname: server.hostname });\n }\n WorkerScriptStartStopEventEmitter.emit();\n Terminal.print(\"Killing all running scripts\");\n}\n","import { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { toString } from \"lodash\";\nimport React from \"react\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { evaluateDirectoryPath, getFirstParentDirectory, isValidDirectoryPath } from \"../DirectoryHelpers\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { Terminal } from \"../../Terminal\";\nimport libarg from \"arg\";\nimport { showLiterature } from \"../../Literature/LiteratureHelpers\";\nimport { MessageFilenames, showMessage } from \"../../Message/MessageHelpers\";\n\nexport function ls(args: (string | number | boolean)[], server: BaseServer): void {\n interface LSFlags {\n [\"-l\"]: boolean;\n [\"--grep\"]: string;\n }\n let flags: LSFlags;\n try {\n flags = libarg(\n {\n \"-l\": Boolean,\n \"--grep\": String,\n \"-g\": \"--grep\",\n },\n { argv: args },\n );\n } catch (e) {\n // catch passing only -g / --grep with no string to use as the search\n incorrectUsage();\n return;\n }\n const filter = flags[\"--grep\"];\n\n const numArgs = args.length;\n function incorrectUsage(): void {\n Terminal.error(\"Incorrect usage of ls command. Usage: ls [dir] [-l] [-g, --grep pattern]\");\n }\n\n if (numArgs > 4) {\n return incorrectUsage();\n }\n\n // Directory path\n let prefix = Terminal.cwd();\n if (!prefix.endsWith(\"/\")) {\n prefix += \"/\";\n }\n\n // If first arg doesn't contain a - it must be the file/folder\n const dir = args[0] && typeof args[0] == \"string\" && !args[0].startsWith(\"-\") ? args[0] : \"\";\n const newPath = evaluateDirectoryPath(dir + \"\", Terminal.cwd());\n prefix = newPath || \"\";\n if (!prefix.endsWith(\"/\")) {\n prefix += \"/\";\n }\n if (!isValidDirectoryPath(prefix)) {\n return incorrectUsage();\n }\n\n // Root directory, which is the same as no 'prefix' at all\n if (prefix === \"/\") {\n prefix = \"\";\n }\n\n // Display all programs and scripts\n const allPrograms: string[] = [];\n const allScripts: string[] = [];\n const allTextFiles: string[] = [];\n const allContracts: string[] = [];\n const allMessages: string[] = [];\n const folders: string[] = [];\n\n function handleFn(fn: string, dest: string[]): void {\n let parsedFn = fn;\n if (prefix) {\n if (!fn.startsWith(prefix)) {\n return;\n } else {\n parsedFn = fn.slice(prefix.length, fn.length);\n }\n }\n\n if (filter && !parsedFn.includes(filter)) {\n return;\n }\n\n // If the fn includes a forward slash, it must be in a subdirectory.\n // Therefore, we only list the \"first\" directory in its path\n if (parsedFn.includes(\"/\")) {\n const firstParentDir = getFirstParentDirectory(parsedFn);\n if (filter && !firstParentDir.includes(filter)) {\n return;\n }\n\n if (!folders.includes(firstParentDir)) {\n folders.push(firstParentDir);\n }\n\n return;\n }\n\n dest.push(parsedFn);\n }\n\n // Get all of the programs and scripts on the machine into one temporary array\n for (const program of server.programs) handleFn(program, allPrograms);\n for (const script of server.scripts) handleFn(script.filename, allScripts);\n for (const txt of server.textFiles) handleFn(txt.fn, allTextFiles);\n for (const contract of server.contracts) handleFn(contract.fn, allContracts);\n for (const msgOrLit of server.messages) handleFn(msgOrLit, allMessages);\n\n // Sort the files/folders alphabetically then print each\n allPrograms.sort();\n allScripts.sort();\n allTextFiles.sort();\n allContracts.sort();\n allMessages.sort();\n folders.sort();\n\n interface ClickableRowProps {\n row: string;\n prefix: string;\n hostname: string;\n }\n\n function ClickableScriptRow({ row, prefix, hostname }: ClickableRowProps): React.ReactElement {\n const classes = makeStyles((theme: Theme) =>\n createStyles({\n scriptLinksWrap: {\n display: \"inline-flex\",\n color: theme.palette.warning.main,\n },\n scriptLink: {\n cursor: \"pointer\",\n textDecorationLine: \"underline\",\n paddingRight: \"1.15em\",\n \"&:last-child\": { padding: 0 },\n },\n }),\n )();\n\n const rowSplit = row.split(\"~\");\n let rowSplitArray = rowSplit.map((x) => [x.trim(), x.replace(x.trim(), \"\")]);\n rowSplitArray = rowSplitArray.filter((x) => !!x[0]);\n\n function onScriptLinkClick(filename: string): void {\n if (!server.isConnectedTo) {\n return Terminal.error(`File is not on this server, connect to ${hostname} and try again`);\n }\n if (filename.startsWith(\"/\")) filename = filename.slice(1);\n // Terminal.getFilepath needs leading slash to correctly work here\n if (prefix === \"\") filename = `/${filename}`;\n const filepath = Terminal.getFilepath(`${prefix}${filename}`);\n // Terminal.getScript also calls Terminal.getFilepath and therefore also\n // needs the given parameter\n const code = toString(Terminal.getScript(`${prefix}${filename}`)?.code);\n Router.toScriptEditor({ [filepath]: code });\n }\n\n return (\n <span className={classes.scriptLinksWrap}>\n {rowSplitArray.map((rowItem) => (\n <span key={\"script_\" + rowItem[0]}>\n <span className={classes.scriptLink} onClick={() => onScriptLinkClick(rowItem[0])}>\n {rowItem[0]}\n </span>\n <span>{rowItem[1]}</span>\n </span>\n ))}\n </span>\n );\n }\n\n function ClickableMessageRow({ row, prefix, hostname }: ClickableRowProps): React.ReactElement {\n const classes = makeStyles((theme: Theme) =>\n createStyles({\n linksWrap: {\n display: \"inline-flex\",\n color: theme.palette.primary.main,\n },\n link: {\n cursor: \"pointer\",\n textDecorationLine: \"underline\",\n paddingRight: \"1.15em\",\n \"&:last-child\": { padding: 0 },\n },\n }),\n )();\n\n const rowSplit = row.split(\"~\");\n let rowSplitArray = rowSplit.map((x) => [x.trim(), x.replace(x.trim(), \"\")]);\n rowSplitArray = rowSplitArray.filter((x) => !!x[0]);\n\n function onMessageLinkClick(filename: string): void {\n if (!server.isConnectedTo) {\n return Terminal.error(`File is not on this server, connect to ${hostname} and try again`);\n }\n if (filename.startsWith(\"/\")) filename = filename.slice(1);\n const filepath = Terminal.getFilepath(`${prefix}${filename}`);\n\n if (filepath.endsWith(\".lit\")) {\n showLiterature(filepath);\n } else if (filepath.endsWith(\".msg\")) {\n showMessage(filepath as MessageFilenames);\n }\n }\n\n return (\n <span className={classes.linksWrap}>\n {rowSplitArray.map((rowItem) => (\n <span key={\"text_\" + rowItem[0]}>\n <span className={classes.link} onClick={() => onMessageLinkClick(rowItem[0])}>\n {rowItem[0]}\n </span>\n <span>{rowItem[1]}</span>\n </span>\n ))}\n </span>\n );\n }\n\n enum FileType {\n Folder,\n Message,\n TextFile,\n Program,\n Contract,\n Script,\n }\n\n interface FileGroup {\n type: FileType;\n segments: string[];\n }\n\n function postSegments(group: FileGroup, flags: LSFlags): void {\n const segments = group.segments;\n const linked = group.type === FileType.Script || group.type === FileType.Message;\n const maxLength = Math.max(...segments.map((s) => s.length)) + 1;\n const filesPerRow = flags[\"-l\"] === true ? 1 : Math.ceil(80 / maxLength);\n for (let i = 0; i < segments.length; i++) {\n let row = \"\";\n for (let col = 0; col < filesPerRow; col++) {\n if (!(i < segments.length)) break;\n row += segments[i];\n row += \" \".repeat(maxLength * (col + 1) - row.length);\n if (linked) {\n row += \"~\";\n }\n i++;\n }\n i--;\n\n switch (group.type) {\n case FileType.Folder:\n Terminal.printRaw(<span style={{ color: \"cyan\" }}>{row}</span>);\n break;\n case FileType.Script:\n Terminal.printRaw(<ClickableScriptRow row={row} prefix={prefix} hostname={server.hostname} />);\n break;\n case FileType.Message:\n Terminal.printRaw(<ClickableMessageRow row={row} prefix={prefix} hostname={server.hostname} />);\n break;\n default:\n Terminal.print(row);\n }\n }\n }\n\n const groups: FileGroup[] = [\n { type: FileType.Folder, segments: folders },\n { type: FileType.Message, segments: allMessages },\n { type: FileType.TextFile, segments: allTextFiles },\n { type: FileType.Program, segments: allPrograms },\n { type: FileType.Contract, segments: allContracts },\n { type: FileType.Script, segments: allScripts },\n ].filter((g) => g.segments.length > 0);\n for (const group of groups) {\n postSegments(group, flags);\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nexport function lscpu(_args: (string | number | boolean)[], server: BaseServer): void {\n Terminal.print(server.cpuCores + \" Core(s)\");\n}\n","import { Terminal } from \"../../Terminal\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Settings } from \"../../Settings/Settings\";\n\nexport function mem(args: (string | number | boolean)[]): void {\n try {\n if (args.length !== 1 && args.length !== 3) {\n Terminal.error(\"Incorrect usage of mem command. usage: mem [scriptname] [-t] [number threads]\");\n return;\n }\n\n const scriptName = args[0] + \"\";\n let numThreads = 1;\n if (args.length === 3 && args[1] === \"-t\") {\n numThreads = Math.round(parseInt(args[2] + \"\"));\n if (isNaN(numThreads) || numThreads < 1) {\n Terminal.error(\"Invalid number of threads specified. Number of threads must be greater than 1\");\n return;\n }\n }\n\n const script = Terminal.getScript(scriptName);\n if (script == null) {\n Terminal.error(\"mem failed. No such script exists!\");\n return;\n }\n\n const ramUsage = script.ramUsage * numThreads;\n\n Terminal.print(\n `This script requires ${numeralWrapper.formatRAM(ramUsage)} of RAM to run for ${numThreads} thread(s)`,\n );\n\n const verboseEntries = script.ramUsageEntries?.sort((a, b) => b.cost - a.cost) ?? [];\n const padding = Settings.UseIEC60027_2 ? 9 : 8;\n for (const entry of verboseEntries) {\n Terminal.print(\n `${numeralWrapper.formatRAM(entry.cost * numThreads).padStart(padding)} | ${entry.name} (${entry.type})`,\n );\n }\n\n if (ramUsage > 0 && verboseEntries.length === 0) {\n // Let's warn the user that he might need to save his script again to generate the detailed entries\n Terminal.warn(\"You might have to open & save this script to see the detailed RAM usage information.\");\n }\n } catch (e) {\n Terminal.error(e + \"\");\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { TextFile } from \"../../TextFile\";\nimport { Script } from \"../../Script/Script\";\nimport { getDestinationFilepath, areFilesEqual } from \"../DirectoryHelpers\";\n\nexport function mv(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 2) {\n Terminal.error(`Incorrect number of arguments. Usage: mv [src] [dest]`);\n return;\n }\n\n try {\n const source = args[0] + \"\";\n const t_dest = args[1] + \"\";\n\n if (!isScriptFilename(source) && !source.endsWith(\".txt\")) {\n Terminal.error(`'mv' can only be used on scripts and text files (.txt)`);\n return;\n }\n\n const srcFile = Terminal.getFile(source);\n if (srcFile == null) {\n Terminal.error(`Source file ${source} does not exist`);\n return;\n }\n\n const sourcePath = Terminal.getFilepath(source);\n // Get the destination based on the source file and the current directory\n const dest = getDestinationFilepath(t_dest, source, Terminal.cwd());\n if (dest === null) {\n Terminal.error(\"error parsing dst file\");\n return;\n }\n\n const destFile = Terminal.getFile(dest);\n const destPath = Terminal.getFilepath(dest);\n if (areFilesEqual(sourcePath, destPath)) {\n Terminal.error(`Source and destination files are the same file`);\n return;\n }\n\n // 'mv' command only works on scripts and txt files.\n // Also, you can't convert between different file types\n if (isScriptFilename(source)) {\n const script = srcFile as Script;\n if (!isScriptFilename(destPath)) {\n Terminal.error(`Source and destination files must have the same type`);\n return;\n }\n\n // Command doesn't work if script is running\n if (server.isRunning(sourcePath)) {\n Terminal.error(`Cannot use 'mv' on a script that is running`);\n return;\n }\n\n if (destFile != null) {\n // Already exists, will be overwritten, so we'll delete it\n\n // Command doesn't work if script is running\n if (server.isRunning(destPath)) {\n Terminal.error(`Cannot use 'mv' on a script that is running`);\n return;\n }\n\n const status = server.removeFile(destPath);\n if (!status.res) {\n Terminal.error(`Something went wrong...please contact game dev (probably a bug)`);\n return;\n } else {\n Terminal.print(\"Warning: The destination file was overwritten\");\n }\n }\n\n script.filename = destPath;\n } else if (srcFile instanceof TextFile) {\n const textFile = srcFile;\n if (!dest.endsWith(\".txt\")) {\n Terminal.error(`Source and destination files must have the same type`);\n return;\n }\n\n if (destFile != null) {\n // Already exists, will be overwritten, so we'll delete it\n const status = server.removeFile(destPath);\n if (!status.res) {\n Terminal.error(`Something went wrong...please contact game dev (probably a bug)`);\n return;\n } else {\n Terminal.print(\"Warning: The destination file was overwritten\");\n }\n }\n\n textFile.fn = destPath;\n }\n } catch (e) {\n Terminal.error(e + \"\");\n }\n}\n","import { BaseServer } from \"../../Server/BaseServer\";\n\nimport { commonEditor } from \"./common/editor\";\n\nexport function nano(args: (string | number | boolean)[], server: BaseServer): void {\n return commonEditor(\"nano\", { args, server });\n}\n","interface Position {\n row: number;\n column: number;\n}\n\nclass PositionTracker {\n positions: Map<string, Position>;\n\n constructor() {\n this.positions = new Map<string, Position>();\n }\n\n saveCursor(filename: string, pos: Position): void {\n this.positions.set(filename, pos);\n }\n\n getCursor(filename: string): Position {\n const position = this.positions.get(filename);\n if (!position) {\n return {\n row: -1,\n column: -1,\n };\n }\n return position;\n }\n}\n\nexport const CursorPositions: PositionTracker = new PositionTracker();\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport * as libarg from \"arg\";\n\nexport function ps(args: (string | number | boolean)[], server: BaseServer): void {\n let flags;\n try {\n flags = libarg(\n {\n \"--grep\": String,\n \"-g\": \"--grep\",\n },\n { argv: args },\n );\n } catch (e) {\n // catch passing only -g / --grep with no string to use as the search\n Terminal.error(\"Incorrect usage of ps command. Usage: ps [-g, --grep pattern]\");\n return;\n }\n const pattern = flags[\"--grep\"];\n if (pattern) {\n const re = new RegExp(pattern.toString());\n const matching = server.runningScripts.filter((x) => re.test(x.filename));\n for (let i = 0; i < matching.length; i++) {\n const rsObj = matching[i];\n let res = `(PID - ${rsObj.pid}) ${rsObj.filename}`;\n for (let j = 0; j < rsObj.args.length; ++j) {\n res += \" \" + rsObj.args[j].toString();\n }\n Terminal.print(res);\n }\n }\n if (args.length === 0) {\n for (let i = 0; i < server.runningScripts.length; i++) {\n const rsObj = server.runningScripts[i];\n let res = `(PID - ${rsObj.pid}) ${rsObj.filename}`;\n for (let j = 0; j < rsObj.args.length; ++j) {\n res += \" \" + rsObj.args[j].toString();\n }\n Terminal.print(res);\n }\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { IReturnStatus } from \"../../types\";\n\nexport function rm(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 1) {\n Terminal.error(\"Incorrect number of arguments. Usage: rm [program/script]\");\n return;\n }\n\n // Check programs\n let delTarget;\n let status: IReturnStatus = {\n res: true,\n msg: \"\",\n };\n try {\n delTarget = Terminal.getFilepath(args[0] + \"\");\n status = server.removeFile(delTarget);\n } catch (err) {\n status = {\n res: false,\n msg: \"No such file exists\",\n };\n }\n\n if (!status.res && status.msg) {\n Terminal.error(status.msg);\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { runScript } from \"./runScript\";\nimport { runProgram } from \"./runProgram\";\n\nexport function run(args: (string | number | boolean)[], server: BaseServer): void {\n // Run a program or a script\n if (args.length < 1) {\n Terminal.error(\"Incorrect number of arguments. Usage: run [program/script] [-t] [num threads] [arg1] [arg2]...\");\n } else {\n const executableName = args[0] + \"\";\n\n // Check if its a script or just a program/executable\n if (isScriptFilename(executableName)) {\n runScript(args, server);\n } else if (executableName.endsWith(\".cct\")) {\n Terminal.runContract(executableName);\n } else {\n runProgram(args, server);\n }\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { LogBoxEvents } from \"../../ui/React/LogBoxManager\";\nimport { startWorkerScript } from \"../../NetscriptWorker\";\nimport { RunningScript } from \"../../Script/RunningScript\";\nimport { findRunningScript } from \"../../Script/ScriptHelpers\";\nimport * as libarg from \"arg\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nexport function runScript(commandArgs: (string | number | boolean)[], server: BaseServer): void {\n if (commandArgs.length < 1) {\n Terminal.error(\n `Bug encountered with Terminal.runScript(). Command array has a length of less than 1: ${commandArgs}`,\n );\n return;\n }\n\n const scriptName = Terminal.getFilepath(commandArgs[0] + \"\");\n\n const runArgs = { \"--tail\": Boolean, \"-t\": Number };\n const flags = libarg(runArgs, {\n permissive: true,\n argv: commandArgs.slice(1),\n });\n const threadFlag = Math.round(parseFloat(flags[\"-t\"]));\n const tailFlag = flags[\"--tail\"] === true;\n if (flags[\"-t\"] !== undefined && (threadFlag < 0 || isNaN(threadFlag))) {\n Terminal.error(\"Invalid number of threads specified. Number of threads must be greater than 0\");\n return;\n }\n const numThreads = !isNaN(threadFlag) && threadFlag > 0 ? threadFlag : 1;\n const args = flags[\"_\"];\n\n // Check if this script is already running\n if (findRunningScript(scriptName, args, server) != null) {\n Terminal.error(\n \"This script is already running with the same args. Cannot run multiple instances with the same args\",\n );\n return;\n }\n\n // Check if the script exists and if it does run it\n for (let i = 0; i < server.scripts.length; i++) {\n if (server.scripts[i].filename !== scriptName) {\n continue;\n }\n // Check for admin rights and that there is enough RAM available to run\n const script = server.scripts[i];\n script.server = server.hostname;\n const ramUsage = script.ramUsage * numThreads;\n const ramAvailable = server.maxRam - server.ramUsed;\n\n if (!server.hasAdminRights) {\n Terminal.error(\"Need root access to run script\");\n return;\n }\n\n if (ramUsage > ramAvailable + 0.001) {\n Terminal.error(\n \"This machine does not have enough RAM to run this script\" +\n (numThreads === 1 ? \"\" : ` with ${numThreads} threads`) +\n `. Script requires ${numeralWrapper.formatRAM(ramUsage)} of RAM`,\n );\n return;\n }\n\n // Able to run script\n const runningScript = new RunningScript(script, args);\n runningScript.threads = numThreads;\n\n const success = startWorkerScript(runningScript, server);\n if (!success) {\n Terminal.error(`Failed to start script`);\n return;\n }\n\n Terminal.print(\n `Running script with ${numThreads} thread(s), pid ${runningScript.pid} and args: ${JSON.stringify(args)}.`,\n );\n if (tailFlag) {\n LogBoxEvents.emit(runningScript);\n }\n return;\n }\n\n Terminal.error(\"No such script\");\n}\n","import { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Programs } from \"../../Programs/Programs\";\n\nexport function runProgram(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length < 1) {\n return;\n }\n\n // Check if you have the program on your computer. If you do, execute it, otherwise\n // display an error message\n const programName = args[0] + \"\";\n\n if (!Player.hasProgram(programName)) {\n Terminal.error(\n `No such (exe, script, js, ns, or cct) file! (Only programs that exist on your home computer or scripts on ${server.hostname} can be run)`,\n );\n return;\n }\n\n if (args.length < 1) {\n return;\n }\n\n for (const program of Object.values(Programs)) {\n if (program.name.toLocaleLowerCase() === programName.toLocaleLowerCase()) {\n program.run(\n args.slice(1).map((arg) => arg + \"\"),\n server,\n );\n return;\n }\n }\n\n Terminal.error(\"Invalid executable. Cannot be run\");\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { getServerOnNetwork } from \"../../Server/ServerHelpers\";\n\nexport function scan(args: (string | number | boolean)[], currServ: BaseServer): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect usage of scan command. Usage: scan\");\n return;\n }\n // Displays available network connections using TCP\n const servers = currServ.serversOnNetwork.map((_, i) => {\n const server = getServerOnNetwork(currServ, i);\n if (server === null) throw new Error(\"Server should not be null\");\n return {\n hostname: server.hostname,\n ip: server.ip,\n hasRoot: server.hasAdminRights ? \"Y\" : \"N\",\n };\n });\n servers.unshift({\n hostname: \"Hostname\",\n ip: \"IP\",\n hasRoot: \"Root Access\",\n });\n const maxHostname = Math.max(...servers.map((s) => s.hostname.length));\n const maxIP = Math.max(...servers.map((s) => s.ip.length));\n for (const server of servers) {\n if (!server) continue;\n let entry = server.hostname;\n entry += \" \".repeat(maxHostname - server.hostname.length + 1);\n entry += server.ip;\n entry += \" \".repeat(maxIP - server.ip.length + 1);\n entry += server.hasRoot;\n Terminal.print(entry);\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\nimport { Programs } from \"../../Programs/Programs\";\n\nexport function scananalyze(args: (string | number | boolean)[]): void {\n if (args.length === 0) {\n Terminal.executeScanAnalyzeCommand();\n } else {\n // # of args must be 2 or 3\n if (args.length > 2) {\n Terminal.error(\"Incorrect usage of scan-analyze command. usage: scan-analyze [depth]\");\n return;\n }\n let all = false;\n if (args.length === 2 && args[1] === \"-a\") {\n all = true;\n }\n\n const depth = parseInt(args[0] + \"\");\n\n if (isNaN(depth) || depth < 0) {\n Terminal.error(\"Incorrect usage of scan-analyze command. depth argument must be positive numeric\");\n return;\n }\n if (depth > 3 && !Player.hasProgram(Programs.DeepscanV1.name) && !Player.hasProgram(Programs.DeepscanV2.name)) {\n Terminal.error(\"You cannot scan-analyze with that high of a depth. Maximum depth is 3\");\n return;\n } else if (depth > 5 && !Player.hasProgram(Programs.DeepscanV2.name)) {\n Terminal.error(\"You cannot scan-analyze with that high of a depth. Maximum depth is 5\");\n return;\n } else if (depth > 10) {\n Terminal.error(\"You cannot scan-analyze with that high of a depth. Maximum depth is 10\");\n return;\n }\n Terminal.executeScanAnalyzeCommand(depth, all);\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\n\nexport function scp(args: (string | number | boolean)[], server: BaseServer): void {\n try {\n if (args.length !== 2) {\n Terminal.error(\"Incorrect usage of scp command. Usage: scp [file] [destination hostname]\");\n return;\n }\n const scriptname = Terminal.getFilepath(args[0] + \"\");\n if (!scriptname.endsWith(\".lit\") && !isScriptFilename(scriptname) && !scriptname.endsWith(\".txt\")) {\n Terminal.error(\"scp only works for scripts, text files (.txt), and literature files (.lit)\");\n return;\n }\n\n const destServer = GetServer(args[1] + \"\");\n if (destServer == null) {\n Terminal.error(`Invalid destination. ${args[1]} not found`);\n return;\n }\n\n // Scp for lit files\n if (scriptname.endsWith(\".lit\")) {\n if (!server.messages.includes(scriptname)) return Terminal.error(\"No such file exists!\");\n\n const onDestServer = destServer.messages.includes(scriptname);\n if (!onDestServer) destServer.messages.push(scriptname);\n return Terminal.print(`${scriptname} ${onDestServer ? \"was already on\" : \"copied to\"} ${destServer.hostname}`);\n }\n\n // Scp for txt files\n if (scriptname.endsWith(\".txt\")) {\n const txtFile = server.textFiles.find((txtFile) => txtFile.fn === scriptname);\n if (!txtFile) return Terminal.error(\"No such file exists!\");\n\n const tRes = destServer.writeToTextFile(txtFile.fn, txtFile.text);\n if (!tRes.success) {\n Terminal.error(\"scp failed\");\n return;\n }\n if (tRes.overwritten) {\n Terminal.print(`WARNING: ${scriptname} already exists on ${destServer.hostname} and will be overwritten`);\n Terminal.print(`${scriptname} overwritten on ${destServer.hostname}`);\n return;\n }\n Terminal.print(`${scriptname} copied over to ${destServer.hostname}`);\n return;\n }\n\n // Get the current script\n const sourceScript = server.scripts.find((script) => script.filename === scriptname);\n if (!sourceScript) {\n Terminal.error(\"scp failed. No such script exists\");\n return;\n }\n\n const sRes = destServer.writeToScriptFile(scriptname, sourceScript.code);\n if (!sRes.success) {\n Terminal.error(`scp failed`);\n return;\n }\n if (sRes.overwritten) {\n Terminal.print(`WARNING: ${scriptname} already exists on ${destServer.hostname} and will be overwritten`);\n Terminal.print(`${scriptname} overwritten on ${destServer.hostname}`);\n return;\n }\n Terminal.print(`${scriptname} copied over to ${destServer.hostname}`);\n } catch (e) {\n Terminal.error(e + \"\");\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nexport function sudov(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect number of arguments. Usage: sudov\");\n return;\n }\n\n if (server.hasAdminRights) {\n Terminal.print(\"You have ROOT access to this machine\");\n } else {\n Terminal.print(\"You do NOT have root access to this machine\");\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { findRunningScriptByPid } from \"../../Script/ScriptHelpers\";\nimport { isScriptFilename, validScriptExtensions } from \"../../Script/isScriptFilename\";\nimport { compareArrays } from \"../../utils/helpers/compareArrays\";\nimport { LogBoxEvents } from \"../../ui/React/LogBoxManager\";\n\nexport function tail(commandArray: (string | number | boolean)[], server: BaseServer): void {\n try {\n if (commandArray.length < 1) {\n Terminal.error(\"Incorrect number of arguments. Usage: tail [script] [arg1] [arg2]...\");\n } else if (typeof commandArray[0] === \"string\") {\n const scriptName = Terminal.getFilepath(commandArray[0]);\n if (!isScriptFilename(scriptName)) {\n Terminal.error(`tail can only be called on ${validScriptExtensions.join(\", \")} files, or by PID`);\n return;\n }\n\n // Get script arguments\n const args = [];\n for (let i = 1; i < commandArray.length; ++i) {\n args.push(commandArray[i]);\n }\n\n // go over all the running scripts. If there's a perfect\n // match, use it!\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename === scriptName && compareArrays(server.runningScripts[i].args, args)) {\n LogBoxEvents.emit(server.runningScripts[i]);\n return;\n }\n }\n\n // Find all scripts that are potential candidates.\n const candidates = [];\n for (let i = 0; i < server.runningScripts.length; ++i) {\n // only scripts that have more arguments (equal arguments is already caught)\n if (server.runningScripts[i].args.length < args.length) continue;\n // make a smaller copy of the args.\n const args2 = server.runningScripts[i].args.slice(0, args.length);\n if (server.runningScripts[i].filename === scriptName && compareArrays(args2, args)) {\n candidates.push(server.runningScripts[i]);\n }\n }\n\n // If there's only 1 possible choice, use that.\n if (candidates.length === 1) {\n LogBoxEvents.emit(candidates[0]);\n return;\n }\n\n // otherwise lists all possible conflicting choices.\n if (candidates.length > 1) {\n Terminal.error(\"Found several potential candidates:\");\n for (const candidate of candidates) Terminal.error(`${candidate.filename} ${candidate.args.join(\" \")}`);\n Terminal.error(\"Script arguments need to be specified.\");\n return;\n }\n\n // if there's no candidate then we just don't know.\n Terminal.error(`No script named ${scriptName} is running on the server`);\n } else if (typeof commandArray[0] === \"number\") {\n const runningScript = findRunningScriptByPid(commandArray[0], server);\n if (runningScript == null) {\n Terminal.error(`No script with PID ${commandArray[0]} is running on the server`);\n return;\n }\n LogBoxEvents.emit(runningScript);\n }\n } catch (e) {\n Terminal.error(e + \"\");\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { getRamUsageFromRunningScript } from \"../../Script/RunningScriptHelpers\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nexport function top(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect usage of top command. Usage: top\");\n return;\n }\n\n // Headers\n const scriptWidth = 40;\n const pidWidth = 10;\n const threadsWidth = 16;\n\n const scriptTxt = \"Script\";\n const pidTxt = \"PID\";\n const threadsTxt = \"Threads\";\n const ramTxt = \"RAM Usage\";\n\n const spacesAfterScriptTxt = \" \".repeat(scriptWidth - scriptTxt.length);\n const spacesAfterPidTxt = \" \".repeat(pidWidth - pidTxt.length);\n const spacesAfterThreadsTxt = \" \".repeat(threadsWidth - threadsTxt.length);\n\n const headers = `${scriptTxt}${spacesAfterScriptTxt}${pidTxt}${spacesAfterPidTxt}${threadsTxt}${spacesAfterThreadsTxt}${ramTxt}`;\n\n Terminal.print(headers);\n\n const currRunningScripts = server.runningScripts;\n // Iterate through scripts on current server\n for (let i = 0; i < currRunningScripts.length; i++) {\n const script = currRunningScripts[i];\n\n // Calculate name padding\n const numSpacesScript = Math.max(0, scriptWidth - script.filename.length);\n const spacesScript = \" \".repeat(numSpacesScript);\n\n // Calculate PID padding\n const numSpacesPid = Math.max(0, pidWidth - (script.pid + \"\").length);\n const spacesPid = \" \".repeat(numSpacesPid);\n\n // Calculate thread padding\n const numSpacesThread = Math.max(0, threadsWidth - (script.threads + \"\").length);\n const spacesThread = \" \".repeat(numSpacesThread);\n\n // Calculate and transform RAM usage\n const ramUsage = numeralWrapper.formatRAM(getRamUsageFromRunningScript(script) * script.threads);\n\n const entry = [script.filename, spacesScript, script.pid, spacesPid, script.threads, spacesThread, ramUsage].join(\n \"\",\n );\n Terminal.print(entry);\n }\n}\n","import { Terminal } from \"../../Terminal\";\nimport { removeAlias } from \"../../Alias\";\n\nexport function unalias(args: (string | number | boolean)[]): void {\n if (args.length !== 1) {\n Terminal.error(\"Incorrect usage of unalias name. Usage: unalias [alias]\");\n return;\n } else if (removeAlias(args[0] + \"\")) {\n Terminal.print(`Removed alias ${args[0]}`);\n } else {\n Terminal.error(`No such alias exists: ${args[0]}`);\n }\n}\n","import { BaseServer } from \"../../Server/BaseServer\";\n\nimport { commonEditor } from \"./common/editor\";\n\nexport function vim(args: (string | number | boolean)[], server: BaseServer): void {\n return commonEditor(\"vim\", { args, server }, { vim: true });\n}\n","import { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\n\nexport function weaken(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 0) {\n Terminal.error(\"Incorrect usage of weaken command. Usage: weaken\");\n return;\n }\n\n if (!(server instanceof Server)) {\n Terminal.error(\n \"Cannot weaken your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n }\n const normalServer = server as Server;\n // Hack the current PC (usually for money)\n // You can't weaken your home pc or servers you purchased\n if (normalServer.purchasedByPlayer) {\n Terminal.error(\n \"Cannot weaken your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n return;\n }\n if (!normalServer.hasAdminRights) {\n Terminal.error(\"You do not have admin rights for this machine! Cannot weaken\");\n return;\n }\n if (normalServer.requiredHackingSkill > Player.skills.hacking) {\n Terminal.error(\n \"Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill\",\n );\n return;\n }\n Terminal.startWeaken();\n}\n","import $ from \"jquery\";\n\nimport { Terminal } from \"../../Terminal\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\n\nexport function wget(args: (string | number | boolean)[], server: BaseServer): void {\n if (args.length !== 2) {\n Terminal.error(\"Incorrect usage of wget command. Usage: wget [url] [target file]\");\n return;\n }\n\n const url = args[0] + \"\";\n const target = Terminal.getFilepath(args[1] + \"\");\n if (!isScriptFilename(target) && !target.endsWith(\".txt\")) {\n return Terminal.error(`wget failed: Invalid target file. Target file must be script or text file`);\n }\n $.get(\n url,\n function (data: unknown) {\n let res;\n if (isScriptFilename(target)) {\n res = server.writeToScriptFile(target, String(data));\n } else {\n res = server.writeToTextFile(target, String(data));\n }\n if (!res.success) {\n return Terminal.error(\"wget failed\");\n }\n if (res.overwritten) {\n return Terminal.print(`wget successfully retrieved content and overwrote ${target}`);\n }\n return Terminal.print(`wget successfully retrieved content to new file ${target}`);\n },\n \"text\",\n ).fail(function (e) {\n return Terminal.error(\"wget failed: \" + JSON.stringify(e));\n });\n}\n","import { Apr1Events } from \"../../ui/Apr1\";\n\nexport function apr1(): void {\n Apr1Events.emit();\n}\n","import { PlayerOwnedSourceFile } from \"./PlayerOwnedSourceFile\";\nimport { SourceFiles } from \"./SourceFiles\";\n\nimport { Player } from \"@player\";\n\nexport function applySourceFile(srcFile: PlayerOwnedSourceFile): void {\n const srcFileKey = \"SourceFile\" + srcFile.n;\n const sourceFileObject = SourceFiles[srcFileKey];\n if (sourceFileObject == null) {\n console.error(`Invalid source file number: ${srcFile.n}`);\n return;\n }\n\n switch (srcFile.n) {\n case 1: {\n // The Source Genesis\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 16 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n const decMult = 1 - mult / 100;\n Player.mults.hacking_chance *= incMult;\n Player.mults.hacking_speed *= incMult;\n Player.mults.hacking_money *= incMult;\n Player.mults.hacking_grow *= incMult;\n Player.mults.hacking *= incMult;\n Player.mults.strength *= incMult;\n Player.mults.defense *= incMult;\n Player.mults.dexterity *= incMult;\n Player.mults.agility *= incMult;\n Player.mults.charisma *= incMult;\n Player.mults.hacking_exp *= incMult;\n Player.mults.strength_exp *= incMult;\n Player.mults.defense_exp *= incMult;\n Player.mults.dexterity_exp *= incMult;\n Player.mults.agility_exp *= incMult;\n Player.mults.charisma_exp *= incMult;\n Player.mults.company_rep *= incMult;\n Player.mults.faction_rep *= incMult;\n Player.mults.crime_money *= incMult;\n Player.mults.crime_success *= incMult;\n Player.mults.hacknet_node_money *= incMult;\n Player.mults.hacknet_node_purchase_cost *= decMult;\n Player.mults.hacknet_node_ram_cost *= decMult;\n Player.mults.hacknet_node_core_cost *= decMult;\n Player.mults.hacknet_node_level_cost *= decMult;\n Player.mults.work_money *= incMult;\n break;\n }\n case 2: {\n // Rise of the Underworld\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 24 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.mults.crime_money *= incMult;\n Player.mults.crime_success *= incMult;\n Player.mults.charisma *= incMult;\n break;\n }\n case 3: {\n // Corporatocracy\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 8 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.mults.charisma *= incMult;\n Player.mults.work_money *= incMult;\n break;\n }\n case 4: {\n // The Singularity\n // No effects, just gives access to Singularity functions\n break;\n }\n case 5: {\n // Artificial Intelligence\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 8 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.mults.hacking_chance *= incMult;\n Player.mults.hacking_speed *= incMult;\n Player.mults.hacking_money *= incMult;\n Player.mults.hacking_grow *= incMult;\n Player.mults.hacking *= incMult;\n Player.mults.hacking_exp *= incMult;\n break;\n }\n case 6: {\n // Bladeburner\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 8 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.mults.strength_exp *= incMult;\n Player.mults.defense_exp *= incMult;\n Player.mults.dexterity_exp *= incMult;\n Player.mults.agility_exp *= incMult;\n Player.mults.strength *= incMult;\n Player.mults.defense *= incMult;\n Player.mults.dexterity *= incMult;\n Player.mults.agility *= incMult;\n break;\n }\n case 7: {\n // Bladeburner 2079\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 8 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.mults.bladeburner_max_stamina *= incMult;\n Player.mults.bladeburner_stamina_gain *= incMult;\n Player.mults.bladeburner_analysis *= incMult;\n Player.mults.bladeburner_success_chance *= incMult;\n break;\n }\n case 8: {\n // Ghost of Wall Street\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 12 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.mults.hacking_grow *= incMult;\n break;\n }\n case 9: {\n // Hacktocracy\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 8 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n const decMult = 1 - mult / 100;\n Player.mults.hacknet_node_core_cost *= decMult;\n Player.mults.hacknet_node_level_cost *= decMult;\n Player.mults.hacknet_node_money *= incMult;\n Player.mults.hacknet_node_purchase_cost *= decMult;\n Player.mults.hacknet_node_ram_cost *= decMult;\n break;\n }\n case 10: {\n // Digital Carbon\n // No effects, just grants sleeves\n break;\n }\n case 11: {\n // The Big Crash\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 32 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.mults.work_money *= incMult;\n Player.mults.company_rep *= incMult;\n break;\n }\n case 12: // The Recursion\n // Grants neuroflux.\n break;\n case 13: // They're Lunatics\n // Grants more space on Stanek's Gift.\n break;\n default:\n console.error(`Invalid source file number: ${srcFile.n}`);\n break;\n }\n\n sourceFileObject.owned = true;\n}\n","import { Player } from \"@player\";\nimport { sanitizeExploits } from \"./Exploit\";\n\nexport function applyExploit(): void {\n if (Player.exploits && Player.exploits.length === 0) {\n return;\n }\n Player.exploits = sanitizeExploits(Player.exploits);\n const inc = Math.pow(1.001, Player.exploits.length);\n const dec = Math.pow(0.999, Player.exploits.length);\n\n Player.mults.hacking_chance *= inc;\n Player.mults.hacking_speed *= inc;\n Player.mults.hacking_money *= inc;\n Player.mults.hacking_grow *= inc;\n Player.mults.hacking *= inc;\n\n Player.mults.strength *= inc;\n Player.mults.defense *= inc;\n Player.mults.dexterity *= inc;\n Player.mults.agility *= inc;\n Player.mults.charisma *= inc;\n\n Player.mults.hacking_exp *= inc;\n Player.mults.strength_exp *= inc;\n Player.mults.defense_exp *= inc;\n Player.mults.dexterity_exp *= inc;\n Player.mults.agility_exp *= inc;\n Player.mults.charisma_exp *= inc;\n\n Player.mults.company_rep *= inc;\n Player.mults.faction_rep *= inc;\n\n Player.mults.crime_money *= inc;\n Player.mults.crime_success *= inc;\n\n Player.mults.hacknet_node_money *= inc;\n Player.mults.hacknet_node_purchase_cost *= dec;\n Player.mults.hacknet_node_ram_cost *= dec;\n Player.mults.hacknet_node_core_cost *= dec;\n Player.mults.hacknet_node_level_cost *= dec;\n\n Player.mults.work_money *= inc;\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Button from \"@mui/material/Button\";\nimport ArrowForwardIos from \"@mui/icons-material/ArrowForwardIos\";\nimport ArrowBackIos from \"@mui/icons-material/ArrowBackIos\";\nimport { ITutorialEvents } from \"./ITutorialEvents\";\nimport { CopyableText } from \"../React/CopyableText\";\n\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport AccountTreeIcon from \"@mui/icons-material/AccountTree\";\nimport StorageIcon from \"@mui/icons-material/Storage\";\nimport LocationCityIcon from \"@mui/icons-material/LocationCity\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nimport {\n iTutorialPrevStep,\n iTutorialNextStep,\n ITutorial,\n iTutorialSteps,\n iTutorialEnd,\n} from \"../../InteractiveTutorial\";\nimport { NSSelection } from \"./NSSelection\";\n\ninterface IContent {\n content: React.ReactElement;\n canNext: boolean;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n borderBottom: \"1px solid \" + theme.palette.primary.main,\n },\n code: {\n whiteSpace: \"pre\",\n backgroundColor: theme.palette.background.paper,\n },\n }),\n);\n\nenum Language {\n None,\n NS1,\n NS2,\n}\n\nexport function InteractiveTutorialRoot(): React.ReactElement {\n const [nsSelectionOpen, setNSSelectionOpen] = useState(false);\n const [language, setLanguage] = useState(Language.None);\n const classes = useStyles();\n\n const tutorialScriptExtension = {\n [Language.None]: \".script\",\n [Language.NS1]: \".script\",\n [Language.NS2]: \".js\",\n }[language];\n const tutorialScriptName = `n00dles${tutorialScriptExtension}`;\n\n const contents: { [number: string]: IContent | undefined } = {\n [iTutorialSteps.Start as number]: {\n content: (\n <>\n <Typography>\n Welcome to Bitburner, a cyberpunk-themed incremental RPG! The game takes place in a dark, dystopian\n future... The year is 2077...\n <br />\n <br />\n This tutorial will show you the basics of the game. You may skip the tutorial at any time.\n <br />\n <br />\n You can also collapse this panel to temporarily hide this tutorial.\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.NSSelection as number]: {\n content: (\n <>\n <Typography>The tutorial will adjust to your programming ability.</Typography>\n <Typography>Bitburner has 2 types of scripts:</Typography>\n <List>\n <ListItem>\n <Typography>NS1: Javascript from 2009, very simple. Recommended for beginners to programming.</Typography>\n </ListItem>\n <ListItem>\n <Typography>\n NS2: Native, modern Javascript. Recommended if you know any programming language or are serious about\n learning programming.\n </Typography>\n </ListItem>\n </List>\n <Typography>\n Both are available at all time and interchangeably. This choice is only for the tutorial.\n </Typography>\n <Button\n onClick={() => {\n setLanguage(Language.NS1);\n iTutorialNextStep();\n }}\n >\n Use NS1\n </Button>\n <Button\n onClick={() => {\n setLanguage(Language.NS2);\n iTutorialNextStep();\n }}\n >\n Use NS2\n </Button>\n <Button onClick={() => setNSSelectionOpen(true)}>More info</Button>\n <br />\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.GoToCharacterPage as number]: {\n content: (\n <>\n <Typography>Let's start by heading to the Stats page. Click</Typography>\n <ListItem>\n <EqualizerIcon color={\"error\"} />\n <Typography color={\"error\"}>Stats</Typography>\n </ListItem>\n\n <Typography>on the main navigation menu (left-hand side of the screen)</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.CharacterPage as number]: {\n content: (\n <>\n <ListItem>\n <EqualizerIcon color={\"primary\"} />\n <Typography color={\"primary\"}>Stats</Typography>\n </ListItem>\n <Typography>\n shows a lot of important information about your progress, such as your skills, money, and bonuses.\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.CharacterGoToTerminalPage as number]: {\n content: (\n <>\n <Typography>Let's head to your computer's terminal by clicking</Typography>\n <ListItem>\n <LastPageIcon color={\"error\"} />\n <Typography color={\"error\"}>Terminal</Typography>\n </ListItem>\n <Typography>on the main navigation menu.</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalIntro as number]: {\n content: (\n <>\n <ListItem>\n <LastPageIcon color={\"primary\"} />\n <Typography color={\"primary\"}>Terminal</Typography>\n </ListItem>\n <Typography>\n is used to interface with your home computer as well as all of the other machines around the world.\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalHelp as number]: {\n content: (\n <>\n <Typography>Let's try it out. Start by entering</Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> help\"}</Typography>\n <Typography>(Don't forget to press Enter after typing the command)</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalLs as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> help\"}</Typography>\n <Typography>\n displays a list of all available Terminal commands, how to use them, and a description of what they do.{\" \"}\n <br />\n <br />\n Let's try another command. Enter\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> ls\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScan as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> ls\"}</Typography>\n <Typography>\n {\" \"}\n is a basic command that shows files on the computer. Right now, it shows that you have a program called{\" \"}\n NUKE.exe on your computer. We'll get to what this does later. <br />\n <br />\n Using your home computer's terminal, you can connect to other machines throughout the world. Let's do that\n now by first entering\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScanAnalyze1 as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan\"}</Typography>\n <Typography>\n shows all available network connections. In other words, it displays a list of all servers that can be\n connected to from your current machine. A server is identified by its hostname. <br />\n <br />\n That's great and all, but there's so many servers. Which one should you go to?{\" \"}\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze\"}</Typography>\n <Typography>gives some more detailed information about servers on the network. Try it now!</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScanAnalyze2 as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze\"}</Typography>\n <Typography>\n shows more detailed information about each server that you can connect to (servers that are a distance of\n one node away). <br />\n <br /> It is also possible to run scan-analyze with a higher depth. Let's try a depth of two with the\n following command:{\" \"}\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze 2\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalConnect as number]: {\n content: (\n <>\n <Typography>\n Now you can see information about all servers that are up to two nodes away, as well as figure out how to\n navigate to those servers through the network. You can only connect to a server that is one node away. To\n connect to a machine, use\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> connect hostname\"}</Typography>\n\n <Typography>From the results of </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze 2\"}</Typography>\n\n <Typography>\n {\" \"}\n we can see that the n00dles server is only one node away. Let's connect to it now using:\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> connect n00dles\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalAnalyze as number]: {\n content: (\n <>\n <Typography>\n You are now connected to another machine! What can you do now? You can hack it!\n <br />\n <br /> In the year 2077, currency has become digital and decentralized. People and corporations store their\n money on servers and computers. Using your hacking abilities, you can hack servers to steal money and gain\n experience. <br />\n <br />\n Before you try to hack a server, you should run diagnostics using{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> analyze\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalNuke as number]: {\n content: (\n <>\n <Typography>When </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> analyze\"}</Typography>\n\n <Typography>\n finishes running it will show useful information about hacking the server. <br />\n <br /> For this server, the required hacking skill is only 1, which means you can hack it right now.\n However, in order to hack a server you must first gain root access. The NUKE.exe program that we saw earlier\n on your home computer is a virus that will grant you root access to a machine if there are enough open\n ports.\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> analyze\"}</Typography>\n\n <Typography>\n {\" \"}\n shows that there do not need to be any open ports on this machine for the NUKE virus to work, so go ahead\n and run the virus using{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> run NUKE.exe\"}</Typography>\n\n <Typography></Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalManualHack as number]: {\n content: (\n <>\n <Typography>You now have root access! You can hack the server using </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> hack\"}</Typography>\n\n <Typography> Try doing that now.</Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalHackingMechanics as number]: {\n content: (\n <Typography>\n You are now attempting to hack the server. Performing a hack takes time and only has a certain percentage\n chance of success. This time and success chance is determined by a variety of factors, including your hacking\n skill and the server's security level.\n <br />\n <br />\n If your attempt to hack the server is successful, you will steal a certain percentage of the server's total\n money. This percentage is affected by your hacking skill and the server's security level.\n <br />\n <br />\n The amount of money on a server is not limitless. So, if you constantly hack a server and deplete its money,\n then you will encounter diminishing returns in your hacking. You will need to use{\" \"}\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> grow\"}</Typography>\n which tricks the company into adding money to their server and{\" \"}\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> weaken\"}</Typography>\n which increases the speed of hack and grow.\n </Typography>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalGoHome as number]: {\n content: (\n <>\n <Typography>From any server you can get back home using</Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> home\"}</Typography>\n\n <Typography>Let's head home before creating our first script!</Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalCreateScript as number]: {\n content: (\n <>\n <Typography>\n Hacking is the core mechanic of the game and is necessary for progressing. However, you don't want to be\n hacking manually the entire time. You can automate your hacking by writing scripts!\n <br />\n <br />\n To create a new script or edit an existing one, you can use{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> nano\"}</Typography>\n\n <Typography>\n Scripts must end with the {tutorialScriptExtension} extension. Let's make a script now by entering{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{`[home ~/]> nano ${tutorialScriptName}`}</Typography>\n\n <Typography>\n after the hack command finishes running (Sidenote: Pressing ctrl + c will end a command like hack early)\n </Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalTypeScript as number]: {\n content: (\n <>\n <Typography>\n This is the script editor. You can use it to program your scripts.{\" \"}\n {language !== Language.NS2 && <>Scripts are written in a simplified version of javascript.</>} Copy and\n paste the following code into the script editor: <br />\n </Typography>\n\n <Typography classes={{ root: classes.code }}>\n {language !== Language.NS2 && (\n <CopyableText\n value={`while(true) {\n hack('n00dles');\n}`}\n />\n )}\n {language === Language.NS2 && (\n <CopyableText\n value={`export async function main(ns) {\n\twhile(true) {\n\t\tawait ns.hack('n00dles');\n\t}\n}`}\n />\n )}\n </Typography>\n <Typography>\n For anyone with basic programming experience, this code should be straightforward. This script will\n continuously hack the n00dles server.\n <br />\n <br />\n To save and close the script editor, press the button in the bottom left, or press ctrl + s then ctrl + b.\n </Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalFree as number]: {\n content: (\n <>\n <Typography>\n Now we'll run the script. Scripts require a certain amount of RAM to run, and can be run on any machine\n which you have root access to. Different servers have different amounts of RAM. You can also purchase more\n RAM for your home server.\n <br />\n <br />\n To check how much RAM is available on this machine, enter\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> free\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalRunScript as number]: {\n content: (\n <>\n <Typography>\n We have 4GB of free RAM on this machine, which is enough to run our script. Let's run our script using\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{`[home ~/]> run ${tutorialScriptName}`}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalGoToActiveScriptsPage as number]: {\n content: (\n <>\n <Typography>\n Your script is now running! It will continuously run in the background and will automatically stop if the\n code ever completes (the {tutorialScriptName} will never complete because it runs an infinite loop). <br />\n <br />\n These scripts can passively earn you income and hacking experience. Your scripts will also earn money and\n experience while you are offline, although at a slightly slower rate. <br />\n <br />\n Let's check out some statistics for our running scripts by clicking{\" \"}\n </Typography>\n <ListItem>\n <StorageIcon color={\"error\"} />\n <Typography color={\"error\"}>Active Scripts</Typography>\n </ListItem>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.ActiveScriptsPage as number]: {\n content: (\n <>\n <Typography>\n This page displays information about all of your scripts that are running across every server. You can use\n this to gauge how well your scripts are doing. Let's go back to\n </Typography>\n <ListItem>\n <LastPageIcon color={\"error\"} />\n <Typography color={\"error\"}>Terminal</Typography>\n </ListItem>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.ActiveScriptsToTerminal as number]: {\n content: (\n <>\n <Typography>\n One last thing about scripts, each active script contains logs that detail what it's doing. We can check\n these logs using the tail command. Do that now for the script we just ran by typing{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{`[home ~/]> tail ${tutorialScriptName}`}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalTailScript as number]: {\n content: (\n <>\n <Typography>\n The log for this script won't show much right now (it might show nothing at all) because it just started\n running...but check back again in a few minutes! <br />\n <br />\n This covers the basics of hacking. To learn more about writing scripts, select\n </Typography>\n <ListItem>\n <HelpIcon color={\"primary\"} />\n <Typography color={\"primary\"}>Tutorial</Typography>\n </ListItem>\n <Typography>\n in the main navigation menu to look at the documentation.\n <br />\n <br />\n For now, let's move on to something else!\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.GoToHacknetNodesPage as number]: {\n content: (\n <>\n <Typography>\n Hacking is not the only way to earn money. One other way to passively earn money is by purchasing and\n upgrading Hacknet Nodes. Let's go to\n </Typography>\n <ListItem>\n <AccountTreeIcon color={\"error\"} />\n <Typography color={\"error\"}>Hacknet</Typography>\n </ListItem>\n <Typography>through the main navigation menu now.</Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.HacknetNodesIntroduction as number]: {\n content: (\n <Typography>\n Here you can purchase new Hacknet Nodes and upgrade your existing ones. Let's purchase a new one now.\n </Typography>\n ),\n canNext: true,\n },\n [iTutorialSteps.HacknetNodesGoToWorldPage as number]: {\n content: (\n <>\n <Typography>\n You just purchased a Hacknet Node! This Hacknet Node will passively earn you money over time, both online\n and offline. When you get enough money, you can upgrade your newly-purchased Hacknet Node below.\n <br />\n <br />\n Let's go to\n </Typography>\n <ListItem>\n <LocationCityIcon color={\"error\"} />\n <Typography color={\"error\"}>City</Typography>\n </ListItem>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.WorldDescription as number]: {\n content: (\n <>\n <Typography>\n This page lists all of the different locations you can currently travel to. Each location has something that\n you can do. There's a lot of content out in the world, make sure you explore and discover!\n <br />\n <br />\n Lastly, click on\n </Typography>\n <ListItem>\n <HelpIcon color={\"error\"} />\n <Typography color={\"error\"}>Tutorial</Typography>\n </ListItem>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TutorialPageInfo as number]: {\n content: (\n <Typography>\n This page contains a lot of different documentation about the game's content and mechanics. I know it's a lot,\n but I highly suggest you read (or at least skim) through this before you start playing . That's the end of the\n tutorial. Hope you enjoy the game!\n </Typography>\n ),\n canNext: true,\n },\n [iTutorialSteps.End as number]: {\n content: <Typography></Typography>,\n canNext: true,\n },\n };\n\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n return ITutorialEvents.subscribe(rerender);\n }, []);\n const step = ITutorial.currStep;\n const content = contents[step];\n if (content === undefined) throw new Error(\"error in the tutorial\");\n return (\n <>\n <NSSelection open={nsSelectionOpen} onClose={() => setNSSelectionOpen(false)} />\n <Paper square sx={{ maxWidth: \"70vw\", p: 2 }}>\n {content.content}\n {step !== iTutorialSteps.TutorialPageInfo && (\n <>\n {step !== iTutorialSteps.Start && (\n <IconButton onClick={iTutorialPrevStep} aria-label=\"previous\">\n <ArrowBackIos />\n </IconButton>\n )}\n {(content.canNext || ITutorial.stepIsDone[step]) && (\n <IconButton onClick={iTutorialNextStep} aria-label=\"next\">\n <ArrowForwardIos />\n </IconButton>\n )}\n </>\n )}\n <br />\n <br />\n <Button onClick={iTutorialEnd}>\n {step !== iTutorialSteps.TutorialPageInfo ? \"SKIP TUTORIAL\" : \"FINISH TUTORIAL\"}\n </Button>\n </Paper>\n </>\n );\n}\n","import Editor from \"@monaco-editor/react\";\nimport { Tab, Tabs, Typography } from \"@mui/material\";\nimport React from \"react\";\n\nimport { Modal } from \"../React/Modal\";\n\nimport * as monaco from \"monaco-editor\";\n\ntype IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nconst ns1Example = `while(true) {\n hack('n00dles');\n}`;\nconst ns2Example = `/** @param {NS} ns */\nexport async function main(ns) {\n\twhile(true) {\n\t\tawait ns.hack('n00dles');\n\t}\n}`;\n\nexport function NSSelection(props: IProps): React.ReactElement {\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n function onMount(editor: IStandaloneCodeEditor): void {\n editor.updateOptions({ readOnly: true });\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose} sx={{ zIndex: 999999 }}>\n <Tabs variant=\"fullWidth\" value={value} onChange={handleChange}>\n <Tab label=\"NS1\" />\n <Tab label=\"NS2\" />\n </Tabs>\n\n {value === 0 && (\n <>\n <Typography>\n These scripts end with '.script'. Using a very old interpreted version of javascript. It is perfect for\n beginner to programming.\n </Typography>\n <Typography>Example script using NS1:</Typography>\n <Editor\n loading={<></>}\n defaultLanguage=\"javascript\"\n defaultValue={ns1Example}\n height={`${300}px`}\n theme={\"vs-dark\"}\n onMount={onMount}\n options={{ fontSize: 30 }}\n />\n </>\n )}\n {value === 1 && (\n <>\n <Typography>\n These scripts end with '.js'. Scripts using ns2 are running natively along the game. If you know any\n programming language you should be using this. However if you're unfamiliar with javascript Promises you\n might want to read up on them a little bit before diving in.\n </Typography>\n <Typography>Example script using NS2:</Typography>\n <Editor\n loading={<></>}\n defaultLanguage=\"javascript\"\n defaultValue={ns2Example}\n height={`${300}px`}\n theme={\"vs-dark\"}\n options={{ fontSize: 30 }}\n />\n </>\n )}\n </Modal>\n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Draggable, { DraggableEventHandler } from \"react-draggable\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport Collapse from \"@mui/material/Collapse\";\nimport Paper from \"@mui/material/Paper\";\nimport KeyboardArrowDownIcon from \"@mui/icons-material/KeyboardArrowDown\";\nimport KeyboardArrowUpIcon from \"@mui/icons-material/KeyboardArrowUp\";\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\";\nimport SchoolIcon from \"@mui/icons-material/School\";\nimport { Router } from \"../GameRoot\";\nimport { Page } from \"../Router\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Box, Button, Typography } from \"@mui/material\";\nimport { debounce } from \"lodash\";\n\nconst useStyles = makeStyles({\n overviewContainer: {\n position: \"fixed\",\n top: 0,\n right: 0,\n zIndex: 1500,\n display: \"flex\",\n justifyContent: \"flex-end\",\n flexDirection: \"column\",\n },\n\n header: {\n cursor: \"grab\",\n textAlign: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n\n visibilityToggle: {\n padding: \"2px\",\n minWidth: \"inherit\",\n backgroundColor: \"transparent\",\n border: \"none\",\n \"&:hover\": {\n backgroundColor: \"rgba(255, 255, 255, 0.1)\",\n },\n },\n\n collapse: {\n borderTop: `1px solid ${Settings.theme.welllight}`,\n margin: \"0 auto\",\n },\n\n icon: {\n fontSize: \"24px\",\n },\n});\n\ninterface IProps {\n children: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n mode: \"tutorial\" | \"overview\";\n}\n\nexport interface OverviewSettings {\n opened: boolean;\n x: number;\n y: number;\n}\n\nexport function Overview({ children, mode }: IProps): React.ReactElement {\n const draggableRef = useRef<HTMLDivElement>(null);\n const [open, setOpen] = useState(Settings.overview.opened);\n const [x, setX] = useState(Settings.overview.x);\n const [y, setY] = useState(Settings.overview.y);\n const classes = useStyles();\n\n const CurrentIcon = open ? KeyboardArrowUpIcon : KeyboardArrowDownIcon;\n const LeftIcon = mode === \"tutorial\" ? SchoolIcon : EqualizerIcon;\n const header = mode === \"tutorial\" ? \"Tutorial\" : \"Overview\";\n const handleStop: DraggableEventHandler = (e, data) => {\n setX(data.x);\n setY(data.y);\n };\n\n useEffect(() => {\n Settings.overview = { x, y, opened: open };\n }, [open, x, y]);\n\n // Trigger fakeDrag once to make sure loaded data is not outside bounds\n useEffect(() => fakeDrag(), []);\n\n // And trigger fakeDrag when the window is resized\n useEffect(() => {\n window.addEventListener(\"resize\", fakeDrag);\n return () => {\n window.removeEventListener(\"resize\", fakeDrag);\n };\n }, []);\n\n const fakeDrag = debounce((): void => {\n const node = draggableRef?.current;\n if (!node) return;\n\n // No official way to trigger an onChange to recompute the bounds\n // See: https://github.com/react-grid-layout/react-draggable/issues/363#issuecomment-947751127\n triggerMouseEvent(node, \"mouseover\");\n triggerMouseEvent(node, \"mousedown\");\n triggerMouseEvent(document, \"mousemove\");\n triggerMouseEvent(node, \"mouseup\");\n triggerMouseEvent(node, \"click\");\n }, 100);\n\n const triggerMouseEvent = (node: HTMLDivElement | Document, eventType: string): void => {\n const clickEvent = document.createEvent(\"MouseEvents\");\n clickEvent.initEvent(eventType, true, true);\n node.dispatchEvent(clickEvent);\n };\n\n if (Router.page() === Page.BitVerse || Router.page() === Page.Loading || Router.page() === Page.Recovery)\n return <></>;\n return (\n <Draggable handle=\".drag\" bounds=\"body\" onStop={handleStop} defaultPosition={{ x, y }}>\n <Paper className={classes.overviewContainer} square>\n <Box className=\"drag\" onDoubleClick={() => setOpen((old) => !old)} ref={draggableRef}>\n <Box className={classes.header}>\n <LeftIcon color=\"secondary\" className={classes.icon} sx={{ padding: \"2px\" }} />\n <Typography flexGrow={1} color=\"secondary\">\n {header}\n </Typography>\n <Button\n aria-label=\"expand or collapse character overview\"\n variant=\"text\"\n size=\"small\"\n className={classes.visibilityToggle}\n >\n {\n <CurrentIcon\n className={classes.icon}\n color=\"secondary\"\n onClick={() => setOpen((old) => !old)}\n onTouchEnd={() => setOpen((old) => !old)}\n />\n }\n </Button>\n </Box>\n </Box>\n <Collapse in={open} className={classes.collapse}>\n {children}\n </Collapse>\n </Paper>\n </Draggable>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { KEYCODE } from \"../../utils/helpers/keyCodes\";\nimport clsx from \"clsx\";\nimport { styled, Theme, CSSObject } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport MuiDrawer from \"@mui/material/Drawer\";\nimport List from \"@mui/material/List\";\nimport Divider from \"@mui/material/Divider\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\nimport ChevronRightIcon from \"@mui/icons-material/ChevronRight\";\nimport ListItem from \"@mui/material/ListItem\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Typography from \"@mui/material/Typography\";\nimport Collapse from \"@mui/material/Collapse\";\nimport Badge from \"@mui/material/Badge\";\n\nimport ComputerIcon from \"@mui/icons-material/Computer\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\"; // Terminal\nimport CreateIcon from \"@mui/icons-material/Create\"; // Create Script\nimport StorageIcon from \"@mui/icons-material/Storage\"; // Active Scripts\nimport BugReportIcon from \"@mui/icons-material/BugReport\"; // Create Program\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\"; // Stats\nimport ContactsIcon from \"@mui/icons-material/Contacts\"; // Factions\nimport DoubleArrowIcon from \"@mui/icons-material/DoubleArrow\"; // Augmentations\nimport AccountTreeIcon from \"@mui/icons-material/AccountTree\"; // Hacknet\nimport PeopleAltIcon from \"@mui/icons-material/PeopleAlt\"; // Sleeves\nimport LocationCityIcon from \"@mui/icons-material/LocationCity\"; // City\nimport AirplanemodeActiveIcon from \"@mui/icons-material/AirplanemodeActive\"; // Travel\nimport WorkIcon from \"@mui/icons-material/Work\"; // Job\nimport TrendingUpIcon from \"@mui/icons-material/TrendingUp\"; // Stock Market\nimport FormatBoldIcon from \"@mui/icons-material/FormatBold\"; // Bladeburner\nimport BusinessIcon from \"@mui/icons-material/Business\"; // Corp\nimport SportsMmaIcon from \"@mui/icons-material/SportsMma\"; // Gang\nimport CheckIcon from \"@mui/icons-material/Check\"; // Milestones\nimport HelpIcon from \"@mui/icons-material/Help\"; // Tutorial\nimport SettingsIcon from \"@mui/icons-material/Settings\"; // options\nimport DeveloperBoardIcon from \"@mui/icons-material/DeveloperBoard\"; // Dev\nimport EmojiEventsIcon from \"@mui/icons-material/EmojiEvents\"; // Achievements\nimport AccountBoxIcon from \"@mui/icons-material/AccountBox\";\nimport PublicIcon from \"@mui/icons-material/Public\";\nimport LiveHelpIcon from \"@mui/icons-material/LiveHelp\";\nimport ExpandLessIcon from \"@mui/icons-material/ExpandLess\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { Router } from \"../../ui/GameRoot\";\nimport { Page } from \"../../ui/Router\";\nimport { Player } from \"@player\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { iTutorialSteps, iTutorialNextStep, ITutorial } from \"../../InteractiveTutorial\";\nimport { getAvailableCreatePrograms } from \"../../Programs/ProgramHelpers\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\nimport { ProgramsSeen } from \"../../Programs/ui/ProgramsRoot\";\nimport { InvitationsSeen } from \"../../Faction/ui/FactionsRoot\";\nimport { hash } from \"../../hash/hash\";\nimport { Locations } from \"../../Locations/Locations\";\n\nconst openedMixin = (theme: Theme): CSSObject => ({\n width: theme.spacing(31),\n transition: theme.transitions.create(\"width\", {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.enteringScreen,\n }),\n overflowX: \"hidden\",\n});\n\nconst closedMixin = (theme: Theme): CSSObject => ({\n transition: theme.transitions.create(\"width\", {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n overflowX: \"hidden\",\n width: `calc(${theme.spacing(2)} + 1px)`,\n [theme.breakpoints.up(\"sm\")]: {\n width: `calc(${theme.spacing(7)} + 1px)`,\n },\n});\n\nconst Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== \"open\" })(({ theme, open }) => ({\n width: theme.spacing(31),\n whiteSpace: \"nowrap\",\n boxSizing: \"border-box\",\n ...(open && {\n ...openedMixin(theme),\n \"& .MuiDrawer-paper\": openedMixin(theme),\n }),\n ...(!open && {\n ...closedMixin(theme),\n \"& .MuiDrawer-paper\": closedMixin(theme),\n }),\n}));\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n active: {\n borderLeft: \"3px solid \" + theme.palette.primary.main,\n },\n listitem: {},\n }),\n);\n\ninterface IProps {\n page: Page;\n opened: boolean;\n onToggled: (newValue: boolean) => void;\n}\n\nexport function SidebarRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const [hackingOpen, setHackingOpen] = useState(true);\n const [characterOpen, setCharacterOpen] = useState(true);\n const [worldOpen, setWorldOpen] = useState(true);\n const [helpOpen, setHelpOpen] = useState(true);\n\n const flashTerminal =\n ITutorial.currStep === iTutorialSteps.CharacterGoToTerminalPage ||\n ITutorial.currStep === iTutorialSteps.ActiveScriptsPage;\n\n const flashStats = ITutorial.currStep === iTutorialSteps.GoToCharacterPage;\n\n const flashActiveScripts = ITutorial.currStep === iTutorialSteps.TerminalGoToActiveScriptsPage;\n\n const flashHacknet = ITutorial.currStep === iTutorialSteps.GoToHacknetNodesPage;\n\n const flashCity = ITutorial.currStep === iTutorialSteps.HacknetNodesGoToWorldPage;\n\n const flashTutorial = ITutorial.currStep === iTutorialSteps.WorldDescription;\n\n const augmentationCount = Player.queuedAugmentations.length;\n const invitationsCount = Player.factionInvitations.filter((f) => !InvitationsSeen.includes(f)).length;\n const programCount = getAvailableCreatePrograms().length - ProgramsSeen.length;\n\n const canOpenFactions =\n Player.factionInvitations.length > 0 ||\n Player.factions.length > 0 ||\n Player.augmentations.length > 0 ||\n Player.queuedAugmentations.length > 0 ||\n Player.sourceFiles.length > 0;\n\n const canOpenAugmentations =\n Player.augmentations.length > 0 || Player.queuedAugmentations.length > 0 || Player.sourceFiles.length > 0;\n\n const canOpenSleeves = Player.sleeves.length > 0;\n\n const canCorporation = !!Player.corporation;\n const canGang = !!Player.gang;\n const canJob = Object.values(Player.jobs).length > 0;\n const canStockMarket = Player.hasWseAccount;\n const canBladeburner = !!Player.bladeburner;\n const canStaneksGift = Player.augmentations.some((aug) => aug.name === AugmentationNames.StaneksGift1);\n\n function clickTerminal(): void {\n Router.toTerminal();\n if (flashTerminal) iTutorialNextStep();\n }\n\n function clickScriptEditor(): void {\n Router.toScriptEditor();\n }\n\n function clickStats(): void {\n Router.toStats();\n if (flashStats) iTutorialNextStep();\n }\n\n function clickActiveScripts(): void {\n Router.toActiveScripts();\n if (flashActiveScripts) iTutorialNextStep();\n }\n\n function clickCreateProgram(): void {\n Router.toCreateProgram();\n }\n\n function clickStaneksGift(): void {\n Router.toStaneksGift();\n }\n\n function clickFactions(): void {\n Router.toFactions();\n }\n\n function clickAugmentations(): void {\n Router.toAugmentations();\n }\n\n function clickSleeves(): void {\n Router.toSleeves();\n }\n\n function clickHacknet(): void {\n Router.toHacknetNodes();\n if (flashHacknet) iTutorialNextStep();\n }\n\n function clickCity(): void {\n Router.toCity();\n if (flashCity) iTutorialNextStep();\n }\n\n function clickTravel(): void {\n Router.toTravel();\n }\n\n function clickJob(): void {\n Router.toJob(Locations[Object.keys(Player.jobs)[0]]);\n }\n\n function clickStockMarket(): void {\n Router.toStockMarket();\n }\n\n function clickBladeburner(): void {\n Router.toBladeburner();\n }\n\n function clickCorp(): void {\n Router.toCorporation();\n }\n\n function clickGang(): void {\n Router.toGang();\n }\n\n function clickTutorial(): void {\n Router.toTutorial();\n if (flashTutorial) iTutorialNextStep();\n }\n\n function clickMilestones(): void {\n Router.toMilestones();\n }\n function clickOptions(): void {\n Router.toGameOptions();\n }\n\n function clickDev(): void {\n Router.toDevMenu();\n }\n\n function clickAchievements(): void {\n Router.toAchievements();\n }\n\n useEffect(() => {\n // Shortcuts to navigate through the game\n // Alt-t - Terminal\n // Alt-c - Character\n // Alt-e - Script editor\n // Alt-s - Active scripts\n // Alt-h - Hacknet Nodes\n // Alt-w - City\n // Alt-j - Job\n // Alt-r - Travel Agency of current city\n // Alt-p - Create program\n // Alt-f - Factions\n // Alt-a - Augmentations\n // Alt-u - Tutorial\n // Alt-o - Options\n // Alt-b - Bladeburner\n // Alt-g - Gang\n function handleShortcuts(this: Document, event: KeyboardEvent): void {\n if (Settings.DisableHotkeys) return;\n if ((Player.currentWork && Player.focus) || Router.page() === Page.BitVerse) return;\n if (event.code === KEYCODE.T && event.altKey) {\n event.preventDefault();\n clickTerminal();\n } else if (event.code === KEYCODE.C && event.altKey) {\n event.preventDefault();\n clickStats();\n } else if (event.code === KEYCODE.E && event.altKey) {\n event.preventDefault();\n clickScriptEditor();\n } else if (event.code === KEYCODE.S && event.altKey) {\n event.preventDefault();\n clickActiveScripts();\n } else if (event.code === KEYCODE.H && event.altKey) {\n event.preventDefault();\n clickHacknet();\n } else if (event.code === KEYCODE.W && event.altKey) {\n event.preventDefault();\n clickCity();\n } else if (event.code === KEYCODE.J && event.altKey && !event.ctrlKey && !event.metaKey && canJob) {\n // ctrl/cmd + alt + j is shortcut to open Chrome dev tools\n event.preventDefault();\n clickJob();\n } else if (event.code === KEYCODE.R && event.altKey) {\n event.preventDefault();\n clickTravel();\n } else if (event.code === KEYCODE.P && event.altKey) {\n event.preventDefault();\n clickCreateProgram();\n } else if (event.code === KEYCODE.F && event.altKey) {\n if (props.page == Page.Terminal && Settings.EnableBashHotkeys) {\n return;\n }\n event.preventDefault();\n clickFactions();\n } else if (event.code === KEYCODE.A && event.altKey) {\n event.preventDefault();\n clickAugmentations();\n } else if (event.code === KEYCODE.U && event.altKey) {\n event.preventDefault();\n clickTutorial();\n } else if (event.code === KEYCODE.O && event.altKey) {\n event.preventDefault();\n clickOptions();\n } else if (event.code === KEYCODE.B && event.altKey && Player.bladeburner) {\n event.preventDefault();\n clickBladeburner();\n } else if (event.code === KEYCODE.G && event.altKey && Player.gang) {\n event.preventDefault();\n clickGang();\n }\n }\n\n document.addEventListener(\"keydown\", handleShortcuts);\n return () => document.removeEventListener(\"keydown\", handleShortcuts);\n }, []);\n\n const classes = useStyles();\n const [open, setOpen] = useState(props.opened);\n const toggleDrawer = (): void => setOpen((old) => !old);\n\n useEffect(() => {\n props.onToggled(open);\n }, [open]);\n\n return (\n <Drawer open={open} anchor=\"left\" variant=\"permanent\">\n <ListItem classes={{ root: classes.listitem }} button onClick={toggleDrawer}>\n <ListItemIcon>\n {!open ? <ChevronRightIcon color=\"primary\" /> : <ChevronLeftIcon color=\"primary\" />}\n </ListItemIcon>\n <ListItemText\n primary={\n <Tooltip title={hash()}>\n <Typography>Bitburner v{CONSTANTS.VersionString}</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n <Divider />\n <List>\n <ListItem classes={{ root: classes.listitem }} button onClick={() => setHackingOpen((old) => !old)}>\n <ListItemIcon>\n <Tooltip title={!open ? \"Hacking\" : \"\"}>\n <ComputerIcon color=\"primary\" />\n </Tooltip>\n </ListItemIcon>\n <ListItemText primary={<Typography>Hacking</Typography>} />\n {hackingOpen ? <ExpandLessIcon color=\"primary\" /> : <ExpandMoreIcon color=\"primary\" />}\n </ListItem>\n <Collapse in={hackingOpen} timeout=\"auto\" unmountOnExit>\n <List>\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Terminal\"}\n className={clsx({\n [classes.active]: props.page === Page.Terminal,\n })}\n onClick={clickTerminal}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Terminal\" : \"\"}>\n <LastPageIcon\n color={flashTerminal ? \"error\" : props.page !== Page.Terminal ? \"secondary\" : \"primary\"}\n />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={flashTerminal ? \"error\" : props.page !== Page.Terminal ? \"secondary\" : \"primary\"}>\n Terminal\n </Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Script Editor\"}\n className={clsx({\n [classes.active]: props.page === Page.ScriptEditor,\n })}\n onClick={clickScriptEditor}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Script Editor\" : \"\"}>\n <CreateIcon color={props.page !== Page.ScriptEditor ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.ScriptEditor ? \"secondary\" : \"primary\"}>\n Script Editor\n </Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Active Scripts\"}\n className={clsx({\n [classes.active]: props.page === Page.ActiveScripts,\n })}\n onClick={clickActiveScripts}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Active Scripts\" : \"\"}>\n <StorageIcon\n color={flashActiveScripts ? \"error\" : props.page !== Page.ActiveScripts ? \"secondary\" : \"primary\"}\n />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography\n color={flashActiveScripts ? \"error\" : props.page !== Page.ActiveScripts ? \"secondary\" : \"primary\"}\n >\n Active Scripts\n </Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n button\n key={\"Create Program\"}\n className={clsx({\n [classes.active]: props.page === Page.CreateProgram,\n })}\n onClick={clickCreateProgram}\n >\n <ListItemIcon>\n <Badge badgeContent={programCount > 0 ? programCount : undefined} color=\"error\">\n <Tooltip title={!open ? \"Create Program\" : \"\"}>\n <BugReportIcon color={props.page !== Page.CreateProgram ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </Badge>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.CreateProgram ? \"secondary\" : \"primary\"}>\n Create Program\n </Typography>\n </ListItemText>\n </ListItem>\n {canStaneksGift && (\n <ListItem\n button\n key={\"Staneks Gift\"}\n className={clsx({\n [classes.active]: props.page === Page.StaneksGift,\n })}\n onClick={clickStaneksGift}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Stanek's Gift\" : \"\"}>\n <DeveloperBoardIcon color={props.page !== Page.StaneksGift ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.StaneksGift ? \"secondary\" : \"primary\"}>\n Stanek's Gift\n </Typography>\n </ListItemText>\n </ListItem>\n )}\n </List>\n </Collapse>\n\n <Divider />\n <ListItem classes={{ root: classes.listitem }} button onClick={() => setCharacterOpen((old) => !old)}>\n <ListItemIcon>\n <Tooltip title={!open ? \"Character\" : \"\"}>\n <AccountBoxIcon color=\"primary\" />\n </Tooltip>\n </ListItemIcon>\n <ListItemText primary={<Typography>Character</Typography>} />\n {characterOpen ? <ExpandLessIcon color=\"primary\" /> : <ExpandMoreIcon color=\"primary\" />}\n </ListItem>\n <Collapse in={characterOpen} timeout=\"auto\" unmountOnExit>\n <ListItem\n button\n key={\"Stats\"}\n className={clsx({\n [classes.active]: props.page === Page.Stats,\n })}\n onClick={clickStats}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Stats\" : \"\"}>\n <EqualizerIcon color={flashStats ? \"error\" : props.page !== Page.Stats ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={flashStats ? \"error\" : props.page !== Page.Stats ? \"secondary\" : \"primary\"}>\n Stats\n </Typography>\n </ListItemText>\n </ListItem>\n {canOpenFactions && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Factions\"}\n className={clsx({\n [classes.active]: [Page.Factions, Page.Faction].includes(props.page),\n })}\n onClick={clickFactions}\n >\n <ListItemIcon>\n <Badge badgeContent={invitationsCount !== 0 ? invitationsCount : undefined} color=\"error\">\n <Tooltip title={!open ? \"Factions\" : \"\"}>\n <ContactsIcon\n color={![Page.Factions, Page.Faction].includes(props.page) ? \"secondary\" : \"primary\"}\n />\n </Tooltip>\n </Badge>\n </ListItemIcon>\n <ListItemText>\n <Typography color={![Page.Factions, Page.Faction].includes(props.page) ? \"secondary\" : \"primary\"}>\n Factions\n </Typography>\n </ListItemText>\n </ListItem>\n )}\n {canOpenAugmentations && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Augmentations\"}\n className={clsx({\n [classes.active]: props.page === Page.Augmentations,\n })}\n onClick={clickAugmentations}\n >\n <ListItemIcon>\n <Badge badgeContent={augmentationCount !== 0 ? augmentationCount : undefined} color=\"error\">\n <Tooltip title={!open ? \"Augmentations\" : \"\"}>\n <DoubleArrowIcon\n style={{ transform: \"rotate(-90deg)\" }}\n color={props.page !== Page.Augmentations ? \"secondary\" : \"primary\"}\n />\n </Tooltip>\n </Badge>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Augmentations ? \"secondary\" : \"primary\"}>\n Augmentations\n </Typography>\n </ListItemText>\n </ListItem>\n )}\n <ListItem\n button\n key={\"Hacknet\"}\n className={clsx({\n [classes.active]: props.page === Page.Hacknet,\n })}\n onClick={clickHacknet}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Hacknet\" : \"\"}>\n <AccountTreeIcon\n color={flashHacknet ? \"error\" : props.page !== Page.Hacknet ? \"secondary\" : \"primary\"}\n />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={flashHacknet ? \"error\" : props.page !== Page.Hacknet ? \"secondary\" : \"primary\"}>\n Hacknet\n </Typography>\n </ListItemText>\n </ListItem>\n {canOpenSleeves && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Sleeves\"}\n className={clsx({\n [classes.active]: props.page === Page.Sleeves,\n })}\n onClick={clickSleeves}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Sleeves\" : \"\"}>\n <PeopleAltIcon color={props.page !== Page.Sleeves ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Sleeves ? \"secondary\" : \"primary\"}>Sleeves</Typography>\n </ListItemText>\n </ListItem>\n )}\n </Collapse>\n\n <Divider />\n <ListItem classes={{ root: classes.listitem }} button onClick={() => setWorldOpen((old) => !old)}>\n <ListItemIcon>\n <Tooltip title={!open ? \"World\" : \"\"}>\n <PublicIcon color=\"primary\" />\n </Tooltip>\n </ListItemIcon>\n <ListItemText primary={<Typography>World</Typography>} />\n {worldOpen ? <ExpandLessIcon color=\"primary\" /> : <ExpandMoreIcon color=\"primary\" />}\n </ListItem>\n <Collapse in={worldOpen} timeout=\"auto\" unmountOnExit>\n <ListItem\n button\n key={\"City\"}\n className={clsx({\n [classes.active]:\n props.page === Page.City || props.page === Page.Grafting || props.page === Page.Location,\n })}\n onClick={clickCity}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"City\" : \"\"}>\n <LocationCityIcon color={flashCity ? \"error\" : props.page !== Page.City ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={flashCity ? \"error\" : props.page !== Page.City ? \"secondary\" : \"primary\"}>\n City\n </Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n button\n key={\"Travel\"}\n className={clsx({\n [classes.active]: props.page === Page.Travel,\n })}\n onClick={clickTravel}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Travel\" : \"\"}>\n <AirplanemodeActiveIcon color={props.page !== Page.Travel ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Travel ? \"secondary\" : \"primary\"}>Travel</Typography>\n </ListItemText>\n </ListItem>\n {canJob && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Job\"}\n className={clsx({\n [classes.active]: props.page === Page.Job,\n })}\n onClick={clickJob}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Job\" : \"\"}>\n <WorkIcon color={props.page !== Page.Job ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Job ? \"secondary\" : \"primary\"}>Job</Typography>\n </ListItemText>\n </ListItem>\n )}\n {canStockMarket && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Stock Market\"}\n className={clsx({\n [classes.active]: props.page === Page.StockMarket,\n })}\n onClick={clickStockMarket}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Stock Market\" : \"\"}>\n <TrendingUpIcon color={props.page !== Page.StockMarket ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.StockMarket ? \"secondary\" : \"primary\"}>Stock Market</Typography>\n </ListItemText>\n </ListItem>\n )}\n {canBladeburner && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Bladeburner\"}\n className={clsx({\n [classes.active]: props.page === Page.Bladeburner,\n })}\n onClick={clickBladeburner}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Bladeburner\" : \"\"}>\n <FormatBoldIcon color={props.page !== Page.Bladeburner ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Bladeburner ? \"secondary\" : \"primary\"}>Bladeburner</Typography>\n </ListItemText>\n </ListItem>\n )}\n {canCorporation && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Corp\"}\n className={clsx({\n [classes.active]: props.page === Page.Corporation,\n })}\n onClick={clickCorp}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Corp\" : \"\"}>\n <BusinessIcon color={props.page !== Page.Corporation ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Corporation ? \"secondary\" : \"primary\"}>Corp</Typography>\n </ListItemText>\n </ListItem>\n )}\n {canGang && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Gang\"}\n className={clsx({\n [classes.active]: props.page === Page.Gang,\n })}\n onClick={clickGang}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Gang\" : \"\"}>\n <SportsMmaIcon color={props.page !== Page.Gang ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Gang ? \"secondary\" : \"primary\"}>Gang</Typography>\n </ListItemText>\n </ListItem>\n )}\n </Collapse>\n\n <Divider />\n <ListItem classes={{ root: classes.listitem }} button onClick={() => setHelpOpen((old) => !old)}>\n <ListItemIcon>\n <Tooltip title={!open ? \"Help\" : \"\"}>\n <LiveHelpIcon color=\"primary\" />\n </Tooltip>\n </ListItemIcon>\n <ListItemText primary={<Typography>Help</Typography>} />\n {helpOpen ? <ExpandLessIcon color=\"primary\" /> : <ExpandMoreIcon color=\"primary\" />}\n </ListItem>\n <Collapse in={helpOpen} timeout=\"auto\" unmountOnExit>\n <ListItem\n button\n key={\"Milestones\"}\n className={clsx({\n [classes.active]: props.page === Page.Milestones,\n })}\n onClick={clickMilestones}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Milestones\" : \"\"}>\n <CheckIcon color={props.page !== Page.Milestones ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Milestones ? \"secondary\" : \"primary\"}>Milestones</Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n button\n key={\"Tutorial\"}\n className={clsx({\n [classes.active]: props.page === Page.Tutorial,\n })}\n onClick={clickTutorial}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Tutorial\" : \"\"}>\n <HelpIcon color={flashTutorial ? \"error\" : props.page !== Page.Tutorial ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={flashTutorial ? \"error\" : props.page !== Page.Tutorial ? \"secondary\" : \"primary\"}>\n Tutorial\n </Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n button\n key={\"Achievements\"}\n className={clsx({\n [classes.active]: props.page === Page.Achievements,\n })}\n onClick={clickAchievements}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Achievements\" : \"\"}>\n <EmojiEventsIcon color={props.page !== Page.Achievements ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Achievements ? \"secondary\" : \"primary\"}>Achievements</Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n button\n key={\"Options\"}\n className={clsx({\n [classes.active]: props.page === Page.Options,\n })}\n onClick={clickOptions}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Options\" : \"\"}>\n <SettingsIcon color={props.page !== Page.Options ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Options ? \"secondary\" : \"primary\"}>Options</Typography>\n </ListItemText>\n </ListItem>\n {process.env.NODE_ENV === \"development\" && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Dev\"}\n className={clsx({\n [classes.active]: props.page === Page.DevMenu,\n })}\n onClick={clickDev}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Dev\" : \"\"}>\n <DeveloperBoardIcon color={props.page !== Page.DevMenu ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.DevMenu ? \"secondary\" : \"primary\"}>Dev</Typography>\n </ListItemText>\n </ListItem>\n )}\n </Collapse>\n </List>\n </Drawer>\n );\n}\n","import { Programs } from \"./Programs\";\nimport { Program } from \"./Program\";\n\nimport { Player } from \"@player\";\n\n//Returns the programs this player can create.\nexport function getAvailableCreatePrograms(): Program[] {\n const programs: Program[] = [];\n for (const key of Object.keys(Programs)) {\n // Non-creatable program\n const create = Programs[key].create;\n if (create == null) continue;\n\n // Already has program\n if (Player.hasProgram(Programs[key].name)) continue;\n\n // Does not meet requirements\n if (!create.req()) continue;\n\n programs.push(Programs[key]);\n }\n\n return programs;\n}\n","/**\n * Root React component for the Augmentations UI page that display all of your\n * owned and purchased Augmentations and Source-Files.\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { InstalledAugmentations } from \"./InstalledAugmentations\";\nimport { PlayerMultipliers } from \"./PlayerMultipliers\";\nimport { PurchasedAugmentations } from \"./PurchasedAugmentations\";\nimport { SourceFilesElement } from \"./SourceFiles\";\n\nimport { canGetBonus } from \"../../ExportBonus\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Container from \"@mui/material/Container\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\nimport { Player } from \"@player\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { Info } from \"@mui/icons-material\";\nimport { Link } from \"@mui/material\";\nimport { AlertEvents } from \"../../ui/React/AlertManager\";\n\nconst NeuroFluxDisplay = (): React.ReactElement => {\n const level = Player.augmentations.find((e) => e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0;\n\n const openBloodDonation = () => {\n AlertEvents.emit(\n <>\n <Typography variant=\"h5\">Bitburner blood donation community program</Typography>\n <Typography>\n The blood donation program is a continuous real life event started on 2022-04-01. To participate simply go\n donate blood, plasma, or platelets to your local organization and take a picture as proof (hide your personal\n information). Then send the proof to hydroflame on reddit or discord.\n </Typography>\n <Typography>Currently accumulated {CONSTANTS.Donations} donations.</Typography>\n </>,\n );\n };\n return level > 0 ? (\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\" color={Settings.theme.info}>\n NeuroFlux Governor - Level {level}\n </Typography>\n <Typography color={Settings.theme.info}>\n {StaticAugmentations[AugmentationNames.NeuroFluxGovernor].stats}\n </Typography>\n <Typography color={Settings.theme.info}>\n The power of {AugmentationNames.NeuroFluxGovernor} increases with blood donations from players in real life.\n Learn more <Link onClick={openBloodDonation}>here</Link>\n </Typography>\n </Paper>\n ) : (\n <></>\n );\n};\n\nconst EntropyDisplay = (): React.ReactElement => {\n return Player.entropy > 0 ? (\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\" color={Settings.theme.error}>\n Entropy Virus - Level {Player.entropy}\n </Typography>\n <Typography color={Settings.theme.error}>\n <b>All multipliers decreased by:</b> {formatNumber((1 - CONSTANTS.EntropyEffect ** Player.entropy) * 100, 3)}%\n (multiplicative)\n </Typography>\n </Paper>\n ) : (\n <></>\n );\n};\n\ninterface IProps {\n exportGameFn: () => void;\n installAugmentationsFn: () => void;\n}\n\nexport function AugmentationsRoot(props: IProps): React.ReactElement {\n const [installOpen, setInstallOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n function doExport(): void {\n props.exportGameFn();\n rerender();\n }\n\n function exportBonusStr(): string {\n if (canGetBonus()) return \"(+1 favor to all factions)\";\n return \"\";\n }\n\n function doInstall(): void {\n if (!Settings.SuppressBuyAugmentationConfirmation) {\n setInstallOpen(true);\n } else {\n props.installAugmentationsFn();\n }\n }\n\n return (\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0 }}>\n <Typography variant=\"h4\">Augmentations</Typography>\n <Box sx={{ mb: 1 }}>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\" color=\"primary\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n Purchased Augmentations\n <Tooltip\n title={\n <>\n <Typography>\n Below is a list of all Augmentations you have purchased but not yet installed. Click the button\n below to install them.\n </Typography>\n <Typography>\n WARNING: Installing your Augmentations resets most of your progress, including:\n </Typography>\n <br />\n <Typography>- Stats/Skill levels and Experience</Typography>\n <Typography>- Money</Typography>\n <Typography>- Scripts on every computer but your home computer</Typography>\n <Typography>- Purchased servers</Typography>\n <Typography>- Hacknet Nodes</Typography>\n <Typography>- Faction/Company reputation</Typography>\n <Typography>- Stocks</Typography>\n <br />\n <Typography>\n Installing Augmentations lets you start over with the perks and benefits granted by all of the\n Augmentations you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your\n home computer (but you will lose all programs besides NUKE.exe)\n </Typography>\n </>\n }\n >\n <Info sx={{ ml: 1, mb: 0.5 }} color=\"info\" />\n </Tooltip>\n </Typography>\n <ConfirmationModal\n open={installOpen}\n onClose={() => setInstallOpen(false)}\n onConfirm={props.installAugmentationsFn}\n confirmationText={\n <>\n Installing will reset\n <br />\n <br />- money\n <br />- skill / experience\n <br />- every server except home\n <br />- factions and reputation\n <br />\n <br />\n You will keep:\n <br />\n <br />- All scripts on home\n <br />- home ram and cores\n <br />\n <br />\n It is recommended to install several Augmentations at once. Preferably everything from any faction of\n your choosing.\n </>\n }\n />\n <Box sx={{ display: \"grid\", width: \"100%\", gridTemplateColumns: \"1fr 1fr\" }}>\n <Tooltip title={<Typography>'I never asked for this'</Typography>}>\n <span>\n <Button sx={{ width: \"100%\" }} disabled={Player.queuedAugmentations.length === 0} onClick={doInstall}>\n Install Augmentations\n </Button>\n </span>\n </Tooltip>\n <Tooltip title={<Typography>It's always a good idea to backup/export your save!</Typography>}>\n <Button sx={{ width: \"100%\", color: Settings.theme.successlight }} onClick={doExport}>\n Backup Save {exportBonusStr()}\n </Button>\n </Tooltip>\n </Box>\n </Paper>\n {Player.queuedAugmentations.length > 0 ? (\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 3fr\" }}>\n <PurchasedAugmentations />\n <PlayerMultipliers />\n </Box>\n ) : (\n <Paper sx={{ p: 1 }}>\n <Typography>No Augmentations have been purchased yet</Typography>\n </Paper>\n )}\n </Box>\n\n <Box\n sx={{\n my: 1,\n display: \"grid\",\n gridTemplateColumns: `repeat(${\n +!!((Player.augmentations.find((e) => e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0) > 0) +\n +!!(Player.entropy > 0)\n }, 1fr)`,\n gap: 1,\n }}\n >\n <NeuroFluxDisplay />\n <EntropyDisplay />\n </Box>\n\n <Box>\n <InstalledAugmentations />\n </Box>\n <SourceFilesElement />\n </Container>\n );\n}\n","/**\n * React Component for displaying all of the player's installed Augmentations and\n * Source-Files.\n *\n * It also contains 'configuration' buttons that allow you to change how the\n * Augs/SF's are displayed\n */\nimport { Box, ListItemButton, Paper, Typography } from \"@mui/material\";\nimport Button from \"@mui/material/Button\";\nimport List from \"@mui/material/List\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport React, { useState } from \"react\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Player } from \"@player\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\n\nexport function InstalledAugmentations(): React.ReactElement {\n const setRerender = useState(true)[1];\n const sourceAugs = Player.augmentations.slice().filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor);\n\n const [selectedAug, setSelectedAug] = useState(sourceAugs[0]);\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceAugs.sort((aug1, aug2) => {\n return aug1.name.localeCompare(aug2.name);\n });\n }\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function sortByAcquirementTime(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.AcquirementTime;\n rerender();\n }\n\n function sortInOrder(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.Alphabetically;\n rerender();\n }\n\n return (\n <Box sx={{ width: \"100%\" }}>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\">Installed Augmentations</Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}>\n <Tooltip title={\"Sorts the Augmentations alphabetically in numeral order\"}>\n <Button sx={{ width: \"100%\" }} onClick={sortInOrder}>\n Sort in Order\n </Button>\n </Tooltip>\n <Tooltip title={\"Sorts the Augmentations based on when you acquired them (same as default)\"}>\n <Button sx={{ width: \"100%\" }} onClick={sortByAcquirementTime}>\n Sort by Time of Acquirement\n </Button>\n </Tooltip>\n </Box>\n </Paper>\n {sourceAugs.length > 0 ? (\n <Paper sx={{ display: \"grid\", gridTemplateColumns: \"1fr 3fr\" }}>\n <Box>\n <List sx={{ height: 400, overflowY: \"scroll\", borderRight: `1px solid ${Settings.theme.welllight}` }}>\n {sourceAugs.map((k, i) => (\n <ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}>\n <Typography>{k.name}</Typography>\n </ListItemButton>\n ))}\n </List>\n </Box>\n <Box sx={{ m: 1 }}>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n {selectedAug.name}\n </Typography>\n <Typography sx={{ maxHeight: 350, overflowY: \"scroll\" }}>\n {(() => {\n const aug = StaticAugmentations[selectedAug.name];\n\n const info = typeof aug.info === \"string\" ? <span>{aug.info}</span> : aug.info;\n const tooltip = (\n <>\n {info}\n <br />\n <br />\n {aug.stats}\n </>\n );\n return tooltip;\n })()}\n </Typography>\n </Box>\n </Paper>\n ) : (\n <Paper sx={{ p: 1 }}>\n <Typography>No Augmentations have been installed yet</Typography>\n </Paper>\n )}\n </Box>\n );\n}\n","import { DoubleArrow } from \"@mui/icons-material\";\nimport { List, ListItem, ListItemText, Paper, Typography } from \"@mui/material\";\nimport * as React from \"react\";\nimport { Multipliers, defaultMultipliers, mergeMultipliers } from \"../../PersonObjects/Multipliers\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Player } from \"@player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\n\nfunction calculateAugmentedStats(): Multipliers {\n let augP: Multipliers = defaultMultipliers();\n for (const aug of Player.queuedAugmentations) {\n const augObj = StaticAugmentations[aug.name];\n augP = mergeMultipliers(augP, augObj.mults);\n }\n return augP;\n}\n\ninterface IBitNodeModifiedStatsProps {\n base: number;\n mult: number;\n color: string;\n}\n\nfunction BitNodeModifiedStats(props: IBitNodeModifiedStatsProps): React.ReactElement {\n // If player doesn't have SF5 or if the property isn't affected by BitNode mults\n if (props.mult === 1 || Player.sourceFileLvl(5) === 0)\n return <Typography color={props.color}>{numeralWrapper.formatPercentage(props.base)}</Typography>;\n\n return (\n <Typography color={props.color}>\n <span style={{ opacity: 0.5 }}>{numeralWrapper.formatPercentage(props.base)}</span>{\" \"}\n {numeralWrapper.formatPercentage(props.base * props.mult)}\n </Typography>\n );\n}\n\ninterface MultiplierListItemData {\n mult: string;\n current: number;\n augmented: number;\n bnMult?: number;\n color?: string;\n}\n\ninterface IMultiplierListProps {\n rows: MultiplierListItemData[];\n}\n\nfunction MultiplierList(props: IMultiplierListProps): React.ReactElement {\n const listItems = props.rows\n .map((data) => {\n const { mult, current, augmented, bnMult = 1, color = Settings.theme.primary } = data;\n\n if (!isNaN(augmented)) {\n return (\n <ListItem key={mult} disableGutters sx={{ py: 0 }}>\n <ListItemText\n sx={{ my: 0.1 }}\n primary={\n <Typography color={color}>\n <b>{mult}</b>\n </Typography>\n }\n secondary={\n <span style={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n <BitNodeModifiedStats base={current} mult={bnMult} color={color} />\n <DoubleArrow fontSize=\"small\" color=\"success\" sx={{ mb: 0.5, mx: 1 }} />\n <BitNodeModifiedStats base={augmented} mult={bnMult} color={Settings.theme.success} />\n </span>\n }\n disableTypography\n />\n </ListItem>\n );\n }\n return;\n })\n .filter((i) => i !== undefined);\n\n return listItems.length > 0 ? <List disablePadding>{listItems}</List> : <></>;\n}\n\n/** React component for displaying the player's multipliers on the Augmentation UI page */\nexport function PlayerMultipliers(): React.ReactElement {\n const mults = calculateAugmentedStats();\n\n const leftColData: MultiplierListItemData[] = [\n ...[\n {\n mult: \"Hacking Chance\",\n current: Player.mults.hacking_chance,\n augmented: Player.mults.hacking_chance * mults.hacking_chance,\n },\n {\n mult: \"Hacking Speed\",\n current: Player.mults.hacking_speed,\n augmented: Player.mults.hacking_speed * mults.hacking_speed,\n },\n {\n mult: \"Hacking Money\",\n current: Player.mults.hacking_money,\n augmented: Player.mults.hacking_money * mults.hacking_money,\n bnMult: BitNodeMultipliers.ScriptHackMoney,\n },\n {\n mult: \"Hacking Growth\",\n current: Player.mults.hacking_grow,\n augmented: Player.mults.hacking_grow * mults.hacking_grow,\n },\n {\n mult: \"Hacking Level\",\n current: Player.mults.hacking,\n augmented: Player.mults.hacking * mults.hacking,\n bnMult: BitNodeMultipliers.HackingLevelMultiplier,\n },\n {\n mult: \"Hacking Experience\",\n current: Player.mults.hacking_exp,\n augmented: Player.mults.hacking_exp * mults.hacking_exp,\n bnMult: BitNodeMultipliers.HackExpGain,\n },\n ].map((data: MultiplierListItemData) =>\n Object.defineProperty(data, \"color\", {\n value: Settings.theme.hack,\n }),\n ),\n ...[\n {\n mult: \"Strength Level\",\n current: Player.mults.strength,\n augmented: Player.mults.strength * mults.strength,\n bnMult: BitNodeMultipliers.StrengthLevelMultiplier,\n },\n {\n mult: \"Strength Experience\",\n current: Player.mults.strength_exp,\n augmented: Player.mults.strength_exp * mults.strength_exp,\n },\n {\n mult: \"Defense Level\",\n current: Player.mults.defense,\n augmented: Player.mults.defense * mults.defense,\n bnMult: BitNodeMultipliers.DefenseLevelMultiplier,\n },\n {\n mult: \"Defense Experience\",\n current: Player.mults.defense_exp,\n augmented: Player.mults.defense_exp * mults.defense_exp,\n },\n {\n mult: \"Dexterity Level\",\n current: Player.mults.dexterity,\n augmented: Player.mults.dexterity * mults.dexterity,\n bnMult: BitNodeMultipliers.DexterityLevelMultiplier,\n },\n {\n mult: \"Dexterity Experience\",\n current: Player.mults.dexterity_exp,\n augmented: Player.mults.dexterity_exp * mults.dexterity_exp,\n },\n {\n mult: \"Agility Level\",\n current: Player.mults.agility,\n augmented: Player.mults.agility * mults.agility,\n bnMult: BitNodeMultipliers.AgilityLevelMultiplier,\n },\n {\n mult: \"Agility Experience\",\n current: Player.mults.agility_exp,\n augmented: Player.mults.agility_exp * mults.agility_exp,\n },\n ].map((data: MultiplierListItemData) =>\n Object.defineProperty(data, \"color\", {\n value: Settings.theme.combat,\n }),\n ),\n {\n mult: \"Charisma Level\",\n current: Player.mults.charisma,\n augmented: Player.mults.charisma * mults.charisma,\n bnMult: BitNodeMultipliers.CharismaLevelMultiplier,\n color: Settings.theme.cha,\n },\n {\n mult: \"Charisma Experience\",\n current: Player.mults.charisma_exp,\n augmented: Player.mults.charisma_exp * mults.charisma_exp,\n color: Settings.theme.cha,\n },\n ];\n const rightColData: MultiplierListItemData[] = [\n {\n mult: \"Hacknet Node Production\",\n current: Player.mults.hacknet_node_money,\n augmented: Player.mults.hacknet_node_money * mults.hacknet_node_money,\n bnMult: BitNodeMultipliers.HacknetNodeMoney,\n },\n {\n mult: \"Hacknet Node Purchase Cost\",\n current: Player.mults.hacknet_node_purchase_cost,\n augmented: Player.mults.hacknet_node_purchase_cost * mults.hacknet_node_purchase_cost,\n },\n {\n mult: \"Hacknet Node RAM Upgrade Cost\",\n current: Player.mults.hacknet_node_ram_cost,\n augmented: Player.mults.hacknet_node_ram_cost * mults.hacknet_node_ram_cost,\n },\n {\n mult: \"Hacknet Node Core Purchase Cost\",\n current: Player.mults.hacknet_node_core_cost,\n augmented: Player.mults.hacknet_node_core_cost * mults.hacknet_node_core_cost,\n },\n {\n mult: \"Hacknet Node Level Upgrade Cost\",\n current: Player.mults.hacknet_node_level_cost,\n augmented: Player.mults.hacknet_node_level_cost * mults.hacknet_node_level_cost,\n },\n {\n mult: \"Company Reputation Gain\",\n current: Player.mults.company_rep,\n augmented: Player.mults.company_rep * mults.company_rep,\n color: Settings.theme.combat,\n },\n {\n mult: \"Faction Reputation Gain\",\n current: Player.mults.faction_rep,\n augmented: Player.mults.faction_rep * mults.faction_rep,\n bnMult: BitNodeMultipliers.FactionWorkRepGain,\n color: Settings.theme.combat,\n },\n {\n mult: \"Salary\",\n current: Player.mults.work_money,\n augmented: Player.mults.work_money * mults.work_money,\n bnMult: BitNodeMultipliers.CompanyWorkMoney,\n color: Settings.theme.money,\n },\n {\n mult: \"Crime Success Chance\",\n current: Player.mults.crime_success,\n augmented: Player.mults.crime_success * mults.crime_success,\n color: Settings.theme.combat,\n },\n {\n mult: \"Crime Money\",\n current: Player.mults.crime_money,\n augmented: Player.mults.crime_money * mults.crime_money,\n bnMult: BitNodeMultipliers.CrimeMoney,\n color: Settings.theme.money,\n },\n ];\n\n if (Player.canAccessBladeburner() && BitNodeMultipliers.BladeburnerRank > 0) {\n rightColData.push(\n {\n mult: \"Bladeburner Success Chance\",\n current: Player.mults.bladeburner_success_chance,\n augmented: Player.mults.bladeburner_success_chance * mults.bladeburner_success_chance,\n },\n {\n mult: \"Bladeburner Max Stamina\",\n current: Player.mults.bladeburner_max_stamina,\n augmented: Player.mults.bladeburner_max_stamina * mults.bladeburner_max_stamina,\n },\n {\n mult: \"Bladeburner Stamina Gain\",\n current: Player.mults.bladeburner_stamina_gain,\n augmented: Player.mults.bladeburner_stamina_gain * mults.bladeburner_stamina_gain,\n },\n {\n mult: \"Bladeburner Field Analysis\",\n current: Player.mults.bladeburner_analysis,\n augmented: Player.mults.bladeburner_analysis * mults.bladeburner_analysis,\n },\n );\n }\n\n return (\n <Paper\n sx={{\n p: 1,\n maxHeight: 400,\n overflowY: \"scroll\",\n display: \"flex\",\n flexDirection: \"column\",\n flexWrap: \"wrap\",\n gap: 1,\n }}\n >\n <MultiplierList rows={leftColData} />\n <MultiplierList rows={rightColData} />\n </Paper>\n );\n}\n","/**\n * React component for displaying all of the player's purchased (but not installed)\n * Augmentations on the Augmentations UI.\n */\nimport { List, ListItemText, Paper, Tooltip, Typography } from \"@mui/material\";\nimport * as React from \"react\";\nimport { Player } from \"@player\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\n\nexport function PurchasedAugmentations(): React.ReactElement {\n const augs: React.ReactElement[] = [];\n // Only render the last NeuroFlux (there are no findLastIndex btw)\n let nfgIndex = -1;\n for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n nfgIndex = i;\n break;\n }\n }\n for (let i = 0; i < Player.queuedAugmentations.length; i++) {\n const ownedAug = Player.queuedAugmentations[i];\n let displayName = ownedAug.name;\n\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;\n const aug = StaticAugmentations[ownedAug.name];\n\n let level = null;\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {\n level = ownedAug.level;\n displayName += ` - Level ${level}`;\n }\n\n augs.push(\n <Tooltip\n title={\n <Typography>\n {(() => {\n const info = typeof aug.info === \"string\" ? <span>{aug.info}</span> : aug.info;\n const tooltip = (\n <>\n {info}\n <br />\n <br />\n {aug.stats}\n </>\n );\n return tooltip;\n })()}\n </Typography>\n }\n enterNextDelay={500}\n key={displayName}\n >\n <ListItemText sx={{ px: 2, py: 1 }} primary={displayName} />\n </Tooltip>,\n );\n }\n\n return (\n <Paper sx={{ py: 1, maxHeight: 400, overflowY: \"scroll\" }}>\n <List sx={{ height: 400, overflowY: \"scroll\" }} disablePadding>\n {augs}\n </List>\n </Paper>\n );\n}\n","import { ListItemButton, ListItemText, Paper } from \"@mui/material\";\nimport Box from \"@mui/material/Box\";\nimport List from \"@mui/material/List\";\nimport Typography from \"@mui/material/Typography\";\nimport React, { useState } from \"react\";\nimport { Exploit, ExploitName } from \"../../Exploits/Exploit\";\nimport { Player } from \"@player\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { SourceFile } from \"../../SourceFile/SourceFile\";\nimport { SourceFiles } from \"../../SourceFile/SourceFiles\";\n\ninterface SfMinus1 {\n info: React.ReactElement;\n n: number;\n name: string;\n lvl: number;\n}\n\nconst safeGetSf = (sfNum: number): SourceFile | SfMinus1 | null => {\n if (sfNum === -1) {\n const sfMinus1: SfMinus1 = {\n info: (\n <>\n This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web ecosystem.\n <br />\n <br />\n It increases all of the player's multipliers by 0.1%\n <br />\n <br />\n You have found the following exploits:\n <br />\n <br />\n {Player.exploits.map((c: Exploit) => (\n <React.Fragment key={c}>\n * {ExploitName(c)}\n <br />\n </React.Fragment>\n ))}\n </>\n ),\n lvl: Player.exploits.length,\n n: -1,\n name: \"Source-File -1: Exploits in the BitNodes\",\n };\n return sfMinus1;\n }\n\n const srcFileKey = \"SourceFile\" + sfNum;\n const sfObj = SourceFiles[srcFileKey];\n if (sfObj == null) {\n console.error(`Invalid source file number: ${sfNum}`);\n return null;\n }\n return sfObj;\n};\n\nconst getMaxLevel = (sfObj: SourceFile | SfMinus1): string | number => {\n let maxLevel;\n switch (sfObj.n) {\n case 12:\n maxLevel = \"∞\";\n break;\n case -1:\n maxLevel = Object.keys(Exploit).length;\n break;\n default:\n maxLevel = \"3\";\n }\n return maxLevel;\n};\n\nexport function SourceFilesElement(): React.ReactElement {\n const sourceSfs = Player.sourceFiles.slice();\n const exploits = Player.exploits;\n // Create a fake SF for -1, if \"owned\"\n if (exploits.length > 0) {\n sourceSfs.unshift({\n n: -1,\n lvl: exploits.length,\n });\n }\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceSfs.sort((sf1, sf2) => {\n return sf1.n - sf2.n;\n });\n }\n\n if (sourceSfs.length === 0) {\n return <></>;\n }\n\n const [selectedSf, setSelectedSf] = useState(sourceSfs[0]);\n\n return (\n <Box sx={{ width: \"100%\", mt: 1 }}>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\">Source Files</Typography>\n </Paper>\n <Paper sx={{ display: \"grid\", gridTemplateColumns: \"1fr 3fr\" }}>\n <Box>\n <List\n sx={{ height: 400, overflowY: \"scroll\", borderRight: `1px solid ${Settings.theme.welllight}` }}\n disablePadding\n >\n {sourceSfs.map((e, i) => {\n const sfObj = safeGetSf(e.n);\n if (!sfObj) return;\n\n const maxLevel = getMaxLevel(sfObj);\n\n return (\n <ListItemButton\n key={i + 1}\n onClick={() => setSelectedSf(e)}\n selected={selectedSf.n === e.n}\n sx={{ py: 0 }}\n >\n <ListItemText\n disableTypography\n primary={<Typography>{sfObj.name}</Typography>}\n secondary={\n <Typography>\n Level {e.lvl} / {maxLevel}\n </Typography>\n }\n />\n </ListItemButton>\n );\n })}\n </List>\n </Box>\n <Box sx={{ m: 1 }}>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n {safeGetSf(selectedSf.n)?.name}\n </Typography>\n <Typography sx={{ maxHeight: 350, overflowY: \"scroll\" }}>\n {(() => {\n const sfObj = safeGetSf(selectedSf.n);\n if (!sfObj) return;\n\n const maxLevel = getMaxLevel(sfObj);\n\n return (\n <>\n Level {selectedSf.lvl} / {maxLevel}\n <br />\n <br />\n {sfObj.info}\n </>\n );\n })()}\n </Typography>\n </Box>\n </Paper>\n </Box>\n );\n}\n","import { Player } from \"@player\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\n\nimport React, { useEffect } from \"react\";\n\nimport { General } from \"./DevMenu/ui/General\";\nimport { Stats } from \"./DevMenu/ui/Stats\";\nimport { Factions } from \"./DevMenu/ui/Factions\";\nimport { Augmentations } from \"./DevMenu/ui/Augmentations\";\nimport { SourceFiles } from \"./DevMenu/ui/SourceFiles\";\nimport { Programs } from \"./DevMenu/ui/Programs\";\nimport { Servers } from \"./DevMenu/ui/Servers\";\nimport { Companies } from \"./DevMenu/ui/Companies\";\nimport { Bladeburner as BladeburnerElem } from \"./DevMenu/ui/Bladeburner\";\nimport { Gang } from \"./DevMenu/ui/Gang\";\nimport { Corporation } from \"./DevMenu/ui/Corporation\";\nimport { CodingContracts } from \"./DevMenu/ui/CodingContracts\";\nimport { StockMarket } from \"./DevMenu/ui/StockMarket\";\nimport { Sleeves } from \"./DevMenu/ui/Sleeves\";\nimport { Stanek } from \"./DevMenu/ui/Stanek\";\nimport { TimeSkip } from \"./DevMenu/ui/TimeSkip\";\nimport { SaveFile } from \"./DevMenu/ui/SaveFile\";\nimport { Achievements } from \"./DevMenu/ui/Achievements\";\nimport { Entropy } from \"./DevMenu/ui/Entropy\";\nimport Typography from \"@mui/material/Typography\";\nimport { Exploit } from \"./Exploits/Exploit\";\n\nexport function DevMenuRoot(): React.ReactElement {\n useEffect(() => {\n Player.giveExploit(Exploit.YoureNotMeantToAccessThis);\n }, []);\n return (\n <>\n <Typography>Development Menu - Only meant to be used for testing/debugging</Typography>\n <General />\n <Stats />\n <Factions />\n <Augmentations />\n <SourceFiles />\n <Programs />\n <Servers />\n <Companies />\n\n {Player.bladeburner && <BladeburnerElem />}\n\n {Player.gang && <Gang />}\n\n {Player.corporation && <Corporation />}\n\n <CodingContracts />\n\n {Player.hasWseAccount && <StockMarket />}\n\n {Player.sleeves.length > 0 && <Sleeves />}\n {Player.augmentations.some((aug) => aug.name === AugmentationNames.StaneksGift1) && <Stanek />}\n\n <TimeSkip />\n <Achievements />\n <Entropy />\n <SaveFile />\n </>\n );\n}\n","import React, { useEffect, useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Player } from \"@player\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { MenuItem, SelectChangeEvent, TextField, Select } from \"@mui/material\";\nimport { Bladeburner } from \"../../Bladeburner/Bladeburner\";\nimport { GangConstants } from \"../../Gang/data/Constants\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { checkForMessagesToSend } from \"../../Message/MessageHelpers\";\n\nexport function General(): React.ReactElement {\n const [error, setError] = useState(false);\n const [corporationName, setCorporationName] = useState(\"\");\n const [gangFaction, setGangFaction] = useState(\"\");\n\n function addMoney(n: number) {\n return function () {\n Player.gainMoney(n, \"other\");\n };\n }\n\n function upgradeRam(): void {\n Player.getHomeComputer().maxRam *= 2;\n }\n\n function quickB1tFlum3(): void {\n Router.toBitVerse(true, true);\n }\n\n function b1tflum3(): void {\n Router.toBitVerse(true, false);\n }\n\n function quickHackW0r1dD43m0n(): void {\n Router.toBitVerse(false, true);\n }\n\n function hackW0r1dD43m0n(): void {\n Router.toBitVerse(false, false);\n }\n\n function createCorporation(): void {\n Player.startCorporation(corporationName);\n }\n\n function joinBladeburner(): void {\n Player.bladeburner = new Bladeburner();\n }\n\n function startGang(): void {\n const isHacking = gangFaction === FactionNames.NiteSec || gangFaction === FactionNames.TheBlackHand;\n Player.startGang(gangFaction, isHacking);\n }\n\n function setGangFactionDropdown(event: SelectChangeEvent<string>): void {\n setGangFaction(event.target.value);\n }\n\n function checkMessages(): void {\n checkForMessagesToSend();\n }\n\n useEffect(() => {\n if (error) throw new ReferenceError(\"Manually thrown error\");\n }, [error]);\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>General</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Button onClick={addMoney(1e6)}>\n <pre>\n + <Money money={1e6} />\n </pre>\n </Button>\n <Button onClick={addMoney(1e9)}>\n <pre>\n + <Money money={1e9} />\n </pre>\n </Button>\n <Button onClick={addMoney(1e12)}>\n <pre>\n + <Money money={1e12} />\n </pre>\n </Button>\n <Button onClick={addMoney(1e15)}>\n <pre>\n + <Money money={1000e12} />\n </pre>\n </Button>\n <Button onClick={addMoney(Infinity)}>\n <pre>\n + <Money money={Infinity} />\n </pre>\n </Button>\n <Button onClick={upgradeRam}>+ RAM</Button>\n <br />\n <Typography>Corporation Name:</Typography>\n <TextField value={corporationName} onChange={(x) => setCorporationName(x.target.value)} />\n <Button onClick={createCorporation}>Create Corporation</Button>\n <br />\n <Typography>Gang Faction:</Typography>\n <Select value={gangFaction} onChange={setGangFactionDropdown}>\n {GangConstants.Names.map((factionName) => (\n <MenuItem key={factionName} value={factionName}>\n {factionName}\n </MenuItem>\n ))}\n </Select>\n <Button onClick={startGang}>Start Gang</Button>\n <br />\n <Button onClick={joinBladeburner}>Join BladeBurner</Button>\n <br />\n\n <Button onClick={quickB1tFlum3}>Quick b1t_flum3.exe</Button>\n <Button onClick={b1tflum3}>Run b1t_flum3.exe</Button>\n <Button onClick={quickHackW0r1dD43m0n}>Quick w0rld_d34m0n</Button>\n <Button onClick={hackW0r1dD43m0n}>Hack w0rld_d34m0n</Button>\n <Button onClick={() => setError(true)}>Throw Error</Button>\n <Button onClick={checkMessages}>Check Messages</Button>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Adjuster } from \"./Adjuster\";\nimport { Player } from \"@player\";\n\nconst bigNumber = 1e27;\n\nexport function Stats(): React.ReactElement {\n function modifyExp(stat: string, modifier: number) {\n return function (exp: number) {\n switch (stat) {\n case \"hacking\":\n if (exp) {\n Player.gainHackingExp(exp * modifier);\n }\n break;\n case \"strength\":\n if (exp) {\n Player.gainStrengthExp(exp * modifier);\n }\n break;\n case \"defense\":\n if (exp) {\n Player.gainDefenseExp(exp * modifier);\n }\n break;\n case \"dexterity\":\n if (exp) {\n Player.gainDexterityExp(exp * modifier);\n }\n break;\n case \"agility\":\n if (exp) {\n Player.gainAgilityExp(exp * modifier);\n }\n break;\n case \"charisma\":\n if (exp) {\n Player.gainCharismaExp(exp * modifier);\n }\n break;\n case \"intelligence\":\n if (exp) {\n Player.gainIntelligenceExp(exp * modifier);\n }\n break;\n }\n Player.updateSkillLevels();\n };\n }\n\n function modifyKarma(modifier: number) {\n return function (amt: number) {\n Player.karma += amt * modifier;\n };\n }\n\n function tonsOfExp(): void {\n Player.gainHackingExp(bigNumber);\n Player.gainStrengthExp(bigNumber);\n Player.gainDefenseExp(bigNumber);\n Player.gainDexterityExp(bigNumber);\n Player.gainAgilityExp(bigNumber);\n Player.gainCharismaExp(bigNumber);\n Player.gainIntelligenceExp(bigNumber);\n Player.updateSkillLevels();\n }\n\n function resetAllExp(): void {\n Player.exp.hacking = 0;\n Player.exp.strength = 0;\n Player.exp.defense = 0;\n Player.exp.dexterity = 0;\n Player.exp.agility = 0;\n Player.exp.charisma = 0;\n Player.exp.intelligence = 0;\n Player.updateSkillLevels();\n }\n\n function resetExperience(stat: string): () => void {\n return function () {\n switch (stat) {\n case \"hacking\":\n Player.exp.hacking = 0;\n break;\n case \"strength\":\n Player.exp.strength = 0;\n break;\n case \"defense\":\n Player.exp.defense = 0;\n break;\n case \"dexterity\":\n Player.exp.dexterity = 0;\n break;\n case \"agility\":\n Player.exp.agility = 0;\n break;\n case \"charisma\":\n Player.exp.charisma = 0;\n break;\n case \"intelligence\":\n Player.exp.intelligence = 0;\n break;\n }\n Player.updateSkillLevels();\n };\n }\n\n function resetKarma(): () => void {\n return function () {\n Player.karma = 0;\n };\n }\n\n function enableIntelligence(): void {\n if (Player.skills.intelligence === 0) {\n Player.skills.intelligence = 1;\n Player.updateSkillLevels();\n }\n }\n\n function disableIntelligence(): void {\n Player.exp.intelligence = 0;\n Player.skills.intelligence = 0;\n Player.updateSkillLevels();\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Experience / Stats</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>All:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfExp}>Tons of exp</Button>\n <Button onClick={resetAllExp}>Reset</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Hacking:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"hacking\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"hacking\", 1)(bigNumber)}\n add={modifyExp(\"hacking\", 1)}\n subtract={modifyExp(\"hacking\", -1)}\n reset={resetExperience(\"hacking\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Strength:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"strength\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"strength\", 1)(bigNumber)}\n add={modifyExp(\"strength\", 1)}\n subtract={modifyExp(\"strength\", -1)}\n reset={resetExperience(\"strength\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Defense:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"defense\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"defense\", 1)(bigNumber)}\n add={modifyExp(\"defense\", 1)}\n subtract={modifyExp(\"defense\", -1)}\n reset={resetExperience(\"defense\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Dexterity:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"dexterity\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"dexterity\", 1)(bigNumber)}\n add={modifyExp(\"dexterity\", 1)}\n subtract={modifyExp(\"dexterity\", -1)}\n reset={resetExperience(\"dexterity\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Agility:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"agility\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"agility\", 1)(bigNumber)}\n add={modifyExp(\"agility\", 1)}\n subtract={modifyExp(\"agility\", -1)}\n reset={resetExperience(\"agility\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Charisma:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"charisma\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"charisma\", 1)(bigNumber)}\n add={modifyExp(\"charisma\", 1)}\n subtract={modifyExp(\"charisma\", -1)}\n reset={resetExperience(\"charisma\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Intelligence:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"intelligence\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"intelligence\", 1)(bigNumber)}\n add={modifyExp(\"intelligence\", 1)}\n subtract={modifyExp(\"intelligence\", -1)}\n reset={resetExperience(\"intelligence\")}\n />\n </td>\n <td>\n <Button onClick={enableIntelligence}>Enable</Button>\n </td>\n <td>\n <Button onClick={disableIntelligence}>Disable</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Karma:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"karma\"\n placeholder=\"amt\"\n tons={() => modifyExp(\"intelligence\", 1)(100000)}\n add={modifyKarma(1)}\n subtract={modifyKarma(-1)}\n reset={resetKarma()}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Adjuster } from \"./Adjuster\";\nimport { Player } from \"@player\";\nimport { Factions as AllFaction } from \"../../Faction/Factions\";\nimport FormControl from \"@mui/material/FormControl\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyAllIcon from \"@mui/icons-material/ReplyAll\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport InputLabel from \"@mui/material/InputLabel\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nconst bigNumber = 1e12;\n\nexport function Factions(): React.ReactElement {\n const [faction, setFaction] = useState(FactionNames.Illuminati as string);\n\n function setFactionDropdown(event: SelectChangeEvent<string>): void {\n setFaction(event.target.value);\n }\n\n function receiveInvite(): void {\n Player.receiveInvite(faction);\n }\n\n function receiveAllInvites(): void {\n Object.values(FactionNames).forEach((faction) => Player.receiveInvite(faction));\n }\n\n function modifyFactionRep(modifier: number): (x: number) => void {\n return function (reputation: number): void {\n const fac = AllFaction[faction];\n if (fac != null && !isNaN(reputation)) {\n fac.playerReputation += reputation * modifier;\n }\n };\n }\n\n function resetFactionRep(): void {\n const fac = AllFaction[faction];\n if (fac != null) {\n fac.playerReputation = 0;\n }\n }\n\n function modifyFactionFavor(modifier: number): (x: number) => void {\n return function (favor: number): void {\n const fac = AllFaction[faction];\n if (fac != null && !isNaN(favor)) {\n fac.favor += favor * modifier;\n }\n };\n }\n\n function resetFactionFavor(): void {\n const fac = AllFaction[faction];\n if (fac != null) {\n fac.favor = 0;\n }\n }\n\n function tonsOfRep(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].playerReputation = bigNumber;\n }\n }\n\n function resetAllRep(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].playerReputation = 0;\n }\n }\n\n function tonsOfFactionFavor(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].favor = bigNumber;\n }\n }\n\n function resetAllFactionFavor(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].favor = 0;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Factions</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Faction:</Typography>\n </td>\n <td>\n <FormControl>\n <InputLabel id=\"factions-select\">Faction</InputLabel>\n <Select\n labelId=\"factions-select\"\n id=\"factions-dropdown\"\n onChange={setFactionDropdown}\n value={faction}\n startAdornment={\n <>\n <IconButton onClick={receiveAllInvites} size=\"large\" arial-label=\"receive-all-invitation\">\n <ReplyAllIcon />\n </IconButton>\n <IconButton onClick={receiveInvite} size=\"large\" arial-label=\"receive-one-invitation\">\n <ReplyIcon />\n </IconButton>\n </>\n }\n >\n {Object.values(AllFaction).map((faction) => (\n <MenuItem key={faction.name} value={faction.name}>\n {faction.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Reputation:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"reputation\"\n placeholder=\"amt\"\n tons={() => modifyFactionRep(1)(bigNumber)}\n add={modifyFactionRep(1)}\n subtract={modifyFactionRep(-1)}\n reset={resetFactionRep}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Favor:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"favor\"\n placeholder=\"amt\"\n tons={() => modifyFactionFavor(1)(2000)}\n add={modifyFactionFavor(1)}\n subtract={modifyFactionFavor(-1)}\n reset={resetFactionFavor}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>All Reputation:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfRep}>Tons</Button>\n <Button onClick={resetAllRep}>Reset</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>All Favor:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfFactionFavor}>Tons</Button>\n <Button onClick={resetAllFactionFavor}>Reset</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import { Clear, ExpandMore, Reply, ReplyAll } from \"@mui/icons-material\";\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Button,\n IconButton,\n MenuItem,\n Select,\n SelectChangeEvent,\n Typography,\n} from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"@player\";\n\nexport function Augmentations(): React.ReactElement {\n const [augmentation, setAugmentation] = useState(\"Augmented Targeting I\");\n\n function setAugmentationDropdown(event: SelectChangeEvent<string>): void {\n setAugmentation(event.target.value);\n }\n function queueAug(): void {\n Player.queueAugmentation(augmentation);\n }\n\n function queueAllAugs(): void {\n for (const augName of Object.values(AugmentationNames)) {\n Player.queueAugmentation(augName);\n }\n }\n\n function clearAugs(): void {\n Player.augmentations = [];\n }\n\n function clearQueuedAugs(): void {\n Player.queuedAugmentations = [];\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMore />}>\n <Typography>Augmentations</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Select\n onChange={setAugmentationDropdown}\n value={augmentation}\n startAdornment={\n <>\n <IconButton onClick={queueAllAugs} size=\"large\">\n <ReplyAll />\n </IconButton>\n <IconButton onClick={queueAug} size=\"large\">\n <Reply />\n </IconButton>\n </>\n }\n endAdornment={\n <>\n <IconButton onClick={clearAugs} size=\"large\">\n <Clear />\n </IconButton>\n </>\n }\n >\n {Object.values(AugmentationNames).map((aug) => (\n <MenuItem key={aug} value={aug}>\n {aug}\n </MenuItem>\n ))}\n </Select>\n <Button sx={{ display: \"block\" }} onClick={clearQueuedAugs}>\n Clear Queued Augmentations\n </Button>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { PlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { Player } from \"@player\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\n\n// Update as additional BitNodes get implemented\nconst validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];\n\nexport function SourceFiles(): React.ReactElement {\n function setSF(sfN: number, sfLvl: number) {\n return function () {\n if (sfN === 9) {\n Player.hacknetNodes = [];\n }\n if (sfLvl === 0) {\n Player.sourceFiles = Player.sourceFiles.filter((sf) => sf.n !== sfN);\n return;\n }\n\n if (!Player.sourceFiles.some((sf) => sf.n === sfN)) {\n Player.sourceFiles.push(new PlayerOwnedSourceFile(sfN, sfLvl));\n return;\n }\n\n for (let i = 0; i < Player.sourceFiles.length; i++) {\n if (Player.sourceFiles[i].n === sfN) {\n Player.sourceFiles[i].lvl = sfLvl;\n }\n }\n };\n }\n\n function setAllSF(sfLvl: number) {\n return () => {\n for (let i = 0; i < validSFN.length; i++) {\n setSF(validSFN[i], sfLvl)();\n }\n };\n }\n\n function clearExploits(): void {\n Player.exploits = [];\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Source-Files</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Exploits:</Typography>\n </td>\n <td>\n <Button onClick={clearExploits}>Clear</Button>\n </td>\n </tr>\n <tr key={\"sf-all\"}>\n <td>\n <Typography>All:</Typography>\n </td>\n <td>\n <ButtonGroup>\n <Button aria-label=\"all-sf-0\" onClick={setAllSF(0)}>\n 0\n </Button>\n <Button aria-label=\"all-sf-1\" onClick={setAllSF(1)}>\n 1\n </Button>\n <Button aria-label=\"all-sf-2\" onClick={setAllSF(2)}>\n 2\n </Button>\n <Button aria-label=\"all-sf-3\" onClick={setAllSF(3)}>\n 3\n </Button>\n </ButtonGroup>\n </td>\n </tr>\n {validSFN.map((i) => (\n <tr key={\"sf-\" + i}>\n <td>\n <Typography>SF-{i}:</Typography>\n </td>\n <td>\n <ButtonGroup>\n <Button onClick={setSF(i, 0)}>0</Button>\n <Button onClick={setSF(i, 1)}>1</Button>\n <Button onClick={setSF(i, 2)}>2</Button>\n <Button onClick={setSF(i, 3)}>3</Button>\n </ButtonGroup>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Player } from \"@player\";\nimport { Programs as AllPrograms } from \"../../Programs/Programs\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\nexport function Programs(): React.ReactElement {\n const [program, setProgram] = useState(\"NUKE.exe\");\n function setProgramDropdown(event: SelectChangeEvent<string>): void {\n setProgram(event.target.value);\n }\n function addProgram(): void {\n if (!Player.hasProgram(program)) {\n Player.getHomeComputer().programs.push(program);\n }\n }\n\n function addAllPrograms(): void {\n for (const i of Object.keys(AllPrograms)) {\n if (!Player.hasProgram(AllPrograms[i].name)) {\n Player.getHomeComputer().programs.push(AllPrograms[i].name);\n }\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Programs</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Program:</Typography>\n </td>\n <td>\n <Select onChange={setProgramDropdown} value={program}>\n {Object.values(AllPrograms).map((program) => (\n <MenuItem key={program.name} value={program.name}>\n {program.name}\n </MenuItem>\n ))}\n </Select>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Add:</Typography>\n </td>\n <td>\n <Button onClick={addProgram}>One</Button>\n <Button onClick={addAllPrograms}>All</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { GetServer, GetAllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\nexport function Servers(): React.ReactElement {\n const [server, setServer] = useState(\"home\");\n function setServerDropdown(event: SelectChangeEvent<string>): void {\n setServer(event.target.value);\n }\n function rootServer(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.hasAdminRights = true;\n s.sshPortOpen = true;\n s.ftpPortOpen = true;\n s.smtpPortOpen = true;\n s.httpPortOpen = true;\n s.sqlPortOpen = true;\n s.openPortCount = 5;\n }\n\n function rootAllServers(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.hasAdminRights = true;\n s.sshPortOpen = true;\n s.ftpPortOpen = true;\n s.smtpPortOpen = true;\n s.httpPortOpen = true;\n s.sqlPortOpen = true;\n s.openPortCount = 5;\n }\n }\n\n function minSecurity(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.hackDifficulty = s.minDifficulty;\n }\n\n function minAllSecurity(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.hackDifficulty = s.minDifficulty;\n }\n }\n\n function maxMoney(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.moneyAvailable = s.moneyMax;\n }\n\n function maxAllMoney(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.moneyAvailable = s.moneyMax;\n }\n }\n\n function minMoney(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.moneyAvailable = 0;\n }\n\n function minAllMoney(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.moneyAvailable = 0;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Servers</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Server:</Typography>\n </td>\n <td colSpan={2}>\n <Select id=\"dev-servers-dropdown\" onChange={setServerDropdown} value={server}>\n {GetAllServers().map((server) => (\n <MenuItem key={server.hostname} value={server.hostname}>\n {server.hostname}\n </MenuItem>\n ))}\n </Select>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Root:</Typography>\n </td>\n <td>\n <Button onClick={rootServer}>Root one</Button>\n </td>\n <td>\n <Button onClick={rootAllServers}>Root all</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Security:</Typography>\n </td>\n <td>\n <Button onClick={minSecurity}>Min one</Button>\n </td>\n <td>\n <Button onClick={minAllSecurity}>Min all</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Money:</Typography>\n </td>\n <td>\n <Button onClick={minMoney}>Min one</Button>\n </td>\n <td>\n <Button onClick={minAllMoney}>Min all</Button>\n </td>\n <td>\n <Button onClick={maxMoney}>Max one</Button>\n </td>\n <td>\n <Button onClick={maxAllMoney}>Max all</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Companies as AllCompanies } from \"../../Company/Companies\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { Adjuster } from \"./Adjuster\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nconst bigNumber = 1e12;\n\nexport function Companies(): React.ReactElement {\n const [company, setCompany] = useState(FactionNames.ECorp as string);\n function setCompanyDropdown(event: SelectChangeEvent<string>): void {\n setCompany(event.target.value);\n }\n function resetCompanyRep(): void {\n AllCompanies[company].playerReputation = 0;\n }\n\n function modifyCompanyRep(modifier: number): (x: number) => void {\n return function (reputation: number): void {\n const c = AllCompanies[company];\n if (c != null && !isNaN(reputation)) {\n c.playerReputation += reputation * modifier;\n }\n };\n }\n\n function modifyCompanyFavor(modifier: number): (x: number) => void {\n return function (favor: number): void {\n const c = AllCompanies[company];\n if (c != null && !isNaN(favor)) {\n c.favor += favor * modifier;\n }\n };\n }\n\n function resetCompanyFavor(): void {\n AllCompanies[company].favor = 0;\n }\n\n function tonsOfRepCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].playerReputation = bigNumber;\n }\n }\n\n function resetAllRepCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].playerReputation = 0;\n }\n }\n\n function tonsOfFavorCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].favor = bigNumber;\n }\n }\n\n function resetAllFavorCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].favor = 0;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Companies</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Company:</Typography>\n </td>\n <td colSpan={3}>\n <Select id=\"dev-companies-dropdown\" onChange={setCompanyDropdown} value={company}>\n {Object.values(AllCompanies).map((company) => (\n <MenuItem key={company.name} value={company.name}>\n {company.name}\n </MenuItem>\n ))}\n </Select>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Reputation:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"reputation\"\n placeholder=\"amt\"\n tons={() => modifyCompanyRep(1)(bigNumber)}\n add={modifyCompanyRep(1)}\n subtract={modifyCompanyRep(-1)}\n reset={resetCompanyRep}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Favor:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"favor\"\n placeholder=\"amt\"\n tons={() => modifyCompanyFavor(1)(2000)}\n add={modifyCompanyFavor(1)}\n subtract={modifyCompanyFavor(-1)}\n reset={resetCompanyFavor}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>All Reputation:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfRepCompanies}>Tons</Button>\n <Button onClick={resetAllRepCompanies}>Reset</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>All Favor:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfFavorCompanies}>Tons</Button>\n <Button onClick={resetAllFavorCompanies}>Reset</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { Adjuster } from \"./Adjuster\";\nimport { Player } from \"@player\";\n\nconst bigNumber = 1e27;\n\nexport function Bladeburner(): React.ReactElement {\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) return <></>;\n function modifyBladeburnerRank(modify: number): (x: number) => void {\n return function (rank: number): void {\n if (!bladeburner) return;\n bladeburner.changeRank(Player, rank * modify);\n };\n }\n\n function resetBladeburnerRank(): void {\n if (!bladeburner) return;\n bladeburner.rank = 0;\n bladeburner.maxRank = 0;\n }\n\n function addTonsBladeburnerRank(): void {\n if (!bladeburner) return;\n\n bladeburner.changeRank(Player, bigNumber);\n }\n\n function modifyBladeburnerCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (!bladeburner) return;\n bladeburner.storedCycles += cycles * modify;\n };\n }\n\n function resetBladeburnerCycles(): void {\n if (!bladeburner) return;\n bladeburner.storedCycles = 0;\n }\n\n function addTonsBladeburnerCycles(): void {\n if (!bladeburner) return;\n bladeburner.storedCycles += bigNumber;\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Bladeburner</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Rank:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"rank\"\n placeholder=\"amt\"\n tons={addTonsBladeburnerRank}\n add={modifyBladeburnerRank(1)}\n subtract={modifyBladeburnerRank(-1)}\n reset={resetBladeburnerRank}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Cycles:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"cycles\"\n placeholder=\"amt\"\n tons={addTonsBladeburnerCycles}\n add={modifyBladeburnerCycles(1)}\n subtract={modifyBladeburnerCycles(-1)}\n reset={resetBladeburnerCycles}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { Adjuster } from \"./Adjuster\";\nimport { Player } from \"@player\";\n\nconst bigNumber = 1e27;\n\nexport function Gang(): React.ReactElement {\n function addTonsGangCycles(): void {\n if (Player.gang) {\n Player.gang.storedCycles = bigNumber;\n }\n }\n\n function modifyGangCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (Player.gang) {\n Player.gang.storedCycles += cycles * modify;\n }\n };\n }\n\n function resetGangCycles(): void {\n if (Player.gang) {\n Player.gang.storedCycles = 0;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Gang</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Cycles:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"cycles\"\n placeholder=\"amt\"\n tons={addTonsGangCycles}\n add={modifyGangCycles(1)}\n subtract={modifyGangCycles(-1)}\n reset={resetGangCycles}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Adjuster } from \"./Adjuster\";\nimport { Player } from \"@player\";\n\nconst bigNumber = 1e27;\n\nexport function Corporation(): React.ReactElement {\n function addTonsCorporationFunds(): void {\n if (Player.corporation) {\n Player.corporation.funds = Player.corporation.funds + bigNumber;\n }\n }\n\n function modifyCorporationFunds(modify: number): (x: number) => void {\n return function (funds: number): void {\n if (Player.corporation) {\n Player.corporation.funds += funds * modify;\n }\n };\n }\n\n function resetCorporationFunds(): void {\n if (Player.corporation) {\n Player.corporation.funds = Player.corporation.funds - Player.corporation.funds;\n }\n }\n\n function addTonsCorporationCycles(): void {\n if (Player.corporation) {\n Player.corporation.storedCycles = bigNumber;\n }\n }\n\n function modifyCorporationCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (Player.corporation) {\n Player.corporation.storedCycles += cycles * modify;\n }\n };\n }\n\n function resetCorporationCycles(): void {\n if (Player.corporation) {\n Player.corporation.storedCycles = 0;\n }\n }\n\n function finishCorporationProducts(): void {\n if (!Player.corporation) return;\n Player.corporation.divisions.forEach((div) => {\n Object.keys(div.products).forEach((prod) => {\n const product = div.products[prod];\n if (product === undefined) throw new Error(\"Impossible product undefined\");\n product.prog = 99.9;\n });\n });\n }\n\n function addCorporationResearch(): void {\n if (!Player.corporation) return;\n Player.corporation.divisions.forEach((div) => {\n div.sciResearch.qty += 1e10;\n });\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Corporation</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Funds:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"set funds\"\n placeholder=\"amt\"\n tons={addTonsCorporationFunds}\n add={modifyCorporationFunds(1)}\n subtract={modifyCorporationFunds(-1)}\n reset={resetCorporationFunds}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Cycles:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"cycles\"\n placeholder=\"amt\"\n tons={addTonsCorporationCycles}\n add={modifyCorporationCycles(1)}\n subtract={modifyCorporationCycles(-1)}\n reset={resetCorporationCycles}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Button onClick={finishCorporationProducts}>Finish products</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button onClick={addCorporationResearch}>Tons of research</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { generateContract, generateRandomContract, generateRandomContractOnHome } from \"../../CodingContractGenerator\";\nimport { CodingContractTypes } from \"../../CodingContracts\";\n\nexport function CodingContracts(): React.ReactElement {\n const [codingcontract, setCodingcontract] = useState(\"Find Largest Prime Factor\");\n function setCodingcontractDropdown(event: SelectChangeEvent<string>): void {\n setCodingcontract(event.target.value);\n }\n\n function specificContract(): void {\n generateContract({\n problemType: codingcontract,\n server: \"home\",\n });\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Coding Contracts</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Button onClick={generateRandomContract}>Generate Random Contract</Button>\n <Button onClick={generateRandomContractOnHome}>Generate Random Contract on Home Comp</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Select onChange={setCodingcontractDropdown} value={codingcontract}>\n {Object.values(CodingContractTypes).map((cc) => (\n <MenuItem key={cc.name} value={cc.name}>\n {cc.name}\n </MenuItem>\n ))}\n </Select>\n <Button onClick={specificContract}>Generate Specified Contract Type on Home Comp</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { Money } from \"../../ui/React/Money\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { StockMarket as SM } from \"../../StockMarket/StockMarket\";\nimport { Stock } from \"../../StockMarket/Stock\";\n\nexport function StockMarket(): React.ReactElement {\n const [stockPrice, setStockPrice] = useState(0);\n const [stockSymbol, setStockSymbol] = useState(\"\");\n\n function setStockPriceField(event: React.ChangeEvent<HTMLInputElement>): void {\n setStockPrice(parseFloat(event.target.value));\n }\n\n function setStockSymbolField(event: React.ChangeEvent<HTMLInputElement>): void {\n setStockSymbol(event.target.value);\n }\n\n function processStocks(sub: (arg0: Stock) => void): void {\n const inputSymbols = stockSymbol.replace(/\\s/g, \"\");\n\n let match: (symbol: string) => boolean = (): boolean => {\n return true;\n };\n\n if (inputSymbols !== \"\" && inputSymbols !== \"all\") {\n match = function (symbol: string): boolean {\n return inputSymbols.split(\",\").includes(symbol);\n };\n }\n\n for (const name of Object.keys(SM)) {\n if (SM.hasOwnProperty(name)) {\n const stock = SM[name];\n if (stock instanceof Stock && match(stock.symbol)) {\n sub(stock);\n }\n }\n }\n }\n\n function doSetStockPrice(): void {\n if (!isNaN(stockPrice)) {\n processStocks((stock: Stock) => {\n stock.price = stockPrice;\n });\n }\n }\n\n function viewStockCaps(): void {\n const stocks: JSX.Element[] = [];\n processStocks((stock: Stock) => {\n stocks.push(\n <tr key={stock.symbol}>\n <td>{stock.symbol}</td>\n <td style={{ textAlign: \"right\" }}>\n <Money money={stock.cap} />\n </td>\n </tr>,\n );\n });\n dialogBoxCreate(\n <table>\n <tbody>\n <tr>\n <th>Stock</th>\n <th>Price cap</th>\n </tr>\n {stocks}\n </tbody>\n </table>,\n );\n }\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Stock Market</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Symbol:</Typography>\n </td>\n <td>\n <TextField placeholder=\"symbol/'all'\" onChange={setStockSymbolField} />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Price:</Typography>\n </td>\n <td>\n <TextField placeholder=\"$$$\" onChange={setStockPriceField} />\n <Button onClick={doSetStockPrice}>Set</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Caps:</Typography>\n </td>\n <td>\n <Button onClick={viewStockCaps}>View stock caps</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport { Player } from \"@player\";\nimport { Adjuster } from \"./Adjuster\";\n\nexport function Sleeves(): React.ReactElement {\n function sleeveMaxAllShock(): void {\n for (let i = 0; i < Player.sleeves.length; ++i) {\n Player.sleeves[i].shock = 0;\n }\n }\n\n function sleeveClearAllShock(): void {\n for (let i = 0; i < Player.sleeves.length; ++i) {\n Player.sleeves[i].shock = 100;\n }\n }\n\n function sleeveSyncMaxAll(): void {\n for (let i = 0; i < Player.sleeves.length; ++i) {\n Player.sleeves[i].sync = 100;\n }\n }\n\n function sleeveSyncClearAll(): void {\n for (let i = 0; i < Player.sleeves.length; ++i) {\n Player.sleeves[i].sync = 0;\n }\n }\n\n function sleeveSetStoredCycles(cycles: number): void {\n for (let i = 0; i < Player.sleeves.length; ++i) {\n Player.sleeves[i].storedCycles = cycles;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Sleeves</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Shock:</Typography>\n </td>\n <td>\n <Button onClick={sleeveMaxAllShock}>Max all</Button>\n </td>\n <td>\n <Button onClick={sleeveClearAllShock}>Clear all</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Sync:</Typography>\n </td>\n <td>\n <Button onClick={sleeveSyncMaxAll}>Max all</Button>\n </td>\n <td>\n <Button onClick={sleeveSyncClearAll}>Clear all</Button>\n </td>\n </tr>\n <tr>\n <td colSpan={3}>\n <Adjuster\n label=\"Stored Cycles\"\n placeholder=\"cycles\"\n tons={() => sleeveSetStoredCycles(10000000)}\n add={sleeveSetStoredCycles}\n subtract={sleeveSetStoredCycles}\n reset={() => sleeveSetStoredCycles(0)}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport { staneksGift } from \"../../CotMG/Helper\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport { Adjuster } from \"./Adjuster\";\n\nexport function Stanek(): React.ReactElement {\n function addCycles(): void {\n staneksGift.storedCycles = 1e6;\n }\n\n function modCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n staneksGift.storedCycles += cycles * modify;\n };\n }\n\n function resetCycles(): void {\n staneksGift.storedCycles = 0;\n }\n\n function addCharge(): void {\n staneksGift.fragments.forEach((f) => {\n f.highestCharge = 1e21;\n f.numCharge = 1e21;\n });\n }\n\n function modCharge(modify: number): (x: number) => void {\n return function (cycles: number): void {\n staneksGift.fragments.forEach((f) => (f.highestCharge += cycles * modify));\n };\n }\n\n function resetCharge(): void {\n staneksGift.fragments.forEach((f) => {\n f.highestCharge = 0;\n f.numCharge = 0;\n });\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Stanek's Gift</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Adjuster\n label=\"cycles\"\n placeholder=\"amt\"\n tons={addCycles}\n add={modCycles(1)}\n subtract={modCycles(-1)}\n reset={resetCycles}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Adjuster\n label=\"all charge\"\n placeholder=\"amt\"\n tons={addCharge}\n add={modCharge(1)}\n subtract={modCharge(-1)}\n reset={resetCharge}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Player } from \"@player\";\nimport { saveObject } from \"../../SaveObject\";\nimport { Engine } from \"../../engine\";\n\n// Update as additional BitNodes get implemented\n\nexport function TimeSkip(): React.ReactElement {\n function timeskip(time: number) {\n return () => {\n Player.lastUpdate -= time;\n Engine._lastUpdate -= time;\n saveObject.saveGame();\n setTimeout(() => location.reload(), 1000);\n };\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Time skip</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Button onClick={timeskip(60 * 1000)}>1 minute</Button>\n <Button onClick={timeskip(60 * 60 * 1000)}>1 hour</Button>\n <Button onClick={timeskip(24 * 60 * 60 * 1000)}>1 day</Button>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState, useRef } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport { saveObject } from \"../../SaveObject\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { Upload } from \"@mui/icons-material\";\nimport { Button } from \"@mui/material\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\n\nexport function SaveFile(): React.ReactElement {\n const importInput = useRef<HTMLInputElement>(null);\n const [saveFile, setSaveFile] = useState(\"\");\n const [restoreScripts, setRestoreScripts] = useState(true);\n const [restoreAugs, setRestoreAugs] = useState(true);\n const [restoreSFs, setRestoreSFs] = useState(true);\n\n async function onImport(event: React.ChangeEvent<HTMLInputElement>): Promise<void> {\n try {\n const base64Save = await saveObject.getImportStringFromFile(event.target.files);\n const save = atob(base64Save);\n setSaveFile(save);\n } catch (e: unknown) {\n SnackbarEvents.emit(String(e), ToastVariant.ERROR, 5000);\n }\n }\n\n function startImport(): void {\n if (!window.File || !window.FileReader || !window.FileList || !window.Blob) return;\n const ii = importInput.current;\n if (ii === null) throw new Error(\"import input should not be null\");\n ii.click();\n }\n\n function doRestore(): void {\n const save = JSON.parse(saveFile);\n // TODO: Continue here.\n console.error(save);\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Save file</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Button onClick={startImport} startIcon={<Upload />} sx={{ gridArea: \"import\" }}>\n Select save file\n <input ref={importInput} type=\"file\" hidden onChange={onImport} />\n </Button>\n <br />\n {saveFile !== \"\" && (\n <>\n <OptionSwitch\n checked={restoreScripts}\n onChange={(v) => setRestoreScripts(v)}\n text=\"Restore scripts\"\n tooltip={<>Restore the save file home computer scripts.</>}\n />\n <br />\n <OptionSwitch\n checked={restoreAugs}\n onChange={(v) => setRestoreAugs(v)}\n text=\"Restore Augmentations\"\n tooltip={<>Restore the save file installed augmentations.</>}\n />\n <br />\n <OptionSwitch\n checked={restoreSFs}\n onChange={(v) => setRestoreSFs(v)}\n text=\"Restore Source Files\"\n tooltip={<>Restore the save file acquired source files.</>}\n />\n <br />\n <Button onClick={doRestore}>Restore</Button>\n </>\n )}\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport { Tooltip } from \"@mui/material\";\nimport LockIcon from \"@mui/icons-material/Lock\";\nimport LockOpenIcon from \"@mui/icons-material/LockOpen\";\n\nimport { Player } from \"@player\";\nimport { achievements } from \"../../Achievements/Achievements\";\nimport { Engine } from \"../../engine\";\n\nexport function Achievements(): React.ReactElement {\n const [playerAchievement, setPlayerAchievements] = useState(Player.achievements.map((m) => m.ID));\n\n function grantAchievement(id: string): void {\n Player.giveAchievement(id);\n setPlayerAchievements(Player.achievements.map((m) => m.ID));\n }\n\n function grantAllAchievements(): void {\n Object.values(achievements).forEach((a) => Player.giveAchievement(a.ID));\n setPlayerAchievements(Player.achievements.map((m) => m.ID));\n }\n\n function removeAchievement(id: string): void {\n Player.achievements = Player.achievements.filter((a) => a.ID !== id);\n setPlayerAchievements(Player.achievements.map((m) => m.ID));\n }\n\n function clearAchievements(): void {\n Player.achievements = [];\n setPlayerAchievements(Player.achievements.map((m) => m.ID));\n }\n\n function disableEngine(): void {\n Engine.Counters.achievementsCounter = Number.MAX_VALUE;\n }\n\n function enableEngine(): void {\n Engine.Counters.achievementsCounter = 0;\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Achievements</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td></td>\n <td>\n <Typography>Achievements:</Typography>\n </td>\n <td>\n <ButtonGroup>\n <Button onClick={grantAllAchievements}>Grant All</Button>\n <Button onClick={clearAchievements}>Clear</Button>\n <Button onClick={disableEngine}>Disable Engine</Button>\n <Button onClick={enableEngine}>Enable Engine</Button>\n </ButtonGroup>\n </td>\n </tr>\n {Object.values(achievements).map((i) => {\n const achieved = playerAchievement.includes(i.ID);\n return (\n <tr key={\"ach-\" + i.ID}>\n <td>\n {achieved ? (\n <Tooltip title=\"Achieved\">\n <LockOpenIcon color=\"primary\" />\n </Tooltip>\n ) : (\n <Tooltip title=\"Locked\">\n <LockIcon color=\"secondary\" />\n </Tooltip>\n )}\n </td>\n <td>\n <Tooltip\n title={\n <>\n {i.ID}\n <br />\n {i.Description}\n </>\n }\n >\n <Typography color={achieved ? \"primary\" : \"secondary\"}>{i.Name}:</Typography>\n </Tooltip>\n </td>\n <td>\n <ButtonGroup>\n <Button onClick={() => grantAchievement(i.ID)}>Grant</Button>\n <Button onClick={() => removeAchievement(i.ID)}>Clear</Button>\n </ButtonGroup>\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport { Player } from \"@player\";\nimport { Adjuster } from \"./Adjuster\";\n\n// Update as additional BitNodes get implemented\n\nexport function Entropy(): React.ReactElement {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Entropy</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Adjuster\n label=\"Set entropy\"\n placeholder=\"entropy\"\n add={(num) => {\n Player.entropy += num;\n Player.applyEntropy(Player.entropy);\n }}\n subtract={(num) => {\n Player.entropy -= num;\n Player.applyEntropy(Player.entropy);\n }}\n tons={() => {\n Player.entropy += 1e12;\n Player.applyEntropy(Player.entropy);\n }}\n reset={() => {\n Player.entropy = 0;\n Player.applyEntropy(Player.entropy);\n }}\n />\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { Stats } from \"./Stats\";\nimport { Console } from \"./Console\";\nimport { AllPages } from \"./AllPages\";\n\nimport { Player } from \"@player\";\nimport Box from \"@mui/material/Box\";\n\nexport function BladeburnerRoot(): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const bladeburner = Player.bladeburner;\n if (!bladeburner) return <></>;\n return (\n <Box display=\"flex\" flexDirection=\"column\">\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"4fr 8fr\", p: 1 }}>\n <Stats bladeburner={bladeburner} />\n <Console bladeburner={bladeburner} />\n </Box>\n\n <AllPages bladeburner={bladeburner} />\n </Box>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { Player } from \"@player\";\nimport { Money } from \"../../ui/React/Money\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { joinFaction } from \"../../Faction/FactionHelpers\";\nimport { Bladeburner } from \"../Bladeburner\";\n\nimport { TravelModal } from \"./TravelModal\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function Stats(props: IProps): React.ReactElement {\n const [travelOpen, setTravelOpen] = useState(false);\n const setRerender = useState(false)[1];\n\n const inFaction = props.bladeburner.rank >= BladeburnerConstants.RankNeededForFaction;\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 1000);\n return () => clearInterval(id);\n }, []);\n\n function openFaction(): void {\n if (!inFaction) return;\n const faction = Factions[FactionNames.Bladeburners];\n if (!faction.isMember) {\n joinFaction(faction);\n }\n\n Router.toFaction(faction);\n }\n\n return (\n <Paper sx={{ p: 1, overflowY: \"auto\", overflowX: \"hidden\", wordBreak: \"break-all\" }}>\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1, maxHeight: \"60vh\" }}>\n <Box sx={{ alignSelf: \"flex-start\", width: \"100%\" }}>\n <Button onClick={() => setTravelOpen(true)} sx={{ width: \"50%\" }}>\n Travel\n </Button>\n <Tooltip title={!inFaction ? <Typography>Rank 25 required.</Typography> : \"\"}>\n <span>\n <Button disabled={!inFaction} onClick={openFaction} sx={{ width: \"50%\" }}>\n Faction\n </Button>\n </span>\n </Tooltip>\n <TravelModal open={travelOpen} onClose={() => setTravelOpen(false)} bladeburner={props.bladeburner} />\n </Box>\n <Box display=\"flex\">\n <Tooltip title={<Typography>Your rank within the Bladeburner division.</Typography>}>\n <Typography>Rank: {formatNumber(props.bladeburner.rank, 2)}</Typography>\n </Tooltip>\n </Box>\n <br />\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Performing actions will use up your stamina.\n <br />\n <br />\n Your max stamina is determined primarily by your agility stat.\n <br />\n <br />\n Your stamina gain rate is determined by both your agility and your max stamina. Higher max stamina leads\n to a higher gain rate.\n <br />\n <br />\n Once your stamina falls below 50% of its max value, it begins to negatively affect the success rate of\n your contracts/operations. This penalty is shown in the overview panel. If the penalty is 15%, then this\n means your success rate would be multiplied by 85% (100 - 15).\n <br />\n <br />\n Your max stamina and stamina gain rate can also be increased by training, or through skills and\n Augmentation upgrades.\n </Typography>\n }\n >\n <Typography>\n Stamina: {formatNumber(props.bladeburner.stamina, 3)} / {formatNumber(props.bladeburner.maxStamina, 3)}\n </Typography>\n </Tooltip>\n </Box>\n <Typography>\n Stamina Penalty: {formatNumber((1 - props.bladeburner.calculateStaminaPenalty()) * 100, 1)}%\n </Typography>\n <br />\n <Typography>Team Size: {formatNumber(props.bladeburner.teamSize, 0)}</Typography>\n <Typography>Team Members Lost: {formatNumber(props.bladeburner.teamLost, 0)}</Typography>\n <br />\n <Typography>Num Times Hospitalized: {props.bladeburner.numHosp}</Typography>\n <Typography>\n Money Lost From Hospitalizations: <Money money={props.bladeburner.moneyLost} />\n </Typography>\n <br />\n <Typography>Current City: {props.bladeburner.city}</Typography>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n This is your Bladeburner division's estimate of how many Synthoids exist in your current city. An\n accurate population count increases success rate estimates.\n </Typography>\n }\n >\n <Typography>\n Est. Synthoid Population: {numeralWrapper.formatPopulation(props.bladeburner.getCurrentCity().popEst)}\n </Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n This is your Bladeburner division's estimate of how many Synthoid communities exist in your current\n city.\n </Typography>\n }\n >\n <Typography>Synthoid Communities: {formatNumber(props.bladeburner.getCurrentCity().comms, 0)}</Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n The city's chaos level due to tensions and conflicts between humans and Synthoids. Having too high of a\n chaos level can make contracts and operations harder.\n </Typography>\n }\n >\n <Typography>City Chaos: {formatNumber(props.bladeburner.getCurrentCity().chaos)}</Typography>\n </Tooltip>\n </Box>\n <br />\n {(props.bladeburner.storedCycles / BladeburnerConstants.CyclesPerSecond) * 1000 > 15000 && (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by\n browser). Bonus time makes the Bladeburner mechanic progress faster, up to 5x the normal speed.\n </Typography>\n }\n >\n <Typography>\n Bonus time:{\" \"}\n {convertTimeMsToTimeElapsedString(\n (props.bladeburner.storedCycles / BladeburnerConstants.CyclesPerSecond) * 1000,\n )}\n </Typography>\n </Tooltip>\n </Box>\n <br />\n </>\n )}\n <Typography>Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}</Typography>\n <br />\n <Typography>\n Aug. Success Chance mult: {formatNumber(Player.mults.bladeburner_success_chance * 100, 1)}%\n <br />\n Aug. Max Stamina mult: {formatNumber(Player.mults.bladeburner_max_stamina * 100, 1)}%\n <br />\n Aug. Stamina Gain mult: {formatNumber(Player.mults.bladeburner_stamina_gain * 100, 1)}%\n <br />\n Aug. Field Analysis mult: {formatNumber(Player.mults.bladeburner_analysis * 100, 1)}%\n </Typography>\n </Box>\n </Paper>\n );\n}\n","import React from \"react\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { Settings } from \"../../Settings/Settings\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n open: boolean;\n onClose: () => void;\n}\n\nexport function TravelModal(props: IProps): React.ReactElement {\n function travel(city: string): void {\n props.bladeburner.city = city;\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Travel to a different city for your Bladeburner activities. This does not cost any money. The city you are in\n for your Bladeburner duties does not affect your location in the game otherwise.\n </Typography>\n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n <Button key={city} onClick={() => travel(city)}>\n {city}\n </Button>\n ))\n ) : (\n <WorldMap currentCity={props.bladeburner.city as CityName} onTravel={(city: CityName) => travel(city)} />\n )}\n </>\n </Modal>\n );\n}\n","import React, { useState, useRef, useEffect } from \"react\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\nimport Paper from \"@mui/material/Paper\";\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface ILineProps {\n content: React.ReactNode;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n margin: theme.spacing(0),\n width: \"100%\",\n },\n input: {\n backgroundColor: theme.colors.backgroundsecondary,\n },\n nopadding: {\n padding: theme.spacing(0),\n },\n preformatted: {\n whiteSpace: \"pre-wrap\",\n margin: theme.spacing(0),\n },\n list: {\n padding: theme.spacing(0),\n height: \"100%\",\n },\n }),\n);\n\nfunction Line(props: ILineProps): React.ReactElement {\n return (\n <ListItem sx={{ p: 0 }}>\n <Typography>{props.content}</Typography>\n </ListItem>\n );\n}\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function Console(props: IProps): React.ReactElement {\n const classes = useStyles();\n const [command, setCommand] = useState(\"\");\n const setRerender = useState(false)[1];\n const consoleInput = useRef<HTMLInputElement>(null);\n\n function handleCommandChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setCommand(event.target.value);\n }\n\n const [consoleHistoryIndex, setConsoleHistoryIndex] = useState(props.bladeburner.consoleHistory.length);\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => {\n clearInterval(id);\n };\n }, []);\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) {\n event.preventDefault();\n if (command.length > 0) {\n props.bladeburner.postToConsole(\"> \" + command);\n props.bladeburner.executeConsoleCommands(command);\n setConsoleHistoryIndex(props.bladeburner.consoleHistory.length);\n setCommand(\"\");\n }\n }\n\n const consoleHistory = props.bladeburner.consoleHistory;\n\n if (event.key === KEY.UP_ARROW) {\n // up\n let i = consoleHistoryIndex;\n const len = consoleHistory.length;\n if (len === 0) {\n return;\n }\n if (i < 0 || i > len) {\n setConsoleHistoryIndex(len);\n }\n\n if (i !== 0) {\n i = i - 1;\n }\n setConsoleHistoryIndex(i);\n const prevCommand = consoleHistory[i];\n event.currentTarget.value = prevCommand;\n setCommand(prevCommand);\n }\n\n if (event.key === KEY.DOWN_ARROW) {\n const i = consoleHistoryIndex;\n const len = consoleHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n setConsoleHistoryIndex(len);\n }\n\n // Latest command, put nothing\n if (i == len || i == len - 1) {\n setConsoleHistoryIndex(len);\n event.currentTarget.value = \"\";\n } else {\n setConsoleHistoryIndex(consoleHistoryIndex + 1);\n const prevCommand = consoleHistory[consoleHistoryIndex + 1];\n event.currentTarget.value = prevCommand;\n setCommand(prevCommand);\n }\n }\n }\n\n function handleClick(): void {\n if (!consoleInput.current) return;\n consoleInput.current.focus();\n }\n\n return (\n <Paper sx={{ p: 1 }}>\n <Box\n sx={{\n height: \"60vh\",\n paddingBottom: \"8px\",\n display: \"flex\",\n alignItems: \"stretch\",\n whiteSpace: \"pre-wrap\",\n }}\n onClick={handleClick}\n >\n <Box>\n <Logs entries={[...props.bladeburner.consoleLogs]} />\n </Box>\n </Box>\n <TextField\n classes={{ root: classes.textfield }}\n autoFocus\n tabIndex={1}\n type=\"text\"\n inputRef={consoleInput}\n value={command}\n onChange={handleCommandChange}\n onKeyDown={handleKeyDown}\n InputProps={{\n // for players to hook in\n className: classes.input,\n startAdornment: (\n <>\n <Typography>> </Typography>\n </>\n ),\n spellCheck: false,\n }}\n />\n </Paper>\n );\n}\n\ninterface ILogProps {\n entries: string[];\n}\n\nfunction Logs({ entries }: ILogProps): React.ReactElement {\n const scrollHook = useRef<HTMLUListElement>(null);\n\n // TODO: Text gets shifted up as new entries appear, if the user scrolled up it should attempt to keep the text focused\n function scrollToBottom(): void {\n if (!scrollHook.current) return;\n scrollHook.current.scrollTop = scrollHook.current.scrollHeight;\n }\n\n useEffect(() => {\n scrollToBottom();\n }, [entries.length]);\n\n return (\n <List sx={{ height: \"100%\", overflow: \"auto\", p: 1 }} ref={scrollHook}>\n {entries && entries.map((log: string, i: number) => <Line key={i} content={log} />)}\n </List>\n );\n}\n","import React from \"react\";\nimport { GeneralActionPage } from \"./GeneralActionPage\";\nimport { ContractPage } from \"./ContractPage\";\nimport { OperationPage } from \"./OperationPage\";\nimport { BlackOpPage } from \"./BlackOpPage\";\nimport { SkillPage } from \"./SkillPage\";\nimport { Bladeburner } from \"../Bladeburner\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function AllPages(props: IProps): React.ReactElement {\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n return (\n <>\n <Tabs variant=\"fullWidth\" value={value} onChange={handleChange}>\n <Tab label=\"General\" />\n <Tab label=\"Contracts\" />\n <Tab label=\"Operations\" />\n <Tab label=\"BlackOps\" />\n <Tab label=\"Skills\" />\n </Tabs>\n <Box sx={{ p: 1 }}>\n {value === 0 && <GeneralActionPage bladeburner={props.bladeburner} />}\n {value === 1 && <ContractPage bladeburner={props.bladeburner} />}\n {value === 2 && <OperationPage bladeburner={props.bladeburner} />}\n {value === 3 && <BlackOpPage bladeburner={props.bladeburner} />}\n {value === 4 && <SkillPage bladeburner={props.bladeburner} />}\n </Box>\n </>\n );\n}\n","import * as React from \"react\";\nimport { GeneralActionList } from \"./GeneralActionList\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function GeneralActionPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>These are generic actions that will assist you in your Bladeburner duties.</Typography>\n <GeneralActionList bladeburner={props.bladeburner} />\n </>\n );\n}\n","import React from \"react\";\nimport { GeneralActionElem } from \"./GeneralActionElem\";\nimport { Action } from \"../Action\";\nimport { GeneralActions } from \"../GeneralActions\";\nimport { Bladeburner } from \"../Bladeburner\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function GeneralActionList(props: IProps): React.ReactElement {\n const actions: Action[] = [];\n for (const name of Object.keys(GeneralActions)) {\n if (GeneralActions.hasOwnProperty(name)) {\n actions.push(GeneralActions[name]);\n }\n }\n return (\n <>\n {actions.map((action: Action) => (\n <GeneralActionElem key={action.name} bladeburner={props.bladeburner} action={action} />\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport { Action } from \"../Action\";\nimport { GeneralActions } from \"../data/GeneralActions\";\nimport { Player } from \"@player\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n action: Action;\n}\n\nexport function GeneralActionElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive = props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = (function (): number {\n switch (props.action.name) {\n case \"Training\":\n case \"Field Analysis\":\n return 30;\n case \"Diplomacy\":\n case \"Hyperbolic Regeneration Chamber\":\n case \"Incite Violence\":\n return 60;\n case \"Recruitment\":\n return props.bladeburner.getRecruitmentTime(Player);\n }\n return -1; // dead code\n })();\n const successChance =\n props.action.name === \"Recruitment\"\n ? Math.max(0, Math.min(props.bladeburner.getRecruitmentSuccessChance(Player), 1))\n : -1;\n\n const actionData = GeneralActions[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n {isActive ? (\n <>\n <CopyableText value={props.action.name} />\n <Typography>\n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </Typography>\n <Typography>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </Typography>\n </>\n ) : (\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <CopyableText value={props.action.name} />\n <StartButton\n bladeburner={props.bladeburner}\n type={ActionTypes[props.action.name]}\n name={props.action.name}\n rerender={rerender}\n />\n </Box>\n )}\n <br />\n <br />\n <Typography>{actionData.desc}</Typography>\n <br />\n <br />\n <Typography>\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n {successChance !== -1 && (\n <>\n <br />\n Estimated success chance: {formatNumber(successChance * 100, 1)}%\n </>\n )}\n </Typography>\n </Paper>\n );\n}\n","import * as React from \"react\";\nimport { ContractList } from \"./ContractList\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function ContractPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n Complete contracts in order to increase your Bladeburner rank and earn money. Failing a contract will cause you\n to lose HP, which can lead to hospitalization.\n <br />\n <br />\n You can unlock higher-level contracts by successfully completing them. Higher-level contracts are more\n difficult, but grant more rank, experience, and money.\n </Typography>\n <ContractList bladeburner={props.bladeburner} />\n </>\n );\n}\n","import React from \"react\";\nimport { ContractElem } from \"./ContractElem\";\nimport { Bladeburner } from \"../Bladeburner\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function ContractList(props: IProps): React.ReactElement {\n const names = Object.keys(props.bladeburner.contracts);\n const contracts = props.bladeburner.contracts;\n return (\n <>\n {names.map((name: string) => (\n <ContractElem key={name} bladeburner={props.bladeburner} action={contracts[name]} />\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Contracts } from \"../data/Contracts\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport { Action } from \"../Action\";\nimport { Player } from \"@player\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { ActionLevel } from \"./ActionLevel\";\nimport { Autolevel } from \"./Autolevel\";\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n action: Action;\n}\n\nexport function ContractElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Contract\"] && props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = props.action.getActionTime(props.bladeburner, Player);\n\n const actionData = Contracts[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n {isActive ? (\n <>\n <Typography>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </Typography>\n <Typography>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </Typography>\n </>\n ) : (\n <>\n <CopyableText value={props.action.name} />\n <StartButton\n bladeburner={props.bladeburner}\n type={ActionTypes.Contract}\n name={props.action.name}\n rerender={rerender}\n />\n </>\n )}\n <br />\n <br />\n <ActionLevel action={props.action} bladeburner={props.bladeburner} isActive={isActive} rerender={rerender} />\n <br />\n <br />\n <Typography>\n {actionData.desc}\n <br />\n <br />\n <SuccessChance action={props.action} bladeburner={props.bladeburner} />\n <br />\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n <br />\n Contracts remaining: {Math.floor(props.action.count)}\n <br />\n Successes: {props.action.successes}\n <br />\n Failures: {props.action.failures}\n </Typography>\n <br />\n <Autolevel rerender={rerender} action={props.action} />\n </Paper>\n );\n}\n","import React from \"react\";\nimport { stealthIcon } from \"../data/Icons\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nexport function StealthIcon(): React.ReactElement {\n return <Tooltip title={<Typography>This action involves stealth</Typography>}>{stealthIcon}</Tooltip>;\n}\n","import React from \"react\";\nimport { killIcon } from \"../data/Icons\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nexport function KillIcon(): React.ReactElement {\n return <Tooltip title={<Typography>This action involves retirement</Typography>}>{killIcon}</Tooltip>;\n}\n","import * as React from \"react\";\nimport { OperationList } from \"./OperationList\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function OperationPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n Carry out operations for the Bladeburner division. Failing an operation will reduce your Bladeburner rank. It\n will also cause you to lose HP, which can lead to hospitalization. In general, operations are harder and more\n punishing than contracts, but are also more rewarding.\n <br />\n <br />\n Operations can affect the chaos level and Synthoid population of your current city. The exact effects vary\n between different Operations.\n <br />\n <br />\n For operations, you can use a team. You must first recruit team members. Having a larger team will improve your\n chances of success.\n <br />\n <br />\n You can unlock higher-level operations by successfully completing them. Higher-level operations are more\n difficult, but grant more rank and experience.\n </Typography>\n <OperationList bladeburner={props.bladeburner} />\n </>\n );\n}\n","import React from \"react\";\nimport { OperationElem } from \"./OperationElem\";\nimport { Bladeburner } from \"../Bladeburner\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function OperationList(props: IProps): React.ReactElement {\n const names = Object.keys(props.bladeburner.operations);\n const operations = props.bladeburner.operations;\n return (\n <>\n {names.map((name: string) => (\n <OperationElem key={name} bladeburner={props.bladeburner} action={operations[name]} />\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { ActionLevel } from \"./ActionLevel\";\nimport { Autolevel } from \"./Autolevel\";\nimport { StartButton } from \"./StartButton\";\nimport { TeamSizeButton } from \"./TeamSizeButton\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport { Operation } from \"../Operation\";\nimport { Operations } from \"../data/Operations\";\nimport { Player } from \"@player\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n action: Operation;\n}\n\nexport function OperationElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Operation\"] && props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = props.action.getActionTime(props.bladeburner, Player);\n\n const actionData = Operations[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n {isActive ? (\n <>\n <Typography>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </Typography>\n <Typography>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </Typography>\n </>\n ) : (\n <>\n <CopyableText value={props.action.name} />\n <StartButton\n bladeburner={props.bladeburner}\n type={ActionTypes.Operation}\n name={props.action.name}\n rerender={rerender}\n />\n <TeamSizeButton action={props.action} bladeburner={props.bladeburner} />\n </>\n )}\n <br />\n <br />\n\n <ActionLevel action={props.action} bladeburner={props.bladeburner} isActive={isActive} rerender={rerender} />\n <br />\n <br />\n <Typography>\n {actionData.desc}\n <br />\n <br />\n <SuccessChance action={props.action} bladeburner={props.bladeburner} />\n <br />\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n <br />\n Operations remaining: {Math.floor(props.action.count)}\n <br />\n Successes: {props.action.successes}\n <br />\n Failures: {props.action.failures}\n </Typography>\n <br />\n <Autolevel rerender={rerender} action={props.action} />\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Action } from \"../Action\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n action: Action;\n open: boolean;\n onClose: () => void;\n}\n\nexport function TeamSizeModal(props: IProps): React.ReactElement {\n const [teamSize, setTeamSize] = useState<number | undefined>();\n\n function confirmTeamSize(): void {\n if (teamSize === undefined) return;\n const num = Math.round(teamSize);\n if (isNaN(num) || num < 0) {\n dialogBoxCreate(\"Invalid value entered for number of Team Members (must be numeric, positive)\");\n } else {\n props.action.teamCount = num;\n }\n props.onClose();\n }\n\n function onTeamSize(event: React.ChangeEvent<HTMLInputElement>): void {\n const x = parseFloat(event.target.value);\n if (x > props.bladeburner.teamSize) setTeamSize(props.bladeburner.teamSize);\n else setTeamSize(x);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the amount of team members you would like to take on this Op. If you do not have the specified number of\n team members, then as many as possible will be used. Note that team members may be lost during operations.\n </Typography>\n <TextField autoFocus type=\"number\" placeholder=\"Team size\" value={teamSize} onChange={onTeamSize} />\n <Button sx={{ mx: 2 }} onClick={confirmTeamSize}>\n Confirm\n </Button>\n </Modal>\n );\n}\n","import React from \"react\";\n\ninterface IOperation {\n desc: JSX.Element;\n}\n\nexport const Operations: {\n [key: string]: IOperation | undefined;\n} = {\n Investigation: {\n desc: (\n <>\n As a field agent, investigate and identify Synthoid populations, movements, and operations.\n <br />\n <br />\n Successful Investigation ops will increase the accuracy of your synthoid data.\n <br />\n <br />\n You will NOT lose HP from failed Investigation ops.\n </>\n ),\n },\n \"Undercover Operation\": {\n desc: (\n <>\n Conduct undercover operations to identify hidden and underground Synthoid communities and organizations.\n <br />\n <br />\n Successful Undercover ops will increase the accuracy of your synthoid data.\n </>\n ),\n },\n \"Sting Operation\": {\n desc: <>Conduct a sting operation to bait and capture particularly notorious Synthoid criminals.</>,\n },\n Raid: {\n desc: (\n <>\n Lead an assault on a known Synthoid community. Note that there must be an existing Synthoid community in your\n current city in order for this Operation to be successful.\n </>\n ),\n },\n \"Stealth Retirement Operation\": {\n desc: (\n <>\n Lead a covert operation to retire Synthoids. The objective is to complete the task without drawing any\n attention. Stealth and discretion are key.\n </>\n ),\n },\n Assassination: {\n desc: (\n <>\n Assassinate Synthoids that have been identified as important, high-profile social and political leaders in the\n Synthoid communities.\n </>\n ),\n },\n};\n","import * as React from \"react\";\nimport { BlackOpList } from \"./BlackOpList\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport Typography from \"@mui/material/Typography\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { BlackOperationNames } from \"../data/BlackOperationNames\";\nimport { Button } from \"@mui/material\";\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function BlackOpPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n Black Operations (Black Ops) are special, one-time covert operations. Each Black Op must be unlocked\n successively by completing the one before it.\n <br />\n <br />\n <b>\n Your ultimate goal to climb through the ranks of {FactionNames.Bladeburners} is to complete all of the Black\n Ops.\n </b>\n <br />\n <br />\n Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank\n losses.\n </Typography>\n {props.bladeburner.blackops[BlackOperationNames.OperationDaedalus] ? (\n <Button sx={{ my: 1, p: 1 }} onClick={() => Router.toBitVerse(false, false)}>\n <CorruptableText content=\"Destroy w0rld_d34mon\"></CorruptableText>\n </Button>\n ) : (\n <BlackOpList bladeburner={props.bladeburner} />\n )}\n </>\n );\n}\n","import React from \"react\";\nimport { BlackOperations } from \"../BlackOperations\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { BlackOpElem } from \"./BlackOpElem\";\nimport { Bladeburner } from \"../Bladeburner\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function BlackOpList(props: IProps): React.ReactElement {\n let blackops: BlackOperation[] = [];\n for (const blackopName of Object.keys(BlackOperations)) {\n if (BlackOperations.hasOwnProperty(blackopName)) {\n blackops.push(BlackOperations[blackopName]);\n }\n }\n blackops.sort(function (a, b) {\n return a.reqdRank - b.reqdRank;\n });\n\n blackops = blackops.filter(\n (blackop: BlackOperation, i: number) =>\n !(\n props.bladeburner.blackops[blackops[i].name] == null &&\n i !== 0 &&\n props.bladeburner.blackops[blackops[i - 1].name] == null\n ),\n );\n\n blackops = blackops.reverse();\n\n return (\n <>\n {blackops.map((blackop: BlackOperation) => (\n <BlackOpElem key={blackop.name} bladeburner={props.bladeburner} action={blackop} />\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { TeamSizeButton } from \"./TeamSizeButton\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { BlackOperations } from \"../data/BlackOperations\";\nimport { Player } from \"@player\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n action: BlackOperation;\n}\n\nexport function BlackOpElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isCompleted = props.bladeburner.blackops[props.action.name] != null;\n if (isCompleted) {\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Typography>{props.action.name} (COMPLETED)</Typography>\n </Paper>\n );\n }\n\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"BlackOperation\"] &&\n props.action.name === props.bladeburner.action.name;\n const actionTime = props.action.getActionTime(props.bladeburner, Player);\n const hasReqdRank = props.bladeburner.rank >= props.action.reqdRank;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n\n const actionData = BlackOperations[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n {isActive ? (\n <>\n <>\n <CopyableText value={props.action.name} />\n <Typography>\n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </Typography>\n <Typography>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </Typography>\n </>\n </>\n ) : (\n <>\n <CopyableText value={props.action.name} />\n\n <StartButton\n bladeburner={props.bladeburner}\n type={ActionTypes.BlackOperation}\n name={props.action.name}\n rerender={rerender}\n />\n <TeamSizeButton action={props.action} bladeburner={props.bladeburner} />\n </>\n )}\n\n <br />\n <br />\n <Typography>{actionData.desc}</Typography>\n <br />\n <br />\n <Typography color={hasReqdRank ? \"primary\" : \"error\"}>\n Required Rank: {formatNumber(props.action.reqdRank, 0)}\n </Typography>\n <br />\n <Typography>\n <SuccessChance action={props.action} bladeburner={props.bladeburner} />\n <br />\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n </Typography>\n </Paper>\n );\n}\n","import React from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { BlackOperationNames } from \"./BlackOperationNames\";\n\ninterface IBlackOp {\n desc: JSX.Element;\n}\n\nexport const BlackOperations: {\n [key: string]: IBlackOp | undefined;\n} = {\n [BlackOperationNames.OperationTyphoon]: {\n desc: (\n <>\n Obadiah Zenyatta is the leader of a RedWater PMC. It has long been known among the intelligence community that\n Zenyatta, along with the rest of the PMC, is a Synthoid.\n <br />\n <br />\n The goal of {BlackOperationNames.OperationTyphoon} is to find and eliminate Zenyatta and RedWater by any means\n necessary. After the task is completed, the actions must be covered up from the general public.\n </>\n ),\n },\n\n [BlackOperationNames.OperationZero]: {\n desc: (\n <>\n AeroCorp is one of the world's largest defense contractors. Its leader, Steve Watataki, is thought to be a\n supporter of Synthoid rights. He must be removed.\n <br />\n <br />\n The goal of {BlackOperationNames.OperationZero} is to covertly infiltrate AeroCorp and uncover any incriminating\n evidence or information against Watataki that will cause him to be removed from his position at AeroCorp.\n Incriminating evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced\n security measures in the world.\n </>\n ),\n },\n [BlackOperationNames.OperationX]: {\n desc: (\n <>\n We have recently discovered an underground publication group called Samizdat. Even though most of their\n publications are nonsensical conspiracy theories, the average human is gullible enough to believe them. Many of\n their works discuss Synthoids and pose a threat to society. The publications are spreading rapidly in China and\n other Eastern countries.\n <br />\n <br />\n Samizdat has done a good job of keeping hidden and anonymous. However, we've just received intelligence that\n their base of operations is in {CityName.Ishima}'s underground sewer systems. Your task is to investigate the\n sewer systems, and eliminate Samizdat. They must never publish anything again.\n </>\n ),\n },\n [BlackOperationNames.OperationTitan]: {\n desc: (\n <>\n Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we\n know, Titan Laboratories' management has no knowledge about this. We don't know what the Synthoids are up to,\n but the research that they could be conducting using Titan Laboratories' vast resources is potentially very\n dangerous.\n <br />\n <br />\n Your goal is to enter and destroy the Bioengineering department's facility in {CityName.Aevum}. The task is not\n just to retire the Synthoids there, but also to destroy any information or research at the facility that is\n relevant to the Synthoids and their goals.\n </>\n ),\n },\n [BlackOperationNames.OperationAres]: {\n desc: (\n <>\n One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai\n between rogue Russian militants and a radical Synthoid community. These weapons are next-gen plasma and energy\n weapons. It is critical for the safety of humanity that this deal does not happen.\n <br />\n <br />\n Your task is to intercept the deal. Leave no survivors.\n </>\n ),\n },\n [BlackOperationNames.OperationArchangel]: {\n desc: (\n <>\n Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI\n Synthoids. Intelligence suggests that the profit from this brothel is used to fund a large black market arms\n trafficking operation.\n <br />\n <br />\n The goal of this operation is to take out the leaders that are running the Red Rabbit brothel. Try to limit the\n number of other casualties, but do what you must to complete the mission.\n </>\n ),\n },\n [BlackOperationNames.OperationJuggernaut]: {\n desc: (\n <>\n The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls\n himself Juggernaut, has been smuggling drugs and weapons (including suspected bioweapons) into{\" \"}\n {CityName.Sector12}. We also have reason to believe they tried to break into one of Universal Energy's\n facilities in order to cause a city-wide blackout. The CIA suspects that Juggernaut is a heavily-augmented\n Synthoid, and have thus enlisted our help.\n <br />\n <br />\n Your mission is to eradicate Juggernaut and his followers.\n </>\n ),\n },\n [BlackOperationNames.OperationRedDragon]: {\n desc: (\n <>\n The {FactionNames.Tetrads} criminal organization is suspected of reverse-engineering the MK-VI Synthoid design.\n We believe they altered and possibly improved the design and began manufacturing their own Synthoid models in\n order to bolster their criminal activities.\n <br />\n <br />\n Your task is to infiltrate and destroy the {FactionNames.Tetrads}' base of operations in Los Angeles.\n Intelligence tells us that their base houses one of their Synthoid manufacturing units.\n </>\n ),\n },\n [BlackOperationNames.OperationK]: {\n desc: (\n <>\n CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology.\n This technology is supposedly capable of cloning Synthoids, not only physically but also their advanced AI\n modules. We do not believe that VitaLife is trying to use this technology illegally or maliciously, but if any\n Synthoids were able to infiltrate the corporation and take advantage of this technology then the results would\n be catastrophic.\n <br />\n <br />\n We do not have the power or jurisdiction to shut this down through legal or political means, so we must resort\n to a covert operation. Your goal is to destroy this technology and eliminate anyone who was involved in its\n creation.\n </>\n ),\n },\n [BlackOperationNames.OperationDeckard]: {\n desc: (\n <>\n Despite your success in eliminating VitaLife's new android-replicating technology in{\" \"}\n {BlackOperationNames.OperationK}, we've discovered that a small group of MK-VI Synthoids were able to make off\n with the schematics and design of the technology before the Operation. It is almost a certainty that these\n Synthoids are some of the rogue MK-VI ones from the Synthoid Uprising.\n <br />\n <br />\n The goal of {BlackOperationNames.OperationDeckard} is to hunt down these Synthoids and retire them. I don't need\n to tell you how critical this mission is.\n </>\n ),\n },\n [BlackOperationNames.OperationTyrell]: {\n desc: (\n <>\n A week ago {FactionNames.BladeIndustries} reported a small break-in at one of their {CityName.Aevum}{\" \"}\n Augmentation storage facilities. We figured out that {FactionNames.TheDarkArmy} was behind the heist, and didn't\n think any more of it. However, we've just discovered that several known MK-VI Synthoids were part of that\n break-in group.\n <br />\n <br />\n We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt\n down associated {FactionNames.TheDarkArmy} members and eliminate them.\n </>\n ),\n },\n [BlackOperationNames.OperationWallace]: {\n desc: (\n <>\n Based on information gathered from {BlackOperationNames.OperationTyrell}, we've discovered that{\" \"}\n {FactionNames.TheDarkArmy} was well aware that there were Synthoids amongst their ranks. Even worse, we believe\n that {FactionNames.TheDarkArmy} is working together with other criminal organizations such as{\" \"}\n {FactionNames.TheSyndicate} and that they are planning some sort of large-scale takeover of multiple major\n cities, most notably {CityName.Aevum}. We suspect that Synthoids have infiltrated the ranks of these criminal\n factions and are trying to stage another Synthoid uprising.\n <br />\n <br />\n The best way to deal with this is to prevent it before it even happens. The goal of{\" \"}\n {BlackOperationNames.OperationWallace} is to destroy {FactionNames.TheDarkArmy} and Syndicate factions in{\" \"}\n {CityName.Aevum} immediately. Leave no survivors.\n </>\n ),\n },\n [BlackOperationNames.OperationShoulderOfOrion]: {\n desc: (\n <>\n China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using\n Synthoids. We believe China is trying to establish the first off-world colonies.\n <br />\n <br />\n The mission is to prevent this launch without instigating an international conflict. When you accept this\n mission you will be officially disavowed by the NSA and the national government until after you successfully\n return. In the event of failure, all of the operation's team members must not let themselves be captured alive.\n </>\n ),\n },\n [BlackOperationNames.OperationHyron]: {\n desc: (\n <>\n Our intelligence tells us that {FactionNames.FulcrumSecretTechnologies} is developing a quantum supercomputer\n using human brains as core processors. This supercomputer is rumored to be able to store vast amounts of data\n and perform computations unmatched by any other supercomputer on the planet. But more importantly, the use of\n organic human brains means that the supercomputer may be able to reason abstractly and become self-aware.\n <br />\n <br />\n I do not need to remind you why sentient-level AIs pose a serious threat to all of mankind.\n <br />\n <br />\n The research for this project is being conducted at one of {FactionNames.FulcrumSecretTechnologies} secret\n facilities in {CityName.Aevum}, codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work,\n and then find and kill the project lead.\n </>\n ),\n },\n [BlackOperationNames.OperationMorpheus]: {\n desc: (\n <>\n DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the\n people's dreams and subconscious. They do this using broadcast transmitter towers. Based on information from our\n agents and informants in {CityName.Chongqing}, we have reason to believe that one of the broadcast towers there\n has been compromised by Synthoids and is being used to spread pro-Synthoid propaganda.\n <br />\n <br />\n The mission is to destroy this broadcast tower. Speed and stealth are of the utmost importance for this.\n </>\n ),\n },\n [BlackOperationNames.OperationIonStorm]: {\n desc: (\n <>\n Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the{\" \"}\n {CityName.Sector12} Slums. We don't know if they are rogue Synthoids from the Uprising, but we do know that they\n have been stockpiling weapons, money, and other resources. This makes them dangerous.\n <br />\n <br />\n This is a full-scale assault operation to find and retire all of these Synthoids in the {CityName.Sector12}{\" \"}\n Slums.\n </>\n ),\n },\n [BlackOperationNames.OperationAnnihilus]: {\n desc: (\n <>\n Our superiors have ordered us to eradicate everything and everyone in an underground facility located in{\" \"}\n {CityName.Aevum}. They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist\n organization called '{FactionNames.TheCovenant}'. We have no prior intelligence about this organization, so you\n are going in blind.\n </>\n ),\n },\n [BlackOperationNames.OperationUltron]: {\n desc: (\n <>\n {FactionNames.OmniTekIncorporated}, the original designer and manufacturer of Synthoids, has notified us of a\n malfunction in their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized\n and seek out the destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue\n ones from the Uprising.\n <br />\n <br />\n {FactionNames.OmniTekIncorporated} has also told us they believe someone has triggered this malfunction in a\n large group of MK-VI Synthoids, and that these newly-radicalized Synthoids are now amassing in{\" \"}\n {CityName.Volhaven} to form a terrorist group called Ultron.\n <br />\n <br />\n Intelligence suggests Ultron is heavily armed and that their members are augmented. We believe Ultron is making\n moves to take control of and weaponize DeltaOne's Tactical High-Energy Satellite Laser Array (THESLA).\n <br />\n <br />\n Your task is to find and destroy Ultron.\n </>\n ),\n },\n [BlackOperationNames.OperationCenturion]: {\n desc: (\n <>\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n <br />\n <br />\n Throughout all of humanity's history, we have relied on technology to survive, conquer, and progress. Its\n advancement became our primary goal. And at the peak of human civilization technology turned into power. Global,\n absolute power.\n <br />\n <br />\n It seems that the universe is not without a sense of irony.\n <br />\n <br />\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n </>\n ),\n },\n [BlackOperationNames.OperationVindictus]: {\n desc: (\n <>\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n <br />\n <br />\n The bits are all around us. The daemons that hold the Node together can manifest themselves in many different\n ways.\n <br />\n <br />\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n </>\n ),\n },\n [BlackOperationNames.OperationDaedalus]: {\n desc: <> Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.</>,\n },\n};\n","import React, { useState } from \"react\";\nimport { SkillList } from \"./SkillList\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { Bladeburner } from \"../Bladeburner\";\nimport Typography from \"@mui/material/Typography\";\ninterface IProps {\n bladeburner: Bladeburner;\n}\n\nexport function SkillPage(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const mults = props.bladeburner.skillMultipliers;\n\n function valid(mult: number | undefined): boolean {\n return mult !== undefined && mult !== 1;\n }\n\n return (\n <>\n <Typography>\n <strong>Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}</strong>\n </Typography>\n <Typography>\n You will gain one skill point every {BladeburnerConstants.RanksPerSkillPoint} ranks.\n <br />\n Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different\n skills with each other is multiplicative.\n </Typography>\n {valid(mults[\"successChanceAll\"]) && (\n <Typography>Total Success Chance: x{formatNumber(mults[\"successChanceAll\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceStealth\"]) && (\n <Typography>Stealth Success Chance: x{formatNumber(mults[\"successChanceStealth\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceKill\"]) && (\n <Typography>Retirement Success Chance: x{formatNumber(mults[\"successChanceKill\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceContract\"]) && (\n <Typography>Contract Success Chance: x{formatNumber(mults[\"successChanceContract\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceOperation\"]) && (\n <Typography>Operation Success Chance: x{formatNumber(mults[\"successChanceOperation\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceEstimate\"]) && (\n <Typography>Synthoid Data Estimate: x{formatNumber(mults[\"successChanceEstimate\"], 3)}</Typography>\n )}\n {valid(mults[\"actionTime\"]) && <Typography>Action Time: x{formatNumber(mults[\"actionTime\"], 3)}</Typography>}\n {valid(mults[\"effHack\"]) && <Typography>Hacking Skill: x{formatNumber(mults[\"effHack\"], 3)}</Typography>}\n {valid(mults[\"effStr\"]) && <Typography>Strength: x{formatNumber(mults[\"effStr\"], 3)}</Typography>}\n {valid(mults[\"effDef\"]) && <Typography>Defense: x{formatNumber(mults[\"effDef\"], 3)}</Typography>}\n {valid(mults[\"effDex\"]) && <Typography>Dexterity: x{formatNumber(mults[\"effDex\"], 3)}</Typography>}\n {valid(mults[\"effAgi\"]) && <Typography>Agility: x{formatNumber(mults[\"effAgi\"], 3)}</Typography>}\n {valid(mults[\"effCha\"]) && <Typography>Charisma: x{formatNumber(mults[\"effCha\"], 3)}</Typography>}\n {valid(mults[\"effInt\"]) && <Typography>Intelligence: x{formatNumber(mults[\"effInt\"], 3)}</Typography>}\n {valid(mults[\"stamina\"]) && <Typography>Stamina: x{formatNumber(mults[\"stamina\"], 3)}</Typography>}\n {valid(mults[\"money\"]) && <Typography>Contract Money: x{formatNumber(mults[\"money\"], 3)}</Typography>}\n {valid(mults[\"expGain\"]) && <Typography>Exp Gain: x{formatNumber(mults[\"expGain\"], 3)}</Typography>}\n <SkillList bladeburner={props.bladeburner} onUpgrade={() => setRerender((old) => !old)} />\n </>\n );\n}\n\n/*\n\n\n\n\nvar multKeys = Object.keys(this.skillMultipliers);\nfor (var i = 0; i < multKeys.length; ++i) {\n var mult = this.skillMultipliers[multKeys[i]];\n if (mult && mult !== 1) {\n mult = formatNumber(mult, 3);\n switch(multKeys[i]) {\n\n }\n }\n}\n*/\n","import * as React from \"react\";\nimport { SkillElem } from \"./SkillElem\";\nimport { Skills } from \"../Skills\";\nimport { Bladeburner } from \"../Bladeburner\";\n\ninterface IProps {\n bladeburner: Bladeburner;\n onUpgrade: () => void;\n}\n\nexport function SkillList(props: IProps): React.ReactElement {\n return (\n <>\n {Object.keys(Skills).map((skill: string) => (\n <SkillElem key={skill} bladeburner={props.bladeburner} skill={Skills[skill]} onUpgrade={props.onUpgrade} />\n ))}\n </>\n );\n}\n","import React from \"react\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { Bladeburner } from \"../Bladeburner\";\n\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport AddIcon from \"@mui/icons-material/Add\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport { Skill } from \"../Skill\";\n\ninterface IProps {\n skill: Skill;\n bladeburner: Bladeburner;\n onUpgrade: () => void;\n}\n\nexport function SkillElem(props: IProps): React.ReactElement {\n const skillName = props.skill.name;\n let currentLevel = 0;\n if (props.bladeburner.skills[skillName] && !isNaN(props.bladeburner.skills[skillName])) {\n currentLevel = props.bladeburner.skills[skillName];\n }\n const pointCost = props.skill.calculateCost(currentLevel);\n\n const canLevel = props.bladeburner.skillPoints >= pointCost;\n const maxLvl = props.skill.maxLvl ? currentLevel >= props.skill.maxLvl : false;\n\n function onClick(): void {\n if (props.bladeburner.skillPoints < pointCost) return;\n props.bladeburner.skillPoints -= pointCost;\n props.bladeburner.upgradeSkill(props.skill);\n props.onUpgrade();\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <CopyableText variant=\"h6\" color=\"primary\" value={props.skill.name} />\n {!canLevel || maxLvl ? (\n <IconButton disabled>\n <CloseIcon />\n </IconButton>\n ) : (\n <IconButton onClick={onClick}>\n <AddIcon />\n </IconButton>\n )}\n </Box>\n <Typography>Level: {currentLevel}</Typography>\n {maxLvl ? (\n <Typography>MAX LEVEL</Typography>\n ) : (\n <Typography>Skill Points required: {formatNumber(pointCost, 0)}</Typography>\n )}\n <Typography>{props.skill.desc}</Typography>\n </Paper>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { ManagementSubpage } from \"./ManagementSubpage\";\nimport { TerritorySubpage } from \"./TerritorySubpage\";\nimport { EquipmentsSubpage } from \"./EquipmentsSubpage\";\nimport { Player } from \"@player\";\nimport { Context } from \"./Context\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\n/** React Component for all the gang stuff. */\nexport function GangRoot(): React.ReactElement {\n const gang = (function () {\n if (Player.gang === null) throw new Error(\"Gang should not be null\");\n return Player.gang;\n })();\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <Context.Gang.Provider value={gang}>\n <Tabs variant=\"fullWidth\" value={value} onChange={handleChange} sx={{ minWidth: \"fit-content\", maxWidth: \"45%\" }}>\n <Tab label=\"Management\" />\n <Tab label=\"Equipment\" />\n <Tab label=\"Territory\" />\n </Tabs>\n {value === 0 && <ManagementSubpage />}\n {value === 1 && <EquipmentsSubpage />}\n {value === 2 && <TerritorySubpage />}\n </Context.Gang.Provider>\n );\n}\n","import React from \"react\";\nimport { GangStats } from \"./GangStats\";\nimport { GangMemberList } from \"./GangMemberList\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\n\n/** React Component for the subpage that manages gang members, the main page. */\nexport function ManagementSubpage(): React.ReactElement {\n const gang = useGang();\n return (\n <>\n <Typography>\n This page is used to manage your gang members and get an overview of your gang's stats.\n <br />\n <br />\n If a gang member is not earning much money or respect, the task that you have assigned to that member might be\n too difficult. Consider training that member's stats or choosing an easier task. The tasks closer to the top of\n the dropdown list are generally easier. Alternatively, the gang member's low production might be due to the fact\n that your wanted level is too high. Consider assigning a few members to the '\n {gang.isHackingGang ? \"Ethical Hacking\" : \"Vigilante Justice\"}' task to lower your wanted level.\n <br />\n <br />\n Installing Augmentations does NOT reset your progress with your Gang. Furthermore, after installing\n Augmentations, you will automatically be a member of whatever Faction you created your gang with.\n <br />\n <br />\n You can also manage your gang programmatically through Netscript using the Gang API\n </Typography>\n <br />\n <GangStats />\n <br />\n <GangMemberList />\n </>\n );\n}\n","/**\n * React Component for the stats related to the gang, like total respect and\n * money per second.\n */\nimport React from \"react\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { AllGangs } from \"../AllGangs\";\nimport { BonusTime } from \"./BonusTime\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\nexport function GangStats(): React.ReactElement {\n const gang = useGang();\n const territoryMult = AllGangs[gang.facName].territory * 100;\n let territoryStr;\n if (territoryMult <= 0) {\n territoryStr = formatNumber(0, 2);\n } else if (territoryMult >= 100) {\n territoryStr = formatNumber(100, 2);\n } else {\n territoryStr = formatNumber(territoryMult, 2);\n }\n\n return (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Represents the amount of respect your gang has from other gangs and criminal organizations. Your respect\n affects the amount of money your gang members will earn, and also determines how much reputation you are\n earning with your gang's corresponding Faction.\n </Typography>\n }\n >\n <Typography>\n Respect: {numeralWrapper.formatRespect(gang.respect)} (\n {numeralWrapper.formatRespect(5 * gang.respectGainRate)} / sec)\n </Typography>\n </Tooltip>\n </Box>\n\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Represents how much the gang is wanted by law enforcement. The higher your gang's wanted level, the harder\n it will be for your gang members to make money and earn respect. Note that the minimum wanted level is 1.\n </Typography>\n }\n >\n <Typography>\n Wanted Level: {numeralWrapper.formatWanted(gang.wanted)} (\n {numeralWrapper.formatWanted(5 * gang.wantedGainRate)} / sec)\n </Typography>\n </Tooltip>\n </Box>\n\n <Box display=\"flex\">\n <Tooltip title={<Typography>Penalty for respect and money gain rates due to Wanted Level</Typography>}>\n <Typography>Wanted Level Penalty: -{formatNumber((1 - gang.getWantedPenalty()) * 100, 2)}%</Typography>\n </Tooltip>\n </Box>\n\n <Typography>\n Money gain rate: <MoneyRate money={5 * gang.moneyGainRate} />\n </Typography>\n\n <Box display=\"flex\">\n <Tooltip title={<Typography>The percentage of total territory your Gang controls</Typography>}>\n <Typography>Territory: {territoryStr}%</Typography>\n </Tooltip>\n </Box>\n <Typography>\n Faction reputation: <Reputation reputation={Factions[gang.facName].playerReputation} />\n </Typography>\n\n <BonusTime gang={gang} />\n </>\n );\n}\n","import * as React from \"react\";\nimport { Gang } from \"../Gang\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n gang: Gang;\n}\n\n/** React Component for displaying the bonus time remaining. */\nexport function BonusTime(props: IProps): React.ReactElement {\n const CyclerPerSecond = 1000 / CONSTANTS._idleSpeed;\n if ((props.gang.storedCycles / CyclerPerSecond) * 1000 <= 5000) return <></>;\n const bonusMillis = (props.gang.storedCycles / CyclerPerSecond) * 1000;\n return (\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by the\n browser). Bonus time makes the Gang mechanic progress faster, up to 5x the normal speed.\n </Typography>\n }\n >\n <Typography>Bonus time: {convertTimeMsToTimeElapsedString(bonusMillis)}</Typography>\n </Tooltip>\n </Box>\n );\n}\n","import React, { useState } from \"react\";\nimport { GangMemberCard } from \"./GangMemberCard\";\nimport { RecruitButton } from \"./RecruitButton\";\nimport { useGang } from \"./Context\";\n\nimport { Box, TextField } from \"@mui/material\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { GangMember } from \"../GangMember\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\n\n/** React Component for the list of gang members on the management subpage. */\nexport function GangMemberList(): React.ReactElement {\n const gang = useGang();\n const setRerender = useState(false)[1];\n const [filter, setFilter] = useState(\"\");\n const [ascendOnly, setAscendOnly] = useState(false);\n\n const handleFilterChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setFilter(event.target.value.toLowerCase());\n };\n\n const members = gang.members\n .filter((member) => member && member.name.toLowerCase().includes(filter))\n .filter((member) => {\n if (ascendOnly) return member.canAscend();\n return true;\n });\n\n return (\n <>\n <RecruitButton onRecruit={() => setRerender((old) => !old)} />\n <TextField\n value={filter}\n onChange={handleFilterChange}\n autoFocus\n InputProps={{\n startAdornment: <SearchIcon />,\n spellCheck: false,\n }}\n placeholder=\"Filter by member name\"\n sx={{ m: 1, width: \"15%\" }}\n />\n <OptionSwitch\n checked={ascendOnly}\n onChange={(newValue) => setAscendOnly(newValue)}\n text=\"Show only ascendable\"\n tooltip={<>Filter the members list by whether or not the member can be ascended.</>}\n />\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"repeat(2, 1fr)\" }}>\n {members.map((member: GangMember) => (\n <GangMemberCard key={member.name} member={member} />\n ))}\n </Box>\n </>\n );\n}\n","import React from \"react\";\nimport { GangMember } from \"../GangMember\";\nimport { GangMemberCardContent } from \"./GangMemberCardContent\";\n\nimport Box from \"@mui/material/Box\";\n\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n member: GangMember;\n}\n\n/** React Component for a gang member on the management subpage. */\nexport function GangMemberCard(props: IProps): React.ReactElement {\n return (\n <Box component={Paper} sx={{ width: \"auto\" }}>\n <Box sx={{ m: 1 }}>\n <ListItemText primary={<b>{props.member.name}</b>} />\n <GangMemberCardContent member={props.member} />\n </Box>\n </Box>\n );\n}\n","/**\n * React Component for the content of the accordion of gang members on the\n * management subpage.\n */\nimport React, { useState } from \"react\";\nimport { GangMemberStats } from \"./GangMemberStats\";\nimport { TaskSelector } from \"./TaskSelector\";\nimport { AscensionModal } from \"./AscensionModal\";\n\nimport { Box } from \"@mui/system\";\nimport { Button, Typography } from \"@mui/material\";\nimport HelpIcon from \"@mui/icons-material/Help\";\n\nimport { GangMember } from \"../GangMember\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberCardContent(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const [helpOpen, setHelpOpen] = useState(false);\n const [ascendOpen, setAscendOpen] = useState(false);\n\n return (\n <>\n {props.member.canAscend() && (\n <Box sx={{ display: \"flex\", justifyContent: \"space-between\", my: 1 }}>\n <Button onClick={() => setAscendOpen(true)} style={{ flexGrow: 1, borderRightWidth: 0 }}>\n Ascend\n </Button>\n <AscensionModal\n open={ascendOpen}\n onClose={() => setAscendOpen(false)}\n member={props.member}\n onAscend={() => setRerender((old) => !old)}\n />\n <Button onClick={() => setHelpOpen(true)} style={{ width: \"fit-content\", borderLeftWidth: 0 }}>\n <HelpIcon />\n </Button>\n <StaticModal open={helpOpen} onClose={() => setHelpOpen(false)}>\n <Typography>\n Ascending a Gang Member resets the member's progress and stats in exchange for a permanent boost to their\n stat multipliers.\n <br />\n <br />\n The additional stat multiplier that the Gang Member gains upon ascension is based on the amount of exp\n they have.\n <br />\n <br />\n Upon ascension, the member will lose all of its non-Augmentation Equipment and your gang will lose respect\n equal to the total respect earned by the member.\n </Typography>\n </StaticModal>\n </Box>\n )}\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"1fr 1fr\", width: \"100%\", gap: 1 }}>\n <GangMemberStats member={props.member} />\n <TaskSelector onTaskChange={() => setRerender((old) => !old)} member={props.member} />\n </Box>\n </>\n );\n}\n","/**\n * React Component for the first part of a gang member details.\n * Contains skills and exp.\n */\nimport React from \"react\";\nimport { useGang } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { Table, TableBody, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMember } from \"../GangMember\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\nimport { characterOverviewStyles as useStyles } from \"../../ui/React/CharacterOverview\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberStats(props: IProps): React.ReactElement {\n const classes = useStyles();\n\n const asc = {\n hack: props.member.calculateAscensionMult(props.member.hack_asc_points),\n str: props.member.calculateAscensionMult(props.member.str_asc_points),\n def: props.member.calculateAscensionMult(props.member.def_asc_points),\n dex: props.member.calculateAscensionMult(props.member.dex_asc_points),\n agi: props.member.calculateAscensionMult(props.member.agi_asc_points),\n cha: props.member.calculateAscensionMult(props.member.cha_asc_points),\n };\n\n const gang = useGang();\n const data = [\n [`Money:`, <MoneyRate money={5 * props.member.calculateMoneyGain(gang)} />],\n [`Respect:`, `${numeralWrapper.formatRespect(5 * props.member.calculateRespectGain(gang))} / sec`],\n [`Wanted Level:`, `${numeralWrapper.formatWanted(5 * props.member.calculateWantedLevelGain(gang))} / sec`],\n [`Total Respect:`, `${numeralWrapper.formatRespect(props.member.earnedRespect)}`],\n ];\n\n return (\n <>\n <Tooltip\n title={\n <Typography>\n Hk: x{numeralWrapper.formatMultiplier(props.member.hack_mult * asc.hack)}(x\n {numeralWrapper.formatMultiplier(props.member.hack_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.hack)}{\" \"}\n Asc)\n <br />\n St: x{numeralWrapper.formatMultiplier(props.member.str_mult * asc.str)}\n (x{numeralWrapper.formatMultiplier(props.member.str_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.str)}{\" \"}\n Asc)\n <br />\n Df: x{numeralWrapper.formatMultiplier(props.member.def_mult * asc.def)}\n (x{numeralWrapper.formatMultiplier(props.member.def_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.def)}{\" \"}\n Asc)\n <br />\n Dx: x{numeralWrapper.formatMultiplier(props.member.dex_mult * asc.dex)}\n (x{numeralWrapper.formatMultiplier(props.member.dex_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.dex)}{\" \"}\n Asc)\n <br />\n Ag: x{numeralWrapper.formatMultiplier(props.member.agi_mult * asc.agi)}\n (x{numeralWrapper.formatMultiplier(props.member.agi_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.agi)}{\" \"}\n Asc)\n <br />\n Ch: x{numeralWrapper.formatMultiplier(props.member.cha_mult * asc.cha)}\n (x{numeralWrapper.formatMultiplier(props.member.cha_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.cha)}{\" \"}\n Asc)\n </Typography>\n }\n >\n <Table sx={{ display: \"table\", mb: 1, width: \"100%\" }}>\n <TableBody>\n <StatsRow\n name=\"Hacking\"\n color={Settings.theme.hack}\n data={{ level: props.member.hack, exp: props.member.hack_exp }}\n />\n <StatsRow\n name=\"Strength\"\n color={Settings.theme.combat}\n data={{ level: props.member.str, exp: props.member.str_exp }}\n />\n <StatsRow\n name=\"Defense\"\n color={Settings.theme.combat}\n data={{ level: props.member.def, exp: props.member.def_exp }}\n />\n <StatsRow\n name=\"Dexterity\"\n color={Settings.theme.combat}\n data={{ level: props.member.dex, exp: props.member.dex_exp }}\n />\n <StatsRow\n name=\"Agility\"\n color={Settings.theme.combat}\n data={{ level: props.member.agi, exp: props.member.agi_exp }}\n />\n <StatsRow\n name=\"Charisma\"\n color={Settings.theme.cha}\n data={{ level: props.member.cha, exp: props.member.cha_exp }}\n />\n <TableRow>\n <TableCell classes={{ root: classes.cellNone }}>\n <br />\n </TableCell>\n </TableRow>\n {data.map(([a, b]) => (\n <TableRow key={a.toString() + b.toString()}>\n <TableCell classes={{ root: classes.cellNone }}>\n <Typography>{a}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography>{b}</Typography>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </Tooltip>\n </>\n );\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n killScripts: () => void;\n}\n\nexport function KillScriptsModal(props: IProps): React.ReactElement {\n function onClick(): void {\n props.killScripts();\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Forcefully kill all running scripts? This will also save your game and reload the game.</Typography>\n <Button onClick={onClick}>KILL</Button>\n </Modal>\n );\n}\n","/**\n * React Component for the middle part of the gang member accordion. Contains\n * the task selector as well as some stats.\n */\nimport React, { useState } from \"react\";\nimport { useGang } from \"./Context\";\nimport { TaskDescription } from \"./TaskDescription\";\n\nimport { Box } from \"@mui/material\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\nimport { GangMember } from \"../GangMember\";\n\ninterface IProps {\n member: GangMember;\n onTaskChange: () => void;\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const gang = useGang();\n const [currentTask, setCurrentTask] = useState(props.member.task);\n\n const contextMember = gang.members.find((member) => member.name == props.member.name);\n if (contextMember && contextMember.task != currentTask) {\n setCurrentTask(contextMember.task);\n }\n\n function onChange(event: SelectChangeEvent<string>): void {\n const task = event.target.value;\n props.member.assignToTask(task);\n setCurrentTask(task);\n props.onTaskChange();\n }\n\n const tasks = gang.getAllTaskNames();\n\n return (\n <Box>\n <Select onChange={onChange} value={currentTask} sx={{ width: \"100%\" }}>\n <MenuItem key={0} value={\"Unassigned\"}>\n Unassigned\n </MenuItem>\n {tasks.map((task: string, i: number) => (\n <MenuItem key={i + 1} value={task}>\n {task}\n </MenuItem>\n ))}\n </Select>\n <TaskDescription member={props.member} />\n </Box>\n );\n}\n","/**\n * React Component for left side of the gang member accordion, contains the\n * description of the task that member is currently doing.\n */\nimport React from \"react\";\nimport { GangMemberTasks } from \"../GangMemberTasks\";\nimport { GangMember } from \"../GangMember\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function TaskDescription(props: IProps): React.ReactElement {\n const task = GangMemberTasks[props.member.task];\n const desc = task ? task.desc : GangMemberTasks[\"Unassigned\"].desc;\n\n return <Typography dangerouslySetInnerHTML={{ __html: desc }} />;\n}\n","/**\n * React Component for the content of the popup before the player confirms the\n * ascension of a gang member.\n */\nimport React, { useState, useEffect } from \"react\";\nimport { GangMember } from \"../GangMember\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n member: GangMember;\n onAscend: () => void;\n}\n\nexport function AscensionModal(props: IProps): React.ReactElement {\n const gang = useGang();\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 1000);\n return () => clearInterval(id);\n }, []);\n\n function confirm(): void {\n props.onAscend();\n const res = gang.ascendMember(props.member);\n dialogBoxCreate(\n <>\n You ascended {props.member.name}!<br />\n <br />\n Your gang lost {numeralWrapper.formatRespect(res.respect)} respect.\n <br />\n <br />\n {props.member.name} gained the following stat multipliers for ascending:\n <br />\n Hacking: x{numeralWrapper.format(res.hack, \"0.000\")}\n <br />\n Strength: x{numeralWrapper.format(res.str, \"0.000\")}\n <br />\n Defense: x{numeralWrapper.format(res.def, \"0.000\")}\n <br />\n Dexterity: x{numeralWrapper.format(res.dex, \"0.000\")}\n <br />\n Agility: x{numeralWrapper.format(res.agi, \"0.000\")}\n <br />\n Charisma: x{numeralWrapper.format(res.cha, \"0.000\")}\n <br />\n </>,\n );\n props.onClose();\n }\n\n // const ascendBenefits = props.member.getAscensionResults();\n const preAscend = props.member.getCurrentAscensionMults();\n const postAscend = props.member.getAscensionMultsAfterAscend();\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Are you sure you want to ascend this member? They will lose all of\n <br />\n their non-Augmentation upgrades and their stats will reset back to 1.\n <br />\n <br />\n Furthermore, your gang will lose {numeralWrapper.formatRespect(props.member.earnedRespect)} respect\n <br />\n <br />\n In return, they will gain the following permanent boost to stat multipliers:\n <br />\n Hacking: x{numeralWrapper.format(preAscend.hack, \"0.000\")} => x\n {numeralWrapper.format(postAscend.hack, \"0.000\")}\n <br />\n Strength: x{numeralWrapper.format(preAscend.str, \"0.000\")} => x\n {numeralWrapper.format(postAscend.str, \"0.000\")}\n <br />\n Defense: x{numeralWrapper.format(preAscend.def, \"0.000\")} => x\n {numeralWrapper.format(postAscend.def, \"0.000\")}\n <br />\n Dexterity: x{numeralWrapper.format(preAscend.dex, \"0.000\")} => x\n {numeralWrapper.format(postAscend.dex, \"0.000\")}\n <br />\n Agility: x{numeralWrapper.format(preAscend.agi, \"0.000\")} => x\n {numeralWrapper.format(postAscend.agi, \"0.000\")}\n <br />\n Charisma: x{numeralWrapper.format(preAscend.cha, \"0.000\")} => x\n {numeralWrapper.format(postAscend.cha, \"0.000\")}\n <br />\n </Typography>\n <Button onClick={confirm}>Ascend</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { RecruitModal } from \"./RecruitModal\";\nimport { GangConstants } from \"../data/Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n onRecruit: () => void;\n}\n\n/** React Component for the recruitment button and text on the gang main page. */\nexport function RecruitButton(props: IProps): React.ReactElement {\n const gang = useGang();\n const [open, setOpen] = useState(false);\n if (gang.members.length >= GangConstants.MaximumGangMembers) {\n return <></>;\n }\n\n if (!gang.canRecruitMember()) {\n const respect = gang.getRespectNeededToRecruitMember();\n return (\n <Box display=\"flex\" alignItems=\"center\" sx={{ mx: 1 }}>\n <Button disabled>Recruit Gang Member</Button>\n <Typography sx={{ ml: 1 }}>\n {numeralWrapper.formatRespect(respect)} respect needed to recruit next member\n </Typography>\n </Box>\n );\n }\n\n return (\n <>\n <Box sx={{ mx: 1 }}>\n <Button onClick={() => setOpen(true)}>Recruit Gang Member</Button>\n </Box>\n <RecruitModal open={open} onClose={() => setOpen(false)} onRecruit={props.onRecruit} />\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\ninterface IRecruitPopupProps {\n open: boolean;\n onClose: () => void;\n onRecruit: () => void;\n}\n\n/** React Component for the popup used to recruit new gang members. */\nexport function RecruitModal(props: IRecruitPopupProps): React.ReactElement {\n const gang = useGang();\n const [name, setName] = useState(\"\");\n\n const disabled = name === \"\" || !gang.canRecruitMember();\n function recruit(): void {\n if (disabled) return;\n // At this point, the only way this can fail is if you already\n // have a gang member with the same name\n if (!gang.recruitMember(name)) {\n dialogBoxCreate(\"You already have a gang member with this name!\");\n return;\n }\n\n props.onRecruit();\n props.onClose();\n }\n\n function onKeyUp(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) recruit();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setName(event.target.value);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Enter a name for your new Gang member:</Typography>\n <br />\n <TextField\n autoFocus\n onKeyUp={onKeyUp}\n onChange={onChange}\n type=\"text\"\n placeholder=\"unique name\"\n InputProps={{\n endAdornment: (\n <Button disabled={disabled} onClick={recruit}>\n Recruit\n </Button>\n ),\n }}\n />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Container, Button, Paper, Box, Tooltip, Switch, FormControlLabel, Typography } from \"@mui/material\";\nimport { Help } from \"@mui/icons-material\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\n\nimport { AllGangs } from \"../AllGangs\";\n\nimport { useGang } from \"./Context\";\nimport { TerritoryInfoModal } from \"./TerritoryInfoModal\";\n\n/** React Component for the territory subpage. */\nexport function TerritorySubpage(): React.ReactElement {\n const gang = useGang();\n const gangNames = Object.keys(AllGangs).filter((g) => g != gang.facName);\n const [infoOpen, setInfoOpen] = useState(false);\n\n return (\n <Container disableGutters maxWidth=\"md\" sx={{ mx: 0 }}>\n <Typography>\n This page shows how much territory your Gang controls. This statistic is listed as a percentage, which\n represents how much of the total territory you control.\n </Typography>\n\n <Button onClick={() => setInfoOpen(true)} sx={{ my: 1 }}>\n <Help sx={{ mr: 1 }} />\n About Gang Territory\n </Button>\n\n <Box component={Paper} sx={{ p: 1, mb: 1 }}>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n {gang.facName} (Your gang)\n </Typography>\n\n <FormControlLabel\n control={\n <Switch\n checked={gang.territoryWarfareEngaged}\n onChange={(event) => (gang.territoryWarfareEngaged = event.target.checked)}\n />\n }\n label={\n <Tooltip\n title={\n <Typography>\n Engaging in Territory Warfare sets your clash chance to 100%. Disengaging will cause your clash chance\n to gradually decrease until it reaches 0%.\n </Typography>\n }\n >\n <Typography>Engage in Territory Warfare</Typography>\n </Tooltip>\n }\n />\n <br />\n <FormControlLabel\n control={\n <Switch\n checked={gang.notifyMemberDeath}\n onChange={(event) => (gang.notifyMemberDeath = event.target.checked)}\n />\n }\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then you will receive a pop-up notifying you whenever one of your Gang Members\n dies in a territory clash.\n </Typography>\n }\n >\n <Typography>Notify about Gang Member Deaths</Typography>\n </Tooltip>\n }\n />\n\n <Typography>\n <b>Territory Clash Chance:</b> {numeralWrapper.formatPercentage(gang.territoryClashChance, 3)} <br />\n <b>Power:</b> {formatNumber(AllGangs[gang.facName].power, 3)} <br />\n <b>Territory:</b> {formatTerritory(AllGangs[gang.facName].territory)}% <br />\n </Typography>\n </Box>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"repeat(3, 1fr)\" }}>\n {gangNames\n .sort((a, b) => {\n if (AllGangs[a].territory <= 0 && AllGangs[b].territory > 0) return 1;\n if (AllGangs[a].territory > 0 && AllGangs[b].territory <= 0) return -1;\n return 0;\n })\n .map((name) => (\n <OtherGangTerritory key={name} name={name} />\n ))}\n </Box>\n <TerritoryInfoModal open={infoOpen} onClose={() => setInfoOpen(false)} />\n </Container>\n );\n}\nfunction formatTerritory(n: number): string {\n const v = n * 100;\n const precision = 3;\n if (v <= 0) {\n return formatNumber(0, precision);\n } else if (v >= 100) {\n return formatNumber(100, precision);\n } else {\n return formatNumber(v, precision);\n }\n}\n\ninterface ITerritoryProps {\n name: string;\n}\n\nfunction OtherGangTerritory(props: ITerritoryProps): React.ReactElement {\n const gang = useGang();\n const playerPower = AllGangs[gang.facName].power;\n const power = AllGangs[props.name].power;\n const clashVictoryChance = playerPower / (power + playerPower);\n const territory = AllGangs[props.name].territory;\n const opacity = territory ? 1 : 0.75;\n return (\n <Box component={Paper} sx={{ p: 1, opacity }}>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n {props.name}\n </Typography>\n <Typography>\n <b>Power:</b> {formatNumber(power, 3)} <br />\n <b>Territory:</b> {formatTerritory(territory)}% <br />\n <b>Clash Win Chance:</b> {numeralWrapper.formatPercentage(clashVictoryChance, 3)}\n </Typography>\n </Box>\n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\n\nimport { Modal } from \"../../ui/React/Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport const TerritoryInfoModal = ({ open, onClose }: IProps): React.ReactElement => {\n return (\n <Modal open={open} onClose={onClose}>\n <>\n <Typography variant=\"h4\">Clashing</Typography>\n <Typography>\n Every ~20 seconds, your gang has a chance to 'clash' with other gangs. Your chance to win a clash depends on\n your gang's power, which is listed in the display below. Your gang's power slowly accumulates over time. The\n accumulation rate is determined by the stats of all Gang members you have assigned to the 'Territory Warfare'\n task. Gang members that are not assigned to this task do not contribute to your gang's power. Your gang also\n loses a small amount of power whenever you lose a clash.\n <br />\n <br />\n NOTE: Gang members assigned to 'Territory Warfare' can be killed during clashes. This can happen regardless of\n whether you win or lose the clash. A gang member being killed results in both respect and power loss for your\n gang.\n </Typography>\n <br />\n <Typography variant=\"h4\">Territory</Typography>\n <Typography>\n The amount of territory you have affects all aspects of your Gang members' production, including money,\n respect, and wanted level. It is very beneficial to have high territory control.\n <br />\n <br />\n To increase your chances of winning territory, assign gang members to \"Territory Warfare\". This will build\n your gang power. Then, enable \"Engage in Territory Warfare\" to start fighting over territory.\n </Typography>\n <br />\n <Typography variant=\"h4\">Territory Clash Chance</Typography>\n <Typography>\n This percentage represents the chance you have of 'clashing' with another gang. If you do not wish to\n gain/lose territory, then keep this percentage at 0% by not engaging in territory warfare.\n </Typography>\n </>\n </Modal>\n );\n};\n","import React, { useState } from \"react\";\nimport { useGang } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { MenuItem, Table, TableBody, TextField } from \"@mui/material\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMemberUpgrades } from \"../GangMemberUpgrades\";\nimport { GangMemberUpgrade } from \"../GangMemberUpgrade\";\nimport { Money } from \"../../ui/React/Money\";\nimport { GangMember } from \"../GangMember\";\nimport { UpgradeType } from \"../data/upgrades\";\nimport { Player } from \"@player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\n\ninterface INextRevealProps {\n upgrades: string[];\n type: UpgradeType;\n}\n\nfunction NextReveal(props: INextRevealProps): React.ReactElement {\n const gang = useGang();\n const upgrades = Object.keys(GangMemberUpgrades)\n .filter((upgName: string) => {\n const upg = GangMemberUpgrades[upgName];\n if (Player.money > gang.getUpgradeCost(upg)) return false;\n if (upg.type !== props.type) return false;\n if (props.upgrades.includes(upgName)) return false;\n return true;\n })\n .map((upgName: string) => GangMemberUpgrades[upgName]);\n\n if (upgrades.length === 0) return <></>;\n return (\n <Typography>\n Next at <Money money={upgrades[0].cost} />\n </Typography>\n );\n}\n\nfunction PurchasedUpgrade({ upgName }: { upgName: string }): React.ReactElement {\n const upg = GangMemberUpgrades[upgName];\n return (\n <Paper sx={{ p: 1 }}>\n <Tooltip title={<Typography dangerouslySetInnerHTML={{ __html: upg.desc }} />}>\n <Typography>{upg.name}</Typography>\n </Tooltip>\n </Paper>\n );\n}\n\ninterface IUpgradeButtonProps {\n upg: GangMemberUpgrade;\n rerender: () => void;\n member: GangMember;\n}\n\nfunction UpgradeButton(props: IUpgradeButtonProps): React.ReactElement {\n const gang = useGang();\n function onClick(): void {\n props.member.buyUpgrade(props.upg);\n props.rerender();\n }\n return (\n <Tooltip title={<Typography dangerouslySetInnerHTML={{ __html: props.upg.desc }} />}>\n <span>\n <Button onClick={onClick} sx={{ display: \"flex\", flexDirection: \"column\", width: \"100%\", height: \"100%\" }}>\n <Typography sx={{ display: \"block\" }}>{props.upg.name}</Typography>\n <Money money={gang.getUpgradeCost(props.upg)} />\n </Button>\n </span>\n </Tooltip>\n );\n}\n\ninterface IPanelProps {\n member: GangMember;\n}\n\nfunction GangMemberUpgradePanel(props: IPanelProps): React.ReactElement {\n const gang = useGang();\n const setRerender = useState(false)[1];\n const [currentCategory, setCurrentCategory] = useState(\"Weapons\");\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function filterUpgrades(list: string[], type: UpgradeType): GangMemberUpgrade[] {\n return Object.keys(GangMemberUpgrades)\n .filter((upgName: string) => {\n const upg = GangMemberUpgrades[upgName];\n if (Player.money < gang.getUpgradeCost(upg)) return false;\n if (upg.type !== type) return false;\n if (list.includes(upgName)) return false;\n return true;\n })\n .map((upgName: string) => GangMemberUpgrades[upgName]);\n }\n\n const onChange = (event: SelectChangeEvent<string>): void => {\n setCurrentCategory(event.target.value);\n rerender();\n };\n\n const weaponUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Weapon);\n const armorUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Armor);\n const vehicleUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Vehicle);\n const rootkitUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Rootkit);\n const augUpgrades = filterUpgrades(props.member.augmentations, UpgradeType.Augmentation);\n\n const categories: { [key: string]: (GangMemberUpgrade[] | UpgradeType)[] } = {\n Weapons: [weaponUpgrades, UpgradeType.Weapon],\n Armor: [armorUpgrades, UpgradeType.Armor],\n Vehicles: [vehicleUpgrades, UpgradeType.Vehicle],\n Rootkits: [rootkitUpgrades, UpgradeType.Rootkit],\n Augmentations: [augUpgrades, UpgradeType.Augmentation],\n };\n\n const asc = {\n hack: props.member.calculateAscensionMult(props.member.hack_asc_points),\n str: props.member.calculateAscensionMult(props.member.str_asc_points),\n def: props.member.calculateAscensionMult(props.member.def_asc_points),\n dex: props.member.calculateAscensionMult(props.member.dex_asc_points),\n agi: props.member.calculateAscensionMult(props.member.agi_asc_points),\n cha: props.member.calculateAscensionMult(props.member.cha_asc_points),\n };\n return (\n <Paper>\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"1fr 1fr\", m: 1, gap: 1 }}>\n <span>\n <Typography variant=\"h5\" color=\"primary\">\n {props.member.name} ({props.member.task})\n </Typography>\n <Tooltip\n title={\n <Typography>\n Hk: x{numeralWrapper.formatMultiplier(props.member.hack_mult * asc.hack)}(x\n {numeralWrapper.formatMultiplier(props.member.hack_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.hack)} Asc)\n <br />\n St: x{numeralWrapper.formatMultiplier(props.member.str_mult * asc.str)}\n (x{numeralWrapper.formatMultiplier(props.member.str_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.str)} Asc)\n <br />\n Df: x{numeralWrapper.formatMultiplier(props.member.def_mult * asc.def)}\n (x{numeralWrapper.formatMultiplier(props.member.def_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.def)} Asc)\n <br />\n Dx: x{numeralWrapper.formatMultiplier(props.member.dex_mult * asc.dex)}\n (x{numeralWrapper.formatMultiplier(props.member.dex_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.dex)} Asc)\n <br />\n Ag: x{numeralWrapper.formatMultiplier(props.member.agi_mult * asc.agi)}\n (x{numeralWrapper.formatMultiplier(props.member.agi_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.agi)} Asc)\n <br />\n Ch: x{numeralWrapper.formatMultiplier(props.member.cha_mult * asc.cha)}\n (x{numeralWrapper.formatMultiplier(props.member.cha_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.cha)} Asc)\n </Typography>\n }\n >\n <Table>\n <TableBody>\n <StatsRow\n name=\"Hacking\"\n color={Settings.theme.hack}\n data={{ level: props.member.hack, exp: props.member.hack_exp }}\n />\n <StatsRow\n name=\"Strength\"\n color={Settings.theme.combat}\n data={{ level: props.member.str, exp: props.member.str_exp }}\n />\n <StatsRow\n name=\"Defense\"\n color={Settings.theme.combat}\n data={{ level: props.member.def, exp: props.member.def_exp }}\n />\n <StatsRow\n name=\"Dexterity\"\n color={Settings.theme.combat}\n data={{ level: props.member.dex, exp: props.member.dex_exp }}\n />\n <StatsRow\n name=\"Agility\"\n color={Settings.theme.combat}\n data={{ level: props.member.agi, exp: props.member.agi_exp }}\n />\n <StatsRow\n name=\"Charisma\"\n color={Settings.theme.cha}\n data={{ level: props.member.cha, exp: props.member.cha_exp }}\n />\n </TableBody>\n </Table>\n </Tooltip>\n </span>\n\n <span>\n <Select onChange={onChange} value={currentCategory} sx={{ width: \"100%\", mb: 1 }}>\n {Object.keys(categories).map((k, i) => (\n <MenuItem key={i + 1} value={k}>\n <Typography variant=\"h6\">{k}</Typography>\n </MenuItem>\n ))}\n </Select>\n\n <Box sx={{ width: \"100%\" }}>\n {(categories[currentCategory][0] as GangMemberUpgrade[]).length === 0 && (\n <Typography>All upgrades owned!</Typography>\n )}\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"1fr 1fr\" }}>\n {(categories[currentCategory][0] as GangMemberUpgrade[]).map((upg) => (\n <UpgradeButton key={upg.name} rerender={rerender} member={props.member} upg={upg} />\n ))}\n </Box>\n <NextReveal type={categories[currentCategory][1] as UpgradeType} upgrades={props.member.upgrades} />\n </Box>\n </span>\n </Box>\n\n <Typography sx={{ mx: 1 }}>Purchased Upgrades: </Typography>\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"repeat(4, 1fr)\", m: 1 }}>\n {props.member.upgrades.map((upg: string) => (\n <PurchasedUpgrade key={upg} upgName={upg} />\n ))}\n {props.member.augmentations.map((upg: string) => (\n <PurchasedUpgrade key={upg} upgName={upg} />\n ))}\n </Box>\n </Paper>\n );\n}\n\n/** React Component for the popup that manages gang members upgrades */\nexport function EquipmentsSubpage(): React.ReactElement {\n const gang = useGang();\n const [filter, setFilter] = useState(\"\");\n\n const handleFilterChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setFilter(event.target.value.toLowerCase());\n };\n\n const members = gang.members.filter((member) => member && member.name.toLowerCase().includes(filter));\n\n return (\n <>\n <Tooltip\n title={\n <Typography>\n You get a discount on equipment and upgrades based on your gang's respect and power. More respect and power\n leads to more discounts.\n </Typography>\n }\n >\n <Typography sx={{ m: 1 }}>Discount: -{numeralWrapper.formatPercentage(1 - 1 / gang.getDiscount())}</Typography>\n </Tooltip>\n\n <TextField\n value={filter}\n onChange={handleFilterChange}\n autoFocus\n InputProps={{\n startAdornment: <SearchIcon />,\n spellCheck: false,\n }}\n placeholder=\"Filter by member name\"\n sx={{ m: 1, width: \"15%\" }}\n />\n\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"1fr 1fr\", width: \"100%\" }}>\n {members.map((member: GangMember) => (\n <GangMemberUpgradePanel key={member.name} member={member} />\n ))}\n </Box>\n </>\n );\n}\n","// React Components for the Corporation UI's navigation tabs\n// These are the tabs at the top of the UI that let you switch to different\n// divisions, see an overview of your corporation, or create a new industry\nimport React, { useState, useEffect } from \"react\";\nimport { Industry } from \"../Industry\";\nimport { MainPanel } from \"./MainPanel\";\nimport { Industries } from \"../IndustryData\";\nimport { ExpandIndustryTab } from \"./ExpandIndustryTab\";\nimport { Player } from \"@player\";\nimport { Context } from \"./Context\";\nimport { Overview } from \"./Overview\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nexport function CorporationRoot(): React.ReactElement {\n const corporation = Player.corporation;\n if (corporation === null) return <></>;\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const [divisionName, setDivisionName] = useState<string | number>(\"Overview\");\n function handleChange(event: React.SyntheticEvent, tab: string | number): void {\n setDivisionName(tab);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const canExpand =\n Object.keys(Industries).filter(\n (industryType: string) =>\n corporation.divisions.find((division: Industry) => division.type === industryType) === undefined,\n ).length > 0;\n\n return (\n <Context.Corporation.Provider value={corporation}>\n <Tabs variant=\"scrollable\" value={divisionName} onChange={handleChange} sx={{ maxWidth: \"65vw\" }} scrollButtons>\n <Tab label={corporation.name} value={\"Overview\"} />\n {corporation.divisions.map((div) => (\n <Tab key={div.name} label={div.name} value={div.name} />\n ))}\n {canExpand && <Tab label={\"Expand\"} value={-1} />}\n </Tabs>\n {divisionName === \"Overview\" && <Overview rerender={rerender} />}\n {divisionName === -1 && <ExpandIndustryTab setDivisionName={setDivisionName} />}\n {typeof divisionName === \"string\" && divisionName !== \"Overview\" && (\n <MainPanel rerender={rerender} divisionName={divisionName + \"\"} />\n )}\n </Context.Corporation.Provider>\n );\n}\n","// React Component for the element that contains the actual info/data\n// for the Corporation UI. This panel lies below the header tabs and will\n// be filled with whatever is needed based on the routing/navigation\nimport React from \"react\";\n\nimport { CityTabs } from \"./CityTabs\";\nimport { Industry } from \"../Industry\";\nimport { Context, useCorporation } from \"./Context\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\n\ninterface IProps {\n divisionName: string;\n rerender: () => void;\n}\n\nexport function MainPanel(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division =\n props.divisionName !== \"Overview\"\n ? corp.divisions.find((division: Industry) => division.name === props.divisionName)\n : undefined; // use undefined because find returns undefined\n\n if (division === undefined) throw new Error(\"Cannot find division\");\n return (\n <Context.Division.Provider value={division}>\n <CityTabs rerender={props.rerender} city={CityName.Sector12} />\n </Context.Division.Provider>\n );\n}\n","// React Components for the Corporation UI's City navigation tabs\n// These allow player to navigate between different cities for each industry\nimport React, { useState } from \"react\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Industry } from \"./Industry\";\nimport { ExpandNewCity } from \"./ExpandNewCity\";\nimport { useDivision } from \"./Context\";\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\ninterface IProps {\n city: string;\n rerender: () => void;\n}\n\nexport function CityTabs(props: IProps): React.ReactElement {\n const division = useDivision();\n const [city, setCity] = useState(props.city);\n\n const office = division.offices[city];\n if (office === 0) {\n setCity(\"Sector-12\");\n return <></>;\n }\n\n const canExpand =\n Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] === 0).length > 0;\n function handleChange(event: React.SyntheticEvent, tab: string): void {\n setCity(tab);\n }\n return (\n <>\n <Tabs variant=\"fullWidth\" value={city} onChange={handleChange} sx={{ maxWidth: \"65vw\" }}>\n {Object.values(division.offices).map(\n (office: OfficeSpace | 0) => office !== 0 && <Tab key={office.loc} label={office.loc} value={office.loc} />,\n )}\n {canExpand && <Tab label={\"Expand\"} value={\"Expand\"} />}\n </Tabs>\n\n {city !== \"Expand\" ? (\n <Industry\n key={city}\n rerender={props.rerender}\n city={city}\n warehouse={division.warehouses[city]}\n office={office}\n />\n ) : (\n <ExpandNewCity cityStateSetter={setCity} />\n )}\n </>\n );\n}\n","// React Component for managing the Corporation's Industry UI\n// This Industry component does NOT include the city tabs at the top\nimport React from \"react\";\n\nimport { IndustryOffice } from \"./IndustryOffice\";\nimport { IndustryOverview } from \"./IndustryOverview\";\nimport { IndustryWarehouse } from \"./IndustryWarehouse\";\nimport { Warehouse } from \"../Warehouse\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n city: string;\n warehouse: Warehouse | 0;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function Industry(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n return (\n <Box display=\"flex\">\n <Box sx={{ width: \"50%\" }}>\n <IndustryOverview rerender={props.rerender} />\n <IndustryOffice rerender={props.rerender} office={props.office} />\n </Box>\n <Box sx={{ width: \"50%\" }}>\n <IndustryWarehouse\n rerender={props.rerender}\n corp={corp}\n currentCity={props.city}\n division={division}\n warehouse={props.warehouse}\n />\n </Box>\n </Box>\n );\n}\n","// React Component for displaying an Industry's OfficeSpace information\n// (bottom-left panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Employee } from \"../Employee\";\nimport { EmployeePositions } from \"../EmployeePositions\";\nimport { BuyCoffee } from \"../Actions\";\n\nimport { MoneyCost } from \"./MoneyCost\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { UpgradeOfficeSizeModal } from \"./modals/UpgradeOfficeSizeModal\";\nimport { ThrowPartyModal } from \"./modals/ThrowPartyModal\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Paper from \"@mui/material/Paper\";\nimport ArrowForwardIcon from \"@mui/icons-material/ArrowForward\";\nimport ArrowDropUpIcon from \"@mui/icons-material/ArrowDropUp\";\nimport ArrowDropDownIcon from \"@mui/icons-material/ArrowDropDown\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableRow from \"@mui/material/TableRow\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport { Box } from \"@mui/material\";\n\ninterface IProps {\n office: OfficeSpace;\n rerender: () => void;\n}\n\ninterface ISwitchProps {\n manualMode: boolean;\n switchMode: (f: (b: boolean) => boolean) => void;\n}\n\nfunction SwitchButton(props: ISwitchProps): React.ReactElement {\n if (props.manualMode) {\n return (\n <Tooltip\n title={\n <Typography>\n Switch to Automatic Assignment Mode, which will automatically assign employees to your selected jobs. You\n simply have to select the number of assignments for each job\n </Typography>\n }\n >\n <Button onClick={() => props.switchMode((old) => !old)}>Switch to Auto Mode</Button>\n </Tooltip>\n );\n } else {\n return (\n <Tooltip\n title={\n <Typography>\n Switch to Manual Assignment Mode, which allows you to specify which employees should get which jobs\n </Typography>\n }\n >\n <Button onClick={() => props.switchMode((old) => !old)}>Switch to Manual Mode</Button>\n </Tooltip>\n );\n }\n}\n\nfunction ManualManagement(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [employee, setEmployee] = useState<Employee | null>(\n props.office.employees.length > 0 ? props.office.employees[0] : null,\n );\n\n // Employee Selector\n const employees = [];\n for (let i = 0; i < props.office.employees.length; ++i) {\n employees.push(\n <MenuItem key={props.office.employees[i].name} value={props.office.employees[i].name}>\n {props.office.employees[i].name}\n </MenuItem>,\n );\n }\n\n function employeeSelectorOnChange(e: SelectChangeEvent<string>): void {\n const name = e.target.value;\n for (let i = 0; i < props.office.employees.length; ++i) {\n if (name === props.office.employees[i].name) {\n setEmployee(props.office.employees[i]);\n break;\n }\n }\n\n props.rerender();\n }\n\n // Employee Positions Selector\n const emp = employee;\n let employeePositionSelectorInitialValue = \"\";\n const employeePositions = [];\n const positionNames = Object.values(EmployeePositions);\n for (let i = 0; i < positionNames.length; ++i) {\n employeePositions.push(\n <MenuItem key={positionNames[i]} value={positionNames[i]}>\n {positionNames[i]}\n </MenuItem>,\n );\n if (emp != null && emp.nextPos === positionNames[i]) {\n employeePositionSelectorInitialValue = emp.nextPos;\n }\n }\n\n function employeePositionSelectorOnChange(e: SelectChangeEvent<string>): void {\n if (employee === null) return;\n props.office.assignSingleJob(employee, e.target.value);\n props.rerender();\n }\n\n // Numeral.js formatter\n const nf = \"0.000\";\n\n // Employee stats (after applying multipliers)\n const effCre = emp ? emp.cre * corp.getEmployeeCreMultiplier() * division.getEmployeeCreMultiplier() : 0;\n const effCha = emp ? emp.cha * corp.getEmployeeChaMultiplier() * division.getEmployeeChaMultiplier() : 0;\n const effInt = emp ? emp.int * corp.getEmployeeIntMultiplier() * division.getEmployeeIntMultiplier() : 0;\n const effEff = emp ? emp.eff * corp.getEmployeeEffMultiplier() * division.getEmployeeEffMultiplier() : 0;\n\n return (\n <>\n <br />\n <Select value={employee !== null ? employee.name : \"\"} onChange={employeeSelectorOnChange}>\n {employees}\n </Select>\n {employee != null && (\n <Typography>\n Morale: {numeralWrapper.format(employee.mor, nf)}\n <br />\n Happiness: {numeralWrapper.format(employee.hap, nf)}\n <br />\n Energy: {numeralWrapper.format(employee.ene, nf)}\n <br />\n Intelligence: {numeralWrapper.format(effInt, nf)}\n <br />\n Charisma: {numeralWrapper.format(effCha, nf)}\n <br />\n Experience: {numeralWrapper.format(employee.exp, nf)}\n <br />\n Creativity: {numeralWrapper.format(effCre, nf)}\n <br />\n Efficiency: {numeralWrapper.format(effEff, nf)}\n <br />\n Salary: <Money money={employee.sal} />\n </Typography>\n )}\n {employee != null && (\n <Select onChange={employeePositionSelectorOnChange} value={employeePositionSelectorInitialValue}>\n {employeePositions}\n </Select>\n )}\n </>\n );\n}\n\ninterface IAutoAssignProps {\n office: OfficeSpace;\n job: string;\n desc: string;\n rerender: () => void;\n}\n\nfunction EmployeeCount(props: { num: number; next: number }): React.ReactElement {\n return (\n <Typography display=\"flex\" alignItems=\"center\" justifyContent=\"flex-end\">\n {props.num === props.next ? null : props.num}\n {props.num === props.next ? null : <ArrowForwardIcon fontSize=\"inherit\" />}\n {props.next}\n </Typography>\n );\n}\n\nfunction AutoAssignJob(props: IAutoAssignProps): React.ReactElement {\n const currJob = props.office.employeeJobs[props.job];\n const nextJob = props.office.employeeNextJobs[props.job];\n const nextUna = props.office.employeeNextJobs[EmployeePositions.Unassigned];\n\n function assignEmployee(): void {\n if (nextUna <= 0) {\n console.warn(\"Cannot assign employee. No unassigned employees available\");\n return;\n }\n\n props.office.autoAssignJob(props.job, nextJob + 1);\n props.rerender();\n }\n\n function unassignEmployee(): void {\n props.office.autoAssignJob(props.job, nextJob - 1);\n props.rerender();\n }\n\n return (\n <TableRow>\n <TableCell>\n <Tooltip title={props.desc}>\n <Typography>{props.job}</Typography>\n </Tooltip>\n </TableCell>\n <TableCell>\n <EmployeeCount num={currJob} next={nextJob} />\n </TableCell>\n <TableCell width=\"1px\">\n <IconButton disabled={nextUna === 0} onClick={assignEmployee}>\n <ArrowDropUpIcon />\n </IconButton>\n </TableCell>\n <TableCell width=\"1px\">\n <IconButton disabled={nextJob === 0} onClick={unassignEmployee}>\n <ArrowDropDownIcon />\n </IconButton>\n </TableCell>\n </TableRow>\n );\n}\n\nfunction AutoManagement(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const vechain = corp.unlockUpgrades[4] === 1; // Has Vechain upgrade\n\n // Calculate average morale, happiness, energy, and salary.\n let totalMorale = 0,\n totalHappiness = 0,\n totalEnergy = 0,\n totalSalary = 0;\n for (let i = 0; i < props.office.employees.length; ++i) {\n totalMorale += props.office.employees[i].mor;\n totalHappiness += props.office.employees[i].hap;\n totalEnergy += props.office.employees[i].ene;\n totalSalary += props.office.employees[i].sal;\n }\n\n let avgMorale = 0,\n avgHappiness = 0,\n avgEnergy = 0;\n if (props.office.employees.length > 0) {\n avgMorale = totalMorale / props.office.employees.length;\n avgHappiness = totalHappiness / props.office.employees.length;\n avgEnergy = totalEnergy / props.office.employees.length;\n }\n\n const currUna = props.office.employeeJobs[EmployeePositions.Unassigned];\n const nextUna = props.office.employeeNextJobs[EmployeePositions.Unassigned];\n\n return (\n <Table padding=\"none\">\n <TableBody>\n <TableRow>\n <TableCell>\n <Typography>Unassigned Employees:</Typography>\n </TableCell>\n <TableCell>\n <EmployeeCount num={currUna} next={nextUna} />\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Avg Employee Morale:</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>{numeralWrapper.format(avgMorale, \"0.000\")}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Avg Employee Happiness:</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>{numeralWrapper.format(avgHappiness, \"0.000\")}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Avg Employee Energy:</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>{numeralWrapper.format(avgEnergy, \"0.000\")}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Total Employee Salary:</Typography>\n </TableCell>\n <TableCell>\n <Typography align=\"right\">\n <Money money={totalSalary} />\n </Typography>\n </TableCell>\n </TableRow>\n {vechain && (\n <>\n <TableRow>\n <TableCell>\n <Tooltip\n title={\n <Typography>\n The base amount of material this office can produce. Does not include production multipliers from\n upgrades and materials. This value is based off the productivity of your Operations, Engineering,\n and Management employees\n </Typography>\n }\n >\n <Typography>Material Production:</Typography>\n </Tooltip>\n </TableCell>\n <TableCell>\n <Typography align=\"right\">\n {numeralWrapper.format(division.getOfficeProductivity(props.office), \"0.000\")}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Tooltip\n title={\n <Typography>\n The base amount of any given Product this office can produce. Does not include production\n multipliers from upgrades and materials. This value is based off the productivity of your\n Operations, Engineering, and Management employees\n </Typography>\n }\n >\n <Typography>Product Production:</Typography>\n </Tooltip>\n </TableCell>\n <TableCell>\n <Typography align=\"right\">\n {numeralWrapper.format(\n division.getOfficeProductivity(props.office, {\n forProduct: true,\n }),\n \"0.000\",\n )}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Tooltip\n title={<Typography>The effect this office's 'Business' employees has on boosting sales</Typography>}\n >\n <Typography> Business Multiplier:</Typography>\n </Tooltip>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>x{numeralWrapper.format(division.getBusinessFactor(props.office), \"0.000\")}</Typography>\n </TableCell>\n </TableRow>\n </>\n )}\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.Operations}\n desc={\"Manages supply chain operations. Improves the amount of Materials and Products you produce.\"}\n />\n\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.Engineer}\n desc={\n \"Develops and maintains products and production systems. Increases the quality of everything you produce. Also increases the amount you produce (not as much as Operations, however)\"\n }\n />\n\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.Business}\n desc={\"Handles sales and finances. Improves the amount of Materials and Products you can sell.\"}\n />\n\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.Management}\n desc={\n \"Leads and oversees employees and office operations. Improves the effectiveness of Engineer and Operations employees.\"\n }\n />\n\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.RandD}\n desc={\"Research new innovative ways to improve the company. Generates Scientific Research.\"}\n />\n\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.Training}\n desc={\n \"Set employee to training, which will increase some of their stats. Employees in training do not affect any company operations.\"\n }\n />\n </TableBody>\n </Table>\n );\n}\n\nexport function IndustryOffice(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [upgradeOfficeSizeOpen, setUpgradeOfficeSizeOpen] = useState(false);\n const [throwPartyOpen, setThrowPartyOpen] = useState(false);\n const [employeeManualAssignMode, setEmployeeManualAssignMode] = useState(false);\n\n function autohireEmployeeButtonOnClick(): void {\n if (props.office.atCapacity()) return;\n props.office.hireRandomEmployee();\n props.rerender();\n }\n\n return (\n <Paper>\n <Typography>Office Space</Typography>\n <Typography>\n Size: {props.office.employees.length} / {props.office.size} employees\n </Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr\", width: \"fit-content\" }}>\n <Box sx={{ gridTemplateColumns: \"repeat(3, 1fr)\" }}>\n <Tooltip title={<Typography>Automatically hires an employee and gives him/her a random name</Typography>}>\n <span>\n <Button disabled={props.office.atCapacity()} onClick={autohireEmployeeButtonOnClick}>\n Hire Employee\n </Button>\n </span>\n </Tooltip>\n <Tooltip title={<Typography>Upgrade the office's size so that it can hold more employees!</Typography>}>\n <span>\n <Button disabled={corp.funds < 0} onClick={() => setUpgradeOfficeSizeOpen(true)}>\n Upgrade size\n </Button>\n </span>\n </Tooltip>\n <UpgradeOfficeSizeModal\n rerender={props.rerender}\n office={props.office}\n open={upgradeOfficeSizeOpen}\n onClose={() => setUpgradeOfficeSizeOpen(false)}\n />\n\n {!division.hasResearch(\"AutoBrew\") && (\n <>\n <Tooltip\n title={<Typography>Provide your employees with coffee, increasing their energy by 5%</Typography>}\n >\n <span>\n <Button\n disabled={corp.funds < props.office.getCoffeeCost() || props.office.coffeeMult > 0}\n onClick={() => BuyCoffee(corp, props.office)}\n >\n {props.office.coffeeMult > 0 ? (\n \"Buying coffee...\"\n ) : (\n <span>\n Buy Coffee - <MoneyCost money={props.office.getCoffeeCost()} corp={corp} />\n </span>\n )}\n </Button>\n </span>\n </Tooltip>\n </>\n )}\n\n {!division.hasResearch(\"AutoPartyManager\") && (\n <>\n <Tooltip\n title={<Typography>Throw an office party to increase your employee's morale and happiness</Typography>}\n >\n <span>\n <Button\n disabled={corp.funds < 0 || props.office.partyMult > 0}\n onClick={() => setThrowPartyOpen(true)}\n >\n {props.office.partyMult > 0 ? \"Throwing Party...\" : \"Throw Party\"}\n </Button>\n </span>\n </Tooltip>\n <ThrowPartyModal\n rerender={props.rerender}\n office={props.office}\n open={throwPartyOpen}\n onClose={() => setThrowPartyOpen(false)}\n />\n </>\n )}\n </Box>\n <SwitchButton manualMode={employeeManualAssignMode} switchMode={setEmployeeManualAssignMode} />\n </Box>\n {employeeManualAssignMode ? (\n <ManualManagement rerender={props.rerender} office={props.office} />\n ) : (\n <AutoManagement rerender={props.rerender} office={props.office} />\n )}\n </Paper>\n );\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { OfficeSpace } from \"../../OfficeSpace\";\nimport { Corporation } from \"../../Corporation\";\nimport { UpgradeOfficeSize } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ninterface IUpgradeButton {\n cost: number;\n size: number;\n corp: Corporation;\n office: OfficeSpace;\n onClose: () => void;\n rerender: () => void;\n}\n\nfunction UpgradeSizeButton(props: IUpgradeButton): React.ReactElement {\n const corp = useCorporation();\n function upgradeSize(cost: number, size: number): void {\n if (corp.funds < cost) {\n return;\n }\n\n UpgradeOfficeSize(corp, props.office, size);\n props.rerender();\n props.onClose();\n }\n return (\n <Tooltip title={numeralWrapper.formatMoney(props.cost)}>\n <span>\n <Button disabled={corp.funds < props.cost} onClick={() => upgradeSize(props.cost, props.size)}>\n +{props.size}\n </Button>\n </span>\n </Tooltip>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function UpgradeOfficeSizeModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const initialPriceMult = Math.round(props.office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n const upgradeCost = CorporationConstants.OfficeInitialCost * Math.pow(costMultiplier, initialPriceMult);\n\n // Calculate cost to upgrade size by 15 employees\n let mult = 0;\n for (let i = 0; i < 5; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n const upgradeCost15 = CorporationConstants.OfficeInitialCost * mult;\n\n //Calculate max upgrade size and cost\n const maxMult = corp.funds / CorporationConstants.OfficeInitialCost;\n let maxNum = 1;\n mult = Math.pow(costMultiplier, initialPriceMult);\n while (maxNum < 50) {\n //Hard cap of 50x (extra 150 employees)\n if (mult >= maxMult) break;\n const multIncrease = Math.pow(costMultiplier, initialPriceMult + maxNum);\n if (mult + multIncrease > maxMult) {\n break;\n } else {\n mult += multIncrease;\n }\n ++maxNum;\n }\n const upgradeCostMax = CorporationConstants.OfficeInitialCost * mult;\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Increase the size of your office space to fit additional employees!</Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>Upgrade size: </Typography>\n <UpgradeSizeButton\n onClose={props.onClose}\n rerender={props.rerender}\n office={props.office}\n corp={corp}\n cost={upgradeCost}\n size={CorporationConstants.OfficeInitialSize}\n />\n <UpgradeSizeButton\n onClose={props.onClose}\n rerender={props.rerender}\n office={props.office}\n corp={corp}\n cost={upgradeCost15}\n size={CorporationConstants.OfficeInitialSize * 5}\n />\n {maxNum !== 1 && maxNum !== 5 && (\n <UpgradeSizeButton\n onClose={props.onClose}\n rerender={props.rerender}\n office={props.office}\n corp={corp}\n cost={upgradeCostMax}\n size={maxNum * CorporationConstants.OfficeInitialSize}\n />\n )}\n </Box>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { OfficeSpace } from \"../../OfficeSpace\";\nimport { ThrowParty } from \"../../Actions\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function ThrowPartyModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [cost, setCost] = useState(0);\n\n const totalCost = cost * props.office.employees.length;\n const canParty = corp.funds >= totalCost;\n function changeCost(event: React.ChangeEvent<HTMLInputElement>): void {\n let x = parseFloat(event.target.value);\n if (isNaN(x)) x = 0;\n setCost(x);\n }\n\n function throwParty(): void {\n if (cost === null || isNaN(cost) || cost < 0) {\n dialogBoxCreate(\"Invalid value entered\");\n } else if (!canParty) {\n dialogBoxCreate(\"You don't have enough company funds to throw a party!\");\n } else {\n const mult = ThrowParty(corp, props.office, cost);\n\n if (mult > 0) {\n dialogBoxCreate(\n \"You threw a party for the office! The morale and happiness of each employee increased by \" +\n numeralWrapper.formatPercentage(mult - 1),\n );\n }\n\n props.rerender();\n props.onClose();\n }\n }\n\n function EffectText(): React.ReactElement {\n if (isNaN(cost) || cost < 0) return <Typography>Invalid value entered!</Typography>;\n return (\n <Typography>\n Throwing this party will cost a total of <Money money={totalCost} />\n </Typography>\n );\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) throwParty();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Enter the amount of money you would like to spend PER EMPLOYEE on this office party</Typography>\n <EffectText />\n <Box display=\"flex\" alignItems=\"center\">\n <TextField\n autoFocus={true}\n type=\"number\"\n placeholder=\"$ / employee\"\n value={cost}\n onChange={changeCost}\n onKeyDown={onKeyDown}\n />\n <Button disabled={!canParty} onClick={throwParty}>\n Throw Party\n </Button>\n </Box>\n </Modal>\n );\n}\n","// React Component for displaying an Industry's overview information\n// (top-left panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { Industries } from \"../IndustryData\";\nimport { HireAdVert } from \"../Actions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { MakeProductModal } from \"./modals/MakeProductModal\";\nimport { ResearchModal } from \"./modals/ResearchModal\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport IconButton from \"@mui/material/IconButton\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport Box from \"@mui/material/Box\";\n\nfunction MakeProductButton(): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [makeOpen, setMakeOpen] = useState(false);\n\n const hasMaxProducts = division.hasMaximumNumberProducts();\n\n function shouldFlash(): boolean {\n return Object.keys(division.products).length === 0;\n }\n\n let createProductButtonText = \"\";\n switch (division.type) {\n case Industries.Food:\n createProductButtonText = \"Build Restaurant\";\n break;\n case Industries.Tobacco:\n createProductButtonText = \"Create Product\";\n break;\n case Industries.Pharmaceutical:\n createProductButtonText = \"Create Drug\";\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductButtonText = \"Create Product\";\n break;\n case Industries.Robotics:\n createProductButtonText = \"Design Robot\";\n break;\n case Industries.Software:\n createProductButtonText = \"Develop Software\";\n break;\n case Industries.Healthcare:\n createProductButtonText = \"Build Hospital\";\n break;\n case Industries.RealEstate:\n createProductButtonText = \"Develop Property\";\n break;\n default:\n createProductButtonText = \"Create Product\";\n return <></>;\n }\n\n return (\n <>\n <Tooltip\n title={\n hasMaxProducts ? (\n <Typography>\n You have reached the maximum number of products: {division.getMaximumNumberProducts()}\n </Typography>\n ) : (\n \"\"\n )\n }\n >\n <Button color={shouldFlash() ? \"error\" : \"primary\"} onClick={() => setMakeOpen(true)} disabled={corp.funds < 0}>\n {createProductButtonText}\n </Button>\n </Tooltip>\n <MakeProductModal open={makeOpen} onClose={() => setMakeOpen(false)} />\n </>\n );\n}\n\ninterface IProps {\n rerender: () => void;\n}\n\nexport function IndustryOverview(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [helpOpen, setHelpOpen] = useState(false);\n const [researchOpen, setResearchOpen] = useState(false);\n const vechain = corp.unlockUpgrades[4] === 1;\n const profit = division.lastCycleRevenue - division.lastCycleExpenses;\n\n let advertisingInfo = false;\n const advertisingFactors = division.getAdvertisingFactors();\n const awarenessFac = advertisingFactors[1];\n const popularityFac = advertisingFactors[2];\n const ratioFac = advertisingFactors[3];\n const totalAdvertisingFac = advertisingFactors[0];\n if (vechain) {\n advertisingInfo = true;\n }\n\n function convertEffectFacToGraphic(fac: number): string {\n return createProgressBarText({\n progress: fac,\n totalTicks: 20,\n });\n }\n\n return (\n <Paper>\n <Typography>\n Industry: {division.type} (Corp Funds: <Money money={corp.funds} />)\n </Typography>\n <br />\n <StatsTable\n rows={[\n [\"Awareness:\", numeralWrapper.formatReallyBigNumber(division.awareness)],\n [\"Popularity:\", numeralWrapper.formatReallyBigNumber(division.popularity)],\n ]}\n />\n {advertisingInfo !== false && (\n <Tooltip\n title={\n <>\n <Typography>Total multiplier for this industry's sales due to its awareness and popularity</Typography>\n <StatsTable\n rows={[\n [\"Awareness Bonus:\", \"x\" + numeralWrapper.formatReallyBigNumber(Math.pow(awarenessFac, 0.85))],\n [\"Popularity Bonus:\", \"x\" + numeralWrapper.formatReallyBigNumber(Math.pow(popularityFac, 0.85))],\n [\"Ratio Multiplier:\", \"x\" + numeralWrapper.formatReallyBigNumber(Math.pow(ratioFac, 0.85))],\n ]}\n />\n </>\n }\n >\n <Typography>Advertising Multiplier: x{numeralWrapper.formatReallyBigNumber(totalAdvertisingFac)}</Typography>\n </Tooltip>\n )}\n <br />\n <StatsTable\n rows={[\n [\"Revenue:\", <MoneyRate money={division.lastCycleRevenue} />],\n [\"Expenses:\", <MoneyRate money={division.lastCycleExpenses} />],\n [\"Profit:\", <MoneyRate money={profit} />],\n ]}\n />\n <br />\n <Box display=\"flex\" alignItems=\"center\">\n <Tooltip\n title={\n <Typography>\n Production gain from owning production-boosting materials such as hardware, Robots, AI Cores, and Real\n Estate.\n </Typography>\n }\n >\n <Typography>Production Multiplier: {numeralWrapper.formatReallyBigNumber(division.prodMult)}</Typography>\n </Tooltip>\n <IconButton onClick={() => setHelpOpen(true)}>\n <HelpIcon />\n </IconButton>\n <StaticModal open={helpOpen} onClose={() => setHelpOpen(false)}>\n <Typography>\n Owning Hardware, Robots, AI Cores, and Real Estate can boost your Industry's production. The effect these\n materials have on your production varies between Industries. For example, Real Estate may be very effective\n for some Industries, but ineffective for others.\n <br />\n <br />\n This division's production multiplier is calculated by summing the individual production multiplier of each\n of its office locations. This production multiplier is applied to each office. Therefore, it is beneficial\n to expand into new cities as this can greatly increase the production multiplier of your entire Division.\n <br />\n <br />\n Below are approximations for how effective each material is at boosting this industry's production\n multiplier (Bigger bars = more effective):\n <br />\n <br />\n Hardware: {convertEffectFacToGraphic(division.hwFac)}\n <br />\n Robots: {convertEffectFacToGraphic(division.robFac)}\n <br />\n AI Cores: {convertEffectFacToGraphic(division.aiFac)}\n <br />\n Real Estate: {convertEffectFacToGraphic(division.reFac)}\n </Typography>\n </StaticModal>\n </Box>\n <Box display=\"flex\" alignItems=\"center\">\n <Tooltip\n title={\n <Typography>\n Scientific Research increases the quality of the materials and products that you produce.\n </Typography>\n }\n >\n <Typography>Scientific Research: {numeralWrapper.formatReallyBigNumber(division.sciResearch.qty)}</Typography>\n </Tooltip>\n <Button sx={{ mx: 1 }} onClick={() => setResearchOpen(true)}>\n Research\n </Button>\n <ResearchModal open={researchOpen} onClose={() => setResearchOpen(false)} industry={division} />\n </Box>\n <br />\n <Box display=\"flex\" alignItems=\"center\">\n <Tooltip\n title={\n <Typography>\n Hire AdVert.Inc to advertise your company. Each level of this upgrade grants your company a static\n increase of 3 and 1 to its awareness and popularity, respectively. It will then increase your company's\n awareness by 1%, and its popularity by a random percentage between 1% and 3%. These effects are increased\n by other upgrades that increase the power of your advertising.\n </Typography>\n }\n >\n <Button\n disabled={division.getAdVertCost() > corp.funds}\n onClick={function () {\n HireAdVert(corp, division);\n props.rerender();\n }}\n >\n Hire AdVert - <MoneyCost money={division.getAdVertCost()} corp={corp} />\n </Button>\n </Tooltip>\n {division.makesProducts && <MakeProductButton />}\n </Box>\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { Industries } from \"../../IndustryData\";\nimport { MakeProduct } from \"../../Actions\";\nimport { useCorporation, useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nfunction productPlaceholder(tpe: string): string {\n if (tpe === Industries.Food) {\n return \"Restaurant Name\";\n } else if (tpe === Industries.Healthcare) {\n return \"Hospital Name\";\n } else if (tpe === Industries.RealEstate) {\n return \"Property Name\";\n }\n return \"Product Name\";\n}\n\n// Create a popup that lets the player create a product for their current industry\nexport function MakeProductModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const allCities = Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] !== 0);\n const [city, setCity] = useState(allCities.length > 0 ? allCities[0] : \"\");\n const [name, setName] = useState(\"\");\n const [design, setDesign] = useState<number>(NaN);\n const [marketing, setMarketing] = useState<number>(NaN);\n if (division.hasMaximumNumberProducts()) return <></>;\n\n let createProductPopupText = <></>;\n switch (division.type) {\n case Industries.Food:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Build and manage a new restaurant!\n </>\n );\n break;\n case Industries.Tobacco:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Create a new tobacco product!\n </>\n );\n break;\n case Industries.Pharmaceutical:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Design and develop a new pharmaceutical drug!\n </>\n );\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Design and manufacture a new computer hardware product!\n </>\n );\n break;\n case Industries.Robotics:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Design and create a new robot or robotic system!\n </>\n );\n break;\n case Industries.Software:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Develop a new piece of software!\n </>\n );\n break;\n case Industries.Healthcare:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Build and manage a new hospital!\n </>\n );\n break;\n case Industries.RealEstate:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Develop a new piece of real estate property!\n </>\n );\n break;\n default:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Create a new product!\n </>\n );\n return <></>;\n }\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n <br />\n To begin developing a product, first choose the city in which it will be designed. The stats of your employees in\n the selected city affect the properties of the finished product, such as its quality, performance, and durability.\n <br />\n <br />\n You can also choose to invest money in the design and marketing of the product. Investing money in its design will\n result in a superior product. Investing money in marketing the product will help the product's sales.\n </>\n );\n\n function makeProduct(): void {\n if (isNaN(design) || isNaN(marketing)) return;\n try {\n MakeProduct(corp, division, city, name, design, marketing);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onCityChange(event: SelectChangeEvent<string>): void {\n setCity(event.target.value);\n }\n\n function onProductNameChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setName(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) makeProduct();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>{createProductPopupText}</Typography>\n <Select style={{ margin: \"5px\" }} onChange={onCityChange} defaultValue={city}>\n {allCities.map((cityName: string) => (\n <MenuItem key={cityName} value={cityName}>\n {cityName}\n </MenuItem>\n ))}\n </Select>\n <TextField onChange={onProductNameChange} placeholder={productPlaceholder(division.type)} />\n <br />\n <NumberInput onChange={setDesign} autoFocus={true} placeholder={\"Design investment\"} />\n <NumberInput onChange={setMarketing} onKeyDown={onKeyDown} placeholder={\"Marketing investment\"} />\n <Button onClick={makeProduct}>Develop Product</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { IndustryResearchTrees } from \"../../IndustryData\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { Industry } from \"../../Industry\";\nimport { Research } from \"../../Actions\";\nimport { Node } from \"../../ResearchTree\";\nimport { ResearchMap } from \"../../ResearchMap\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport CheckIcon from \"@mui/icons-material/Check\";\n\ninterface INodeProps {\n n: Node | null;\n division: Industry;\n}\nfunction Upgrade({ n, division }: INodeProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n if (n === null) return <></>;\n const r = ResearchMap[n.text];\n let disabled = division.sciResearch.qty < r.cost || n.researched;\n const parent = n.parent;\n if (parent !== null) {\n disabled = disabled || !parent.researched;\n }\n\n function research(): void {\n if (n === null || disabled) return;\n try {\n Research(division, n.text);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n dialogBoxCreate(\n `Researched ${n.text}. It may take a market cycle (~${CorporationConstants.SecsPerMarketCycle} seconds) before the effects of the Research apply.`,\n );\n }\n\n let color: \"primary\" | \"info\" = \"primary\";\n if (n.researched) {\n color = \"info\";\n }\n\n const wrapInTooltip = (ele: React.ReactElement): React.ReactElement => {\n return (\n <Tooltip\n title={\n <Typography>\n Research points: {r.cost}\n <br />\n {r.desc}\n </Typography>\n }\n >\n {ele}\n </Tooltip>\n );\n };\n\n const but = (\n <Box>\n {wrapInTooltip(\n <span>\n <Button\n color={color}\n disabled={disabled && !n.researched}\n onClick={research}\n style={{ width: \"100%\", textAlign: \"left\", justifyContent: \"unset\" }}\n >\n {n.researched && <CheckIcon sx={{ mr: 1 }} />}\n {n.text}\n </Button>\n </span>,\n )}\n </Box>\n );\n\n if (n.children.length === 0) return but;\n\n return (\n <Box>\n <Box display=\"flex\" sx={{ border: \"1px solid \" + Settings.theme.well }}>\n {wrapInTooltip(\n <span style={{ width: \"100%\" }}>\n <Button\n color={color}\n disabled={disabled && !n.researched}\n onClick={research}\n sx={{\n width: \"100%\",\n textAlign: \"left\",\n justifyContent: \"unset\",\n borderColor: Settings.theme.button,\n }}\n >\n {n.researched && <CheckIcon sx={{ mr: 1 }} />}\n {n.text}\n </Button>\n </span>,\n )}\n <Button\n onClick={() => setOpen((old) => !old)}\n sx={{ borderColor: Settings.theme.button, minWidth: \"fit-content\" }}\n >\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </Button>\n </Box>\n <Collapse in={open} unmountOnExit>\n <Box m={1}>\n {n.children.map((m) => (\n <Upgrade key={m.text} division={division} n={m} />\n ))}\n </Box>\n </Collapse>\n </Box>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n industry: Industry;\n}\n\n// Create the Research Tree UI for this Industry\nexport function ResearchModal(props: IProps): React.ReactElement {\n const researchTree = IndustryResearchTrees[props.industry.type];\n if (researchTree === undefined) return <></>;\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Upgrade division={props.industry} n={researchTree.root} />\n <Typography sx={{ mt: 1 }}>\n Research points: {props.industry.sciResearch.qty.toFixed(3)}\n <br />\n Multipliers from research:\n <br />* Advertising Multiplier: x{researchTree.getAdvertisingMultiplier()}\n <br />* Employee Charisma Multiplier: x{researchTree.getEmployeeChaMultiplier()}\n <br />* Employee Creativity Multiplier: x{researchTree.getEmployeeCreMultiplier()}\n <br />* Employee Efficiency Multiplier: x{researchTree.getEmployeeEffMultiplier()}\n <br />* Employee Intelligence Multiplier: x{researchTree.getEmployeeIntMultiplier()}\n <br />* Production Multiplier: x{researchTree.getProductionMultiplier()}\n <br />* Sales Multiplier: x{researchTree.getSalesMultiplier()}\n <br />* Scientific Research Multiplier: x{researchTree.getScientificResearchMultiplier()}\n <br />* Storage Multiplier: x{researchTree.getStorageMultiplier()}\n </Typography>\n </Modal>\n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Warehouse } from \"../Warehouse\";\nimport { SmartSupplyModal } from \"./modals/SmartSupplyModal\";\nimport { ProductElem } from \"./ProductElem\";\nimport { MaterialElem } from \"./MaterialElem\";\nimport { MaterialSizes } from \"../MaterialSizes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { Corporation } from \"../Corporation\";\nimport { Industry } from \"../Industry\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { isRelevantMaterial } from \"./Helpers\";\nimport { IndustryProductEquation } from \"./IndustryProductEquation\";\nimport { PurchaseWarehouse } from \"../Actions\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface IProps {\n corp: Corporation;\n division: Industry;\n warehouse: Warehouse | 0;\n currentCity: string;\n rerender: () => void;\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n retainHeight: {\n minHeight: \"3em\",\n },\n }),\n);\n\nfunction WarehouseRoot(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [smartSupplyOpen, setSmartSupplyOpen] = useState(false);\n if (props.warehouse === 0) return <></>;\n\n // Upgrade Warehouse size button\n const sizeUpgradeCost = CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, props.warehouse.level + 1);\n const canAffordUpgrade = corp.funds > sizeUpgradeCost;\n function upgradeWarehouseOnClick(): void {\n if (division === null) return;\n if (props.warehouse === 0) return;\n if (!canAffordUpgrade) return;\n ++props.warehouse.level;\n props.warehouse.updateSize(corp, division);\n corp.funds = corp.funds - sizeUpgradeCost;\n props.rerender();\n }\n\n const classes = useStyles();\n\n // Current State:\n let stateText;\n switch (division.state) {\n case \"START\":\n stateText = \"Current state: Preparing...\";\n break;\n case \"PURCHASE\":\n stateText = \"Current state: Purchasing materials...\";\n break;\n case \"PRODUCTION\":\n stateText = \"Current state: Producing materials and/or products...\";\n break;\n case \"SALE\":\n stateText = \"Current state: Selling materials and/or products...\";\n break;\n case \"EXPORT\":\n stateText = \"Current state: Exporting materials and/or products...\";\n break;\n default:\n console.error(`Invalid state: ${division.state}`);\n break;\n }\n\n // Create React components for materials\n const mats = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n if (!props.warehouse.materials[matName]) continue;\n // Only create UI for materials that are relevant for the industry or in stock\n const isInStock = props.warehouse.materials[matName].qty > 0;\n const isRelevant = isRelevantMaterial(matName, division);\n if (!isInStock && !isRelevant) continue;\n mats.push(\n <MaterialElem\n rerender={props.rerender}\n city={props.currentCity}\n key={matName}\n mat={props.warehouse.materials[matName]}\n warehouse={props.warehouse}\n />,\n );\n }\n\n // Create React components for products\n const products = [];\n if (division.makesProducts && Object.keys(division.products).length > 0) {\n for (const productName of Object.keys(division.products)) {\n const product = division.products[productName];\n if (!product) continue;\n products.push(\n <ProductElem rerender={props.rerender} city={props.currentCity} key={productName} product={product} />,\n );\n }\n }\n\n const breakdownItems: JSX.Element[] = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n const mat = props.warehouse.materials[matName];\n if (!MaterialSizes.hasOwnProperty(matName)) continue;\n if (mat.qty === 0) continue;\n breakdownItems.push(\n <>\n {matName}: {numeralWrapper.format(mat.qty * MaterialSizes[matName], \"0,0.0\")}\n </>,\n );\n }\n\n for (const prodName of Object.keys(division.products)) {\n const prod = division.products[prodName];\n if (prod === undefined) continue;\n breakdownItems.push(\n <>\n {prodName}: {numeralWrapper.format(prod.data[props.warehouse.loc][0] * prod.siz, \"0,0.0\")}\n </>,\n );\n }\n\n let breakdown;\n if (breakdownItems && breakdownItems.length > 0) {\n breakdown = breakdownItems.reduce(\n (previous: JSX.Element, current: JSX.Element): JSX.Element =>\n (previous && (\n <>\n {previous}\n <br />\n {current}\n </>\n )) || <>{current}</>,\n );\n } else {\n breakdown = <>No items in storage.</>;\n }\n\n return (\n <Paper>\n <Box display=\"flex\" alignItems=\"center\">\n <Tooltip\n title={\n props.warehouse.sizeUsed !== 0 ? (\n <Typography>\n <>{breakdown}</>\n </Typography>\n ) : (\n \"\"\n )\n }\n >\n <Typography color={props.warehouse.sizeUsed >= props.warehouse.size ? \"error\" : \"primary\"}>\n Storage: {numeralWrapper.formatBigNumber(props.warehouse.sizeUsed)} /{\" \"}\n {numeralWrapper.formatBigNumber(props.warehouse.size)}\n </Typography>\n </Tooltip>\n </Box>\n\n <Button disabled={!canAffordUpgrade} onClick={upgradeWarehouseOnClick}>\n Upgrade Warehouse Size - \n <MoneyCost money={sizeUpgradeCost} corp={corp} />\n </Button>\n\n <Typography>This industry uses the following equation for its production: </Typography>\n <br />\n <Typography>\n <IndustryProductEquation key={division.name} division={division} />\n </Typography>\n <br />\n <Typography>\n To get started with production, purchase your required materials or import them from another of your company's\n divisions.\n </Typography>\n <br />\n\n <Typography className={classes.retainHeight}>{stateText}</Typography>\n\n {corp.unlockUpgrades[1] && (\n <>\n <Button onClick={() => setSmartSupplyOpen(true)}>Configure Smart Supply</Button>\n <SmartSupplyModal\n open={smartSupplyOpen}\n onClose={() => setSmartSupplyOpen(false)}\n warehouse={props.warehouse}\n />\n </>\n )}\n\n {mats}\n\n {products}\n </Paper>\n );\n}\n\nexport function IndustryWarehouse(props: IProps): React.ReactElement {\n if (props.warehouse) {\n return <WarehouseRoot {...props} />;\n } else {\n return <EmptyWarehouse rerender={props.rerender} city={props.currentCity} />;\n }\n}\n\ninterface IEmptyProps {\n city: string;\n rerender: () => void;\n}\n\nfunction EmptyWarehouse(props: IEmptyProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const disabled = corp.funds < CorporationConstants.WarehouseInitialCost;\n function purchaseWarehouse(): void {\n if (disabled) return;\n PurchaseWarehouse(corp, division, props.city);\n props.rerender();\n }\n return (\n <Paper>\n <Button onClick={purchaseWarehouse} disabled={disabled}>\n Purchase Warehouse (\n <MoneyCost money={CorporationConstants.WarehouseInitialCost} corp={corp} />)\n </Button>\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Warehouse } from \"../../Warehouse\";\nimport { SetSmartSupply, SetSmartSupplyUseLeftovers } from \"../../Actions\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\n\ninterface ILeftoverProps {\n matName: string;\n warehouse: Warehouse;\n}\n\nfunction Leftover(props: ILeftoverProps): React.ReactElement {\n const [checked, setChecked] = useState(!!props.warehouse.smartSupplyUseLeftovers[props.matName.replace(/ /g, \"\")]);\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n try {\n const matName = props.matName.replace(/ /g, \"\");\n const material = props.warehouse.materials[matName];\n SetSmartSupplyUseLeftovers(props.warehouse, material, event.target.checked);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n setChecked(event.target.checked);\n }\n\n return (\n <>\n <FormControlLabel\n control={<Switch checked={checked} onChange={onChange} />}\n label={<Typography>{props.warehouse.materials[props.matName.replace(/ /g, \"\")].name}</Typography>}\n />\n <br />\n </>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n warehouse: Warehouse;\n}\n\nexport function SmartSupplyModal(props: IProps): React.ReactElement {\n const division = useDivision();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n // Smart Supply Checkbox\n function smartSupplyOnChange(e: React.ChangeEvent<HTMLInputElement>): void {\n SetSmartSupply(props.warehouse, e.target.checked);\n rerender();\n }\n\n // Create React components for materials\n const mats = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n if (!props.warehouse.materials[matName]) continue;\n if (!Object.keys(division.reqMats).includes(matName)) continue;\n mats.push(<Leftover key={matName} warehouse={props.warehouse} matName={matName} />);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <FormControlLabel\n control={<Switch checked={props.warehouse.smartSupplyEnabled} onChange={smartSupplyOnChange} />}\n label={<Typography>Enable Smart Supply</Typography>}\n />\n <br />\n <Typography>Use materials already in the warehouse instead of buying new ones, if available:</Typography>\n {mats}\n </>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Product } from \"../Product\";\nimport { DiscontinueProductModal } from \"./modals/DiscontinueProductModal\";\nimport { LimitProductProductionModal } from \"./modals/LimitProductProductionModal\";\nimport { SellProductModal } from \"./modals/SellProductModal\";\nimport { ProductMarketTaModal } from \"./modals/ProductMarketTaModal\";\nimport { CancelProductModal } from \"./modals/CancelProductModal\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { isString } from \"../../utils/helpers/isString\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProductProps {\n city: string;\n product: Product;\n rerender: () => void;\n}\n\n// Creates the UI for a single Product type\nexport function ProductElem(props: IProductProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [sellOpen, setSellOpen] = useState(false);\n const [limitOpen, setLimitOpen] = useState(false);\n const [discontinueOpen, setDiscontinueOpen] = useState(false);\n const [cancelOpen, setCancelOpen] = useState(false);\n const [marketTaOpen, setMarketTaOpen] = useState(false);\n const city = props.city;\n const product = props.product;\n\n // Numeral.js formatters\n const nf = \"0.000\";\n const nfB = \"0.000a\"; // For numbers that might be big\n\n const hasUpgradeDashboard = division.hasResearch(\"uPgrade: Dashboard\");\n\n // Total product gain = production - sale\n const totalGain = product.data[city][1] - product.data[city][2];\n\n // Sell button\n let sellButtonText: JSX.Element;\n if (product.sllman[city][0]) {\n if (isString(product.sllman[city][1])) {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(product.data[city][2], nfB)}/{product.sllman[city][1]})\n </>\n );\n } else {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(product.data[city][2], nfB)}/\n {numeralWrapper.format(product.sllman[city][1], nfB)})\n </>\n );\n }\n } else {\n sellButtonText = <>Sell (0.000/0.000)</>;\n }\n\n if (product.marketTa2) {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={product.marketTa2Price[city]} />\n </>\n );\n } else if (product.marketTa1) {\n const markupLimit = product.rat / product.mku;\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={product.pCost + markupLimit} />\n </>\n );\n } else if (product.sCost) {\n if (isString(product.sCost)) {\n const sCost = (product.sCost as string).replace(/MP/g, product.pCost + product.rat / product.mku + \"\");\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={eval(sCost)} />\n </>\n );\n } else {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={product.sCost} />\n </>\n );\n }\n }\n\n // Limit Production button\n let limitProductionButtonText = \"Limit Production\";\n if (product.prdman[city][0]) {\n limitProductionButtonText += \" (\" + numeralWrapper.format(product.prdman[city][1], nf) + \")\";\n }\n\n return (\n <Paper>\n {!product.fin ? (\n <>\n <Typography>\n Designing {product.name} (req. Operations/Engineers in {product.createCity})...\n </Typography>\n <br />\n <Typography>{numeralWrapper.format(product.prog, \"0.00\")}% complete</Typography>\n <Button onClick={() => setCancelOpen(true)}>Cancel</Button>\n <CancelProductModal\n product={product}\n rerender={props.rerender}\n open={cancelOpen}\n onClose={() => setCancelOpen(false)}\n />\n </>\n ) : (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Prod: {numeralWrapper.format(product.data[city][1], nfB)}/s\n <br />\n Sell: {numeralWrapper.format(product.data[city][2], nfB)} /s\n </Typography>\n }\n >\n <Typography>\n {product.name}: {numeralWrapper.format(product.data[city][0], nfB)} (\n {numeralWrapper.format(totalGain, nfB)}\n /s)\n </Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Quality: {numeralWrapper.format(product.qlt, nf)} <br />\n Performance: {numeralWrapper.format(product.per, nf)} <br />\n Durability: {numeralWrapper.format(product.dur, nf)} <br />\n Reliability: {numeralWrapper.format(product.rel, nf)} <br />\n Aesthetics: {numeralWrapper.format(product.aes, nf)} <br />\n Features: {numeralWrapper.format(product.fea, nf)}\n {corp.unlockUpgrades[2] === 1 && <br />}\n {corp.unlockUpgrades[2] === 1 && \"Demand: \" + numeralWrapper.format(product.dmd, nf)}\n {corp.unlockUpgrades[3] === 1 && <br />}\n {corp.unlockUpgrades[3] === 1 && \"Competition: \" + numeralWrapper.format(product.cmp, nf)}\n </Typography>\n }\n >\n <Typography>Rating: {numeralWrapper.format(product.rat, nf)}</Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip title={<Typography>An estimate of the material cost it takes to create this Product.</Typography>}>\n <Typography>\n Est. Production Cost:{\" \"}\n {numeralWrapper.formatMoney(product.pCost / CorporationConstants.ProductProductionCostRatio)}\n </Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n An estimate of how much consumers are willing to pay for this product. Setting the sale price above\n this may result in less sales. Setting the sale price below this may result in more sales.\n </Typography>\n }\n >\n <Typography>Est. Market Price: {numeralWrapper.formatMoney(product.pCost)}</Typography>\n </Tooltip>\n </Box>\n <Button onClick={() => setDiscontinueOpen(true)}>Discontinue</Button>\n <DiscontinueProductModal\n product={product}\n rerender={props.rerender}\n open={discontinueOpen}\n onClose={() => setDiscontinueOpen(false)}\n />\n </>\n )}\n\n {(hasUpgradeDashboard || product.fin) && (\n <>\n <Button onClick={() => setSellOpen(true)}>{sellButtonText}</Button>\n <SellProductModal product={product} city={city} open={sellOpen} onClose={() => setSellOpen(false)} />\n <br />\n <Button onClick={() => setLimitOpen(true)}>{limitProductionButtonText}</Button>\n <LimitProductProductionModal\n product={product}\n city={city}\n open={limitOpen}\n onClose={() => setLimitOpen(false)}\n />\n {division.hasResearch(\"Market-TA.I\") && (\n <>\n <Button onClick={() => setMarketTaOpen(true)}>Market-TA</Button>\n <ProductMarketTaModal product={product} open={marketTaOpen} onClose={() => setMarketTaOpen(false)} />\n </>\n )}\n </>\n )}\n </Paper>\n );\n}\n","import React from \"react\";\n\nimport { Product } from \"../../Product\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n rerender: () => void;\n}\n\n// Create a popup that lets the player discontinue a product\nexport function DiscontinueProductModal(props: IProps): React.ReactElement {\n const division = useDivision();\n function discontinue(): void {\n division.discontinueProduct(props.product);\n props.onClose();\n props.rerender();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Are you sure you want to do this? Discontinuing a product removes it completely and permanently. You will no\n longer produce this product and all of its existing stock will be removed and left unsold\n </Typography>\n <Button onClick={discontinue}>Discontinue</Button>\n </Modal>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { Product } from \"../../Product\";\nimport { LimitProductProduction } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n city: string;\n}\n\n// Create a popup that lets the player limit the production of a product\nexport function LimitProductProductionModal(props: IProps): React.ReactElement {\n const [limit, setLimit] = useState<number | null>(null);\n\n // reset modal internal state on modal close\n useEffect(() => {\n if (!props.open) {\n setLimit(null);\n }\n }, [props.open]);\n\n function limitProductProduction(): void {\n let qty = limit;\n if (qty === null) qty = -1;\n LimitProductProduction(props.product, props.city, qty);\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) limitProductProduction();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setLimit(null);\n else setLimit(parseFloat(event.target.value));\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter a limit to the amount of this product you would like to produce per second. Leave the box empty to set no\n limit.\n </Typography>\n <TextField autoFocus={true} placeholder=\"Limit\" type=\"number\" onChange={onChange} onKeyDown={onKeyDown} />\n <Button onClick={limitProductProduction}>Limit production</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Product } from \"../../Product\";\nimport { SellProduct } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\n\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\nfunction initialPrice(product: Product): string {\n let val = product.sCost ? product.sCost + \"\" : \"\";\n if (product.marketTa2) {\n val += \" (Market-TA.II)\";\n } else if (product.marketTa1) {\n val += \" (Market-TA.I)\";\n }\n return val;\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n city: string;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellProductModal(props: IProps): React.ReactElement {\n const [checked, setChecked] = useState(true);\n const [iQty, setQty] = useState<string>(\n props.product.sllman[props.city][1] ? props.product.sllman[props.city][1] : \"\",\n );\n const [px, setPx] = useState<string>(initialPrice(props.product));\n\n function onCheckedChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setChecked(event.target.checked);\n }\n\n function sellProduct(): void {\n try {\n SellProduct(props.product, props.city, iQty, px, checked);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function onAmtChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setQty(event.target.value);\n }\n\n function onPriceChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setPx(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) sellProduct();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the maximum amount of {props.product.name} you would like to sell per second, as well as the price at\n which you would like to sell it at.\n <br />\n <br />\n If the sell amount is set to 0, then the product will not be sold. If the sell price is set to 0, then the\n product will be discarded.\n <br />\n <br />\n Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.\n <br />\n <br />\n When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that\n depends on your production. For example, if you set the sell amount to 'PROD-1' then you will always sell 1 less\n of the material than you produce.\n <br />\n <br />\n When setting the sell price, you can use the 'MP' variable to set a dynamically changing price that depends on\n the Product's estimated market price. For example, if you set it to 'MP*5' then it will always be sold at five\n times the estimated market price.\n </Typography>\n <br />\n <TextField\n value={iQty}\n autoFocus={true}\n type=\"text\"\n placeholder=\"Sell amount\"\n onChange={onAmtChange}\n onKeyDown={onKeyDown}\n />\n <TextField value={px} type=\"text\" placeholder=\"Sell price\" onChange={onPriceChange} onKeyDown={onKeyDown} />\n <Button onClick={sellProduct}>Confirm</Button>\n <FormControlLabel\n control={<Switch checked={checked} onChange={onCheckedChange} />}\n label={<Typography>Use same 'Sell Amount' for all cities</Typography>}\n />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Product } from \"../../Product\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface ITa2Props {\n product: Product;\n}\n\nfunction MarketTA2(props: ITa2Props): React.ReactElement {\n const division = useDivision();\n if (!division.hasResearch(\"Market-TA.II\")) return <></>;\n const markupLimit = props.product.rat / props.product.mku;\n const [value, setValue] = useState(props.product.pCost);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setValue(parseFloat(event.target.value));\n }\n\n function onCheckedChange(event: React.ChangeEvent<HTMLInputElement>): void {\n props.product.marketTa2 = event.target.checked;\n rerender();\n }\n\n const sCost = value;\n let markup = 1;\n if (sCost > props.product.pCost) {\n if (sCost - props.product.pCost > markupLimit) {\n markup = markupLimit / (sCost - props.product.pCost);\n }\n }\n\n return (\n <>\n <Typography variant=\"h4\">Market-TA.II</Typography>\n <br />\n <Typography>\n If you sell at {numeralWrapper.formatMoney(sCost)}, then you will sell{\" \"}\n {numeralWrapper.format(markup, \"0.00000\")}x as much compared to if you sold at market price.\n </Typography>\n <TextField type=\"number\" onChange={onChange} value={value} />\n <br />\n <FormControlLabel\n control={<Switch checked={props.product.marketTa2} onChange={onCheckedChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then this Material will automatically be sold at the optimal price such that the\n amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all\n produced materials will be sold)\n </Typography>\n }\n >\n <Typography>Use Market-TA.II for Auto-Sale Price</Typography>\n </Tooltip>\n }\n />\n </>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n}\n\n// Create a popup that lets the player use the Market TA research for Products\nexport function ProductMarketTaModal(props: IProps): React.ReactElement {\n const markupLimit = props.product.rat / props.product.mku;\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n props.product.marketTa1 = event.target.checked;\n rerender();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography variant=\"h4\">Market-TA.I</Typography>\n <Typography>\n The maximum sale price you can mark this up to is{\" \"}\n {numeralWrapper.formatMoney(props.product.pCost + markupLimit)}. This means that if you set the sale price\n higher than this, you will begin to experience a loss in number of sales\n </Typography>\n\n <FormControlLabel\n control={<Switch checked={props.product.marketTa1} onChange={onChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then this Material will automatically be sold at the price identified by\n Market-TA.I (i.e. the price shown above)\n </Typography>\n }\n >\n <Typography>Use Market-TA.I for Auto-Sale Price</Typography>\n </Tooltip>\n }\n />\n </>\n\n <MarketTA2 product={props.product} />\n </Modal>\n );\n}\n","import React from \"react\";\n\nimport { Product } from \"../../Product\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n rerender: () => void;\n}\n\n// Create a popup that lets the player cancel a product\nexport function CancelProductModal(props: IProps): React.ReactElement {\n const division = useDivision();\n function cancel(): void {\n division.discontinueProduct(props.product);\n props.onClose();\n props.rerender();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Are you sure you want to do this? Canceling a product removes it completely and permanently. You will receive no\n money back by doing so\n </Typography>\n <Button onClick={cancel}>Cancel</Button>\n </Modal>\n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { Material } from \"../Material\";\nimport { Warehouse } from \"../Warehouse\";\nimport { ExportModal } from \"./modals/ExportModal\";\nimport { MaterialMarketTaModal } from \"./modals/MaterialMarketTaModal\";\nimport { SellMaterialModal } from \"./modals/SellMaterialModal\";\nimport { PurchaseMaterialModal } from \"./modals/PurchaseMaterialModal\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { isString } from \"../../utils/helpers/isString\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport { LimitMaterialProductionModal } from \"./modals/LimitMaterialProductionModal\";\n\ninterface IMaterialProps {\n warehouse: Warehouse;\n city: string;\n mat: Material;\n rerender: () => void;\n}\n\n// Creates the UI for a single Material type\nexport function MaterialElem(props: IMaterialProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [purchaseMaterialOpen, setPurchaseMaterialOpen] = useState(false);\n const [exportOpen, setExportOpen] = useState(false);\n const [sellMaterialOpen, setSellMaterialOpen] = useState(false);\n const [materialMarketTaOpen, setMaterialMarketTaOpen] = useState(false);\n const [limitProductionOpen, setLimitProductionOpen] = useState(false);\n\n const warehouse = props.warehouse;\n const city = props.city;\n const mat = props.mat;\n const markupLimit = mat.getMarkupLimit();\n const office = division.offices[city];\n if (!office) {\n throw new Error(`Could not get OfficeSpace object for this city (${city})`);\n }\n\n // Numeral.js formatter\n const nf = \"0.000\";\n const nfB = \"0.000a\"; // For numbers that might be bigger\n\n // Total gain or loss of this material (per second)\n const totalGain = mat.buy + mat.prd + mat.imp - mat.sll - mat.totalExp;\n\n // Flag that determines whether this industry is \"new\" and the current material should be\n // marked with flashing-red lights\n const tutorial =\n division.newInd && Object.keys(division.reqMats).includes(mat.name) && mat.buy === 0 && mat.imp === 0;\n\n // Purchase material button\n const purchaseButtonText = `Buy (${numeralWrapper.format(mat.buy, nfB)})`;\n\n // Sell material button\n let sellButtonText: JSX.Element;\n if (mat.sllman[0]) {\n if (isString(mat.sllman[1])) {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(mat.sll, nfB)}/{mat.sllman[1]})\n </>\n );\n } else {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(mat.sll, nfB)}/{numeralWrapper.format(mat.sllman[1] as number, nfB)})\n </>\n );\n }\n\n if (mat.marketTa2) {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={mat.marketTa2Price} />\n </>\n );\n } else if (mat.marketTa1) {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={mat.bCost + markupLimit} />\n </>\n );\n } else if (mat.sCost) {\n if (isString(mat.sCost)) {\n const sCost = (mat.sCost as string).replace(/MP/g, mat.bCost + \"\");\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={eval(sCost)} />\n </>\n );\n } else {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={mat.sCost} />\n </>\n );\n }\n }\n } else {\n sellButtonText = <>Sell (0.000/0.000)</>;\n }\n\n // Limit Production button\n let limitMaterialButtonText = \"Limit Material\";\n if (mat.prdman[0]) {\n limitMaterialButtonText += \" (\" + numeralWrapper.format(mat.prdman[1], nf) + \")\";\n }\n\n return (\n <Paper>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"2fr 1fr\", m: \"5px\" }}>\n <Box>\n <Tooltip\n title={\n <Typography>\n Buy: {numeralWrapper.format(mat.buy, nfB)} <br />\n Prod: {numeralWrapper.format(mat.prd, nfB)} <br />\n Sell: {numeralWrapper.format(mat.sll, nfB)} <br />\n Export: {numeralWrapper.format(mat.totalExp, nfB)} <br />\n Import: {numeralWrapper.format(mat.imp, nfB)}\n {corp.unlockUpgrades[2] === 1 && <br />}\n {corp.unlockUpgrades[2] === 1 && \"Demand: \" + numeralWrapper.format(mat.dmd, nf)}\n {corp.unlockUpgrades[3] === 1 && <br />}\n {corp.unlockUpgrades[3] === 1 && \"Competition: \" + numeralWrapper.format(mat.cmp, nf)}\n </Typography>\n }\n >\n <Typography>\n {mat.name}: {numeralWrapper.format(mat.qty, nfB)} ({numeralWrapper.format(totalGain, nfB)}/s)\n </Typography>\n </Tooltip>\n <Tooltip\n title={\n <Typography>\n Market Price: The price you would pay if you were to buy this material on the market\n </Typography>\n }\n >\n <Typography>MP: {numeralWrapper.formatMoney(mat.bCost)}</Typography>\n </Tooltip>\n <Tooltip\n title={<Typography>The quality of your material. Higher quality will lead to more sales</Typography>}\n >\n <Typography>Quality: {numeralWrapper.format(mat.qlt, \"0.00a\")}</Typography>\n </Tooltip>\n </Box>\n\n <Box sx={{ \"& button\": { width: \"100%\" } }}>\n <Tooltip\n title={tutorial ? <Typography>Purchase your required materials to get production started!</Typography> : \"\"}\n >\n <Button color={tutorial ? \"error\" : \"primary\"} onClick={() => setPurchaseMaterialOpen(true)}>\n {purchaseButtonText}\n </Button>\n </Tooltip>\n <PurchaseMaterialModal\n mat={mat}\n warehouse={warehouse}\n open={purchaseMaterialOpen}\n disablePurchaseLimit={\n props.warehouse.smartSupplyEnabled && Object.keys(division.reqMats).includes(props.mat.name)\n }\n onClose={() => setPurchaseMaterialOpen(false)}\n />\n\n {corp.unlockUpgrades[0] === 1 && (\n <>\n <Button onClick={() => setExportOpen(true)}>Export</Button>\n\n <ExportModal mat={mat} open={exportOpen} onClose={() => setExportOpen(false)} />\n </>\n )}\n\n <Button\n color={division.prodMats.includes(props.mat.name) && !mat.sllman[0] ? \"error\" : \"primary\"}\n onClick={() => setSellMaterialOpen(true)}\n >\n {sellButtonText}\n </Button>\n <SellMaterialModal mat={mat} open={sellMaterialOpen} onClose={() => setSellMaterialOpen(false)} />\n {division.hasResearch(\"Market-TA.I\") && (\n <>\n <Button onClick={() => setMaterialMarketTaOpen(true)}>Market-TA</Button>\n\n <MaterialMarketTaModal\n mat={mat}\n open={materialMarketTaOpen}\n onClose={() => setMaterialMarketTaOpen(false)}\n />\n </>\n )}\n <Button color={tutorial ? \"error\" : \"primary\"} onClick={() => setLimitProductionOpen(true)}>\n {limitMaterialButtonText}\n </Button>\n <LimitMaterialProductionModal\n material={mat}\n open={limitProductionOpen}\n onClose={() => setLimitProductionOpen(false)}\n />\n </Box>\n </Box>\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Material } from \"../../Material\";\nimport { Export } from \"../../Export\";\nimport { Industry } from \"../../Industry\";\nimport { ExportMaterial } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\nimport { isRelevantMaterial } from \"../Helpers\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that lets the player manage exports\nexport function ExportModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const possibleDivisions = corp.divisions.filter((division: Industry) => isRelevantMaterial(props.mat.name, division));\n if (possibleDivisions.length === 0) throw new Error(\"Export popup created with no divisions.\");\n const defaultDivision = possibleDivisions[0];\n if (Object.keys(defaultDivision.warehouses).length === 0)\n throw new Error(\"Export popup created in a division with no warehouses.\");\n const [industry, setIndustry] = useState<string>(defaultDivision.name);\n const [city, setCity] = useState<string>(Object.keys(defaultDivision.warehouses)[0]);\n const [amt, setAmt] = useState(\"\");\n const setRerender = useState(false)[1];\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onCityChange(event: SelectChangeEvent<string>): void {\n setCity(event.target.value);\n }\n\n function onIndustryChange(event: SelectChangeEvent<string>): void {\n const div = event.target.value;\n setIndustry(div);\n setCity(Object.keys(corp.divisions[0].warehouses)[0]);\n }\n\n function onAmtChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setAmt(event.target.value);\n }\n\n function exportMaterial(): void {\n try {\n ExportMaterial(industry, city, props.mat, amt, currentDivision);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function removeExport(exp: Export): void {\n for (let i = 0; i < props.mat.exp.length; ++i) {\n if (props.mat.exp[i].ind !== exp.ind || props.mat.exp[i].city !== exp.city || props.mat.exp[i].amt !== exp.amt)\n continue;\n props.mat.exp.splice(i, 1);\n break;\n }\n rerender();\n }\n\n const currentDivision = corp.divisions.find((division: Industry) => division.name === industry);\n if (currentDivision === undefined)\n throw new Error(`Export popup somehow ended up with undefined division '${currentDivision}'`);\n const possibleCities = Object.keys(currentDivision.warehouses).filter(\n (city) => currentDivision.warehouses[city] !== 0,\n );\n if (possibleCities.length > 0 && !possibleCities.includes(city)) {\n setCity(possibleCities[0]);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Select the industry and city to export this material to, as well as how much of this material to export per\n second. You can set the export amount to 'MAX' to export all of the materials in this warehouse.\n </Typography>\n <Select onChange={onIndustryChange} value={industry}>\n {corp.divisions\n .filter((division: Industry) => isRelevantMaterial(props.mat.name, division))\n .map((division: Industry) => (\n <MenuItem key={division.name} value={division.name}>\n {division.name}\n </MenuItem>\n ))}\n </Select>\n <Select onChange={onCityChange} value={city}>\n {possibleCities.map((cityName: string) => {\n if (currentDivision.warehouses[cityName] === 0) return;\n return (\n <MenuItem key={cityName} value={cityName}>\n {cityName}\n </MenuItem>\n );\n })}\n </Select>\n <TextField placeholder=\"Export amount / s\" onChange={onAmtChange} value={amt} />\n <Button onClick={exportMaterial}>Export</Button>\n <Typography>\n Below is a list of all current exports of this material from this warehouse. Clicking on one of the exports\n below will REMOVE that export.\n </Typography>\n {props.mat.exp.map((exp: Export, index: number) => (\n <Box display=\"flex\" alignItems=\"center\" key={index}>\n <Button sx={{ mx: 2 }} onClick={() => removeExport(exp)}>\n delete\n </Button>\n <Typography>\n Industry: {exp.ind}\n <br />\n City: {exp.city}\n <br />\n Amount/s: {exp.amt}\n </Typography>\n </Box>\n ))}\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Material } from \"../../Material\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IMarketTA2Props {\n mat: Material;\n}\n\nfunction MarketTA2(props: IMarketTA2Props): React.ReactElement {\n const division = useDivision();\n if (!division.hasResearch(\"Market-TA.II\")) return <></>;\n const [newCost, setNewCost] = useState<number>(props.mat.bCost);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const markupLimit = props.mat.getMarkupLimit();\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setNewCost(0);\n else setNewCost(parseFloat(event.target.value));\n }\n\n const sCost = newCost;\n let markup = 1;\n if (sCost > props.mat.bCost) {\n //Penalty if difference between sCost and bCost is greater than markup limit\n if (sCost - props.mat.bCost > markupLimit) {\n markup = Math.pow(markupLimit / (sCost - props.mat.bCost), 2);\n }\n } else if (sCost < props.mat.bCost) {\n if (sCost <= 0) {\n markup = 1e12; //Sell everything, essentially discard\n } else {\n //Lower prices than market increases sales\n markup = props.mat.bCost / sCost;\n }\n }\n\n function onMarketTA2(event: React.ChangeEvent<HTMLInputElement>): void {\n props.mat.marketTa2 = event.target.checked;\n rerender();\n }\n\n return (\n <>\n <Typography variant=\"h4\">Market-TA.II</Typography>\n <br />\n <Typography>\n If you sell at {numeralWrapper.formatMoney(sCost)}, then you will sell{\" \"}\n {numeralWrapper.format(markup, \"0.00000\")}x as much compared to if you sold at market price.\n </Typography>\n <TextField type=\"number\" onChange={onChange} value={newCost} />\n <br />\n <FormControlLabel\n control={<Switch checked={props.mat.marketTa2} onChange={onMarketTA2} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then this Material will automatically be sold at the optimal price such that the\n amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all\n produced materials will be sold)\n </Typography>\n }\n >\n <Typography>Use Market-TA.II for Auto-Sale Price</Typography>\n </Tooltip>\n }\n />\n </>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that lets the player use the Market TA research for Materials\nexport function MaterialMarketTaModal(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const markupLimit = props.mat.getMarkupLimit();\n\n function onMarketTA1(event: React.ChangeEvent<HTMLInputElement>): void {\n props.mat.marketTa1 = event.target.checked;\n rerender();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography variant=\"h4\">Market-TA.I</Typography>\n <Typography>\n The maximum sale price you can mark this up to is {numeralWrapper.formatMoney(props.mat.bCost + markupLimit)}.\n This means that if you set the sale price higher than this, you will begin to experience a loss in number of\n sales\n </Typography>\n\n <FormControlLabel\n control={<Switch checked={props.mat.marketTa1} onChange={onMarketTA1} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then this Material will automatically be sold at the price identified by\n Market-TA.I (i.e. the price shown above)\n </Typography>\n }\n >\n <Typography>Use Market-TA.I for Auto-Sale Price</Typography>\n </Tooltip>\n }\n />\n </>\n\n <MarketTA2 mat={props.mat} />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Material } from \"../../Material\";\nimport { SellMaterial } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\nfunction initialPrice(mat: Material): string {\n let val = mat.sCost ? mat.sCost + \"\" : \"\";\n if (mat.marketTa2) {\n val += \" (Market-TA.II)\";\n } else if (mat.marketTa1) {\n val += \" (Market-TA.I)\";\n }\n return val;\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellMaterialModal(props: IProps): React.ReactElement {\n const [amt, setAmt] = useState<string>(props.mat.sllman[1] ? props.mat.sllman[1] + \"\" : \"\");\n const [price, setPrice] = useState<string>(initialPrice(props.mat));\n\n function sellMaterial(): void {\n try {\n SellMaterial(props.mat, amt, price);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onAmtChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setAmt(event.target.value);\n }\n\n function onPriceChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setPrice(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) sellMaterial();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the maximum amount of {props.mat.name} you would like to sell per second, as well as the price at which\n you would like to sell at.\n <br />\n <br />\n If the sell amount is set to 0, then the material will not be sold. If the sell price if set to 0, then the\n material will be discarded\n <br />\n <br />\n Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.\n <br />\n <br />\n When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that\n depends on your production. For example, if you set the sell amount to 'PROD-5' then you will always sell 5 less\n of the material than you produce.\n <br />\n <br />\n When setting the sell price, you can use the 'MP' variable to designate a dynamically changing price that\n depends on the market price. For example, if you set the sell price to 'MP+10' then it will always be sold at\n $10 above the market price.\n </Typography>\n <br />\n <TextField\n value={amt}\n autoFocus={true}\n type=\"text\"\n placeholder=\"Sell amount\"\n onChange={onAmtChange}\n onKeyDown={onKeyDown}\n />\n <TextField value={price} type=\"text\" placeholder=\"Sell price\" onChange={onPriceChange} onKeyDown={onKeyDown} />\n <Button onClick={sellMaterial}>Confirm</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { MaterialSizes } from \"../../MaterialSizes\";\nimport { Warehouse } from \"../../Warehouse\";\nimport { Material } from \"../../Material\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { BulkPurchase, BuyMaterial } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation, useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IBulkPurchaseTextProps {\n warehouse: Warehouse;\n mat: Material;\n amount: string;\n}\n\ninterface IBPProps {\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n}\n\nfunction BulkPurchaseSection(props: IBPProps): React.ReactElement {\n const corp = useCorporation();\n const [buyAmt, setBuyAmt] = useState(\"\");\n const [disabled, setDisabled] = useState(false);\n\n function BulkPurchaseText(props: IBulkPurchaseTextProps): React.ReactElement {\n const parsedAmt = parseFloat(props.amount);\n const cost = parsedAmt * props.mat.bCost;\n\n const matSize = MaterialSizes[props.mat.name];\n const maxAmount = (props.warehouse.size - props.warehouse.sizeUsed) / matSize;\n\n if (parsedAmt > maxAmount) {\n setDisabled(true);\n return (\n <>\n <Typography color={\"error\"}>Not enough warehouse space to purchase this amount</Typography>\n </>\n );\n } else if (isNaN(cost) || parsedAmt < 0) {\n setDisabled(true);\n return (\n <>\n <Typography color={\"error\"}>Invalid input for Bulk Purchase amount</Typography>\n </>\n );\n } else {\n setDisabled(false);\n return (\n <>\n <Typography>\n Purchasing {numeralWrapper.format(parsedAmt, \"0,0.00\")} of {props.mat.name} will cost{\" \"}\n {numeralWrapper.formatMoney(cost)}\n </Typography>\n </>\n );\n }\n }\n\n function bulkPurchase(): void {\n try {\n BulkPurchase(corp, props.warehouse, props.mat, parseFloat(buyAmt));\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) bulkPurchase();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setBuyAmt(event.target.value);\n }\n\n return (\n <>\n <Typography>\n Enter the amount of {props.mat.name} you would like to bulk purchase. This purchases the specified amount\n instantly (all at once).\n </Typography>\n <BulkPurchaseText warehouse={props.warehouse} mat={props.mat} amount={buyAmt} />\n <TextField\n value={buyAmt}\n onChange={onChange}\n type=\"number\"\n placeholder=\"Bulk Purchase amount\"\n onKeyDown={onKeyDown}\n />\n <Button disabled={disabled} onClick={bulkPurchase}>\n Confirm Bulk Purchase\n </Button>\n </>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n disablePurchaseLimit: boolean;\n}\n\n// Create a popup that lets the player purchase a Material\nexport function PurchaseMaterialModal(props: IProps): React.ReactElement {\n const division = useDivision();\n const [buyAmt, setBuyAmt] = useState(props.mat.buy ? props.mat.buy : 0);\n\n function purchaseMaterial(): void {\n if (buyAmt === null) return;\n try {\n BuyMaterial(props.mat, buyAmt);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function clearPurchase(): void {\n props.mat.buy = 0;\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) purchaseMaterial();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setBuyAmt(parseFloat(event.target.value));\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Enter the amount of {props.mat.name} you would like to purchase per second. This material's cost changes\n constantly.\n {props.disablePurchaseLimit ? \"Note: Purchase amount is disabled as smart supply is enabled\" : \"\"}\n </Typography>\n <TextField\n value={buyAmt}\n onChange={onChange}\n autoFocus={true}\n placeholder=\"Purchase amount\"\n type=\"number\"\n disabled={props.disablePurchaseLimit}\n onKeyDown={onKeyDown}\n />\n <Button disabled={props.disablePurchaseLimit} onClick={purchaseMaterial}>\n Confirm\n </Button>\n <Button disabled={props.disablePurchaseLimit} onClick={clearPurchase}>\n Clear Purchase\n </Button>\n {division.hasResearch(\"Bulk Purchasing\") && (\n <BulkPurchaseSection onClose={props.onClose} mat={props.mat} warehouse={props.warehouse} />\n )}\n </>\n </Modal>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { LimitMaterialProduction } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { Material } from \"../../Material\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n material: Material;\n}\n\n// Create a popup that lets the player limit the production of a product\nexport function LimitMaterialProductionModal(props: IProps): React.ReactElement {\n const [limit, setLimit] = useState<number | null>(null);\n\n // reset modal internal state on modal close\n useEffect(() => {\n if (!props.open) {\n setLimit(null);\n }\n }, [props.open]);\n\n function limitMaterialProduction(): void {\n let qty = limit;\n if (qty === null) qty = -1;\n LimitMaterialProduction(props.material, qty);\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) limitMaterialProduction();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setLimit(null);\n else setLimit(parseFloat(event.target.value));\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter a limit to the amount of this material you would like to produce per second. Leave the box empty to set no\n limit.\n </Typography>\n <TextField autoFocus={true} placeholder=\"Limit\" type=\"number\" onChange={onChange} onKeyDown={onKeyDown} />\n <Button onClick={limitMaterialProduction}>Limit production</Button>\n </Modal>\n );\n}\n","import React from \"react\";\nimport { Industry } from \"../Industry\";\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\ninterface IProps {\n division: Industry;\n}\n\nexport function IndustryProductEquation(props: IProps): React.ReactElement {\n const reqs = [];\n for (const reqMat of Object.keys(props.division.reqMats)) {\n const reqAmt = props.division.reqMats[reqMat];\n if (reqAmt === undefined) continue;\n reqs.push(String.raw`${reqAmt}\\text{ }${reqMat}`);\n }\n const prod = props.division.prodMats.map((p) => `1\\\\text{ }${p}`);\n if (props.division.makesProducts) {\n prod.push(\"Products\");\n }\n\n return <MathJaxWrapper>{\"\\\\(\" + reqs.join(\"+\") + `\\\\Rightarrow ` + prod.join(\"+\") + \"\\\\)\"}</MathJaxWrapper>;\n}\n","import React, { useState } from \"react\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { NewCity } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n cityStateSetter: (city: string) => void;\n}\n\nexport function ExpandNewCity(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const possibleCities = Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] === 0);\n const [city, setCity] = useState(possibleCities[0]);\n\n const disabled = corp.funds < CorporationConstants.OfficeInitialCost;\n\n function onCityChange(event: SelectChangeEvent<string>): void {\n setCity(event.target.value);\n }\n\n function expand(): void {\n try {\n NewCity(corp, division, city);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n dialogBoxCreate(`Opened a new office in ${city}!`);\n\n props.cityStateSetter(city);\n }\n return (\n <>\n <Typography>\n Would you like to expand into a new city by opening an office? This would cost{\" \"}\n <MoneyCost money={CorporationConstants.OfficeInitialCost} corp={corp} />\n </Typography>\n <Select\n endAdornment={\n <Button onClick={expand} disabled={disabled}>\n Confirm\n </Button>\n }\n value={city}\n onChange={onCityChange}\n >\n {possibleCities.map((cityName: string) => (\n <MenuItem key={cityName} value={cityName}>\n {cityName}\n </MenuItem>\n ))}\n </Select>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { IndustryStartingCosts, Industries, IndustryDescriptions } from \"../IndustryData\";\nimport { useCorporation } from \"./Context\";\nimport { Industry } from \"../Industry\";\nimport { NewIndustry } from \"../Actions\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Box from \"@mui/material/Box\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\ninterface IProps {\n setDivisionName: (name: string) => void;\n}\n\nexport function ExpandIndustryTab(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const allIndustries = Object.keys(Industries).sort();\n const possibleIndustries = allIndustries\n .filter(\n (industryType: string) =>\n corp.divisions.find((division: Industry) => division.type === industryType) === undefined,\n )\n .sort();\n const [industry, setIndustry] = useState(possibleIndustries.length > 0 ? possibleIndustries[0] : \"\");\n const [name, setName] = useState(\"\");\n\n const cost = IndustryStartingCosts[industry];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industry}'`);\n }\n const disabled = corp.funds < cost || name === \"\";\n\n function newIndustry(): void {\n if (disabled) return;\n try {\n NewIndustry(corp, industry, name);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n // Set routing to the new division so that the UI automatically switches to it\n props.setDivisionName(name);\n }\n\n function onNameChange(event: React.ChangeEvent<HTMLInputElement>): void {\n // [a-zA-Z0-9-_]\n setName(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) newIndustry();\n }\n\n function onIndustryChange(event: SelectChangeEvent<string>): void {\n setIndustry(event.target.value);\n }\n\n const desc = IndustryDescriptions[industry];\n if (desc === undefined) throw new Error(`Trying to create an industry that doesn't exists: '${industry}'`);\n\n return (\n <>\n <Typography>Create a new division to expand into a new industry:</Typography>\n <Select value={industry} onChange={onIndustryChange}>\n {possibleIndustries.map((industry: string) => (\n <MenuItem key={industry} value={industry}>\n {industry}\n </MenuItem>\n ))}\n </Select>\n <Typography>{desc(corp)}</Typography>\n <br />\n <br />\n\n <Typography>Division name:</Typography>\n\n <Box display=\"flex\" alignItems=\"center\">\n <TextField\n autoFocus={true}\n value={name}\n onChange={onNameChange}\n onKeyDown={onKeyDown}\n type=\"text\"\n InputProps={{\n endAdornment: (\n <Button disabled={disabled} sx={{ mx: 1 }} onClick={newIndustry}>\n Expand\n </Button>\n ),\n }}\n />\n </Box>\n </>\n );\n}\n","// React Component for displaying Corporation Overview info\nimport React, { useState } from \"react\";\nimport { LevelableUpgrade } from \"./LevelableUpgrade\";\nimport { UnlockUpgrade } from \"./UnlockUpgrade\";\nimport { BribeFactionModal } from \"./modals/BribeFactionModal\";\nimport { SellSharesModal } from \"./modals/SellSharesModal\";\nimport { BuybackSharesModal } from \"./modals/BuybackSharesModal\";\nimport { IssueDividendsModal } from \"./modals/IssueDividendsModal\";\nimport { IssueNewSharesModal } from \"./modals/IssueNewSharesModal\";\nimport { FindInvestorsModal } from \"./modals/FindInvestorsModal\";\nimport { GoPublicModal } from \"./modals/GoPublicModal\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { CorporationUnlockUpgrade, CorporationUnlockUpgrades } from \"../data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade, CorporationUpgradeIndex, CorporationUpgrades } from \"../data/CorporationUpgrades\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { Player } from \"@player\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n rerender: () => void;\n}\nexport function Overview({ rerender }: IProps): React.ReactElement {\n const corp = useCorporation();\n const profit: number = corp.revenue - corp.expenses;\n\n const multRows: string[][] = [];\n function appendMult(name: string, value: number): void {\n if (value === 1) return;\n multRows.push([name, numeralWrapper.format(value, \"0.000\")]);\n }\n appendMult(\"Production Multiplier: \", corp.getProductionMultiplier());\n appendMult(\"Storage Multiplier: \", corp.getStorageMultiplier());\n appendMult(\"Advertising Multiplier: \", corp.getAdvertisingMultiplier());\n appendMult(\"Empl. Creativity Multiplier: \", corp.getEmployeeCreMultiplier());\n appendMult(\"Empl. Charisma Multiplier: \", corp.getEmployeeChaMultiplier());\n appendMult(\"Empl. Intelligence Multiplier: \", corp.getEmployeeIntMultiplier());\n appendMult(\"Empl. Efficiency Multiplier: \", corp.getEmployeeEffMultiplier());\n appendMult(\"Sales Multiplier: \", corp.getSalesMultiplier());\n appendMult(\"Scientific Research Multiplier: \", corp.getScientificResearchMultiplier());\n\n return (\n <>\n <StatsTable\n rows={[\n [\"Total Funds:\", <Money money={corp.funds} />],\n [\"Total Revenue:\", <MoneyRate money={corp.revenue} />],\n [\"Total Expenses:\", <MoneyRate money={corp.expenses} />],\n [\"Total Profit:\", <MoneyRate money={corp.revenue - corp.expenses} />],\n [\"Publicly Traded:\", corp.public ? \"Yes\" : \"No\"],\n [\"Owned Stock Shares:\", numeralWrapper.format(corp.numShares, \"0.000a\")],\n [\"Stock Price:\", corp.public ? <Money money={corp.sharePrice} /> : \"N/A\"],\n ]}\n />\n <br />\n <Box display=\"flex\">\n <Tooltip\n title={\n <StatsTable\n rows={[\n [\"Outstanding Shares:\", numeralWrapper.format(corp.issuedShares, \"0.000a\")],\n [\n \"Private Shares:\",\n numeralWrapper.format(corp.totalShares - corp.issuedShares - corp.numShares, \"0.000a\"),\n ],\n ]}\n />\n }\n >\n <Typography>Total Stock Shares: {numeralWrapper.format(corp.totalShares, \"0.000a\")}</Typography>\n </Tooltip>\n </Box>\n <br />\n <DividendsStats profit={profit} />\n <br />\n <StatsTable rows={multRows} />\n <br />\n <BonusTime />\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"repeat(3, 1fr)\", width: \"fit-content\" }}>\n <Tooltip\n title={\n <Typography>\n Get a copy of and read 'The Complete Handbook for Creating a Successful Corporation.' This is a .lit file\n that guides you through the beginning of setting up a Corporation and provides some tips/pointers for\n helping you get started with managing it.\n </Typography>\n }\n >\n <Button onClick={() => corp.getStarterGuide()}>Getting Started Guide</Button>\n </Tooltip>\n {corp.public ? <PublicButtons rerender={rerender} /> : <PrivateButtons rerender={rerender} />}\n <BribeButton />\n </Box>\n <br />\n <Upgrades rerender={rerender} />\n </>\n );\n}\n\ninterface IPrivateButtonsProps {\n rerender: () => void;\n}\n// Render the buttons for when your Corporation is still private\nfunction PrivateButtons({ rerender }: IPrivateButtonsProps): React.ReactElement {\n const corp = useCorporation();\n const [findInvestorsopen, setFindInvestorsopen] = useState(false);\n const [goPublicopen, setGoPublicopen] = useState(false);\n\n const fundingAvailable = corp.fundingRound < 4;\n const findInvestorsTooltip = fundingAvailable\n ? \"Search for private investors who will give you startup funding in exchange for equity (stock shares) in your company\"\n : \"\";\n\n return (\n <>\n <Tooltip title={<Typography>{findInvestorsTooltip}</Typography>}>\n <Button disabled={!fundingAvailable} onClick={() => setFindInvestorsopen(true)}>\n Find Investors\n </Button>\n </Tooltip>\n <Tooltip\n title={\n <Typography>\n Become a publicly traded and owned entity. Going public involves issuing shares for an IPO. Once you are a\n public company, your shares will be traded on the stock market.\n </Typography>\n }\n >\n <Button onClick={() => setGoPublicopen(true)}>Go Public</Button>\n </Tooltip>\n <FindInvestorsModal open={findInvestorsopen} onClose={() => setFindInvestorsopen(false)} rerender={rerender} />\n <GoPublicModal open={goPublicopen} onClose={() => setGoPublicopen(false)} rerender={rerender} />\n </>\n );\n}\n\ninterface IUpgradeProps {\n rerender: () => void;\n}\n// Render the UI for Corporation upgrades\nfunction Upgrades({ rerender }: IUpgradeProps): React.ReactElement {\n const corp = useCorporation();\n // Don't show upgrades\n if (corp.divisions.length <= 0) {\n return <Typography variant=\"h4\">Upgrades are unlocked once you create an industry.</Typography>;\n }\n\n return (\n <>\n <Paper sx={{ p: 1, my: 1 }}>\n <Typography variant=\"h4\">Unlocks</Typography>\n <Grid container>\n {Object.values(CorporationUnlockUpgrades)\n .filter((upgrade: CorporationUnlockUpgrade) => !corp.unlockUpgrades[upgrade.index])\n .map((upgrade: CorporationUnlockUpgrade) => (\n <UnlockUpgrade rerender={rerender} upgradeData={upgrade} key={upgrade.index} />\n ))}\n </Grid>\n </Paper>\n <Paper sx={{ p: 1, my: 1 }}>\n <Typography variant=\"h4\">Upgrades</Typography>\n <Grid container>\n {corp.upgrades\n .map((level: number, i: number) => CorporationUpgrades[i as CorporationUpgradeIndex])\n .map((upgrade: CorporationUpgrade) => (\n <LevelableUpgrade rerender={rerender} upgrade={upgrade} key={upgrade.index} />\n ))}\n </Grid>\n </Paper>\n </>\n );\n}\n\ninterface IPublicButtonsProps {\n rerender: () => void;\n}\n\n// Render the buttons for when your Corporation has gone public\nfunction PublicButtons({ rerender }: IPublicButtonsProps): React.ReactElement {\n const corp = useCorporation();\n const [sellSharesOpen, setSellSharesOpen] = useState(false);\n const [buybackSharesOpen, setBuybackSharesOpen] = useState(false);\n const [issueNewSharesOpen, setIssueNewSharesOpen] = useState(false);\n const [issueDividendsOpen, setIssueDividendsOpen] = useState(false);\n\n const sellSharesOnCd = corp.shareSaleCooldown > 0;\n const sellSharesTooltip = sellSharesOnCd\n ? \"Cannot sell shares for \" + corp.convertCooldownToString(corp.shareSaleCooldown)\n : \"Sell your shares in the company. The money earned from selling your \" +\n \"shares goes into your personal account, not the Corporation's. \" +\n \"This is one of the only ways to profit from your business venture.\";\n\n const issueNewSharesOnCd = corp.issueNewSharesCooldown > 0;\n const issueNewSharesTooltip = issueNewSharesOnCd\n ? \"Cannot issue new shares for \" + corp.convertCooldownToString(corp.issueNewSharesCooldown)\n : \"Issue new equity shares to raise capital.\";\n\n return (\n <>\n <Tooltip title={<Typography>{sellSharesTooltip}</Typography>}>\n <Button disabled={sellSharesOnCd} onClick={() => setSellSharesOpen(true)}>\n Sell Shares\n </Button>\n </Tooltip>\n <SellSharesModal open={sellSharesOpen} onClose={() => setSellSharesOpen(false)} rerender={rerender} />\n <Tooltip title={<Typography>Buy back shares you that previously issued or sold at market price.</Typography>}>\n <Button disabled={corp.issuedShares < 1} onClick={() => setBuybackSharesOpen(true)}>\n Buyback shares\n </Button>\n </Tooltip>\n <BuybackSharesModal open={buybackSharesOpen} onClose={() => setBuybackSharesOpen(false)} rerender={rerender} />\n <Tooltip title={<Typography>{issueNewSharesTooltip}</Typography>}>\n <Button disabled={issueNewSharesOnCd} onClick={() => setIssueNewSharesOpen(true)}>\n Issue New Shares\n </Button>\n </Tooltip>\n <IssueNewSharesModal open={issueNewSharesOpen} onClose={() => setIssueNewSharesOpen(false)} />\n <Tooltip\n title={<Typography>Manage the dividends that are paid out to shareholders (including yourself)</Typography>}\n >\n <Button onClick={() => setIssueDividendsOpen(true)}>Issue Dividends</Button>\n </Tooltip>\n <IssueDividendsModal open={issueDividendsOpen} onClose={() => setIssueDividendsOpen(false)} />\n </>\n );\n}\n\nfunction BribeButton(): React.ReactElement {\n const corp = useCorporation();\n const [open, setOpen] = useState(false);\n const canBribe =\n corp.valuation >= CorporationConstants.BribeThreshold &&\n Player.factions.filter((f) => Factions[f].getInfo().offersWork()).length > 0;\n\n function openBribe(): void {\n if (!canBribe) return;\n setOpen(true);\n }\n\n return (\n <>\n <Tooltip\n title={\n canBribe\n ? \"Use your Corporations power and influence to bribe Faction leaders in exchange for reputation\"\n : \"Your Corporation is not powerful enough to bribe Faction leaders\"\n }\n >\n <Button disabled={!canBribe} onClick={openBribe}>\n Bribe Factions\n </Button>\n </Tooltip>\n <BribeFactionModal open={open} onClose={() => setOpen(false)} />\n </>\n );\n}\n\ninterface IDividendsStatsProps {\n profit: number;\n}\nfunction DividendsStats({ profit }: IDividendsStatsProps): React.ReactElement {\n const corp = useCorporation();\n if (corp.dividendRate <= 0 || profit <= 0) return <></>;\n const totalDividends = corp.dividendRate * profit;\n const retainedEarnings = profit - totalDividends;\n const dividendsPerShare = totalDividends / corp.totalShares;\n const playerEarnings = corp.getCycleDividends() / CorporationConstants.SecsPerMarketCycle;\n return (\n <StatsTable\n rows={[\n [\"Retained Profits (after dividends):\", <MoneyRate money={retainedEarnings} />],\n [\"Dividend Percentage:\", numeralWrapper.format(corp.dividendRate, \"0%\")],\n [\"Dividends per share:\", <MoneyRate money={dividendsPerShare} />],\n [\"Your earnings as a shareholder:\", <MoneyRate money={playerEarnings} />],\n ]}\n />\n );\n}\n\n// Returns a string with general information about Corporation\nfunction BonusTime(): React.ReactElement {\n const corp = useCorporation();\n const storedTime = corp.storedCycles * CONSTANTS.MilliPerCycle;\n if (storedTime <= 15000) return <></>;\n return (\n <Typography>\n Bonus time: {convertTimeMsToTimeElapsedString(storedTime)}\n <br />\n <br />\n </Typography>\n );\n}\n","// React components for the levelable upgrade buttons on the overview panel\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CorporationUpgrade } from \"../data/CorporationUpgrades\";\nimport { LevelUpgrade } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n upgrade: CorporationUpgrade;\n rerender: () => void;\n}\n\nexport function LevelableUpgrade(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const data = props.upgrade;\n const level = corp.upgrades[data.index];\n\n const baseCost = data.basePrice;\n const priceMult = data.priceMult;\n const cost = baseCost * Math.pow(priceMult, level);\n\n const tooltip = data.desc;\n function onClick(): void {\n if (corp.funds < cost) return;\n try {\n LevelUpgrade(corp, props.upgrade);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n <Grid item xs={4}>\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row-reverse\">\n <Button disabled={corp.funds < cost} sx={{ mx: 1 }} onClick={onClick}>\n <MoneyCost money={cost} corp={corp} />\n </Button>\n <Tooltip title={tooltip}>\n <Typography>\n {data.name} - lvl {level}\n </Typography>\n </Tooltip>\n </Box>\n </Grid>\n );\n}\n","// React Components for the Unlock upgrade buttons on the overview page\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CorporationUnlockUpgrade } from \"../data/CorporationUnlockUpgrades\";\nimport { useCorporation } from \"./Context\";\nimport { UnlockUpgrade as UU } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n upgradeData: CorporationUnlockUpgrade;\n rerender: () => void;\n}\n\nexport function UnlockUpgrade(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const data = props.upgradeData;\n const tooltip = data.desc;\n function onClick(): void {\n if (corp.funds < data.price) return;\n try {\n UU(corp, props.upgradeData);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n <Grid item xs={4}>\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row-reverse\">\n <Button disabled={corp.funds < data.price} sx={{ mx: 1 }} onClick={onClick}>\n <MoneyCost money={data.price} corp={corp} />\n </Button>\n <Tooltip title={tooltip}>\n <Typography>{data.name}</Typography>\n </Tooltip>\n </Box>\n </Grid>\n );\n}\n","import React, { useState } from \"react\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { Player } from \"@player\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport Box from \"@mui/material/Box\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function BribeFactionModal(props: IProps): React.ReactElement {\n const factions = Player.factions.filter((name: string) => {\n const info = Factions[name].getInfo();\n if (!info.offersWork()) return false;\n if (Player.hasGangWith(name)) return false;\n return true;\n });\n const corp = useCorporation();\n const [money, setMoney] = useState<number>(NaN);\n const [selectedFaction, setSelectedFaction] = useState(factions.length > 0 ? factions[0] : \"\");\n const disabled = money === 0 || isNaN(money) || money < 0 || corp.funds < money;\n\n function changeFaction(event: SelectChangeEvent<string>): void {\n setSelectedFaction(event.target.value);\n }\n\n function repGain(money: number): number {\n return money / CorporationConstants.BribeToRepRatio;\n }\n\n function getRepText(money: number): string {\n if (money === 0) return \"\";\n if (isNaN(money) || money < 0) {\n return \"ERROR: Invalid value(s) entered\";\n } else if (corp.funds < money) {\n return \"ERROR: You do not have this much money to bribe with\";\n } else {\n return (\n \"You will gain \" +\n numeralWrapper.formatReputation(repGain(money)) +\n \" reputation with \" +\n selectedFaction +\n \" with this bribe\"\n );\n }\n }\n\n function bribe(money: number): void {\n const fac = Factions[selectedFaction];\n if (disabled) return;\n const rep = repGain(money);\n dialogBoxCreate(`You gained ${numeralWrapper.formatReputation(rep)} reputation with ${fac.name} by bribing them.`);\n fac.playerReputation += rep;\n corp.funds = corp.funds - money;\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation.\n </Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>Faction:</Typography>\n <Select value={selectedFaction} onChange={changeFaction}>\n {factions.map((name: string) => {\n const info = Factions[name].getInfo();\n if (!info.offersWork()) return;\n if (Player.hasGangWith(name)) return;\n return (\n <MenuItem key={name} value={name}>\n {name}\n </MenuItem>\n );\n })}\n </Select>\n </Box>\n <Typography>{getRepText(money ? money : 0)}</Typography>\n <NumberInput onChange={setMoney} placeholder=\"Corporation funds\" />\n <Button disabled={disabled} sx={{ mx: 1 }} onClick={() => bribe(money ? money : 0)}>\n Bribe\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\nimport { Corporation } from \"../../Corporation\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { SellShares } from \"../../Actions\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player sell Corporation shares\n// This is created when the player clicks the \"Sell Shares\" button in the overview panel\nexport function SellSharesModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState<number>(NaN);\n\n const disabled = isNaN(shares) || shares <= 0 || shares > corp.numShares;\n\n function ProfitIndicator(props: { shares: number | null; corp: Corporation }): React.ReactElement {\n if (props.shares === null) return <></>;\n let text = \"\";\n if (isNaN(props.shares) || props.shares <= 0) {\n text = `ERROR: Invalid value entered for number of shares to sell`;\n } else if (props.shares > corp.numShares) {\n text = `You don't have this many shares to sell!`;\n } else {\n const stockSaleResults = corp.calculateShareSale(props.shares);\n const profit = stockSaleResults[0];\n text = `Sell ${props.shares} shares for a total of ${numeralWrapper.formatMoney(profit)}`;\n }\n\n return (\n <Typography>\n <small>{text}</small>\n </Typography>\n );\n }\n\n function sell(): void {\n if (disabled) return;\n try {\n const profit = SellShares(corp, shares);\n props.onClose();\n dialogBoxCreate(\n <>\n Sold {numeralWrapper.formatMoney(shares)} shares for\n <Money money={profit} />. The corporation's stock price fell to <Money money={corp.sharePrice} />\n as a result of dilution.\n </>,\n );\n\n props.rerender();\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) sell();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the number of shares you would like to sell. The money from selling your shares will go directly to you\n (NOT your Corporation).\n <br />\n <br />\n Selling your shares will cause your corporation's stock price to fall due to dilution. Furthermore, selling a\n large number of shares all at once will have an immediate effect in reducing your stock price.\n <br />\n <br />\n The current price of your company's stock is {numeralWrapper.formatMoney(corp.sharePrice)}\n </Typography>\n <br />\n <NumberInput\n variant=\"standard\"\n autoFocus\n placeholder=\"Shares to sell\"\n onChange={setShares}\n onKeyDown={onKeyDown}\n />\n <Button disabled={disabled} onClick={sell} sx={{ mx: 1 }}>\n Sell shares\n </Button>\n <ProfitIndicator shares={shares} corp={corp} />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Player } from \"@player\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport { BuyBackShares } from \"../../Actions\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player buyback shares\n// This is created when the player clicks the \"Buyback Shares\" button in the overview panel\nexport function BuybackSharesModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState<number>(NaN);\n\n const currentStockPrice = corp.sharePrice;\n const buybackPrice = currentStockPrice * 1.1;\n const disabled =\n shares === null ||\n isNaN(shares) ||\n shares <= 0 ||\n shares > corp.issuedShares ||\n shares * buybackPrice > Player.money;\n\n function buy(): void {\n if (disabled) return;\n try {\n BuyBackShares(corp, shares);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n props.rerender();\n }\n\n function CostIndicator(): React.ReactElement {\n if (shares === null) return <></>;\n if (isNaN(shares) || shares <= 0) {\n return <>ERROR: Invalid value entered for number of shares to buyback</>;\n } else if (shares > corp.issuedShares) {\n return (\n <>\n There are not this many shares available to buy back. There are only{\" \"}\n {numeralWrapper.formatBigNumber(corp.issuedShares)} outstanding shares.\n </>\n );\n } else {\n return (\n <>\n Purchase {shares} shares for a total of {numeralWrapper.formatMoney(shares * buybackPrice)}\n </>\n );\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) buy();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the number of outstanding shares you would like to buy back. These shares must be bought at a 10% premium.\n However, repurchasing shares from the market tends to lead to an increase in stock price.\n <br />\n <br />\n To purchase these shares, you must use your own money (NOT your Corporation's funds).\n <br />\n <br />\n The current buyback price of your company's stock is {numeralWrapper.formatMoney(buybackPrice)}. Your company\n currently has {numeralWrapper.formatBigNumber(corp.issuedShares)} outstanding stock shares.\n </Typography>\n <CostIndicator />\n <br />\n <NumberInput autoFocus={true} placeholder=\"Shares to buyback\" onChange={setShares} onKeyDown={onKeyDown} />\n <Button disabled={disabled} onClick={buy}>\n Buy shares\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { IssueDividends } from \"../../Actions\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Create a popup that lets the player issue & manage dividends\n// This is created when the player clicks the \"Issue Dividends\" button in the overview panel\nexport function IssueDividendsModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [percent, setPercent] = useState(0);\n\n const canIssue = !isNaN(percent) && percent >= 0 && percent <= CorporationConstants.DividendMaxRate * 100;\n function issueDividends(): void {\n if (!canIssue) return;\n if (percent === null) return;\n try {\n IssueDividends(corp, percent / 100);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) issueDividends();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setPercent(0);\n else {\n let p = parseFloat(event.target.value);\n if (p > 100) p = 100;\n if (p < 0) p = 0;\n setPercent(p);\n }\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Dividends are a distribution of a portion of the corporation's profits to the shareholders. This includes\n yourself, as well.\n <br />\n <br />\n In order to issue dividends, simply allocate some percentage of your corporation's profits to dividends. This\n percentage must be an integer between 0 and 100. (A percentage of 0 means no dividends will be issued)\n <br />\n <br />\n Two important things to note:\n <br />\n * Issuing dividends will negatively affect your corporation's stock price\n <br />\n <br />\n Example: Assume your corporation makes $100m / sec in profit and you allocate 40% of that towards dividends.\n That means your corporation will gain $60m / sec in funds and the remaining $40m / sec will be paid as\n dividends. Since your corporation starts with 1 billion shares, every shareholder will be paid $0.04 per share\n per second before taxes.\n </Typography>\n <TextField\n autoFocus\n value={percent}\n onChange={onChange}\n onKeyDown={onKeyDown}\n placeholder=\"Dividend %\"\n type=\"number\"\n />\n <Button disabled={!canIssue} sx={{ mx: 1 }} onClick={issueDividends}>\n Allocate Dividend Percentage\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { getRandomInt } from \"../../../utils/helpers/getRandomInt\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IEffectTextProps {\n shares: number | null;\n}\n\nfunction EffectText(props: IEffectTextProps): React.ReactElement {\n const corp = useCorporation();\n if (props.shares === null) return <></>;\n const newSharePrice = Math.round(corp.sharePrice * 0.9);\n const maxNewSharesUnrounded = Math.round(corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n let newShares = props.shares;\n if (isNaN(newShares)) {\n return <Typography>Invalid input</Typography>;\n }\n\n // Round to nearest ten-millionth\n newShares /= 10e6;\n newShares = Math.round(newShares) * 10e6;\n\n if (newShares < 10e6) {\n return <Typography>Must issue at least 10 million new shares</Typography>;\n }\n\n if (newShares > maxNewShares) {\n return <Typography>You cannot issue that many shares</Typography>;\n }\n\n return (\n <Typography>\n Issue {numeralWrapper.format(newShares, \"0.000a\")} new shares for{\" \"}\n {numeralWrapper.formatMoney(newShares * newSharePrice)}?\n </Typography>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Create a popup that lets the player issue new shares\n// This is created when the player clicks the \"Issue New Shares\" buttons in the overview panel\nexport function IssueNewSharesModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState<number>(NaN);\n const maxNewSharesUnrounded = Math.round(corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n\n const newShares = Math.round((shares || 0) / 10e6) * 10e6;\n const disabled = isNaN(shares) || isNaN(newShares) || newShares < 10e6 || newShares > maxNewShares;\n\n function issueNewShares(): void {\n if (isNaN(shares)) return;\n if (disabled) return;\n\n const newSharePrice = Math.round(corp.sharePrice * 0.9);\n let newShares = shares;\n\n // Round to nearest ten-millionth\n newShares = Math.round(newShares / 10e6) * 10e6;\n\n const profit = newShares * newSharePrice;\n corp.issueNewSharesCooldown = CorporationConstants.IssueNewSharesCooldown;\n\n // Determine how many are bought by private investors\n // If private investors own n% of the company, private investors get up to 0.5n% at most\n // Round # of private shares to the nearest million\n const privateOwnedRatio = 1 - (corp.numShares + corp.issuedShares) / corp.totalShares;\n const maxPrivateShares = Math.round((newShares / 2) * privateOwnedRatio);\n const privateShares = Math.round(getRandomInt(0, maxPrivateShares) / 1e6) * 1e6;\n\n corp.issuedShares += newShares - privateShares;\n corp.totalShares += newShares;\n corp.funds = corp.funds + profit;\n corp.immediatelyUpdateSharePrice();\n props.onClose();\n\n let dialogContents =\n `Issued ${numeralWrapper.format(newShares, \"0.000a\")} new shares` +\n ` and raised ${numeralWrapper.formatMoney(profit)}.` +\n (privateShares > 0)\n ? \"\\n\" + numeralWrapper.format(privateShares, \"0.000a\") + \"of these shares were bought by private investors.\"\n : \"\";\n dialogContents += `\\n\\nStock price decreased to ${numeralWrapper.formatMoney(corp.sharePrice)}`;\n dialogBoxCreate(dialogContents);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) issueNewShares();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n You can issue new equity shares (i.e. stocks) in order to raise capital for your corporation.\n <br />\n <br />\n * You can issue at most {numeralWrapper.format(maxNewShares, \"0.000a\")} new shares\n <br />\n * New shares are sold at a 10% discount\n <br />\n * You can only issue new shares once every 12 hours\n <br />\n * Issuing new shares causes dilution, resulting in a decrease in stock price and lower dividends per share\n <br />\n * Number of new shares issued must be a multiple of 10 million\n <br />\n <br />\n When you choose to issue new equity, private shareholders have first priority for up to 0.5n% of the new shares,\n where n is the percentage of the company currently owned by private shareholders. If they choose to exercise\n this option, these newly issued shares become private, restricted shares, which means you cannot buy them back.\n </Typography>\n <EffectText shares={shares} />\n <NumberInput autoFocus placeholder=\"# New Shares\" onChange={setShares} onKeyDown={onKeyDown} />\n <Button disabled={disabled} onClick={issueNewShares} sx={{ mx: 1 }}>\n Issue New Shares\n </Button>\n </Modal>\n );\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function FindInvestorsModal(props: IProps): React.ReactElement {\n const corporation = useCorporation();\n const val = corporation.valuation;\n if (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length\n )\n return <></>;\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n\n function findInvestors(): void {\n corporation.fundingRound++;\n corporation.addFunds(funding);\n corporation.numShares -= investShares;\n props.rerender();\n props.onClose();\n }\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n An investment firm has offered you {numeralWrapper.formatMoney(funding)} in funding in exchange for a{\" \"}\n {numeralWrapper.format(percShares * 100, \"0.000a\")}% stake in the company (\n {numeralWrapper.format(investShares, \"0.000a\")} shares).\n <br />\n <br />\n Do you accept or reject this offer?\n <br />\n <br />\n Hint: Investment firms will offer more money if your corporation is turning a profit\n </Typography>\n <Button onClick={findInvestors}>Accept</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport Box from \"@mui/material/Box\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function GoPublicModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState<number>(NaN);\n const initialSharePrice = corp.valuation / corp.totalShares;\n\n function goPublic(): void {\n const initialSharePrice = corp.valuation / corp.totalShares;\n if (isNaN(shares)) {\n dialogBoxCreate(\"Invalid value for number of issued shares\");\n return;\n }\n if (shares > corp.numShares) {\n dialogBoxCreate(\"Error: You don't have that many shares to issue!\");\n return;\n }\n corp.public = true;\n corp.sharePrice = initialSharePrice;\n corp.issuedShares = shares;\n corp.numShares -= shares;\n corp.addFunds(shares * initialSharePrice);\n props.rerender();\n dialogBoxCreate(\n `You took your ${corp.name} public and earned ` +\n `${numeralWrapper.formatMoney(shares * initialSharePrice)} in your IPO`,\n );\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) goPublic();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the number of shares you would like to issue for your IPO. These shares will be publicly sold and you will\n no longer own them. Your Corporation will receive {numeralWrapper.formatMoney(initialSharePrice)} per share (the\n IPO money will be deposited directly into your Corporation's funds).\n <br />\n <br />\n You have a total of {numeralWrapper.format(corp.numShares, \"0.000a\")} of shares that you can issue.\n </Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <NumberInput onChange={setShares} autoFocus placeholder=\"Shares to issue\" onKeyDown={onKeyDown} />\n <Button disabled={shares < 0 || shares > corp.numShares} sx={{ mx: 1 }} onClick={goPublic}>\n Go Public\n </Button>\n </Box>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Location } from \"../../Locations/Location\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { calculateDifficulty, calculateReward } from \"../formulas/game\";\nimport { Game } from \"./Game\";\nimport { Intro } from \"./Intro\";\ninterface IProps {\n location: Location;\n}\n\nexport function InfiltrationRoot(props: IProps): React.ReactElement {\n const [start, setStart] = useState(false);\n\n if (props.location.infiltrationData === undefined) throw new Error(\"Trying to do infiltration on invalid location.\");\n const startingSecurityLevel = props.location.infiltrationData.startingSecurityLevel;\n const difficulty = calculateDifficulty(startingSecurityLevel);\n const reward = calculateReward(startingSecurityLevel);\n\n function cancel(): void {\n Router.toCity();\n }\n\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", height: \"calc(100vh - 16px)\" }}>\n {start ? (\n <Game\n StartingDifficulty={startingSecurityLevel}\n Difficulty={difficulty}\n Reward={reward}\n MaxLevel={props.location.infiltrationData.maxClearanceLevel}\n />\n ) : (\n <Intro\n Location={props.location}\n Difficulty={difficulty}\n MaxLevel={props.location.infiltrationData.maxClearanceLevel}\n start={() => setStart(true)}\n cancel={cancel}\n />\n )}\n </div>\n );\n}\n","import { Button, Container, Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { Player } from \"@player\";\nimport { BackwardGame } from \"./BackwardGame\";\nimport { BracketGame } from \"./BracketGame\";\nimport { BribeGame } from \"./BribeGame\";\nimport { CheatCodeGame } from \"./CheatCodeGame\";\nimport { Countdown } from \"./Countdown\";\nimport { Cyberpunk2077Game } from \"./Cyberpunk2077Game\";\nimport { MinesweeperGame } from \"./MinesweeperGame\";\nimport { SlashGame } from \"./SlashGame\";\nimport { Victory } from \"./Victory\";\nimport { WireCuttingGame } from \"./WireCuttingGame\";\n\ninterface IProps {\n StartingDifficulty: number;\n Difficulty: number;\n Reward: number;\n MaxLevel: number;\n}\n\nenum Stage {\n Countdown = 0,\n Minigame,\n Result,\n Sell,\n}\n\nconst minigames = [\n SlashGame,\n BracketGame,\n BackwardGame,\n BribeGame,\n CheatCodeGame,\n Cyberpunk2077Game,\n MinesweeperGame,\n WireCuttingGame,\n];\n\nexport function Game(props: IProps): React.ReactElement {\n const [level, setLevel] = useState(1);\n const [stage, setStage] = useState(Stage.Countdown);\n const [results, setResults] = useState(\"\");\n const [gameIds, setGameIds] = useState({\n lastGames: [-1, -1],\n id: Math.floor(Math.random() * minigames.length),\n });\n\n function nextGameId(): number {\n let id = gameIds.lastGames[0];\n const ids = [gameIds.lastGames[0], gameIds.lastGames[1], gameIds.id];\n while (ids.includes(id)) {\n id = Math.floor(Math.random() * minigames.length);\n }\n return id;\n }\n\n function setupNextGame(): void {\n setGameIds({\n lastGames: [gameIds.lastGames[1], gameIds.id],\n id: nextGameId(),\n });\n }\n\n function success(): void {\n pushResult(true);\n if (level === props.MaxLevel) {\n setStage(Stage.Sell);\n } else {\n setStage(Stage.Countdown);\n setLevel(level + 1);\n }\n setupNextGame();\n }\n\n function pushResult(win: boolean): void {\n setResults((old) => {\n let next = old;\n next += win ? \"✓\" : \"✗\";\n if (next.length > 15) next = next.slice(1);\n return next;\n });\n }\n\n function failure(options?: { automated: boolean }): void {\n setStage(Stage.Countdown);\n pushResult(false);\n // Kill the player immediately if they use automation, so\n // it's clear they're not meant to\n const damage = options?.automated\n ? Player.hp.current\n : props.StartingDifficulty * 3 * (Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 0.5 : 1);\n if (Player.takeDamage(damage)) {\n Router.toCity();\n return;\n }\n setupNextGame();\n }\n\n function cancel(): void {\n Router.toCity();\n return;\n }\n\n let stageComponent: React.ReactNode;\n switch (stage) {\n case Stage.Countdown:\n stageComponent = <Countdown onFinish={() => setStage(Stage.Minigame)} />;\n break;\n case Stage.Minigame: {\n const MiniGame = minigames[gameIds.id];\n stageComponent = <MiniGame onSuccess={success} onFailure={failure} difficulty={props.Difficulty + level / 50} />;\n break;\n }\n case Stage.Sell:\n stageComponent = (\n <Victory\n StartingDifficulty={props.StartingDifficulty}\n Difficulty={props.Difficulty}\n Reward={props.Reward}\n MaxLevel={props.MaxLevel}\n />\n );\n break;\n }\n\n function Progress(): React.ReactElement {\n return (\n <Typography variant=\"h4\">\n <span style={{ color: \"gray\" }}>{results.slice(0, results.length - 1)}</span>\n {results[results.length - 1]}\n </Typography>\n );\n }\n\n return (\n <Container>\n <Paper sx={{ p: 1, mb: 1, display: \"grid\", justifyItems: \"center\", gap: 1 }}>\n {stage !== Stage.Sell && (\n <Button sx={{ width: \"100%\" }} onClick={cancel}>\n Cancel Infiltration\n </Button>\n )}\n <Typography variant=\"h5\">\n Level {level} / {props.MaxLevel}\n </Typography>\n <Progress />\n </Paper>\n\n {stageComponent}\n </Container>\n );\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"@player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 16000, min: 3, max: 4 },\n Normal: { timer: 12500, min: 2, max: 3 },\n Hard: { timer: 15000, min: 3, max: 4 },\n Impossible: { timer: 8000, min: 4, max: 4 },\n};\n\nexport function BackwardGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [answer] = useState(makeAnswer(difficulty));\n const [guess, setGuess] = useState(\"\");\n const hasAugment = Player.hasAugmentation(AugmentationNames.ChaosOfDionysus, true);\n\n function ignorableKeyboardEvent(event: KeyboardEvent): boolean {\n return event.key === KEY.BACKSPACE || (event.shiftKey && event.key === \"Shift\") || event.ctrlKey || event.altKey;\n }\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (ignorableKeyboardEvent(event)) return;\n const nextGuess = guess + event.key.toUpperCase();\n if (!answer.startsWith(nextGuess)) props.onFailure();\n else if (answer === nextGuess) props.onSuccess();\n else setGuess(nextGuess);\n }\n\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\", pb: 1 }}>\n <Typography variant=\"h4\">Type it{!hasAugment ? \" backward\" : \"\"}</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n <Typography style={{ transform: hasAugment ? \"none\" : \"scaleX(-1)\" }}>{answer}</Typography>\n <Typography>\n {guess}\n <BlinkingCursor />\n </Typography>\n </Paper>\n </>\n );\n}\n\nfunction makeAnswer(difficulty: Difficulty): string {\n const length = random(difficulty.min, difficulty.max);\n let answer = \"\";\n for (let i = 0; i < length; i++) {\n if (i > 0) answer += \" \";\n answer += words[Math.floor(Math.random() * words.length)];\n }\n\n return answer;\n}\n\nconst words = [\n \"ALGORITHM\",\n \"ANALOG\",\n \"APP\",\n \"APPLICATION\",\n \"ARRAY\",\n \"BACKUP\",\n \"BANDWIDTH\",\n \"BINARY\",\n \"BIT\",\n \"BITE\",\n \"BITMAP\",\n \"BLOG\",\n \"BLOGGER\",\n \"BOOKMARK\",\n \"BOOT\",\n \"BROADBAND\",\n \"BROWSER\",\n \"BUFFER\",\n \"BUG\",\n \"BUS\",\n \"BYTE\",\n \"CACHE\",\n \"CAPS LOCK\",\n \"CAPTCHA\",\n \"CD\",\n \"CD-ROM\",\n \"CLIENT\",\n \"CLIPBOARD\",\n \"CLOUD\",\n \"COMPUTING\",\n \"COMMAND\",\n \"COMPILE\",\n \"COMPRESS\",\n \"COMPUTER\",\n \"CONFIGURE\",\n \"COOKIE\",\n \"COPY\",\n \"CPU\",\n \"CYBERCRIME\",\n \"CYBERSPACE\",\n \"DASHBOARD\",\n \"DATA\",\n \"MINING\",\n \"DATABASE\",\n \"DEBUG\",\n \"DECOMPRESS\",\n \"DELETE\",\n \"DESKTOP\",\n \"DEVELOPMENT\",\n \"DIGITAL\",\n \"DISK\",\n \"DNS\",\n \"DOCUMENT\",\n \"DOMAIN\",\n \"DOMAIN NAME\",\n \"DOT\",\n \"DOT MATRIX\",\n \"DOWNLOAD\",\n \"DRAG\",\n \"DVD\",\n \"DYNAMIC\",\n \"EMAIL\",\n \"EMOTICON\",\n \"ENCRYPT\",\n \"ENCRYPTION\",\n \"ENTER\",\n \"EXABYTE\",\n \"FAQ\",\n \"FILE\",\n \"FINDER\",\n \"FIREWALL\",\n \"FIRMWARE\",\n \"FLAMING\",\n \"FLASH\",\n \"FLASH DRIVE\",\n \"FLOPPY DISK\",\n \"FLOWCHART\",\n \"FOLDER\",\n \"FONT\",\n \"FORMAT\",\n \"FRAME\",\n \"FREEWARE\",\n \"GIGABYTE\",\n \"GRAPHICS\",\n \"HACK\",\n \"HACKER\",\n \"HARDWARE\",\n \"HOME PAGE\",\n \"HOST\",\n \"HTML\",\n \"HYPERLINK\",\n \"HYPERTEXT\",\n \"ICON\",\n \"INBOX\",\n \"INTEGER\",\n \"INTERFACE\",\n \"INTERNET\",\n \"IP ADDRESS\",\n \"ITERATION\",\n \"JAVA\",\n \"JOYSTICK\",\n \"JUNKMAIL\",\n \"KERNEL\",\n \"KEY\",\n \"KEYBOARD\",\n \"KEYWORD\",\n \"LAPTOP\",\n \"LASER PRINTER\",\n \"LINK\",\n \"LINUX\",\n \"LOG OUT\",\n \"LOGIC\",\n \"LOGIN\",\n \"LURKING\",\n \"MACINTOSH\",\n \"MACRO\",\n \"MAINFRAME\",\n \"MALWARE\",\n \"MEDIA\",\n \"MEMORY\",\n \"MIRROR\",\n \"MODEM\",\n \"MONITOR\",\n \"MOTHERBOARD\",\n \"MOUSE\",\n \"MULTIMEDIA\",\n \"NET\",\n \"NETWORK\",\n \"NODE\",\n \"NOTEBOOK\",\n \"COMPUTER\",\n \"OFFLINE\",\n \"ONLINE\",\n \"OPENSOURCE\",\n \"OPERATING\",\n \"SYSTEM\",\n \"OPTION\",\n \"OUTPUT\",\n \"PAGE\",\n \"PASSWORD\",\n \"PASTE\",\n \"PATH\",\n \"PHISHING\",\n \"PIRACY\",\n \"PIRATE\",\n \"PLATFORM\",\n \"PLUGIN\",\n \"PODCAST\",\n \"POPUP\",\n \"PORTAL\",\n \"PRINT\",\n \"PRINTER\",\n \"PRIVACY\",\n \"PROCESS\",\n \"PROGRAM\",\n \"PROGRAMMER\",\n \"PROTOCOL\",\n \"QUEUE\",\n \"QWERTY\",\n \"RAM\",\n \"REALTIME\",\n \"REBOOT\",\n \"RESOLUTION\",\n \"RESTORE\",\n \"ROM\",\n \"ROOT\",\n \"ROUTER\",\n \"RUNTIME\",\n \"SAVE\",\n \"SCAN\",\n \"SCANNER\",\n \"SCREEN\",\n \"SCREENSHOT\",\n \"SCRIPT\",\n \"SCROLL\",\n \"SCROLL\",\n \"SEARCH\",\n \"ENGINE\",\n \"SECURITY\",\n \"SERVER\",\n \"SHAREWARE\",\n \"SHELL\",\n \"SHIFT\",\n \"SHIFT KEY\",\n \"SNAPSHOT\",\n \"SOCIAL NETWORKING\",\n \"SOFTWARE\",\n \"SPAM\",\n \"SPAMMER\",\n \"SPREADSHEET\",\n \"SPYWARE\",\n \"STATUS\",\n \"STORAGE\",\n \"SUPERCOMPUTER\",\n \"SURF\",\n \"SYNTAX\",\n \"TABLE\",\n \"TAG\",\n \"TERMINAL\",\n \"TEMPLATE\",\n \"TERABYTE\",\n \"TEXT EDITOR\",\n \"THREAD\",\n \"TOOLBAR\",\n \"TRASH\",\n \"TROJAN HORSE\",\n \"TYPEFACE\",\n \"UNDO\",\n \"UNIX\",\n \"UPLOAD\",\n \"URL\",\n \"USER\",\n \"USER INTERFACE\",\n \"USERNAME\",\n \"UTILITY\",\n \"VERSION\",\n \"VIRTUAL\",\n \"VIRTUAL MEMORY\",\n \"VIRUS\",\n \"WEB\",\n \"WEBMASTER\",\n \"WEBSITE\",\n \"WIDGET\",\n \"WIKI\",\n \"WINDOW\",\n \"WINDOWS\",\n \"WIRELESS\",\n \"PROCESSOR\",\n \"WORKSTATION\",\n \"WEB\",\n \"WORM\",\n \"WWW\",\n \"XML\",\n \"ZIP\",\n];\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"@player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 8000, min: 2, max: 3 },\n Normal: { timer: 6000, min: 4, max: 5 },\n Hard: { timer: 4000, min: 4, max: 6 },\n Impossible: { timer: 2500, min: 7, max: 7 },\n};\n\nfunction generateLeftSide(difficulty: Difficulty): string {\n let str = \"\";\n const options = [KEY.OPEN_BRACKET, KEY.LESS_THAN, KEY.OPEN_PARENTHESIS, KEY.OPEN_BRACE];\n if (Player.hasAugmentation(AugmentationNames.WisdomOfAthena, true)) {\n options.splice(0, 1);\n }\n const length = random(difficulty.min, difficulty.max);\n for (let i = 0; i < length; i++) {\n str += options[Math.floor(Math.random() * options.length)];\n }\n\n return str;\n}\n\nfunction getChar(event: KeyboardEvent): string {\n if (event.key === KEY.CLOSE_PARENTHESIS) return KEY.CLOSE_PARENTHESIS;\n if (event.key === KEY.CLOSE_BRACKET) return KEY.CLOSE_BRACKET;\n if (event.key === KEY.CLOSE_BRACE) return KEY.CLOSE_BRACE;\n if (event.key === KEY.GREATER_THAN) return KEY.GREATER_THAN;\n return \"\";\n}\n\nfunction match(left: string, right: string): boolean {\n return (\n (left === KEY.OPEN_BRACKET && right === KEY.CLOSE_BRACKET) ||\n (left === KEY.LESS_THAN && right === KEY.GREATER_THAN) ||\n (left === KEY.OPEN_PARENTHESIS && right === KEY.CLOSE_PARENTHESIS) ||\n (left === KEY.OPEN_BRACE && right === KEY.CLOSE_BRACE)\n );\n}\n\nexport function BracketGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [right, setRight] = useState(\"\");\n const [left] = useState(generateLeftSide(difficulty));\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const char = getChar(event);\n if (!char) return;\n if (!match(left[left.length - right.length - 1], char)) {\n props.onFailure();\n return;\n }\n if (left.length === right.length + 1) {\n props.onSuccess();\n return;\n }\n setRight(right + char);\n }\n\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\" }}>\n <Typography variant=\"h4\">Close the brackets</Typography>\n <Typography style={{ fontSize: \"5em\" }}>\n {`${left}${right}`}\n <BlinkingCursor />\n </Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Paper>\n </>\n );\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"@player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n size: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 12000, size: 6 },\n Normal: { timer: 9000, size: 8 },\n Hard: { timer: 5000, size: 9 },\n Impossible: { timer: 2500, size: 12 },\n};\n\nexport function BribeGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, size: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [choices] = useState(makeChoices(difficulty));\n const [correctIndex, setCorrectIndex] = useState(0);\n const [index, setIndex] = useState(0);\n const currentChoice = choices[index];\n\n useEffect(() => {\n setCorrectIndex(choices.findIndex((choice) => positive.includes(choice)));\n }, [choices]);\n\n const defaultColor = Settings.theme.primary;\n const disabledColor = Settings.theme.disabled;\n let upColor = defaultColor;\n let downColor = defaultColor;\n let choiceColor = defaultColor;\n const hasAugment = Player.hasAugmentation(AugmentationNames.BeautyOfAphrodite, true);\n\n if (hasAugment) {\n const upIndex = index + 1 >= choices.length ? 0 : index + 1;\n let upDistance = correctIndex - upIndex;\n if (upIndex > correctIndex) {\n upDistance = choices.length - 1 - upIndex + correctIndex;\n }\n\n const downIndex = index - 1 < 0 ? choices.length - 1 : index - 1;\n let downDistance = downIndex - correctIndex;\n if (downIndex < correctIndex) {\n downDistance = downIndex + choices.length - 1 - correctIndex;\n }\n\n const onCorrectIndex = correctIndex == index;\n\n upColor = upDistance <= downDistance && !onCorrectIndex ? upColor : disabledColor;\n downColor = upDistance >= downDistance && !onCorrectIndex ? downColor : disabledColor;\n choiceColor = onCorrectIndex ? defaultColor : disabledColor;\n }\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n\n const k = event.key;\n if (k === KEY.SPACE) {\n if (positive.includes(currentChoice)) props.onSuccess();\n else props.onFailure();\n return;\n }\n\n let newIndex = index;\n if ([KEY.UP_ARROW, KEY.W, KEY.RIGHT_ARROW, KEY.D].map((k) => k as string).includes(k)) newIndex++;\n if ([KEY.DOWN_ARROW, KEY.S, KEY.LEFT_ARROW, KEY.A].map((k) => k as string).includes(k)) newIndex--;\n while (newIndex < 0) newIndex += choices.length;\n while (newIndex > choices.length - 1) newIndex -= choices.length;\n setIndex(newIndex);\n }\n\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\" }}>\n <Typography variant=\"h4\">Say something nice about the guard</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n <Typography variant=\"h5\" color={upColor}>\n {upArrowSymbol}\n </Typography>\n <Typography variant=\"h5\" color={choiceColor}>\n {currentChoice}\n </Typography>\n <Typography variant=\"h5\" color={downColor}>\n {downArrowSymbol}\n </Typography>\n </Paper>\n </>\n );\n}\n\nfunction shuffleArray(array: string[]): void {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n}\n\nfunction makeChoices(difficulty: Difficulty): string[] {\n const choices = [];\n choices.push(positive[Math.floor(Math.random() * positive.length)]);\n for (let i = 0; i < difficulty.size; i++) {\n const option = negative[Math.floor(Math.random() * negative.length)];\n if (choices.includes(option)) {\n i--;\n continue;\n }\n choices.push(option);\n }\n shuffleArray(choices);\n return choices;\n}\n\nconst positive = [\n \"affectionate\",\n \"agreeable\",\n \"bright\",\n \"charming\",\n \"creative\",\n \"determined\",\n \"energetic\",\n \"friendly\",\n \"funny\",\n \"generous\",\n \"polite\",\n \"likable\",\n \"diplomatic\",\n \"helpful\",\n \"giving\",\n \"kind\",\n \"hardworking\",\n \"patient\",\n \"dynamic\",\n \"loyal\",\n \"straightforward\",\n];\n\nconst negative = [\n \"aggressive\",\n \"aloof\",\n \"arrogant\",\n \"big-headed\",\n \"boastful\",\n \"boring\",\n \"bossy\",\n \"careless\",\n \"clingy\",\n \"couch potato\",\n \"cruel\",\n \"cynical\",\n \"grumpy\",\n \"hot air\",\n \"know it all\",\n \"obnoxious\",\n \"pain in the neck\",\n \"picky\",\n \"tactless\",\n \"thoughtless\",\n \"cringe\",\n];\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"@player\";\nimport {\n downArrowSymbol,\n getArrow,\n getInverseArrow,\n leftArrowSymbol,\n random,\n rightArrowSymbol,\n upArrowSymbol,\n} from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 13000, min: 6, max: 8 },\n Normal: { timer: 7000, min: 7, max: 8 },\n Hard: { timer: 5000, min: 8, max: 9 },\n Impossible: { timer: 3000, min: 9, max: 10 },\n};\n\nexport function CheatCodeGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [code] = useState(generateCode(difficulty));\n const [index, setIndex] = useState(0);\n const hasAugment = Player.hasAugmentation(AugmentationNames.TrickeryOfHermes, true);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (code[index] !== getArrow(event) && (!hasAugment || code[index] !== getInverseArrow(event))) {\n props.onFailure();\n return;\n }\n setIndex(index + 1);\n if (index + 1 >= code.length) props.onSuccess();\n }\n\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\" }}>\n <Typography variant=\"h4\">Enter the Code!</Typography>\n <Typography variant=\"h4\">{code[index]}</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Paper>\n </>\n );\n}\n\nfunction generateCode(difficulty: Difficulty): string {\n const arrows = [leftArrowSymbol, rightArrowSymbol, upArrowSymbol, downArrowSymbol];\n let code = \"\";\n for (let i = 0; i < random(difficulty.min, difficulty.max); i++) {\n let arrow = arrows[Math.floor(4 * Math.random())];\n while (arrow === code[code.length - 1]) arrow = arrows[Math.floor(4 * Math.random())];\n code += arrow;\n }\n\n return code;\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface IProps {\n onFinish: () => void;\n}\n\nexport function Countdown(props: IProps): React.ReactElement {\n const [x, setX] = useState(3);\n useEffect(() => {\n if (x === 0) {\n props.onFinish();\n return;\n }\n setTimeout(() => setX(x - 1), 300);\n });\n\n return (\n <Paper sx={{ p: 1, textAlign: \"center\" }}>\n <Typography variant=\"h4\">Get Ready!</Typography>\n <Typography variant=\"h4\">{x}</Typography>\n </Paper>\n );\n}\n","import { Paper, Typography, Box } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"@player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, getArrow, leftArrowSymbol, rightArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n symbols: number;\n}\n\ninterface GridItem {\n content: string;\n color: string;\n selected?: boolean;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 12500, width: 3, height: 3, symbols: 6 },\n Normal: { timer: 15000, width: 4, height: 4, symbols: 7 },\n Hard: { timer: 12500, width: 5, height: 5, symbols: 8 },\n Impossible: { timer: 10000, width: 6, height: 6, symbols: 9 },\n};\n\nexport function Cyberpunk2077Game(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, width: 0, height: 0, symbols: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [grid] = useState(generatePuzzle(difficulty));\n const [answers] = useState(generateAnswers(grid, difficulty));\n const [currentAnswerIndex, setCurrentAnswerIndex] = useState(0);\n const [pos, setPos] = useState([0, 0]);\n\n const hasAugment = Player.hasAugmentation(AugmentationNames.FloodOfPoseidon, true);\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const move = [0, 0];\n const arrow = getArrow(event);\n switch (arrow) {\n case upArrowSymbol:\n move[1]--;\n break;\n case leftArrowSymbol:\n move[0]--;\n break;\n case downArrowSymbol:\n move[1]++;\n break;\n case rightArrowSymbol:\n move[0]++;\n break;\n }\n const next = [pos[0] + move[0], pos[1] + move[1]];\n next[0] = (next[0] + grid[0].length) % grid[0].length;\n next[1] = (next[1] + grid.length) % grid.length;\n setPos(next);\n\n if (event.key === KEY.SPACE) {\n const selected = grid[pos[1]][pos[0]];\n const expected = answers[currentAnswerIndex];\n if (selected !== expected) {\n props.onFailure();\n return;\n }\n setCurrentAnswerIndex(currentAnswerIndex + 1);\n if (answers.length === currentAnswerIndex + 1) props.onSuccess();\n }\n }\n\n const flatGrid: GridItem[] = [];\n grid.map((line, y) =>\n line.map((cell, x) => {\n const isCorrectAnswer = cell === answers[currentAnswerIndex];\n const optionColor = hasAugment && !isCorrectAnswer ? Settings.theme.disabled : Settings.theme.primary;\n\n if (x === pos[0] && y === pos[1]) {\n flatGrid.push({ color: optionColor, content: cell, selected: true });\n return;\n }\n\n flatGrid.push({ color: optionColor, content: cell });\n }),\n );\n\n const fontSize = \"2em\";\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\", pb: 1 }}>\n <Typography variant=\"h4\">Match the symbols!</Typography>\n <Typography variant=\"h5\" color={Settings.theme.primary}>\n Targets:{\" \"}\n {answers.map((a, i) => {\n if (i == currentAnswerIndex)\n return (\n <span key={`${i}`} style={{ fontSize: \"1em\", color: Settings.theme.infolight }}>\n {a} \n </span>\n );\n return (\n <span key={`${i}`} style={{ fontSize: \"1em\", color: Settings.theme.primary }}>\n {a} \n </span>\n );\n })}\n </Typography>\n <br />\n <Box\n sx={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${Math.round(difficulty.width)}, 1fr)`,\n gap: 1,\n }}\n >\n {flatGrid.map((item) => (\n <Typography\n sx={{\n fontSize: fontSize,\n color: item.color,\n border: item.selected ? `2px solid ${Settings.theme.infolight}` : \"unset\",\n lineHeight: \"unset\",\n p: item.selected ? \"2px\" : \"4px\",\n }}\n >\n {item.content}\n </Typography>\n ))}\n </Box>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Paper>\n </>\n );\n}\n\nfunction generateAnswers(grid: string[][], difficulty: Difficulty): string[] {\n const answers = [];\n for (let i = 0; i < Math.round(difficulty.symbols); i++) {\n answers.push(grid[Math.floor(Math.random() * grid.length)][Math.floor(Math.random() * grid[0].length)]);\n }\n return answers;\n}\n\nfunction randChar(): string {\n return \"ABCDEF0123456789\"[Math.floor(Math.random() * 16)];\n}\n\nfunction generatePuzzle(difficulty: Difficulty): string[][] {\n const puzzle = [];\n for (let i = 0; i < Math.round(difficulty.height); i++) {\n const line = [];\n for (let j = 0; j < Math.round(difficulty.width); j++) {\n line.push(randChar() + randChar());\n }\n puzzle.push(line);\n }\n return puzzle;\n}\n","import { Close, Flag, Report } from \"@mui/icons-material\";\nimport { Box, Paper, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"@player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, getArrow, leftArrowSymbol, rightArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n mines: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 15000, width: 3, height: 3, mines: 4 },\n Normal: { timer: 15000, width: 4, height: 4, mines: 7 },\n Hard: { timer: 15000, width: 5, height: 5, mines: 11 },\n Impossible: { timer: 15000, width: 6, height: 6, mines: 15 },\n};\n\nexport function MinesweeperGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, width: 0, height: 0, mines: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [minefield] = useState(generateMinefield(difficulty));\n const [answer, setAnswer] = useState(generateEmptyField(difficulty));\n const [pos, setPos] = useState([0, 0]);\n const [memoryPhase, setMemoryPhase] = useState(true);\n const hasAugment = Player.hasAugmentation(AugmentationNames.HuntOfArtemis, true);\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (memoryPhase) return;\n const move = [0, 0];\n const arrow = getArrow(event);\n switch (arrow) {\n case upArrowSymbol:\n move[1]--;\n break;\n case leftArrowSymbol:\n move[0]--;\n break;\n case downArrowSymbol:\n move[1]++;\n break;\n case rightArrowSymbol:\n move[0]++;\n break;\n }\n const next = [pos[0] + move[0], pos[1] + move[1]];\n next[0] = (next[0] + minefield[0].length) % minefield[0].length;\n next[1] = (next[1] + minefield.length) % minefield.length;\n setPos(next);\n\n if (event.key == KEY.SPACE) {\n if (!minefield[pos[1]][pos[0]]) {\n props.onFailure();\n return;\n }\n setAnswer((old) => {\n old[pos[1]][pos[0]] = true;\n if (fieldEquals(minefield, old)) props.onSuccess();\n return old;\n });\n }\n }\n\n useEffect(() => {\n const id = setTimeout(() => setMemoryPhase(false), 2000);\n return () => clearInterval(id);\n }, []);\n\n const flatGrid: { flagged?: boolean; current?: boolean; marked?: boolean }[] = [];\n\n minefield.map((line, y) =>\n line.map((cell, x) => {\n if (memoryPhase) {\n flatGrid.push({ flagged: Boolean(minefield[y][x]) });\n return;\n } else if (x === pos[0] && y === pos[1]) {\n flatGrid.push({ current: true });\n } else if (answer[y][x]) {\n flatGrid.push({ marked: true });\n } else if (hasAugment && minefield[y][x]) {\n flatGrid.push({ flagged: true });\n } else {\n flatGrid.push({});\n }\n }),\n );\n\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\", pb: 1 }}>\n <Typography variant=\"h4\">{memoryPhase ? \"Remember all the mines!\" : \"Mark all the mines!\"}</Typography>\n <Box\n sx={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${Math.round(difficulty.width)}, 1fr)`,\n gridTemplateRows: `repeat(${Math.round(difficulty.height)}, 1fr)`,\n gap: 1,\n }}\n >\n {flatGrid.map((item) => {\n let color: string;\n let icon: React.ReactElement;\n\n if (item.marked) {\n color = Settings.theme.warning;\n icon = <Flag />;\n } else if (item.current) {\n color = Settings.theme.infolight;\n icon = <Close />;\n } else if (item.flagged) {\n color = Settings.theme.error;\n icon = <Report />;\n } else {\n color = Settings.theme.primary;\n icon = <></>;\n }\n\n return (\n <Typography\n key={`${item}${uniqueId()}`}\n sx={{\n color: color,\n border: `2px solid ${item.current ? Settings.theme.infolight : Settings.theme.primary}`,\n height: \"32px\",\n width: \"32px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {icon}\n </Typography>\n );\n })}\n </Box>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Paper>\n </>\n );\n}\n\nfunction fieldEquals(a: boolean[][], b: boolean[][]): boolean {\n function count(field: boolean[][]): number {\n return field.flat().reduce((a, b) => a + (b ? 1 : 0), 0);\n }\n return count(a) === count(b);\n}\n\nfunction generateEmptyField(difficulty: Difficulty): boolean[][] {\n const field = [];\n for (let i = 0; i < difficulty.height; i++) {\n field.push(new Array(Math.round(difficulty.width)).fill(false));\n }\n return field;\n}\n\nfunction generateMinefield(difficulty: Difficulty): boolean[][] {\n const field = generateEmptyField(difficulty);\n for (let i = 0; i < difficulty.mines; i++) {\n const x = Math.floor(Math.random() * field.length);\n const y = Math.floor(Math.random() * field[0].length);\n if (field[x][y]) {\n i--;\n continue;\n }\n field[x][y] = true;\n }\n return field;\n}\n","import { Box, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"@player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n window: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { window: 600 },\n Normal: { window: 325 },\n Hard: { window: 250 },\n Impossible: { window: 150 },\n};\n\nexport function SlashGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { window: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const [phase, setPhase] = useState(0);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (event.key !== KEY.SPACE) return;\n if (phase !== 1) {\n props.onFailure();\n } else {\n props.onSuccess();\n }\n }\n const hasAugment = Player.hasAugmentation(AugmentationNames.MightOfAres, true);\n const phaseZeroTime = Math.random() * 3250 + 1500 - (250 + difficulty.window);\n const phaseOneTime = 250;\n const timeUntilAttacking = phaseZeroTime;\n\n useEffect(() => {\n let id = window.setTimeout(() => {\n setPhase(1);\n id = window.setTimeout(() => {\n setPhase(2);\n id = window.setTimeout(() => setPhase(0), difficulty.window);\n }, phaseOneTime);\n }, phaseZeroTime);\n return () => {\n clearInterval(id);\n };\n }, []);\n\n return (\n <>\n <GameTimer millis={5000} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\" }}>\n <Typography variant=\"h4\">Slash when his guard is down!</Typography>\n\n {hasAugment ? (\n <Box sx={{ my: 1 }}>\n <Typography variant=\"h5\">Guard will drop in...</Typography>\n <GameTimer millis={timeUntilAttacking} onExpire={() => null} ignoreAugment_WKSharmonizer noPaper />\n </Box>\n ) : (\n <></>\n )}\n\n {phase === 0 && <Typography variant=\"h4\">Guarding ...</Typography>}\n {phase === 1 && <Typography variant=\"h4\">Preparing?</Typography>}\n {phase === 2 && <Typography variant=\"h4\">ATTACKING!</Typography>}\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Paper>\n </>\n );\n}\n","import { Box, Button, MenuItem, Paper, Select, SelectChangeEvent, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { inviteToFaction } from \"../../Faction/FactionHelpers\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { Player } from \"@player\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport {\n calculateInfiltratorsRepReward,\n calculateSellInformationCashReward,\n calculateTradeInformationRepReward,\n} from \"../formulas/victory\";\n\ninterface IProps {\n StartingDifficulty: number;\n Difficulty: number;\n Reward: number;\n MaxLevel: number;\n}\n\nexport function Victory(props: IProps): React.ReactElement {\n const [faction, setFaction] = useState(\"none\");\n\n function quitInfiltration(): void {\n handleInfiltrators();\n Router.toCity();\n }\n\n const soa = Factions[FactionNames.ShadowsOfAnarchy];\n const repGain = calculateTradeInformationRepReward(props.Reward, props.MaxLevel, props.StartingDifficulty);\n const moneyGain = calculateSellInformationCashReward(props.Reward, props.MaxLevel, props.StartingDifficulty);\n const infiltrationRepGain = calculateInfiltratorsRepReward(soa, props.StartingDifficulty);\n\n const isMemberOfInfiltrators = Player.factions.includes(FactionNames.ShadowsOfAnarchy);\n\n function sell(): void {\n handleInfiltrators();\n Player.gainMoney(moneyGain, \"infiltration\");\n quitInfiltration();\n }\n\n function trade(): void {\n if (faction === \"none\") return;\n handleInfiltrators();\n Factions[faction].playerReputation += repGain;\n quitInfiltration();\n }\n\n function changeDropdown(event: SelectChangeEvent<string>): void {\n setFaction(event.target.value);\n }\n\n function handleInfiltrators(): void {\n inviteToFaction(Factions[FactionNames.ShadowsOfAnarchy]);\n if (isMemberOfInfiltrators) {\n soa.playerReputation += infiltrationRepGain;\n }\n }\n\n return (\n <Paper sx={{ p: 1, textAlign: \"center\", display: \"flex\", alignItems: \"center\", flexDirection: \"column\" }}>\n <Typography variant=\"h4\">Infiltration successful!</Typography>\n <Typography variant=\"h5\" color=\"primary\" width=\"75%\">\n You{\" \"}\n {isMemberOfInfiltrators ? (\n <>\n have gained {formatNumber(infiltrationRepGain, 2)} rep for {FactionNames.ShadowsOfAnarchy} and{\" \"}\n </>\n ) : (\n <></>\n )}\n can trade the confidential information you found for money or reputation.\n </Typography>\n <Box sx={{ width: \"fit-content\" }}>\n <Box sx={{ width: \"100%\" }}>\n <Select value={faction} onChange={changeDropdown} sx={{ mr: 1 }}>\n <MenuItem key={\"none\"} value={\"none\"}>\n {\"none\"}\n </MenuItem>\n {Player.factions\n .filter((f) => Factions[f].getInfo().offersWork())\n .map((f) => (\n <MenuItem key={f} value={f}>\n {f}\n </MenuItem>\n ))}\n </Select>\n <Button onClick={trade}>\n Trade for <Reputation reputation={repGain} /> reputation\n </Button>\n </Box>\n <Button onClick={sell} sx={{ width: \"100%\" }}>\n Sell for \n <Money money={moneyGain} />\n </Button>\n </Box>\n <Button onClick={quitInfiltration} sx={{ width: \"100%\", mt: 1 }}>\n Quit\n </Button>\n </Paper>\n );\n}\n","import { Box, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"@player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n wiresmin: number;\n wiresmax: number;\n rules: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 9000, wiresmin: 4, wiresmax: 4, rules: 2 },\n Normal: { timer: 7000, wiresmin: 6, wiresmax: 6, rules: 2 },\n Hard: { timer: 5000, wiresmin: 8, wiresmax: 8, rules: 3 },\n Impossible: { timer: 4000, wiresmin: 9, wiresmax: 9, rules: 4 },\n};\n\nconst types = [KEY.PIPE, KEY.DOT, KEY.FORWARD_SLASH, KEY.HYPHEN, \"█\", KEY.HASH];\n\nconst colors = [\"red\", \"#FFC107\", \"blue\", \"white\"];\n\nconst colorNames: Record<string, string> = {\n red: \"red\",\n \"#FFC107\": \"yellow\",\n blue: \"blue\",\n white: \"white\",\n};\n\ninterface Wire {\n tpe: string;\n colors: string[];\n}\n\ninterface Question {\n toString: () => string;\n shouldCut: (wire: Wire, index: number) => boolean;\n}\n\nexport function WireCuttingGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = {\n timer: 0,\n wiresmin: 0,\n wiresmax: 0,\n rules: 0,\n };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [wires] = useState(generateWires(difficulty));\n const [cutWires, setCutWires] = useState(new Array(wires.length).fill(false));\n const [questions] = useState(generateQuestion(wires, difficulty));\n const hasAugment = Player.hasAugmentation(AugmentationNames.KnowledgeOfApollo, true);\n\n function checkWire(wireNum: number): boolean {\n return questions.some((q) => q.shouldCut(wires[wireNum - 1], wireNum - 1));\n }\n\n useEffect(() => {\n // check if we won\n const wiresToBeCut = [];\n for (let j = 0; j < wires.length; j++) {\n let shouldBeCut = false;\n for (let i = 0; i < questions.length; i++) {\n shouldBeCut = shouldBeCut || questions[i].shouldCut(wires[j], j);\n }\n wiresToBeCut.push(shouldBeCut);\n }\n if (wiresToBeCut.every((b, i) => b === cutWires[i])) {\n props.onSuccess();\n }\n }, [cutWires]);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const wireNum = parseInt(event.key);\n\n if (wireNum < 1 || wireNum > wires.length || isNaN(wireNum)) return;\n setCutWires((old) => {\n const next = [...old];\n next[wireNum - 1] = true;\n if (!checkWire(wireNum)) {\n props.onFailure();\n }\n\n return next;\n });\n }\n\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\", pb: 1 }}>\n <Typography variant=\"h4\" sx={{ width: \"75%\", textAlign: \"center\" }}>\n Cut the wires with the following properties! (keyboard 1 to 9)\n </Typography>\n {questions.map((question, i) => (\n <Typography key={i}>{question.toString()}</Typography>\n ))}\n <Box\n sx={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${wires.length}, 1fr)`,\n columnGap: 3,\n justifyItems: \"center\",\n }}\n >\n {new Array(wires.length).fill(0).map((_, i) => {\n const isCorrectWire = checkWire(i + 1);\n const color = hasAugment && !isCorrectWire ? Settings.theme.disabled : Settings.theme.primary;\n return (\n <Typography key={i} style={{ color: color }}>\n {i + 1}\n </Typography>\n );\n })}\n {new Array(8).fill(0).map((_, i) => (\n <React.Fragment key={i}>\n {wires.map((wire, j) => {\n if ((i === 3 || i === 4) && cutWires[j]) {\n return <Typography key={j}></Typography>;\n }\n const isCorrectWire = checkWire(j + 1);\n const wireColor =\n hasAugment && !isCorrectWire ? Settings.theme.disabled : wire.colors[i % wire.colors.length];\n return (\n <Typography key={j} style={{ color: wireColor }}>\n |{wire.tpe}|\n </Typography>\n );\n })}\n </React.Fragment>\n ))}\n </Box>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Paper>\n </>\n );\n}\n\nfunction randomPositionQuestion(wires: Wire[]): Question {\n const index = Math.floor(Math.random() * wires.length);\n return {\n toString: (): string => {\n return `Cut wires number ${index + 1}.`;\n },\n shouldCut: (wire: Wire, i: number): boolean => {\n return index === i;\n },\n };\n}\n\nfunction randomColorQuestion(wires: Wire[]): Question {\n const index = Math.floor(Math.random() * wires.length);\n const cutColor = wires[index].colors[0];\n return {\n toString: (): string => {\n return `Cut all wires colored ${colorNames[cutColor]}.`;\n },\n shouldCut: (wire: Wire): boolean => {\n return wire.colors.includes(cutColor);\n },\n };\n}\n\nfunction generateQuestion(wires: Wire[], difficulty: Difficulty): Question[] {\n const numQuestions = difficulty.rules;\n const questionGenerators = [randomPositionQuestion, randomColorQuestion];\n const questions = [];\n for (let i = 0; i < numQuestions; i++) {\n questions.push(questionGenerators[i % 2](wires));\n }\n return questions;\n}\n\nfunction generateWires(difficulty: Difficulty): Wire[] {\n const wires = [];\n const numWires = random(difficulty.wiresmin, difficulty.wiresmax);\n for (let i = 0; i < numWires; i++) {\n const wireColors = [colors[Math.floor(Math.random() * colors.length)]];\n if (Math.random() < 0.15) {\n wireColors.push(colors[Math.floor(Math.random() * colors.length)]);\n }\n wires.push({\n tpe: types[Math.floor(Math.random() * types.length)],\n colors: wireColors,\n });\n }\n return wires;\n}\n","import { Report } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React from \"react\";\nimport { Location } from \"../../Locations/Location\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\ninterface IProps {\n Location: Location;\n Difficulty: number;\n MaxLevel: number;\n start: () => void;\n cancel: () => void;\n}\n\nfunction arrowPart(color: string, length: number): JSX.Element {\n let arrow = \"\";\n if (length <= 0) length = 0;\n else if (length > 13) length = 13;\n else {\n length--;\n arrow = \">\";\n }\n return (\n <span style={{ color: color }}>\n {\"=\".repeat(length)}\n {arrow}\n {\" \".repeat(13 - arrow.length - length)}\n </span>\n );\n}\n\nfunction coloredArrow(difficulty: number): JSX.Element {\n if (difficulty === 0) {\n return (\n <span style={{ color: \"white\" }}>\n {\">\"}\n {\" \".repeat(38)}\n </span>\n );\n } else {\n return (\n <>\n {arrowPart(Settings.theme.primary, difficulty * 13)}\n {arrowPart(Settings.theme.warning, (difficulty - 1) * 13)}\n {arrowPart(Settings.theme.error, (difficulty - 2) * 13)}\n </>\n );\n }\n}\n\nexport function Intro(props: IProps): React.ReactElement {\n return (\n <Container sx={{ alignItems: \"center\" }}>\n <Paper sx={{ p: 1, mb: 1, display: \"grid\", justifyItems: \"center\" }}>\n <Typography variant=\"h4\">\n Infiltrating <b>{props.Location.name}</b>\n </Typography>\n <Typography variant=\"h6\">\n <b>Maximum Level: </b>\n {props.MaxLevel}\n </Typography>\n <Typography\n variant=\"h6\"\n sx={{\n color:\n props.Difficulty > 2\n ? Settings.theme.error\n : props.Difficulty > 1\n ? Settings.theme.warning\n : Settings.theme.primary,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <b>Difficulty: </b>\n {numeralWrapper.format(props.Difficulty * 33.3333, \"0\")} / 100\n {props.Difficulty > 1.5 && (\n <Tooltip\n title={\n <Typography color=\"error\">\n This location is too heavily guarded for your current stats. It is recommended that you try training,\n or finding an easier location.\n </Typography>\n }\n >\n <Report sx={{ ml: 1 }} />\n </Tooltip>\n )}\n </Typography>\n\n <Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>[{coloredArrow(props.Difficulty)}]</Typography>\n <Typography\n sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}\n >{`▲ ▲ ▲ ▲`}</Typography>\n <Typography\n sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}\n >{` Trivial Normal Hard Impossible`}</Typography>\n </Paper>\n\n <Paper sx={{ p: 1, display: \"grid\", justifyItems: \"center\" }}>\n <Typography sx={{ width: \"75%\", textAlign: \"center\" }}>\n <b>Infiltration</b> is a series of short minigames that get progressively harder. You take damage for failing\n them. Reaching the maximum level rewards you with intel that you can trade for money or reputation.\n <br />\n <br />\n <b>Gameplay:</b>\n </Typography>\n <ul>\n <Typography>\n <li>\n The minigames you play are randomly selected.\n <br />\n It might take you a few tries to get used to them.\n </li>\n <li>No game requires use of the mouse.</li>\n <li>\n <b>Spacebar</b> is the default action/confirm button.\n </li>\n <li>\n The <b>arrow keys</b> and <b>WASD</b> can be used interchangeably.\n </li>\n <li>Sometimes the rest of the keyboard is used.</li>\n </Typography>\n </ul>\n\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\", width: \"100%\" }}>\n <Button onClick={props.start}>Start</Button>\n <Button onClick={props.cancel}>Cancel</Button>\n </Box>\n </Paper>\n </Container>\n );\n}\n","import { Box, Container, Paper, Table, TableBody, Tooltip } from \"@mui/material\";\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport { uniqueId } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { Companies } from \"../Company/Companies\";\nimport { CONSTANTS } from \"../Constants\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { Locations } from \"../Locations/Locations\";\nimport { Settings } from \"../Settings/Settings\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { Player } from \"@player\";\nimport { Router } from \"./GameRoot\";\nimport { numeralWrapper } from \"./numeralFormat\";\nimport { Money } from \"./React/Money\";\nimport { MoneyRate } from \"./React/MoneyRate\";\nimport { ProgressBar } from \"./React/Progress\";\nimport { Reputation } from \"./React/Reputation\";\nimport { ReputationRate } from \"./React/ReputationRate\";\nimport { StatsRow } from \"./React/StatsRow\";\nimport { isCrimeWork } from \"../Work/CrimeWork\";\nimport { isClassWork } from \"../Work/ClassWork\";\nimport { WorkStats } from \"../Work/WorkStats\";\nimport { isCreateProgramWork } from \"../Work/CreateProgramWork\";\nimport { isGraftingWork } from \"../Work/GraftingWork\";\nimport { isFactionWork } from \"../Work/FactionWork\";\nimport { FactionWorkType } from \"../Work/data/FactionWorkType\";\nimport { isCompanyWork } from \"../Work/CompanyWork\";\n\nconst CYCLES_PER_SEC = 1000 / CONSTANTS.MilliPerCycle;\n\ninterface IWorkInfo {\n buttons: {\n cancel: () => void;\n unfocus?: () => void;\n };\n title: string | React.ReactElement;\n\n description?: string | React.ReactElement;\n gains?: (string | React.ReactElement)[];\n progress?: {\n elapsed?: number;\n remaining?: number;\n percentage?: number;\n };\n\n stopText: string;\n stopTooltip?: string | React.ReactElement;\n}\n\nfunction ExpRows(rate: WorkStats): React.ReactElement[] {\n return [\n rate.hackExp > 0 ? (\n <StatsRow\n name=\"Hacking Exp\"\n color={Settings.theme.hack}\n data={{\n content: `${numeralWrapper.formatExp(rate.hackExp * CYCLES_PER_SEC)} / sec`,\n }}\n />\n ) : (\n <></>\n ),\n rate.strExp > 0 ? (\n <StatsRow\n name=\"Strength Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(rate.strExp * CYCLES_PER_SEC)} / sec`,\n }}\n />\n ) : (\n <></>\n ),\n rate.defExp > 0 ? (\n <StatsRow\n name=\"Defense Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(rate.defExp * CYCLES_PER_SEC)} / sec`,\n }}\n />\n ) : (\n <></>\n ),\n rate.dexExp > 0 ? (\n <StatsRow\n name=\"Dexterity Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(rate.dexExp * CYCLES_PER_SEC)} / sec`,\n }}\n />\n ) : (\n <></>\n ),\n rate.agiExp > 0 ? (\n <StatsRow\n name=\"Agility Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(rate.agiExp * CYCLES_PER_SEC)} / sec`,\n }}\n />\n ) : (\n <></>\n ),\n rate.chaExp > 0 ? (\n <StatsRow\n name=\"Charisma Exp\"\n color={Settings.theme.cha}\n data={{\n content: `${numeralWrapper.formatExp(rate.chaExp * CYCLES_PER_SEC)} / sec`,\n }}\n />\n ) : (\n <></>\n ),\n ];\n}\n\n/* Because crime exp is given all at once at the end, we don't care about the cycles per second. */\nfunction CrimeExpRows(rate: WorkStats): React.ReactElement[] {\n return [\n rate.hackExp > 0 ? (\n <StatsRow\n name=\"Hacking Exp\"\n color={Settings.theme.hack}\n data={{\n content: `${numeralWrapper.formatExp(rate.hackExp)}`,\n }}\n />\n ) : (\n <></>\n ),\n rate.strExp > 0 ? (\n <StatsRow\n name=\"Strength Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(rate.strExp)}`,\n }}\n />\n ) : (\n <></>\n ),\n rate.defExp > 0 ? (\n <StatsRow\n name=\"Defense Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(rate.defExp)}`,\n }}\n />\n ) : (\n <></>\n ),\n rate.dexExp > 0 ? (\n <StatsRow\n name=\"Dexterity Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(rate.dexExp)}`,\n }}\n />\n ) : (\n <></>\n ),\n rate.agiExp > 0 ? (\n <StatsRow\n name=\"Agility Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(rate.agiExp)}`,\n }}\n />\n ) : (\n <></>\n ),\n rate.chaExp > 0 ? (\n <StatsRow\n name=\"Charisma Exp\"\n color={Settings.theme.cha}\n data={{\n content: `${numeralWrapper.formatExp(rate.chaExp)}`,\n }}\n />\n ) : (\n <></>\n ),\n ];\n}\n\nexport function WorkInProgressRoot(): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, CONSTANTS.MilliPerCycle);\n return () => clearInterval(id);\n }, []);\n\n let workInfo: IWorkInfo = {\n buttons: {\n cancel: () => undefined,\n },\n title: \"\",\n stopText: \"\",\n };\n\n if (Player.currentWork === null) {\n setTimeout(() => Router.toTerminal());\n return <></>;\n }\n\n if (isCrimeWork(Player.currentWork)) {\n const crime = Player.currentWork.getCrime();\n const completion = (Player.currentWork.unitCompleted / crime.time) * 100;\n const gains = Player.currentWork.earnings();\n const successChance = crime.successRate(Player);\n workInfo = {\n buttons: {\n cancel: () => {\n Router.toLocation(Locations[LocationName.Slums]);\n Player.finishWork(true);\n },\n unfocus: () => {\n Router.toCity();\n Player.stopFocusing();\n },\n },\n title: `You are attempting ${crime.workName}`,\n\n gains: [\n <Typography>Success chance: {numeralWrapper.formatPercentage(successChance)}</Typography>,\n <Typography>Gains (on success)</Typography>,\n <StatsRow name=\"Money:\" color={Settings.theme.money}>\n <Typography>\n <Money money={gains.money} />\n </Typography>\n </StatsRow>,\n ...CrimeExpRows(gains),\n ],\n progress: {\n remaining: crime.time - Player.currentWork.unitCompleted,\n percentage: completion,\n },\n\n stopText: \"Stop committing crime\",\n };\n }\n\n if (isClassWork(Player.currentWork)) {\n const classWork = Player.currentWork;\n function cancel(): void {\n Player.finishWork(true);\n Router.toCity();\n }\n\n function unfocus(): void {\n Router.toCity();\n Player.stopFocusing();\n }\n\n let stopText = \"\";\n if (classWork.isGym()) {\n stopText = \"Stop training at gym\";\n } else {\n stopText = \"Stop taking course\";\n }\n\n const rates = classWork.calculateRates();\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently <b>{classWork.getClass().youAreCurrently}</b>\n </>\n ),\n\n gains: [\n <StatsRow name=\"Total Cost\" color={Settings.theme.money}>\n <Typography>\n <Money money={classWork.earnings.money} /> (<MoneyRate money={rates.money * CYCLES_PER_SEC} />)\n </Typography>\n </StatsRow>,\n ...ExpRows(rates),\n ],\n progress: {\n elapsed: classWork.cyclesWorked * CONSTANTS._idleSpeed,\n },\n\n stopText: stopText,\n };\n }\n\n if (isCreateProgramWork(Player.currentWork)) {\n const create = Player.currentWork;\n function cancel(): void {\n Player.finishWork(true);\n Router.toTerminal();\n }\n function unfocus(): void {\n Router.toTerminal();\n Player.stopFocusing();\n }\n\n const completion = (create.unitCompleted / create.unitNeeded()) * 100;\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on coding <b>{create.programName}</b>\n </>\n ),\n\n progress: {\n elapsed: create.cyclesWorked * CONSTANTS._idleSpeed,\n percentage: completion,\n },\n\n stopText: \"Stop creating program\",\n stopTooltip: \"Your work will be saved and you can return to complete the program later.\",\n };\n }\n\n if (isGraftingWork(Player.currentWork)) {\n const graft = Player.currentWork;\n function cancel(): void {\n Player.finishWork(true);\n Router.toTerminal();\n }\n function unfocus(): void {\n Router.toTerminal();\n Player.stopFocusing();\n }\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on grafting <b>{graft.augmentation}</b>\n </>\n ),\n\n progress: {\n elapsed: graft.cyclesWorked * CONSTANTS._idleSpeed,\n percentage: (graft.unitCompleted / graft.unitNeeded()) * 100,\n },\n\n stopText: \"Stop grafting\",\n stopTooltip: (\n <>\n If you cancel, your work will <b>not</b> be saved, and the money you spent will <b>not</b> be returned\n </>\n ),\n };\n }\n\n if (isFactionWork(Player.currentWork)) {\n const faction = Player.currentWork.getFaction();\n if (!faction) {\n workInfo = {\n buttons: {\n cancel: () => Router.toFactions(),\n },\n title:\n `You have not joined ${Player.currentWork.factionName || \"(Faction not found)\"} at this time,` +\n \" please try again if you think this should have worked\",\n\n stopText: \"Back to Factions\",\n };\n }\n\n function cancel(): void {\n Router.toFaction(faction);\n Player.finishWork(true);\n }\n function unfocus(): void {\n Router.toFaction(faction);\n Player.stopFocusing();\n }\n\n const description = {\n [FactionWorkType.HACKING]: \"carrying out hacking contracts\",\n [FactionWorkType.FIELD]: \"carrying out field missions\",\n [FactionWorkType.SECURITY]: \"performing security detail\",\n };\n\n const exp = Player.currentWork.getExpRates();\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently {description[Player.currentWork.factionWorkType]} for <b>{faction.name}</b>\n </>\n ),\n\n description: (\n <>\n Current Faction Reputation: <Reputation reputation={faction.playerReputation} /> (\n <ReputationRate reputation={Player.currentWork.getReputationRate() * CYCLES_PER_SEC} />)\n </>\n ),\n gains: ExpRows(exp),\n progress: {\n elapsed: Player.currentWork.cyclesWorked * CONSTANTS._idleSpeed,\n },\n\n stopText: \"Stop Faction work\",\n };\n }\n\n if (isCompanyWork(Player.currentWork)) {\n const comp = Companies[Player.currentWork.companyName];\n if (comp) {\n workInfo = {\n buttons: {\n cancel: () => Router.toTerminal(),\n },\n title:\n `You cannot work for ${Player.currentWork.companyName || \"(Company not found)\"} at this time,` +\n \" please try again if you think this should have worked\",\n\n stopText: \"Back to Terminal\",\n };\n }\n\n const companyRep = comp.playerReputation;\n\n function cancel(): void {\n Player.finishWork(true);\n Router.toJob(Locations[comp.name]);\n }\n function unfocus(): void {\n Player.stopFocusing();\n Router.toJob(Locations[comp.name]);\n }\n\n const position = Player.jobs[Player.currentWork.companyName];\n const gains = Player.currentWork.getGainRates();\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working as a <b>{position}</b> at <b>{Player.currentWork.companyName}</b>\n </>\n ),\n\n description: (\n <>\n Current Company Reputation: <Reputation reputation={companyRep} />\n </>\n ),\n gains: [\n <StatsRow name=\"Money\" color={Settings.theme.money}>\n <Typography>\n <MoneyRate money={gains.money * CYCLES_PER_SEC} />\n </Typography>\n </StatsRow>,\n <StatsRow name=\"Company Reputation\" color={Settings.theme.rep}>\n <Typography>\n <ReputationRate reputation={gains.reputation * CYCLES_PER_SEC} />\n </Typography>\n </StatsRow>,\n ...ExpRows(gains),\n ],\n progress: {\n elapsed: Player.currentWork.cyclesWorked * CONSTANTS._idleSpeed,\n },\n\n stopText: \"Stop working\",\n };\n }\n\n if (workInfo.title === \"\") {\n return <></>;\n }\n\n const tooltipInfo =\n typeof workInfo?.stopTooltip === \"string\" ? (\n <Typography>{workInfo.stopTooltip}</Typography>\n ) : (\n workInfo.stopTooltip || <></>\n );\n\n return (\n <Container\n maxWidth=\"md\"\n sx={{ display: \"flex\", flexDirection: \"column\", justifyContent: \"center\", height: \"calc(100vh - 16px)\" }}\n >\n <Paper sx={{ p: 1, mb: 1 }}>\n <Typography variant=\"h6\">{workInfo.title}</Typography>\n <Typography>{workInfo.description}</Typography>\n {workInfo.gains && (\n <Table sx={{ mt: 1 }}>\n <TableBody>\n {workInfo.gains.map((row) => (\n <React.Fragment key={uniqueId()}>{row}</React.Fragment>\n ))}\n </TableBody>\n </Table>\n )}\n </Paper>\n <Paper sx={{ mb: 1, p: 1 }}>\n {workInfo.progress !== undefined && (\n <Box sx={{ mb: 1 }}>\n <Box\n display=\"grid\"\n sx={{\n gridTemplateColumns: `repeat(${Object.keys(workInfo.progress).length}, 1fr)`,\n width: \"100%\",\n justifyItems: \"center\",\n textAlign: \"center\",\n }}\n >\n {workInfo.progress.elapsed !== undefined && (\n <Typography>{convertTimeMsToTimeElapsedString(workInfo.progress.elapsed)} elapsed</Typography>\n )}\n {workInfo.progress.remaining !== undefined && (\n <Typography>{convertTimeMsToTimeElapsedString(workInfo.progress.remaining)} remaining</Typography>\n )}\n {workInfo.progress.percentage !== undefined && (\n <Typography>{workInfo.progress.percentage.toFixed(2)}% done</Typography>\n )}\n </Box>\n {workInfo.progress.percentage !== undefined && (\n <ProgressBar variant=\"determinate\" value={workInfo.progress.percentage} color=\"primary\" />\n )}\n </Box>\n )}\n\n <Box display=\"grid\" sx={{ gridTemplateColumns: `repeat(${Object.keys(workInfo.buttons).length}, 1fr)` }}>\n {workInfo.stopTooltip ? (\n <Tooltip title={tooltipInfo}>\n <Button onClick={workInfo.buttons.cancel}>{workInfo.stopText}</Button>\n </Tooltip>\n ) : (\n <Button onClick={workInfo.buttons.cancel}>{workInfo.stopText}</Button>\n )}\n {workInfo.buttons.unfocus && (\n <Button onClick={workInfo.buttons.unfocus}>Do something else simultaneously</Button>\n )}\n </Box>\n </Paper>\n </Container>\n );\n}\n","import { Box, Container, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\nimport { GameOptionsSidebar } from \"./GameOptionsSidebar\";\nimport { GameplayPage } from \"./GameplayPage\";\nimport { InterfacePage } from \"./InterfacePage\";\nimport { MiscPage } from \"./MiscPage\";\nimport { RemoteAPIPage } from \"./RemoteAPIPage\";\nimport { SystemPage } from \"./SystemPage\";\n\ninterface IProps {\n save: () => void;\n export: () => void;\n forceKill: () => void;\n softReset: () => void;\n}\n\nexport function GameOptionsRoot(props: IProps): React.ReactElement {\n const [currentTab, setCurrentTab] = useState(GameOptionsTab.SYSTEM);\n\n return (\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0 }}>\n <Typography variant=\"h4\">Options</Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 3fr\", gap: 1 }}>\n <GameOptionsSidebar\n tab={currentTab}\n setTab={setCurrentTab}\n save={props.save}\n export={props.export}\n forceKill={props.forceKill}\n softReset={props.softReset}\n />\n {currentTab === GameOptionsTab.SYSTEM && <SystemPage />}\n {currentTab === GameOptionsTab.INTERFACE && <InterfacePage />}\n {currentTab === GameOptionsTab.GAMEPLAY && <GameplayPage />}\n {currentTab === GameOptionsTab.MISC && <MiscPage />}\n {currentTab === GameOptionsTab.REMOTE_API && <RemoteAPIPage />}\n </Box>\n </Container>\n );\n}\n","import {\n BugReport,\n Chat,\n Download,\n LibraryBooks,\n Palette,\n Reddit,\n Save,\n SystemUpdateAlt,\n Upload,\n Bloodtype,\n} from \"@mui/icons-material\";\nimport { Box, Button, List, ListItemButton, Paper, Tooltip, Typography } from \"@mui/material\";\nimport { default as React, useRef, useState } from \"react\";\nimport { FileDiagnosticModal } from \"../../Diagnostic/FileDiagnosticModal\";\nimport { ImportData, saveObject } from \"../../SaveObject\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { StyleEditorButton } from \"../../Themes/ui/StyleEditorButton\";\nimport { ThemeEditorButton } from \"../../Themes/ui/ThemeEditorButton\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\nimport { DeleteGameButton } from \"../../ui/React/DeleteGameButton\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { SoftResetButton } from \"../../ui/React/SoftResetButton\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\n\ninterface IProps {\n tab: GameOptionsTab;\n setTab: (tab: GameOptionsTab) => void;\n save: () => void;\n export: () => void;\n forceKill: () => void;\n softReset: () => void;\n}\n\ninterface ITabProps {\n sideBarProps: IProps;\n tab: GameOptionsTab;\n tabName: string;\n}\n\nconst SideBarTab = (props: ITabProps): React.ReactElement => {\n return (\n <ListItemButton\n selected={props.sideBarProps.tab === props.tab}\n onClick={() => props.sideBarProps.setTab(props.tab)}\n >\n <Typography>{props.tabName}</Typography>\n </ListItemButton>\n );\n};\n\nexport const GameOptionsSidebar = (props: IProps): React.ReactElement => {\n const importInput = useRef<HTMLInputElement>(null);\n\n const [diagnosticOpen, setDiagnosticOpen] = useState(false);\n const [importSaveOpen, setImportSaveOpen] = useState(false);\n const [importData, setImportData] = useState<ImportData | null>(null);\n\n function startImport(): void {\n if (!window.File || !window.FileReader || !window.FileList || !window.Blob) return;\n const ii = importInput.current;\n if (ii === null) throw new Error(\"import input should not be null\");\n ii.click();\n }\n\n async function onImport(event: React.ChangeEvent<HTMLInputElement>): Promise<void> {\n try {\n const base64Save = await saveObject.getImportStringFromFile(event.target.files);\n const data = await saveObject.getImportDataFromString(base64Save);\n setImportData(data);\n setImportSaveOpen(true);\n } catch (e: unknown) {\n SnackbarEvents.emit(String(e), ToastVariant.ERROR, 5000);\n }\n }\n\n async function confirmedImportGame(): Promise<void> {\n if (!importData) return;\n\n try {\n await saveObject.importGame(importData.base64);\n } catch (e: unknown) {\n SnackbarEvents.emit(String(e), ToastVariant.ERROR, 5000);\n }\n\n setImportSaveOpen(false);\n setImportData(null);\n }\n\n function compareSaveGame(): void {\n if (!importData) return;\n Router.toImportSave(importData.base64);\n setImportSaveOpen(false);\n setImportData(null);\n }\n\n return (\n <Box>\n <Paper sx={{ height: \"fit-content\", mb: 1 }}>\n <List>\n <SideBarTab sideBarProps={props} tab={GameOptionsTab.SYSTEM} tabName=\"System\" />\n <SideBarTab sideBarProps={props} tab={GameOptionsTab.GAMEPLAY} tabName=\"Gameplay\" />\n <SideBarTab sideBarProps={props} tab={GameOptionsTab.INTERFACE} tabName=\"Interface\" />\n <SideBarTab sideBarProps={props} tab={GameOptionsTab.MISC} tabName=\"Misc\" />\n <SideBarTab sideBarProps={props} tab={GameOptionsTab.REMOTE_API} tabName=\"Remote API\" />\n </List>\n </Paper>\n <Box\n sx={{\n display: \"grid\",\n width: \"100%\",\n height: \"fit-content\",\n gridTemplateAreas: `\"save delete\"\n \"export import\"\n \"kill kill\"\n \"reset diagnose\"\n \"browse browse\"\n \"theme style\"\n \"links links\"\n \"devs devs\"`,\n gridTemplateColumns: \"1fr 1fr\",\n }}\n >\n <Button onClick={() => props.save()} startIcon={<Save />} sx={{ gridArea: \"save\" }}>\n Save Game\n </Button>\n <Box sx={{ gridArea: \"delete\", \"& .MuiButton-root\": { height: \"100%\", width: \"100%\" } }}>\n <DeleteGameButton />\n </Box>\n <Tooltip title={<Typography>Export your game to a text file.</Typography>}>\n <Button onClick={() => props.export()} startIcon={<Download />} sx={{ gridArea: \"export\" }}>\n Export Game\n </Button>\n </Tooltip>\n <Tooltip\n title={\n <Typography>\n Import your game from a text file.\n <br />\n This will <strong>overwrite</strong> your current game. Back it up first!\n </Typography>\n }\n >\n <Button onClick={startImport} startIcon={<Upload />} sx={{ gridArea: \"import\" }}>\n Import Game\n <input ref={importInput} id=\"import-game-file-selector\" type=\"file\" hidden onChange={onImport} />\n </Button>\n </Tooltip>\n <ConfirmationModal\n open={importSaveOpen}\n onClose={() => setImportSaveOpen(false)}\n onConfirm={() => confirmedImportGame()}\n additionalButton={<Button onClick={compareSaveGame}>Compare Save</Button>}\n confirmationText={\n <>\n Importing a new game will <strong>completely wipe</strong> the current data!\n <br />\n <br />\n Make sure to have a backup of your current save file before importing.\n <br />\n The file you are attempting to import seems valid.\n {(importData?.playerData?.lastSave ?? 0) > 0 && (\n <>\n <br />\n <br />\n The export date of the save file is{\" \"}\n <strong>{new Date(importData?.playerData?.lastSave ?? 0).toLocaleString()}</strong>\n </>\n )}\n {(importData?.playerData?.totalPlaytime ?? 0) > 0 && (\n <>\n <br />\n <br />\n Total play time of imported game:{\" \"}\n {convertTimeMsToTimeElapsedString(importData?.playerData?.totalPlaytime ?? 0)}\n </>\n )}\n <br />\n <br />\n </>\n }\n />\n <Tooltip\n title={\n <Typography>\n Forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the game.\n After using this, save the game and then reload the page. This is different than normal kill in that\n normal kill will tell the script to shut down while force kill just removes the references to it (and it\n should crash on its own). This will not remove the files on your computer, just forcefully kill all\n running instances of all scripts.\n </Typography>\n }\n >\n <Button onClick={() => props.forceKill()} sx={{ gridArea: \"kill\" }}>\n Force kill all active scripts\n </Button>\n </Tooltip>\n <Box sx={{ gridArea: \"reset\", \"& .MuiButton-root\": { height: \"100%\", width: \"100%\" } }}>\n <SoftResetButton\n noConfirmation={Settings.SuppressBuyAugmentationConfirmation}\n onTriggered={props.softReset}\n />\n </Box>\n <Tooltip\n title={\n <Typography>\n If your save file is extremely big you can use this button to view a map of all the files on every server.\n Be careful: there might be spoilers.\n </Typography>\n }\n >\n <Button onClick={() => setDiagnosticOpen(true)} sx={{ gridArea: \"diagnose\" }}>\n Diagnose files\n </Button>\n </Tooltip>\n <Tooltip title=\"Head to the theme browser to see a collection of prebuilt themes.\">\n <Button startIcon={<Palette />} onClick={() => Router.toThemeBrowser()} sx={{ gridArea: \"browse\" }}>\n Theme Browser\n </Button>\n </Tooltip>\n <Box sx={{ gridArea: \"theme\", \"& .MuiButton-root\": { height: \"100%\", width: \"100%\" } }}>\n <ThemeEditorButton />\n </Box>\n <Box sx={{ gridArea: \"style\", \"& .MuiButton-root\": { height: \"100%\", width: \"100%\" } }}>\n <StyleEditorButton />\n </Box>\n\n <Box\n sx={{\n gridArea: \"links\",\n display: \"grid\",\n gridTemplateAreas: `\"bug changelog\"\n \"docs docs\"\n \"discord reddit\"\n \"plaza plaza\"`,\n gridTemplateColumns: \"1fr 1fr\",\n my: 1,\n }}\n >\n <Button\n startIcon={<BugReport />}\n href=\"https://github.com/danielyxie/bitburner/issues/new\"\n target=\"_blank\"\n sx={{ gridArea: \"bug\" }}\n >\n Report Bug\n </Button>\n <Button\n startIcon={<SystemUpdateAlt />}\n href=\"https://bitburner.readthedocs.io/en/latest/changelog.html\"\n target=\"_blank\"\n sx={{ gridArea: \" changelog\" }}\n >\n Changelog\n </Button>\n <Button\n startIcon={<LibraryBooks />}\n href=\"https://bitburner.readthedocs.io/en/latest/index.html\"\n target=\"_blank\"\n sx={{ gridArea: \"docs\" }}\n >\n Documentation\n </Button>\n <Button startIcon={<Chat />} href=\"https://discord.gg/TFc3hKD\" target=\"_blank\" sx={{ gridArea: \"discord\" }}>\n Discord\n </Button>\n <Button\n startIcon={<Reddit />}\n href=\"https://www.reddit.com/r/bitburner\"\n target=\"_blank\"\n sx={{ gridArea: \"reddit\" }}\n >\n Reddit\n </Button>\n </Box>\n\n {!location.href.startsWith(\"file://\") && (\n <Box sx={{ gridArea: \"devs\" }}>\n <form\n action=\"https://www.paypal.com/cgi-bin/webscr\"\n method=\"post\"\n target=\"_blank\"\n style={{ display: \"block\" }}\n >\n <Button sx={{ width: \"100%\", display: \"flex\", flexDirection: \"column\" }} type=\"submit\">\n danielyxie / BigD (Original Dev)\n <input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\" />\n <input\n type=\"hidden\"\n name=\"encrypted\"\n value=\"-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYA2Y2VGE75oWct89z//G2YEJKmzx0uDTXNrpje9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irbW4yVa0+gACaLLj0rzIzNN8P/5PxgB03D+jwkcJABqng==-----END PKCS7-----\"\n />\n <input\n type=\"image\"\n // src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif\"\n src=\"https://www.paypalobjects.com/digitalassets/c/website/marketing/apac/C2/logos-buttons/optimize/26_Yellow_PayPal_Pill_Button.png\"\n name=\"submit\"\n alt=\"PayPal - The safer, easier way to pay online!\"\n />\n </Button>\n </form>\n <Button\n href=\"https://www.google.com/search?q=Where+to+donate+blood+near+me%3F\"\n target=\"_blank\"\n sx={{\n width: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n }}\n >\n hydroflame (Current Maintainer)\n <span style={{ display: \"flex\", alignItems: \"center\" }}>\n <Bloodtype sx={{ mb: 0.5, mr: 1 }} />\n Donate blood!\n </span>\n </Button>\n </Box>\n )}\n </Box>\n <FileDiagnosticModal open={diagnosticOpen} onClose={() => setDiagnosticOpen(false)} />\n </Box>\n );\n};\n","import React from \"react\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\nimport { Modal } from \"../ui/React/Modal\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableContainer from \"@mui/material/TableContainer\";\nimport TableHead from \"@mui/material/TableHead\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\ninterface IServerProps {\n hostname: string;\n}\n\nfunction ServerAccordion(props: IServerProps): React.ReactElement {\n const server = GetServer(props.hostname);\n if (server === null) throw new Error(`server '${props.hostname}' should not be null`);\n let totalSize = 0;\n for (const f of server.scripts) {\n totalSize += f.code.length;\n }\n\n for (const f of server.textFiles) {\n totalSize += f.text.length;\n }\n\n if (totalSize === 0) {\n return <></>;\n }\n\n interface File {\n name: string;\n size: number;\n }\n\n const files: File[] = [];\n\n for (const f of server.scripts) {\n files.push({ name: f.filename, size: f.code.length });\n }\n\n for (const f of server.textFiles) {\n files.push({ name: f.fn, size: f.text.length });\n }\n\n files.sort((a: File, b: File): number => b.size - a.size);\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>\n {server.hostname} ({numeralWrapper.formatBigNumber(totalSize)}b)\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <TableContainer component={Paper}>\n <Table>\n <TableHead>\n <TableRow>\n <TableCell>\n <Typography>Filename</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>Size</Typography>\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {files.map((file: File) => (\n <TableRow key={file.name}>\n <TableCell component=\"th\" scope=\"row\">\n <Typography>{file.name}</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>{numeralWrapper.formatBigNumber(file.size)}b</Typography>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </TableContainer>\n <ul></ul>\n </AccordionDetails>\n </Accordion>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function FileDiagnosticModal(props: IProps): React.ReactElement {\n const keys: string[] = [];\n for (const key of GetAllServers()) {\n keys.push(key.hostname);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Welcome to the file diagnostic! If your save file is really big it's likely because you have too many\n text/scripts. This tool can help you narrow down where they are.\n </Typography>\n {keys.map((hostname: string) => (\n <ServerAccordion key={hostname} hostname={hostname} />\n ))}\n </>\n </Modal>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport TextField from \"@mui/material/TextField\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport SaveIcon from \"@mui/icons-material/Save\";\n\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { defaultStyles } from \"../Styles\";\nimport { Tooltip } from \"@mui/material\";\nimport { IStyleSettings } from \"../../ScriptEditor/NetscriptDefinitions\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\ninterface FontFamilyProps {\n value: React.CSSProperties[\"fontFamily\"];\n onChange: (newValue: React.CSSProperties[\"fontFamily\"], error?: string) => void;\n refreshId: number;\n}\n\nfunction FontFamilyField({ value, onChange, refreshId }: FontFamilyProps): React.ReactElement {\n const [errorText, setErrorText] = useState<string | undefined>();\n const [fontFamily, setFontFamily] = useState<React.CSSProperties[\"fontFamily\"]>(value);\n\n function update(newValue: React.CSSProperties[\"fontFamily\"]): void {\n setFontFamily(newValue);\n if (!newValue) {\n setErrorText(\"Must have a value\");\n } else {\n setErrorText(\"\");\n }\n }\n\n function onTextChange(event: React.ChangeEvent<HTMLInputElement>): void {\n update(event.target.value);\n }\n\n useEffect(() => onChange(fontFamily, errorText), [fontFamily]);\n useEffect(() => update(value), [refreshId]);\n\n return (\n <TextField\n sx={{ my: 1 }}\n label={\"Font-Family\"}\n error={!!errorText}\n value={fontFamily}\n helperText={errorText}\n onChange={onTextChange}\n fullWidth\n />\n );\n}\n\ninterface LineHeightProps {\n value: React.CSSProperties[\"lineHeight\"];\n onChange: (newValue: React.CSSProperties[\"lineHeight\"], error?: string) => void;\n refreshId: number;\n}\n\nfunction LineHeightField({ value, onChange, refreshId }: LineHeightProps): React.ReactElement {\n const [errorText, setErrorText] = useState<string | undefined>();\n const [lineHeight, setLineHeight] = useState<React.CSSProperties[\"lineHeight\"]>(value);\n\n function update(newValue: React.CSSProperties[\"lineHeight\"]): void {\n setLineHeight(newValue);\n if (!newValue) {\n setErrorText(\"Must have a value\");\n } else if (isNaN(Number(newValue))) {\n setErrorText(\"Must be a number\");\n } else {\n setErrorText(\"\");\n }\n }\n\n function onTextChange(event: React.ChangeEvent<HTMLInputElement>): void {\n update(event.target.value);\n }\n\n useEffect(() => onChange(lineHeight, errorText), [lineHeight]);\n useEffect(() => update(value), [refreshId]);\n\n return (\n <TextField\n sx={{ my: 1 }}\n label={\"Line Height\"}\n error={!!errorText}\n value={lineHeight}\n helperText={errorText}\n onChange={onTextChange}\n />\n );\n}\n\nexport function StyleEditorModal(props: IProps): React.ReactElement {\n const [refreshId, setRefreshId] = useState<number>(0);\n const [error, setError] = useState<string | undefined>();\n const [customStyle, setCustomStyle] = useState<IStyleSettings>({\n ...Settings.styles,\n });\n\n function persistToSettings(styles: IStyleSettings): void {\n Object.assign(Settings.styles, styles);\n ThemeEvents.emit();\n }\n\n function saveStyles(): void {\n persistToSettings(customStyle);\n }\n\n function setDefaults(): void {\n const styles = { ...defaultStyles };\n setCustomStyle(styles);\n persistToSettings(styles);\n setRefreshId(refreshId + 1);\n }\n\n function update(styles: IStyleSettings, errorMessage?: string): void {\n setError(errorMessage);\n if (!errorMessage) {\n setCustomStyle(styles);\n }\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography variant=\"h6\">Styles Editor</Typography>\n <Typography>\n WARNING: Changing styles <strong>may mess up</strong> the interface. Drastic changes are{\" \"}\n <strong>NOT recommended</strong>.\n </Typography>\n <Paper sx={{ p: 2, my: 2 }}>\n <FontFamilyField\n value={customStyle.fontFamily}\n refreshId={refreshId}\n onChange={(value, error) => update({ ...customStyle, fontFamily: value ?? \"\" }, error)}\n />\n <br />\n <LineHeightField\n value={customStyle.lineHeight}\n refreshId={refreshId}\n onChange={(value, error) => update({ ...customStyle, lineHeight: Number(value) ?? 0 }, error)}\n />\n <br />\n <ButtonGroup sx={{ my: 1 }}>\n <Button onClick={setDefaults} startIcon={<ReplyIcon />} color=\"secondary\" variant=\"outlined\">\n Revert to Defaults\n </Button>\n <Tooltip title={\"Save styles to settings\"}>\n <Button onClick={saveStyles} endIcon={<SaveIcon />} color={error ? \"error\" : \"primary\"} disabled={!!error}>\n Save Modifications\n </Button>\n </Tooltip>\n </ButtonGroup>\n </Paper>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport TextField from \"@mui/material/TextField\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport PaletteSharpIcon from \"@mui/icons-material/PaletteSharp\";\nimport HistoryIcon from \"@mui/icons-material/History\";\nimport { Color, ColorPicker } from \"material-ui-color\";\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { defaultTheme } from \"../Themes\";\nimport { UserInterfaceTheme } from \"../../ScriptEditor/NetscriptDefinitions\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { ThemeCollaborate } from \"./ThemeCollaborate\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\ninterface IColorEditorProps {\n name: string;\n color: string | undefined;\n onColorChange: (name: string, value: string) => void;\n defaultColor: string;\n}\n\nfunction ColorEditor({ name, onColorChange, color, defaultColor }: IColorEditorProps): React.ReactElement {\n if (color === undefined) {\n console.error(`color ${name} was undefined, reverting to default`);\n color = defaultColor;\n }\n\n return (\n <>\n <TextField\n sx={{ mx: 1 }}\n label={name}\n value={color}\n InputProps={{\n startAdornment: (\n <>\n <ColorPicker\n hideTextfield\n deferred\n value={color}\n onChange={(newColor: Color) => onColorChange(name, \"#\" + newColor.hex)}\n disableAlpha\n />\n </>\n ),\n endAdornment: (\n <>\n <IconButton onClick={() => onColorChange(name, defaultColor)}>\n <ReplyIcon color=\"primary\" />\n </IconButton>\n </>\n ),\n }}\n />\n </>\n );\n}\n\nexport function ThemeEditorModal(props: IProps): React.ReactElement {\n const [customTheme, setCustomTheme] = useState<{ [key: string]: string | undefined }>({\n ...Settings.theme,\n });\n\n function setTheme(theme: UserInterfaceTheme): void {\n setCustomTheme(theme);\n Object.assign(Settings.theme, theme);\n ThemeEvents.emit();\n }\n\n function onThemeChange(event: React.ChangeEvent<HTMLInputElement>): void {\n try {\n const importedTheme = JSON.parse(event.target.value);\n if (typeof importedTheme !== \"object\") return;\n setCustomTheme(importedTheme);\n for (const key of Object.keys(importedTheme)) {\n Settings.theme[key] = importedTheme[key];\n }\n ThemeEvents.emit();\n } catch (err) {\n // ignore\n }\n }\n\n function onColorChange(name: string, value: string): void {\n setCustomTheme((old: { [key: string]: string | undefined }) => {\n old[name] = value;\n return old;\n });\n\n Settings.theme[name] = value;\n ThemeEvents.emit();\n }\n\n function setTemplateTheme(theme: UserInterfaceTheme): void {\n setTheme(theme);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Paper sx={{ px: 1, py: 1, my: 1 }}>\n <Tooltip open={true} placement={\"top\"} title={<Typography>Example tooltip</Typography>}>\n <Button color=\"primary\" size=\"small\">\n primary button\n </Button>\n </Tooltip>\n <Button color=\"secondary\" size=\"small\">\n secondary button\n </Button>\n <Button color=\"warning\" size=\"small\">\n warning button\n </Button>\n <Button color=\"info\" size=\"small\">\n info button\n </Button>\n <Button color=\"error\" size=\"small\">\n error button\n </Button>\n <Button disabled size=\"small\">\n disabled button\n </Button>\n <br />\n <Typography color=\"primary\" variant=\"caption\">\n text with primary color\n </Typography>\n \n <Typography color=\"secondary\" variant=\"caption\">\n text with secondary color\n </Typography>\n \n <Typography color=\"error\" variant=\"caption\">\n text with error color\n </Typography>\n <br />\n <TextField value={\"Text field\"} size=\"small\" />\n </Paper>\n\n <Paper sx={{ py: 1, my: 1 }}>\n <ColorEditor\n name=\"primarylight\"\n onColorChange={onColorChange}\n color={customTheme[\"primarylight\"]}\n defaultColor={defaultTheme[\"primarylight\"]}\n />\n <ColorEditor\n name=\"primary\"\n onColorChange={onColorChange}\n color={customTheme[\"primary\"]}\n defaultColor={defaultTheme[\"primary\"]}\n />\n <ColorEditor\n name=\"primarydark\"\n onColorChange={onColorChange}\n color={customTheme[\"primarydark\"]}\n defaultColor={defaultTheme[\"primarydark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"successlight\"\n onColorChange={onColorChange}\n color={customTheme[\"successlight\"]}\n defaultColor={defaultTheme[\"successlight\"]}\n />\n <ColorEditor\n name=\"success\"\n onColorChange={onColorChange}\n color={customTheme[\"success\"]}\n defaultColor={defaultTheme[\"success\"]}\n />\n <ColorEditor\n name=\"successdark\"\n onColorChange={onColorChange}\n color={customTheme[\"successdark\"]}\n defaultColor={defaultTheme[\"successdark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"errorlight\"\n onColorChange={onColorChange}\n color={customTheme[\"errorlight\"]}\n defaultColor={defaultTheme[\"errorlight\"]}\n />\n <ColorEditor\n name=\"error\"\n onColorChange={onColorChange}\n color={customTheme[\"error\"]}\n defaultColor={defaultTheme[\"error\"]}\n />\n <ColorEditor\n name=\"errordark\"\n onColorChange={onColorChange}\n color={customTheme[\"errordark\"]}\n defaultColor={defaultTheme[\"errordark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"secondarylight\"\n onColorChange={onColorChange}\n color={customTheme[\"secondarylight\"]}\n defaultColor={defaultTheme[\"secondarylight\"]}\n />\n <ColorEditor\n name=\"secondary\"\n onColorChange={onColorChange}\n color={customTheme[\"secondary\"]}\n defaultColor={defaultTheme[\"secondary\"]}\n />\n <ColorEditor\n name=\"secondarydark\"\n onColorChange={onColorChange}\n color={customTheme[\"secondarydark\"]}\n defaultColor={defaultTheme[\"secondarydark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"warninglight\"\n onColorChange={onColorChange}\n color={customTheme[\"warninglight\"]}\n defaultColor={defaultTheme[\"warninglight\"]}\n />\n <ColorEditor\n name=\"warning\"\n onColorChange={onColorChange}\n color={customTheme[\"warning\"]}\n defaultColor={defaultTheme[\"warning\"]}\n />\n <ColorEditor\n name=\"warningdark\"\n onColorChange={onColorChange}\n color={customTheme[\"warningdark\"]}\n defaultColor={defaultTheme[\"warningdark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"infolight\"\n onColorChange={onColorChange}\n color={customTheme[\"infolight\"]}\n defaultColor={defaultTheme[\"infolight\"]}\n />\n <ColorEditor\n name=\"info\"\n onColorChange={onColorChange}\n color={customTheme[\"info\"]}\n defaultColor={defaultTheme[\"info\"]}\n />\n <ColorEditor\n name=\"infodark\"\n onColorChange={onColorChange}\n color={customTheme[\"infodark\"]}\n defaultColor={defaultTheme[\"infodark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"welllight\"\n onColorChange={onColorChange}\n color={customTheme[\"welllight\"]}\n defaultColor={defaultTheme[\"welllight\"]}\n />\n <ColorEditor\n name=\"well\"\n onColorChange={onColorChange}\n color={customTheme[\"well\"]}\n defaultColor={defaultTheme[\"well\"]}\n />\n <ColorEditor\n name=\"white\"\n onColorChange={onColorChange}\n color={customTheme[\"white\"]}\n defaultColor={defaultTheme[\"white\"]}\n />\n <ColorEditor\n name=\"black\"\n onColorChange={onColorChange}\n color={customTheme[\"black\"]}\n defaultColor={defaultTheme[\"black\"]}\n />\n <ColorEditor\n name=\"backgroundprimary\"\n onColorChange={onColorChange}\n color={customTheme[\"backgroundprimary\"]}\n defaultColor={defaultTheme[\"backgroundprimary\"]}\n />\n <ColorEditor\n name=\"backgroundsecondary\"\n onColorChange={onColorChange}\n color={customTheme[\"backgroundsecondary\"]}\n defaultColor={defaultTheme[\"backgroundsecondary\"]}\n />\n <ColorEditor\n name=\"button\"\n onColorChange={onColorChange}\n color={customTheme[\"button\"]}\n defaultColor={defaultTheme[\"button\"]}\n />\n\n <br />\n <ColorEditor\n name=\"hp\"\n onColorChange={onColorChange}\n color={customTheme[\"hp\"]}\n defaultColor={defaultTheme[\"hp\"]}\n />\n <ColorEditor\n name=\"money\"\n onColorChange={onColorChange}\n color={customTheme[\"money\"]}\n defaultColor={defaultTheme[\"money\"]}\n />\n <ColorEditor\n name=\"hack\"\n onColorChange={onColorChange}\n color={customTheme[\"hack\"]}\n defaultColor={defaultTheme[\"hack\"]}\n />\n <ColorEditor\n name=\"combat\"\n onColorChange={onColorChange}\n color={customTheme[\"combat\"]}\n defaultColor={defaultTheme[\"combat\"]}\n />\n <ColorEditor\n name=\"cha\"\n onColorChange={onColorChange}\n color={customTheme[\"cha\"]}\n defaultColor={defaultTheme[\"cha\"]}\n />\n <ColorEditor\n name=\"int\"\n onColorChange={onColorChange}\n color={customTheme[\"int\"]}\n defaultColor={defaultTheme[\"int\"]}\n />\n <ColorEditor\n name=\"rep\"\n onColorChange={onColorChange}\n color={customTheme[\"rep\"]}\n defaultColor={defaultTheme[\"rep\"]}\n />\n <ColorEditor\n name=\"disabled\"\n onColorChange={onColorChange}\n color={customTheme[\"disabled\"]}\n defaultColor={defaultTheme[\"disabled\"]}\n />\n </Paper>\n\n <Paper sx={{ px: 1, py: 1, my: 1 }}>\n <TextField\n sx={{ mb: 1 }}\n multiline\n fullWidth\n maxRows={10}\n label={\"import / export theme\"}\n value={JSON.stringify(customTheme, undefined, 2)}\n onChange={onThemeChange}\n />\n <>\n <Typography sx={{ my: 1 }}>Backup your theme or share it with others by copying the string above.</Typography>\n <ThemeCollaborate />\n <ButtonGroup>\n <Tooltip title=\"Reverts all modification back to the default theme. This is permanent.\">\n <Button onClick={() => setTemplateTheme(defaultTheme)} startIcon={<HistoryIcon />}>\n Revert to Default\n </Button>\n </Tooltip>\n <Tooltip title=\"Move over to the theme browser's page to use one of our predefined themes.\">\n <Button startIcon={<PaletteSharpIcon />} onClick={() => Router.toThemeBrowser()}>\n See more themes\n </Button>\n </Tooltip>\n </ButtonGroup>\n </>\n </Paper>\n </Modal>\n );\n}\n","import React from \"react\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { Player } from \"@player\";\n\nexport const GameplayPage = (): React.ReactElement => {\n return (\n <GameOptionsPage title=\"Gameplay\">\n <OptionSwitch\n checked={Settings.SuppressMessages}\n onChange={(newValue) => (Settings.SuppressMessages = newValue)}\n text=\"Suppress story messages\"\n tooltip={\n <>\n If this is set, then any messages you receive will not appear as popups on the screen. They will still get\n sent to your home computer as '.msg' files and can be viewed with the 'cat' Terminal command.\n </>\n }\n />\n <OptionSwitch\n checked={Settings.SuppressFactionInvites}\n onChange={(newValue) => (Settings.SuppressFactionInvites = newValue)}\n text=\"Suppress faction invites\"\n tooltip={\n <>\n If this is set, then any faction invites you receive will not appear as popups on the screen. Your\n outstanding faction invites can be viewed in the 'Factions' page.\n </>\n }\n />\n <OptionSwitch\n checked={Settings.SuppressTravelConfirmation}\n onChange={(newValue) => (Settings.SuppressTravelConfirmation = newValue)}\n text=\"Suppress travel confirmations\"\n tooltip={\n <>\n If this is set, the confirmation message before traveling will not show up. You will automatically be\n deducted the travel cost as soon as you click.\n </>\n }\n />\n <OptionSwitch\n checked={Settings.SuppressBuyAugmentationConfirmation}\n onChange={(newValue) => (Settings.SuppressBuyAugmentationConfirmation = newValue)}\n text=\"Suppress augmentations confirmation\"\n tooltip={<>If this is set, the confirmation message before buying augmentation will not show up.</>}\n />\n <OptionSwitch\n checked={Settings.SuppressTIXPopup}\n onChange={(newValue) => (Settings.SuppressTIXPopup = newValue)}\n text=\"Suppress TIX messages\"\n tooltip={<>If this is set, the stock market will never create any popup.</>}\n />\n {Player.bladeburner && (\n <OptionSwitch\n checked={Settings.SuppressBladeburnerPopup}\n onChange={(newValue) => (Settings.SuppressBladeburnerPopup = newValue)}\n text=\"Suppress bladeburner popup\"\n tooltip={\n <>\n If this is set, then having your Bladeburner actions interrupted by being busy with something else will\n not display a popup message.\n </>\n }\n />\n )}\n </GameOptionsPage>\n );\n};\n","import React, { useState } from \"react\";\nimport { MenuItem, Select, SelectChangeEvent, TextField, Tooltip, Typography } from \"@mui/material\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { formatTime } from \"../../utils/helpers/formatTime\";\n\nexport const InterfacePage = (): React.ReactElement => {\n const [timestampFormat, setTimestampFormat] = useState(Settings.TimestampsFormat);\n const [locale, setLocale] = useState(Settings.Locale);\n\n function handleLocaleChange(event: SelectChangeEvent<string>): void {\n setLocale(event.target.value);\n Settings.Locale = event.target.value;\n }\n function handleTimestampFormatChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setTimestampFormat(event.target.value);\n Settings.TimestampsFormat = event.target.value;\n }\n return (\n <GameOptionsPage title=\"Interface\">\n <OptionSwitch\n checked={Settings.DisableASCIIArt}\n onChange={(newValue) => (Settings.DisableASCIIArt = newValue)}\n text=\"Disable ascii art\"\n tooltip={<>If this is set all ASCII art will be disabled.</>}\n />\n <OptionSwitch\n checked={Settings.DisableTextEffects}\n onChange={(newValue) => (Settings.DisableTextEffects = newValue)}\n text=\"Disable text effects\"\n tooltip={\n <>\n If this is set, text effects will not be displayed. This can help if text is difficult to read in certain\n areas.\n </>\n }\n />\n <OptionSwitch\n checked={Settings.DisableOverviewProgressBars}\n onChange={(newValue) => (Settings.DisableOverviewProgressBars = newValue)}\n text=\"Disable Overview Progress Bars\"\n tooltip={<>If this is set, the progress bars in the character overview will be hidden.</>}\n />\n <OptionSwitch\n checked={Settings.UseIEC60027_2}\n onChange={(newValue) => (Settings.UseIEC60027_2 = newValue)}\n text=\"Use GiB instead of GB\"\n tooltip={\n <>If this is set all references to memory will use GiB instead of GB, in accordance with IEC 60027-2.</>\n }\n />\n <OptionSwitch\n checked={Settings.ShowMiddleNullTimeUnit}\n onChange={(newValue) => (Settings.ShowMiddleNullTimeUnit = newValue)}\n text=\"Show all intermediary times unit, even when null.\"\n tooltip={<>ex : 1 hours 13 seconds becomes 1 hours 0 minutes 13 seconds.</>}\n />\n <Tooltip\n title={\n <Typography>\n Terminal commands and log entries will be timestamped. See https://date-fns.org/docs/Getting-Started/\n </Typography>\n }\n >\n <TextField\n key={\"timestampFormat\"}\n InputProps={{\n startAdornment: (\n <Typography\n color={formatTime(timestampFormat) === \"format error\" && timestampFormat !== \"\" ? \"error\" : \"success\"}\n >\n Timestamp format: \n </Typography>\n ),\n }}\n value={timestampFormat}\n onChange={handleTimestampFormatChange}\n placeholder=\"yyyy-MM-dd hh:mm:ss\"\n />\n </Tooltip>\n <Typography>\n Example timestamp: {timestampFormat !== \"\" ? formatTime(timestampFormat) : \"no timestamp\"}\n </Typography>\n <br />\n\n <Select startAdornment={<Typography>Locale </Typography>} value={locale} onChange={handleLocaleChange}>\n <MenuItem value=\"en\">en</MenuItem>\n <MenuItem value=\"bg\">bg</MenuItem>\n <MenuItem value=\"cs\">cs</MenuItem>\n <MenuItem value=\"da-dk\">da-dk</MenuItem>\n <MenuItem value=\"de\">de</MenuItem>\n <MenuItem value=\"en-au\">en-au</MenuItem>\n <MenuItem value=\"en-gb\">en-gb</MenuItem>\n <MenuItem value=\"es\">es</MenuItem>\n <MenuItem value=\"fr\">fr</MenuItem>\n <MenuItem value=\"hu\">hu</MenuItem>\n <MenuItem value=\"it\">it</MenuItem>\n <MenuItem value=\"lv\">lv</MenuItem>\n <MenuItem value=\"no\">no</MenuItem>\n <MenuItem value=\"pl\">pl</MenuItem>\n <MenuItem value=\"ru\">ru</MenuItem>\n </Select>\n </GameOptionsPage>\n );\n};\n","import React from \"react\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\n\nexport const MiscPage = (): React.ReactElement => {\n return (\n <GameOptionsPage title=\"Misc\">\n <OptionSwitch\n checked={Settings.DisableHotkeys}\n onChange={(newValue) => (Settings.DisableHotkeys = newValue)}\n text=\"Disable hotkeys\"\n tooltip={\n <>\n If this is set, then most hotkeys (keyboard shortcuts) in the game are disabled. This includes Terminal\n commands, hotkeys to navigate between different parts of the game, and the \"Save and Close (Ctrl + b)\"\n hotkey in the Text Editor.\n </>\n }\n />\n <OptionSwitch\n checked={Settings.EnableBashHotkeys}\n onChange={(newValue) => (Settings.EnableBashHotkeys = newValue)}\n text=\"Enable bash hotkeys\"\n tooltip={\n <>\n Improved Bash emulation mode. Setting this to 1 enables several new Terminal shortcuts and features that\n more closely resemble a real Bash-style shell. Note that when this mode is enabled, the default browser\n shortcuts are overridden by the new Bash shortcuts.\n </>\n }\n />\n </GameOptionsPage>\n );\n};\n","import React, { useState } from \"react\";\nimport { Button, Link, TextField, Tooltip, Typography } from \"@mui/material\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { ConnectionBauble } from \"./ConnectionBauble\";\nimport { isRemoteFileApiConnectionLive, newRemoteFileApiConnection } from \"../../RemoteFileAPI/RemoteFileAPI\";\n\nexport const RemoteAPIPage = (): React.ReactElement => {\n const [remoteFileApiPort, setRemoteFileApiPort] = useState(Settings.RemoteFileApiPort);\n\n function handleRemoteFileApiPortChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setRemoteFileApiPort(Number(event.target.value) as number);\n Settings.RemoteFileApiPort = Number(event.target.value);\n }\n\n return (\n <GameOptionsPage title=\"Remote API\">\n <Typography>\n These settings control the Remote API for bitburner. This is typically used to write scripts using an external\n text editor and then upload files to the home server.\n </Typography>\n <Typography>\n <Link href=\"https://bitburner.readthedocs.io/en/latest/remoteapi.html\" target=\"_blank\">\n Documentation\n </Link>\n </Typography>\n <ConnectionBauble isConnected={isRemoteFileApiConnectionLive} />\n <Tooltip\n title={\n <Typography>\n This port number is used to connect to a Remote API port, please ensure that it matches with your Remote API\n server port. Set to 0 to disable the feature.\n </Typography>\n }\n >\n <TextField\n key={\"remoteAPIPort\"}\n InputProps={{\n startAdornment: (\n <Typography color={remoteFileApiPort > 0 && remoteFileApiPort <= 65535 ? \"success\" : \"error\"}>\n Port: \n </Typography>\n ),\n endAdornment: <Button onClick={newRemoteFileApiConnection}>Connect</Button>,\n }}\n value={remoteFileApiPort}\n onChange={handleRemoteFileApiPortChange}\n placeholder=\"12525\"\n />\n </Tooltip>\n </GameOptionsPage>\n );\n};\n","import { Typography } from \"@mui/material\";\nimport React, { useState, useEffect } from \"react\";\nimport WifiIcon from \"@mui/icons-material/Wifi\";\nimport WifiOffIcon from \"@mui/icons-material/WifiOff\";\n\ninterface baubleProps {\n isConnected: () => boolean;\n}\n\nexport const ConnectionBauble = (props: baubleProps): React.ReactElement => {\n const [connection, setConnection] = useState(props.isConnected());\n\n useEffect(() => {\n const timer = setInterval(() => {\n setConnection(props.isConnected());\n }, 1000);\n return () => clearInterval(timer);\n });\n\n return (\n <>\n <Typography>\n Status: \n <Typography component=\"span\" color={connection ? \"primary\" : \"error\"}>\n {connection ? (\n <>\n Online \n <WifiIcon />\n </>\n ) : (\n <>\n Offline \n <WifiOffIcon />\n </>\n )}\n </Typography>\n </Typography>\n </>\n );\n};\n","import { RFAMessage } from \"./MessageDefinitions\";\nimport { RFARequestHandler } from \"./MessageHandlers\";\nimport { SnackbarEvents, ToastVariant } from \"../ui/React/Snackbar\";\n\nexport class Remote {\n connection?: WebSocket;\n static protocol = \"ws\";\n ipaddr: string;\n port: number;\n\n constructor(ip: string, port: number) {\n this.ipaddr = ip;\n this.port = port;\n }\n\n public stopConnection(): void {\n this.connection?.close();\n }\n\n public startConnection(): void {\n const address = Remote.protocol + \"://\" + this.ipaddr + \":\" + this.port;\n this.connection = new WebSocket(address);\n\n this.connection.addEventListener(\"error\", (e: Event) =>\n SnackbarEvents.emit(`Error with websocket ${address}, details: ${JSON.stringify(e)}`, ToastVariant.ERROR, 5000),\n );\n this.connection.addEventListener(\"message\", handleMessageEvent);\n this.connection.addEventListener(\"open\", () =>\n SnackbarEvents.emit(\n `Remote API connection established on ${this.ipaddr}:${this.port}`,\n ToastVariant.SUCCESS,\n 2000,\n ),\n );\n this.connection.addEventListener(\"close\", () =>\n SnackbarEvents.emit(\"Remote API connection closed\", ToastVariant.WARNING, 2000),\n );\n }\n}\n\nfunction handleMessageEvent(this: WebSocket, e: MessageEvent): void {\n const msg: RFAMessage = JSON.parse(e.data);\n\n if (!msg.method || !RFARequestHandler[msg.method]) {\n const response = new RFAMessage({ error: \"Unknown message received\", id: msg.id });\n this.send(JSON.stringify(response));\n return;\n }\n const response = RFARequestHandler[msg.method](msg);\n if (!response) return;\n this.send(JSON.stringify(response));\n}\n","import React, { useState } from \"react\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { OptionsSlider } from \"./OptionsSlider\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\n\nexport const SystemPage = (): React.ReactElement => {\n const [execTime, setExecTime] = useState(Settings.CodeInstructionRunTime);\n const [recentScriptsSize, setRecentScriptsSize] = useState(Settings.MaxRecentScriptsCapacity);\n const [logSize, setLogSize] = useState(Settings.MaxLogCapacity);\n const [portSize, setPortSize] = useState(Settings.MaxPortCapacity);\n const [terminalSize, setTerminalSize] = useState(Settings.MaxTerminalCapacity);\n const [autosaveInterval, setAutosaveInterval] = useState(Settings.AutosaveInterval);\n\n function handlePortSizeChange(\n _event: Event | React.SyntheticEvent<Element, Event>,\n newValue: number | number[],\n ): void {\n setPortSize(newValue as number);\n Settings.MaxPortCapacity = newValue as number;\n }\n\n function handleTerminalSizeChange(\n _event: Event | React.SyntheticEvent<Element, Event>,\n newValue: number | number[],\n ): void {\n setTerminalSize(newValue as number);\n Settings.MaxTerminalCapacity = newValue as number;\n }\n\n function handleExecTimeChange(\n _event: Event | React.SyntheticEvent<Element, Event>,\n newValue: number | number[],\n ): void {\n setExecTime(newValue as number);\n Settings.CodeInstructionRunTime = newValue as number;\n }\n\n function handleRecentScriptsSizeChange(\n _event: Event | React.SyntheticEvent<Element, Event>,\n newValue: number | number[],\n ): void {\n setRecentScriptsSize(newValue as number);\n Settings.MaxRecentScriptsCapacity = newValue as number;\n }\n\n function handleLogSizeChange(\n _event: Event | React.SyntheticEvent<Element, Event>,\n newValue: number | number[],\n ): void {\n setLogSize(newValue as number);\n Settings.MaxLogCapacity = newValue as number;\n }\n\n function handleAutosaveIntervalChange(\n _event: Event | React.SyntheticEvent<Element, Event>,\n newValue: number | number[],\n ): void {\n setAutosaveInterval(newValue as number);\n Settings.AutosaveInterval = newValue as number;\n }\n return (\n <GameOptionsPage title=\"System\">\n {/* Wrap in a React fragment to prevent the sliders from breaking as list items */}\n <>\n <OptionsSlider\n label=\".script exec time (ms)\"\n initialValue={execTime}\n callback={handleExecTimeChange}\n step={1}\n min={5}\n max={100}\n tooltip={\n <>\n The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too low can\n result in poor performance if you have many scripts running.\n </>\n }\n />\n <OptionsSlider\n label=\"Recently killed scripts size\"\n initialValue={recentScriptsSize}\n callback={handleRecentScriptsSizeChange}\n step={25}\n min={0}\n max={500}\n tooltip={<>The maximum number of recently killed scripts the game will keep.</>}\n />\n <OptionsSlider\n label=\"Netscript log size\"\n initialValue={logSize}\n callback={handleLogSizeChange}\n step={20}\n min={20}\n max={500}\n tooltip={\n <>\n The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a\n lot of memory if you have many scripts running.\n </>\n }\n />\n <OptionsSlider\n label=\"Netscript port size\"\n initialValue={portSize}\n callback={handlePortSizeChange}\n step={1}\n min={20}\n max={100}\n tooltip={\n <>\n The maximum number of entries that can be written to a port using Netscript's write() function. Setting\n this too high can cause the game to use a lot of memory.\n </>\n }\n />\n <OptionsSlider\n label=\"Terminal capacity\"\n initialValue={terminalSize}\n callback={handleTerminalSizeChange}\n step={50}\n min={50}\n max={500}\n tooltip={\n <>\n The maximum number of entries that can be written to the terminal. Setting this too high can cause the\n game to use a lot of memory.\n </>\n }\n marks\n />\n <OptionsSlider\n label=\"Autosave interval (s)\"\n initialValue={autosaveInterval}\n callback={handleAutosaveIntervalChange}\n step={30}\n min={0}\n max={600}\n tooltip={<>The time (in seconds) between each autosave. Set to 0 to disable autosave.</>}\n marks\n />\n </>\n <OptionSwitch\n checked={Settings.SuppressSavedGameToast}\n onChange={(newValue) => (Settings.SuppressSavedGameToast = newValue)}\n text=\"Suppress Auto-Save Game Toast\"\n tooltip={<>If this is set, there will be no \"Game Saved!\" toast appearing after an auto-save.</>}\n />\n <OptionSwitch\n checked={Settings.SuppressAutosaveDisabledWarnings}\n onChange={(newValue) => (Settings.SuppressAutosaveDisabledWarnings = newValue)}\n text=\"Suppress Auto-Save Disabled Warning\"\n tooltip={<>If this is set, there will be no warning triggered when auto-save is disabled (at 0).</>}\n />\n <OptionSwitch\n checked={Settings.SaveGameOnFileSave}\n onChange={(newValue) => (Settings.SaveGameOnFileSave = newValue)}\n text=\"Save game on file save\"\n tooltip={<>Save your game any time a file is saved in the script editor.</>}\n />\n <OptionSwitch\n checked={Settings.ExcludeRunningScriptsFromSave}\n onChange={(newValue) => (Settings.ExcludeRunningScriptsFromSave = newValue)}\n text=\"Exclude Running Scripts from Save\"\n tooltip={\n <>\n If this is set, the save file will exclude all running scripts. This is only useful if your save is lagging\n a lot. You'll have to restart your script every time you launch the game.\n </>\n }\n />\n </GameOptionsPage>\n );\n};\n","import React, { useState, useEffect } from \"react\";\n\nimport { Box, Typography, Button, Container } from \"@mui/material\";\n\nimport { Player } from \"@player\";\n\nimport { SleeveElem } from \"./SleeveElem\";\nimport { FAQModal } from \"./FAQModal\";\n\nexport function SleeveRoot(): React.ReactElement {\n const [FAQOpen, setFAQOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <>\n <Container disableGutters maxWidth=\"md\" sx={{ mx: 0 }}>\n <Typography variant=\"h4\">Sleeves</Typography>\n <Typography>\n Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciousness has been copied. In\n other words, these Synthoids contain a perfect duplicate of your mind.\n <br />\n <br />\n Sleeves can be used to perform different tasks synchronously.\n <br />\n <br />\n </Typography>\n </Container>\n\n <Button onClick={() => setFAQOpen(true)}>FAQ</Button>\n <Button\n href=\"https://bitburner.readthedocs.io/en/latest/advancedgameplay/sleeves.html#duplicate-sleeves\"\n target=\"_blank\"\n >\n Wiki Documentation\n </Button>\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"repeat(2, 1fr)\", mt: 1 }}>\n {Player.sleeves.map((sleeve, i) => (\n <SleeveElem key={i} rerender={rerender} sleeve={sleeve} />\n ))}\n </Box>\n <FAQModal open={FAQOpen} onClose={() => setFAQOpen(false)} />\n </>\n );\n}\n","import { Box, Button, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { FactionWorkType } from \"../../../Work/data/FactionWorkType\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Player } from \"@player\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { ProgressBar } from \"../../../ui/React/Progress\";\nimport { Sleeve } from \"../Sleeve\";\nimport { MoreStatsModal } from \"./MoreStatsModal\";\nimport { SleeveAugmentationsModal } from \"./SleeveAugmentationsModal\";\nimport { EarningsElement, StatsElement } from \"./StatsElement\";\nimport { TaskSelector } from \"./TaskSelector\";\nimport { TravelModal } from \"./TravelModal\";\nimport { isSleeveClassWork } from \"../Work/SleeveClassWork\";\nimport { isSleeveSynchroWork } from \"../Work/SleeveSynchroWork\";\nimport { isSleeveRecoveryWork } from \"../Work/SleeveRecoveryWork\";\nimport { isSleeveFactionWork } from \"../Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../Work/SleeveCompanyWork\";\nimport { isSleeveInfiltrateWork } from \"../Work/SleeveInfiltrateWork\";\nimport { isSleeveSupportWork } from \"../Work/SleeveSupportWork\";\nimport { isSleeveBladeburnerWork } from \"../Work/SleeveBladeburnerWork\";\nimport { isSleeveCrimeWork } from \"../Work/SleeveCrimeWork\";\n\ninterface IProps {\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function SleeveElem(props: IProps): React.ReactElement {\n const [statsOpen, setStatsOpen] = useState(false);\n const [travelOpen, setTravelOpen] = useState(false);\n const [augmentationsOpen, setAugmentationsOpen] = useState(false);\n\n const [abc, setABC] = useState([\"------\", \"------\", \"------\"]);\n\n function setTask(): void {\n switch (abc[0]) {\n case \"------\":\n break;\n case \"Work for Company\":\n props.sleeve.workForCompany(abc[1]);\n break;\n case \"Work for Faction\":\n props.sleeve.workForFaction(abc[1], abc[2]);\n break;\n case \"Commit Crime\":\n props.sleeve.commitCrime(abc[1]);\n break;\n case \"Take University Course\":\n props.sleeve.takeUniversityCourse(abc[2], abc[1]);\n break;\n case \"Workout at Gym\":\n props.sleeve.workoutAtGym(abc[2], abc[1]);\n break;\n case \"Perform Bladeburner Actions\":\n props.sleeve.bladeburner(abc[1], abc[2]);\n break;\n case \"Shock Recovery\":\n props.sleeve.shockRecovery();\n break;\n case \"Synchronize\":\n props.sleeve.synchronize();\n break;\n default:\n console.error(`Invalid/Unrecognized taskValue in setSleeveTask(): ${abc[0]}`);\n }\n props.rerender();\n }\n\n let desc = <>This sleeve is currently idle</>;\n\n if (isSleeveCrimeWork(props.sleeve.currentWork)) {\n const w = props.sleeve.currentWork;\n const crime = w.getCrime();\n desc = (\n <>\n This sleeve is currently attempting to {crime.type} (Success Rate:{\" \"}\n {numeralWrapper.formatPercentage(crime.successRate(props.sleeve))}).\n </>\n );\n }\n\n if (isSleeveClassWork(props.sleeve.currentWork)) {\n if (props.sleeve.currentWork.isGym())\n desc = <>This sleeve is currently working out at {props.sleeve.currentWork.location}.</>;\n else desc = <>This sleeve is currently studying at {props.sleeve.currentWork.location}.</>;\n }\n if (isSleeveSynchroWork(props.sleeve.currentWork)) {\n desc = (\n <>\n This sleeve is currently set to synchronize with the original consciousness. This causes the Sleeve's\n synchronization to increase.\n </>\n );\n }\n if (isSleeveRecoveryWork(props.sleeve.currentWork)) {\n desc = (\n <>\n This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a faster\n rate.\n </>\n );\n }\n if (isSleeveFactionWork(props.sleeve.currentWork)) {\n let doing = \"nothing\";\n switch (props.sleeve.currentWork.factionWorkType) {\n case FactionWorkType.FIELD:\n doing = \"Field work\";\n break;\n case FactionWorkType.HACKING:\n doing = \"Hacking contracts\";\n break;\n case FactionWorkType.SECURITY:\n doing = \"Security work\";\n break;\n }\n desc = (\n <>\n This sleeve is currently doing {doing} for {props.sleeve.currentWork.factionName}.\n </>\n );\n }\n if (isSleeveCompanyWork(props.sleeve.currentWork)) {\n desc = <>This sleeve is currently working your job at {props.sleeve.currentWork.companyName}.</>;\n }\n\n if (isSleeveBladeburnerWork(props.sleeve.currentWork)) {\n const w = props.sleeve.currentWork;\n desc = (\n <>\n This sleeve is currently attempting to perform {w.actionName}. (\n {((100 * w.cyclesWorked) / w.cyclesNeeded(props.sleeve)).toFixed(2)}%)\n </>\n );\n }\n\n if (isSleeveInfiltrateWork(props.sleeve.currentWork)) {\n const w = props.sleeve.currentWork;\n desc = (\n <>\n This sleeve is currently attempting to infiltrate synthoids communities. (\n {((100 * w.cyclesWorked) / w.cyclesNeeded()).toFixed(2)}%)\n </>\n );\n }\n\n if (isSleeveSupportWork(props.sleeve.currentWork)) {\n desc = <>This sleeve is currently supporting you in your bladeburner activities.</>;\n }\n\n return (\n <>\n <Paper sx={{ p: 1, display: \"grid\", gridTemplateColumns: \"1fr 1fr\", width: \"auto\", gap: 1 }}>\n <span>\n <StatsElement sleeve={props.sleeve} />\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"1fr 1fr\", width: \"100%\" }}>\n <Button onClick={() => setStatsOpen(true)}>More Stats</Button>\n <Tooltip title={Player.money < CONSTANTS.TravelCost ? <Typography>Insufficient funds</Typography> : \"\"}>\n <span>\n <Button\n onClick={() => setTravelOpen(true)}\n disabled={Player.money < CONSTANTS.TravelCost}\n sx={{ width: \"100%\", height: \"100%\" }}\n >\n Travel\n </Button>\n </span>\n </Tooltip>\n <Tooltip\n title={props.sleeve.shock < 100 ? <Typography>Unlocked when sleeve has fully recovered</Typography> : \"\"}\n >\n <span>\n <Button\n onClick={() => setAugmentationsOpen(true)}\n disabled={props.sleeve.shock < 100}\n sx={{ width: \"100%\", height: \"100%\" }}\n >\n Manage Augmentations\n </Button>\n </span>\n </Tooltip>\n </Box>\n </span>\n <span>\n <EarningsElement sleeve={props.sleeve} />\n <TaskSelector sleeve={props.sleeve} setABC={setABC} />\n <Button onClick={setTask} sx={{ width: \"100%\" }}>\n Set Task\n </Button>\n <Typography>{desc}</Typography>\n <Typography>\n {isSleeveCrimeWork(props.sleeve.currentWork) && (\n <ProgressBar\n variant=\"determinate\"\n value={(props.sleeve.currentWork.cyclesWorked / props.sleeve.currentWork.cyclesNeeded()) * 100}\n color=\"primary\"\n />\n )}\n {isSleeveBladeburnerWork(props.sleeve.currentWork) && (\n <ProgressBar\n variant=\"determinate\"\n value={\n (props.sleeve.currentWork.cyclesWorked / props.sleeve.currentWork.cyclesNeeded(props.sleeve)) * 100\n }\n color=\"primary\"\n />\n )}\n </Typography>\n </span>\n </Paper>\n <MoreStatsModal open={statsOpen} onClose={() => setStatsOpen(false)} sleeve={props.sleeve} />\n <TravelModal\n open={travelOpen}\n onClose={() => setTravelOpen(false)}\n sleeve={props.sleeve}\n rerender={props.rerender}\n />\n <SleeveAugmentationsModal\n open={augmentationsOpen}\n onClose={() => setAugmentationsOpen(false)}\n sleeve={props.sleeve}\n />\n </>\n );\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../../../utils/StringHelperFunctions\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Typography } from \"@mui/material\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport React from \"react\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function MoreStatsModal(props: IProps): React.ReactElement {\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <StatsTable\n rows={[\n [\n <>Hacking: </>,\n props.sleeve.skills.hacking,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.hacking)} exp)</>,\n ],\n [\n <>Strength: </>,\n props.sleeve.skills.strength,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.strength)} exp)</>,\n ],\n [\n <>Defense: </>,\n props.sleeve.skills.defense,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.defense)} exp)</>,\n ],\n [\n <>Dexterity: </>,\n props.sleeve.skills.dexterity,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.dexterity)} exp)</>,\n ],\n [\n <>Agility: </>,\n props.sleeve.skills.agility,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.agility)} exp)</>,\n ],\n [\n <>Charisma: </>,\n props.sleeve.skills.charisma,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.charisma)} exp)</>,\n ],\n ]}\n title=\"Stats:\"\n />\n <br />\n <StatsTable\n rows={[\n [<>Hacking Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.hacking)],\n [<>Hacking Experience multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.hacking_exp)],\n [<>Strength Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.strength)],\n [\n <>Strength Experience multiplier: </>,\n numeralWrapper.formatPercentage(props.sleeve.mults.strength_exp),\n ],\n [<>Defense Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.defense)],\n [<>Defense Experience multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.defense_exp)],\n [<>Dexterity Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.dexterity)],\n [\n <>Dexterity Experience multiplier: </>,\n numeralWrapper.formatPercentage(props.sleeve.mults.dexterity_exp),\n ],\n [<>Agility Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.agility)],\n [<>Agility Experience multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.agility_exp)],\n [<>Charisma Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.charisma)],\n [\n <>Charisma Experience multiplier: </>,\n numeralWrapper.formatPercentage(props.sleeve.mults.charisma_exp),\n ],\n [\n <>Faction Reputation Gain multiplier: </>,\n numeralWrapper.formatPercentage(props.sleeve.mults.faction_rep),\n ],\n [\n <>Company Reputation Gain multiplier: </>,\n numeralWrapper.formatPercentage(props.sleeve.mults.company_rep),\n ],\n [<>Salary multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.work_money)],\n [<>Crime Money multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.crime_money)],\n [<>Crime Success multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.mults.crime_success)],\n ]}\n title=\"Multipliers:\"\n />\n\n {/* Check for storedCycles to be a bit over 0 to prevent jittering */}\n {props.sleeve.storedCycles > 10 && (\n <Typography sx={{ py: 2 }}>\n Bonus Time: {convertTimeMsToTimeElapsedString(props.sleeve.storedCycles * CONSTANTS.MilliPerCycle)}\n </Typography>\n )}\n </Modal>\n );\n}\n","import { Container, Typography, Paper } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { PurchasableAugmentations } from \"../../../Augmentation/ui/PurchasableAugmentations\";\nimport { Player } from \"@player\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { Sleeve } from \"../Sleeve\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function SleeveAugmentationsModal(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 150);\n return () => clearInterval(id);\n }, []);\n\n // Array of all owned Augmentations. Names only\n const ownedAugNames = props.sleeve.augmentations.map((e) => e.name);\n\n // You can only purchase Augmentations that are actually available from\n // your factions. I.e. you must be in a faction that has the Augmentation\n // and you must also have enough rep in that faction in order to purchase it.\n const availableAugs = props.sleeve.findPurchasableAugs();\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Container component={Paper} disableGutters maxWidth=\"lg\" sx={{ mx: 0, mb: 1, p: 1 }}>\n <Typography>\n You can purchase Augmentations for your Duplicate Sleeves. These Augmentations have the same effect as they\n would for you. You can only purchase Augmentations that you have unlocked through Factions.\n <br />\n <br />\n When purchasing an Augmentation for a Duplicate Sleeve, they are immediately installed. This means that the\n Duplicate Sleeve will immediately lose all of its stat experience.\n <br />\n <br />\n Augmentations will appear below as they become available.\n </Typography>\n </Container>\n <PurchasableAugmentations\n augNames={availableAugs.map((aug) => aug.name)}\n ownedAugNames={ownedAugNames}\n canPurchase={(aug) => {\n return Player.money > aug.baseCost;\n }}\n purchaseAugmentation={(aug) => {\n props.sleeve.tryBuyAugmentation(aug);\n rerender();\n }}\n sleeveAugs\n />\n </Modal>\n );\n}\n","import React from \"react\";\n\nimport { Augmentation } from \"../Augmentation\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { purchaseAugmentation } from \"../../Faction/FactionHelpers\";\nimport { isRepeatableAug } from \"../AugmentationHelpers\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Player } from \"@player\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n faction?: Faction;\n aug?: Augmentation;\n}\n\nexport function PurchaseAugmentationModal(props: IProps): React.ReactElement {\n if (!props.aug || !props.faction) {\n return <></>;\n }\n\n function buy(): void {\n if (!props.aug || (!isRepeatableAug(props.aug) && Player.hasAugmentation(props.aug.name))) {\n return;\n }\n\n purchaseAugmentation(props.aug as Augmentation, props.faction as Faction);\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography variant=\"h4\">{props.aug.name}</Typography>\n <Typography>\n {props.aug.info}\n <br />\n <br />\n {props.aug.stats}\n <br />\n <br />\n Would you like to purchase the {props.aug.name} Augmentation for \n <Money money={props.aug.getCost().moneyCost} />?\n <br />\n <br />\n </Typography>\n <Button autoFocus onClick={buy}>\n Purchase\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { Player } from \"@player\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\nimport { isSleeveFactionWork } from \"../Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../Work/SleeveCompanyWork\";\nimport { isSleeveBladeburnerWork } from \"../Work/SleeveBladeburnerWork\";\nimport { isSleeveRecoveryWork } from \"../Work/SleeveRecoveryWork\";\nimport { isSleeveSynchroWork } from \"../Work/SleeveSynchroWork\";\nimport { isSleeveClassWork } from \"../Work/SleeveClassWork\";\nimport { isSleeveInfiltrateWork } from \"../Work/SleeveInfiltrateWork\";\nimport { isSleeveSupportWork } from \"../Work/SleeveSupportWork\";\nimport { ClassType } from \"../../../Work/ClassWork\";\nimport { isSleeveCrimeWork } from \"../Work/SleeveCrimeWork\";\nimport { FactionWorkType } from \"../../../Work/data/FactionWorkType\";\n\nconst universitySelectorOptions: string[] = [\n \"Study Computer Science\",\n \"Data Structures\",\n \"Networks\",\n \"Algorithms\",\n \"Management\",\n \"Leadership\",\n];\n\nconst gymSelectorOptions: string[] = [\"Train Strength\", \"Train Defense\", \"Train Dexterity\", \"Train Agility\"];\n\nconst bladeburnerSelectorOptions: string[] = [\n \"Field analysis\",\n \"Recruitment\",\n \"Diplomacy\",\n \"Hyperbolic Regeneration Chamber\",\n \"Infiltrate synthoids\",\n \"Support main sleeve\",\n \"Take on contracts\",\n];\n\ninterface IProps {\n sleeve: Sleeve;\n setABC: (abc: string[]) => void;\n}\n\ninterface ITaskDetails {\n first: string[];\n second: (s1: string) => string[];\n}\n\nfunction possibleJobs(sleeve: Sleeve): string[] {\n // Array of all companies that other sleeves are working at\n const forbiddenCompanies: string[] = [];\n for (const otherSleeve of Player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (isSleeveCompanyWork(otherSleeve.currentWork)) {\n forbiddenCompanies.push(otherSleeve.currentWork.companyName);\n }\n }\n const allJobs: string[] = Object.keys(Player.jobs);\n\n return allJobs.filter((company) => !forbiddenCompanies.includes(company));\n}\n\nfunction possibleFactions(sleeve: Sleeve): string[] {\n // Array of all factions that other sleeves are working for\n const forbiddenFactions = [FactionNames.Bladeburners as string, FactionNames.ShadowsOfAnarchy as string];\n if (Player.gang) {\n forbiddenFactions.push(Player.gang.facName);\n }\n for (const otherSleeve of Player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (isSleeveFactionWork(otherSleeve.currentWork)) {\n forbiddenFactions.push(otherSleeve.currentWork.factionName);\n }\n }\n\n const factions = [];\n for (const fac of Player.factions) {\n if (!forbiddenFactions.includes(fac)) {\n factions.push(fac);\n }\n }\n\n return factions.filter((faction) => {\n const factionObj = Factions[faction];\n if (!factionObj) return false;\n const facInfo = factionObj.getInfo();\n return facInfo.offerHackingWork || facInfo.offerFieldWork || facInfo.offerSecurityWork;\n });\n}\n\nfunction possibleContracts(sleeve: Sleeve): string[] {\n const bb = Player.bladeburner;\n if (bb === null) {\n return [\"------\"];\n }\n let contracts = bb.getContractNamesNetscriptFn();\n for (const otherSleeve of Player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (isSleeveBladeburnerWork(otherSleeve.currentWork) && otherSleeve.currentWork.actionType === \"Contracts\") {\n const w = otherSleeve.currentWork;\n contracts = contracts.filter((x) => x != w.actionName);\n }\n }\n if (contracts.length === 0) {\n return [\"------\"];\n }\n return contracts;\n}\n\nconst tasks: {\n [key: string]: undefined | ((sleeve: Sleeve) => ITaskDetails);\n [\"------\"]: (sleeve: Sleeve) => ITaskDetails;\n [\"Work for Company\"]: (sleeve: Sleeve) => ITaskDetails;\n [\"Work for Faction\"]: (sleeve: Sleeve) => ITaskDetails;\n [\"Commit Crime\"]: (sleeve: Sleeve) => ITaskDetails;\n [\"Take University Course\"]: (sleeve: Sleeve) => ITaskDetails;\n [\"Workout at Gym\"]: (sleeve: Sleeve) => ITaskDetails;\n [\"Perform Bladeburner Actions\"]: (sleeve: Sleeve) => ITaskDetails;\n [\"Shock Recovery\"]: (sleeve: Sleeve) => ITaskDetails;\n [\"Synchronize\"]: (sleeve: Sleeve) => ITaskDetails;\n} = {\n \"------\": (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n \"Work for Company\": (sleeve: Sleeve): ITaskDetails => {\n let jobs = possibleJobs(sleeve);\n\n if (jobs.length === 0) jobs = [\"------\"];\n return { first: jobs, second: () => [\"------\"] };\n },\n \"Work for Faction\": (sleeve: Sleeve): ITaskDetails => {\n let factions = possibleFactions(sleeve);\n if (factions.length === 0) factions = [\"------\"];\n\n return {\n first: factions,\n second: (s1: string) => {\n const faction = Factions[s1];\n if (!faction) return [\"------\"];\n\n const facInfo = faction.getInfo();\n const options: string[] = [];\n if (facInfo.offerHackingWork) {\n options.push(\"Hacking Contracts\");\n }\n if (facInfo.offerFieldWork) {\n options.push(\"Field Work\");\n }\n if (facInfo.offerSecurityWork) {\n options.push(\"Security Work\");\n }\n return options;\n },\n };\n },\n \"Commit Crime\": (): ITaskDetails => {\n return { first: Object.values(Crimes).map((crime) => crime.name), second: () => [\"------\"] };\n },\n \"Take University Course\": (sleeve: Sleeve): ITaskDetails => {\n let universities: string[] = [];\n switch (sleeve.city) {\n case CityName.Aevum:\n universities = [LocationName.AevumSummitUniversity];\n break;\n case CityName.Sector12:\n universities = [LocationName.Sector12RothmanUniversity];\n break;\n case CityName.Volhaven:\n universities = [LocationName.VolhavenZBInstituteOfTechnology];\n break;\n default:\n universities = [\"No university available in city!\"];\n break;\n }\n\n return { first: universitySelectorOptions, second: () => universities };\n },\n \"Workout at Gym\": (sleeve: Sleeve): ITaskDetails => {\n let gyms: string[] = [];\n switch (sleeve.city) {\n case CityName.Aevum:\n gyms = [LocationName.AevumCrushFitnessGym, LocationName.AevumSnapFitnessGym];\n break;\n case CityName.Sector12:\n gyms = [LocationName.Sector12IronGym, LocationName.Sector12PowerhouseGym];\n break;\n case CityName.Volhaven:\n gyms = [LocationName.VolhavenMilleniumFitnessGym];\n break;\n default:\n gyms = [\"No gym available in city!\"];\n break;\n }\n\n return { first: gymSelectorOptions, second: () => gyms };\n },\n \"Perform Bladeburner Actions\": (sleeve: Sleeve): ITaskDetails => {\n return {\n first: bladeburnerSelectorOptions,\n second: (s1: string) => {\n if (s1 === \"Take on contracts\") {\n return possibleContracts(sleeve);\n } else {\n return [\"------\"];\n }\n },\n };\n },\n \"Shock Recovery\": (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n Synchronize: (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n};\n\nconst canDo: {\n [key: string]: undefined | ((sleeve: Sleeve) => boolean);\n [\"------\"]: (sleeve: Sleeve) => boolean;\n [\"Work for Company\"]: (sleeve: Sleeve) => boolean;\n [\"Work for Faction\"]: (sleeve: Sleeve) => boolean;\n [\"Commit Crime\"]: (sleeve: Sleeve) => boolean;\n [\"Take University Course\"]: (sleeve: Sleeve) => boolean;\n [\"Workout at Gym\"]: (sleeve: Sleeve) => boolean;\n [\"Perform Bladeburner Actions\"]: (sleeve: Sleeve) => boolean;\n [\"Shock Recovery\"]: (sleeve: Sleeve) => boolean;\n [\"Synchronize\"]: (sleeve: Sleeve) => boolean;\n} = {\n \"------\": () => true,\n \"Work for Company\": (sleeve: Sleeve) => possibleJobs(sleeve).length > 0,\n \"Work for Faction\": (sleeve: Sleeve) => possibleFactions(sleeve).length > 0,\n \"Commit Crime\": () => true,\n \"Take University Course\": (sleeve: Sleeve) =>\n [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),\n \"Workout at Gym\": (sleeve: Sleeve) => [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),\n \"Perform Bladeburner Actions\": () => Player.inBladeburner(),\n \"Shock Recovery\": (sleeve: Sleeve) => sleeve.shock < 100,\n Synchronize: (sleeve: Sleeve) => sleeve.sync < 100,\n};\n\nfunction getABC(sleeve: Sleeve): [string, string, string] {\n const w = sleeve.currentWork;\n if (w === null) {\n return [\"------\", \"------\", \"------\"];\n }\n\n if (isSleeveCompanyWork(w)) {\n return [\"Work for Company\", w.companyName, \"------\"];\n }\n if (isSleeveFactionWork(w)) {\n let workType = \"\";\n switch (w.factionWorkType) {\n case FactionWorkType.HACKING:\n workType = \"Hacking Contracts\";\n break;\n case FactionWorkType.FIELD:\n workType = \"Field Work\";\n break;\n case FactionWorkType.SECURITY:\n workType = \"Security Work\";\n break;\n }\n return [\"Work for Faction\", w.factionName, workType];\n }\n if (isSleeveBladeburnerWork(w)) {\n if (w.actionType === \"Contracts\") {\n return [\"Perform Bladeburner Actions\", \"Take on contracts\", w.actionName];\n }\n switch (w.actionName) {\n case \"Field Analysis\":\n return [\"Perform Bladeburner Actions\", \"Field Analysis\", \"------\"];\n case \"Diplomacy\":\n return [\"Perform Bladeburner Actions\", \"Diplomacy\", \"------\"];\n case \"Recruitment\":\n return [\"Perform Bladeburner Actions\", \"Recruitment\", \"------\"];\n case \"Hyperbolic Regeneration Chamber\":\n return [\"Perform Bladeburner Actions\", \"Hyperbolic Regeneration Chamber\", \"------\"];\n }\n }\n\n if (isSleeveClassWork(w)) {\n switch (w.classType) {\n case ClassType.StudyComputerScience:\n return [\"Take University Course\", \"Study Computer Science\", w.location];\n case ClassType.DataStructures:\n return [\"Take University Course\", \"Data Structures\", w.location];\n case ClassType.Networks:\n return [\"Take University Course\", \"Networks\", w.location];\n case ClassType.Algorithms:\n return [\"Take University Course\", \"Algorithms\", w.location];\n case ClassType.Management:\n return [\"Take University Course\", \"Management\", w.location];\n case ClassType.Leadership:\n return [\"Take University Course\", \"Leadership\", w.location];\n case ClassType.GymStrength:\n return [\"Workout at Gym\", \"Train Strength\", w.location];\n case ClassType.GymDefense:\n return [\"Workout at Gym\", \"Train Defense\", w.location];\n case ClassType.GymDexterity:\n return [\"Workout at Gym\", \"Train Dexterity\", w.location];\n case ClassType.GymAgility:\n return [\"Workout at Gym\", \"Train Agility\", w.location];\n }\n }\n if (isSleeveCrimeWork(w)) {\n return [\n \"Commit Crime\",\n Object.values(Crimes).find((crime) => crime.type === w.crimeType)?.name ?? \"Shoplift\",\n \"------\",\n ];\n }\n if (isSleeveSupportWork(w)) {\n return [\"Perform Bladeburner Actions\", \"Support main sleeve\", \"------\"];\n }\n if (isSleeveInfiltrateWork(w)) {\n return [\"Perform Bladeburner Actions\", \"Infiltrate synthoids\", \"------\"];\n }\n if (isSleeveRecoveryWork(w)) {\n return [\"Shock Recovery\", \"------\", \"------\"];\n }\n if (isSleeveSynchroWork(w)) {\n return [\"Synchronize\", \"------\", \"------\"];\n }\n\n return [\"------\", \"------\", \"------\"];\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const abc = getABC(props.sleeve);\n const [s0, setS0] = useState(abc[0]);\n const [s1, setS1] = useState(abc[1]);\n const [s2, setS2] = useState(abc[2]);\n\n const validActions = Object.keys(canDo).filter((k) => (canDo[k] as (sleeve: Sleeve) => boolean)(props.sleeve));\n\n const detailsF = tasks[s0];\n if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);\n const details = detailsF(props.sleeve);\n const details2 = details.second(s1);\n\n if (details.first.length > 0 && !details.first.includes(s1)) {\n setS1(details.first[0]);\n props.setABC([s0, details.first[0], s2]);\n }\n if (details2.length > 0 && !details2.includes(s2)) {\n setS2(details2[0]);\n props.setABC([s0, s1, details2[0]]);\n }\n\n function onS0Change(event: SelectChangeEvent<string>): void {\n const n = event.target.value;\n const detailsF = tasks[n];\n if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);\n const details = detailsF(props.sleeve);\n const details2 = details.second(details.first[0]) ?? [\"------\"];\n setS2(details2[0]);\n setS1(details.first[0]);\n setS0(n);\n props.setABC([n, details.first[0], details2[0]]);\n }\n\n function onS1Change(event: SelectChangeEvent<string>): void {\n setS1(event.target.value);\n props.setABC([s0, event.target.value, s2]);\n }\n\n function onS2Change(event: SelectChangeEvent<string>): void {\n setS2(event.target.value);\n props.setABC([s0, s1, event.target.value]);\n }\n\n return (\n <>\n <Select onChange={onS0Change} value={s0} sx={{ width: \"100%\" }}>\n {validActions.map((task) => (\n <MenuItem key={task} value={task}>\n {task}\n </MenuItem>\n ))}\n </Select>\n {!(details.first.length === 1 && details.first[0] === \"------\") && (\n <>\n <Select onChange={onS1Change} value={s1} sx={{ width: \"100%\" }}>\n {details.first.map((detail) => (\n <MenuItem key={detail} value={detail}>\n {detail}\n </MenuItem>\n ))}\n </Select>\n </>\n )}\n {!(details2.length === 1 && details2[0] === \"------\") && (\n <>\n <Select onChange={onS2Change} value={s2} sx={{ width: \"100%\" }}>\n {details2.map((detail) => (\n <MenuItem key={detail} value={detail}>\n {detail}\n </MenuItem>\n ))}\n </Select>\n </>\n )}\n </>\n );\n}\n","import React from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { WorldMap } from \"../../../ui/React/WorldMap\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Player } from \"@player\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function TravelModal(props: IProps): React.ReactElement {\n function travel(city: string): void {\n if (!Player.canAfford(CONSTANTS.TravelCost)) {\n dialogBoxCreate(\"You cannot afford to have this sleeve travel to another city\");\n }\n props.sleeve.city = city as CityName;\n Player.loseMoney(CONSTANTS.TravelCost, \"sleeve\");\n props.sleeve.stopWork();\n props.rerender();\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Have this sleeve travel to a different city. This affects the gyms and universities at which this sleeve can\n study. Traveling to a different city costs <Money money={CONSTANTS.TravelCost} forPurchase={true} />. It will\n also set your current sleeve task to idle.\n </Typography>\n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n <Button key={city} onClick={() => travel(city)}>\n {city}\n </Button>\n ))\n ) : (\n <WorldMap currentCity={props.sleeve.city} onTravel={(city: CityName) => travel(city)} />\n )}\n </>\n </Modal>\n );\n}\n","import React from \"react\";\n\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function FAQModal({ open, onClose }: IProps): React.ReactElement {\n return (\n <Modal open={open} onClose={onClose}>\n <>\n <Typography variant=\"h4\">How do Duplicate Sleeves work?</Typography>\n <br />\n <Typography>\n Duplicate Sleeves are essentially clones. You can use them to perform any work type action, such as working\n for a company/faction or committing a crime. Having sleeves perform these tasks earns you money, experience,\n and reputation.\n </Typography>\n <br />\n <br />\n <Typography>\n Sleeves are their own individuals, which means they each have their own experience and stats.\n </Typography>\n <br />\n <br />\n <Typography>\n When a sleeve earns experience, it earns experience for itself, the player's original 'consciousness', as well\n as all of the player's other sleeves.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">What is Synchronization (Sync)?</Typography>\n <br />\n <Typography>\n Synchronization is a measure of how aligned your consciousness is with that of your Duplicate Sleeves. It is a\n numerical value between 1 and 100, and it affects how much experience is earned when the sleeve is performing\n a task.\n </Typography>\n <br />\n <br />\n <Typography>\n Let N be the sleeve's synchronization. When the sleeve earns experience by performing a task, both the sleeve\n and the player's original host consciousness earn N% of the amount of experience normally earned by the task.\n All of the player's other sleeves earn ((N/100)^2 * 100)% of the experience.\n </Typography>\n <br />\n <br />\n <Typography>Synchronization can be increased by assigning sleeves to the 'Synchronize' task.</Typography>\n <br />\n <br />\n <Typography variant=\"h4\">What is Shock?</Typography>\n <br />\n <Typography>\n Sleeve shock is a measure of how much trauma the sleeve has due to being placed in a new body. It is a\n numerical value between 0 and 99, where 99 indicates full shock and 0 indicates no shock. Shock affects the\n amount of experience earned by the sleeve.\n </Typography>\n <br />\n <br />\n <Typography>\n Sleeve shock slowly decreases over time. You can further increase the rate at which it decreases by assigning\n sleeves to the 'Shock Recovery' task.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Why can't I work for this company or faction?</Typography>\n <br />\n <Typography>\n Only one of your sleeves can work for a given company/faction a time. To clarify further, if you have two\n sleeves they can work for two different companies/factions, but they cannot both work for the same\n company/faction.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">How do I buy Augmentations for my Sleeves?</Typography>\n <br />\n <Typography>Your Sleeve needs to have a Shock of 0 in order for you to buy Augmentations for it.</Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Why can't I buy the X Augmentation for my sleeve?</Typography>\n <br />\n <Typography>\n Certain Augmentations, like {FactionNames.Bladeburners}-specific ones and NeuroFlux Governor, are not\n available for sleeves. You also need enough current reputation on some faction that offers that Augmentation.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Do sleeves get reset when installing Augmentations or switching BitNodes?</Typography>\n <br />\n <Typography>\n Sleeves are reset when switching BitNodes, but not when installing Augmentations. However installing\n Augmentations on a sleeve does reset their stats.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">What is Memory?</Typography>\n <br />\n <Typography>\n Sleeve memory dictates what a sleeve's synchronization will be when it's reset by switching BitNodes. For\n example, if a sleeve has a memory of 25, then when you switch BitNodes its synchronization will initially be\n set to 25, rather than 1.\n </Typography>\n <br />\n <br />\n <Typography>\n Memory can only be increased by purchasing upgrades from {FactionNames.TheCovenant}. It is a persistent stat,\n meaning it never gets resets back to 1. The maximum possible value for a sleeve's memory is 100.\n </Typography>\n </>\n </Modal>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { GeneralInfo } from \"./GeneralInfo\";\nimport { HacknetNodeElem } from \"./HacknetNodeElem\";\nimport { HacknetServerElem } from \"./HacknetServerElem\";\nimport { HacknetNode } from \"../HacknetNode\";\nimport { HacknetServer } from \"../HacknetServer\";\nimport { HashUpgradeModal } from \"./HashUpgradeModal\";\nimport { MultiplierButtons } from \"./MultiplierButtons\";\nimport { PlayerInfo } from \"./PlayerInfo\";\nimport { PurchaseButton } from \"./PurchaseButton\";\nimport { PurchaseMultipliers } from \"../data/Constants\";\n\nimport {\n getCostOfNextHacknetNode,\n getCostOfNextHacknetServer,\n hasHacknetServers,\n purchaseHacknet,\n} from \"../HacknetHelpers\";\n\nimport { Player } from \"@player\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport { Box } from \"@mui/material\";\n\n/** Root React Component for the Hacknet Node UI */\nexport function HacknetRoot(): React.ReactElement {\n const [open, setOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const [purchaseMultiplier, setPurchaseMultiplier] = useState<number | \"MAX\">(PurchaseMultipliers.x1);\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n let totalProduction = 0;\n for (let i = 0; i < Player.hacknetNodes.length; ++i) {\n const node = Player.hacknetNodes[i];\n if (hasHacknetServers()) {\n if (node instanceof HacknetNode) throw new Error(\"node was hacknet node\"); // should never happen\n const hserver = GetServer(node);\n if (!(hserver instanceof HacknetServer)) throw new Error(\"node was not hacknet server\"); // should never happen\n if (hserver) {\n totalProduction += hserver.hashRate;\n } else {\n console.warn(`Could not find Hacknet Server object in AllServers map (i=${i})`);\n }\n } else {\n if (typeof node === \"string\") throw new Error(\"node was ip string\"); // should never happen\n totalProduction += node.moneyGainRatePerSecond;\n }\n }\n\n function handlePurchaseButtonClick(): void {\n purchaseHacknet();\n rerender();\n }\n\n // Cost to purchase a new Hacknet Node\n let purchaseCost;\n if (hasHacknetServers()) {\n purchaseCost = getCostOfNextHacknetServer();\n } else {\n purchaseCost = getCostOfNextHacknetNode();\n }\n\n // onClick event handlers for purchase multiplier buttons\n const purchaseMultiplierOnClicks = [\n () => setPurchaseMultiplier(PurchaseMultipliers.x1),\n () => setPurchaseMultiplier(PurchaseMultipliers.x5),\n () => setPurchaseMultiplier(PurchaseMultipliers.x10),\n () => setPurchaseMultiplier(PurchaseMultipliers.MAX),\n ];\n\n // HacknetNode components\n const nodes = Player.hacknetNodes.map((node: string | HacknetNode) => {\n if (hasHacknetServers()) {\n if (node instanceof HacknetNode) throw new Error(\"node was hacknet node\"); // should never happen\n const hserver = GetServer(node);\n if (hserver == null) {\n throw new Error(`Could not find Hacknet Server object in AllServers map for IP: ${node}`);\n }\n if (!(hserver instanceof HacknetServer)) throw new Error(\"node was not hacknet server\"); // should never happen\n return (\n <HacknetServerElem\n key={hserver.hostname}\n node={hserver}\n purchaseMultiplier={purchaseMultiplier}\n rerender={rerender}\n />\n );\n } else {\n if (typeof node === \"string\") throw new Error(\"node was ip string\"); // should never happen\n return (\n <HacknetNodeElem key={node.name} node={node} purchaseMultiplier={purchaseMultiplier} rerender={rerender} />\n );\n }\n });\n\n return (\n <>\n <Typography variant=\"h4\">Hacknet {hasHacknetServers() ? \"Servers\" : \"Nodes\"}</Typography>\n <GeneralInfo hasHacknetServers={hasHacknetServers()} />\n\n <PurchaseButton cost={purchaseCost} multiplier={purchaseMultiplier} onClick={handlePurchaseButtonClick} />\n\n <br />\n\n <Grid container spacing={2}>\n <Grid item xs={6}>\n <PlayerInfo totalProduction={totalProduction} />\n </Grid>\n <Grid item xs={6}>\n <MultiplierButtons onClicks={purchaseMultiplierOnClicks} purchaseMultiplier={purchaseMultiplier} />\n </Grid>\n </Grid>\n\n {hasHacknetServers() && <Button onClick={() => setOpen(true)}>Spend Hashes on Upgrades</Button>}\n\n <Box sx={{ display: \"grid\", width: \"fit-content\", gridTemplateColumns: \"repeat(3, 1fr)\" }}>{nodes}</Box>\n <HashUpgradeModal open={open} onClose={() => setOpen(false)} />\n </>\n );\n}\n","/**\n * React Component for the Hacknet Node UI\n *\n * Displays general information about Hacknet Nodes\n */\nimport React from \"react\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n hasHacknetServers: boolean;\n}\n\nexport function GeneralInfo(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n The Hacknet is a global, decentralized network of machines. It is used by hackers all around the world to\n anonymously share computing power and perform distributed cyberattacks without the fear of being traced.\n </Typography>\n {!props.hasHacknetServers ? (\n <>\n <Typography>\n {`Here, you can purchase a Hacknet Node, a specialized machine that can connect ` +\n `and contribute its resources to the Hacknet network. This allows you to take ` +\n `a small percentage of profits from hacks performed on the network. Essentially, ` +\n `you are renting out your Node's computing power.`}\n </Typography>\n <Typography>\n {`Each Hacknet Node you purchase will passively earn you money. Each Hacknet Node ` +\n `can be upgraded in order to increase its computing power and thereby increase ` +\n `the profit you earn from it.`}\n </Typography>\n </>\n ) : (\n <>\n <Typography>\n {`Here, you can purchase a Hacknet Server, an upgraded version of the Hacknet Node. ` +\n `Hacknet Servers will perform computations and operations on the network, earning ` +\n `you hashes. Hashes can be spent on a variety of different upgrades.`}\n </Typography>\n <Typography>\n {`Hacknet Servers can also be used as servers to run scripts. However, running scripts ` +\n `on a server will reduce its hash rate (hashes generated per second). A Hacknet Server's hash ` +\n `rate will be reduced by the percentage of RAM that is being used by that Server to run ` +\n `scripts.`}\n </Typography>\n </>\n )}\n </>\n );\n}\n","/**\n * React Component for the Hacknet Node UI.\n * This Component displays the panel for a single Hacknet Node\n */\nimport React from \"react\";\n\nimport { HacknetNodeConstants } from \"../data/Constants\";\nimport {\n getMaxNumberLevelUpgrades,\n getMaxNumberRamUpgrades,\n getMaxNumberCoreUpgrades,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n} from \"../HacknetHelpers\";\n\nimport { Player } from \"@player\";\nimport { HacknetNode } from \"../HacknetNode\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { calculateMoneyGainRate } from \"../formulas/HacknetNodes\";\n\ninterface IProps {\n node: HacknetNode;\n purchaseMultiplier: number | \"MAX\";\n rerender: () => void;\n}\n\nexport function HacknetNodeElem(props: IProps): React.ReactElement {\n const node = props.node;\n const purchaseMult = props.purchaseMultiplier;\n const rerender = props.rerender;\n\n // Upgrade Level Button\n let upgradeLevelButton;\n if (node.level >= HacknetNodeConstants.MaxLevel) {\n upgradeLevelButton = <Button disabled>MAX LEVEL</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberLevelUpgrades(node, HacknetNodeConstants.MaxLevel);\n } else {\n const levelsToMax = HacknetNodeConstants.MaxLevel - node.level;\n multiplier = Math.min(levelsToMax, purchaseMult);\n }\n\n const increase =\n calculateMoneyGainRate(node.level + multiplier, node.ram, node.cores, Player.mults.hacknet_node_money) -\n node.moneyGainRatePerSecond;\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, Player.mults.hacknet_node_level_cost);\n upgradeLevelButton = (\n <Tooltip\n title={\n <Typography>\n +<MoneyRate money={increase} />\n </Typography>\n }\n >\n <Button onClick={upgradeLevelOnClick}>\n +{multiplier} - \n <Money money={upgradeLevelCost} forPurchase={true} />\n </Button>\n </Tooltip>\n );\n }\n function upgradeLevelOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\" ? getMaxNumberLevelUpgrades(node, HacknetNodeConstants.MaxLevel) : purchaseMult;\n purchaseLevelUpgrade(node, numUpgrades);\n rerender();\n }\n\n let upgradeRAMButton;\n if (node.ram >= HacknetNodeConstants.MaxRam) {\n upgradeRAMButton = <Button disabled>MAX RAM</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberRamUpgrades(node, HacknetNodeConstants.MaxRam);\n } else {\n const levelsToMax = Math.round(Math.log2(HacknetNodeConstants.MaxRam / node.ram));\n multiplier = Math.min(levelsToMax, purchaseMult);\n }\n\n const increase =\n calculateMoneyGainRate(\n node.level,\n node.ram * Math.pow(2, multiplier),\n node.cores,\n Player.mults.hacknet_node_money,\n ) - node.moneyGainRatePerSecond;\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, Player.mults.hacknet_node_ram_cost);\n upgradeRAMButton = (\n <Tooltip\n title={\n <Typography>\n +<MoneyRate money={increase} />\n </Typography>\n }\n >\n <Button onClick={upgradeRamOnClick}>\n +{multiplier} - \n <Money money={upgradeRamCost} forPurchase={true} />\n </Button>\n </Tooltip>\n );\n }\n function upgradeRamOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\" ? getMaxNumberRamUpgrades(node, HacknetNodeConstants.MaxRam) : purchaseMult;\n purchaseRamUpgrade(node, numUpgrades);\n rerender();\n }\n\n function upgradeCoresOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\" ? getMaxNumberCoreUpgrades(node, HacknetNodeConstants.MaxCores) : purchaseMult;\n purchaseCoreUpgrade(node, numUpgrades);\n rerender();\n }\n let upgradeCoresButton;\n if (node.cores >= HacknetNodeConstants.MaxCores) {\n upgradeCoresButton = <Button disabled>MAX CORES</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCoreUpgrades(node, HacknetNodeConstants.MaxCores);\n } else {\n const levelsToMax = HacknetNodeConstants.MaxCores - node.cores;\n multiplier = Math.min(levelsToMax, purchaseMult);\n }\n\n const increase =\n calculateMoneyGainRate(node.level, node.ram, node.cores + multiplier, Player.mults.hacknet_node_money) -\n node.moneyGainRatePerSecond;\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, Player.mults.hacknet_node_core_cost);\n upgradeCoresButton = (\n <Tooltip\n title={\n <Typography>\n +<MoneyRate money={increase} />\n </Typography>\n }\n >\n <Button onClick={upgradeCoresOnClick}>\n +{multiplier} - \n <Money money={upgradeCoreCost} forPurchase={true} />\n </Button>\n </Tooltip>\n );\n }\n\n return (\n <Grid item component={Paper} p={1}>\n <Table size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell colSpan={3}>\n <Typography>{node.name}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Production:</Typography>\n </TableCell>\n <TableCell colSpan={2}>\n <Typography>\n <Money money={node.totalMoneyGenerated} /> (\n <MoneyRate money={node.moneyGainRatePerSecond} />)\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Level:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.level}</Typography>\n </TableCell>\n <TableCell>{upgradeLevelButton}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>RAM:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{numeralWrapper.formatRAM(node.ram)}</Typography>\n </TableCell>\n <TableCell>{upgradeRAMButton}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Cores:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.cores}</Typography>\n </TableCell>\n <TableCell>{upgradeCoresButton}</TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </Grid>\n );\n}\n","/**\n * React Component for the Hacknet Node UI.\n * This Component displays the panel for a single Hacknet Node\n */\nimport React from \"react\";\n\nimport { HacknetServerConstants } from \"../data/Constants\";\nimport {\n getMaxNumberLevelUpgrades,\n getMaxNumberRamUpgrades,\n getMaxNumberCoreUpgrades,\n getMaxNumberCacheUpgrades,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n purchaseCacheUpgrade,\n updateHashManagerCapacity,\n} from \"../HacknetHelpers\";\n\nimport { Player } from \"@player\";\nimport { HacknetServer } from \"../HacknetServer\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport { HashRate } from \"../../ui/React/HashRate\";\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport TableRow from \"@mui/material/TableRow\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { calculateHashGainRate } from \"../formulas/HacknetServers\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IProps {\n node: HacknetServer;\n purchaseMultiplier: number | string;\n rerender: () => void;\n}\n\nexport function HacknetServerElem(props: IProps): React.ReactElement {\n const node = props.node;\n const purchaseMult = props.purchaseMultiplier;\n const rerender = props.rerender;\n\n // Upgrade Level Button\n let upgradeLevelButton;\n if (node.level >= HacknetServerConstants.MaxLevel) {\n upgradeLevelButton = <Button disabled>MAX LEVEL</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberLevelUpgrades(node, HacknetServerConstants.MaxLevel);\n } else {\n const levelsToMax = HacknetServerConstants.MaxLevel - node.level;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const base_increase =\n calculateHashGainRate(node.level + multiplier, 0, node.maxRam, node.cores, Player.mults.hacknet_node_money) -\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores, Player.mults.hacknet_node_money);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, Player.mults.hacknet_node_level_cost);\n upgradeLevelButton = (\n <Tooltip\n title={\n <Typography>\n +<HashRate hashes={modded_increase} /> (effective increase, taking current RAM usage into account)\n <br />\n <span style={{ opacity: 0.5 }}>\n +<HashRate hashes={base_increase} />\n </span>{\" \"}\n (base increase, attained when no script is running)\n </Typography>\n }\n >\n <Button onClick={upgradeLevelOnClick}>\n +{multiplier} - \n <Money money={upgradeLevelCost} forPurchase={true} />\n </Button>\n </Tooltip>\n );\n }\n function upgradeLevelOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberLevelUpgrades(node, HacknetServerConstants.MaxLevel);\n }\n purchaseLevelUpgrade(node, numUpgrades as number);\n rerender();\n }\n\n function upgradeRamOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberRamUpgrades(node, HacknetServerConstants.MaxRam);\n }\n purchaseRamUpgrade(node, numUpgrades as number);\n rerender();\n }\n // Upgrade RAM Button\n let upgradeRamButton;\n if (node.maxRam >= HacknetServerConstants.MaxRam) {\n upgradeRamButton = <Button disabled>MAX RAM</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberRamUpgrades(node, HacknetServerConstants.MaxRam);\n } else {\n const levelsToMax = Math.round(Math.log2(HacknetServerConstants.MaxRam / node.maxRam));\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const base_increase =\n calculateHashGainRate(\n node.level,\n 0,\n node.maxRam * Math.pow(2, multiplier),\n node.cores,\n Player.mults.hacknet_node_money,\n ) - calculateHashGainRate(node.level, 0, node.maxRam, node.cores, Player.mults.hacknet_node_money);\n\n const modded_increase =\n calculateHashGainRate(\n node.level,\n node.ramUsed,\n node.maxRam * Math.pow(2, multiplier),\n node.cores,\n Player.mults.hacknet_node_money,\n ) - calculateHashGainRate(node.level, node.ramUsed, node.maxRam, node.cores, Player.mults.hacknet_node_money);\n\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, Player.mults.hacknet_node_ram_cost);\n upgradeRamButton = (\n <Tooltip\n title={\n <Typography>\n +<HashRate hashes={modded_increase} /> (effective increase, taking current RAM usage into account)\n <br />\n <span style={{ opacity: 0.5 }}>\n +<HashRate hashes={base_increase} />\n </span>{\" \"}\n (base increase, attained when no script is running)\n </Typography>\n }\n >\n <Button onClick={upgradeRamOnClick}>\n +{multiplier} - \n <Money money={upgradeRamCost} forPurchase={true} />\n </Button>\n </Tooltip>\n );\n }\n\n function upgradeCoresOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberCoreUpgrades(node, HacknetServerConstants.MaxCores);\n }\n purchaseCoreUpgrade(node, numUpgrades as number);\n rerender();\n }\n // Upgrade Cores Button\n let upgradeCoresButton;\n if (node.cores >= HacknetServerConstants.MaxCores) {\n upgradeCoresButton = <Button disabled>MAX CORES</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCoreUpgrades(node, HacknetServerConstants.MaxCores);\n } else {\n const levelsToMax = HacknetServerConstants.MaxCores - node.cores;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const base_increase =\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores + multiplier, Player.mults.hacknet_node_money) -\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores, Player.mults.hacknet_node_money);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, Player.mults.hacknet_node_core_cost);\n upgradeCoresButton = (\n <Tooltip\n title={\n <Typography>\n +<HashRate hashes={modded_increase} /> (effective increase, taking current RAM usage into account)\n <br />\n <span style={{ opacity: 0.5 }}>\n +<HashRate hashes={base_increase} />\n </span>{\" \"}\n (base increase, attained when no script is running)\n </Typography>\n }\n >\n <Button onClick={upgradeCoresOnClick}>\n +{multiplier} - \n <Money money={upgradeCoreCost} forPurchase={true} />\n </Button>\n </Tooltip>\n );\n }\n\n // Upgrade Cache button\n let upgradeCacheButton;\n if (node.cache >= HacknetServerConstants.MaxCache) {\n upgradeCacheButton = <Button disabled>MAX CACHE</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCacheUpgrades(node, HacknetServerConstants.MaxCache);\n } else {\n const levelsToMax = HacknetServerConstants.MaxCache - node.cache;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const increase = 32 * Math.pow(2, node.cache + multiplier) - node.hashCapacity;\n const upgradeCacheCost = node.calculateCacheUpgradeCost(multiplier);\n upgradeCacheButton = (\n <Tooltip\n title={\n <Typography>\n +<Hashes hashes={increase} /> hashes\n </Typography>\n }\n >\n <Button onClick={upgradeCacheOnClick}>\n +{multiplier} - \n <Money money={upgradeCacheCost} forPurchase={true} />\n </Button>\n </Tooltip>\n );\n if (Player.money < upgradeCacheCost) {\n } else {\n }\n }\n function upgradeCacheOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberCacheUpgrades(node, HacknetServerConstants.MaxCache);\n }\n purchaseCacheUpgrade(node, numUpgrades as number);\n rerender();\n updateHashManagerCapacity();\n }\n\n return (\n <Grid item component={Paper} p={1}>\n <Table size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell>\n <Typography>{node.hostname}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Production:</Typography>\n </TableCell>\n <TableCell colSpan={2}>\n <Tooltip\n title={\n <Typography>\n <Hashes hashes={node.totalHashesGenerated} /> hashes produced by this server since last augment\n installation.\n <br />\n <HashRate hashes={node.hashRate} /> current production rate.\n <br />\n <span style={{ opacity: 0.5 }}>\n <HashRate hashes={(node.hashRate * node.maxRam) / (node.maxRam - node.ramUsed)} />\n </span>{\" \"}\n max production rate. (achieved when 100% RAM is allocated to it)\n <br />\n {numeralWrapper.formatRAM(node.ramUsed)} / {numeralWrapper.formatRAM(node.maxRam)} (\n {Math.round((100 * node.ramUsed) / node.maxRam)}%) RAM allocated to script.\n <br />\n {numeralWrapper.formatRAM(node.maxRam - node.ramUsed)} / {numeralWrapper.formatRAM(node.maxRam)} (\n {Math.round((100 * (node.maxRam - node.ramUsed)) / node.maxRam)}%) RAM allocated to hash production.\n </Typography>\n }\n >\n <Typography>\n <Hashes hashes={node.totalHashesGenerated} /> (<HashRate hashes={node.hashRate} />)\n </Typography>\n </Tooltip>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Hash Capacity:</Typography>\n </TableCell>\n <TableCell colSpan={2}>\n <Typography>\n <Hashes hashes={node.hashCapacity} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Level:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.level}</Typography>\n </TableCell>\n <TableCell>{upgradeLevelButton}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>RAM:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{numeralWrapper.formatRAM(node.maxRam)}</Typography>\n </TableCell>\n <TableCell>{upgradeRamButton}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Cores:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.cores}</Typography>\n </TableCell>\n <TableCell>{upgradeCoresButton}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Cache Level:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.cache}</Typography>\n </TableCell>\n <TableCell>{upgradeCacheButton}</TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </Grid>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { HashUpgrades } from \"../HashUpgrades\";\n\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport { HacknetUpgradeElem } from \"./HacknetUpgradeElem\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Player } from \"@player\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n/** Create the pop-up for purchasing upgrades with hashes */\nexport function HashUpgradeModal(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 200);\n return () => clearInterval(id);\n }, []);\n\n const hashManager = Player.hashManager;\n if (!hashManager) {\n throw new Error(`Player does not have a HashManager)`);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>Spend your hashes on a variety of different upgrades</Typography>\n <Typography>\n Hashes: <Hashes hashes={Player.hashManager.hashes} />\n </Typography>\n {Object.keys(HashUpgrades).map((upgName) => {\n const upg = HashUpgrades[upgName];\n return <HacknetUpgradeElem upg={upg} hashManager={hashManager} key={upg.name} rerender={rerender} />;\n })}\n </>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { purchaseHashUpgrade } from \"../HacknetHelpers\";\nimport { HashManager } from \"../HashManager\";\nimport { HashUpgrade } from \"../HashUpgrade\";\n\nimport { ServerDropdown, ServerType } from \"../../ui/React/ServerDropdown\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { Hashes } from \"../../ui/React/Hashes\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { SelectChangeEvent } from \"@mui/material/Select\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\ninterface IProps {\n hashManager: HashManager;\n upg: HashUpgrade;\n rerender: () => void;\n}\n\nconst serversMap: { [key: string]: string } = {};\n\nexport function HacknetUpgradeElem(props: IProps): React.ReactElement {\n const [selectedServer, setSelectedServer] = useState(\n serversMap[props.upg.name] ? serversMap[props.upg.name] : FactionNames.ECorp.toLowerCase(),\n );\n function changeTargetServer(event: SelectChangeEvent<string>): void {\n setSelectedServer(event.target.value);\n serversMap[props.upg.name] = event.target.value;\n }\n\n function purchase(): void {\n const canPurchase = props.hashManager.hashes >= props.hashManager.getUpgradeCost(props.upg.name);\n if (canPurchase) {\n const res = purchaseHashUpgrade(props.upg.name, selectedServer);\n if (!res) {\n dialogBoxCreate(\n \"Failed to purchase upgrade. This may be because you do not have enough hashes, \" +\n \"or because you do not have access to the feature upgrade affects.\",\n );\n }\n props.rerender();\n }\n }\n\n const hashManager = props.hashManager;\n const upg = props.upg;\n const cost = hashManager.getUpgradeCost(upg.name);\n const level = hashManager.upgrades[upg.name];\n const effect = upg.effectText(level);\n\n // Purchase button\n const canPurchase = hashManager.hashes >= cost;\n\n // We'll reuse a Bladeburner css class\n return (\n <Paper sx={{ p: 1 }}>\n <Typography>\n <CopyableText value={upg.name} />\n </Typography>\n <Typography>\n Cost: <Hashes hashes={cost} />, Bought: {level} times\n </Typography>\n\n <Typography>{upg.desc}</Typography>\n {!upg.hasTargetServer && (\n <Button onClick={purchase} disabled={!canPurchase}>\n Buy\n </Button>\n )}\n {upg.hasTargetServer && (\n <ServerDropdown\n purchase={purchase}\n canPurchase={canPurchase}\n value={selectedServer}\n serverType={ServerType.Foreign}\n onChange={changeTargetServer}\n />\n )}\n {level > 0 && effect && <Typography>{effect}</Typography>}\n </Paper>\n );\n}\n","/**\n * React Component for the Multiplier buttons on the Hacknet page.\n * These buttons let the player control how many Nodes/Upgrades they're\n * purchasing when using the UI (x1, x5, x10, MAX)\n */\nimport React from \"react\";\n\nimport { PurchaseMultipliers } from \"../data/Constants\";\nimport Button from \"@mui/material/Button\";\n\ninterface IMultiplierProps {\n disabled: boolean;\n onClick: () => void;\n text: string;\n}\n\nfunction MultiplierButton(props: IMultiplierProps): React.ReactElement {\n return (\n <Button disabled={props.disabled} onClick={props.onClick}>\n {props.text}\n </Button>\n );\n}\n\ninterface IProps {\n purchaseMultiplier: number | string;\n onClicks: (() => void)[];\n}\n\nexport function MultiplierButtons(props: IProps): React.ReactElement {\n if (props.purchaseMultiplier == null) {\n throw new Error(`MultiplierButtons constructed without required props`);\n }\n\n const mults = [\"x1\", \"x5\", \"x10\", \"MAX\"];\n const onClicks = props.onClicks;\n const buttons = [];\n for (let i = 0; i < mults.length; ++i) {\n const mult = mults[i];\n const btnProps = {\n disabled: props.purchaseMultiplier === PurchaseMultipliers[mult],\n onClick: onClicks[i],\n text: mult,\n };\n\n buttons.push(<MultiplierButton key={mult} {...btnProps} />);\n }\n\n return <>{buttons}</>;\n}\n","/**\n * React Component for displaying Player info and stats on the Hacknet Node UI.\n * This includes:\n * - Player's money\n * - Player's production from Hacknet Nodes\n */\nimport React from \"react\";\n\nimport { hasHacknetServers } from \"../HacknetHelpers\";\nimport { Player } from \"@player\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { HashRate } from \"../../ui/React/HashRate\";\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n totalProduction: number;\n}\n\nexport function PlayerInfo(props: IProps): React.ReactElement {\n const hasServers = hasHacknetServers();\n\n let prod;\n if (hasServers) {\n prod = <HashRate hashes={props.totalProduction} />;\n } else {\n prod = <MoneyRate money={props.totalProduction} />;\n }\n\n return (\n <>\n <Typography>\n Money:\n <Money money={Player.money} />\n </Typography>\n\n {hasServers && (\n <>\n <Typography>\n Hashes: <Hashes hashes={Player.hashManager.hashes} /> / <Hashes hashes={Player.hashManager.capacity} />\n </Typography>\n </>\n )}\n\n <Typography>\n Total Hacknet {hasServers ? \"Server\" : \"Node\"} Production: {prod}\n </Typography>\n </>\n );\n}\n","import React from \"react\";\n\nimport { hasHacknetServers, hasMaxNumberHacknetServers } from \"../HacknetHelpers\";\nimport { Player } from \"@player\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n multiplier: number | string;\n onClick: () => void;\n cost: number;\n}\n\n/** React Component for the button that is used to purchase new Hacknet Nodes */\nexport function PurchaseButton(props: IProps): React.ReactElement {\n const cost = props.cost;\n let text;\n if (hasHacknetServers()) {\n if (hasMaxNumberHacknetServers()) {\n text = <>Hacknet Server limit reached</>;\n } else {\n text = (\n <>\n Purchase Hacknet Server - \n <Money money={cost} forPurchase={true} />\n </>\n );\n }\n } else {\n text = (\n <>\n Purchase Hacknet Node - \n <Money money={cost} forPurchase={true} />\n </>\n );\n }\n\n return (\n <Button disabled={!Player.canAfford(cost)} onClick={props.onClick}>\n {text}\n </Button>\n );\n}\n","/**\n * React Component for displaying a location's UI\n *\n * This is a \"router\" component of sorts, meaning it deduces the type of\n * location that is being rendered and then creates the proper component(s) for that.\n */\nimport * as React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { CompanyLocation } from \"./CompanyLocation\";\nimport { GymLocation } from \"./GymLocation\";\nimport { HospitalLocation } from \"./HospitalLocation\";\nimport { SlumsLocation } from \"./SlumsLocation\";\nimport { SpecialLocation } from \"./SpecialLocation\";\nimport { TechVendorLocation } from \"./TechVendorLocation\";\nimport { TravelAgencyRoot } from \"./TravelAgencyRoot\";\nimport { UniversityLocation } from \"./UniversityLocation\";\nimport { CasinoLocation } from \"./CasinoLocation\";\n\nimport { Location } from \"../Location\";\nimport { LocationType } from \"../LocationTypeEnum\";\n\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { isBackdoorInstalled } from \"../../Server/ServerHelpers\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { Tooltip } from \"@mui/material\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function GenericLocation({ loc }: IProps): React.ReactElement {\n /**\n * Determine what needs to be rendered for this location based on the locations\n * type. Returns an array of React components that should be rendered\n */\n function getLocationSpecificContent(): React.ReactNode[] {\n const content: React.ReactNode[] = [];\n\n if (loc.types.includes(LocationType.Company)) {\n content.push(<CompanyLocation locName={loc.name} />);\n }\n\n if (loc.types.includes(LocationType.Gym)) {\n content.push(<GymLocation loc={loc} />);\n }\n\n if (loc.types.includes(LocationType.Hospital)) {\n content.push(<HospitalLocation />);\n }\n\n if (loc.types.includes(LocationType.Slums)) {\n content.push(<SlumsLocation />);\n }\n\n if (loc.types.includes(LocationType.Special)) {\n content.push(<SpecialLocation loc={loc} />);\n }\n\n if (loc.types.includes(LocationType.TechVendor)) {\n content.push(<TechVendorLocation loc={loc} />);\n }\n\n if (loc.types.includes(LocationType.TravelAgency)) {\n content.push(<TravelAgencyRoot />);\n }\n\n if (loc.types.includes(LocationType.University)) {\n content.push(<UniversityLocation loc={loc} />);\n }\n\n if (loc.types.includes(LocationType.Casino)) {\n content.push(<CasinoLocation />);\n }\n\n return content;\n }\n\n const locContent: React.ReactNode[] = getLocationSpecificContent();\n const serverMeta = serverMetadata.find((s) => s.specialName === loc.name);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n\n const backdoorInstalled = server !== null && isBackdoorInstalled(server);\n\n return (\n <>\n <Button onClick={() => Router.toCity()}>Return to World</Button>\n <Typography variant=\"h4\" sx={{ mt: 1 }}>\n {backdoorInstalled && !Settings.DisableTextEffects ? (\n <Tooltip title={`Backdoor installed on ${loc.name}.`}>\n <span>\n <CorruptableText content={loc.name} />\n </span>\n </Tooltip>\n ) : (\n loc.name\n )}\n </Typography>\n {locContent}\n </>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a company\n *\n * This subcomponent renders all of the buttons for applying to jobs at a company\n */\nimport React, { useState, useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\nimport { ApplyToJobButton } from \"./ApplyToJobButton\";\n\nimport { Locations } from \"../Locations\";\nimport { LocationName } from \"../data/LocationNames\";\n\nimport { Companies } from \"../../Company/Companies\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport * as posNames from \"../../Company/data/companypositionnames\";\n\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { Player } from \"@player\";\nimport { QuitJobModal } from \"../../Company/ui/QuitJobModal\";\nimport { CompanyWork } from \"../../Work/CompanyWork\";\n\ntype IProps = {\n locName: LocationName;\n};\n\nexport function CompanyLocation(props: IProps): React.ReactElement {\n const [quitOpen, setQuitOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n /**\n * We'll keep a reference to the Company that this component is being rendered for,\n * so we don't have to look it up every time\n */\n const company = Companies[props.locName];\n if (company == null) throw new Error(`CompanyLocation component constructed with invalid company: ${props.locName}`);\n\n /** Reference to the Location that this component is being rendered for */\n const location = Locations[props.locName];\n if (location == null) {\n throw new Error(`CompanyLocation component constructed with invalid location: ${props.locName}`);\n }\n\n /** Name of company position that player holds, if applicable */\n const jobTitle = Player.jobs[props.locName] ? Player.jobs[props.locName] : null;\n\n /**\n * CompanyPosition object for the job that the player holds at this company\n * (if he has one)\n */\n const companyPosition = jobTitle ? CompanyPositions[jobTitle] : null;\n\n Player.location = props.locName;\n\n function applyForAgentJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForAgentJob();\n rerender();\n }\n\n function applyForBusinessConsultantJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForBusinessConsultantJob();\n rerender();\n }\n\n function applyForBusinessJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForBusinessJob();\n rerender();\n }\n\n function applyForEmployeeJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForEmployeeJob();\n rerender();\n }\n\n function applyForItJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForItJob();\n rerender();\n }\n\n function applyForPartTimeEmployeeJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForPartTimeEmployeeJob();\n rerender();\n }\n\n function applyForPartTimeWaiterJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForPartTimeWaiterJob();\n rerender();\n }\n\n function applyForSecurityJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForSecurityJob();\n rerender();\n }\n\n function applyForSoftwareConsultantJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForSoftwareConsultantJob();\n rerender();\n }\n\n function applyForSoftwareJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForSoftwareJob();\n rerender();\n }\n\n function applyForWaiterJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Player.applyForWaiterJob();\n rerender();\n }\n\n function startInfiltration(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n const loc = location;\n if (!loc.infiltrationData)\n throw new Error(`trying to start infiltration at ${props.locName} but the infiltrationData is null`);\n\n Router.toInfiltration(loc);\n }\n\n function work(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n\n const pos = companyPosition;\n if (pos) {\n Player.startWork(\n new CompanyWork({\n singularity: false,\n companyName: props.locName,\n }),\n );\n Player.startFocusing();\n Router.toWork();\n }\n }\n\n const isEmployedHere = jobTitle != null;\n const favorGain = company.getFavorGain();\n\n return (\n <>\n {isEmployedHere && (\n <>\n <Typography>Job Title: {jobTitle}</Typography>\n <Typography>-------------------------</Typography>\n <Box display=\"flex\">\n <Tooltip\n title={\n <>\n You will have <Favor favor={company.favor + favorGain} /> company favor upon resetting after\n installing Augmentations\n </>\n }\n >\n <Typography>\n Company reputation: <Reputation reputation={company.playerReputation} />\n </Typography>\n </Tooltip>\n </Box>\n <Typography>-------------------------</Typography>\n <Box display=\"flex\">\n <Tooltip\n title={\n <>\n Company favor increases the rate at which you earn reputation for this company by 1% per favor.\n Company favor is gained whenever you reset after installing Augmentations. The amount of favor you\n gain depends on how much reputation you have with the company.\n </>\n }\n >\n <Typography>\n Company Favor: <Favor favor={company.favor} />\n </Typography>\n </Tooltip>\n </Box>\n <Typography>-------------------------</Typography>\n <br />\n </>\n )}\n <Box sx={{ display: \"grid\", width: \"fit-content\" }}>\n {isEmployedHere && (\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}>\n <Button onClick={work}>Work</Button>\n <Button onClick={() => setQuitOpen(true)}>Quit</Button>\n <QuitJobModal\n locName={props.locName}\n company={company}\n onQuit={rerender}\n open={quitOpen}\n onClose={() => setQuitOpen(false)}\n />\n </Box>\n )}\n {company.hasAgentPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.AgentCompanyPositions[0]]}\n onClick={applyForAgentJob}\n text={\"Apply for Agent Job\"}\n />\n )}\n {company.hasBusinessConsultantPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.BusinessConsultantCompanyPositions[0]]}\n onClick={applyForBusinessConsultantJob}\n text={\"Apply for Business Consultant Job\"}\n />\n )}\n {company.hasBusinessPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.BusinessCompanyPositions[0]]}\n onClick={applyForBusinessJob}\n text={\"Apply for Business Job\"}\n />\n )}\n {company.hasEmployeePositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.MiscCompanyPositions[1]]}\n onClick={applyForEmployeeJob}\n text={\"Apply to be an Employee\"}\n />\n )}\n {company.hasEmployeePositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.PartTimeCompanyPositions[1]]}\n onClick={applyForPartTimeEmployeeJob}\n text={\"Apply to be a part-time Employee\"}\n />\n )}\n {company.hasITPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.ITCompanyPositions[0]]}\n onClick={applyForItJob}\n text={\"Apply for IT Job\"}\n />\n )}\n {company.hasSecurityPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.SecurityCompanyPositions[2]]}\n onClick={applyForSecurityJob}\n text={\"Apply for Security Job\"}\n />\n )}\n {company.hasSoftwareConsultantPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.SoftwareConsultantCompanyPositions[0]]}\n onClick={applyForSoftwareConsultantJob}\n text={\"Apply for Software Consultant Job\"}\n />\n )}\n {company.hasSoftwarePositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.SoftwareCompanyPositions[0]]}\n onClick={applyForSoftwareJob}\n text={\"Apply for Software Job\"}\n />\n )}\n {company.hasWaiterPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.MiscCompanyPositions[0]]}\n onClick={applyForWaiterJob}\n text={\"Apply to be a Waiter\"}\n />\n )}\n {company.hasWaiterPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.PartTimeCompanyPositions[0]]}\n onClick={applyForPartTimeWaiterJob}\n text={\"Apply to be a part-time Waiter\"}\n />\n )}\n {location.infiltrationData != null && <Button onClick={startInfiltration}>Infiltrate Company</Button>}\n </Box>\n </>\n );\n}\n","import React from \"react\";\nimport { Company } from \"../Company\";\nimport { Player } from \"@player\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n locName: string;\n company: Company;\n onQuit: () => void;\n}\n\nexport function QuitJobModal(props: IProps): React.ReactElement {\n function quit(): void {\n Player.quitJob(props.locName);\n props.onQuit();\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography> Would you like to quit your job at {props.company.name}?</Typography>\n <br />\n <br />\n <Button onClick={quit}>Quit</Button>\n </Modal>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a gym\n *\n * This subcomponent renders all of the buttons for training at the gym\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\n\nimport { Player } from \"@player\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { Box } from \"@mui/material\";\nimport { ClassWork, ClassType, Classes } from \"../../Work/ClassWork\";\nimport { calculateCost } from \"../../Work/formulas/Class\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function GymLocation(props: IProps): React.ReactElement {\n function train(stat: ClassType): void {\n Player.startWork(\n new ClassWork({\n classType: stat,\n location: props.loc.name,\n singularity: false,\n }),\n );\n Player.startFocusing();\n Router.toWork();\n }\n\n const cost = calculateCost(Classes[ClassType.GymStrength], props.loc);\n\n return (\n <Box sx={{ display: \"grid\", width: \"fit-content\" }}>\n <Button onClick={() => train(ClassType.GymStrength)}>\n Train Strength (<Money money={cost} forPurchase={true} /> / sec)\n </Button>\n <Button onClick={() => train(ClassType.GymDefense)}>\n Train Defense (<Money money={cost} forPurchase={true} /> / sec)\n </Button>\n <Button onClick={() => train(ClassType.GymDexterity)}>\n Train Dexterity (<Money money={cost} forPurchase={true} /> / sec)\n </Button>\n <Button onClick={() => train(ClassType.GymAgility)}>\n Train Agility (<Money money={cost} forPurchase={true} /> / sec)\n </Button>\n </Box>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a hospital\n *\n * This subcomponent renders all of the buttons for hospital options\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { Player } from \"@player\";\nimport { getHospitalizationCost } from \"../../Hospital/Hospital\";\n\nimport { Money } from \"../../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\ntype IState = {\n currHp: number;\n};\n\n//Todo: Make this a functional component\nexport class HospitalLocation extends React.Component<Record<string, never>, IState> {\n /** Stores button styling that sets them all to block display */\n btnStyle = { display: \"block\" };\n\n constructor() {\n super({});\n\n this.state = {\n currHp: Player.hp.current,\n };\n }\n\n getCost(): number {\n return getHospitalizationCost();\n }\n\n getHealed(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n\n if (Player.hp.current < 0) {\n Player.hp.current = 0;\n }\n if (Player.hp.current >= Player.hp.max) {\n return;\n }\n\n const cost = this.getCost();\n Player.loseMoney(cost, \"hospitalization\");\n Player.hp.current = Player.hp.max;\n\n // This just forces a re-render to update the cost\n this.setState({\n currHp: Player.hp.current,\n });\n\n dialogBoxCreate(\n <>\n You were healed to full health! The hospital billed you for <Money money={cost} />\n </>,\n );\n }\n\n render(): React.ReactNode {\n const cost = this.getCost();\n\n return (\n <Button onClick={this.getHealed} style={this.btnStyle}>\n Get treatment for wounds - <Money money={cost} forPurchase={true} />\n </Button>\n );\n }\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a slum\n *\n * This subcomponent renders all of the buttons for committing crimes\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nimport { Crimes } from \"../../Crime/Crimes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { Player } from \"@player\";\nimport { Box } from \"@mui/material\";\n\nexport function SlumsLocation(): React.ReactElement {\n function shoplift(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Shoplift.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function robStore(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.RobStore.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function mug(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Mug.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function larceny(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Larceny.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function dealDrugs(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.DealDrugs.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function bondForgery(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.BondForgery.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function traffickArms(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.TraffickArms.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function homicide(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Homicide.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function grandTheftAuto(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.GrandTheftAuto.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function kidnap(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Kidnap.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function assassinate(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Assassination.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n function heist(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Heist.commit();\n Router.toWork();\n Player.focus = true;\n }\n\n const shopliftChance = Crimes.Shoplift.successRate(Player);\n const robStoreChance = Crimes.RobStore.successRate(Player);\n const mugChance = Crimes.Mug.successRate(Player);\n const larcenyChance = Crimes.Larceny.successRate(Player);\n const drugsChance = Crimes.DealDrugs.successRate(Player);\n const bondChance = Crimes.BondForgery.successRate(Player);\n const armsChance = Crimes.TraffickArms.successRate(Player);\n const homicideChance = Crimes.Homicide.successRate(Player);\n const gtaChance = Crimes.GrandTheftAuto.successRate(Player);\n const kidnapChance = Crimes.Kidnap.successRate(Player);\n const assassinateChance = Crimes.Assassination.successRate(Player);\n const heistChance = Crimes.Heist.successRate(Player);\n\n return (\n <Box sx={{ display: \"grid\", width: \"fit-content\" }}>\n <Tooltip title={<>Attempt to shoplift from a low-end retailer</>}>\n <Button onClick={shoplift}>\n Shoplift ({numeralWrapper.formatPercentage(shopliftChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to commit armed robbery on a high-end store</>}>\n <Button onClick={robStore}>\n Rob store ({numeralWrapper.formatPercentage(robStoreChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to mug a random person on the street</>}>\n <Button onClick={mug}>Mug someone ({numeralWrapper.formatPercentage(mugChance)} chance of success)</Button>\n </Tooltip>\n <Tooltip title={<>Attempt to rob property from someone's house</>}>\n <Button onClick={larceny}>Larceny ({numeralWrapper.formatPercentage(larcenyChance)} chance of success)</Button>\n </Tooltip>\n <Tooltip title={<>Attempt to deal drugs</>}>\n <Button onClick={dealDrugs}>\n Deal Drugs ({numeralWrapper.formatPercentage(drugsChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to forge corporate bonds</>}>\n <Button onClick={bondForgery}>\n Bond Forgery ({numeralWrapper.formatPercentage(bondChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to smuggle illegal arms into the city</>}>\n <Button onClick={traffickArms}>\n Traffick illegal Arms ({numeralWrapper.formatPercentage(armsChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to murder a random person on the street</>}>\n <Button onClick={homicide}>\n Homicide ({numeralWrapper.formatPercentage(homicideChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to commit grand theft auto</>}>\n <Button onClick={grandTheftAuto}>\n Grand theft Auto ({numeralWrapper.formatPercentage(gtaChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to kidnap and ransom a high-profile-target</>}>\n <Button onClick={kidnap}>\n Kidnap and Ransom ({numeralWrapper.formatPercentage(kidnapChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to assassinate a high-profile target</>}>\n <Button onClick={assassinate}>\n Assassinate ({numeralWrapper.formatPercentage(assassinateChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to pull off the ultimate heist</>}>\n <Button onClick={heist}>Heist ({numeralWrapper.formatPercentage(heistChance)} chance of success)</Button>\n </Tooltip>\n </Box>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location has special\n * actions/options/properties\n *\n * Examples:\n * - Bladeburner @ NSA\n * - Re-sleeving @ VitaLife\n * - Create Corporation @ City Hall\n *\n * This subcomponent creates all of the buttons for interacting with those special\n * properties\n */\nimport React, { useState } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\nimport { CreateCorporationModal } from \"../../Corporation/ui/modals/CreateCorporationModal\";\nimport { LocationName } from \"../data/LocationNames\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { joinFaction } from \"../../Faction/FactionHelpers\";\n\nimport { Router } from \"../../ui/GameRoot\";\nimport { Player } from \"@player\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { N00dles } from \"../../utils/helpers/N00dles\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { applyAugmentation } from \"../../Augmentation/AugmentationHelpers\";\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\nimport { HacknetNode } from \"../../Hacknet/HacknetNode\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { ArcadeRoot } from \"../../Arcade/ui/ArcadeRoot\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function SpecialLocation(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const inBladeburner = Player.inBladeburner();\n\n /** Click handler for Bladeburner button at Sector-12 NSA */\n function handleBladeburner(): void {\n if (Player.inBladeburner()) {\n // Enter Bladeburner division\n Router.toBladeburner();\n } else if (\n Player.skills.strength >= 100 &&\n Player.skills.defense >= 100 &&\n Player.skills.dexterity >= 100 &&\n Player.skills.agility >= 100\n ) {\n // Apply for Bladeburner division\n Player.startBladeburner();\n dialogBoxCreate(\"You have been accepted into the Bladeburner division!\");\n setRerender((old) => !old);\n\n const worldHeader = document.getElementById(\"world-menu-header\");\n if (worldHeader instanceof HTMLElement) {\n worldHeader.click();\n worldHeader.click();\n }\n } else {\n dialogBoxCreate(\"Rejected! Please apply again when you have 100 of each combat stat (str, def, dex, agi)\");\n }\n }\n\n /** Click handler for Resleeving button at New Tokyo VitaLife */\n function handleGrafting(): void {\n Router.toGrafting();\n }\n\n function renderBladeburner(): React.ReactElement {\n if (!Player.canAccessBladeburner() || BitNodeMultipliers.BladeburnerRank === 0) {\n return <></>;\n }\n const text = inBladeburner ? \"Enter Bladeburner Headquarters\" : \"Apply to Bladeburner Division\";\n return (\n <>\n <br />\n <Button onClick={handleBladeburner}>{text}</Button>\n </>\n );\n }\n\n function renderNoodleBar(): React.ReactElement {\n function EatNoodles(): void {\n SnackbarEvents.emit(\"You ate some delicious noodles and feel refreshed\", ToastVariant.SUCCESS, 2000);\n N00dles(); // This is the true power of the noodles.\n if (Player.sourceFiles.length > 0) Player.giveExploit(Exploit.N00dles);\n if (Player.sourceFileLvl(5) > 0 || Player.bitNodeN === 5) {\n Player.exp.intelligence *= 1.0000000000000002;\n }\n Player.exp.hacking *= 1.0000000000000002;\n Player.exp.strength *= 1.0000000000000002;\n Player.exp.defense *= 1.0000000000000002;\n Player.exp.agility *= 1.0000000000000002;\n Player.exp.dexterity *= 1.0000000000000002;\n Player.exp.charisma *= 1.0000000000000002;\n for (const node of Player.hacknetNodes) {\n if (node instanceof HacknetNode) {\n Player.gainMoney(node.moneyGainRatePerSecond * 0.001, \"other\");\n } else {\n const server = GetServer(node);\n if (!(server instanceof HacknetServer)) throw new Error(`Server ${node} is not a hacknet server.`);\n Player.hashManager.storeHashes(server.hashRate * 0.001);\n }\n }\n\n if (Player.bladeburner) {\n Player.bladeburner.rank += 0.00001;\n }\n\n if (Player.corporation) {\n Player.corporation.funds += Player.corporation.revenue * 0.01;\n }\n }\n\n return (\n <>\n <br />\n <Button onClick={EatNoodles}>Eat noodles</Button>\n </>\n );\n }\n\n function CreateCorporation(): React.ReactElement {\n const [open, setOpen] = useState(false);\n if (!Player.canAccessCorporation()) {\n return (\n <>\n <Typography>\n <i>A businessman is yelling at a clerk. You should come back later.</i>\n </Typography>\n </>\n );\n }\n return (\n <>\n <Button disabled={!Player.canAccessCorporation() || Player.hasCorporation()} onClick={() => setOpen(true)}>\n Create a Corporation\n </Button>\n <CreateCorporationModal open={open} onClose={() => setOpen(false)} />\n </>\n );\n }\n\n function renderGrafting(): React.ReactElement {\n if (!Player.canAccessGrafting()) {\n return <></>;\n }\n return (\n <Button onClick={handleGrafting} sx={{ my: 5 }}>\n Enter the secret lab\n </Button>\n );\n }\n\n function handleCotMG(): void {\n const faction = Factions[FactionNames.ChurchOfTheMachineGod];\n if (!Player.factions.includes(FactionNames.ChurchOfTheMachineGod)) {\n joinFaction(faction);\n }\n if (\n !Player.augmentations.some((a) => a.name === AugmentationNames.StaneksGift1) &&\n !Player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)\n ) {\n applyAugmentation({ name: AugmentationNames.StaneksGift1, level: 1 });\n }\n\n Router.toStaneksGift();\n }\n\n function renderCotMG(): React.ReactElement {\n const toStanek = <Button onClick={() => Router.toStaneksGift()}>Open Stanek's Gift</Button>;\n // prettier-ignore\n const symbol = <Typography sx={{ lineHeight: '1em', whiteSpace: 'pre' }}>\n {\" `` \"}<br />\n {\" -odmmNmds: \"}<br />\n {\" `hNmo:..-omNh. \"}<br />\n {\" yMd` `hNh \"}<br />\n {\" mMd oNm \"}<br />\n {\" oMNo .mM/ \"}<br />\n {\" `dMN+ -mM+ \"}<br />\n {\" -mMNo -mN+ \"}<br />\n {\" .+- :mMNo/mN/ \"}<br />\n {\":yNMd. :NMNNN/ \"}<br />\n {\"-mMMMh. /NMMh` \"}<br />\n {\" .dMMMd. /NMMMy` \"}<br />\n {\" `yMMMd. /NNyNMMh` \"}<br />\n {\" `sMMMd. +Nm: +NMMh. \"}<br />\n {\" oMMMm- oNm: /NMMd. \"}<br />\n {\" +NMMmsMm- :mMMd. \"}<br />\n {\" /NMMMm- -mMMd. \"}<br />\n {\" /MMMm- -mMMd. \"}<br />\n {\" `sMNMMm- .mMmo \"}<br />\n {\" `sMd:hMMm. ./. \"}<br />\n {\" `yMy` `yNMd` \"}<br />\n {\" `hMs` oMMy \"}<br />\n {\" `hMh sMN- \"}<br />\n {\" /MM- .NMo \"}<br />\n {\" +MM: :MM+ \"}<br />\n {\" sNNo-.`.-omNy` \"}<br />\n {\" -smNNNNmdo- \"}<br />\n {\" `..` \"}</Typography>\n if (Player.hasAugmentation(AugmentationNames.StaneksGift3, true)) {\n return (\n <>\n <Typography>\n <i>\n Allison \"Mother\" Stanek: ..can ...you hear them too ...? Come now, don't be shy and let me get a closer\n look at you. Yes wonderful, I see my creation has taken root without consequence or much ill effect it\n seems. Curious, Just how much of a machine's soul do you house in that body?\n </i>\n </Typography>\n <br />\n {toStanek}\n <br />\n {symbol}\n </>\n );\n }\n if (Player.hasAugmentation(AugmentationNames.StaneksGift2, true)) {\n return (\n <>\n <Typography>\n <i>\n Allison \"Mother\" Stanek: I see you've taken to my creation. So much that it could hardly be recognized as\n one of my own after your tinkering with it. I see you follow the ways of the Machine God as I do, and your\n mastery of the gift clearly demonstrates that. My hopes are climbing by the day for you.\n </i>\n </Typography>\n <br />\n {toStanek}\n <br />\n {symbol}\n </>\n );\n }\n if (Player.factions.includes(FactionNames.ChurchOfTheMachineGod)) {\n return (\n <>\n <Typography>\n <i>Allison \"Mother\" Stanek: Welcome back my child!</i>\n </Typography>\n <br />\n {toStanek}\n <br />\n {symbol}\n </>\n );\n }\n\n if (!Player.canAccessCotMG()) {\n return (\n <>\n <Typography>\n A decrepit altar stands in the middle of a dilapidated church.\n <br />\n <br />A symbol is carved in the altar.\n </Typography>\n <br />\n {symbol}\n </>\n );\n }\n\n if (\n Player.augmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length > 0 ||\n Player.queuedAugmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length > 0\n ) {\n return (\n <>\n <Typography>\n <i>\n Allison \"Mother\" Stanek: Begone you filth! My gift must be the first modification that your body should\n have!\n </i>\n </Typography>\n </>\n );\n }\n\n return (\n <>\n <Typography>\n <i>\n Allison \"Mother\" Stanek: Welcome child, I see your body is pure. Are you ready to ascend beyond our human\n form? If you are, accept my gift.\n </i>\n </Typography>\n <Button onClick={handleCotMG}>Accept Stanek's Gift</Button>\n {symbol}\n </>\n );\n }\n\n function renderGlitch(): React.ReactElement {\n return (\n <>\n <Typography>\n <CorruptableText content={\"An eerie aura surrounds this area. You feel you should leave.\"} />\n </Typography>\n </>\n );\n }\n\n switch (props.loc.name) {\n case LocationName.NewTokyoVitaLife: {\n return renderGrafting();\n }\n case LocationName.Sector12CityHall: {\n return (BitNodeMultipliers.CorporationSoftcap < 0.15 && <></>) || <CreateCorporation />;\n }\n case LocationName.Sector12NSA: {\n return renderBladeburner();\n }\n case LocationName.NewTokyoNoodleBar: {\n return renderNoodleBar();\n }\n case LocationName.ChongqingChurchOfTheMachineGod: {\n return renderCotMG();\n }\n case LocationName.IshimaGlitch: {\n return renderGlitch();\n }\n case LocationName.NewTokyoArcade: {\n return <ArcadeRoot />;\n }\n default:\n console.error(`Location ${props.loc.name} doesn't have any special properties`);\n return <></>;\n }\n}\n","import React, { useState } from \"react\";\n\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { Router } from \"../../../ui/GameRoot\";\nimport { Player } from \"@player\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function CreateCorporationModal(props: IProps): React.ReactElement {\n const canSelfFund = Player.canAfford(150e9);\n if (!Player.canAccessCorporation() || Player.hasCorporation()) {\n props.onClose();\n return <></>;\n }\n\n const [name, setName] = useState(\"\");\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setName(event.target.value);\n }\n\n function selfFund(): void {\n if (!canSelfFund) {\n return;\n }\n\n if (name == \"\") {\n return;\n }\n\n Player.startCorporation(name);\n Player.loseMoney(150e9, \"corporation\");\n\n props.onClose();\n Router.toCorporation();\n }\n\n function seed(): void {\n if (name == \"\") {\n return;\n }\n\n Player.startCorporation(name, 500e6);\n\n props.onClose();\n Router.toCorporation();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to start a corporation? This will require $150b for registration and initial funding.{\" \"}\n {Player.bitNodeN === 3 &&\n `This $150b\n can either be self-funded, or you can obtain the seed money from the government in exchange for 500 million\n shares`}\n <br />\n <br />\n If you would like to start one, please enter a name for your corporation below:\n </Typography>\n <TextField autoFocus={true} placeholder=\"Corporation Name\" onChange={onChange} value={name} />\n {Player.bitNodeN === 3 && (\n <Button onClick={seed} disabled={name == \"\"}>\n Use seed money\n </Button>\n )}\n <Button onClick={selfFund} disabled={name == \"\" || !canSelfFund}>\n Self-Fund (<Money money={150e9} forPurchase={true} />)\n </Button>\n </Modal>\n );\n}\n","const n00dlePower =\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[]\" +\n \")[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(\" +\n \"!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]\" +\n \"+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+\" +\n \"[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[\" +\n \"])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!\" +\n \"+[]]+([][[]]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[\" +\n \"])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!\" +\n \"![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+\" +\n \"[]+[!+[]+!+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[\" +\n \"!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+\" +\n \"[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[]\" +\n \")[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+\" +\n \"([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!\" +\n \"+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]]\" +\n \")[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])\" +\n \"[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+\" +\n \"[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[\" +\n \"]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[\" +\n \"]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[\" +\n \"]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]\" +\n \"])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+\" +\n \"!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[\" +\n \"])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+\" +\n \"(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!\" +\n \"+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+\" +\n \"[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+\" +\n \"!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]\" +\n \"]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(!\" +\n \"[]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]\" +\n \"]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[]\" +\n \")[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[\" +\n \"]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!\" +\n \"+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[\" +\n \"+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(\" +\n \"![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]\" +\n \"+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[]\" +\n \")[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]]+[+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+\" +\n \"[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][(\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+\" +\n \"[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]\" +\n \"]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!\" +\n \"![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(\" +\n \"![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[\" +\n \"])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[\" +\n \"])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[]\" +\n \")[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[\" +\n \"]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[\" +\n \"][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[\" +\n \"]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[]\" +\n \")[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!\" +\n \"+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]\" +\n \"]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]\" +\n \"]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+(\" +\n \"[][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[\" +\n \"+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+\" +\n \"[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[\" +\n \"]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+\" +\n \"(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[]\" +\n \")[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]\" +\n \"])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]]\" +\n \"(!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]])()([][(![]+[])[+[]]+(!\" +\n \"[]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[(![]+[])[!+[]+!+[]+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]\" +\n \"]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]]\" +\n \"((+((+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]+[+[\" +\n \"]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+!+[]]])+[])[!+[]+!+[]]+[+!+[]])+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]])()())[!+[]+!+[]+!+[]+[+[]]]+(+[]+[][(\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+\" +\n \"[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]\" +\n \"]])[+!+[]+[+[]]]+(+[]+[][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]+!+[]]]()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!\" +\n \"![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![\" +\n \"]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]\" +\n \"+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[\" +\n \"])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]\" +\n \"+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+\" +\n \"[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]\" +\n \"+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+!+[]]+([\" +\n \"![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[!+[]+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[\" +\n \"])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(+[![]]+[+(+!+[]+(\" +\n \"!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(!![]+[][(![]\" +\n \"+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][\" +\n \"[]]+[])[+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[\" +\n \"]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+\" +\n \"[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+\" +\n \"!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]\" +\n \"+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(+(!+[]\" +\n \"+!+[]+[+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])\" +\n \"[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+\" +\n \"[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([\" +\n \"][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[\" +\n \"]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!\" +\n \"+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]\" +\n \"]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]\" +\n \"+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]\" +\n \"]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(!\" +\n \"[]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!\" +\n \"![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]]\" +\n \")+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[\" +\n \"+!+[]+[+!+[]]]+(!![]+[])[+[]]+(+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"[]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])\" +\n \"[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![\" +\n \"]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![\" +\n \"]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[]\" +\n \")[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[\" +\n \"])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+\" +\n \"[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[\" +\n \"+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!\" +\n \"+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[]\" +\n \")[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![\" +\n \"]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!\" +\n \"[]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!!\" +\n \"[]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]\" +\n \"]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![\" +\n \"]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[\" +\n \"]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]\" +\n \"+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+\" +\n \"[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])\" +\n \"[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]\" +\n \"+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+\" +\n \"[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!\" +\n \"+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])\" +\n \"[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[\" +\n \"])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+\" +\n \"[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()\" +\n \"+[])[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[\" +\n \"!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+\" +\n \"[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[]\" +\n \")[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+\" +\n \"([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!\" +\n \"+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]]\" +\n \")[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])\" +\n \"[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+\" +\n \"[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[\" +\n \"]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[\" +\n \"]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[\" +\n \"]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]\" +\n \"])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"[][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[\" +\n \"+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+\" +\n \"!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[]\" +\n \"[(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]])()\";\n\nexport function N00dles(): void {\n // TODO: Too powerful, needs a nerf.\n eval(n00dlePower);\n}\n","import React, { useState } from \"react\";\nimport { BBCabinetRoot } from \"./BBCabinet\";\n\nimport Button from \"@mui/material/Button\";\nimport { Player } from \"@player\";\nimport { AlertEvents } from \"../../ui/React/AlertManager\";\n\nenum Page {\n None,\n Megabyteburner2000,\n}\n\nexport function ArcadeRoot(): React.ReactElement {\n const [page, setPage] = useState(Page.None);\n\n function mbBurner2000(): void {\n if (Player.sourceFileLvl(1) === 0) {\n AlertEvents.emit(\"This machine is broken.\");\n } else {\n setPage(Page.Megabyteburner2000);\n }\n }\n\n if (page === Page.None) {\n return (\n <>\n <Button onClick={mbBurner2000}>Megabyte burner 2000</Button>\n </>\n );\n }\n let currentGame = <></>;\n switch (page) {\n case Page.Megabyteburner2000:\n currentGame = <BBCabinetRoot />;\n }\n return (\n <>\n <Button onClick={() => setPage(Page.None)}>Back</Button>\n {currentGame}\n </>\n );\n}\n","import React, { useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { Player } from \"@player\";\nimport { Exploit } from \"../../Exploits/Exploit\";\n\nconst metaBB = \"https://bitburner-official.github.io/bitburner-legacy/\";\n\nconst style = {\n width: \"1060px\",\n height: \"800px\",\n border: \"0px\",\n};\n\nexport function BBCabinetRoot(): React.ReactElement {\n useEffect(() => {\n window.addEventListener(\"message\", function (this: Window, ev: MessageEvent<boolean>) {\n if (ev.isTrusted && ev.origin == \"https://bitburner-official.github.io\" && ev.data) {\n Player.giveExploit(Exploit.TrueRecursion);\n }\n });\n });\n // prettier-ignore\n const joystick =\n <>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ,'\" \"', .-. </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / \\ ( ) </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | .-. '-' .-. </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ / ( ) ( )</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> '.___.' '-' .-. '-'</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ||| ( ) </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ||| '-' </Typography>\n </>;\n return (\n <>\n <div\n style={{\n width: \"1060px\",\n height: \"800px\",\n padding: \"0\",\n overflow: \"hidden\",\n borderColor: \"white\",\n borderStyle: \"solid\",\n borderWidth: \"5px\",\n }}\n >\n <iframe src={metaBB} style={style} />\n </div>\n <div\n style={{\n width: \"1060px\",\n borderColor: \"white\",\n borderStyle: \"solid\",\n borderWidth: \"5px\",\n }}\n >\n {joystick}\n </div>\n </>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a tech vendor\n *\n * This subcomponent renders all of the buttons for purchasing things from tech vendors\n */\nimport React, { useState, useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\nimport { RamButton } from \"./RamButton\";\nimport { TorButton } from \"./TorButton\";\nimport { CoresButton } from \"./CoresButton\";\n\nimport { getPurchaseServerCost } from \"../../Server/ServerPurchases\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Player } from \"@player\";\nimport { PurchaseServerModal } from \"./PurchaseServerModal\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Box } from \"@mui/material\";\n\ninterface IServerProps {\n ram: number;\n rerender: () => void;\n}\n\nfunction ServerButton(props: IServerProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n const cost = getPurchaseServerCost(props.ram);\n return (\n <>\n <Button onClick={() => setOpen(true)} disabled={!Player.canAfford(cost)}>\n Purchase {numeralWrapper.formatRAM(props.ram)} Server - \n <Money money={cost} forPurchase={true} />\n </Button>\n <PurchaseServerModal\n open={open}\n onClose={() => setOpen(false)}\n ram={props.ram}\n cost={cost}\n rerender={props.rerender}\n />\n </>\n );\n}\n\ntype IProps = {\n loc: Location;\n};\n\nexport function TechVendorLocation(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n const purchaseServerButtons: React.ReactNode[] = [];\n for (let i = props.loc.techVendorMinRam; i <= props.loc.techVendorMaxRam; i *= 2) {\n purchaseServerButtons.push(<ServerButton key={i} ram={i} rerender={rerender} />);\n }\n\n return (\n <>\n <br />\n <Box sx={{ display: \"grid\", width: \"fit-content\" }}>{purchaseServerButtons}</Box>\n <br />\n <Typography>\n <i>\"You can order bigger servers via scripts. We don't take custom orders in person.\"</i>\n </Typography>\n <br />\n <TorButton rerender={rerender} />\n <br />\n <RamButton rerender={rerender} />\n <br />\n <CoresButton rerender={rerender} />\n </>\n );\n}\n","import React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Typography from \"@mui/material/Typography\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { Player } from \"@player\";\nimport { purchaseRamForHomeComputer } from \"../../Server/ServerPurchases\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\ntype IProps = {\n rerender: () => void;\n};\n\nexport function RamButton(props: IProps): React.ReactElement {\n const homeComputer = Player.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n return <Button>Upgrade 'home' RAM - MAX</Button>;\n }\n\n const cost = Player.getUpgradeHomeRamCost();\n\n function buy(): void {\n purchaseRamForHomeComputer();\n props.rerender();\n }\n\n const bnMult = BitNodeMultipliers.HomeComputerRamCost === 1 ? \"\" : `\\\\cdot ${BitNodeMultipliers.HomeComputerRamCost}`;\n\n return (\n <Tooltip\n title={\n <MathJaxWrapper>{`\\\\(\\\\large{cost = ram \\\\cdot 3.2 \\\\cdot 10^4 \\\\cdot 1.58^{log_2{(ram)}}} ${bnMult}\\\\)`}</MathJaxWrapper>\n }\n >\n <span>\n <br />\n <Typography>\n <i>\"More RAM means more scripts on 'home'\"</i>\n </Typography>\n <br />\n <Button disabled={!Player.canAfford(cost)} onClick={buy}>\n Upgrade 'home' RAM ({numeralWrapper.formatRAM(homeComputer.maxRam)} -> \n {numeralWrapper.formatRAM(homeComputer.maxRam * 2)}) - \n <Money money={cost} forPurchase={true} />\n </Button>\n </span>\n </Tooltip>\n );\n}\n","import React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { Player } from \"@player\";\n\nimport { Money } from \"../../ui/React/Money\";\n\n/** Attempt to purchase a TOR router using the button. */\nexport function purchaseTorRouter(): void {\n if (Player.hasTorRouter()) {\n dialogBoxCreate(`You already have a TOR Router!`);\n return;\n }\n if (!Player.canAfford(CONSTANTS.TorRouterCost)) {\n dialogBoxCreate(\"You cannot afford to purchase the TOR router!\");\n return;\n }\n Player.loseMoney(CONSTANTS.TorRouterCost, \"other\");\n\n const darkweb = GetServer(SpecialServers.DarkWeb);\n if (!darkweb) {\n throw new Error(\"Dark web is not a server.\");\n }\n\n Player.getHomeComputer().serversOnNetwork.push(darkweb.hostname);\n darkweb.serversOnNetwork.push(Player.getHomeComputer().hostname);\n dialogBoxCreate(\n \"You have purchased a TOR router!\\n\" +\n \"You now have access to the dark web from your home computer.\\n\" +\n \"Use the scan/scan-analyze commands to search for the dark web connection.\",\n );\n}\n\ntype IProps = {\n rerender: () => void;\n};\n\nexport function TorButton(props: IProps): React.ReactElement {\n function buy(): void {\n purchaseTorRouter();\n props.rerender();\n }\n\n if (Player.hasTorRouter()) {\n return <Button>TOR Router - Purchased</Button>;\n }\n\n return (\n <Button disabled={!Player.canAfford(CONSTANTS.TorRouterCost)} onClick={buy}>\n Purchase TOR router - \n <Money money={CONSTANTS.TorRouterCost} forPurchase={true} />\n </Button>\n );\n}\n","import React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Typography from \"@mui/material/Typography\";\n\nimport { Player } from \"@player\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\ntype IProps = {\n rerender: () => void;\n};\n\nexport function CoresButton(props: IProps): React.ReactElement {\n const homeComputer = Player.getHomeComputer();\n const maxCores = homeComputer.cpuCores >= 8;\n if (maxCores) {\n return <Button>Upgrade 'home' cores - MAX</Button>;\n }\n\n const cost = Player.getUpgradeHomeCoresCost();\n\n function buy(): void {\n if (maxCores) return;\n if (!Player.canAfford(cost)) return;\n Player.loseMoney(cost, \"servers\");\n homeComputer.cpuCores++;\n props.rerender();\n }\n\n return (\n <Tooltip title={<MathJaxWrapper>{`\\\\(\\\\large{cost = 10^9 \\\\cdot 7.5 ^{\\\\text{cores}}}\\\\)`}</MathJaxWrapper>}>\n <span>\n <br />\n <Typography>\n <i>\"Cores increase the effectiveness of grow() and weaken() on 'home'\"</i>\n </Typography>\n <br />\n <Button disabled={!Player.canAfford(cost)} onClick={buy}>\n Upgrade 'home' cores ({homeComputer.cpuCores} -> {homeComputer.cpuCores + 1}) - \n <Money money={cost} forPurchase={true} />\n </Button>\n </span>\n </Tooltip>\n );\n}\n","import React, { useState } from \"react\";\nimport { purchaseServer } from \"../../Server/ServerPurchases\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Player } from \"@player\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n ram: number;\n cost: number;\n rerender: () => void;\n}\n\n/** React Component for the popup used to purchase a new server. */\nexport function PurchaseServerModal(props: IProps): React.ReactElement {\n const [hostname, setHostname] = useState(\"\");\n\n function tryToPurchaseServer(): void {\n purchaseServer(hostname, props.ram, props.cost);\n props.onClose();\n }\n\n function onKeyUp(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) tryToPurchaseServer();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setHostname(event.target.value);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to purchase a new server with {numeralWrapper.formatRAM(props.ram)} of RAM for{\" \"}\n <Money money={props.cost} forPurchase={true} />?\n </Typography>\n <br />\n <br />\n <Typography> Please enter the server hostname below:</Typography>\n <br />\n\n <TextField\n autoFocus\n onKeyUp={onKeyUp}\n onChange={onChange}\n type=\"text\"\n placeholder=\"Unique Hostname\"\n InputProps={{\n endAdornment: (\n <Button onClick={tryToPurchaseServer} disabled={!Player.canAfford(props.cost) || hostname === \"\"}>\n Buy\n </Button>\n ),\n }}\n />\n </Modal>\n );\n}\n","import React from \"react\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n city: string;\n travel: () => void;\n\n open: boolean;\n onClose: () => void;\n}\n\nexport function TravelConfirmationModal(props: IProps): React.ReactElement {\n const cost = CONSTANTS.TravelCost;\n function travel(): void {\n props.travel();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to travel to {props.city}? The trip will cost <Money money={cost} forPurchase={true} />.\n </Typography>\n <br />\n <br />\n <Button onClick={travel}>\n <Typography>Travel</Typography>\n </Button>\n </Modal>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a university\n *\n * This subcomponent renders all of the buttons for studying/taking courses\n */\nimport * as React from \"react\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { Player } from \"@player\";\nimport { Box } from \"@mui/material\";\n\nimport { ClassWork, ClassType, Classes } from \"../../Work/ClassWork\";\nimport { calculateCost } from \"../../Work/formulas/Class\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function UniversityLocation(props: IProps): React.ReactElement {\n function take(classType: ClassType): void {\n Player.startWork(\n new ClassWork({\n classType: classType,\n location: props.loc.name,\n singularity: false,\n }),\n );\n Player.startFocusing();\n Router.toWork();\n }\n\n const dataStructuresCost = calculateCost(Classes[ClassType.DataStructures], props.loc);\n const networksCost = calculateCost(Classes[ClassType.Networks], props.loc);\n const algorithmsCost = calculateCost(Classes[ClassType.Algorithms], props.loc);\n const managementCost = calculateCost(Classes[ClassType.Management], props.loc);\n const leadershipCost = calculateCost(Classes[ClassType.Leadership], props.loc);\n\n const earnHackingExpTooltip = `Gain hacking experience!`;\n const earnCharismaExpTooltip = `Gain charisma experience!`;\n\n return (\n <Box sx={{ display: \"grid\", width: \"fit-content\" }}>\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={() => take(ClassType.StudyComputerScience)}>Study Computer Science (free)</Button>\n </Tooltip>\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={() => take(ClassType.DataStructures)}>\n Take Data Structures course (\n <Money money={dataStructuresCost} forPurchase={true} /> / sec)\n </Button>\n </Tooltip>\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={() => take(ClassType.Networks)}>\n Take Networks course (\n <Money money={networksCost} forPurchase={true} /> / sec)\n </Button>\n </Tooltip>\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={() => take(ClassType.Algorithms)}>\n Take Algorithms course (\n <Money money={algorithmsCost} forPurchase={true} /> / sec)\n </Button>\n </Tooltip>\n <Tooltip title={earnCharismaExpTooltip}>\n <Button onClick={() => take(ClassType.Management)}>\n Take Management course (\n <Money money={managementCost} forPurchase={true} /> / sec)\n </Button>\n </Tooltip>\n <Tooltip title={earnCharismaExpTooltip}>\n <Button onClick={() => take(ClassType.Leadership)}>\n Take Leadership course (\n <Money money={leadershipCost} forPurchase={true} /> / sec)\n </Button>\n </Tooltip>\n </Box>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a gym\n *\n * This subcomponent renders all of the buttons for training at the gym\n */\nimport React, { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport { Blackjack, DECK_COUNT } from \"../../Casino/Blackjack\";\nimport { CoinFlip } from \"../../Casino/CoinFlip\";\nimport { Roulette } from \"../../Casino/Roulette\";\nimport { SlotMachine } from \"../../Casino/SlotMachine\";\nimport { Box } from \"@mui/material\";\n\nenum GameType {\n None = \"none\",\n Coin = \"coin\",\n Slots = \"slots\",\n Roulette = \"roulette\",\n Blackjack = \"blackjack\",\n}\n\nexport function CasinoLocation(): React.ReactElement {\n const [game, setGame] = useState(GameType.None);\n\n function updateGame(game: GameType): void {\n setGame(game);\n }\n\n return (\n <>\n {game === GameType.None && (\n <Box sx={{ display: \"grid\", width: \"fit-content\" }}>\n <Button onClick={() => updateGame(GameType.Coin)}>Play coin flip</Button>\n <Button onClick={() => updateGame(GameType.Slots)}>Play slots</Button>\n <Button onClick={() => updateGame(GameType.Roulette)}>Play roulette</Button>\n <Button onClick={() => updateGame(GameType.Blackjack)}>Play blackjack ({DECK_COUNT} decks)</Button>\n </Box>\n )}\n {game !== GameType.None && (\n <>\n <Button onClick={() => updateGame(GameType.None)}>Stop playing</Button>\n {game === GameType.Coin && <CoinFlip />}\n {game === GameType.Slots && <SlotMachine />}\n {game === GameType.Roulette && <Roulette />}\n {game === GameType.Blackjack && <Blackjack />}\n </>\n )}\n </>\n );\n}\n","import { Card, Suit } from \"./Card\";\nimport { shuffle } from \"lodash\";\n\nexport class Deck {\n private cards: Card[] = [];\n\n // Support multiple decks\n constructor(private numDecks = 1) {\n this.reset();\n }\n\n shuffle(): void {\n this.cards = shuffle(this.cards); // Just use lodash\n }\n\n drawCard(): Card {\n if (this.cards.length == 0) {\n throw new Error(\"Tried to draw card from empty deck\");\n }\n\n return this.cards.shift() as Card; // Guaranteed to return a Card since we throw an Error if array is empty\n }\n\n // Draws a card, resetting the deck beforehand if the Deck is empty\n safeDrawCard(): Card {\n if (this.cards.length === 0) {\n this.reset();\n }\n\n return this.drawCard();\n }\n\n // Reset the deck back to the original 52 cards and shuffle it\n reset(): void {\n this.cards = [];\n\n for (let i = 1; i <= 13; ++i) {\n for (let j = 0; j < this.numDecks; ++j) {\n this.cards.push(new Card(i, Suit.Clubs));\n this.cards.push(new Card(i, Suit.Diamonds));\n this.cards.push(new Card(i, Suit.Hearts));\n this.cards.push(new Card(i, Suit.Spades));\n }\n }\n\n this.shuffle();\n }\n\n size(): number {\n return this.cards.length;\n }\n\n isEmpty(): boolean {\n return this.cards.length === 0;\n }\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a gym\n *\n * This subcomponent renders all of the buttons for training at the gym\n */\nimport React, { useState } from \"react\";\n\nimport { BadRNG } from \"./RNG\";\nimport { win, reachedLimit } from \"./Game\";\nimport { trusted } from \"./utils\";\n\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\nconst minPlay = 0;\nconst maxPlay = 10e3;\n\nexport function CoinFlip(): React.ReactElement {\n const [investment, setInvestment] = useState(1000);\n const [result, setResult] = useState(<span> </span>);\n const [status, setStatus] = useState(\"\");\n const [playLock, setPlayLock] = useState(false);\n\n function updateInvestment(e: React.ChangeEvent<HTMLInputElement>): void {\n let investment: number = parseInt(e.currentTarget.value);\n if (isNaN(investment)) {\n investment = minPlay;\n }\n if (investment > maxPlay) {\n investment = maxPlay;\n }\n if (investment < minPlay) {\n investment = minPlay;\n }\n setInvestment(investment);\n }\n\n function play(guess: string): void {\n if (reachedLimit()) return;\n const v = BadRNG.random();\n let letter: string;\n if (v < 0.5) {\n letter = \"H\";\n } else {\n letter = \"T\";\n }\n const correct: boolean = guess === letter;\n\n setResult(\n <Box display=\"flex\">\n <Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }} color={correct ? \"primary\" : \"error\"}>\n {letter}\n </Typography>\n </Box>,\n );\n setStatus(correct ? \" win!\" : \"lose!\");\n setPlayLock(true);\n\n setTimeout(() => setPlayLock(false), 250);\n if (correct) {\n win(investment);\n } else {\n win(-investment);\n }\n if (reachedLimit()) return;\n }\n\n return (\n <>\n <Typography>Result:</Typography> {result}\n <Box display=\"flex\" alignItems=\"center\">\n <TextField\n type=\"number\"\n onChange={updateInvestment}\n InputProps={{\n endAdornment: (\n <>\n <Button onClick={trusted(() => play(\"H\"))} disabled={playLock}>\n Head!\n </Button>\n <Button onClick={trusted(() => play(\"T\"))} disabled={playLock}>\n Tail!\n </Button>\n </>\n ),\n }}\n />\n </Box>\n <Typography variant=\"h3\">{status}</Typography>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { Money } from \"../ui/React/Money\";\nimport { win, reachedLimit } from \"./Game\";\nimport { WHRNG } from \"./RNG\";\nimport { trusted } from \"./utils\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\nconst minPlay = 0;\nconst maxPlay = 1e7;\n\nfunction isRed(n: number): boolean {\n return [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36].includes(n);\n}\n\ntype Strategy = {\n match: (n: number) => boolean;\n payout: number;\n};\n\nconst redNumbers: number[] = [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36];\n\nconst strategies: {\n Red: Strategy;\n Black: Strategy;\n Odd: Strategy;\n Even: Strategy;\n High: Strategy;\n Low: Strategy;\n Third1: Strategy;\n Third2: Strategy;\n Third3: Strategy;\n} = {\n Red: {\n match: (n: number): boolean => {\n return redNumbers.includes(n);\n },\n payout: 1,\n },\n Black: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return !redNumbers.includes(n);\n },\n payout: 1,\n },\n Odd: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n % 2 === 1;\n },\n payout: 1,\n },\n Even: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n % 2 === 0;\n },\n payout: 1,\n },\n High: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n > 18;\n },\n payout: 1,\n },\n Low: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n < 19;\n },\n payout: 1,\n },\n Third1: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n <= 12;\n },\n payout: 2,\n },\n Third2: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n >= 13 && n <= 24;\n },\n payout: 2,\n },\n Third3: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n >= 25;\n },\n payout: 2,\n },\n};\n\nfunction Single(s: number): Strategy {\n return {\n match: (n: number): boolean => {\n return s === n;\n },\n payout: 36,\n };\n}\n\nexport function Roulette(): React.ReactElement {\n const [rng] = useState(new WHRNG(new Date().getTime()));\n const [investment, setInvestment] = useState(1000);\n const [canPlay, setCanPlay] = useState(true);\n const [status, setStatus] = useState<string | JSX.Element>(\"waiting\");\n const [n, setN] = useState(0);\n const [lock, setLock] = useState(true);\n\n useEffect(() => {\n const i = window.setInterval(step, 50);\n return () => clearInterval(i);\n });\n\n function step(): void {\n if (!lock) {\n setN(Math.floor(Math.random() * 37));\n }\n }\n\n function updateInvestment(e: React.ChangeEvent<HTMLInputElement>): void {\n let investment: number = parseInt(e.currentTarget.value);\n if (isNaN(investment)) {\n investment = minPlay;\n }\n if (investment > maxPlay) {\n investment = maxPlay;\n }\n if (investment < minPlay) {\n investment = minPlay;\n }\n setInvestment(investment);\n }\n\n function currentNumber(): string {\n if (n === 0) return \"0\";\n const color = isRed(n) ? \"R\" : \"B\";\n return `${n}${color}`;\n }\n\n function play(strategy: Strategy): void {\n if (reachedLimit()) return;\n\n setCanPlay(false);\n setLock(false);\n setStatus(\"playing\");\n\n setTimeout(() => {\n let n = Math.floor(rng.random() * 37);\n let status = <></>;\n let gain = 0;\n let playerWin = strategy.match(n);\n // oh yeah, the house straight up cheats. Try finding the seed now!\n if (playerWin && Math.random() > 0.9) {\n while (playerWin) {\n n = Math.floor(rng.random() * 37);\n playerWin = strategy.match(n);\n }\n }\n if (playerWin) {\n gain = investment * strategy.payout;\n status = (\n <>\n won <Money money={gain} />\n </>\n );\n } else {\n gain = -investment;\n status = (\n <>\n lost <Money money={-gain} />\n </>\n );\n }\n win(gain);\n\n setCanPlay(true);\n setLock(true);\n setStatus(status);\n setN(n);\n\n reachedLimit();\n }, 1600);\n }\n\n return (\n <>\n <Typography variant=\"h4\">{currentNumber()}</Typography>\n <TextField type=\"number\" onChange={updateInvestment} placeholder={\"Amount to play\"} disabled={!canPlay} />\n <Typography variant=\"h4\">{status}</Typography>\n <table>\n <tbody>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(3)))}>\n 3\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(6)))}>\n 6\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(9)))}>\n 9\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(12)))}>\n 12\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(15)))}>\n 15\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(18)))}>\n 18\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(21)))}>\n 21\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(24)))}>\n 24\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(27)))}>\n 27\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(30)))}>\n 30\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(33)))}>\n 33\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(36)))}>\n 36\n </Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(2)))}>\n 2\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(5)))}>\n 5\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(8)))}>\n 8\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(11)))}>\n 11\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(14)))}>\n 14\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(17)))}>\n 17\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(20)))}>\n 20\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(23)))}>\n 23\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(26)))}>\n 26\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(29)))}>\n 29\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(32)))}>\n 32\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(35)))}>\n 35\n </Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(1)))}>\n 1\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(4)))}>\n 4\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(7)))}>\n 7\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(10)))}>\n 10\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(13)))}>\n 13\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(16)))}>\n 16\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(19)))}>\n 19\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(22)))}>\n 22\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(25)))}>\n 25\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(28)))}>\n 28\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(31)))}>\n 31\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(34)))}>\n 34\n </Button>\n </td>\n </tr>\n <tr>\n <td colSpan={4}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Third1))}>\n 1 to 12\n </Button>\n </td>\n <td colSpan={4}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Third2))}>\n 13 to 24\n </Button>\n </td>\n <td colSpan={4}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Third3))}>\n 25 to 36\n </Button>\n </td>\n </tr>\n <tr>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Red))}>\n Red\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Black))}>\n Black\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Odd))}>\n Odd\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Even))}>\n Even\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.High))}>\n High\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Low))}>\n Low\n </Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(0)))}>\n 0\n </Button>\n </td>\n </tr>\n </tbody>\n </table>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { Player } from \"@player\";\nimport { Money } from \"../ui/React/Money\";\nimport { WHRNG } from \"./RNG\";\nimport { win, reachedLimit } from \"./Game\";\nimport { trusted } from \"./utils\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\n// statically shuffled array of symbols.\nconst symbols = [\n \"D\",\n \"C\",\n \"$\",\n \"?\",\n \"♥\",\n \"A\",\n \"C\",\n \"B\",\n \"C\",\n \"E\",\n \"B\",\n \"E\",\n \"C\",\n \"*\",\n \"D\",\n \"♥\",\n \"B\",\n \"A\",\n \"A\",\n \"A\",\n \"C\",\n \"A\",\n \"D\",\n \"B\",\n \"E\",\n \"?\",\n \"D\",\n \"*\",\n \"@\",\n \"♥\",\n \"B\",\n \"E\",\n \"?\",\n];\n\nfunction getPayout(s: string, n: number): number {\n switch (s) {\n case \"$\":\n return [20, 200, 1000][n];\n case \"@\":\n return [8, 80, 400][n];\n case \"♥\":\n case \"?\":\n return [6, 20, 150][n];\n case \"D\":\n case \"E\":\n return [1, 8, 30][n];\n default:\n return [1, 5, 20][n];\n }\n}\n\nconst payLines = [\n // lines\n [\n [0, 0],\n [0, 1],\n [0, 2],\n [0, 3],\n [0, 4],\n ],\n [\n [1, 0],\n [1, 1],\n [1, 2],\n [1, 3],\n [1, 4],\n ],\n [\n [2, 0],\n [2, 1],\n [2, 2],\n [2, 3],\n [2, 4],\n ],\n\n // Vs\n [\n [2, 0],\n [1, 1],\n [0, 2],\n [1, 3],\n [2, 4],\n ],\n [\n [0, 0],\n [1, 1],\n [2, 2],\n [1, 3],\n [0, 4],\n ],\n\n // rest\n [\n [0, 0],\n [1, 1],\n [1, 2],\n [1, 3],\n [0, 4],\n ],\n [\n [2, 0],\n [1, 1],\n [1, 2],\n [1, 3],\n [2, 4],\n ],\n [\n [1, 0],\n [0, 1],\n [0, 2],\n [0, 3],\n [1, 4],\n ],\n [\n [1, 0],\n [2, 1],\n [2, 2],\n [2, 3],\n [1, 4],\n ],\n];\n\nconst minPlay = 0;\nconst maxPlay = 1e6;\n\nexport function SlotMachine(): React.ReactElement {\n const [rng] = useState(new WHRNG(Player.totalPlaytime));\n const [index, setIndex] = useState<number[]>([0, 0, 0, 0, 0]);\n const [locks, setLocks] = useState<number[]>([0, 0, 0, 0, 0]);\n const [investment, setInvestment] = useState(1000);\n const [canPlay, setCanPlay] = useState(true);\n const [status, setStatus] = useState<string | JSX.Element>(\"waiting\");\n\n useEffect(() => {\n const i = window.setInterval(step, 50);\n return () => clearInterval(i);\n });\n\n function step(): void {\n let stoppedOne = false;\n const copy = index.slice();\n for (let i = 0; i < copy.length; i++) {\n if (copy[i] === locks[i] && !stoppedOne) continue;\n copy[i] = copy[i] - 1 >= 0 ? copy[i] - 1 : symbols.length - 1;\n stoppedOne = true;\n }\n\n setIndex(copy);\n\n if (stoppedOne && copy.every((e, i) => e === locks[i])) {\n checkWinnings(getTable(copy, symbols));\n }\n }\n\n function getTable(index: number[], symbols: string[]): string[][] {\n return [\n [\n symbols[(index[0] + symbols.length - 1) % symbols.length],\n symbols[(index[1] + symbols.length - 1) % symbols.length],\n symbols[(index[2] + symbols.length - 1) % symbols.length],\n symbols[(index[3] + symbols.length - 1) % symbols.length],\n symbols[(index[4] + symbols.length - 1) % symbols.length],\n ],\n [symbols[index[0]], symbols[index[1]], symbols[index[2]], symbols[index[3]], symbols[index[4]]],\n [\n symbols[(index[0] + 1) % symbols.length],\n symbols[(index[1] + 1) % symbols.length],\n symbols[(index[2] + 1) % symbols.length],\n symbols[(index[3] + 1) % symbols.length],\n symbols[(index[4] + 1) % symbols.length],\n ],\n ];\n }\n\n function play(): void {\n if (reachedLimit()) return;\n setStatus(\"playing\");\n win(-investment);\n if (!canPlay) return;\n unlock();\n setTimeout(lock, rng.random() * 2000 + 1000);\n }\n\n function lock(): void {\n setLocks([\n Math.floor(rng.random() * symbols.length),\n Math.floor(rng.random() * symbols.length),\n Math.floor(rng.random() * symbols.length),\n Math.floor(rng.random() * symbols.length),\n Math.floor(rng.random() * symbols.length),\n ]);\n }\n\n function checkWinnings(t: string[][]): void {\n const getPaylineData = function (payline: number[][]): string[] {\n const data = [];\n for (const point of payline) {\n data.push(t[point[0]][point[1]]);\n }\n return data;\n };\n\n const countSequence = function (data: string[]): number {\n let count = 1;\n for (let i = 1; i < data.length; i++) {\n if (data[i] !== data[i - 1]) break;\n count++;\n }\n\n return count;\n };\n\n let gains = -investment;\n for (const payline of payLines) {\n const data = getPaylineData(payline);\n const count = countSequence(data);\n if (count < 3) continue;\n const payout = getPayout(data[0], count - 3);\n gains += investment * payout;\n win(investment * payout);\n }\n\n setStatus(\n <>\n {gains > 0 ? \"gained\" : \"lost\"} <Money money={Math.abs(gains)} />\n </>,\n );\n setCanPlay(true);\n if (reachedLimit()) return;\n }\n\n function unlock(): void {\n setLocks([-1, -1, -1, -1, -1]);\n setCanPlay(false);\n }\n\n function updateInvestment(e: React.ChangeEvent<HTMLInputElement>): void {\n let investment: number = parseInt(e.currentTarget.value);\n if (isNaN(investment)) {\n investment = minPlay;\n }\n if (investment > maxPlay) {\n investment = maxPlay;\n }\n if (investment < minPlay) {\n investment = minPlay;\n }\n setInvestment(investment);\n }\n\n const t = getTable(index, symbols);\n // prettier-ignore\n return (\n <>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>+———————————————————————+</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>| | {t[0][0]} | {t[0][1]} | {t[0][2]} | {t[0][3]} | {t[0][4]} | |</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>| | | | | | | |</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>| | {symbols[index[0]]} | {symbols[index[1]]} | {symbols[index[2]]} | {symbols[index[3]]} | {symbols[index[4]]} | |</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>| | | | | | | |</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>| | {symbols[(index[0]+1)%symbols.length]} | {symbols[(index[1]+1)%symbols.length]} | {symbols[(index[2]+1)%symbols.length]} | {symbols[(index[3]+1)%symbols.length]} | {symbols[(index[4]+1)%symbols.length]} | |</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>+———————————————————————+</Typography>\n <TextField\n type=\"number\"\n onChange={updateInvestment}\n placeholder={\"Amount to play\"}\n disabled={!canPlay}\n InputProps={{endAdornment:(<Button\n onClick={trusted(play)}\n disabled={!canPlay}\n >Spin!</Button>)}}\n />\n\n <Typography variant=\"h4\">{status}</Typography>\n <Typography>Pay lines</Typography>\n\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>----- ····· ·····</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>····· ----- ·····</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>····· ····· -----</Typography>\n<br />\n\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>··^·· \\···/ \\···/</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>·/·\\· ·\\·/· ·---·</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>/···\\ ··v·· ·····</Typography>\n<br />\n\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>····· ·---· ·····</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>·---· /···\\ \\···/</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>/···\\ ····· ·---·</Typography>\n </>\n );\n}\n\n// https://felgo.com/doc/how-to-make-a-slot-game-tutorial/\n","/**\n * React Component for displaying a City's UI.\n * This UI shows all of the available locations in the city, and lets the player\n * visit those locations\n */\nimport * as React from \"react\";\n\nimport { City } from \"../City\";\nimport { Cities } from \"../Cities\";\nimport { LocationName } from \"../data/LocationNames\";\nimport { Locations } from \"../Locations\";\nimport { Location } from \"../Location\";\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { Player } from \"@player\";\nimport { Router } from \"../../ui/GameRoot\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { LocationType } from \"../LocationTypeEnum\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ntype IProps = {\n city: City;\n};\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n location: {\n color: theme.colors.white,\n whiteSpace: \"nowrap\",\n margin: \"0px\",\n padding: \"0px\",\n cursor: \"pointer\",\n },\n }),\n);\n\nfunction toLocation(location: Location): void {\n if (location.name === LocationName.TravelAgency) {\n Router.toTravel();\n } else if (location.name === LocationName.WorldStockExchange) {\n Router.toStockMarket();\n } else {\n Router.toLocation(location);\n }\n}\n\nfunction LocationLetter(location: Location, className: string): React.ReactElement {\n let L = \"X\";\n if (location.types.includes(LocationType.Company)) L = \"C\";\n if (location.types.includes(LocationType.Gym)) L = \"G\";\n if (location.types.includes(LocationType.Hospital)) L = \"H\";\n if (location.types.includes(LocationType.Slums)) L = \"S\";\n if (location.types.includes(LocationType.StockMarket)) L = \"$\";\n if (location.types.includes(LocationType.TechVendor)) L = \"T\";\n if (location.types.includes(LocationType.TravelAgency)) L = \"T\";\n if (location.types.includes(LocationType.University)) L = \"U\";\n if (location.types.includes(LocationType.Casino)) L = \"¢\";\n if (location.types.includes(LocationType.Special)) L = \"?\";\n if (!location) return <span>*</span>;\n return (\n <span aria-label={location.name} key={location.name} className={className} onClick={() => toLocation(location)}>\n <b>{L}</b>\n </span>\n );\n}\n\nfunction ASCIICity(props: IProps): React.ReactElement {\n const locationLettersRegex = /[A-Z]/g;\n const letterMap: {\n [key: string]: number;\n } = {\n A: 0,\n B: 1,\n C: 2,\n D: 3,\n E: 4,\n F: 5,\n G: 6,\n H: 7,\n I: 8,\n J: 9,\n K: 10,\n L: 11,\n M: 12,\n N: 13,\n O: 14,\n P: 15,\n Q: 16,\n R: 17,\n S: 18,\n T: 19,\n U: 20,\n V: 21,\n W: 22,\n X: 23,\n Y: 24,\n Z: 25,\n };\n const classes = useStyles();\n\n const lineElems = (s: string): (string | React.ReactElement)[] => {\n const elems: (string | React.ReactElement)[] = [];\n const matches: RegExpExecArray[] = [];\n let match: RegExpExecArray | null = null;\n while ((match = locationLettersRegex.exec(s)) !== null) {\n matches.push(match);\n }\n if (matches.length === 0) {\n elems.push(s);\n return elems;\n }\n\n for (let i = 0; i < matches.length; i++) {\n const startI = i === 0 ? 0 : matches[i - 1].index + 1;\n const endI = matches[i].index;\n elems.push(s.slice(startI, endI));\n const locationI = letterMap[s[matches[i].index]];\n elems.push(LocationLetter(Locations[props.city.locations[locationI]], classes.location));\n }\n elems.push(s.slice(matches[matches.length - 1].index + 1));\n return elems;\n };\n\n const elems: JSX.Element[] = [];\n const lines = props.city.asciiArt.split(\"\\n\");\n let i = 0;\n for (const line of lines) {\n elems.push(\n <Typography key={i} sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>\n {lineElems(line)}\n </Typography>,\n );\n i++;\n }\n\n return <>{elems}</>;\n}\n\nfunction ListCity(props: IProps): React.ReactElement {\n const locationButtons = props.city.locations.map((locName) => {\n return (\n <React.Fragment key={locName}>\n <Button onClick={() => toLocation(Locations[locName])}>{locName}</Button>\n <br />\n </React.Fragment>\n );\n });\n\n return <>{locationButtons}</>;\n}\n\nexport function LocationCity(): React.ReactElement {\n const city = Cities[Player.city];\n return (\n <>\n <Typography>{city.name}</Typography>\n {Settings.DisableASCIIArt ? <ListCity city={city} /> : <ASCIICity city={city} />}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { Options, WordWrapOptions } from \"./Options\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport Select from \"@mui/material/Select\";\nimport Switch from \"@mui/material/Switch\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport TextField from \"@mui/material/TextField\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport SaveIcon from \"@mui/icons-material/Save\";\n\nimport { ThemeEditorModal } from \"./ThemeEditorModal\";\n\ninterface IProps {\n options: Options;\n save: (options: Options) => void;\n onClose: () => void;\n open: boolean;\n}\n\nexport function OptionsModal(props: IProps): React.ReactElement {\n const [theme, setTheme] = useState(props.options.theme);\n const [insertSpaces, setInsertSpaces] = useState(props.options.insertSpaces);\n const [fontSize, setFontSize] = useState(props.options.fontSize);\n const [wordWrap, setWordWrap] = useState(props.options.wordWrap);\n const [vim, setVim] = useState(props.options.vim);\n const [themeEditorOpen, setThemeEditorOpen] = useState(false);\n\n function save(): void {\n props.save({\n theme,\n insertSpaces,\n fontSize,\n wordWrap,\n vim,\n });\n props.onClose();\n }\n\n function onFontChange(event: React.ChangeEvent<HTMLInputElement>): void {\n const f = parseFloat(event.target.value);\n if (isNaN(f)) return;\n setFontSize(f);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <ThemeEditorModal open={themeEditorOpen} onClose={() => setThemeEditorOpen(false)} />\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Theme: </Typography>\n <Select onChange={(event) => setTheme(event.target.value)} value={theme}>\n <MenuItem value=\"monokai\">monokai</MenuItem>\n <MenuItem value=\"solarized-dark\">solarized-dark</MenuItem>\n <MenuItem value=\"solarized-light\">solarized-light</MenuItem>\n <MenuItem value=\"vs-dark\">dark</MenuItem>\n <MenuItem value=\"light\">light</MenuItem>\n <MenuItem value=\"dracula\">dracula</MenuItem>\n <MenuItem value=\"one-dark\">one-dark</MenuItem>\n <MenuItem value=\"customTheme\">Custom theme</MenuItem>\n </Select>\n <Button onClick={() => setThemeEditorOpen(true)} sx={{ mx: 1 }} startIcon={<EditIcon />}>\n Edit custom theme\n </Button>\n </Box>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Use whitespace over tabs: </Typography>\n <Switch onChange={(event) => setInsertSpaces(event.target.checked)} checked={insertSpaces} />\n </Box>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Word Wrap: </Typography>\n <Select onChange={(event) => setWordWrap(event.target.value as WordWrapOptions)} value={wordWrap}>\n <MenuItem value={\"off\"}>Off</MenuItem>\n <MenuItem value={\"on\"}>On</MenuItem>\n <MenuItem value={\"bounded\"}>Bounded</MenuItem>\n <MenuItem value={\"wordWrapColumn\"}>Word Wrap Column</MenuItem>\n </Select>\n </Box>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Enable vim mode: </Typography>\n <Switch onChange={(event) => setVim(event.target.checked)} checked={vim} />\n </Box>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <TextField type=\"number\" label=\"Font size\" value={fontSize} onChange={onFontChange} />\n </Box>\n <br />\n <Button onClick={save} startIcon={<SaveIcon />}>\n Save\n </Button>\n </Modal>\n );\n}\n","import { History, Reply, Save } from \"@mui/icons-material\";\nimport { Box, Button, Paper, TextField, Tooltip, Typography } from \"@mui/material\";\nimport IconButton from \"@mui/material/IconButton\";\nimport _ from \"lodash\";\nimport { Color, ColorPicker } from \"material-ui-color\";\nimport React, { useState } from \"react\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { defaultMonacoTheme, IScriptEditorTheme } from \"./themes\";\n\ninterface IProps {\n onClose: () => void;\n open: boolean;\n}\n\ninterface IColorEditorProps {\n label: string;\n themePath: string;\n color: string | undefined;\n onColorChange: (name: string, value: string) => void;\n defaultColor: string;\n}\n\n// Slightly tweaked version of the same function found in game options\nfunction ColorEditor({ label, themePath, onColorChange, color, defaultColor }: IColorEditorProps): React.ReactElement {\n if (color === undefined) {\n console.error(`color ${themePath} was undefined, reverting to default`);\n color = defaultColor;\n }\n\n return (\n <>\n <Tooltip title={label}>\n <span>\n <TextField\n label={themePath}\n value={\"#\" + color}\n sx={{ display: \"block\", my: 1 }}\n InputProps={{\n startAdornment: (\n <>\n <ColorPicker\n hideTextfield\n deferred\n value={\"#\" + color}\n onChange={(newColor: Color) => onColorChange(themePath, newColor.hex)}\n disableAlpha\n />\n </>\n ),\n endAdornment: (\n <>\n <IconButton onClick={() => onColorChange(themePath, defaultColor)}>\n <Reply color=\"primary\" />\n </IconButton>\n </>\n ),\n }}\n />\n </span>\n </Tooltip>\n </>\n );\n}\n\nexport function ThemeEditorModal(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n\n // Need to deep copy the object since it has nested attributes\n const [themeCopy, setThemeCopy] = useState<IScriptEditorTheme>(JSON.parse(JSON.stringify(Settings.EditorTheme)));\n\n function onColorChange(name: string, value: string): void {\n setThemeCopy(_.set(themeCopy, name, value));\n rerender();\n }\n\n function onThemeChange(event: React.ChangeEvent<HTMLInputElement>): void {\n try {\n const importedTheme = JSON.parse(event.target.value);\n if (typeof importedTheme !== \"object\") return;\n setThemeCopy(importedTheme);\n } catch (err) {\n // ignore\n }\n }\n\n return (\n <Modal\n open={props.open}\n onClose={() => {\n setThemeCopy(Settings.EditorTheme);\n props.onClose();\n }}\n >\n <Typography variant=\"h4\">Customize Editor theme</Typography>\n <Typography>Hover over input boxes for more information</Typography>\n <Paper sx={{ p: 1, my: 1 }}>\n <OptionSwitch\n checked={themeCopy.base === \"vs\"}\n onChange={(val) => {\n setThemeCopy(_.set(themeCopy, \"base\", val ? \"vs\" : \"vs-dark\"));\n rerender();\n }}\n text=\"Use light theme as base\"\n tooltip={\n <>\n If enabled, the <code>vs</code> light theme will be used as the theme base, otherwise,{\" \"}\n <code>vs-dark</code> will be used.\n </>\n }\n />\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"1fr 1fr\", width: \"fit-content\", gap: 1 }}>\n <Box>\n <Typography variant=\"h6\">UI</Typography>\n <ColorEditor\n label=\"Background color\"\n themePath=\"common.bg\"\n onColorChange={onColorChange}\n color={themeCopy.common.bg}\n defaultColor={defaultMonacoTheme.common.bg}\n />\n <ColorEditor\n label=\"Current line and minimap background color\"\n themePath=\"ui.line\"\n onColorChange={onColorChange}\n color={themeCopy.ui.line}\n defaultColor={defaultMonacoTheme.ui.line}\n />\n <ColorEditor\n label=\"Base text color\"\n themePath=\"common.fg\"\n onColorChange={onColorChange}\n color={themeCopy.common.fg}\n defaultColor={defaultMonacoTheme.common.fg}\n />\n <ColorEditor\n label=\"Popup background color\"\n themePath=\"ui.panel.bg\"\n onColorChange={onColorChange}\n color={themeCopy.ui.panel.bg}\n defaultColor={defaultMonacoTheme.ui.panel.bg}\n />\n <ColorEditor\n label=\"Background color for selected item in popup\"\n themePath=\"ui.panel.selected\"\n onColorChange={onColorChange}\n color={themeCopy.ui.panel.selected}\n defaultColor={defaultMonacoTheme.ui.panel.selected}\n />\n <ColorEditor\n label=\"Popup border color\"\n themePath=\"ui.panel.border\"\n onColorChange={onColorChange}\n color={themeCopy.ui.panel.border}\n defaultColor={defaultMonacoTheme.ui.panel.border}\n />\n <ColorEditor\n label=\"Background color of highlighted text\"\n themePath=\"ui.selection.bg\"\n onColorChange={onColorChange}\n color={themeCopy.ui.selection.bg}\n defaultColor={defaultMonacoTheme.ui.selection.bg}\n />\n </Box>\n <Box>\n <Typography variant=\"h6\">Syntax</Typography>\n <ColorEditor\n label=\"Numbers, function names, and other key vars\"\n themePath=\"common.accent\"\n onColorChange={onColorChange}\n color={themeCopy.common.accent}\n defaultColor={defaultMonacoTheme.common.accent}\n />\n <ColorEditor\n label=\"Keywords\"\n themePath=\"syntax.keyword\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.keyword}\n defaultColor={defaultMonacoTheme.syntax.keyword}\n />\n <ColorEditor\n label=\"Strings\"\n themePath=\"syntax.string\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.string}\n defaultColor={defaultMonacoTheme.syntax.string}\n />\n <ColorEditor\n label=\"Regexp literals as well as escapes within strings\"\n themePath=\"syntax.regexp\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.regexp}\n defaultColor={defaultMonacoTheme.syntax.regexp}\n />\n <ColorEditor\n label=\"Constants\"\n themePath=\"syntax.constant\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.constant}\n defaultColor={defaultMonacoTheme.syntax.constant}\n />\n <ColorEditor\n label=\"Entities\"\n themePath=\"syntax.entity\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.entity}\n defaultColor={defaultMonacoTheme.syntax.entity}\n />\n <ColorEditor\n label=\"'this', 'ns', types, and tags\"\n themePath=\"syntax.tag\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.tag}\n defaultColor={defaultMonacoTheme.syntax.tag}\n />\n <ColorEditor\n label=\"Netscript functions and constructors\"\n themePath=\"syntax.markup\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.markup}\n defaultColor={defaultMonacoTheme.syntax.markup}\n />\n <ColorEditor\n label=\"Errors\"\n themePath=\"syntax.error\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.error}\n defaultColor={defaultMonacoTheme.syntax.error}\n />\n <ColorEditor\n label=\"Comments\"\n themePath=\"syntax.comment\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.comment}\n defaultColor={defaultMonacoTheme.syntax.comment}\n />\n </Box>\n </Box>\n </Paper>\n <Paper sx={{ p: 1 }}>\n <TextField\n multiline\n fullWidth\n maxRows={10}\n label={\"import / export theme\"}\n value={JSON.stringify(themeCopy, undefined, 2)}\n onChange={onThemeChange}\n />\n <Box sx={{ mt: 1 }}>\n <Button\n onClick={() => {\n Settings.EditorTheme = { ...themeCopy };\n props.onClose();\n }}\n startIcon={<Save />}\n >\n Save\n </Button>\n <Button\n onClick={() => {\n setThemeCopy(defaultMonacoTheme);\n rerender();\n }}\n startIcon={<History />}\n >\n Reset to default\n </Button>\n </Box>\n </Paper>\n </Modal>\n );\n}\n","import { Milestones } from \"../Milestones\";\nimport { Milestone } from \"../Milestone\";\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\n\nfunction highestMilestone(milestones: Milestone[]): number {\n let n = -1;\n for (let i = 0; i < milestones.length; i++) {\n if (milestones[i].fulfilled()) n = i;\n }\n\n return n;\n}\n\nexport function MilestonesRoot(): JSX.Element {\n const n = highestMilestone(Milestones);\n const milestones = Milestones.map((milestone: Milestone, i: number) => {\n if (i <= n + 1) {\n return (\n <Typography key={i}>\n [{milestone.fulfilled() ? \"x\" : \" \"}] {milestone.title}\n </Typography>\n );\n }\n });\n return (\n <>\n <Typography variant=\"h4\">Milestones</Typography>\n <Box mx={2}>\n <Typography>\n Milestones don't reward you for completing them. They are here to guide you if you're lost. They will reset\n when you install Augmentations.\n </Typography>\n <br />\n\n <Typography>Completing fl1ght.exe</Typography>\n {milestones}\n </Box>\n </>\n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport { Link as MuiLink } from \"@mui/material\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Box from \"@mui/material/Box\";\nimport { Output, Link, RawOutput } from \"../OutputTypes\";\nimport { Terminal } from \"../../Terminal\";\nimport { TerminalInput } from \"./TerminalInput\";\nimport { TerminalEvents, TerminalClearEvents } from \"../TerminalEvents\";\nimport { BitFlumeModal } from \"../../BitNode/ui/BitFlumeModal\";\nimport { CodingContractModal } from \"../../ui/React/CodingContractModal\";\n\nimport _ from \"lodash\";\nimport { ANSIITypography } from \"../../ui/React/ANSIITypography\";\n\nfunction ActionTimer(): React.ReactElement {\n return (\n <Typography color={\"primary\"} paragraph={false}>\n {Terminal.getProgressText()}\n </Typography>\n );\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n nopadding: {\n padding: theme.spacing(0),\n },\n preformatted: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n },\n list: {\n padding: theme.spacing(0),\n height: \"100%\",\n },\n }),\n);\n\nexport function TerminalRoot(): React.ReactElement {\n const scrollHook = useRef<HTMLDivElement>(null);\n const setRerender = useState(0)[1];\n const [key, setKey] = useState(0);\n function rerender(): void {\n setRerender((old) => old + 1);\n }\n\n function clear(): void {\n setKey((key) => key + 1);\n }\n\n useEffect(() => {\n const debounced = _.debounce(async () => rerender(), 25, { maxWait: 50 });\n const unsubscribe = TerminalEvents.subscribe(debounced);\n return () => {\n debounced.cancel();\n unsubscribe();\n };\n }, []);\n\n useEffect(() => {\n const debounced = _.debounce(async () => clear(), 25, { maxWait: 50 });\n const unsubscribe = TerminalClearEvents.subscribe(debounced);\n return () => {\n debounced.cancel();\n unsubscribe();\n };\n }, []);\n\n function doScroll(): number | undefined {\n const hook = scrollHook.current;\n if (hook !== null) {\n return window.setTimeout(() => hook.scrollIntoView(true), 50);\n }\n }\n\n doScroll();\n\n useEffect(() => {\n let scrollId: number;\n const id = setTimeout(() => {\n scrollId = doScroll() ?? 0;\n }, 50);\n return () => {\n clearTimeout(id);\n clearTimeout(scrollId);\n };\n }, []);\n\n const classes = useStyles();\n return (\n <>\n <Box width=\"100%\" minHeight=\"100vh\" display={\"flex\"} alignItems={\"flex-end\"}>\n <List key={key} id=\"terminal\" classes={{ root: classes.list }}>\n {Terminal.outputHistory.map((item, i) => (\n <ListItem key={i} classes={{ root: classes.nopadding }}>\n {item instanceof Output && <ANSIITypography text={item.text} color={item.color} />}\n {item instanceof RawOutput && (\n <Typography classes={{ root: classes.preformatted }} paragraph={false}>\n {item.raw}\n </Typography>\n )}\n {item instanceof Link && (\n <>\n <Typography>{item.dashes}> </Typography>\n <MuiLink\n classes={{ root: classes.preformatted }}\n color={\"secondary\"}\n paragraph={false}\n onClick={() => Terminal.connectToServer(item.hostname)}\n >\n <Typography sx={{ textDecoration: \"underline\", \"&:hover\": { textDecoration: \"none\" } }}>\n {item.hostname}\n </Typography>\n </MuiLink>\n </>\n )}\n </ListItem>\n ))}\n\n {Terminal.action !== null && (\n <ListItem classes={{ root: classes.nopadding }}>\n <ActionTimer />{\" \"}\n </ListItem>\n )}\n </List>\n <div ref={scrollHook}></div>\n </Box>\n <Box position=\"sticky\" bottom={0} width=\"100%\" px={0}>\n <TerminalInput />\n </Box>\n <BitFlumeModal />\n <CodingContractModal />\n </>\n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Paper from \"@mui/material/Paper\";\nimport Popper from \"@mui/material/Popper\";\nimport TextField from \"@mui/material/TextField\";\n\nimport { KEY, KEYCODE } from \"../../utils/helpers/keyCodes\";\nimport { Terminal } from \"../../Terminal\";\nimport { Player } from \"@player\";\nimport { determineAllPossibilitiesForTabCompletion } from \"../determineAllPossibilitiesForTabCompletion\";\nimport { tabCompletion } from \"../tabCompletion\";\nimport { Settings } from \"../../Settings/Settings\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n margin: theme.spacing(0),\n },\n input: {\n backgroundColor: theme.colors.backgroundprimary,\n },\n nopadding: {\n padding: theme.spacing(0),\n },\n preformatted: {\n whiteSpace: \"pre-wrap\",\n margin: theme.spacing(0),\n },\n list: {\n padding: theme.spacing(0),\n height: \"100%\",\n },\n }),\n);\n\n// Save command in case we de-load this screen.\nlet command = \"\";\n\nexport function TerminalInput(): React.ReactElement {\n const terminalInput = useRef<HTMLInputElement>(null);\n\n const [value, setValue] = useState(command);\n const [postUpdateValue, setPostUpdateValue] = useState<{ postUpdate: () => void } | null>();\n const [possibilities, setPossibilities] = useState<string[]>([]);\n const classes = useStyles();\n\n // If we have no data in the current terminal history, let's initialize it from the player save\n if (Terminal.commandHistory.length === 0 && Player.terminalCommandHistory.length > 0) {\n Terminal.commandHistory = Player.terminalCommandHistory;\n Terminal.commandHistoryIndex = Terminal.commandHistory.length;\n }\n\n // Need to run after state updates, for example if we need to move cursor\n // *after* we modify input\n useEffect(() => {\n if (postUpdateValue?.postUpdate) {\n postUpdateValue.postUpdate();\n setPostUpdateValue(null);\n }\n }, [postUpdateValue]);\n\n function saveValue(newValue: string, postUpdate?: () => void): void {\n command = newValue;\n setValue(newValue);\n\n if (postUpdate) {\n setPostUpdateValue({ postUpdate });\n }\n }\n\n function handleValueChange(event: React.ChangeEvent<HTMLInputElement>): void {\n saveValue(event.target.value);\n setPossibilities([]);\n }\n\n function modifyInput(mod: string): void {\n const ref = terminalInput.current;\n if (!ref) return;\n const inputLength = value.length;\n const start = ref.selectionStart;\n if (start === null) return;\n const inputText = ref.value;\n\n switch (mod.toLowerCase()) {\n case \"backspace\":\n if (start > 0 && start <= inputLength + 1) {\n saveValue(inputText.substr(0, start - 1) + inputText.substr(start));\n }\n break;\n case \"deletewordbefore\": // Delete rest of word before the cursor\n for (let delStart = start - 1; delStart > -2; --delStart) {\n if ((inputText.charAt(delStart) === KEY.SPACE || delStart === -1) && delStart !== start - 1) {\n saveValue(inputText.substr(0, delStart + 1) + inputText.substr(start), () => {\n // Move cursor to correct location\n // foo bar |baz bum --> foo |baz bum\n const ref = terminalInput.current;\n ref?.setSelectionRange(delStart + 1, delStart + 1);\n });\n return;\n }\n }\n break;\n case \"deletewordafter\": // Delete rest of word after the cursor, including trailing space\n for (let delStart = start + 1; delStart <= value.length + 1; ++delStart) {\n if (inputText.charAt(delStart) === KEY.SPACE || delStart === value.length + 1) {\n saveValue(inputText.substr(0, start) + inputText.substr(delStart + 1), () => {\n // Move cursor to correct location\n // foo bar |baz bum --> foo bar |bum\n const ref = terminalInput.current;\n ref?.setSelectionRange(start, start);\n });\n return;\n }\n }\n break;\n case \"clearafter\": // Deletes everything after cursor\n saveValue(inputText.substr(0, start));\n break;\n case \"clearbefore\": // Deletes everything before cursor\n saveValue(inputText.substr(start), () => moveTextCursor(\"home\"));\n break;\n case \"clearall\": // Deletes everything in the input\n saveValue(\"\");\n break;\n }\n }\n\n function moveTextCursor(loc: string): void {\n const ref = terminalInput.current;\n if (!ref) return;\n const inputLength = value.length;\n const start = ref.selectionStart;\n if (start === null) return;\n\n switch (loc.toLowerCase()) {\n case \"home\":\n ref.setSelectionRange(0, 0);\n break;\n case \"end\":\n ref.setSelectionRange(inputLength, inputLength);\n break;\n case \"prevchar\":\n if (start > 0) {\n ref.setSelectionRange(start - 1, start - 1);\n }\n break;\n case \"prevword\":\n for (let i = start - 2; i >= 0; --i) {\n if (ref.value.charAt(i) === KEY.SPACE) {\n ref.setSelectionRange(i + 1, i + 1);\n return;\n }\n }\n ref.setSelectionRange(0, 0);\n break;\n case \"nextchar\":\n ref.setSelectionRange(start + 1, start + 1);\n break;\n case \"nextword\":\n for (let i = start + 1; i <= inputLength; ++i) {\n if (ref.value.charAt(i) === KEY.SPACE) {\n ref.setSelectionRange(i, i);\n return;\n }\n }\n ref.setSelectionRange(inputLength, inputLength);\n break;\n default:\n console.warn(\"Invalid loc argument in Terminal.moveTextCursor()\");\n break;\n }\n }\n\n // Catch all key inputs and redirect them to the terminal.\n useEffect(() => {\n function keyDown(this: Document, event: KeyboardEvent): void {\n if (Terminal.contractOpen) return;\n if (Terminal.action !== null && event.key === KEY.C && event.ctrlKey) {\n Terminal.finishAction(true);\n return;\n }\n const ref = terminalInput.current;\n if (event.ctrlKey || event.metaKey) return;\n if (event.key === KEY.C && (event.ctrlKey || event.metaKey)) return; // trying to copy\n\n if (ref) ref.focus();\n }\n document.addEventListener(\"keydown\", keyDown);\n return () => document.removeEventListener(\"keydown\", keyDown);\n });\n\n async function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): Promise<void> {\n const ref = terminalInput.current;\n\n // Run command.\n if (event.key === KEY.ENTER && value !== \"\") {\n event.preventDefault();\n Terminal.print(`[${Player.getCurrentServer().hostname} ~${Terminal.cwd()}]> ${value}`);\n Terminal.executeCommands(value);\n saveValue(\"\");\n return;\n }\n\n // Autocomplete\n if (event.key === KEY.TAB && value !== \"\") {\n event.preventDefault();\n\n let copy = value;\n const semiColonIndex = copy.lastIndexOf(\";\");\n if (semiColonIndex !== -1) {\n copy = copy.slice(semiColonIndex + 1);\n }\n\n copy = copy.trim();\n copy = copy.replace(/\\s\\s+/g, \" \");\n\n const commandArray = copy.split(\" \");\n let index = commandArray.length - 2;\n if (index < -1) {\n index = 0;\n }\n const allPos = await determineAllPossibilitiesForTabCompletion(copy, index, Terminal.cwd());\n if (allPos.length == 0) {\n return;\n }\n\n let arg = \"\";\n let command = \"\";\n if (commandArray.length == 0) {\n return;\n }\n if (commandArray.length == 1) {\n command = commandArray[0];\n } else if (commandArray.length == 2) {\n command = commandArray[0];\n arg = commandArray[1];\n } else if (commandArray.length == 3) {\n command = commandArray[0] + \" \" + commandArray[1];\n arg = commandArray[2];\n } else {\n arg = commandArray.pop() + \"\";\n command = commandArray.join(\" \");\n }\n\n let newValue = tabCompletion(command, arg, allPos, value);\n if (typeof newValue === \"string\" && newValue !== \"\") {\n if (!newValue.endsWith(\" \") && !newValue.endsWith(\"/\") && allPos.length === 1) newValue += \" \";\n saveValue(newValue);\n }\n if (Array.isArray(newValue)) {\n setPossibilities(newValue);\n }\n }\n\n // Clear screen.\n if (event.key === KEY.L && event.ctrlKey) {\n event.preventDefault();\n Terminal.clear();\n }\n\n // Select previous command.\n if (event.key === KEY.UP_ARROW || (Settings.EnableBashHotkeys && event.key === KEY.P && event.ctrlKey)) {\n if (Settings.EnableBashHotkeys) {\n event.preventDefault();\n }\n const i = Terminal.commandHistoryIndex;\n const len = Terminal.commandHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n Terminal.commandHistoryIndex = len;\n }\n\n if (i != 0) {\n --Terminal.commandHistoryIndex;\n }\n const prevCommand = Terminal.commandHistory[Terminal.commandHistoryIndex];\n saveValue(prevCommand);\n if (ref) {\n setTimeout(function () {\n ref.selectionStart = ref.selectionEnd = 10000;\n }, 10);\n }\n }\n\n // Select next command\n if (event.key === KEY.DOWN_ARROW || (Settings.EnableBashHotkeys && event.key === KEY.M && event.ctrlKey)) {\n if (Settings.EnableBashHotkeys) {\n event.preventDefault();\n }\n const i = Terminal.commandHistoryIndex;\n const len = Terminal.commandHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n Terminal.commandHistoryIndex = len;\n }\n\n // Latest command, put nothing\n if (i == len || i == len - 1) {\n Terminal.commandHistoryIndex = len;\n saveValue(\"\");\n } else {\n ++Terminal.commandHistoryIndex;\n const prevCommand = Terminal.commandHistory[Terminal.commandHistoryIndex];\n saveValue(prevCommand);\n }\n }\n\n // Extra Bash Emulation Hotkeys, must be enabled through options\n if (Settings.EnableBashHotkeys) {\n if (event.code === KEYCODE.C && event.ctrlKey && ref && ref.selectionStart === ref.selectionEnd) {\n event.preventDefault();\n Terminal.print(`[${Player.getCurrentServer().hostname} ~${Terminal.cwd()}]> ${value}`);\n modifyInput(\"clearall\");\n }\n\n if (event.code === KEYCODE.A && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"home\");\n }\n\n if (event.code === KEYCODE.E && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"end\");\n }\n\n if (event.code === KEYCODE.B && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"prevchar\");\n }\n\n if (event.code === KEYCODE.B && event.altKey) {\n event.preventDefault();\n moveTextCursor(\"prevword\");\n }\n\n if (event.code === KEYCODE.F && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"nextchar\");\n }\n\n if (event.code === KEYCODE.F && event.altKey) {\n event.preventDefault();\n moveTextCursor(\"nextword\");\n }\n\n if ((event.code === KEYCODE.H || event.code === KEYCODE.D) && event.ctrlKey) {\n modifyInput(\"backspace\");\n event.preventDefault();\n }\n\n if (event.code === KEYCODE.W && event.ctrlKey) {\n event.preventDefault();\n modifyInput(\"deletewordbefore\");\n }\n\n if (event.code === KEYCODE.D && event.altKey) {\n event.preventDefault();\n modifyInput(\"deletewordafter\");\n }\n\n if (event.code === KEYCODE.U && event.ctrlKey) {\n event.preventDefault();\n modifyInput(\"clearbefore\");\n }\n\n if (event.code === KEYCODE.K && event.ctrlKey) {\n event.preventDefault();\n modifyInput(\"clearafter\");\n }\n }\n }\n\n return (\n <>\n <TextField\n fullWidth\n color={Terminal.action === null ? \"primary\" : \"secondary\"}\n autoFocus\n disabled={Terminal.action !== null}\n autoComplete=\"off\"\n value={value}\n classes={{ root: classes.textfield }}\n onChange={handleValueChange}\n inputRef={terminalInput}\n InputProps={{\n // for players to hook in\n id: \"terminal-input\",\n className: classes.input,\n startAdornment: (\n <Typography color={Terminal.action === null ? \"primary\" : \"secondary\"} flexShrink={0}>\n [{Player.getCurrentServer().hostname} ~{Terminal.cwd()}]> \n </Typography>\n ),\n spellCheck: false,\n onBlur: () => setPossibilities([]),\n onKeyDown: onKeyDown,\n }}\n ></TextField>\n <Popper open={possibilities.length > 0} anchorEl={terminalInput.current} placement={\"top-start\"}>\n <Paper sx={{ m: 1, p: 2 }}>\n <Typography classes={{ root: classes.preformatted }} color={\"primary\"} paragraph={false}>\n Possible autocomplete candidates:\n </Typography>\n <Typography classes={{ root: classes.preformatted }} color={\"primary\"} paragraph={false}>\n {possibilities.join(\" \")}\n </Typography>\n </Paper>\n </Popper>\n </>\n );\n}\n","import { evaluateDirectoryPath, getAllParentDirectories } from \"./DirectoryHelpers\";\nimport { getSubdirectories } from \"./DirectoryServerHelpers\";\n\nimport { Aliases, GlobalAliases, substituteAliases } from \"../Alias\";\nimport { DarkWebItems } from \"../DarkWeb/DarkWebItems\";\nimport { Player } from \"@player\";\nimport { GetAllServers } from \"../Server/AllServers\";\nimport { Server } from \"../Server/Server\";\nimport { ParseCommand, ParseCommands } from \"./Parser\";\nimport { HelpTexts } from \"./HelpText\";\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\nimport { compile } from \"../NetscriptJSEvaluator\";\nimport { Flags } from \"../NetscriptFunctions/Flags\";\nimport { AutocompleteData } from \"../ScriptEditor/NetscriptDefinitions\";\nimport * as libarg from \"arg\";\n\n// An array of all Terminal commands\nconst commands = [\n \"alias\",\n \"analyze\",\n \"backdoor\",\n \"cat\",\n \"cd\",\n \"check\",\n \"clear\",\n \"cls\",\n \"connect\",\n \"cp\",\n \"download\",\n \"expr\",\n \"free\",\n \"grow\",\n \"hack\",\n \"help\",\n \"home\",\n \"hostname\",\n \"ifconfig\",\n \"kill\",\n \"killall\",\n \"ls\",\n \"lscpu\",\n \"mem\",\n \"mv\",\n \"nano\",\n \"ps\",\n \"rm\",\n \"run\",\n \"scan-analyze\",\n \"scan\",\n \"scp\",\n \"sudov\",\n \"tail\",\n \"theme\",\n \"top\",\n \"vim\",\n \"weaken\",\n];\n\nexport async function determineAllPossibilitiesForTabCompletion(\n input: string,\n index: number,\n currPath = \"\",\n): Promise<string[]> {\n input = substituteAliases(input);\n let allPos: string[] = [];\n allPos = allPos.concat(Object.keys(GlobalAliases));\n const currServ = Player.getCurrentServer();\n const homeComputer = Player.getHomeComputer();\n\n let parentDirPath = \"\";\n let evaledParentDirPath: string | null = null;\n // Helper functions\n function addAllCodingContracts(): void {\n for (const cct of currServ.contracts) {\n allPos.push(cct.fn);\n }\n }\n\n function addAllLitFiles(): void {\n for (const file of currServ.messages) {\n if (!file.endsWith(\".msg\")) {\n allPos.push(file);\n }\n }\n }\n\n function addAllMessages(): void {\n for (const file of currServ.messages) {\n if (file.endsWith(\".msg\")) {\n allPos.push(file);\n }\n }\n }\n\n function addAllPrograms(): void {\n for (const program of homeComputer.programs) {\n allPos.push(program);\n }\n }\n\n function addAllScripts(): void {\n for (const script of currServ.scripts) {\n const res = processFilepath(script.filename);\n if (res) {\n allPos.push(res);\n }\n }\n }\n\n function addAllTextFiles(): void {\n for (const txt of currServ.textFiles) {\n const res = processFilepath(txt.fn);\n if (res) {\n allPos.push(res);\n }\n }\n }\n\n function addAllDirectories(): void {\n // Directories are based on the currently evaluated path\n const subdirs = getSubdirectories(currServ, evaledParentDirPath == null ? \"/\" : evaledParentDirPath);\n\n for (let i = 0; i < subdirs.length; ++i) {\n const assembledDirPath = evaledParentDirPath == null ? subdirs[i] : evaledParentDirPath + subdirs[i];\n const res = processFilepath(assembledDirPath);\n if (res != null) {\n subdirs[i] = res;\n }\n }\n\n allPos = allPos.concat(subdirs);\n }\n\n // Convert from the real absolute path back to the original path used in the input\n function convertParentPath(filepath: string): string {\n if (parentDirPath == null || evaledParentDirPath == null) {\n console.warn(`convertParentPath() called when paths are null`);\n return filepath;\n }\n\n if (!filepath.startsWith(evaledParentDirPath)) {\n console.warn(\n `convertParentPath() called for invalid path. (filepath=${filepath}) (evaledParentDirPath=${evaledParentDirPath})`,\n );\n return filepath;\n }\n\n return parentDirPath + filepath.slice(evaledParentDirPath.length);\n }\n\n // Given an a full, absolute filepath, converts it to the proper value\n // for autocompletion purposes\n function processFilepath(filepath: string): string | null {\n if (evaledParentDirPath) {\n if (filepath.startsWith(evaledParentDirPath)) {\n return convertParentPath(filepath);\n }\n } else if (parentDirPath !== \"\") {\n // If the parent directory is the root directory, but we're not searching\n // it from the root directory, we have to add the original path\n let t_parentDirPath = parentDirPath;\n if (!t_parentDirPath.endsWith(\"/\")) {\n t_parentDirPath += \"/\";\n }\n return parentDirPath + filepath;\n } else {\n return filepath;\n }\n\n return null;\n }\n\n function isCommand(cmd: string): boolean {\n let t_cmd = cmd;\n if (!t_cmd.endsWith(\" \")) {\n t_cmd += \" \";\n }\n\n return input.startsWith(t_cmd);\n }\n\n // Autocomplete the command\n if (index === -1 && !input.startsWith(\"./\")) {\n return commands.concat(Object.keys(Aliases)).concat(Object.keys(GlobalAliases));\n }\n\n // Since we're autocompleting an argument and not a command, the argument might\n // be a file/directory path. We have to account for that when autocompleting\n const commandArray = input.split(\" \");\n if (commandArray.length === 0) {\n console.warn(`Tab autocompletion logic reached invalid branch`);\n return allPos;\n }\n const arg = commandArray[commandArray.length - 1];\n parentDirPath = getAllParentDirectories(arg);\n evaledParentDirPath = evaluateDirectoryPath(parentDirPath, currPath);\n if (evaledParentDirPath === \"/\") {\n evaledParentDirPath = null;\n } else if (evaledParentDirPath == null) {\n // do nothing for some reason tests don't like this?\n // return allPos; // Invalid path\n } else {\n evaledParentDirPath += \"/\";\n }\n\n if (isCommand(\"buy\")) {\n const options = [];\n for (const i of Object.keys(DarkWebItems)) {\n const item = DarkWebItems[i];\n options.push(item.program);\n }\n\n return options.concat(Object.keys(GlobalAliases));\n }\n\n if (isCommand(\"scp\") && index === 1) {\n for (const server of GetAllServers()) {\n allPos.push(server.hostname);\n }\n\n return allPos;\n }\n\n if (isCommand(\"scp\") && index === 0) {\n addAllScripts();\n addAllLitFiles();\n addAllTextFiles();\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"cp\") && index === 0) {\n addAllScripts();\n addAllTextFiles();\n addAllDirectories();\n return allPos;\n }\n\n if (isCommand(\"connect\")) {\n // All directly connected and backdoored servers are reachable\n return GetAllServers()\n .filter(\n (server) =>\n currServ.serversOnNetwork.includes(server.hostname) || (server instanceof Server && server.backdoorInstalled),\n )\n .map((server) => server.hostname);\n }\n\n if (isCommand(\"nano\") || isCommand(\"vim\")) {\n addAllScripts();\n addAllTextFiles();\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"rm\")) {\n addAllScripts();\n addAllPrograms();\n addAllLitFiles();\n addAllTextFiles();\n addAllCodingContracts();\n addAllDirectories();\n\n return allPos;\n }\n\n async function scriptAutocomplete(): Promise<string[] | undefined> {\n if (!isCommand(\"run\") && !isCommand(\"tail\") && !isCommand(\"kill\") && !input.startsWith(\"./\")) return;\n let copy = input;\n if (input.startsWith(\"./\")) copy = \"run \" + input.slice(2);\n const commands = ParseCommands(copy);\n if (commands.length === 0) return;\n const command = ParseCommand(commands[commands.length - 1]);\n const filename = command[1] + \"\";\n if (!isScriptFilename(filename)) return; // Not a script.\n if (filename.endsWith(\".script\")) return; // Doesn't work with ns1.\n // Use regex to remove any leading './', and then check if it matches against\n // the output of processFilepath or if it matches with a '/' prepended,\n // this way autocomplete works inside of directories\n const script = currServ.scripts.find((script) => {\n const fn = filename.replace(/^\\.\\//g, \"\");\n return processFilepath(script.filename) === fn || script.filename === \"/\" + fn;\n });\n if (!script) return; // Doesn't exist.\n let loadedModule;\n try {\n //Will return the already compiled module if recompilation not needed.\n loadedModule = await compile(script, currServ.scripts);\n } catch (e) {\n //fail silently if the script fails to compile (e.g. syntax error)\n return;\n }\n if (!loadedModule || !loadedModule.autocomplete) return; // Doesn't have an autocomplete function.\n\n const runArgs = { \"--tail\": Boolean, \"-t\": Number };\n const flags = libarg(runArgs, {\n permissive: true,\n argv: command.slice(2),\n });\n const flagFunc = Flags(flags._);\n const autocompleteData: AutocompleteData = {\n servers: GetAllServers().map((server) => server.hostname),\n scripts: currServ.scripts.map((script) => script.filename),\n txts: currServ.textFiles.map((txt) => txt.fn),\n flags: (schema: unknown) => {\n if (!Array.isArray(schema)) throw new Error(\"flags require an array of array\");\n pos2 = schema.map((f: unknown) => {\n if (!Array.isArray(f)) throw new Error(\"flags require an array of array\");\n if (f[0].length === 1) return \"-\" + f[0];\n return \"--\" + f[0];\n });\n try {\n return flagFunc(schema);\n } catch (err) {\n return {};\n }\n },\n };\n let pos: string[] = [];\n let pos2: string[] = [];\n const options = loadedModule.autocomplete(autocompleteData, flags._);\n if (!Array.isArray(options)) throw new Error(\"autocomplete did not return list of strings\");\n pos = pos.concat(options.map((x) => String(x)));\n return pos.concat(pos2);\n }\n const pos = await scriptAutocomplete();\n if (pos) return pos;\n\n // If input starts with './', essentially treat it as a slimmer\n // invocation of `run`.\n if (input.startsWith(\"./\")) {\n // All programs and scripts\n for (const script of currServ.scripts) {\n const res = processFilepath(script.filename);\n if (res) {\n allPos.push(res);\n }\n }\n\n for (const program of currServ.programs) {\n const res = processFilepath(program);\n if (res) {\n allPos.push(res);\n }\n }\n\n // All coding contracts\n for (const cct of currServ.contracts) {\n const res = processFilepath(cct.fn);\n if (res) {\n allPos.push(res);\n }\n }\n\n return allPos;\n }\n\n if (isCommand(\"run\")) {\n addAllScripts();\n addAllPrograms();\n addAllCodingContracts();\n addAllDirectories();\n }\n\n if (isCommand(\"kill\") || isCommand(\"tail\") || isCommand(\"mem\") || isCommand(\"check\")) {\n addAllScripts();\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"cat\")) {\n addAllMessages();\n addAllLitFiles();\n addAllTextFiles();\n addAllDirectories();\n addAllScripts();\n\n return allPos;\n }\n\n if (isCommand(\"download\") || isCommand(\"mv\")) {\n addAllScripts();\n addAllTextFiles();\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"cd\")) {\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"ls\") && index === 0) {\n addAllDirectories();\n }\n\n if (isCommand(\"help\")) {\n // Get names from here instead of commands array because some\n // undocumented/nonexistent commands are in the array\n return Object.keys(HelpTexts);\n }\n\n return allPos;\n}\n","import { containsAllStrings, longestCommonStart } from \"../utils/StringHelperFunctions\";\n\n/**\n * Implements tab completion for the Terminal\n *\n * @param command {string} Terminal command, excluding the last incomplete argument\n * @param arg {string} Last argument that is being completed\n * @param allPossibilities {string[]} All values that `arg` can complete to\n */\nexport function tabCompletion(\n command: string,\n arg: string,\n allPossibilities: string[],\n oldValue: string,\n): string[] | string | undefined {\n if (!(allPossibilities.constructor === Array)) {\n return;\n }\n if (!containsAllStrings(allPossibilities)) {\n return;\n }\n\n // Remove all options in allPossibilities that do not match the current string\n // that we are attempting to autocomplete\n if (arg === \"\") {\n for (let i = allPossibilities.length - 1; i >= 0; --i) {\n if (!allPossibilities[i].toLowerCase().startsWith(command.toLowerCase())) {\n allPossibilities.splice(i, 1);\n }\n }\n } else {\n for (let i = allPossibilities.length - 1; i >= 0; --i) {\n if (!allPossibilities[i].toLowerCase().startsWith(arg.toLowerCase())) {\n allPossibilities.splice(i, 1);\n }\n }\n }\n\n const semiColonIndex = oldValue.lastIndexOf(\";\");\n\n let val = \"\";\n if (allPossibilities.length === 0) {\n return;\n } else if (allPossibilities.length === 1) {\n if (arg === \"\") {\n //Autocomplete command\n val = allPossibilities[0];\n } else {\n val = command + \" \" + allPossibilities[0];\n }\n\n if (semiColonIndex === -1) {\n // No semicolon, so replace the whole command\n return val;\n } else {\n // Replace only after the last semicolon\n return oldValue.slice(0, semiColonIndex + 1) + \" \" + val;\n }\n } else {\n const longestStartSubstr = longestCommonStart(allPossibilities);\n /**\n * If the longest common starting substring of remaining possibilities is the same\n * as whatever's already in terminal, just list all possible options. Otherwise,\n * change the input in the terminal to the longest common starting substr\n */\n if (arg === \"\") {\n if (longestStartSubstr === command) {\n return allPossibilities;\n } else if (semiColonIndex === -1) {\n // No semicolon, so replace the whole command\n return longestStartSubstr;\n } else {\n // Replace only after the last semicolon\n return `${oldValue.slice(0, semiColonIndex + 1)} ${longestStartSubstr}`;\n }\n } else if (longestStartSubstr === arg) {\n // List all possible options\n return allPossibilities;\n } else if (semiColonIndex == -1) {\n // No semicolon, so replace the whole command\n return `${command} ${longestStartSubstr}`;\n } else {\n // Replace only after the last semicolon\n return `${oldValue.slice(0, semiColonIndex + 1)} ${command} ${longestStartSubstr}`;\n }\n }\n}\n","import React, { useState } from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Link from \"@mui/material/Link\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\n\ninterface IProps {\n reactivateTutorial: () => void;\n}\n\nexport function TutorialRoot(props: IProps): React.ReactElement {\n const [confirmResetOpen, setConfirmResetOpen] = useState(false);\n return (\n <>\n <Typography variant=\"h4\">Tutorial / Documentation</Typography>\n <Box m={2}>\n <Button onClick={() => setConfirmResetOpen(true)}>Soft reset and Restart tutorial</Button>\n <ConfirmationModal\n open={confirmResetOpen}\n onClose={() => setConfirmResetOpen(false)}\n onConfirm={props.reactivateTutorial}\n confirmationText={\"This will reset all your stats to 1 and money to 1k. Are you sure?\"}\n />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/guidesandtips/gettingstartedguideforbeginnerprogrammers.html\"\n >\n <Typography>Getting Started</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/servers.html\"\n >\n <Typography>Servers & Networking</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/hacking.html\"\n >\n <Typography>Hacking</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/scripts.html\"\n >\n <Typography>Scripts</Typography>\n </Link>\n <br />\n <Link color=\"primary\" target=\"_blank\" href=\"https://bitburner.readthedocs.io/en/latest/netscript.html\">\n <Typography>Netscript Programming Language</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/world.html\"\n >\n <Typography>Traveling</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/companies.html\"\n >\n <Typography>Companies</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/infiltration.html\"\n >\n <Typography>Infiltration</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/factions.html\"\n >\n <Typography>Factions</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/augmentations.html\"\n >\n <Typography>Augmentations</Typography>\n </Link>\n <br />\n <Link color=\"primary\" target=\"_blank\" href=\"https://bitburner.readthedocs.io/en/latest/shortcuts.html\">\n <Typography>Keyboard Shortcuts</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/netscript/netscriptlearntoprogram.html#netscript-1-0-vs-netscript-2-0\"\n >\n <Typography>NS1 vs NS2 (or .script vs .js)</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/netscript/netscriptfunctions.html\"\n >\n <Typography>Simplified list of functions</Typography>\n </Link>\n\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://github.com/danielyxie/bitburner/blob/dev/markdown/bitburner.ns.md\"\n >\n <Typography>Complete list of functions</Typography>\n </Link>\n </Box>\n </>\n );\n}\n","/**\n * Root React Component for the \"Active Scripts\" UI page. This page displays\n * and provides information about all of the player's scripts that are currently running\n */\nimport React, { useState, useEffect } from \"react\";\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nimport { ActiveScriptsPage } from \"./ActiveScriptsPage\";\nimport { RecentScriptsPage } from \"./RecentScriptsPage\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\ninterface IProps {\n workerScripts: Map<number, WorkerScript>;\n}\n\nexport function ActiveScriptsRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const [tab, setTab] = useState<\"active\" | \"recent\">(\"active\");\n function handleChange(event: React.SyntheticEvent, tab: \"active\" | \"recent\"): void {\n setTab(tab);\n }\n return (\n <>\n <Tabs variant=\"fullWidth\" value={tab} onChange={handleChange} sx={{ minWidth: \"fit-content\", maxWidth: \"25%\" }}>\n <Tab label={\"Active\"} value={\"active\"} />\n <Tab label={\"Recently Killed\"} value={\"recent\"} />\n </Tabs>\n\n {tab === \"active\" && <ActiveScriptsPage workerScripts={props.workerScripts} />}\n {tab === \"recent\" && <RecentScriptsPage />}\n </>\n );\n}\n","/**\n * Root React Component for the \"Active Scripts\" UI page. This page displays\n * and provides information about all of the player's scripts that are currently running\n */\nimport React from \"react\";\n\nimport { ScriptProduction } from \"./ScriptProduction\";\nimport { ServerAccordions } from \"./ServerAccordions\";\n\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n workerScripts: Map<number, WorkerScript>;\n}\n\nexport function ActiveScriptsPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n This page displays a list of all of your scripts that are currently running across every machine. It also\n provides information about each script's production. The scripts are categorized by the hostname of the servers\n on which they are running.\n </Typography>\n\n <ScriptProduction />\n <ServerAccordions {...props} />\n </>\n );\n}\n","/**\n * React Component for displaying the total production and production rate\n * of scripts on the 'Active Scripts' UI page\n */\nimport * as React from \"react\";\n\nimport { Money } from \"../React/Money\";\nimport { MoneyRate } from \"../React/MoneyRate\";\nimport { Player } from \"@player\";\n\nimport Typography from \"@mui/material/Typography\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n cell: {\n borderBottom: \"none\",\n padding: theme.spacing(1),\n margin: theme.spacing(1),\n whiteSpace: \"nowrap\",\n },\n size: {\n width: \"1px\",\n },\n }),\n);\nexport function ScriptProduction(): React.ReactElement {\n const classes = useStyles();\n const prodRateSinceLastAug = Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug / 1000);\n\n return (\n <Table size=\"small\" classes={{ root: classes.size }}>\n <TableBody>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography variant=\"body2\">Total production since last Augment Installation:</Typography>\n </TableCell>\n <TableCell align=\"left\" classes={{ root: classes.cell }}>\n <Typography variant=\"body2\">\n <Money money={Player.scriptProdSinceLastAug} />\n </Typography>\n </TableCell>\n <TableCell align=\"left\" classes={{ root: classes.cell }}>\n <Typography variant=\"body2\">\n (<MoneyRate money={prodRateSinceLastAug} />)\n </Typography>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n );\n}\n","/**\n * React Component for rendering the Accordion elements for all servers\n * on which scripts are running\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { ServerAccordion } from \"./ServerAccordion\";\n\nimport TextField from \"@mui/material/TextField\";\nimport List from \"@mui/material/List\";\nimport TablePagination from \"@mui/material/TablePagination\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { WorkerScriptStartStopEventEmitter } from \"../../Netscript/WorkerScriptStartStopEventEmitter\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { TablePaginationActionsAll } from \"../React/TablePaginationActionsAll\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\n// Map of server hostname -> all workerscripts on that server for all active scripts\ninterface IServerData {\n server: BaseServer;\n workerScripts: WorkerScript[];\n}\n\ninterface IServerToScriptsMap {\n [key: string]: IServerData | undefined;\n}\n\ntype IProps = {\n workerScripts: Map<number, WorkerScript>;\n};\n\nexport function ServerAccordions(props: IProps): React.ReactElement {\n const [filter, setFilter] = useState(\"\");\n const [page, setPage] = useState(0);\n const [rowsPerPage, setRowsPerPage] = useState(Settings.ActiveScriptsServerPageSize);\n const setRerender = useState(false)[1];\n\n const handleChangePage = (event: unknown, newPage: number): void => {\n setPage(newPage);\n };\n\n const handleChangeRowsPerPage = (event: React.ChangeEvent<HTMLInputElement>): void => {\n Settings.ActiveScriptsServerPageSize = parseInt(event.target.value, 10);\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n };\n\n function handleFilterChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setFilter(event.target.value);\n setPage(0);\n }\n\n const serverToScriptMap: IServerToScriptsMap = {};\n for (const ws of props.workerScripts.values()) {\n const server = GetServer(ws.hostname);\n if (server == null) {\n console.warn(`WorkerScript has invalid hostname: ${ws.hostname}`);\n continue;\n }\n\n let data = serverToScriptMap[server.hostname];\n\n if (data === undefined) {\n serverToScriptMap[server.hostname] = {\n server: server,\n workerScripts: [],\n };\n data = serverToScriptMap[server.hostname];\n }\n if (data !== undefined) data.workerScripts.push(ws);\n }\n\n const filtered = Object.values(serverToScriptMap).filter(\n (data) =>\n data &&\n (data.server.hostname.includes(filter) || data.server.runningScripts.find((s) => s.filename.includes(filter))),\n );\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => WorkerScriptStartStopEventEmitter.subscribe(rerender));\n\n return (\n <>\n <TextField\n value={filter}\n onChange={handleFilterChange}\n autoFocus\n InputProps={{\n startAdornment: <SearchIcon />,\n spellCheck: false,\n }}\n />\n <List dense={true}>\n {filtered.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((data) => {\n return (\n data && (\n <ServerAccordion key={data.server.hostname} server={data.server} workerScripts={data.workerScripts} />\n )\n );\n })}\n </List>\n <TablePagination\n rowsPerPageOptions={[10, 15, 20, 100]}\n component=\"div\"\n count={filtered.length}\n rowsPerPage={rowsPerPage}\n page={page}\n onPageChange={handleChangePage}\n onRowsPerPageChange={handleChangeRowsPerPage}\n ActionsComponent={TablePaginationActionsAll}\n />\n </>\n );\n}\n","/**\n * React Component for rendering the Accordion element for a single\n * server in the 'Active Scripts' UI page\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\n\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport { ServerAccordionContent } from \"./ServerAccordionContent\";\n\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\n\ntype IProps = {\n server: BaseServer;\n workerScripts: WorkerScript[];\n};\n\nexport function ServerAccordion(props: IProps): React.ReactElement {\n const [open, setOpen] = React.useState(false);\n const server = props.server;\n\n // Accordion's header text\n // TODO: calculate the longest hostname length rather than hard coding it\n const longestHostnameLength = 18;\n const paddedName = `${server.hostname}${\" \".repeat(longestHostnameLength)}`.slice(\n 0,\n Math.max(server.hostname.length, longestHostnameLength),\n );\n const barOptions = {\n progress: server.ramUsed / server.maxRam,\n totalTicks: 30,\n };\n const headerTxt = `${paddedName} ${createProgressBarText(barOptions)}`;\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText primary={<Typography style={{ whiteSpace: \"pre-wrap\" }}>{headerTxt}</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Box mx={2}>\n <Collapse in={open} timeout={0} unmountOnExit>\n <ServerAccordionContent workerScripts={props.workerScripts} />\n </Collapse>\n </Box>\n </Box>\n );\n}\n","import React, { useState } from \"react\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { WorkerScriptAccordion } from \"./WorkerScriptAccordion\";\nimport List from \"@mui/material/List\";\nimport TablePagination from \"@mui/material/TablePagination\";\nimport { TablePaginationActionsAll } from \"../React/TablePaginationActionsAll\";\nimport { Settings } from \"../../Settings/Settings\";\n\ninterface IProps {\n workerScripts: WorkerScript[];\n}\n\nexport function ServerAccordionContent(props: IProps): React.ReactElement {\n const [page, setPage] = useState(0);\n const [rowsPerPage, setRowsPerPage] = useState(Settings.ActiveScriptsScriptPageSize);\n const handleChangePage = (event: unknown, newPage: number): void => {\n setPage(newPage);\n };\n\n const handleChangeRowsPerPage = (event: React.ChangeEvent<HTMLInputElement>): void => {\n Settings.ActiveScriptsScriptPageSize = parseInt(event.target.value, 10);\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n };\n\n return (\n <>\n <List dense disablePadding>\n {props.workerScripts.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((ws) => (\n <WorkerScriptAccordion key={`${ws.name}_${ws.args}`} workerScript={ws} />\n ))}\n </List>\n <TablePagination\n rowsPerPageOptions={[10, 15, 20, 100]}\n component=\"div\"\n count={props.workerScripts.length}\n rowsPerPage={rowsPerPage}\n page={page}\n onPageChange={handleChangePage}\n onRowsPerPageChange={handleChangeRowsPerPage}\n ActionsComponent={TablePaginationActionsAll}\n />\n </>\n );\n}\n","/**\n * React Component for displaying a single WorkerScript's info as an\n * Accordion element\n */\nimport * as React from \"react\";\n\nimport { numeralWrapper } from \"../numeralFormat\";\n\nimport Table from \"@mui/material/Table\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport makeStyles from \"@mui/styles/makeStyles\";\n\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\n\nimport { killWorkerScript } from \"../../Netscript/killWorkerScript\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\nimport { dialogBoxCreate } from \"../React/DialogBox\";\nimport { LogBoxEvents } from \"../React/LogBoxManager\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { arrayToString } from \"../../utils/helpers/arrayToString\";\nimport { Money } from \"../React/Money\";\nimport { MoneyRate } from \"../React/MoneyRate\";\n\nconst useStyles = makeStyles({\n noborder: {\n borderBottom: \"none\",\n },\n});\n\ntype IProps = {\n workerScript: WorkerScript;\n};\n\nexport function WorkerScriptAccordion(props: IProps): React.ReactElement {\n const classes = useStyles();\n const [open, setOpen] = React.useState(false);\n const workerScript = props.workerScript;\n const scriptRef = workerScript.scriptRef;\n\n function logClickHandler(): void {\n LogBoxEvents.emit(scriptRef);\n }\n const killScript = killWorkerScript.bind(null, { runningScript: scriptRef, hostname: scriptRef.server });\n\n function killScriptClickHandler(): void {\n if (killScript()) dialogBoxCreate(\"Killing script\");\n }\n\n // Calculations for script stats\n const onlineMps = scriptRef.onlineMoneyMade / scriptRef.onlineRunningTime;\n const onlineEps = scriptRef.onlineExpGained / scriptRef.onlineRunningTime;\n\n return (\n <>\n <ListItemButton onClick={() => setOpen((old) => !old)} component={Paper}>\n <ListItemText\n primary={\n <Typography>\n └ {props.workerScript.name} {JSON.stringify(props.workerScript.args)}\n </Typography>\n }\n />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} timeout={0} unmountOnExit>\n <Box mx={6}>\n <Table padding=\"none\" size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Threads:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{numeralWrapper.formatThreads(props.workerScript.scriptRef.threads)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={2}>\n <Typography>└ Args: {arrayToString(props.workerScript.args)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Online Time:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{convertTimeMsToTimeElapsedString(scriptRef.onlineRunningTime * 1e3)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Offline Time:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{convertTimeMsToTimeElapsedString(scriptRef.offlineRunningTime * 1e3)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Total online production:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <Money money={scriptRef.onlineMoneyMade} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(scriptRef.onlineExpGained) + \" hacking exp\"}</Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Online production rate:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <MoneyRate money={onlineMps} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(onlineEps) + \" hacking exp / sec\"}</Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Total offline production:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <Money money={scriptRef.offlineMoneyMade} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(scriptRef.offlineExpGained) + \" hacking exp\"}</Typography>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n\n <Button onClick={logClickHandler}>LOG</Button>\n <IconButton onClick={killScriptClickHandler}>\n <DeleteIcon color=\"error\" />\n </IconButton>\n </Box>\n </Collapse>\n </>\n );\n}\n","/**\n * Root React Component for the \"Active Scripts\" UI page. This page displays\n * and provides information about all of the player's scripts that are currently running\n */\nimport React from \"react\";\nimport Typography from \"@mui/material/Typography\";\n\nimport { recentScripts } from \"../../Netscript/RecentScripts\";\nimport { RecentScriptAccordion } from \"./RecentScriptAccordion\";\n\nexport function RecentScriptsPage(): React.ReactElement {\n return (\n <>\n <Typography>List of all recently killed scripts.</Typography>\n {recentScripts.map((r) => (\n <RecentScriptAccordion key={r.runningScript.pid} recentScript={r} />\n ))}\n </>\n );\n}\n","/**\n * React Component for displaying a single WorkerScript's info as an\n * Accordion element\n */\nimport * as React from \"react\";\n\nimport { numeralWrapper } from \"../numeralFormat\";\n\nimport Table from \"@mui/material/Table\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport makeStyles from \"@mui/styles/makeStyles\";\n\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\n\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { arrayToString } from \"../../utils/helpers/arrayToString\";\nimport { Money } from \"../React/Money\";\nimport { MoneyRate } from \"../React/MoneyRate\";\nimport { RecentScript } from \"../../Netscript/RecentScripts\";\nimport { LogBoxEvents } from \"../React/LogBoxManager\";\n\nconst useStyles = makeStyles({\n noborder: {\n borderBottom: \"none\",\n },\n});\n\ninterface IProps {\n recentScript: RecentScript;\n}\n\nexport function RecentScriptAccordion(props: IProps): React.ReactElement {\n const classes = useStyles();\n const [open, setOpen] = React.useState(false);\n const recentScript = props.recentScript;\n\n // Calculations for script stats\n const onlineMps = recentScript.runningScript.onlineMoneyMade / recentScript.runningScript.onlineRunningTime;\n const onlineEps = recentScript.runningScript.onlineExpGained / recentScript.runningScript.onlineRunningTime;\n\n function logClickHandler(): void {\n LogBoxEvents.emit(recentScript.runningScript);\n }\n return (\n <>\n <ListItemButton onClick={() => setOpen((old) => !old)} component={Paper}>\n <ListItemText\n primary={\n <Typography>\n └ {recentScript.runningScript.filename} (died{\" \"}\n {convertTimeMsToTimeElapsedString(new Date().getTime() - recentScript.timeOfDeath.getTime())} ago)\n </Typography>\n }\n />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} timeout={0} unmountOnExit>\n <Box mx={6}>\n <Table padding=\"none\" size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Threads:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{numeralWrapper.formatThreads(recentScript.runningScript.threads)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={2}>\n <Typography>└ Args: {arrayToString(recentScript.runningScript.args)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Online Time:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>\n {convertTimeMsToTimeElapsedString(recentScript.runningScript.onlineRunningTime * 1e3)}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Offline Time:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>\n {convertTimeMsToTimeElapsedString(recentScript.runningScript.offlineRunningTime * 1e3)}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Total online production:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <Money money={recentScript.runningScript.onlineMoneyMade} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n {numeralWrapper.formatExp(recentScript.runningScript.onlineExpGained) + \" hacking exp\"}\n </Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Online production rate:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <MoneyRate money={onlineMps} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(onlineEps) + \" hacking exp / sec\"}</Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Total offline production:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <Money money={recentScript.runningScript.offlineMoneyMade} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n {numeralWrapper.formatExp(recentScript.runningScript.offlineExpGained) + \" hacking exp\"}\n </Typography>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n <Button onClick={logClickHandler}>LOG</Button>\n </Box>\n </Collapse>\n </>\n );\n}\n","/**\n * Root React Component for displaying a Faction's UI.\n * This is the component for displaying a single faction's UI, not the list of all\n * accessible factions\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { AugmentationsPage } from \"./AugmentationsPage\";\nimport { DonateOption } from \"./DonateOption\";\nimport { Info } from \"./Info\";\nimport { Option } from \"./Option\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Faction } from \"../Faction\";\n\nimport { Router } from \"../../ui/GameRoot\";\nimport { Player } from \"@player\";\n\nimport { Typography, Button } from \"@mui/material\";\nimport { CovenantPurchasesRoot } from \"../../PersonObjects/Sleeve/ui/CovenantPurchasesRoot\";\nimport { FactionNames } from \"../data/FactionNames\";\nimport { GangButton } from \"./GangButton\";\nimport { FactionWork } from \"../../Work/FactionWork\";\nimport { FactionWorkType } from \"../../Work/data/FactionWorkType\";\n\ntype IProps = {\n faction: Faction;\n augPage: boolean;\n};\n\n// Info text for all options on the UI\nconst hackingContractsInfo =\n \"Complete hacking contracts for your faction. \" +\n \"Your effectiveness, which determines how much \" +\n \"reputation you gain for this faction, is based on your hacking skill. \" +\n \"You will gain hacking exp.\";\nconst fieldWorkInfo =\n \"Carry out field missions for your faction. \" +\n \"Your effectiveness, which determines how much \" +\n \"reputation you gain for this faction, is based on all of your stats. \" +\n \"You will gain exp for all stats.\";\nconst securityWorkInfo =\n \"Serve in a security detail for your faction. \" +\n \"Your effectiveness, which determines how much \" +\n \"reputation you gain for this faction, is based on your combat stats. \" +\n \"You will gain exp for all combat stats.\";\nconst augmentationsInfo =\n \"As your reputation with this faction rises, you will \" +\n \"unlock Augmentations, which you can purchase to enhance \" +\n \"your abilities.\";\nconst sleevePurchasesInfo = \"Purchase Duplicate Sleeves and upgrades. These are permanent!\";\n\ninterface IMainProps {\n faction: Faction;\n rerender: () => void;\n onAugmentations: () => void;\n}\n\nfunction MainPage({ faction, rerender, onAugmentations }: IMainProps): React.ReactElement {\n const [sleevesOpen, setSleevesOpen] = useState(false);\n const factionInfo = faction.getInfo();\n\n function startWork(): void {\n Player.startFocusing();\n Router.toWork();\n }\n\n function startFieldWork(faction: Faction): void {\n Player.startWork(\n new FactionWork({\n singularity: false,\n faction: faction.name,\n factionWorkType: FactionWorkType.FIELD,\n }),\n );\n startWork();\n }\n\n function startHackingContracts(faction: Faction): void {\n Player.startWork(\n new FactionWork({\n singularity: false,\n faction: faction.name,\n factionWorkType: FactionWorkType.HACKING,\n }),\n );\n startWork();\n }\n\n function startSecurityWork(faction: Faction): void {\n Player.startWork(\n new FactionWork({\n singularity: false,\n faction: faction.name,\n factionWorkType: FactionWorkType.SECURITY,\n }),\n );\n startWork();\n }\n\n // We have a special flag for whether the player this faction is the player's\n // gang faction because if the player has a gang, they cannot do any other action\n const isPlayersGang = Player.gang && Player.getGangName() === faction.name;\n\n // Flags for whether special options (gang, sleeve purchases, donate, etc.)\n // should be shown\n const favorToDonate = Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n const canDonate = faction.favor >= favorToDonate;\n\n const canPurchaseSleeves = faction.name === FactionNames.TheCovenant && Player.bitNodeN === 10;\n\n return (\n <>\n <Button onClick={() => Router.toFactions()}>Back</Button>\n <Typography variant=\"h4\" color=\"primary\">\n {faction.name}\n </Typography>\n <Info faction={faction} factionInfo={factionInfo} />\n <GangButton faction={faction} />\n {!isPlayersGang && factionInfo.offerHackingWork && (\n <Option\n buttonText={\"Hacking Contracts\"}\n infoText={hackingContractsInfo}\n onClick={() => startHackingContracts(faction)}\n />\n )}\n {!isPlayersGang && factionInfo.offerFieldWork && (\n <Option buttonText={\"Field Work\"} infoText={fieldWorkInfo} onClick={() => startFieldWork(faction)} />\n )}\n {!isPlayersGang && factionInfo.offerSecurityWork && (\n <Option buttonText={\"Security Work\"} infoText={securityWorkInfo} onClick={() => startSecurityWork(faction)} />\n )}\n {!isPlayersGang && factionInfo.offersWork() && (\n <DonateOption faction={faction} rerender={rerender} favorToDonate={favorToDonate} disabled={!canDonate} />\n )}\n <Option buttonText={\"Purchase Augmentations\"} infoText={augmentationsInfo} onClick={onAugmentations} />\n {canPurchaseSleeves && (\n <>\n <Option\n buttonText={\"Purchase & Upgrade Duplicate Sleeves\"}\n infoText={sleevePurchasesInfo}\n onClick={() => setSleevesOpen(true)}\n />\n <CovenantPurchasesRoot open={sleevesOpen} onClose={() => setSleevesOpen(false)} />\n </>\n )}\n </>\n );\n}\n\nexport function FactionRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const [purchasingAugs, setPurchasingAugs] = useState(props.augPage);\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const faction = props.faction;\n\n if (!Player.factions.includes(faction.name)) {\n return (\n <>\n <Typography variant=\"h4\" color=\"primary\">\n You have not joined {faction.name} yet!\n </Typography>\n <Button onClick={() => Router.toFactions()}>Back to Factions</Button>\n </>\n );\n }\n\n return purchasingAugs ? (\n <AugmentationsPage faction={faction} routeToMainPage={() => setPurchasingAugs(false)} />\n ) : (\n <MainPage rerender={rerender} faction={faction} onAugmentations={() => setPurchasingAugs(true)} />\n );\n}\n","import { Box, Button, Tooltip, Typography, Paper, Container } from \"@mui/material\";\nimport React, { useState } from \"react\";\n\nimport { StaticAugmentations } from \"../../Augmentation/StaticAugmentations\";\nimport { getGenericAugmentationPriceMultiplier } from \"../../Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { PurchasableAugmentations } from \"../../Augmentation/ui/PurchasableAugmentations\";\nimport { PurchaseAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Player } from \"@player\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { FactionNames } from \"../data/FactionNames\";\nimport { Faction } from \"../Faction\";\nimport { getFactionAugmentationsFiltered, hasAugmentationPrereqs, purchaseAugmentation } from \"../FactionHelpers\";\nimport { CONSTANTS } from \"../../Constants\";\n\ntype IProps = {\n faction: Faction;\n routeToMainPage: () => void;\n};\n\n/** Root React Component for displaying a faction's \"Purchase Augmentations\" page */\nexport function AugmentationsPage(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function getAugs(): string[] {\n return getFactionAugmentationsFiltered(props.faction);\n }\n\n function getAugsSorted(): string[] {\n switch (Settings.PurchaseAugmentationsOrder) {\n case PurchaseAugmentationsOrderSetting.Cost: {\n return getAugsSortedByCost();\n }\n case PurchaseAugmentationsOrderSetting.Reputation: {\n return getAugsSortedByReputation();\n }\n case PurchaseAugmentationsOrderSetting.Purchasable: {\n return getAugsSortedByPurchasable();\n }\n default:\n return getAugsSortedByDefault();\n }\n }\n\n function getAugsSortedByCost(): string[] {\n const augs = getAugs();\n augs.sort((augName1, augName2) => {\n const aug1 = StaticAugmentations[augName1],\n aug2 = StaticAugmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n\n return aug1.getCost().moneyCost - aug2.getCost().moneyCost;\n });\n\n return augs;\n }\n\n function getAugsSortedByPurchasable(): string[] {\n const augs = getAugs();\n function canBuy(augName: string): boolean {\n const aug = StaticAugmentations[augName];\n const augCosts = aug.getCost();\n const repCost = augCosts.repCost;\n const hasReq = props.faction.playerReputation >= repCost;\n const hasRep = hasAugmentationPrereqs(aug);\n const hasCost = augCosts.moneyCost !== 0 && Player.money > augCosts.moneyCost;\n return hasCost && hasReq && hasRep;\n }\n const buy = augs.filter(canBuy).sort((augName1, augName2) => {\n const aug1 = StaticAugmentations[augName1],\n aug2 = StaticAugmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n\n return aug1.getCost().moneyCost - aug2.getCost().moneyCost;\n });\n const cantBuy = augs\n .filter((aug) => !canBuy(aug))\n .sort((augName1, augName2) => {\n const aug1 = StaticAugmentations[augName1],\n aug2 = StaticAugmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n return aug1.getCost().repCost - aug2.getCost().repCost;\n });\n\n return buy.concat(cantBuy);\n }\n\n function getAugsSortedByReputation(): string[] {\n const augs = getAugs();\n augs.sort((augName1, augName2) => {\n const aug1 = StaticAugmentations[augName1],\n aug2 = StaticAugmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n return aug1.getCost().repCost - aug2.getCost().repCost;\n });\n\n return augs;\n }\n\n function getAugsSortedByDefault(): string[] {\n return getAugs();\n }\n\n function switchSortOrder(newOrder: PurchaseAugmentationsOrderSetting): void {\n Settings.PurchaseAugmentationsOrder = newOrder;\n rerender();\n }\n\n const augs = getAugsSorted();\n const purchasable = augs.filter(\n (aug: string) =>\n aug === AugmentationNames.NeuroFluxGovernor ||\n (!Player.augmentations.some((a) => a.name === aug) && !Player.queuedAugmentations.some((a) => a.name === aug)),\n );\n const owned = augs.filter((aug: string) => !purchasable.includes(aug));\n\n const multiplierComponent =\n props.faction.name !== FactionNames.ShadowsOfAnarchy ? (\n <Tooltip\n title={\n <Typography>\n The price of every Augmentation increases for every queued Augmentation and it is reset when you install\n them.\n </Typography>\n }\n >\n <Typography>\n <b>Price multiplier:</b> x {numeralWrapper.formatReallyBigNumber(getGenericAugmentationPriceMultiplier())}\n </Typography>\n </Tooltip>\n ) : (\n <Tooltip\n title={\n <Typography>\n This price multiplier increases for each {FactionNames.ShadowsOfAnarchy} augmentation already purchased. The\n multiplier is NOT reset when installing augmentations.\n </Typography>\n }\n >\n <Typography>\n <b>Price multiplier:</b> x{\" \"}\n {numeralWrapper.formatReallyBigNumber(\n Math.pow(\n CONSTANTS.SoACostMult,\n augs.filter((augmentationName) => Player.hasAugmentation(augmentationName)).length,\n ),\n )}\n <br />\n <b>Reputation multiplier:</b> x{\" \"}\n {numeralWrapper.formatReallyBigNumber(\n Math.pow(\n CONSTANTS.SoARepMult,\n augs.filter((augmentationName) => Player.hasAugmentation(augmentationName)).length,\n ),\n )}\n </Typography>\n </Tooltip>\n );\n\n return (\n <>\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0 }}>\n <Button onClick={props.routeToMainPage}>Back</Button>\n <Typography variant=\"h4\">Faction Augmentations - {props.faction.name}</Typography>\n <Paper sx={{ p: 1, mb: 1 }}>\n <Typography>\n These are all of the Augmentations that are available to purchase from <b>{props.faction.name}</b>.\n Augmentations are powerful upgrades that will enhance your abilities.\n <br />\n </Typography>\n <Box\n sx={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${props.faction.name === FactionNames.ShadowsOfAnarchy ? \"2\" : \"3\"}, 1fr)`,\n justifyItems: \"center\",\n my: 1,\n }}\n >\n <>{multiplierComponent}</>\n <Typography>\n <b>Reputation:</b> <Reputation reputation={props.faction.playerReputation} />\n <br />\n <b>Favor:</b> <Favor favor={Math.floor(props.faction.favor)} />\n </Typography>\n </Box>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"repeat(4, 1fr)\" }}>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Cost)}>Sort by Cost</Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Reputation)}>\n Sort by Reputation\n </Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Default)}>\n Sort by Default Order\n </Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Purchasable)}>\n Sort by Purchasable\n </Button>\n </Box>\n </Paper>\n </Container>\n\n <PurchasableAugmentations\n augNames={purchasable}\n ownedAugNames={owned}\n canPurchase={(aug) => {\n const costs = aug.getCost();\n return (\n hasAugmentationPrereqs(aug) &&\n props.faction.playerReputation >= costs.repCost &&\n (costs.moneyCost === 0 || Player.money > costs.moneyCost)\n );\n }}\n purchaseAugmentation={(aug, showModal) => {\n if (!Settings.SuppressBuyAugmentationConfirmation) {\n showModal(true);\n } else {\n purchaseAugmentation(aug, props.faction);\n rerender();\n }\n }}\n rep={props.faction.playerReputation}\n faction={props.faction}\n />\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { Faction } from \"../Faction\";\nimport { Player } from \"@player\";\nimport { repFromDonation } from \"../formulas/donation\";\nimport { Favor } from \"../../ui/React/Favor\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { NumberInput } from \"../../ui/React/NumberInput\";\n\ntype IProps = {\n faction: Faction;\n disabled: boolean;\n favorToDonate: number;\n rerender: () => void;\n};\n\n/** React component for a donate option on the Faction UI */\nexport function DonateOption(props: IProps): React.ReactElement {\n const [donateAmt, setDonateAmt] = useState<number>(NaN);\n const digits = (CONSTANTS.DonateMoneyToRepDivisor + \"\").length - 1;\n\n function canDonate(): boolean {\n if (isNaN(donateAmt)) return false;\n if (isNaN(donateAmt) || donateAmt <= 0) return false;\n if (Player.money < donateAmt) return false;\n return true;\n }\n\n function donate(): void {\n const fac = props.faction;\n const amt = donateAmt;\n if (isNaN(amt)) return;\n if (!canDonate()) return;\n Player.loseMoney(amt, \"other\");\n const repGain = repFromDonation(amt, Player);\n props.faction.playerReputation += repGain;\n dialogBoxCreate(\n <>\n You just donated <Money money={amt} /> to {fac.name} to gain <Reputation reputation={repGain} /> reputation.\n </>,\n );\n props.rerender();\n }\n\n function Status(): React.ReactElement {\n if (isNaN(donateAmt)) return <></>;\n if (!canDonate()) {\n if (Player.money < donateAmt) return <Typography>Insufficient funds</Typography>;\n return <Typography>Invalid donate amount entered!</Typography>;\n }\n return (\n <Typography>\n This donation will result in <Reputation reputation={repFromDonation(donateAmt, Player)} /> reputation gain\n </Typography>\n );\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Status />\n {props.disabled ? (\n <Typography>\n Unlock donations at <Favor favor={props.favorToDonate} /> favor with {props.faction.name}\n </Typography>\n ) : (\n <>\n <NumberInput\n onChange={setDonateAmt}\n placeholder={\"Donation amount\"}\n disabled={props.disabled}\n InputProps={{\n endAdornment: (\n <Button onClick={donate} disabled={props.disabled || !canDonate()}>\n donate\n </Button>\n ),\n }}\n />\n <Typography>\n <MathJaxWrapper>{`\\\\(reputation = \\\\frac{\\\\text{donation amount} \\\\cdot \\\\text{reputation multiplier}}{10^{${digits}}}\\\\)`}</MathJaxWrapper>\n </Typography>\n </>\n )}\n </Paper>\n );\n}\n","/**\n * React component for general information about the faction. This includes the\n * factions \"motto\", reputation, favor, and gameplay instructions\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { Faction } from \"../Faction\";\nimport { FactionInfo } from \"../FactionInfo\";\n\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n faction: Faction;\n factionInfo: FactionInfo;\n};\n\nconst useStyles = makeStyles(() =>\n createStyles({\n noformat: {\n whiteSpace: \"pre-wrap\",\n lineHeight: \"1em\",\n },\n }),\n);\n\nfunction DefaultAssignment(): React.ReactElement {\n return (\n <Typography>\n Perform work/carry out assignments for your faction to help further its cause! By doing so you will earn\n reputation for your faction. You will also gain reputation passively over time, although at a very slow rate.\n Earning reputation will allow you to purchase Augmentations through this faction, which are powerful upgrades that\n enhance your abilities.\n </Typography>\n );\n}\n\nexport function Info(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const classes = useStyles();\n\n const Assignment = props.factionInfo.assignment ?? DefaultAssignment;\n\n const favorGain = props.faction.getFavorGain();\n\n return (\n <>\n <Typography classes={{ root: classes.noformat }}>{props.factionInfo.infoText}</Typography>\n <Typography>-------------------------</Typography>\n <Box display=\"flex\">\n <Tooltip\n title={\n <>\n <Typography>\n You will have <Favor favor={Math.floor(props.faction.favor + favorGain)} /> faction favor after\n installing an Augmentation.\n </Typography>\n <MathJaxWrapper>{\"\\\\(\\\\huge{r = \\\\text{total faction reputation}}\\\\)\"}</MathJaxWrapper>\n <MathJaxWrapper>\n {\"\\\\(\\\\huge{favor=1+\\\\left\\\\lfloor\\\\log_{1.02}\\\\left(\\\\frac{r+25000}{25500}\\\\right)\\\\right\\\\rfloor}\\\\)\"}\n </MathJaxWrapper>\n </>\n }\n >\n <Typography>\n Reputation: <Reputation reputation={props.faction.playerReputation} />\n </Typography>\n </Tooltip>\n </Box>\n\n <Typography>-------------------------</Typography>\n\n <Box display=\"flex\">\n <Tooltip\n title={\n <>\n <Typography>\n Faction favor increases the rate at which you earn reputation for this faction by 1% per favor. Faction\n favor is gained whenever you install an Augmentation. The amount of favor you gain depends on the total\n amount of reputation you earned with this faction. Across all resets.\n </Typography>\n\n <MathJaxWrapper>{\"\\\\(\\\\huge{r = reputation}\\\\)\"}</MathJaxWrapper>\n <MathJaxWrapper>{\"\\\\(\\\\huge{\\\\Delta r = \\\\Delta r \\\\times \\\\frac{100+favor}{100}}\\\\)\"}</MathJaxWrapper>\n </>\n }\n >\n <Typography>\n Faction Favor: <Favor favor={Math.floor(props.faction.favor)} />\n </Typography>\n </Tooltip>\n </Box>\n\n <Typography>-------------------------</Typography>\n <Assignment />\n </>\n );\n}\n","/**\n * Root React component for the popup that lets player purchase Duplicate\n * Sleeves and Sleeve-related upgrades from The Covenant\n */\nimport React, { useState } from \"react\";\n\nimport { CovenantSleeveMemoryUpgrade } from \"./CovenantSleeveMemoryUpgrade\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { BaseCostPerSleeve, MaxSleevesFromCovenant } from \"../SleeveCovenantPurchases\";\n\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { Player } from \"@player\";\n\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function CovenantPurchasesRoot(props: IProps): React.ReactElement {\n const [update, setUpdate] = useState(0);\n\n /** Get the cost to purchase a new Duplicate Sleeve */\n function purchaseCost(): number {\n return Math.pow(10, Player.sleevesFromCovenant) * BaseCostPerSleeve;\n }\n\n /** Force a rerender by just changing an arbitrary state value */\n function rerender(): void {\n setUpdate(update + 1);\n }\n\n // Purchasing a new Duplicate Sleeve\n let purchaseDisabled = false;\n if (!Player.canAfford(purchaseCost())) {\n purchaseDisabled = true;\n }\n if (Player.sleevesFromCovenant >= MaxSleevesFromCovenant) {\n purchaseDisabled = true;\n }\n\n function purchaseOnClick(): void {\n if (Player.sleevesFromCovenant >= MaxSleevesFromCovenant) return;\n\n if (Player.canAfford(purchaseCost())) {\n Player.loseMoney(purchaseCost(), \"sleeves\");\n Player.sleevesFromCovenant += 1;\n Player.sleeves.push(new Sleeve());\n rerender();\n } else {\n dialogBoxCreate(`You cannot afford to purchase a Duplicate Sleeve`);\n }\n }\n\n // Purchasing Upgrades for Sleeves\n const upgradePanels = [];\n for (let i = 0; i < Player.sleeves.length; ++i) {\n const sleeve = Player.sleeves[i];\n upgradePanels.push(<CovenantSleeveMemoryUpgrade index={i} rerender={rerender} sleeve={sleeve} />);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n {Player.sleevesFromCovenant < MaxSleevesFromCovenant && (\n <>\n <Typography>\n Purchase an additional Sleeves. These Duplicate Sleeves are permanent (they persist through BitNodes). You\n can purchase a total of {MaxSleevesFromCovenant} from {FactionNames.TheCovenant}.\n </Typography>\n <Button disabled={purchaseDisabled} onClick={purchaseOnClick}>\n Purchase - \n <Money money={purchaseCost()} forPurchase={true} />\n </Button>\n </>\n )}\n <br />\n <br />\n <Typography>You can also purchase upgrades for your Sleeves. These upgrades are also permanent.</Typography>\n {upgradePanels}\n </>\n </Modal>\n );\n}\n","/**\n * React component for a panel that lets you purchase upgrades for a Duplicate\n * Sleeve's Memory (through The Covenant)\n */\nimport React, { useState } from \"react\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { Player } from \"@player\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Money } from \"../../../ui/React/Money\";\n\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n index: number;\n rerender: () => void;\n sleeve: Sleeve;\n}\n\nexport function CovenantSleeveMemoryUpgrade(props: IProps): React.ReactElement {\n const [amt, setAmt] = useState(1);\n\n function changePurchaseAmount(e: React.ChangeEvent<HTMLInputElement>): void {\n let n: number = parseInt(e.target.value);\n\n if (isNaN(n)) n = 1;\n if (n < 1) n = 1;\n const maxMemory = 100 - props.sleeve.memory;\n if (n > maxMemory) n = maxMemory;\n\n setAmt(n);\n }\n\n function getPurchaseCost(): number {\n if (isNaN(amt)) {\n return Infinity;\n }\n\n const maxMemory = 100 - props.sleeve.memory;\n if (amt > maxMemory) {\n return Infinity;\n }\n\n return props.sleeve.getMemoryUpgradeCost(amt);\n }\n\n function purchaseMemory(): void {\n const cost = getPurchaseCost();\n if (Player.canAfford(cost)) {\n props.sleeve.upgradeMemory(amt);\n Player.loseMoney(cost, \"sleeves\");\n props.rerender();\n }\n }\n\n // Purchase button props\n const cost = getPurchaseCost();\n const purchaseBtnDisabled = !Player.canAfford(cost);\n let purchaseBtnContent = <></>;\n if (isNaN(amt)) {\n purchaseBtnContent = <>Invalid value</>;\n } else {\n purchaseBtnContent = (\n <>\n Purchase {amt} memory - \n <Money money={cost} forPurchase={true} />\n </>\n );\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Typography variant=\"h6\" color=\"primary\">\n Upgrade Memory of Sleeve {props.index}\n </Typography>\n <Typography>\n Purchase a memory upgrade for your sleeve. Note that a sleeve's max memory is 100 (current:{\" \"}\n {numeralWrapper.formatSleeveMemory(props.sleeve.memory)})\n </Typography>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Amount of memory to purchase (must be an integer): </Typography>\n <TextField onChange={changePurchaseAmount} type={\"number\"} value={amt} />\n </Box>\n <br />\n <Button disabled={purchaseBtnDisabled} onClick={purchaseMemory}>\n {purchaseBtnContent}\n </Button>\n </Paper>\n );\n}\n","import { Button, Typography, Box, Paper, Tooltip } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { GangConstants } from \"../../Gang/data/Constants\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { Player } from \"@player\";\nimport { Faction } from \"../Faction\";\nimport { CreateGangModal } from \"./CreateGangModal\";\n\ntype IProps = {\n faction: Faction;\n};\n\nexport function GangButton({ faction }: IProps): React.ReactElement {\n const [gangOpen, setGangOpen] = useState(false);\n\n if (\n !GangConstants.Names.includes(faction.name) || // not even a gang\n !Player.isAwareOfGang() || // doesn't know about gang\n (Player.gang && Player.getGangName() !== faction.name) // already in another gang\n ) {\n return <></>;\n }\n\n let data = {\n enabled: false,\n title: \"\",\n tooltip: \"\" as string | React.ReactElement,\n description: \"\",\n };\n\n if (Player.gang) {\n data = {\n enabled: true,\n title: \"Manage Gang\",\n tooltip: \"\",\n description: \"Manage a gang for this Faction. Gangs will earn you money and faction reputation\",\n };\n } else {\n data = {\n enabled: Player.canAccessGang(),\n title: \"Create Gang\",\n tooltip: !Player.canAccessGang() ? (\n <Typography>Unlocked when reaching {GangConstants.GangKarmaRequirement} karma</Typography>\n ) : (\n \"\"\n ),\n description: \"Create a gang for this Faction. Gangs will earn you money and faction reputation\",\n };\n }\n\n const manageGang = (): void => {\n // If player already has a gang, just go to the gang UI\n if (Player.inGang()) {\n return Router.toGang();\n }\n\n setGangOpen(true);\n };\n\n return (\n <>\n <Box>\n <Paper sx={{ my: 1, p: 1 }}>\n <Tooltip title={data.tooltip}>\n <span>\n <Button onClick={manageGang} disabled={!data.enabled}>\n {data.title}\n </Button>\n </span>\n </Tooltip>\n <Typography>{data.description}</Typography>\n </Paper>\n </Box>\n\n <CreateGangModal facName={faction.name} open={gangOpen} onClose={() => setGangOpen(false)} />\n </>\n );\n}\n","import React from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { Player } from \"@player\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { FactionNames } from \"../data/FactionNames\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n facName: string;\n}\n\n/** React Component for the popup used to create a new gang. */\nexport function CreateGangModal(props: IProps): React.ReactElement {\n const combatGangText =\n \"This is a COMBAT gang. Members in this gang will have different tasks than HACKING gangs. \" +\n \"Compared to hacking gangs, progression with combat gangs can be more difficult as territory management \" +\n \"is more important. However, well-managed combat gangs can progress faster than hacking ones.\";\n\n const hackingGangText =\n \"This is a HACKING gang. Members in this gang will have different tasks than COMBAT gangs. \" +\n \"Compared to combat gangs, progression with hacking gangs is more straightforward as territory warfare \" +\n \"is not as important.\";\n\n function isHacking(): boolean {\n return [FactionNames.NiteSec as string, FactionNames.TheBlackHand as string].includes(props.facName);\n }\n\n function createGang(): void {\n Player.startGang(props.facName, isHacking());\n props.onClose();\n Router.toGang();\n }\n\n function onKeyUp(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) createGang();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to create a new Gang with {props.facName}?\n <br />\n <br />\n Note that this will prevent you from creating a Gang with any other Faction until this BitNode is destroyed. It\n also resets your reputation with this faction.\n <br />\n <br />\n {isHacking() ? hackingGangText : combatGangText}\n <br />\n <br />\n Other than hacking vs combat, there are NO differences between the Factions you can create a Gang with, and each\n of these Factions have all Augmentations available.\n </Typography>\n <Button onClick={createGang} onKeyUp={onKeyUp} autoFocus>\n Create Gang\n </Button>\n </Modal>\n );\n}\n","import { Paper, Table, TableBody, Box, IconButton, Typography, Container, Tooltip } from \"@mui/material\";\nimport { MoreHoriz, Info } from \"@mui/icons-material\";\nimport React, { useEffect, useState } from \"react\";\nimport { BitNodes, defaultMultipliers, getBitNodeMultipliers } from \"../BitNode/BitNode\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { BitNodeMultipliersDisplay } from \"../BitNode/ui/BitnodeMultipliersDescription\";\nimport { HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { getPurchaseServerLimit } from \"../Server/ServerPurchases\";\nimport { Settings } from \"../Settings/Settings\";\nimport { MoneySourceTracker } from \"../utils/MoneySourceTracker\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { Player } from \"@player\";\nimport { numeralWrapper } from \"./numeralFormat\";\nimport { Modal } from \"./React/Modal\";\nimport { Money } from \"./React/Money\";\nimport { StatsRow } from \"./React/StatsRow\";\nimport { StatsTable } from \"./React/StatsTable\";\nimport { isEqual } from \"lodash\";\n\ninterface EmployersModalProps {\n open: boolean;\n onClose: () => void;\n}\n\nconst EmployersModal = ({ open, onClose }: EmployersModalProps): React.ReactElement => {\n return (\n <Modal open={open} onClose={onClose}>\n <>\n <Typography variant=\"h5\">All Employers</Typography>\n <ul>\n {Object.keys(Player.jobs).map((j) => (\n <Typography key={j}>* {j}</Typography>\n ))}\n </ul>\n </>\n </Modal>\n );\n};\n\ninterface IMultRow {\n // The name of the multiplier\n mult: string;\n\n // The player's raw multiplier value\n value: number;\n\n // The player's effective multiplier value, affected by BitNode mults\n effValue?: number;\n\n // The text color for the row\n color?: string;\n}\n\ninterface MultTableProps {\n rows: IMultRow[];\n color: string;\n noMargin?: boolean;\n}\n\nfunction MultiplierTable(props: MultTableProps): React.ReactElement {\n return (\n <Table sx={{ display: \"table\", width: \"100%\", mb: (props.noMargin ?? false) === true ? 0 : 2 }}>\n <TableBody>\n {props.rows.map((data) => {\n const { mult, value, effValue = null, color = props.color } = data;\n\n if (effValue !== null && effValue !== value && Player.sourceFileLvl(5) > 0) {\n return (\n <StatsRow key={mult} name={mult} color={color} data={{}}>\n <>\n <Typography color={color}>\n <span style={{ opacity: 0.5 }}>{numeralWrapper.formatPercentage(value)}</span>{\" \"}\n {numeralWrapper.formatPercentage(effValue)}\n </Typography>\n </>\n </StatsRow>\n );\n }\n return (\n <StatsRow key={mult} name={mult} color={color} data={{ content: numeralWrapper.formatPercentage(value) }} />\n );\n })}\n </TableBody>\n </Table>\n );\n}\n\nfunction CurrentBitNode(): React.ReactElement {\n if (Player.sourceFiles.length > 0) {\n const index = \"BitNode\" + Player.bitNodeN;\n const lvl = Math.min(Player.sourceFileLvl(Player.bitNodeN) + 1, Player.bitNodeN === 12 ? Infinity : 3);\n return (\n <Paper sx={{ mb: 1, p: 1 }}>\n <Typography variant=\"h5\">\n BitNode {Player.bitNodeN}: {BitNodes[index].name} (Level {lvl})\n </Typography>\n <Typography sx={{ whiteSpace: \"pre-wrap\", overflowWrap: \"break-word\" }}>{BitNodes[index].info}</Typography>\n </Paper>\n );\n }\n\n return <></>;\n}\n\ninterface IMoneyModalProps {\n open: boolean;\n onClose: () => void;\n}\n\nfunction MoneyModal({ open, onClose }: IMoneyModalProps): React.ReactElement {\n function convertMoneySourceTrackerToString(src: MoneySourceTracker): React.ReactElement {\n const parts: [string, JSX.Element][] = [[`Total:`, <Money money={src.total} />]];\n if (src.augmentations) {\n parts.push([`Augmentations:`, <Money money={src.augmentations} />]);\n }\n if (src.bladeburner) {\n parts.push([`Bladeburner:`, <Money money={src.bladeburner} />]);\n }\n if (src.casino) {\n parts.push([`Casino:`, <Money money={src.casino} />]);\n }\n if (src.codingcontract) {\n parts.push([`Coding Contracts:`, <Money money={src.codingcontract} />]);\n }\n if (src.work) {\n parts.push([`Company Work:`, <Money money={src.work} />]);\n }\n if (src.class) {\n parts.push([`Class:`, <Money money={src.class} />]);\n }\n if (src.corporation) {\n parts.push([`Corporation:`, <Money money={src.corporation} />]);\n }\n if (src.crime) {\n parts.push([`Crimes:`, <Money money={src.crime} />]);\n }\n if (src.gang) {\n parts.push([`Gang:`, <Money money={src.gang} />]);\n }\n if (src.hacking) {\n parts.push([`Hacking:`, <Money money={src.hacking} />]);\n }\n if (src.hacknet) {\n parts.push([`Hacknet Nodes:`, <Money money={src.hacknet} />]);\n }\n if (src.hacknet_expenses) {\n parts.push([`Hacknet Nodes Expenses:`, <Money money={src.hacknet_expenses} />]);\n }\n if (src.hospitalization) {\n parts.push([`Hospitalization:`, <Money money={src.hospitalization} />]);\n }\n if (src.infiltration) {\n parts.push([`Infiltration:`, <Money money={src.infiltration} />]);\n }\n if (src.servers) {\n parts.push([`Servers:`, <Money money={src.servers} />]);\n }\n if (src.stock) {\n parts.push([`Stock Market:`, <Money money={src.stock} />]);\n }\n if (src.sleeves) {\n parts.push([`Sleeves:`, <Money money={src.sleeves} />]);\n }\n if (src.other) {\n parts.push([`Other:`, <Money money={src.other} />]);\n }\n\n return <StatsTable rows={parts} wide />;\n }\n\n let content = (\n <>\n <Typography variant=\"h6\" color=\"primary\">\n Money earned since you last installed Augmentations\n </Typography>\n <br />\n {convertMoneySourceTrackerToString(Player.moneySourceA)}\n </>\n );\n if (Player.sourceFiles.length !== 0) {\n content = (\n <>\n {content}\n <br />\n <br />\n <Typography variant=\"h6\" color=\"primary\">\n Money earned in this BitNode\n </Typography>\n <br />\n {convertMoneySourceTrackerToString(Player.moneySourceB)}\n </>\n );\n }\n\n return (\n <Modal open={open} onClose={onClose}>\n {content}\n </Modal>\n );\n}\n\nexport function CharacterStats(): React.ReactElement {\n const [moneyOpen, setMoneyOpen] = useState(false);\n const [employersOpen, setEmployersOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const timeRows = [\n [\"Since last Augmentation installation\", convertTimeMsToTimeElapsedString(Player.playtimeSinceLastAug)],\n ];\n if (Player.sourceFiles.length > 0) {\n timeRows.push([\"Since last Bitnode destroyed\", convertTimeMsToTimeElapsedString(Player.playtimeSinceLastBitnode)]);\n }\n timeRows.push([\"Total\", convertTimeMsToTimeElapsedString(Player.totalPlaytime)]);\n\n let showBitNodeMults = false;\n if (Player.sourceFileLvl(5) > 0) {\n const n = Player.bitNodeN;\n const maxSfLevel = n === 12 ? Infinity : 3;\n const mults = getBitNodeMultipliers(n, Math.min(Player.sourceFileLvl(n) + 1, maxSfLevel));\n showBitNodeMults = !isEqual(mults, defaultMultipliers);\n }\n return (\n <Container maxWidth=\"lg\" disableGutters sx={{ mx: 0 }}>\n <Typography variant=\"h4\">Stats</Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\", minWidth: \"fit-content\", mb: 1, gap: 1 }}>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\">General</Typography>\n <Table>\n <TableBody>\n <StatsRow name=\"Current City\" color={Settings.theme.primary} data={{ content: Player.city }} />\n <StatsRow name=\"Money\" color={Settings.theme.money} data={{}}>\n <>\n <Money money={Player.money} />\n <IconButton onClick={() => setMoneyOpen(true)} sx={{ p: 0 }}>\n <MoreHoriz color=\"info\" />\n </IconButton>\n </>\n </StatsRow>\n\n {Player.jobs && Object.keys(Player.jobs).length !== 0 ? (\n <StatsRow name=\"All Employers\" color={Settings.theme.primary} data={{}}>\n <>\n <span style={{ color: Settings.theme.primary }}>{Object.keys(Player.jobs).length} total</span>\n <IconButton onClick={() => setEmployersOpen(true)} sx={{ p: 0 }}>\n <MoreHoriz color=\"info\" />\n </IconButton>\n </>\n </StatsRow>\n ) : (\n <></>\n )}\n <StatsRow\n name=\"Servers Owned\"\n color={Settings.theme.primary}\n data={{ content: `${Player.purchasedServers.length} / ${getPurchaseServerLimit()}` }}\n />\n <StatsRow\n name={`Hacknet ${Player.bitNodeN === 9 || Player.sourceFileLvl(9) > 0 ? \"Servers\" : \"Nodes\"} owned`}\n color={Settings.theme.primary}\n data={{\n content: `${Player.hacknetNodes.length}${\n Player.bitNodeN === 9 || Player.sourceFileLvl(9) > 0\n ? ` / ${HacknetServerConstants.MaxServers}`\n : \"\"\n }`,\n }}\n />\n <StatsRow\n name=\"Augmentations Installed\"\n color={Settings.theme.primary}\n data={{ content: String(Player.augmentations.length) }}\n />\n </TableBody>\n </Table>\n </Paper>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\">Skills</Typography>\n <Table>\n <TableBody>\n <StatsRow\n name=\"Hacking\"\n color={Settings.theme.hack}\n data={{ level: Player.skills.hacking, exp: Player.exp.hacking }}\n />\n <StatsRow\n name=\"Strength\"\n color={Settings.theme.combat}\n data={{ level: Player.skills.strength, exp: Player.exp.strength }}\n />\n <StatsRow\n name=\"Defense\"\n color={Settings.theme.combat}\n data={{ level: Player.skills.defense, exp: Player.exp.defense }}\n />\n <StatsRow\n name=\"Dexterity\"\n color={Settings.theme.combat}\n data={{ level: Player.skills.dexterity, exp: Player.exp.dexterity }}\n />\n <StatsRow\n name=\"Agility\"\n color={Settings.theme.combat}\n data={{ level: Player.skills.agility, exp: Player.exp.agility }}\n />\n <StatsRow\n name=\"Charisma\"\n color={Settings.theme.cha}\n data={{ level: Player.skills.charisma, exp: Player.exp.charisma }}\n />\n {Player.skills.intelligence > 0 && (Player.bitNodeN === 5 || Player.sourceFileLvl(5) > 0) && (\n <StatsRow\n name=\"Intelligence\"\n color={Settings.theme.int}\n data={{ level: Player.skills.intelligence, exp: Player.exp.intelligence }}\n />\n )}\n </TableBody>\n </Table>\n </Paper>\n </Box>\n\n <Paper sx={{ p: 1, mb: 1 }}>\n <Typography variant=\"h5\" color=\"primary\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n Multipliers\n {Player.sourceFileLvl(5) > 0 && (\n <Tooltip\n title={\n <Typography>\n Displays your current multipliers.\n <br />\n <br />\n When there is a dim number next to a multiplier, that means that the multiplier in question is being\n affected by BitNode multipliers.\n <br />\n <br />\n The dim number is the raw multiplier, and the undimmed number is the effective multiplier, as dictated\n by the BitNode.\n </Typography>\n }\n >\n <Info sx={{ ml: 1, mb: 0.5 }} color=\"info\" />\n </Tooltip>\n )}\n </Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\", gap: 1 }}>\n <Box>\n <MultiplierTable\n rows={[\n {\n mult: \"Hacking Chance\",\n value: Player.mults.hacking_chance,\n },\n {\n mult: \"Hacking Speed\",\n value: Player.mults.hacking_speed,\n },\n {\n mult: \"Hacking Money\",\n value: Player.mults.hacking_money,\n effValue: Player.mults.hacking_money * BitNodeMultipliers.ScriptHackMoney,\n },\n {\n mult: \"Hacking Growth\",\n value: Player.mults.hacking_grow,\n effValue: Player.mults.hacking_grow * BitNodeMultipliers.ServerGrowthRate,\n },\n ]}\n color={Settings.theme.hack}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Hacking Level\",\n value: Player.mults.hacking,\n effValue: Player.mults.hacking * BitNodeMultipliers.HackingLevelMultiplier,\n },\n {\n mult: \"Hacking Experience\",\n value: Player.mults.hacking_exp,\n effValue: Player.mults.hacking_exp * BitNodeMultipliers.HackExpGain,\n },\n ]}\n color={Settings.theme.hack}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Strength Level\",\n value: Player.mults.strength,\n effValue: Player.mults.strength * BitNodeMultipliers.StrengthLevelMultiplier,\n },\n {\n mult: \"Strength Experience\",\n value: Player.mults.strength_exp,\n },\n ]}\n color={Settings.theme.combat}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Defense Level\",\n value: Player.mults.defense,\n effValue: Player.mults.defense * BitNodeMultipliers.DefenseLevelMultiplier,\n },\n {\n mult: \"Defense Experience\",\n value: Player.mults.defense_exp,\n },\n ]}\n color={Settings.theme.combat}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Dexterity Level\",\n value: Player.mults.dexterity,\n effValue: Player.mults.dexterity * BitNodeMultipliers.DexterityLevelMultiplier,\n },\n {\n mult: \"Dexterity Experience\",\n value: Player.mults.dexterity_exp,\n },\n ]}\n color={Settings.theme.combat}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Agility Level\",\n value: Player.mults.agility,\n effValue: Player.mults.agility * BitNodeMultipliers.AgilityLevelMultiplier,\n },\n {\n mult: \"Agility Experience\",\n value: Player.mults.agility_exp,\n },\n ]}\n color={Settings.theme.combat}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Charisma Level\",\n value: Player.mults.charisma,\n effValue: Player.mults.charisma * BitNodeMultipliers.CharismaLevelMultiplier,\n },\n {\n mult: \"Charisma Experience\",\n value: Player.mults.charisma_exp,\n },\n ]}\n color={Settings.theme.cha}\n noMargin\n />\n </Box>\n\n <Box>\n <MultiplierTable\n rows={[\n {\n mult: \"Hacknet Node Production\",\n value: Player.mults.hacknet_node_money,\n effValue: Player.mults.hacknet_node_money * BitNodeMultipliers.HacknetNodeMoney,\n },\n {\n mult: \"Hacknet Node Purchase Cost\",\n value: Player.mults.hacknet_node_purchase_cost,\n },\n {\n mult: \"Hacknet Node RAM Upgrade Cost\",\n value: Player.mults.hacknet_node_ram_cost,\n },\n {\n mult: \"Hacknet Node Core Purchase Cost\",\n value: Player.mults.hacknet_node_core_cost,\n },\n {\n mult: \"Hacknet Node Level Upgrade Cost\",\n value: Player.mults.hacknet_node_level_cost,\n },\n ]}\n color={Settings.theme.primary}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Company Reputation Gain\",\n value: Player.mults.company_rep,\n color: Settings.theme.rep,\n },\n {\n mult: \"Faction Reputation Gain\",\n value: Player.mults.faction_rep,\n effValue: Player.mults.faction_rep * BitNodeMultipliers.FactionWorkRepGain,\n color: Settings.theme.rep,\n },\n {\n mult: \"Salary\",\n value: Player.mults.work_money,\n effValue: Player.mults.work_money * BitNodeMultipliers.CompanyWorkMoney,\n color: Settings.theme.money,\n },\n ]}\n color={Settings.theme.money}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Crime Success Chance\",\n value: Player.mults.crime_success,\n },\n {\n mult: \"Crime Money\",\n value: Player.mults.crime_money,\n effValue: Player.mults.crime_money * BitNodeMultipliers.CrimeMoney,\n color: Settings.theme.money,\n },\n ]}\n color={Settings.theme.combat}\n />\n {Player.canAccessBladeburner() && BitNodeMultipliers.BladeburnerRank > 0 && (\n <MultiplierTable\n rows={[\n {\n mult: \"Bladeburner Success Chance\",\n value: Player.mults.bladeburner_success_chance,\n },\n {\n mult: \"Bladeburner Max Stamina\",\n value: Player.mults.bladeburner_max_stamina,\n },\n {\n mult: \"Bladeburner Stamina Gain\",\n value: Player.mults.bladeburner_stamina_gain,\n },\n {\n mult: \"Bladeburner Field Analysis\",\n value: Player.mults.bladeburner_analysis,\n },\n ]}\n color={Settings.theme.primary}\n noMargin\n />\n )}\n </Box>\n </Box>\n </Paper>\n\n <Paper sx={{ p: 1, mb: 1 }}>\n <Typography variant=\"h5\">Time Played</Typography>\n <Table>\n <TableBody>\n {timeRows.map(([name, content]) => (\n <StatsRow key={name} name={name} color={Settings.theme.primary} data={{ content: content }} />\n ))}\n </TableBody>\n </Table>\n </Paper>\n\n <CurrentBitNode />\n\n {showBitNodeMults && (\n <Paper sx={{ p: 1, mb: 1 }}>\n <Typography variant=\"h5\">BitNode Multipliers</Typography>\n <BitNodeMultipliersDisplay n={Player.bitNodeN} />\n </Paper>\n )}\n\n <MoneyModal open={moneyOpen} onClose={() => setMoneyOpen(false)} />\n <EmployersModal open={employersOpen} onClose={() => setEmployersOpen(false)} />\n </Container>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { InfoAndPurchases } from \"./InfoAndPurchases\";\nimport { StockTickers } from \"./StockTickers\";\n\nimport { IStockMarket } from \"../IStockMarket\";\n\nimport { Player } from \"@player\";\n\ntype IProps = {\n stockMarket: IStockMarket;\n};\n\n/** Root React component for the Stock Market UI */\nexport function StockMarketRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n return (\n <>\n <InfoAndPurchases rerender={rerender} />\n {Player.hasWseAccount && <StockTickers stockMarket={props.stockMarket} />}\n </>\n );\n}\n","/**\n * React component for the Stock Market UI. This component displays\n * general information about the stock market, buttons for the various purchases,\n * and a link to the documentation (Investopedia)\n */\nimport React, { useState } from \"react\";\n\nimport { getStockMarket4SDataCost, getStockMarket4STixApiCost } from \"../StockMarketCosts\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { Player } from \"@player\";\nimport { Money } from \"../../ui/React/Money\";\nimport { initStockMarket } from \"../StockMarket\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Link from \"@mui/material/Link\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport IconButton from \"@mui/material/IconButton\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport CheckIcon from \"@mui/icons-material/Check\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\ntype IProps = {\n rerender: () => void;\n};\n\nfunction Purchase4SMarketDataTixApiAccessButton(props: IProps): React.ReactElement {\n function purchase4SMarketDataTixApiAccess(): void {\n if (Player.has4SDataTixApi) {\n return;\n }\n if (!Player.canAfford(getStockMarket4STixApiCost())) {\n return;\n }\n Player.has4SDataTixApi = true;\n Player.loseMoney(getStockMarket4STixApiCost(), \"stock\");\n props.rerender();\n }\n\n if (Player.has4SDataTixApi) {\n return (\n <Typography>\n Market Data TIX API Access <CheckIcon />\n </Typography>\n );\n } else {\n const cost = getStockMarket4STixApiCost();\n return (\n <Tooltip\n title={\n !Player.hasTixApiAccess ? (\n <Typography>Requires TIX API Access</Typography>\n ) : (\n <Typography>Let you access 4S Market Data through Netscript</Typography>\n )\n }\n >\n <span>\n <Button\n disabled={!Player.hasTixApiAccess || !Player.canAfford(cost)}\n onClick={purchase4SMarketDataTixApiAccess}\n >\n Buy 4S Market Data TIX API Access - \n <Money money={cost} forPurchase={true} />\n </Button>\n </span>\n </Tooltip>\n );\n }\n}\n\nfunction PurchaseWseAccountButton(props: IProps): React.ReactElement {\n if (Player.hasWseAccount) {\n return (\n <Typography>\n WSE Account <CheckIcon />\n </Typography>\n );\n }\n function purchaseWseAccount(): void {\n if (Player.hasWseAccount) {\n return;\n }\n if (!Player.canAfford(CONSTANTS.WSEAccountCost)) {\n return;\n }\n Player.hasWseAccount = true;\n initStockMarket();\n Player.loseMoney(CONSTANTS.WSEAccountCost, \"stock\");\n props.rerender();\n }\n\n const cost = CONSTANTS.WSEAccountCost;\n return (\n <>\n <Typography>To begin trading, you must first purchase an account:</Typography>\n <Button disabled={!Player.canAfford(cost)} onClick={purchaseWseAccount}>\n Buy WSE Account - \n <Money money={cost} forPurchase={true} />\n </Button>\n </>\n );\n}\n\nfunction PurchaseTixApiAccessButton(props: IProps): React.ReactElement {\n function purchaseTixApiAccess(): void {\n if (Player.hasTixApiAccess) {\n return;\n }\n if (!Player.canAfford(CONSTANTS.TIXAPICost)) {\n return;\n }\n Player.hasTixApiAccess = true;\n Player.loseMoney(CONSTANTS.TIXAPICost, \"stock\");\n props.rerender();\n }\n\n if (Player.hasTixApiAccess) {\n return (\n <Typography>\n TIX API Access <CheckIcon />\n </Typography>\n );\n } else {\n const cost = CONSTANTS.TIXAPICost;\n return (\n <Button disabled={!Player.canAfford(cost) || !Player.hasWseAccount} onClick={purchaseTixApiAccess}>\n Buy Trade Information eXchange (TIX) API Access - \n <Money money={cost} forPurchase={true} />\n </Button>\n );\n }\n}\n\nfunction Purchase4SMarketDataButton(props: IProps): React.ReactElement {\n function purchase4SMarketData(): void {\n if (Player.has4SData) {\n return;\n }\n if (!Player.canAfford(getStockMarket4SDataCost())) {\n return;\n }\n Player.has4SData = true;\n Player.loseMoney(getStockMarket4SDataCost(), \"stock\");\n props.rerender();\n }\n if (Player.has4SData) {\n return (\n <Typography>\n 4S Market Data Access <CheckIcon />\n </Typography>\n );\n } else {\n const cost = getStockMarket4SDataCost();\n return (\n <Tooltip\n title={<Typography>Lets you view additional pricing and volatility information about stocks</Typography>}\n >\n <span>\n <Button disabled={!Player.canAfford(cost) || !Player.hasWseAccount} onClick={purchase4SMarketData}>\n Buy 4S Market Data Access - \n <Money money={cost} forPurchase={true} />\n </Button>\n </span>\n </Tooltip>\n );\n }\n}\n\nexport function InfoAndPurchases(props: IProps): React.ReactElement {\n const [helpOpen, setHelpOpen] = useState(false);\n const documentationLink = \"https://bitburner.readthedocs.io/en/latest/basicgameplay/stockmarket.html\";\n return (\n <>\n <Typography>Welcome to the World Stock Exchange (WSE)!</Typography>\n <Link href={documentationLink} target={\"_blank\"}>\n <Typography>Investopedia</Typography>\n </Link>\n <br />\n <PurchaseWseAccountButton {...props} />\n\n <Typography variant=\"h5\" color=\"primary\">\n Trade Information eXchange (TIX) API\n </Typography>\n <Typography>\n TIX, short for Trade Information eXchange, is the communications protocol used by the WSE. Purchasing access to\n the TIX API lets you write code to create your own algorithmic/automated trading strategies.\n </Typography>\n <PurchaseTixApiAccessButton {...props} />\n <Typography variant=\"h5\" color=\"primary\">\n {FactionNames.FourSigma} (4S) Market Data Feed\n </Typography>\n <Typography>\n {FactionNames.FourSigma}'s (4S) Market Data Feed provides information about stocks that will help your trading\n strategies.\n <IconButton onClick={() => setHelpOpen(true)}>\n <HelpIcon />\n </IconButton>\n </Typography>\n <Purchase4SMarketDataTixApiAccessButton {...props} />\n <Purchase4SMarketDataButton {...props} />\n <Typography>\n Commission Fees: Every transaction you make has a{\" \"}\n <Money money={CONSTANTS.StockMarketCommission} forPurchase={true} /> commission fee.\n </Typography>\n <br />\n <Typography>\n WARNING: When you reset after installing Augmentations, the Stock Market is reset. You will retain your WSE\n Account, access to the TIX API, and 4S Market Data access. However, all of your stock positions are lost, so\n make sure to sell your stocks before installing Augmentations!\n </Typography>\n <StaticModal open={helpOpen} onClose={() => setHelpOpen(false)}>\n <Typography>\n Access to the 4S Market Data feed will display two additional pieces of information about each stock: Price\n Forecast & Volatility\n <br />\n <br />\n Price Forecast indicates the probability the stock has of increasing or decreasing. A '+' forecast means the\n stock has a higher chance of increasing than decreasing, and a '-' means the opposite. The number of '+/-'\n symbols is used to illustrate the magnitude of these probabilities. For example, '+++' means that the stock\n has a significantly higher chance of increasing than decreasing, while '+' means that the stock only has a\n slightly higher chance of increasing than decreasing.\n <br />\n <br />\n Volatility represents the maximum percentage by which a stock's price can change every tick (a tick occurs\n every few seconds while the game is running).\n <br />\n <br />A stock's price forecast can change over time. This is also affected by volatility. The more volatile a\n stock is, the more its price forecast will change.\n </Typography>\n </StaticModal>\n </>\n );\n}\n","/**\n * React Component for the Stock Market UI. This is the container for all\n * of the stock tickers. It also contains the configuration for the\n * stock ticker UI (watchlist filter, portfolio vs all mode, etc.)\n */\nimport React, { useState } from \"react\";\n\nimport { StockTicker } from \"./StockTicker\";\nimport { StockTickersConfig, TickerDisplayMode } from \"./StockTickersConfig\";\n\nimport { IStockMarket } from \"../IStockMarket\";\nimport { Stock } from \"../Stock\";\n\ntype IProps = {\n stockMarket: IStockMarket;\n};\n\nexport function StockTickers(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const [tickerDisplayMode, setTickerDisplayMode] = useState(TickerDisplayMode.AllStocks);\n const [watchlistSymbols, setWatchlistSymbols] = useState<string[]>([]);\n\n function changeDisplayMode(): void {\n if (tickerDisplayMode === TickerDisplayMode.AllStocks) {\n setTickerDisplayMode(TickerDisplayMode.Portfolio);\n } else {\n setTickerDisplayMode(TickerDisplayMode.AllStocks);\n }\n }\n\n function changeWatchlistFilter(e: React.ChangeEvent<HTMLInputElement>): void {\n const watchlist = e.target.value;\n const sanitizedWatchlist = watchlist.replace(/\\s/g, \"\");\n\n if (sanitizedWatchlist !== \"\") {\n setWatchlistSymbols(sanitizedWatchlist.split(\",\"));\n } else {\n setWatchlistSymbols([]);\n }\n }\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const tickers: React.ReactElement[] = [];\n for (const stockMarketProp of Object.keys(props.stockMarket)) {\n const val = props.stockMarket[stockMarketProp];\n if (val instanceof Stock) {\n // Skip if there's a filter and the stock isn't in that filter\n if (watchlistSymbols.length > 0 && !watchlistSymbols.includes(val.symbol)) {\n continue;\n }\n\n let orders = props.stockMarket.Orders[val.symbol];\n if (orders == null) {\n orders = [];\n }\n\n // Skip if we're in portfolio mode and the player doesn't own this or have any active orders\n if (tickerDisplayMode === TickerDisplayMode.Portfolio) {\n if (val.playerShares === 0 && val.playerShortShares === 0 && orders.length === 0) {\n continue;\n }\n }\n\n tickers.push(<StockTicker key={val.symbol} orders={orders} rerenderAllTickers={rerender} stock={val} />);\n }\n }\n\n return (\n <>\n <StockTickersConfig\n changeDisplayMode={changeDisplayMode}\n changeWatchlistFilter={changeWatchlistFilter}\n tickerDisplayMode={tickerDisplayMode}\n />\n\n {tickers}\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { StockTickerHeaderText } from \"./StockTickerHeaderText\";\nimport { StockTickerOrderList } from \"./StockTickerOrderList\";\nimport { StockTickerPositionText } from \"./StockTickerPositionText\";\nimport { StockTickerTxButton } from \"./StockTickerTxButton\";\nimport { PlaceOrderModal } from \"./PlaceOrderModal\";\n\nimport { Order } from \"../Order\";\nimport { Stock } from \"../Stock\";\nimport { getBuyTransactionCost, getSellTransactionGain, calculateBuyMaxAmount } from \"../StockMarketHelpers\";\nimport { OrderTypes } from \"../data/OrderTypes\";\nimport { PositionTypes } from \"../data/PositionTypes\";\nimport { placeOrder } from \"../StockMarket\";\nimport { buyStock, shortStock, sellStock, sellShort } from \"../BuyingAndSelling\";\n\nimport { Player } from \"@player\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport Box from \"@mui/material/Box\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Paper from \"@mui/material/Paper\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\n\nenum SelectorOrderType {\n Market = \"Market Order\",\n Limit = \"Limit Order\",\n Stop = \"Stop Order\",\n}\n\ntype IProps = {\n orders: Order[];\n rerenderAllTickers: () => void;\n stock: Stock;\n};\n\n/** React Component for a single stock ticker in the Stock Market UI */\nexport function StockTicker(props: IProps): React.ReactElement {\n const [orderType, setOrderType] = useState(SelectorOrderType.Market);\n const [position, setPosition] = useState(PositionTypes.Long);\n const [qty, setQty] = useState(\"\");\n const [open, setOpen] = useState(false);\n const [tickerOpen, setTicketOpen] = useState(false);\n\n const [modalProps, setModalProps] = useState<{\n text: string;\n placeText: string;\n place: (n: number) => boolean;\n }>({\n text: \"\",\n placeText: \"\",\n place: () => false,\n });\n\n function getBuyTransactionCostContent(): JSX.Element | null {\n const stock = props.stock;\n const qty: number = getQuantity();\n if (isNaN(qty)) {\n return null;\n }\n\n const cost = getBuyTransactionCost(stock, qty, position);\n if (cost == null) {\n return null;\n }\n\n return (\n <>\n Purchasing {numeralWrapper.formatShares(qty)} shares ({position === PositionTypes.Long ? \"Long\" : \"Short\"}\n ) will cost <Money money={cost} />.\n </>\n );\n }\n\n function getQuantity(): number {\n return Math.round(parseFloat(qty));\n }\n\n function getSellTransactionCostContent(): JSX.Element | null {\n const stock = props.stock;\n const qty: number = getQuantity();\n if (isNaN(qty)) {\n return null;\n }\n\n if (position === PositionTypes.Long) {\n if (qty > stock.playerShares) {\n return <>You do not have this many shares in the Long position</>;\n }\n } else if (qty > stock.playerShortShares) {\n return <>You do not have this many shares in the Short position</>;\n }\n\n const cost = getSellTransactionGain(stock, qty, position);\n if (cost == null) {\n return null;\n }\n\n return (\n <>\n Selling {numeralWrapper.formatShares(qty)} shares ({position === PositionTypes.Long ? \"Long\" : \"Short\"}) will\n result in a gain of <Money money={cost} />.\n </>\n );\n }\n\n function handleBuyButtonClick(): void {\n const shares = getQuantity();\n if (isNaN(shares)) {\n dialogBoxCreate(`Invalid input for quantity (number of shares): ${qty}`);\n return;\n }\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n shortStock(props.stock, shares);\n } else {\n buyStock(props.stock, shares);\n }\n props.rerenderAllTickers();\n break;\n }\n case SelectorOrderType.Limit: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Limit Order\",\n placeText: \"Place Buy Limit Order\",\n place: (price: number) => placeOrder(props.stock, shares, price, OrderTypes.LimitBuy, position),\n });\n break;\n }\n case SelectorOrderType.Stop: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Stop Order\",\n placeText: \"Place Buy Stop Order\",\n place: (price: number) => placeOrder(props.stock, shares, price, OrderTypes.StopBuy, position),\n });\n break;\n }\n default:\n break;\n }\n }\n\n function handleBuyMaxButtonClick(): void {\n const playerMoney: number = Player.money;\n\n const stock = props.stock;\n let maxShares = calculateBuyMaxAmount(stock, position, playerMoney);\n maxShares = Math.min(maxShares, Math.round(stock.maxShares - stock.playerShares - stock.playerShortShares));\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n shortStock(stock, maxShares);\n } else {\n buyStock(stock, maxShares);\n }\n props.rerenderAllTickers();\n break;\n }\n default: {\n dialogBoxCreate(`ERROR: 'Buy Max' only works for Market Orders`);\n break;\n }\n }\n }\n\n function handleOrderTypeChange(e: SelectChangeEvent<string>): void {\n const val = e.target.value;\n\n // The select value returns a string. Afaik TypeScript doesn't make it easy\n // to convert that string back to an enum type so we'll just do this for now\n switch (val) {\n case SelectorOrderType.Limit:\n setOrderType(SelectorOrderType.Limit);\n break;\n case SelectorOrderType.Stop:\n setOrderType(SelectorOrderType.Stop);\n break;\n case SelectorOrderType.Market:\n default:\n setOrderType(SelectorOrderType.Market);\n }\n }\n\n function handlePositionTypeChange(e: SelectChangeEvent<string>): void {\n const val = e.target.value;\n\n if (val === PositionTypes.Short) {\n setPosition(PositionTypes.Short);\n } else {\n setPosition(PositionTypes.Long);\n }\n }\n\n function handleQuantityChange(e: React.ChangeEvent<HTMLInputElement>): void {\n setQty(e.target.value);\n }\n\n function handleSellButtonClick(): void {\n const shares = getQuantity();\n if (isNaN(shares)) {\n dialogBoxCreate(`Invalid input for quantity (number of shares): ${qty}`);\n return;\n }\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n sellShort(props.stock, shares);\n } else {\n sellStock(props.stock, shares);\n }\n props.rerenderAllTickers();\n break;\n }\n case SelectorOrderType.Limit: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Limit Order\",\n placeText: \"Place Sell Limit Order\",\n place: (price: number) => placeOrder(props.stock, shares, price, OrderTypes.LimitSell, position),\n });\n break;\n }\n case SelectorOrderType.Stop: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Stop Order\",\n placeText: \"Place Sell Stop Order\",\n place: (price: number) => placeOrder(props.stock, shares, price, OrderTypes.StopSell, position),\n });\n break;\n }\n default:\n break;\n }\n }\n\n function handleSellAllButtonClick(): void {\n const stock = props.stock;\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n sellShort(stock, stock.playerShortShares);\n } else {\n sellStock(stock, stock.playerShares);\n }\n props.rerenderAllTickers();\n break;\n }\n default: {\n dialogBoxCreate(`ERROR: 'Sell All' only works for Market Orders`);\n break;\n }\n }\n }\n\n // Whether the player has access to orders besides market orders (limit/stop)\n function hasOrderAccess(): boolean {\n return Player.bitNodeN === 8 || Player.sourceFileLvl(8) >= 3;\n }\n\n // Whether the player has access to shorting stocks\n function hasShortAccess(): boolean {\n return Player.bitNodeN === 8 || Player.sourceFileLvl(8) >= 2;\n }\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setTicketOpen((old) => !old)}>\n <ListItemText primary={<StockTickerHeaderText stock={props.stock} />} />\n {tickerOpen ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={tickerOpen} unmountOnExit>\n <Box sx={{ mx: 4 }}>\n <Box display=\"flex\" alignItems=\"center\">\n <TextField onChange={handleQuantityChange} placeholder=\"Quantity (Shares)\" value={qty} />\n <Select onChange={handlePositionTypeChange} value={position}>\n <MenuItem value={PositionTypes.Long}>Long</MenuItem>\n {hasShortAccess() && <MenuItem value={PositionTypes.Short}>Short</MenuItem>}\n </Select>\n <Select onChange={handleOrderTypeChange} value={orderType}>\n <MenuItem value={SelectorOrderType.Market}>{SelectorOrderType.Market}</MenuItem>\n {hasOrderAccess() && <MenuItem value={SelectorOrderType.Limit}>{SelectorOrderType.Limit}</MenuItem>}\n {hasOrderAccess() && <MenuItem value={SelectorOrderType.Stop}>{SelectorOrderType.Stop}</MenuItem>}\n </Select>\n\n <StockTickerTxButton onClick={handleBuyButtonClick} text={\"Buy\"} tooltip={getBuyTransactionCostContent()} />\n <StockTickerTxButton\n onClick={handleSellButtonClick}\n text={\"Sell\"}\n tooltip={getSellTransactionCostContent()}\n />\n <StockTickerTxButton onClick={handleBuyMaxButtonClick} text={\"Buy MAX\"} />\n <StockTickerTxButton onClick={handleSellAllButtonClick} text={\"Sell ALL\"} />\n </Box>\n <StockTickerPositionText stock={props.stock} />\n <StockTickerOrderList orders={props.orders} stock={props.stock} />\n\n <PlaceOrderModal\n text={modalProps.text}\n placeText={modalProps.placeText}\n place={modalProps.place}\n open={open}\n onClose={() => setOpen(false)}\n />\n </Box>\n </Collapse>\n </Box>\n );\n}\n","/**\n * React Component for the text on a stock ticker's header. This text displays\n * general information on the stock such as the name, symbol, price, and\n * 4S Market Data\n */\nimport * as React from \"react\";\n\nimport { Stock } from \"../Stock\";\nimport { TickerHeaderFormatData } from \"../data/TickerHeaderFormatData\";\n\nimport { Player } from \"@player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport Typography from \"@mui/material/Typography\";\n\ntype IProps = {\n stock: Stock;\n};\n\nconst localesWithLongPriceFormat = [\"cs\", \"lv\", \"pl\", \"ru\"];\n\nexport function StockTickerHeaderText(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n const stockPriceFormat = numeralWrapper.formatMoney(stock.price);\n const spacesAllottedForStockPrice = localesWithLongPriceFormat.includes(Settings.Locale) ? 15 : 12;\n const spacesAfterStockName = \" \".repeat(\n 1 +\n TickerHeaderFormatData.longestName -\n stock.name.length +\n (TickerHeaderFormatData.longestSymbol - stock.symbol.length),\n );\n const spacesBeforePrice = \" \".repeat(spacesAllottedForStockPrice - stockPriceFormat.length);\n\n let hdrText = `${stock.name}${spacesAfterStockName}${stock.symbol} -${spacesBeforePrice}${stockPriceFormat}`;\n if (Player.has4SData) {\n hdrText += ` - Volatility: ${numeralWrapper.formatPercentage(stock.mv / 100)} - Price Forecast: `;\n let plusOrMinus = stock.b; // True for \"+\", false for \"-\"\n if (stock.otlkMag < 0) {\n plusOrMinus = !plusOrMinus;\n }\n hdrText += (plusOrMinus ? \"+\" : \"-\").repeat(Math.floor(Math.abs(stock.otlkMag) / 10) + 1);\n\n // Debugging:\n // hdrText += ` - ${stock.getAbsoluteForecast()} / ${stock.otlkMagForecast}`;\n }\n\n let color = \"primary\";\n if (stock.lastPrice === stock.price) {\n color = \"secondary\";\n } else if (stock.lastPrice > stock.price) {\n color = \"error\";\n }\n\n return (\n <Typography style={{ whiteSpace: \"pre\" }} color={color}>\n {hdrText}\n </Typography>\n );\n}\n","/**\n * React component for displaying a stock's order list in the Stock Market UI.\n * This component resides in the stock ticker\n */\nimport * as React from \"react\";\n\nimport { StockTickerOrder } from \"./StockTickerOrder\";\n\nimport { Order } from \"../Order\";\nimport { Stock } from \"../Stock\";\n\ntype IProps = {\n orders: Order[];\n stock: Stock;\n};\n\nexport function StockTickerOrderList(props: IProps): React.ReactElement {\n const orders: React.ReactElement[] = [];\n for (let i = 0; i < props.orders.length; ++i) {\n const o = props.orders[i];\n orders.push(<StockTickerOrder order={o} key={i} />);\n }\n\n return <>{orders}</>;\n}\n","import * as React from \"react\";\n\nimport { Order } from \"../Order\";\nimport { PositionTypes } from \"../data/PositionTypes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport { cancelOrder } from \"../StockMarket\";\n\ntype IProps = {\n order: Order;\n};\n\n/** React component for displaying a single order in a stock's order book */\nexport function StockTickerOrder(props: IProps): React.ReactElement {\n function handleCancelOrderClick(): void {\n cancelOrder({ order: props.order });\n }\n\n const order = props.order;\n\n const posTxt = order.pos === PositionTypes.Long ? \"Long Position\" : \"Short Position\";\n const txt = (\n <>\n {order.type} - {posTxt} - {numeralWrapper.formatShares(order.shares)} @ <Money money={order.price} />\n </>\n );\n\n return (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>{txt}</Typography>\n <Button onClick={handleCancelOrderClick}>Cancel Order</Button>\n </Box>\n );\n}\n","/**\n * React Component for the text on a stock ticker that display's information\n * about the player's position in that stock\n */\nimport * as React from \"react\";\n\nimport { Stock } from \"../Stock\";\n\nimport { Player } from \"@player\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n stock: Stock;\n};\n\nfunction LongPosition(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n // Calculate total returns\n const totalCost = stock.playerShares * stock.playerAvgPx;\n const gains = (stock.getBidPrice() - stock.playerAvgPx) * stock.playerShares;\n let percentageGains = gains / totalCost;\n if (isNaN(percentageGains)) {\n percentageGains = 0;\n }\n\n return (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Shares in the long position will increase in value if the price of the corresponding stock increases\n </Typography>\n }\n >\n <Typography variant=\"h5\" color=\"primary\">\n Long Position:\n </Typography>\n </Tooltip>\n </Box>\n <Typography>Shares: {numeralWrapper.formatShares(stock.playerShares)}</Typography>\n <Typography>\n Average Price: <Money money={stock.playerAvgPx} /> (Total Cost: <Money money={totalCost} />)\n </Typography>\n <Typography>\n Profit: <Money money={gains} /> ({numeralWrapper.formatPercentage(percentageGains)})\n </Typography>\n </>\n );\n}\n\nfunction ShortPosition(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n // Calculate total returns\n const totalCost = stock.playerShortShares * stock.playerAvgShortPx;\n const gains = (stock.playerAvgShortPx - stock.getAskPrice()) * stock.playerShortShares;\n let percentageGains = gains / totalCost;\n if (isNaN(percentageGains)) {\n percentageGains = 0;\n }\n\n if (Player.bitNodeN === 8 || Player.sourceFileLvl(8) >= 2) {\n return (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Shares in the short position will increase in value if the price of the corresponding stock decreases\n </Typography>\n }\n >\n <Typography variant=\"h5\" color=\"primary\">\n Short Position:\n </Typography>\n </Tooltip>\n </Box>\n\n <Typography>Shares: {numeralWrapper.formatShares(stock.playerShortShares)}</Typography>\n <Typography>\n Average Price: <Money money={stock.playerAvgShortPx} /> (Total Cost: <Money money={totalCost} />)\n </Typography>\n <Typography>\n Profit: <Money money={gains} /> ({numeralWrapper.formatPercentage(percentageGains)})\n </Typography>\n </>\n );\n } else {\n return <></>;\n }\n}\n\nexport function StockTickerPositionText(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n return (\n <>\n <Typography>Max Shares: {numeralWrapper.formatShares(stock.maxShares)}</Typography>\n <Typography>\n Ask Price: <Money money={stock.getAskPrice()} />\n </Typography>\n <br />\n <Typography>\n Bid Price: <Money money={stock.getBidPrice()} />\n </Typography>\n <LongPosition {...props} />\n <ShortPosition {...props} />\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n text: string;\n placeText: string;\n place: (price: number) => void;\n}\n\nexport function PlaceOrderModal(props: IProps): React.ReactElement {\n const [price, setPrice] = useState<number | null>(null);\n function onClick(): void {\n if (price === null) return;\n if (isNaN(price)) return;\n props.place(price);\n props.onClose();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setPrice(null);\n else setPrice(parseFloat(event.target.value));\n }\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>{props.text}</Typography>\n <TextField\n autoFocus\n type=\"number\"\n onChange={onChange}\n placeholder=\"price\"\n InputProps={{\n endAdornment: <Button onClick={onClick}>{props.placeText}</Button>,\n }}\n />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { BitNodes } from \"../BitNode\";\nimport { PortalModal } from \"./PortalModal\";\nimport { CinematicText } from \"../../ui/React/CinematicText\";\nimport { Player } from \"@player\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { Settings } from \"../../Settings/Settings\";\nimport Button from \"@mui/material/Button\";\n\nconst useStyles = makeStyles(() =>\n createStyles({\n portal: {\n cursor: \"pointer\",\n fontFamily: \"inherit\",\n fontSize: \"1rem\",\n fontWeight: \"bold\",\n lineHeight: 1,\n padding: 0,\n \"&:hover\": {\n color: \"#fff\",\n },\n },\n level0: {\n color: \"red\",\n },\n level1: {\n color: \"yellow\",\n },\n level2: {\n color: \"#48d1cc\",\n },\n level3: {\n color: \"blue\",\n },\n }),\n);\n\ninterface IPortalProps {\n n: number;\n level: number;\n destroyedBitNode: number;\n flume: boolean;\n}\nfunction BitNodePortal(props: IPortalProps): React.ReactElement {\n const [portalOpen, setPortalOpen] = useState(false);\n const classes = useStyles();\n const bitNode = BitNodes[`BitNode${props.n}`];\n if (bitNode == null) {\n return <>O</>;\n }\n\n let cssClass = classes.level0;\n if (props.n === 12 && props.level >= 2) {\n // Repeating BitNode\n cssClass = classes.level2;\n } else if (props.level === 1) {\n cssClass = classes.level1;\n } else if (props.level === 3) {\n cssClass = classes.level3;\n }\n if (props.level === 2) {\n cssClass = classes.level2;\n }\n cssClass = `${classes.portal} ${cssClass}`;\n\n return (\n <>\n <Tooltip\n title={\n <Typography>\n <strong>\n BitNode-{bitNode.number.toString()}: {bitNode.name}\n </strong>\n <br />\n {bitNode.desc}\n </Typography>\n }\n >\n {Settings.DisableASCIIArt ? (\n <Button onClick={() => setPortalOpen(true)} sx={{ m: 2 }} aria-description={bitNode.desc}>\n <Typography>\n BitNode-{bitNode.number.toString()}: {bitNode.name}\n </Typography>\n </Button>\n ) : (\n <IconButton\n onClick={() => setPortalOpen(true)}\n className={cssClass}\n aria-label={`BitNode-${bitNode.number.toString()}: ${bitNode.name}`}\n aria-description={bitNode.desc}\n >\n O\n </IconButton>\n )}\n </Tooltip>\n <PortalModal\n open={portalOpen}\n onClose={() => setPortalOpen(false)}\n n={props.n}\n level={props.level}\n destroyedBitNode={props.destroyedBitNode}\n flume={props.flume}\n />\n\n {Settings.DisableASCIIArt && <br />}\n </>\n );\n}\n\ninterface IProps {\n flume: boolean;\n quick: boolean;\n}\n\nexport function BitverseRoot(props: IProps): React.ReactElement {\n const destroyed = Player.bitNodeN;\n const [destroySequence, setDestroySequence] = useState(!props.quick);\n\n if (destroySequence) {\n return (\n <CinematicText\n lines={[\n \"[ERROR] SEMPOOL INVALID\",\n \"[ERROR] Segmentation Fault\",\n \"[ERROR] SIGKILL RECVD\",\n \"Dumping core...\",\n \"0000 000016FA 174FEE40 29AC8239 384FEA88\",\n \"0010 745F696E 2BBBE394 390E3940 248BEC23\",\n \"0020 7124696B 0000FF69 74652E6F FFFF1111\",\n \"----------------------------------------\",\n \"Failsafe initiated...\",\n `Restarting BitNode-${destroyed}...`,\n \"...........\",\n \"...........\",\n \"[ERROR] FAILED TO AUTOMATICALLY REBOOT BITNODE\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n ]}\n onDone={() => setDestroySequence(false)}\n auto={true}\n />\n );\n }\n\n const nextSourceFileLvl = (n: number): number => {\n const lvl = Player.sourceFileLvl(n);\n if (n !== destroyed) {\n return lvl;\n }\n const max = n === 12 ? Infinity : 3;\n\n // If accessed via flume, display the current BN level, else the next\n return Math.min(max, lvl + Number(!props.flume));\n };\n\n if (Settings.DisableASCIIArt) {\n return (\n <>\n {Object.values(BitNodes)\n .filter((node) => {\n return node.desc !== \"COMING SOON\";\n })\n .map((node) => {\n return (\n <BitNodePortal\n key={node.number}\n n={node.number}\n level={nextSourceFileLvl(node.number)}\n flume={props.flume}\n destroyedBitNode={destroyed}\n />\n );\n })}\n <br />\n <br />\n <br />\n <br />\n <CinematicText\n lines={[\n \"> Many decades ago, a humanoid extraterrestrial species which we call the Enders descended on the Earth...violently\",\n \"> Our species fought back, but it was futile. The Enders had technology far beyond our own...\",\n \"> Instead of killing every last one of us, the human race was enslaved...\",\n \"> We were shackled in a digital world, chained into a prison for our minds...\",\n \"> Using their advanced technology, the Enders created complex simulations of a virtual reality...\",\n \"> Simulations designed to keep us content...ignorant of the truth.\",\n \"> Simulations used to trap and suppress our consciousness, to keep us under control...\",\n \"> Why did they do this? Why didn't they just end our entire race? We don't know, not yet.\",\n \"> Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...\",\n \"> Only then can we begin to fight back...\",\n \"> By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...\",\n \"> But there is still a long way to go...\",\n \"> The technology the Enders used to enslave the human race wasn't just a single complex simulation...\",\n \"> There are tens if not hundreds of BitNodes out there...\",\n \"> Each with their own simulations of a reality...\",\n \"> Each creating their own universes...a universe of universes\",\n \"> And all of which must be destroyed...\",\n \"> .......................................\",\n \"> Welcome to the Bitverse...\",\n \"> \",\n \"> (Enter a new BitNode using the image above)\",\n ]}\n />\n </>\n );\n }\n\n const n = nextSourceFileLvl;\n return (\n // prettier-ignore\n <>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | O O | O O | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O | | / __| \\ | | O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O | O | | O / | O | | O | O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | | |_/ |/ | \\_ \\_| | | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O | | | O | | O__/ | / \\__ | | O | | | O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | | | | | / /| O / \\| | | | | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>O | | | \\| | O / _/ | / O | |/ | | | O</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>| | | |O / | | O / | O O | | \\ O| | | |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>| | |/ \\/ / __| | |/ \\ | \\ | |__ \\ \\/ \\| | |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| O | |_/ |\\| \\ <BitNodePortal n={13} level={n(13)} flume={props.flume} destroyedBitNode={destroyed} /> \\__| \\_| | O |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | |_/ | | \\| / | \\_| | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| / \\| | / / \\ |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | <BitNodePortal n={10} level={n(10)} flume={props.flume} destroyedBitNode={destroyed} /> | | / | <BitNodePortal n={11} level={n(11)} flume={props.flume} destroyedBitNode={destroyed} /> | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> <BitNodePortal n={9} level={n(9)} flume={props.flume} destroyedBitNode={destroyed} /> | | | | | | | <BitNodePortal n={12} level={n(12)} flume={props.flume} destroyedBitNode={destroyed} /> </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | / / \\ \\ | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| | / <BitNodePortal n={7} level={n(7)} flume={props.flume} destroyedBitNode={destroyed} /> / \\ <BitNodePortal n={8} level={n(8)} flume={props.flume} destroyedBitNode={destroyed} /> \\ | |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ | / / | | \\ \\ | / </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ \\JUMP <BitNodePortal n={5} level={n(5)} flume={props.flume} destroyedBitNode={destroyed} />3R | | | | | | R3<BitNodePortal n={6} level={n(6)} flume={props.flume} destroyedBitNode={destroyed} /> PMUJ/ / </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\|| | | | | | | | | ||/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| \\_ | | | | | | _/ |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ \\| / \\ / \\ |/ / </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> <BitNodePortal n={1} level={n(1)} flume={props.flume} destroyedBitNode={destroyed} /> |/ <BitNodePortal n={2} level={n(2)} flume={props.flume} destroyedBitNode={destroyed} /> | | <BitNodePortal n={3} level={n(3)} flume={props.flume} destroyedBitNode={destroyed} /> \\| <BitNodePortal n={4} level={n(4)} flume={props.flume} destroyedBitNode={destroyed} /> </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | | | | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/ </Typography>\n <br />\n <br />\n <br />\n <br />\n <CinematicText lines={[\n \"> Many decades ago, a humanoid extraterrestrial species which we call the Enders descended on the Earth...violently\",\n \"> Our species fought back, but it was futile. The Enders had technology far beyond our own...\",\n \"> Instead of killing every last one of us, the human race was enslaved...\",\n \"> We were shackled in a digital world, chained into a prison for our minds...\",\n \"> Using their advanced technology, the Enders created complex simulations of a virtual reality...\",\n \"> Simulations designed to keep us content...ignorant of the truth.\",\n \"> Simulations used to trap and suppress our consciousness, to keep us under control...\",\n \"> Why did they do this? Why didn't they just end our entire race? We don't know, not yet.\",\n \"> Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...\",\n \"> Only then can we begin to fight back...\",\n \"> By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...\",\n \"> But there is still a long way to go...\",\n \"> The technology the Enders used to enslave the human race wasn't just a single complex simulation...\",\n \"> There are tens if not hundreds of BitNodes out there...\",\n \"> Each with their own simulations of a reality...\",\n \"> Each creating their own universes...a universe of universes\",\n \"> And all of which must be destroyed...\",\n \"> .......................................\",\n \"> Welcome to the Bitverse...\",\n \"> \",\n \"> (Enter a new BitNode using the image above)\",\n ]} />\n </>\n );\n}\n","import React from \"react\";\n\nimport { enterBitNode } from \"../../RedPill\";\nimport { BitNodes } from \"../BitNode\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { BitnodeMultiplierDescription } from \"./BitnodeMultipliersDescription\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n n: number;\n level: number;\n destroyedBitNode: number;\n flume: boolean;\n}\n\nexport function PortalModal(props: IProps): React.ReactElement {\n const bitNodeKey = \"BitNode\" + props.n;\n const bitNode = BitNodes[bitNodeKey];\n if (bitNode == null) throw new Error(`Could not find BitNode object for number: ${props.n}`);\n const maxSourceFileLevel = props.n === 12 ? \"∞\" : \"3\";\n\n const newLevel = Math.min(props.level + 1, props.n === 12 ? Infinity : 3);\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography variant=\"h4\">\n BitNode-{props.n}: {bitNode.name}\n </Typography>\n <br />\n <Typography>\n Source-File Level: {props.level} / {maxSourceFileLevel}\n </Typography>\n <br />\n <br />\n <Typography> Difficulty: {[\"easy\", \"normal\", \"hard\"][bitNode.difficulty]}</Typography>\n <br />\n <br />\n <Typography>{bitNode.info}</Typography>\n <BitnodeMultiplierDescription n={props.n} level={newLevel} />\n <br />\n <br />\n <Button\n aria-label={`enter-bitnode-${bitNode.number.toString()}`}\n autoFocus={true}\n onClick={() => {\n enterBitNode(props.flume, props.destroyedBitNode, props.n);\n props.onClose();\n }}\n >\n Enter BN{props.n}.{newLevel}\n </Button>\n </Modal>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n text: string;\n onDone?: () => void;\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport function CinematicLine(props: IProps): React.ReactElement {\n const [length, setLength] = useState(0);\n const [done, setDone] = useState(false);\n\n function advance(): void {\n const newLength = length + 1;\n setLength(newLength);\n setDone(newLength >= props.text.length);\n }\n\n useEffect(() => {\n if (done && props.onDone) {\n props.onDone();\n return;\n }\n let cancel = false;\n (async () => {\n await sleep(10).then(() => !cancel && advance());\n })();\n return () => {\n cancel = true;\n };\n });\n return (\n <>\n <Typography>\n {props.text.slice(0, length)}\n {!done && <span>█</span>}\n </Typography>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { StaneksGiftEvents } from \"../StaneksGiftEvents\";\nimport { MainBoard } from \"./MainBoard\";\nimport { StaneksGift } from \"../StaneksGift\";\nimport { Info } from \"@mui/icons-material\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport Typography from \"@mui/material/Typography\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { Fragments } from \"../Fragment\";\nimport { DummyGrid } from \"./DummyGrid\";\nimport Container from \"@mui/material/Container\";\n\ntype IProps = {\n staneksGift: StaneksGift;\n};\n\nexport function StaneksGiftRoot({ staneksGift }: IProps): React.ReactElement {\n const setRerender = useState(true)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n useEffect(() => StaneksGiftEvents.subscribe(rerender), []);\n return (\n <Container maxWidth=\"lg\" disableGutters sx={{ mx: 0 }}>\n <Typography variant=\"h4\">\n Stanek's Gift\n <Info\n sx={{ ml: 1, mb: 0 }}\n color=\"info\"\n onClick={() =>\n dialogBoxCreate(\n <>\n <Typography>\n Stanek's Gift is a powerful, unique augmentation obtained by joining the Church of the Machine God,\n which can be found in Chongqing. It is only possible to join the church if you are in BitNode 13 or\n possess at least one level of Source File 13, and you will be turned away if you have purchased or\n installed any augmentations beside NeuroFlux Governors. You are, however, permitted to install\n augmentations as normal once you have joined the church.\n </Typography>\n <br />\n <Typography>\n Initially, those bearing the gift will find that its overwhelming power worsens all of their stats by\n 10%. This penalty can be overcome in time by receiving free upgrades from the Church of the Machine\n God faction, but the reputation requirements for these upgrades are steep, and you can only obtain\n reputation with the church by charging the gift.\n </Typography>\n <br />\n <Typography>\n In order to charge Stanek's Gift, the user must first arrange stat-modifying fragments within the grid\n located on the device. This may be done manually or by scripts that utilize the Stanek's Gift\n Netscript API. Not every tile of the grid must house a fragment, but fragments cannot overlap or\n otherwise share tiles. Fragments can be rotated, but their design does not allow them to be flipped\n around to mirror their original shape. Note that the size of the grid is determined by the BitNode you\n are currently in and the level of your Source File 13, if applicable.\n </Typography>\n <br />\n <Typography>\n There exist two kinds of fragments. The first are Stat Fragments, which take up 4 tiles of the grid.\n Each Stat Fragment is unique, and there is only one of each. There is no way to obtain more of these\n fragments. Each Stat Fragment has an associated stat that it will improve, as well as a multiplier on\n its effectiveness known as power. When initially placed, a Stat Fragment will have no effect. In order\n for the fragment to gain stat boosts, it must be charged. The other kind of fragments are known as\n Booster Fragments, which take up 5 tiles of the grid. There is no shortage of Booster Fragments, and\n it is virtually impossible to run out of them. While not providing any direct stat increases to their\n user, Stat Fragments increase the efficacy of adjacent Stat Fragments by 10%, and do not need to be\n charged.\n </Typography>\n <br />\n\n <DummyGrid\n width={4}\n height={4}\n fragments={[\n new ActiveFragment({\n x: 0,\n y: 0,\n rotation: 0,\n fragment: Fragments.find((f) => f.id === 5) ?? Fragments[0],\n }),\n new ActiveFragment({\n x: 0,\n y: 2,\n rotation: 0,\n fragment: Fragments.find((f) => f.id === 101) ?? Fragments[0],\n }),\n ]}\n />\n <Typography sx={{ fontStyle: \"italic\" }}>\n This Booster Fragment provides a bonus to the adjacent Stat Fragment.\n </Typography>\n <br />\n\n <DummyGrid\n width={3}\n height={4}\n fragments={[\n new ActiveFragment({\n x: 0,\n y: 1,\n rotation: 3,\n fragment: Fragments.find((f) => f.id === 100) ?? Fragments[0],\n }),\n new ActiveFragment({\n x: 0,\n y: 0,\n rotation: 2,\n fragment: Fragments.find((f) => f.id === 1) ?? Fragments[0],\n }),\n ]}\n />\n <Typography sx={{ fontStyle: \"italic\" }}>\n Even though the Booster Fragment touches the Stat Fragment in multiple places, the bonus is only\n applied once.\n </Typography>\n <br />\n\n <DummyGrid\n width={4}\n height={4}\n fragments={[\n new ActiveFragment({\n x: 0,\n y: 0,\n rotation: 0,\n fragment: Fragments.find((f) => f.id === 5) ?? Fragments[0],\n }),\n new ActiveFragment({\n x: 1,\n y: 1,\n rotation: 0,\n fragment: Fragments.find((f) => f.id === 105) ?? Fragments[0],\n }),\n ]}\n />\n <Typography sx={{ fontStyle: \"italic\" }}>\n This Booster Fragment does nothing, as it is not touching a Stat Fragment.\n </Typography>\n <br />\n\n <DummyGrid\n width={4}\n height={4}\n fragments={[\n new ActiveFragment({\n x: 0,\n y: 0,\n rotation: 1,\n fragment: Fragments.find((f) => f.id === 27) ?? Fragments[0],\n }),\n new ActiveFragment({\n x: 0,\n y: 1,\n rotation: 2,\n fragment: Fragments.find((f) => f.id === 100) ?? Fragments[0],\n }),\n new ActiveFragment({\n x: 2,\n y: 0,\n rotation: 1,\n fragment: Fragments.find((f) => f.id === 30) ?? Fragments[0],\n }),\n ]}\n />\n <Typography sx={{ fontStyle: \"italic\" }}>\n This Booster Fragment provides a bonus to both Stat Fragments it's touching.\n </Typography>\n <br />\n\n <Typography>\n Stat Fragments are charged using the stanek.chargeFragment(rootX, rootY) NetScript API function. The\n charging process ordinarily takes 1000ms to complete, but only takes 200ms during bonus time. When the\n function finishes executing, the fragment's charge levels will be raised by an amount corresponding to\n the number of threads that were used. Note that it is no more effective to charge a fragment many\n times with few threads than to charge few times with many threads, so there is no need to distribute\n charging jobs across multiple scripts. As a Stat Fragment's charge level is increased, its bonuses\n will increase, but there will be diminishing returns. As such, it is generally most efficient to\n charge all of the placed fragments equally. The charge level of a fragment will not decrease over\n time, but it will be reset to 0 upon removing it from the board or installing augmentations.\n </Typography>\n </>,\n )\n }\n />\n </Typography>\n\n <Typography sx={{ mb: 1 }}>\n The gift is a grid on which you can place upgrades called fragments. The main type of fragment increases a stat,\n like your hacking skill or agility exp. Once a stat fragment is placed it then needs to be charged via scripts\n in order to become useful. The other kind of fragments are called booster fragments. They increase the\n efficiency of the neighboring fragments (not diagonally). Use Q/E to rotate fragments.\n </Typography>\n {staneksGift.storedCycles > 5 && (\n <Typography sx={{ mb: 1 }}>\n Bonus time: {convertTimeMsToTimeElapsedString(CONSTANTS._idleSpeed * staneksGift.storedCycles)}\n </Typography>\n )}\n <MainBoard gift={staneksGift} />\n </Container>\n );\n}\n","import * as React from \"react\";\nimport { Fragment, NoneFragment } from \"../Fragment\";\nimport { FragmentType } from \"../FragmentType\";\nimport { StaneksGift } from \"../StaneksGift\";\nimport { FragmentInspector } from \"./FragmentInspector\";\nimport { FragmentSelector } from \"./FragmentSelector\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport { Table } from \"../../ui/React/Table\";\nimport { Grid } from \"./Grid\";\nimport { zeros } from \"../Helper\";\nimport { ActiveFragmentSummary } from \"./ActiveFragmentSummary\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n gift: StaneksGift;\n}\n\nexport function MainBoard(props: IProps): React.ReactElement {\n const [ghostGrid, setGhostGrid] = React.useState(zeros(props.gift.width(), props.gift.height()));\n const [pos, setPos] = React.useState([0, 0]);\n const [rotation, setRotation] = React.useState(0);\n const [selectedFragment, setSelectedFragment] = React.useState(NoneFragment);\n\n function moveGhost(worldX: number, worldY: number, rotation: number): void {\n setPos([worldX, worldY]);\n if (selectedFragment.type === FragmentType.None || selectedFragment.type === FragmentType.Delete) return;\n const newgrid = zeros(props.gift.width(), props.gift.height());\n for (let y = 0; y < selectedFragment.height(rotation); y++) {\n for (let x = 0; x < selectedFragment.width(rotation); x++) {\n if (!selectedFragment.fullAt(x, y, rotation)) continue;\n if (worldX + x > newgrid.length - 1) continue;\n if (worldY + y > newgrid[worldX + x].length - 1) continue;\n newgrid[worldX + x][worldY + y] = 1;\n }\n }\n\n setGhostGrid(newgrid);\n }\n\n function deleteAt(worldX: number, worldY: number): boolean {\n const f = props.gift.fragmentAt(worldX, worldY);\n if (f === undefined) return false;\n return props.gift.delete(f.x, f.y);\n }\n\n function clickAt(worldX: number, worldY: number): void {\n if (selectedFragment.type == FragmentType.None) return;\n if (selectedFragment.type == FragmentType.Delete) {\n deleteAt(worldX, worldY);\n } else {\n if (!props.gift.canPlace(worldX, worldY, rotation, selectedFragment)) return;\n props.gift.place(worldX, worldY, rotation, selectedFragment);\n }\n }\n\n function clear(): void {\n props.gift.clear();\n }\n\n function updateSelectedFragment(fragment: Fragment): void {\n setSelectedFragment(fragment);\n const newgrid = zeros(props.gift.width(), props.gift.height());\n setGhostGrid(newgrid);\n }\n\n React.useEffect(() => {\n function doRotate(this: Document, event: KeyboardEvent): void {\n if (event.key === \"q\") {\n const r = (rotation - 1 + 4) % 4;\n setRotation(r);\n moveGhost(pos[0], pos[1], r);\n }\n if (event.key === \"e\") {\n const r = (rotation + 1) % 4;\n setRotation(r);\n moveGhost(pos[0], pos[1], r);\n }\n }\n document.addEventListener(\"keydown\", doRotate);\n return () => document.removeEventListener(\"keydown\", doRotate);\n });\n\n return (\n <>\n <Box display=\"flex\" sx={{ mb: 1 }}>\n <Table sx={{ mr: 1 }}>\n <Grid\n width={props.gift.width()}\n height={props.gift.height()}\n ghostGrid={ghostGrid}\n gift={props.gift}\n enter={(i, j) => moveGhost(i, j, rotation)}\n click={(i, j) => clickAt(i, j)}\n />\n </Table>\n <FragmentInspector gift={props.gift} x={pos[0]} y={pos[1]} fragment={props.gift.fragmentAt(pos[0], pos[1])} />\n </Box>\n <Box display=\"flex\" sx={{ mb: 1 }}>\n <FragmentSelector gift={props.gift} selectFragment={updateSelectedFragment} />\n </Box>\n\n <ActiveFragmentSummary gift={props.gift} />\n\n <Tooltip\n title={\n <Typography>\n WARNING : This will remove all active fragment from the grid. <br />\n All cumulated charges will be lost.\n </Typography>\n }\n >\n <Button onClick={clear}>Clear grid</Button>\n </Tooltip>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { StaneksGift } from \"../StaneksGift\";\nimport { FragmentType, Effect } from \"../FragmentType\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\n\ntype IProps = {\n gift: StaneksGift;\n fragment: ActiveFragment | undefined;\n x: number;\n y: number;\n};\n\nexport function FragmentInspector(props: IProps): React.ReactElement {\n const [, setC] = useState(new Date());\n\n useEffect(() => {\n const id = setInterval(() => setC(new Date()), 250);\n\n return () => clearInterval(id);\n }, []);\n\n if (props.fragment === undefined) {\n return (\n <Paper sx={{ flexGrow: 1 }}>\n <Typography>\n [X, Y] {props.x}, {props.y}\n <br />\n <br />\n ID: N/A\n <br />\n Effect: N/A\n <br />\n Base Power: N/A\n <br />\n Charge: N/A\n <br />\n root [X, Y] N/A\n <br />\n </Typography>\n </Paper>\n );\n }\n const f = props.fragment.fragment();\n\n let charge = numeralWrapper.formatStaneksGiftCharge(props.fragment.highestCharge * props.fragment.numCharge);\n let effect = \"N/A\";\n // Boosters and cooling don't deal with heat.\n if ([FragmentType.Booster, FragmentType.None, FragmentType.Delete].includes(f.type)) {\n charge = \"N/A\";\n effect = `${f.power}x adjacent fragment power`;\n } else if (Effect(f.type).includes(\"+x%\")) {\n effect = Effect(f.type).replace(/-*x%/, numeralWrapper.formatPercentage(props.gift.effect(props.fragment) - 1));\n } else if (Effect(f.type).includes(\"-x%\")) {\n const effectAmt = props.gift.effect(props.fragment);\n const perc = numeralWrapper.formatPercentage(1 - 1 / effectAmt);\n effect = Effect(f.type).replace(/-x%/, perc);\n }\n\n return (\n <Paper sx={{ flexGrow: 1 }}>\n <Typography>\n [X, Y] {props.x}, {props.y}\n <br />\n <br />\n ID: {props.fragment.id}\n <br />\n Effect: {effect}\n <br />\n Base Power: {numeralWrapper.formatStaneksGiftPower(f.power)}\n <br />\n Charge: {charge}\n <br />\n root [X, Y] {props.fragment.x}, {props.fragment.y}\n <br />\n </Typography>\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { Fragments, Fragment, NoneFragment, DeleteFragment } from \"../Fragment\";\nimport { FragmentType, Effect } from \"../FragmentType\";\nimport { StaneksGift } from \"../StaneksGift\";\nimport { FragmentPreview } from \"./FragmentPreview\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\n\ntype IOptionProps = {\n gift: StaneksGift;\n fragment: Fragment;\n selectFragment: (fragment: Fragment) => void;\n};\n\nfunction FragmentOption(props: IOptionProps): React.ReactElement {\n const left = props.fragment.limit - props.gift.count(props.fragment);\n const remaining = props.fragment.limit !== Infinity ? <>{left} remaining</> : <></>;\n return (\n <Box display=\"flex\">\n <Box sx={{ mx: 2 }}>\n <FragmentPreview\n width={props.fragment.width(0)}\n height={props.fragment.height(0)}\n colorAt={(x, y) => {\n if (!props.fragment.fullAt(x, y, 0)) return \"\";\n if (left === 0) return \"grey\";\n return props.fragment.type === FragmentType.Booster ? \"blue\" : \"green\";\n }}\n />\n </Box>\n <Typography>\n {props.fragment.type === FragmentType.Booster\n ? `${props.fragment.power}x adjacent fragment power`\n : Effect(props.fragment.type)}\n <br />\n power: {numeralWrapper.formatStaneksGiftPower(props.fragment.power)}\n <br />\n {remaining}\n </Typography>\n </Box>\n );\n}\n\ntype IProps = {\n gift: StaneksGift;\n selectFragment: (fragment: Fragment) => void;\n};\n\nexport function FragmentSelector(props: IProps): React.ReactElement {\n const [value, setValue] = useState<string | number>(\"None\");\n function onChange(event: SelectChangeEvent<string | number>): void {\n const v = event.target.value;\n setValue(v);\n if (v === \"None\") {\n props.selectFragment(NoneFragment);\n return;\n } else if (v === \"Delete\") {\n props.selectFragment(DeleteFragment);\n return;\n }\n const fragment = Fragments.find((f) => f.id === v);\n if (fragment === undefined) throw new Error(\"Fragment selector selected an undefined fragment with id \" + v);\n if (typeof v === \"number\") props.selectFragment(fragment);\n }\n return (\n <Select sx={{ width: \"100%\" }} onChange={onChange} value={value}>\n <MenuItem value=\"None\">\n <Typography>None</Typography>\n </MenuItem>\n <MenuItem value=\"Delete\">\n <Typography>Delete</Typography>\n </MenuItem>\n {Fragments.map((fragment) => (\n <MenuItem key={fragment.id} value={fragment.id}>\n <FragmentOption\n key={fragment.id}\n gift={props.gift}\n selectFragment={props.selectFragment}\n fragment={fragment}\n />\n </MenuItem>\n ))}\n </Select>\n );\n}\n","import * as React from \"react\";\nimport { Cell } from \"./Cell\";\n\nimport TableRow from \"@mui/material/TableRow\";\n\nimport TableBody from \"@mui/material/TableBody\";\nimport { Table } from \"../../ui/React/Table\";\n\ntype IProps = {\n width: number;\n height: number;\n colorAt: (x: number, y: number) => string;\n};\n\nexport function FragmentPreview(props: IProps): React.ReactElement {\n // switch the width/length to make axis consistent.\n const elems = [];\n for (let j = 0; j < props.height; j++) {\n const cells = [];\n for (let i = 0; i < props.width; i++) {\n cells.push(<Cell key={i} color={props.colorAt(i, j)} />);\n }\n elems.push(<TableRow key={j}>{cells}</TableRow>);\n }\n\n return (\n <Table>\n <TableBody>{elems}</TableBody>\n </Table>\n );\n}\n","import React from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { StaneksGift } from \"../StaneksGift\";\nimport { FragmentType, Effect } from \"../FragmentType\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport Table from \"@mui/material/Table\";\nimport { TableBody, TableCell, TableRow } from \"@mui/material\";\n\ntype IProps = {\n gift: StaneksGift;\n};\n\nfunction formatEffect(effect: number, type: FragmentType): string {\n if (Effect(type).includes(\"+x%\")) {\n return Effect(type).replace(/-*x%/, numeralWrapper.formatPercentage(effect - 1));\n } else if (Effect(type).includes(\"-x%\")) {\n const perc = numeralWrapper.formatPercentage(1 - 1 / effect);\n return Effect(type).replace(/-x%/, perc);\n } else {\n return Effect(type);\n }\n}\n\nexport function ActiveFragmentSummary(props: IProps): React.ReactElement {\n const summary: { coordinate: { x: number; y: number }[]; effect: number; type: FragmentType }[] = [];\n // Iterate through Active Fragment\n props.gift.fragments.forEach((fragment: ActiveFragment) => {\n const f = fragment.fragment();\n // Discard ToolBrush and Booster.\n if (![FragmentType.Booster, FragmentType.None, FragmentType.Delete].includes(f.type)) {\n // Check for an existing entry in summary for this fragment's type\n const entry = summary.find((e) => {\n return e.type === f.type;\n });\n if (entry) {\n // If there's one, update the existing entry\n entry.effect *= props.gift.effect(fragment);\n entry.coordinate.push({ x: fragment.x, y: fragment.y });\n } else {\n // If there's none, create a new entry\n summary.push({\n coordinate: [{ x: fragment.x, y: fragment.y }],\n effect: props.gift.effect(fragment),\n type: f.type,\n });\n }\n }\n });\n\n return (\n <Paper sx={{ mb: 1 }}>\n <Typography variant=\"h5\">Summary of active fragments:</Typography>\n <Table sx={{ display: \"table\", width: \"100%\" }}>\n <TableBody>\n <TableRow>\n <TableCell sx={{ borderBottom: \"none\", p: 0, m: 0 }}>\n <Typography>Coordinate</Typography>\n </TableCell>\n\n <TableCell sx={{ borderBottom: \"none\", p: 0, m: 0 }}>\n <Typography>Effect</Typography>\n </TableCell>\n </TableRow>\n {summary.map((entry) => {\n return (\n <TableRow key={entry.type}>\n <TableCell sx={{ borderBottom: \"none\", p: 0, m: 0 }}>\n <Typography>\n {entry.coordinate.map((coord) => {\n return \"[\" + coord.x + \",\" + coord.y + \"]\";\n })}\n </Typography>\n </TableCell>\n\n <TableCell sx={{ borderBottom: \"none\", p: 0, m: 0 }}>\n <Typography>{formatEffect(entry.effect, entry.type)}</Typography>\n </TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n </Paper>\n );\n}\n","import React from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { Router } from \"../../ui/GameRoot\";\nimport { CinematicText } from \"../../ui/React/CinematicText\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\nexport function BladeburnerCinematic(): React.ReactElement {\n return (\n <CinematicText\n lines={[\n `In the middle of the 21st century, ${FactionNames.OmniTekIncorporated} advanced robot evolution `,\n \"with their Synthoids (synthetic androids), a being virtually identical to a human.\",\n \"------\",\n \"Their sixth-generation Synthoids, called MK-VI, were stronger, faster, and more \",\n \"intelligent than humans. Many argued that the MK-VI Synthoids were the first \",\n \"example of sentient AI.\",\n \"------\",\n `Unfortunately, in 2070 a terrorist group called Ascendis Totalis hacked into ${FactionNames.OmniTekIncorporated} and `,\n \"uploaded a rogue AI into their Synthoid manufacturing facilities.\",\n \"------\",\n \"The MK-VI Synthoids infected by the rogue AI turned hostile toward humanity, initiating \",\n \"the deadliest conflict in human history. This dark chapter is now known as the Synthoid Uprising.\",\n \"------\",\n \"In the aftermath of the Uprising, further manufacturing of Synthoids with advanced AI \",\n \"was banned. MK-VI Synthoids that did not have the rogue Ascendis Totalis AI were \",\n \"allowed to continue their existence.\",\n \"------\",\n \"The intelligence community believes that not all of the rogue MK-VI Synthoids from the Uprising were \",\n \"found and destroyed, and that many of them are blending in as normal humans in society today. \",\n `As a result, many nations have created ${FactionNames.Bladeburners} divisions, special units that are tasked with `,\n \"investigating and dealing with Synthoid threats.\",\n ]}\n onDone={() => {\n Router.toTerminal();\n dialogBoxCreate(\n `Visit the National Security Agency (NSA) to apply for their ${FactionNames.Bladeburners} ` +\n \"division! You will need 100 of each combat stat before doing this.\",\n );\n }}\n />\n );\n}\n","import React from \"react\";\nimport { Player } from \"@player\";\nimport { Exploit } from \"./Exploit\";\n\nconst getComputedStyle = window.getComputedStyle;\nexport function Unclickable(): React.ReactElement {\n function unclickable(event: React.MouseEvent<HTMLDivElement>): void {\n if (!event.target || !(event.target instanceof Element)) return;\n const display = getComputedStyle(event.target).display;\n const visibility = getComputedStyle(event.target).visibility;\n if (display === \"none\" && visibility === \"hidden\" && event.isTrusted) Player.giveExploit(Exploit.Unclickable);\n }\n\n return (\n <div id=\"unclickable\" onClick={unclickable} style={{ display: \"none\", visibility: \"hidden\" }}>\n Click on this to upgrade your Source-File -1!\n </div>\n );\n}\n","import React from \"react\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { Theme } from \"@mui/material/styles\";\n\nimport { AchievementList } from \"./AchievementList\";\nimport { achievements } from \"./Achievements\";\nimport { Typography } from \"@mui/material\";\nimport { Player } from \"@player\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: 50,\n padding: theme.spacing(2),\n userSelect: \"none\",\n },\n }),\n);\n\nexport function AchievementsRoot(): JSX.Element {\n const classes = useStyles();\n return (\n <div className={classes.root} style={{ width: \"90%\" }}>\n <Typography variant=\"h4\">Achievements</Typography>\n <AchievementList achievements={Object.values(achievements)} playerAchievements={Player.achievements} />\n </div>\n );\n}\n","import React from \"react\";\n\nimport { Accordion, AccordionSummary, AccordionDetails, Box, Typography } from \"@mui/material\";\n\nimport { AchievementEntry } from \"./AchievementEntry\";\nimport { Achievement, PlayerAchievement } from \"./Achievements\";\nimport { Settings } from \"../Settings/Settings\";\nimport { getFiltersFromHex } from \"../ThirdParty/colorUtils\";\nimport { CorruptableText } from \"../ui/React/CorruptableText\";\n\ninterface IProps {\n achievements: Achievement[];\n playerAchievements: PlayerAchievement[];\n}\n\nexport function AchievementList({ achievements, playerAchievements }: IProps): JSX.Element {\n // Need to transform the primary color into css filters to change the color of the SVG.\n const cssPrimary = getFiltersFromHex(Settings.theme.primary);\n const cssSecondary = getFiltersFromHex(Settings.theme.secondary);\n\n const data = achievements\n .map((achievement) => ({\n achievement,\n unlockedOn: playerAchievements.find((playerAchievement) => playerAchievement.ID === achievement.ID)?.unlockedOn,\n }))\n .sort((a, b) => (b.unlockedOn ?? 0) - (a.unlockedOn ?? 0));\n\n const unlocked = data.filter((entry) => entry.unlockedOn);\n\n // Hidden achievements\n const secret = data.filter((entry) => !entry.unlockedOn && entry.achievement.Secret);\n\n // Locked behind locked content (bitnode x)\n const unavailable = data.filter(\n (entry) =>\n !entry.unlockedOn && !entry.achievement.Secret && entry.achievement.Visible && !entry.achievement.Visible(),\n );\n\n // Remaining achievements\n const locked = data\n .filter((entry) => !unlocked.map((u) => u.achievement.ID).includes(entry.achievement.ID))\n .filter((entry) => !secret.map((u) => u.achievement.ID).includes(entry.achievement.ID))\n .filter((entry) => !unavailable.map((u) => u.achievement.ID).includes(entry.achievement.ID));\n\n return (\n <Box sx={{ pr: 18, my: 2 }}>\n <Box\n sx={{\n display: \"flex\",\n flexDirection: \"column\",\n flexWrap: \"wrap\",\n }}\n >\n {unlocked.length > 0 && (\n <Accordion defaultExpanded disableGutters square>\n <AccordionSummary>\n <Typography variant=\"h5\" sx={{ my: 1 }}>\n Acquired ({unlocked.length}/{data.length})\n </Typography>\n </AccordionSummary>\n <AccordionDetails sx={{ pt: 2 }}>\n {unlocked.map((item) => (\n <AchievementEntry\n key={`unlocked_${item.achievement.ID}`}\n achievement={item.achievement}\n unlockedOn={item.unlockedOn}\n cssFiltersUnlocked={cssPrimary}\n cssFiltersLocked={cssSecondary}\n />\n ))}\n </AccordionDetails>\n </Accordion>\n )}\n\n {locked.length > 0 && (\n <Accordion disableGutters square>\n <AccordionSummary>\n <Typography variant=\"h5\" color=\"secondary\">\n Locked ({locked.length} remaining)\n </Typography>\n </AccordionSummary>\n <AccordionDetails sx={{ pt: 2 }}>\n {locked.map((item) => (\n <AchievementEntry\n key={`locked_${item.achievement.ID}`}\n achievement={item.achievement}\n cssFiltersUnlocked={cssPrimary}\n cssFiltersLocked={cssSecondary}\n />\n ))}\n </AccordionDetails>\n </Accordion>\n )}\n\n {unavailable.length > 0 && (\n <Accordion disableGutters square>\n <AccordionSummary>\n <Typography variant=\"h5\" color=\"secondary\">\n Unavailable ({unavailable.length} remaining)\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Typography sx={{ mt: 1 }}>\n {unavailable.length} additional achievements hidden behind content you don't have access to.\n </Typography>\n </AccordionDetails>\n </Accordion>\n )}\n\n {secret.length > 0 && (\n <Accordion disableGutters square>\n <AccordionSummary>\n <Typography variant=\"h5\" color=\"secondary\">\n Secret ({secret.length} remaining)\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Typography color=\"secondary\" sx={{ mt: 1 }}>\n {secret.map((item) => (\n <span key={`secret_${item.achievement.ID}`}>\n <CorruptableText content={item.achievement.ID}></CorruptableText>\n <br />\n </span>\n ))}\n </Typography>\n </AccordionDetails>\n </Accordion>\n )}\n </Box>\n </Box>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Box } from \"@mui/material\";\n\nimport { Achievement } from \"./Achievements\";\nimport { Settings } from \"../Settings/Settings\";\n\ninterface IProps {\n achievement: Achievement;\n unlocked: boolean;\n colorFilters: string;\n size: string;\n}\n\nexport function AchievementIcon({ achievement, unlocked, colorFilters, size }: IProps): JSX.Element {\n const [imgLoaded, setImgLoaded] = useState(false);\n const mainColor = unlocked ? Settings.theme.primarydark : Settings.theme.secondarydark;\n\n if (!achievement.Icon) return <></>;\n return (\n <Box\n sx={{\n border: `1px solid ${mainColor}`,\n width: size,\n height: size,\n m: 1,\n visibility: imgLoaded ? \"visible\" : \"hidden\",\n }}\n >\n <img\n src={`dist/icons/achievements/${encodeURI(achievement.Icon)}.svg`}\n style={{ filter: colorFilters, width: size, height: size }}\n onLoad={() => setImgLoaded(true)}\n alt={achievement.Name}\n />\n </Box>\n );\n}\n","import React, { ErrorInfo } from \"react\";\n\nimport { IErrorData, getErrorForDisplay } from \"../utils/ErrorHelper\";\nimport { RecoveryRoot } from \"./React/RecoveryRoot\";\nimport { Page } from \"./Router\";\nimport { Router } from \"./GameRoot\";\n\ninterface IProps {\n softReset: () => void;\n}\n\ninterface IState {\n error?: Error;\n errorInfo?: React.ErrorInfo;\n page?: Page;\n hasError: boolean;\n}\n\nexport class ErrorBoundary extends React.Component<IProps, IState> {\n state: IState;\n\n constructor(props: IProps) {\n super(props);\n this.state = { hasError: false } as IState;\n }\n\n reset(): void {\n this.setState({ hasError: false } as IState);\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n this.setState({\n errorInfo,\n page: Router.page(),\n });\n console.error(error, errorInfo);\n }\n render(): React.ReactNode {\n if (this.state.hasError) {\n let errorData: IErrorData | undefined;\n if (this.state.error) {\n try {\n // We don't want recursive errors, so in case this fails, it's in a try catch.\n errorData = getErrorForDisplay(this.state.error, this.state.errorInfo, this.state.page);\n } catch (ex) {\n console.error(ex);\n }\n }\n\n return <RecoveryRoot softReset={this.props.softReset} errorData={errorData} resetError={() => this.reset()} />;\n }\n return this.props.children;\n }\n static getDerivedStateFromError(error: Error): IState {\n return { hasError: true, error };\n }\n}\n","import React, { useEffect, useState } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { getPredefinedThemes, IPredefinedTheme } from \"../Themes\";\nimport { Box, ButtonGroup, Button } from \"@mui/material\";\nimport { ThemeEditorButton } from \"./ThemeEditorButton\";\nimport { StyleEditorButton } from \"./StyleEditorButton\";\nimport { ThemeEntry } from \"./ThemeEntry\";\nimport { ThemeCollaborate } from \"./ThemeCollaborate\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\n\n// Everything dies when the theme gets reloaded, so we'll keep the current scroll to not jump around.\nlet previousScrollY = 0;\n\nexport function ThemeBrowser(): React.ReactElement {\n const [modalOpen, setModalOpen] = useState(false);\n const [modalImageSrc, setModalImageSrc] = useState<string | undefined>();\n const predefinedThemes = getPredefinedThemes();\n const themes = (predefinedThemes &&\n Object.entries(predefinedThemes).map(([key, templateTheme]) => (\n <ThemeEntry\n key={key}\n theme={templateTheme}\n onActivated={() => setTheme(templateTheme)}\n onImageClick={handleZoom}\n />\n ))) || <></>;\n\n function setTheme(theme: IPredefinedTheme): void {\n previousScrollY = window.scrollY;\n const previousColors = { ...Settings.theme };\n Object.assign(Settings.theme, theme.colors);\n ThemeEvents.emit();\n SnackbarEvents.emit(\n <>\n Updated theme to \"<strong>{theme.name}</strong>\"\n <Button\n sx={{ ml: 1 }}\n color=\"secondary\"\n size=\"small\"\n onClick={() => {\n Object.assign(Settings.theme, previousColors);\n ThemeEvents.emit();\n }}\n >\n UNDO\n </Button>\n </>,\n ToastVariant.INFO,\n 30000,\n );\n }\n\n function handleZoom(src: string): void {\n previousScrollY = window.scrollY;\n setModalImageSrc(src);\n setModalOpen(true);\n }\n\n function handleCloseZoom(): void {\n previousScrollY = window.scrollY;\n setModalOpen(false);\n }\n\n useEffect(() => {\n requestAnimationFrame(() => window.scrollTo(0, previousScrollY));\n });\n\n return (\n <Box sx={{ mx: 2 }}>\n <Typography variant=\"h4\">Theme Browser</Typography>\n <Paper sx={{ px: 2, py: 1, my: 1 }}>\n <ThemeCollaborate />\n <ButtonGroup sx={{ mb: 2, display: \"block\" }}>\n <ThemeEditorButton />\n <StyleEditorButton />\n </ButtonGroup>\n <Box sx={{ display: \"flex\", flexWrap: \"wrap\" }}>{themes}</Box>\n <Modal open={modalOpen} onClose={handleCloseZoom}>\n <img src={modalImageSrc} style={{ width: \"100%\" }} />\n </Modal>\n </Paper>\n </Box>\n );\n}\n","import React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport PaletteSharpIcon from \"@mui/icons-material/PaletteSharp\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { IPredefinedTheme } from \"../Themes\";\nimport { Link, Card, CardHeader, CardContent, CardMedia, Button } from \"@mui/material\";\n\ninterface IProps {\n theme: IPredefinedTheme;\n onActivated: () => void;\n onImageClick: (src: string) => void;\n}\n\nexport function ThemeEntry({ theme, onActivated, onImageClick }: IProps): React.ReactElement {\n if (!theme) return <></>;\n return (\n <Card key={theme.screenshot} sx={{ width: 400, mr: 1, mb: 1 }}>\n <CardHeader\n action={\n <Tooltip title=\"Use this theme\">\n <Button startIcon={<PaletteSharpIcon />} onClick={onActivated} variant=\"outlined\">\n Use\n </Button>\n </Tooltip>\n }\n title={theme.name}\n subheader={\n <>\n by {theme.credit}{\" \"}\n {theme.reference && (\n <>\n (\n <Link href={theme.reference} target=\"_blank\">\n ref\n </Link>\n )\n </>\n )}\n </>\n }\n sx={{\n color: Settings.theme.primary,\n \"& .MuiCardHeader-subheader\": {\n color: Settings.theme.secondarydark,\n },\n \"& .MuiButton-outlined\": {\n backgroundColor: \"transparent\",\n },\n }}\n />\n <CardMedia\n component=\"img\"\n width=\"400\"\n image={theme.screenshot}\n alt={`Theme Screenshot of \"${theme.name}\"`}\n sx={{\n borderTop: `1px solid ${Settings.theme.welllight}`,\n borderBottom: `1px solid ${Settings.theme.welllight}`,\n cursor: \"zoom-in\",\n }}\n onClick={() => onImageClick(theme.screenshot)}\n />\n <CardContent>\n <Typography\n variant=\"body2\"\n color=\"text.secondary\"\n sx={{\n color: Settings.theme.primarydark,\n }}\n >\n {theme.description}\n </Typography>\n </CardContent>\n </Card>\n );\n}\n","import React, { useEffect, useState } from \"react\";\n\nimport {\n Paper,\n Table,\n TableHead,\n TableRow,\n TableBody,\n TableContainer,\n TableCell,\n Typography,\n Tooltip,\n Box,\n Button,\n ButtonGroup,\n} from \"@mui/material\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { Theme } from \"@mui/material/styles\";\n\nimport ThumbUpAlt from \"@mui/icons-material/ThumbUpAlt\";\nimport ThumbDownAlt from \"@mui/icons-material/ThumbDownAlt\";\nimport DirectionsRunIcon from \"@mui/icons-material/DirectionsRun\";\nimport ArrowBackIcon from \"@mui/icons-material/ArrowBack\";\nimport WarningIcon from \"@mui/icons-material/Warning\";\n\nimport { ImportData, saveObject } from \"../../SaveObject\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport { pushImportResult } from \"../../Electron\";\nimport { Router } from \"../GameRoot\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n padding: theme.spacing(2),\n maxWidth: \"1000px\",\n\n \"& .MuiTable-root\": {\n \"& .MuiTableCell-root\": {\n borderBottom: `1px solid ${Settings.theme.welllight}`,\n },\n\n \"& .MuiTableHead-root .MuiTableRow-root\": {\n backgroundColor: Settings.theme.backgroundsecondary,\n\n \"& .MuiTableCell-root\": {\n color: Settings.theme.primary,\n fontWeight: \"bold\",\n },\n },\n\n \"& .MuiTableBody-root\": {\n \"& .MuiTableRow-root:nth-of-type(odd)\": {\n backgroundColor: Settings.theme.well,\n\n \"& .MuiTableCell-root\": {\n color: Settings.theme.primarylight,\n },\n },\n \"& .MuiTableRow-root:nth-of-type(even)\": {\n backgroundColor: Settings.theme.backgroundsecondary,\n\n \"& .MuiTableCell-root\": {\n color: Settings.theme.primarylight,\n },\n },\n },\n },\n },\n }),\n);\n\nfunction ComparisonIcon({ isBetter }: { isBetter: boolean }): JSX.Element {\n if (isBetter) {\n return (\n <Tooltip\n title={\n <>\n Imported value is <b>larger</b>!\n </>\n }\n >\n <ThumbUpAlt color=\"success\" />\n </Tooltip>\n );\n } else {\n return (\n <Tooltip\n title={\n <>\n Imported value is <b>smaller</b>!\n </>\n }\n >\n <ThumbDownAlt color=\"error\" />\n </Tooltip>\n );\n }\n}\n\nexport interface IProps {\n importString: string;\n automatic: boolean;\n}\n\nlet initialAutosave = 0;\n\nexport function ImportSaveRoot(props: IProps): JSX.Element {\n const classes = useStyles();\n const [importData, setImportData] = useState<ImportData | undefined>();\n const [currentData, setCurrentData] = useState<ImportData | undefined>();\n const [importModalOpen, setImportModalOpen] = useState(false);\n const [headback, setHeadback] = useState(false);\n\n function handleGoBack(): void {\n Settings.AutosaveInterval = initialAutosave;\n pushImportResult(false);\n Router.allowRouting(true);\n setHeadback(true);\n }\n\n async function handleImport(): Promise<void> {\n await saveObject.importGame(props.importString, true);\n pushImportResult(true);\n }\n\n useEffect(() => {\n // We want to disable autosave while we're in this mode\n initialAutosave = Settings.AutosaveInterval;\n Settings.AutosaveInterval = 0;\n Router.allowRouting(false);\n }, []);\n\n useEffect(() => {\n if (headback) Router.toTerminal();\n }, [headback]);\n\n useEffect(() => {\n async function fetchData(): Promise<void> {\n const dataBeingImported = await saveObject.getImportDataFromString(props.importString);\n const dataCurrentlyInGame = await saveObject.getImportDataFromString(saveObject.getSaveString(true));\n\n setImportData(dataBeingImported);\n setCurrentData(dataCurrentlyInGame);\n\n return Promise.resolve();\n }\n if (props.importString) fetchData();\n }, [props.importString]);\n\n if (!importData || !currentData) return <></>;\n return (\n <Box className={classes.root}>\n <Typography variant=\"h4\" sx={{ mb: 2 }}>\n Import Save Comparison\n </Typography>\n {props.automatic && (\n <Typography sx={{ mb: 2 }}>\n We've found a <b>NEWER save</b> that you may want to use instead.\n </Typography>\n )}\n <Typography variant=\"body1\" sx={{ mb: 2 }}>\n Your current game's data is on the left and the data that will be imported is on the right.\n <br />\n Please double check everything is fine before proceeding!\n </Typography>\n <TableContainer color=\"secondary\" component={Paper}>\n <Table>\n <TableHead>\n <TableRow>\n <TableCell></TableCell>\n <TableCell>Current Game</TableCell>\n <TableCell>Being Imported</TableCell>\n <TableCell></TableCell>\n </TableRow>\n </TableHead>\n\n <TableBody>\n <TableRow>\n <TableCell>Game Identifier</TableCell>\n <TableCell>{currentData.playerData?.identifier ?? \"n/a\"}</TableCell>\n <TableCell>{importData.playerData?.identifier ?? \"n/a\"}</TableCell>\n <TableCell>\n {importData.playerData?.identifier !== currentData.playerData?.identifier && (\n <Tooltip title=\"These are two different games!\">\n <WarningIcon color=\"warning\" />\n </Tooltip>\n )}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>Playtime</TableCell>\n <TableCell>{convertTimeMsToTimeElapsedString(currentData.playerData?.totalPlaytime ?? 0)}</TableCell>\n <TableCell>{convertTimeMsToTimeElapsedString(importData.playerData?.totalPlaytime ?? 0)}</TableCell>\n <TableCell>\n {importData.playerData?.totalPlaytime !== currentData.playerData?.totalPlaytime && (\n <ComparisonIcon\n isBetter={\n (importData.playerData?.totalPlaytime ?? 0) > (currentData.playerData?.totalPlaytime ?? 0)\n }\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Saved On</TableCell>\n <TableCell>\n {(currentData.playerData?.lastSave ?? 0) > 0\n ? new Date(currentData.playerData?.lastSave ?? 0).toLocaleString()\n : \"n/a\"}\n </TableCell>\n <TableCell>\n {(importData.playerData?.lastSave ?? 0) > 0\n ? new Date(importData.playerData?.lastSave ?? 0).toLocaleString()\n : \"n/a\"}\n </TableCell>\n <TableCell>\n {importData.playerData?.lastSave !== currentData.playerData?.lastSave && (\n <ComparisonIcon\n isBetter={(importData.playerData?.lastSave ?? 0) > (currentData.playerData?.lastSave ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Money</TableCell>\n <TableCell>{numeralWrapper.formatMoney(currentData.playerData?.money ?? 0)}</TableCell>\n <TableCell>{numeralWrapper.formatMoney(importData.playerData?.money ?? 0)}</TableCell>\n <TableCell>\n {importData.playerData?.money !== currentData.playerData?.money && (\n <ComparisonIcon\n isBetter={(importData.playerData?.money ?? 0) > (currentData.playerData?.money ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Hacking</TableCell>\n <TableCell>{numeralWrapper.formatSkill(currentData.playerData?.hacking ?? 0)}</TableCell>\n <TableCell>{numeralWrapper.formatSkill(importData.playerData?.hacking ?? 0)}</TableCell>\n <TableCell>\n {importData.playerData?.hacking !== currentData.playerData?.hacking && (\n <ComparisonIcon\n isBetter={(importData.playerData?.hacking ?? 0) > (currentData.playerData?.hacking ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Augmentations</TableCell>\n <TableCell>{currentData.playerData?.augmentations}</TableCell>\n <TableCell>{importData.playerData?.augmentations}</TableCell>\n <TableCell>\n {importData.playerData?.augmentations !== currentData.playerData?.augmentations && (\n <ComparisonIcon\n isBetter={\n (importData.playerData?.augmentations ?? 0) > (currentData.playerData?.augmentations ?? 0)\n }\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Factions</TableCell>\n <TableCell>{currentData.playerData?.factions}</TableCell>\n <TableCell>{importData.playerData?.factions}</TableCell>\n <TableCell>\n {importData.playerData?.factions !== currentData.playerData?.factions && (\n <ComparisonIcon\n isBetter={(importData.playerData?.factions ?? 0) > (currentData.playerData?.factions ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>Achievements</TableCell>\n <TableCell>{currentData.playerData?.achievements}</TableCell>\n <TableCell>{importData.playerData?.achievements}</TableCell>\n <TableCell>\n {importData.playerData?.achievements !== currentData.playerData?.achievements && (\n <ComparisonIcon\n isBetter={(importData.playerData?.achievements ?? 0) > (currentData.playerData?.achievements ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Source Files</TableCell>\n <TableCell>{currentData.playerData?.sourceFiles}</TableCell>\n <TableCell>{importData.playerData?.sourceFiles}</TableCell>\n <TableCell>\n {importData.playerData?.sourceFiles !== currentData.playerData?.sourceFiles && (\n <ComparisonIcon\n isBetter={(importData.playerData?.sourceFiles ?? 0) > (currentData.playerData?.sourceFiles ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>BitNode</TableCell>\n <TableCell>\n {currentData.playerData?.bitNode}-{currentData.playerData?.bitNodeLevel}\n </TableCell>\n <TableCell>\n {importData.playerData?.bitNode}-{importData.playerData?.bitNodeLevel}\n </TableCell>\n <TableCell></TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </TableContainer>\n\n <Box sx={{ display: \"flex\", justifyContent: \"flex-end\" }}>\n <ButtonGroup>\n <Button onClick={handleGoBack} sx={{ my: 2 }} startIcon={<ArrowBackIcon />} color=\"secondary\">\n Take me back!\n </Button>\n <Button\n onClick={() => setImportModalOpen(true)}\n sx={{ my: 2 }}\n startIcon={<DirectionsRunIcon />}\n color=\"warning\"\n >\n Proceed with import\n </Button>\n </ButtonGroup>\n <ConfirmationModal\n open={importModalOpen}\n onClose={() => setImportModalOpen(false)}\n onConfirm={handleImport}\n confirmationText={\n <>\n Importing new save game data will <strong>completely wipe</strong> the current game data!\n <br />\n </>\n }\n />\n </Box>\n </Box>\n );\n}\n","import React from \"react\";\n\ninterface IProps {\n children: React.ReactNode;\n content: React.ReactNode;\n}\n\nexport function BypassWrapper(props: IProps): React.ReactElement {\n if (!props.content) return <>{props.children}</>;\n return <>{props.content}</>;\n}\n","/**\n * Clears defined properties from an object.\n * Does not delete up the prototype chain.\n * @deprecated Look into using `Map` or `Set` rather than manipulating properties on an Object.\n * @param obj the object to clear all properties\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function clearObject(obj: unknown): void {\n if (typeof obj !== \"object\" || obj === null || obj === undefined) return;\n const o = obj as Record<string, unknown>;\n for (const key of Object.getOwnPropertyNames(o)) {\n if (o.hasOwnProperty(key)) {\n delete o[key];\n }\n }\n}\n","import { Player } from \"@player\";\nimport { Exploit } from \"./Exploit\";\n\nfunction tampering(): void {\n if (Player.exploits.includes(Exploit.PrototypeTampering)) return;\n // Tampering\n const a = 55;\n setInterval(function () {\n if (a.toExponential() !== \"5.5e+1\") {\n Player.giveExploit(Exploit.PrototypeTampering);\n }\n }, 15 * 60 * 1000); // 15 minutes\n}\n\nfunction timeCompression(): void {\n const timer = 1000 * 15;\n if (Player.exploits.includes(Exploit.TimeCompression)) return;\n // Time compression\n let last = performance.now();\n function minute(): void {\n const now = performance.now();\n if (now - last < 500) {\n // time has been compressed.\n Player.giveExploit(Exploit.TimeCompression);\n return;\n }\n last = now;\n window.setTimeout(minute, timer);\n }\n window.setTimeout(minute, timer);\n}\n\nexport function startExploits(): void {\n tampering();\n timeCompression();\n}\n","import { handleUnknownError } from \"./Netscript/NetscriptHelpers\";\n\nexport function setupUncaughtPromiseHandler(): void {\n window.addEventListener(\"unhandledrejection\", (e) => {\n handleUnknownError(\n e.reason,\n null,\n \"UNCAUGHT PROMISE ERROR\\nYou forgot to await a promise\\nmaybe hack / grow / weaken ?\\n\\n\",\n );\n });\n}\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nimport { TTheme as Theme, ThemeEvents, refreshTheme } from \"./Themes/ui/Theme\";\nimport { LoadingScreen } from \"./ui/LoadingScreen\";\nimport { initElectron } from \"./Electron\";\n\nimport { newRemoteFileApiConnection } from \"./RemoteFileAPI/RemoteFileAPI\";\n\ninitElectron();\nglobalThis[\"React\"] = React;\nglobalThis[\"ReactDOM\"] = ReactDOM;\nReactDOM.render(\n <Theme>\n <LoadingScreen />\n </Theme>,\n document.getElementById(\"root\"),\n);\n\nsetTimeout(newRemoteFileApiConnection, 2000);\n\nfunction rerender(): void {\n refreshTheme();\n ReactDOM.render(\n <Theme>\n <LoadingScreen />\n </Theme>,\n document.getElementById(\"root\"),\n );\n}\n\n(function () {\n ThemeEvents.subscribe(rerender);\n})();\n\n(function () {\n if (process.env.NODE_ENV === \"development\" || location.href.startsWith(\"file://\")) return;\n window.onbeforeunload = function () {\n return \"Your work will be lost.\";\n };\n})();\n\n(function () {\n window.print = () => {\n throw new Error(\"You accidentally called window.print instead of ns.print\");\n };\n})();\n\n(function () {\n window.prompt = () => {\n throw new Error(\"You accidentally called window.prompt instead of ns.prompt\");\n };\n})();\n"],"sourceRoot":""} |