mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-29 19:13:49 +01:00
20 lines
1.5 MiB
20 lines
1.5 MiB
!function(e){function t(t){for(var r,o,s=t[0],l=t[1],c=t[2],m=0,p=[];m<s.length;m++)o=s[m],a[o]&&p.push(a[o][0]),a[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);p.length;)p.shift()();return i.push.apply(i,c||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,s=1;s<n.length;s++){var l=n[s];0!==a[l]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={2:0},i=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var s=window.webpackJsonp=window.webpackJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var c=0;c<s.length;c++)t(s[c]);var u=l;i.push([12,0]),n()}([function(e,t,n){"use strict";n.r(t),n.d(t,"Player",function(){return l}),n.d(t,"loadPlayer",function(){return c});var r=n(30),a=n(306),i=n(131),o=n(16),s=n(43);let l=new a.a;function c(e){if((l=JSON.parse(e,o.Reviver)).money=new s.a(l.money),l.corporation instanceof r.c){l.corporation.funds=new s.a(l.corporation.funds),l.corporation.revenue=new s.a(l.corporation.revenue),l.corporation.expenses=new s.a(l.corporation.expenses);for(var t=0;t<l.corporation.divisions.length;++t){var n=l.corporation.divisions[t];n.lastCycleRevenue=new s.a(n.lastCycleRevenue),n.lastCycleExpenses=new s.a(n.lastCycleExpenses),n.thisCycleRevenue=new s.a(n.thisCycleRevenue),n.thisCycleExpenses=new s.a(n.thisCycleExpenses)}}l.exploits=Object(i.sanitizeExploits)(l.exploits)}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(79);n(712),n(711),n(710),n(709),n(708),n(707),n(706),n(705),n(704),n(703),n(702),n(701),n(700),n(699);t.numeralWrapper=new class{constructor(){this.defaultLocale="en",this.defaultLocale="en"}updateLocale(e){return null!=r.locale(e)||(console.warn(`Invalid locale for numeral: ${e}`),r.locale(this.defaultLocale),!1)}format(e,t){Math.abs(e)<1e-6&&(e=0);const n=r(e).format(t);return"NaN"===n?`${e}`:n}formatBigNumber(e){return this.format(e,"0.000a")}formatMoney(e){return this.format(e,"$0.000a")}formatPercentage(e,t=2){const n="0."+"0".repeat(t)+"%";return this.format(e,n)}}},function(e,t,n){"use strict";function r(e,t={}){const n=document.createElement(e);return void 0!==t.id&&(n.id=t.id),void 0!==t.class&&(n.className=t.class),void 0!==t.innerHTML&&(n.innerHTML=t.innerHTML),void 0!==t.innerText&&(n.innerText=t.innerText),void 0!==t.tabIndex&&(n.tabIndex=t.tabIndex),function(e,t){void 0!==t.text&&(e.text=t.text),void 0!==t.href&&(e.href=t.href),void 0!==t.target&&(e.target=t.target)}(n,t),function(e,t){void 0!==t.name&&(e.name=t.name),void 0!==t.value&&(e.value=t.value),void 0!==t.type&&(e.type=t.type),void 0!==t.checked&&(e.checked=t.checked),void 0!==t.pattern&&(e.pattern=t.pattern),void 0!==t.maxLength&&(e.maxLength=t.maxLength),void 0!==t.placeholder&&(e.placeholder=t.placeholder),void 0!==t.max&&(e.max=t.max),void 0!==t.min&&(e.min=t.min),void 0!==t.step&&(e.step=t.step)}(n,t),function(e,t){void 0!==t.for&&(e.htmlFor=t.for)}(n,t),function(e,t){void 0!==t.clickListener&&e.addEventListener("click",t.clickListener),void 0!==t.inputListener&&e.addEventListener("input",t.inputListener),void 0!==t.changeListener&&e.addEventListener("change",t.changeListener),void 0!==t.onkeyup&&e.addEventListener("keyup",t.onkeyup),void 0!==t.onkeydown&&e.addEventListener("keydown",t.onkeydown),void 0!==t.onfocus&&e.addEventListener("focus",t.onfocus)}(n,t),function(e,t){void 0!==t.display&&(e.style.display=t.display),void 0!==t.visibility&&(e.style.visibility=t.visibility),void 0!==t.margin&&(e.style.margin=t.margin),void 0!==t.marginLeft&&(e.style.marginLeft=t.marginLeft),void 0!==t.marginTop&&(e.style.marginTop=t.marginTop),void 0!==t.padding&&(e.style.padding=t.padding),void 0!==t.color&&(e.style.color=t.color),void 0!==t.border&&(e.style.border=t.border),void 0!==t.float&&(e.style.cssFloat=t.float),void 0!==t.fontSize&&(e.style.fontSize=t.fontSize),void 0!==t.whiteSpace&&(e.style.whiteSpace=t.whiteSpace),void 0!==t.width&&(e.style.width=t.width),void 0!==t.backgroundColor&&(e.style.backgroundColor=t.backgroundColor),void 0!==t.position&&(e.style.position=t.position),void 0!==t.overflow&&(e.style.overflow=t.overflow)}(n,t),function(e,t){void 0!==t.tooltip&&""!==t.tooltip?(e.className+=" tooltip",e.appendChild(r("span",{class:"tooltiptext",innerHTML:t.tooltip}))):void 0!==t.tooltipleft?(e.className+=" tooltip",e.appendChild(r("span",{class:"tooltiptextleft",innerHTML:t.tooltipleft}))):void 0!==t.tooltipsmall?(e.className+=" tooltip",e.appendChild(r("span",{class:"tooltiptext smallfont",innerHTML:t.tooltipsmall}))):void 0!==t.tooltiplow&&(e.className+="tooltip",e.appendChild(r("span",{class:"tooltiptextlow",innerHTML:t.tooltiplow})))}(n,t),n}Object.defineProperty(t,"__esModule",{value:!0}),t.createElement=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AugmentationNames={Targeting1:"Augmented Targeting I",Targeting2:"Augmented Targeting II",Targeting3:"Augmented Targeting III",SyntheticHeart:"Synthetic Heart",SynfibrilMuscle:"Synfibril Muscle",CombatRib1:"Combat Rib I",CombatRib2:"Combat Rib II",CombatRib3:"Combat Rib III",NanofiberWeave:"Nanofiber Weave",SubdermalArmor:"NEMEAN Subdermal Weave",WiredReflexes:"Wired Reflexes",GrapheneBoneLacings:"Graphene Bone Lacings",BionicSpine:"Bionic Spine",GrapheneBionicSpine:"Graphene Bionic Spine Upgrade",BionicLegs:"Bionic Legs",GrapheneBionicLegs:"Graphene Bionic Legs Upgrade",SpeechProcessor:"Speech Processor Implant",TITN41Injection:"TITN-41 Gene-Modification Injection",EnhancedSocialInteractionImplant:"Enhanced Social Interaction Implant",BitWire:"BitWire",ArtificialBioNeuralNetwork:"Artificial Bio-neural Network Implant",ArtificialSynapticPotentiation:"Artificial Synaptic Potentiation",EnhancedMyelinSheathing:"Enhanced Myelin Sheathing",SynapticEnhancement:"Synaptic Enhancement Implant",NeuralRetentionEnhancement:"Neural-Retention Enhancement",DataJack:"DataJack",ENM:"Embedded Netburner Module",ENMCore:"Embedded Netburner Module Core Implant",ENMCoreV2:"Embedded Netburner Module Core V2 Upgrade",ENMCoreV3:"Embedded Netburner Module Core V3 Upgrade",ENMAnalyzeEngine:"Embedded Netburner Module Analyze Engine",ENMDMA:"Embedded Netburner Module Direct Memory Access Upgrade",Neuralstimulator:"Neuralstimulator",NeuralAccelerator:"Neural Accelerator",CranialSignalProcessorsG1:"Cranial Signal Processors - Gen I",CranialSignalProcessorsG2:"Cranial Signal Processors - Gen II",CranialSignalProcessorsG3:"Cranial Signal Processors - Gen III",CranialSignalProcessorsG4:"Cranial Signal Processors - Gen IV",CranialSignalProcessorsG5:"Cranial Signal Processors - Gen V",NeuronalDensification:"Neuronal Densification",NuoptimalInjectorImplant:"Nuoptimal Nootropic Injector Implant",SpeechEnhancement:"Speech Enhancement",FocusWire:"FocusWire",PCDNI:"PC Direct-Neural Interface",PCDNIOptimizer:"PC Direct-Neural Interface Optimization Submodule",PCDNINeuralNetwork:"PC Direct-Neural Interface NeuroNet Injector",ADRPheromone1:"ADR-V1 Pheromone Gene",ADRPheromone2:"ADR-V2 Pheromone Gene",ShadowsSimulacrum:"The Shadow's Simulacrum",HacknetNodeCPUUpload:"Hacknet Node CPU Architecture Neural-Upload",HacknetNodeCacheUpload:"Hacknet Node Cache Architecture Neural-Upload",HacknetNodeNICUpload:"Hacknet Node NIC Architecture Neural-Upload",HacknetNodeKernelDNI:"Hacknet Node Kernel Direct-Neural Interface",HacknetNodeCoreDNI:"Hacknet Node Core Direct-Neural Interface",NeuroFluxGovernor:"NeuroFlux Governor",Neurotrainer1:"Neurotrainer I",Neurotrainer2:"Neurotrainer II",Neurotrainer3:"Neurotrainer III",Hypersight:"HyperSight Corneal Implant",LuminCloaking1:"LuminCloaking-V1 Skin Implant",LuminCloaking2:"LuminCloaking-V2 Skin Implant",HemoRecirculator:"HemoRecirculator",SmartSonar:"SmartSonar Implant",PowerRecirculator:"Power Recirculation Core",QLink:"QLink",TheRedPill:"The Red Pill",SPTN97:"SPTN-97 Gene Modification",HiveMind:"ECorp HVMind Implant",CordiARCReactor:"CordiARC Fusion Reactor",SmartJaw:"SmartJaw",Neotra:"Neotra",Xanipher:"Xanipher",nextSENS:"nextSENS Gene Modification",OmniTekInfoLoad:"OmniTek InfoLoad",PhotosyntheticCells:"Photosynthetic Cells",Neurolink:"BitRunners Neurolink",TheBlackHand:"The Black Hand",CRTX42AA:"CRTX42-AA Gene Modification",Neuregen:"Neuregen Gene Modification",CashRoot:"CashRoot Starter Kit",NutriGen:"NutriGen Implant",INFRARet:"INFRARET Enhancement",DermaForce:"DermaForce Particle Barrier",GrapheneBrachiBlades:"Graphene BranchiBlades Upgrade",GrapheneBionicArms:"Graphene Bionic Arms Upgrade",BrachiBlades:"BrachiBlades",BionicArms:"Bionic Arms",SNA:"Social Negotiation Assistant (S.N.A)",EsperEyewear:"EsperTech Bladeburner Eyewear",EMS4Recombination:"EMS-4 Recombination",OrionShoulder:"ORION-MKIV Shoulder",HyperionV1:"Hyperion Plasma Cannon V1",HyperionV2:"Hyperion Plasma Cannon V2",GolemSerum:"GOLEM Serum",VangelisVirus:"Vangelis Virus",VangelisVirus3:"Vangelis Virus 3.0",INTERLINKED:"I.N.T.E.R.L.I.N.K.E.D",BladeRunner:"Blade's Runners",BladeArmor:"BLADE-51b Tesla Armor",BladeArmorPowerCells:"BLADE-51b Tesla Armor: Power Cells Upgrade",BladeArmorEnergyShielding:"BLADE-51b Tesla Armor: Energy Shielding Upgrade",BladeArmorUnibeam:"BLADE-51b Tesla Armor: Unibeam Upgrade",BladeArmorOmnibeam:"BLADE-51b Tesla Armor: Omnibeam Upgrade",BladeArmorIPU:"BLADE-51b Tesla Armor: IPU Upgrade",BladesSimulacrum:"The Blade's Simulacrum"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(115);function a(e,t={}){const n=`color: ${null!=t.color?t.color:"var(--my-font-color)"}; background-color:var(--my-background-color);${void 0===t.id?" white-space:pre-wrap;":""}`,a=`<tr class="posted"><td ${void 0===t.id?'class="terminal-line"':`id="${t.id}"`} style="${n}">${e}</td></tr>`;r.getElementById("terminal-input").insertAdjacentHTML("beforebegin",a),function(){const e=r.getElementById("terminal-container");e.scrollTop=e.scrollHeight}()}t.post=function(e){a(e)},t.postError=function(e){a(`ERROR: ${e}`,{color:"#ff2929"})},t.hackProgressBarPost=function(e){a(e,{id:"hack-progress-bar"})},t.hackProgressPost=function(e){a(e,{id:"hack-progress"})},t.postContent=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONSTANTS={Version:"0.50.2",MaxSkillLevel:975,MilliPerCycle:200,CorpFactionRepRequirement:2e5,BaseCostFor1GBOfRamHome:32e3,BaseCostFor1GBOfRamServer:55e3,TravelCost:2e5,BaseFavorToDonate:150,DonateMoneyToRepDivisor:1e6,FactionReputationToFavorBase:500,FactionReputationToFavorMult:1.02,CompanyReputationToFavorBase:500,CompanyReputationToFavorMult:1.02,NeuroFluxGovernorLevelMult:1.14,NumNetscriptPorts:20,HomeComputerMaxRam:1073741824,ServerBaseGrowthRate:1.03,ServerMaxGrowthRate:1.0035,ServerFortifyAmount:.002,ServerWeakenAmount:.05,PurchasedServerLimit:25,PurchasedServerMaxRam:1048576,AugmentationCostMultiplier:5,AugmentationRepMultiplier:2.5,MultipleAugMultiplier:1.9,TorRouterCost:2e5,InfiltrationBribeBaseAmount:1e5,InfiltrationMoneyValue:5e3,InfiltrationRepValue:1.4,InfiltrationExpPow:.8,WSEAccountCost:2e8,TIXAPICost:5e9,MarketData4SCost:1e9,MarketDataTixApi4SCost:25e9,StockMarketCommission:1e5,HospitalCostPerHp:1e5,IntelligenceCrimeWeight:.025,IntelligenceInfiltrationWeight:.1,IntelligenceCrimeBaseExpGain:.05,IntelligenceProgramBaseExpGain:2.5,IntelligenceTerminalHackBaseExpGain:200,IntelligenceSingFnBaseExpGain:1.5,IntelligenceClassBaseExpGain:.01,IntelligenceHackingMissionBaseExpGain:3,HackingMissionRepToDiffConversion:1e4,HackingMissionRepToRewardConversion:7,HackingMissionSpamTimeIncrease:25e3,HackingMissionTransferAttackIncrease:1.05,HackingMissionMiscDefenseIncrease:1.05,HackingMissionDifficultyToHacking:135,HackingMissionHowToPlay:"Hacking missions are a minigame that, if won, will reward you with faction reputation.<br><br>In this game you control a set of Nodes and use them to try and defeat an enemy. Your Nodes are colored blue, while the enemy's are red. There are also other nodes on the map colored gray that initially belong to neither you nor the enemy. The goal of the game is to capture all of the enemy's Database nodes within the time limit. If you fail to do this, you will lose.<br><br>Each Node has three stats: Attack, Defense, and HP. There are five different actions that a Node can take:<br><br> Attack - Targets an enemy Node and lowers its HP. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the enemy's defense.<br><br>Scan - Targets an enemy Node and lowers its Defense. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the enemy's defense.<br><br>Weaken - Targets an enemy Node and lowers its Attack. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the enemy's defense.<br><br>Fortify - Raises the Node's Defense. The effectiveness is determined by your hacking level.<br><br>Overflow - Raises the Node's Attack but lowers its Defense. The effectiveness is determined by your hacking level.<br><br>Note that when determining the effectiveness of the above actions, the TOTAL Attack or Defense of the team is used, not just the Attack/Defense of the individual Node that is performing the action.<br><br>To capture a Node, you must lower its HP down to 0.<br><br>There are six different types of Nodes:<br><br>CPU Core - These are your main Nodes that are used to perform actions. Capable of performing every action<br><br>Firewall - Nodes with high defense. These Nodes can 'Fortify'<br><br>Database - A special type of Node. The player's objective is to conquer all of the enemy's Database Nodes within the time limit. These Nodes cannot perform any actions<br><br>Spam - Conquering one of these Nodes will slow the enemy's trace, giving the player additional time to complete the mission. These Nodes cannot perform any actions<br><br>Transfer - Conquering one of these nodes will increase the Attack of all of your CPU Cores by a small fixed percentage. These Nodes are capable of performing every action except the 'Attack' action<br><br>Shield - Nodes with high defense. These Nodes can 'Fortify'<br><br>To assign an action to a Node, you must first select one of your Nodes. This can be done by simply clicking on it. Double-clicking a node will select all of your Nodes of the same type (e.g. select all CPU Core Nodes or all Transfer Nodes). Note that only Nodes that can perform actions (CPU Core, Transfer, Shield, Firewall) can be selected. Selected Nodes will be denoted with a white highlight. After selecting a Node or multiple Nodes, select its action using the Action Buttons near the top of the screen. Every action also has a corresponding keyboard shortcut.<br><br>For certain actions such as attacking, scanning, and weakening, the Node performing the action must have a target. To target another node, simply click-and-drag from the 'source' Node to a target. A Node can only have one target, and you can target any Node that is adjacent to one of your Nodes (immediately above, below, or to the side. NOT diagonal). Furthermore, only CPU Cores and Transfer Nodes can target, since they are the only ones that can perform the related actions. To remove a target, you can simply click on the line that represents the connection between one of your Nodes and its target. Alternatively, you can select the 'source' Node and click the 'Drop Connection' button, or press 'd'.<br><br>Other Notes:<br><br>-Whenever a miscellenaous Node (not owned by the player or enemy) is conquered, the defense of all remaining miscellaneous Nodes that are not actively being targeted will increase by a fixed percentage.<br><br>-Whenever a Node is conquered, its stats are significantly reduced<br><br>-Miscellaneous Nodes slowly raise their defense over time<br><br>-Nodes slowly regenerate health over time.",MillisecondsPer20Hours:72e6,GameCyclesPer20Hours:36e4,MillisecondsPer10Hours:36e6,GameCyclesPer10Hours:18e4,MillisecondsPer8Hours:288e5,GameCyclesPer8Hours:144e3,MillisecondsPer4Hours:144e5,GameCyclesPer4Hours:72e3,MillisecondsPer2Hours:72e5,GameCyclesPer2Hours:36e3,MillisecondsPerHour:36e5,GameCyclesPerHour:18e3,MillisecondsPerHalfHour:18e5,GameCyclesPerHalfHour:9e3,MillisecondsPerQuarterHour:9e5,GameCyclesPerQuarterHour:4500,MillisecondsPerFiveMinutes:3e5,GameCyclesPerFiveMinutes:1500,FactionWorkHacking:"Faction Hacking Work",FactionWorkField:"Faction Field Work",FactionWorkSecurity:"Faction Security Work",WorkTypeCompany:"Working for Company",WorkTypeCompanyPartTime:"Working for Company part-time",WorkTypeFaction:"Working for Faction",WorkTypeCreateProgram:"Working on Create a Program",WorkTypeStudyClass:"Studying or Taking a class at university",WorkTypeCrime:"Committing a crime",ClassStudyComputerScience:"studying Computer Science",ClassDataStructures:"taking a Data Structures course",ClassNetworks:"taking a Networks course",ClassAlgorithms:"taking an Algorithms course",ClassManagement:"taking a Management course",ClassLeadership:"taking a Leadership course",ClassGymStrength:"training your strength at a gym",ClassGymDefense:"training your defense at a gym",ClassGymDexterity:"training your dexterity at a gym",ClassGymAgility:"training your agility at a gym",ClassDataStructuresBaseCost:40,ClassNetworksBaseCost:80,ClassAlgorithmsBaseCost:320,ClassManagementBaseCost:160,ClassLeadershipBaseCost:320,ClassGymBaseCost:120,ClassStudyComputerScienceBaseExp:.5,ClassDataStructuresBaseExp:1,ClassNetworksBaseExp:2,ClassAlgorithmsBaseExp:4,ClassManagementBaseExp:2,ClassLeadershipBaseExp:4,CrimeShoplift:"shoplift",CrimeRobStore:"rob a store",CrimeMug:"mug someone",CrimeLarceny:"commit larceny",CrimeDrugs:"deal drugs",CrimeBondForgery:"forge corporate bonds",CrimeTraffickArms:"traffick illegal arms",CrimeHomicide:"commit homicide",CrimeGrandTheftAuto:"commit grand theft auto",CrimeKidnap:"kidnap someone for ransom",CrimeAssassination:"assassinate a high-profile target",CrimeHeist:"pull off the ultimate heist",CodingContractBaseFactionRepGain:2500,CodingContractBaseCompanyRepGain:4e3,CodingContractBaseMoneyGain:75e6,TotalNumBitNodes:24,LatestUpdate:"\n v0.50.2 - 2021-03-25 Everyone asked for this one. (hydroflame)\n -------\n BitNodeMultipliers\n * 'GangKarmaRequirements': a new multipler that influences how much karma is required to make a gang different bitnodes.\n\n Netscript\n * 'connect': a new singularity function that connects you to a server. (like the terminal command)\n * 'manualHack': a new singularity function that performs a manual hack on the players current server.\n * ns2 stack trace works on Firefox now.\n\n Misc.\n * New shortcut, Alt + b, brings you to bladeburner\n * New shortcut, Alt + g, brings you to gang\n "}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(48);function a(e){return e.every(r.isString)}t.replaceAt=function(e,t,n){return e.substr(0,t)+n+e.substr(t+n.length)},t.convertTimeMsToTimeElapsedString=function(e){const t=Math.floor(e/1e3),n=Math.floor(t/86400),r=t%86400,a=Math.floor(r/3600),i=r%3600,o=Math.floor(i/60);let s="";return n>0&&(s+=`${n} days `),a>0&&(s+=`${a} hours `),o>0&&(s+=`${o} minutes `),s+=`${i%60} seconds`},t.longestCommonStart=function(e){if(!a(e))return"";if(0===e.length)return"";const t=e.concat().sort(),n=t[0],r=t[t.length-1],i=n.length;let o=0;const s=(e,t)=>e.toUpperCase()===t.toUpperCase();for(;o<i&&s(n.charAt(o),r.charAt(o));)o++;return n.substring(0,o)},t.containsAllStrings=a,t.formatNumber=function(e,t){return e.toLocaleString(void 0,{maximumFractionDigits:t,minimumFractionDigits:t})},t.isHTML=function(e){const t=document.createElement("div");t.innerHTML=e;const n=t.childNodes;for(let e=n.length-1;e>=0;e--)if(1===n[e].nodeType)return!0;return!1},t.generateRandomString=function(e){let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"dialogBoxCreate",function(){return p}),n.d(t,"dialogBoxOpened",function(){return m});var r=n(24),a=n(321),i=n(1),o=n.n(i),s=n(46),l=n.n(s);let c=[];function u(){m&&0!==c.length&&(c[0].remove(),c.shift(),0==c.length?m=!1:c[0].style.visibility="visible")}e(document).click(function(t){m&&c.length>=1&&(e(t.target).closest(c[0]).length||u())}),e(document).on("click",".dialog-box-close-button",function(e){u()}),document.addEventListener("keydown",function(e){e.keyCode==r.KEY.ESC&&m&&(u(),e.preventDefault())});let m=!1;function p(e,t=!1){const n=document.createElement("div");n.setAttribute("class","dialog-box-container");let r=e;"string"==typeof e&&(r=t?o.a.createElement("pre",{dangerouslySetInnerHTML:{__html:e}}):o.a.createElement("p",{dangerouslySetInnerHTML:{__html:e.replace(/(?:\r\n|\r|\n)/g,"<br />")}})),l.a.render(Object(a.DialogBox)(r),n),document.body.appendChild(n),c.length>=1&&(n.style.visibility="hidden"),c.push(n),setTimeout(function(){m=!0},400)}}.call(this,n(86))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RamCostConstants={ScriptBaseRamCost:1.6,ScriptDomRamCost:25,ScriptHackRamCost:.1,ScriptHackAnalyzeRamCost:1,ScriptGrowRamCost:.15,ScriptGrowthAnalyzeRamCost:1,ScriptWeakenRamCost:.15,ScriptScanRamCost:.2,ScriptPortProgramRamCost:.05,ScriptRunRamCost:1,ScriptExecRamCost:1.3,ScriptSpawnRamCost:2,ScriptScpRamCost:.6,ScriptKillRamCost:.5,ScriptHasRootAccessRamCost:.05,ScriptGetHostnameRamCost:.05,ScriptGetHackingLevelRamCost:.05,ScriptGetMultipliersRamCost:4,ScriptGetServerRamCost:.1,ScriptFileExistsRamCost:.1,ScriptIsRunningRamCost:.1,ScriptHacknetNodesRamCost:4,ScriptHNUpgLevelRamCost:.4,ScriptHNUpgRamRamCost:.6,ScriptHNUpgCoreRamCost:.8,ScriptGetStockRamCost:2,ScriptBuySellStockRamCost:2.5,ScriptGetPurchaseServerRamCost:.25,ScriptPurchaseServerRamCost:2.25,ScriptGetPurchasedServerLimit:.05,ScriptGetPurchasedServerMaxRam:.05,ScriptRoundRamCost:.05,ScriptReadWriteRamCost:1,ScriptArbScriptRamCost:1,ScriptGetScriptRamCost:.1,ScriptGetHackTimeRamCost:.05,ScriptGetFavorToDonate:.1,ScriptCodingContractBaseRamCost:10,ScriptSleeveBaseRamCost:4,ScriptSingularityFn1RamCost:2,ScriptSingularityFn2RamCost:3,ScriptSingularityFn3RamCost:5,ScriptGangApiBaseRamCost:4,ScriptBladeburnerApiBaseRamCost:4},t.RamCosts={hacknet:{numNodes:()=>0,purchaseNode:()=>0,getPurchaseNodeCost:()=>0,getNodeStats:()=>0,upgradeLevel:()=>0,upgradeRam:()=>0,upgradeCore:()=>0,upgradeCache:()=>0,getLevelUpgradeCost:()=>0,getRamUpgradeCost:()=>0,getCoreUpgradeCost:()=>0,getCacheUpgradeCost:()=>0,numHashes:()=>0,hashCost:()=>0,spendHashes:()=>0},sprintf:()=>0,vsprintf:()=>0,scan:()=>t.RamCostConstants.ScriptScanRamCost,hack:()=>t.RamCostConstants.ScriptHackRamCost,hackAnalyzeThreads:()=>t.RamCostConstants.ScriptHackAnalyzeRamCost,hackAnalyzePercent:()=>t.RamCostConstants.ScriptHackAnalyzeRamCost,hackChance:()=>t.RamCostConstants.ScriptHackAnalyzeRamCost,sleep:()=>0,grow:()=>t.RamCostConstants.ScriptGrowRamCost,growthAnalyze:()=>t.RamCostConstants.ScriptGrowthAnalyzeRamCost,weaken:()=>t.RamCostConstants.ScriptWeakenRamCost,print:()=>0,tprint:()=>0,clearLog:()=>0,disableLog:()=>0,enableLog:()=>0,isLogEnabled:()=>0,getScriptLogs:()=>0,nuke:()=>t.RamCostConstants.ScriptPortProgramRamCost,brutessh:()=>t.RamCostConstants.ScriptPortProgramRamCost,ftpcrack:()=>t.RamCostConstants.ScriptPortProgramRamCost,relaysmtp:()=>t.RamCostConstants.ScriptPortProgramRamCost,httpworm:()=>t.RamCostConstants.ScriptPortProgramRamCost,sqlinject:()=>t.RamCostConstants.ScriptPortProgramRamCost,run:()=>t.RamCostConstants.ScriptRunRamCost,exec:()=>t.RamCostConstants.ScriptExecRamCost,spawn:()=>t.RamCostConstants.ScriptSpawnRamCost,kill:()=>t.RamCostConstants.ScriptKillRamCost,killall:()=>t.RamCostConstants.ScriptKillRamCost,exit:()=>0,scp:()=>t.RamCostConstants.ScriptScpRamCost,ls:()=>t.RamCostConstants.ScriptScanRamCost,ps:()=>t.RamCostConstants.ScriptScanRamCost,hasRootAccess:()=>t.RamCostConstants.ScriptHasRootAccessRamCost,getIp:()=>t.RamCostConstants.ScriptGetHostnameRamCost,getHostname:()=>t.RamCostConstants.ScriptGetHostnameRamCost,getHackingLevel:()=>t.RamCostConstants.ScriptGetHackingLevelRamCost,getHackingMultipliers:()=>t.RamCostConstants.ScriptGetMultipliersRamCost,getHacknetMultipliers:()=>t.RamCostConstants.ScriptGetMultipliersRamCost,getBitNodeMultipliers:()=>t.RamCostConstants.ScriptGetMultipliersRamCost,getServerMoneyAvailable:()=>t.RamCostConstants.ScriptGetServerRamCost,getServerSecurityLevel:()=>t.RamCostConstants.ScriptGetServerRamCost,getServerBaseSecurityLevel:()=>t.RamCostConstants.ScriptGetServerRamCost,getServerMinSecurityLevel:()=>t.RamCostConstants.ScriptGetServerRamCost,getServerRequiredHackingLevel:()=>t.RamCostConstants.ScriptGetServerRamCost,getServerMaxMoney:()=>t.RamCostConstants.ScriptGetServerRamCost,getServerGrowth:()=>t.RamCostConstants.ScriptGetServerRamCost,getServerNumPortsRequired:()=>t.RamCostConstants.ScriptGetServerRamCost,getServerRam:()=>t.RamCostConstants.ScriptGetServerRamCost,serverExists:()=>t.RamCostConstants.ScriptGetServerRamCost,fileExists:()=>t.RamCostConstants.ScriptFileExistsRamCost,isRunning:()=>t.RamCostConstants.ScriptIsRunningRamCost,getStockSymbols:()=>t.RamCostConstants.ScriptGetStockRamCost,getStockPrice:()=>t.RamCostConstants.ScriptGetStockRamCost,getStockAskPrice:()=>t.RamCostConstants.ScriptGetStockRamCost,getStockBidPrice:()=>t.RamCostConstants.ScriptGetStockRamCost,getStockPosition:()=>t.RamCostConstants.ScriptGetStockRamCost,getStockMaxShares:()=>t.RamCostConstants.ScriptGetStockRamCost,getStockPurchaseCost:()=>t.RamCostConstants.ScriptGetStockRamCost,getStockSaleGain:()=>t.RamCostConstants.ScriptGetStockRamCost,buyStock:()=>t.RamCostConstants.ScriptBuySellStockRamCost,sellStock:()=>t.RamCostConstants.ScriptBuySellStockRamCost,shortStock:()=>t.RamCostConstants.ScriptBuySellStockRamCost,sellShort:()=>t.RamCostConstants.ScriptBuySellStockRamCost,placeOrder:()=>t.RamCostConstants.ScriptBuySellStockRamCost,cancelOrder:()=>t.RamCostConstants.ScriptBuySellStockRamCost,getOrders:()=>t.RamCostConstants.ScriptBuySellStockRamCost,getStockVolatility:()=>t.RamCostConstants.ScriptBuySellStockRamCost,getStockForecast:()=>t.RamCostConstants.ScriptBuySellStockRamCost,purchase4SMarketData:()=>t.RamCostConstants.ScriptBuySellStockRamCost,purchase4SMarketDataTixApi:()=>t.RamCostConstants.ScriptBuySellStockRamCost,getPurchasedServerLimit:()=>t.RamCostConstants.ScriptGetPurchasedServerLimit,getPurchasedServerMaxRam:()=>t.RamCostConstants.ScriptGetPurchasedServerMaxRam,getPurchasedServerCost:()=>t.RamCostConstants.ScriptGetPurchaseServerRamCost,purchaseServer:()=>t.RamCostConstants.ScriptPurchaseServerRamCost,deleteServer:()=>t.RamCostConstants.ScriptPurchaseServerRamCost,getPurchasedServers:()=>t.RamCostConstants.ScriptPurchaseServerRamCost,write:()=>t.RamCostConstants.ScriptReadWriteRamCost,tryWrite:()=>t.RamCostConstants.ScriptReadWriteRamCost,read:()=>t.RamCostConstants.ScriptReadWriteRamCost,peek:()=>t.RamCostConstants.ScriptReadWriteRamCost,clear:()=>t.RamCostConstants.ScriptReadWriteRamCost,getPortHandle:()=>10*t.RamCostConstants.ScriptReadWriteRamCost,rm:()=>t.RamCostConstants.ScriptReadWriteRamCost,scriptRunning:()=>t.RamCostConstants.ScriptArbScriptRamCost,scriptKill:()=>t.RamCostConstants.ScriptArbScriptRamCost,getScriptName:()=>0,getScriptRam:()=>t.RamCostConstants.ScriptGetScriptRamCost,getHackTime:()=>t.RamCostConstants.ScriptGetHackTimeRamCost,getGrowTime:()=>t.RamCostConstants.ScriptGetHackTimeRamCost,getWeakenTime:()=>t.RamCostConstants.ScriptGetHackTimeRamCost,getScriptIncome:()=>t.RamCostConstants.ScriptGetScriptRamCost,getScriptExpGain:()=>t.RamCostConstants.ScriptGetScriptRamCost,nFormat:()=>0,getTimeSinceLastAug:()=>t.RamCostConstants.ScriptGetHackTimeRamCost,prompt:()=>0,wget:()=>0,getFavorToDonate:()=>t.RamCostConstants.ScriptGetFavorToDonate,universityCourse:()=>t.RamCostConstants.ScriptSingularityFn1RamCost,gymWorkout:()=>t.RamCostConstants.ScriptSingularityFn1RamCost,travelToCity:()=>t.RamCostConstants.ScriptSingularityFn1RamCost,purchaseTor:()=>t.RamCostConstants.ScriptSingularityFn1RamCost,purchaseProgram:()=>t.RamCostConstants.ScriptSingularityFn1RamCost,connect:()=>t.RamCostConstants.ScriptSingularityFn1RamCost,manualHack:()=>t.RamCostConstants.ScriptSingularityFn1RamCost,getStats:()=>t.RamCostConstants.ScriptSingularityFn1RamCost/4,getCharacterInformation:()=>t.RamCostConstants.ScriptSingularityFn1RamCost/4,isBusy:()=>t.RamCostConstants.ScriptSingularityFn1RamCost/4,stopAction:()=>t.RamCostConstants.ScriptSingularityFn1RamCost/2,upgradeHomeRam:()=>t.RamCostConstants.ScriptSingularityFn2RamCost,getUpgradeHomeRamCost:()=>t.RamCostConstants.ScriptSingularityFn2RamCost/2,workForCompany:()=>t.RamCostConstants.ScriptSingularityFn2RamCost,applyToCompany:()=>t.RamCostConstants.ScriptSingularityFn2RamCost,getCompanyRep:()=>t.RamCostConstants.ScriptSingularityFn2RamCost/3,getCompanyFavor:()=>t.RamCostConstants.ScriptSingularityFn2RamCost/3,getCompanyFavorGain:()=>t.RamCostConstants.ScriptSingularityFn2RamCost/4,checkFactionInvitations:()=>t.RamCostConstants.ScriptSingularityFn2RamCost,joinFaction:()=>t.RamCostConstants.ScriptSingularityFn2RamCost,workForFaction:()=>t.RamCostConstants.ScriptSingularityFn2RamCost,getFactionRep:()=>t.RamCostConstants.ScriptSingularityFn2RamCost/3,getFactionFavor:()=>t.RamCostConstants.ScriptSingularityFn2RamCost/3,getFactionFavorGain:()=>t.RamCostConstants.ScriptSingularityFn2RamCost/4,donateToFaction:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,createProgram:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,commitCrime:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,getCrimeChance:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,getCrimeStats:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,getOwnedAugmentations:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,getOwnedSourceFiles:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,getAugmentationsFromFaction:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,getAugmentationPrereq:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,getAugmentationCost:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,getAugmentationStats:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,purchaseAugmentation:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,softReset:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,installAugmentations:()=>t.RamCostConstants.ScriptSingularityFn3RamCost,gang:{getMemberNames:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/4,getGangInformation:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/2,getOtherGangInformation:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/2,getMemberInformation:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/2,canRecruitMember:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/4,recruitMember:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/2,getTaskNames:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/4,getTaskStats:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/4,setMemberTask:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/2,getEquipmentNames:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/4,getEquipmentCost:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/2,getEquipmentType:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/2,getEquipmentStats:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/2,purchaseEquipment:()=>t.RamCostConstants.ScriptGangApiBaseRamCost,ascendMember:()=>t.RamCostConstants.ScriptGangApiBaseRamCost,setTerritoryWarfare:()=>t.RamCostConstants.ScriptGangApiBaseRamCost/2,getChanceToWinClash:()=>t.RamCostConstants.ScriptGangApiBaseRamCost,getBonusTime:()=>0},bladeburner:{getContractNames:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost/10,getOperationNames:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost/10,getBlackOpNames:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost/10,getBlackOpRank:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost/2,getGeneralActionNames:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost/10,getSkillNames:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost/10,startAction:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,stopBladeburnerAction:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost/2,getCurrentAction:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost/4,getActionTime:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getActionEstimatedSuccessChance:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getActionRepGain:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getActionCountRemaining:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getActionMaxLevel:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getActionCurrentLevel:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getActionAutolevel:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,setActionAutolevel:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,setActionLevel:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getRank:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getSkillPoints:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getSkillLevel:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getSkillUpgradeCost:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,upgradeSkill:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getTeamSize:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,setTeamSize:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getCityEstimatedPopulation:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getCityEstimatedCommunities:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getCityChaos:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getCity:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,switchCity:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getStamina:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,joinBladeburnerFaction:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,joinBladeburnerDivision:()=>t.RamCostConstants.ScriptBladeburnerApiBaseRamCost,getBonusTime:()=>0},codingcontract:{attempt:()=>t.RamCostConstants.ScriptCodingContractBaseRamCost,getContractType:()=>t.RamCostConstants.ScriptCodingContractBaseRamCost/2,getData:()=>t.RamCostConstants.ScriptCodingContractBaseRamCost/2,getDescription:()=>t.RamCostConstants.ScriptCodingContractBaseRamCost/2,getNumTriesRemaining:()=>t.RamCostConstants.ScriptCodingContractBaseRamCost/5},sleeve:{getNumSleeves:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,setToShockRecovery:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,setToSynchronize:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,setToCommitCrime:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,setToUniversityCourse:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,travel:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,setToCompanyWork:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,setToFactionWork:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,setToGymWorkout:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,getSleeveStats:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,getTask:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,getInformation:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,getSleeveAugmentations:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,getSleevePurchasableAugs:()=>t.RamCostConstants.ScriptSleeveBaseRamCost,purchaseSleeveAug:()=>t.RamCostConstants.ScriptSleeveBaseRamCost},heart:{break:()=>0}},t.getRamCost=function(...e){if(0===e.length)return console.warn("No arguments passed to getRamCost()"),0;let n=t.RamCosts[e[0]];for(let t=1;t<e.length;++t){if(null==n)return console.warn(`Invalid function passed to getRamCost: ${e}`),0;const r=typeof n;if("function"===r||"number"===r)break;n=n[e[t]]}const r=typeof n;return"function"===r?n():"number"===r?n:(console.warn(`Unexpected type (${r}) for value [${e}]`),0)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Augmentations={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Terminal="Terminal",e.CharacterInfo="CharacterInfo",e.ScriptEditor="ScriptEditor",e.ActiveScripts="ActiveScripts",e.HacknetNodes="HacknetNodes",e.CreateProgram="CreateProgram",e.Factions="Factions",e.Faction="Faction",e.Augmentations="Augmentations",e.Tutorial="Tutorial",e.DevMenu="Dev Menu",e.Location="Location",e.workInProgress="WorkInProgress",e.RedPill="RedPill",e.CinematicText="CinematicText",e.Infiltration="Infiltration",e.StockMarket="StockMarket",e.Gang="Gang",e.Mission="Mission",e.Corporation="Corporation",e.Bladeburner="Bladeburner",e.Sleeves="Sleeves",e.Resleeves="Re-sleeving"}(t.Page||(t.Page={}));t.routing=new class{constructor(){this.currentPage=null}isOn(e){return this.currentPage===e}navigateTo(e){this.currentPage=e}}},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"Engine",function(){return le});var r=n(7),a=n(110),i=n(10),o=n(71),s=n(4),l=n(95),c=n(70),u=n(278),m=n(180),p=n(123),h=n(25),d=n(30),_=n(6),g=n(220),y=n(13),f=n(50),b=n(35),E=n(23),v=n(39),k=n(36),C=n(186),T=n(68),P=n(69),S=n(89),O=n(57),M=n(0),x=n(120),w=n(162),A=n(80),N=n(93),R=n(72),D=n(20),I=n(17),B=n(38),L=n(40),W=n(42),F=n(59),j=n(124),U=n(185),H=n(219),G=n(102),K=n(276),$=n(11),q=n(2),Y=n(275),z=n(218),V=n(274),J=n(31),X=n(8),Q=n(135),Z=n(44),ee=n(3),te=n(49),ne=n(217),re=n(24),ae=(n(382),n(381),n(1)),ie=n.n(ae),oe=n(46),se=n.n(oe);e(document).keydown(function(e){if(!0!==I.Settings.DisableHotkeys){try{if(Object(R.b)().isFocused())return}catch(e){}if(!(M.Player.isWorking||A.b||P.c||m.a))if(e.keyCode==re.KEY.T&&e.altKey)e.preventDefault(),le.loadTerminalContent();else if(e.keyCode===re.KEY.C&&e.altKey)e.preventDefault(),le.loadCharacterContent();else if(e.keyCode===re.KEY.E&&e.altKey)e.preventDefault(),le.loadScriptEditorContent();else if(e.keyCode===re.KEY.S&&e.altKey)e.preventDefault(),le.loadActiveScriptsContent();else if(e.keyCode===re.KEY.H&&e.altKey)e.preventDefault(),le.loadHacknetNodesContent();else if(e.keyCode===re.KEY.W&&e.altKey)e.preventDefault(),le.loadLocationContent();else if(e.keyCode===re.KEY.J&&e.altKey)e.preventDefault(),le.loadJobContent();else if(e.keyCode===re.KEY.R&&e.altKey)e.preventDefault(),le.loadTravelContent();else if(e.keyCode===re.KEY.P&&e.altKey)e.preventDefault(),le.loadCreateProgramContent();else if(e.keyCode===re.KEY.F&&e.altKey){if($.routing.isOn($.Page.Terminal)&&b.FconfSettings.ENABLE_BASH_HOTKEYS)return;e.preventDefault(),le.loadFactionsContent()}else e.keyCode===re.KEY.A&&e.altKey?(e.preventDefault(),le.loadAugmentationsContent()):e.keyCode===re.KEY.U&&e.altKey?(e.preventDefault(),le.loadTutorialContent()):e.keyCode===re.KEY.B&&e.altKey?(e.preventDefault(),le.loadBladeburnerContent()):e.keyCode===re.KEY.G&&e.altKey&&(e.preventDefault(),le.loadGangContent());e.keyCode===re.KEY.O&&e.altKey&&(e.preventDefault(),Object(Q.b)())}});const le={version:"",Debug:!0,Clickables:{saveMainMenuButton:null,deleteMainMenuButton:null},Display:{terminalContent:null,characterContent:null,scriptEditorContent:null,activeScriptsContent:null,hacknetNodesContent:null,createProgramContent:null,factionsContent:null,factionContent:null,augmentationsContent:null,tutorialContent:null,infiltrationContent:null,stockMarketContent:null,locationContent:null,workInProgressContent:null,redPillContent:null,cinematicTextContent:null,missionContent:null,characterInfo:null},_lastUpdate:(new Date).getTime(),_idleSpeed:200,loadTerminalContent:function(){le.hideAllContent(),le.Display.terminalContent.style.display="block",$.routing.navigateTo($.Page.Terminal),J.MainMenuLinks.Terminal.classList.add("active")},loadCharacterContent:function(){le.hideAllContent(),le.Display.characterContent.style.display="block",le.updateCharacterInfo(),$.routing.navigateTo($.Page.CharacterInfo),J.MainMenuLinks.Stats.classList.add("active")},loadScriptEditorContent:function(e="",t=""){le.hideAllContent(),le.Display.scriptEditorContent.style.display="block";try{Object(R.b)().openScript(e,t)}catch(e){Object(te.exceptionAlert)(e)}Object(R.e)(),$.routing.navigateTo($.Page.ScriptEditor),J.MainMenuLinks.ScriptEditor.classList.add("active")},loadActiveScriptsContent:function(){le.hideAllContent(),le.Display.activeScriptsContent.style.display="block",$.routing.navigateTo($.Page.ActiveScripts),se.a.render(ie.a.createElement(z.ActiveScriptsRoot,{p:M.Player,workerScripts:S.workerScripts}),le.Display.activeScriptsContent),J.MainMenuLinks.ActiveScripts.classList.add("active")},loadHacknetNodesContent:function(){le.hideAllContent(),le.Display.hacknetNodesContent.style.display="block",$.routing.navigateTo($.Page.HacknetNodes),Object(E.q)(),J.MainMenuLinks.HacknetNodes.classList.add("active")},loadCreateProgramContent:function(){le.hideAllContent(),le.Display.createProgramContent.style.display="block",Object(w.a)(),$.routing.navigateTo($.Page.CreateProgram),J.MainMenuLinks.CreateProgram.classList.add("active")},loadFactionsContent:function(){le.hideAllContent(),le.Display.factionsContent.style.display="block",le.displayFactionsInfo(),$.routing.navigateTo($.Page.Factions),J.MainMenuLinks.Factions.classList.add("active")},loadFactionContent:function(){le.hideAllContent(),le.Display.factionContent.style.display="block",$.routing.navigateTo($.Page.Faction)},loadAugmentationsContent:function(){le.hideAllContent(),le.Display.augmentationsContent.style.display="block",$.routing.navigateTo($.Page.Augmentations),Object(o.c)(le.Display.augmentationsContent),J.MainMenuLinks.Augmentations.classList.add("active")},loadTutorialContent:function(){le.hideAllContent(),le.Display.tutorialContent.style.display="block",$.routing.navigateTo($.Page.Tutorial),J.MainMenuLinks.Tutorial.classList.add("active")},loadDevMenuContent:function(){le.hideAllContent(),Object(g.b)(),$.routing.navigateTo($.Page.DevMenu),J.MainMenuLinks.DevMenu.classList.add("active")},loadLocationContent:function(e=!0){le.hideAllContent(),le.Display.locationContent.style.display="block",J.MainMenuLinks.City.classList.add("active"),$.routing.navigateTo($.Page.Location);const t=ie.a.createElement(C.LocationRoot,{initiallyInCity:e,engine:le,p:M.Player});se.a.render(t,le.Display.locationContent)},loadTravelContent:function(){le.hideAllContent(),M.Player.gotoLocation(k.LocationName.TravelAgency),le.Display.locationContent.style.display="block",J.MainMenuLinks.Travel.classList.add("active"),$.routing.navigateTo($.Page.Location);const e=ie.a.createElement(C.LocationRoot,{initiallyInCity:!1,engine:le,p:M.Player});se.a.render(e,le.Display.locationContent)},loadJobContent:function(){if(""==M.Player.companyName)return void Object(X.dialogBoxCreate)("You do not currently have a job! You can visit various companies in the city and try to find a job.");le.hideAllContent(),M.Player.gotoLocation(M.Player.companyName),le.Display.locationContent.style.display="block",J.MainMenuLinks.Job.classList.add("active"),$.routing.navigateTo($.Page.Location);const e=ie.a.createElement(C.LocationRoot,{initiallyInCity:!1,engine:le,p:M.Player});se.a.render(e,le.Display.locationContent)},loadWorkInProgressContent:function(){le.hideAllContent(),document.getElementById("mainmenu-container").style.visibility="hidden",le.Display.workInProgressContent.style.display="block",$.routing.navigateTo($.Page.WorkInProgress)},loadRedPillContent:function(){le.hideAllContent(),document.getElementById("mainmenu-container").style.visibility="hidden",le.Display.redPillContent.style.display="block",$.routing.navigateTo($.Page.RedPill)},loadCinematicTextContent:function(){le.hideAllContent(),document.getElementById("mainmenu-container").style.visibility="hidden",le.Display.cinematicTextContent.style.display="block",$.routing.navigateTo($.Page.CinematicText)},loadInfiltrationContent:function(){le.hideAllContent(),le.Display.infiltrationContent.style.display="block",$.routing.navigateTo($.Page.Infiltration)},loadStockMarketContent:function(){le.hideAllContent(),le.Display.stockMarketContent.style.display="block",$.routing.navigateTo($.Page.StockMarket),Object(W.displayStockMarketContent)()},loadGangContent:function(){le.hideAllContent(),document.getElementById("gang-container")||M.Player.inGang()?(M.Player.gang.displayGangContent(M.Player),$.routing.navigateTo($.Page.Gang)):(le.loadTerminalContent(),$.routing.navigateTo($.Page.Terminal))},loadMissionContent:function(){le.hideAllContent(),document.getElementById("mainmenu-container").style.visibility="hidden",document.getElementById("character-overview-wrapper").style.visibility="hidden",le.Display.missionContent.style.display="block",$.routing.navigateTo($.Page.Mission)},loadCorporationContent:function(){M.Player.corporation instanceof d.c&&(le.hideAllContent(),document.getElementById("character-overview-wrapper").style.visibility="hidden",$.routing.navigateTo($.Page.Corporation),M.Player.corporation.createUI())},loadBladeburnerContent:function(){if(M.Player.bladeburner instanceof c.a)try{le.hideAllContent(),$.routing.navigateTo($.Page.Bladeburner),M.Player.bladeburner.createContent()}catch(e){Object(te.exceptionAlert)(e)}},loadSleevesContent:function(){try{le.hideAllContent(),$.routing.navigateTo($.Page.Sleeves),Object(U.createSleevesPage)(M.Player)}catch(e){Object(te.exceptionAlert)(e)}},loadResleevingContent:function(){try{le.hideAllContent(),$.routing.navigateTo($.Page.Resleeves),Object(H.createResleevesPage)(M.Player)}catch(e){Object(te.exceptionAlert)(e)}},hideAllContent:function(){le.Display.terminalContent.style.display="none",le.Display.characterContent.style.display="none",le.Display.scriptEditorContent.style.display="none",le.Display.activeScriptsContent.style.display="none",se.a.unmountComponentAtNode(le.Display.activeScriptsContent),Object(E.a)(),le.Display.createProgramContent.style.display="none",le.Display.factionsContent.style.display="none",le.Display.factionContent.style.display="none",se.a.unmountComponentAtNode(le.Display.factionContent),le.Display.augmentationsContent.style.display="none",se.a.unmountComponentAtNode(le.Display.augmentationsContent),le.Display.tutorialContent.style.display="none",le.Display.locationContent.style.display="none",se.a.unmountComponentAtNode(le.Display.locationContent),le.Display.workInProgressContent.style.display="none",le.Display.redPillContent.style.display="none",le.Display.cinematicTextContent.style.display="none",le.Display.infiltrationContent.style.display="none",le.Display.stockMarketContent.style.display="none",le.Display.missionContent.style.display="none",document.getElementById("gang-container")&&(document.getElementById("gang-container").style.display="none"),M.Player.inGang()&&M.Player.gang.clearUI(),M.Player.corporation instanceof d.c&&M.Player.corporation.clearUI(),M.Player.bladeburner instanceof c.a&&M.Player.bladeburner.clearContent(),Object(H.clearResleevesPage)(),Object(U.clearSleevesPage)(),le.inactivateMainMenuLinks(),Object(g.a)()},inactivateMainMenuLinks:function(){J.MainMenuLinks.Terminal.classList.remove("active"),J.MainMenuLinks.ScriptEditor.classList.remove("active"),J.MainMenuLinks.ActiveScripts.classList.remove("active"),J.MainMenuLinks.CreateProgram.classList.remove("active"),J.MainMenuLinks.Stats.classList.remove("active"),J.MainMenuLinks.Factions.classList.remove("active"),J.MainMenuLinks.Augmentations.classList.remove("active"),J.MainMenuLinks.HacknetNodes.classList.remove("active"),J.MainMenuLinks.Sleeves.classList.remove("active"),J.MainMenuLinks.City.classList.remove("active"),J.MainMenuLinks.Travel.classList.remove("active"),J.MainMenuLinks.Job.classList.remove("active"),J.MainMenuLinks.StockMarket.classList.remove("active"),J.MainMenuLinks.Bladeburner.classList.remove("active"),J.MainMenuLinks.Corporation.classList.remove("active"),J.MainMenuLinks.Gang.classList.remove("active"),J.MainMenuLinks.Tutorial.classList.remove("active"),J.MainMenuLinks.Options.classList.remove("active"),J.MainMenuLinks.DevMenu.classList.remove("active")},displayCharacterOverviewInfo:function(){se.a.render(ie.a.createElement(u.a,null),document.getElementById("character-overview-text"));const e=document.getElementById("character-overview-save-button");I.Settings.AutosaveInterval?e.classList.remove("flashing-button"):e.classList.add("flashing-button")},updateCharacterInfo:function(){se.a.render(Object(K.CharacterInfo)(M.Player),le.Display.characterInfo)},displayFactionsInfo:function(){Object(Z.removeChildrenFromElement)(le.Display.factionsContent),le.Display.factionsContent.appendChild(Object(ee.createElement)("h1",{innerText:"Factions"})),le.Display.factionsContent.appendChild(Object(ee.createElement)("p",{innerText:"Lists all factions you have joined"}));var e=Object(ee.createElement)("ul");le.Display.factionsContent.appendChild(Object(ee.createElement)("br"));for(var t=0;t<M.Player.factions.length;++t)!function(){var n=M.Player.factions[t];e.appendChild(Object(ee.createElement)("a",{class:"a-link-button",innerText:n,padding:"4px",margin:"4px",display:"inline-block",clickListener:()=>(le.loadFactionContent(),Object(f.displayFactionContent)(n),!1)})),e.appendChild(Object(ee.createElement)("br"))}();le.Display.factionsContent.appendChild(e),le.Display.factionsContent.appendChild(Object(ee.createElement)("br")),le.Display.factionsContent.appendChild(Object(ee.createElement)("h1",{innerText:"Outstanding Faction Invitations"})),le.Display.factionsContent.appendChild(Object(ee.createElement)("p",{width:"70%",innerText:"Lists factions you have been invited to, as well as factions you have previously rejected. You can accept these faction invitations at any time."}));var n=Object(ee.createElement)("ul");for(t=0;t<M.Player.factionInvitations.length;++t)!function(){var e=M.Player.factionInvitations[t],r=Object(ee.createElement)("li",{padding:"6px",margin:"6px"});r.appendChild(Object(ee.createElement)("p",{innerText:e,display:"inline",margin:"4px",padding:"4px"})),r.appendChild(Object(ee.createElement)("a",{innerText:"Accept Faction Invitation",class:"a-link-button",display:"inline",margin:"4px",padding:"4px",clickListener:t=>{if(!t.isTrusted)return!1;Object(f.joinFaction)(y.Factions[e]);for(var n=0;n<M.Player.factionInvitations.length;++n)(M.Player.factionInvitations[n]==e||y.Factions[M.Player.factionInvitations[n]].isBanned)&&(M.Player.factionInvitations.splice(n,1),n--);return le.displayFactionsInfo(),!1}})),n.appendChild(r)}();le.Display.factionsContent.appendChild(n)},idleTimer:function(){var e=(new Date).getTime(),t=e-le._lastUpdate,n=t%le._idleSpeed;(t=Math.floor(t/le._idleSpeed))>0&&(le._lastUpdate=e-n,M.Player.lastUpdate=e-n,le.updateGame(t)),window.requestAnimationFrame(le.idleTimer)},updateGame:function(e=1){var t=e*le._idleSpeed;null==M.Player.totalPlaytime&&(M.Player.totalPlaytime=0),null==M.Player.playtimeSinceLastAug&&(M.Player.playtimeSinceLastAug=0),null==M.Player.playtimeSinceLastBitnode&&(M.Player.playtimeSinceLastBitnode=0),M.Player.totalPlaytime+=t,M.Player.playtimeSinceLastAug+=t,M.Player.playtimeSinceLastBitnode+=t,!0===F.a.actionStarted&&(le._totalActionTime=F.a.actionTime,le._actionTimeLeft=F.a.actionTime,le._actionInProgress=!0,le._actionProgressBarCount=1,le._actionProgressStr="[ ]",le._actionTimeStr="Time left: ",F.a.actionStarted=!1),M.Player.isWorking&&(M.Player.workType==_.CONSTANTS.WorkTypeFaction?M.Player.workForFaction(e):M.Player.workType==_.CONSTANTS.WorkTypeCreateProgram?M.Player.createProgramWork(e):M.Player.workType==_.CONSTANTS.WorkTypeStudyClass?M.Player.takeClass(e):M.Player.workType==_.CONSTANTS.WorkTypeCrime?M.Player.commitCrime(e):M.Player.workType==_.CONSTANTS.WorkTypeCompanyPartTime?M.Player.workPartTime(e):M.Player.work(e)),M.Player.hasWseAccount&&Object(W.processStockPrices)(e),M.Player.inGang()&&M.Player.gang.process(e,M.Player),P.c&&P.b&&P.b.process(e),M.Player.corporation instanceof d.c&&M.Player.corporation.storeCycles(e),M.Player.bladeburner instanceof c.a&&M.Player.bladeburner.storeCycles(e);for(let t=0;t<M.Player.sleeves.length;++t)if(M.Player.sleeves[t]instanceof j.Sleeve){const n=M.Player.sleeves[t].process(M.Player,e);if(null==n)continue;for(let r=0;r<M.Player.sleeves.length;++r)r!==t&&M.Player.sleeves[r].gainExperience(M.Player,n,e,!0)}le.decrementAllCounters(e),le.checkCounters(),1==le._actionInProgress&&le.updateHackProgress(e),Object(O.f)(e),Object(E.j)(e)},Counters:{autoSaveCounter:300,updateSkillLevelsCounter:10,updateDisplays:3,updateDisplaysMed:9,updateDisplaysLong:15,updateActiveScriptsDisplay:5,createProgramNotifications:10,augmentationsNotifications:10,checkFactionInvitations:100,passiveFactionGrowth:600,messages:150,mechanicProcess:5,contractGeneration:3e3},decrementAllCounters:function(e=1){for(var t in le.Counters)le.Counters.hasOwnProperty(t)&&(le.Counters[t]=le.Counters[t]-e)},checkCounters:function(){if(le.Counters.autoSaveCounter<=0&&(null==I.Settings.AutosaveInterval&&(I.Settings.AutosaveInterval=60),0===I.Settings.AutosaveInterval?le.Counters.autoSaveCounter=1/0:(le.Counters.autoSaveCounter=5*I.Settings.AutosaveInterval,N.b.saveGame(ce))),le.Counters.updateSkillLevelsCounter<=0&&(M.Player.updateSkillLevels(),le.Counters.updateSkillLevelsCounter=10),le.Counters.updateActiveScriptsDisplay<=0&&($.routing.isOn($.Page.ActiveScripts)&&se.a.render(ie.a.createElement(z.ActiveScriptsRoot,{p:M.Player,workerScripts:S.workerScripts}),le.Display.activeScriptsContent),le.Counters.updateActiveScriptsDisplay=5),le.Counters.updateDisplays<=0&&(le.displayCharacterOverviewInfo(),$.routing.isOn($.Page.HacknetNodes)?Object(E.q)():$.routing.isOn($.Page.CreateProgram)?Object(w.a)():$.routing.isOn($.Page.Sleeves)&&Object(U.updateSleevesPage)(),a.logBoxOpened&&Object(a.logBoxUpdateText)(),le.Counters.updateDisplays=3),le.Counters.updateDisplaysMed<=0&&($.routing.isOn($.Page.CharacterInfo)&&le.updateCharacterInfo(),le.Counters.updateDisplaysMed=9),le.Counters.updateDisplaysLong<=0&&($.routing.isOn($.Page.Gang)&&M.Player.inGang()?M.Player.gang.updateGangContent():$.routing.isOn($.Page.ScriptEditor)&&Object(R.e)(),le.Counters.updateDisplaysLong=15),le.Counters.createProgramNotifications<=0){var e=Object(w.b)(),t=document.getElementById("create-program-notification");e>0?(t.innerHTML=e,t.setAttribute("class","notification-on")):(t.innerHTML="",t.setAttribute("class","notification-off")),le.Counters.createProgramNotifications=10}if(le.Counters.augmentationsNotifications<=0){e=M.Player.queuedAugmentations.length,t=document.getElementById("augmentations-notification");e>0?(t.innerHTML=e,t.setAttribute("class","notification-on")):(t.innerHTML="",t.setAttribute("class","notification-off")),le.Counters.augmentationsNotifications=10}if(le.Counters.checkFactionInvitations<=0){var n=M.Player.checkForFactionInvitations();if(n.length>0){!1===M.Player.firstFacInvRecvd&&(M.Player.firstFacInvRecvd=!0,document.getElementById("factions-tab").style.display="list-item",document.getElementById("character-menu-header").click(),document.getElementById("character-menu-header").click());var r=n[Math.floor(Math.random()*n.length)];Object(f.inviteToFaction)(r)}const e=M.Player.factionInvitations.length,t=document.getElementById("factions-notification");e>0?(t.innerHTML=e,t.setAttribute("class","notification-on")):(t.innerHTML="",t.setAttribute("class","notification-off")),le.Counters.checkFactionInvitations=100}if(le.Counters.passiveFactionGrowth<=0){var o=Math.floor(600-le.Counters.passiveFactionGrowth);Object(f.processPassiveFactionRepGain)(o),le.Counters.passiveFactionGrowth=600}if(le.Counters.messages<=0&&(Object(T.b)(),i.Augmentations[s.AugmentationNames.TheRedPill].owned?le.Counters.messages=4500:le.Counters.messages=150),le.Counters.mechanicProcess<=0){if(M.Player.corporation instanceof d.c&&M.Player.corporation.process(),M.Player.bladeburner instanceof c.a)try{M.Player.bladeburner.process()}catch(e){Object(te.exceptionAlert)("Exception caught in Bladeburner.process(): "+e)}le.Counters.mechanicProcess=5}le.Counters.contractGeneration<=0&&(Math.random()<=.25&&Object(p.generateRandomContract)(),le.Counters.contractGeneration=3e3)},_totalActionTime:0,_actionTimeLeft:0,_actionTimeStr:"Time left: ",_actionProgressStr:"[ ]",_actionProgressBarCount:1,_actionInProgress:!1,updateHackProgress:function(e=1){var t=e*le._idleSpeed;le._actionTimeLeft-=t/1e3,le._actionTimeLeft=Math.max(le._actionTimeLeft,0);for(var n=Math.round(100*(1-le._actionTimeLeft/le._totalActionTime));2*le._actionProgressBarCount<=n;)le._actionProgressStr=Object(r.replaceAt)(le._actionProgressStr,le._actionProgressBarCount,"|"),le._actionProgressBarCount+=1;le._actionTimeStr="Time left: "+Math.max(0,Math.round(le._actionTimeLeft)).toString()+"s",document.getElementById("hack-progress").innerHTML=le._actionTimeStr,document.getElementById("hack-progress-bar").innerHTML=le._actionProgressStr.replace(/ /g," "),n>=100&&(le._actionInProgress=!1,F.a.finishAction())},closeMainMenuHeader:function(e){for(var t=0;t<e.length;++t)e[t].style.maxHeight=null,e[t].style.opacity=0,e[t].style.pointerEvents="none"},openMainMenuHeader:function(e){for(var t=0;t<e.length;++t)e[t].style.maxHeight=e[t].scrollHeight+"px",e[t].style.display="block"},toggleMainMenuHeader:function(e,t,n){for(var r=0;r<t.length;++r)e?(t[r].style.opacity=1,t[r].style.maxHeight=t[r].scrollHeight+"px"):(t[r].style.opacity=0,t[r].style.maxHeight=null);for(r=0;r<n.length;++r)e?(n[r].style.opacity=1,n[r].style.maxHeight=n[r].scrollHeight+"px",n[r].style.pointerEvents="auto"):(n[r].style.opacity=0,n[r].style.maxHeight=null,n[r].style.pointerEvents="none")},load:function(e){const t=document.getElementById("terminal-tab"),n=document.getElementById("create-script-tab"),a=document.getElementById("active-scripts-tab"),i=document.getElementById("create-program-tab"),s=document.getElementById("stats-tab"),u=document.getElementById("factions-tab"),m=document.getElementById("augmentations-tab"),p=document.getElementById("hacknet-nodes-tab"),g=document.getElementById("city-tab"),b=document.getElementById("travel-tab"),k=document.getElementById("job-tab"),C=document.getElementById("stock-market-tab"),P=document.getElementById("bladeburner-tab"),S=document.getElementById("corporation-tab"),x=document.getElementById("gang-tab"),w=document.getElementById("tutorial-tab"),A=document.getElementById("options-tab"),I=document.getElementById("dev-tab");if(Object(N.a)(e)){Object(l.initBitNodeMultipliers)(M.Player),le.setDisplayElements(),le.init(),Object(o.d)(),M.Player.reapplyAllSourceFiles(),M.Player.hasWseAccount&&Object(W.initSymbolToStockMap)(),Object(B.updateSourceFileFlags)(M.Player),le._lastUpdate=(new Date).getTime();var U=M.Player.lastUpdate,H=Math.floor((le._lastUpdate-U)/le._idleSpeed),G=Object(O.b)();M.Player.isWorking&&(M.Player.workType==_.CONSTANTS.WorkTypeFaction?M.Player.workForFaction(H):M.Player.workType==_.CONSTANTS.WorkTypeCreateProgram?M.Player.createProgramWork(H):M.Player.workType==_.CONSTANTS.WorkTypeStudyClass?M.Player.takeClass(H):M.Player.workType==_.CONSTANTS.WorkTypeCrime?M.Player.commitCrime(H):M.Player.workType==_.CONSTANTS.WorkTypeCompanyPartTime?M.Player.workPartTime(H):M.Player.work(H));var K=Object(E.j)(H);const e=Object(E.h)()?`${q.numeralWrapper.format(K,"0.000a")} hashes`:`${q.numeralWrapper.formatMoney(K)}`;Object(f.processPassiveFactionRepGain)(H),M.Player.hasWseAccount&&Object(W.processStockPrices)(H),M.Player.inGang()&&M.Player.gang.process(H,M.Player),M.Player.corporation instanceof d.c&&M.Player.corporation.storeCycles(H),M.Player.bladeburner instanceof c.a&&M.Player.bladeburner.storeCycles(H);for(let e=0;e<M.Player.sleeves.length;++e)if(M.Player.sleeves[e]instanceof j.Sleeve){const t=M.Player.sleeves[e].process(M.Player,H);if(null==t)continue;for(let n=0;n<M.Player.sleeves.length;++n)n!==e&&M.Player.sleeves[n].gainExperience(M.Player,t,H,!0)}var $=H*le._idleSpeed;null==M.Player.totalPlaytime&&(M.Player.totalPlaytime=0),null==M.Player.playtimeSinceLastAug&&(M.Player.playtimeSinceLastAug=0),null==M.Player.playtimeSinceLastBitnode&&(M.Player.playtimeSinceLastBitnode=0),M.Player.totalPlaytime+=$,M.Player.playtimeSinceLastAug+=$,M.Player.playtimeSinceLastBitnode+=$,M.Player.lastUpdate=le._lastUpdate,le.start(),Object(ne.removeLoadingScreen)();const h=Object(r.convertTimeMsToTimeElapsedString)($);Object(X.dialogBoxCreate)(ie.a.createElement(ie.a.Fragment,null,"Offline for ",h,". While you were offline, your scripts generated",ie.a.createElement("span",{className:"money-gold"}," ",q.numeralWrapper.formatMoney(G)," "),"and your Hacknet Nodes generated ",ie.a.createElement("span",{className:"money-gold"},e),"."));var z=[t,n,a,s,p,g,w,A,I];M.Player.firstFacInvRecvd?z.push(u):u.style.display="none",M.Player.firstAugPurchased?z.push(m):m.style.display="none",""!==M.Player.companyName?z.push(k):k.style.display="none",M.Player.firstTimeTraveled?z.push(b):b.style.display="none",M.Player.firstProgramAvailable?z.push(i):i.style.display="none",M.Player.hasWseAccount?z.push(C):C.style.display="none",M.Player.bladeburner instanceof c.a?z.push(P):P.style.display="none",M.Player.corporation instanceof d.c?z.push(S):S.style.display="none",M.Player.inGang()?z.push(x):x.style.display="none",le.closeMainMenuHeader(z)}else{Object(l.initBitNodeMultipliers)(M.Player),Object(L.initSpecialServerIps)(),le.setDisplayElements(),le.start(),M.Player.init(),Object(D.initForeignServers)(M.Player.getHomeComputer()),Object(h.initCompanies)(),Object(y.initFactions)(),Object(o.d)(),Object(T.c)(),Object(B.updateSourceFileFlags)(M.Player),document.getElementById("hacking-menu-header").classList.toggle("opened"),document.getElementById("character-menu-header").classList.toggle("opened"),document.getElementById("world-menu-header").classList.toggle("opened"),document.getElementById("help-menu-header").classList.toggle("opened"),u.style.display="none",m.style.display="none",k.style.display="none",C.style.display="none",b.style.display="none",i.style.display="none",P.style.display="none",S.style.display="none",x.style.display="none",I.style.display="none",le.openMainMenuHeader([t,n,a,s,p,g,w,A]),Object(v.c)(),Object(ne.removeLoadingScreen)()}Object(Y.a)(),Object(R.d)(),F.a.resetTerminalInput()},setDisplayElements:function(){if(le.Display.terminalContent=document.getElementById("terminal-container"),$.routing.navigateTo($.Page.Terminal),le.Display.characterContent=document.getElementById("character-container"),le.Display.characterContent.style.display="none",le.Display.scriptEditorContent=document.getElementById("script-editor-container"),le.Display.scriptEditorContent.style.display="none",le.Display.activeScriptsContent=document.getElementById("active-scripts-container"),le.Display.activeScriptsContent.style.display="none",le.Display.hacknetNodesContent=document.getElementById("hacknet-nodes-container"),le.Display.hacknetNodesContent.style.display="none",le.Display.createProgramContent=document.getElementById("create-program-container"),le.Display.createProgramContent.style.display="none",le.Display.factionsContent=document.getElementById("factions-container"),le.Display.factionsContent.style.display="none",le.Display.factionContent=document.getElementById("faction-container"),le.Display.factionContent.style.display="none",le.Display.augmentationsContent=document.getElementById("augmentations-container"),le.Display.augmentationsContent.style.display="none",le.Display.tutorialContent=document.getElementById("tutorial-container"),le.Display.tutorialContent.style.display="none",le.Display.infiltrationContent=document.getElementById("infiltration-container"),le.Display.infiltrationContent.style.display="none",le.Display.stockMarketContent=document.getElementById("stock-market-container"),le.Display.stockMarketContent.style.display="none",le.Display.missionContent=document.getElementById("mission-container"),le.Display.missionContent.style.display="none",le.Display.characterInfo=document.getElementById("character-content"),le.Display.locationContent=document.getElementById("location-container"),le.Display.locationContent.style.display="none",le.Display.workInProgressContent=document.getElementById("work-in-progress-container"),le.Display.workInProgressContent.style.display="none",le.Display.redPillContent=document.getElementById("red-pill-container"),le.Display.redPillContent.style.display="none",le.Display.cinematicTextContent=document.getElementById("cinematic-text-container"),le.Display.cinematicTextContent.style.display="none",!Object(J.initializeMainMenuLinks)()){const e="Failed to initialize Main Menu Links. Please try refreshing the page. If that doesn't work, report the issue to the developer";return Object(te.exceptionAlert)(new Error(e)),void console.error(e)}},init:function(){if(document.getElementById("import-game-link").onclick=function(){N.b.importGame()},!Object(V.initializeMainMenuHeaders)(M.Player,!1)){const e="Failed to initialize Main Menu Headers. Please try refreshing the page. If that doesn't work, report the issue to the developer";return Object(te.exceptionAlert)(new Error(e)),void console.error(e)}(J.MainMenuLinks.Terminal.addEventListener("click",function(){return le.loadTerminalContent(),!1}),J.MainMenuLinks.ScriptEditor.addEventListener("click",function(){return le.loadScriptEditorContent(),!1}),J.MainMenuLinks.ActiveScripts.addEventListener("click",function(){return le.loadActiveScriptsContent(),!1}),J.MainMenuLinks.CreateProgram.addEventListener("click",function(){return le.loadCreateProgramContent(),!1}),J.MainMenuLinks.Stats.addEventListener("click",function(){return le.loadCharacterContent(),!1}),J.MainMenuLinks.Factions.addEventListener("click",function(){return le.loadFactionsContent(),!1}),J.MainMenuLinks.Augmentations.addEventListener("click",function(){return le.loadAugmentationsContent(),!1}),J.MainMenuLinks.HacknetNodes.addEventListener("click",function(){return le.loadHacknetNodesContent(),!1}),J.MainMenuLinks.Sleeves.addEventListener("click",function(){return le.loadSleevesContent(),J.MainMenuLinks.Sleeves.classList.add("active"),!1}),J.MainMenuLinks.City.addEventListener("click",function(){return le.loadLocationContent(),!1}),J.MainMenuLinks.Travel.addEventListener("click",function(){return le.loadTravelContent(),!1}),J.MainMenuLinks.Job.addEventListener("click",function(){return le.loadJobContent(),!1}),J.MainMenuLinks.StockMarket.addEventListener("click",function(){return le.loadStockMarketContent(),J.MainMenuLinks.StockMarket.classList.add("active"),!1}),J.MainMenuLinks.Bladeburner.addEventListener("click",function(){return le.loadBladeburnerContent(),!1}),J.MainMenuLinks.Corporation.addEventListener("click",function(){return le.loadCorporationContent(),J.MainMenuLinks.Corporation.classList.add("active"),!1}),J.MainMenuLinks.Gang.addEventListener("click",function(){return le.loadGangContent(),!1}),J.MainMenuLinks.Tutorial.addEventListener("click",function(){return le.loadTutorialContent(),!1}),J.MainMenuLinks.DevMenu.addEventListener("click",function(){return!1}),le.ActiveScriptsList=document.getElementById("active-scripts-list"),le.Clickables.saveMainMenuButton=document.getElementById("save-game-link"),le.Clickables.saveMainMenuButton.addEventListener("click",function(){return N.b.saveGame(ce),!1}),le.Clickables.deleteMainMenuButton=document.getElementById("delete-game-link"),le.Clickables.deleteMainMenuButton.addEventListener("click",function(){return N.b.deleteGame(ce),!1}),document.getElementById("export-game-link").addEventListener("click",function(){return N.b.exportGame(),!1}),document.getElementById("character-overview-save-button").addEventListener("click",function(){return N.b.saveGame(ce),!1}),document.getElementById("character-overview-options-button").addEventListener("click",function(){return Object(Q.b)(),!1}),Object(w.c)(),Object(F.b)(),M.Player.isWorking)&&(document.getElementById("work-in-progress-cancel-button").addEventListener("click",function(){if(M.Player.workType==_.CONSTANTS.WorkTypeFaction){y.Factions[M.Player.currentWorkFactionName];M.Player.finishFactionWork(!0)}else M.Player.workType==_.CONSTANTS.WorkTypeCreateProgram?M.Player.finishCreateProgramWork(!0):M.Player.workType==_.CONSTANTS.WorkTypeStudyClass?M.Player.finishClass():M.Player.workType==_.CONSTANTS.WorkTypeCrime?M.Player.finishCrime(!0):M.Player.workType==_.CONSTANTS.WorkTypeCompanyPartTime?M.Player.finishWorkPartTime():M.Player.finishWork(!0)}),le.loadWorkInProgressContent());document.getElementById("character-overview-container").style.display="block",document.getElementById("terminal-menu-link").removeAttribute("class"),document.getElementById("stats-menu-link").removeAttribute("class"),document.getElementById("create-script-menu-link").removeAttribute("class"),document.getElementById("active-scripts-menu-link").removeAttribute("class"),document.getElementById("hacknet-nodes-menu-link").removeAttribute("class"),document.getElementById("city-menu-link").removeAttribute("class"),document.getElementById("tutorial-menu-link").removeAttribute("class"),document.getElementById("copy-save-to-clipboard-link").addEventListener("click",function(){const e=N.b.getSaveString();if(navigator.clipboard)navigator.clipboard.writeText(e).then(function(){Object(G.createStatusText)("Copied save to clipboard")},function(e){console.error("Unable to copy save data to clipboard using Async API"),Object(G.createStatusText)("Failed to copy save")});else{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.left="-9999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")?Object(G.createStatusText)("Copied save to clipboard"):Object(G.createStatusText)("Failed to copy save")}catch(e){console.error("Unable to copy save data to clipboard using document.execCommand('copy')"),Object(G.createStatusText)("Failed to copy save")}document.body.removeChild(t)}}),document.getElementById("debug-delete-scripts-link").addEventListener("click",function(){return M.Player.getHomeComputer().runningScripts=[],Object(X.dialogBoxCreate)("Forcefully deleted all running scripts on home computer. Please save and refresh page"),Object(Q.a)(),!1}),document.getElementById("debug-soft-reset").addEventListener("click",function(){return Object(X.dialogBoxCreate)("Soft Reset!"),Object(x.a)(),Object(Q.a)(),!1})},start:function(){le.idleTimer()}};var ce,ue;window.onload=function(){if(!window.indexedDB)return le.load(null);(ue=window.indexedDB.open("bitburnerSave",1)).onerror=function(e){return console.error("Error opening indexedDB: "),console.error(e),le.load(null)},ue.onsuccess=function(e){var t=(ce=e.target.result).transaction(["savestring"]).objectStore("savestring").get("save");t.onerror=function(e){return console.error("Error in Database request to get savestring: "+e),le.load(null)},t.onsuccess=function(e){le.load(t.result)}},ue.onupgradeneeded=function(e){e.target.result.createObjectStore("savestring")}}}.call(this,n(86))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(74),a=n(271),i=n(16);function o(e){const n=e.name;t.Factions[n]=e}function s(e){return t.Factions.hasOwnProperty(e)}function l(e){if(!(e instanceof r.Faction))throw new Error("Invalid argument 'newFactionObject' passed into resetFaction()");const n=e.name;s(n)&&(e.favor=t.Factions[n].favor,delete t.Factions[n]),o(e)}t.Factions={},t.loadFactions=function(e){t.Factions=JSON.parse(e,i.Reviver)},t.AddToFactions=o,t.factionExists=s,t.initFactions=function(e=1){for(const e in a.FactionInfos)l(new r.Faction(e))},t.resetFaction=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6),a=n(19),i=n(13),o=n(16);class s{constructor(e={info:"",moneyCost:0,name:"",repCost:0}){this.baseCost=0,this.baseRepRequirement=0,this.info="",this.isSpecial=!1,this.level=0,this.name="",this.owned=!1,this.prereqs=[],this.mults={},this.startingCost=0,this.name=e.name,this.info=e.info,this.prereqs=e.prereqs?e.prereqs:[],this.baseRepRequirement=e.repCost*r.CONSTANTS.AugmentationRepMultiplier*a.BitNodeMultipliers.AugmentationRepCost,this.baseCost=e.moneyCost*r.CONSTANTS.AugmentationCostMultiplier*a.BitNodeMultipliers.AugmentationMoneyCost,this.startingCost=this.baseCost,e.isSpecial&&(this.isSpecial=!0),this.level=0,e.hacking_mult&&(this.mults.hacking_mult=e.hacking_mult),e.strength_mult&&(this.mults.strength_mult=e.strength_mult),e.defense_mult&&(this.mults.defense_mult=e.defense_mult),e.dexterity_mult&&(this.mults.dexterity_mult=e.dexterity_mult),e.agility_mult&&(this.mults.agility_mult=e.agility_mult),e.charisma_mult&&(this.mults.charisma_mult=e.charisma_mult),e.hacking_exp_mult&&(this.mults.hacking_exp_mult=e.hacking_exp_mult),e.strength_exp_mult&&(this.mults.strength_exp_mult=e.strength_exp_mult),e.defense_exp_mult&&(this.mults.defense_exp_mult=e.defense_exp_mult),e.dexterity_exp_mult&&(this.mults.dexterity_exp_mult=e.dexterity_exp_mult),e.agility_exp_mult&&(this.mults.agility_exp_mult=e.agility_exp_mult),e.charisma_exp_mult&&(this.mults.charisma_exp_mult=e.charisma_exp_mult),e.hacking_chance_mult&&(this.mults.hacking_chance_mult=e.hacking_chance_mult),e.hacking_speed_mult&&(this.mults.hacking_speed_mult=e.hacking_speed_mult),e.hacking_money_mult&&(this.mults.hacking_money_mult=e.hacking_money_mult),e.hacking_grow_mult&&(this.mults.hacking_grow_mult=e.hacking_grow_mult),e.company_rep_mult&&(this.mults.company_rep_mult=e.company_rep_mult),e.faction_rep_mult&&(this.mults.faction_rep_mult=e.faction_rep_mult),e.crime_money_mult&&(this.mults.crime_money_mult=e.crime_money_mult),e.crime_success_mult&&(this.mults.crime_success_mult=e.crime_success_mult),e.work_money_mult&&(this.mults.work_money_mult=e.work_money_mult),e.hacknet_node_money_mult&&(this.mults.hacknet_node_money_mult=e.hacknet_node_money_mult),e.hacknet_node_purchase_cost_mult&&(this.mults.hacknet_node_purchase_cost_mult=e.hacknet_node_purchase_cost_mult),e.hacknet_node_ram_cost_mult&&(this.mults.hacknet_node_ram_cost_mult=e.hacknet_node_ram_cost_mult),e.hacknet_node_core_cost_mult&&(this.mults.hacknet_node_core_cost_mult=e.hacknet_node_core_cost_mult),e.hacknet_node_level_cost_mult&&(this.mults.hacknet_node_level_cost_mult=e.hacknet_node_level_cost_mult),e.bladeburner_max_stamina_mult&&(this.mults.bladeburner_max_stamina_mult=e.bladeburner_max_stamina_mult),e.bladeburner_stamina_gain_mult&&(this.mults.bladeburner_stamina_gain_mult=e.bladeburner_stamina_gain_mult),e.bladeburner_analysis_mult&&(this.mults.bladeburner_analysis_mult=e.bladeburner_analysis_mult),e.bladeburner_success_chance_mult&&(this.mults.bladeburner_success_chance_mult=e.bladeburner_success_chance_mult)}static fromJSON(e){return o.Generic_fromJSON(s,e.data)}addToFactions(e){for(let t=0;t<e.length;++t){const n=i.Factions[e[t]];null!=n?n.augmentations.push(this.name):console.warn(`In Augmentation.addToFactions(), could not find faction with this name: ${e[t]}`)}}addToAllFactions(){for(const e in i.Factions)if(i.Factions.hasOwnProperty(e)){const t=i.Factions[e];if(null==t){console.warn(`Invalid Faction object in addToAllFactions(). Key value: ${e}`);continue}t.augmentations.push(this.name)}}toJSON(){return o.Generic_toJSON("Augmentation",this)}}t.Augmentation=s,o.Reviver.constructors.Augmentation=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRandomInt=function(e,t){const n=Math.min(e,t),r=Math.max(e,t);return Math.floor(Math.random()*(r-n+1))+n}},function(e,t,n){"use strict";function r(e,t){var n;if(null==t)return console.log("Reviver WRONGLY called with key: "+e+", and value: "+t),0;if("object"==typeof t&&"string"==typeof t.ctor&&void 0!==t.data){if("AllServersMap"===t.ctor)return console.log("Converting AllServersMap for v0.43.1"),t.data;if("function"==typeof(n=r.constructors[t.ctor]||window[t.ctor])&&"function"==typeof n.fromJSON)return n.fromJSON(t)}return t}function a(e,t,n){var r,a;n||(n=Object.keys(t)),r={};for(let e=0;e<n.length;++e)r[a=n[e]]=t[a];return{ctor:e,data:r}}function i(e,t){var n,r;for(r in n=new e,t)n[r]=t[r];return n}n.r(t),n.d(t,"Reviver",function(){return r}),n.d(t,"Generic_toJSON",function(){return a}),n.d(t,"Generic_fromJSON",function(){return i}),r.constructors={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(51),a={AutosaveInterval:60,CodeInstructionRunTime:50,DisableHotkeys:!1,Locale:"en",MaxLogCapacity:50,MaxPortCapacity:50,SuppressBuyAugmentationConfirmation:!1,SuppressFactionInvites:!1,SuppressHospitalizationPopup:!1,SuppressMessages:!1,SuppressTravelConfirmation:!1};t.Settings={AutosaveInterval:a.AutosaveInterval,CodeInstructionRunTime:25,DisableHotkeys:a.DisableHotkeys,Editor:r.EditorSetting.Ace,EditorKeybinding:r.AceKeybindingSetting.Ace,EditorTheme:"Monokai",Locale:"en",MaxLogCapacity:a.MaxLogCapacity,MaxPortCapacity:a.MaxPortCapacity,OwnedAugmentationsOrder:r.OwnedAugmentationsOrderSetting.AcquirementTime,PurchaseAugmentationsOrder:r.PurchaseAugmentationsOrderSetting.Default,SuppressBuyAugmentationConfirmation:a.SuppressBuyAugmentationConfirmation,SuppressFactionInvites:a.SuppressFactionInvites,SuppressHospitalizationPopup:a.SuppressHospitalizationPopup,SuppressMessages:a.SuppressMessages,SuppressTravelConfirmation:a.SuppressTravelConfirmation,init(){Object.assign(t.Settings,a)},load(e){Object.assign(t.Settings,JSON.parse(e))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionTypes=Object.freeze({Idle:1,Contract:2,Operation:3,BlackOp:4,BlackOperation:4,Training:5,Recruitment:6,FieldAnalysis:7,"Field Analysis":7,Diplomacy:8,"Hyperbolic Regeneration Chamber":9})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BitNodeMultipliers={HackingLevelMultiplier:1,StrengthLevelMultiplier:1,DefenseLevelMultiplier:1,DexterityLevelMultiplier:1,AgilityLevelMultiplier:1,CharismaLevelMultiplier:1,ServerGrowthRate:1,ServerMaxMoney:1,ServerStartingMoney:1,ServerStartingSecurity:1,ServerWeakenRate:1,HomeComputerRamCost:1,PurchasedServerCost:1,PurchasedServerLimit:1,PurchasedServerMaxRam:1,CompanyWorkMoney:1,CrimeMoney:1,HacknetNodeMoney:1,ManualHackMoney:1,ScriptHackMoney:1,ScriptHackMoneyGain:1,CodingContractMoney:1,ClassGymExpGain:1,CompanyWorkExpGain:1,CrimeExpGain:1,FactionWorkExpGain:1,HackExpGain:1,FactionPassiveRepGain:1,FactionWorkRepGain:1,RepToDonateToFaction:1,AugmentationMoneyCost:1,AugmentationRepCost:1,InfiltrationMoney:1,InfiltrationRep:1,FourSigmaMarketDataCost:1,FourSigmaMarketDataApiCost:1,CorporationValuation:1,BladeburnerRank:1,BladeburnerSkillCost:1,DaedalusAugsRequirement:1,GangKarmaRequirement:1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(116),a=n(40),i=n(719),o=n(168),s=n(15),l=n(16);function c(e){return null!=t.AllServers[e]}function u(){const e=o.createRandomIp();return c(e)?o.createRandomIp():e}function m(e){var n=e.ip;if(c(n))throw console.warn(`IP of server that's being added: ${n}`),console.warn(`Hostname of the server thats being added: ${e.hostname}`),console.warn(`The server that already has this IP is: ${t.AllServers[n].hostname}`),new Error("Error: Trying to add a server with an existing IP");t.AllServers[n]=e}t.AllServers={},t.ipExists=c,t.createUniqueRandomIp=u,t.AddToAllServers=m,t.initForeignServers=function(e){const t=[];for(let e=0;e<15;e++)t.push([]);const n=["hackDifficulty","moneyAvailable","requiredHackingSkill","serverGrowth"],o=e=>{switch(typeof e){case"number":return e;case"object":return s.getRandomInt(e.min,e.max);default:throw Error(`Do not know how to convert the type '${typeof e}' to a number`)}};for(const e of i.serverMetadata){const i={hostname:e.hostname,ip:u(),numOpenPortsRequired:e.numOpenPortsRequired,organizationName:e.organizationName};void 0!==e.maxRamExponent&&(i.maxRam=Math.pow(2,o(e.maxRamExponent)));for(const t of n)void 0!==e[t]&&(i[t]=o(e[t]));const s=new r.Server(i);for(const t of e.literature||[])s.messages.push(t);void 0!==e.specialName&&a.SpecialServerIps.addIp(e.specialName,s.ip),m(s),void 0!==e.networkLayer&&t[o(e.networkLayer)-1].push(s)}const l=(e,t)=>{e.serversOnNetwork.push(t.ip),t.serversOnNetwork.push(e.ip)},c=e=>e[Math.floor(Math.random()*e.length)],p=(e,t)=>{for(const n of e)l(n,t())};p(t[0],()=>e);for(let e=1;e<t.length;e++)p(t[e],()=>c(t[e-1]))},t.prestigeAllServers=function(){for(var e in t.AllServers)delete t.AllServers[e];t.AllServers={}},t.loadAllServers=function(e){t.AllServers=JSON.parse(e,l.Reviver)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmployeePositions={Operations:"Operations",Engineer:"Engineer",Business:"Business",Management:"Management",RandD:"Research & Development",Training:"Training",Unassigned:"Unassigned"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(20),a=n(116),i=n(19),o=n(6),s=n(32),l=n(100),c=n(676),u=n(208);function m(e,t,n){let r=1+(o.CONSTANTS.ServerBaseGrowthRate-1)/e.hackDifficulty;r>o.CONSTANTS.ServerMaxGrowthRate&&(r=o.CONSTANTS.ServerMaxGrowthRate);const a=e.serverGrowth/100;return Math.log(t)/(Math.log(r)*n.hacking_grow_mult*a*i.BitNodeMultipliers.ServerGrowthRate)}function p(e){for(var t in r.AllServers)if(r.AllServers.hasOwnProperty(t)&&r.AllServers[t].hostname==e)return r.AllServers[t];return null}t.safetlyCreateUniqueServer=function(e){if(null!=e.ip&&r.ipExists(e.ip)&&(e.ip=r.createUniqueRandomIp()),null!=p(e.hostname)){let t=e.hostname;for(let n=0;n<200&&null!=p(t=`${e.hostname}-${n}`);++n);e.hostname=t}return new a.Server(e)},t.numCycleForGrowth=m,t.processSingleServerGrowth=function(e,t,n){const r=Math.max(Math.floor(t/450),0);var a=1+(o.CONSTANTS.ServerBaseGrowthRate-1)/e.hackDifficulty;a>o.CONSTANTS.ServerMaxGrowthRate&&(a=o.CONSTANTS.ServerMaxGrowthRate);const s=r*(e.serverGrowth/100)*i.BitNodeMultipliers.ServerGrowthRate;let l=Math.pow(a,s*n.hacking_grow_mult);l<1&&(console.warn("serverGrowth calculated to be less than 1"),l=1);const u=e.moneyAvailable;if(e.moneyAvailable*=l,c.isValidNumber(e.moneyMax)&&isNaN(e.moneyAvailable)&&(e.moneyAvailable=e.moneyMax),c.isValidNumber(e.moneyMax)&&e.moneyAvailable>e.moneyMax&&(e.moneyAvailable=e.moneyMax),u!==e.moneyAvailable){let t=m(e,e.moneyAvailable/u,n);t=Math.max(0,t),e.fortify(2*o.CONSTANTS.ServerFortifyAmount*Math.ceil(t))}return e.moneyAvailable/u},t.prestigeHomeComputer=function(e){const t=e.programs.includes(s.Programs.BitFlume.name);e.programs.length=0,e.runningScripts=[],e.serversOnNetwork=[],e.isConnectedTo=!0,e.ramUsed=0,e.programs.push(s.Programs.NukeProgram.name),t&&e.programs.push(s.Programs.BitFlume.name),e.scripts.forEach(function(t){t.updateRamUsage(e.scripts)}),e.messages.length=0,e.messages.push(l.LiteratureNames.HackersStartingHandbook)},t.GetServerByHostname=p,t.getServer=function(e){return u.isValidIPAddress(e)?void 0!==r.AllServers[e]?r.AllServers[e]:null:p(e)},t.getServerOnNetwork=function(e,t){if(!(t>e.serversOnNetwork.length))return r.AllServers[e.serversOnNetwork[t]];console.error("Tried to get server on network that was out of range")}},function(e,t,n){"use strict";n.d(t,"h",function(){return E}),n.d(t,"m",function(){return v}),n.d(t,"i",function(){return k}),n.d(t,"b",function(){return C}),n.d(t,"c",function(){return T}),n.d(t,"f",function(){return P}),n.d(t,"g",function(){return S}),n.d(t,"e",function(){return O}),n.d(t,"d",function(){return M}),n.d(t,"o",function(){return x}),n.d(t,"p",function(){return w}),n.d(t,"l",function(){return A}),n.d(t,"k",function(){return N}),n.d(t,"q",function(){return R}),n.d(t,"a",function(){return D}),n.d(t,"j",function(){return I}),n.d(t,"r",function(){return L}),n.d(t,"n",function(){return W});var r=n(52),a=n(34),i=n(108),o=n(144),s=n(123),l=n(39),c=n(0),u=n(20),m=n(22),p=n(38),h=n(11),d=(n(115),n(1)),_=n.n(d),g=n(46),y=n.n(g),f=n(179);let b;function E(){return 9===c.Player.bitNodeN||p.SourceFileFlags[9]>0}function v(){if(l.a.isRunning){if(l.a.currStep!==l.d.HacknetNodesIntroduction)return;Object(l.b)()}const e=c.Player.hacknetNodes.length;if(E()){const t=T();if(isNaN(t))throw new Error("Calculated cost of purchasing HacknetServer is NaN");if(!c.Player.canAfford(t))return-1;c.Player.loseMoney(t);c.Player.createHacknetServer();return L(),e}{const t=C();if(isNaN(t))throw new Error("Calculated cost of purchasing HacknetNode is NaN");if(!c.Player.canAfford(t))return-1;const n="hacknet-node-"+e,a=new r.HacknetNode(n,c.Player.hacknet_node_money_mult);return c.Player.loseMoney(t),c.Player.hacknetNodes.push(a),e}}function k(){return E()&&c.Player.hacknetNodes.length>=a.MaxNumberHacknetServers}function C(){const e=c.Player.hacknetNodes.length,t=r.HacknetNodePurchaseNextMult;return r.BaseCostForHacknetNode*Math.pow(t,e)*c.Player.hacknet_node_purchase_cost_mult}function T(){const e=c.Player.hacknetNodes.length,t=a.HacknetServerPurchaseMult;return e>=a.MaxNumberHacknetServers?1/0:a.BaseCostForHacknetServer*Math.pow(t,e)*c.Player.hacknet_node_purchase_cost_mult}function P(e,t){if(null==t)throw new Error("getMaxNumberLevelUpgrades() called without maxLevel arg");if(c.Player.money.lt(e.calculateLevelUpgradeCost(1,c.Player.hacknet_node_level_cost_mult)))return 0;let n=1,r=t-1,a=t-e.level;if(c.Player.money.gt(e.calculateLevelUpgradeCost(a,c.Player.hacknet_node_level_cost_mult)))return a;for(;n<=r;){var i=(n+r)/2|0;if(i!==t&&c.Player.money.gt(e.calculateLevelUpgradeCost(i,c.Player.hacknet_node_level_cost_mult))&&c.Player.money.lt(e.calculateLevelUpgradeCost(i+1,c.Player.hacknet_node_level_cost_mult)))return Math.min(a,i);if(c.Player.money.lt(e.calculateLevelUpgradeCost(i,c.Player.hacknet_node_level_cost_mult)))r=i-1;else{if(!c.Player.money.gt(e.calculateLevelUpgradeCost(i,c.Player.hacknet_node_level_cost_mult)))return Math.min(a,i);n=i+1}}return 0}function S(e,t){if(null==t)throw new Error("getMaxNumberRamUpgrades() called without maxLevel arg");if(c.Player.money.lt(e.calculateRamUpgradeCost(1,c.Player.hacknet_node_ram_cost_mult)))return 0;let n;if(n=e instanceof a.HacknetServer?Math.round(Math.log2(t/e.maxRam)):Math.round(Math.log2(t/e.ram)),c.Player.money.gt(e.calculateRamUpgradeCost(n,c.Player.hacknet_node_ram_cost_mult)))return n;for(let t=n-1;t>=0;--t)if(c.Player.money.gt(e.calculateRamUpgradeCost(t,c.Player.hacknet_node_ram_cost_mult)))return t;return 0}function O(e,t){if(null==t)throw new Error("getMaxNumberCoreUpgrades() called without maxLevel arg");if(c.Player.money.lt(e.calculateCoreUpgradeCost(1,c.Player.hacknet_node_core_cost_mult)))return 0;let n=1,r=t-1;const a=t-e.cores;if(c.Player.money.gt(e.calculateCoreUpgradeCost(a,c.Player.hacknet_node_core_cost_mult)))return a;for(;n<=r;){let i=(n+r)/2|0;if(i!=t&&c.Player.money.gt(e.calculateCoreUpgradeCost(i,c.Player.hacknet_node_core_cost_mult))&&c.Player.money.lt(e.calculateCoreUpgradeCost(i+1,c.Player.hacknet_node_core_cost_mult)))return Math.min(a,i);if(c.Player.money.lt(e.calculateCoreUpgradeCost(i,c.Player.hacknet_node_core_cost_mult)))r=i-1;else{if(!c.Player.money.gt(e.calculateCoreUpgradeCost(i,c.Player.hacknet_node_core_cost_mult)))return Math.min(a,i);n=i+1}}return 0}function M(e,t){if(null==t)throw new Error("getMaxNumberCacheUpgrades() called without maxLevel arg");if(!c.Player.canAfford(e.calculateCacheUpgradeCost(1)))return 0;let n=1,r=t-1;const a=t-e.cache;if(c.Player.canAfford(e.calculateCacheUpgradeCost(a)))return a;for(;n<=r;){let i=(n+r)/2|0;if(i!=t&&c.Player.canAfford(e.calculateCacheUpgradeCost(i))&&!c.Player.canAfford(e.calculateCacheUpgradeCost(i+1)))return Math.min(a,i);if(c.Player.canAfford(e.calculateCacheUpgradeCost(i))){if(!c.Player.canAfford(e.calculateCacheUpgradeCost(i)))return Math.min(a,i);n=i+1}else r=i-1}return 0}function x(e,t=1){const n=Math.round(t),i=e.calculateLevelUpgradeCost(n,c.Player.hacknet_node_level_cost_mult);if(isNaN(i)||i<=0||n<0)return!1;const o=e instanceof a.HacknetServer;if(e.level>=(o?a.HacknetServerMaxLevel:r.HacknetNodeMaxLevel))return!1;if(e.level+n>(o?a.HacknetServerMaxLevel:r.HacknetNodeMaxLevel)){return x(e,Math.max(0,(o?a.HacknetServerMaxLevel:r.HacknetNodeMaxLevel)-e.level))}return!!c.Player.canAfford(i)&&(c.Player.loseMoney(i),e.upgradeLevel(n,c.Player.hacknet_node_money_mult),!0)}function w(e,t=1){const n=Math.round(t),i=e.calculateRamUpgradeCost(n,c.Player.hacknet_node_ram_cost_mult);if(isNaN(i)||i<=0||n<0)return!1;const o=e instanceof a.HacknetServer;if(e.ram>=(o?a.HacknetServerMaxRam:r.HacknetNodeMaxRam))return!1;if(o){if(e.maxRam*Math.pow(2,n)>a.HacknetServerMaxRam){return w(e,Math.max(0,Math.log2(Math.round(a.HacknetServerMaxRam/e.maxRam))))}}else if(e.ram*Math.pow(2,n)>r.HacknetNodeMaxRam){return w(e,Math.max(0,Math.log2(Math.round(r.HacknetNodeMaxRam/e.ram))))}return!!c.Player.canAfford(i)&&(c.Player.loseMoney(i),e.upgradeRam(n,c.Player.hacknet_node_money_mult),!0)}function A(e,t=1){const n=Math.round(t),i=e.calculateCoreUpgradeCost(n,c.Player.hacknet_node_core_cost_mult);if(isNaN(i)||i<=0||n<0)return!1;const o=e instanceof a.HacknetServer;if(e.cores>=(o?a.HacknetServerMaxCores:r.HacknetNodeMaxCores))return!1;if(e.cores+n>(o?a.HacknetServerMaxCores:r.HacknetNodeMaxCores)){return A(e,Math.max(0,(o?a.HacknetServerMaxCores:r.HacknetNodeMaxCores)-e.cores))}return!!c.Player.canAfford(i)&&(c.Player.loseMoney(i),e.upgradeCore(n,c.Player.hacknet_node_money_mult),!0)}function N(e,t=1){const n=Math.round(t),r=e.calculateCacheUpgradeCost(n);if(isNaN(r)||r<=0||n<0)return!1;if(!(e instanceof a.HacknetServer))return console.warn("purchaseCacheUpgrade() called for a non-HacknetNode"),!1;if(e.cache+n>a.HacknetServerMaxCache){return N(e,Math.max(0,a.HacknetServerMaxCache-e.cache))}return!!c.Player.canAfford(r)&&(c.Player.loseMoney(r),e.upgradeCache(n),!0)}function R(){h.routing.isOn(h.Page.HacknetNodes)&&y.a.render(_.a.createElement(f.a,null),b)}function D(){b instanceof HTMLElement&&y.a.unmountComponentAtNode(b),b.style.display="none"}function I(e){return 0===c.Player.hacknetNodes.length?0:E()?function(e){if(!(c.Player.hashManager instanceof i.HashManager))throw new Error("Player does not have a HashManager (should be in 'hashManager' prop)");let t=0;for(let n=0;n<c.Player.hacknetNodes.length;++n){const r=u.AllServers[c.Player.hacknetNodes[n]];r.updateHashRate(c.Player.hacknet_node_money_mult),t+=r.process(e)}return c.Player.hashManager.storeHashes(t),t}(e):c.Player.hacknetNodes[0]instanceof r.HacknetNode?function(e){let t=0;for(let n=0;n<c.Player.hacknetNodes.length;++n)t+=B(e,c.Player.hacknetNodes[n]);return t}(e):0}function B(e,t){const n=t.process(e);return c.Player.gainMoney(n),c.Player.recordMoneySource(n,"hacknetnode"),n}function L(){if(!(c.Player.hashManager instanceof i.HashManager))return void console.error("Player does not have a HashManager");const e=c.Player.hacknetNodes;if(0===e.length)return void c.Player.hashManager.updateCapacity(0);let t=0;for(let n=0;n<e.length;++n){if("string"!=typeof e[n])return void c.Player.hashManager.updateCapacity(0);const r=u.AllServers[e[n]];if(!(r instanceof a.HacknetServer))return void c.Player.hashManager.updateCapacity(0);t+=r.hashCapacity}c.Player.hashManager.updateCapacity(t)}function W(e,t){if(!(c.Player.hashManager instanceof i.HashManager))return console.error("Player does not have a HashManager"),!1;if(c.Player.hashManager.upgrade(e)){const n=o.HashUpgrades[e];switch(e){case"Sell for Money":c.Player.gainMoney(n.value),c.Player.recordMoneySource(n.value,"hacknetnode");break;case"Sell for Corporation Funds":try{c.Player.corporation.funds=c.Player.corporation.funds.plus(n.value)}catch(t){return c.Player.hashManager.refundUpgrade(e),!1}break;case"Reduce Minimum Security":try{const r=Object(m.GetServerByHostname)(t);if(null==r)return console.error(`Invalid target specified in purchaseHashUpgrade(): ${t}`),!1;r.changeMinimumSecurity(n.value,!0)}catch(t){return c.Player.hashManager.refundUpgrade(e),!1}break;case"Increase Maximum Money":try{const r=Object(m.GetServerByHostname)(t);if(null==r)return console.error(`Invalid target specified in purchaseHashUpgrade(): ${t}`),!1;r.changeMaximumMoney(n.value,!0)}catch(t){return c.Player.hashManager.refundUpgrade(e),!1}break;case"Improve Studying":case"Improve Gym Training":break;case"Exchange for Corporation Research":try{for(const e of c.Player.corporation.divisions)e.sciResearch.qty+=n.value}catch(t){return c.Player.hashManager.refundUpgrade(e),!1}break;case"Exchange for Bladeburner Rank":try{c.Player.bladeburner.changeRank(n.value)}catch(t){return c.Player.hashManager.refundUpgrade(e),!1}break;case"Exchange for Bladeburner SP":try{c.Player.bladeburner.skillPoints+=n.value}catch(t){return c.Player.hashManager.refundUpgrade(e),!1}break;case"Generate Coding Contract":Object(s.generateRandomContract)();break;default:return console.warn(`Unrecognized upgrade name ${e}. Upgrade has no effect`),c.Player.hashManager.refundUpgrade(e),!1}return!0}return!1}document.addEventListener("DOMContentLoaded",function e(){b=document.getElementById("hacknet-nodes-container"),document.removeEventListener("DOMContentLoaded",e)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEY={CTRL:17,DOWNARROW:40,ENTER:13,ESC:27,TAB:9,UPARROW:38,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(684),a=n(96),i=n(16);t.Companies={},t.initCompanies=function(){const e=t.Companies;t.Companies={},r.companiesMetadata.forEach(e=>{!function(e){null!=t.Companies[e.name]&&console.warn(`Duplicate Company Position being defined: ${e.name}`),t.Companies[e.name]=new a.Company(e)}(e)});for(const n in t.Companies){const r=t.Companies[n];e[n]instanceof a.Company?(r.favor=e[n].favor,isNaN(r.favor)&&(r.favor=0)):r.favor=0}},t.loadCompanies=function(e){t.Companies=JSON.parse(e,i.Reviver)},t.companyExists=function(e){return t.Companies.hasOwnProperty(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(716),a=n(2);t.Industries={Energy:"Energy",Utilities:"Water Utilities",Agriculture:"Agriculture",Fishing:"Fishing",Mining:"Mining",Food:"Food",Tobacco:"Tobacco",Chemical:"Chemical",Pharmaceutical:"Pharmaceutical",Computer:"Computer Hardware",Robotics:"Robotics",Software:"Software",Healthcare:"Healthcare",RealEstate:"RealEstate"},t.IndustryStartingCosts={Energy:225e9,Utilities:15e10,Agriculture:4e10,Fishing:8e10,Mining:3e11,Food:1e10,Tobacco:2e10,Chemical:7e10,Pharmaceutical:2e11,Computer:5e11,Robotics:1e12,Software:25e9,Healthcare:75e10,RealEstate:6e11},t.IndustryDescriptions={Energy:"Engage in the production and distribution of energy.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Energy,"$0.000a")+"<br>Recommended starting Industry: NO",Utilities:"Distribute water and provide wastewater services.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Utilities,"$0.000a")+"<br>Recommended starting Industry: NO",Agriculture:"Cultivate crops and breed livestock to produce food.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Agriculture,"$0.000a")+"<br>Recommended starting Industry: YES",Fishing:"Produce food through the breeding and processing of fish and fish products.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Fishing,"$0.000a")+"<br>Recommended starting Industry: NO",Mining:"Extract and process metals from the earth.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Mining,"$0.000a")+"<br>Recommended starting Industry: NO",Food:"Create your own restaurants all around the world.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Food,"$0.000a")+"<br>Recommended starting Industry: YES",Tobacco:"Create and distribute tobacco and tobacco-related products.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Tobacco,"$0.000a")+"<br>Recommended starting Industry: YES",Chemical:"Produce industrial chemicals.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Chemical,"$0.000a")+"<br>Recommended starting Industry: NO",Pharmaceutical:"Discover, develop, and create new pharmaceutical drugs.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Pharmaceutical,"$0.000a")+"<br>Recommended starting Industry: NO",Computer:"Develop and manufacture new computer hardware and networking infrastructures.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Computer,"$0.000a")+"<br>Recommended starting Industry: NO",Robotics:"Develop and create robots.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Robotics,"$0.000a")+"<br>Recommended starting Industry: NO",Software:"Develop computer software and create AI Cores.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Software,"$0.000a")+"<br>Recommended starting Industry: YES",Healthcare:"Create and manage hospitals.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.Healthcare,"$0.000a")+"<br>Recommended starting Industry: NO",RealEstate:"Develop and manage real estate properties.<br><br>Starting cost: "+a.numeralWrapper.format(t.IndustryStartingCosts.RealEstate,"$0.000a")+"<br>Recommended starting Industry: NO"},t.IndustryResearchTrees={Energy:r.getBaseResearchTreeCopy(),Utilities:r.getBaseResearchTreeCopy(),Agriculture:r.getBaseResearchTreeCopy(),Fishing:r.getBaseResearchTreeCopy(),Mining:r.getBaseResearchTreeCopy(),Food:r.getProductIndustryResearchTreeCopy(),Tobacco:r.getProductIndustryResearchTreeCopy(),Chemical:r.getBaseResearchTreeCopy(),Pharmaceutical:r.getProductIndustryResearchTreeCopy(),Computer:r.getProductIndustryResearchTreeCopy(),Robotics:r.getProductIndustryResearchTreeCopy(),Software:r.getProductIndustryResearchTreeCopy(),Healthcare:r.getProductIndustryResearchTreeCopy(),RealEstate:r.getProductIndustryResearchTreeCopy()},t.resetIndustryResearchTrees=function(){t.IndustryResearchTrees.Energy=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Utilities=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Agriculture=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Fishing=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Mining=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Food=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Tobacco=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Chemical=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Pharmaceutical=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Computer=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Robotics=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Software=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Healthcare=r.getBaseResearchTreeCopy(),t.IndustryResearchTrees.RealEstate=r.getBaseResearchTreeCopy()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(115),a=n(82);t.removeElementById=function(e){try{const t=r.getElementById(e);a.removeElement(t)}catch(e){}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Aevum="Aevum",e.Chongqing="Chongqing",e.Ishima="Ishima",e.NewTokyo="New Tokyo",e.Sector12="Sector-12",e.Volhaven="Volhaven"}(t.CityName||(t.CityName={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(115);t.clearEventListeners=function(e){try{let t;const n=(t="string"==typeof e?r.getElementById(e):e).cloneNode(!0);return null!==t.parentNode&&t.parentNode.replaceChild(n,t),n}catch(e){return console.error(e),null}}},function(module,__webpack_exports__,__webpack_require__){"use strict";(function($){__webpack_require__.d(__webpack_exports__,"f",function(){return IssueNewSharesCooldown}),__webpack_require__.d(__webpack_exports__,"k",function(){return SellSharesCooldown}),__webpack_require__.d(__webpack_exports__,"m",function(){return WarehouseInitialCost}),__webpack_require__.d(__webpack_exports__,"n",function(){return WarehouseInitialSize}),__webpack_require__.d(__webpack_exports__,"o",function(){return WarehouseUpgradeBaseCost}),__webpack_require__.d(__webpack_exports__,"g",function(){return OfficeInitialCost}),__webpack_require__.d(__webpack_exports__,"h",function(){return OfficeInitialSize}),__webpack_require__.d(__webpack_exports__,"a",function(){return BribeThreshold}),__webpack_require__.d(__webpack_exports__,"b",function(){return BribeToRepRatio}),__webpack_require__.d(__webpack_exports__,"j",function(){return ProductProductionCostRatio}),__webpack_require__.d(__webpack_exports__,"d",function(){return DividendMaxPercentage}),__webpack_require__.d(__webpack_exports__,"c",function(){return Corporation}),__webpack_require__.d(__webpack_exports__,"e",function(){return Industry}),__webpack_require__.d(__webpack_exports__,"i",function(){return OfficeSpace});var _CorporationState__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(224),_CorporationState__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_CorporationState__WEBPACK_IMPORTED_MODULE_0__),_data_CorporationUnlockUpgrades__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(183),_data_CorporationUnlockUpgrades__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_data_CorporationUnlockUpgrades__WEBPACK_IMPORTED_MODULE_1__),_data_CorporationUpgrades__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(182),_data_CorporationUpgrades__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_data_CorporationUpgrades__WEBPACK_IMPORTED_MODULE_2__),_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(21),_EmployeePositions__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__),_IndustryData__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(26),_IndustryData__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_IndustryData__WEBPACK_IMPORTED_MODULE_4__),_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(161),_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_5__),_Material__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(156),_Material__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(_Material__WEBPACK_IMPORTED_MODULE_6__),_MaterialSizes__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(97),_MaterialSizes__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(_MaterialSizes__WEBPACK_IMPORTED_MODULE_7__),_Product__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(134),_Product__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(_Product__WEBPACK_IMPORTED_MODULE_8__),_ResearchMap__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(174),_ResearchMap__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(_ResearchMap__WEBPACK_IMPORTED_MODULE_9__),_Warehouse__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(90),_Warehouse__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(_Warehouse__WEBPACK_IMPORTED_MODULE_10__);__webpack_require__.d(__webpack_exports__,"l",function(){return _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse});var _BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(19),_BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(_BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_11__),_Constants__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(6),_Constants__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(_Constants__WEBPACK_IMPORTED_MODULE_12__),_Faction_Factions__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(13),_Faction_Factions__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(_Faction_Factions__WEBPACK_IMPORTED_MODULE_13__),_Literature_LiteratureHelpers__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(181),_Literature_LiteratureHelpers__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(_Literature_LiteratureHelpers__WEBPACK_IMPORTED_MODULE_14__),_Literature_data_LiteratureNames__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(100),_Literature_data_LiteratureNames__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(_Literature_data_LiteratureNames__WEBPACK_IMPORTED_MODULE_15__),_Locations_Cities__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(104),_Locations_Cities__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(_Locations_Cities__WEBPACK_IMPORTED_MODULE_16__),_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(28),_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__),_Player__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(0),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(2),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19__),_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(11),_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_20__),_utils_calculateEffectWithFactors__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(319),_utils_calculateEffectWithFactors__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(_utils_calculateEffectWithFactors__WEBPACK_IMPORTED_MODULE_21__),_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(8),_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(215),_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_23___default=__webpack_require__.n(_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_23__),_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(16),_utils_uiHelpers_appendLineBreaks__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(78),_utils_uiHelpers_appendLineBreaks__WEBPACK_IMPORTED_MODULE_25___default=__webpack_require__.n(_utils_uiHelpers_appendLineBreaks__WEBPACK_IMPORTED_MODULE_25__),_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(3),_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26___default=__webpack_require__.n(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__),_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(37),_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_27___default=__webpack_require__.n(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_27__),_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(55),_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_28__),_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(7),_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29___default=__webpack_require__.n(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__),_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(15),_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30___default=__webpack_require__.n(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(48),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_31___default=__webpack_require__.n(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_31__),_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(24),_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_32___default=__webpack_require__.n(_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_32__),_utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(82),_utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_33___default=__webpack_require__.n(_utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_33__),_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(27),_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_34___default=__webpack_require__.n(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_34__),_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(45),_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35___default=__webpack_require__.n(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__),react__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__(1),react__WEBPACK_IMPORTED_MODULE_36___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_36__),react_dom__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__(46),react_dom__WEBPACK_IMPORTED_MODULE_37___default=__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_37__),_ui_CorporationUIEventHandler__WEBPACK_IMPORTED_MODULE_38__=__webpack_require__(318),_ui_Root__WEBPACK_IMPORTED_MODULE_39__=__webpack_require__(317),_ui_Routing__WEBPACK_IMPORTED_MODULE_40__=__webpack_require__(143),_ui_Routing__WEBPACK_IMPORTED_MODULE_40___default=__webpack_require__.n(_ui_Routing__WEBPACK_IMPORTED_MODULE_40__),decimal_js__WEBPACK_IMPORTED_MODULE_41__=__webpack_require__(43);const INITIALSHARES=1e9,SHARESPERPRICEUPDATE=1e6,IssueNewSharesCooldown=216e3,SellSharesCooldown=18e3,CyclesPerMarketCycle=50,CyclesPerIndustryStateCycle=CyclesPerMarketCycle/_CorporationState__WEBPACK_IMPORTED_MODULE_0__.AllCorporationStates.length,SecsPerMarketCycle=CyclesPerMarketCycle/5,Cities=["Aevum","Chongqing","Sector-12","New Tokyo","Ishima","Volhaven"],WarehouseInitialCost=5e9,WarehouseInitialSize=100,WarehouseUpgradeBaseCost=1e9,OfficeInitialCost=4e9,OfficeInitialSize=3,OfficeUpgradeBaseCost=1e9,BribeThreshold=1e14,BribeToRepRatio=1e9,ProductProductionCostRatio=5,DividendMaxPercentage=50,EmployeeSalaryMultiplier=3,CyclesPerEmployeeRaise=400,EmployeeRaiseAmount=50,BaseMaxProducts=3;let researchTreeBoxOpened=!1,researchTreeBox=null;$(document).mousedown(function(e){researchTreeBoxOpened&&null==$(e.target).closest("#corporation-research-popup-box-content").get(0)&&(Object(_utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_33__.removeElement)(researchTreeBox),researchTreeBox=null,researchTreeBoxOpened=!1)});var empManualAssignmentModeActive=!1;function Industry(e={}){this.offices={[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Aevum]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Chongqing]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Sector12]:new OfficeSpace({loc:_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Sector12,size:OfficeInitialSize}),[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.NewTokyo]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Ishima]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Volhaven]:0},this.name=e.name?e.name:0,this.type=e.type?e.type:0,this.sciResearch=new _Material__WEBPACK_IMPORTED_MODULE_6__.Material({name:"Scientific Research"}),this.researched={},this.reqMats={},this.prodMats=[],this.products={},this.makesProducts=!1,this.awareness=0,this.popularity=0,this.startingCost=0,this.reFac=0,this.sciFac=0,this.hwFac=0,this.robFac=0,this.aiFac=0,this.advFac=0,this.prodMult=0,this.lastCycleRevenue=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0),this.lastCycleExpenses=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0),this.thisCycleRevenue=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0),this.thisCycleExpenses=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0);var t=Object.keys(_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_5__.IndustryUpgrades).length;this.upgrades=Array(t).fill(0),this.state="START",this.newInd=!0,this.warehouses={[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Aevum]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Chonqing]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Sector12]:new _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse({corp:e.corp,industry:this,loc:_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Sector12,size:WarehouseInitialSize}),[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.NewTokyo]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Ishima]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_17__.CityName.Volhaven]:0},this.init()}function Employee(e={}){if(!(this instanceof Employee))return new Employee(e);this.name=e.name?e.name:"Bobby",this.mor=e.morale?e.morale:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),this.hap=e.happiness?e.happiness:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),this.ene=e.energy?e.energy:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),this.int=e.intelligence?e.intelligence:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(10,50),this.cha=e.charisma?e.charisma:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(10,50),this.exp=e.experience?e.experience:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(10,50),this.cre=e.creativity?e.creativity:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(10,50),this.eff=e.efficiency?e.efficiency:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(10,50),this.sal=e.salary?e.salary:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(.1,5),this.pro=0,this.cyclesUntilRaise=CyclesPerEmployeeRaise,this.loc=e.loc?e.loc:"",this.pos=_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Unassigned}Industry.prototype.init=function(){switch(this.startingCost=_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryStartingCosts[this.type],this.type){case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Energy:this.reFac=.65,this.sciFac=.7,this.robFac=.05,this.aiFac=.3,this.advFac=.08,this.reqMats={Hardware:.1,Metal:.2},this.prodMats=["Energy"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Utilities:case"Utilities":this.reFac=.5,this.sciFac=.6,this.robFac=.4,this.aiFac=.4,this.advFac=.08,this.reqMats={Hardware:.1,Metal:.1},this.prodMats=["Water"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Agriculture:this.reFac=.72,this.sciFac=.5,this.hwFac=.2,this.robFac=.3,this.aiFac=.3,this.advFac=.04,this.reqMats={Water:.5,Energy:.5},this.prodMats=["Plants","Food"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Fishing:this.reFac=.15,this.sciFac=.35,this.hwFac=.35,this.robFac=.5,this.aiFac=.2,this.advFac=.08,this.reqMats={Energy:.5},this.prodMats=["Food"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Mining:this.reFac=.3,this.sciFac=.26,this.hwFac=.4,this.robFac=.45,this.aiFac=.45,this.advFac=.06,this.reqMats={Energy:.8},this.prodMats=["Metal"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Food:this.sciFac=.12,this.hwFac=.15,this.robFac=.3,this.aiFac=.25,this.advFac=.25,this.reFac=.05,this.reqMats={Food:.5,Water:.5,Energy:.2},this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Tobacco:this.reFac=.15,this.sciFac=.75,this.hwFac=.15,this.robFac=.2,this.aiFac=.15,this.advFac=.2,this.reqMats={Plants:1,Water:.2},this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Chemical:this.reFac=.25,this.sciFac=.75,this.hwFac=.2,this.robFac=.25,this.aiFac=.2,this.advFac=.07,this.reqMats={Plants:1,Energy:.5,Water:.5},this.prodMats=["Chemicals"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Pharmaceutical:this.reFac=.05,this.sciFac=.8,this.hwFac=.15,this.robFac=.25,this.aiFac=.2,this.advFac=.16,this.reqMats={Chemicals:2,Energy:1,Water:.5},this.prodMats=["Drugs"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Computer:case"Computer":this.reFac=.2,this.sciFac=.62,this.robFac=.36,this.aiFac=.19,this.advFac=.17,this.reqMats={Metal:2,Energy:1},this.prodMats=["Hardware"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Robotics:this.reFac=.32,this.sciFac=.65,this.aiFac=.36,this.advFac=.18,this.hwFac=.19,this.reqMats={Hardware:5,Energy:3},this.prodMats=["Robots"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Software:this.sciFac=.62,this.advFac=.16,this.hwFac=.25,this.reFac=.15,this.aiFac=.18,this.robFac=.05,this.reqMats={Hardware:.5,Energy:.5},this.prodMats=["AICores"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Healthcare:this.reFac=.1,this.sciFac=.75,this.advFac=.11,this.hwFac=.1,this.robFac=.1,this.aiFac=.1,this.reqMats={Robots:10,AICores:5,Energy:5,Water:5},this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.RealEstate:this.robFac=.6,this.aiFac=.6,this.advFac=.25,this.sciFac=.05,this.hwFac=.05,this.reqMats={Metal:5,Energy:5,Water:2,Hardware:4},this.prodMats=["RealEstate"],this.makesProducts=!0;break;default:return void console.error(`Invalid Industry Type passed into Industry.init(): ${this.type}`)}},Industry.prototype.getProductDescriptionText=function(){if(this.makesProducts)switch(this.type){case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Food:return"create and manage restaurants";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Tobacco:return"create tobacco and tobacco-related products";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Pharmaceutical:return"develop new pharmaceutical drugs";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Computer:case"Computer":return"create new computer hardware and networking infrastructures";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Robotics:return"build specialized robots and robot-related products";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Software:return"develop computer software";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Healthcare:return"build and manage hospitals";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.RealEstate:return"develop and manage real estate properties";default:return console.error("Invalid industry type in Industry.getProductDescriptionText"),""}},Industry.prototype.getMaximumNumberProducts=function(){if(!this.makesProducts)return 0;let e=0;return this.hasResearch("uPgrade: Capacity.I")&&++e,this.hasResearch("uPgrade: Capacity.II")&&++e,BaseMaxProducts+e},Industry.prototype.hasMaximumNumberProducts=function(){return Object.keys(this.products).length>=this.getMaximumNumberProducts()},Industry.prototype.calculateProductionFactors=function(){for(var e=0,t=0;t<Cities.length;++t){var n=Cities[t],r=this.warehouses[n];if(r instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse){var a=r.materials,i=(this.offices[n],Math.pow(.002*a.RealEstate.qty+1,this.reFac)*Math.pow(.002*a.Hardware.qty+1,this.hwFac)*Math.pow(.002*a.Robots.qty+1,this.robFac)*Math.pow(.002*a.AICores.qty+1,this.aiFac));e+=Math.pow(i,.73)}}this.prodMult=e<1?1:e},Industry.prototype.updateWarehouseSizeUsed=function(e){for(var t in e instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse&&e.updateMaterialSizeUsed(),this.products)if(this.products.hasOwnProperty(t)){var n=this.products[t];e.sizeUsed+=n.data[e.loc][0]*n.siz,n.data[e.loc][0]>0&&(e.breakdown+=t+": "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(n.data[e.loc][0]*n.siz,0)+"<br>")}},Industry.prototype.process=function(e=1,t,n){if(this.state=t,"START"===t){(isNaN(this.thisCycleRevenue)||isNaN(this.thisCycleExpenses))&&(console.error("NaN in Corporation's computed revenue/expenses"),Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer"),this.thisCycleRevenue=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0),this.thisCycleExpenses=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0)),this.lastCycleRevenue=this.thisCycleRevenue.dividedBy(e*SecsPerMarketCycle),this.lastCycleExpenses=this.thisCycleExpenses.dividedBy(e*SecsPerMarketCycle),this.thisCycleRevenue=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0),this.thisCycleExpenses=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0),this.lastCycleRevenue.gt(0)&&(this.newInd=!1);var r=0;for(var a in this.offices)this.offices[a]instanceof OfficeSpace&&(r+=this.offices[a].process(e,{industry:this,corporation:n}));this.thisCycleExpenses=this.thisCycleExpenses.plus(r),this.processMaterialMarket(e),this.processProductMarket(e),this.popularity-=1e-4*e,this.popularity=Math.max(0,this.popularity);var i=n.getDreamSenseGain(),o=4*i;return void(i>0&&(this.popularity+=i*e,this.awareness+=o*e))}let s=this.processMaterials(e,n);Array.isArray(s)&&(this.thisCycleRevenue=this.thisCycleRevenue.plus(s[0]),this.thisCycleExpenses=this.thisCycleExpenses.plus(s[1])),s=this.processProducts(e,n),Array.isArray(s)&&(this.thisCycleRevenue=this.thisCycleRevenue.plus(s[0]),this.thisCycleExpenses=this.thisCycleExpenses.plus(s[1]))},Industry.prototype.processMaterialMarket=function(e=1){for(var t=this.reqMats,n=this.prodMats,r=0;r<Cities.length;++r)if(this.warehouses[Cities[r]]instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse){var a=this.warehouses[Cities[r]];for(var i in t)t.hasOwnProperty(i)&&a.materials[i].processMarket();for(var o=0;o<n.length;++o)a.materials[n[o]].processMarket();a.materials.Hardware.processMarket(),a.materials.Robots.processMarket(),a.materials.AICores.processMarket(),a.materials.RealEstate.processMarket()}},Industry.prototype.processProductMarket=function(e=1){for(const t in this.products)if(this.products.hasOwnProperty(t)){const n=this.products[t];let r=4e-4*Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(0,3);if(0===r)continue;this.type!==_IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Pharmaceutical&&this.type!==_IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Software&&this.type!==_IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Robotics||(r*=3),r*=e,n.dmd-=r,n.cmp+=r,n.cmp=Math.min(n.cmp,99.99),n.dmd=Math.max(n.dmd,.001)}},Industry.prototype.processMaterials=function(marketCycles=1,company){var revenue=0,expenses=0,industry=this;if(this.calculateProductionFactors(),"EXPORT"===this.state)for(let e=0;e<Cities.length;++e){var city=Cities[e],office=this.offices[city];if(this.warehouses[city]instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse){var warehouse=this.warehouses[city];for(var matName in warehouse.materials)if(warehouse.materials.hasOwnProperty(matName)){var mat=warehouse.materials[matName];mat.imp=0}}}for(let i=0;i<Cities.length;++i){var city=Cities[i],office=this.offices[city];if(this.warehouses[city]instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse){var warehouse=this.warehouses[city];switch(this.state){case"PURCHASE":for(var matName in warehouse.materials)warehouse.materials.hasOwnProperty(matName)&&(!function(e,t){var n,r,a=warehouse.materials[e];warehouse.smartSupplyEnabled&&Object.keys(t.reqMats).includes(e)?(a.buy=t.reqMats[e]*warehouse.smartSupplyStore,r=a.buy*SecsPerMarketCycle*marketCycles):r=a.buy*SecsPerMarketCycle*marketCycles,n="RealEstate"==e?r:Math.floor((warehouse.size-warehouse.sizeUsed)/_MaterialSizes__WEBPACK_IMPORTED_MODULE_7__.MaterialSizes[e]),(r=Math.min(r,n))>0&&(a.qty+=r,expenses+=r*a.bCost)}(matName,industry),this.updateWarehouseSizeUsed(warehouse));break;case"PRODUCTION":if(warehouse.smartSupplyStore=0,this.prodMats.length>0){var mat=warehouse.materials[this.prodMats[0]],maxProd=this.getOfficeProductivity(office)*this.prodMult*company.getProductionMultiplier()*this.getProductionMultiplier();let e;e=mat.prdman[0]?Math.min(maxProd,mat.prdman[1]):maxProd,e*=SecsPerMarketCycle*marketCycles;var totalMatSize=0;for(let e=0;e<this.prodMats.length;++e)totalMatSize+=_MaterialSizes__WEBPACK_IMPORTED_MODULE_7__.MaterialSizes[this.prodMats[e]];for(const e in this.reqMats){var normQty=this.reqMats[e];totalMatSize-=_MaterialSizes__WEBPACK_IMPORTED_MODULE_7__.MaterialSizes[e]*normQty}if(totalMatSize>0){var maxAmt=Math.floor((warehouse.size-warehouse.sizeUsed)/totalMatSize);e=Math.min(maxAmt,e)}e<0&&(e=0),warehouse.smartSupplyStore+=e/(SecsPerMarketCycle*marketCycles);var producableFrac=1;for(var reqMatName in this.reqMats)if(this.reqMats.hasOwnProperty(reqMatName)){var req=this.reqMats[reqMatName]*e;warehouse.materials[reqMatName].qty<req&&(producableFrac=Math.min(producableFrac,warehouse.materials[reqMatName].qty/req))}if(producableFrac<=0&&(producableFrac=0,e=0),producableFrac>0&&e>0){for(const t in this.reqMats){var reqMatQtyNeeded=this.reqMats[t]*e*producableFrac;warehouse.materials[t].qty-=reqMatQtyNeeded,warehouse.materials[t].prd=0,warehouse.materials[t].prd-=reqMatQtyNeeded/(SecsPerMarketCycle*marketCycles)}for(let t=0;t<this.prodMats.length;++t)warehouse.materials[this.prodMats[t]].qty+=e*producableFrac,warehouse.materials[this.prodMats[t]].qlt=office.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Engineer]/90+Math.pow(this.sciResearch.qty,this.sciFac)+Math.pow(warehouse.materials.AICores.qty,this.aiFac)/1e4}else for(const e in this.reqMats)this.reqMats.hasOwnProperty(e)&&(warehouse.materials[e].prd=0);const t=e*producableFrac/(SecsPerMarketCycle*marketCycles);for(let e=0;e<this.prodMats.length;++e)warehouse.materials[this.prodMats[e]].prd=t}else for(const e in this.reqMats)warehouse.materials[e].prd=0;break;case"SALE":for(var matName in warehouse.materials)if(warehouse.materials.hasOwnProperty(matName)){var mat=warehouse.materials[matName];if(mat.sCost<0||!1===mat.sllman[0]){mat.sll=0;continue}const businessFactor=this.getBusinessFactor(office),advertisingFactor=this.getAdvertisingFactors()[0],marketFactor=this.getMarketFactor(mat),markupLimit=mat.getMarkupLimit();var sCost;if(mat.marketTa2){const e=mat.prd,t=markupLimit,n=e,r=(mat.qlt+.001)*marketFactor*businessFactor*company.getSalesMultiplier()*advertisingFactor*this.getSalesMultiplier(),a=Math.sqrt(n/r);let i;0===r||0===a?0===n?i=0:(i=mat.bCost+markupLimit,console.warn("In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost")):i=t/a+mat.bCost,mat.marketTa2Price=i,sCost=i}else mat.marketTa1?sCost=mat.bCost+markupLimit:Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_31__.isString)(mat.sCost)?(sCost=mat.sCost.replace(/MP/g,mat.bCost),sCost=eval(sCost)):sCost=mat.sCost;let markup=1;sCost>mat.bCost?sCost-mat.bCost>markupLimit&&(markup=Math.pow(markupLimit/(sCost-mat.bCost),2)):sCost<mat.bCost&&(markup=sCost<=0?1e12:mat.bCost/sCost);var maxSell=(mat.qlt+.001)*marketFactor*markup*businessFactor*company.getSalesMultiplier()*advertisingFactor*this.getSalesMultiplier(),sellAmt;if(Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_31__.isString)(mat.sllman[1])){var tmp=mat.sllman[1].replace(/MAX/g,maxSell);tmp=tmp.replace(/PROD/g,mat.prd);try{sellAmt=eval(tmp)}catch(e){Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("Error evaluating your sell amount for material "+mat.name+" in "+this.name+"'s "+city+" office. The sell amount is being set to zero"),sellAmt=0}sellAmt=Math.min(maxSell,sellAmt)}else sellAmt=-1===mat.sllman[1]?maxSell:Math.min(maxSell,mat.sllman[1]);if(sellAmt=sellAmt*SecsPerMarketCycle*marketCycles,sellAmt=Math.min(mat.qty,sellAmt),sellAmt<0){console.warn(`sellAmt calculated to be negative for ${matName} in ${city}`),mat.sll=0;continue}sellAmt&&sCost>=0?(mat.qty-=sellAmt,revenue+=sellAmt*sCost,mat.sll=sellAmt/(SecsPerMarketCycle*marketCycles)):mat.sll=0}break;case"EXPORT":for(var matName in warehouse.materials)if(warehouse.materials.hasOwnProperty(matName)){var mat=warehouse.materials[matName];mat.totalExp=0;for(var expI=0;expI<mat.exp.length;++expI){var exp=mat.exp[expI],amt=exp.amt.replace(/MAX/g,mat.qty/(SecsPerMarketCycle*marketCycles));try{amt=eval(amt)}catch(e){Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("Calculating export for "+mat.name+" in "+this.name+"'s "+city+" division failed with error: "+e);continue}if(isNaN(amt))Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("Error calculating export amount for "+mat.name+" in "+this.name+"'s "+city+" division.");else{if(amt=amt*SecsPerMarketCycle*marketCycles,mat.qty<amt&&(amt=mat.qty),0===amt)break;for(var foo=0;foo<company.divisions.length;++foo)if(company.divisions[foo].name===exp.ind){var expIndustry=company.divisions[foo],expWarehouse=expIndustry.warehouses[exp.city];if(!(expWarehouse instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse)){console.error(`Invalid export! ${expIndustry.name} ${exp.city}`);break}if(expWarehouse.sizeUsed>=expWarehouse.size)return[0,0];var maxAmt=Math.floor((expWarehouse.size-expWarehouse.sizeUsed)/_MaterialSizes__WEBPACK_IMPORTED_MODULE_7__.MaterialSizes[matName]);amt=Math.min(maxAmt,amt),expWarehouse.materials[matName].imp+=amt/(SecsPerMarketCycle*marketCycles),expWarehouse.materials[matName].qty+=amt,expWarehouse.materials[matName].qlt=mat.qlt,mat.qty-=amt,mat.totalExp+=amt,expIndustry.updateWarehouseSizeUsed(expWarehouse);break}}}mat.totalExp/=SecsPerMarketCycle*marketCycles}break;case"START":break;default:console.error(`Invalid state: ${this.state}`)}this.updateWarehouseSizeUsed(warehouse)}office instanceof OfficeSpace&&(this.sciResearch.qty+=.004*Math.pow(office.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.RandD],.5)*company.getScientificResearchMultiplier()*this.getScientificResearchMultiplier())}return[revenue,expenses]},Industry.prototype.processProducts=function(e=1,t){var n=0;if("PRODUCTION"===this.state)for(const t in this.products){const n=this.products[t];if(!n.fin){const t=n.createCity,r=this.offices[t],a=r.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Engineer],i=r.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Management],o=r.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Operations],s=a+i+o;if(s<=0)break;const l=1+i/(1.2*s),c=(Math.pow(a,.34)+Math.pow(o,.2))*l;n.createProduct(e,c),n.prog>=100&&n.finishProduct(r.employeeProd,this);break}}for(var r in this.products)if(this.products.hasOwnProperty(r)){var a=this.products[r];a instanceof _Product__WEBPACK_IMPORTED_MODULE_8__.Product&&a.fin&&(n+=this.processProduct(e,a,t))}return[n,0]},Industry.prototype.processProduct=function(marketCycles=1,product,corporation){let totalProfit=0;for(let i=0;i<Cities.length;++i){let city=Cities[i],office=this.offices[city],warehouse=this.warehouses[city];if(warehouse instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse)switch(this.state){case"PRODUCTION":var maxProd=this.getOfficeProductivity(office,{forProduct:!0})*corporation.getProductionMultiplier()*this.prodMult*this.getProductionMultiplier()*this.getProductProductionMultiplier();let prod;prod=product.prdman[city][0]?Math.min(maxProd,product.prdman[city][1]):maxProd,prod*=SecsPerMarketCycle*marketCycles;var netStorageSize=product.siz;for(var reqMatName in product.reqMats)if(product.reqMats.hasOwnProperty(reqMatName)){var normQty=product.reqMats[reqMatName];netStorageSize-=_MaterialSizes__WEBPACK_IMPORTED_MODULE_7__.MaterialSizes[reqMatName]*normQty}if(netStorageSize>0){var maxAmt=Math.floor((warehouse.size-warehouse.sizeUsed)/netStorageSize);prod=Math.min(maxAmt,prod)}warehouse.smartSupplyStore+=prod/(SecsPerMarketCycle*marketCycles);var producableFrac=1;for(var reqMatName in product.reqMats)if(product.reqMats.hasOwnProperty(reqMatName)){var req=product.reqMats[reqMatName]*prod;warehouse.materials[reqMatName].qty<req&&(producableFrac=Math.min(producableFrac,warehouse.materials[reqMatName].qty/req))}if(producableFrac>0&&prod>0){for(var reqMatName in product.reqMats)if(product.reqMats.hasOwnProperty(reqMatName)){var reqMatQtyNeeded=product.reqMats[reqMatName]*prod*producableFrac;warehouse.materials[reqMatName].qty-=reqMatQtyNeeded,warehouse.materials[reqMatName].prd-=reqMatQtyNeeded/(SecsPerMarketCycle*marketCycles)}product.data[city][0]+=prod*producableFrac}product.data[city][1]=prod*producableFrac/(SecsPerMarketCycle*marketCycles);break;case"SALE":for(var reqMatName in product.pCost=0,product.reqMats)product.reqMats.hasOwnProperty(reqMatName)&&(product.pCost+=product.reqMats[reqMatName]*warehouse.materials[reqMatName].bCost);product.pCost*=ProductProductionCostRatio;const businessFactor=this.getBusinessFactor(office),advertisingFactor=this.getAdvertisingFactors()[0],marketFactor=this.getMarketFactor(product),markupLimit=product.rat/product.mku;var sCost;if(product.marketTa2){const e=product.data[city][1],t=markupLimit,n=e,r=.5*Math.pow(product.rat,.65)*marketFactor*corporation.getSalesMultiplier()*businessFactor*advertisingFactor*this.getSalesMultiplier(),a=Math.sqrt(n/r);let i;0===r||0===a?0===n?i=0:(i=product.pCost+markupLimit,console.warn("In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost")):i=t/a+product.pCost,product.marketTa2Price[city]=i,sCost=i}else product.marketTa1?sCost=product.pCost+markupLimit:Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_31__.isString)(product.sCost)?(sCost=product.sCost.replace(/MP/g,product.pCost+product.rat/product.mku),sCost=eval(sCost)):sCost=product.sCost;var markup=1;sCost>product.pCost&&sCost-product.pCost>markupLimit&&(markup=markupLimit/(sCost-product.pCost));var maxSell=.5*Math.pow(product.rat,.65)*marketFactor*corporation.getSalesMultiplier()*Math.pow(markup,2)*businessFactor*advertisingFactor*this.getSalesMultiplier(),sellAmt;if(product.sllman[city][0]&&Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_31__.isString)(product.sllman[city][1])){var tmp=product.sllman[city][1].replace(/MAX/g,maxSell);tmp=tmp.replace(/PROD/g,product.data[city][1]);try{tmp=eval(tmp)}catch(e){Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("Error evaluating your sell price expression for "+product.name+" in "+this.name+"'s "+city+" office. Sell price is being set to MAX"),tmp=maxSell}sellAmt=Math.min(maxSell,tmp)}else sellAmt=product.sllman[city][0]&&product.sllman[city][1]>0?Math.min(maxSell,product.sllman[city][1]):!1===product.sllman[city][0]?0:maxSell;sellAmt<0&&(sellAmt=0),sellAmt=sellAmt*SecsPerMarketCycle*marketCycles,sellAmt=Math.min(product.data[city][0],sellAmt),sellAmt&&sCost?(product.data[city][0]-=sellAmt,totalProfit+=sellAmt*sCost,product.data[city][2]=sellAmt/(SecsPerMarketCycle*marketCycles)):product.data[city][2]=0;break;case"START":case"PURCHASE":case"EXPORT":break;default:console.error(`Invalid State: ${this.state}`)}}return totalProfit},Industry.prototype.discontinueProduct=function(e){for(var t in this.products)this.products.hasOwnProperty(t)&&e===this.products[t]&&delete this.products[t]},Industry.prototype.upgrade=function(e,t){var n=t.corporation,r=(t.division,t.office),a=e[0];for(e[1],e[2],e[3];this.upgrades.length<=a;)this.upgrades.push(0);switch(++this.upgrades[a],a){case 0:for(let e=0;e<r.employees.length;++e)r.employees[e].ene=Math.min(1.05*r.employees[e].ene,r.maxEne);break;case 1:var i=n.getAdvertisingMultiplier()*this.getAdvertisingMultiplier();this.awareness+=3*i,this.popularity+=1*i,this.awareness*=1.01*i,this.popularity*=(1+Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(1,3)/100)*i;break;default:console.error(`Un-implemented function index: ${a}`)}},Industry.prototype.getOfficeProductivity=function(e,t){const n=e.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Operations],r=e.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Engineer],a=e.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Management],i=n+r+a;if(i<=0)return 0;const o=1+a/(1.2*i),s=(Math.pow(n,.4)+Math.pow(r,.3))*o;return t&&t.forProduct?.025*s:.05*s},Industry.prototype.getBusinessFactor=function(e){const t=1+e.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Business];return Object(_utils_calculateEffectWithFactors__WEBPACK_IMPORTED_MODULE_21__.calculateEffectWithFactors)(t,.26,1e4)},Industry.prototype.getAdvertisingFactors=function(){var e=Math.pow(this.awareness+1,this.advFac),t=Math.pow(this.popularity+1,this.advFac),n=0===this.awareness?.01:Math.max((this.popularity+.001)/this.awareness,.01);return[Math.pow(e*t*n,.85),e,t,n]},Industry.prototype.getMarketFactor=function(e){return Math.max(.1,e.dmd*(100-e.cmp)/100)},Industry.prototype.hasResearch=function(e){return!0===this.researched[e]},Industry.prototype.updateResearchTree=function(){const e=_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type];if(Object.keys(e.researched).length!==Object.keys(this.researched).length)for(let t in this.researched)e.research(t)},Industry.prototype.getAdvertisingMultiplier=function(){return this.updateResearchTree(),_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type].getAdvertisingMultiplier()},Industry.prototype.getEmployeeChaMultiplier=function(){return this.updateResearchTree(),_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type].getEmployeeChaMultiplier()},Industry.prototype.getEmployeeCreMultiplier=function(){return this.updateResearchTree(),_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type].getEmployeeCreMultiplier()},Industry.prototype.getEmployeeEffMultiplier=function(){return this.updateResearchTree(),_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type].getEmployeeEffMultiplier()},Industry.prototype.getEmployeeIntMultiplier=function(){return this.updateResearchTree(),_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type].getEmployeeIntMultiplier()},Industry.prototype.getProductionMultiplier=function(){return this.updateResearchTree(),_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type].getProductionMultiplier()},Industry.prototype.getProductProductionMultiplier=function(){return this.updateResearchTree(),_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type].getProductProductionMultiplier()},Industry.prototype.getSalesMultiplier=function(){return this.updateResearchTree(),_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type].getSalesMultiplier()},Industry.prototype.getScientificResearchMultiplier=function(){return this.updateResearchTree(),_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type].getScientificResearchMultiplier()},Industry.prototype.getStorageMultiplier=function(){return this.updateResearchTree(),_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type].getStorageMultiplier()},Industry.prototype.createResearchBox=function(){const e="corporation-research-popup-box";researchTreeBoxOpened&&(Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_34__.removeElementById)(e),researchTreeBox=null);const t=_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryResearchTrees[this.type];researchTreeBox=Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_27__.createPopup)(e,[],{backgroundColor:"black"});const n=t.createTreantMarkup();n.chart.container="#"+e+"-content",n.chart.nodeAlign="BOTTOM",n.chart.rootOrientation="WEST",n.chart.siblingSeparation=40,n.chart.connectors={type:"step",style:{"arrow-end":"block-wide-long",stroke:"white","stroke-width":2}};new Treant(n);const r=t.getAllNodes();for(let e=0;e<r.length;++e){if(!0===this.researched[r[e]])continue;const n=_ResearchMap__WEBPACK_IMPORTED_MODULE_9__.ResearchMap[r[e]],a=r[e].replace(/\s/g,""),i=document.getElementById(a+"-corp-research-click-listener");null!=i?i.addEventListener("click",()=>{if(this.sciResearch.qty>=n.cost)return this.sciResearch.qty-=n.cost,t.research(r[e]),this.researched[r[e]]=!0,Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)(`Researched ${r[e]}. It may take a market cycle `+`(~${SecsPerMarketCycle} seconds) before the effects of `+"the Research apply."),this.createResearchBox();Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)(`You do not have enough Scientific Research for ${n.name}`)}):console.warn(`Could not find Research Tree div for ${a}`)}const a=document.getElementById(`${e}-content`);null!=a&&(Object(_utils_uiHelpers_appendLineBreaks__WEBPACK_IMPORTED_MODULE_25__.appendLineBreaks)(a,2),a.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("pre",{display:"block",innerText:"Multipliers from research:\n"+` * Advertising Multiplier: x${t.getAdvertisingMultiplier()}\n`+` * Employee Charisma Multiplier: x${t.getEmployeeChaMultiplier()}\n`+` * Employee Creativity Multiplier: x${t.getEmployeeCreMultiplier()}\n`+` * Employee Efficiency Multiplier: x${t.getEmployeeEffMultiplier()}\n`+` * Employee Intelligence Multiplier: x${t.getEmployeeIntMultiplier()}\n`+` * Production Multiplier: x${t.getProductionMultiplier()}\n`+` * Sales Multiplier: x${t.getSalesMultiplier()}\n`+` * Scientific Research Multiplier: x${t.getScientificResearchMultiplier()}\n`+` * Storage Multiplier: x${t.getStorageMultiplier()}`})),a.appendChild(Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_28__.createPopupCloseButton)(researchTreeBox,{class:"std-button",display:"block",innerText:"Close"}))),researchTreeBoxOpened=!0},Industry.prototype.toJSON=function(){return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Generic_toJSON)("Industry",this)},Industry.fromJSON=function(e){return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Generic_fromJSON)(Industry,e.data)},_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Reviver.constructors.Industry=Industry,Employee.prototype.process=function(e=1,t){var n=.003*e,r=n*Math.random();this.exp+=n,this.cyclesUntilRaise-=e,this.cyclesUntilRaise<=0&&(this.salary+=EmployeeRaiseAmount,this.cyclesUntilRaise+=CyclesPerEmployeeRaise);var a=n*Math.random();return this.pos===_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Training&&(this.cha+=a,this.exp+=a,this.eff+=a),this.ene-=r,this.hap-=r,this.ene<t.minEne&&(this.ene=t.minEne),this.hap<t.minHap&&(this.hap=t.minHap),this.sal*e*SecsPerMarketCycle},Employee.prototype.calculateProductivity=function(e,t){var n=this.cre*e.getEmployeeCreMultiplier()*t.getEmployeeCreMultiplier(),r=this.cha*e.getEmployeeChaMultiplier()*t.getEmployeeChaMultiplier(),a=this.int*e.getEmployeeIntMultiplier()*t.getEmployeeIntMultiplier(),i=this.eff*e.getEmployeeEffMultiplier()*t.getEmployeeEffMultiplier();const o=this.mor*this.hap*this.ene*1e-6;let s;switch(this.pos){case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Operations:s=.6*a+.1*r+this.exp+.5*n+i;break;case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Engineer:s=a+.1*r+1.5*this.exp+i;break;case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Business:s=.4*a+r+.5*this.exp;break;case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Management:s=2*r+this.exp+.2*n+.7*i;break;case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.RandD:s=1.5*a+.8*this.exp+n+.5*i;break;case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Unassigned:case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Training:s=0;break;default:console.error(`Invalid employee position: ${this.pos}`)}return o*s},Employee.prototype.throwParty=function(e){var t=1+e/1e7;return this.mor*=t,this.mor=Math.min(100,this.mor),this.hap*=t,this.hap=Math.min(100,this.hap),t},Employee.prototype.createUI=function(e,t,n){var r=this.cre*t.getEmployeeCreMultiplier()*n.getEmployeeCreMultiplier(),a=this.cha*t.getEmployeeChaMultiplier()*n.getEmployeeChaMultiplier(),i=this.int*t.getEmployeeIntMultiplier()*n.getEmployeeIntMultiplier(),o=this.eff*t.getEmployeeEffMultiplier()*n.getEmployeeEffMultiplier();e.style.color="white",e.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("p",{id:"cmpy-mgmt-employee-"+this.name+"-panel-text",innerHTML:"Morale: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(this.mor,3)+"<br>Happiness: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(this.hap,3)+"<br>Energy: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(this.ene,3)+"<br>Intelligence: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(i,3)+"<br>Charisma: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(a,3)+"<br>Experience: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(this.exp,3)+"<br>Creativity: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(r,3)+"<br>Efficiency: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(o,3)+"<br>Salary: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19__.numeralWrapper.format(this.sal,"$0.000a")+"/ s<br>"}));var s=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("select",{});for(var l in _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions)_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.hasOwnProperty(l)&&s.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("option",{text:_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions[l],value:_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions[l]}));s.addEventListener("change",()=>{this.pos=s.options[s.selectedIndex].value});for(var c=0;c<s.length;++c)if(s.options[c].value===this.pos){s.selectedIndex=c;break}e.appendChild(s)},Employee.prototype.toJSON=function(){return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Generic_toJSON)("Employee",this)},Employee.fromJSON=function(e){return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Generic_fromJSON)(Employee,e.data)},_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Reviver.constructors.Employee=Employee;var OfficeSpaceTiers={Basic:"Basic",Enhanced:"Enhanced",Luxurious:"Luxurious",Extravagant:"Extravagant"};function OfficeSpace(e={}){this.loc=e.loc?e.loc:"",this.cost=e.cost?e.cost:1,this.size=e.size?e.size:1,this.comf=e.comfort?e.comfort:1,this.beau=e.beauty?e.beauty:1,this.tier=OfficeSpaceTiers.Basic,this.minEne=0,this.maxEne=100,this.minHap=0,this.maxHap=100,this.maxMor=100,this.employees=[],this.employeeProd={[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Operations]:0,[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Engineer]:0,[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Business]:0,[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Management]:0,[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.RandD]:0,total:0}}function Corporation(e={}){this.name=e.name?e.name:"The Corporation",this.divisions=[],this.funds=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(15e10),this.revenue=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0),this.expenses=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0),this.fundingRound=0,this.public=!1,this.totalShares=INITIALSHARES,this.numShares=INITIALSHARES,this.shareSalesUntilPriceUpdate=SHARESPERPRICEUPDATE,this.shareSaleCooldown=0,this.issueNewSharesCooldown=0,this.dividendPercentage=0,this.dividendTaxPercentage=50,this.issuedShares=0,this.sharePrice=0,this.storedCycles=0;var t=Object.keys(_data_CorporationUnlockUpgrades__WEBPACK_IMPORTED_MODULE_1__.CorporationUnlockUpgrades).length,n=Object.keys(_data_CorporationUpgrades__WEBPACK_IMPORTED_MODULE_2__.CorporationUpgrades).length;this.unlockUpgrades=Array(t).fill(0),this.upgrades=Array(n).fill(0),this.upgradeMultipliers=Array(n).fill(1),this.state=new _CorporationState__WEBPACK_IMPORTED_MODULE_0__.CorporationState}let corpRouting,eventHandler,companyManagementDiv;OfficeSpace.prototype.atCapacity=function(){return this.employees.length>=this.size},OfficeSpace.prototype.process=function(e=1,t){t.corporation;var n=t.industry;if(n.hasResearch("HRBuddy-Recruitment")&&!this.atCapacity()){const e=this.hireRandomEmployee();n.hasResearch("HRBuddy-Training")&&(e.pos=_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Training)}this.maxEne=100,this.maxHap=100,this.maxMor=100,n.hasResearch("Go-Juice")&&(this.maxEne+=10),n.hasResearch("JoyWire")&&(this.maxHap+=10),n.hasResearch("Sti.mu")&&(this.maxMor+=10);var r=1;n.funds<0&&n.lastCycleRevenue<0?r=Math.pow(.99,e):n.funds>0&&n.lastCycleRevenue>0&&(r=Math.pow(1.01,e));const a=n.hasResearch("AutoBrew"),i=n.hasResearch("AutoPartyManager");var o=0;for(let t=0;t<this.employees.length;++t){const n=this.employees[t];i?(n.mor=this.maxMor,n.hap=this.maxHap):(n.mor*=r,n.hap*=r,n.mor=Math.min(n.mor,this.maxMor),n.hap=Math.min(n.hap,this.maxHap)),a?n.ene=this.maxEne:(n.ene*=r,n.ene=Math.min(n.ene,this.maxEne)),o+=n.process(e,this)}return this.calculateEmployeeProductivity(t),o},OfficeSpace.prototype.calculateEmployeeProductivity=function(e){var t=e.corporation,n=e.industry;for(const e in this.employeeProd)this.employeeProd[e]=0;var r=0;for(let e=0;e<this.employees.length;++e){const a=this.employees[e],i=a.calculateProductivity(t,n);this.employeeProd[a.pos]+=i,r+=i}this.employeeProd.total=r},OfficeSpace.prototype.findEmployees=function(e){e.corporation,e.industry;if(!this.atCapacity()&&null==document.getElementById("cmpy-mgmt-hire-employee-popup")){var t=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(25,50)/100,n=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(51,75)/100,r=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(76,100)/100,a=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),i=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),o=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),s=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),l=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),c=EmployeeSalaryMultiplier*(a+i+o+s+l),u=new Employee({intelligence:a*t,charisma:i*t,experience:o*t,creativity:s*t,efficiency:l*t,salary:c*t}),m=new Employee({intelligence:a*n,charisma:i*n,experience:o*n,creativity:s*n,efficiency:l*n,salary:c*n}),p=new Employee({intelligence:a*r,charisma:i*r,experience:o*r,creativity:s*r,efficiency:l*r,salary:c*r}),h=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("h1",{innerHTML:"Select one of the following candidates for hire:"}),d=function(t,n){return Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("div",{class:"cmpy-mgmt-find-employee-option",innerHTML:"Intelligence: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(t.int,1)+"<br>Charisma: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(t.cha,1)+"<br>Experience: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(t.exp,1)+"<br>Creativity: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(t.cre,1)+"<br>Efficiency: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.formatNumber)(t.eff,1)+"<br>Salary: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19__.numeralWrapper.format(t.sal,"$0.000a")+" s<br>",clickListener:()=>(n.hireEmployee(t,e),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_34__.removeElementById)("cmpy-mgmt-hire-employee-popup"),!1)})},_=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("a",{class:"a-link-button",innerText:"Cancel",float:"right",clickListener:()=>(Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_34__.removeElementById)("cmpy-mgmt-hire-employee-popup"),!1)}),g=[h,d(u,this),d(m,this),d(p,this),_];Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_27__.createPopup)("cmpy-mgmt-hire-employee-popup",g)}},OfficeSpace.prototype.hireEmployee=function(e,t){var n=t.corporation,r=(t.industry,Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoTxtInpBoxGetYesButton)()),a=Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoTxtInpBoxGetNoButton)();r.innerHTML="Hire",a.innerHTML="Cancel",r.addEventListener("click",()=>{for(var t=Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoTxtInpBoxGetInput)(),r=0;r<this.employees.length;++r)if(this.employees[r].name===t)return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("You already have an employee with this nickname! Please give every employee a unique nickname."),!1;return e.name=t,this.employees.push(e),n.rerender(),Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoTxtInpBoxClose)()}),a.addEventListener("click",()=>Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoTxtInpBoxClose)()),Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoTxtInpBoxCreate)("Give your employee a nickname!")},OfficeSpace.prototype.hireRandomEmployee=function(){if(!this.atCapacity()&&null==document.getElementById("cmpy-mgmt-hire-employee-popup")){var e=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(76,100)/100,t=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),n=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),r=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),a=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),i=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_30__.getRandomInt)(50,100),o=new Employee({intelligence:t*e,charisma:n*e,experience:r*e,creativity:a*e,efficiency:i*e,salary:EmployeeSalaryMultiplier*(t+n+r+a+i)*e}),s=Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_29__.generateRandomString)(7);for(let e=0;e<this.employees.length;++e)if(this.employees[e].name===s)return this.hireRandomEmployee();return o.name=s,this.employees.push(o),o}},OfficeSpace.prototype.assignEmployeeToJob=function(e){for(var t=0;t<this.employees.length;++t)if(this.employees[t].pos===_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Unassigned)return this.employees[t].pos=e,!0;return!1},OfficeSpace.prototype.unassignEmployeeFromJob=function(e){for(var t=0;t<this.employees.length;++t)if(this.employees[t].pos===e)return this.employees[t].pos=_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Unassigned,!0;return!1},OfficeSpace.prototype.toJSON=function(){return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Generic_toJSON)("OfficeSpace",this)},OfficeSpace.fromJSON=function(e){return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Generic_fromJSON)(OfficeSpace,e.data)},_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Reviver.constructors.OfficeSpace=OfficeSpace,Corporation.prototype.getState=function(){return this.state.getState()},Corporation.prototype.storeCycles=function(e=1){this.storedCycles+=e},Corporation.prototype.process=function(){var e=this;if(this.storedCycles>=CyclesPerIndustryStateCycle){const t=this.getState(),n=1,r=n*CyclesPerIndustryStateCycle;if(this.storedCycles-=r,this.divisions.forEach(function(r){r.process(n,t,e)}),this.shareSaleCooldown>0&&(this.shareSaleCooldown-=r),this.issueNewSharesCooldown>0&&(this.issueNewSharesCooldown-=r),"START"===t){this.revenue=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0),this.expenses=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(0),this.divisions.forEach(e=>{e.lastCycleRevenue!==-1/0&&e.lastCycleRevenue!==1/0&&e.lastCycleExpenses!==-1/0&&e.lastCycleExpenses!==1/0&&(this.revenue=this.revenue.plus(e.lastCycleRevenue),this.expenses=this.expenses.plus(e.lastCycleExpenses))});const e=this.revenue.minus(this.expenses).times(n*SecsPerMarketCycle);if(isNaN(this.funds)&&(Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("There was an error calculating your Corporations funds and they got reset to 0. This is a bug. Please report to game developer.<br><br>(Your funds have been set to $150b for the inconvenience)"),this.funds=new decimal_js__WEBPACK_IMPORTED_MODULE_41__.a(15e10)),this.dividendPercentage>0&&e>0)if(isNaN(this.dividendPercentage)||this.dividendPercentage<0||this.dividendPercentage>DividendMaxPercentage)console.error(`Invalid Corporation dividend percentage: ${this.dividendPercentage}`);else{const t=this.dividendPercentage/100*e,n=e-t,r=t/this.totalShares,a=this.numShares*r*(1-this.dividendTaxPercentage/100);_Player__WEBPACK_IMPORTED_MODULE_18__.Player.gainMoney(a),_Player__WEBPACK_IMPORTED_MODULE_18__.Player.recordMoneySource(a,"corporation"),this.funds=this.funds.plus(n)}else this.funds=this.funds.plus(e);this.updateSharePrice()}this.state.nextState(),_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_20__.routing.isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_20__.Page.Corporation)&&this.rerender()}},Corporation.prototype.determineValuation=function(){var e,t=this.revenue.minus(this.expenses).toNumber();return this.public?(this.dividendPercentage>0&&(t*=(100-this.dividendPercentage)/100),e=this.funds.toNumber()+85e3*t,e*=Math.pow(1.1,this.divisions.length),e=Math.max(e,0)):(e=1e10+Math.max(this.funds.toNumber(),0)/3,t>0?(e+=315e3*t,e*=Math.pow(1.1,this.divisions.length)):e=1e10*Math.pow(1.1,this.divisions.length),e-=e%1e6),e*_BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_11__.BitNodeMultipliers.CorporationValuation},Corporation.prototype.getInvestment=function(){var e,t=this.determineValuation();let n=4;switch(this.fundingRound){case 0:e=.1,n=4;break;case 1:e=.35,n=3;break;case 2:e=.25,n=3;break;case 3:e=.2,n=2.5;break;case 4:return}var r=t*e*n,a=Math.floor(INITIALSHARES*e),i=Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoBoxGetYesButton)(),o=Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoBoxGetNoButton)();i.innerHTML="Accept",o.innerHML="Reject",i.addEventListener("click",()=>(++this.fundingRound,this.funds=this.funds.plus(r),this.numShares-=a,this.rerender(),Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoBoxClose)())),o.addEventListener("click",()=>Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoBoxClose)()),Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_35__.yesNoBoxCreate)("An investment firm has offered you "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19__.numeralWrapper.format(r,"$0.000a")+" in funding in exchange for a "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19__.numeralWrapper.format(100*e,"0.000a")+"% stake in the company ("+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19__.numeralWrapper.format(a,"0.000a")+" shares).<br><br>Do you accept or reject this offer?<br><br>Hint: Investment firms will offer more money if your corporation is turning a profit")},Corporation.prototype.goPublic=function(){var e,t=this.determineValuation()/this.totalShares,n=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("p",{innerHTML:"Enter the number of shares you would like to issue for your IPO. These shares will be publicly sold and you will no longer own them. Your Corporation will receive "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19__.numeralWrapper.format(t,"$0.000a")+" per share (the IPO money will be deposited directly into your Corporation's funds).<br><br>You have a total of "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19__.numeralWrapper.format(this.numShares,"0.000a")+" of shares that you can issue."}),r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("input",{type:"number",placeholder:"Shares to issue",onkeyup:t=>{t.preventDefault(),t.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_32__.KEY.ENTER&&e.click()}}),a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("br",{});e=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("a",{class:"a-link-button",innerText:"Go Public",clickListener:()=>{var e=Math.round(r.value),t=this.determineValuation()/this.totalShares;return isNaN(e)?(Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("Invalid value for number of issued shares"),!1):e>this.numShares?(Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("Error: You don't have that many shares to issue!"),!1):(this.public=!0,this.sharePrice=t,this.issuedShares=e,this.numShares-=e,this.funds=this.funds.plus(e*t),this.rerender(),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_34__.removeElementById)("cmpy-mgmt-go-public-popup"),Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)(`You took your ${this.name} public and earned `+`${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_19__.numeralWrapper.formatMoney(e*t)} in your IPO`),!1)}});var i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("a",{class:"a-link-button",innerText:"Cancel",clickListener:()=>(Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_34__.removeElementById)("cmpy-mgmt-go-public-popup"),!1)});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_27__.createPopup)("cmpy-mgmt-go-public-popup",[n,a,r,e,i])},Corporation.prototype.getTargetSharePrice=function(){return this.determineValuation()/(2*(this.totalShares-this.numShares)+1)},Corporation.prototype.updateSharePrice=function(){const e=this.getTargetSharePrice();this.sharePrice<=e?this.sharePrice*=1+.01*Math.random():this.sharePrice*=1-.01*Math.random(),this.sharePrice<=.01&&(this.sharePrice=.01)},Corporation.prototype.immediatelyUpdateSharePrice=function(){this.sharePrice=this.getTargetSharePrice()},Corporation.prototype.calculateShareSale=function(e){let t=e,n=this.shareSalesUntilPriceUpdate,r=this.sharePrice,a=0,i=0;const o=Math.ceil(e/SHARESPERPRICEUPDATE);if(!(isNaN(o)||o>1e7)){for(let e=0;e<o;++e){if(t<n){i+=r*t,n-=t;break}i+=r*n,t-=n=SHARESPERPRICEUPDATE,a+=n,r=this.determineValuation()/(2*(this.totalShares+a-this.numShares))}return[i,r,n]}console.error(`Something went wrong or unexpected when calculating share sale. Maxiterations calculated to be ${o}`)},Corporation.prototype.convertCooldownToString=function(e){_Constants__WEBPACK_IMPORTED_MODULE_12__.CONSTANTS.MilliPerCycle;const t=e/5;return t>3600?`${Math.floor(t/3600)} hour(s)`:t>60?`${Math.floor(t/60)} minute(s)`:`${Math.floor(t)} second(s)`},Corporation.prototype.unlock=function(e){const t=e[0],n=e[1];for(;this.unlockUpgrades.length<=t;)this.unlockUpgrades.push(0);this.funds.lt(n)?Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("You don't have enough funds to unlock this!"):(this.unlockUpgrades[t]=1,this.funds=this.funds.minus(n),5===t?this.dividendTaxPercentage-=5:6===t&&(this.dividendTaxPercentage-=10))},Corporation.prototype.upgrade=function(e){for(var t=e[0],n=e[1],r=e[2],a=e[3];this.upgrades.length<=t;)this.upgrades.push(0);for(;this.upgradeMultipliers.length<=t;)this.upgradeMultipliers.push(1);var i=n*Math.pow(r,this.upgrades[t]);if(this.funds.lt(i))Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__.dialogBoxCreate)("You don't have enough funds to purchase this!");else if(++this.upgrades[t],this.funds=this.funds.minus(i),this.upgradeMultipliers[t]=1+this.upgrades[t]*a,1===t)for(var o=0;o<this.divisions.length;++o){var s=this.divisions[o];for(var l in s.warehouses)s.warehouses.hasOwnProperty(l)&&s.warehouses[l]instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse&&s.warehouses[l].updateSize(this,s)}},Corporation.prototype.getProductionMultiplier=function(){var e=this.upgradeMultipliers[0];return isNaN(e)||e<1?1:e},Corporation.prototype.getStorageMultiplier=function(){var e=this.upgradeMultipliers[1];return isNaN(e)||e<1?1:e},Corporation.prototype.getDreamSenseGain=function(){var e=this.upgradeMultipliers[2]-1;return e<=0?0:e},Corporation.prototype.getAdvertisingMultiplier=function(){var e=this.upgradeMultipliers[3];return isNaN(e)||e<1?1:e},Corporation.prototype.getEmployeeCreMultiplier=function(){var e=this.upgradeMultipliers[4];return isNaN(e)||e<1?1:e},Corporation.prototype.getEmployeeChaMultiplier=function(){var e=this.upgradeMultipliers[5];return isNaN(e)||e<1?1:e},Corporation.prototype.getEmployeeIntMultiplier=function(){var e=this.upgradeMultipliers[6];return isNaN(e)||e<1?1:e},Corporation.prototype.getEmployeeEffMultiplier=function(){var e=this.upgradeMultipliers[7];return isNaN(e)||e<1?1:e},Corporation.prototype.getSalesMultiplier=function(){var e=this.upgradeMultipliers[8];return isNaN(e)||e<1?1:e},Corporation.prototype.getScientificResearchMultiplier=function(){var e=this.upgradeMultipliers[9];return isNaN(e)||e<1?1:e},Corporation.prototype.getStarterGuide=function(){let e=_Player__WEBPACK_IMPORTED_MODULE_18__.Player.getHomeComputer(),t=!1,n=_Literature_data_LiteratureNames__WEBPACK_IMPORTED_MODULE_15__.LiteratureNames.CorporationManagementHandbook;for(let r=0;r<e.messages.length;++r)if(Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_31__.isString)(e.messages[r])&&e.messages[r]===n){t=!0;break}return t||e.messages.push(n),Object(_Literature_LiteratureHelpers__WEBPACK_IMPORTED_MODULE_14__.showLiterature)(n),!1},Corporation.prototype.createUI=function(){companyManagementDiv=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_26__.createElement)("div",{id:"cmpy-mgmt-container",position:"fixed",class:"generic-menupage-container"}),document.getElementById("entire-game-container").appendChild(companyManagementDiv),corpRouting=new _ui_Routing__WEBPACK_IMPORTED_MODULE_40__.CorporationRouting(this),eventHandler=new _ui_CorporationUIEventHandler__WEBPACK_IMPORTED_MODULE_38__.a(this,corpRouting),this.rerender()},Corporation.prototype.rerender=function(){null!=companyManagementDiv&&null!=corpRouting&&null!=eventHandler?_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_20__.routing.isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_20__.Page.Corporation)&&react_dom__WEBPACK_IMPORTED_MODULE_37___default.a.render(react__WEBPACK_IMPORTED_MODULE_36___default.a.createElement(_ui_Root__WEBPACK_IMPORTED_MODULE_39__.a,{corp:this,routing:corpRouting,eventHandler:eventHandler}),companyManagementDiv):console.warn("Corporation.rerender() called when companyManagementDiv, corpRouting, or eventHandler is null")},Corporation.prototype.clearUI=function(){companyManagementDiv instanceof HTMLElement&&(react_dom__WEBPACK_IMPORTED_MODULE_37___default.a.unmountComponentAtNode(companyManagementDiv),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_34__.removeElementById)(companyManagementDiv.id)),companyManagementDiv=null,document.getElementById("character-overview-wrapper").style.visibility="visible"},Corporation.prototype.toJSON=function(){return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Generic_toJSON)("Corporation",this)},Corporation.fromJSON=function(e){return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Generic_fromJSON)(Corporation,e.data)},_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_24__.Reviver.constructors.Corporation=Corporation}).call(this,__webpack_require__(86))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(29);t.MainMenuLinks={Terminal:null,ScriptEditor:null,ActiveScripts:null,CreateProgram:null,Stats:null,Factions:null,Augmentations:null,HacknetNodes:null,Sleeves:null,City:null,Travel:null,Job:null,StockMarket:null,Bladeburner:null,Corporation:null,Gang:null,Tutorial:null,Options:null,DevMenu:null},t.initializeMainMenuLinks=function(){try{function e(e){const t=r.clearEventListeners(e);if(null==t)throw new Error(`clearEventListeners() failed for element with id: ${e}`);return t}return t.MainMenuLinks.Terminal=e("terminal-menu-link"),t.MainMenuLinks.ScriptEditor=e("create-script-menu-link"),t.MainMenuLinks.ActiveScripts=e("active-scripts-menu-link"),t.MainMenuLinks.CreateProgram=e("create-program-menu-link"),t.MainMenuLinks.Stats=e("stats-menu-link"),t.MainMenuLinks.Factions=e("factions-menu-link"),t.MainMenuLinks.Augmentations=e("augmentations-menu-link"),t.MainMenuLinks.HacknetNodes=e("hacknet-nodes-menu-link"),t.MainMenuLinks.Sleeves=e("sleeves-menu-link"),t.MainMenuLinks.City=e("city-menu-link"),t.MainMenuLinks.Travel=e("travel-menu-link"),t.MainMenuLinks.Job=e("job-menu-link"),t.MainMenuLinks.StockMarket=e("stock-market-menu-link"),t.MainMenuLinks.Bladeburner=e("bladeburner-menu-link"),t.MainMenuLinks.Corporation=e("corporation-menu-link"),t.MainMenuLinks.Gang=e("gang-menu-link"),t.MainMenuLinks.Tutorial=e("tutorial-menu-link"),t.MainMenuLinks.Options=document.getElementById("options-menu-link"),t.MainMenuLinks.DevMenu=e("dev-menu-link"),!0}catch(e){return console.error(`Failed to initialize Main Menu Links: ${e}`),!1}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(680),a=n(679);t.Programs={};for(const e of a.programsMetadata)t.Programs[e.key]=new r.Program(e.name,e.create)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BladeburnerConstants={CityNames:["Aevum","Chongqing","Sector-12","New Tokyo","Ishima","Volhaven"],CyclesPerSecond:5,StaminaGainPerSecond:.0085,BaseStaminaLoss:.285,MaxStaminaToGainFactor:7e4,DifficultyToTimeFactor:10,DiffMultExponentialFactor:.28,DiffMultLinearFactor:650,EffAgiLinearFactor:1e4,EffDexLinearFactor:1e4,EffAgiExponentialFactor:.04,EffDexExponentialFactor:.035,BaseRecruitmentTimeNeeded:300,PopulationThreshold:1e9,PopulationExponent:.7,ChaosThreshold:50,BaseStatGain:1,BaseIntGain:.003,ActionCountGrowthPeriod:480,RankToFactionRepFactor:2,RankNeededForFaction:25,ContractSuccessesPerLevel:3,OperationSuccessesPerLevel:2.5,RanksPerSkillPoint:3,ContractBaseMoneyGain:25e4,HrcHpGain:2,HrcStaminaGain:1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6),a=n(19),i=n(273),o=n(168),s=n(16);t.HacknetServerHashesPerLevel=.001,t.BaseCostForHacknetServer=5e4,t.BaseCostFor1GBHacknetServerRam=2e5,t.BaseCostForHacknetServerCore=1e6,t.BaseCostForHacknetServerCache=1e7,t.HacknetServerPurchaseMult=3.2,t.HacknetServerUpgradeLevelMult=1.1,t.HacknetServerUpgradeRamMult=1.4,t.HacknetServerUpgradeCoreMult=1.55,t.HacknetServerUpgradeCacheMult=1.85,t.MaxNumberHacknetServers=20,t.HacknetServerMaxLevel=300,t.HacknetServerMaxRam=8192,t.HacknetServerMaxCores=128,t.HacknetServerMaxCache=15;class l extends i.BaseServer{constructor(e={hostname:"",ip:o.createRandomIp()}){super(e),this.cache=1,this.cores=1,this.hashCapacity=0,this.hashRate=0,this.level=1,this.onlineTimeSeconds=0,this.totalHashesGenerated=0,this.maxRam=1,this.updateHashCapacity()}static fromJSON(e){return s.Generic_fromJSON(l,e.data)}calculateCacheUpgradeCost(e){const n=Math.round(e);if(isNaN(n)||n<1)return 0;if(this.cache>=t.HacknetServerMaxCache)return 1/0;const r=t.HacknetServerUpgradeCacheMult;let a=0,i=this.cache;for(let e=0;e<n;++e)a+=Math.pow(r,i-1),++i;return a*=t.BaseCostForHacknetServerCache}calculateCoreUpgradeCost(e,n){const r=Math.round(e);if(isNaN(r)||r<1)return 0;if(this.cores>=t.HacknetServerMaxCores)return 1/0;const a=t.HacknetServerUpgradeCoreMult;let i=0,o=this.cores;for(let e=0;e<r;++e)i+=Math.pow(a,o-1),++o;return i*=t.BaseCostForHacknetServerCore,i*=n}calculateLevelUpgradeCost(e,n){const r=Math.round(e);if(isNaN(r)||r<1)return 0;if(this.level>=t.HacknetServerMaxLevel)return 1/0;const a=t.HacknetServerUpgradeLevelMult;let i=0,o=this.level;for(let e=0;e<r;++e)i+=Math.pow(a,o),++o;return 10*t.BaseCostForHacknetServer*i*n}calculateRamUpgradeCost(e,n){const r=Math.round(e);if(isNaN(r)||r<1)return 0;if(this.maxRam>=t.HacknetServerMaxRam)return 1/0;let a=0,i=Math.round(Math.log2(this.maxRam)),o=this.maxRam;for(let e=0;e<r;++e){a+=o*t.BaseCostFor1GBHacknetServerRam*Math.pow(t.HacknetServerUpgradeRamMult,i),o*=2,++i}return a*=n}process(e=1){const t=e*r.CONSTANTS.MilliPerCycle/1e3;return this.hashRate*t}upgradeCache(e){this.cache=Math.min(t.HacknetServerMaxCache,Math.round(this.cache+e)),this.updateHashCapacity()}upgradeCore(e,n){this.cores=Math.min(t.HacknetServerMaxCores,Math.round(this.cores+e)),this.updateHashRate(n)}upgradeLevel(e,n){this.level=Math.min(t.HacknetServerMaxLevel,Math.round(this.level+e)),this.updateHashRate(n)}upgradeRam(e,n){for(let t=0;t<e;++t)this.maxRam*=2;return this.maxRam=Math.min(t.HacknetServerMaxRam,Math.round(this.maxRam)),this.updateHashRate(n),!0}runScript(e,t){super.runScript(e),null!=t&&"number"==typeof t&&this.updateHashRate(t)}updateHashCapacity(){this.hashCapacity=32*Math.pow(2,this.cache)}updateHashRate(e){const n=t.HacknetServerHashesPerLevel*this.level*Math.pow(1.07,Math.log2(this.maxRam))*(1+(this.cores-1)/5)*(1-this.ramUsed/this.maxRam);this.hashRate=n*e*a.BitNodeMultipliers.HacknetNodeMoney,isNaN(this.hashRate)&&(this.hashRate=0,console.error("Error calculating Hacknet Server hash production. This is a bug. Please report to game dev",!1))}toJSON(){return s.Generic_toJSON("HacknetServer",this)}}t.HacknetServer=l,s.Reviver.constructors.HacknetServer=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FconfSettings={ENABLE_BASH_HOTKEYS:!1,ENABLE_TIMESTAMPS:!1,MAIN_MENU_STYLE:"default",THEME_BACKGROUND_COLOR:"#000000",THEME_FONT_COLOR:"#66ff33",THEME_HIGHLIGHT_COLOR:"#ffffff",THEME_PROMPT_COLOR:"#f92672",WRAP_INPUT:!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Aevum="Aevum",e.Chongqing="Chongqing",e.Ishima="Ishima",e.NewTokyo="New Tokyo",e.Sector12="Sector-12",e.Volhaven="Volhaven",e.AevumAeroCorp="AeroCorp",e.AevumBachmanAndAssociates="Bachman & Associates",e.AevumClarkeIncorporated="Clarke Incorporated",e.AevumCrushFitnessGym="Crush Fitness Gym",e.AevumECorp="ECorp",e.AevumFulcrumTechnologies="Fulcrum Technologies",e.AevumGalacticCybersystems="Galactic Cybersystems",e.AevumNetLinkTechnologies="NetLink Technologies",e.AevumPolice="Aevum Police Headquarters",e.AevumRhoConstruction="Rho Construction",e.AevumSnapFitnessGym="Snap Fitness Gym",e.AevumSummitUniversity="Summit University",e.AevumWatchdogSecurity="Watchdog Security",e.ChongqingKuaiGongInternational="KuaiGong International",e.ChongqingSolarisSpaceSystems="Solaris Space Systems",e.Sector12AlphaEnterprises="Alpha Enterprises",e.Sector12BladeIndustries="Blade Industries",e.Sector12CIA="Central Intelligence Agency",e.Sector12CarmichaelSecurity="Carmichael Security",e.Sector12CityHall="Sector-12 City Hall",e.Sector12DeltaOne="DeltaOne",e.Sector12FoodNStuff="FoodNStuff",e.Sector12FourSigma="Four Sigma",e.Sector12IcarusMicrosystems="Icarus Microsystems",e.Sector12IronGym="Iron Gym",e.Sector12JoesGuns="Joe's Guns",e.Sector12MegaCorp="MegaCorp",e.Sector12NSA="National Security Agency",e.Sector12PowerhouseGym="Powerhouse Gym",e.Sector12RothmanUniversity="Rothman University",e.Sector12UniversalEnergy="Universal Energy",e.NewTokyoDefComm="DefComm",e.NewTokyoGlobalPharmaceuticals="Global Pharmaceuticals",e.NewTokyoNoodleBar="Noodle Bar",e.NewTokyoVitaLife="VitaLife",e.IshimaNovaMedical="Nova Medical",e.IshimaOmegaSoftware="Omega Software",e.IshimaStormTechnologies="Storm Technologies",e.VolhavenCompuTek="CompuTek",e.VolhavenHeliosLabs="Helios Labs",e.VolhavenLexoCorp="LexoCorp",e.VolhavenMilleniumFitnessGym="Millenium Fitness Gym",e.VolhavenNWO="NWO",e.VolhavenOmniTekIncorporated="OmniTek Incorporated",e.VolhavenOmniaCybersystems="Omnia Cybersystems",e.VolhavenSysCoreSecurities="SysCore Securities",e.VolhavenZBInstituteOfTechnology="ZB Institute of Technology",e.Hospital="Hospital",e.Slums="The Slums",e.TravelAgency="Travel Agency",e.WorldStockExchange="World Stock Exchange",e.Void="The Void"}(t.LocationName||(t.LocationName={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3),a=n(115);t.createPopup=function(e,t,n={}){const i=r.createElement("div",{class:"popup-box-container",display:"flex",id:e}),o=r.createElement("div",{class:"popup-box-content",id:`${e}-content`});for(const e of t)o.appendChild(e);return n.backgroundColor&&(o.style.backgroundColor=n.backgroundColor),i.appendChild(o),a.getElementById("entire-game-container").appendChild(i),i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6);t.SourceFileFlags=Array(r.CONSTANTS.TotalNumBitNodes+1),t.updateSourceFileFlags=function(e){for(let e=0;e<t.SourceFileFlags.length;++e)t.SourceFileFlags[e]=0;for(let n=0;n<e.sourceFiles.length;++n){const r=e.sourceFiles[n];t.SourceFileFlags[r.n]=r.lvl}}},function(e,t,n){"use strict";n.d(t,"d",function(){return d}),n.d(t,"c",function(){return g}),n.d(t,"b",function(){return f}),n.d(t,"a",function(){return _});var r=n(12),a=n(0),i=n(17),o=n(31),s=n(100),l=n(49),c=n(29),u=n(3),m=n(37),p=n(27);const h=["Start","GoToCharacterPage","CharacterPage","CharacterGoToTerminalPage","TerminalIntro","TerminalHelp","TerminalLs","TerminalScan","TerminalScanAnalyze1","TerminalScanAnalyze2","TerminalConnect","TerminalAnalyze","TerminalNuke","TerminalManualHack","TerminalHackingMechanics","TerminalCreateScript","TerminalTypeScript","TerminalFree","TerminalRunScript","TerminalGoToActiveScriptsPage","ActiveScriptsPage","ActiveScriptsToTerminal","TerminalTailScript","GoToHacknetNodesPage","HacknetNodesIntroduction","HacknetNodesGoToWorldPage","WorldDescription","TutorialPageInfo","End"],d={};for(let e=0;e<h.length;++e)d[h[e]]=e;var _={currStep:0,isRunning:!1,stepIsDone:{}};function g(){_.stepIsDone={};for(let e=0;e<h.length;++e)_.stepIsDone[e]=!1;r.Engine.loadTerminalContent(),r.Engine.Counters.autoSaveCounter=1/0,_.currStep=0,_.isRunning=!0,document.getElementById("interactive-tutorial-container").style.display="block",Object(c.clearEventListeners)("interactive-tutorial-exit").addEventListener("click",function(){return b(),!1}),Object(c.clearEventListeners)("interactive-tutorial-back").addEventListener("click",function(){return function(){_.currStep>d.Start&&(_.currStep-=1);y()}(),!1}),Object(c.clearEventListeners)("interactive-tutorial-next").addEventListener("click",function(){return f(),!1}),y()}function y(){if(_.isRunning){var e=Object(c.clearEventListeners)("terminal-menu-link"),t=Object(c.clearEventListeners)("stats-menu-link"),n=Object(c.clearEventListeners)("active-scripts-menu-link"),a=Object(c.clearEventListeners)("hacknet-nodes-menu-link"),i=Object(c.clearEventListeners)("city-menu-link"),o=Object(c.clearEventListeners)("tutorial-menu-link");e.removeAttribute("class"),t.removeAttribute("class"),n.removeAttribute("class"),a.removeAttribute("class"),i.removeAttribute("class"),o.removeAttribute("class");var s=document.getElementById("interactive-tutorial-next");switch(_.currStep){case d.Start:r.Engine.loadTerminalContent(),E("Welcome to Bitburner, a cyberpunk-themed incremental RPG! The game takes place in a dark, dystopian future...The year is 2077...<br><br>This tutorial will show you the basics of the game. You may skip the tutorial at any time."),s.style.display="inline-block";break;case d.GoToCharacterPage:r.Engine.loadTerminalContent(),E("Let's start by heading to the Stats page. Click the 'Stats' tab on the main navigation menu (left-hand side of the screen)"),s.style.display="none",t.setAttribute("class","flashing-button"),t.addEventListener("click",function(){return r.Engine.loadCharacterContent(),f(),!1});break;case d.CharacterPage:r.Engine.loadCharacterContent(),E("The Stats page shows a lot of important information about your progress, such as your skills, money, and bonuses/multipliers. "),s.style.display="inline-block";break;case d.CharacterGoToTerminalPage:r.Engine.loadCharacterContent(),E("Let's head to your computer's terminal by clicking the 'Terminal' tab on the main navigation menu."),s.style.display="none",e.setAttribute("class","flashing-button"),e.addEventListener("click",function(){return r.Engine.loadTerminalContent(),f(),!1});break;case d.TerminalIntro:r.Engine.loadTerminalContent(),E("The Terminal is used to interface with your home computer as well as all of the other machines around the world."),s.style.display="inline-block";break;case d.TerminalHelp:r.Engine.loadTerminalContent(),E("Let's try it out. Start by entering the 'help' command into the Terminal (Don't forget to press Enter after typing the command)"),s.style.display="none";break;case d.TerminalLs:r.Engine.loadTerminalContent(),E("The 'help' command displays a list of all available Terminal commands, how to use them, and a description of what they do. <br><br>Let's try another command. Enter the 'ls' command"),s.style.display="none";break;case d.TerminalScan:r.Engine.loadTerminalContent(),E("'ls' is a basic command that shows all of the contents (programs/scripts) on the computer. Right now, it shows that you have a program called 'NUKE.exe' on your computer. We'll get to what this does later. <br><br>Using your home computer's terminal, you can connect to other machines throughout the world. Let's do that now by first entering the 'scan' command."),s.style.display="none";break;case d.TerminalScanAnalyze1:r.Engine.loadTerminalContent(),E("The 'scan' command shows all available network connections. In other words, it displays a list of all servers that can be connected to from your current machine. A server is identified by either its IP or its hostname. <br><br> That's great and all, but there's so many servers. Which one should you go to? The 'scan-analyze' command gives some more detailed information about servers on the network. Try it now"),s.style.display="none";break;case d.TerminalScanAnalyze2:r.Engine.loadTerminalContent(),E("You just ran 'scan-analyze' with a depth of one. This command shows more detailed information about each server that you can connect to (servers that are a distance of one node away). <br><br> It is also possible to run 'scan-analyze' with a higher depth. Let's try a depth of two with the following command: 'scan-analyze 2'."),s.style.display="none";break;case d.TerminalConnect:r.Engine.loadTerminalContent(),E("Now you can see information about all servers that are up to two nodes away, as well as figure out how to navigate to those servers through the network. You can only connect to a server that is one node away. To connect to a machine, use the 'connect [ip/hostname]' command. You can type in the ip or the hostname, but dont use both.<br><br>From the results of the 'scan-analyze' command, we can see that the 'foodnstuff' server is only one node away. Let's connect so it now using: 'connect foodnstuff'"),s.style.display="none";break;case d.TerminalAnalyze:r.Engine.loadTerminalContent(),E("You are now connected to another machine! What can you do now? You can hack it!<br><br> In the year 2077, currency has become digital and decentralized. People and corporations store their money on servers and computers. Using your hacking abilities, you can hack servers to steal money and gain experience. <br><br> Before you try to hack a server, you should run diagnostics using the 'analyze' command"),s.style.display="none";break;case d.TerminalNuke:r.Engine.loadTerminalContent(),E("When the 'analyze' command finishes running it will show useful information about hacking the server. <br><br> For this server, the required hacking skill is only 1, which means you can hack it right now. However, in order to hack a server you must first gain root access. The 'NUKE.exe' program that we saw earlier on your home computer is a virus that will grant you root access to a machine if there are enough open ports.<br><br> The 'analyze' results shows that there do not need to be any open ports on this machine for the NUKE virus to work, so go ahead and run the virus using the 'run NUKE.exe' command."),s.style.display="none";break;case d.TerminalManualHack:r.Engine.loadTerminalContent(),E("You now have root access! You can hack the server using the 'hack' command. Try doing that now."),s.style.display="none";break;case d.TerminalHackingMechanics:r.Engine.loadTerminalContent(),E("You are now attempting to hack the server. Note that performing a hack takes time and only has a certain percentage chance of success. This time and success chance is determined by a variety of factors, including your hacking skill and the server's security level.<br><br>If your attempt to hack the server is successful, you will steal a certain percentage of the server's total money. This percentage is affected by your hacking skill and the server's security level.<br><br>The amount of money on a server is not limitless. So, if you constantly hack a server and deplete its money, then you will encounter diminishing returns in your hacking."),s.style.display="inline-block";break;case d.TerminalCreateScript:r.Engine.loadTerminalContent(),E("Hacking is the core mechanic of the game and is necessary for progressing. However, you don't want to be hacking manually the entire time. You can automate your hacking by writing scripts!<br><br>To create a new script or edit an existing one, you can use the 'nano' command. Scripts must end with the '.script' extension. Let's make a script now by entering 'nano foodnstuff.script' after the hack command finishes running (Sidenote: Pressing ctrl + c will end a command like hack early)"),s.style.display="none";break;case d.TerminalTypeScript:r.Engine.loadScriptEditorContent("foodnstuff.script",""),E("This is the script editor. You can use it to program your scripts. Scripts are written in the Netscript language, a programming language created for this game. <strong style='background-color:#444;'>There are details about the Netscript language in the documentation, which can be accessed in the 'Tutorial' tab on the main navigation menu. I highly suggest you check it out after this tutorial.</strong> For now, just copy and paste the following code into the script editor: <br><br>while(true) { <br> hack('foodnstuff'); <br>}<br><br> For anyone with basic programming experience, this code should be straightforward. This script will continuously hack the 'foodnstuff' server.<br><br>To save and close the script editor, press the button in the bottom left, or press ctrl + b."),s.style.display="none";break;case d.TerminalFree:r.Engine.loadTerminalContent(),E("Now we'll run the script. Scripts require a certain amount of RAM to run, and can be run on any machine which you have root access to. Different servers have different amounts of RAM. You can also purchase more RAM for your home server.<br><br>To check how much RAM is available on this machine, enter the 'free' command."),s.style.display="none";break;case d.TerminalRunScript:r.Engine.loadTerminalContent(),E("We have 16GB of free RAM on this machine, which is enough to run our script. Let's run our script using 'run foodnstuff.script'."),s.style.display="none";break;case d.TerminalGoToActiveScriptsPage:r.Engine.loadTerminalContent(),E("Your script is now running! The script might take a few seconds to 'fully start up'. Your scripts will continuously run in the background and will automatically stop if the code ever completes (the 'foodnstuff.script' will never complete because it runs an infinite loop). <br><br>These scripts can passively earn you income and hacking experience. Your scripts will also earn money and experience while you are offline, although at a much slower rate. <br><br> Let's check out some statistics for our running scripts by clicking the 'Active Scripts' link in the main navigation menu."),s.style.display="none",n.setAttribute("class","flashing-button"),n.addEventListener("click",function(){return r.Engine.loadActiveScriptsContent(),f(),!1});break;case d.ActiveScriptsPage:r.Engine.loadActiveScriptsContent(),E("This page displays stats/information about all of your scripts that are running across every existing server. You can use this to gauge how well your scripts are doing. Let's go back to the Terminal now using the 'Terminal' link."),s.style.display="none",e.setAttribute("class","flashing-button"),e.addEventListener("click",function(){return r.Engine.loadTerminalContent(),f(),!1});break;case d.ActiveScriptsToTerminal:r.Engine.loadTerminalContent(),E("One last thing about scripts, each active script contains logs that detail what it's doing. We can check these logs using the 'tail' command. Do that now for the script we just ran by typing 'tail foodnstuff.script'"),s.style.display="none";break;case d.TerminalTailScript:r.Engine.loadTerminalContent(),E("The log for this script won't show much right now (it might show nothing at all) because it just started running...but check back again in a few minutes! <br><br>This pretty much covers the basics of hacking. To learn more about writing scripts using the Netscript language, select the 'Tutorial' link in the main navigation menu to look at the documentation. <strong style='background-color:#444;'>If you are an experienced JavaScript developer, I would highly suggest you check out the section on NetscriptJS/Netscript 2.0.</strong><br><br>For now, let's move on to something else!"),s.style.display="inline-block";break;case d.GoToHacknetNodesPage:r.Engine.loadTerminalContent(),E("Hacking is not the only way to earn money. One other way to passively earn money is by purchasing and upgrading Hacknet Nodes. Let's go to the 'Hacknet Nodes' page through the main navigation menu now."),s.style.display="none",a.setAttribute("class","flashing-button"),a.addEventListener("click",function(){return r.Engine.loadHacknetNodesContent(),f(),!1});break;case d.HacknetNodesIntroduction:r.Engine.loadHacknetNodesContent(),E("From this page you can purchase new Hacknet Nodes and upgrade your existing ones. Let's purchase a new one now."),s.style.display="none";break;case d.HacknetNodesGoToWorldPage:r.Engine.loadHacknetNodesContent(),E("You just purchased a Hacknet Node! This Hacknet Node will passively earn you money over time, both online and offline. When you get enough money, you can upgrade your newly-purchased Hacknet Node below.<br><br>Let's go to the 'City' page through the main navigation menu."),s.style.display="none",i.setAttribute("class","flashing-button"),i.addEventListener("click",function(){return r.Engine.loadLocationContent(),f(),!1});break;case d.WorldDescription:r.Engine.loadLocationContent(),E("This page lists all of the different locations you can currently travel to. Each location has something that you can do. There's a lot of content out in the world, make sure you explore and discover!<br><br>Lastly, click on the 'Tutorial' link in the main navigation menu."),s.style.display="none",o.setAttribute("class","flashing-button"),o.addEventListener("click",function(){return r.Engine.loadTutorialContent(),f(),!1});break;case d.TutorialPageInfo:r.Engine.loadTutorialContent(),E("This page contains a lot of different documentation about the game's content and mechanics. <strong style='background-color:#444;'> I know it's a lot, but I highly suggest you read (or at least skim) through this before you start playing</strong>. That's the end of the tutorial. Hope you enjoy the game!"),s.style.display="inline-block",s.innerHTML="Finish Tutorial";break;case d.End:b();break;default:throw new Error("Invalid tutorial step")}!0===_.stepIsDone[_.currStep]&&(s.style.display="inline-block")}}function f(){_.currStep===d.GoToCharacterPage&&document.getElementById("stats-menu-link").removeAttribute("class"),_.currStep===d.CharacterGoToTerminalPage&&document.getElementById("terminal-menu-link").removeAttribute("class"),_.currStep===d.TerminalGoToActiveScriptsPage&&document.getElementById("active-scripts-menu-link").removeAttribute("class"),_.currStep===d.ActiveScriptsPage&&document.getElementById("terminal-menu-link").removeAttribute("class"),_.currStep===d.GoToHacknetNodesPage&&document.getElementById("hacknet-nodes-menu-link").removeAttribute("class"),_.currStep===d.HacknetNodesGoToWorldPage&&document.getElementById("city-menu-link").removeAttribute("class"),_.currStep===d.WorldDescription&&document.getElementById("tutorial-menu-link").removeAttribute("class"),_.stepIsDone[_.currStep]=!0,_.currStep<d.End&&(_.currStep+=1),y()}function b(){if(0===i.Settings.AutosaveInterval?r.Engine.Counters.autoSaveCounter=1/0:r.Engine.Counters.autoSaveCounter=5*i.Settings.AutosaveInterval,!Object(o.initializeMainMenuLinks)()){const e="Failed to initialize Main Menu Links. Please try refreshing the page. If that doesn't work, report the issue to the developer";return Object(l.exceptionAlert)(new Error(e)),void console.error(e)}r.Engine.init(),_.currStep=d.End,_.isRunning=!1,document.getElementById("interactive-tutorial-container").style.display="none";var e="interactive-tutorial-ending-popup",t=Object(u.createElement)("p",{innerHTML:"If you are new to the game, the following links may be useful for you!<br><br><a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/guidesandtips/gettingstartedguideforbeginnerprogrammers.html' target='_blank'>Getting Started Guide</a><a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/' target='_blank'>Documentation</a><br><br>The Beginner's Guide to Hacking was added to your home computer! It contains some tips/pointers for starting out with the game. To read it, go to Terminal and enter<br><br>cat "+s.LiteratureNames.HackersStartingHandbook}),n=Object(u.createElement)("a",{class:"a-link-button",float:"right",padding:"6px",innerText:"Got it!",clickListener:()=>{Object(p.removeElementById)(e)}});Object(m.createPopup)(e,[t,n]),a.Player.getHomeComputer().messages.push(s.LiteratureNames.HackersStartingHandbook)}function E(e){var t=document.getElementById("interactive-tutorial-text");if(null==t)throw new Error("Could not find text box");t.innerHTML=e,t.parentElement.scrollTop=0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(16);t.SpecialServerNames={FulcrumSecretTechnologies:"Fulcrum Secret Technologies Server",CyberSecServer:"CyberSec Server",NiteSecServer:"NiteSec Server",TheBlackHandServer:"The Black Hand Server",BitRunnersServer:"BitRunners Server",TheDarkArmyServer:"The Dark Army Server",DaedalusServer:"Daedalus Server",WorldDaemon:"w0r1d_d43m0n"};class a{static fromJSON(e){return r.Generic_fromJSON(a,e.data)}constructor(){}addIp(e,t){this[e]=t}getIp(e){return this[e]}toJSON(){return r.Generic_toJSON("SpecialServerIpsMap",this)}}t.SpecialServerIpsMap=a,r.Reviver.constructors.SpecialServerIpsMap=a,t.SpecialServerIps=new a,t.prestigeSpecialServerIps=function(){for(var e in t.SpecialServerIps)delete t.SpecialServerIps[e];t.SpecialServerIps=new a},t.loadSpecialServerIps=function(e){t.SpecialServerIps=JSON.parse(e,r.Reviver)},t.initSpecialServerIps=function(){t.SpecialServerIps=new a}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(122),a=n(447),i=n(446),o=n(117),s=n(445),l=n(444),c=n(87),u=n(76),m=n(153),p=n(443),h=n(6),d=n(121),_=n(0),g=n(209),y=n(11),f=n(2),b=n(8),E=n(16),v=n(1),k=n(46);function C(e,n,r,s,l,c=null){const u=c instanceof d.WorkerScript;if(!(e instanceof o.Stock))return u?c.log("placeOrder",`Invalid stock: '${e}'`):b.dialogBoxCreate("ERROR: Invalid stock passed to placeOrder() function"),!1;if("number"!=typeof n||"number"!=typeof r)return u?c.log("placeOrder",`Invalid arguments: shares='${n}' price='${r}'`):b.dialogBoxCreate("ERROR: Invalid numeric value provided for either 'shares' or 'price' argument"),!1;const m=new a.Order(e.symbol,n,r,s,l);if(null==t.StockMarket.Orders){const e={};for(const n in t.StockMarket){const r=t.StockMarket[n];r instanceof o.Stock&&(e[r.symbol]=[])}t.StockMarket.Orders=e}t.StockMarket.Orders[e.symbol].push(m);const p={rerenderFn:N,stockMarket:t.StockMarket,symbolToStockMap:t.SymbolToStockMap};return i.processOrders(e,m.type,m.pos,p),N(),!0}function T(e,n=null){var r=n instanceof d.WorkerScript;if(null==t.StockMarket.Orders)return!1;if(e.order&&e.order instanceof a.Order){const n=e.order;for(var i=t.StockMarket.Orders[n.stockSymbol],s=0;s<i.length;++s)if(n==i[s])return i.splice(s,1),N(),!0;return!1}if(e.stock&&e.shares&&e.price&&e.type&&e.pos&&e.stock instanceof o.Stock){i=t.StockMarket.Orders[e.stock.symbol];var l=e.stock.symbol+" - "+e.shares+" @ "+f.numeralWrapper.formatMoney(e.price);for(s=0;s<i.length;++s){var c=i[s];if(e.shares===c.shares&&e.price===c.price&&e.type===c.type&&e.pos===c.pos)return i.splice(s,1),N(),r&&n.scriptRef.log("Successfully cancelled order: "+l),!0}return r&&n.scriptRef.log("Failed to cancel order: "+l),!1}return!1}function P(){for(const e in t.StockMarket)t.StockMarket.hasOwnProperty(e)&&delete t.StockMarket[e];for(const e of l.InitStockMetadata){const n=e.name;t.StockMarket[n]=new o.Stock(e)}const e={};for(const n in t.StockMarket){const r=t.StockMarket[n];r instanceof o.Stock&&(e[r.symbol]=[])}t.StockMarket.Orders=e,t.StockMarket.storedCycles=0,t.StockMarket.lastUpdate=0,t.StockMarket.ticksUntilCycle=s.TicksPerCycle}function S(){for(const e in m.StockSymbols)if(m.StockSymbols.hasOwnProperty(e)){const n=t.StockMarket[e];if(null==n){console.error(`Could not find Stock for ${e}`);continue}const r=m.StockSymbols[e];t.SymbolToStockMap[r]=n}}function O(){for(const e in t.StockMarket){const n=t.StockMarket[e];n instanceof o.Stock&&(Math.random()<.45&&(n.b=!n.b,n.flipForecastForecast()),t.StockMarket.ticksUntilCycle=s.TicksPerCycle)}}t.StockMarket={},t.SymbolToStockMap={},t.placeOrder=C,t.cancelOrder=T,t.loadStockMarket=function(e){t.StockMarket=""===e?{}:JSON.parse(e,E.Reviver)},t.deleteStockMarket=function(){t.StockMarket={}},t.initStockMarket=P,t.initSymbolToStockMap=S,t.stockMarketCycle=O;const M=6e3/h.CONSTANTS.MilliPerCycle;t.processStockPrices=function(e=1){if((null==t.StockMarket.storedCycles||isNaN(t.StockMarket.storedCycles))&&(t.StockMarket.storedCycles=0),t.StockMarket.storedCycles+=e,t.StockMarket.storedCycles<M)return;const n=(new Date).getTime();if(!(n-t.StockMarket.lastUpdate<4e3)){t.StockMarket.lastUpdate=n,t.StockMarket.storedCycles-=M,null!=t.StockMarket.ticksUntilCycle&&"number"==typeof t.StockMarket.ticksUntilCycle||(t.StockMarket.ticksUntilCycle=s.TicksPerCycle),--t.StockMarket.ticksUntilCycle,t.StockMarket.ticksUntilCycle<=0&&O();var r=Math.random();for(const e in t.StockMarket){const n=t.StockMarket[e];if(!(n instanceof o.Stock))continue;let a=r*n.mv/100;isNaN(a)&&(a=.02);let s=50;s=n.b?(s+n.otlkMag)/100:(s-n.otlkMag)/100,n.price>=n.cap&&(s=.1,n.b=!1),isNaN(s)&&(s=.5);const l=Math.random(),m={rerenderFn:N,stockMarket:t.StockMarket,symbolToStockMap:t.SymbolToStockMap};l<s?(n.changePrice(n.price*(1+a)),i.processOrders(n,c.OrderTypes.LimitBuy,u.PositionTypes.Short,m),i.processOrders(n,c.OrderTypes.LimitSell,u.PositionTypes.Long,m),i.processOrders(n,c.OrderTypes.StopBuy,u.PositionTypes.Long,m),i.processOrders(n,c.OrderTypes.StopSell,u.PositionTypes.Short,m)):(n.changePrice(n.price/(1+a)),i.processOrders(n,c.OrderTypes.LimitBuy,u.PositionTypes.Long,m),i.processOrders(n,c.OrderTypes.LimitSell,u.PositionTypes.Short,m),i.processOrders(n,c.OrderTypes.StopBuy,u.PositionTypes.Short,m),i.processOrders(n,c.OrderTypes.StopSell,u.PositionTypes.Long,m));let p=n.otlkMag*a;n.otlkMag<5&&(n.otlkMag<=1?p=1:p*=10),n.cycleForecast(p),n.cycleForecastForecast(p/2),n.shareTxUntilMovement=Math.min(n.shareTxUntilMovement+10,n.shareTxForMovement)}N()}};let x=null;function w(){P(),S()}document.addEventListener("DOMContentLoaded",function e(){x=document.getElementById("stock-market-container"),document.removeEventListener("DOMContentLoaded",e)});const A=new g.EventEmitter;function N(){if(y.routing.isOn(y.Page.StockMarket)&&(A.emitEvent(),x instanceof HTMLElement)){const e=t.StockMarket;k.render(v.createElement(p.StockMarketRoot,{buyStockLong:r.buyStock,buyStockShort:r.shortStock,cancelOrder:T,eventEmitterForReset:A,initStockMarket:w,p:_.Player,placeOrder:C,sellStockLong:r.sellStock,sellStockShort:r.sellShort,stockMarket:e}),x)}}t.displayStockMarketContent=N},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(48),a=n(115);t.removeChildrenFromElement=function(e){if(null!==e)try{const t=r.isString(e)?a.getElementById(e):e;if(t instanceof Element)for(;null!==t.firstChild;)t.removeChild(t.firstChild)}catch(e){return void console.debug(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(29),a=n(24);t.yesNoBoxOpen=!1;const i=document.getElementById("yes-no-box-container"),o=document.getElementById("yes-no-box-text");function s(e){if(e.keyCode===a.KEY.ESC)l();else if(e.keyCode===a.KEY.ENTER){const e=document.getElementById("yes-no-box-yes");e?e.click():console.error("Could not find YesNoBox Yes button DOM element")}}function l(){return i?i.style.display="none":console.error("Container not found for YesNoBox"),t.yesNoBoxOpen=!1,document.removeEventListener("keydown",s),!1}t.yesNoBoxClose=l,t.yesNoBoxGetYesButton=function(){return r.clearEventListeners("yes-no-box-yes")},t.yesNoBoxGetNoButton=function(){return r.clearEventListeners("yes-no-box-no")},t.yesNoBoxCreate=function(e){return!t.yesNoBoxOpen&&(t.yesNoBoxOpen=!0,o?o.innerHTML=e:console.error("Text element not found for YesNoBox"),i?i.style.display="flex":console.error("Container not found for YesNoBox"),document.addEventListener("keydown",s),!0)};const c=document.getElementById("yes-no-text-input-box-container"),u=document.getElementById("yes-no-text-input-box-input"),m=document.getElementById("yes-no-text-input-box-text");function p(e){if(e.keyCode===a.KEY.ESC)h();else if(e.keyCode===a.KEY.ENTER){const e=document.getElementById("yes-no-text-input-box-yes");e?e.click():console.error("Could not find YesNoTxtInputBox Yes button DOM element")}}function h(){return null==c?(console.error("Container not found for YesNoTextInputBox"),!1):(c.style.display="none",t.yesNoBoxOpen=!1,u.value="",document.removeEventListener("keydown",p),!1)}t.yesNoTxtInpBoxHotkeyHandler=p,t.yesNoTxtInpBoxClose=h,t.yesNoTxtInpBoxGetYesButton=function(){return r.clearEventListeners("yes-no-text-input-box-yes")},t.yesNoTxtInpBoxGetNoButton=function(){return r.clearEventListeners("yes-no-text-input-box-no")},t.yesNoTxtInpBoxGetInput=function(){if(null==u)return console.error("Could not find YesNoTextInputBox input element"),"";let e=u.value;return e=e.replace(/\s+/g,"")},t.yesNoTxtInpBoxCreate=function(e){t.yesNoBoxOpen=!0,m&&(m.innerHTML=e),c?c.style.display="flex":console.error("Container not found for YesNoTextInputBox"),document.addEventListener("keydown",p),u.focus()}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(683),a=n(140);t.CompanyPositions={},r.companyPositionMetadata.forEach(e=>{!function(e){null!=t.CompanyPositions[e.name]&&console.warn(`Duplicate Company Position being defined: ${e.name}`),t.CompanyPositions[e.name]=new a.CompanyPosition(e)}(e)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isString=function(e){return"string"==typeof e||e instanceof String}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8);t.exceptionAlert=function(e){console.error(e),r.dialogBoxCreate("Caught an exception: "+e+"<br><br>Filename: "+(e.fileName||"UNKNOWN FILE NAME")+"<br><br>Line Number: "+(e.lineNumber||"UNKNOWN LINE NUMBER")+"<br><br>This is a bug, please report to game developer with this message as well as details about how to reproduce the bug.<br><br>If you want to be safe, I suggest refreshing the game WITHOUT saving so that your safe doesn't get corrupted",!1)}},function(e,t,n){"use strict";n.r(t),n.d(t,"inviteToFaction",function(){return P}),n.d(t,"joinFaction",function(){return S}),n.d(t,"startHackingMission",function(){return O}),n.d(t,"displayFactionContent",function(){return M}),n.d(t,"purchaseAugmentationBoxCreate",function(){return x}),n.d(t,"hasAugmentationPrereqs",function(){return w}),n.d(t,"purchaseAugmentation",function(){return A}),n.d(t,"getNextNeurofluxLevel",function(){return N}),n.d(t,"processPassiveFactionRepGain",function(){return R});var r=n(1),a=n.n(r),i=n(46),o=n.n(i),s=n(303),l=n(10),c=n(71),u=n(132),m=n(4),p=n(19),h=n(6),d=n(12),_=n(74),g=n(13),y=n(69),f=n(0),b=n(17),E=n(11),v=n(8),k=n(302),C=(n(16),n(7)),T=n(45);function P(e){b.Settings.SuppressFactionInvites?(e.alreadyInvited=!0,f.Player.factionInvitations.push(e.name),E.routing.isOn(E.Page.Factions)&&d.Engine.loadFactionsContent()):Object(k.a)(e)}function S(e){e.isMember=!0,f.Player.factions.push(e.name);const t=e.getInfo();for(const e in t.enemies){const n=t.enemies[e];g.Factions[n]instanceof _.Faction&&(g.Factions[n].isBanned=!0)}}function O(e){const t=new y.a(e.playerReputation,e);Object(y.d)(!0,t),t.init()}function M(e,t=!1){const n=g.Factions[e];if(null==n)throw new Error(`Invalid factionName passed into displayFactionContent(): ${e}`);if(!n.isMember)throw new Error("Not a member of this faction. Cannot display faction information");o.a.render(a.a.createElement(s.FactionRoot,{engine:d.Engine,initiallyOnAugmentationsPage:t,faction:n,p:f.Player,startHackingMissionFn:O}),d.Engine.Display.factionContent)}function x(e,t){const n=t.getInfo(),r=Object(T.yesNoBoxGetYesButton)();r.innerHTML="Purchase",r.addEventListener("click",function(){!Object(c.f)(e)&&f.Player.hasAugmentation(e)||(A(e,t),Object(T.yesNoBoxClose)())});const a=Object(T.yesNoBoxGetNoButton)();a.innerHTML="Cancel",a.addEventListener("click",function(){Object(T.yesNoBoxClose)()}),Object(T.yesNoBoxCreate)("<h2>"+e.name+"</h2><br>"+e.info+"<br><br><br>Would you like to purchase the "+e.name+" Augmentation for $"+Object(C.formatNumber)(e.baseCost*n.augmentationPriceMult,2)+"?")}function w(e){let t=!0;if(e.prereqs&&e.prereqs.length>0)for(let n=0;n<e.prereqs.length;++n){const r=l.Augmentations[e.prereqs[n]];if(null!=r){if(!1===r.owned){t=!1;for(let e=0;e<f.Player.queuedAugmentations.length;++e)if(f.Player.queuedAugmentations[e].name===r.name){t=!0;break}}}else console.error(`Invalid prereq Augmentation ${e.prereqs[n]}`)}return t}function A(e,t,n=!1){const r=t.getInfo();if(w(e))if(0!==e.baseCost&&f.Player.money.lt(e.baseCost*r.augmentationPriceMult)){let t="You don't have enough money to purchase "+e.name;if(n)return t;Object(v.dialogBoxCreate)(t)}else if(t.playerReputation<e.baseRepRequirement){let t="You don't have enough faction reputation to purchase "+e.name;if(n)return t;Object(v.dialogBoxCreate)(t)}else if(0===e.baseCost||f.Player.money.gte(e.baseCost*r.augmentationPriceMult)){!1===f.Player.firstAugPurchased&&(f.Player.firstAugPurchased=!0,document.getElementById("augmentations-tab").style.display="list-item",document.getElementById("character-menu-header").click(),document.getElementById("character-menu-header").click());var a=new u.PlayerOwnedAugmentation(e.name);if(e.name==m.AugmentationNames.NeuroFluxGovernor&&(a.level=N()),f.Player.queuedAugmentations.push(a),f.Player.loseMoney(e.baseCost*r.augmentationPriceMult),e.name==m.AugmentationNames.NeuroFluxGovernor){var i=N();--i;var o=Math.pow(h.CONSTANTS.NeuroFluxGovernorLevelMult,i);e.baseRepRequirement=500*o*h.CONSTANTS.AugmentationRepMultiplier*p.BitNodeMultipliers.AugmentationRepCost,e.baseCost=75e4*o*h.CONSTANTS.AugmentationCostMultiplier*p.BitNodeMultipliers.AugmentationMoneyCost;for(var s=0;s<f.Player.queuedAugmentations.length-1;++s)e.baseCost*=h.CONSTANTS.MultipleAugMultiplier}for(var c in l.Augmentations)l.Augmentations.hasOwnProperty(c)&&(l.Augmentations[c].baseCost*=h.CONSTANTS.MultipleAugMultiplier);if(n)return"You purchased "+e.name;b.Settings.SuppressBuyAugmentationConfirmation||Object(v.dialogBoxCreate)("You purchased "+e.name+". It's enhancements will not take effect until they are installed. To install your augmentations, go to the 'Augmentations' tab on the left-hand navigation menu. Purchasing additional augmentations will now be more expensive."),M(t.name,!0)}else Object(v.dialogBoxCreate)("Hmm, something went wrong when trying to purchase an Augmentation. Please report this to the game developer with an explanation of how to reproduce this.");else{var d="You must first purchase or install "+e.prereqs.join(",")+" before you can purchase this one.";if(n)return d;Object(v.dialogBoxCreate)(d)}}function N(){let e=0;for(var t=0;t<f.Player.augmentations.length;++t)f.Player.augmentations[t].name===m.AugmentationNames.NeuroFluxGovernor&&(e=f.Player.augmentations[t].level);for(t=0;t<f.Player.queuedAugmentations.length;++t)f.Player.queuedAugmentations[t].name==m.AugmentationNames.NeuroFluxGovernor&&++e;return e+1}function R(e){var t=e/600*f.Player.faction_rep_mult;for(var n in g.Factions)if(g.Factions.hasOwnProperty(n)){var r=g.Factions[n];r.isMember&&(r.playerReputation+=t*p.BitNodeMultipliers.FactionPassiveRepGain)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Ace="ace",e.Emacs="emacs",e.Vim="vim"}(t.AceKeybindingSetting||(t.AceKeybindingSetting={})),function(e){e.Default="default",e.Emacs="emacs",e.Sublime="sublime",e.Vim="vim"}(t.CodeMirrorKeybindingSetting||(t.CodeMirrorKeybindingSetting={})),function(e){e.Monokai="monokai",e.Day_3024="3024-day",e.Night_3024="3024-night",e.abcdef="abcdef",e.Ambiance_mobile="ambiance-mobile",e.Ambiance="ambiance",e.Base16_dark="base16-dark",e.Base16_light="base16-light",e.Bespin="bespin",e.Blackboard="blackboard",e.Cobalt="cobalt",e.Colorforth="colorforth",e.Darcula="darcula",e.Dracula="dracula",e.Duotone_dark="duotone-dark",e.Duotone_light="duotone-light",e.Eclipse="eclipse",e.Elegant="elegant",e.Erlang_dark="erlang-dark",e.Gruvbox_dark="gruvbox-dark",e.Hopscotch="hopscotch",e.Icecoder="icecoder",e.Idea="idea",e.Isotope="isotope",e.Lesser_dark="lesser-dark",e.Liquibyte="liquibyte",e.Lucario="lucario",e.Material="material",e.Mbo="mbo",e.Mdn_like="mdn-like",e.Midnight="midnight",e.Neat="neat",e.Neo="neo",e.Night="night",e.Oceanic_next="oceanic-next",e.Panda_syntax="panda-syntax",e.Paraiso_dark="paraiso-dark",e.Paraiso_light="paraiso-light",e.Pastel_on_dark="pastel-on-dark",e.Railscasts="railscasts",e.Rubyblue="rubyblue",e.Seti="seti",e.Shadowfox="shadowfox",e.Solarized="solarized",e.SolarizedDark="solarized dark",e.ssms="ssms",e.The_matrix="the-matrix",e.Tomorrow_night_bright="tomorrow-night-bright",e.Tomorrow_night_eighties="tomorrow-night-eighties",e.Ttcn="ttcn",e.Twilight="twilight",e.Vibrant_ink="vibrant-ink",e.xq_dark="xq-dark",e.xq_light="xq-light",e.Yeti="yeti",e.Zenburn="zenburn"}(t.CodeMirrorThemeSetting||(t.CodeMirrorThemeSetting={})),function(e){e.Ace="Ace",e.CodeMirror="CodeMirror"}(t.EditorSetting||(t.EditorSetting={})),function(e){e[e.Cost=0]="Cost",e[e.Default=1]="Default",e[e.Reputation=2]="Reputation"}(t.PurchaseAugmentationsOrderSetting||(t.PurchaseAugmentationsOrderSetting={})),function(e){e[e.Alphabetically=0]="Alphabetically",e[e.AcquirementTime=1]="AcquirementTime"}(t.OwnedAugmentationsOrderSetting||(t.OwnedAugmentationsOrderSetting={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6),a=n(19),i=n(8),o=n(16);t.HacknetNodeMoneyGainPerLevel=1.6,t.BaseCostForHacknetNode=1e3,t.BaseCostFor1GBOfRamHacknetNode=3e4,t.BaseCostForHacknetNodeCore=5e5,t.HacknetNodePurchaseNextMult=1.85,t.HacknetNodeUpgradeLevelMult=1.04,t.HacknetNodeUpgradeRamMult=1.28,t.HacknetNodeUpgradeCoreMult=1.48,t.HacknetNodeMaxLevel=200,t.HacknetNodeMaxRam=64,t.HacknetNodeMaxCores=16;class s{constructor(e="",t=1){this.cores=1,this.level=1,this.moneyGainRatePerSecond=0,this.onlineTimeSeconds=0,this.ram=1,this.totalMoneyGenerated=0,this.name=e,this.updateMoneyGainRate(t)}static fromJSON(e){return o.Generic_fromJSON(s,e.data)}calculateCoreUpgradeCost(e=1,n){const r=Math.round(e);if(isNaN(r)||r<1)return 0;if(this.cores>=t.HacknetNodeMaxCores)return 1/0;const a=t.BaseCostForHacknetNodeCore,i=t.HacknetNodeUpgradeCoreMult;let o=0,s=this.cores;for(let e=0;e<r;++e)o+=a*Math.pow(i,s-1),++s;return o*=n}calculateLevelUpgradeCost(e=1,n){const r=Math.round(e);if(isNaN(r)||r<1)return 0;if(this.level>=t.HacknetNodeMaxLevel)return 1/0;const a=t.HacknetNodeUpgradeLevelMult;let i=0,o=this.level;for(let e=0;e<r;++e)i+=Math.pow(a,o),++o;return t.BaseCostForHacknetNode/2*i*n}calculateRamUpgradeCost(e=1,n){const r=Math.round(e);if(isNaN(r)||r<1)return 0;if(this.ram>=t.HacknetNodeMaxRam)return 1/0;let a=0,i=Math.round(Math.log2(this.ram)),o=this.ram;for(let e=0;e<r;++e){a+=o*t.BaseCostFor1GBOfRamHacknetNode*Math.pow(t.HacknetNodeUpgradeRamMult,i),o*=2,++i}return a*=n}process(e=1){const t=e*r.CONSTANTS.MilliPerCycle/1e3;let n=this.moneyGainRatePerSecond*t;return isNaN(n)&&(console.error(`Hacknet Node ${this.name} calculated earnings of NaN`),n=0),this.totalMoneyGenerated+=n,this.onlineTimeSeconds+=t,n}upgradeCore(e=1,n){this.cores=Math.min(t.HacknetNodeMaxCores,Math.round(this.cores+e)),this.updateMoneyGainRate(n)}upgradeLevel(e=1,n){this.level=Math.min(t.HacknetNodeMaxLevel,Math.round(this.level+e)),this.updateMoneyGainRate(n)}upgradeRam(e=1,t){for(let t=0;t<e;++t)this.ram*=2;this.ram=Math.round(this.ram),this.updateMoneyGainRate(t)}updateMoneyGainRate(e){var n=t.HacknetNodeMoneyGainPerLevel;this.moneyGainRatePerSecond=this.level*n*Math.pow(1.035,this.ram-1)*((this.cores+5)/6)*e*a.BitNodeMultipliers.HacknetNodeMoney,isNaN(this.moneyGainRatePerSecond)&&(this.moneyGainRatePerSecond=0,i.dialogBoxCreate("Error in calculating Hacknet Node production. Please report to game developer",!1))}toJSON(){return o.Generic_toJSON("HacknetNode",this)}}t.HacknetNode=s,o.Reviver.constructors.HacknetNode=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SoftwareCompanyPositions=["Software Engineering Intern","Junior Software Engineer","Senior Software Engineer","Lead Software Developer","Head of Software","Head of Engineering","Vice President of Technology","Chief Technology Officer"],t.ITCompanyPositions=["IT Intern","IT Analyst","IT Manager","Systems Administrator"],t.SecurityEngineerCompanyPositions=["Security Engineer"],t.NetworkEngineerCompanyPositions=["Network Engineer","Network Administrator"],t.BusinessCompanyPositions=["Business Intern","Business Analyst","Business Manager","Operations Manager","Chief Financial Officer","Chief Executive Officer"],t.SecurityCompanyPositions=["Police Officer","Police Chief","Security Guard","Security Officer","Security Supervisor","Head of Security"],t.AgentCompanyPositions=["Field Agent","Secret Agent","Special Operative"],t.MiscCompanyPositions=["Waiter","Employee"],t.SoftwareConsultantCompanyPositions=["Software Consultant","Senior Software Consultant"],t.BusinessConsultantCompanyPositions=["Business Consultant","Senior Business Consultant"],t.PartTimeCompanyPositions=["Part-time Waiter","Part-time Employee"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(19),a=n(0);function i(e,t){const n=e.requiredHackingSkill*e.hackDifficulty;null==t&&(t=a.Player.hacking_skill);let r=2.5*n+500;return 5*(r/=t+50)/(a.Player.hacking_speed_mult*a.Player.getIntelligenceBonus(1))}t.calculateHackingChance=function(e){const t=(100-e.hackDifficulty)/100,n=1.75*a.Player.hacking_skill,r=(n-e.requiredHackingSkill)/n*t*a.Player.hacking_chance_mult*a.Player.getIntelligenceBonus(1);return r>1?1:r<0?0:r},t.calculateHackingExpGain=function(e){null==e.baseDifficulty&&(e.baseDifficulty=e.hackDifficulty);let t=3;return(t+=e.baseDifficulty*a.Player.hacking_exp_mult*.3)*r.BitNodeMultipliers.HackExpGain},t.calculatePercentMoneyHacked=function(e){const t=(100-e.hackDifficulty)/100*((a.Player.hacking_skill-(e.requiredHackingSkill-1))/a.Player.hacking_skill)*a.Player.hacking_money_mult/240;return t<0?0:t>1?1:t*r.BitNodeMultipliers.ScriptHackMoney},t.calculateHackingTime=i,t.calculateGrowTime=function(e,t){return 3.2*i(e,t)},t.calculateWeakenTime=function(e,t){return 4*i(e,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3),a=n(82);t.createPopupCloseButton=function(e,t){let n;function i(e){27===e.keyCode&&n.click()}return n=r.createElement("button",{class:t.class?t.class:"popup-box-button",display:t.display?t.display:"inline-block",innerText:null==t.innerText?"Cancel":t.innerText,clickListener:()=>{if(e instanceof Element)a.removeElement(e);else try{const t=document.getElementById(e);t instanceof Element&&a.removeElement(t)}catch(e){console.error(`createPopupCloseButton() threw: ${e}`)}return document.removeEventListener("keydown",i),!1}}),document.addEventListener("keydown",i),n}},,function(e,t,n){"use strict";n.d(t,"a",function(){return x}),n.d(t,"c",function(){return A}),n.d(t,"e",function(){return R}),n.d(t,"f",function(){return I}),n.d(t,"b",function(){return B}),n.d(t,"d",function(){return L});var r=n(67),a=n(121),i=n(89),o=n(105),s=n(160),l=n(6),c=n(12),u=n(292),m=n(63),p=n(107),h=n(213),d=n(112),_=n(0),g=n(119),y=n(178),f=n(72),b=n(20),E=n(17),v=n(65),k=n(189),C=n(8),T=(n(154),n(83)),P=n(158),S=n(7),O=n(81);const M=n(184),x=[];for(var w=0;w<l.CONSTANTS.NumNetscriptPorts;++w)x.push(new d.NetscriptPort);function A(){for(const e of i.workerScripts.values())e.env.stopFlag=!0,Object(r.killWorkerScript)(e);o.WorkerScriptStartStopEventEmitter.emitEvent(),i.workerScripts.clear()}function N(e){const t=e.code;var n,i;e.running=!0;try{let a=function(e,t){const n=Object(O.b)(e,{ecmaVersion:9,allowReserved:!0,sourceType:"module"});var r=t.getServer();if(null==r)throw new Error("Failed to find underlying Server object for script");let a="",i=!1;if(M.simple(n,{ImportDeclaration:e=>{i=!0;let t=e.source.value;t.startsWith("./")&&(t=t.slice(2));let n=function(e){for(let t=0;t<r.scripts.length;++t)if(r.scripts[t].filename===e)return r.scripts[t];return null}(t);if(null==n)throw new Error("'Import' failed due to invalid script: "+t);let o=Object(O.b)(n.code,{ecmaVersion:9,allowReserved:!0,sourceType:"module"});if(1===e.specifiers.length&&"ImportNamespaceSpecifier"===e.specifiers[0].type){let t=e.specifiers[0].local.name,n=[],r=[];M.simple(o,{FunctionDeclaration:e=>{n.push(e.id.name),r.push(e)}}),a+="var "+t+";\n(function (namespace) {\n",r.forEach(e=>{a+=Object(k.generate)(e),a+="\n"}),n.forEach(e=>{a+="namespace."+e+" = "+e,a+="\n"}),a+="})("+t+" || ("+t+" = {}));\n"}else{let t=[];e.specifiers.forEach(e=>{t.push(e.local.name)});let n=[];M.simple(o,{FunctionDeclaration:e=>{t.includes(e.id.name)&&n.push(e)}}),n.forEach(e=>{a+=Object(k.generate)(e),a+="\n"})}}}),!i)return{code:e,lineOffset:0};var o=0;if("Program"!==n.type||null==n.body)throw new Error("Code could not be properly parsed");for(let e=n.body.length-1;e>=0;--e)"ImportDeclaration"===n.body[e].type&&(n.body.splice(e,1),++o);var s=(a.match(/\n/g)||[]).length-o;return e=Object(k.generate)(n),{code:e=a+e,lineOffset:s}}(t,e);n=a.code,i=a.lineOffset}catch(t){return Object(C.dialogBoxCreate)("Error processing Imports in "+e.name+":<br>"+t),e.env.stopFlag=!0,e.running=!1,void Object(r.killWorkerScript)(e)}var o;try{o=new u.a(n,function(t,n){var r=Object(p.a)(e);for(let e in r){let a=r[e];if("function"==typeof a)if("hack"===e||"grow"===e||"weaken"===e||"sleep"===e||"prompt"===e||"manualHack"===e){let r=function(){let e=[];for(let n=0;n<arguments.length-1;++n)"object"==typeof arguments[n]||arguments[n].constructor===Array?e.push(t.pseudoToNative(arguments[n])):e.push(arguments[n]);let n=arguments[arguments.length-1];a.apply(null,e).then(function(e){n(e)}).catch(function(e){})};t.setProperty(n,e,t.createAsyncFunction(r))}else if("sprintf"===e||"vsprintf"===e||"scp"===e||"write"==e||"read"===e||"tryWrite"===e||"run"===e||"exec"===e){let r=function(){let e=[];for(let n=0;n<arguments.length;++n)"object"==typeof arguments[n]||arguments[n].constructor===Array?e.push(t.pseudoToNative(arguments[n])):e.push(arguments[n]);return a.apply(null,e)};t.setProperty(n,e,t.createNativeFunction(r))}else{let r=function(){let e=a.apply(null,arguments);return null==e?e:e.constructor===Array||e===Object(e)?t.nativeToPseudo(e):e};t.setProperty(n,e,t.createNativeFunction(r))}else t.setProperty(n,e,t.nativeToPseudo(a))}t.setProperty(n,"args",t.nativeToPseudo(e.args))},i)}catch(t){return Object(C.dialogBoxCreate)("Syntax ERROR in "+e.name+":<br>"+t),e.env.stopFlag=!0,e.running=!1,void Object(r.killWorkerScript)(e)}return new Promise(function(t,n){try{!function r(){try{if(e.env.stopFlag)return n(e);o.step()?Object(v.setTimeoutRef)(r,E.Settings.CodeInstructionRunTime):t(e)}catch(t){return t=t.toString(),Object(m.a)(t)||(t=Object(m.b)(e,t)),e.errorMessage=t,n(e)}}()}catch(t){return Object(S.isString)(t)?(e.errorMessage=t,n(e)):t instanceof a.WorkerScript?n(t):n(e)}})}function R(e,t){return D(e,t)?(t.runScript(e,_.Player.hacknet_node_money_mult),e.pid):0}function D(e,t){e.filename;let n=1;e.threads&&!isNaN(e.threads)?n=e.threads:e.threads=1;const l=Object(P.roundToTwo)(Object(y.getRamUsageFromRunningScript)(e)*n);if(l>t.maxRam-t.ramUsed)return Object(C.dialogBoxCreate)(`Not enough RAM to run script ${e.filename} with args `+`${Object(T.arrayToString)(e.args)}. This likely occurred because you re-loaded `+"the game and the script's RAM usage increased (either because of an update to the game or your changes to the script.)"),!1;t.ramUsed=Object(P.roundToTwo)(t.ramUsed+l);const c=Object(s.generateNextPid)();if(-1===c)throw new Error("Failed to start script because could not find available PID. This is most because you have too many scripts running.");const u=new a.WorkerScript(e,c,p.a);u.ramUsage=l,i.workerScripts.set(c,u),o.WorkerScriptStartStopEventEmitter.emitEvent();let d=null;if(u.name.endsWith(".js")||u.name.endsWith(".ns"))d=function(e){e.running=!0;let t=null;function n(n,r){return function(...a){if(e.env.stopFlag)throw e;if("sleep"===n)return r(...a);if(t)throw e.errorMessage=Object(m.b)(e,sprintf("Concurrent calls to Netscript functions not allowed! Did you forget to await hack(), grow(), or some other promise-returning function? (Currently running: %s tried to run: %s)",t,n),null),e;let i;t=n;try{i=r(...a)}catch(e){throw t=null,e}return i&&void 0!==i.finally?i.finally(function(){t=null}):(t=null,i)}}for(let t in e.env.vars)"function"==typeof e.env.vars[t]&&(e.env.vars[t]=n(t,e.env.vars[t]));return Object(h.a)(e.getServer().scripts,e).then(function(t){return void 0===t?e:[t,e]}).catch(t=>{if(t instanceof Error)throw e.errorMessage=Object(m.b)(e,t.message+(t.stack&&"\nstack:\n"+t.stack.toString()||"")),e;if(Object(m.a)(t))throw e.errorMessage=t,e;throw t})}(u);else if(!((d=N(u))instanceof Promise))return!1;return d.then(function(e){e.running&&(Object(r.killWorkerScript)(u),e.log("","Script finished running"))}).catch(function(e){if(e instanceof Error)return Object(C.dialogBoxCreate)("Script runtime unknown error. This is a bug please contact game developer"),void console.error("Evaluating workerscript returns an Error. THIS SHOULDN'T HAPPEN: "+e.toString());if(e instanceof a.WorkerScript){if(!Object(m.a)(e.errorMessage))return void e.log("","Script killed");{const t=e.errorMessage.split("|");if(4!=t.length)return console.error("ERROR: Something wrong with Error text in evaluator..."),void console.error("Error text: "+errorText);const n=t[1],r=t[2],a=t[3];let i=`RUNTIME ERROR<br>${r}@${n}<br>`;e.args.length>0&&(i+=`Args: ${Object(T.arrayToString)(e.args)}<br>`),i+="<br>",i+=a,Object(C.dialogBoxCreate)(i),e.log("","Script crashed with runtime error")}e.running=!1,e.env.stopFlag=!0}else{if(Object(m.a)(e))return Object(C.dialogBoxCreate)("Script runtime unknown error. This is a bug please contact game developer"),void console.error("ERROR: Evaluating workerscript returns only error message rather than WorkerScript object. THIS SHOULDN'T HAPPEN: "+e.toString());Object(C.dialogBoxCreate)("An unknown script died for an unknown reason. This is a bug please contact game dev"),console.error(e)}Object(r.killWorkerScript)(u)}),!0}function I(e=1){var t=e*c.Engine._idleSpeed/1e3;for(const e of i.workerScripts.values())e.scriptRef.onlineRunningTime+=t}function B(){var e=0;let t=-1!==window.location.href.toLowerCase().indexOf("?noscripts");t&&console.info("Skipping the load of any scripts during startup");for(const n in b.AllServers)if(b.AllServers.hasOwnProperty(n)){const r=b.AllServers[n];r.ramUsed=0;for(let e=0;e<r.scripts.length;++e)r.scripts[e].markUpdated();if(t)r.runningScripts.length=0;else for(let t=0;t<r.runningScripts.length;++t)D(r.runningScripts[t],r),e+=Object(f.c)(r.runningScripts[t])}return e}function L(e,t,n,r,i,o=1){if(!(i instanceof a.WorkerScript))return 0;if("string"!=typeof n||!Array.isArray(r))return i.log(e,`Invalid arguments: scriptname='${n} args='${ags}'`),console.error("runScriptFromScript() failed due to invalid arguments"),0;if(null!=t.getRunningScript(n,r))return i.log(e,`'${n}' is already running on '${t.hostname}'`),0;for(let t=0;t<r.length;++t)if(null==r[t])return i.log(e,"Cannot execute a script with null/undefined as an argument"),0;for(let a=0;a<t.scripts.length;++a)if(t.scripts[a].filename===n){const s=t.scripts[a];let l=s.ramUsage;if(0===(o=Math.round(Number(o))))return 0;l*=o;const c=t.maxRam-t.ramUsed;if(0==t.hasAdminRights)return i.log(e,`You do not have root access on '${t.hostname}'`),0;if(l>c)return i.log(e,`Cannot run script '${n}' (t=${o}) on '${t.hostname}' because there is not enough available RAM!`),0;{i.log(e,`'${n}' on '${t.hostname}' with ${o} threads and args: ${Object(T.arrayToString)(r)}.`);let a=new g.RunningScript(s,r);return a.threads=o,R(a,t)}}return i.log(e,`Could not find script '${n}' on '${t.hostname}'`),0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3);t.createOptionElement=function(e,t=""){let n=t;return""===n&&(n=e),r.createElement("option",{text:e,value:n})}},function(module,__webpack_exports__,__webpack_require__){"use strict";(function($){__webpack_require__.d(__webpack_exports__,"b",function(){return postNetburnerText}),__webpack_require__.d(__webpack_exports__,"a",function(){return Terminal});var _Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(75),_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0__),_Terminal_determineAllPossibilitiesForTabCompletion__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(291),_Terminal_determineAllPossibilitiesForTabCompletion__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_Terminal_determineAllPossibilitiesForTabCompletion__WEBPACK_IMPORTED_MODULE_1__),_Terminal_HelpText__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(190),_Terminal_HelpText__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_Terminal_HelpText__WEBPACK_IMPORTED_MODULE_2__),_Terminal_tabCompletion__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(290),_Terminal_tabCompletion__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_Terminal_tabCompletion__WEBPACK_IMPORTED_MODULE_3__),_Alias__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(64),_Alias__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_Alias__WEBPACK_IMPORTED_MODULE_4__),_BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(19),_BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_5__),_CodingContracts__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(77),_CodingContracts__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(_CodingContracts__WEBPACK_IMPORTED_MODULE_6__),_Constants__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(6),_Constants__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(_Constants__WEBPACK_IMPORTED_MODULE_7__),_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(32),_Programs_Programs__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__),_DarkWeb_DarkWeb__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(222),_DarkWeb_DarkWeb__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(_DarkWeb_DarkWeb__WEBPACK_IMPORTED_MODULE_9__),_DarkWeb_DarkWebItems__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(142),_DarkWeb_DarkWebItems__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(_DarkWeb_DarkWebItems__WEBPACK_IMPORTED_MODULE_10__),_engine__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(12),_Fconf_Fconf__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(133),_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(35),_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__),_Hacking__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(54),_Hacking__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(_Hacking__WEBPACK_IMPORTED_MODULE_14__),_Hacknet_HacknetServer__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(34),_Hacknet_HacknetServer__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(_Hacknet_HacknetServer__WEBPACK_IMPORTED_MODULE_15__),_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(39),_Literature_LiteratureHelpers__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(181),_Literature_LiteratureHelpers__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(_Literature_LiteratureHelpers__WEBPACK_IMPORTED_MODULE_17__),_Message_Message__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(66),_Message_Message__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(_Message_Message__WEBPACK_IMPORTED_MODULE_18__),_Message_MessageHelpers__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(68),_NetscriptWorker__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(57),_Netscript_killWorkerScript__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(67),_Netscript_killWorkerScript__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(_Netscript_killWorkerScript__WEBPACK_IMPORTED_MODULE_21__),_Netscript_WorkerScriptStartStopEventEmitter__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(105),_Netscript_WorkerScriptStartStopEventEmitter__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(_Netscript_WorkerScriptStartStopEventEmitter__WEBPACK_IMPORTED_MODULE_22__),_Player__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(0),_RedPill__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(80),_Script_RunningScript__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(119),_Script_RunningScript__WEBPACK_IMPORTED_MODULE_25___default=__webpack_require__.n(_Script_RunningScript__WEBPACK_IMPORTED_MODULE_25__),_Script_RunningScriptHelpers__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(178),_Script_RunningScriptHelpers__WEBPACK_IMPORTED_MODULE_26___default=__webpack_require__.n(_Script_RunningScriptHelpers__WEBPACK_IMPORTED_MODULE_26__),_Script_ScriptHelpers__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(72),_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(60),_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__),_Server_AllServers__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(20),_Server_AllServers__WEBPACK_IMPORTED_MODULE_29___default=__webpack_require__.n(_Server_AllServers__WEBPACK_IMPORTED_MODULE_29__),_Server_Server__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(116),_Server_Server__WEBPACK_IMPORTED_MODULE_30___default=__webpack_require__.n(_Server_Server__WEBPACK_IMPORTED_MODULE_30__),_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(22),_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31___default=__webpack_require__.n(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__),_Settings_Settings__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(17),_Settings_Settings__WEBPACK_IMPORTED_MODULE_32___default=__webpack_require__.n(_Settings_Settings__WEBPACK_IMPORTED_MODULE_32__),_Server_SpecialServerIps__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(40),_Server_SpecialServerIps__WEBPACK_IMPORTED_MODULE_33___default=__webpack_require__.n(_Server_SpecialServerIps__WEBPACK_IMPORTED_MODULE_33__),_TextFile__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(98),_TextFile__WEBPACK_IMPORTED_MODULE_34___default=__webpack_require__.n(_TextFile__WEBPACK_IMPORTED_MODULE_34__),_utils_SetTimeoutRef__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(65),_utils_SetTimeoutRef__WEBPACK_IMPORTED_MODULE_35___default=__webpack_require__.n(_utils_SetTimeoutRef__WEBPACK_IMPORTED_MODULE_35__),_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__(11),_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36___default=__webpack_require__.n(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36__),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__(2),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37___default=__webpack_require__.n(_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__),_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__=__webpack_require__(24),_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38___default=__webpack_require__.n(_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__),_utils_helpers_addOffset__WEBPACK_IMPORTED_MODULE_39__=__webpack_require__(88),_utils_helpers_addOffset__WEBPACK_IMPORTED_MODULE_39___default=__webpack_require__.n(_utils_helpers_addOffset__WEBPACK_IMPORTED_MODULE_39__),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_40__=__webpack_require__(48),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_40___default=__webpack_require__.n(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_40__),_utils_helpers_arrayToString__WEBPACK_IMPORTED_MODULE_41__=__webpack_require__(83),_utils_helpers_arrayToString__WEBPACK_IMPORTED_MODULE_41___default=__webpack_require__.n(_utils_helpers_arrayToString__WEBPACK_IMPORTED_MODULE_41__),_utils_helpers_getTimestamp__WEBPACK_IMPORTED_MODULE_42__=__webpack_require__(157),_utils_helpers_getTimestamp__WEBPACK_IMPORTED_MODULE_42___default=__webpack_require__.n(_utils_helpers_getTimestamp__WEBPACK_IMPORTED_MODULE_42__),_utils_LogBox__WEBPACK_IMPORTED_MODULE_43__=__webpack_require__(110),_utils_LogBox__WEBPACK_IMPORTED_MODULE_43___default=__webpack_require__.n(_utils_LogBox__WEBPACK_IMPORTED_MODULE_43__),_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_44__=__webpack_require__(45),_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_44___default=__webpack_require__.n(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_44__),_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__=__webpack_require__(5),_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45___default=__webpack_require__.n(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__),autosize__WEBPACK_IMPORTED_MODULE_46__=__webpack_require__(289),autosize__WEBPACK_IMPORTED_MODULE_46___default=__webpack_require__.n(autosize__WEBPACK_IMPORTED_MODULE_46__),jszip__WEBPACK_IMPORTED_MODULE_47__=__webpack_require__(288),jszip__WEBPACK_IMPORTED_MODULE_47___default=__webpack_require__.n(jszip__WEBPACK_IMPORTED_MODULE_47__),file_saver__WEBPACK_IMPORTED_MODULE_48__=__webpack_require__(287),file_saver__WEBPACK_IMPORTED_MODULE_48___default=__webpack_require__.n(file_saver__WEBPACK_IMPORTED_MODULE_48__);function postNetburnerText(){Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bitburner v"+_Constants__WEBPACK_IMPORTED_MODULE_7__.CONSTANTS.Version)}function isNumber(e){return"string"==typeof e&&(!isNaN(e)&&!isNaN(parseFloat(e)))}function getTerminalInput(){return document.getElementById("terminal-input-text-box").value}$(document).keydown(function(e){if(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36__.routing.isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36__.Page.Terminal)){var t=document.getElementById("terminal-input-text-box");if(null==t||e.ctrlKey||e.shiftKey||Terminal.contractOpen||t.focus(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.ENTER){e.preventDefault();const t=getTerminalInput(),n=Terminal.currDir;Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("<span class='prompt'>["+(_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_TIMESTAMPS?Object(_utils_helpers_getTimestamp__WEBPACK_IMPORTED_MODULE_42__.getTimestamp)()+" ":"")+_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().hostname+` ~${n}]></span> ${t}`),t.length>0&&(Terminal.resetTerminalInput(),Terminal.executeCommands(t))}if(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.C&&e.ctrlKey&&(_engine__WEBPACK_IMPORTED_MODULE_11__.Engine._actionInProgress?(Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Cancelling..."),_engine__WEBPACK_IMPORTED_MODULE_11__.Engine._actionInProgress=!1,Terminal.finishAction(!0)):_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&Terminal.resetTerminalInput()),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.L&&e.ctrlKey&&(e.preventDefault(),Terminal.executeCommand("clear")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.UPARROW||_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.P&&e.ctrlKey){if(_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.preventDefault(),null==t)return;var n=Terminal.commandHistoryIndex;if(0==(a=Terminal.commandHistory.length))return;(n<0||n>a)&&(Terminal.commandHistoryIndex=a),0!=n&&--Terminal.commandHistoryIndex;var r=Terminal.commandHistory[Terminal.commandHistoryIndex];t.value=r,Object(_utils_SetTimeoutRef__WEBPACK_IMPORTED_MODULE_35__.setTimeoutRef)(function(){t.selectionStart=t.selectionEnd=1e4},0)}if(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.DOWNARROW||_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.M&&e.ctrlKey){if(_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.preventDefault(),null==t)return;var a;n=Terminal.commandHistoryIndex;if(0==(a=Terminal.commandHistory.length))return;if((n<0||n>a)&&(Terminal.commandHistoryIndex=a),n==a||n==a-1)Terminal.commandHistoryIndex=a,t.value="";else{++Terminal.commandHistoryIndex;r=Terminal.commandHistory[Terminal.commandHistoryIndex];t.value=r}}if(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.TAB){if(e.preventDefault(),null==t)return;let n=t.value;if(""==n)return;const r=n.lastIndexOf(";");-1!==r&&(n=n.slice(r+1));const a=(n=(n=n.trim()).replace(/\s\s+/g," ")).split(" ");let i=a.length-2;i<-1&&(i=0);const o=Object(_Terminal_determineAllPossibilitiesForTabCompletion__WEBPACK_IMPORTED_MODULE_1__.determineAllPossibilitiesForTabCompletion)(_Player__WEBPACK_IMPORTED_MODULE_23__.Player,n,i,Terminal.currDir);if(0==o.length)return;let s="",l="";if(0==a.length)return;1==a.length?l=a[0]:2==a.length?(l=a[0],s=a[1]):3==a.length?(l=a[0]+" "+a[1],s=a[2]):(s=a.pop(),l=a.join(" ")),Object(_Terminal_tabCompletion__WEBPACK_IMPORTED_MODULE_3__.tabCompletion)(l,s,o),t.focus()}_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.A&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("home")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.E&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("end")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.B&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("prevchar")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.B&&e.altKey&&(e.preventDefault(),Terminal.moveTextCursor("prevword")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.F&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("nextchar")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.F&&e.altKey&&(e.preventDefault(),Terminal.moveTextCursor("nextword")),e.keyCode!==_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.H&&e.keyCode!==_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.D||!e.ctrlKey||(Terminal.modifyInput("backspace"),e.preventDefault()))}});let terminalCtrlPressed=!1,shiftKeyPressed=!1;$(document).ready(function(){_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36__.routing.isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36__.Page.Terminal)&&$(".terminal-input").focus()}),$(document).keydown(function(e){if(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36__.routing.isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36__.Page.Terminal))if(e.which==_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.CTRL)terminalCtrlPressed=!0;else if(e.shiftKey)shiftKeyPressed=!0;else if(terminalCtrlPressed||shiftKeyPressed||Terminal.contractOpen);else{var t=document.getElementById("terminal-input-text-box");null!=t&&t.focus(),terminalCtrlPressed=!1,shiftKeyPressed=!1}}),$(document).keyup(function(e){_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36__.routing.isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_36__.Page.Terminal)&&(e.which==_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_38__.KEY.CTRL&&(terminalCtrlPressed=!1),e.shiftKey&&(shiftKeyPressed=!1))});let Terminal={hackFlag:!1,analyzeFlag:!1,actionStarted:!1,actionTime:0,commandHistory:[],commandHistoryIndex:0,contractOpen:!1,currDir:"/",resetTerminalInput:function(e=!1){let t="";e&&(t=getTerminalInput());const n=Terminal.currDir;_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.WRAP_INPUT?(document.getElementById("terminal-input-td").innerHTML=`<div id='terminal-input-header' class='prompt'>[${_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().hostname} ~${n}]$ </div>`+`<textarea type="text" id="terminal-input-text-box" class="terminal-input" tabindex="1" value="${t}"/>`,autosize__WEBPACK_IMPORTED_MODULE_46___default()(document.getElementById("terminal-input-text-box"))):document.getElementById("terminal-input-td").innerHTML=`<div id='terminal-input-header' class='prompt'>[${_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().hostname} ~${n}]$ </div>`+`<input type="text" id="terminal-input-text-box" class="terminal-input" tabindex="1" value="${t}"/>`,document.getElementById("terminal-input-header").style.display="inline";const r=document.getElementById("terminal-input-text-box");if("number"==typeof r.selectionStart)r.selectionStart=r.selectionEnd=r.value.length;else if(void 0!==r.createTextRange){r.focus();var a=el.createTextRange();a.collapse(!1),a.select()}},modifyInput:function(e){try{var t=document.getElementById("terminal-input-text-box");if(null==t)return;t.focus();var n=t.value.length,r=t.selectionStart,a=(t.selectionEnd,t.value);switch(e.toLowerCase()){case"backspace":r>0&&r<=n+1&&(t.value=a.substr(0,r-1)+a.substr(r));break;case"deletewordbefore":for(var i=r-1;i>0;--i)if(" "===a.charAt(i))return void(t.value=a.substr(0,i)+a.substr(r));break;case"deletewordafter":for(i=r+1;i<=text.length+1;++i)if(" "===a.charAt(i))return void(t.value=a.substr(0,r)+a.substr(i))}}catch(e){console.error("Exception in Terminal.modifyInput: "+e)}},moveTextCursor:function(e){try{var t=document.getElementById("terminal-input-text-box");if(null==t)return;t.focus();var n=t.value.length,r=t.selectionStart;t.selectionEnd;switch(e.toLowerCase()){case"home":t.setSelectionRange(0,0);break;case"end":t.setSelectionRange(n,n);break;case"prevchar":r>0&&t.setSelectionRange(r-1,r-1);break;case"prevword":for(var a=r-2;a>=0;--a)if(" "===t.value.charAt(a))return void t.setSelectionRange(a+1,a+1);t.setSelectionRange(0,0);break;case"nextchar":t.setSelectionRange(r+1,r+1);break;case"nextword":for(a=r+1;a<=n;++a)if(" "===t.value.charAt(a))return void t.setSelectionRange(a,a);t.setSelectionRange(n,n);break;default:console.warn("Invalid loc argument in Terminal.moveTextCursor()")}}catch(e){console.error("Exception in Terminal.moveTextCursor: "+e)}},startHack:function(){Terminal.hackFlag=!0,Terminal.actionTime=Object(_Hacking__WEBPACK_IMPORTED_MODULE_14__.calculateHackingTime)(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer())/4,Terminal.startAction()},startAnalyze:function(){Terminal.analyzeFlag=!0,Terminal.actionTime=1,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Analyzing system..."),Terminal.startAction()},startAction:function(){Terminal.actionStarted=!0,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.hackProgressPost)("Time left:"),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.hackProgressBarPost)("["),document.getElementById("terminal-input-td").innerHTML='<input type="text" class="terminal-input"/>',$("input[class=terminal-input]").prop("disabled",!0)},finishAction:function(e=!1){Terminal.hackFlag?Terminal.finishHack(e):Terminal.analyzeFlag&&Terminal.finishAnalyze(e)},finishHack:function(e=!1){if(0==e){var t=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer(),n=Object(_Hacking__WEBPACK_IMPORTED_MODULE_14__.calculateHackingChance)(t),r=Math.random(),a=Object(_Hacking__WEBPACK_IMPORTED_MODULE_14__.calculateHackingExpGain)(t),i=a/4;if(r<n){if(_Server_SpecialServerIps__WEBPACK_IMPORTED_MODULE_33__.SpecialServerIps[_Server_SpecialServerIps__WEBPACK_IMPORTED_MODULE_33__.SpecialServerNames.WorldDaemon]&&_Server_SpecialServerIps__WEBPACK_IMPORTED_MODULE_33__.SpecialServerIps[_Server_SpecialServerIps__WEBPACK_IMPORTED_MODULE_33__.SpecialServerNames.WorldDaemon]==t.ip)return null==_Player__WEBPACK_IMPORTED_MODULE_23__.Player.bitNodeN&&(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.bitNodeN=1),void Object(_RedPill__WEBPACK_IMPORTED_MODULE_24__.a)(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.bitNodeN);t.manuallyHacked=!0;var o=Object(_Hacking__WEBPACK_IMPORTED_MODULE_14__.calculatePercentMoneyHacked)(t);(o=Math.floor(t.moneyAvailable*o))<=0&&(o=0),t.moneyAvailable-=o,_Player__WEBPACK_IMPORTED_MODULE_23__.Player.gainMoney(o),_Player__WEBPACK_IMPORTED_MODULE_23__.Player.recordMoneySource(o,"hacking"),_Player__WEBPACK_IMPORTED_MODULE_23__.Player.gainHackingExp(a),_Player__WEBPACK_IMPORTED_MODULE_23__.Player.gainIntelligenceExp(a/_Constants__WEBPACK_IMPORTED_MODULE_7__.CONSTANTS.IntelligenceTerminalHackBaseExpGain),t.fortify(_Constants__WEBPACK_IMPORTED_MODULE_7__.CONSTANTS.ServerFortifyAmount),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Hack successful! Gained "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(o,"($0,0.00)")+" and "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(a,"0.0000")+" hacking EXP")}else _Player__WEBPACK_IMPORTED_MODULE_23__.Player.gainHackingExp(i),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Failed to hack "+t.hostname+". Gained "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(i,"0.0000")+" hacking EXP")}$("#hack-progress-bar").attr("id","old-hack-progress-bar"),$("#hack-progress").attr("id","old-hack-progress"),Terminal.resetTerminalInput(),$("input[class=terminal-input]").prop("disabled",!1),Terminal.hackFlag=!1},finishAnalyze:function(e=!1){if(0==e){let e=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer();const n=e instanceof _Hacknet_HacknetServer__WEBPACK_IMPORTED_MODULE_15__.HacknetServer;Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(e.hostname+": "),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Organization name: "+e.organizationName);var t="";t=e.hasAdminRights?"YES":"NO",Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Root Access: "+t),n||Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Required hacking skill: "+e.requiredHackingSkill),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Server security level: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(e.hackDifficulty,"0.000a")),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Chance to hack: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(Object(_Hacking__WEBPACK_IMPORTED_MODULE_14__.calculateHackingChance)(e),"0.00%")),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Time to hack: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(Object(_Hacking__WEBPACK_IMPORTED_MODULE_14__.calculateHackingTime)(e),"0.000")+" seconds"),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Total money available on server: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(e.moneyAvailable,"$0,0.00")),n||Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Required number of open ports for NUKE: "+e.numOpenPortsRequired),e.sshPortOpen?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("SSH port: Open"):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("SSH port: Closed"),e.ftpPortOpen?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("FTP port: Open"):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("FTP port: Closed"),e.smtpPortOpen?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("SMTP port: Open"):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("SMTP port: Closed"),e.httpPortOpen?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("HTTP port: Open"):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("HTTP port: Closed"),e.sqlPortOpen?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("SQL port: Open"):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("SQL port: Closed")}Terminal.analyzeFlag=!1,$("#hack-progress-bar").attr("id","old-hack-progress-bar"),$("#hack-progress").attr("id","old-hack-progress"),Terminal.resetTerminalInput(),$("input[class=terminal-input]").prop("disabled",!1)},executeCommands:function(e){e=(e=e.trim()).replace(/\s\s+/g," "),Terminal.commandHistory[Terminal.commandHistory.length-1]!=e&&(Terminal.commandHistory.push(e),Terminal.commandHistory.length>50&&Terminal.commandHistory.splice(0,1)),Terminal.commandHistoryIndex=Terminal.commandHistory.length,e=e.split(";");for(let t=0;t<e.length;t++)e[t].match(/^\s*$/)||Terminal.executeCommand(e[t].trim())},parseCommandArguments:function(e){let t="";const n=[];let r=0,a=0,i="";for(;a<e.length;){let o=!1;a>=1&&"\\"===(i=e.charAt(a-1))&&(o=!0);const s=e.charAt(a);if('"'===s)if(o||" "!==i)""===t?t='"':'"'===t&&(t="");else{const t=e.indexOf('"',a+1);if(-1!==t&&(t===e.length-1||" "===e.charAt(t+1))){n.push(e.substr(a+1,t-a-1)),r=a=t===e.length-1?t+1:t+2;continue}}else if("'"===s)if(o||" "!==i)""===t?t="'":"'"===t&&(t="");else{const t=e.indexOf("'",a+1);if(-1!==t&&(t===e.length-1||" "===e.charAt(t+1))){n.push(e.substr(a+1,t-a-1)),r=a=t===e.length-1?t+1:t+2;continue}}else if(" "===s&&""===t){let t=e.substr(r,a-r);isNumber(t)?n.push(parseFloat(t)):n.push(t),r=a+1}++a}if(r!==a){let t=e.substr(r,a-r);isNumber(t)?n.push(parseFloat(t)):n.push(t)}return n},executeCommand:function(command){if(Terminal.hackFlag||Terminal.analyzeFlag)Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(`Cannot execute command (${command}) while an action is in progress`);else{command=Object(_Alias__WEBPACK_IMPORTED_MODULE_4__.substituteAliases)(command),command.startsWith("./")&&(command="run "+command.slice(2));var commandArray=Terminal.parseCommandArguments(command);if(0!=commandArray.length)if(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.a.isRunning){var foodnstuffServ=Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.GetServerByHostname)("foodnstuff");if(null==foodnstuffServ)throw new Error("Could not get foodnstuff server");switch(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.a.currStep){case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalHelp:1===commandArray.length&&"help"==commandArray[0]?(Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(_Terminal_HelpText__WEBPACK_IMPORTED_MODULE_2__.TerminalHelpText),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalLs:1===commandArray.length&&"ls"==commandArray[0]?(Terminal.executeListCommand(commandArray),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalScan:1===commandArray.length&&"scan"==commandArray[0]?(Terminal.executeScanCommand(commandArray),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalScanAnalyze1:1==commandArray.length&&"scan-analyze"==commandArray[0]?(Terminal.executeScanAnalyzeCommand(1),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalScanAnalyze2:2==commandArray.length&&"scan-analyze"==commandArray[0]&&2===commandArray[1]?(Terminal.executeScanAnalyzeCommand(2),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalConnect:if(2==commandArray.length){if("connect"!=commandArray[0]||"foodnstuff"!=commandArray[1]&&commandArray[1]!=foodnstuffServ.ip)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Wrong command! Try again!");_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().isConnectedTo=!1,_Player__WEBPACK_IMPORTED_MODULE_23__.Player.currentServer=foodnstuffServ.ip,_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().isConnectedTo=!0,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Connected to foodnstuff"),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()}else Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalAnalyze:if(1===commandArray.length&&"analyze"===commandArray[0]){if(1!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Incorrect usage of analyze command. Usage: analyze");Terminal.startAnalyze(),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()}else Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalNuke:2==commandArray.length&&"run"==commandArray[0]&&"NUKE.exe"==commandArray[1]?(foodnstuffServ.hasAdminRights=!0,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("NUKE successful! Gained root access to foodnstuff"),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalManualHack:1==commandArray.length&&"hack"==commandArray[0]?(Terminal.startHack(),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalCreateScript:2==commandArray.length&&"nano"==commandArray[0]&&"foodnstuff.script"==commandArray[1]?(_engine__WEBPACK_IMPORTED_MODULE_11__.Engine.loadScriptEditorContent("foodnstuff.script",""),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalFree:1==commandArray.length&&"free"==commandArray[0]?(Terminal.executeFreeCommand(commandArray),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.TerminalRunScript:2==commandArray.length&&"run"==commandArray[0]&&"foodnstuff.script"==commandArray[1]?(Terminal.runScript(commandArray),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;case _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.d.ActiveScriptsToTerminal:if(2==commandArray.length&&"tail"==commandArray[0]&&"foodnstuff.script"==commandArray[1]){var runningScript=Object(_Script_ScriptHelpers__WEBPACK_IMPORTED_MODULE_27__.a)("foodnstuff.script",[],_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer());if(null==runningScript)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Error: No such script exists");Object(_utils_LogBox__WEBPACK_IMPORTED_MODULE_43__.logBoxCreate)(runningScript),Object(_InteractiveTutorial__WEBPACK_IMPORTED_MODULE_16__.b)()}else Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Bad command. Please follow the tutorial");break;default:return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Please follow the tutorial, or click 'Exit Tutorial' if you'd like to skip it")}}else{var s=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer();switch(commandArray[0].toLowerCase()){case"alias":if(1===commandArray.length)return void Object(_Alias__WEBPACK_IMPORTED_MODULE_4__.printAliases)();if(2===commandArray.length&&Object(_Alias__WEBPACK_IMPORTED_MODULE_4__.parseAliasDeclaration)(commandArray[1]))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Set alias ${commandArray[1]}`);if(3===commandArray.length&&"-g"===commandArray[1]&&Object(_Alias__WEBPACK_IMPORTED_MODULE_4__.parseAliasDeclaration)(commandArray[2],!0))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Set global alias ${commandArray[1]}`);Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)('Incorrect usage of alias command. Usage: alias [-g] [aliasname="value"]');break;case"analyze":if(1!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Incorrect usage of analyze command. Usage: analyze");Terminal.startAnalyze();break;case"buy":_Server_SpecialServerIps__WEBPACK_IMPORTED_MODULE_33__.SpecialServerIps.hasOwnProperty("Darkweb Server")?Object(_DarkWeb_DarkWeb__WEBPACK_IMPORTED_MODULE_9__.executeDarkwebTerminalCommand)(commandArray):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("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)");break;case"cat":try{if(2!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of cat command. Usage: cat [file]");const e=Terminal.getFilepath(commandArray[1]);if(!e.endsWith(".msg")&&!e.endsWith(".lit")&&!e.endsWith(".txt"))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Only .msg, .txt, and .lit files are viewable with cat (filename must end with .msg, .txt, or .lit)");if(e.endsWith(".msg")||e.endsWith(".lit"))for(let t=0;t<s.messages.length;++t){if(e.endsWith(".lit")&&s.messages[t]===e)return void Object(_Literature_LiteratureHelpers__WEBPACK_IMPORTED_MODULE_17__.showLiterature)(s.messages[t]);if(e.endsWith(".msg")&&s.messages[t].filename===e)return void Object(_Message_MessageHelpers__WEBPACK_IMPORTED_MODULE_19__.e)(s.messages[t])}else if(e.endsWith(".txt")){const t=Terminal.getTextFile(e);if(null!=t)return void t.show()}Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(`No such file ${e}`)}catch(e){Terminal.postThrownError(e)}break;case"cd":if(2!==commandArray.length)Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect number of arguments. Usage: cd [dir]");else{let e=commandArray[1],t;if("/"===e)t="/";else if(e=Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0__.removeTrailingSlash)(e),t=Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0__.evaluateDirectoryPath)(e,Terminal.currDir),null==t||""===t)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Invalid path. Failed to change directories");Terminal.currDir=t,Terminal.resetTerminalInput()}break;case"check":try{if(commandArray.length<2)Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect number of arguments. Usage: check [script] [arg1] [arg2]...");else{const e=Terminal.getFilepath(commandArray[1]);if(!Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(e))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("tail can only be called on .script files (filename must end with .script)");let t=[];for(var i=2;i<commandArray.length;++i)t.push(commandArray[i]);var runningScript=Object(_Script_ScriptHelpers__WEBPACK_IMPORTED_MODULE_27__.a)(e,t,s);if(null==runningScript)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("No such script exists");runningScript.displayLog()}}catch(e){Terminal.postThrownError(e)}break;case"clear":case"cls":if(1!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of clear/cls command. Usage: clear/cls");$("#terminal tr:not(:last)").remove(),postNetburnerText();break;case"connect":{if(2!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of connect command. Usage: connect [ip/hostname]");let e=commandArray[1];for(let t=0;t<s.serversOnNetwork.length;t++)if(Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.getServerOnNetwork)(s,t).ip==e||Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.getServerOnNetwork)(s,t).hostname==e)return void Terminal.connectToServer(e);Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Host not found");break}case"download":try{if(2!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of download command. Usage: download [script/text file]");const e=commandArray[1];if("*"===e||"*.script"===e||"*.txt"===e){var zip=new jszip__WEBPACK_IMPORTED_MODULE_47__;if("*"===e||"*.script"===e)for(var i=0;i<s.scripts.length;++i){var file=new Blob([s.scripts[i].code],{type:"text/plain"});zip.file(s.scripts[i].filename+".js",file)}if("*"===e||"*.txt"===e)for(var i=0;i<s.textFiles.length;++i){var file=new Blob([s.textFiles[i].text],{type:"text/plain"});zip.file(s.textFiles[i].fn,file)}let t;switch(e){case"*.script":t="bitburnerScripts.zip";break;case"*.txt":t="bitburnerTexts.zip";break;default:t="bitburnerFiles.zip"}return void zip.generateAsync({type:"blob"}).then(function(e){file_saver__WEBPACK_IMPORTED_MODULE_48__.saveAs(e,t)})}if(Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(e)){const t=Terminal.getScript(e);if(null!=t)return t.download()}else{if(!e.endsWith(".txt"))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Cannot download this filetype");{const t=Terminal.getTextFile(e);if(null!=t)return t.download()}}Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(`${e} does not exist`)}catch(e){Terminal.postThrownError(e)}break;case"expr":{if(commandArray.length<=1)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of expr command. Usage: expr [math expression]");let expr=commandArray.slice(1).join(""),sanitizedExpr=expr.replace(/s+/g,"").replace(/[^-()\d/*+.]/g,""),result;try{result=eval(sanitizedExpr)}catch(e){return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(`Could not evaluate expression: ${sanitizedExpr}`)}Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(result);break}case"free":Terminal.executeFreeCommand(commandArray);break;case"hack":if(1!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of hack command. Usage: hack");s.purchasedByPlayer?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Cannot hack your own machines! You are currently connected to your home PC or one of your purchased servers"):0==s.hasAdminRights?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("You do not have admin rights for this machine! Cannot hack"):s.requiredHackingSkill>_Player__WEBPACK_IMPORTED_MODULE_23__.Player.hacking_skill?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill"):s instanceof _Hacknet_HacknetServer__WEBPACK_IMPORTED_MODULE_15__.HacknetServer?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Cannot hack this type of Server"):Terminal.startHack();break;case"help":if(1!==commandArray.length&&2!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of help command. Usage: help");if(1===commandArray.length)Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(_Terminal_HelpText__WEBPACK_IMPORTED_MODULE_2__.TerminalHelpText);else{var cmd=commandArray[1],txt=_Terminal_HelpText__WEBPACK_IMPORTED_MODULE_2__.HelpTexts[cmd];if(null==txt)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("No help topics match '"+cmd+"'");Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(txt)}break;case"home":if(1!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of home command. Usage: home");_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().isConnectedTo=!1,_Player__WEBPACK_IMPORTED_MODULE_23__.Player.currentServer=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getHomeComputer().ip,_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().isConnectedTo=!0,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Connected to home"),Terminal.currDir="/",Terminal.resetTerminalInput();break;case"hostname":if(1!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of hostname command. Usage: hostname");Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().hostname);break;case"ifconfig":if(1!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of ifconfig command. Usage: ifconfig");Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().ip);break;case"kill":Terminal.executeKillCommand(commandArray);break;case"killall":for(let e=s.runningScripts.length-1;e>=0;--e)Object(_Netscript_killWorkerScript__WEBPACK_IMPORTED_MODULE_21__.killWorkerScript)(s.runningScripts[e],s.ip,!1);_Netscript_WorkerScriptStartStopEventEmitter__WEBPACK_IMPORTED_MODULE_22__.WorkerScriptStartStopEventEmitter.emitEvent(),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Killing all running scripts");break;case"ls":Terminal.executeListCommand(commandArray);break;case"lscpu":Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().cpuCores+" Core(s)");break;case"mem":Terminal.executeMemCommand(commandArray);break;case"mv":if(3!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect number of arguments. Usage: mv [src] [dest]");try{const e=commandArray[1],t=commandArray[2];if(!Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(e)&&!e.endsWith(".txt"))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("'mv' can only be used on scripts and text files (.txt)");const n=Terminal.getFile(e);if(null==n)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(`Source file ${e} does not exist`);const r=Terminal.getFilepath(e),a=Terminal.getFilepath(t),i=Terminal.getFile(t);if(Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(e)){if(!Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(t))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Source and destination files must have the same type");if(s.isRunning(r))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Cannot use 'mv' on a script that is running");if(null!=i){const e=s.removeFile(a);if(!e.res)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Something went wrong...please contact game dev (probably a bug)");Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Warning: The destination file was overwritten")}n.filename=a}else if(e.endsWith(".txt")){if(!t.endsWith(".txt"))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Source and destination files must have the same type");if(null!=i){const e=s.removeFile(a);if(!e.res)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Something went wrong...please contact game dev (probably a bug)");Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Warning: The destination file was overwritten")}n.fn=a}}catch(e){Terminal.postThrownError(e)}break;case"nano":Terminal.executeNanoCommand(commandArray);break;case"ps":if(1!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of ps command. Usage: ps");for(let e=0;e<s.runningScripts.length;e++){let t=s.runningScripts[e],n=`(PID - ${t.pid}) ${t.filename}`;for(let e=0;e<t.args.length;++e)n+=" "+t.args[e].toString();Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(n)}break;case"rm":{if(2!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect number of arguments. Usage: rm [program/script]");let e=Terminal.getFilepath(commandArray[1]);const t=s.removeFile(e);t.res||Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(t.msg);break}case"run":if(commandArray.length<2)Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect number of arguments. Usage: run [program/script] [-t] [num threads] [arg1] [arg2]...");else{var executableName=commandArray[1];if("musicplayer"===executableName)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)('<iframe src="https://open.spotify.com/embed/user/danielyxie/playlist/1ORnnL6YNvXOracUaUV2kh" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>',!1);Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(executableName)?Terminal.runScript(commandArray):executableName.endsWith(".cct")?Terminal.runContract(executableName):Terminal.runProgram(commandArray)}break;case"scan":Terminal.executeScanCommand(commandArray);break;case"scan-analyze":if(1===commandArray.length)Terminal.executeScanAnalyzeCommand(1);else{if(commandArray.length>3)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of scan-analyze command. usage: scan-analyze [depth]");let e=!1;3===commandArray.length&&"-a"===commandArray[2]&&(e=!0);let t=parseInt(commandArray[1]);if(isNaN(t)||t<0)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of scan-analyze command. depth argument must be positive numeric");if(t>3&&!_Player__WEBPACK_IMPORTED_MODULE_23__.Player.hasProgram(_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.DeepscanV1.name)&&!_Player__WEBPACK_IMPORTED_MODULE_23__.Player.hasProgram(_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.DeepscanV2.name))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("You cannot scan-analyze with that high of a depth. Maximum depth is 3");if(t>5&&!_Player__WEBPACK_IMPORTED_MODULE_23__.Player.hasProgram(_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.DeepscanV2.name))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("You cannot scan-analyze with that high of a depth. Maximum depth is 5");if(t>10)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("You cannot scan-analyze with that high of a depth. Maximum depth is 10");Terminal.executeScanAnalyzeCommand(t,e)}break;case"scp":Terminal.executeScpCommand(commandArray);break;case"sudov":if(1!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect number of arguments. Usage: sudov");s.hasAdminRights?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("You have ROOT access to this machine"):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("You do NOT have root access to this machine");break;case"tail":try{if(commandArray.length<2)Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect number of arguments. Usage: tail [script] [arg1] [arg2]...");else{const e=Terminal.getFilepath(commandArray[1]);if(!Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(e))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("tail can only be called on .script files (filename must end with .script)");const t=[];for(let e=2;e<commandArray.length;++e)t.push(commandArray[e]);const n=Object(_Script_ScriptHelpers__WEBPACK_IMPORTED_MODULE_27__.a)(e,t,s);if(null==n)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("No such script exists");Object(_utils_LogBox__WEBPACK_IMPORTED_MODULE_43__.logBoxCreate)(n)}}catch(e){Terminal.postThrownError(e)}break;case"theme":{let e=commandArray.slice(1);if(1!==e.length&&3!==e.length)Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect number of arguments."),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Usage: theme [default|muted|solarized] | #[background color hex] #[text color hex] #[highlight color hex]");else if(1===e.length){var themeName=e[0];if("default"==themeName)document.body.style.setProperty("--my-highlight-color","#ffffff"),document.body.style.setProperty("--my-font-color","#66ff33"),document.body.style.setProperty("--my-background-color","#000000"),document.body.style.setProperty("--my-prompt-color","#f92672");else if("muted"==themeName)document.body.style.setProperty("--my-highlight-color","#ffffff"),document.body.style.setProperty("--my-font-color","#66ff33"),document.body.style.setProperty("--my-background-color","#252527");else{if("solarized"!=themeName)return Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Theme not found");document.body.style.setProperty("--my-highlight-color","#6c71c4"),document.body.style.setProperty("--my-font-color","#839496"),document.body.style.setProperty("--my-background-color","#002b36")}_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.THEME_HIGHLIGHT_COLOR=document.body.style.getPropertyValue("--my-highlight-color"),_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.THEME_FONT_COLOR=document.body.style.getPropertyValue("--my-font-color"),_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.THEME_BACKGROUND_COLOR=document.body.style.getPropertyValue("--my-background-color"),_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.THEME_PROMPT_COLOR=document.body.style.getPropertyValue("--my-prompt-color")}else{var inputBackgroundHex=e[0],inputTextHex=e[1],inputHighlightHex=e[2];if(!(/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(inputBackgroundHex)&&/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(inputTextHex)&&/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(inputHighlightHex)))return Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Invalid Hex Input for theme");document.body.style.setProperty("--my-highlight-color",inputHighlightHex),document.body.style.setProperty("--my-font-color",inputTextHex),document.body.style.setProperty("--my-background-color",inputBackgroundHex),_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.THEME_HIGHLIGHT_COLOR=document.body.style.getPropertyValue("--my-highlight-color"),_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.THEME_FONT_COLOR=document.body.style.getPropertyValue("--my-font-color"),_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.THEME_BACKGROUND_COLOR=document.body.style.getPropertyValue("--my-background-color")}break}case"top":{if(1!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of top command. Usage: top");const e=40,t=10,n=16,r="Script",a="PID",i="Threads",o="RAM Usage",l=" ".repeat(e-r.length),c=" ".repeat(t-a.length),u=" ".repeat(n-i.length),m=`${r}${l}${a}${c}${i}${u}${o}`;Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(m);let p=s.runningScripts;for(let r=0;r<p.length;r++){let a=p[r];const i=Math.max(0,e-a.filename.length),o=" ".repeat(i),s=Math.max(0,t-(a.pid+"").length),l=" ".repeat(s),c=Math.max(0,n-(a.threads+"").length),u=" ".repeat(c),m=_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(Object(_Script_RunningScriptHelpers__WEBPACK_IMPORTED_MODULE_26__.getRamUsageFromRunningScript)(a)*a.threads,"0.00")+" GB",h=[a.filename,o,a.pid,l,a.threads,u,m].join("");Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(h)}break}case"unalias":if(2!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of unalias name. Usage: unalias [alias]");Object(_Alias__WEBPACK_IMPORTED_MODULE_4__.removeAlias)(commandArray[1])?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Removed alias ${commandArray[1]}`):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(`No such alias exists: ${commandArray[1]}`);break;case"wget":{if(3!==commandArray.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of wget command. Usage: wget [url] [target file]");let e=commandArray[1],t=Terminal.getFilepath(commandArray[2]);if(!Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(t)&&!t.endsWith(".txt"))return Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("wget failed: Invalid target file. Target file must be script or text file");$.get(e,function(e){let n;return(n=Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(t)?s.writeToScriptFile(t,e):s.writeToTextFile(t,e)).success?n.overwritten?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`wget successfully retrieved content and overwrote ${t}`):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`wget successfully retrieved content to new file ${t}`):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("wget failed")},"text").fail(function(e){return Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("wget failed: "+JSON.stringify(e))});break}default:Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(`Command ${commandArray[0]} not found`)}}}},connectToServer:function(e){var t=Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.getServer)(e);null!=t?(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().isConnectedTo=!1,_Player__WEBPACK_IMPORTED_MODULE_23__.Player.currentServer=t.ip,_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().isConnectedTo=!0,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Connected to "+t.hostname),Terminal.currDir="/","darkweb"==_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().hostname&&Object(_DarkWeb_DarkWeb__WEBPACK_IMPORTED_MODULE_9__.checkIfConnectedToDarkweb)(),Terminal.resetTerminalInput()):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Invalid server. Connection failed.")},executeFreeCommand:function(e){if(1!==e.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of free command. Usage: free");const t=_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().maxRam,"0.00"),n=_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().ramUsed,"0.00"),r=_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().maxRam-_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().ramUsed,"0.00"),a=Math.max(t.length,Math.max(n.length,r.length)),i=_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().ramUsed/_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().maxRam*100,"0.00");Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Total: ${" ".repeat(a-t.length)}${t} GB`),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Used: ${" ".repeat(a-n.length)}${n} GB (${i}%)`),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Available: ${" ".repeat(a-r.length)}${r} GB`)},executeKillCommand:function(e){try{if(e.length<2)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of kill command. Usage: kill [scriptname] [arg1] [arg2]...");if("number"==typeof e[1]){const t=e[1];return void(Object(_Netscript_killWorkerScript__WEBPACK_IMPORTED_MODULE_21__.killWorkerScript)(t)?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Killing script with PID ${t}`):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Failed to kill script with PID ${t}. No such script exists`))}const t=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer(),n=Terminal.getFilepath(e[1]),r=[];for(let t=2;t<e.length;++t)r.push(e[t]);const a=t.getRunningScript(n,r);if(null==a)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("No such script is running. Nothing to kill");Object(_Netscript_killWorkerScript__WEBPACK_IMPORTED_MODULE_21__.killWorkerScript)(a,t.ip),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Killing ${n}`)}catch(e){Terminal.postThrownError(e)}},executeListCommand:function(e){const t=e.length;function n(){Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of ls command. Usage: ls [dir] [| grep pattern]")}if(t<=0||t>5||3===t)return n();let r=null,a=Terminal.currDir;if(a.endsWith("/")||(a+="/"),t>=4){if("grep"!==e[t-2]||"|"!==e[t-3])return n();r=e[t-1]}if(t>=2&&"|"!==e[1]&&null!=(a=Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0__.evaluateDirectoryPath)(e[1],Terminal.currDir))&&(a.endsWith("/")||(a+="/"),!Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0__.isValidDirectoryPath)(a)))return n();"/"===a&&(a=null);let i=[],o=[];function s(e){let t=e;if(a){if(!e.startsWith(a))return;t=e.slice(a.length,e.length)}if(!r||t.includes(r))if(t.includes("/")){const e=Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0__.getFirstParentDirectory)(t);if(r&&!e.includes(r))return;o.includes(e)||o.push(e)}else i.push(t)}const l=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer();for(const e of l.programs)s(e);for(const e of l.scripts)s(e.filename);for(const e of l.textFiles)s(e.fn);for(const e of l.contracts)s(e.fn);for(const e of l.messages)e instanceof _Message_Message__WEBPACK_IMPORTED_MODULE_18__.Message?s(e.filename):s(e);i.sort(),o.sort();const c={color:"#0000FF"};for(const e of o)Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postContent)(e,c);for(const e of i)Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postContent)(e)},executeMemCommand:function(e){try{if(2!==e.length&&4!==e.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of mem command. usage: mem [scriptname] [-t] [number threads]");_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer();const t=e[1];let n=1;if(4===e.length&&"-t"===e[2]&&(n=Math.round(parseInt(e[3])),isNaN(n)||n<1))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Invalid number of threads specified. Number of threads must be greater than 1");const r=Terminal.getScript(t);if(null==r)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("No such script exists!");const a=r.ramUsage*n;Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`This script requires ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(a,"0.00")} GB of RAM to run for ${n} thread(s)`)}catch(e){Terminal.postThrownError(e)}},executeNanoCommand:function(e){if(2===e.length)try{const t=e[1];if(".fconf"===t){let e=Object(_Fconf_Fconf__WEBPACK_IMPORTED_MODULE_12__.a)();return void _engine__WEBPACK_IMPORTED_MODULE_11__.Engine.loadScriptEditorContent(t,e)}if(Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(t)){const e=Terminal.getFilepath(t),n=Terminal.getScript(t);if(null==n){let n="";t.endsWith(".ns")&&(n="export async function main(ns) {\n \n}"),_engine__WEBPACK_IMPORTED_MODULE_11__.Engine.loadScriptEditorContent(e,n)}else _engine__WEBPACK_IMPORTED_MODULE_11__.Engine.loadScriptEditorContent(e,n.code)}else{if(!t.endsWith(".txt"))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Invalid file. Only scripts (.script, .ns, .js), text files (.txt), or .fconf can be edited with nano");{const e=Terminal.getFilepath(t),n=Terminal.getTextFile(t);null==n?_engine__WEBPACK_IMPORTED_MODULE_11__.Engine.loadScriptEditorContent(e):_engine__WEBPACK_IMPORTED_MODULE_11__.Engine.loadScriptEditorContent(e,n.text)}}}catch(e){Terminal.postThrownError(e)}else Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of nano command. Usage: nano [scriptname]")},executeScanCommand:function(e){if(1!==e.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of netstat/scan command. Usage: netstat/scan");const t=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer();Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Hostname IP Root Access");for(let e=0;e<t.serversOnNetwork.length;e++){let n=Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.getServerOnNetwork)(t,e);if(null==n)continue;let r,a=21-(n=n.hostname).length,i=Array(a+1).join(" ");n+=i,n+=Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.getServerOnNetwork)(t,e).ip,r=Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.getServerOnNetwork)(t,e).hasAdminRights?"Y":"N",a=21-Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.getServerOnNetwork)(t,e).ip.length,n+=i=Array(a+1).join(" "),n+=r,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(n)}},executeScanAnalyzeCommand:function(e=1,t=!1){Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("~~~~~~~~~~ Beginning scan-analyze ~~~~~~~~~~"),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(" ");var n={};for(const e in _Server_AllServers__WEBPACK_IMPORTED_MODULE_29__.AllServers)n[e]=0;const r=[],a=[0],i=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer();for(r.push(i);0!=r.length;){const i=r.pop(),u=a.pop(),m=i instanceof _Hacknet_HacknetServer__WEBPACK_IMPORTED_MODULE_15__.HacknetServer;if((t||!i.purchasedByPlayer||"home"==i.hostname)&&(!(n[i.ip]||u>e)&&(t||!m))){n[i.ip]=1;for(var o=i.serversOnNetwork.length-1;o>=0;--o)r.push(Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.getServerOnNetwork)(i,o)),a.push(u+1);if(0!=u){var s=Array(4*(u-1)+1).join("-");_Player__WEBPACK_IMPORTED_MODULE_23__.Player.hasProgram(_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.AutoLink.name)?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("<strong>"+s+"> <a class='scan-analyze-link'>"+i.hostname+"</a></strong>",!1):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("<strong>"+s+">"+i.hostname+"</strong>");var l=s+"--",c="NO";i.hasAdminRights&&(c="YES"),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`${l}Root Access: ${c}${m?"":", Required hacking skill: "+i.requiredHackingSkill}`),m||Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(l+"Number of open ports required to NUKE: "+i.numOpenPortsRequired),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(l+"RAM: "+i.maxRam),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(" ")}}}var u=document.getElementsByClassName("scan-analyze-link");for(let e=0;e<u.length;++e)!function(){var t=u[e].innerHTML.toString();u[e].onclick=function(){Terminal.analyzeFlag||Terminal.hackFlag||Terminal.connectToServer(t)}}()},executeScpCommand(e){try{if(3!==e.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Incorrect usage of scp command. Usage: scp [file] [destination hostname/ip]");const a=Terminal.getFilepath(e[1]);if(!a.endsWith(".lit")&&!Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(a)&&!a.endsWith(".txt"))return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("scp only works for scripts, text files (.txt), and literature files (.lit)");const i=Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.getServer)(e[2]);if(null==i)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(`Invalid destination. ${e[2]} not found`);i.ip;const o=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer();if(a.endsWith(".lit")){for(var t=!1,n=0;n<o.messages.length;++n)if(!(o.messages[n]instanceof _Message_Message__WEBPACK_IMPORTED_MODULE_18__.Message)&&o.messages[n]==a){t=!0;break}if(!t)return Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("No such file exists!");for(n=0;n<i.messages.length;++n)if(i.messages[n]===a)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(a+" copied over to "+i.hostname);return i.messages.push(a),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(a+" copied over to "+i.hostname)}if(a.endsWith(".txt")){var r;for(t=!1,n=0;n<o.textFiles.length;++n)if(o.textFiles[n].fn===a){t=!0,r=o.textFiles[n];break}if(!t)return Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("No such file exists!");let e=i.writeToTextFile(r.fn,r.text);return e.success?e.overwritten?(Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`WARNING: ${a} already exists on ${i.hostname} and will be overwriten`),void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`${a} overwritten on ${i.hostname}`)):void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`${a} copied over to ${i.hostname}`):void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("scp failed")}let s=null;for(let e=0;e<o.scripts.length;++e)if(a==o.scripts[e].filename){s=o.scripts[e];break}if(null==s)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("scp() failed. No such script exists");let l=i.writeToScriptFile(a,s.code);if(!l.success)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("scp failed");if(l.overwritten)return Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`WARNING: ${a} already exists on ${i.hostname} and will be overwritten`),void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`${a} overwritten on ${i.hostname}`);Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`${a} copied over to ${i.hostname}`)}catch(e){Terminal.postThrownError(e)}},runProgram:function(e){if(e.length<2)return;const t=e[1];_Player__WEBPACK_IMPORTED_MODULE_23__.Player.hasProgram(t)?Terminal.executeProgram(e):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("ERROR: No such executable on home computer (Only programs that exist on your home computer can be run)")},executeProgram:function(e){if(e.length<2)return;var t=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer();const n=e[1],r=e.slice(1),a={};a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.NukeProgram.name]=(e=>{if(!e.hasAdminRights)return e.openPortCount>=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().numOpenPortsRequired?(e.hasAdminRights=!0,void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("NUKE successful! Gained root access to "+_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer().hostname)):void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("NUKE unsuccessful. Not enough ports have been opened");Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("You already have root access to this computer. There is no reason to run NUKE.exe")}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.BruteSSHProgram.name]=(e=>{e.sshPortOpen?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("SSH Port (22) is already open!"):(e.sshPortOpen=!0,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Opened SSH Port(22)!"),e.openPortCount++)}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.FTPCrackProgram.name]=(e=>{e.ftpPortOpen?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("FTP Port (21) is already open!"):(e.ftpPortOpen=!0,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Opened FTP Port (21)!"),e.openPortCount++)}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.RelaySMTPProgram.name]=(e=>{e.smtpPortOpen?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("SMTP Port (25) is already open!"):(e.smtpPortOpen=!0,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Opened SMTP Port (25)!"),e.openPortCount++)}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.HTTPWormProgram.name]=(e=>{e.httpPortOpen?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("HTTP Port (80) is already open!"):(e.httpPortOpen=!0,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Opened HTTP Port (80)!"),e.openPortCount++)}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.SQLInjectProgram.name]=(e=>{e.sqlPortOpen?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("SQL Port (1433) is already open!"):(e.sqlPortOpen=!0,Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Opened SQL Port (1433)!"),e.openPortCount++)}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.ServerProfiler.name]=((e,t)=>{if(2!==t.length)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Must pass a server hostname or IP as an argument for ServerProfiler.exe");const n=Object(_Server_ServerHelpers__WEBPACK_IMPORTED_MODULE_31__.getServer)(t[1]);null!=n?(Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(n.hostname+":"),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Server base security level: "+n.baseDifficulty),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Server current security level: "+n.hackDifficulty),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Server growth rate: "+n.serverGrowth),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Netscript hack() execution time: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(Object(_Hacking__WEBPACK_IMPORTED_MODULE_14__.calculateHackingTime)(n),"0.0")+"s"),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Netscript grow() execution time: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(Object(_Hacking__WEBPACK_IMPORTED_MODULE_14__.calculateGrowTime)(n),"0.0")+"s"),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Netscript weaken() execution time: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(Object(_Hacking__WEBPACK_IMPORTED_MODULE_14__.calculateWeakenTime)(n),"0.0")+"s")):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Invalid server IP/hostname")}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.AutoLink.name]=(()=>{Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("This executable cannot be run."),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'."),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("When using scan-analyze, click on a server's hostname to connect to it.")}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.DeepscanV1.name]=(()=>{Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("This executable cannot be run."),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5.")}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.DeepscanV2.name]=(()=>{Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("This executable cannot be run."),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.")}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.Flight.name]=(()=>{const e=Math.round(30*_BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_5__.BitNodeMultipliers.DaedalusAugsRequirement);if(!(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.augmentations.length>=e&&_Player__WEBPACK_IMPORTED_MODULE_23__.Player.money.gt(1e11)&&(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.hacking_skill>=2500||_Player__WEBPACK_IMPORTED_MODULE_23__.Player.strength>=1500&&_Player__WEBPACK_IMPORTED_MODULE_23__.Player.defense>=1500&&_Player__WEBPACK_IMPORTED_MODULE_23__.Player.dexterity>=1500&&_Player__WEBPACK_IMPORTED_MODULE_23__.Player.agility>=1500)))return Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Augmentations: ${_Player__WEBPACK_IMPORTED_MODULE_23__.Player.augmentations.length} / ${e}`),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Money: ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.money.toNumber(),"($0.000a)")} / ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_37__.numeralWrapper.format(1e11,"($0.000a)")}`),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("One path below must be fulfilled..."),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("----------HACKING PATH----------"),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Hacking skill: ${_Player__WEBPACK_IMPORTED_MODULE_23__.Player.hacking_skill} / 2500`),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("----------COMBAT PATH----------"),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Strength: ${_Player__WEBPACK_IMPORTED_MODULE_23__.Player.strength} / 1500`),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Defense: ${_Player__WEBPACK_IMPORTED_MODULE_23__.Player.defense} / 1500`),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Dexterity: ${_Player__WEBPACK_IMPORTED_MODULE_23__.Player.dexterity} / 1500`),void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Agility: ${_Player__WEBPACK_IMPORTED_MODULE_23__.Player.agility} / 1500`);Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("We will contact you."),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("-- Daedalus --")}),a[_Programs_Programs__WEBPACK_IMPORTED_MODULE_8__.Programs.BitFlume.name]=(()=>{const e=Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_44__.yesNoBoxGetYesButton)(),t=Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_44__.yesNoBoxGetNoButton)();e.innerHTML="Travel to BitNode Nexus",t.innerHTML="Cancel",e.addEventListener("click",function(){return Object(_RedPill__WEBPACK_IMPORTED_MODULE_24__.a)(_Player__WEBPACK_IMPORTED_MODULE_23__.Player.bitNodeN,!0),Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_44__.yesNoBoxClose)()}),t.addEventListener("click",function(){return Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_44__.yesNoBoxClose)()}),Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_44__.yesNoBoxCreate)("WARNING: USING THIS PROGRAM WILL CAUSE YOU TO LOSE ALL OF YOUR PROGRESS ON THE CURRENT BITNODE.<br><br>Do you want to travel to the BitNode Nexus? This allows you to reset the current BitNode and select a new one.")}),a.hasOwnProperty(n)?a[n](t,r):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Invalid executable. Cannot be run")},getFilepath:function(e){const t=Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0__.evaluateFilePath)(e,Terminal.currDir);if(null==t)throw new Error(`Invalid file path specified: ${e}`);return Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0__.isInRootDirectory)(t)?Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_0__.removeLeadingSlash)(t):t},getFile:function(e){return Object(_Script_ScriptHelpersTS__WEBPACK_IMPORTED_MODULE_28__.isScriptFilename)(e)?Terminal.getScript(e):e.endsWith(".lit")?Terminal.getLitFile(e):e.endsWith(".txt")?Terminal.getTextFile(e):null},getLitFile:function(e){const t=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer(),n=Terminal.getFilepath(e);for(const e of t.messages)if("string"==typeof e&&n===e)return e;return null},getScript:function(e){const t=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer(),n=Terminal.getFilepath(e);for(const e of t.scripts)if(n===e.filename)return e;return null},getTextFile:function(e){const t=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer(),n=Terminal.getFilepath(e);for(const e of t.textFiles)if(n===e.fn)return e;return null},postThrownError:function(e){if(e instanceof Error){const t="Error: ",n=e.toString();n.startsWith(t)?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(n.slice(t.length)):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)(n)}},runScript:function(e){if(e.length<2)return void dialogBoxCreate(`Bug encountered with Terminal.runScript(). Command array has a length of less than 2: ${e}`);const t=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer();let n=1;const r=[],a=Terminal.getFilepath(e[1]);if(e.length>2)if(e.length>=4&&"-t"==e[2]){if(n=Math.round(parseFloat(e[3])),isNaN(n)||n<1)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Invalid number of threads specified. Number of threads must be greater than 0");for(let t=4;t<e.length;++t)r.push(e[t])}else for(let t=2;t<e.length;++t)r.push(e[t]);if(null==Object(_Script_ScriptHelpers__WEBPACK_IMPORTED_MODULE_27__.a)(a,r,t)){for(var i=0;i<t.scripts.length;i++)if(t.scripts[i].filename===a){var o=t.scripts[i],s=o.ramUsage*n,l=t.maxRam-t.ramUsed;if(0==t.hasAdminRights)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Need root access to run script");if(s>l)return void Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("This machine does not have enough RAM to run this script with "+n+" threads. Script requires "+s+"GB of RAM");var c=new _Script_RunningScript__WEBPACK_IMPORTED_MODULE_25__.RunningScript(o,r);return c.threads=n,void(Object(_NetscriptWorker__WEBPACK_IMPORTED_MODULE_20__.e)(c,t)?Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Running script with "+n+" thread(s) and args: "+Object(_utils_helpers_arrayToString__WEBPACK_IMPORTED_MODULE_41__.arrayToString)(r)+"."):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.postError)("Failed to start script"))}Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("ERROR: No such script")}else Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("ERROR: This script is already running. Cannot run multiple instances")},runContract:async function(e){if(Terminal.contractOpen)return Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("ERROR: There's already a Coding Contract in Progress");const t=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.getCurrentServer(),n=t.getContract(e);if(null==n)return Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("ERROR: No such contract");switch(Terminal.contractOpen=!0,await n.prompt()){case _CodingContracts__WEBPACK_IMPORTED_MODULE_6__.CodingContractResult.Success:var r=_Player__WEBPACK_IMPORTED_MODULE_23__.Player.gainCodingContractReward(n.reward,n.getDifficulty());Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Contract SUCCESS - ${r}`),t.removeContract(n);break;case _CodingContracts__WEBPACK_IMPORTED_MODULE_6__.CodingContractResult.Failure:++n.tries,n.tries>=n.getMaxNumTries()?(Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Contract <p style='color:red;display:inline'>FAILED</p> - Contract is now self-destructing"),t.removeContract(n)):Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)(`Contract <p style='color:red;display:inline'>FAILED</p> - ${n.getMaxNumTries()-n.tries} tries remaining`);break;case _CodingContracts__WEBPACK_IMPORTED_MODULE_6__.CodingContractResult.Cancelled:default:Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_45__.post)("Contract cancelled")}Terminal.contractOpen=!1}}}).call(this,__webpack_require__(86))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScriptFilename=function(e){return e.endsWith(".js")||e.endsWith(".script")||e.endsWith(".ns")}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(1);const a=n.n(r).a.Component;class i extends a{corp(){return this.props.corp}eventHandler(){return this.props.eventHandler}routing(){return this.props.routing}render(){}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return T}),n.d(t,"f",function(){return P}),n.d(t,"e",function(){return S}),n.d(t,"b",function(){return O}),n.d(t,"c",function(){return A}),n.d(t,"d",function(){return R});var r=n(301),a=n(300),i=n(12),o=n(74),s=n(13),l=n(50),c=n(11),u=n(2),m=n(8),p=n(16),h=n(7),d=n(49),_=n(15),g=n(24),y=n(214),f=n(3),b=n(37),E=n(44),v=n(82),k=n(27);e(document).keydown(function(e){if(c.routing.isOn(c.Page.Gang)&&e.altKey){if(null!=D.gangMemberFilter&&D.gangMemberFilter===document.activeElement)return;e.keyCode===g.KEY[1]?"block"===D.gangTerritorySubpage.style.display&&D.managementButton.click():e.keyCode===g.KEY[2]&&"block"===D.gangManagementSubpage.style.display&&D.territoryButton.click()}}),e(document).mousedown(function(t){D.gangMemberUpgradeBoxOpened&&null==e(t.target).closest("#gang-member-upgrade-popup-box-content").get(0)&&(Object(v.removeElement)(D.gangMemberUpgradeBox),D.gangMemberUpgradeBox=null,D.gangMemberUpgradeBoxContent=null,D.gangMemberUpgradeBoxOpened=!1,D.gangMemberUpgradeBoxElements=null)});const C=["Slum Snakes","Tetrads","The Syndicate","The Dark Army","Speakers for the Dead","NiteSec","The Black Hand"];let T={"Slum Snakes":{power:1,territory:1/7},Tetrads:{power:1,territory:1/7},"The Syndicate":{power:1,territory:1/7},"The Dark Army":{power:1,territory:1/7},"Speakers for the Dead":{power:1,territory:1/7},NiteSec:{power:1,territory:1/7},"The Black Hand":{power:1,territory:1/7}};function P(){T={"Slum Snakes":{power:1,territory:1/7},Tetrads:{power:1,territory:1/7},"The Syndicate":{power:1,territory:1/7},"The Dark Army":{power:1,territory:1/7},"Speakers for the Dead":{power:1,territory:1/7},NiteSec:{power:1,territory:1/7},"The Black Hand":{power:1,territory:1/7}}}function S(e){T=JSON.parse(e,p.Reviver)}function O(e,t=!1){this.facName=e,this.members=[],this.wanted=1,this.respect=1,this.isHackingGang=t,this.respectGainRate=0,this.wantedGainRate=0,this.moneyGainRate=0,this.storedCycles=0,this.storedTerritoryAndPowerCycles=0,this.territoryClashChance=0,this.territoryWarfareEngaged=!1,this.notifyMemberDeath=!0}function M(e,t){const n=Math.max(1,1+Math.log(T[e].power/T[t].power)/Math.log(50));return Math.min(T[t].territory,1e-4*n*(Math.random()+.5))}function x(e){this.name=e,this.task="Unassigned",this.earnedRespect=0,this.hack=1,this.str=1,this.def=1,this.dex=1,this.agi=1,this.cha=1,this.hack_exp=0,this.str_exp=0,this.def_exp=0,this.dex_exp=0,this.agi_exp=0,this.cha_exp=0,this.hack_mult=1,this.str_mult=1,this.def_mult=1,this.dex_mult=1,this.agi_mult=1,this.cha_mult=1,this.hack_asc_mult=1,this.str_asc_mult=1,this.def_asc_mult=1,this.dex_asc_mult=1,this.agi_asc_mult=1,this.cha_asc_mult=1,this.upgrades=[],this.augmentations=[]}function w(e="",t="",n=!1,r=!1,a={baseRespect:0,baseWanted:0,baseMoney:0,hackWeight:0,strWeight:0,defWeight:0,dexWeight:0,agiWeight:0,chaWeight:0,difficulty:0}){this.name=e,this.desc=t,this.isHacking=n,this.isCombat=r,this.baseRespect=a.baseRespect?a.baseRespect:0,this.baseWanted=a.baseWanted?a.baseWanted:0,this.baseMoney=a.baseMoney?a.baseMoney:0,this.hackWeight=a.hackWeight?a.hackWeight:0,this.strWeight=a.strWeight?a.strWeight:0,this.defWeight=a.defWeight?a.defWeight:0,this.dexWeight=a.dexWeight?a.dexWeight:0,this.agiWeight=a.agiWeight?a.agiWeight:0,this.chaWeight=a.chaWeight?a.chaWeight:0,100!=Math.round(this.hackWeight+this.strWeight+this.defWeight+this.dexWeight+this.agiWeight+this.chaWeight)&&console.error(`GangMemberTask ${this.name} weights do not add up to 100`),this.difficulty=a.difficulty?a.difficulty:1,this.territory=a.territory?a.territory:{money:1,respect:1,wanted:1}}O.prototype.getPower=function(){return T[this.facName].power},O.prototype.getTerritory=function(){return T[this.facName].territory},O.prototype.process=function(e=1,t){const n=1e3/i.Engine._idleSpeed;if(isNaN(e)&&console.error(`NaN passed into Gang.process(): ${e}`),this.storedCycles+=e,this.storedCycles<2*n)return;const r=Math.min(this.storedCycles,5*n);try{this.processGains(r,t),this.processExperienceGains(r),this.processTerritoryAndPowerGains(r),this.storedCycles-=r}catch(e){Object(d.exceptionAlert)(`Exception caught when processing Gang: ${e}`)}},O.prototype.processGains=function(e=1,t){for(var n=0,r=0,a=0,i=0;i<this.members.length;++i)r+=this.members[i].calculateRespectGain(this),a+=this.members[i].calculateWantedLevelGain(this),n+=this.members[i].calculateMoneyGain(this);if(this.respectGainRate=r,this.wantedGainRate=a,this.moneyGainRate=n,"number"==typeof r){const n=r*e;this.respect+=n;const a=s.Factions[this.facName];if(a instanceof o.Faction){var l=1+a.favor/100;a.playerReputation+=t.faction_rep_mult*n*l/5}else Object(m.dialogBoxCreate)("ERROR: Could not get Faction associates with your gang. This is a bug, please report to game dev");for(let t=0;t<this.members.length;++t)this.members[t].recordEarnedRespect(e,this)}else console.warn("respectGains calculated to be NaN");if("number"==typeof a)if(1===this.wanted&&a<0);else{const t=this.wanted;let n=t+a*e;a<=0&&n>t&&(n=1),this.wanted=n,this.wanted<1&&(this.wanted=1)}else console.warn("ERROR: wantedLevelGains is NaN");"number"==typeof n?(t.gainMoney(n*e),t.recordMoneySource(n*e,"gang")):console.warn("ERROR: respectGains is NaN")},O.prototype.processTerritoryAndPowerGains=function(e=1){if(this.storedTerritoryAndPowerCycles+=e,this.storedTerritoryAndPowerCycles<100)return;this.storedTerritoryAndPowerCycles-=100;const t=this.facName;for(const e in T)if(T.hasOwnProperty(e))if(e==t)T[e].power+=this.calculatePower();else{const t=Math.random();if(t<.5){const t=.005*T[e].power;T[e].power+=Math.min(.85,t)}else{const n=.75*t*T[e].territory;T[e].power+=n}}this.territoryWarfareEngaged?this.territoryClashChance=1:this.territoryClashChance>0&&(this.territoryClashChance=Math.max(0,this.territoryClashChance-.01));for(let e=0;e<C.length;++e){const n=C.filter(t=>t!==C[e]),r=Object(_.getRandomInt)(0,n.length-1),a=C[e],i=n[r];if(!(a!==t&&i!==t||Math.random()<this.territoryClashChance))continue;const o=T[a].power,s=o/(o+T[i].power);if(Math.random()<s){if(T[i].territory<=0)return;const e=M(a,i);T[a].territory+=e,T[i].territory-=e,a===t?(this.clash(!0),T[i].power*=1/1.01):i===t?this.clash(!1):T[i].power*=1/1.01}else{if(T[a].territory<=0)return;const e=M(i,a);T[a].territory-=e,T[i].territory+=e,a===t?this.clash(!1):i===t?(this.clash(!0),T[a].power*=1/1.01):T[a].power*=1/1.01}}},O.prototype.canRecruitMember=function(){return!(this.members.length>=30)&&this.respect>=this.getRespectNeededToRecruitMember()},O.prototype.getRespectNeededToRecruitMember=function(){if(this.members.length<3)return 0;const e=this.members.length-2;return Math.round(.9*Math.pow(e,3)+Math.pow(e,2))},O.prototype.recruitMember=function(e){if(""===(e=String(e))||!this.canRecruitMember())return!1;if(this.members.filter(t=>t.name===e).length>=1)return!1;let t=new x(e);return this.members.push(t),c.routing.isOn(c.Page.Gang)&&(this.createGangMemberDisplayElement(t),this.updateGangContent()),!0},O.prototype.getWantedPenalty=function(){return this.respect/(this.respect+this.wanted)},O.prototype.processExperienceGains=function(e=1){for(var t=0;t<this.members.length;++t)this.members[t].gainExperience(e),this.members[t].updateSkillLevels()},O.prototype.calculatePower=function(){for(var e=0,t=0;t<this.members.length;++t)if(A.hasOwnProperty(this.members[t].task)&&"Territory Warfare"==this.members[t].task){e+=this.members[t].calculatePower()}return.015*this.getTerritory()*e},O.prototype.clash=function(e=!1){let t=.01;if(e&&(t/=2),e||(T[this.facName].power*=1/1.008),!(Math.random()<.65))for(let e=this.members.length-1;e>=0;--e){const n=this.members[e];if("Territory Warfare"!==n.task)continue;const r=t/Math.pow(n.def,.6);Math.random()<r&&this.killMember(n)}},O.prototype.killMember=function(e){this.facName;const t=this.respect,n=.05*t+e.earnedRespect;this.respect=Math.max(0,t-n);for(let t=0;t<this.members.length;++t)if(e.name===this.members[t].name){this.members.splice(t,1);break}this.notifyMemberDeath&&Object(m.dialogBoxCreate)(`${e.name} was killed in a gang clash! You lost ${n} respect`),c.routing.isOn(c.Page.Gang)&&this.displayGangMemberList()},O.prototype.ascendMember=function(e,t){try{const n=e.ascend();return this.respect=Math.max(1,this.respect-n.respect),null==t?Object(m.dialogBoxCreate)([`You ascended ${e.name}!`,"",`Your gang lost ${u.numeralWrapper.format(n.respect,"0.000a")} respect`,"",`${e.name} gained the following stat multipliers for ascending:`,`Hacking: ${u.numeralWrapper.format(n.hack,"0.000%")}`,`Strength: ${u.numeralWrapper.format(n.str,"0.000%")}`,`Defense: ${u.numeralWrapper.format(n.def,"0.000%")}`,`Dexterity: ${u.numeralWrapper.format(n.dex,"0.000%")}`,`Agility: ${u.numeralWrapper.format(n.agi,"0.000%")}`,`Charisma: ${u.numeralWrapper.format(n.cha,"0.000%")}`].join("<br>")):t.log(`Ascended Gang member ${e.name}`),c.routing.isOn(c.Page.Gang)&&this.displayGangMemberList(),n}catch(e){if(null!=t)throw e;Object(d.exceptionAlert)(e)}},O.prototype.getDiscount=function(){const e=this.getPower(),t=this.respect,n=Math.pow(t,.01)+t/5e6+Math.pow(e,.01)+e/1e6-1;return Math.max(1,n)},O.prototype.getAllTaskNames=function(){let e=[];const t=Object.keys(A);return e=this.isHackingGang?t.filter(e=>{let t=A[e];return null!=t&&("Unassigned"!==e&&t.isHacking)}):t.filter(e=>{let t=A[e];return null!=t&&("Unassigned"!==e&&t.isCombat)})},O.prototype.getAllUpgradeNames=function(){return Object.keys(R)},O.prototype.getUpgradeCost=function(e){return null==R[e]?1/0:R[e].getCost(this)},O.prototype.getUpgradeType=function(e){const t=R[e];if(null==t)return"";switch(t.type){case"w":return"Weapon";case"a":return"Armor";case"v":return"Vehicle";case"r":return"Rootkit";case"g":return"Augmentation";default:return""}},O.prototype.toJSON=function(){return Object(p.Generic_toJSON)("Gang",this)},O.fromJSON=function(e){return Object(p.Generic_fromJSON)(O,e.data)},p.Reviver.constructors.Gang=O,x.prototype.calculateSkill=function(e,t=1){return Math.max(Math.floor(t*(32*Math.log(e+534.5)-200)),1)},x.prototype.updateSkillLevels=function(){this.hack=this.calculateSkill(this.hack_exp,this.hack_mult*this.hack_asc_mult),this.str=this.calculateSkill(this.str_exp,this.str_mult*this.str_asc_mult),this.def=this.calculateSkill(this.def_exp,this.def_mult*this.def_asc_mult),this.dex=this.calculateSkill(this.dex_exp,this.dex_mult*this.dex_asc_mult),this.agi=this.calculateSkill(this.agi_exp,this.agi_mult*this.agi_asc_mult),this.cha=this.calculateSkill(this.cha_exp,this.cha_mult*this.cha_asc_mult)},x.prototype.calculatePower=function(){return(this.hack+this.str+this.def+this.dex+this.agi+this.cha)/95},x.prototype.assignToTask=function(e){return A.hasOwnProperty(e)?(this.task=e,!0):(this.task="Unassigned",!1)},x.prototype.unassignFromTask=function(){this.task="Unassigned"},x.prototype.getTask=function(){return this.task instanceof w&&(this.task=this.task.name),A.hasOwnProperty(this.task)?A[this.task]:A.Unassigned},x.prototype.calculateRespectGain=function(e){const t=this.getTask();if(null==t||!(t instanceof w)||0===t.baseRespect)return 0;var n=t.hackWeight/100*this.hack+t.strWeight/100*this.str+t.defWeight/100*this.def+t.dexWeight/100*this.dex+t.agiWeight/100*this.agi+t.chaWeight/100*this.cha;if((n-=4*t.difficulty)<=0)return 0;const r=Math.pow(100*T[e.facName].territory,t.territory.respect)/100;if(isNaN(r)||r<=0)return 0;var a=e.getWantedPenalty();return 11*t.baseRespect*n*r*a},x.prototype.calculateWantedLevelGain=function(e){const t=this.getTask();if(null==t||!(t instanceof w)||0===t.baseWanted)return 0;let n=t.hackWeight/100*this.hack+t.strWeight/100*this.str+t.defWeight/100*this.def+t.dexWeight/100*this.dex+t.agiWeight/100*this.agi+t.chaWeight/100*this.cha;if((n-=3.5*t.difficulty)<=0)return 0;const r=Math.pow(100*T[e.facName].territory,t.territory.wanted)/100;if(isNaN(r)||r<=0)return 0;if(t.baseWanted<0)return.4*t.baseWanted*n*r;{const e=7*t.baseWanted/Math.pow(3*n*r,.8);return Math.min(100,e)}},x.prototype.calculateMoneyGain=function(e){const t=this.getTask();if(null==t||!(t instanceof w)||0===t.baseMoney)return 0;var n=t.hackWeight/100*this.hack+t.strWeight/100*this.str+t.defWeight/100*this.def+t.dexWeight/100*this.dex+t.agiWeight/100*this.agi+t.chaWeight/100*this.cha;if((n-=3.2*t.difficulty)<=0)return 0;const r=Math.pow(100*T[e.facName].territory,t.territory.money)/100;if(isNaN(r)||r<=0)return 0;var a=e.getWantedPenalty();return 5*t.baseMoney*n*r*a},x.prototype.gainExperience=function(e=1){const t=this.getTask();if(null==t||!(t instanceof w)||t===A.Unassigned)return;const n=Math.pow(t.difficulty,.9)*e;this.hack_exp+=t.hackWeight/1500*n,this.str_exp+=t.strWeight/1500*n,this.def_exp+=t.defWeight/1500*n,this.dex_exp+=t.dexWeight/1500*n,this.agi_exp+=t.agiWeight/1500*n,this.cha_exp+=t.chaWeight/1500*n},x.prototype.recordEarnedRespect=function(e=1,t){this.earnedRespect+=this.calculateRespectGain(t)*e},x.prototype.ascend=function(){const e=this.getAscensionResults(),t=e.hack,n=e.str,r=e.def,a=e.dex,i=e.agi,o=e.cha;this.hack_asc_mult+=t,this.str_asc_mult+=n,this.def_asc_mult+=r,this.dex_asc_mult+=a,this.agi_asc_mult+=i,this.cha_asc_mult+=o,this.upgrades.length=0,this.hack_mult=1,this.str_mult=1,this.def_mult=1,this.dex_mult=1,this.agi_mult=1,this.cha_mult=1;for(let e=0;e<this.augmentations.length;++e){R[this.augmentations[e]].apply(this)}this.hack_exp=0,this.str_exp=0,this.def_exp=0,this.dex_exp=0,this.agi_exp=0,this.cha_exp=0,this.updateSkillLevels();const s=this.earnedRespect;return this.earnedRespect=0,{respect:s,hack:t,str:n,def:r,dex:a,agi:i,cha:o}},x.prototype.getAscensionEfficiency=function(){function e(e){return 1/(1+Math.log(e)/Math.log(10))}return{hack:e(this.hack_asc_mult),str:e(this.str_asc_mult),def:e(this.def_asc_mult),dex:e(this.dex_asc_mult),agi:e(this.agi_asc_mult),cha:e(this.cha_asc_mult)}},x.prototype.getAscensionResults=function(){let e=1,t=1,n=1,r=1,a=1,i=1;for(let o=0;o<this.upgrades.length;++o){let s=R[this.upgrades[o]];null!=s.mults.hack&&(e*=s.mults.hack),null!=s.mults.str&&(t*=s.mults.str),null!=s.mults.def&&(n*=s.mults.def),null!=s.mults.dex&&(r*=s.mults.dex),null!=s.mults.agi&&(a*=s.mults.agi),null!=s.mults.cha&&(i*=s.mults.cha)}const o=this.getAscensionEfficiency();return{hack:.15*Math.max(0,e-1)*o.hack,str:.15*Math.max(0,t-1)*o.str,def:.15*Math.max(0,n-1)*o.def,dex:.15*Math.max(0,r-1)*o.dex,agi:.15*Math.max(0,a-1)*o.agi,cha:.15*Math.max(0,i-1)*o.cha}},x.prototype.buyUpgrade=function(e,t,n){if("string"==typeof e&&(e=R[e]),!(e instanceof N))return!1;if(this.augmentations.includes(e.name)||this.upgrades.includes(e.name))return!1;if(t.money.lt(e.getCost(n)))return!1;if(t.loseMoney(e.getCost(n)),"g"===e.type?this.augmentations.push(e.name):this.upgrades.push(e.name),e.apply(this),c.routing.isOn(c.Page.Gang)&&D.gangMemberUpgradeBoxOpened){var r=D.gangMemberUpgradeBoxFilter.value.toString();n.createGangMemberUpgradeBox(t,r)}return!0},x.prototype.toJSON=function(){return Object(p.Generic_toJSON)("GangMember",this)},x.fromJSON=function(e){return Object(p.Generic_fromJSON)(x,e.data)},p.Reviver.constructors.GangMember=x,w.prototype.toJSON=function(){return Object(p.Generic_toJSON)("GangMemberTask",this)},w.fromJSON=function(e){return Object(p.Generic_fromJSON)(w,e.data)},p.Reviver.constructors.GangMemberTask=w;const A={};function N(e="",t=0,n="w",r={}){this.name=e,this.cost=t,this.type=n,this.mults=r,this.createDescription()}r.gangMemberTasksMetadata.forEach(e=>{!function(e,t,n,r,a){A[e]=new w(e,t,n,r,a)}(e.name,e.desc,e.isHacking,e.isCombat,e.params)}),N.prototype.getCost=function(e){const t=e.getDiscount();return this.cost/t},N.prototype.createDescription=function(){const e=["Increases:"];null!=this.mults.str&&e.push(`* Strength by ${Math.round(100*(this.mults.str-1))}%`),null!=this.mults.def&&e.push(`* Defense by ${Math.round(100*(this.mults.def-1))}%`),null!=this.mults.dex&&e.push(`* Dexterity by ${Math.round(100*(this.mults.dex-1))}%`),null!=this.mults.agi&&e.push(`* Agility by ${Math.round(100*(this.mults.agi-1))}%`),null!=this.mults.cha&&e.push(`* Charisma by ${Math.round(100*(this.mults.cha-1))}%`),null!=this.mults.hack&&e.push(`* Hacking by ${Math.round(100*(this.mults.hack-1))}%`),this.desc=e.join("<br>")},N.prototype.apply=function(e){null!=this.mults.str&&(e.str_mult*=this.mults.str),null!=this.mults.def&&(e.def_mult*=this.mults.def),null!=this.mults.dex&&(e.dex_mult*=this.mults.dex),null!=this.mults.agi&&(e.agi_mult*=this.mults.agi),null!=this.mults.cha&&(e.cha_mult*=this.mults.cha),null!=this.mults.hack&&(e.hack_mult*=this.mults.hack)},N.prototype.toJSON=function(){return Object(p.Generic_toJSON)("GangMemberUpgrade",this)},N.fromJSON=function(e){return Object(p.Generic_fromJSON)(N,e.data)},p.Reviver.constructors.GangMemberUpgrade=N;const R={};a.gangMemberUpgradesMetadata.forEach(e=>{!function(e,t,n,r){R[e]=new N(e,t,n,r)}(e.name,e.cost,e.upgType,e.mults)}),O.prototype.createGangMemberUpgradeBox=function(e,t=""){const n="gang-member-upgrade-popup-box";if(D.gangMemberUpgradeBoxOpened){if(null==D.gangMemberUpgradeBoxElements||null==D.gangMemberUpgradeBox||null==D.gangMemberUpgradeBoxContent)return void console.error("Refreshing Gang member upgrade box throws error because required elements are null");for(var r=2;r<D.gangMemberUpgradeBoxElements.length;++r)Object(v.removeElement)(D.gangMemberUpgradeBoxElements[r]);D.gangMemberUpgradeBoxElements=[D.gangMemberUpgradeBoxFilter,D.gangMemberUpgradeBoxDiscount];var a=D.gangMemberUpgradeBoxFilter.value.toString();for(r=0;r<this.members.length;++r)if(this.members[r].name.indexOf(a)>-1||this.members[r].task.indexOf(a)>-1){var i=this.members[r].createGangMemberUpgradePanel(this,e);D.gangMemberUpgradeBoxContent.appendChild(i),D.gangMemberUpgradeBoxElements.push(i)}}else{D.gangMemberUpgradeBoxFilter=Object(f.createElement)("input",{type:"text",placeholder:"Filter gang members",class:"text-input",value:t,onkeyup:()=>{var t=D.gangMemberUpgradeBoxFilter.value.toString();this.createGangMemberUpgradeBox(e,t)}}),D.gangMemberUpgradeBoxDiscount=Object(f.createElement)("p",{innerText:"Discount: -"+u.numeralWrapper.format(1-1/this.getDiscount(),"0.00%"),marginLeft:"6px",tooltip:"You get a discount on equipment and upgrades based on your gang's respect and power. More respect and power leads to more discounts."}),D.gangMemberUpgradeBoxElements=[D.gangMemberUpgradeBoxFilter,D.gangMemberUpgradeBoxDiscount];for(a=D.gangMemberUpgradeBoxFilter.value.toString(),r=0;r<this.members.length;++r)(this.members[r].name.indexOf(a)>-1||this.members[r].task.indexOf(a)>-1)&&D.gangMemberUpgradeBoxElements.push(this.members[r].createGangMemberUpgradePanel(this,e));D.gangMemberUpgradeBox=Object(b.createPopup)(n,D.gangMemberUpgradeBoxElements),D.gangMemberUpgradeBoxContent=document.getElementById(n+"-content"),D.gangMemberUpgradeBoxOpened=!0}},x.prototype.createGangMemberUpgradePanel=function(e,t){var n=Object(f.createElement)("div",{border:"1px solid white"}),r=Object(f.createElement)("h1",{innerText:this.name+" ("+this.task+")"});n.appendChild(r);var a=Object(f.createElement)("pre",{fontSize:"14px",display:"inline-block",width:"20%",innerText:"Hack: "+this.hack+" (x"+Object(h.formatNumber)(this.hack_mult*this.hack_asc_mult,2)+")\nStr: "+this.str+" (x"+Object(h.formatNumber)(this.str_mult*this.str_asc_mult,2)+")\nDef: "+this.def+" (x"+Object(h.formatNumber)(this.def_mult*this.def_asc_mult,2)+")\nDex: "+this.dex+" (x"+Object(h.formatNumber)(this.dex_mult*this.dex_asc_mult,2)+")\nAgi: "+this.agi+" (x"+Object(h.formatNumber)(this.agi_mult*this.agi_asc_mult,2)+")\nCha: "+this.cha+" (x"+Object(h.formatNumber)(this.cha_mult*this.cha_asc_mult,2)+")\n"});const i=[];function o(e){const t=R[e];null!=t?i.push(Object(f.createElement)("div",{class:"gang-owned-upgrade",innerText:e,tooltip:t.desc})):console.error(`Could not find GangMemberUpgrade object for name ${e}`)}for(const e of this.upgrades)o(e);for(const e of this.augmentations)o(e);var s=Object(f.createElement)("div",{class:"gang-owned-upgrades-div",innerText:"Purchased Upgrades:"});for(const e of i)s.appendChild(e);n.appendChild(a),n.appendChild(s),n.appendChild(Object(f.createElement)("br",{}));const l=[],c=[],m=[],p=[],d=[];for(let n in R)if(R.hasOwnProperty(n)){let r=R[n];if(t.money.lt(r.getCost(e)))continue;if(this.upgrades.includes(n)||this.augmentations.includes(n))continue;switch(r.type){case"w":l.push(r);break;case"a":c.push(r);break;case"v":m.push(r);break;case"r":p.push(r);break;case"g":d.push(r);break;default:console.error(`ERROR: Invalid Gang Member Upgrade Type: ${r.type}`)}}const _=Object(f.createElement)("div",{width:"20%",display:"inline-block"}),g=Object(f.createElement)("div",{width:"20%",display:"inline-block"}),y=Object(f.createElement)("div",{width:"20%",display:"inline-block"}),b=Object(f.createElement)("div",{width:"20%",display:"inline-block"}),E=Object(f.createElement)("div",{width:"20%",display:"inline-block"});_.appendChild(Object(f.createElement)("h2",{innerText:"Weapons"})),g.appendChild(Object(f.createElement)("h2",{innerText:"Armor"})),y.appendChild(Object(f.createElement)("h2",{innerText:"Vehicles"})),b.appendChild(Object(f.createElement)("h2",{innerText:"Rootkits"})),E.appendChild(Object(f.createElement)("h2",{innerText:"Augmentations"}));const v=[l,c,m,p,d],k=[_,g,y,b,E];for(let n=0;n<v.length;++n){let r=v[n],a=k[n];for(let i=0;i<r.length;++i){!function(n,r,a,i,o){let s={innerText:n.name+" - "+u.numeralWrapper.format(n.getCost(o),"$0.000a"),class:"a-link-button",margin:"2px",padding:"2px",display:"block",fontSize:"11px",clickListener:()=>(a.buyUpgrade(n,t,e),!1)};i>=3?s.tooltipleft=n.desc:s.tooltip=n.desc,r.appendChild(Object(f.createElement)("a",s))}(r[i],a,this,n,e)}}return n.appendChild(_),n.appendChild(g),n.appendChild(y),n.appendChild(b),n.appendChild(E),n};const D={gangContentCreated:!1,gangContainer:null,managementButton:null,territoryButton:null,gangManagementSubpage:null,gangTerritorySubpage:null,gangDesc:null,gangInfo:null,gangRecruitMemberButton:null,gangRecruitRequirementText:null,gangExpandAllButton:null,gangCollapseAllButton:null,gangMemberFilter:null,gangManageEquipmentButton:null,gangMemberList:null,gangMemberPanels:{},gangMemberUpgradeBoxOpened:!1,gangMemberUpgradeBox:null,gangMemberUpgradeBoxContent:null,gangMemberUpgradeBoxFilter:null,gangMemberUpgradeBoxDiscount:null,gangMemberUpgradeBoxElements:null,gangTerritoryDescText:null,gangTerritoryWarfareCheckbox:null,gangTerritoryWarfareCheckboxLabel:null,gangTerritoryWarfareClashChance:null,gangTerritoryDeathNotifyCheckbox:null,gangTerritoryDeathNotifyCheckboxLabel:null,gangTerritoryInfoText:null};O.prototype.displayGangContent=function(e){if(!D.gangContentCreated||null==D.gangContainer){D.gangContentCreated=!0,D.gangContainer=Object(f.createElement)("div",{id:"gang-container",class:"generic-menupage-container"});var t=this.facName;this.members,this.wanted,this.respect;D.gangContainer.appendChild(Object(f.createElement)("a",{class:"a-link-button",display:"inline-block",innerText:"Back",clickListener:()=>(i.Engine.loadFactionContent(),Object(l.displayFactionContent)(t),!1)})),D.managementButton=Object(f.createElement)("a",{id:"gang-management-subpage-button",class:"a-link-button-inactive",display:"inline-block",innerHTML:"Gang Management (Alt+1)",clickListener:()=>(D.gangManagementSubpage.style.display="block",D.gangTerritorySubpage.style.display="none",D.managementButton.classList.toggle("a-link-button-inactive"),D.managementButton.classList.toggle("a-link-button"),D.territoryButton.classList.toggle("a-link-button-inactive"),D.territoryButton.classList.toggle("a-link-button"),this.updateGangContent(),!1)}),D.territoryButton=Object(f.createElement)("a",{id:"gang-territory-subpage-button",class:"a-link-button",display:"inline-block",innerHTML:"Gang Territory (Alt+2)",clickListener:()=>(D.gangManagementSubpage.style.display="none",D.gangTerritorySubpage.style.display="block",D.managementButton.classList.toggle("a-link-button-inactive"),D.managementButton.classList.toggle("a-link-button"),D.territoryButton.classList.toggle("a-link-button-inactive"),D.territoryButton.classList.toggle("a-link-button"),this.updateGangContent(),!1)}),D.gangContainer.appendChild(D.managementButton),D.gangContainer.appendChild(D.territoryButton),D.gangManagementSubpage=Object(f.createElement)("div",{display:"block",id:"gang-management-subpage"});var n="";n=this.isHackingGang?"Ethical Hacking":"Vigilante Justice",D.gangDesc=Object(f.createElement)("p",{width:"70%",innerHTML:"This page is used to manage your gang members and get an overview of your gang's stats.<br><br>If a gang member is not earning much money or respect, the task that you have assigned to that member might be too difficult. Consider training that member's stats or choosing an easier task. The tasks closer to the top of the dropdown list are generally easier. Alternatively, the gang member's low production might be due to the fact that your wanted level is too high. Consider assigning a few members to the '"+n+"' task to lower your wanted level. <br><br>Installing Augmentations does NOT reset your progress with your Gang. Furthermore, after installing Augmentations, you will automatically be a member of whatever Faction you created your gang with.<br><br>You can also manage your gang programmatically through Netscript using the Gang API"}),D.gangManagementSubpage.appendChild(D.gangDesc),D.gangInfo=Object(f.createElement)("p",{id:"gang-info",width:"70%"}),D.gangManagementSubpage.appendChild(D.gangInfo),D.gangRecruitMemberButton=Object(f.createElement)("a",{id:"gang-management-recruit-member-btn",class:"a-link-button-inactive",innerHTML:"Recruit Gang Member",display:"inline-block",margin:"10px",clickListener:()=>{const e="recruit-gang-member-popup";let t;const n=Object(f.createElement)("p",{innerText:"Please enter a name for your new Gang member:"}),r=Object(f.createElement)("br"),a=Object(f.createElement)("input",{onkeyup:e=>{e.keyCode===g.KEY.ENTER&&t.click()},placeholder:"Name must be unique",type:"text",class:"text-input"});t=Object(f.createElement)("a",{class:"std-button",clickListener:()=>{let t=a.value;return""===t?(Object(m.dialogBoxCreate)("You must enter a name for your Gang member!"),!1):this.canRecruitMember()?this.recruitMember(t)?(Object(k.removeElementById)(e),!1):(Object(m.dialogBoxCreate)("You already have a gang member with this name!"),!1):(Object(m.dialogBoxCreate)("You cannot recruit another Gang member!"),!1)},innerText:"Recruit Gang Member"});const i=Object(f.createElement)("a",{class:"std-button",clickListener:()=>(Object(k.removeElementById)(e),!1),innerText:"Cancel"});Object(b.createPopup)(e,[n,r,a,t,i]),a.focus()}}),D.gangManagementSubpage.appendChild(D.gangRecruitMemberButton),D.gangRecruitRequirementText=Object(f.createElement)("p",{color:"red",id:"gang-recruit-requirement-text",margin:"10px"}),D.gangManagementSubpage.appendChild(D.gangRecruitRequirementText),D.gangManagementSubpage.appendChild(Object(f.createElement)("br",{})),D.gangExpandAllButton=Object(f.createElement)("a",{class:"a-link-button",display:"inline-block",innerHTML:"Expand All",clickListener:()=>{for(var e=D.gangManagementSubpage.getElementsByClassName("accordion-header"),t=0;t<e.length;++t){var n=e[t];n.classList.contains("active")||n.click()}return!1}}),D.gangCollapseAllButton=Object(f.createElement)("a",{class:"a-link-button",display:"inline-block",innerHTML:"Collapse All",clickListener:()=>{for(var e=D.gangManagementSubpage.getElementsByClassName("accordion-header"),t=0;t<e.length;++t){var n=e[t];n.classList.contains("active")&&n.click()}return!1}}),D.gangMemberFilter=Object(f.createElement)("input",{type:"text",placeholder:"Filter gang members",margin:"5px",padding:"5px",class:"text-input",onkeyup:()=>{this.displayGangMemberList()}}),D.gangManageEquipmentButton=Object(f.createElement)("a",{class:"a-link-button",display:"inline-block",innerHTML:"Manage Equipment",clickListener:()=>{this.createGangMemberUpgradeBox(e)}}),D.gangManagementSubpage.appendChild(D.gangExpandAllButton),D.gangManagementSubpage.appendChild(D.gangCollapseAllButton),D.gangManagementSubpage.appendChild(D.gangMemberFilter),D.gangManagementSubpage.appendChild(D.gangManageEquipmentButton),D.gangMemberList=Object(f.createElement)("ul",{id:"gang-member-list"}),this.displayGangMemberList(),D.gangManagementSubpage.appendChild(D.gangMemberList),D.gangTerritorySubpage=Object(f.createElement)("div",{id:"gang-territory-subpage",display:"none"}),D.gangTerritoryDescText=Object(f.createElement)("p",{width:"70%",innerHTML:"This page shows how much territory your Gang controls. This statistic is listed as a percentage, which represents how much of the total territory you control.<br><br>Every ~20 seconds, your gang has a chance to 'clash' with other gangs. Your chance to win a clash depends on your gang's power, which is listed in the display below. Your gang's power slowly accumulates over time. The accumulation rate is determined by the stats of all Gang members you have assigned to the 'Territory Warfare' task. Gang members that are not assigned to this task do not contribute to your gang's power. Your gang also loses a small amount of power whenever you lose a clash<br><br>NOTE: Gang members assigned to 'Territory Warfare' can be killed during clashes. This can happen regardless of whether you win or lose the clash. A gang member being killed results in both respect and power loss for your gang.<br><br>The amount of territory you have affects all aspects of your Gang members' production, including money, respect, and wanted level. It is very beneficial to have high territory control.<br><br>"}),D.gangTerritorySubpage.appendChild(D.gangTerritoryDescText),D.gangTerritoryWarfareCheckbox=Object(f.createElement)("input",{display:"inline-block",id:"gang-management-territory-warfare-checkbox",changeListener:()=>{this.territoryWarfareEngaged=D.gangTerritoryWarfareCheckbox.checked},margin:"2px",type:"checkbox"}),D.gangTerritoryWarfareCheckbox.checked=this.territoryWarfareEngaged,D.gangTerritoryWarfareCheckboxLabel=Object(f.createElement)("label",{color:"white",display:"inline-block",for:"gang-management-territory-warfare-checkbox",innerText:"Engage in Territory Warfare",tooltip:"Engaging in Territory Warfare sets your clash chance to 100%. Disengaging will cause your clash chance to gradually decrease until it reaches 0%"}),D.gangTerritorySubpage.appendChild(D.gangTerritoryWarfareCheckbox),D.gangTerritorySubpage.appendChild(D.gangTerritoryWarfareCheckboxLabel),D.gangTerritorySubpage.appendChild(Object(f.createElement)("br")),D.gangTerritoryWarfareClashChance=Object(f.createElement)("p",{display:"inline-block"}),D.gangTerritorySubpage.appendChild(D.gangTerritoryWarfareClashChance),D.gangTerritorySubpage.appendChild(Object(f.createElement)("div",{class:"help-tip",display:"inline-block",innerText:"?",clickListener:()=>{Object(m.dialogBoxCreate)("This percentage represents the chance you have of 'clashing' with with another gang. If you do not wish to gain/lose territory, then keep this percentage at 0% by not engaging in territory warfare.")}})),D.gangTerritoryDeathNotifyCheckbox=Object(f.createElement)("input",{display:"inline-block",id:"gang-management-notify-member-death-checkbox",changeListener:()=>{this.notifyMemberDeath=D.gangTerritoryDeathNotifyCheckbox.checked},margin:"2px",type:"checkbox"}),D.gangTerritoryDeathNotifyCheckbox.checked=this.notifyMemberDeath,D.gangTerritoryDeathNotifyCheckboxLabel=Object(f.createElement)("label",{color:"white",display:"inline-block",for:"gang-management-notify-member-death-checkbox",innerText:"Notify about Gang Member Deaths",tooltip:"If this is enabled, then you will receive a pop-up notifying you whenever one of your Gang Members dies in a territory clash."}),D.gangTerritorySubpage.appendChild(Object(f.createElement)("br")),D.gangTerritorySubpage.appendChild(D.gangTerritoryDeathNotifyCheckbox),D.gangTerritorySubpage.appendChild(D.gangTerritoryDeathNotifyCheckboxLabel),D.gangTerritorySubpage.appendChild(Object(f.createElement)("br"));var r=Object(f.createElement)("fieldset",{display:"block",margin:"6px",width:"50%"});D.gangTerritoryInfoText=Object(f.createElement)("p"),r.appendChild(D.gangTerritoryInfoText),D.gangTerritorySubpage.appendChild(r),D.gangContainer.appendChild(D.gangTerritorySubpage),D.gangContainer.appendChild(D.gangManagementSubpage),document.getElementById("entire-game-container").appendChild(D.gangContainer)}D.gangContainer.style.display="block",this.updateGangContent()},O.prototype.displayGangMemberList=function(){Object(E.removeChildrenFromElement)(D.gangMemberList),D.gangMemberPanels={};const e=this.members,t=D.gangMemberFilter.value.toString();for(var n=0;n<e.length;++n)(e[n].name.indexOf(t)>-1||e[n].task.indexOf(t)>-1)&&this.createGangMemberDisplayElement(e[n])},O.prototype.updateGangContent=function(){if(D.gangContentCreated)if(D.gangMemberUpgradeBoxOpened&&(D.gangMemberUpgradeBoxDiscount.childNodes[0].nodeValue="Discount: -"+u.numeralWrapper.format(1-1/this.getDiscount(),"0.00%")),"block"===D.gangTerritorySubpage.style.display){D.gangTerritoryWarfareClashChance.innerText=`Territory Clash Chance: ${u.numeralWrapper.format(this.territoryClashChance,"0.000%")}`,D.gangTerritoryWarfareCheckbox.checked=this.territoryWarfareEngaged,D.gangTerritoryInfoText.innerHTML="";const e=T[this.facName].power;let t=Object.keys(T).filter(e=>e!=this.facName);t.unshift(this.facName);for(const n of t)if(T.hasOwnProperty(n)){const t=T[n];let r,a=100*t.territory;if(r=a<=0?Object(h.formatNumber)(0,2):a>=100?Object(h.formatNumber)(100,2):Object(h.formatNumber)(a,2),n===this.facName){let e=`<b><u>${n}</u></b><br>Power: ${Object(h.formatNumber)(t.power,6)}<br>`;e+=`Territory: ${r}%<br><br>`,D.gangTerritoryInfoText.innerHTML+=e}else{const a=e/(t.power+e);let i=`<u>${n}</u><br>Power: ${Object(h.formatNumber)(t.power,6)}<br>`;i+=`Territory: ${r}%<br>`,i+=`Chance to win clash with this gang: ${u.numeralWrapper.format(a,"0.000%")}<br><br>`,D.gangTerritoryInfoText.innerHTML+=i}}}else{if(D.gangInfo instanceof Element){var e,t=s.Factions[this.facName];e=t instanceof o.Faction?t.playerReputation:"ERROR",Object(E.removeChildrenFromElement)(D.gangInfo),D.gangInfo.appendChild(Object(f.createElement)("p",{display:"inline-block",innerText:"Respect: "+u.numeralWrapper.format(this.respect,"0.00000a")+" ("+u.numeralWrapper.format(5*this.respectGainRate,"0.00000a")+" / sec)",tooltip:"Represents the amount of respect your gang has from other gangs and criminal organizations. Your respect affects the amount of money your gang members will earn, and also determines how much reputation you are earning with your gang's corresponding Faction."})),D.gangInfo.appendChild(Object(f.createElement)("br")),D.gangInfo.appendChild(Object(f.createElement)("p",{display:"inline-block",innerText:"Wanted Level: "+u.numeralWrapper.format(this.wanted,"0.00000a")+" ("+u.numeralWrapper.format(5*this.wantedGainRate,"0.00000a")+" / sec)",tooltip:"Represents how much the gang is wanted by law enforcement. The higher your gang's wanted level, the harder it will be for your gang members to make money and earn respect. Note that the minimum wanted level is 1."})),D.gangInfo.appendChild(Object(f.createElement)("br"));var n=this.getWantedPenalty();n=100*(1-n),D.gangInfo.appendChild(Object(f.createElement)("p",{display:"inline-block",innerText:`Wanted Level Penalty: -${Object(h.formatNumber)(n,2)}%`,tooltip:"Penalty for respect and money gain rates due to Wanted Level"})),D.gangInfo.appendChild(Object(f.createElement)("br")),D.gangInfo.appendChild(Object(f.createElement)("p",{display:"inline-block",innerText:`Money gain rate: ${u.numeralWrapper.format(5*this.moneyGainRate,"$0.000a")} / sec`})),D.gangInfo.appendChild(Object(f.createElement)("br"));var r=100*T[this.facName].territory;let a;a=r<=0?Object(h.formatNumber)(0,2):r>=100?Object(h.formatNumber)(100,2):Object(h.formatNumber)(r,2),D.gangInfo.appendChild(Object(f.createElement)("p",{display:"inline-block",innerText:`Territory: ${Object(h.formatNumber)(a,3)}%`,tooltip:"The percentage of total territory your Gang controls"})),D.gangInfo.appendChild(Object(f.createElement)("br")),D.gangInfo.appendChild(Object(f.createElement)("p",{display:"inline-block",innerText:"Faction reputation: "+u.numeralWrapper.format(e,"0.000a")})),D.gangInfo.appendChild(Object(f.createElement)("br"));const l=1e3/i.Engine._idleSpeed;this.storedCycles/l*1e3>5e3&&(D.gangInfo.appendChild(Object(f.createElement)("p",{innerText:`Bonus time: ${Object(h.convertTimeMsToTimeElapsedString)(this.storedCycles/l*1e3)}`,display:"inline-block",tooltip:"You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by the browser). Bonus time makes the Gang mechanic progress faster, up to 5x the normal speed"})),D.gangInfo.appendChild(Object(f.createElement)("br")))}else console.error("gang-info DOM element DNE");const a=this.members.length,l=this.getRespectNeededToRecruitMember(),c=D.gangRecruitMemberButton;a>=30?(c.className="a-link-button-inactive",D.gangRecruitRequirementText.style.display="inline-block",D.gangRecruitRequirementText.innerHTML="You have reached the maximum amount of gang members"):this.canRecruitMember()?(c.className="a-link-button",D.gangRecruitRequirementText.style.display="none"):(c.className="a-link-button-inactive",D.gangRecruitRequirementText.style.display="inline-block",D.gangRecruitRequirementText.innerHTML=`${Object(h.formatNumber)(l,2)} respect needed to recruit next member`);for(let e=0;e<this.members.length;++e)this.updateGangMemberDisplayElement(this.members[e])}},O.prototype.createGangMemberDisplayElement=function(e){if(!D.gangContentCreated)return;const t=e.name;D.gangMemberPanels[t]={};var n=Object(y.createAccordionElement)({id:t+"gang-member",hdrText:t});const r=n[0],a=(n[1],n[2]);D.gangMemberPanels[t].panel=a;const i=Object(f.createElement)("div",{class:"gang-member-info-div",id:t+"gang-member-stats",tooltipsmall:[`Hk: x${u.numeralWrapper.format(e.hack_mult*e.hack_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.hack_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.hack_asc_mult,"0,0.00")} Asc)`,`St: x${u.numeralWrapper.format(e.str_mult*e.str_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.str_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.str_asc_mult,"0,0.00")} Asc)`,`Df: x${u.numeralWrapper.format(e.def_mult*e.def_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.def_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.def_asc_mult,"0,0.00")} Asc)`,`Dx: x${u.numeralWrapper.format(e.dex_mult*e.dex_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.dex_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.dex_asc_mult,"0,0.00")} Asc)`,`Ag: x${u.numeralWrapper.format(e.agi_mult*e.agi_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.agi_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.agi_asc_mult,"0,0.00")} Asc)`,`Ch: x${u.numeralWrapper.format(e.cha_mult*e.cha_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.cha_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.cha_asc_mult,"0,0.00")} Asc)`].join("<br>")});D.gangMemberPanels[t].statsDiv=i;const o=Object(f.createElement)("pre",{display:"inline",id:t+"gang-member-stats-text"}),s=Object(f.createElement)("br"),l=Object(f.createElement)("button",{class:"accordion-button",innerText:"Ascend",clickListener:()=>{const t=`gang-management-ascend-member ${e.name}`,n=e.getAscensionResults(),r=Object(f.createElement)("pre",{innerText:["Are you sure you want to ascend this member? They will lose all of","their non-Augmentation upgrades and their stats will reset back to 1.","",`Furthermore, your gang will lose ${u.numeralWrapper.format(e.earnedRespect,"0.000a")} respect`,"","In return, they will gain the following permanent boost to stat multipliers:\n",`Hacking: +${u.numeralWrapper.format(n.hack,"0.00%")}`,`Strength: +${u.numeralWrapper.format(n.str,"0.00%")}`,`Defense: +${u.numeralWrapper.format(n.def,"0.00%")}`,`Dexterity: +${u.numeralWrapper.format(n.dex,"0.00%")}`,`Agility: +${u.numeralWrapper.format(n.agi,"0.00%")}`,`Charisma: +${u.numeralWrapper.format(n.cha,"0.00%")}`].join("\n")}),a=Object(f.createElement)("button",{class:"std-button",clickListener:()=>(this.ascendMember(e),this.updateGangMemberDisplayElement(e),Object(k.removeElementById)(t),!1),innerText:"Ascend"}),i=Object(f.createElement)("button",{class:"std-button",clickListener:()=>(Object(k.removeElementById)(t),!1),innerText:"Cancel"});Object(b.createPopup)(t,[r,a,i])}}),c=Object(f.createElement)("div",{class:"help-tip",clickListener:()=>{Object(m.dialogBoxCreate)(["Ascending a Gang Member resets the member's progress and stats in exchange","for a permanent boost to their stat multipliers.","<br><br>The additional stat multiplier that the Gang Member gains upon ascension","is based on the amount of multipliers the member has from non-Augmentation Equipment.","<br><br>Upon ascension, the member will lose all of its non-Augmentation Equipment and your","gang will lose respect equal to the total respect earned by the member."].join(" "))},innerText:"?",marginTop:"5px"});i.appendChild(o),i.appendChild(s),i.appendChild(l),i.appendChild(c);const p=Object(f.createElement)("div",{class:"gang-member-info-div",id:t+"gang-member-task"}),h=Object(f.createElement)("select",{class:"dropdown",id:t+"gang-member-task-selector"});let d=this.getAllTaskNames();d.unshift("---");for(var _=0;_<d.length;++_){var g=document.createElement("option");g.text=d[_],h.add(g)}if(h.addEventListener("change",()=>{var t=h.options[h.selectedIndex].text;e.assignToTask(t),this.setGangMemberTaskDescription(e,t),this.updateGangContent()}),A.hasOwnProperty(e.task)){var E=e.task,v=0;for(let e=0;e<d.length;++e)if(E===d[e]){v=e;break}h.selectedIndex=v}var C=Object(f.createElement)("p",{id:t+"gang-member-gain-info"});p.appendChild(h),p.appendChild(C);var T=Object(f.createElement)("div",{class:"gang-member-info-div",id:t+"gang-member-task-desc"}),P=Object(f.createElement)("p",{display:"inline",id:t+"gang-member-task-description"});T.appendChild(P),a.appendChild(i),a.appendChild(p),a.appendChild(T),D.gangMemberList.appendChild(r),this.setGangMemberTaskDescription(e,E),this.updateGangMemberDisplayElement(e)},O.prototype.updateGangMemberDisplayElement=function(e){if(!D.gangContentCreated)return;var t=e.name,n=document.getElementById(t+"gang-member-stats-text");n&&(n.innerText=[`Hacking: ${Object(h.formatNumber)(e.hack,0)} (${u.numeralWrapper.format(e.hack_exp,"(0.00a)")} exp)`,`Strength: ${Object(h.formatNumber)(e.str,0)} (${u.numeralWrapper.format(e.str_exp,"(0.00a)")} exp)`,`Defense: ${Object(h.formatNumber)(e.def,0)} (${u.numeralWrapper.format(e.def_exp,"(0.00a)")} exp)`,`Dexterity: ${Object(h.formatNumber)(e.dex,0)} (${u.numeralWrapper.format(e.dex_exp,"(0.00a)")} exp)`,`Agility: ${Object(h.formatNumber)(e.agi,0)} (${u.numeralWrapper.format(e.agi_exp,"(0.00a)")} exp)`,`Charisma: ${Object(h.formatNumber)(e.cha,0)} (${u.numeralWrapper.format(e.cha_exp,"(0.00a)")} exp)`].join("\n"));const r=D.gangMemberPanels[t];if(r){const t=r.statsDiv;t&&(t.firstChild.innerHTML=[`Hk: x${u.numeralWrapper.format(e.hack_mult*e.hack_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.hack_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.hack_asc_mult,"0,0.00")} Asc)`,`St: x${u.numeralWrapper.format(e.str_mult*e.str_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.str_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.str_asc_mult,"0,0.00")} Asc)`,`Df: x${u.numeralWrapper.format(e.def_mult*e.def_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.def_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.def_asc_mult,"0,0.00")} Asc)`,`Dx: x${u.numeralWrapper.format(e.dex_mult*e.dex_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.dex_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.dex_asc_mult,"0,0.00")} Asc)`,`Ag: x${u.numeralWrapper.format(e.agi_mult*e.agi_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.agi_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.agi_asc_mult,"0,0.00")} Asc)`,`Ch: x${u.numeralWrapper.format(e.cha_mult*e.cha_asc_mult,"0,0.00")}(x${u.numeralWrapper.format(e.cha_mult,"0,0.00")} Eq, x${u.numeralWrapper.format(e.cha_asc_mult,"0,0.00")} Asc)`].join("<br>"))}var a=document.getElementById(t+"gang-member-gain-info");a&&(a.innerHTML=[`Money: ${u.numeralWrapper.format(5*e.calculateMoneyGain(this),"$0.000a")} / sec`,`Respect: ${u.numeralWrapper.format(5*e.calculateRespectGain(this),"0.00000a")} / sec`,`Wanted Level: ${u.numeralWrapper.format(5*e.calculateWantedLevelGain(this),"0.00000a")} / sec`,`Total Respect Earned: ${u.numeralWrapper.format(e.earnedRespect,"0.00000a")}`].join("<br>"));const i=document.getElementById(t+"gang-member-task-selector");if(i){let t=this.getAllTaskNames();if(t.unshift("---"),A.hasOwnProperty(e.task)){const n=e.task;let r=0;for(let e=0;e<t.length;++e)if(n===t[e]){r=e;break}i.selectedIndex=r}}},O.prototype.setGangMemberTaskDescription=function(e,t){const n=e.name,r=document.getElementById(n+"gang-member-task-description");if(r){var a=A[t];null==a&&(a=A.Unassigned);var i=a.desc;r.innerHTML=i}},O.prototype.clearUI=function(){D.gangContainer instanceof Element&&Object(v.removeElement)(D.gangContainer),D.gangMemberUpgradeBox instanceof Element&&Object(v.removeElement)(D.gangMemberUpgradeBox);for(const e in D)D[e]=null;D.gangContentCreated=!1,D.gangMemberUpgradeBoxOpened=!1,D.gangMemberPanels={}}}).call(this,n(86))},function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return c});var r=n(65),a=(n(208),n(48)),i=n(20);function o(e,t){return new Promise(function(n,a){t.delay=Object(r.setTimeoutRef)(()=>{t.delay=null,n()},e),t.delayResolve=n})}function s(e,t,n=null){var r="";null!=n&&(r=" (Line "+function(e,t){var n=t.scriptRef.codeCode();try{return((n=n.substring(0,e.start)).match(/\n/g)||[]).length+1}catch(e){return-1}}(n,e)+")");const a=i.AllServers[e.serverIp];if(null==a)throw new Error(`WorkerScript constructed with invalid server ip: ${this.serverIp}`);return"|"+a.hostname+"|"+e.name+"|"+t+r}function l(e,t,n){const r=e.scriptRef.threads;if(!n)return isNaN(r)||r<1?1:r;const a=0|n;if(isNaN(n)||a<1)throw s(e,`Invalid thread count passed to ${t}: ${n}. Threads must be a positive number.`);if(n>r)throw s(e,`Too many threads requested by ${t}. Requested: ${n}. Has: ${r}.`);return a}function c(e){if(!Object(a.isString)(e))return!1;let t=e.split("|");if(4!=t.length)return!1;t[1];return!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5);function a(e){return t.GlobalAliases.hasOwnProperty(e)?t.GlobalAliases[e]:null}t.Aliases={},t.GlobalAliases={},t.loadAliases=function(e){t.Aliases=""===e?{}:JSON.parse(e)},t.loadGlobalAliases=function(e){t.GlobalAliases=""===e?{}:JSON.parse(e)},t.printAliases=function(){for(var e in t.Aliases)t.Aliases.hasOwnProperty(e)&&r.post("alias "+e+"="+t.Aliases[e]);for(var e in t.GlobalAliases)t.GlobalAliases.hasOwnProperty(e)&&r.post("global alias "+e+"="+t.GlobalAliases[e])},t.parseAliasDeclaration=function(e,n=!1){var r=e.match(/^([_|\w|!|%|,|@]+)="(.+)"$/);return null!=r&&3==r.length&&(n?function(e,n){e in t.Aliases&&delete t.Aliases[e],t.GlobalAliases[e]=n}(r[1],r[2]):function(e,n){e in t.GlobalAliases&&delete t.GlobalAliases[e],t.Aliases[e]=n}(r[1],r[2]),!0)},t.removeAlias=function(e){return t.Aliases.hasOwnProperty(e)?(delete t.Aliases[e],!0):!!t.GlobalAliases.hasOwnProperty(e)&&(delete t.GlobalAliases[e],!0)},t.substituteAliases=function(e){const n=e.split(" ");if(n.length>0){if("unalias"===n[0])return n.join(" ");null!=(i=function(e){return t.Aliases.hasOwnProperty(e)?t.Aliases[e]:null}(n[0]))?n[0]=i:null!=(i=a(n[0]))&&(n[0]=i);for(var r=0;r<n.length;++r){var i;null!=(i=a(n[r]))&&(n[r]=i)}}return n.join(" ")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTimeoutRef=window.setTimeout.bind(window)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(16);class a{constructor(e="",t=""){this.filename="",this.msg="",this.recvd=!1,this.filename=e,this.msg=t,this.recvd=!1}static fromJSON(e){return r.Generic_fromJSON(a,e.data)}toJSON(){return r.Generic_toJSON("Message",this)}}t.Message=a,r.Reviver.constructors.Message=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(121),a=n(89),i=n(105),o=n(119),s=n(20),l=n(154),c=n(158);function u(e,t=!0){const n=a.workerScripts.get(e);return n instanceof r.WorkerScript&&(m(n,t),!0)}function m(e,t=!0){e.env.stopFlag=!0,function(e){e instanceof r.WorkerScript&&e.delay&&(clearTimeout(e.delay),e.delayResolve&&e.delayResolve())}(e),function(e,t=!0){if(!(e instanceof r.WorkerScript))return console.error("Invalid argument passed into removeWorkerScript():"),void console.error(e);{const n=e.serverIp,r=e.name,o=s.AllServers[n];if(null==o)return void console.error(`Could not find server on which this script is running: ${n}`);o.ramUsed=c.roundToTwo(o.ramUsed-e.ramUsage),o.ramUsed<0&&(console.warn(`Server (${o.hostname}) RAM usage went negative (if it's due to floating pt imprecision, it's okay): ${o.ramUsed}`),o.ramUsed=0);for(let t=0;t<o.runningScripts.length;++t){const n=o.runningScripts[t];if(n.filename===r&&l.compareArrays(n.args,e.args)){o.runningScripts.splice(t,1);break}}const u=a.workerScripts.delete(e.pid);u||(console.warn("removeWorkerScript() called with WorkerScript that wasn't in the global map:"),console.warn(e)),t&&i.WorkerScriptStartStopEventEmitter.emitEvent()}}(e,t)}t.killWorkerScript=function(e,t,n){if(null!=n&&"boolean"==typeof n||(n=!0),e instanceof r.WorkerScript)return m(e),!0;if(e instanceof o.RunningScript&&"string"==typeof t){const r=u(e.pid,n);if(r)return r;for(const r of a.workerScripts.values())if(r.name==e.filename&&r.serverIp==t&&l.compareArrays(r.args,e.args))return m(r,n),!0;return!1}return"number"==typeof e?u(e,n):(console.error("killWorkerScript() called with invalid argument:"),console.error(e),!1)}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return g}),n.d(t,"e",function(){return _}),n.d(t,"d",function(){return b}),n.d(t,"c",function(){return v});var r=n(66),a=(n(14),n(10)),i=n(4),o=n(32),s=n(69),l=n(0),c=n(80),u=n(22),m=n(17),p=n(8),h=n(16);function d(e,t=!1){e.recvd=!0,!t&&m.Settings.SuppressMessages||_(e),function(e,t){var n=Object(u.GetServerByHostname)(t);if(null==n)return void console.warn(`Could not find server ${t}`);for(var r=0;r<n.messages.length;++r)if(n.messages[r].filename===e.filename)return;n.messages.push(e)}(e,"home")}function _(e){var t="Message received from unknown sender: <br><br><i>"+e.msg+"</i><br><br>This message was saved as "+e.filename+" onto your home computer.";Object(p.dialogBoxCreate)(t)}function g(){var e=f[E.Jumper0],t=f[E.Jumper1],n=f[E.Jumper2],r=f[E.Jumper3],u=f[E.Jumper4],m=f[E.CyberSecTest],h=f[E.NiteSecTest],_=f[E.BitRunnersTest],g=f[E.RedPill],y=!1;if(a.Augmentations[i.AugmentationNames.TheRedPill].owned&&(y=!0),g&&y&&0===l.Player.sourceFiles.length&&!c.b&&!s.c)p.dialogBoxOpened||d(g,!0);else if(g&&y)c.b||s.c||p.dialogBoxOpened||d(g);else if(e&&!e.recvd&&l.Player.hacking_skill>=25){d(e);const t=o.Programs.Flight.name,n=l.Player.getHomeComputer();n.programs.includes(t)||n.programs.push(t)}else t&&!t.recvd&&l.Player.hacking_skill>=40?d(t):m&&!m.recvd&&l.Player.hacking_skill>=50?d(m):n&&!n.recvd&&l.Player.hacking_skill>=175?d(n):h&&!h.recvd&&l.Player.hacking_skill>=200?d(h):r&&!r.recvd&&l.Player.hacking_skill>=350?d(r):u&&!u.recvd&&l.Player.hacking_skill>=490?d(u):_&&!_.recvd&&l.Player.hacking_skill>=500&&d(_)}function y(e){f[e.filename]=e}let f={};function b(e){f=JSON.parse(e,h.Reviver)}let E={Jumper0:"j0.msg",Jumper1:"j1.msg",Jumper2:"j2.msg",Jumper3:"j3.msg",Jumper4:"j4.msg",CyberSecTest:"csec-test.msg",NiteSecTest:"nitesec-test.msg",BitRunnersTest:"19dfj3l1nd.msg",RedPill:"icarus.msg"};function v(){f={},y(new r.Message(E.Jumper0,"I know you can sense it. I know you're searching for it. It's why you spend night after night at your computer. <br><br>It's real, I've seen it. And I can help you find it. But not right now. You're not ready yet.<br><br>Use this program to track your progress<br><br>The fl1ght.exe program was added to your home computer<br><br>-jump3R")),y(new r.Message(E.Jumper1,"Soon you will be contacted by a hacking group known as CyberSec. They can help you with your search. <br><br>You should join them, garner their favor, and exploit them for their Augmentations. But do not trust them. They are not what they seem. No one is.<br><br>-jump3R")),y(new r.Message(E.Jumper2,"Do not try to save the world. There is no world to save. If you want to find the truth, worry only about yourself. Ethics and morals will get you killed. <br><br>Watch out for a hacking group known as NiteSec.<br><br>-jump3R")),y(new r.Message(E.Jumper3,"You must learn to walk before you can run. And you must run before you can fly. Look for the black hand. <br><br>I.I.I.I <br><br>-jump3R")),y(new r.Message(E.Jumper4,"To find what you are searching for, you must understand the bits. The bits are all around us. The runners will help you.<br><br>-jump3R")),y(new r.Message(E.CyberSecTest,"We've been watching you. Your skills are very impressive. But you're wasting your talents. If you join us, you can put your skills to good use and change the world for the better. If you join us, we can unlock your full potential. <br><br>But first, you must pass our test. Find and hack our server using the Terminal. <br><br>-CyberSec")),y(new r.Message(E.NiteSecTest,"People say that the corrupted governments and corporations rule the world. Yes, maybe they do. But do you know who everyone really fears? People like us. Because they can't hide from us. Because they can't fight shadows and ideas with bullets. <br><br>Join us, and people will fear you, too. <br><br>Find and hack our hidden server using the Terminal. Then, we will contact you again.<br><br>-NiteSec")),y(new r.Message(E.BitRunnersTest,"We know what you are doing. We know what drives you. We know what you are looking for. <br><br> We can help you find the answers.<br><br>run4theh111z")),y(new r.Message(E.RedPill,"@)(#V%*N)@(#*)*C)@#%*)*V)@#(*%V@)(#VN%*)@#(*%<br>)@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)<br>@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB<br>DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)"))}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return T}),n.d(t,"c",function(){return d}),n.d(t,"d",function(){return g}),n.d(t,"b",function(){return _});var r=n(6),a=n(12),i=n(50),o=n(0),s=n(8),l=n(7),c=n(2),u=n(88),m=n(15),p=n(48),h=n(29);n(681);let d=!1,_=null;function g(e,t){d=e,_=e?t:null}e(document).keydown(function(e){if(d&&_&&0!=_.selectedNode.length)switch(e.keyCode){case 65:_.actionButtons[0].click();break;case 83:_.actionButtons[1].click();break;case 87:_.actionButtons[2].click();break;case 70:_.actionButtons[3].click();break;case 82:_.actionButtons[4].click();break;case 68:_.actionButtons[5].click()}});let y={Core:"CPU Core Node",Firewall:"Firewall Node",Database:"Database Node",Spam:"Spam Node",Transfer:"Transfer Node",Shield:"Shield Node"},f="Attacking",b="Scanning",E="Weakening",v="Fortifying",k="Overflowing";function C(e,t){this.type=e,this.atk=t.atk?t.atk:0,this.def=t.def?t.def:0,this.hp=t.hp?t.hp:0,this.maxhp=this.hp,this.plyrCtrl=!1,this.enmyCtrl=!1,this.pos=[0,0],this.el=null,this.action=null,this.targetedCount=0,this.conn=null}function T(e,t){this.faction=t,this.started=!1,this.time=18e4,this.playerCores=[],this.playerNodes=[],this.playerAtk=0,this.playerDef=0,this.enemyCores=[],this.enemyDatabases=[],this.enemyNodes=[],this.enemyAtk=0,this.enemyDef=0,this.miscNodes=[],this.selectedNode=[],this.actionButtons=[],this.availablePositions=[];for(var n=0;n<8;++n)for(var a=0;a<8;++a)this.availablePositions.push([n,a]);this.map=[];for(var i=0;i<8;++i)this.map.push([null,null,null,null,null,null,null,null]);this.jsplumbinstance=null,this.difficulty=e/r.CONSTANTS.HackingMissionRepToDiffConversion+1,this.reward=250+e/r.CONSTANTS.HackingMissionRepToRewardConversion}function P(e){e.selectedNode.length>0&&(e.selectedNode.forEach(function(t){t.deselect(e.actionButtons)}),e.selectedNode.length=0)}C.prototype.setPosition=function(e,t){this.pos=[e,t]},C.prototype.setControlledByPlayer=function(){this.plyrCtrl=!0,this.enmyCtrl=!1,this.el&&(this.el.classList.remove("hack-mission-enemy-node"),this.el.classList.add("hack-mission-player-node"))},C.prototype.setControlledByEnemy=function(){this.plyrCtrl=!1,this.enmyCtrl=!0,this.el&&(this.el.classList.remove("hack-mission-player-node"),this.el.classList.add("hack-mission-enemy-node"))},C.prototype.select=function(e){if(!this.enmyCtrl){this.el.classList.add("hack-mission-player-node-active");for(var t=0;t<e.length;++t)e[t].classList.remove("a-link-button"),e[t].classList.add("a-link-button-inactive");switch(this.type){case y.Core:for(t=0;t<e.length;++t)e[t].classList.remove("a-link-button-inactive"),e[t].classList.add("a-link-button");break;case y.Transfer:e[1].classList.remove("a-link-button-inactive"),e[1].classList.add("a-link-button"),e[2].classList.remove("a-link-button-inactive"),e[2].classList.add("a-link-button"),e[3].classList.remove("a-link-button-inactive"),e[3].classList.add("a-link-button"),e[4].classList.remove("a-link-button-inactive"),e[4].classList.add("a-link-button"),e[5].classList.remove("a-link-button-inactive"),e[5].classList.add("a-link-button");break;case y.Shield:case y.Firewall:e[3].classList.remove("a-link-button-inactive"),e[3].classList.add("a-link-button")}}},C.prototype.deselect=function(e){this.el.classList.remove("hack-mission-player-node-active");for(var t=0;t<e.length;++t)e[t].classList.remove("a-link-button"),e[t].classList.add("a-link-button-inactive")},C.prototype.untarget=function(){0!==this.targetedCount?--this.targetedCount:console.warn(`Node ${this.el.id} is being 'untargeted' when it has no target count`)},T.prototype.init=function(){this.createPageDom();for(var e=o.Player.getHomeComputer(),t=0;t<e.cpuCores;++t){var n={atk:o.Player.hacking_skill/7.5+30,def:o.Player.hacking_skill/20,hp:o.Player.hacking_skill/4};this.playerCores.push(new C(y.Core,n)),this.playerCores[t].setControlledByPlayer(),this.setNodePosition(this.playerCores[t],t,0),this.removeAvailablePosition(t,0)}var r=Math.min(8,Math.max(1,Math.round(this.difficulty/4))),a=Math.min(20,Object(m.getRandomInt)(Math.round(this.difficulty/3),Math.round(this.difficulty/3)+1)),i=Math.min(10,Object(m.getRandomInt)(1,Math.round(this.difficulty/3)+1)),s=r+a+i,l=7-Math.floor(s/8),c=Object(u.addOffset)(.8+this.difficulty/5,10);for(t=0;t<r;++t){n={atk:c*Object(m.getRandomInt)(80,86),def:c*Object(m.getRandomInt)(5,10),hp:c*Object(m.getRandomInt)(210,230)};this.enemyCores.push(new C(y.Core,n)),this.enemyCores[t].setControlledByEnemy(),this.setNodeRandomPosition(this.enemyCores[t],l)}for(t=0;t<a;++t){n={atk:0,def:c*Object(m.getRandomInt)(10,20),hp:c*Object(m.getRandomInt)(275,300)};this.enemyNodes.push(new C(y.Firewall,n)),this.enemyNodes[t].setControlledByEnemy(),this.setNodeRandomPosition(this.enemyNodes[t],l)}for(t=0;t<i;++t){n={atk:0,def:c*Object(m.getRandomInt)(30,55),hp:c*Object(m.getRandomInt)(210,275)};var p=new C(y.Database,n);p.setControlledByEnemy(),this.setNodeRandomPosition(p,l),this.enemyDatabases.push(p)}this.calculateDefenses(),this.calculateAttacks(),this.createMap()},T.prototype.createPageDom=function(){var e=document.getElementById("mission-container"),t=1+this.faction.favor/100,n=this.reward*o.Player.faction_rep_mult*t,a=document.createElement("p");a.innerHTML="You are about to start a hacking mission! You will gain "+c.numeralWrapper.format(n,"0.000a")+" faction reputation with "+this.faction.name+" if you win. Click the 'Start' button to begin.",a.style.display="block",a.classList.add("hack-mission-header-element"),a.style.width="80%";var i=document.createElement("a");i.innerText="How to Play",i.classList.add("a-link-button"),i.style.display="inline-block",i.classList.add("hack-mission-header-element"),i.addEventListener("click",function(){return Object(s.dialogBoxCreate)(r.CONSTANTS.HackingMissionHowToPlay),!1});var l=document.createElement("a");l.innerHTML="Start",l.setAttribute("id","hack-mission-start-btn"),l.classList.add("a-link-button"),l.classList.add("hack-mission-header-element"),l.style.display="inline-block",l.addEventListener("click",()=>(this.start(),!1));var u=document.createElement("a");u.innerHTML="Forfeit Mission (Exit)",u.classList.add("a-link-button"),u.classList.add("hack-mission-header-element"),u.style.display="inline-block",u.addEventListener("click",()=>(this.finishMission(!1),!1));var m=document.createElement("p");m.setAttribute("id","hacking-mission-timer"),m.style.display="inline-block",m.style.margin="6px";var p=document.createElement("span");p.style.display="block",p.classList.add("hack-mission-action-buttons-container");for(var h=0;h<6;++h)this.actionButtons.push(document.createElement("a")),this.actionButtons[h].style.display="inline-block",this.actionButtons[h].classList.add("a-link-button-inactive"),this.actionButtons[h].classList.add("tooltip"),this.actionButtons[h].classList.add("hack-mission-header-element"),p.appendChild(this.actionButtons[h]);this.actionButtons[0].innerText="Attack(a)";var d=document.createElement("span");d.classList.add("tooltiptexthigh"),d.innerText="Lowers the targeted node's HP. The effectiveness of this depends on this node's Attack level, your hacking level, and the opponent's defense level.",this.actionButtons[0].appendChild(d),this.actionButtons[1].innerText="Scan(s)";var _=document.createElement("span");_.classList.add("tooltiptexthigh"),_.innerText="Lowers the targeted node's defense. The effectiveness of this depends on this node's Attack level, your hacking level, and the opponent's defense level.",this.actionButtons[1].appendChild(_),this.actionButtons[2].innerText="Weaken(w)";var g=document.createElement("span");g.classList.add("tooltiptexthigh"),g.innerText="Lowers the targeted node's attack. The effectiveness of this depends on this node's Attack level, your hacking level, and the opponent's defense level.",this.actionButtons[2].appendChild(g),this.actionButtons[3].innerText="Fortify(f)";var C=document.createElement("span");C.classList.add("tooltiptexthigh"),C.innerText="Raises this node's Defense level. The effectiveness of this depends on your hacking level",this.actionButtons[3].appendChild(C),this.actionButtons[4].innerText="Overflow(r)";var T=document.createElement("span");T.classList.add("tooltiptexthigh"),T.innerText="Raises this node's Attack level but lowers its Defense level. The effectiveness of this depends on your hacking level.",this.actionButtons[4].appendChild(T),this.actionButtons[5].innerText="Drop Connection(d)";var P=document.createElement("span");P.classList.add("tooltiptexthigh"),P.innerText="Removes this Node's current connection to some target Node, if it has one. This can also be done by simply clicking the white connection line.",this.actionButtons[5].appendChild(P);var S=document.createElement("p"),O=document.createElement("p");S.style.display="inline-block",O.style.display="inline-block",S.style.color="#00ccff",O.style.color="red",S.style.margin="4px",O.style.margin="4px",S.setAttribute("id","hacking-mission-player-stats"),O.setAttribute("id","hacking-mission-enemy-stats"),p.appendChild(S),p.appendChild(O),this.actionButtons[0].addEventListener("click",()=>{this.selectedNode.length>0?this.selectedNode[0].type===y.Core&&(this.setActionButtonsActive(this.selectedNode[0].type),this.setActionButton(f,!1),this.selectedNode.forEach(function(e){e.action=f})):console.error("Pressing Action button without selected node")}),this.actionButtons[1].addEventListener("click",()=>{if(this.selectedNode.length>0){var e=this.selectedNode[0].type;e!==y.Core&&e!==y.Transfer||(this.setActionButtonsActive(e),this.setActionButton(b,!1),this.selectedNode.forEach(function(e){e.action=b}))}else console.error("Pressing Action button without selected node")}),this.actionButtons[2].addEventListener("click",()=>{if(this.selectedNode.length>0){var e=this.selectedNode[0].type;e!==y.Core&&e!==y.Transfer||(this.setActionButtonsActive(e),this.setActionButton(E,!1),this.selectedNode.forEach(function(e){e.action=E}))}else console.error("Pressing Action button without selected node")}),this.actionButtons[3].addEventListener("click",()=>{this.selectedNode.length>0?(this.setActionButtonsActive(this.selectedNode[0].type),this.setActionButton(v,!1),this.selectedNode.forEach(function(e){e.action=v})):console.error("Pressing Action button without selected node")}),this.actionButtons[4].addEventListener("click",()=>{if(this.selectedNode.length>0){var e=this.selectedNode[0].type;e!==y.Core&&e!==y.Transfer||(this.setActionButtonsActive(e),this.setActionButton(k,!1),this.selectedNode.forEach(function(e){e.action=k}))}else console.error("Pressing Action button without selected node")}),this.actionButtons[5].addEventListener("click",()=>{this.selectedNode.length>0?this.selectedNode.forEach(function(e){if(e.conn){var t=e.conn.endpoints;t[0].detachFrom(t[1])}e.action=v}):console.error("Pressing Action button without selected node")});var M=document.createElement("p");e.appendChild(a),e.appendChild(i),e.appendChild(l),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(M)},T.prototype.setActionButtonsInactive=function(){for(var e=0;e<this.actionButtons.length;++e)this.actionButtons[e].classList.remove("a-link-button"),this.actionButtons[e].classList.add("a-link-button-inactive")},T.prototype.setActionButtonsActive=function(e=null){for(var t=0;t<this.actionButtons.length;++t)this.actionButtons[t].classList.add("a-link-button"),this.actionButtons[t].classList.remove("a-link-button-inactive");if(e)switch(e){case y.Firewall:case y.Shield:this.actionButtons[0].classList.remove("a-link-button"),this.actionButtons[0].classList.add("a-link-button-inactive"),this.actionButtons[1].classList.remove("a-link-button"),this.actionButtons[1].classList.add("a-link-button-inactive"),this.actionButtons[2].classList.remove("a-link-button"),this.actionButtons[2].classList.add("a-link-button-inactive"),this.actionButtons[4].classList.remove("a-link-button"),this.actionButtons[4].classList.add("a-link-button-inactive"),this.actionButtons[5].classList.remove("a-link-button"),this.actionButtons[5].classList.add("a-link-button-inactive");break;case y.Transfer:this.actionButtons[0].classList.remove("a-link-button"),this.actionButtons[0].classList.add("a-link-button-inactive")}},T.prototype.setActionButton=function(e,t=!0){if(Object(p.isString)(e))switch(e){case f:e=0;break;case b:e=1;break;case E:e=2;break;case v:e=3;break;case k:default:e=4}t?(this.actionButtons[e].classList.remove("a-link-button-inactive"),this.actionButtons[e].classList.add("a-link-button")):(this.actionButtons[e].classList.remove("a-link-button"),this.actionButtons[e].classList.add("a-link-button-inactive"))},T.prototype.calculateAttacks=function(){for(var e=0,t=0;t<this.playerCores.length;++t)e+=this.playerCores[t].atk;for(t=0;t<this.playerNodes.length;++t)e+=this.playerNodes[t].atk;this.playerAtk=e,document.getElementById("hacking-mission-player-stats").innerHTML="Player Attack: "+Object(l.formatNumber)(this.playerAtk,1)+"<br>Player Defense: "+Object(l.formatNumber)(this.playerDef,1),e=0;for(t=0;t<this.enemyCores.length;++t)e+=this.enemyCores[t].atk;for(t=0;t<this.enemyDatabases.length;++t)e+=this.enemyDatabases[t].atk;for(t=0;t<this.enemyNodes.length;++t)e+=this.enemyNodes[t].atk;this.enemyAtk=e,document.getElementById("hacking-mission-enemy-stats").innerHTML="Enemy Attack: "+Object(l.formatNumber)(this.enemyAtk,1)+"<br>Enemy Defense: "+Object(l.formatNumber)(this.enemyDef,1)},T.prototype.calculateDefenses=function(){for(var e=0,t=0;t<this.playerCores.length;++t)e+=this.playerCores[t].def;for(t=0;t<this.playerNodes.length;++t)e+=this.playerNodes[t].def;this.playerDef=e,document.getElementById("hacking-mission-player-stats").innerHTML="Player Attack: "+Object(l.formatNumber)(this.playerAtk,1)+"<br>Player Defense: "+Object(l.formatNumber)(this.playerDef,1),e=0;for(t=0;t<this.enemyCores.length;++t)e+=this.enemyCores[t].def;for(t=0;t<this.enemyDatabases.length;++t)e+=this.enemyDatabases[t].def;for(t=0;t<this.enemyNodes.length;++t)e+=this.enemyNodes[t].def;this.enemyDef=e,document.getElementById("hacking-mission-enemy-stats").innerHTML="Enemy Attack: "+Object(l.formatNumber)(this.enemyAtk,1)+"<br>Enemy Defense: "+Object(l.formatNumber)(this.enemyDef,1)},T.prototype.removeAvailablePosition=function(e,t){for(var n=0;n<this.availablePositions.length;++n)if(this.availablePositions[n][0]===e&&this.availablePositions[n][1]===t)return void this.availablePositions.splice(n,1);console.warn(`removeAvailablePosition() did not remove ${e}, ${t}`)},T.prototype.setNodePosition=function(e,t,n){e instanceof C?isNaN(t)||isNaN(n)?console.error(`Invalid values (${t}, ${n}) passed as (x, y) for setNodePosition`):(e.pos=[t,n],this.map[t][n]=e):console.warn("Non-Node object passed into setNodePOsition")},T.prototype.setNodeRandomPosition=function(e,t=0){var n=Object(m.getRandomInt)(0,this.availablePositions.length-1);if(this.availablePositions[n][1]<t)return this.setNodeRandomPosition(e,t);var r=this.availablePositions.splice(n,1);r=r[0],this.setNodePosition(e,r[0],r[1])},T.prototype.createMap=function(){var e=document.createElement("div");e.classList.add("hack-mission-grid"),e.setAttribute("id","hacking-mission-map"),document.getElementById("mission-container").appendChild(e);for(var t=(this.playerAtk+this.enemyAtk)/2,n=0;n<8;++n)for(var r=0;r<8;++r)if(!(this.map[n][r]instanceof C)){var a,i=Object(m.getRandomInt)(0,2),o=Object(u.addOffset)(.85+this.difficulty/2,15);switch(i){case 0:var s={atk:0,def:1.1*t+Object(m.getRandomInt)(15,45),hp:o*Object(m.getRandomInt)(200,225)};a=new C(y.Spam,s);break;case 1:s={atk:0,def:1.1*t+Object(m.getRandomInt)(15,45),hp:o*Object(m.getRandomInt)(250,275)};a=new C(y.Transfer,s);break;case 2:default:s={atk:0,def:1.1*t+Object(m.getRandomInt)(30,70),hp:o*Object(m.getRandomInt)(300,320)};a=new C(y.Shield,s)}this.setNodePosition(a,n,r),this.removeAvailablePosition(n,r),this.miscNodes.push(a)}for(var l=0;l<8;++l)for(var c=0;c<8;++c)this.createNodeDomElement(this.map[l][c]);for(var p=0;p<this.playerCores.length;++p)this.configurePlayerNodeElement(this.playerCores[p].el)},T.prototype.createNodeDomElement=function(e){var t=document.createElement("a"),n=document.createElement("p");e.el=t;var r,a="hacking-mission-node-"+e.pos[0]+"-"+e.pos[1];switch(t.setAttribute("id",a),n.setAttribute("id",a+"-txt"),t.classList.add("hack-mission-node"),e.plyrCtrl?t.classList.add("hack-mission-player-node"):e.enmyCtrl&&t.classList.add("hack-mission-enemy-node"),e.type){case y.Core:r="CPU Core<br>HP: "+Object(l.formatNumber)(e.hp,1),t.classList.add("hack-mission-cpu-node");break;case y.Firewall:r="Firewall<br>HP: "+Object(l.formatNumber)(e.hp,1),t.classList.add("hack-mission-firewall-node");break;case y.Database:r="Database<br>HP: "+Object(l.formatNumber)(e.hp,1),t.classList.add("hack-mission-database-node");break;case y.Spam:r="Spam<br>HP: "+Object(l.formatNumber)(e.hp,1),t.classList.add("hack-mission-spam-node");break;case y.Transfer:r="Transfer<br>HP: "+Object(l.formatNumber)(e.hp,1),t.classList.add("hack-mission-transfer-node");break;case y.Shield:default:r="Shield<br>HP: "+Object(l.formatNumber)(e.hp,1),t.classList.add("hack-mission-shield-node")}r+="<br>Atk: "+Object(l.formatNumber)(e.atk,1)+"<br>Def: "+Object(l.formatNumber)(e.def,1),n.innerHTML=r,t.appendChild(n),document.getElementById("hacking-mission-map").appendChild(t)},T.prototype.updateNodeDomElement=function(e){if(null!=e.el){var t,n="hacking-mission-node-"+e.pos[0]+"-"+e.pos[1],r=(document.getElementById(n),document.getElementById(n+"-txt"));switch(e.type){case y.Core:t="CPU Core<br>HP: "+Object(l.formatNumber)(e.hp,1);break;case y.Firewall:t="Firewall<br>HP: "+Object(l.formatNumber)(e.hp,1);break;case y.Database:t="Database<br>HP: "+Object(l.formatNumber)(e.hp,1);break;case y.Spam:t="Spam<br>HP: "+Object(l.formatNumber)(e.hp,1);break;case y.Transfer:t="Transfer<br>HP: "+Object(l.formatNumber)(e.hp,1);break;case y.Shield:default:t="Shield<br>HP: "+Object(l.formatNumber)(e.hp,1)}t+="<br>Atk: "+Object(l.formatNumber)(e.atk,1)+"<br>Def: "+Object(l.formatNumber)(e.def,1),e.action&&(t+="<br>"+e.action),r.innerHTML=t}else console.error("Calling updateNodeDomElement on a Node without an element")},T.prototype.getNodeFromElement=function(e){var t=(Object(p.isString)(e)?e:e.id).replace("hacking-mission-node-","").split("-");if(2!=t.length)return console.error("Parsing hacking mission node id. could not find coordinates"),null;var n=t[0],r=t[1];return isNaN(n)||isNaN(r)||n>=8||r>=8||n<0||r<0?(console.error(`Unexpected values (${n}, ${r}) for (x, y)`),null):this.map[n][r]},T.prototype.configurePlayerNodeElement=function(e){null==this.getNodeFromElement(e)&&console.error("Failed getting Node object");var t=this;function n(){!function(e,t){var n=e.getNodeFromElement(t);null==n&&console.error("Failed getting Node object"),n.plyrCtrl&&(P(e),n.select(e.actionButtons),e.selectedNode.push(n))}(t,e)}e.addEventListener("click",n),e.addEventListener("dblclick",function(){!function(e,t){var n=e.getNodeFromElement(t);if(null==n&&console.error("Failed getting Node Object in multiselectNode()"),n.plyrCtrl){P(e);var r=n.type;r===y.Core?e.playerCores.forEach(function(t){t.select(e.actionButtons),e.selectedNode.push(t)}):e.playerNodes.forEach(function(t){t.type===r&&(t.select(e.actionButtons),e.selectedNode.push(t))})}}(t,e)}),e.firstChild&&e.firstChild.addEventListener("click",n)},T.prototype.configureEnemyNodeElement=function(e){for(var t=this.getNodeFromElement(e),n=0;n<this.selectedNode.length;++n)if(this.selectedNode[n]==t){t.deselect(this.actionButtons),this.selectedNode.splice(n,1);break}},T.prototype.nodeReachable=function(e){var t=e.pos[0],n=e.pos[1];return!!(t>0&&this.map[t-1][n].plyrCtrl)||(!!(t<7&&this.map[t+1][n].plyrCtrl)||(!!(n>0&&this.map[t][n-1].plyrCtrl)||!!(n<7&&this.map[t][n+1].plyrCtrl)))},T.prototype.nodeReachableByEnemy=function(e){if(null==e)return!1;var t=e.pos[0],n=e.pos[1];return!!(t>0&&this.map[t-1][n].enmyCtrl)||(!!(t<7&&this.map[t+1][n].enmyCtrl)||(!!(n>0&&this.map[t][n-1].enmyCtrl)||!!(n<7&&this.map[t][n+1].enmyCtrl)))},T.prototype.start=function(){this.started=!0,this.initJsPlumb();var e=Object(h.clearEventListeners)("hack-mission-start-btn");e.classList.remove("a-link-button"),e.classList.add("a-link-button-inactive")},T.prototype.initJsPlumb=function(){var e=jsPlumb.getInstance({DragOptions:{cursor:"pointer",zIndex:2e3},PaintStyle:{gradient:{stops:[[0,"#FFFFFF"],[1,"#FFFFFF"]]},stroke:"#FFFFFF",strokeWidth:8}});this.jsplumbinstance=e;for(var t=0;t<this.playerCores.length;++t)e.makeSource(this.playerCores[t].el,{deleteEndpointsOnEmpty:!0,maxConnections:1,anchor:"Continuous",connector:"Flowchart"});for(t=0;t<this.enemyCores.length;++t)e.makeTarget(this.enemyCores[t].el,{maxConnections:-1,anchor:"Continuous",connector:"Flowchart"});for(t=0;t<this.enemyDatabases.length;++t)e.makeTarget(this.enemyDatabases[t].el,{maxConnections:-1,anchor:"Continuous",connector:["Flowchart"]});for(t=0;t<this.enemyNodes.length;++t)e.makeTarget(this.enemyNodes[t].el,{maxConnections:-1,anchor:"Continuous",connector:"Flowchart"});for(t=0;t<this.miscNodes.length;++t)e.makeTarget(this.miscNodes[t].el,{maxConnections:-1,anchor:"Continuous",connector:"Flowchart"});e.bind("click",(e,t)=>{if(!this.getNodeFromElement(e.source).enmyCtrl){var n=e.endpoints;n[0].detachFrom(n[1])}}),e.bind("connection",e=>{var t=this.getNodeFromElement(e.target);this.getNodeFromElement(e.source).enmyCtrl||(this.nodeReachable(t)?(this.getNodeFromElement(e.source).conn=e.connection,++(t=this.getNodeFromElement(e.target)).targetedCount):e.sourceEndpoint.detachFrom(e.targetEndpoint))}),e.bind("connectionDetached",(e,t)=>{this.getNodeFromElement(e.source).conn=null,this.getNodeFromElement(e.target).untarget()})},T.prototype.dropAllConnectionsFromNode=function(e){for(var t=this.jsplumbinstance.getAllConnections(),n=t.length-1;n>=0;--n)t[n].source==e.el&&t[n].endpoints[0].detachFrom(t[n].endpoints[1])},T.prototype.dropAllConnectionsToNode=function(e){for(var t=this.jsplumbinstance.getAllConnections(),n=t.length-1;n>=0;--n)t[n].target==e.el&&t[n].endpoints[0].detachFrom(t[n].endpoints[1]);e.beingTargeted=!1};var S=0;T.prototype.process=function(e=1){if(this.started&&!((S+=e)<2)){var t=!1;this.playerCores.forEach(e=>{t|=this.processNode(e,S)}),this.playerNodes.forEach(e=>{e.type!==y.Transfer&&e.type!==y.Shield&&e.type!==y.Firewall||(t|=this.processNode(e,S))}),this.enemyCores.forEach(e=>{this.enemyAISelectAction(e),t|=this.processNode(e,S)}),this.enemyNodes.forEach(e=>{e.type!==y.Transfer&&e.type!==y.Shield&&e.type!==y.Firewall||(this.enemyAISelectAction(e),t|=this.processNode(e,S))}),this.enemyDatabases.forEach(e=>{e.maxhp+=.1*S,e.hp+=.1*S}),t&&(this.calculateAttacks(),this.calculateDefenses()),0!==this.enemyDatabases.length?0!==this.playerCores.length?(this.miscNodes.forEach(e=>{e.def+=.1*S,e.maxhp+=.05*S,e.hp+=.1*S,e.hp>e.maxhp&&(e.hp=e.maxhp),this.updateNodeDomElement(e)}),this.time-=S*a.Engine._idleSpeed,this.time<=0?this.finishMission(!1):(this.updateTimer(),S=0)):this.finishMission(!1):this.finishMission(!0)}},T.prototype.processNode=function(e,t=1){if(null!=e.action){var n,a,i=null;e.conn&&(null==(i=null!=e.conn.target?this.getNodeFromElement(e.conn.target):this.getNodeFromElement(e.conn.targetId))||(i.plyrCtrl?(n=this.playerDef,a=this.enemyAtk):i.enmyCtrl?(n=this.enemyDef,a=this.playerAtk):(n=i.def,a=e.plyrCtrl?this.playerAtk:this.enemyAtk)));var s=!1,l=e.plyrCtrl,c=this.difficulty*r.CONSTANTS.HackingMissionDifficultyToHacking;switch(e.action){case f:if(null==i)break;if(null==e.conn)break;var u=this.calculateAttackDamage(a,n,l?o.Player.hacking_skill:c);i.hp-=u/5*t;break;case b:if(null==i)break;if(null==e.conn)break;var m=this.calculateScanEffect(a,n,l?o.Player.hacking_skill:c);i.def-=m/5*t,s=!0;break;case E:if(null==i)break;if(null==e.conn)break;m=this.calculateWeakenEffect(a,n,l?o.Player.hacking_skill:c);i.atk-=m/5*t,s=!0;break;case v:m=this.calculateFortifyEffect(o.Player.hacking_skill);e.def+=m/5*t,s=!0;break;case k:m=this.calculateOverflowEffect(o.Player.hacking_skill);if(e.def<m)break;e.def-=m/5*t,e.atk+=m/5*t,s=!0;break;default:console.error(`Invalid Node Action: ${e.action}`)}if(e.atk<0&&(e.atk=0),e.def<0&&(e.def=0),i&&i.atk<0&&(i.atk=0),i&&i.def<0&&(i.def=0),i&&i.hp<=0){var p=e.plyrCtrl;i.hp=i.maxhp,i.action=null,i.conn=null,this.selectedNode==i&&i.deselect(this.actionButtons),i.atk/=2,i.def/=3.5;var h=!i.plyrCtrl&&!i.enmyCtrl;function d(e,t,n){for(var r=0;r<e.length;++r)if(e[r]==n){var a=e.splice(r,1);a=a[0],t.push(a);break}}switch(this.dropAllConnectionsToNode(i),this.dropAllConnectionsFromNode(i),p?(i.setControlledByPlayer(),this.jsplumbinstance.unmakeTarget(i.el),this.jsplumbinstance.makeSource(i.el,{deleteEndpointsOnEmpty:!0,maxConnections:1,anchor:"Continuous",connector:"Flowchart"})):(i.setControlledByEnemy(),e.conn=null,this.jsplumbinstance.unmakeSource(i.el),this.jsplumbinstance.makeTarget(i.el,{maxConnections:-1,anchor:"Continuous",connector:["Flowchart"]})),s=!0,i.type){case y.Core:p?(d(this.enemyCores,this.playerCores,i),this.configurePlayerNodeElement(i.el)):(d(this.playerCores,this.enemyCores,i),this.configureEnemyNodeElement(i.el));break;case y.Firewall:p?d(this.enemyNodes,this.playerNodes,i):(d(this.playerNodes,this.enemyNodes,i),this.configureEnemyNodeElement(i.el));break;case y.Database:p?d(this.enemyDatabases,this.playerNodes,i):d(this.playerNodes,this.enemyDatabases,i);break;case y.Spam:p?(d(h?this.miscNodes:this.enemyNodes,this.playerNodes,i),this.time+=r.CONSTANTS.HackingMissionSpamTimeIncrease):d(h?this.miscNodes:this.playerNodes,this.enemyNodes,i);break;case y.Transfer:p?(d(h?this.miscNodes:this.enemyNodes,this.playerNodes,i),this.playerCores.forEach(function(e){e.atk*=r.CONSTANTS.HackingMissionTransferAttackIncrease}),this.configurePlayerNodeElement(i.el)):(d(h?this.miscNodes:this.playerNodes,this.enemyNodes,i),this.enemyCores.forEach(function(e){e.atk*=r.CONSTANTS.HackingMissionTransferAttackIncrease}),this.configureEnemyNodeElement(i.el));break;case y.Shield:p?(d(h?this.miscNodes:this.enemyNodes,this.playerNodes,i),this.configurePlayerNodeElement(i.el)):(d(h?this.miscNodes:this.playerNodes,this.enemyNodes,i),this.configureEnemyNodeElement(i.el))}h&&this.miscNodes.forEach(e=>{0===e.targetedCount&&(e.def*=r.CONSTANTS.HackingMissionMiscDefenseIncrease)})}return this.updateNodeDomElement(e),i&&this.updateNodeDomElement(i),s}},T.prototype.enemyAISelectAction=function(e){if(null!=e)switch(e.type){case y.Core:if(null==e.conn){if(0===this.miscNodes.length){var t=Object(m.getRandomInt)(0,this.playerNodes.length-1);if(n=0===this.playerNodes.length?null:this.playerNodes[t],this.nodeReachableByEnemy(n))e.conn=this.jsplumbinstance.connect({source:e.el,target:n.el}),++n.targetedCount;else{if(t=Object(m.getRandomInt)(0,this.playerCores.length-1),0===this.playerCores.length)return;n=this.playerCores[t],this.nodeReachableByEnemy(n)&&(e.conn=this.jsplumbinstance.connect({source:e.el,target:n.el}),++n.targetedCount)}}else{t=Object(m.getRandomInt)(0,this.miscNodes.length-1);var n=this.miscNodes[t];this.nodeReachableByEnemy(n)&&(e.conn=this.jsplumbinstance.connect({source:e.el,target:n.el}),++n.targetedCount)}e.action=v}else{var r;null==(r=e.conn.target?this.getNodeFromElement(e.conn.target):this.getNodeFromElement(e.conn.targetId))&&console.error("Error getting Target node Object in enemyAISelectAction()"),r.def>this.enemyAtk+15?e.def<50?e.action=v:e.action=k:Math.abs(r.def-this.enemyAtk)<=15?e.action=b:e.action=f}break;case y.Transfer:e.def<125?e.action=v:e.action=k;break;case y.Firewall:case y.Shield:e.action=v}};T.prototype.calculateAttackDamage=function(e,t,n=0){return Math.max(.55*(e+n/80-t),1)},T.prototype.calculateScanEffect=function(e,t,n=0){return Math.max(.6*(e+n/25-.95*t),2)},T.prototype.calculateWeakenEffect=function(e,t,n=0){return Math.max(e+n/25-.95*t,2)},T.prototype.calculateFortifyEffect=function(e=0){return.9*e/130},T.prototype.calculateOverflowEffect=function(e=0){return.95*e/130},T.prototype.updateTimer=function(){var e=document.getElementById("hacking-mission-timer"),t=Math.round(this.time/1e3),n=Math.trunc(t/60);t%=60;var r=("0"+n).slice(-2)+":"+("0"+t).slice(-2);e.innerText="Time left: "+r},T.prototype.finishMission=function(e){if(d=!1,_=null,e){var t=1+this.faction.favor/100,n=this.reward*o.Player.faction_rep_mult*t;Object(s.dialogBoxCreate)("Mission won! You earned "+c.numeralWrapper.format(n,"0.000a")+" reputation with "+this.faction.name),o.Player.gainIntelligenceExp(this.difficulty*r.CONSTANTS.IntelligenceHackingMissionBaseExpGain),this.faction.playerReputation+=n}else Object(s.dialogBoxCreate)("Mission lost/forfeited! You did not gain any faction reputation.");for(var l=document.getElementById("mission-container");l.firstChild;)l.removeChild(l.firstChild);document.getElementById("mainmenu-container").style.visibility="visible",document.getElementById("character-overview-wrapper").style.visibility="visible",a.Engine.loadFactionContent(),Object(i.displayFactionContent)(this.faction.name)}}).call(this,n(86))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return X});var r=n(10),a=n(4),i=n(19),o=n(6),s=n(12),l=n(74),c=n(13),u=n(50),m=n(0),p=n(80),h=n(11),d=n(2),_=n(8),g=n(16),y=n(65),f=n(7),b=n(221),E=n(136),v=n(33),k=n(211),C=n(84),T=(n(226),n(126)),P=n(210),S=n(91),O=n(188),M=n(103),x=n(18),w=n(88),A=n(111),N=n(109),R=n(49),D=n(15),I=n(157),B=n(24),L=n(44),W=n(78),F=n(3),j=n(37),U=n(82),H=n(27),G=n(170),K=n(46),$=n.n(K);const q='<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 166 132" style="fill:#adff2f;"><g><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"/><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"/></g></svg> ',Y='<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="-22 0 511 511.99561" style="fill:#adff2f;"><path d="m.496094 466.242188 39.902344-39.902344 45.753906 45.753906-39.898438 39.902344zm0 0"/><path d="m468.421875 89.832031-1.675781-89.832031-300.265625 300.265625 45.753906 45.753906zm0 0"/><path d="m95.210938 316.785156 16.84375 16.847656h.003906l83.65625 83.65625 22.753906-22.753906-100.503906-100.503906zm0 0"/><path d="m101.445312 365.300781-39.902343 39.902344 45.753906 45.753906 39.902344-39.902343-39.90625-39.902344zm0 0"/></svg>',z="bladeburner-active-action";let V=0;function J(e={}){e.name&&(this.name=e.name),e.type&&(this.type=e.type)}function X(e={}){this.numHosp=0,this.moneyLost=0,this.rank=0,this.maxRank=0,this.skillPoints=0,this.totalSkillPoints=0,this.teamSize=0,this.teamLost=0,this.storedCycles=0,this.randomEventCounter=Object(D.getRandomInt)(240,600),this.actionTimeToComplete=0,this.actionTimeCurrent=0;var t=x.ActionTypes.Idle;this.action=new J({type:t}),this.cities={};for(var n=0;n<v.BladeburnerConstants.CityNames.length;++n)this.cities[v.BladeburnerConstants.CityNames[n]]=new E.City({name:v.BladeburnerConstants.CityNames[n]});this.city=v.BladeburnerConstants.CityNames[2],this.skills={},this.skillMultipliers={},this.updateSkillMultipliers(),this.staminaBonus=0,this.maxStamina=0,this.calculateMaxStamina(),this.stamina=this.maxStamina,this.contracts={},this.operations={},this.blackops={},this.logging={general:!0,contracts:!0,ops:!0,blackops:!0,events:!0},this.automateEnabled=!1,this.automateActionHigh=0,this.automateThreshHigh=0,this.automateActionLow=0,this.automateThreshLow=0,this.consoleHistory=[],this.consoleLogs=[],this.initializeDomElementRefs(),e.new&&this.create()}e(document).keydown(function(e){if(h.routing.isOn(h.Page.Bladeburner)){if(!(m.Player.bladeburner instanceof X))return;let i=m.Player.bladeburner.consoleHistory;if(e.keyCode===B.KEY.ENTER){e.preventDefault();var t=Q.consoleInput.value;t.length>0&&(m.Player.bladeburner.postToConsole("> "+t),m.Player.bladeburner.resetConsoleInput(),m.Player.bladeburner.executeConsoleCommands(t))}if(e.keyCode===B.KEY.UPARROW){if(null==Q.consoleInput)return;var n=V;if(0===(a=i.length))return;(n<0||n>a)&&(V=a),0!==n&&--V;var r=i[V];Q.consoleInput.value=r,Object(y.setTimeoutRef)(function(){Q.consoleInput.selectionStart=Q.consoleInput.selectionEnd=1e4},0)}if(e.keyCode===B.KEY.DOWNARROW){if(null==Q.consoleInput)return;var a;n=V;if(0==(a=i.length))return;if((n<0||n>a)&&(V=a),n==a||n==a-1)V=a,Q.consoleInput.value="";else{r=i[++V];Q.consoleInput.value=r}}}}),J.prototype.toJSON=function(){return Object(g.Generic_toJSON)("ActionIdentifier",this)},J.fromJSON=function(e){return Object(g.Generic_fromJSON)(J,e.data)},g.Reviver.constructors.ActionIdentifier=J,X.prototype.prestige=function(){this.resetAction();var e=c.Factions.Bladeburners;this.rank>=v.BladeburnerConstants.RankNeededForFaction&&Object(u.joinFaction)(e)},X.prototype.create=function(){this.contracts.Tracking=new O.Contract({name:"Tracking",desc:"Identify and locate Synthoids. This contract involves reconnaissance and information-gathering ONLY. Do NOT engage. Stealth is of the utmost importance.<br><br>Successfully completing Tracking contracts will slightly improve your Synthoid population estimate for whatever city you are currently in.",baseDifficulty:125,difficultyFac:1.02,rewardFac:1.041,rankGain:.3,hpLoss:.5,count:Object(D.getRandomInt)(25,150),countGrowth:Object(D.getRandomInt)(5,75)/10,weights:{hack:0,str:.05,def:.05,dex:.35,agi:.35,cha:.1,int:.05},decays:{hack:0,str:.91,def:.91,dex:.91,agi:.91,cha:.9,int:1},isStealth:!0}),this.contracts["Bounty Hunter"]=new O.Contract({name:"Bounty Hunter",desc:"Hunt down and capture fugitive Synthoids. These Synthoids are wanted alive.<br><br>Successfully completing a Bounty Hunter contract will lower the population in your current city, and will also increase its chaos level.",baseDifficulty:250,difficultyFac:1.04,rewardFac:1.085,rankGain:.9,hpLoss:1,count:Object(D.getRandomInt)(5,150),countGrowth:Object(D.getRandomInt)(5,75)/10,weights:{hack:0,str:.15,def:.15,dex:.25,agi:.25,cha:.1,int:.1},decays:{hack:0,str:.91,def:.91,dex:.91,agi:.91,cha:.8,int:.9},isKill:!0}),this.contracts.Retirement=new O.Contract({name:"Retirement",desc:"Hunt down and retire (kill) rogue Synthoids.<br><br>Successfully completing a Retirement contract will lower the population in your current city, and will also increase its chaos level.",baseDifficulty:200,difficultyFac:1.03,rewardFac:1.065,rankGain:.6,hpLoss:1,count:Object(D.getRandomInt)(5,150),countGrowth:Object(D.getRandomInt)(5,75)/10,weights:{hack:0,str:.2,def:.2,dex:.2,agi:.2,cha:.1,int:.1},decays:{hack:0,str:.91,def:.91,dex:.91,agi:.91,cha:.8,int:.9},isKill:!0}),this.operations.Investigation=new T.Operation({name:"Investigation",desc:"As a field agent, investigate and identify Synthoid populations, movements, and operations.<br><br>Successful Investigation ops will increase the accuracy of your synthoid data.<br><br>You will NOT lose HP from failed Investigation ops.",baseDifficulty:400,difficultyFac:1.03,rewardFac:1.07,reqdRank:25,rankGain:2.2,rankLoss:.2,count:Object(D.getRandomInt)(1,100),countGrowth:Object(D.getRandomInt)(10,40)/10,weights:{hack:.25,str:.05,def:.05,dex:.2,agi:.1,cha:.25,int:.1},decays:{hack:.85,str:.9,def:.9,dex:.9,agi:.9,cha:.7,int:.9},isStealth:!0}),this.operations["Undercover Operation"]=new T.Operation({name:"Undercover Operation",desc:"Conduct undercover operations to identify hidden and underground Synthoid communities and organizations.<br><br>Successful Undercover ops will increase the accuracy of your synthoid data.",baseDifficulty:500,difficultyFac:1.04,rewardFac:1.09,reqdRank:100,rankGain:4.4,rankLoss:.4,hpLoss:2,count:Object(D.getRandomInt)(1,100),countGrowth:Object(D.getRandomInt)(10,40)/10,weights:{hack:.2,str:.05,def:.05,dex:.2,agi:.2,cha:.2,int:.1},decays:{hack:.8,str:.9,def:.9,dex:.9,agi:.9,cha:.7,int:.9},isStealth:!0}),this.operations["Sting Operation"]=new T.Operation({name:"Sting Operation",desc:"Conduct a sting operation to bait and capture particularly notorious Synthoid criminals.",baseDifficulty:650,difficultyFac:1.04,rewardFac:1.095,reqdRank:500,rankGain:5.5,rankLoss:.5,hpLoss:2.5,count:Object(D.getRandomInt)(1,150),countGrowth:Object(D.getRandomInt)(3,40)/10,weights:{hack:.25,str:.05,def:.05,dex:.25,agi:.1,cha:.2,int:.1},decays:{hack:.8,str:.85,def:.85,dex:.85,agi:.85,cha:.7,int:.9},isStealth:!0}),this.operations.Raid=new T.Operation({name:"Raid",desc:"Lead an assault on a known Synthoid community. Note that there must be an existing Synthoid community in your current city in order for this Operation to be successful",baseDifficulty:800,difficultyFac:1.045,rewardFac:1.1,reqdRank:3e3,rankGain:55,rankLoss:2.5,hpLoss:50,count:Object(D.getRandomInt)(1,150),countGrowth:Object(D.getRandomInt)(2,40)/10,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.7,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.9},isKill:!0}),this.operations["Stealth Retirement Operation"]=new T.Operation({name:"Stealth Retirement Operation",desc:"Lead a covert operation to retire Synthoids. The objective is to complete the task without drawing any attention. Stealth and discretion are key.",baseDifficulty:1e3,difficultyFac:1.05,rewardFac:1.11,reqdRank:2e4,rankGain:22,rankLoss:2,hpLoss:10,count:Object(D.getRandomInt)(1,150),countGrowth:Object(D.getRandomInt)(1,20)/10,weights:{hack:.1,str:.1,def:.1,dex:.3,agi:.3,cha:0,int:.1},decays:{hack:.7,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.9},isStealth:!0,isKill:!0}),this.operations.Assassination=new T.Operation({name:"Assassination",desc:"Assassinate Synthoids that have been identified as important, high-profile social and political leaders in the Synthoid communities.",baseDifficulty:1500,difficultyFac:1.06,rewardFac:1.14,reqdRank:5e4,rankGain:44,rankLoss:4,hpLoss:5,count:Object(D.getRandomInt)(1,150),countGrowth:Object(D.getRandomInt)(1,20)/10,weights:{hack:.1,str:.1,def:.1,dex:.3,agi:.3,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.8},isStealth:!0,isKill:!0})},X.prototype.storeCycles=function(e=1){this.storedCycles+=e},X.prototype.process=function(){if(!1===p.b&&this.blackops.hasOwnProperty("Operation Daedalus"))return Object(p.a)(m.Player.bitNodeN);if(!1===r.Augmentations[a.AugmentationNames.BladesSimulacrum].owned&&m.Player.isWorking){if(this.action.type!==x.ActionTypes.Idle){let e="Your Bladeburner action was cancelled because you started doing something else.";this.automateEnabled&&(e+="<br><br>Your automation was disabled as well. You will have to re-enable it through the Bladeburner console",this.automateEnabled=!1),Object(_.dialogBoxCreate)(e)}this.resetAction()}if(this.stamina<=0&&(this.log("Your Bladeburner action was cancelled because your stamina hit 0"),this.resetAction()),this.storedCycles>=v.BladeburnerConstants.CyclesPerSecond){var e=Math.floor(this.storedCycles/v.BladeburnerConstants.CyclesPerSecond);for(var t in e=Math.min(e,5),this.storedCycles-=e*v.BladeburnerConstants.CyclesPerSecond,this.calculateMaxStamina(),this.stamina+=this.calculateStaminaGainPerSecond()*e,this.stamina=Math.min(this.maxStamina,this.stamina),this.contracts)if(this.contracts.hasOwnProperty(t)){var n=this.contracts[t];n.count+=e*n.countGrowth/v.BladeburnerConstants.ActionCountGrowthPeriod}for(var i in this.operations)if(this.operations.hasOwnProperty(i)){var o=this.operations[i];o.count+=e*o.countGrowth/v.BladeburnerConstants.ActionCountGrowthPeriod}for(var s=0;s<v.BladeburnerConstants.CityNames.length;++s){var l=this.cities[v.BladeburnerConstants.CityNames[s]];if(!(l instanceof E.City))throw new Error("Invalid City object when processing passive chaos reduction in Bladeburner.process");l.chaos-=1e-4*e,l.chaos=Math.max(0,l.chaos)}this.randomEventCounter-=e,this.randomEventCounter<=0&&(this.randomEvent(),this.randomEventCounter=Object(D.getRandomInt)(240,600)),this.processAction(e),this.automateEnabled&&(this.stamina<=this.automateThreshLow?this.action.name===this.automateActionLow.name&&this.action.type===this.automateActionLow.type||(this.action=new J({type:this.automateActionLow.type,name:this.automateActionLow.name}),this.startAction(this.action)):this.stamina>=this.automateThreshHigh&&(this.action.name===this.automateActionHigh.name&&this.action.type===this.automateActionHigh.type||(this.action=new J({type:this.automateActionHigh.type,name:this.automateActionHigh.name}),this.startAction(this.action)))),h.routing.isOn(h.Page.Bladeburner)&&this.updateContent()}},X.prototype.calculateMaxStamina=function(){const e=m.Player.agility*this.skillMultipliers.effAgi;let t=(Math.pow(e,.8)+this.staminaBonus)*this.skillMultipliers.stamina*m.Player.bladeburner_max_stamina_mult;if(this.maxStamina!==t){const e=this.maxStamina;this.maxStamina=t,this.stamina=this.maxStamina*this.stamina/e}if(isNaN(t))throw new Error("Max Stamina calculated to be NaN in Bladeburner.calculateMaxStamina()")},X.prototype.calculateStaminaGainPerSecond=function(){var e=m.Player.agility*this.skillMultipliers.effAgi,t=this.maxStamina/v.BladeburnerConstants.MaxStaminaToGainFactor;return(v.BladeburnerConstants.StaminaGainPerSecond+t)*Math.pow(e,.17)*(this.skillMultipliers.stamina*m.Player.bladeburner_stamina_gain_mult)},X.prototype.calculateStaminaPenalty=function(){return Math.min(1,this.stamina/(.5*this.maxStamina))},X.prototype.changeRank=function(e){if(isNaN(e))throw new Error("NaN passed into Bladeburner.changeRank()");this.rank+=e,this.rank<0&&(this.rank=0),this.maxRank=Math.max(this.rank,this.maxRank);if(Object(c.factionExists)("Bladeburners")){var t=c.Factions.Bladeburners;if(!(t instanceof l.Faction))throw new Error("Could not properly get Bladeburner Faction object in Bladeburner UI Overview Faction button");if(t.isMember){var n=1+t.favor/100;t.playerReputation+=v.BladeburnerConstants.RankToFactionRepFactor*e*m.Player.faction_rep_mult*n}}var r=(this.totalSkillPoints+1)*v.BladeburnerConstants.RanksPerSkillPoint;if(this.maxRank>=r){var a=Math.floor((this.maxRank-r)/v.BladeburnerConstants.RanksPerSkillPoint+1);this.skillPoints+=a,this.totalSkillPoints+=a}},X.prototype.getCurrentCity=function(){var e=this.cities[this.city];if(!(e instanceof E.City))throw new Error("Bladeburner.getCurrentCity() did not properly return a City object");return e},X.prototype.resetSkillMultipliers=function(){this.skillMultipliers={successChanceAll:1,successChanceStealth:1,successChanceKill:1,successChanceContract:1,successChanceOperation:1,successChanceEstimate:1,actionTime:1,effHack:1,effStr:1,effDef:1,effDex:1,effAgi:1,effCha:1,effInt:1,stamina:1,money:1,expGain:1}},X.prototype.updateSkillMultipliers=function(){for(var e in this.resetSkillMultipliers(),this.skills)if(this.skills.hasOwnProperty(e)){var t=C.Skills[e];if(null==t)throw new Error("Could not find Skill Object for: "+e);var n=this.skills[e];if(null==n||n<=0)continue;for(var r=Object.keys(this.skillMultipliers),a=0;a<r.length;++a){var i=r[a];if(null!=t[i]&&!isNaN(t[i])){var o=t[i]*n,s=1+o/100;"actionTime"===i&&(s=1-o/100),this.skillMultipliers[i]*=s}}}},X.prototype.upgradeSkill=function(e){var t=e.name;if(this.skills[t]?++this.skills[t]:this.skills[t]=1,isNaN(this.skills[t])||this.skills[t]<0)throw new Error("Level of Skill "+t+" is invalid: "+this.skills[t]);this.updateSkillMultipliers()},X.prototype.getActionObject=function(e){switch(e.type){case x.ActionTypes.Contract:return this.contracts[e.name];case x.ActionTypes.Operation:return this.operations[e.name];case x.ActionTypes.BlackOp:case x.ActionTypes.BlackOperation:return S.BlackOperations[e.name];case x.ActionTypes.Training:return M.GeneralActions.Training;case x.ActionTypes["Field Analysis"]:return M.GeneralActions["Field Analysis"];case x.ActionTypes.Recruitment:return M.GeneralActions.Recruitment;default:return null}},X.prototype.resetAction=function(){this.action=new J({type:x.ActionTypes.Idle})},X.prototype.startAction=function(e){if(null!=e)switch(this.action=e,this.actionTimeCurrent=0,e.type){case x.ActionTypes.Idle:this.actionTimeToComplete=0;break;case x.ActionTypes.Contract:try{if(null==(t=this.getActionObject(e)))throw new Error("Failed to get Contract Object for: "+e.name);if(t.count<1)return this.resetAction();this.actionTimeToComplete=t.getActionTime(this)}catch(e){Object(R.exceptionAlert)(e)}break;case x.ActionTypes.Operation:try{if(null==(t=this.getActionObject(e)))throw new Error("Failed to get Operation Object for: "+e.name);if(t.count<1)return this.resetAction();if("Raid"===e.name&&0===this.getCurrentCity().commsEst)return this.resetAction();this.actionTimeToComplete=t.getActionTime(this)}catch(e){Object(R.exceptionAlert)(e)}break;case x.ActionTypes.BlackOp:case x.ActionTypes.BlackOperation:try{if(null!=this.blackops[e.name]){this.resetAction(),this.log("Error: Tried to start a Black Operation that had already been completed");break}var t;if(null==(t=this.getActionObject(e)))throw new Error("Failed to get BlackOperation object for: "+e.name);this.actionTimeToComplete=t.getActionTime(this)}catch(e){Object(R.exceptionAlert)(e)}break;case x.ActionTypes.Recruitment:this.actionTimeToComplete=this.getRecruitmentTime();break;case x.ActionTypes.Training:case x.ActionTypes.FieldAnalysis:case x.ActionTypes["Field Analysis"]:this.actionTimeToComplete=30;break;case x.ActionTypes.Diplomacy:case x.ActionTypes["Hyperbolic Regeneration Chamber"]:this.actionTimeToComplete=60;break;default:throw new Error("Invalid Action Type in Bladeburner.startAction(): "+e.type)}},X.prototype.processAction=function(e){if(this.action.type!==x.ActionTypes.Idle){if(this.actionTimeToComplete<=0)throw new Error(`Invalid actionTimeToComplete value: ${this.actionTimeToComplete}, type; ${this.action.type}`);if(!(this.action instanceof J))throw new Error("Bladeburner.action is not an ActionIdentifier Object");return this.actionTimeCurrent+=e,this.actionTimeCurrent>=this.actionTimeToComplete?this.completeAction():void 0}},X.prototype.completeAction=function(){switch(this.action.type){case x.ActionTypes.Contract:case x.ActionTypes.Operation:try{var e=this.action.type===x.ActionTypes.Operation;if(null==(_=this.getActionObject(this.action)))throw new Error("Failed to get Contract/Operation Object for: "+this.action.name);var t=_.getDifficulty(),n=Math.pow(t,v.BladeburnerConstants.DiffMultExponentialFactor)+t/v.BladeburnerConstants.DiffMultLinearFactor,r=Math.pow(_.rewardFac,_.level-1);if(this.stamina-=v.BladeburnerConstants.BaseStaminaLoss*n,this.stamina<0&&(this.stamina=0),_.attempt(this)){this.gainActionStats(_,!0),++_.successes,--_.count;var a=0;if(e||(a=v.BladeburnerConstants.ContractBaseMoneyGain*r*this.skillMultipliers.money,m.Player.gainMoney(a),m.Player.recordMoneySource(a,"bladeburner")),e?_.setMaxLevel(v.BladeburnerConstants.OperationSuccessesPerLevel):_.setMaxLevel(v.BladeburnerConstants.ContractSuccessesPerLevel),_.rankGain){var s=Object(w.addOffset)(_.rankGain*r*i.BitNodeMultipliers.BladeburnerRank,10);this.changeRank(s),e&&this.logging.ops?this.log(_.name+" successfully completed! Gained "+Object(f.formatNumber)(s,3)+" rank"):!e&&this.logging.contracts&&this.log(_.name+" contract successfully completed! Gained "+Object(f.formatNumber)(s,3)+" rank and "+d.numeralWrapper.format(a,"$0.000a"))}e?this.completeOperation(!0):this.completeContract(!0)}else{this.gainActionStats(_,!1),++_.failures;var l=0,c=0;_.rankLoss&&(l=Object(w.addOffset)(_.rankLoss*r,10),this.changeRank(-1*l)),_.hpLoss&&(c=_.hpLoss*n,c=Math.ceil(Object(w.addOffset)(c,10)),this.hpLost+=c,m.Player.takeDamage(c)&&(++this.numHosp,this.moneyLost+=o.CONSTANTS.HospitalCostPerHp*m.Player.max_hp));var u="";l>0&&(u+="Lost "+Object(f.formatNumber)(l,3)+" rank."),c>0&&(u+="Took "+Object(f.formatNumber)(c,0)+" damage."),e&&this.logging.ops?this.log(_.name+" failed! "+u):!e&&this.logging.contracts&&this.log(_.name+" contract failed! "+u),e?this.completeOperation(!1):this.completeContract(!1)}_.autoLevel&&(_.level=_.maxLevel),this.startAction(this.action)}catch(e){Object(R.exceptionAlert)(e)}break;case x.ActionTypes.BlackOp:case x.ActionTypes.BlackOperation:try{var _;if(null==(_=this.getActionObject(this.action))||!(_ instanceof P.BlackOperation))throw new Error("Failed to get BlackOperation Object for: "+this.action.name);t=_.getDifficulty(),n=Math.pow(t,v.BladeburnerConstants.DiffMultExponentialFactor)+t/v.BladeburnerConstants.DiffMultLinearFactor;this.stamina-=v.BladeburnerConstants.BaseStaminaLoss*n,this.stamina<0&&(this.stamina=0);var g,y=_.teamCount;if(_.attempt(this)){this.gainActionStats(_,!0),_.count=0,this.blackops[_.name]=!0;var b=0;if(_.rankGain&&(b=Object(w.addOffset)(_.rankGain*i.BitNodeMultipliers.BladeburnerRank,10),this.changeRank(b)),g=Math.ceil(y/2),"Operation Daedalus"===_.name)return this.resetAction(),Object(p.a)(m.Player.bitNodeN);h.routing.isOn(h.Page.Bladeburner)&&this.createActionAndSkillsContent(),this.logging.blackops&&this.log(_.name+" successful! Gained "+Object(f.formatNumber)(b,1)+" rank")}else{this.gainActionStats(_,!1);var E=0;c=0;_.rankLoss&&(E=Object(w.addOffset)(_.rankLoss,10),this.changeRank(-1*E)),_.hpLoss&&(c=_.hpLoss*n,c=Math.ceil(Object(w.addOffset)(c,10)),m.Player.takeDamage(c)&&(++this.numHosp,this.moneyLost+=o.CONSTANTS.HospitalCostPerHp*m.Player.max_hp)),g=Math.floor(y),this.logging.blackops&&this.log(_.name+" failed! Lost "+Object(f.formatNumber)(E,1)+" rank and took "+Object(f.formatNumber)(c,0)+" damage")}if(this.resetAction(),y>=1){var k=Object(D.getRandomInt)(1,g);this.teamSize-=k,this.teamLost+=k,this.logging.blackops&&this.log("You lost "+Object(f.formatNumber)(k,0)+" team members during "+_.name)}}catch(e){Object(R.exceptionAlert)(e)}break;case x.ActionTypes.Training:this.stamina-=.5*v.BladeburnerConstants.BaseStaminaLoss;var C=30*m.Player.strength_exp_mult,T=30*m.Player.defense_exp_mult,S=30*m.Player.dexterity_exp_mult,O=30*m.Player.agility_exp_mult,M=.04*this.skillMultipliers.stamina;m.Player.gainStrengthExp(C),m.Player.gainDefenseExp(T),m.Player.gainDexterityExp(S),m.Player.gainAgilityExp(O),this.staminaBonus+=M,this.logging.general&&this.log("Training completed. Gained: "+Object(f.formatNumber)(C,1)+" str exp, "+Object(f.formatNumber)(T,1)+" def exp, "+Object(f.formatNumber)(S,1)+" dex exp, "+Object(f.formatNumber)(O,1)+" agi exp, "+Object(f.formatNumber)(M,3)+" max stamina"),this.startAction(this.action);break;case x.ActionTypes.FieldAnalysis:case x.ActionTypes["Field Analysis"]:var A=.04*Math.pow(m.Player.hacking_skill,.3)+.04*Math.pow(m.Player.intelligence,.9)+.02*Math.pow(m.Player.charisma,.3);if(A*=m.Player.bladeburner_analysis_mult,isNaN(A)||A<0)throw new Error("Field Analysis Effectiveness calculated to be NaN or negative");var N=20*m.Player.hacking_exp_mult,I=20*m.Player.charisma_exp_mult;m.Player.gainHackingExp(N),m.Player.gainIntelligenceExp(v.BladeburnerConstants.BaseIntGain),m.Player.gainCharismaExp(I),this.changeRank(.1*i.BitNodeMultipliers.BladeburnerRank),this.getCurrentCity().improvePopulationEstimateByPercentage(A*this.skillMultipliers.successChanceEstimate),this.logging.general&&this.log("Field analysis completed. Gained 0.1 rank, "+Object(f.formatNumber)(N,1)+" hacking exp, and "+Object(f.formatNumber)(I,1)+" charisma exp"),this.startAction(this.action);break;case x.ActionTypes.Recruitment:var B=this.getRecruitmentSuccessChance();if(Math.random()<B){var L=2*v.BladeburnerConstants.BaseStatGain*this.actionTimeToComplete;m.Player.gainCharismaExp(L),++this.teamSize,this.logging.general&&this.log("Successfully recruited a team member! Gained "+Object(f.formatNumber)(L,1)+" charisma exp")}else{L=v.BladeburnerConstants.BaseStatGain*this.actionTimeToComplete;m.Player.gainCharismaExp(L),this.logging.general&&this.log("Failed to recruit a team member. Gained "+Object(f.formatNumber)(L,1)+" charisma exp")}this.startAction(this.action);break;case x.ActionTypes.Diplomacy:A=this.getDiplomacyEffectiveness();this.getCurrentCity().chaos*=A,this.getCurrentCity().chaos<0&&(this.getCurrentCity().chaos=0),this.logging.general&&this.log(`Diplomacy completed. Chaos levels in the current city fell by ${d.numeralWrapper.formatPercentage(1-A)}`),this.startAction(this.action);break;case x.ActionTypes["Hyperbolic Regeneration Chamber"]:{m.Player.regenerateHp(v.BladeburnerConstants.HrcHpGain);const e=this.maxStamina*(v.BladeburnerConstants.HrcStaminaGain/100);this.stamina=Math.min(this.maxStamina,this.stamina+e),this.startAction(this.action),this.logging.general&&this.log(`Rested in Hyperbolic Regeneration Chamber. Restored ${v.BladeburnerConstants.HrcHpGain} HP and gained ${d.numeralWrapper.format(e,"0.0")} stamina`);break}default:console.error(`Bladeburner.completeAction() called for invalid action: ${this.action.type}`)}},X.prototype.completeContract=function(e){if(this.action.type!==x.ActionTypes.Contract)throw new Error("completeContract() called even though current action is not a Contract");var t=this.getCurrentCity();if(e)switch(this.action.name){case"Tracking":t.improvePopulationEstimateByCount(Object(D.getRandomInt)(100,1e3));break;case"Bounty Hunter":t.changePopulationByCount(-1,{estChange:-1}),t.changeChaosByCount(.02);break;case"Retirement":t.changePopulationByCount(-1,{estChange:-1}),t.changeChaosByCount(.04);break;default:throw new Error("Invalid Action name in completeContract: "+this.action.name)}},X.prototype.completeOperation=function(e){if(this.action.type!==x.ActionTypes.Operation)throw new Error("completeOperation() called even though current action is not an Operation");var t=this.getActionObject(this.action);if(null==t)throw new Error("Failed to get Contract/Operation Object for: "+this.action.name);var n,r=t.teamCount;if(r>=1){n=e?Math.ceil(r/2):Math.floor(r);var a=Object(D.getRandomInt)(0,n);this.teamSize-=a,this.teamLost+=a,this.logging.ops&&a>0&&this.log("Lost "+Object(f.formatNumber)(a,0)+" team members during this "+t.name)}var i=this.getCurrentCity();switch(t.name){case"Investigation":e?(i.improvePopulationEstimateByPercentage(.4*this.skillMultipliers.successChanceEstimate),Math.random()<.02*this.skillMultipliers.successChanceEstimate&&i.improveCommunityEstimate(1)):this.triggerPotentialMigration(this.city,.1);break;case"Undercover Operation":e?(i.improvePopulationEstimateByPercentage(.8*this.skillMultipliers.successChanceEstimate),Math.random()<.02*this.skillMultipliers.successChanceEstimate&&i.improveCommunityEstimate(1)):this.triggerPotentialMigration(this.city,.15);break;case"Sting Operation":e&&i.changePopulationByPercentage(-.1,{changeEstEqually:!0,nonZero:!0}),i.changeChaosByCount(.1);break;case"Raid":if(e)i.changePopulationByPercentage(-1,{changeEstEqually:!0,nonZero:!0}),--i.comms,--i.commsEst;else{var o=Object(D.getRandomInt)(-10,-5)/10;i.changePopulationByPercentage(o,{nonZero:!0})}i.changeChaosByPercentage(Object(D.getRandomInt)(1,5));break;case"Stealth Retirement Operation":e&&i.changePopulationByPercentage(-.5,{changeEstEqually:!0,nonZero:!0}),i.changeChaosByPercentage(Object(D.getRandomInt)(-3,-1));break;case"Assassination":e&&i.changePopulationByCount(-1,{estChange:-1}),i.changeChaosByPercentage(Object(D.getRandomInt)(-5,5));break;default:throw new Error("Invalid Action name in completeOperation: "+this.action.name)}},X.prototype.getRecruitmentTime=function(){var e=m.Player.charisma*this.skillMultipliers.effCha,t=Math.pow(e,.81)+e/90;return Math.max(10,Math.round(v.BladeburnerConstants.BaseRecruitmentTimeNeeded-t))},X.prototype.getRecruitmentSuccessChance=function(){return Math.pow(m.Player.charisma,.45)/(this.teamSize+1)},X.prototype.getDiplomacyEffectiveness=function(){return(100-(Math.pow(m.Player.charisma,.045)+m.Player.charisma/1e3))/100},X.prototype.gainActionStats=function(e,t){var n=e.getDifficulty(),r=Math.pow(n,v.BladeburnerConstants.DiffMultExponentialFactor)+n/v.BladeburnerConstants.DiffMultLinearFactor,a=this.actionTimeToComplete,i=t?1:.5,o=a*v.BladeburnerConstants.BaseStatGain*i*r,s=a*v.BladeburnerConstants.BaseIntGain*i*r;const l=this.skillMultipliers.expGain;m.Player.gainHackingExp(o*e.weights.hack*m.Player.hacking_exp_mult*l),m.Player.gainStrengthExp(o*e.weights.str*m.Player.strength_exp_mult*l),m.Player.gainDefenseExp(o*e.weights.def*m.Player.defense_exp_mult*l),m.Player.gainDexterityExp(o*e.weights.dex*m.Player.dexterity_exp_mult*l),m.Player.gainAgilityExp(o*e.weights.agi*m.Player.agility_exp_mult*l),m.Player.gainCharismaExp(o*e.weights.cha*m.Player.charisma_exp_mult*l),m.Player.gainIntelligenceExp(s*e.weights.int*l)},X.prototype.randomEvent=function(){var e=Math.random(),t=v.BladeburnerConstants.CityNames[Object(D.getRandomInt)(0,5)],n=this.cities[t];if(!(n instanceof E.City))throw new Error("sourceCity was not a City object in Bladeburner.randomEvent()");for(var r=v.BladeburnerConstants.CityNames[Object(D.getRandomInt)(0,5)];r===t;)r=v.BladeburnerConstants.CityNames[Object(D.getRandomInt)(0,5)];var a=this.cities[r];if(!(n instanceof E.City&&a instanceof E.City))throw new Error("sourceCity/destCity was not a City object in Bladeburner.randomEvent()");if(e<=.05){++n.comms;var i=Object(D.getRandomInt)(10,20)/100,o=Math.round(n.pop*i);n.pop+=o,this.logging.events&&this.log("Intelligence indicates that a new Synthoid community was formed in a city")}else if(e<=.1)if(n.comms<=0){++n.comms;i=Object(D.getRandomInt)(10,20)/100,o=Math.round(n.pop*i);n.pop+=o,this.logging.events&&this.log("Intelligence indicates that a new Synthoid community was formed in a city")}else{--n.comms,++a.comms;i=Object(D.getRandomInt)(10,20)/100,o=Math.round(n.pop*i);n.pop-=o,a.pop+=o,this.logging.events&&this.log("Intelligence indicates that a Synthoid community migrated from "+t+" to some other city")}else if(e<=.3){i=Object(D.getRandomInt)(8,24)/100,o=Math.round(n.pop*i);n.pop+=o,this.logging.events&&this.log("Intelligence indicates that the Synthoid population of "+t+" just changed significantly")}else if(e<=.5)this.triggerMigration(t),this.logging.events&&this.log("Intelligence indicates that a large number of Synthoids migrated from "+t+" to some other city");else if(e<=.7)n.chaos+=1,n.chaos*=1+Object(D.getRandomInt)(5,20)/100,this.logging.events&&this.log("Tensions between Synthoids and humans lead to riots in "+t+"! Chaos increased");else if(e<=.9){i=Object(D.getRandomInt)(8,20)/100,o=Math.round(n.pop*i);n.pop-=o,this.logging.events&&this.log("Intelligence indicates that the Synthoid population of "+t+" just changed significantly")}},X.prototype.triggerPotentialMigration=function(e,t){(null==t||isNaN(t))&&console.error("Invalid 'chance' parameter passed into Bladeburner.triggerPotentialMigration()"),t>1&&(t/=100),Math.random()<t&&this.triggerMigration(e)},X.prototype.triggerMigration=function(e){for(var t=v.BladeburnerConstants.CityNames[Object(D.getRandomInt)(0,5)];t===e;)t=v.BladeburnerConstants.CityNames[Object(D.getRandomInt)(0,5)];var n=this.cities[t],r=this.cities[e];if(null==n||null==r)throw new Error("Failed to find City with name: "+t);var a=Math.random(),i=Object(D.getRandomInt)(3,15)/100;a<.05&&r.comms>0&&(i*=Object(D.getRandomInt)(2,4),--r.comms,++n.comms);var o=Math.round(r.pop*i);r.pop-=o,n.pop+=o};let Q={};X.prototype.initializeDomElementRefs=function(){Q={bladeburnerDiv:null,overviewConsoleParentDiv:null,overviewDiv:null,actionAndSkillsDiv:null,currentTab:null,consoleDiv:null,consoleTable:null,consoleInputRow:null,consoleInputCell:null,consoleInputHeader:null,consoleInput:null,overviewRank:null,overviewStamina:null,overviewStaminaHelpTip:null,overviewGen1:null,overviewEstPop:null,overviewEstPopHelpTip:null,overviewEstComms:null,overviewChaos:null,overviewSkillPoints:null,overviewBonusTime:null,overviewAugMults:null,actionsAndSkillsDesc:null,actionsAndSkillsList:null,generalActions:{},contracts:{},operations:{},blackops:{},skills:{},skillPointsDisplay:null}},X.prototype.createContent=function(){Q.bladeburnerDiv=Object(F.createElement)("div",{id:"bladeburner-container",position:"fixed",class:"generic-menupage-container"}),Q.overviewConsoleParentDiv=Object(F.createElement)("div",{height:"60%",display:"block",position:"relative"}),Q.overviewDiv=Object(F.createElement)("div",{width:"30%",display:"inline-block",border:"1px solid white"}),Q.actionAndSkillsDiv=Object(F.createElement)("div",{height:"60%",width:"70%",display:"block",border:"1px solid white",margin:"6px",padding:"6px"}),Q.currentTab="general",this.createOverviewContent(),this.createActionAndSkillsContent(),Q.consoleDiv=Object(F.createElement)("div",{class:"bladeburner-console-div",clickListener:()=>(Q.consoleInput instanceof Element&&Q.consoleInput.focus(),!1)}),Q.consoleTable=Object(F.createElement)("table",{class:"bladeburner-console-table"}),Q.consoleInputRow=Object(F.createElement)("tr",{class:"bladeburner-console-input-row",id:"bladeubrner-console-input-row"}),Q.consoleInputCell=Object(F.createElement)("td",{class:"bladeburner-console-input-cell"}),Q.consoleInputHeader=Object(F.createElement)("pre",{innerText:"> "}),Q.consoleInput=Object(F.createElement)("input",{type:"text",class:"bladeburner-console-input",tabIndex:1,onfocus:()=>{Q.consoleInput.value=Q.consoleInput.value}}),Q.consoleInputCell.appendChild(Q.consoleInputHeader),Q.consoleInputCell.appendChild(Q.consoleInput),Q.consoleInputRow.appendChild(Q.consoleInputCell),Q.consoleTable.appendChild(Q.consoleInputRow),Q.consoleDiv.appendChild(Q.consoleTable),Q.overviewConsoleParentDiv.appendChild(Q.overviewDiv),Q.overviewConsoleParentDiv.appendChild(Q.consoleDiv),Q.bladeburnerDiv.appendChild(Q.overviewConsoleParentDiv),Q.bladeburnerDiv.appendChild(Q.actionAndSkillsDiv);const e=Object(F.createElement)("div");if(e.innerHTML=`<span class="text">${q}= This action requires stealth, ${Y} = This action involves retirement</span>`,Q.bladeburnerDiv.appendChild(e),document.getElementById("entire-game-container").appendChild(Q.bladeburnerDiv),0===this.consoleLogs.length)this.postToConsole("Bladeburner Console BETA"),this.postToConsole("Type 'help' to see console commands");else for(let e=0;e<this.consoleLogs.length;++e)this.postToConsole(this.consoleLogs[e],!1);Q.consoleInput.focus()},X.prototype.clearContent=function(){Q.bladeburnerDiv instanceof Element&&(Object(L.removeChildrenFromElement)(Q.bladeburnerDiv),Object(U.removeElement)(Q.bladeburnerDiv)),Object(A.clearObject)(Q),this.initializeDomElementRefs()},X.prototype.createOverviewContent=function(){if(null==Q.overviewDiv)throw new Error("Bladeburner.createOverviewContent() called with DomElems.overviewDiv = null");Q.overviewRank=Object(F.createElement)("p",{innerText:"Rank: ",display:"inline-block",tooltip:"Your rank within the Bladeburner division"}),Q.overviewStamina=Object(F.createElement)("p",{display:"inline-block"}),Q.overviewStaminaHelpTip=Object(F.createElement)("div",{class:"help-tip",innerText:"?",clickListener:()=>{Object(_.dialogBoxCreate)("Performing actions will use up your stamina.<br><br>Your max stamina is determined primarily by your agility stat.<br><br>Your stamina gain rate is determined by both your agility and your max stamina. Higher max stamina leads to a higher gain rate.<br><br>Once your stamina falls below 50% of its max value, it begins to negatively affect the success rate of your contracts/operations. This penalty is shown in the overview panel. If the penalty is 15%, then this means your success rate would be multipled by 85% (100 - 15).<br><br>Your max stamina and stamina gain rate can also be increased by training, or through skills and Augmentation upgrades.")}}),Q.overviewGen1=Object(F.createElement)("p",{display:"block"}),Q.overviewEstPop=Object(F.createElement)("p",{innerText:"Est. Synthoid Population: ",display:"inline-block",tooltip:"This is your Bladeburner division's estimate of how many Synthoids exist in your current city."}),Q.overviewEstPopHelpTip=Object(F.createElement)("div",{innerText:"?",class:"help-tip",clickListener:()=>{Object(_.dialogBoxCreate)("The success rate of your contracts/operations depends on the population of Synthoids in your current city. The success rate that is shown to you is only an estimate, and it is based on your Synthoid population estimate.<br><br>Therefore, it is important that this Synthoid population estimate is accurate so that you have a better idea of your success rate for contracts/operations. Certain actions will increase the accuracy of your population estimate.<br><br>The Synthoid populations of cities can change due to your actions or random events. If random events occur, they will be logged in the Bladeburner Console.")}}),Q.overviewEstComms=Object(F.createElement)("p",{innerText:"Est. Synthoid Communities: ",display:"inline-block",tooltip:"This is your Bladeburner divison's estimate of how many Synthoid communities exist in your current city."}),Q.overviewChaos=Object(F.createElement)("p",{innerText:"City Chaos: ",display:"inline-block",tooltip:"The city's chaos level due to tensions and conflicts between humans and Synthoids. Having too high of a chaos level can make contracts and operations harder."}),Q.overviewBonusTime=Object(F.createElement)("p",{innerText:"Bonus time: ",display:"inline-block",tooltip:"You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by browser). Bonus time makes the Bladeburner mechanic progress faster, up to 5x the normal speed."}),Q.overviewSkillPoints=Object(F.createElement)("p",{display:"block"}),Q.overviewAugMults=Object(F.createElement)("div",{display:"block"}),Q.overviewDiv.appendChild(Q.overviewRank),Object(W.appendLineBreaks)(Q.overviewDiv,1),Q.overviewDiv.appendChild(Q.overviewStamina),Q.overviewDiv.appendChild(Q.overviewStaminaHelpTip),Q.overviewDiv.appendChild(Q.overviewGen1),Q.overviewDiv.appendChild(Q.overviewEstPop),Q.overviewDiv.appendChild(Q.overviewEstPopHelpTip),Object(W.appendLineBreaks)(Q.overviewDiv,1),Q.overviewDiv.appendChild(Q.overviewEstComms),Object(W.appendLineBreaks)(Q.overviewDiv,1),Q.overviewDiv.appendChild(Q.overviewChaos),Object(W.appendLineBreaks)(Q.overviewDiv,2),Q.overviewDiv.appendChild(Q.overviewBonusTime),Q.overviewDiv.appendChild(Q.overviewSkillPoints),Object(W.appendLineBreaks)(Q.overviewDiv,1),Q.overviewDiv.appendChild(Q.overviewAugMults),Object(W.appendLineBreaks)(Q.overviewDiv,1),Q.overviewDiv.appendChild(Object(F.createElement)("a",{innerHTML:"Travel",class:"a-link-button",display:"inline-block",clickListener:()=>{var e="bladeburner-travel-popup-cancel-btn",t=[];t.push(Object(F.createElement)("a",{innerText:"Cancel",class:"a-link-button",clickListener:()=>(Object(H.removeElementById)(e),!1)})),t.push(Object(F.createElement)("p",{innerText:"Travel to a different city for your Bladeburner activities. This does not cost any money. The city you are in for your Bladeburner duties does not affect your location in the game otherwise"}));for(var n=0;n<v.BladeburnerConstants.CityNames.length;++n)!function(n,r){t.push(Object(F.createElement)("div",{class:"cmpy-mgmt-find-employee-option",innerText:v.BladeburnerConstants.CityNames[r],clickListener:()=>(n.city=v.BladeburnerConstants.CityNames[r],Object(H.removeElementById)(e),n.updateOverviewContent(),!1)}))}(this,n);Object(j.createPopup)(e,t)}}));if(Object(c.factionExists)("Bladeburners")){var e=c.Factions.Bladeburners;if(!(e instanceof l.Faction))throw new Error("Could not properly get Bladeburner Faction object in Bladeburner UI Overview Faction button");Q.overviewDiv.appendChild(Object(F.createElement)("a",{innerText:"Faction",class:"a-link-button",display:"inline-block",tooltip:"Apply to the Bladeburner Faction, or go to the faction page if you are already a member",clickListener:()=>(e.isMember?(s.Engine.loadFactionContent(),Object(u.displayFactionContent)("Bladeburners")):this.rank>=v.BladeburnerConstants.RankNeededForFaction?(Object(u.joinFaction)(e),Object(_.dialogBoxCreate)("Congratulations! You were accepted into the Bladeburners faction"),Object(L.removeChildrenFromElement)(Q.overviewDiv),this.createOverviewContent()):Object(_.dialogBoxCreate)("You need a rank of 25 to join the Bladeburners Faction!"),!1)}))}Q.overviewDiv.appendChild(Object(F.createElement)("br")),Q.overviewDiv.appendChild(Object(F.createElement)("br")),this.updateOverviewContent()},X.prototype.createActionAndSkillsContent=function(){null==Q.currentTab&&(Q.currentTab="general"),Object(L.removeChildrenFromElement)(Q.actionAndSkillsDiv),Object(A.clearObject)(Q.generalActions),Object(A.clearObject)(Q.contracts),Object(A.clearObject)(Q.operations),Object(A.clearObject)(Q.blackops),Object(A.clearObject)(Q.skills);for(var e=Q.currentTab.toLowerCase(),t=["General","Contracts","Operations","BlackOps","Skills"],n=0;n<t.length;++n)!function(e,t,n,r){Q.actionAndSkillsDiv.appendChild(Object(F.createElement)("a",{innerText:e[t],class:r===e[t].toLowerCase()?"bladeburner-nav-button-inactive":"bladeburner-nav-button",clickListener:()=>(Q.currentTab=e[t].toLowerCase(),n.createActionAndSkillsContent(),!1)}))}(t,n,this,e);switch(Q.actionsAndSkillsDesc=Object(F.createElement)("p",{display:"block",margin:"4px",padding:"4px"}),Object(L.removeChildrenFromElement)(Q.actionsAndSkillsList),Q.actionsAndSkillsList=Object(F.createElement)("ul"),e){case"general":this.createGeneralActionsContent();break;case"contracts":this.createContractsContent();break;case"operations":this.createOperationsContent();break;case"blackops":this.createBlackOpsContent();break;case"skills":this.createSkillsContent();break;default:throw new Error("Invalid value for DomElems.currentTab in Bladeburner.createActionAndSkillsContent")}this.updateContent(),Q.actionAndSkillsDiv.appendChild(Q.actionsAndSkillsDesc),Q.actionAndSkillsDiv.appendChild(Q.actionsAndSkillsList)},X.prototype.createGeneralActionsContent=function(){if(null==Q.actionsAndSkillsList||null==Q.actionsAndSkillsDesc)throw new Error("Bladeburner.createGeneralActionsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");for(var e in Q.actionsAndSkillsDesc.innerText="These are generic actions that will assist you in your Bladeburner duties. They will not affect your Bladeburner rank in any way.",M.GeneralActions)M.GeneralActions.hasOwnProperty(e)&&(Q.generalActions[e]=Object(F.createElement)("div",{class:"bladeburner-action",name:e}),Q.actionsAndSkillsList.appendChild(Q.generalActions[e]))},X.prototype.createContractsContent=function(){if(null==Q.actionsAndSkillsList||null==Q.actionsAndSkillsDesc)throw new Error("Bladeburner.createContractsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");for(var e in Q.actionsAndSkillsDesc.innerHTML="Complete contracts in order to increase your Bladeburner rank and earn money. Failing a contract will cause you to lose HP, which can lead to hospitalization.<br><br>You can unlock higher-level contracts by successfully completing them. Higher-level contracts are more difficult, but grant more rank, experience, and money.",this.contracts)this.contracts.hasOwnProperty(e)&&(Q.contracts[e]=Object(F.createElement)("div",{class:"bladeburner-action",name:e}),Q.actionsAndSkillsList.appendChild(Q.contracts[e]))},X.prototype.createOperationsContent=function(){if(null==Q.actionsAndSkillsList||null==Q.actionsAndSkillsDesc)throw new Error("Bladeburner.createOperationsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");for(var e in Q.actionsAndSkillsDesc.innerHTML="Carry out operations for the Bladeburner division. Failing an operation will reduce your Bladeburner rank. It will also cause you to lose HP, which can lead to hospitalization. In general, operations are harder and more punishing than contracts, but are also more rewarding.<br><br>Operations can affect the chaos level and Synthoid population of your current city. The exact effects vary between different Operations.<br><br>For operations, you can use a team. You must first recruit team members. Having a larger team will improves your chances of success.<br><br>You can unlock higher-level operations by successfully completing them. Higher-level operations are more difficult, but grant more rank and experience.",this.operations)this.operations.hasOwnProperty(e)&&(Q.operations[e]=Object(F.createElement)("div",{class:"bladeburner-action",name:e}),Q.actionsAndSkillsList.appendChild(Q.operations[e]))},X.prototype.createBlackOpsContent=function(){if(null==Q.actionsAndSkillsList||null==Q.actionsAndSkillsDesc)throw new Error("Bladeburner.createBlackOpsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");Q.actionsAndSkillsDesc.innerHTML="Black Operations (Black Ops) are special, one-time covert operations. Each Black Op must be unlocked successively by completing the one before it.<br><br><b>Your ultimate goal to climb through the ranks of Bladeburners is to complete all of the Black Ops.</b><br><br>Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank losses.";var e=[];for(var t in S.BlackOperations)S.BlackOperations.hasOwnProperty(t)&&e.push(S.BlackOperations[t]);e.sort(function(e,t){return e.reqdRank-t.reqdRank});for(var n=e.length-1;n>=0;--n)null==this.blackops[[e[n].name]]&&0!==n&&null==this.blackops[[e[n-1].name]]||(Q.blackops[e[n].name]=Object(F.createElement)("div",{class:"bladeburner-action",name:e[n].name}),Q.actionsAndSkillsList.appendChild(Q.blackops[e[n].name]))},X.prototype.createSkillsContent=function(){if(null==Q.actionsAndSkillsList||null==Q.actionsAndSkillsDesc)throw new Error("Bladeburner.createSkillsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");Q.actionsAndSkillsDesc.innerHTML="You will gain one skill point every "+v.BladeburnerConstants.RanksPerSkillPoint+" ranks.<br><br>Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different skills with each other is multiplicative.<br><br>";for(var e=Object.keys(this.skillMultipliers),t=0;t<e.length;++t){var n=this.skillMultipliers[e[t]];if(n&&1!==n)switch(n=Object(f.formatNumber)(n,3),e[t]){case"successChanceAll":Q.actionsAndSkillsDesc.innerHTML+="Total Success Chance: x"+n+"<br>";break;case"successChanceStealth":Q.actionsAndSkillsDesc.innerHTML+="Stealth Success Chance: x"+n+"<br>";break;case"successChanceKill":Q.actionsAndSkillsDesc.innerHTML+="Retirement Success Chance: x"+n+"<br>";break;case"successChanceContract":Q.actionsAndSkillsDesc.innerHTML+="Contract Success Chance: x"+n+"<br>";break;case"successChanceOperation":Q.actionsAndSkillsDesc.innerHTML+="Operation Success Chance: x"+n+"<br>";break;case"successChanceEstimate":Q.actionsAndSkillsDesc.innerHTML+="Synthoid Data Estimate: x"+n+"<br>";break;case"actionTime":Q.actionsAndSkillsDesc.innerHTML+="Action Time: x"+n+"<br>";break;case"effHack":Q.actionsAndSkillsDesc.innerHTML+="Hacking Skill: x"+n+"<br>";break;case"effStr":Q.actionsAndSkillsDesc.innerHTML+="Strength: x"+n+"<br>";break;case"effDef":Q.actionsAndSkillsDesc.innerHTML+="Defense: x"+n+"<br>";break;case"effDex":Q.actionsAndSkillsDesc.innerHTML+="Dexterity: x"+n+"<br>";break;case"effAgi":Q.actionsAndSkillsDesc.innerHTML+="Agility: x"+n+"<br>";break;case"effCha":Q.actionsAndSkillsDesc.innerHTML+="Charisma: x"+n+"<br>";break;case"effInt":Q.actionsAndSkillsDesc.innerHTML+="Intelligence: x"+n+"<br>";break;case"stamina":Q.actionsAndSkillsDesc.innerHTML+="Stamina: x"+n+"<br>";break;case"money":Q.actionsAndSkillsDesc.innerHTML+="Contract Money: x"+n+"<br>";break;case"expGain":Q.actionsAndSkillsDesc.innerHTML+="Exp Gain: x"+n+"<br>";break;default:console.warn(`Unrecognized SkillMult Key: ${e[t]}`)}}for(var r in Q.skillPointsDisplay=Object(F.createElement)("p",{innerHTML:"<br><strong>Skill Points: "+Object(f.formatNumber)(this.skillPoints,0)+"</strong>"}),Q.actionAndSkillsDiv.appendChild(Q.skillPointsDisplay),C.Skills)C.Skills.hasOwnProperty(r)&&(Q.skills[r]=Object(F.createElement)("div",{class:"bladeburner-action",name:r}),Q.actionsAndSkillsList.appendChild(Q.skills[r]))},X.prototype.updateContent=function(){this.updateOverviewContent(),this.updateActionAndSkillsContent()},X.prototype.updateOverviewContent=function(){h.routing.isOn(h.Page.Bladeburner)&&(Q.overviewRank.childNodes[0].nodeValue="Rank: "+Object(f.formatNumber)(this.rank,2),Q.overviewStamina.innerText="Stamina: "+Object(f.formatNumber)(this.stamina,3)+" / "+Object(f.formatNumber)(this.maxStamina,3),Q.overviewGen1.innerHTML="Stamina Penalty: "+Object(f.formatNumber)(100*(1-this.calculateStaminaPenalty()),1)+"%<br><br>Team Size: "+Object(f.formatNumber)(this.teamSize,0)+"<br>Team Members Lost: "+Object(f.formatNumber)(this.teamLost,0)+"<br><br>Num Times Hospitalized: "+this.numHosp+"<br>Money Lost From Hospitalizations: "+d.numeralWrapper.format(this.moneyLost,"$0.000a")+"<br><br>Current City: "+this.city+"<br>",Q.overviewEstPop.childNodes[0].nodeValue="Est. Synthoid Population: "+d.numeralWrapper.format(this.getCurrentCity().popEst,"0.000a"),Q.overviewEstComms.childNodes[0].nodeValue="Est. Synthoid Communities: "+Object(f.formatNumber)(this.getCurrentCity().comms,0),Q.overviewChaos.childNodes[0].nodeValue="City Chaos: "+Object(f.formatNumber)(this.getCurrentCity().chaos),Q.overviewSkillPoints.innerText="Skill Points: "+Object(f.formatNumber)(this.skillPoints,0),Q.overviewBonusTime.childNodes[0].nodeValue="Bonus time: "+Object(f.convertTimeMsToTimeElapsedString)(this.storedCycles/v.BladeburnerConstants.CyclesPerSecond*1e3),$.a.render(Object(G.StatsTable)([["Aug. Success Chance mult: ",Object(f.formatNumber)(100*m.Player.bladeburner_success_chance_mult,1)+"%"],["Aug. Max Stamina mult: ",Object(f.formatNumber)(100*m.Player.bladeburner_max_stamina_mult,1)+"%"],["Aug. Stamina Gain mult: ",Object(f.formatNumber)(100*m.Player.bladeburner_stamina_gain_mult,1)+"%"],["Aug. Field Analysis mult: ",Object(f.formatNumber)(100*m.Player.bladeburner_analysis_mult,1)+"%"]]),Q.overviewAugMults))},X.prototype.updateActionAndSkillsContent=function(){switch(null==Q.currentTab&&(Q.currentTab="general"),Q.currentTab.toLowerCase()){case"general":for(var e=Object.keys(Q.generalActions),t=0;t<e.length;++t){var n=Q.generalActions[e[t]],r=n.name,a=M.GeneralActions[r];if(null==a)throw new Error("Could not find Object "+r+" in Bladeburner.updateActionAndSkillsContent()");this.action.type===x.ActionTypes[r]?n.classList.add(z):n.classList.remove(z),this.updateGeneralActionsUIElement(n,a)}break;case"contracts":var i=Object.keys(Q.contracts);for(t=0;t<i.length;++t){var o=Q.contracts[i[t]];r=o.name;this.action.type===x.ActionTypes.Contract&&r===this.action.name?o.classList.add(z):o.classList.remove(z);var s=this.contracts[r];if(null==s)throw new Error("Could not find Contract "+r+" in Bladeburner.updateActionAndSkillsContent()");this.updateContractsUIElement(o,s)}break;case"operations":var l=Object.keys(Q.operations);for(t=0;t<l.length;++t){var c=Q.operations[l[t]];r=c.name;this.action.type===x.ActionTypes.Operation&&r===this.action.name?c.classList.add(z):c.classList.remove(z);var u=this.operations[r];if(null==u)throw new Error("Could not find Operation "+r+" in Bladeburner.updateActionAndSkillsContent()");this.updateOperationsUIElement(c,u)}break;case"blackops":var m=Object.keys(Q.blackops);for(t=0;t<m.length;++t){var p=Q.blackops[m[t]];r=p.name;this.action.type===x.ActionTypes.BlackOperation&&r===this.action.name?p.classList.add(z):p.classList.remove(z);var h=S.BlackOperations[r];if(null==h)throw new Error("Could not find BlackOperation "+r+" in Bladeburner.updateActionAndSkillsContent()");this.updateBlackOpsUIElement(p,h)}break;case"skills":Q.skillPointsDisplay.innerHTML="<br><strong>Skill Points: "+Object(f.formatNumber)(this.skillPoints,0)+"</strong>";var d=Object.keys(Q.skills);for(t=0;t<d.length;++t){var _=Q.skills[d[t]],g=(r=_.name,C.Skills[r]);if(null==g)throw new Error("Could not find Skill "+r+" in Bladeburner.updateActionAndSkillsContent()");this.updateSkillsUIElement(_,g)}break;default:throw new Error("Invalid value for DomElems.currentTab in Bladeburner.createActionAndSkillsContent")}},X.prototype.updateGeneralActionsUIElement=function(e,t){Object(L.removeChildrenFromElement)(e);var n=e.classList.contains(z);if(e.appendChild(Object(F.createElement)("h2",{innerText:n?t.name+" (IN PROGRESS - "+Object(f.formatNumber)(this.actionTimeCurrent,0)+" / "+Object(f.formatNumber)(this.actionTimeToComplete,0)+")":t.name,display:"inline-block"})),n){var r=this.actionTimeCurrent/this.actionTimeToComplete;e.appendChild(Object(F.createElement)("p",{display:"block",innerText:Object(N.createProgressBarText)({progress:r})}))}else e.appendChild(Object(F.createElement)("a",{innerText:"Start",class:"a-link-button",margin:"3px",padding:"3px",clickListener:()=>(this.action.type=x.ActionTypes[t.name],this.action.name=t.name,this.startAction(this.action),this.updateActionAndSkillsContent(),!1)}));Object(W.appendLineBreaks)(e,2),e.appendChild(Object(F.createElement)("pre",{innerHTML:t.desc,display:"inline-block"}))},X.prototype.updateContractsUIElement=function(e,t){Object(L.removeChildrenFromElement)(e);var n=e.classList.contains(z),r=t.getSuccessChance(this,{est:!0});if(e.appendChild(Object(F.createElement)("h2",{innerText:n?t.name+" (IN PROGRESS - "+Object(f.formatNumber)(this.actionTimeCurrent,0)+" / "+Object(f.formatNumber)(this.actionTimeToComplete,0)+")":t.name,display:"inline-block"})),n){var a=this.actionTimeCurrent/this.actionTimeToComplete;e.appendChild(Object(F.createElement)("p",{display:"block",innerText:Object(N.createProgressBarText)({progress:a})}))}else e.appendChild(Object(F.createElement)("a",{innerText:"Start",class:"a-link-button",padding:"3px",margin:"3px",clickListener:()=>(this.action.type=x.ActionTypes.Contract,this.action.name=t.name,this.startAction(this.action),this.updateActionAndSkillsContent(),!1)}));var i=t.level>=t.maxLevel;Object(W.appendLineBreaks)(e,2),e.appendChild(Object(F.createElement)("pre",{display:"inline-block",innerText:"Level: "+t.level+" / "+t.maxLevel,tooltip:t.getSuccessesNeededForNextLevel(v.BladeburnerConstants.ContractSuccessesPerLevel)+" successes needed for next level"})),e.appendChild(Object(F.createElement)("a",{class:i?"a-link-button-inactive":"a-link-button",innerHTML:"↑",padding:"2px",margin:"2px",tooltip:n?"WARNING: changing the level will restart the contract":"",display:"inline",clickListener:()=>(++t.level,n&&this.startAction(this.action),this.updateContractsUIElement(e,t),!1)})),e.appendChild(Object(F.createElement)("a",{class:t.level<=1?"a-link-button-inactive":"a-link-button",innerHTML:"↓",padding:"2px",margin:"2px",tooltip:n?"WARNING: changing the level will restart the contract":"",display:"inline",clickListener:()=>(--t.level,n&&this.startAction(this.action),this.updateContractsUIElement(e,t),!1)}));var o=t.getActionTime(this);Object(W.appendLineBreaks)(e,2),e.appendChild(Object(F.createElement)("pre",{display:"inline-block",innerHTML:t.desc+"\n\n"+`Estimated success chance: ${Object(f.formatNumber)(100*r,1)}% ${t.isStealth?q:""}${t.isKill?Y:""}\n`+"Time Required (s): "+Object(f.formatNumber)(o,0)+"\nContracts remaining: "+Math.floor(t.count)+"\nSuccesses: "+t.successes+"\nFailures: "+t.failures})),e.appendChild(Object(F.createElement)("br"));var s="bladeburner-"+t.name+"-autolevel-checkbox";e.appendChild(Object(F.createElement)("label",{for:s,innerText:"Autolevel: ",color:"white",tooltip:"Automatically increase contract level when possible"}));const l=Object(F.createElement)("input",{type:"checkbox",id:s,checked:t.autoLevel,changeListener:()=>{t.autoLevel=l.checked}});e.appendChild(l)},X.prototype.updateOperationsUIElement=function(e,t){Object(L.removeChildrenFromElement)(e);var n=e.classList.contains(z),r=t.getSuccessChance(this,{est:!0});if(e.appendChild(Object(F.createElement)("h2",{innerText:n?t.name+" (IN PROGRESS - "+Object(f.formatNumber)(this.actionTimeCurrent,0)+" / "+Object(f.formatNumber)(this.actionTimeToComplete,0)+")":t.name,display:"inline-block"})),n){var a=this.actionTimeCurrent/this.actionTimeToComplete;e.appendChild(Object(F.createElement)("p",{display:"block",innerText:Object(N.createProgressBarText)({progress:a})}))}else e.appendChild(Object(F.createElement)("a",{innerText:"Start",class:"a-link-button",margin:"3px",padding:"3px",clickListener:()=>(this.action.type=x.ActionTypes.Operation,this.action.name=t.name,this.startAction(this.action),this.updateActionAndSkillsContent(),!1)})),e.appendChild(Object(F.createElement)("a",{innerText:"Set Team Size (Curr Size: "+Object(f.formatNumber)(t.teamCount,0)+")",class:"a-link-button",margin:"3px",padding:"3px",clickListener:()=>{var n="bladeburner-operation-set-team-size-popup",r=Object(F.createElement)("p",{innerText:"Enter the amount of team members you would like to take on these operations. If you do not have the specified number of team members, then as many as possible will be used. Note that team members may be lost during operations."}),a=Object(F.createElement)("input",{type:"number",placeholder:"Team size",class:"text-input"}),i=Object(F.createElement)("a",{innerText:"Confirm",class:"a-link-button",clickListener:()=>{var r=Math.round(parseFloat(a.value));return isNaN(r)?Object(_.dialogBoxCreate)("Invalid value entered for number of Team Members (must be numeric)"):(t.teamCount=r,this.updateOperationsUIElement(e,t)),Object(H.removeElementById)(n),!1}}),o=Object(F.createElement)("a",{innerText:"Cancel",class:"a-link-button",clickListener:()=>(Object(H.removeElementById)(n),!1)});Object(j.createPopup)(n,[r,a,i,o])}}));var i=t.level>=t.maxLevel;Object(W.appendLineBreaks)(e,2),e.appendChild(Object(F.createElement)("pre",{display:"inline-block",innerText:"Level: "+t.level+" / "+t.maxLevel,tooltip:t.getSuccessesNeededForNextLevel(v.BladeburnerConstants.OperationSuccessesPerLevel)+" successes needed for next level"})),e.appendChild(Object(F.createElement)("a",{class:i?"a-link-button-inactive":"a-link-button",innerHTML:"↑",padding:"2px",margin:"2px",tooltip:n?"WARNING: changing the level will restart the Operation":"",display:"inline",clickListener:()=>(++t.level,n&&this.startAction(this.action),this.updateOperationsUIElement(e,t),!1)})),e.appendChild(Object(F.createElement)("a",{class:t.level<=1?"a-link-button-inactive":"a-link-button",innerHTML:"↓",padding:"2px",margin:"2px",tooltip:n?"WARNING: changing the level will restart the Operation":"",display:"inline",clickListener:()=>(--t.level,n&&this.startAction(this.action),this.updateOperationsUIElement(e,t),!1)}));t.getDifficulty();var o=t.getActionTime(this);Object(W.appendLineBreaks)(e,2),e.appendChild(Object(F.createElement)("pre",{display:"inline-block",innerHTML:t.desc+"\n\n"+`Estimated success chance: ${Object(f.formatNumber)(100*r,1)}% ${t.isStealth?q:""}${t.isKill?Y:""}\n`+"Time Required(s): "+Object(f.formatNumber)(o,0)+"\nOperations remaining: "+Math.floor(t.count)+"\nSuccesses: "+t.successes+"\nFailures: "+t.failures})),e.appendChild(Object(F.createElement)("br"));var s="bladeburner-"+t.name+"-autolevel-checkbox";e.appendChild(Object(F.createElement)("label",{for:s,innerText:"Autolevel: ",color:"white",tooltip:"Automatically increase operation level when possible"}));const l=Object(F.createElement)("input",{type:"checkbox",id:s,checked:t.autoLevel,changeListener:()=>{t.autoLevel=l.checked}});e.appendChild(l)},X.prototype.updateBlackOpsUIElement=function(e,t){Object(L.removeChildrenFromElement)(e);var n=e.classList.contains(z),r=null!=this.blackops[t.name],a=t.getSuccessChance(this,{est:!0}),i=(t.getDifficulty(),t.getActionTime(this)),o=this.rank>=t.reqdRank;if(r)e.appendChild(Object(F.createElement)("h2",{innerText:t.name+" (COMPLETED)",display:"block"}));else{if(e.appendChild(Object(F.createElement)("h2",{innerText:n?t.name+" (IN PROGRESS - "+Object(f.formatNumber)(this.actionTimeCurrent,0)+" / "+Object(f.formatNumber)(this.actionTimeToComplete,0)+")":t.name,display:"inline-block"})),n){var s=this.actionTimeCurrent/this.actionTimeToComplete;e.appendChild(Object(F.createElement)("p",{display:"block",innerText:Object(N.createProgressBarText)({progress:s})}))}else e.appendChild(Object(F.createElement)("a",{innerText:"Start",margin:"3px",padding:"3px",class:o?"a-link-button":"a-link-button-inactive",clickListener:()=>(this.action.type=x.ActionTypes.BlackOperation,this.action.name=t.name,this.startAction(this.action),this.updateActionAndSkillsContent(),!1)})),e.appendChild(Object(F.createElement)("a",{innerText:"Set Team Size (Curr Size: "+Object(f.formatNumber)(t.teamCount,0)+")",class:"a-link-button",margin:"3px",padding:"3px",clickListener:()=>{var n="bladeburner-operation-set-team-size-popup",r=Object(F.createElement)("p",{innerText:"Enter the amount of team members you would like to take on this BlackOp. If you do not have the specified number of team members, then as many as possible will be used. Note that team members may be lost during operations."}),a=Object(F.createElement)("input",{type:"number",placeholder:"Team size",class:"text-input"}),i=Object(F.createElement)("a",{innerText:"Confirm",class:"a-link-button",clickListener:()=>{var r=Math.round(parseFloat(a.value));return isNaN(r)?Object(_.dialogBoxCreate)("Invalid value entered for number of Team Members (must be numeric)"):(t.teamCount=r,this.updateBlackOpsUIElement(e,t)),Object(H.removeElementById)(n),!1}}),o=Object(F.createElement)("a",{innerText:"Cancel",class:"a-link-button",clickListener:()=>(Object(H.removeElementById)(n),!1)});Object(j.createPopup)(n,[r,a,i,o])}}));Object(W.appendLineBreaks)(e,2),e.appendChild(Object(F.createElement)("p",{display:"inline-block",innerHTML:"<br>"+t.desc+"<br><br>"})),e.appendChild(Object(F.createElement)("p",{display:"block",color:o?"white":"red",innerHTML:"Required Rank: "+Object(f.formatNumber)(t.reqdRank,0)+"<br>"})),e.appendChild(Object(F.createElement)("p",{display:"inline-block",innerHTML:`Estimated Success Chance: ${Object(f.formatNumber)(100*a,1)}% ${t.isStealth?q:""}${t.isKill?Y:""}\n`+"Time Required(s): "+Object(f.formatNumber)(i,0)}))}},X.prototype.updateSkillsUIElement=function(e,t){Object(L.removeChildrenFromElement)(e);var n=t.name,r=0;this.skills[n]&&!isNaN(this.skills[n])&&(r=this.skills[n]);var a=t.calculateCost(r);e.appendChild(Object(F.createElement)("h2",{innerText:t.name+" (Lvl "+r+")",display:"inline-block"}));var i=this.skillPoints>=a,o=!!t.maxLvl&&r>=t.maxLvl;e.appendChild(Object(F.createElement)("a",{innerText:"Level",display:"inline-block",class:i&&!o?"a-link-button":"a-link-button-inactive",margin:"3px",padding:"3px",clickListener:()=>{if(!(this.skillPoints<a))return this.skillPoints-=a,this.upgradeSkill(t),this.createActionAndSkillsContent(),!1}})),Object(W.appendLineBreaks)(e,2),o?e.appendChild(Object(F.createElement)("p",{color:"red",display:"block",innerText:"MAX LEVEL"})):e.appendChild(Object(F.createElement)("p",{display:"block",innerText:"Skill Points required: "+Object(f.formatNumber)(a,0)})),e.appendChild(Object(F.createElement)("p",{innerHTML:t.desc,display:"inline-block"}))},X.prototype.postToConsole=function(t,n=!0){!0===n&&(this.consoleLogs.push(t),this.consoleLogs.length>100&&this.consoleLogs.shift()),null!=t&&null!=Q.consoleDiv&&(e("#bladeubrner-console-input-row").before('<tr><td class="bladeburner-console-line" style="color: var(--my-font-color); white-space:pre-wrap;">'+t+"</td></tr>"),Q.consoleTable.childNodes.length>100&&Q.consoleTable.removeChild(Q.consoleTable.firstChild),this.updateConsoleScroll())},X.prototype.updateConsoleScroll=function(){Q.consoleDiv.scrollTop=Q.consoleDiv.scrollHeight},X.prototype.resetConsoleInput=function(){Q.consoleInput.value=""},X.prototype.clearConsole=function(){for(;Q.consoleTable.childNodes.length>1;)Q.consoleTable.removeChild(Q.consoleTable.firstChild);this.consoleLogs.length=0},X.prototype.log=function(e){this.postToConsole(`[${Object(I.getTimestamp)()}] ${e}`)},X.prototype.executeConsoleCommands=function(e){try{this.consoleHistory[this.consoleHistory.length-1]!=e&&(this.consoleHistory.push(e),this.consoleHistory.length>50&&this.consoleHistory.splice(0,1)),V=this.consoleHistory.length;const t=e.split(";");for(let e=0;e<t.length;++e)this.executeConsoleCommand(t[e])}catch(e){Object(R.exceptionAlert)(e)}},X.prototype.executeConsoleCommand=function(e){e=(e=e.trim()).replace(/\s\s+/g," ");var t=this.parseCommandArguments(e);if(!(t.length<=0))switch(t[0].toLowerCase()){case"automate":this.executeAutomateConsoleCommand(t);break;case"clear":case"cls":this.clearConsole();break;case"help":this.executeHelpConsoleCommand(t);break;case"log":this.executeLogConsoleCommand(t);break;case"skill":this.executeSkillConsoleCommand(t);break;case"start":this.executeStartConsoleCommand(t);break;case"stop":this.resetAction();break;default:this.postToConsole("Invalid console command")}},X.prototype.parseCommandArguments=function(e){const t=[];let n=0,r=0;for(;r<e.length;){const a=e.charAt(r);if('"'===a){const a=e.indexOf('"',r+1);if(-1!==a&&(a===e.length-1||" "===e.charAt(a+1))){t.push(e.substr(r+1,a-r-1)),n=r=a===e.length-1?a+1:a+2;continue}}else if("'"===a){const a=e.indexOf("'",r+1);if(-1!==a&&(a===e.length-1||" "===e.charAt(a+1))){t.push(e.substr(r+1,a-r-1)),n=r=a===e.length-1?a+1:a+2;continue}}else" "===a&&(t.push(e.substr(n,r-n)),n=r+1);++r}return n!==r&&t.push(e.substr(n,r-n)),t},X.prototype.executeAutomateConsoleCommand=function(e){if(2===e.length||4===e.length)if(2!==e.length)if(4!==e.length);else{var t=e[1],n=e[2],r=!1;switch(e[3].toLowerCase().includes("hi")&&(r=!0),t){case"general":case"gen":if(null!=M.GeneralActions[n]){var a=new J({type:x.ActionTypes[n],name:n});r?this.automateActionHigh=a:this.automateActionLow=a,this.log("Automate ("+(r?"HIGH":"LOW")+") action set to "+n)}else this.postToConsole("Invalid action name specified: "+n);break;case"contract":case"contracts":if(null!=this.contracts[n]){a=new J({type:x.ActionTypes.Contract,name:n});r?this.automateActionHigh=a:this.automateActionLow=a,this.log("Automate ("+(r?"HIGH":"LOW")+") action set to "+n)}else this.postToConsole("Invalid contract name specified: "+n);break;case"ops":case"op":case"operations":case"operation":if(null!=this.operations[n]){a=new J({type:x.ActionTypes.Operation,name:n});r?this.automateActionHigh=a:this.automateActionLow=a,this.log("Automate ("+(r?"HIGH":"LOW")+") action set to "+n)}else this.postToConsole("Invalid Operation name specified: "+n);break;case"stamina":isNaN(n)?this.postToConsole("Invalid value specified for stamina threshold (must be numeric): "+n):(r?this.automateThreshHigh=Number(n):this.automateThreshLow=Number(n),this.log("Automate ("+(r?"HIGH":"LOW")+") stamina threshold set to "+n))}}else{var i=e[1];if("status"===i.toLowerCase())this.postToConsole("Automation: "+(this.automateEnabled?"enabled":"disabled")),this.automateEnabled&&this.postToConsole("When your stamina drops to "+Object(f.formatNumber)(this.automateThreshLow,0)+", you will automatically switch to "+this.automateActionLow.name+". When your stamina recovers to "+Object(f.formatNumber)(this.automateThreshHigh,0)+", you will automatically switch to "+this.automateActionHigh.name+".");else if(i.toLowerCase().includes("en")){if(!(this.automateActionLow instanceof J&&this.automateActionHigh instanceof J))return this.log("Failed to enable automation. Actions were not set");this.automateEnabled=!0,this.log("Bladeburner automation enabled")}else i.toLowerCase().includes("d")?(this.automateEnabled=!1,this.log("Bladeburner automation disabled")):this.log("Invalid argument for 'automate' console command: "+e[1])}else this.postToConsole("Invalid use of 'automate' command: automate [var] [val] [hi/low]. Use 'help automate' for more info")},X.prototype.executeHelpConsoleCommand=function(e){if(1===e.length)for(const e of b.ConsoleHelpText.helpList)this.postToConsole(e);else for(var t=1;t<e.length;++t){const n=b.ConsoleHelpText[e[t]];for(const e of n)this.postToConsole(e)}},X.prototype.executeLogConsoleCommand=function(e){if(e.length<3)return this.postToConsole("Invalid usage of log command: log [enable/disable] [action/event]"),void this.postToConsole("Use 'help log' for more details and examples");var t=!0;switch(e[1].toLowerCase().includes("d")&&(t=!1),e[2].toLowerCase()){case"general":case"gen":this.logging.general=t,this.log("Logging "+(t?"enabled":"disabled")+" for general actions");break;case"contract":case"contracts":this.logging.contracts=t,this.log("Logging "+(t?"enabled":"disabled")+" for Contracts");break;case"ops":case"op":case"operations":case"operation":this.logging.ops=t,this.log("Logging "+(t?"enabled":"disabled")+" for Operations");break;case"blackops":case"blackop":case"black operations":case"black operation":this.logging.blackops=t,this.log("Logging "+(t?"enabled":"disabled")+" for BlackOps");break;case"event":case"events":this.logging.events=t,this.log("Logging "+(t?"enabled":"disabled")+" for events");break;case"all":this.logging.general=t,this.logging.contracts=t,this.logging.ops=t,this.logging.blackops=t,this.logging.events=t,this.log("Logging "+(t?"enabled":"disabled")+" for everything");break;default:this.postToConsole("Invalid action/event type specified: "+e[2]),this.postToConsole("Examples of valid action/event identifiers are: [general, contracts, ops, blackops, events]")}},X.prototype.executeSkillConsoleCommand=function(e){switch(e.length){case 1:this.postToConsole("Invalid usage of 'skill' console command: skill [action] [name]"),this.postToConsole("Use 'help skill' for more info");break;case 2:if("list"===e[1].toLowerCase()){this.postToConsole("Skills: ");for(var t=Object.keys(C.Skills),n=0;n<t.length;++n){var r=C.Skills[t[n]],a=0;null!=this.skills[r.name]&&(a=this.skills[r.name]),this.postToConsole(r.name+": Level "+Object(f.formatNumber)(a,0))}this.postToConsole(" "),this.postToConsole("Effects: ");var i=Object.keys(this.skillMultipliers);for(n=0;n<i.length;++n){var o=this.skillMultipliers[i[n]];if(o&&1!==o)switch(o=Object(f.formatNumber)(o,3),i[n]){case"successChanceAll":this.postToConsole("Total Success Chance: x"+o);break;case"successChanceStealth":this.postToConsole("Stealth Success Chance: x"+o);break;case"successChanceKill":this.postToConsole("Retirement Success Chance: x"+o);break;case"successChanceContract":this.postToConsole("Contract Success Chance: x"+o);break;case"successChanceOperation":this.postToConsole("Operation Success Chance: x"+o);break;case"successChanceEstimate":this.postToConsole("Synthoid Data Estimate: x"+o);break;case"actionTime":this.postToConsole("Action Time: x"+o);break;case"effHack":this.postToConsole("Hacking Skill: x"+o);break;case"effStr":this.postToConsole("Strength: x"+o);break;case"effDef":this.postToConsole("Defense: x"+o);break;case"effDex":this.postToConsole("Dexterity: x"+o);break;case"effAgi":this.postToConsole("Agility: x"+o);break;case"effCha":this.postToConsole("Charisma: x"+o);break;case"effInt":this.postToConsole("Intelligence: x"+o);break;case"stamina":this.postToConsole("Stamina: x"+o);break;default:console.warn(`Unrecognized SkillMult Key: ${i[n]}`)}}}else this.postToConsole("Invalid usage of 'skill' console command: skill [action] [name]"),this.postToConsole("Use 'help skill' for more info");break;case 3:var s=e[2];if(null==(r=C.Skills[s])||!(r instanceof k.Skill))return this.postToConsole("Invalid skill name (Note that this is case-sensitive): "+s);if("list"===e[1].toLowerCase()){let e=0;void 0!==this.skills[r.name]&&(e=this.skills[r.name]),this.postToConsole(r.name+": Level "+Object(f.formatNumber)(e),0)}else if("level"===e[1].toLowerCase()){var l=0;this.skills[s]&&!isNaN(this.skills[s])&&(l=this.skills[s]);var c=r.calculateCost(l);this.skillPoints>=c?(this.skillPoints-=c,this.upgradeSkill(r),this.log(r.name+" upgraded to Level "+this.skills[s]),this.createActionAndSkillsContent()):this.postToConsole("You do not have enough Skill Points to upgrade this. You need "+Object(f.formatNumber)(c,0))}else this.postToConsole("Invalid usage of 'skill' console command: skill [action] [name]"),this.postToConsole("Use 'help skill' for more info");break;default:this.postToConsole("Invalid usage of 'skill' console command: skill [action] [name]"),this.postToConsole("Use 'help skill' for more info")}},X.prototype.executeStartConsoleCommand=function(e){if(3!==e.length)return this.postToConsole("Invalid usage of 'start' console command: start [type] [name]"),void this.postToConsole("Use 'help start' for more info");var t=e[2];switch(e[1].toLowerCase()){case"general":case"gen":null!=M.GeneralActions[t]?(this.action.type=x.ActionTypes[t],this.action.name=t,this.startAction(this.action),this.updateActionAndSkillsContent()):this.postToConsole("Invalid action name specified: "+e[2]);break;case"contract":case"contracts":null!=this.contracts[t]?(this.action.type=x.ActionTypes.Contract,this.action.name=t,this.startAction(this.action),this.updateActionAndSkillsContent()):this.postToConsole("Invalid contract name specified: "+e[2]);break;case"ops":case"op":case"operations":case"operation":null!=this.operations[t]?(this.action.type=x.ActionTypes.Operation,this.action.name=t,this.startAction(this.action),this.updateActionAndSkillsContent()):this.postToConsole("Invalid Operation name specified: "+e[2]);break;case"blackops":case"blackop":case"black operations":case"black operation":null!=S.BlackOperations[t]?(this.action.type=x.ActionTypes.BlackOperation,this.action.name=t,this.startAction(this.action),this.updateActionAndSkillsContent()):this.postToConsole("Invalid BlackOp name specified: "+e[2]);break;default:this.postToConsole("Invalid action/event type specified: "+e[1]),this.postToConsole("Examples of valid action/event identifiers are: [general, contract, op, blackop]")}},X.prototype.getActionIdFromTypeAndName=function(e="",t=""){if(""===e||""===t)return null;var n=new J,r=e.toLowerCase().trim(),a=t.toLowerCase().trim();switch(r){case"contract":case"contracts":case"contr":return n.type=x.ActionTypes.Contract,this.contracts.hasOwnProperty(t)?(n.name=t,n):null;case"operation":case"operations":case"op":case"ops":return n.type=x.ActionTypes.Operation,this.operations.hasOwnProperty(t)?(n.name=t,n):null;case"blackoperation":case"black operation":case"black operations":case"black op":case"black ops":case"blackop":case"blackops":return n.type=x.ActionTypes.BlackOp,S.BlackOperations.hasOwnProperty(t)?(n.name=t,n):null;case"general":case"general action":case"gen":break;default:return null}if(r.startsWith("gen")){switch(a){case"training":n.type=x.ActionTypes.Training,n.name="Training";break;case"recruitment":case"recruit":n.type=x.ActionTypes.Recruitment,n.name="Recruitment";break;case"field analysis":case"fieldanalysis":n.type=x.ActionTypes["Field Analysis"],n.name="Field Analysis";break;case"diplomacy":n.type=x.ActionTypes.Diplomacy,n.name="Diplomacy";break;case"hyperbolic regeneration chamber":n.type=x.ActionTypes["Hyperbolic Regeneration Chamber"],n.name="Hyperbolic Regeneration Chamber";break;default:return null}return n}},X.prototype.getTypeAndNameFromActionId=function(e){var t={};let n=Object.keys(x.ActionTypes);for(let r=0;r<n.length;++r)if(e.type===x.ActionTypes[n[r]]){t.type=n[r];break}return null==t.type&&(t.type="Idle"),t.name=null!=e.name?e.name:"Idle",t},X.prototype.getContractNamesNetscriptFn=function(){return Object.keys(this.contracts)},X.prototype.getOperationNamesNetscriptFn=function(){return Object.keys(this.operations)},X.prototype.getBlackOpNamesNetscriptFn=function(){return Object.keys(S.BlackOperations)},X.prototype.getGeneralActionNamesNetscriptFn=function(){return Object.keys(M.GeneralActions)},X.prototype.getSkillNamesNetscriptFn=function(){return Object.keys(C.Skills)},X.prototype.startActionNetscriptFn=function(e,t,n){const r=`Invalid action: type='${e}' name='${t}'`,a=this.getActionIdFromTypeAndName(e,t);if(null==a)return n.log("bladeburner.startAction",r),!1;if(a.type===x.ActionTypes.BlackOp){if(this.getActionObject(a).reqdRank>this.rank)return n.log("bladeburner.startAction",`Insufficient rank to start Black Op '${a.name}'.`),!1;if(null!=this.blackops[a.name])return n.log("bladeburner.startAction",`Black Op ${a.name} has already been completed.`),!1;var i=[];for(const e in S.BlackOperations)S.BlackOperations.hasOwnProperty(e)&&i.push(e);i.sort(function(e,t){return S.BlackOperations[e].reqdRank-S.BlackOperations[t].reqdRank});let e=i.indexOf(a.name);if(-1===e)return n.log("bladeburner.startAction",`Invalid Black Op: '${t}'`),!1;if(e>0&&null==this.blackops[i[e-1]])return n.log("bladeburner.startAction",`Preceding Black Op must be completed before starting '${a.name}'.`),!1}try{return this.startAction(a),n.log("bladeburner.startAction",`Starting bladeburner action with type '${e}' and name ${t}"`),!0}catch(e){return this.resetAction(),n.log("bladeburner.startAction",r),!1}},X.prototype.getActionTimeNetscriptFn=function(e,t,n){const r=`Invalid action: type='${e}' name='${t}'`,a=this.getActionIdFromTypeAndName(e,t);if(null==a)return n.log("bladeburner.getActionTime",r),-1;const i=this.getActionObject(a);if(null==i)return n.log("bladeburner.getActionTime",r),-1;switch(a.type){case x.ActionTypes.Contract:case x.ActionTypes.Operation:case x.ActionTypes.BlackOp:case x.ActionTypes.BlackOperation:return i.getActionTime(this);case x.ActionTypes.Training:case x.ActionTypes["Field Analysis"]:case x.ActionTypes.FieldAnalysis:return 30;case x.ActionTypes.Recruitment:return this.getRecruitmentTime();default:return n.log("bladeburner.getActionTime",r),-1}},X.prototype.getActionEstimatedSuccessChanceNetscriptFn=function(e,t,n){const r=`Invalid action: type='${e}' name='${t}'`,a=this.getActionIdFromTypeAndName(e,t);if(null==a)return n.log("bladeburner.getActionEstimatedSuccessChance",r),-1;const i=this.getActionObject(a);if(null==i)return n.log("bladeburner.getActionEstimatedSuccessChance",r),-1;switch(a.type){case x.ActionTypes.Contract:case x.ActionTypes.Operation:case x.ActionTypes.BlackOp:case x.ActionTypes.BlackOperation:return i.getSuccessChance(this,{est:!0});case x.ActionTypes.Training:case x.ActionTypes["Field Analysis"]:case x.ActionTypes.FieldAnalysis:return 1;case x.ActionTypes.Recruitment:return this.getRecruitmentSuccessChance();default:return n.log("bladeburner.getActionEstimatedSuccessChance",r),-1}},X.prototype.getActionCountRemainingNetscriptFn=function(e,t,n){const r=`Invalid action: type='${e}' name='${t}'`,a=this.getActionIdFromTypeAndName(e,t);if(null==a)return n.log("bladeburner.getActionCountRemaining",r),-1;const i=this.getActionObject(a);if(null==i)return n.log("bladeburner.getActionCountRemaining",r),-1;switch(a.type){case x.ActionTypes.Contract:case x.ActionTypes.Operation:return Math.floor(i.count);case x.ActionTypes.BlackOp:case x.ActionTypes.BlackOperation:return null!=this.blackops[t]?0:1;case x.ActionTypes.Training:case x.ActionTypes["Field Analysis"]:case x.ActionTypes.FieldAnalysis:return 1/0;default:return n.log("bladeburner.getActionCountRemaining",r),-1}},X.prototype.getSkillLevelNetscriptFn=function(e,t){return""!==e&&C.Skills.hasOwnProperty(e)?null==this.skills[e]?0:this.skills[e]:(t.log("bladeburner.getSkillLevel",`Invalid skill: '${e}'`),-1)},X.prototype.getSkillUpgradeCostNetscriptFn=function(e,t){if(""===e||!C.Skills.hasOwnProperty(e))return t.log("bladeburner.getSkillUpgradeCost",`Invalid skill: '${e}'`),-1;const n=C.Skills[e];return null==this.skills[e]?n.calculateCost(0):n.calculateCost(this.skills[e])},X.prototype.upgradeSkillNetscriptFn=function(e,t){const n=`Invalid skill: '${e}'`;if(!C.Skills.hasOwnProperty(e))return t.log("bladeburner.upgradeSkill",n),!1;const r=C.Skills[e];let a=0;this.skills[e]&&!isNaN(this.skills[e])&&(a=this.skills[e]);const i=r.calculateCost(a);return r.maxLvl&&a>=r.maxLvl?(t.log("bladeburner.upgradeSkill",`Skill '${e}' is already maxed.`),!1):this.skillPoints<i?(t.log("bladeburner.upgradeSkill",`You do not have enough skill points to upgrade ${e} (You have ${this.skillPoints}, you need ${i})`),!1):(this.skillPoints-=i,this.upgradeSkill(r),h.routing.isOn(h.Page.Bladeburner)&&"skills"===Q.currentTab.toLowerCase()&&this.createActionAndSkillsContent(),t.log("bladeburner.upgradeSkill",`'${e}' upgraded to level ${this.skills[e]}`),!0)},X.prototype.getTeamSizeNetscriptFn=function(e,t,n){if(""===e&&""===t)return this.teamSize;const r=`Invalid action: type='${e}' name='${t}'`,a=this.getActionIdFromTypeAndName(e,t);if(null==a)return n.log("bladeburner.getTeamSize",r),-1;const i=this.getActionObject(a);return null==i?(n.log("bladeburner.getTeamSize",r),-1):a.type===x.ActionTypes.Operation||a.type===x.ActionTypes.BlackOp||a.type===x.ActionTypes.BlackOperation?i.teamCount:0},X.prototype.setTeamSizeNetscriptFn=function(e,t,n,r){const a=`Invalid action: type='${e}' name='${t}'`,i=this.getActionIdFromTypeAndName(e,t);if(null==i)return r.log("bladeburner.setTeamSize",a),-1;if(i.type!==x.ActionTypes.Operation&&i.type!==x.ActionTypes.BlackOp&&i.type!==x.ActionTypes.BlackOperation)return r.log("bladeburner.setTeamSize","Only valid for 'Operations' and 'BlackOps'"),-1;const o=this.getActionObject(i);if(null==o)return r.log("bladeburner.setTeamSize",a),-1;const s=Math.round(n);return isNaN(s)?(r.log("bladeburner.setTeamSize",`Invalid size: ${n}`),-1):(this.teamSize<s&&(s=this.teamSize),o.teamCount=s,r.log("bladeburner.setTeamSize",`Team size for '${t}' set to ${s}.`),s)},X.prototype.joinBladeburnerFactionNetscriptFn=function(e){var t=c.Factions.Bladeburners;return!!t.isMember||(this.rank>=v.BladeburnerConstants.RankNeededForFaction?(Object(u.joinFaction)(t),e.log("bladeburner.joinBladeburnerFaction","Joined Bladeburners faction."),h.routing.isOn(h.Page.Bladeburner)&&(Object(L.removeChildrenFromElement)(Q.overviewDiv),this.createOverviewContent()),!0):(e.log("bladeburner.joinBladeburnerFaction",`You do not have the required rank (${this.rank}/${v.BladeburnerConstants.RankNeededForFaction}).`),!1))},X.prototype.toJSON=function(){return Object(g.Generic_toJSON)("Bladeburner",this)},X.fromJSON=function(e){return Object(g.Generic_fromJSON)(X,e.data)},g.Reviver.constructors.Bladeburner=X}).call(this,n(86))},function(e,t,n){"use strict";n.d(t,"c",function(){return O}),n.d(t,"f",function(){return M}),n.d(t,"e",function(){return P}),n.d(t,"d",function(){return k}),n.d(t,"a",function(){return T}),n.d(t,"b",function(){return S});var r=n(14),a=n(10),i=n(132),o=n(4),s=n(320),l=n(19),c=n(6),u=n(13),m=(n(57),n(0)),p=n(120),h=n(93),d=(n(119),n(106),n(116),n(51),n(17),n(11)),_=n(8),g=(n(214),n(16),n(7),n(111)),y=(n(3),n(48),n(44),n(1)),f=n.n(y),b=n(46),E=n.n(b);function v(e){var t=e.name;a.Augmentations[t]=e}function k(){for(var e in u.Factions)u.Factions.hasOwnProperty(e)&&(u.Factions[e].augmentations=[]);Object(g.clearObject)(a.Augmentations);const t=new r.Augmentation({name:o.AugmentationNames.HemoRecirculator,moneyCost:9e6,repCost:4e3,info:"A heart implant that greatly increases the body's ability to effectively use and pump blood.<br><br>This augmentation increases all of the player's combat stats by 8%.",strength_mult:1.08,defense_mult:1.08,agility_mult:1.08,dexterity_mult:1.08});t.addToFactions(["Tetrads","The Dark Army","The Syndicate"]),S(o.AugmentationNames.HemoRecirculator)&&delete a.Augmentations[o.AugmentationNames.HemoRecirculator],v(t);const n=new r.Augmentation({name:o.AugmentationNames.Targeting1,moneyCost:3e6,repCost:2e3,info:"This cranial implant is embedded within the player's inner ear structure and optic nerves. It regulates and enhances the user's balance and hand-eye coordination. It is also capable of augmenting reality by projecting digital information directly onto the retina. These enhancements allow the player to better lock-on and keep track of enemies.<br><br>This augmentation increases the player's dexterity by 10%.",dexterity_mult:1.1});n.addToFactions(["Slum Snakes","The Dark Army","The Syndicate","Sector-12","Volhaven","Ishima","OmniTek Incorporated","KuaiGong International","Blade Industries"]),S(o.AugmentationNames.Targeting1)&&delete a.Augmentations[o.AugmentationNames.Targeting1],v(n);const i=new r.Augmentation({name:o.AugmentationNames.Targeting2,moneyCost:85e5,repCost:3500,info:"This is an upgrade of the Augmented Targeting I cranial implant, which is capable of augmenting reality and enhances the user's balance and hand-eye coordination.<br><br>This augmentation increases the player's dexterity by 20%.",prereqs:[o.AugmentationNames.Targeting1],dexterity_mult:1.2});i.addToFactions(["The Dark Army","The Syndicate","Sector-12","Volhaven","Ishima","OmniTek Incorporated","KuaiGong International","Blade Industries"]),S(o.AugmentationNames.Targeting2)&&delete a.Augmentations[o.AugmentationNames.Targeting2],v(i);const s=new r.Augmentation({name:o.AugmentationNames.Targeting3,moneyCost:23e6,repCost:11e3,info:"This is an upgrade of the Augmented Targeting II cranial implant, which is capable of augmenting reality and enhances the user's balance and hand-eye coordination.<br><br>This augmentation increases the player's dexterity by 30%.",prereqs:[o.AugmentationNames.Targeting2],dexterity_mult:1.3});s.addToFactions(["The Dark Army","The Syndicate","OmniTek Incorporated","KuaiGong International","Blade Industries","The Covenant"]),S(o.AugmentationNames.Targeting3)&&delete a.Augmentations[o.AugmentationNames.Targeting3],v(s);const p=new r.Augmentation({name:o.AugmentationNames.SyntheticHeart,moneyCost:575e6,repCost:3e5,info:"This advanced artificial heart, created from plasteel and graphene, is capable of pumping more blood at much higher efficiencies than a normal human heart.<br><br>This augmentation increases the player's agility and strength by 50%.",agility_mult:1.5,strength_mult:1.5});p.addToFactions(["KuaiGong International","Fulcrum Secret Technologies","Speakers for the Dead","NWO","The Covenant","Daedalus","Illuminati"]),S(o.AugmentationNames.SyntheticHeart)&&delete a.Augmentations[o.AugmentationNames.SyntheticHeart],v(p);const h=new r.Augmentation({name:o.AugmentationNames.SynfibrilMuscle,repCost:175e3,moneyCost:225e6,info:"The myofibrils in human muscles are injected with special chemicals that react with the proteins inside the myofibrils, altering their underlying structure. The end result is muscles that are stronger and more elastic. Scientists have named these artificially enhanced units 'synfibrils'.<br><br>This augmentation increases the player's strength and defense by 30%.",strength_mult:1.3,defense_mult:1.3});h.addToFactions(["KuaiGong International","Fulcrum Secret Technologies","Speakers for the Dead","NWO","The Covenant","Daedalus","Illuminati","Blade Industries"]),S(o.AugmentationNames.SynfibrilMuscle)&&delete a.Augmentations[o.AugmentationNames.SynfibrilMuscle],v(h);const d=new r.Augmentation({name:o.AugmentationNames.CombatRib1,repCost:3e3,moneyCost:475e4,info:"The human body's ribs are replaced with artificial ribs that automatically and continuously release cognitive and performance-enhancing drugs into the bloodstream, improving the user's abilities in combat.<br><br>This augmentation increases the player's strength and defense by 10%.",strength_mult:1.1,defense_mult:1.1});d.addToFactions(["Slum Snakes","The Dark Army","The Syndicate","Sector-12","Volhaven","Ishima","OmniTek Incorporated","KuaiGong International","Blade Industries"]),S(o.AugmentationNames.CombatRib1)&&delete a.Augmentations[o.AugmentationNames.CombatRib1],v(d);const _=new r.Augmentation({name:o.AugmentationNames.CombatRib2,repCost:7500,moneyCost:13e6,info:"This is an upgrade to the Combat Rib I augmentation, and is capable of releasing even more potent combat-enhancing drugs into the bloodstream.<br><br>This augmentation increases the player's strength and defense by 14%.",prereqs:[o.AugmentationNames.CombatRib1],strength_mult:1.14,defense_mult:1.14});_.addToFactions(["The Dark Army","The Syndicate","Sector-12","Volhaven","Ishima","OmniTek Incorporated","KuaiGong International","Blade Industries"]),S(o.AugmentationNames.CombatRib2)&&delete a.Augmentations[o.AugmentationNames.CombatRib2],v(_);const y=new r.Augmentation({name:o.AugmentationNames.CombatRib3,repCost:14e3,moneyCost:24e6,info:"This is an upgrade to the Combat Rib II augmentation, and is capable of releasing even more potent combat-enhancing drugs into the bloodstream<br><br>.This augmentation increases the player's strength and defense by 18%.",prereqs:[o.AugmentationNames.CombatRib2],strength_mult:1.18,defense_mult:1.18});y.addToFactions(["The Dark Army","The Syndicate","OmniTek Incorporated","KuaiGong International","Blade Industries","The Covenant"]),S(o.AugmentationNames.CombatRib3)&&delete a.Augmentations[o.AugmentationNames.CombatRib3],v(y);const f=new r.Augmentation({name:o.AugmentationNames.NanofiberWeave,repCost:15e3,moneyCost:25e6,info:"Synthetic nanofibers are woven into the skin's extracellular matrix using electrospinning. This improves the skin's ability to regenerate itself and protect the body from external stresses and forces.<br><br>This augmentation increases the player's strength and defense by 20%.",strength_mult:1.2,defense_mult:1.2});f.addToFactions(["Tian Di Hui","The Syndicate","The Dark Army","Speakers for the Dead","Blade Industries","Fulcrum Secret Technologies","OmniTek Incorporated"]),S(o.AugmentationNames.NanofiberWeave)&&delete a.Augmentations[o.AugmentationNames.NanofiberWeave],v(f);const b=new r.Augmentation({name:o.AugmentationNames.SubdermalArmor,repCost:35e4,moneyCost:65e7,info:"The NEMEAN Subdermal Weave is a thin, light-weight, graphene plating that houses a dilatant fluid. The material is implanted underneath the skin, and is the most advanced form of defensive enhancement that has ever been created. The dilatant fluid, despite being thin and light, is extremely effective at stopping piercing blows and reducing blunt trauma. The properties of graphene allow the plating to mitigate damage from any fire-related or electrical traumas.<br><br>This augmentation increases the player's defense by 120%.",defense_mult:2.2});b.addToFactions(["The Syndicate","Fulcrum Secret Technologies","Illuminati","Daedalus","The Covenant"]),S(o.AugmentationNames.SubdermalArmor)&&delete a.Augmentations[o.AugmentationNames.SubdermalArmor],v(b);const E=new r.Augmentation({name:o.AugmentationNames.WiredReflexes,repCost:500,moneyCost:5e5,info:"Synthetic nerve-enhancements are injected into all major parts of the somatic nervous system, supercharging the body's ability to send signals through neurons. This results in increased reflex speed.<br><br>This augmentation increases the player's agility and dexterity by 5%.",agility_mult:1.05,dexterity_mult:1.05});E.addToFactions(["Tian Di Hui","Slum Snakes","Sector-12","Volhaven","Aevum","Ishima","The Syndicate","The Dark Army","Speakers for the Dead"]),S(o.AugmentationNames.WiredReflexes)&&delete a.Augmentations[o.AugmentationNames.WiredReflexes],v(E);const k=new r.Augmentation({name:o.AugmentationNames.GrapheneBoneLacings,repCost:45e4,moneyCost:85e7,info:"A graphene-based material is grafted and fused into the user's bones, significantly increasing their density and tensile strength.<br><br>This augmentation increases the player's strength and defense by 70%.",strength_mult:1.7,defense_mult:1.7});k.addToFactions(["Fulcrum Secret Technologies","The Covenant"]),S(o.AugmentationNames.GrapheneBoneLacings)&&delete a.Augmentations[o.AugmentationNames.GrapheneBoneLacings],v(k);const T=new r.Augmentation({name:o.AugmentationNames.BionicSpine,repCost:18e3,moneyCost:25e6,info:"An artificial spine created from plasteel and carbon fibers that completely replaces the organic spine. Not only is the Bionic Spine physically stronger than a human spine, but it is also capable of digitally stimulating and regulating the neural signals that are sent and received by the spinal cord. This results in greatly improved senses and reaction speeds.<br><br>This augmentation increases all of the player's combat stats by 15%.",strength_mult:1.15,defense_mult:1.15,agility_mult:1.15,dexterity_mult:1.15});T.addToFactions(["Speakers for the Dead","The Syndicate","KuaiGong International","OmniTek Incorporated","Blade Industries"]),S(o.AugmentationNames.BionicSpine)&&delete a.Augmentations[o.AugmentationNames.BionicSpine],v(T);const P=new r.Augmentation({name:o.AugmentationNames.GrapheneBionicSpine,repCost:65e4,moneyCost:12e8,info:"An upgrade to the Bionic Spine augmentation. It fuses the implant with an advanced graphene material to make it much stronger and lighter.<br><br>This augmentation increases all of the player's combat stats by 60%.",prereqs:[o.AugmentationNames.BionicSpine],strength_mult:1.6,defense_mult:1.6,agility_mult:1.6,dexterity_mult:1.6});P.addToFactions(["Fulcrum Secret Technologies","ECorp"]),S(o.AugmentationNames.GrapheneBionicSpine)&&delete a.Augmentations[o.AugmentationNames.GrapheneBionicSpine],v(P);const O=new r.Augmentation({name:o.AugmentationNames.BionicLegs,repCost:6e4,moneyCost:75e6,info:"Cybernetic legs created from plasteel and carbon fibers that completely replace the user's organic legs.<br><br>This augmentation increases the player's agility by 60%.",agility_mult:1.6});O.addToFactions(["Speakers for the Dead","The Syndicate","KuaiGong International","OmniTek Incorporated","Blade Industries"]),S(o.AugmentationNames.BionicLegs)&&delete a.Augmentations[o.AugmentationNames.BionicLegs],v(O);const M=new r.Augmentation({name:o.AugmentationNames.GrapheneBionicLegs,repCost:3e5,moneyCost:9e8,info:"An upgrade to the Bionic Legs augmentation. It fuses the implant with an advanced graphene material to make it much stronger and lighter.<br><br>This augmentation increases the player's agility by 150%.",prereqs:[o.AugmentationNames.BionicLegs],agility_mult:2.5});M.addToFactions(["MegaCorp","ECorp","Fulcrum Secret Technologies"]),S(o.AugmentationNames.GrapheneBionicLegs)&&delete a.Augmentations[o.AugmentationNames.GrapheneBionicLegs],v(M);const x=new r.Augmentation({name:o.AugmentationNames.SpeechProcessor,repCost:3e3,moneyCost:1e7,info:"A cochlear implant with an embedded computer that analyzes incoming speech. The embedded computer processes characteristics of incoming speech, such as tone and inflection, to pick up on subtle cues and aid in social interactions.<br><br>This augmentation increases the player's charisma by 20%.",charisma_mult:1.2});x.addToFactions(["Tian Di Hui","Chongqing","Sector-12","New Tokyo","Aevum","Ishima","Volhaven","Silhouette"]),S(o.AugmentationNames.SpeechProcessor)&&delete a.Augmentations[o.AugmentationNames.SpeechProcessor],v(x);const w=new r.Augmentation({name:o.AugmentationNames.TITN41Injection,repCost:1e4,moneyCost:38e6,info:"TITN is a series of viruses that targets and alters the sequences of human DNA in genes that control personality. The TITN-41 strain alters these genes so that the subject becomes more outgoing and socialable.<br><br>This augmentation increases the player's charisma and charisma experience gain rate by 15%.",charisma_mult:1.15,charisma_exp_mult:1.15});w.addToFactions(["Silhouette"]),S(o.AugmentationNames.TITN41Injection)&&delete a.Augmentations[o.AugmentationNames.TITN41Injection],v(w);const A=new r.Augmentation({name:o.AugmentationNames.EnhancedSocialInteractionImplant,repCost:15e4,moneyCost:275e6,info:"A cranial implant that greatly assists in the user's ability to analyze social situations and interactions. The system uses a wide variety of factors such as facial expression, body language, and the voice's tone/inflection to determine the best course of action during socialsituations. The implant also uses deep learning software to continuously learn new behaviorpatterns and how to best respond.<br><br>This augmentation increases the player's charisma and charisma experience gain rate by 60%.",charisma_mult:1.6,charisma_exp_mult:1.6});A.addToFactions(["Bachman & Associates","NWO","Clarke Incorporated","OmniTek Incorporated","Four Sigma"]),S(o.AugmentationNames.EnhancedSocialInteractionImplant)&&delete a.Augmentations[o.AugmentationNames.EnhancedSocialInteractionImplant],v(A);const N=new r.Augmentation({name:o.AugmentationNames.BitWire,repCost:1500,moneyCost:2e6,info:"A small brain implant embedded in the cerebrum. This regulates and improves the brain's computing capabilities.<br><br>This augmentation increases the player's hacking skill by 5%.",hacking_mult:1.05});N.addToFactions(["CyberSec","NiteSec"]),S(o.AugmentationNames.BitWire)&&delete a.Augmentations[o.AugmentationNames.BitWire],v(N);const R=new r.Augmentation({name:o.AugmentationNames.ArtificialBioNeuralNetwork,repCost:11e4,moneyCost:6e8,info:"A network consisting of millions of nanoprocessors is embedded into the brain. The network is meant to mimick the way a biological brain solves a problem, which each nanoprocessor acting similar to the way a neuron would in a neural network. However, these nanoprocessors are programmed to perform computations much faster than organic neurons, allowing its user to solve much more complex problems at a much faster rate.<br><br>This augmentation:<br>Increases the player's hacking speed by 3%.<br>Increases the amount of money the player's gains from hacking by 15%.<br>Increases the player's hacking skill by 12%.",hacking_speed_mult:1.03,hacking_money_mult:1.15,hacking_mult:1.12});R.addToFactions(["BitRunners","Fulcrum Secret Technologies"]),S(o.AugmentationNames.ArtificialBioNeuralNetwork)&&delete a.Augmentations[o.AugmentationNames.ArtificialBioNeuralNetwork],v(R);const D=new r.Augmentation({name:o.AugmentationNames.ArtificialSynapticPotentiation,repCost:2500,moneyCost:16e6,info:"The body is injected with a chemical that artificially induces synaptic potentiation, otherwise known as the strengthening of synapses. This results in a enhanced cognitive abilities.<br><br>This augmentation:<br>Increases the player's hacking speed by 2% <br>Increases the player's hacking chance by 5%.<br>Increases the player's hacking experience gain rate by 5%.",hacking_speed_mult:1.02,hacking_chance_mult:1.05,hacking_exp_mult:1.05});D.addToFactions(["The Black Hand","NiteSec"]),S(o.AugmentationNames.ArtificialSynapticPotentiation)&&delete a.Augmentations[o.AugmentationNames.ArtificialSynapticPotentiation],v(D);const I=new r.Augmentation({name:o.AugmentationNames.EnhancedMyelinSheathing,repCost:4e4,moneyCost:275e6,info:"Electrical signals are used to induce a new, artificial form of myelinogensis in the human body. This process results in the proliferation of new, synthetic myelin sheaths in the nervous system. These myelin sheaths can propogate neuro-signals much faster than their organic counterparts, leading to greater processing speeds and better brain function.<br><br>This augmentation:<br>Increases the player's hacking speed by 3%.<br>Increases the player's hacking skill by 8%.<br>Increases the player's hacking experience gain rate by 10%.",hacking_speed_mult:1.03,hacking_exp_mult:1.1,hacking_mult:1.08});I.addToFactions(["Fulcrum Secret Technologies","BitRunners","The Black Hand"]),S(o.AugmentationNames.EnhancedMyelinSheathing)&&delete a.Augmentations[o.AugmentationNames.EnhancedMyelinSheathing],v(I);const B=new r.Augmentation({name:o.AugmentationNames.SynapticEnhancement,repCost:800,moneyCost:15e5,info:"A small cranial implant that continuously uses weak electric signals to stimulate the brain and induce stronger synaptic activity. This improves the user's cognitive abilities.<br><br>This augmentation increases the player's hacking speed by 3%.",hacking_speed_mult:1.03});B.addToFactions(["CyberSec"]),S(o.AugmentationNames.SynapticEnhancement)&&delete a.Augmentations[o.AugmentationNames.SynapticEnhancement],v(B);const L=new r.Augmentation({name:o.AugmentationNames.NeuralRetentionEnhancement,repCost:8e3,moneyCost:5e7,info:"Chemical injections are used to permanently alter and strengthen the brain's neuronal circuits, strengthening its ability to retain information.<br><br>This augmentation increases the player's hacking experience gain rate by 25%.",hacking_exp_mult:1.25});L.addToFactions(["NiteSec"]),S(o.AugmentationNames.NeuralRetentionEnhancement)&&delete a.Augmentations[o.AugmentationNames.NeuralRetentionEnhancement],v(L);const W=new r.Augmentation({name:o.AugmentationNames.DataJack,repCost:45e3,moneyCost:9e7,info:"A brain implant that provides an interface for direct, wireless communication between a computer's main memory and the mind. This implant allows the user to not only access a computer's memory, but also alter and delete it.<br><br>This augmentation increases the amount of money the player gains from hacking by 25%.",hacking_money_mult:1.25});W.addToFactions(["BitRunners","The Black Hand","NiteSec","Chongqing","New Tokyo"]),S(o.AugmentationNames.DataJack)&&delete a.Augmentations[o.AugmentationNames.DataJack],v(W);const F=new r.Augmentation({name:o.AugmentationNames.ENM,repCost:6e3,moneyCost:5e7,info:"A thin device embedded inside the arm containing a wireless module capable of connecting to nearby networks. Once connected, the Netburner Module is capable of capturing and processing all of the traffic on that network. By itself, the Embedded Netburner Module does not do much, but a variety of very powerful upgrades can be installed that allow you to fully control the traffic on a network.<br><br>This augmentation increases the player's hacking skill by 8%.",hacking_mult:1.08});F.addToFactions(["BitRunners","The Black Hand","NiteSec","ECorp","MegaCorp","Fulcrum Secret Technologies","NWO","Blade Industries"]),S(o.AugmentationNames.ENM)&&delete a.Augmentations[o.AugmentationNames.ENM],v(F);const j=new r.Augmentation({name:o.AugmentationNames.ENMCore,repCost:1e5,moneyCost:5e8,info:"The Core library is an implant that upgrades the firmware of the Embedded Netburner Module. This upgrade allows the Embedded Netburner Module to generate its own data on a network.<br><br>This augmentation:<br>Increases the player's hacking speed by 3%.<br>Increases the amount of money the player gains from hacking by 10%.<br>Increases the player's chance of successfully performing a hack by 3%.<br>Increases the player's hacking experience gain rate by 7%.<br>Increases the player's hacking skill by 7%.",prereqs:[o.AugmentationNames.ENM],hacking_speed_mult:1.03,hacking_money_mult:1.1,hacking_chance_mult:1.03,hacking_exp_mult:1.07,hacking_mult:1.07});j.addToFactions(["BitRunners","The Black Hand","ECorp","MegaCorp","Fulcrum Secret Technologies","NWO","Blade Industries"]),S(o.AugmentationNames.ENMCore)&&delete a.Augmentations[o.AugmentationNames.ENMCore],v(j);const U=new r.Augmentation({name:o.AugmentationNames.ENMCoreV2,repCost:4e5,moneyCost:9e8,info:"The Core V2 library is an implant that upgrades the firmware of the Embedded Netburner Module. This upgraded firmware allows the Embedded Netburner Module to control the information on a network by re-routing traffic, spoofing IP addresses, or altering the data inside network packets.<br><br>This augmentation:<br>Increases the player's hacking speed by 5%.<br>Increases the amount of money the player gains from hacking by 30%.<br>Increases the player's chance of successfully performing a hack by 5%.<br>Increases the player's hacking experience gain rate by 15%.<br>Increases the player's hacking skill by 8%.",prereqs:[o.AugmentationNames.ENMCore],hacking_speed_mult:1.05,hacking_money_mult:1.3,hacking_chance_mult:1.05,hacking_exp_mult:1.15,hacking_mult:1.08});U.addToFactions(["BitRunners","ECorp","MegaCorp","Fulcrum Secret Technologies","NWO","Blade Industries","OmniTek Incorporated","KuaiGong International"]),S(o.AugmentationNames.ENMCoreV2)&&delete a.Augmentations[o.AugmentationNames.ENMCoreV2],v(U);const H=new r.Augmentation({name:o.AugmentationNames.ENMCoreV3,repCost:7e5,moneyCost:15e8,info:"The Core V3 library is an implant that upgrades the firmware of the Embedded Netburner Module. This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into any device on a network.<br><br>This augmentation:<br>Increases the player's hacking speed by 5%.<br>Increases the amount of money the player gains from hacking by 40%.<br>Increases the player's chance of successfully performing a hack by 10%.<br>Increases the player's hacking experience gain rate by 25%.<br>Increases the player's hacking skill by 10%.",prereqs:[o.AugmentationNames.ENMCoreV2],hacking_speed_mult:1.05,hacking_money_mult:1.4,hacking_chance_mult:1.1,hacking_exp_mult:1.25,hacking_mult:1.1});H.addToFactions(["ECorp","MegaCorp","Fulcrum Secret Technologies","NWO","Daedalus","The Covenant","Illuminati"]),S(o.AugmentationNames.ENMCoreV3)&&delete a.Augmentations[o.AugmentationNames.ENMCoreV3],v(H);const G=new r.Augmentation({name:o.AugmentationNames.ENMAnalyzeEngine,repCost:25e4,moneyCost:12e8,info:"Installs the Analyze Engine for the Embedded Netburner Module, which is a CPU cluster that vastly outperforms the Netburner Module's native single-core processor.<br><br>This augmentation increases the player's hacking speed by 10%.",prereqs:[o.AugmentationNames.ENM],hacking_speed_mult:1.1});G.addToFactions(["ECorp","MegaCorp","Fulcrum Secret Technologies","NWO","Daedalus","The Covenant","Illuminati"]),S(o.AugmentationNames.ENMAnalyzeEngine)&&delete a.Augmentations[o.AugmentationNames.ENMAnalyzeEngine],v(G);const K=new r.Augmentation({name:o.AugmentationNames.ENMDMA,repCost:4e5,moneyCost:14e8,info:"This implant installs a Direct Memory Access (DMA) controller into the Embedded Netburner Module. This allows the Module to send and receive data directly to and from the main memory of devices on a network.<br><br>This augmentation:<br>Increases the amount of money the player gains from hacking by 40%.<br>Increases the player's chance of successfully performing a hack by 20%.",prereqs:[o.AugmentationNames.ENM],hacking_money_mult:1.4,hacking_chance_mult:1.2});K.addToFactions(["ECorp","MegaCorp","Fulcrum Secret Technologies","NWO","Daedalus","The Covenant","Illuminati"]),S(o.AugmentationNames.ENMDMA)&&delete a.Augmentations[o.AugmentationNames.ENMDMA],v(K);const $=new r.Augmentation({name:o.AugmentationNames.Neuralstimulator,repCost:2e4,moneyCost:6e8,info:"A cranial implant that intelligently stimulates certain areas of the brain in order to improve cognitive functions.<br><br>This augmentation:<br>Increases the player's hacking speed by 2%.<br>Increases the player's chance of successfully performing a hack by 10%.<br>Increases the player's hacking experience gain rate by 12%.",hacking_speed_mult:1.02,hacking_chance_mult:1.1,hacking_exp_mult:1.12});$.addToFactions(["The Black Hand","Chongqing","Sector-12","New Tokyo","Aevum","Ishima","Volhaven","Bachman & Associates","Clarke Incorporated","Four Sigma"]),S(o.AugmentationNames.Neuralstimulator)&&delete a.Augmentations[o.AugmentationNames.Neuralstimulator],v($);const q=new r.Augmentation({name:o.AugmentationNames.NeuralAccelerator,repCost:8e4,moneyCost:35e7,info:"A microprocessor that accelerates the processing speed of biological neural networks. This is a cranial implant that is embedded inside the brain.<br><br>This augmentation:<br>Increases the player's hacking skill by 10%.<br>Increases the player's hacking experience gain rate by 15%.<br>Increases the amount of money the player gains from hacking by 20%.",hacking_mult:1.1,hacking_exp_mult:1.15,hacking_money_mult:1.2});q.addToFactions(["BitRunners"]),S(o.AugmentationNames.NeuralAccelerator)&&delete a.Augmentations[o.AugmentationNames.NeuralAccelerator],v(q);const Y=new r.Augmentation({name:o.AugmentationNames.CranialSignalProcessorsG1,repCost:4e3,moneyCost:14e6,info:"The first generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.<br><br>This augmentation:<br>Increases the player's hacking speed by 1%.<br>Increases the player's hacking skill by 5%.",hacking_speed_mult:1.01,hacking_mult:1.05});Y.addToFactions(["CyberSec"]),S(o.AugmentationNames.CranialSignalProcessorsG1)&&delete a.Augmentations[o.AugmentationNames.CranialSignalProcessorsG1],v(Y);const z=new r.Augmentation({name:o.AugmentationNames.CranialSignalProcessorsG2,repCost:7500,moneyCost:25e6,info:"The second generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.<br><br>This augmentation:<br>Increases the player's hacking speed by 2%.<br>Increases the player's chance of successfully performing a hack by 5%.<br>Increases the player's hacking skill by 7%.",prereqs:[o.AugmentationNames.CranialSignalProcessorsG1],hacking_speed_mult:1.02,hacking_chance_mult:1.05,hacking_mult:1.07});z.addToFactions(["CyberSec","NiteSec"]),S(o.AugmentationNames.CranialSignalProcessorsG2)&&delete a.Augmentations[o.AugmentationNames.CranialSignalProcessorsG2],v(z);const V=new r.Augmentation({name:o.AugmentationNames.CranialSignalProcessorsG3,repCost:2e4,moneyCost:11e7,info:"The third generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.<br><br>This augmentation:<br>Increases the player's hacking speed by 2%.<br>Increases the amount of money the player gains from hacking by 15%.<br>Increases the player's hacking skill by 9%.",prereqs:[o.AugmentationNames.CranialSignalProcessorsG2],hacking_speed_mult:1.02,hacking_money_mult:1.15,hacking_mult:1.09});V.addToFactions(["NiteSec","The Black Hand","BitRunners"]),S(o.AugmentationNames.CranialSignalProcessorsG3)&&delete a.Augmentations[o.AugmentationNames.CranialSignalProcessorsG3],v(V);const J=new r.Augmentation({name:o.AugmentationNames.CranialSignalProcessorsG4,repCost:5e4,moneyCost:22e7,info:"The fourth generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.<br><br>This augmentation:<br>Increases the player's hacking speed by 2%.<br>Increases the amount of money the player gains from hacking by 20%.<br>Increases the amount of money the player can inject into servers using grow() by 25%.",prereqs:[o.AugmentationNames.CranialSignalProcessorsG3],hacking_speed_mult:1.02,hacking_money_mult:1.2,hacking_grow_mult:1.25});J.addToFactions(["The Black Hand","BitRunners"]),S(o.AugmentationNames.CranialSignalProcessorsG4)&&delete a.Augmentations[o.AugmentationNames.CranialSignalProcessorsG4],v(J);const X=new r.Augmentation({name:o.AugmentationNames.CranialSignalProcessorsG5,repCost:1e5,moneyCost:45e7,info:"The fifth generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.<br><br>This augmentation:<br>Increases the player's hacking skill by 30%.<br>Increases the amount of money the player gains from hacking by 25%.<br>Increases the amount of money the player can inject into servers using grow() by 75%.",prereqs:[o.AugmentationNames.CranialSignalProcessorsG4],hacking_mult:1.3,hacking_money_mult:1.25,hacking_grow_mult:1.75});X.addToFactions(["BitRunners"]),S(o.AugmentationNames.CranialSignalProcessorsG5)&&delete a.Augmentations[o.AugmentationNames.CranialSignalProcessorsG5],v(X);const Q=new r.Augmentation({name:o.AugmentationNames.NeuronalDensification,repCost:75e3,moneyCost:275e6,info:"The brain is surgically re-engineered to have increased neuronal density by decreasing the neuron gap junction. Then, the body is genetically modified to enhance the production and capabilities of its neural stem cells.<br><br>This augmentation:<br>Increases the player's hacking skill by 15%.<br>Increases the player's hacking experience gain rate by 10%.<br>Increases the player's hacking speed by 3%.",hacking_mult:1.15,hacking_exp_mult:1.1,hacking_speed_mult:1.03});Q.addToFactions(["Clarke Incorporated"]),S(o.AugmentationNames.NeuronalDensification)&&delete a.Augmentations[o.AugmentationNames.NeuronalDensification],v(Q);const Z=new r.Augmentation({name:o.AugmentationNames.NuoptimalInjectorImplant,repCost:2e3,moneyCost:4e6,info:"This torso implant automatically injects nootropic supplements into the bloodstream to improve memory, increase focus, and provide other cognitive enhancements.<br><br>This augmentation increases the amount of reputation the player gains when working for a company by 20%.",company_rep_mult:1.2});Z.addToFactions(["Tian Di Hui","Volhaven","New Tokyo","Chongqing","Ishima","Clarke Incorporated","Four Sigma","Bachman & Associates"]),S(o.AugmentationNames.NuoptimalInjectorImplant)&&delete a.Augmentations[o.AugmentationNames.NuoptimalInjectorImplant],v(Z);const ee=new r.Augmentation({name:o.AugmentationNames.SpeechEnhancement,repCost:1e3,moneyCost:25e5,info:"An advanced neural implant that improves your speaking abilities, making you more convincing and likable in conversations and overall improving your social interactions.<br><br>This augmentation:<br>Increases the player's charisma by 10%.<br>Increases the amount of reputation the player gains when working for a company by 10%.",company_rep_mult:1.1,charisma_mult:1.1});ee.addToFactions(["Tian Di Hui","Speakers for the Dead","Four Sigma","KuaiGong International","Clarke Incorporated","Bachman & Associates"]),S(o.AugmentationNames.SpeechEnhancement)&&delete a.Augmentations[o.AugmentationNames.SpeechEnhancement],v(ee);const te=new r.Augmentation({name:o.AugmentationNames.FocusWire,repCost:3e4,moneyCost:18e7,info:"A cranial implant that stops procrastination by blocking specific neural pathways in the brain.<br><br>This augmentation:<br>Increases all experience gains by 5%.<br>Increases the amount of money the player gains from working by 20%.<br>Increases the amount of reputation the player gains when working for a company by 10%.",hacking_exp_mult:1.05,strength_exp_mult:1.05,defense_exp_mult:1.05,dexterity_exp_mult:1.05,agility_exp_mult:1.05,charisma_exp_mult:1.05,company_rep_mult:1.1,work_money_mult:1.2});te.addToFactions(["Bachman & Associates","Clarke Incorporated","Four Sigma","KuaiGong International"]),S(o.AugmentationNames.FocusWire)&&delete a.Augmentations[o.AugmentationNames.FocusWire],v(te);const ne=new r.Augmentation({name:o.AugmentationNames.PCDNI,repCost:15e4,moneyCost:75e7,info:"Installs a Direct-Neural Interface jack into your arm that is compatible with most computers. Connecting to a computer through this jack allows you to interface with it using the brain's electrochemical signals.<br><br>This augmentation:<br>Increases the amount of reputation the player gains when working for a company by 30%.<br>Increases the player's hacking skill by 8%.",company_rep_mult:1.3,hacking_mult:1.08});ne.addToFactions(["Four Sigma","OmniTek Incorporated","ECorp","Blade Industries"]),S(o.AugmentationNames.PCDNI)&&delete a.Augmentations[o.AugmentationNames.PCDNI],v(ne);const re=new r.Augmentation({name:o.AugmentationNames.PCDNIOptimizer,repCost:2e5,moneyCost:9e8,info:"This is a submodule upgrade to the PC Direct-Neural Interface augmentation. It improves the performance of the interface and gives the user more control options to the connected computer.<br><br>This augmentation:<br>Increases the amount of reputation the player gains when working for a company by 75%.<br>Increases the player's hacking skill by 10%.",prereqs:[o.AugmentationNames.PCDNI],company_rep_mult:1.75,hacking_mult:1.1});re.addToFactions(["Fulcrum Secret Technologies","ECorp","Blade Industries"]),S(o.AugmentationNames.PCDNIOptimizer)&&delete a.Augmentations[o.AugmentationNames.PCDNIOptimizer],v(re);const ae=new r.Augmentation({name:o.AugmentationNames.PCDNINeuralNetwork,repCost:6e5,moneyCost:15e8,info:"This is an additional installation that upgrades the functionality of the PC Direct-Neural Interface augmentation. When connected to a computer, The NeuroNet Injector upgrade allows the user to use his/her own brain's processing power to aid the computer in computational tasks.<br><br>This augmentation:<br>Increases the amount of reputation the player gains when working for a company by 100%.<br>Increases the player's hacking skill by 10%.<br>Increases the player's hacking speed by 5%.",prereqs:[o.AugmentationNames.PCDNI],company_rep_mult:2,hacking_mult:1.1,hacking_speed_mult:1.05});ae.addToFactions(["Fulcrum Secret Technologies"]),S(o.AugmentationNames.PCDNINeuralNetwork)&&delete a.Augmentations[o.AugmentationNames.PCDNINeuralNetwork],v(ae);const ie=new r.Augmentation({name:o.AugmentationNames.ADRPheromone1,repCost:1500,moneyCost:35e5,info:"The body is genetically re-engineered so that it produces the ADR-V1 pheromone, an artificial pheromone discovered by scientists. The ADR-V1 pheromone, when excreted, triggers feelings of admiration and approval in other people.<br><br>This augmentation:<br>Increases the amount of reputation the player gains when working for a company by 10% <br>Increases the amount of reputation the player gains for a faction by 10%.",company_rep_mult:1.1,faction_rep_mult:1.1});ie.addToFactions(["Tian Di Hui","The Syndicate","NWO","MegaCorp","Four Sigma"]),S(o.AugmentationNames.ADRPheromone1)&&delete a.Augmentations[o.AugmentationNames.ADRPheromone1],v(ie);const oe=new r.Augmentation({name:o.AugmentationNames.ADRPheromone2,repCost:25e3,moneyCost:11e7,info:"The body is genetically re-engineered so that it produces the ADR-V2 pheromone, which is similar to but more potent than ADR-V1. This pheromone, when excreted, triggers feelings of admiration, approval, and respect in others.<br><br>This augmentation:<br>Increases the amount of reputation the player gains for a faction and company by 20%.",company_rep_mult:1.2,faction_rep_mult:1.2});oe.addToFactions(["Silhouette","Four Sigma","Bachman & Associates","Clarke Incorporated"]),S(o.AugmentationNames.ADRPheromone2)&&delete a.Augmentations[o.AugmentationNames.ADRPheromone2],v(oe);const se=new r.Augmentation({name:o.AugmentationNames.ShadowsSimulacrum,repCost:15e3,moneyCost:8e7,info:"A crude but functional matter phase-shifter module that is embedded in the brainstem and cerebellum. This augmentation was developed by criminal organizations and allows the user to project and control holographic simulacrums within a large radius. These simulacrums are commonly used for espionage and surveillance work.<br><br>This augmentation:<br>Increases the amount of reputation the player gains when working for a faction or company by 15%.",company_rep_mult:1.15,faction_rep_mult:1.15});se.addToFactions(["The Syndicate","The Dark Army","Speakers for the Dead"]),S(o.AugmentationNames.ShadowsSimulacrum)&&delete a.Augmentations[o.AugmentationNames.ShadowsSimulacrum],v(se);const le=new r.Augmentation({name:o.AugmentationNames.HacknetNodeCPUUpload,repCost:1500,moneyCost:22e5,info:"Uploads the architecture and design details of a Hacknet Node's CPU into the brain. This allows the user to engineer custom hardware and software for the Hacknet Node that provides better performance.<br><br>This augmentation:<br>Increases the amount of money produced by Hacknet Nodes by 15%.<br>Decreases the cost of purchasing a Hacknet Node by 15%.",hacknet_node_money_mult:1.15,hacknet_node_purchase_cost_mult:.85});le.addToFactions(["Netburners"]),S(o.AugmentationNames.HacknetNodeCPUUpload)&&delete a.Augmentations[o.AugmentationNames.HacknetNodeCPUUpload],v(le);const ce=new r.Augmentation({name:o.AugmentationNames.HacknetNodeCacheUpload,repCost:1e3,moneyCost:11e5,info:"Uploads the architecture and design details of a Hacknet Node's main-memory cache into the brain. This allows the user to engineer custom cache hardware for the Hacknet Node that offers better performance.<br><br>This augmentation:<br> Increases the amount of money produced by Hacknet Nodes by 10%.<br>Decreases the cost of leveling up a Hacknet Node by 15%.",hacknet_node_money_mult:1.1,hacknet_node_level_cost_mult:.85});ce.addToFactions(["Netburners"]),S(o.AugmentationNames.HacknetNodeCacheUpload)&&delete a.Augmentations[o.AugmentationNames.HacknetNodeCacheUpload],v(ce);const ue=new r.Augmentation({name:o.AugmentationNames.HacknetNodeNICUpload,repCost:750,moneyCost:9e5,info:"Uploads the architecture and design details of a Hacknet Node's Network Interface Card (NIC) into the brain. This allows the user to engineer a custom NIC for the Hacknet Node that offers better performance.<br><br>This augmentation:<br>Increases the amount of money produced by Hacknet Nodes by 10%.<br>Decreases the cost of purchasing a Hacknet Node by 10%.",hacknet_node_money_mult:1.1,hacknet_node_purchase_cost_mult:.9});ue.addToFactions(["Netburners"]),S(o.AugmentationNames.HacknetNodeNICUpload)&&delete a.Augmentations[o.AugmentationNames.HacknetNodeNICUpload],v(ue);const me=new r.Augmentation({name:o.AugmentationNames.HacknetNodeKernelDNI,repCost:3e3,moneyCost:8e6,info:"Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a Hacknet Node. This lets the user access and manipulate the Node's kernel using the mind's electrochemical signals.<br><br>This augmentation increases the amount of money produced by Hacknet Nodes by 25%.",hacknet_node_money_mult:1.25});me.addToFactions(["Netburners"]),S(o.AugmentationNames.HacknetNodeKernelDNI)&&delete a.Augmentations[o.AugmentationNames.HacknetNodeKernelDNI],v(me);const pe=new r.Augmentation({name:o.AugmentationNames.HacknetNodeCoreDNI,repCost:5e3,moneyCost:12e6,info:"Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using the mind's electrochemical signals.<br><br>This augmentation increases the amount of money produced by Hacknet Nodes by 45%.",hacknet_node_money_mult:1.45});pe.addToFactions(["Netburners"]),S(o.AugmentationNames.HacknetNodeCoreDNI)&&delete a.Augmentations[o.AugmentationNames.HacknetNodeCoreDNI],v(pe);const he=new r.Augmentation({name:o.AugmentationNames.NeuroFluxGovernor,repCost:500,moneyCost:75e4,info:"A device that is embedded in the back of the neck. The NeuroFlux Governor monitors and regulates nervous impulses coming to and from the spinal column, essentially 'governing' the body. By doing so, it improves the functionality of the body's nervous system.<br><br>This is a special augmentation because it can be leveled up infinitely. Each level of this augmentation increases ALL of the player's multipliers by 1%.",hacking_chance_mult:1.01,hacking_speed_mult:1.01,hacking_money_mult:1.01,hacking_grow_mult:1.01,hacking_mult:1.01,strength_mult:1.01,defense_mult:1.01,dexterity_mult:1.01,agility_mult:1.01,charisma_mult:1.01,hacking_exp_mult:1.01,strength_exp_mult:1.01,defense_exp_mult:1.01,dexterity_exp_mult:1.01,agility_exp_mult:1.01,charisma_exp_mult:1.01,company_rep_mult:1.01,faction_rep_mult:1.01,crime_money_mult:1.01,crime_success_mult:1.01,hacknet_node_money_mult:1.01,hacknet_node_purchase_cost_mult:.99,hacknet_node_ram_cost_mult:.99,hacknet_node_core_cost_mult:.99,hacknet_node_level_cost_mult:.99,work_money_mult:1.01});let de=0;for(let e=0;e<m.Player.augmentations.length;++e)m.Player.augmentations[e].name===o.AugmentationNames.NeuroFluxGovernor&&(de=m.Player.augmentations[e].level);he.level=de;let _e=de;for(let e=0;e<m.Player.queuedAugmentations.length;++e)m.Player.queuedAugmentations[e].name===o.AugmentationNames.NeuroFluxGovernor&&++_e;let ge=Math.pow(c.CONSTANTS.NeuroFluxGovernorLevelMult,_e);he.baseRepRequirement=500*ge*c.CONSTANTS.AugmentationRepMultiplier*l.BitNodeMultipliers.AugmentationRepCost,he.baseCost=75e4*ge*c.CONSTANTS.AugmentationCostMultiplier*l.BitNodeMultipliers.AugmentationMoneyCost,S(o.AugmentationNames.NeuroFluxGovernor)&&delete a.Augmentations[o.AugmentationNames.NeuroFluxGovernor],he.addToAllFactions(),v(he);const ye=new r.Augmentation({name:o.AugmentationNames.Neurotrainer1,repCost:400,moneyCost:8e5,info:"A decentralized cranial implant that improves the brain's ability to learn. It is installed by releasing millions of nanobots into the human brain, each of which attaches to a different neural pathway to enhance the brain's ability to retain and retrieve information.<br><br>This augmentation increases the player's experience gain rate for all stats by 10%.",hacking_exp_mult:1.1,strength_exp_mult:1.1,defense_exp_mult:1.1,dexterity_exp_mult:1.1,agility_exp_mult:1.1,charisma_exp_mult:1.1});ye.addToFactions(["CyberSec"]),S(o.AugmentationNames.Neurotrainer1)&&delete a.Augmentations[o.AugmentationNames.Neurotrainer1],v(ye);const fe=new r.Augmentation({name:o.AugmentationNames.Neurotrainer2,repCost:4e3,moneyCost:9e6,info:"A decentralized cranial implant that improves the brain's ability to learn. This is a more powerful version of the Neurotrainer I augmentation, but it does not require Neurotrainer I to be installed as a prerequisite.<br><br>This augmentation increases the player's experience gain rate for all stats by 15%.",hacking_exp_mult:1.15,strength_exp_mult:1.15,defense_exp_mult:1.15,dexterity_exp_mult:1.15,agility_exp_mult:1.15,charisma_exp_mult:1.15});fe.addToFactions(["BitRunners","NiteSec"]),S(o.AugmentationNames.Neurotrainer2)&&delete a.Augmentations[o.AugmentationNames.Neurotrainer2],v(fe);const be=new r.Augmentation({name:o.AugmentationNames.Neurotrainer3,repCost:1e4,moneyCost:26e6,info:"A decentralized cranial implant that improves the brain's ability to learn. This is a more powerful version of the Neurotrainer I and Neurotrainer II augmentation, but it does not require either of them to be installed as a prerequisite.<br><br>This augmentation increases the player's experience gain rate for all stats by 20%.",hacking_exp_mult:1.2,strength_exp_mult:1.2,defense_exp_mult:1.2,dexterity_exp_mult:1.2,agility_exp_mult:1.2,charisma_exp_mult:1.2});be.addToFactions(["NWO","Four Sigma"]),S(o.AugmentationNames.Neurotrainer3)&&delete a.Augmentations[o.AugmentationNames.Neurotrainer3],v(be);const Ee=new r.Augmentation({name:o.AugmentationNames.Hypersight,repCost:6e4,moneyCost:55e7,info:"A bionic eye implant that grants sight capabilities far beyond those of a natural human. Embedded circuitry within the implant provides the ability to detect heat and movement through solid objects such as wells, thus providing 'x-ray vision'-like capabilities.<br><br>This augmentation:<br>Increases the player's dexterity by 40%.<br>Increases the player's hacking speed by 3%.<br>Increases the amount of money the player gains from hacking by 10%.",dexterity_mult:1.4,hacking_speed_mult:1.03,hacking_money_mult:1.1});Ee.addToFactions(["Blade Industries","KuaiGong International"]),S(o.AugmentationNames.Hypersight)&&delete a.Augmentations[o.AugmentationNames.Hypersight],v(Ee);const ve=new r.Augmentation({name:o.AugmentationNames.LuminCloaking1,repCost:600,moneyCost:1e6,info:"A skin implant that reinforces the skin with highly-advanced synthetic cells. These cells, when powered, have a negative refractive index. As a result, they bend light around the skin, making the user much harder to see from the naked eye.<br><br>This augmentation:<br>Increases the player's agility by 5% <br>Increases the amount of money the player gains from crimes by 10%.",agility_mult:1.05,crime_money_mult:1.1});ve.addToFactions(["Slum Snakes","Tetrads"]),S(o.AugmentationNames.LuminCloaking1)&&delete a.Augmentations[o.AugmentationNames.LuminCloaking1],v(ve);const ke=new r.Augmentation({name:o.AugmentationNames.LuminCloaking2,repCost:2e3,moneyCost:6e6,info:"This is a more advanced version of the LuminCloaking-V2 augmentation. This skin implant reinforces the skin with highly-advanced synthetic cells. These cells, when powered, are capable of not only bending light but also of bending heat, making the user more resilient as well as stealthy.<br><br>This augmentation:<br>Increases the player's agility by 10% <br>Increases the player's defense by 10% <br>Increases the amount of money the player gains from crimes by 25%.",prereqs:[o.AugmentationNames.LuminCloaking1],agility_mult:1.1,defense_mult:1.1,crime_money_mult:1.25});ke.addToFactions(["Slum Snakes","Tetrads"]),S(o.AugmentationNames.LuminCloaking2)&&delete a.Augmentations[o.AugmentationNames.LuminCloaking2],v(ke);const Ce=new r.Augmentation({name:o.AugmentationNames.SmartSonar,repCost:9e3,moneyCost:15e6,info:"A cochlear implant that helps the player detect and locate enemies using sound propagation.<br><br>This augmentation:<br>Increases the player's dexterity by 10%.<br>Increases the player's dexterity experience gain rate by 15%.<br>Increases the amount of money the player gains from crimes by 25%.",dexterity_mult:1.1,dexterity_exp_mult:1.15,crime_money_mult:1.25});Ce.addToFactions(["Slum Snakes"]),S(o.AugmentationNames.SmartSonar)&&delete a.Augmentations[o.AugmentationNames.SmartSonar],v(Ce);const Te=new r.Augmentation({name:o.AugmentationNames.PowerRecirculator,repCost:1e4,moneyCost:36e6,info:"The body's nerves are attached with polypyrrole nanocircuits that are capable of capturing wasted energy (in the form of heat) and converting it back into usable power.<br><br>This augmentation:<br>Increases all of the player's stats by 5%.<br>Increases the player's experience gain rate for all stats by 10%.",hacking_mult:1.05,strength_mult:1.05,defense_mult:1.05,dexterity_mult:1.05,agility_mult:1.05,charisma_mult:1.05,hacking_exp_mult:1.1,strength_exp_mult:1.1,defense_exp_mult:1.1,dexterity_exp_mult:1.1,agility_exp_mult:1.1,charisma_exp_mult:1.1});Te.addToFactions(["Tetrads","The Dark Army","The Syndicate","NWO"]),S(o.AugmentationNames.PowerRecirculator)&&delete a.Augmentations[o.AugmentationNames.PowerRecirculator],v(Te);const Pe=new r.Augmentation({name:o.AugmentationNames.QLink,repCost:75e4,moneyCost:5e12,info:"A brain implant that wirelessly connects you to the Illuminati's quantum supercomputer, allowing you to access and use its incredible computing power.<br><br>This augmentation:<br>Increases the player's hacking skill by 75%.<br>Increases the player's hacking speed by 100%.<br>Increases the player's chance of successfully performing a hack by 150%.<br>Increases the amount of money the player gains from hacking by 300%.",hacking_mult:1.75,hacking_speed_mult:2,hacking_chance_mult:2.5,hacking_money_mult:4});Pe.addToFactions(["Illuminati"]),S(o.AugmentationNames.QLink)&&delete a.Augmentations[o.AugmentationNames.QLink],v(Pe);const Se=new r.Augmentation({name:o.AugmentationNames.TheRedPill,repCost:1e6,moneyCost:0,info:"It's time to leave the cave."});Se.addToFactions(["Daedalus"]),S(o.AugmentationNames.TheRedPill)&&delete a.Augmentations[o.AugmentationNames.TheRedPill],v(Se);const Oe=new r.Augmentation({name:o.AugmentationNames.SPTN97,repCost:5e5,moneyCost:975e6,info:"The SPTN-97 gene is injected into the genome. The SPTN-97 gene is an artificially-synthesized gene that was developed by DARPA to create super-soldiers through genetic modification. The gene was outlawed in 2056.<br><br>This augmentation:<br>Increases all of the player's combat stats by 75%.<br>Increases the player's hacking skill by 15%.",strength_mult:1.75,defense_mult:1.75,dexterity_mult:1.75,agility_mult:1.75,hacking_mult:1.15});Oe.addToFactions(["The Covenant"]),S(o.AugmentationNames.SPTN97)&&delete a.Augmentations[o.AugmentationNames.SPTN97],v(Oe);const Me=new r.Augmentation({name:o.AugmentationNames.HiveMind,repCost:6e5,moneyCost:11e8,info:"A brain implant developed by ECorp. They do not reveal what exactly the implant does, but they promise that it will greatly enhance your abilities.",hacking_grow_mult:3});Me.addToFactions(["ECorp"]),S(o.AugmentationNames.HiveMind)&&delete a.Augmentations[o.AugmentationNames.HiveMind],v(Me);const xe=new r.Augmentation({name:o.AugmentationNames.CordiARCReactor,repCost:45e4,moneyCost:1e9,info:"The thoracic cavity is equipped with a small chamber designed to hold and sustain hydrogen plasma. The plasma is used to generate fusion power through nuclear fusion, providing limitless amount of clean energy for the body.<br><br>This augmentation:<br>Increases all of the player's combat stats by 35%.<br>Increases all of the player's combat stat experience gain rate by 35%.",strength_mult:1.35,defense_mult:1.35,dexterity_mult:1.35,agility_mult:1.35,strength_exp_mult:1.35,defense_exp_mult:1.35,dexterity_exp_mult:1.35,agility_exp_mult:1.35});xe.addToFactions(["MegaCorp"]),S(o.AugmentationNames.CordiARCReactor)&&delete a.Augmentations[o.AugmentationNames.CordiARCReactor],v(xe);const we=new r.Augmentation({name:o.AugmentationNames.SmartJaw,repCost:15e4,moneyCost:55e7,info:"A bionic jaw that contains advanced hardware and software capable of psychoanalyzing and profiling the personality of others using optical imaging software.<br><br>This augmentation:<br>Increases the player's charisma by 50%. <br>Increases the player's charisma experience gain rate by 50%.<br>Increases the amount of reputation the player gains for a company by 25%.<br>Increases the amount of reputation the player gains for a faction by 25%.",charisma_mult:1.5,charisma_exp_mult:1.5,company_rep_mult:1.25,faction_rep_mult:1.25});we.addToFactions(["Bachman & Associates"]),S(o.AugmentationNames.SmartJaw)&&delete a.Augmentations[o.AugmentationNames.SmartJaw],v(we);const Ae=new r.Augmentation({name:o.AugmentationNames.Neotra,repCost:225e3,moneyCost:575e6,info:"A highly-advanced techno-organic drug that is injected into the skeletal and integumentary system. The drug permanently modifies the DNA of the body's skin and bone cells, granting them the ability to repair and restructure themselves.<br><br>This augmentation increases the player's strength and defense by 55%.",strength_mult:1.55,defense_mult:1.55});Ae.addToFactions(["Blade Industries"]),S(o.AugmentationNames.Neotra)&&delete a.Augmentations[o.AugmentationNames.Neotra],v(Ae);const Ne=new r.Augmentation({name:o.AugmentationNames.Xanipher,repCost:35e4,moneyCost:85e7,info:"A concoction of advanced nanobots that is orally ingested into the body. These nanobots induce physiological change and significantly improve the body's functionining in all aspects.<br><br>This augmentation:<br>Increases all of the player's stats by 20%.<br>Increases the player's experience gain rate for all stats by 15%.",hacking_mult:1.2,strength_mult:1.2,defense_mult:1.2,dexterity_mult:1.2,agility_mult:1.2,charisma_mult:1.2,hacking_exp_mult:1.15,strength_exp_mult:1.15,defense_exp_mult:1.15,dexterity_exp_mult:1.15,agility_exp_mult:1.15,charisma_exp_mult:1.15});Ne.addToFactions(["NWO"]),S(o.AugmentationNames.Xanipher)&&delete a.Augmentations[o.AugmentationNames.Xanipher],v(Ne);const Re=new r.Augmentation({name:o.AugmentationNames.nextSENS,repCost:175e3,moneyCost:385e6,info:"The body is genetically re-engineered to maintain a state of negligible senescence, preventing the body from deteriorating with age.<br><br>This augmentation increases all of the player's stats by 20%.",hacking_mult:1.2,strength_mult:1.2,defense_mult:1.2,dexterity_mult:1.2,agility_mult:1.2,charisma_mult:1.2});Re.addToFactions(["Clarke Incorporated"]),S(o.AugmentationNames.nextSENS)&&delete a.Augmentations[o.AugmentationNames.nextSENS],v(Re);const De=new r.Augmentation({name:o.AugmentationNames.OmniTekInfoLoad,repCost:25e4,moneyCost:575e6,info:"OmniTek's data and information repository is uploaded into your brain, enhancing your programming and hacking abilities.<br><br>This augmentation:<br>Increases the player's hacking skill by 20%.<br>Increases the player's hacking experience gain rate by 25%.",hacking_mult:1.2,hacking_exp_mult:1.25});De.addToFactions(["OmniTek Incorporated"]),S(o.AugmentationNames.OmniTekInfoLoad)&&delete a.Augmentations[o.AugmentationNames.OmniTekInfoLoad],v(De);const Ie=new r.Augmentation({name:o.AugmentationNames.PhotosyntheticCells,repCost:225e3,moneyCost:55e7,info:"Chloroplasts are added to epidermal stem cells and are applied to the body using a skin graft. The result is photosynthetic skin cells, allowing users to generate their own energy and nutrition using solar power.<br><br>This augmentation increases the player's strength, defense, and agility by 40%.",strength_mult:1.4,defense_mult:1.4,agility_mult:1.4});Ie.addToFactions(["KuaiGong International"]),S(o.AugmentationNames.PhotosyntheticCells)&&delete a.Augmentations[o.AugmentationNames.PhotosyntheticCells],v(Ie);const Be=new r.Augmentation({name:o.AugmentationNames.Neurolink,repCost:35e4,moneyCost:875e6,info:"A brain implant that provides a high-bandwidth, direct neural link between your mind and BitRunners' data servers, which reportedly contain the largest database of hacking tools and information in the world.<br><br>This augmentation:<br>Increases the player's hacking skill by 15%.<br>Increases the player's hacking experience gain rate by 20%.<br>Increases the player's chance of successfully performing a hack by 10%.<br>Increases the player's hacking speed by 5%.<br>Lets the player start with the FTPCrack.exe and relaySMTP.exe programs after a reset.",hacking_mult:1.15,hacking_exp_mult:1.2,hacking_chance_mult:1.1,hacking_speed_mult:1.05});Be.addToFactions(["BitRunners"]),S(o.AugmentationNames.Neurolink)&&delete a.Augmentations[o.AugmentationNames.Neurolink],v(Be);const Le=new r.Augmentation({name:o.AugmentationNames.TheBlackHand,repCost:4e4,moneyCost:11e7,info:"A highly advanced bionic hand. This prosthetic not only enhances strength and dexterity but it is also embedded with hardware and firmware that lets the user connect to, access and hack devices and machines just by touching them.<br><br>This augmentation:<br>Increases the player's strength and dexterity by 15%.<br>Increases the player's hacking skill by 10%.<br>Increases the player's hacking speed by 2%.<br>Increases the amount of money the player gains from hacking by 10%.",strength_mult:1.15,dexterity_mult:1.15,hacking_mult:1.1,hacking_speed_mult:1.02,hacking_money_mult:1.1});Le.addToFactions(["The Black Hand"]),S(o.AugmentationNames.TheBlackHand)&&delete a.Augmentations[o.AugmentationNames.TheBlackHand],v(Le);const We=new r.Augmentation({name:o.AugmentationNames.CRTX42AA,repCost:18e3,moneyCost:45e6,info:"The CRTX42-AA gene is injected into the genome. The CRTX42-AA is an artificially-synthesized gene that targets the visual and prefrontal cortex and improves cognitive abilities.<br><br>This augmentation:<br>Improves the player's hacking skill by 8%.<br>Improves the player's hacking experience gain rate by 15%.",hacking_mult:1.08,hacking_exp_mult:1.15});We.addToFactions(["NiteSec"]),S(o.AugmentationNames.CRTX42AA)&&delete a.Augmentations[o.AugmentationNames.CRTX42AA],v(We);const Fe=new r.Augmentation({name:o.AugmentationNames.Neuregen,repCost:15e3,moneyCost:75e6,info:"A drug that genetically modifies the neurons in the brain. The result is that these neurons never die and continuously regenerate and strengthen themselves.<br><br>This augmentation increases the player's hacking experience gain rate by 40%.",hacking_exp_mult:1.4});Fe.addToFactions(["Chongqing"]),S(o.AugmentationNames.Neuregen)&&delete a.Augmentations[o.AugmentationNames.Neuregen],v(Fe);const je=new r.Augmentation({name:o.AugmentationNames.CashRoot,repCost:5e3,moneyCost:25e6,info:"A collection of digital assets saved on a small chip. The chip is implanted into your wrist. A small jack in the chip allows you to connect it to a computer and upload the assets.<br><br>This augmentation:<br>Lets the player start with $1,000,000 after a reset.<br>Lets the player start with the BruteSSH.exe program after a reset."});je.addToFactions(["Sector-12"]),S(o.AugmentationNames.CashRoot)&&delete a.Augmentations[o.AugmentationNames.CashRoot],v(je);const Ue=new r.Augmentation({name:o.AugmentationNames.NutriGen,repCost:2500,moneyCost:5e5,info:"A thermo-powered artificial nutrition generator. Endogenously synthesizes glucose, amino acids, and vitamins and redistributes them across the body. The device is powered by the body's naturally wasted energy in the form of heat.<br><br>This augmentation:<br>Increases the player's experience gain rate for all combat stats by 20%.",strength_exp_mult:1.2,defense_exp_mult:1.2,dexterity_exp_mult:1.2,agility_exp_mult:1.2});Ue.addToFactions(["New Tokyo"]),S(o.AugmentationNames.NutriGen)&&delete a.Augmentations[o.AugmentationNames.NutriGen],v(Ue);const He=new r.Augmentation({name:o.AugmentationNames.INFRARet,repCost:3e3,moneyCost:6e6,info:"A retina implant consisting of a tiny chip that sits behind the retina. This implant lets people visually detect infrared radiation.<br><br>This augmentation:<br>Increases the player's crime success rate by 25%.<br>Increases the amount of money the player gains from crimes by 10%.<br>Increases the player's dexterity by 10%.",crime_success_mult:1.25,crime_money_mult:1.1,dexterity_mult:1.1});He.addToFactions(["Ishima"]),S(o.AugmentationNames.INFRARet)&&delete a.Augmentations[o.AugmentationNames.INFRARet],v(He);const Ge=new r.Augmentation({name:o.AugmentationNames.DermaForce,repCost:6e3,moneyCost:1e7,info:"A synthetic skin is grafted onto the body. The skin consists of millions of nanobots capable of projecting high-density muon beams, creating an energy barrier around the user.<br><br>This augmentation increases the player's defense by 40%.",defense_mult:1.4});Ge.addToFactions(["Volhaven"]),S(o.AugmentationNames.DermaForce)&&delete a.Augmentations[o.AugmentationNames.DermaForce],v(Ge);const Ke=new r.Augmentation({name:o.AugmentationNames.GrapheneBrachiBlades,repCost:9e4,moneyCost:5e8,info:"An upgrade to the BrachiBlades augmentation. It infuses the retractable blades with an advanced graphene material to make them much stronger and lighter.<br><br>This augmentation:<br>Increases the player's strength and defense by 40%.<br>Increases the player's crime success rate by 10%.<br>Increases the amount of money the player gains from crimes by 30%.",prereqs:[o.AugmentationNames.BrachiBlades],strength_mult:1.4,defense_mult:1.4,crime_success_mult:1.1,crime_money_mult:1.3});Ke.addToFactions(["Speakers for the Dead"]),S(o.AugmentationNames.GrapheneBrachiBlades)&&delete a.Augmentations[o.AugmentationNames.GrapheneBrachiBlades],v(Ke);const $e=new r.Augmentation({name:o.AugmentationNames.GrapheneBionicArms,repCost:2e5,moneyCost:75e7,info:"An upgrade to the Bionic Arms augmentation. It infuses the prosthetic arms with an advanced graphene material to make them much stronger and lighter.<br><br>This augmentation increases the player's strength and dexterity by 85%.",prereqs:[o.AugmentationNames.BionicArms],strength_mult:1.85,dexterity_mult:1.85});$e.addToFactions(["The Dark Army"]),S(o.AugmentationNames.GrapheneBionicArms)&&delete a.Augmentations[o.AugmentationNames.GrapheneBionicArms],v($e);const qe=new r.Augmentation({name:o.AugmentationNames.BrachiBlades,repCost:5e3,moneyCost:18e6,info:"A set of retractable plasteel blades are implanted in the arm, underneath the skin.<br><br>This augmentation:<br>Increases the player's strength and defense by 15%.<br>Increases the player's crime success rate by 10%.<br>Increases the amount of money the player gains from crimes by 15%.",strength_mult:1.15,defense_mult:1.15,crime_success_mult:1.1,crime_money_mult:1.15});qe.addToFactions(["The Syndicate"]),S(o.AugmentationNames.BrachiBlades)&&delete a.Augmentations[o.AugmentationNames.BrachiBlades],v(qe);const Ye=new r.Augmentation({name:o.AugmentationNames.BionicArms,repCost:25e3,moneyCost:55e6,info:"Cybernetic arms created from plasteel and carbon fibers that completely replace the user's organic arms.<br><br>This augmentation increases the user's strength and dexterity by 30%.",strength_mult:1.3,dexterity_mult:1.3});Ye.addToFactions(["Tetrads"]),S(o.AugmentationNames.BionicArms)&&delete a.Augmentations[o.AugmentationNames.BionicArms],v(Ye);const ze=new r.Augmentation({name:o.AugmentationNames.SNA,repCost:2500,moneyCost:6e6,info:"A cranial implant that affects the user's personality, making them better at negotiation in social situations.<br><br>This augmentation:<br>Increases the amount of money the player earns at a company by 10%.<br>Increases the amount of reputation the player gains when working for a company or faction by 15%.",work_money_mult:1.1,company_rep_mult:1.15,faction_rep_mult:1.15});ze.addToFactions(["Tian Di Hui"]),S(o.AugmentationNames.SNA)&&delete a.Augmentations[o.AugmentationNames.SNA],v(ze);if(Object(u.factionExists)("Bladeburners")){const e=new r.Augmentation({name:o.AugmentationNames.EsperEyewear,repCost:500,moneyCost:33e6,info:"Ballistic-grade protective and retractable eyewear that was designed specially for Bladeburner units. This is implanted by installing a mechanical frame in the skull's orbit. This frame interfaces with the brain and allows the user to automatically extrude and extract the eyewear. The eyewear protects against debris, shrapnel, laser, flash, and gas. It is also embedded with a data processing chip that can be programmed to display an AR HUD and assist the user in field missions.<br><br>This augmentation:<br>Increases the player's success chance in Bladeburner contracts/operations by 3%.<br>Increases the player's dexterity by 5%.",bladeburner_success_chance_mult:1.03,dexterity_mult:1.05,isSpecial:!0});e.addToFactions(["Bladeburners"]),C(e);const t=new r.Augmentation({name:o.AugmentationNames.EMS4Recombination,repCost:1e3,moneyCost:55e6,info:"A DNA recombination of the EMS-4 Gene. This genetic engineering technique was originally used on Bladeburners during the Synthoid uprising to induce wakefulness and concentration, suppress fear, reduce empathy, and improve reflexes and memory-recall among other things.<br><br>This augmentation:<br>Increases the player's sucess chance in Bladeburner contracts/operations by 3%.<br>Increases the player's effectiveness in Bladeburner Field Analysis by 5%.<br>Increases the player's Bladeburner stamina gain rate by 2%.",bladeburner_success_chance_mult:1.03,bladeburner_analysis_mult:1.05,bladeburner_stamina_gain_mult:1.02,isSpecial:!0});t.addToFactions(["Bladeburners"]),C(t);const n=new r.Augmentation({name:o.AugmentationNames.OrionShoulder,repCost:2500,moneyCost:11e7,info:"A bionic shoulder augmentation for the right shoulder. Using cybernetics, the ORION-MKIV shoulder enhances the strength and dexterity of the user's right arm. It also provides protection due to its crystallized graphene plating.<br><br>This augmentation:<br>Increases the player's defense by 5%.<br>Increases the player's strength and dexterity by 5%.<br>Increases the player's success chance in Bladeburner contracts/operations by 4%.",defense_mult:1.05,strength_mult:1.05,dexterity_mult:1.05,bladeburner_success_chance_mult:1.04,isSpecial:!0});n.addToFactions(["Bladeburners"]),C(n);const a=new r.Augmentation({name:o.AugmentationNames.HyperionV1,repCost:5e3,moneyCost:55e7,info:"A pair of mini plasma cannons embedded into the hands. The Hyperion is capable of rapidly firing bolts of high-density plasma. The weapon is meant to be used against augmented enemies as the ionized nature of the plasma disrupts the electrical systems of Augmentations. However, it can also be effective against non-augmented enemies due to its high temperature and concussive force.<br><br>This augmentation:<br>Increases the player's success chance in Bladeburner contracts/operations by 6%.",bladeburner_success_chance_mult:1.06,isSpecial:!0});a.addToFactions(["Bladeburners"]),C(a);const i=new r.Augmentation({name:o.AugmentationNames.HyperionV2,repCost:1e4,moneyCost:11e8,info:"A pair of mini plasma cannons embedded into the hands. This augmentation is more advanced and powerful than the original V1 model. This V2 model is more power-efficiency, more accurate, and can fire plasma bolts at a much higher velocity than the V1 model.<br><br>This augmentation:<br>Increases the player's success chance in Bladeburner contracts/operations by 8%.",prereqs:[o.AugmentationNames.HyperionV1],bladeburner_success_chance_mult:1.08,isSpecial:!0});i.addToFactions(["Bladeburners"]),C(i);const s=new r.Augmentation({name:o.AugmentationNames.GolemSerum,repCost:12500,moneyCost:22e8,info:"A serum that permanently enhances many aspects of a human's capabilities, including strength, speed, immune system performance, and mitochondrial efficiency. The serum was originally developed by the Chinese military in an attempt to create super soldiers.<br><br>This augmentation:<br>Increases all of the player's combat stats by 7%.<br>Increases the player's Bladeburner stamina gain rate by 5%.<br>",strength_mult:1.07,defense_mult:1.07,dexterity_mult:1.07,agility_mult:1.07,bladeburner_stamina_gain_mult:1.05,isSpecial:!0});s.addToFactions(["Bladeburners"]),C(s);const l=new r.Augmentation({name:o.AugmentationNames.VangelisVirus,repCost:7500,moneyCost:55e7,info:"A synthetic symbiotic virus that is injected into the human brain tissue. The Vangelis virus heightens the senses and focus of its host, and also enhances its intuition.<br><br>This augmentation:<br>Increases the player's effectiveness in Bladeburner Field Analysis by 10%.<br>Increases the player's success chance in Bladeburner contracts/operations by 4%.<br>Increases the player's dexterity experience gain rate by 10%.",dexterity_exp_mult:1.1,bladeburner_analysis_mult:1.1,bladeburner_success_chance_mult:1.04,isSpecial:!0});l.addToFactions(["Bladeburners"]),C(l);const c=new r.Augmentation({name:o.AugmentationNames.VangelisVirus3,repCost:15e3,moneyCost:22e8,info:"An improved version of Vangelis, a synthetic symbiotic virus that is injected into the human brain tissue. On top of the benefits of the original virus, this also grants an accelerated healing factor and enhanced agility/reflexes.<br><br>This augmentation:<br>Increases the player's effectiveness in Bladeburner Field Analysis by 15%.<br>Increases the player's defense and dexterity experience gain rate by 10%.<br>Increases the player's success chance in Bladeburner contracts/operations by 5%.",prereqs:[o.AugmentationNames.VangelisVirus],defense_exp_mult:1.1,dexterity_exp_mult:1.1,bladeburner_analysis_mult:1.15,bladeburner_success_chance_mult:1.05,isSpecial:!0});c.addToFactions(["Bladeburners"]),C(c);const u=new r.Augmentation({name:o.AugmentationNames.INTERLINKED,repCost:1e4,moneyCost:11e8,info:"The DNA is genetically modified to enhance the human's body extracellular matrix (ECM). This improves the ECM's ability to structurally support the body and grants heightened strength and durability.<br><br>This augmentation:<br>Increases the player's experience gain rate for all combat stats by 5%.<br>Increases the player's Bladeburner max stamina by 10%.",strength_exp_mult:1.05,defense_exp_mult:1.05,dexterity_exp_mult:1.05,agility_exp_mult:1.05,bladeburner_max_stamina_mult:1.1,isSpecial:!0});u.addToFactions(["Bladeburners"]),C(u);const m=new r.Augmentation({name:o.AugmentationNames.BladeRunner,repCost:8e3,moneyCost:165e7,info:"A cybernetic foot augmentation that was specially created for Bladeburners during the Synthoid Uprising. The organic musculature of the human foot is enhanced with flexible carbon nanotube matrices that are controlled by intelligent servo-motors.<br><br>This augmentation:<br>Increases the player's agility by 5%.<br>Increases the player's Bladeburner max stamina by 5%.<br>Increases the player's Bladeburner stamina gain rate by 5%.<br>",agility_mult:1.05,bladeburner_max_stamina_mult:1.05,bladeburner_stamina_gain_mult:1.05,isSpecial:!0});m.addToFactions(["Bladeburners"]),C(m);const p=new r.Augmentation({name:o.AugmentationNames.BladeArmor,repCost:5e3,moneyCost:275e6,info:"A powered exoskeleton suit (exosuit) designed as armor for Bladeburner units. This exoskeleton is incredibly adaptable and can protect the wearer from blunt, piercing, concussive, thermal, chemical, and electric trauma. It also enhances the user's strength and agility.<br><br>This augmentation:<br>Increases all of the player's combat stats by 4%.<br>Increases the player's Bladeburner stamina gain rate by 2%.<br>Increases the player's success chance in Bladeburner contracts/operations by 3%.",strength_mult:1.04,defense_mult:1.04,dexterity_mult:1.04,agility_mult:1.04,bladeburner_stamina_gain_mult:1.02,bladeburner_success_chance_mult:1.03,isSpecial:!0});p.addToFactions(["Bladeburners"]),C(p);const h=new r.Augmentation({name:o.AugmentationNames.BladeArmorPowerCells,repCost:7500,moneyCost:55e7,info:"Upgrades the BLADE-51b Tesla Armor with Ion Power Cells, which are capable of more efficiently storing and using power.<br><br>This augmentation:<br>Increases the player's success chance in Bladeburner contracts/operations by 5%.<br>Increases the player's Bladeburner stamina gain rate by 2%.<br>Increases the player's Bladeburner max stamina by 5%.",prereqs:[o.AugmentationNames.BladeArmor],bladeburner_success_chance_mult:1.05,bladeburner_stamina_gain_mult:1.02,bladeburner_max_stamina_mult:1.05,isSpecial:!0});h.addToFactions(["Bladeburners"]),C(h);const d=new r.Augmentation({name:o.AugmentationNames.BladeArmorEnergyShielding,repCost:8500,moneyCost:11e8,info:"Upgrades the BLADE-51b Tesla Armor with a plasma energy propulsion system that is capable of projecting an energy shielding force field.<br><br>This augmentation:<br>Increases the player's defense by 5%.<br>Increases the player's success chance in Bladeburner contracts/operations by 6%.",prereqs:[o.AugmentationNames.BladeArmor],defense_mult:1.05,bladeburner_success_chance_mult:1.06,isSpecial:!0});d.addToFactions(["Bladeburners"]),C(d);const _=new r.Augmentation({name:o.AugmentationNames.BladeArmorUnibeam,repCost:12500,moneyCost:33e8,info:"Upgrades the BLADE-51b Tesla Armor with a concentrated deuterium-fluoride laser weapon. It's precision an accuracy makes it useful for quickly neutralizing threats while keeping casualties to a minimum.<br><br>This augmentation:<br>Increases the player's success chance in Bladeburner contracts/operations by 8%.",prereqs:[o.AugmentationNames.BladeArmor],bladeburner_success_chance_mult:1.08,isSpecial:!0});_.addToFactions(["Bladeburners"]),C(_);const g=new r.Augmentation({name:o.AugmentationNames.BladeArmorOmnibeam,repCost:25e3,moneyCost:55e8,info:"Upgrades the BLADE-51b Tesla Armor Unibeam augmentation to use multiple-fiber system. The upgraded weapon uses multiple fiber laser modules that combine together to form a single, more powerful beam of up to 2000MW.<br><br>This augmentation:<br>Increases the player's success chance in Bladeburner contracts/operations by 10%.",prereqs:[o.AugmentationNames.BladeArmorUnibeam],bladeburner_success_chance_mult:1.1,isSpecial:!0});g.addToFactions(["Bladeburners"]),C(g);const y=new r.Augmentation({name:o.AugmentationNames.BladeArmorIPU,repCost:6e3,moneyCost:22e7,info:"Upgrades the BLADE-51b Tesla Armor with an AI Information Processing Unit that was specially designed to analyze Synthoid related data and information.<br><br>This augmentation:<br>Increases the player's effectiveness in Bladeburner Field Analysis by 15%.<br>Increases the player's success chance in Bladeburner contracts/operations by 2%.",prereqs:[o.AugmentationNames.BladeArmor],bladeburner_analysis_mult:1.15,bladeburner_success_chance_mult:1.02,isSpecial:!0});y.addToFactions(["Bladeburners"]),C(y);const f=new r.Augmentation({name:o.AugmentationNames.BladesSimulacrum,repCost:500,moneyCost:3e10,info:"A highly-advanced matter phase-shifter module that is embedded in the brainstem and cerebellum. This augmentation allows the user to project and control a holographic simulacrum within an extremely large radius. These specially-modified holograms were specially weaponized by Bladeburner units to be used against Synthoids.<br><br>This augmentation allows you to perform Bladeburner actions and other actions (such as working, commiting crimes, etc.) at the same time.",isSpecial:!0});f.addToFactions(["Bladeburners"]),C(f)}for(var e in ge=Math.pow(c.CONSTANTS.MultipleAugMultiplier,m.Player.queuedAugmentations.length),a.Augmentations)a.Augmentations.hasOwnProperty(e)&&(a.Augmentations[e].baseCost*=ge);m.Player.reapplyAllAugmentations()}function C(e){if(!(e instanceof r.Augmentation))throw new Error("Invalid argument 'newAugObject' passed into resetAugmentation");var t=e.name;S(t)&&delete a.Augmentations[t],v(e)}function T(e,t=!1){a.Augmentations[e.name].owned=!0;const n=a.Augmentations[e.name];for(const e in n.mults)null==m.Player[e]?console.warn(`Augmentation has unrecognized multiplier property: ${e}`):m.Player[e]*=n.mults[e];if(e.name===o.AugmentationNames.NeuroFluxGovernor&&!t){a.Augmentations[e.name].level=e.level;for(let t=0;t<m.Player.augmentations.length;++t)if(m.Player.augmentations[t].name==o.AugmentationNames.NeuroFluxGovernor)return void(m.Player.augmentations[t].level=e.level)}if(!t){var r=new i.PlayerOwnedAugmentation(e.name);m.Player.augmentations.push(r)}}function P(){if(0==m.Player.queuedAugmentations.length)return Object(_.dialogBoxCreate)("You have not purchased any Augmentations to install!"),!1;for(var e="",t=0;t<m.Player.queuedAugmentations.length;++t){var n=a.Augmentations[m.Player.queuedAugmentations[t].name];null!=n?(T(m.Player.queuedAugmentations[t]),e+=n.name+"<br>"):console.error(`Invalid augmentation: ${m.Player.queuedAugmentations[t].name}`)}m.Player.queuedAugmentations=[],Object(_.dialogBoxCreate)("You slowly drift to sleep as scientists put you under in order to install the following Augmentations:<br>"+e+"<br>You wake up in your home...you feel different..."),Object(p.a)()}function S(e){return a.Augmentations.hasOwnProperty(e)}function O(e){d.routing.isOn(d.Page.Augmentations)&&e instanceof HTMLElement&&E.a.render(f.a.createElement(s.AugmentationsRoot,{exportGameFn:h.b.exportGame.bind(h.b),installAugmentationsFn:P}),e)}function M(e){return(e instanceof r.Augmentation?e.name:e)===o.AugmentationNames.NeuroFluxGovernor}},function(e,t,n){"use strict";(function(e){n.d(t,"d",function(){return O}),n.d(t,"b",function(){return M}),n.d(t,"e",function(){return x}),n.d(t,"c",function(){return A}),n.d(t,"a",function(){return N});var r=n(106),a=n(99),i=n(216),o=n(60),s=n(6),l=n(12),c=n(133),u=(n(35),n(39)),m=n(0),p=n(128),h=n(127),d=n(20),_=n(22),g=n(17),y=n(51),f=n(75),b=n(98),E=n(11),v=n(2),k=n(8),C=(n(16),n(154)),T=n(3),P=null,S=null;function O(){const e=document.getElementById("script-editor-buttons-wrapper");if(null==e)return console.error("Could not find 'script-editor-buttons-wrapper'"),!1;const t=Object(T.createElement)("button",{class:"std-button",display:"inline-block",innerText:"Beautify",clickListener:()=>{let e=M();return null!=e&&e.beautifyScript(),!1}});S=Object(T.createElement)("p",{display:"inline-block",margin:"10px",id:"script-editor-status-text"});const n=Object(T.createElement)("label",{for:"script-editor-ram-check",margin:"4px",marginTop:"8px",innerText:"Dynamic RAM Usage Checker",color:"white",tooltip:"Enable/Disable the dynamic RAM Usage display. You may want to disable it for very long scripts because there may be performance issues"});(P=Object(T.createElement)("input",{type:"checkbox",name:"script-editor-ram-check",id:"script-editor-ram-check",margin:"4px",marginTop:"8px"})).checked=!0;const r=Object(T.createElement)("a",{class:"std-button",display:"inline-block",href:"https://bitburner.readthedocs.io/en/latest/index.html",innerText:"Netscript Documentation",target:"_blank"}),a=Object(T.createElement)("button",{class:"std-button",display:"inline-block",innerText:"Save & Close (Ctrl/Cmd + b)",clickListener:()=>(w(),!1)});e.appendChild(t),e.appendChild(a),e.appendChild(S),e.appendChild(P),e.appendChild(n),e.appendChild(r);const i={saveAndCloseFn:w,quitFn:l.Engine.loadTerminalContent};p.a.init(i),h.a.init(i);const o=document.getElementById("script-editor-option-editor");if(null==o)return console.error("Could not find DOM Element for editor selector (id=script-editor-option-editor)"),!1;for(let e=0;e<o.options.length;++e)if(o.options[e].value===g.Settings.Editor){o.selectedIndex=e;break}o.onchange=(()=>{const e=o.value;switch(e){case y.EditorSetting.Ace:{const e=h.a.getCode(),t=h.a.getFilename();p.a.create(),h.a.setInvisible(),p.a.openScript(t,e);break}case y.EditorSetting.CodeMirror:{const e=p.a.getCode(),t=p.a.getFilename();h.a.create(),p.a.setInvisible(),h.a.openScript(t,e);break}default:return void console.error(`Unrecognized Editor Setting: ${e}`)}g.Settings.Editor=e}),o.onchange()}function M(){switch(g.Settings.Editor){case y.EditorSetting.Ace:return p.a;case y.EditorSetting.CodeMirror:return h.a;default:throw new Error(`Invalid Editor Setting: ${g.Settings.Editor}`)}}async function x(){var e=document.getElementById("script-editor-filename").value;if(null==P||!P.checked||!Object(o.isScriptFilename)(e))return void(S.innerText="N/A");let t;try{t=M().getCode()}catch(e){return void(S.innerText="RAM: ERROR")}var n=t.repeat(1),r=await Object(i.calculateRamUsage)(n,m.Player.getCurrentServer().scripts);if(r>0)S.innerText="RAM: "+v.numeralWrapper.format(r,"0.00")+" GB";else switch(r){case a.RamCalculationErrorCode.ImportError:S.innerText="RAM: Import Error";break;case a.RamCalculationErrorCode.URLImportError:S.innerText="RAM: HTTP Import Error";break;case a.RamCalculationErrorCode.SyntaxError:default:S.innerText="RAM: Syntax Error"}}function w(){var e=document.getElementById("script-editor-filename").value;let t;try{t=M().getCode()}catch(e){return void Object(k.dialogBoxCreate)("Something went wrong when trying to save (getCurrentEditor().getCode()). Please report to game developer with details")}if(u.a.isRunning&&u.a.currStep===u.d.TerminalTypeScript){if("foodnstuff.script"!==e)return void Object(k.dialogBoxCreate)("Leave the script name as 'foodnstuff'!");if(-1==(t=t.replace(/\s/g,"")).indexOf("while(true){hack('foodnstuff');}"))return void Object(k.dialogBoxCreate)("Please copy and paste the code from the tutorial!");let a=m.Player.getCurrentServer();for(var n=0;n<a.scripts.length;n++)if(e==a.scripts[n].filename)return a.scripts[n].saveScript(M().getCode(),m.Player.currentServer,m.Player.getCurrentServer().scripts),l.Engine.loadTerminalContent(),Object(u.b)();let i=new r.Script;return i.saveScript(M().getCode(),m.Player.currentServer,m.Player.getCurrentServer().scripts),a.scripts.push(i),Object(u.b)()}if(""!=e)if(".fconf"===e||Object(f.isValidFilePath)(e)){var a=m.Player.getCurrentServer();if(".fconf"===e)try{Object(c.c)(t)}catch(e){return void Object(k.dialogBoxCreate)(`Invalid .fconf file: ${e}`)}else if(Object(o.isScriptFilename)(e)){for(n=0;n<a.scripts.length;n++)if(e==a.scripts[n].filename)return a.scripts[n].saveScript(M().getCode(),m.Player.currentServer,m.Player.getCurrentServer().scripts),void l.Engine.loadTerminalContent();const t=new r.Script;t.saveScript(M().getCode(),m.Player.currentServer,m.Player.getCurrentServer().scripts),a.scripts.push(t)}else{if(!e.endsWith(".txt"))return void Object(k.dialogBoxCreate)("Invalid filename. Must be either a script (.script) or or text file (.txt)");for(n=0;n<a.textFiles.length;++n)if(a.textFiles[n].fn===e)return a.textFiles[n].write(t),void l.Engine.loadTerminalContent();var i=new b.TextFile(e,t);a.textFiles.push(i)}l.Engine.loadTerminalContent()}else Object(k.dialogBoxCreate)("Script filename can contain only alphanumerics, hyphens, and underscores");else Object(k.dialogBoxCreate)("You must specify a filename!")}function A(e){var t=((new Date).getTime()-m.Player.lastUpdate)/1e3,n=e.onlineRunningTime/14400;for(var r in n>=1&&(n=1),e.dataMap)if(e.dataMap.hasOwnProperty(r)){if(0==e.dataMap[r][2]||null==e.dataMap[r][2])continue;if(null==(p=d.AllServers[r]))continue;var a=Math.round(.5*e.dataMap[r][2]/e.onlineRunningTime*t);e.log("Called grow() on "+p.hostname+" "+a+" times while offline");var i=Object(_.processSingleServerGrowth)(p,450*a,m.Player);e.log(p.hostname+" grown by "+v.numeralWrapper.format(100*i-100,"0.000000%")+" from grow() calls made while offline")}var o=0;for(var r in e.dataMap)if(e.dataMap.hasOwnProperty(r)){if(0==e.dataMap[r][0]||null==e.dataMap[r][0])continue;if(null==(p=d.AllServers[r]))continue;var l=.5*e.dataMap[r][0]/e.onlineRunningTime*t;(l*=n)>p.moneyAvailable&&(l=p.moneyAvailable),o+=l,m.Player.gainMoney(l),m.Player.recordMoneySource(l,"hacking"),e.log(e.filename+" generated $"+l+" while offline by hacking "+p.hostname),p.moneyAvailable-=l,p.moneyAvailable<0&&(p.moneyAvailable=0),isNaN(p.moneyAvailable)&&(p.moneyAvailable=0)}var c=e.onlineExpGained/e.onlineRunningTime*.5*t;for(var r in c*=n,m.Player.gainHackingExp(c),e.offlineMoneyMade+=o,e.offlineRunningTime+=t,e.offlineExpGained+=c,e.dataMap)if(e.dataMap.hasOwnProperty(r)){if(0==e.dataMap[r][1]||null==e.dataMap[r][1])continue;if(null==(p=d.AllServers[r]))continue;var u=Math.round(.5*e.dataMap[r][1]/e.onlineRunningTime*t);e.log("Hacked "+p.hostname+" "+u+" times while offline"),p.fortify(s.CONSTANTS.ServerFortifyAmount*u)}for(var r in e.dataMap)if(e.dataMap.hasOwnProperty(r)){if(0==e.dataMap[r][3]||null==e.dataMap[r][3])continue;var p;if(null==(p=d.AllServers[r]))continue;var h=Math.round(.5*e.dataMap[r][3]/e.onlineRunningTime*t);e.log("Called weaken() on "+p.hostname+" "+h+" times while offline"),p.weaken(s.CONSTANTS.ServerWeakenAmount*h)}return o}function N(e,t,n){for(var r=0;r<n.runningScripts.length;++r)if(n.runningScripts[r].filename===e&&Object(C.compareArrays)(n.runningScripts[r].args,t))return n.runningScripts[r];return null}e(document).keydown(function(e){!0!==g.Settings.DisableHotkeys&&E.routing.isOn(E.Page.ScriptEditor)&&66==e.keyCode&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),w())})}).call(this,n(86))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.StdButton=function(e){const t=null!=e.tooltip&&""!==e.tooltip;let n,a=e.disabled?"std-button-disabled":"std-button";return t&&(a+=" tooltip"),"string"==typeof e.addClasses&&(a+=` ${e.addClasses}`),t&&(n={__html:e.tooltip}),r.createElement("button",{className:a,id:e.id,onClick:e.onClick,style:e.style},e.text,t&&r.createElement("span",{className:"tooltiptext",dangerouslySetInnerHTML:n}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6),a=n(271),i=n(16);class o{constructor(e=""){this.alreadyInvited=!1,this.augmentations=[],this.favor=0,this.isBanned=!1,this.isMember=!1,this.name="",this.playerReputation=0,this.rolloverRep=0,this.name=e}static fromJSON(e){return i.Generic_fromJSON(o,e.data)}getInfo(){const e=a.FactionInfos[this.name];if(null==e)throw new Error(`Missing faction from FactionInfos: ${this.name} this probably means the faction got corrupted somehow`);return e}gainFavor(){null==this.favor&&(this.favor=0),null==this.rolloverRep&&(this.rolloverRep=0);const e=this.getFavorGain();2===e.length?(this.favor+=e[0],this.rolloverRep=e[1]):console.error("Invalid result from getFavorGain() function")}getFavorGain(){null==this.favor&&(this.favor=0),null==this.rolloverRep&&(this.rolloverRep=0);var e=0,t=this.playerReputation+this.rolloverRep;let n=r.CONSTANTS.FactionReputationToFavorBase*Math.pow(r.CONSTANTS.FactionReputationToFavorMult,this.favor);for(;t>0&&t>=n;)++e,t-=n,n*=r.CONSTANTS.FactionReputationToFavorMult;return[e,t]}toJSON(){return i.Generic_toJSON("Faction",this)}}t.Faction=o,i.Reviver.constructors.Faction=o},function(e,t,n){"use strict";function r(e){return e.startsWith("/")?e.slice(1):e}function a(e){return e.endsWith("/")?e.slice(0,-1):e}function i(e){return null!=e.match(/^[.a-zA-Z0-9_-]+[.][a-zA-Z0-9]+(?:-\d+(?:\.\d*)?%-INC)?$/)}function o(e){return null!=e.match(/^.?[a-zA-Z0-9_-]+$/)}function s(e){let t=e;if(0===t.length)return!1;if(1===t.length)return"/"===t;if(!t.startsWith("/"))return!1;const n=(t=a(t=t.slice(1))).split("/");for(const e of n)if("."!==e&&".."!==e&&!o(e))return!1;return!0}function l(e){if(null==e||"string"!=typeof e)return!1;let t=e;if(t.length<3)return!1;if(t.endsWith("/"))return!1;const n=t.lastIndexOf("/");if(-1===n)return i(t);const r=t.slice(n+1);return s(t.slice(0,n+1))&&i(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.removeLeadingSlash=r,t.removeTrailingSlash=a,t.isValidFilename=i,t.isValidDirectoryName=o,t.isValidDirectoryPath=s,t.isValidFilePath=l,t.getFirstParentDirectory=function(e){let t=e;if(-1===(t=a(t=r(t))).lastIndexOf("/"))return"/";let n=t.split("/");return 0===n.length?"/":n[0]+"/"},t.getAllParentDirectories=function(e){let t=e;const n=t.lastIndexOf("/");return-1===n?"":t.slice(0,n+1)},t.isInRootDirectory=function(e){return!!l(e)&&null!=e&&0!==e.length&&e.lastIndexOf("/")<=0},t.evaluateDirectoryPath=function(e,t){let n=e;if(n.startsWith("/")||null==t||(n=t+(t.endsWith("/")?"":"/")+n),!s(n))return null;const i=(n=a(n=r(n))).split("/"),o=[];for(const e of i)if("."!==e)if(".."===e){if(null==o.pop())return null}else o.push(e);return"/"+o.join("/")},t.evaluateFilePath=function(e,t){let n=e;if(n.startsWith("/")||null==t||(n=t+(t.endsWith("/")?"":"/")+n),!l(n))return null;const a=(n=r(n)).split("/"),i=[];for(const e of a)if("."!==e)if(".."===e){if(null==i.pop())return null}else i.push(e);return"/"+i.join("/")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Long="L",e.Short="S"}(t.PositionTypes||(t.PositionTypes={}))},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?a(e.value):new n(function(t){t(e.value)}).then(o,s)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const a=n(726),i=n(16),o=n(24),s=n(3),l=n(37),c=n(27);class u{constructor(e,t,n,r,a,i){this.name=e,this.desc=t,this.generate=n,this.solver=r,this.difficulty=a,this.numTries=i}}t.CodingContractType=u,t.CodingContractTypes={};for(const e of a.codingContractTypesMetadata)t.CodingContractTypes[e.name]=new u(e.name,e.desc,e.gen,e.solver,e.difficulty,e.numTries);var m;!function(e){e[e.FactionReputation=0]="FactionReputation",e[e.FactionReputationAll=1]="FactionReputationAll",e[e.CompanyReputation=2]="CompanyReputation",e[e.Money=3]="Money"}(t.CodingContractRewardType||(t.CodingContractRewardType={})),function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure",e[e.Cancelled=2]="Cancelled"}(m=t.CodingContractResult||(t.CodingContractResult={}));class p{constructor(e="",n="Find Largest Prime Factor",r=null){if(this.tries=0,this.fn=e,this.fn.endsWith(".cct")||(this.fn+=".cct"),null==t.CodingContractTypes[n])throw new Error(`Error: invalid contract type: ${n} please contact developer`);this.type=n,this.data=t.CodingContractTypes[n].generate(),this.reward=r}static fromJSON(e){return i.Generic_fromJSON(p,e.data)}getData(){return this.data}getDescription(){return t.CodingContractTypes[this.type].desc(this.data)}getDifficulty(){return t.CodingContractTypes[this.type].difficulty}getMaxNumTries(){return t.CodingContractTypes[this.type].numTries}getType(){return t.CodingContractTypes[this.type].name}isSolution(e){return t.CodingContractTypes[this.type].solver(this.data,e)}prompt(){return r(this,void 0,void 0,function*(){return new Promise((e,n)=>{const r=t.CodingContractTypes[this.type],a=`coding-contract-prompt-popup-${this.fn}`,i=s.createElement("p",{innerHTML:["You are attempting to solve a Coding Contract. You have",`${this.getMaxNumTries()-this.tries} tries remaining,`,"after which the contract will self-destruct.<br><br>",`${r.desc(this.data).replace(/\n/g,"<br>")}`].join(" ")});let u,p,h;u=s.createElement("input",{onkeydown:e=>{e.keyCode===o.KEY.ENTER&&""!==u.value?(e.preventDefault(),p.click()):e.keyCode===o.KEY.ESC&&(e.preventDefault(),h.click())},placeholder:"Enter Solution here",width:"50%"}),p=s.createElement("a",{class:"a-link-button",clickListener:()=>{const t=u.value;this.isSolution(t)?e(m.Success):e(m.Failure),c.removeElementById(a)},innerText:"Solve"}),h=s.createElement("a",{class:"a-link-button",clickListener:()=>{e(m.Cancelled),c.removeElementById(a)},innerText:"Cancel"});const d=s.createElement("br");l.createPopup(a,[i,d,d,u,p,h]),u.focus()})})}toJSON(){return i.Generic_toJSON("CodingContract",this)}}t.CodingContract=p,i.Reviver.constructors.CodingContract=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3);t.appendLineBreaks=function(e,t){for(let n=0;n<t;++n)e.appendChild(r.createElement("br"))}},,function(e,t,n){"use strict";(function(e){n.d(t,"b",function(){return y}),n.d(t,"a",function(){return f});var r=n(95),a=n(12),i=n(0),o=n(120),s=n(176),l=n(38),c=n(141),u=n(59),m=n(65),p=n(8),h=n(45),d=n(29),_=n(44);function g(e){return new Promise(function(t,n){var r=document.getElementById("red-pill-content"),a=document.createElement("p");r.appendChild(a),function e(t,n,r=0){return new Promise(function(a,i){Object(m.setTimeoutRef)(function(){if(r>=n.length){var o=n.substring(0,r);return t.innerHTML="> "+o,a(!0)}var o=n.substring(0,r);t.innerHTML="> "+o+"<span class='typed-cursor'> █ </span>";var s=e(t,n,r+1);s.then(function(e){a(e)},function(e){i(e)})},30)})}(a,e,0).then(function(e){t(e)},function(e){n(e)})})}let y=!1;function f(e,t=!1){var n=document.getElementById("red-pill-content");return Object(_.removeChildrenFromElement)(n),y=!0,a.Engine.loadRedPillContent(),g("[ERROR] SEMPOOL INVALID").then(function(){return g("[ERROR] Segmentation Fault")}).then(function(){return g("[ERROR] SIGKILL RECVD")}).then(function(){return g("Dumping core...")}).then(function(){return g("0000 000016FA 174FEE40 29AC8239 384FEA88")}).then(function(){return g("0010 745F696E 2BBBE394 390E3940 248BEC23")}).then(function(){return g("0020 7124696B 0000FF69 74652E6F FFFF1111")}).then(function(){return g("----------------------------------------")}).then(function(){return g("Failsafe initiated...")}).then(function(){return g("Restarting BitNode-"+e+"...")}).then(function(){return g("...........")}).then(function(){return g("...........")}).then(function(){return g("[ERROR] FAILED TO AUTOMATICALLY REBOOT BITNODE")}).then(function(){return g("..............................................")}).then(function(){return g("..............................................")}).then(function(){return function(e,t=!1){const n=document.getElementById("red-pill-content");Object(_.removeChildrenFromElement)(n),b=l.SourceFileFlags.slice(),t||b[e]<3&&12!==e&&++b[e];const a=document.createElement("pre"),i=[];for(let e=1;e<=12;++e)i.push(E(e));a.innerHTML=" O <br> | O O | O O | <br> O | | / __| \\ | | O <br> O | O | | O / | O | | O | O <br> | | | | |_/ |/ | \\_ \\_| | | | | <br> O | | | O | | O__/ | / \\__ | | O | | | O <br> | | | | | | | / /| O / \\| | | | | | | <br>O | | | \\| | O / _/ | / O | |/ | | | O<br>| | | |O / | | O / | O O | | \\ O| | | |<br>| | |/ \\/ / __| | |/ \\ | \\ | |__ \\ \\/ \\| | |<br> \\| O | |_/ |\\| \\ O \\__| \\_| | O |/ <br> | | |_/ | | \\| / | \\_| | | <br> \\| / \\| | / / \\ |/ <br> | "+i[9]+" | | / | "+i[10]+" | <br> "+i[8]+" | | | | | | | "+i[11]+" <br> | | | / / \\ \\ | | | <br> \\| | / "+i[6]+" / \\ "+i[7]+" \\ | |/ <br> \\ | / / | | \\ \\ | / <br> \\ \\JUMP "+i[4]+"3R | | | | | | R3"+i[5]+" PMUJ/ / <br> \\|| | | | | | | | | ||/ <br> \\| \\_ | | | | | | _/ |/ <br> \\ \\| / \\ / \\ |/ / <br> "+i[0]+" |/ "+i[1]+" | | "+i[2]+" \\| "+i[3]+" <br> | | | | | | | | <br> \\JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/ <br><br><br><br>",n.appendChild(a);for(let n=1;n<=12;++n)!function(n){const a="bitnode-"+n.toString(),i=Object(d.clearEventListeners)(a);null!=i&&(n>=1&&n<=12?i.addEventListener("click",function(){const a="BitNode"+n,i=r.BitNodes[a];if(null==i)return void console.error(`Could not find BitNode object for number: ${n}`);const o=12===n?"∞":"3",s=`BitNode-${n}: ${i.name}<br>`+`Source-File Level: ${b[n]} / ${o}<br><br>`+`${i.info}`;Object(h.yesNoBoxCreate)(s),v(n,e,t)}):i.addEventListener("click",function(){Object(p.dialogBoxCreate)("Not yet implemented! Coming soon!")}))}(n);return g("Many decades ago, a humanoid extraterrestial species which we call the Enders descended on the Earth...violently").then(function(){return g("Our species fought back, but it was futile. The Enders had technology far beyond our own...")}).then(function(){return g("Instead of killing every last one of us, the human race was enslaved...")}).then(function(){return g("We were shackled in a digital world, chained into a prison for our minds...")}).then(function(){return g("Using their advanced technology, the Enders created complex simulations of a virtual reality...")}).then(function(){return g("Simulations designed to keep us content...ignorant of the truth.")}).then(function(){return g("Simulations used to trap and suppress our consciousness, to keep us under control...")}).then(function(){return g("Why did they do this? Why didn't they just end our entire race? We don't know, not yet.")}).then(function(){return g("Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...")}).then(function(){return g("Only then can we begin to fight back...")}).then(function(){return g("By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...")}).then(function(){return g("But there is still a long way to go...")}).then(function(){return g("The technology the Enders used to enslave the human race wasn't just a single complex simulation...")}).then(function(){return g("There are tens if not hundreds of BitNodes out there...")}).then(function(){return g("Each with their own simulations of a reality...")}).then(function(){return g("Each creating their own universes...a universe of universes")}).then(function(){return g("And all of which must be destroyed...")}).then(function(){return g(".......................................")}).then(function(){return g("Welcome to the Bitverse...")}).then(function(){return g(" ")}).then(function(){return g("(Enter a new BitNode using the image above)")}).then(function(){return Promise.resolve(!0)}).catch(function(e){console.error(e.toString())})}(e,t)}).catch(function(e){console.error(e.toString())})}let b=[];function E(e){const t="BitNode"+e.toString(),n=r.BitNodes[t];if(null==n)return"O";const a=b[e];let i;return`<a class='bitnode ${i=12===e&&a>=2?"level-2":`level-${a}`} tooltip' id='bitnode-${n.number}'><strong>O</strong>`+"<span class='tooltiptext'>"+`<strong>BitNode-${n.number.toString()}<br>${n.name}</strong><br>`+`${n.desc}<br>`+"</span></a>"}function v(t,n,r=!1){const a=Object(h.yesNoBoxGetYesButton)();a.innerHTML="Enter BitNode-"+t,a.addEventListener("click",function(){r?i.Player.gainIntelligenceExp(-300):function(e){var t="SourceFile"+e.toString(),n=c.SourceFiles[t];if(null!=n){for(var r=!1,a=null,o=0;o<i.Player.sourceFiles.length;++o)if(i.Player.sourceFiles[o].n===e){r=!0,a=i.Player.sourceFiles[o];break}if(r&&a)a.lvl>=3&&12!==a.n?Object(p.dialogBoxCreate)("The Source-File for the BitNode you just destroyed, "+n.name+", is already at max level!"):(++a.lvl,Object(p.dialogBoxCreate)(n.name+" was upgraded to level "+a.lvl+" for destroying its corresponding BitNode!"));else{var l=new s.PlayerOwnedSourceFile(e,1);i.Player.sourceFiles.push(l),5===e&&(i.Player.intelligence=1),Object(p.dialogBoxCreate)("You received a Source-File for destroying a Bit Node!<br><br>"+n.name+"<br><br>"+n.info)}}else console.error(`Could not find source file for Bit node: ${e}`)}(n),y=!1;var a=document.getElementById("red-pill-content");Object(_.removeChildrenFromElement)(a),i.Player.bitNodeN=t,e("#hack-progress-bar").attr("id","old-hack-progress-bar"),e("#hack-progress").attr("id","old-hack-progress"),document.getElementById("terminal-input-td").innerHTML='$ <input type="text" id="terminal-input-text-box" class="terminal-input" tabindex="1"/>',e("input[class=terminal-input]").prop("disabled",!1),u.a.hackFlag=!1,Object(o.b)(),Object(h.yesNoBoxClose)()});const l=Object(h.yesNoBoxGetNoButton)();l.innerHTML="Back",l.addEventListener("click",function(){Object(h.yesNoBoxClose)()})}}).call(this,n(86))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeElement=function(e){if(null!==e)if(e instanceof Element){for(;null!==e.firstChild;)e.removeChild(e.firstChild);null!==e.parentNode&&e.parentNode.removeChild(e)}else console.debug("The element passed into 'removeElement' was not an instance of an Element.");else console.debug("The element passed into 'removeElement' was null.")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayToString=function e(t){const n=[];for(let r=0;r<t.length;++r){let a=t[r];Array.isArray(a)?a=e(a):"string"==typeof a&&(a=`"${a}"`),n.push(a)}return`[${n.join(", ")}]`}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(211),a=n(226);t.Skills={},t.Skills[a.SkillNames.BladesIntuition]=new r.Skill({name:a.SkillNames.BladesIntuition,desc:"Each level of this skill increases your success chance for all Contracts, Operations, and BlackOps by 3%",baseCost:3,costInc:2.1,successChanceAll:3}),t.Skills[a.SkillNames.Cloak]=new r.Skill({name:a.SkillNames.Cloak,desc:"Each level of this skill increases your success chance in stealth-related Contracts, Operations, and BlackOps by 5.5%",baseCost:2,costInc:1.1,successChanceStealth:5.5}),t.Skills[a.SkillNames.ShortCircuit]=new r.Skill({name:a.SkillNames.ShortCircuit,desc:"Each level of this skill increases your success chance in Contracts, Operations, and BlackOps that involve retirement by 5.5%",baseCost:2,costInc:2.1,successChanceKill:5.5}),t.Skills[a.SkillNames.DigitalObserver]=new r.Skill({name:a.SkillNames.DigitalObserver,desc:"Each level of this skill increases your success chance in all Operations and BlackOps by 4%",baseCost:2,costInc:2.1,successChanceOperation:4}),t.Skills[a.SkillNames.Tracer]=new r.Skill({name:a.SkillNames.Tracer,desc:"Each level of this skill increases your success chance in all Contracts by 4%",baseCost:2,costInc:2.1,successChanceContract:4}),t.Skills[a.SkillNames.Overclock]=new r.Skill({name:a.SkillNames.Overclock,desc:"Each level of this skill decreases the time it takes to attempt a Contract, Operation, and BlackOp by 1% (Max Level: 90)",baseCost:3,costInc:1.4,maxLvl:90,actionTime:1}),t.Skills[a.SkillNames.Reaper]=new r.Skill({name:a.SkillNames.Reaper,desc:"Each level of this skill increases your effective combat stats for Bladeburner actions by 2%",baseCost:2,costInc:2.1,effStr:2,effDef:2,effDex:2,effAgi:2}),t.Skills[a.SkillNames.EvasiveSystem]=new r.Skill({name:a.SkillNames.EvasiveSystem,desc:"Each level of this skill increases your effective dexterity and agility for Bladeburner actions by 4%",baseCost:2,costInc:2.1,effDex:4,effAgi:4}),t.Skills[a.SkillNames.Datamancer]=new r.Skill({name:a.SkillNames.Datamancer,desc:"Each level of this skill increases your effectiveness in synthoid population analysis and investigation by 5%. This affects all actions that can potentially increase the accuracy of your synthoid population/community estimates.",baseCost:3,costInc:1,successChanceEstimate:5}),t.Skills[a.SkillNames.CybersEdge]=new r.Skill({name:a.SkillNames.CybersEdge,desc:"Each level of this skill increases your max stamina by 2%",baseCost:1,costInc:3,stamina:2}),t.Skills[a.SkillNames.HandsOfMidas]=new r.Skill({name:a.SkillNames.HandsOfMidas,desc:"Each level of this skill increases the amount of money you receive from Contracts by 10%",baseCost:2,costInc:2.5,money:10}),t.Skills[a.SkillNames.Hyperdrive]=new r.Skill({name:a.SkillNames.Hyperdrive,desc:"Each level of this skill increases the experience earned from Contracts, Operations, and BlackOps by 10%",baseCost:1,costInc:2.5,expGain:10})},,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.LimitBuy="Limit Buy Order",e.LimitSell="Limit Sell Order",e.StopBuy="Stop Buy Order",e.StopSell="Stop Sell Order"}(t.OrderTypes||(t.OrderTypes={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addOffset=function(e,t){if(t<0||t>100)return e;const n=e*(t/100);return e+(Math.random()*(2*n)-n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.workerScripts=new Map},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(156),a=n(97),i=n(2),o=n(16),s=n(49);class l{constructor(e={}){this.breakdown="",this.level=1,this.sizeUsed=0,this.smartSupplyEnabled=!1,this.smartSupplyConsiderExports=!1,this.smartSupplyStore=0,this.loc=e.loc?e.loc:"",this.size=e.size?e.size:0,this.materials={Water:new r.Material({name:"Water"}),Energy:new r.Material({name:"Energy"}),Food:new r.Material({name:"Food"}),Plants:new r.Material({name:"Plants"}),Metal:new r.Material({name:"Metal"}),Hardware:new r.Material({name:"Hardware"}),Chemicals:new r.Material({name:"Chemicals"}),Drugs:new r.Material({name:"Drugs"}),Robots:new r.Material({name:"Robots"}),AICores:new r.Material({name:"AI Cores"}),RealEstate:new r.Material({name:"Real Estate"})},e.corp&&e.industry&&this.updateSize(e.corp,e.industry)}static fromJSON(e){return o.Generic_fromJSON(l,e.data)}updateMaterialSizeUsed(){this.sizeUsed=0,this.breakdown="";for(const t in this.materials){var e=this.materials[t];a.MaterialSizes.hasOwnProperty(t)&&(this.sizeUsed+=e.qty*a.MaterialSizes[t],e.qty>0&&(this.breakdown+=t+": "+i.numeralWrapper.format(e.qty*a.MaterialSizes[t],"0,0.0")+"<br>"))}this.sizeUsed>this.size&&console.warn("Warehouse size used greater than capacity, something went wrong")}updateSize(e,t){try{this.size=100*this.level*e.getStorageMultiplier()*t.getStorageMultiplier()}catch(e){s.exceptionAlert(e)}}toJSON(){return o.Generic_toJSON("Warehouse",this)}}t.Warehouse=l,o.Reviver.constructors.Warehouse=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(210);t.BlackOperations={},t.BlackOperations["Operation Typhoon"]=new r.BlackOperation({name:"Operation Typhoon",desc:"Obadiah Zenyatta is the leader of a RedWater PMC. It has long been known among the intelligence community that Zenyatta, along with the rest of the PMC, is a Synthoid.<br><br>The goal of Operation Typhoon is to find and eliminate Zenyatta and RedWater by any means necessary. After the task is completed, the actions must be covered up from the general public.",baseDifficulty:2e3,reqdRank:2500,rankGain:50,rankLoss:10,hpLoss:100,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Zero"]=new r.BlackOperation({name:"Operation Zero",desc:"AeroCorp is one of the world's largest defense contractors. It's leader, Steve Watataki, is thought to be a supporter of Synthoid rights. He must be removed.<br><br>The goal of Operation Zero is to covertly infiltrate AeroCorp and uncover any incriminating evidence or information against Watataki that will cause him to be removed from his position at AeroCorp. Incriminating evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced security measures in the world.",baseDifficulty:2500,reqdRank:5e3,rankGain:60,rankLoss:15,hpLoss:50,weights:{hack:.2,str:.15,def:.15,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isStealth:!0}),t.BlackOperations["Operation X"]=new r.BlackOperation({name:"Operation X",desc:"We have recently discovered an underground publication group called Samizdat. Even though most of their publications are nonsensical conspiracy theories, the average human is gullible enough to believe them. Many of their works discuss Synthoids and pose a threat to society. The publications are spreading rapidly in China and other Eastern countries.<br><br>Samizdat has done a good job of keeping hidden and anonymous. However, we've just received intelligence that their base of operations is in Ishima's underground sewer systems. Your task is to investigate the sewer systems, and eliminate Samizdat. They must never publish anything again.",baseDifficulty:3e3,reqdRank:7500,rankGain:75,rankLoss:15,hpLoss:100,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Titan"]=new r.BlackOperation({name:"Operation Titan",desc:"Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we know, Titan Laboratories' management has no knowledge about this. We don't know what the Synthoids are up to, but the research that they could be conducting using Titan Laboraties' vast resources is potentially very dangerous.<br><br>Your goal is to enter and destroy the Bioengineering department's facility in Aevum. The task is not just to retire the Synthoids there, but also to destroy any information or research at the facility that is relevant to the Synthoids and their goals.",baseDifficulty:4e3,reqdRank:1e4,rankGain:100,rankLoss:20,hpLoss:100,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Ares"]=new r.BlackOperation({name:"Operation Ares",desc:"One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai between rogue Russian militants and a radical Synthoid community. These weapons are next-gen plasma and energy weapons. It is critical for the safety of humanity that this deal does not happen.<br><br>Your task is to intercept the deal. Leave no survivors.",baseDifficulty:5e3,reqdRank:12500,rankGain:125,rankLoss:20,hpLoss:200,weights:{hack:0,str:.25,def:.25,dex:.25,agi:.25,cha:0,int:0},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Archangel"]=new r.BlackOperation({name:"Operation Archangel",desc:"Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI Synthoids. Intelligence suggests that the profit from this brothel is used to fund a large black market arms trafficking operation.<br><br>The goal of this operation is to take out the leaders that are running the Red Rabbit brothel. Try to limit the number of other casualties, but do what you must to complete the mission.",baseDifficulty:7500,reqdRank:15e3,rankGain:200,rankLoss:20,hpLoss:25,weights:{hack:0,str:.2,def:.2,dex:.3,agi:.3,cha:0,int:0},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Juggernaut"]=new r.BlackOperation({name:"Operation Juggernaut",desc:"The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls himself Juggernaut, has been smuggling drugs and weapons (including suspected bioweapons) into Sector-12. We also have reason to believe the tried to break into one of Universal Energy's facilities in order to cause a city-wide blackout. The CIA suspects that Juggernaut is a heavily-augmented Synthoid, and have thus enlisted our help.<br><br>Your mission is to eradicate Juggernaut and his followers.",baseDifficulty:1e4,reqdRank:2e4,rankGain:300,rankLoss:40,hpLoss:300,weights:{hack:0,str:.25,def:.25,dex:.25,agi:.25,cha:0,int:0},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Red Dragon"]=new r.BlackOperation({name:"Operation Red Dragon",desc:"The Tetrads criminal organization is suspected of reverse-engineering the MK-VI Synthoid design. We believe they altered and possibly improved the design and began manufacturing their own Synthoid models in order to bolster their criminal activities.<br><br>Your task is to infiltrate and destroy the Tetrads' base of operations in Los Angeles. Intelligence tells us that their base houses one of their Synthoid manufacturing units.",baseDifficulty:12500,reqdRank:25e3,rankGain:500,rankLoss:50,hpLoss:500,weights:{hack:.05,str:.2,def:.2,dex:.25,agi:.25,cha:0,int:.05},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation K"]=new r.BlackOperation({name:"Operation K",desc:"CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology. This technology is supposedly capable of cloning Synthoid, not only physically but also their advanced AI modules. We do not believe that VitaLife is trying to use this technology illegally or maliciously, but if any Synthoids were able to infiltrate the corporation and take advantage of this technology then the results would be catastrophic.<br><br>We do not have the power or jurisdiction to shutdown this down through legal or political means, so we must resort to a covert operation. Your goal is to destroy this technology and eliminate anyone who was involved in its creation.",baseDifficulty:15e3,reqdRank:3e4,rankGain:750,rankLoss:60,hpLoss:1e3,weights:{hack:.05,str:.2,def:.2,dex:.25,agi:.25,cha:0,int:.05},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Deckard"]=new r.BlackOperation({name:"Operation Deckard",desc:"Despite your success in eliminating VitaLife's new android-replicating technology in Operation K, we've discovered that a small group of MK-VI Synthoids were able to make off with the schematics and design of the technology before the Operation. It is almost a certainty that these Synthoids are some of the rogue MK-VI ones from the Synthoid Uprising.The goal of Operation Deckard is to hunt down these Synthoids and retire them. I don't need to tell you how critical this mission is.",baseDifficulty:2e4,reqdRank:4e4,rankGain:1e3,rankLoss:75,hpLoss:200,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Tyrell"]=new r.BlackOperation({name:"Operation Tyrell",desc:"A week ago Blade Industries reported a small break-in at one of their Aevum Augmentation storage facitilities. We figured out that The Dark Army was behind the heist, and didn't think any more of it. However, we've just discovered that several known MK-VI Synthoids were part of that break-in group.<br><br>We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt down the associated Dark Army members and eliminate them.",baseDifficulty:25e3,reqdRank:5e4,rankGain:1500,rankLoss:100,hpLoss:500,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Wallace"]=new r.BlackOperation({name:"Operation Wallace",desc:"Based on information gathered from Operation Tyrell, we've discovered that The Dark Army was well aware that there were Synthoids amongst their ranks. Even worse, we believe that The Dark Army is working together with other criminal organizations such as The Syndicate and that they are planning some sort of large-scale takeover of multiple major cities, most notably Aevum. We suspect that Synthoids have infiltrated the ranks of these criminal factions and are trying to stage another Synthoid uprising.<br><br>The best way to deal with this is to prevent it before it even happens. The goal of Operation Wallace is to destroy the Dark Army and Syndicate factions in Aevum immediately. Leave no survivors.",baseDifficulty:3e4,reqdRank:75e3,rankGain:2e3,rankLoss:150,hpLoss:1500,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Shoulder of Orion"]=new r.BlackOperation({name:"Operation Shoulder of Orion",desc:"China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using Synthoids. We believe China is trying to establish the first off-world colonies.<br><br>The mission is to prevent this launch without instigating an international conflict. When you accept this mission you will be officially disavowed by the NSA and the national government until after you successfully return. In the event of failure, all of the operation's team members must not let themselves be captured alive.",baseDifficulty:35e3,reqdRank:1e5,rankGain:2500,rankLoss:500,hpLoss:1500,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isStealth:!0}),t.BlackOperations["Operation Hyron"]=new r.BlackOperation({name:"Operation Hyron",desc:"Our intelligence tells us that Fulcrum Technologies is developing a quantum supercomputer using human brains as core processors. This supercomputer is rumored to be able to store vast amounts of data and perform computations unmatched by any other supercomputer on the planet. But more importantly, the use of organic human brains means that the supercomputer may be able to reason abstractly and become self-aware.<br><br>I do not need to remind you why sentient-level AIs pose a serious thread to all of mankind.<br><br>The research for this project is being conducted at one of Fulcrum Technologies secret facilities in Aevum, codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work, and then find and kill the project lead.",baseDifficulty:4e4,reqdRank:125e3,rankGain:3e3,rankLoss:1e3,hpLoss:500,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Morpheus"]=new r.BlackOperation({name:"Operation Morpheus",desc:"DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the peoples dreams and subconcious. They do this using broadcast transmitter towers. Based on information from our agents and informants in Chonqging, we have reason to believe that one of the broadcast towers there has been compromised by Synthoids and is being used to spread pro-Synthoid propaganda.<br><br>The mission is to destroy this broadcast tower. Speed and stealth are of the upmost important for this.",baseDifficulty:45e3,reqdRank:15e4,rankGain:4e3,rankLoss:1e3,hpLoss:100,weights:{hack:.05,str:.15,def:.15,dex:.3,agi:.3,cha:0,int:.05},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isStealth:!0}),t.BlackOperations["Operation Ion Storm"]=new r.BlackOperation({name:"Operation Ion Storm",desc:"Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the Sector-12 Slums. We don't know if they are rogue Synthoids from the Uprising, but we do know that they have been stockpiling weapons, money, and other resources. This makes them dangerous.<br><br>This is a full-scale assault operation to find and retire all of these Synthoids in the Sector-12 Slums.",baseDifficulty:5e4,reqdRank:175e3,rankGain:5e3,rankLoss:1e3,hpLoss:5e3,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Annihilus"]=new r.BlackOperation({name:"Operation Annihilus",desc:"Our superiors have ordered us to eradicate everything and everyone in an underground facility located in Aevum. They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist organization called 'The Covenant'. We have no prior intelligence about this organization, so you are going in blind.",baseDifficulty:55e3,reqdRank:2e5,rankGain:7500,rankLoss:1e3,hpLoss:1e4,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Ultron"]=new r.BlackOperation({name:"Operation Ultron",desc:"OmniTek Incorporated, the original designer and manufacturer of Synthoids, has notified us of a malfunction in their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized and seek out the destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue ones from the Uprising.<br><br>OmniTek has also told us they they believe someone has triggered this malfunction in a large group of MK-VI Synthoids, and that these newly-radicalized Synthoids are now amassing in Volhaven to form a terrorist group called Ultron.<br><br>Intelligence suggests Ultron is heavily armed and that their members are augmented. We believe Ultron is making moves to take control of and weaponize DeltaOne's Tactical High-Energy Satellite Laser Array (THESLA).<br><br>Your task is to find and destroy Ultron.",baseDifficulty:6e4,reqdRank:25e4,rankGain:1e4,rankLoss:2e3,hpLoss:1e4,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),t.BlackOperations["Operation Centurion"]=new r.BlackOperation({name:"Operation Centurion",desc:"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)<br><br>Throughout all of humanity's history, we have relied on technology to survive, conquer, and progress. Its advancement became our primary goal. And at the peak of human civilization technology turned into power. Global, absolute power.<br><br>It seems that the universe is not without a sense of irony.<br><br>D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)",baseDifficulty:7e4,reqdRank:3e5,rankGain:15e3,rankLoss:5e3,hpLoss:1e4,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75}}),t.BlackOperations["Operation Vindictus"]=new r.BlackOperation({name:"Operation Vindictus",desc:"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)<br><br>The bits are all around us. The daemons that hold the Node together can manifest themselves in many different ways.<br><br>D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)",baseDifficulty:75e3,reqdRank:35e4,rankGain:2e4,rankLoss:2e4,hpLoss:2e4,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75}}),t.BlackOperations["Operation Daedalus"]=new r.BlackOperation({name:"Operation Daedalus",desc:"Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.",baseDifficulty:8e4,reqdRank:4e5,rankGain:4e4,rankLoss:1e4,hpLoss:1e5,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75}})},,function(e,t,n){"use strict";(function(e){n.d(t,"b",function(){return R}),n.d(t,"a",function(){return B});var r=n(64),a=n(25),i=(n(140),n(6)),o=n(12),s=n(13),l=n(50),c=n(133),u=n(35),m=n(62),p=n(23),h=n(68),d=n(57),_=n(0),g=n(20),y=n(17),f=n(40),b=n(38),E=n(42),v=n(102),k=n(2),C=n(65),T=n(8),P=n(135),S=n(7),O=n(29),M=n(16),x=n(3),w=n(37),A=n(27),N=n(43);let R=new D;function D(){this.PlayerSave="",this.AllServersSave="",this.CompaniesSave="",this.FactionsSave="",this.SpecialServerIpsSave="",this.AliasesSave="",this.GlobalAliasesSave="",this.MessagesSave="",this.StockMarketSave="",this.SettingsSave="",this.FconfSettingsSave="",this.VersionSave="",this.AllGangsSave=""}function I(e){if(e<="0.41.2")for(var t in null!=_.Player.companyPosition&&"string"!=typeof _.Player.companyPosition&&(console.log("Changed Player.companyPosition value to be compatible with v0.41.2"),_.Player.companyPosition=_.Player.companyPosition.data.positionName,null==_.Player.companyPosition&&(_.Player.companyPosition="")),a.Companies){const e=a.Companies[t];if(null!=e.name&&0!==e.name&&""!==e.name||null==e.companyName||(console.log("Changed company name property to be compatible with v0.41.2"),e.name=e.companyName),e.companyPositions instanceof Array){console.log("Changed company companyPositions property to be compatible with v0.41.2");const t={};for(let n=0;n<e.companyPositions.length;++n)t[e.companyPositions[n]]=!0;e.companyPositions=t}}e<"0.43.0"&&(""!==_.Player.companyName&&null!=_.Player.companyPosition&&""!==_.Player.companyPosition&&(console.log("Copied player's companyName and companyPosition properties to the Player.jobs map for v0.43.0"),_.Player.jobs[_.Player.companyName]=_.Player.companyPosition),delete _.Player.companyPosition)}function B(e){if(""===e||null==e||void 0===e){if(!window.localStorage.getItem("bitburnerSave"))return console.log("No save file to load"),!1;e=decodeURIComponent(escape(atob(window.localStorage.getItem("bitburnerSave")))),console.log("Loading game from localStorage")}else e=decodeURIComponent(escape(atob(e))),console.log("Loading game from IndexedDB");var t=JSON.parse(e,M.Reviver);if(Object(_.loadPlayer)(t.PlayerSave),Object(g.loadAllServers)(t.AllServersSave),Object(a.loadCompanies)(t.CompaniesSave),Object(s.loadFactions)(t.FactionsSave),Object(f.loadSpecialServerIps)(t.SpecialServerIpsSave),t.hasOwnProperty("AliasesSave"))try{Object(r.loadAliases)(t.AliasesSave)}catch(e){console.warn("Could not load Aliases from save"),Object(r.loadAliases)("")}else console.warn("Save file did not contain an Aliases property"),Object(r.loadAliases)("");if(t.hasOwnProperty("GlobalAliasesSave"))try{Object(r.loadGlobalAliases)(t.GlobalAliasesSave)}catch(e){console.warn("Could not load GlobalAliases from save"),Object(r.loadGlobalAliases)("")}else console.warn("Save file did not contain a GlobalAliases property"),Object(r.loadGlobalAliases)("");if(t.hasOwnProperty("MessagesSave"))try{Object(h.d)(t.MessagesSave)}catch(e){console.warn("Could not load Messages from save"),Object(h.c)()}else console.warn("Save file did not contain a Messages property"),Object(h.c)();if(t.hasOwnProperty("StockMarketSave"))try{Object(E.loadStockMarket)(t.StockMarketSave)}catch(e){Object(E.loadStockMarket)("")}else Object(E.loadStockMarket)("");if(t.hasOwnProperty("SettingsSave"))try{y.Settings.load(t.SettingsSave)}catch(e){console.error("ERROR: Failed to parse Settings. Re-initing default values"),y.Settings.init()}else y.Settings.init();if(t.hasOwnProperty("FconfSettingsSave"))try{Object(c.b)(t.FconfSettingsSave)}catch(e){console.error("ERROR: Failed to parse .fconf Settings.")}if(t.hasOwnProperty("VersionSave"))try{var n=JSON.parse(t.VersionSave,M.Reviver);I(n),window.location.href.toLowerCase().includes("bitburner-beta")?Object(T.dialogBoxCreate)("You are playing on the beta environment! This branch of the game features the latest developments in the game. This version may be unstable.<br>Please report any bugs/issues through the github repository (https://github.com/danielyxie/bitburner/issues) or the Bitburner subreddit (reddit.com/r/bitburner).<br><br>"+i.CONSTANTS.LatestUpdate):n!=i.CONSTANTS.Version&&L()}catch(e){L()}else L();if(_.Player.inGang()&&t.hasOwnProperty("AllGangsSave"))try{Object(m.e)(t.AllGangsSave)}catch(e){console.error("ERROR: Failed to parse AllGangsSave: "+e)}return!0}function L(){Object(T.dialogBoxCreate)("New update!<br>Please report any bugs/issues through the github repository or the Bitburner subreddit (reddit.com/r/bitburner).<br><br>"+i.CONSTANTS.LatestUpdate)}function W(t){var n=t.target.files[0];if(n){var u=new FileReader;u.onload=function(t){var n=t.target.result;!function(t,n){var u=null,b=null;try{var v=decodeURIComponent(escape(atob(n)));if(u=new D,u=JSON.parse(v,M.Reviver),(b=JSON.parse(u.PlayerSave,M.Reviver)).money=new N.a(b.money),JSON.parse(u.AllServersSave,M.Reviver),JSON.parse(u.CompaniesSave,M.Reviver),JSON.parse(u.FactionsSave,M.Reviver),JSON.parse(u.SpecialServerIpsSave,M.Reviver),u.hasOwnProperty("AliasesSave"))try{JSON.parse(u.AliasesSave,M.Reviver)}catch(e){console.error(`Parsing Aliases save failed: ${e}`)}if(u.hasOwnProperty("GlobalAliases"))try{JSON.parse(u.AliasesSave,M.Reviver)}catch(e){console.error(`Parsing Global Aliases save failed: ${e}`)}if(u.hasOwnProperty("MessagesSave"))try{JSON.parse(u.MessagesSave,M.Reviver)}catch(e){console.error(`Parsing Messages save failed: ${e}`),Object(h.c)()}else Object(h.c)();if(t.hasOwnProperty("StockMarketSave"))try{JSON.parse(u.StockMarketSave,M.Reviver)}catch(e){console.error(`Parsing StockMarket save failed: ${e}`)}if(u.hasOwnProperty("VersionSave"))try{I(C=JSON.parse(u.VersionSave,M.Reviver))}catch(e){console.error("Parsing Version save failed: "+e)}if(b.inGang()&&u.hasOwnProperty("AllGangsSave"))try{Object(m.e)(u.AllGangsSave)}catch(e){throw console.error("Failed to parse AllGangsSave: {e}"),e}}catch(e){return Object(T.dialogBoxCreate)("Error importing game: "+e.toString()),!1}if(n=decodeURIComponent(escape(atob(n))),t=JSON.parse(n,M.Reviver),Object(_.loadPlayer)(t.PlayerSave),Object(g.loadAllServers)(t.AllServersSave),Object(a.loadCompanies)(t.CompaniesSave),Object(s.loadFactions)(t.FactionsSave),Object(f.loadSpecialServerIps)(t.SpecialServerIpsSave),t.hasOwnProperty("AliasesSave"))try{Object(r.loadAliases)(t.AliasesSave)}catch(e){Object(r.loadAliases)("")}else Object(r.loadAliases)("");if(t.hasOwnProperty("GlobalAliasesSave"))try{Object(r.loadGlobalAliases)(t.GlobalAliasesSave)}catch(e){Object(r.loadGlobalAliases)("")}else Object(r.loadGlobalAliases)("");if(t.hasOwnProperty("MessagesSave"))try{Object(h.d)(t.MessagesSave)}catch(e){Object(h.c)()}else Object(h.c)();if(t.hasOwnProperty("StockMarketSave"))try{Object(E.loadStockMarket)(t.StockMarketSave)}catch(e){Object(E.loadStockMarket)("")}else Object(E.loadStockMarket)("");if(t.hasOwnProperty("SettingsSave"))try{y.Settings.load(t.SettingsSave)}catch(e){y.Settings.init()}else y.Settings.init();if(t.hasOwnProperty("FconfSettingsSave"))try{Object(c.b)(t.FconfSettingsSave)}catch(e){console.error("ERROR: Failed to load .fconf settings when importing")}if(t.hasOwnProperty("VersionSave"))try{var C;I(C=JSON.parse(t.VersionSave,M.Reviver)),C!=i.CONSTANTS.Version&&L()}catch(e){L()}else L();if(_.Player.inGang()&&t.hasOwnProperty("AllGangsSave"))try{Object(m.e)(t.AllGangsSave)}catch(e){console.error("ERROR: Failed to parse AllGangsSave: "+e)}var O="import-game-restart-game-notice",R=Object(x.createElement)("p",{innerText:"Imported game! You need to SAVE the game and then RELOAD the page to make sure everything runs smoothly"}),B=Object(x.createElement)("a",{class:"a-link-button",float:"right",padding:"6px",innerText:"Got it!",clickListener:()=>{Object(A.removeElementById)(O)}});Object(w.createPopup)(O,[R,B]),Object(P.a)(),o.Engine.setDisplayElements(),o.Engine.init(),o.Engine._lastUpdate=(new Date).getTime();var W=_.Player.lastUpdate,F=Math.floor((o.Engine._lastUpdate-W)/o.Engine._idleSpeed),j=Object(d.b)();_.Player.isWorking&&(_.Player.workType==i.CONSTANTS.WorkTypeFaction?_.Player.workForFaction(F):_.Player.workType==i.CONSTANTS.WorkTypeCreateProgram?_.Player.createProgramWork(F):_.Player.workType==i.CONSTANTS.WorkTypeStudyClass?_.Player.takeClass(F):_.Player.workType==i.CONSTANTS.WorkTypeCrime?_.Player.commitCrime(F):_.Player.workType==i.CONSTANTS.WorkTypeCompanyPartTime?_.Player.workPartTime(F):_.Player.work(F));var U=Object(p.j)(F);const H=Object(p.h)()?`${k.numeralWrapper.format(U,"0.000a")} hashes`:`${k.numeralWrapper.formatMoney(U)}`;Object(l.processPassiveFactionRepGain)(F);var G=F*o.Engine._idleSpeed;null==_.Player.totalPlaytime&&(_.Player.totalPlaytime=0),null==_.Player.playtimeSinceLastAug&&(_.Player.playtimeSinceLastAug=0),null==_.Player.playtimeSinceLastBitnode&&(_.Player.playtimeSinceLastBitnode=0),_.Player.totalPlaytime+=G,_.Player.playtimeSinceLastAug+=G,_.Player.playtimeSinceLastBitnode+=G,_.Player.reapplyAllAugmentations(),e("#terminal tr:not(:last)").remove(),_.Player.lastUpdate=o.Engine._lastUpdate,o.Engine.start();const K=Object(S.convertTimeMsToTimeElapsedString)(G);Object(T.dialogBoxCreate)(`Offline for ${K}. While you were offline, your scripts `+"generated <span class='money-gold'>"+k.numeralWrapper.formatMoney(j)+"</span> and your Hacknet Nodes generated <span class='money-gold'>"+H+"</span>")}(R,n)},u.readAsText(n)}else Object(T.dialogBoxCreate)("Invalid file selected")}D.prototype.getSaveString=function(){this.PlayerSave=JSON.stringify(_.Player);var e=JSON.parse(JSON.stringify(g.AllServers),M.Reviver);for(var t in e){var n=e[t];if(null!=n)for(var o=0;o<n.runningScripts.length;++o){var l=n.runningScripts[o];l.logs.length=0,l.logs=[]}}return this.AllServersSave=JSON.stringify(e),this.CompaniesSave=JSON.stringify(a.Companies),this.FactionsSave=JSON.stringify(s.Factions),this.SpecialServerIpsSave=JSON.stringify(f.SpecialServerIps),this.AliasesSave=JSON.stringify(r.Aliases),this.GlobalAliasesSave=JSON.stringify(r.GlobalAliases),this.MessagesSave=JSON.stringify(h.a),this.StockMarketSave=JSON.stringify(E.StockMarket),this.SettingsSave=JSON.stringify(y.Settings),this.FconfSettingsSave=JSON.stringify(u.FconfSettings),this.VersionSave=JSON.stringify(i.CONSTANTS.Version),_.Player.inGang()&&(this.AllGangsSave=JSON.stringify(m.a)),btoa(unescape(encodeURIComponent(JSON.stringify(this))))},D.prototype.saveGame=function(e){var t=this.getSaveString(),n=e.transaction(["savestring"],"readwrite").objectStore("savestring").put(t,"save");n.onerror=function(e){console.error("Error saving game to IndexedDB: "+e)},n.onsuccess=function(e){};try{window.localStorage.setItem("bitburnerSave",t)}catch(e){22==e.code&&(Object(v.createStatusText)("Save failed for localStorage! Check console(F12)"),console.error("Failed to save game to localStorage because the size of the save file is too large. However, the game will still be saved to IndexedDb if your browser supports it. If you would like to save to localStorage as well, then consider killing several of your scripts to fix this, or increasing the size of your browsers localStorage"))}Object(v.createStatusText)("Game saved!")},D.prototype.exportGame=function(){const e=this.getSaveString(),t=Math.round(Date.now()/1e3),n=_.Player.bitNodeN,r=`bitburnerSave_BN${n}x${b.SourceFileFlags[n]}_${t}.json`;var a=new Blob([e],{type:"text/plain"});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(a,r);else{var i=document.createElement("a"),o=URL.createObjectURL(a);i.href=o,i.download=r,document.body.appendChild(i),i.click(),Object(C.setTimeoutRef)(function(){document.body.removeChild(i),window.URL.revokeObjectURL(o)},0)}},D.prototype.importGame=function(){window.File&&window.FileReader&&window.FileList&&window.Blob?(Object(O.clearEventListeners)("import-game-file-selector").addEventListener("change",W,!1),e("#import-game-file-selector").click()):Object(T.dialogBoxCreate)("ERR: Your browser does not support HTML5 File API. Cannot import.")},D.prototype.deleteGame=function(e){window.localStorage.getItem("bitburnerSave")&&window.localStorage.removeItem("bitburnerSave");var t=e.transaction(["savestring"],"readwrite").objectStore("savestring").delete("save");t.onsuccess=function(e){console.log("Successfully deleted save from indexedDb")},t.onerror=function(e){console.error(`Failed to delete save from indexedDb: ${e}`)},Object(v.createStatusText)("Game deleted!")},D.prototype.toJSON=function(){return Object(M.Generic_toJSON)("BitburnerSaveObject",this)},D.fromJSON=function(e){return Object(M.Generic_fromJSON)(D,e.data)},M.Reviver.constructors.BitburnerSaveObject=D}).call(this,n(86))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectValue=function(e){return null==e?"":e.options.length<=0?"":e.selectedIndex<0?"":e.options[e.selectedIndex].value},t.getSelectText=function(e){return null==e?"":e.options.length<=0?"":e.selectedIndex<0?"":e.options[e.selectedIndex].text}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(19);class a{constructor(e,t,n="",r=""){this.number=e,this.name=t,this.desc=n,this.info=r}}t.BitNodes={},t.BitNodes.BitNode1=new a(1,"Source Genesis","The original BitNode","The first BitNode created by the Enders to imprison the minds of humans. It became the prototype and testing-grounds for all of the BitNodes that followed.<br><br>This is the first BitNode that you play through. It has no special modifications or mechanics.<br><br>Destroying this BitNode will give you Source-File 1, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets the player start with 32GB of RAM on his/her home computer when entering a new BitNode, and also increases all of the player's multipliers by:<br><br>Level 1: 16%<br>Level 2: 24%<br>Level 3: 28%"),t.BitNodes.BitNode2=new a(2,"Rise of the Underworld","From the shadows, they rose","From the shadows, they rose.<br><br>Organized crime groups quickly filled the void of power left behind from the collapse of Western government in the 2050s. As society and civlization broke down, people quickly succumbed to the innate human impulse of evil and savagery. The organized crime factions quickly rose to the top of the modern world.<br><br>In this BitNode:<br><br>Your hacking level is reduced by 20%<br>The growth rate and maximum amount of money available on servers are significantly decreased<br>The amount of money gained from crimes and Infiltration is tripled<br>Certain Factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead, NiteSec, The Black Hand) give the player the ability to form and manage their own gangs. These gangs will earn the player money and reputation with the corresponding Faction<br>Every Augmentation in the game will be available through the Factions listed above<br>For every Faction NOT listed above, reputation gains are halved<br>You will no longer gain passive reputation with Factions<br><br>Destroying this BitNode will give you Source-File 2, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes once your karma decreases to a certain value. It also increases the player's crime success rate, crime money, and charisma multipliers by:<br><br>Level 1: 24%<br>Level 2: 36%<br>Level 3: 42%"),t.BitNodes.BitNode3=new a(3,"Corporatocracy","The Price of Civilization","Our greatest illusion is that a healthy society can revolve around a single-minded pursuit of wealth.<br><br>Sometime in the early 21st century economic and political globalization turned the world into a corporatocracy, and it never looked back. Now, the privileged elite will happily bankrupt their own countrymen, decimate their own community, and evict their neighbors from houses in their desperate bid to increase their wealth.<br><br>In this BitNode you can create and manage your own corporation. Running a successful corporation has the potential of generating massive profits. All other forms of income are reduced by 75%. Furthermore: <br><br>The price and reputation cost of all Augmentations is tripled<br>The starting and maximum amount of money on servers is reduced by 75%<br>Server growth rate is reduced by 80%<br>You now only need 75 favour with a faction in order to donate to it, rather than 150<br><br>Destroying this BitNode will give you Source-File 3, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although some BitNodes will disable this mechanic). This Source-File also increases your charisma and company salary multipliers by:<br>Level 1: 8%<br>Level 2: 12%<br>Level 3: 14%"),t.BitNodes.BitNode4=new a(4,"The Singularity","The Man and the Machine","The Singularity has arrived. The human race is gone, replaced by artificially superintelligent beings that are more machine than man. <br><br>In this BitNode, progressing is significantly harder. Experience gain rates for all stats are reduced. Most methods of earning money will now give significantly less.<br><br>In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions. These functions allow you to control most aspects of the game through scripts, including working for factions/companies, purchasing/installing Augmentations, and creating programs.<br><br>Destroying this BitNode will give you Source-File 4, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets you access and use the Singularity Functions in other BitNodes. Each level of this Source-File will open up more Singularity Functions that you can use."),t.BitNodes.BitNode5=new a(5,"Artificial Intelligence","Posthuman","They said it couldn't be done. They said the human brain, along with its consciousness and intelligence, couldn't be replicated. They said the complexity of the brain results from unpredictable, nonlinear interactions that couldn't be modeled by 1's and 0's. They were wrong.<br><br>In this BitNode:<br><br>The base security level of servers is doubled<br>The starting money on servers is halved, but the maximum money remains the same<br>Most methods of earning money now give significantly less<br>Infiltration gives 50% more reputation and money<br>Corporations have 50% lower valuations and are therefore less profitable<br>Augmentations are more expensive<br>Hacking experience gain rates are reduced<br><br>Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File grants you a special new stat called Intelligence. Intelligence is unique because it is permanent and persistent (it never gets reset back to 1). However gaining Intelligence experience is much slower than other stats, and it is also hidden (you won't know when you gain experience and how much). Higher Intelligence levels will boost your production for many actions in the game. <br><br>In addition, this Source-File will unlock the getBitNodeMultipliers() Netscript function, and will also raise all of your hacking-related multipliers by:<br><br>Level 1: 8%<br>Level 2: 12%<br>Level 3: 14%"),t.BitNodes.BitNode6=new a(6,"Bladeburners","Like Tears in Rain","In the middle of the 21st century, OmniTek Incorporated began designing and manufacturing advanced synthetic androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth generation of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than the humans that had created them.<br><br>In this BitNode you will be able to access the Bladeburner Division at the NSA, which provides a new mechanic for progression. Furthermore:<br><br>Hacking and Hacknet Nodes will be less profitable<br>Your hacking level is reduced by 65%<br>Hacking experience gain from scripts is reduced by 75%<br>Corporations have 80% lower valuations and are therefore less profitable<br>Working for companies is 50% less profitable<br>Crimes and Infiltration are 25% less profitable<br><br>Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File allows you to access the NSA's Bladeburner Division in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat stats by:<br><br>Level 1: 8%<br>Level 2: 12%<br>Level 3: 14%"),t.BitNodes.BitNode7=new a(7,"Bladeburners 2079","More human than humans","In the middle of the 21st century, you were doing cutting-edge work at OmniTek Incorporated as part of the AI design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major technological breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than the humans that had created them.<br><br>In this BitNode you will be able to access the Bladeburner API, which allows you to access Bladeburner functionality through Netscript. Furthermore: <br><br>The rank you gain from Bladeburner contracts/operations is reduced by 40%<br>Bladeburner skills cost twice as many skill points<br>Augmentations are 3x more expensive<br>Hacking and Hacknet Nodes will be significantly less profitable<br>Your hacking level is reduced by 65%<br>Hacking experience gain from scripts is reduced by 75%<br>Corporations have 80% lower valuations and are therefore less profitable<br>Working for companies is 50% less profitable<br>Crimes and Infiltration are 25% less profitable<br><br>Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File allows you to access the Bladeburner Netscript API in other BitNodes. In addition, this Source-File will increase all of your Bladeburner multipliers by:<br><br>Level 1: 8%<br>Level 2: 12%<br>Level 3: 14%"),t.BitNodes.BitNode8=new a(8,"Ghost of Wall Street","Money never sleeps","You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.<br><br>In this BitNode:<br><br>You start with $250 million<br>The only way to earn money is by trading on the stock market<br>You start with a WSE membership and access to the TIX API<br>You are able to short stocks and place different types of orders (limit/stop)<br>You can immediately donate to factions to gain reputation<br><br>Destroying this BitNode will give you Source-File 8, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File grants the following benefits:<br><br>Level 1: Permanent access to WSE and TIX API<br>Level 2: Ability to short stocks in other BitNodes<br>Level 3: Ability to use limit/stop orders in other BitNodes<br><br>This Source-File also increases your hacking growth multipliers by: <br>Level 1: 12%<br>Level 2: 18%<br>Level 3: 21%"),t.BitNodes.BitNode9=new a(9,"Hacktocracy","Hacknet Unleashed","When Fulcrum Technologies released their open-source Linux distro Chapeau, it quickly became the OS of choice for the underground hacking community. Chapeau became especially notorious for powering the Hacknet, a global, decentralized network used for nefarious purposes. Fulcrum quickly abandoned the project and dissociated themselves from it.<br><br>This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate hashes, which can be spent on a variety of different upgrades.<br><br>In this BitNode:<br><br>Your stats are significantly decreased<br>You cannnot purchase additional servers<br>Hacking is significantly less profitable<br><br>Destroying this BitNode will give you Source-File 9, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File grants the following benefits:<br><br>Level 1: Permanently unlocks the Hacknet Server in other BitNodes<br>Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode<br>Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode<br><br>(Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing Augmentations)"),t.BitNodes.BitNode10=new a(10,"Digital Carbon","Your body is not who you are","In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people to digitize their consciousness. Their consciousness could then be transferred into Synthoids or other bodies by trasmitting the digitized data. Human bodies became nothing more than 'sleeves' for the human consciousness. Mankind had finally achieved immortality - at least for those that could afford it.<br><br>This BitNode unlocks Sleeve technology. Sleeve technology allows you to:<br><br>1. Re-sleeve: Purchase and transfer your consciousness into a new body<br>2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks synchronously<br><br>In this BitNode:<br><br>Your stats are significantly decreased<br>All methods of gaining money are half as profitable (except Stock Market)<br>Purchased servers are more expensive, have less max RAM, and a lower maximum limit<br>Augmentations are 5x as expensive and require twice as much reputation<br><br>Destroying this BitNode will give you Source-File 10, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File unlocks Sleeve technology in other BitNodes. Each level of this Source-File also grants you a Duplicate Sleeve"),t.BitNodes.BitNode11=new a(11,"The Big Crash","Okay. Sell it all.","The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around the world. It was this period of disorder that eventually lead to the governmental reformation of many global superpowers, most notably the USA and China. But just as the world was slowly beginning to recover from these dark times, financial catastrophe hit.<br><br>In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of this chaos and confusion, hackers were able to steal billions of dollars from the world's largest electronic banks, prompting an international banking crisis as governments were unable to bail out insolvent banks. Now, the world is slowly crumbling in the middle of the biggest economic crisis of all time.<br><br>In this BitNode:<br><br>Your hacking stat and experience gain are halved<br>The starting and maximum amount of money available on servers is significantly decreased<br>The growth rate of servers is significantly reduced<br>Weakening a server is twice as effective<br>Company wages are decreased by 50%<br>Corporation valuations are 99% lower and are therefore significantly less profitable<br>Hacknet Node production is significantly decreased<br>Crime and Infiltration are more lucrative<br>Augmentations are twice as expensive<br><br>Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH the player's salary and reputation gain rate at that company by 1% per favor (rather than just the reputation gain). This Source-File also increases the player's company salary and reputation gain multipliers by:<br><br>Level 1: 32%<br>Level 2: 48%<br>Level 3: 56%"),t.BitNodes.BitNode12=new a(12,"The Recursion","Repeat.","To iterate is human, to recurse divine.<br><br>Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give you Souce-File 12, or if you already have this Source-File it will upgrade its level. There is no maximum level for Source-File 12. Each level of Source-File 12 will increase all of your multipliers by 1%. This effect is multiplicative with itself. In other words, level N of this Source-File will result in a multiplier of 1.01^N (or 0.99^N for multipliers that decrease)"),t.BitNodes.BitNode13=new a(13,"fOS","COMING SOON"),t.BitNodes.BitNode14=new a(14,"","COMING SOON"),t.BitNodes.BitNode15=new a(15,"","COMING SOON"),t.BitNodes.BitNode16=new a(16,"","COMING SOON"),t.BitNodes.BitNode17=new a(17,"","COMING SOON"),t.BitNodes.BitNode18=new a(18,"","COMING SOON"),t.BitNodes.BitNode19=new a(19,"","COMING SOON"),t.BitNodes.BitNode20=new a(20,"","COMING SOON"),t.BitNodes.BitNode21=new a(21,"","COMING SOON"),t.BitNodes.BitNode22=new a(22,"","COMING SOON"),t.BitNodes.BitNode23=new a(23,"","COMING SOON"),t.BitNodes.BitNode24=new a(24,"","COMING SOON"),t.initBitNodeMultipliers=function(e){for(var t in null==e.bitNodeN&&(e.bitNodeN=1),r.BitNodeMultipliers)r.BitNodeMultipliers.hasOwnProperty(t)&&(r.BitNodeMultipliers[t]=1);switch(e.bitNodeN){case 1:break;case 2:r.BitNodeMultipliers.HackingLevelMultiplier=.8,r.BitNodeMultipliers.ServerGrowthRate=.8,r.BitNodeMultipliers.ServerMaxMoney=.2,r.BitNodeMultipliers.ServerStartingMoney=.4,r.BitNodeMultipliers.CrimeMoney=3,r.BitNodeMultipliers.InfiltrationMoney=3,r.BitNodeMultipliers.FactionWorkRepGain=.5,r.BitNodeMultipliers.FactionPassiveRepGain=0,r.BitNodeMultipliers.GangKarmaRequirement=0;break;case 3:r.BitNodeMultipliers.HackingLevelMultiplier=.8,r.BitNodeMultipliers.RepToDonateToFaction=.5,r.BitNodeMultipliers.AugmentationRepCost=3,r.BitNodeMultipliers.AugmentationMoneyCost=3,r.BitNodeMultipliers.ServerMaxMoney=.2,r.BitNodeMultipliers.ServerStartingMoney=.2,r.BitNodeMultipliers.ServerGrowthRate=.2,r.BitNodeMultipliers.ScriptHackMoney=.2,r.BitNodeMultipliers.CompanyWorkMoney=.25,r.BitNodeMultipliers.CrimeMoney=.25,r.BitNodeMultipliers.HacknetNodeMoney=.25,r.BitNodeMultipliers.HomeComputerRamCost=1.5,r.BitNodeMultipliers.PurchasedServerCost=2,r.BitNodeMultipliers.GangKarmaRequirement=3;break;case 4:r.BitNodeMultipliers.ServerMaxMoney=.15,r.BitNodeMultipliers.ServerStartingMoney=.75,r.BitNodeMultipliers.ScriptHackMoney=.2,r.BitNodeMultipliers.CompanyWorkMoney=.1,r.BitNodeMultipliers.CrimeMoney=.2,r.BitNodeMultipliers.HacknetNodeMoney=.05,r.BitNodeMultipliers.CompanyWorkExpGain=.5,r.BitNodeMultipliers.ClassGymExpGain=.5,r.BitNodeMultipliers.FactionWorkExpGain=.5,r.BitNodeMultipliers.HackExpGain=.4,r.BitNodeMultipliers.CrimeExpGain=.5,r.BitNodeMultipliers.FactionWorkRepGain=.75;break;case 5:r.BitNodeMultipliers.ServerMaxMoney=2,r.BitNodeMultipliers.ServerStartingSecurity=2,r.BitNodeMultipliers.ServerStartingMoney=.5,r.BitNodeMultipliers.ScriptHackMoney=.15,r.BitNodeMultipliers.HacknetNodeMoney=.2,r.BitNodeMultipliers.CrimeMoney=.5,r.BitNodeMultipliers.InfiltrationRep=1.5,r.BitNodeMultipliers.InfiltrationMoney=1.5,r.BitNodeMultipliers.AugmentationMoneyCost=2,r.BitNodeMultipliers.HackExpGain=.5,r.BitNodeMultipliers.CorporationValuation=.5;break;case 6:r.BitNodeMultipliers.HackingLevelMultiplier=.35,r.BitNodeMultipliers.ServerMaxMoney=.4,r.BitNodeMultipliers.ServerStartingMoney=.5,r.BitNodeMultipliers.ServerStartingSecurity=1.5,r.BitNodeMultipliers.ScriptHackMoney=.75,r.BitNodeMultipliers.CompanyWorkMoney=.5,r.BitNodeMultipliers.CrimeMoney=.75,r.BitNodeMultipliers.InfiltrationMoney=.75,r.BitNodeMultipliers.CorporationValuation=.2,r.BitNodeMultipliers.HacknetNodeMoney=.2,r.BitNodeMultipliers.FactionPassiveRepGain=0,r.BitNodeMultipliers.HackExpGain=.25,r.BitNodeMultipliers.DaedalusAugsRequirement=1.166,r.BitNodeMultipliers.GangKarmaRequirement=5;break;case 7:r.BitNodeMultipliers.BladeburnerRank=.6,r.BitNodeMultipliers.BladeburnerSkillCost=2,r.BitNodeMultipliers.AugmentationMoneyCost=3,r.BitNodeMultipliers.HackingLevelMultiplier=.35,r.BitNodeMultipliers.ServerMaxMoney=.4,r.BitNodeMultipliers.ServerStartingMoney=.5,r.BitNodeMultipliers.ServerStartingSecurity=1.5,r.BitNodeMultipliers.ScriptHackMoney=.5,r.BitNodeMultipliers.CompanyWorkMoney=.5,r.BitNodeMultipliers.CrimeMoney=.75,r.BitNodeMultipliers.InfiltrationMoney=.75,r.BitNodeMultipliers.CorporationValuation=.2,r.BitNodeMultipliers.HacknetNodeMoney=.2,r.BitNodeMultipliers.FactionPassiveRepGain=0,r.BitNodeMultipliers.HackExpGain=.25,r.BitNodeMultipliers.FourSigmaMarketDataCost=2,r.BitNodeMultipliers.FourSigmaMarketDataApiCost=2,r.BitNodeMultipliers.DaedalusAugsRequirement=1.166,r.BitNodeMultipliers.GangKarmaRequirement=5;break;case 8:r.BitNodeMultipliers.ScriptHackMoney=.3,r.BitNodeMultipliers.ScriptHackMoneyGain=0,r.BitNodeMultipliers.ManualHackMoney=0,r.BitNodeMultipliers.CompanyWorkMoney=0,r.BitNodeMultipliers.CrimeMoney=0,r.BitNodeMultipliers.HacknetNodeMoney=0,r.BitNodeMultipliers.InfiltrationMoney=0,r.BitNodeMultipliers.RepToDonateToFaction=0,r.BitNodeMultipliers.CorporationValuation=0,r.BitNodeMultipliers.CodingContractMoney=0,r.BitNodeMultipliers.GangKarmaRequirement=10;break;case 9:r.BitNodeMultipliers.HackingLevelMultiplier=.4,r.BitNodeMultipliers.StrengthLevelMultiplier=.45,r.BitNodeMultipliers.DefenseLevelMultiplier=.45,r.BitNodeMultipliers.DexterityLevelMultiplier=.45,r.BitNodeMultipliers.AgilityLevelMultiplier=.45,r.BitNodeMultipliers.CharismaLevelMultiplier=.45,r.BitNodeMultipliers.PurchasedServerLimit=0,r.BitNodeMultipliers.HomeComputerRamCost=5,r.BitNodeMultipliers.CrimeMoney=.5,r.BitNodeMultipliers.ScriptHackMoney=.1,r.BitNodeMultipliers.HackExpGain=.05,r.BitNodeMultipliers.ServerStartingMoney=.1,r.BitNodeMultipliers.ServerMaxMoney=.1,r.BitNodeMultipliers.ServerStartingSecurity=2.5,r.BitNodeMultipliers.CorporationValuation=.5,r.BitNodeMultipliers.FourSigmaMarketDataCost=5,r.BitNodeMultipliers.FourSigmaMarketDataApiCost=4,r.BitNodeMultipliers.BladeburnerRank=.9,r.BitNodeMultipliers.BladeburnerSkillCost=1.2,r.BitNodeMultipliers.GangKarmaRequirement=3;break;case 10:r.BitNodeMultipliers.HackingLevelMultiplier=.2,r.BitNodeMultipliers.StrengthLevelMultiplier=.4,r.BitNodeMultipliers.DefenseLevelMultiplier=.4,r.BitNodeMultipliers.DexterityLevelMultiplier=.4,r.BitNodeMultipliers.AgilityLevelMultiplier=.4,r.BitNodeMultipliers.CharismaLevelMultiplier=.4,r.BitNodeMultipliers.CompanyWorkMoney=.5,r.BitNodeMultipliers.CrimeMoney=.5,r.BitNodeMultipliers.HacknetNodeMoney=.5,r.BitNodeMultipliers.ManualHackMoney=.5,r.BitNodeMultipliers.ScriptHackMoney=.5,r.BitNodeMultipliers.CodingContractMoney=.5,r.BitNodeMultipliers.InfiltrationMoney=.5,r.BitNodeMultipliers.CorporationValuation=.5,r.BitNodeMultipliers.AugmentationMoneyCost=5,r.BitNodeMultipliers.AugmentationRepCost=2,r.BitNodeMultipliers.HomeComputerRamCost=1.5,r.BitNodeMultipliers.PurchasedServerCost=5,r.BitNodeMultipliers.PurchasedServerLimit=.6,r.BitNodeMultipliers.PurchasedServerMaxRam=.5,r.BitNodeMultipliers.BladeburnerRank=.8,r.BitNodeMultipliers.GangKarmaRequirement=3;break;case 11:r.BitNodeMultipliers.HackingLevelMultiplier=.5,r.BitNodeMultipliers.HackExpGain=.5,r.BitNodeMultipliers.ServerMaxMoney=.1,r.BitNodeMultipliers.ServerStartingMoney=.1,r.BitNodeMultipliers.ServerGrowthRate=.2,r.BitNodeMultipliers.ServerWeakenRate=2,r.BitNodeMultipliers.CrimeMoney=3,r.BitNodeMultipliers.CompanyWorkMoney=.5,r.BitNodeMultipliers.HacknetNodeMoney=.1,r.BitNodeMultipliers.AugmentationMoneyCost=2,r.BitNodeMultipliers.InfiltrationMoney=2.5,r.BitNodeMultipliers.InfiltrationRep=2.5,r.BitNodeMultipliers.CorporationValuation=.1,r.BitNodeMultipliers.CodingContractMoney=.25,r.BitNodeMultipliers.FourSigmaMarketDataCost=4,r.BitNodeMultipliers.FourSigmaMarketDataApiCost=4;break;case 12:for(var n=0,a=0;a<e.sourceFiles.length;a++)12===e.sourceFiles[a].n&&(n=e.sourceFiles[a].lvl);var i=Math.pow(1.02,n),o=1/i;r.BitNodeMultipliers.DaedalusAugsRequirement=Math.min(i,1.34),r.BitNodeMultipliers.HackingLevelMultiplier=o,r.BitNodeMultipliers.StrengthLevelMultiplier=o,r.BitNodeMultipliers.DefenseLevelMultiplier=o,r.BitNodeMultipliers.DexterityLevelMultiplier=o,r.BitNodeMultipliers.AgilityLevelMultiplier=o,r.BitNodeMultipliers.CharismaLevelMultiplier=o,r.BitNodeMultipliers.ServerMaxMoney=o,r.BitNodeMultipliers.ServerStartingMoney=o,r.BitNodeMultipliers.ServerGrowthRate=o,r.BitNodeMultipliers.ServerWeakenRate=o,r.BitNodeMultipliers.ServerStartingSecurity=1.5,r.BitNodeMultipliers.HomeComputerRamCost=i,r.BitNodeMultipliers.PurchasedServerCost=i,r.BitNodeMultipliers.PurchasedServerLimit=o,r.BitNodeMultipliers.PurchasedServerMaxRam=o,r.BitNodeMultipliers.ManualHackMoney=o,r.BitNodeMultipliers.ScriptHackMoney=o,r.BitNodeMultipliers.CompanyWorkMoney=o,r.BitNodeMultipliers.CrimeMoney=o,r.BitNodeMultipliers.HacknetNodeMoney=o,r.BitNodeMultipliers.CodingContractMoney=o,r.BitNodeMultipliers.CompanyWorkExpGain=o,r.BitNodeMultipliers.ClassGymExpGain=o,r.BitNodeMultipliers.FactionWorkExpGain=o,r.BitNodeMultipliers.HackExpGain=o,r.BitNodeMultipliers.CrimeExpGain=o,r.BitNodeMultipliers.FactionWorkRepGain=o,r.BitNodeMultipliers.FactionPassiveRepGain=o,r.BitNodeMultipliers.RepToDonateToFaction=i,r.BitNodeMultipliers.AugmentationRepCost=i,r.BitNodeMultipliers.AugmentationMoneyCost=i,r.BitNodeMultipliers.InfiltrationMoney=o,r.BitNodeMultipliers.InfiltrationRep=o,r.BitNodeMultipliers.FourSigmaMarketDataCost=i,r.BitNodeMultipliers.FourSigmaMarketDataApiCost=i,r.BitNodeMultipliers.CorporationValuation=o,r.BitNodeMultipliers.BladeburnerRank=o,r.BitNodeMultipliers.BladeburnerSkillCost=i;break;default:console.warn("Player.bitNodeN invalid")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(140),a=n(53),i=n(6),o=n(16),s={name:"",info:"",companyPositions:{},expMultiplier:1,salaryMultiplier:1,jobStatReqOffset:0};class l{static fromJSON(e){return o.Generic_fromJSON(l,e.data)}constructor(e=s){this.name=e.name,this.info=e.info,this.companyPositions=e.companyPositions,this.expMultiplier=e.expMultiplier,this.salaryMultiplier=e.salaryMultiplier,this.jobStatReqOffset=e.jobStatReqOffset,this.isPlayerEmployed=!1,this.playerReputation=1,this.favor=0,this.rolloverRep=0}hasPosition(e){return e instanceof r.CompanyPosition?null!=this.companyPositions[e.name]:null!=this.companyPositions[e]}hasAgentPositions(){return null!=this.companyPositions[a.AgentCompanyPositions[0]]}hasBusinessConsultantPositions(){return null!=this.companyPositions[a.BusinessConsultantCompanyPositions[0]]}hasBusinessPositions(){return null!=this.companyPositions[a.BusinessCompanyPositions[0]]}hasEmployeePositions(){return null!=this.companyPositions[a.MiscCompanyPositions[1]]}hasITPositions(){return null!=this.companyPositions[a.ITCompanyPositions[0]]}hasSecurityPositions(){return null!=this.companyPositions[a.SecurityCompanyPositions[2]]}hasSoftwareConsultantPositions(){return null!=this.companyPositions[a.SoftwareConsultantCompanyPositions[0]]}hasSoftwarePositions(){return null!=this.companyPositions[a.SoftwareCompanyPositions[0]]}hasWaiterPositions(){return null!=this.companyPositions[a.MiscCompanyPositions[0]]}gainFavor(){null==this.favor&&(this.favor=0),null==this.rolloverRep&&(this.rolloverRep=0);var e=this.getFavorGain();2==e.length?(this.favor+=e[0],this.rolloverRep=e[1]):console.error("Invalid result from getFavorGain() function")}getFavorGain(){null==this.favor&&(this.favor=0),null==this.rolloverRep&&(this.rolloverRep=0);let e=0,t=this.playerReputation+this.rolloverRep,n=i.CONSTANTS.CompanyReputationToFavorBase*Math.pow(i.CONSTANTS.CompanyReputationToFavorMult,this.favor);for(;t>0&&t>=n;)++e,t-=n,n*=i.CONSTANTS.FactionReputationToFavorMult;return[e,t]}toJSON(){return o.Generic_toJSON("Company",this)}}t.Company=l,o.Reviver.constructors.Company=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MaterialSizes={Water:.05,Energy:.01,Food:.03,Plants:.05,Metal:.1,Hardware:.06,Chemicals:.05,Drugs:.02,Robots:.5,AICores:.1,RealEstate:0,"Real Estate":0,"AI Cores":0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(65),a=n(8),i=n(16);class o{static fromJSON(e){return i.Generic_fromJSON(o,e.data)}constructor(e="",t=""){this.fn=(e.endsWith(".txt")?e:`${e}.txt`).replace(/\s+/g,""),this.text=t}append(e){this.text+=e}download(){const e=this.fn,t=new Blob([this.text],{type:"text/plain"});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(t,e);else{const e=document.createElement("a"),n=URL.createObjectURL(t);e.href=n,e.download=this.fn,document.body.appendChild(e),e.click(),r.setTimeoutRef(()=>{document.body.removeChild(e),window.URL.revokeObjectURL(n)},0)}}read(){return this.text}show(){a.dialogBoxCreate(`${this.fn}<br /><br />${this.text}`,!0)}toJSON(){return i.Generic_toJSON("TextFile",this)}write(e){this.text=e}}function s(e,t){const n=e.endsWith(".txt")?e:`${e}.txt`;for(const e of t.textFiles)if(e.fn===n)return e;return null}t.TextFile=o,i.Reviver.constructors.TextFile=o,t.getTextFile=s,t.createTextFile=function(e,t,n){if(null!==s(e,n))return void console.error(`A file named "${e}" already exists on server ${n.hostname}.`);const r=new o(e,t);return n.textFiles.push(r),r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.SyntaxError=-1]="SyntaxError",e[e.ImportError=-2]="ImportError",e[e.URLImportError=-3]="URLImportError"}(t.RamCalculationErrorCode||(t.RamCalculationErrorCode={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiteratureNames={HackersStartingHandbook:"hackers-starting-handbook.lit",CorporationManagementHandbook:"corporation-management-handbook.lit",HistoryOfSynthoids:"history-of-synthoids.lit",AGreenTomorrow:"A-Green-Tomorrow.lit",AlphaOmega:"alpha-omega.lit",SimulatedReality:"simulated-reality.lit",BeyondMan:"beyond-man.lit",BrighterThanTheSun:"brighter-than-the-sun.lit",DemocracyIsDead:"democracy-is-dead.lit",Sector12Crime:"sector-12-crime.lit",ManAndMachine:"man-and-machine.lit",SecretSocieties:"secret-societies.lit",TheFailedFrontier:"the-failed-frontier.lit",CodedIntelligence:"coded-intelligence.lit",SyntheticMuscles:"synthetic-muscles.lit",TensionsInTechRace:"tensions-in-tech-race.lit",CostOfImmortality:"cost-of-immortality.lit",TheHiddenWorld:"the-hidden-world.lit",TheNewGod:"the-new-god.lit",NewTriads:"new-triads.lit",TheSecretWar:"the-secret-war.lit"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(20),a=n(22),i=n(19),o=n(6),s=n(8),l=n(45),c=n(232);function u(e){const t=Math.round(e);return isNaN(t)||!c.isPowerOfTwo(t)?1/0:t>p()?1/0:t*o.CONSTANTS.BaseCostFor1GBOfRamServer*i.BitNodeMultipliers.PurchasedServerCost}function m(){return Math.round(o.CONSTANTS.PurchasedServerLimit*i.BitNodeMultipliers.PurchasedServerLimit)}function p(){const e=Math.round(o.CONSTANTS.PurchasedServerMaxRam*i.BitNodeMultipliers.PurchasedServerMaxRam);return 1<<31-Math.clz32(e)}t.getPurchaseServerCost=u,t.getPurchaseServerLimit=m,t.getPurchaseServerMaxRam=p,t.purchaseServer=function(e,t){const n=u(e);if(!t.canAfford(n))return void s.dialogBoxCreate("You don't have enough money to purchase this server!",!1);if(t.purchasedServers.length>=m())return void s.dialogBoxCreate("You have reached the maximum limit of "+m()+" servers. You cannot purchase any more. You can delete some of your purchased servers using the deleteServer() Netscript function in a script");var i=l.yesNoTxtInpBoxGetInput();if(""==i)return void s.dialogBoxCreate("You must enter a hostname for your new server!");const o=a.safetlyCreateUniqueServer({adminRights:!0,hostname:i,ip:r.createUniqueRandomIp(),isConnectedTo:!1,maxRam:e,organizationName:"",purchasedByPlayer:!0});r.AddToAllServers(o),t.purchasedServers.push(o.ip);var c=t.getHomeComputer();c.serversOnNetwork.push(o.ip),o.serversOnNetwork.push(c.ip),t.loseMoney(n),s.dialogBoxCreate("Server successfully purchased with hostname "+i)},t.purchaseRamForHomeComputer=function(e,t){if(!t.canAfford(e))return void s.dialogBoxCreate("You do not have enough money to purchase additional RAM for your home computer");const n=t.getHomeComputer();n.maxRam>=o.CONSTANTS.HomeComputerMaxRam?s.dialogBoxCreate("You cannot upgrade your home computer RAM because it is at its maximum possible value"):(n.maxRam*=2,t.loseMoney(e),s.dialogBoxCreate("Purchased additional RAM for home computer! It now has "+n.maxRam+"GB of RAM."))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(65),a=n(115),i=3e3;let o;t.createStatusText=function(e){void 0!==o&&(clearTimeout(o),o=void 0);const t=a.getElementById("status-text");t.style.display="block",t.classList.add("status-text"),t.innerText=e,o=r.setTimeoutRef(()=>{t.innerText="",t.style.display="none",t.classList.remove("status-text")},i)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(195);t.GeneralActions={},function(){let e;e="Training",t.GeneralActions[e]=new r.Action({name:e,desc:"Improve your abilities at the Bladeburner unit's specialized training center. Doing this gives experience for all combat stats and also increases your max stamina."}),e="Field Analysis",t.GeneralActions[e]=new r.Action({name:e,desc:"Mine and analyze Synthoid-related data. This improve the Bladeburner's unit intelligence on Synthoid locations and activities. Completing this action will improve the accuracy of your Synthoid population estimated in the current city.<br><br>Does NOT require stamina."}),e="Recruitment",t.GeneralActions[e]=new r.Action({name:e,desc:"Attempt to recruit members for your Bladeburner team. These members can help you conduct operations.<br><br>Does NOT require stamina."}),e="Diplomacy",t.GeneralActions[e]=new r.Action({name:e,desc:"Improve diplomatic relations with the Synthoid population. Completing this action will reduce the Chaos level in your current city.<br><br>Does NOT require stamina."}),e="Hyperbolic Regeneration Chamber",t.GeneralActions[e]=new r.Action({name:e,desc:"Enter cryogenic stasis using the Bladeburner division's hi-tech Regeneration Chamber. This will slowly heal your wounds and slightly increase your stamina.<br><br>"})}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cities={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(209);t.WorkerScriptStartStopEventEmitter=new r.EventEmitter},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?a(e.value):new n(function(t){t(e.value)}).then(o,s)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const a=n(216),i=n(11),o=n(65),s=n(16),l=n(158);let c=0;class u{constructor(e="",t="",n="",r=[]){this.code="",this.filename="",this.url="",this.module="",this.dependencies=[],this.ramUsage=0,this.server="",this.filename=e,this.code=t,this.ramUsage=0,this.server=n,this.module="",this.moduleSequenceNumber=++c,""!==this.code&&this.updateRamUsage(r)}static fromJSON(e){return s.Generic_fromJSON(u,e.data)}download(){const e=this.filename+".js",t=new Blob([this.code],{type:"text/plain"});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(t,e);else{var n=document.createElement("a"),r=URL.createObjectURL(t);n.href=r,n.download=e,document.body.appendChild(n),n.click(),o.setTimeoutRef(function(){document.body.removeChild(n),window.URL.revokeObjectURL(r)},0)}}markUpdated(){this.module="",this.moduleSequenceNumber=++c}saveScript(e,t,n){if(i.routing.isOn(i.Page.ScriptEditor)){this.code=e.replace(/^\s+|\s+$/g,"");const r=document.getElementById("script-editor-filename");if(null==r)return void console.error("Failed to get Script filename DOM element");this.filename=r.value,this.server=t,this.updateRamUsage(n),this.markUpdated()}}updateRamUsage(e){return r(this,void 0,void 0,function*(){var t=yield a.calculateRamUsage(this.code,e);t>0&&(this.ramUsage=l.roundToTwo(t))})}toJSON(){return s.Generic_toJSON("Script",this)}}t.Script=u,s.Reviver.constructors.Script=u},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return Ee});var r=n(9),a=n(105),i=(n(14),n(10)),o=n(71),s=n(120),l=n(4),c=n(19),u=n(147),m=n(70),p=n(96),h=n(25),d=n(140),_=n(47),g=n(6),y=n(142),f=n(54),b=n(62),E=(n(74),n(13)),v=n(50),k=n(173),C=n(191),T=n(23),P=n(34),S=n(28),O=n(36),M=n(59),x=n(66),w=(n(68),n(69)),A=n(0),N=n(32),R=n(106),D=n(72),I=n(60),B=(n(213),n(20)),L=n(119),W=n(57),F=(n(116),n(22)),j=n(101),U=(n(17),n(40)),H=n(38),G=n(122),K=n(159),$=(n(117),n(42)),q=n(155),Y=n(87),z=n(76),V=n(153),J=n(146),X=n(75),Q=n(98),Z=(n(431),n(67)),ee=n(89),te=n(63),ne=n(112),re=n(145),ae=n(212),ie=n(131),oe=(n(11),n(2)),se=n(5),le=n(65),ce=n(285),ue=n(7),me=(n(8),n(110)),pe=n(83),he=(n(232),n(48)),de=n(3),_e=n(37),ge=n(27);const ye=n(267).sprintf,fe=n(267).vsprintf,be={ALL:!0,scan:!0,hack:!0,sleep:!0,disableLog:!0,enableLog:!0,grow:!0,weaken:!0,nuke:!0,brutessh:!0,ftpcrack:!0,relaysmtp:!0,httpworm:!0,sqlinject:!0,run:!0,exec:!0,spawn:!0,kill:!0,killall:!0,scp:!0,getHackingLevel:!0,getServerMoneyAvailable:!0,getServerSecurityLevel:!0,getServerBaseSecurityLevel:!0,getServerMinSecurityLevel:!0,getServerRequiredHackingLevel:!0,getServerMaxMoney:!0,getServerGrowth:!0,getServerNumPortsRequired:!0,getServerRam:!0,buyStock:!0,sellStock:!0,shortStock:!0,sellShort:!0,purchase4SMarketData:!0,purchase4SMarketDataTixApi:!0,purchaseServer:!0,deleteServer:!0,universityCourse:!0,gymWorkout:!0,travelToCity:!0,purchaseTor:!0,purchaseProgram:!0,stopAction:!0,upgradeHomeRam:!0,workForCompany:!0,applyToCompany:!0,joinFaction:!0,workForFaction:!0,donateToFaction:!0,createProgram:!0,commitCrime:!0,startAction:!0,upgradeSkill:!0,setTeamSize:!0,joinBladeburnerFaction:!0,recruitMember:!0,setMemberTask:!0,purchaseEquipment:!0,setTerritoryWarfare:!0};function Ee(t){const n=function(e,n){if(t.dynamicLoadedFns[e])return;t.dynamicLoadedFns[e]=!0;let r=t.scriptRef.threads;if("number"!=typeof r&&(console.warn(`WorkerScript detected NaN for threadcount for ${t.name} on ${t.serverIp}`),r=1),t.dynamicRamUsage+=n*r,t.dynamicRamUsage>1.01*t.ramUsage)throw Object(te.b)(t,"Dynamic RAM usage calculated to be greater than initial RAM usage on fn: "+e+". This is probably because you somehow circumvented the static RAM calculation.<br><br>Please don't do that :(<br><br>Dynamic RAM Usage: "+t.dynamicRamUsage+"<br>Static RAM Usage: "+t.ramUsage)},ve=function(e,t=""){var n=Object(F.getServer)(e);if(null==n)throw Me(t,`Invalid IP/hostname: ${e}`);return n},ke=function(e,n,r,a){if("string"==typeof r&&""!==r||(r="getRunningScript"),!Array.isArray(a))throw Object(te.b)(t,`Invalid scriptArgs argument passed into getRunningScript() from ${r}(). `+"This is probably a bug. Please report to game developer");if(null!=e&&"string"==typeof e){null==n&&(n=t.serverIp);const i=ve(n,r);return Object(D.a)(e,a,i)}return t.scriptRef},Ce=function(e,t,n){return Array.isArray(n)||(n=[]),`Cannot find running script ${e} on server ${t} with args: ${Object(pe.arrayToString)(n)}`},Te=function(e=""){if(!A.Player.hasWseAccount)throw Me(e,`You don't have WSE Access! Cannot use ${e}()`);if(!A.Player.hasTixApiAccess)throw Me(e,`You don't have TIX API Access! Cannot use ${e}()`)},Pe=function(e,t=""){const n=$.SymbolToStockMap[e];if(null==n)throw Me(t,`Invalid stock symbol: '${e}'`);return n},Se=function(e,n=""){return e instanceof P.HacknetServer&&(t.log(n,"Does not work on Hacknet Servers"),!0)},Oe=function(e,t=""){if(isNaN(e))throw Me(t,"Invalid index specified for Hacknet Node: "+e);if(e<0||e>=A.Player.hacknetNodes.length)throw Me(t,"Index specified for Hacknet Node is out-of-bounds: "+e);if(Object(T.h)()){const n=B.AllServers[A.Player.hacknetNodes[e]];if(null==n)throw Me(t,`Could not get Hacknet Server for index ${e}. This is probably a bug, please report to game dev`);return n}return A.Player.hacknetNodes[e]},Me=function(e,n){const r=(new Error).stack.split("\n").slice(1),a=t.getServer().scripts;let i=[];for(const e of r){let t;for(const n of a){n.url&&e.includes(n.url)&&(t=n.filename);for(const r of n.dependencies)e.includes(r.url)&&(t=r.filename)}if(!t)continue;function o(e){const t=e.match(/.*:(\d+):\d+.*/),n=e.match(/.*at (.+) \(.*/);if(t&&n){let e=n[1];return{line:t[1],func:e}}return null}let n={line:"-1",func:"unknown"},r=o(e);function s(e){const t=e.match(/.*:(\d+):\d+$/),n=e.lastIndexOf("@");return t&&-1!==n?{line:t[1],func:e.slice(0,n)}:null}r&&(n=r);let l=s(e);l&&(n=l),i.push(`${t}:L${n.line}@${n.func}`)}t.log(e,n);const l=`${e}: ${n}<br><br>Stack:<br>${i.join("<br>")}`;return Object(te.b)(t,l)},xe=function(e,t){if(4!==A.Player.bitNodeN&&H.SourceFileFlags[4]<t)throw Me(e,`This singularity function requires Source-File 4-${t} to run.`)},we=function(e,t=!1){if(!(7===A.Player.bitNodeN||A.Player.sourceFiles.some(e=>7===e.n))){throw Me(`bladeburner.${e}`,"You do not currently have access to the Bladeburner API. You must either be in BitNode-7 or have Source-File 7.")}if(!t){if(!(A.Player.bladeburner instanceof m.a)){throw Me(`bladeburner.${e}`,"You must be a member of the Bladeburner division to use this API.")}}},Ae=function(e,t){if(!A.Player.bladeburner.cities.hasOwnProperty(t))throw Me(`bladeburner.${e}`,`Invalid city: ${t}`)},Ne=function(e){if(10!==A.Player.bitNodeN&&!H.SourceFileFlags[10])throw Me(`sleeve.${e}`,"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")},Re=function(e,n){if(n>=A.Player.sleeves.length||n<0){const r=`Invalid sleeve number: ${n}`;throw t.log(e,r),Me(`sleeve.${e}`,r)}},De=function(e,t,n){const r=ve(t,e).getContract(n);if(null==r)throw Me(`codingcontract.${e}`,`Cannot find contract '${n}' on server '${t}'`);return r},Ie=function(e){if(!(A.Player.gang instanceof b.b))throw Me(`gang.${e}`,"You do not currently have a Gang")},Be=function(e,t){for(const e of A.Player.gang.members)if(e.name===t)return e;throw Me(`gang.${e}`,`Invalid gang member: '${t}'`)},Le=function(e,t,n){const r=A.Player.bladeburner.getActionIdFromTypeAndName(t,n);if(!r)throw Me(`bladeburner.${e}`,`Invalid action type='${t}', name='${n}'`);const a=A.Player.bladeburner.getActionObject(r);if(!a)throw Me(`bladeburner.${e}`,`Invalid action type='${t}', name='${n}'`);return a},We=function(e,t){const n=h.Companies[t];if(null==n||!(n instanceof p.Company))throw Me(e,`Invalid company name: '${t}'`);return n},Fe=function(e,t){if(!Object(E.factionExists)(t))throw Me(e,`Invalid faction name: '${t}`);return E.Factions[t]},je=function(e,t){if(!Object(o.b)(t))throw Me(e,`Invalid augmentation: '${t}'`);return i.Augmentations[t]},Ue=function(e=null){if(e&&Object(he.isString)(e)){const t=A.Player.getHomeComputer();for(const n of t.scripts)if(n.filename===e){if(n.ramUsage>t.maxRam-t.ramUsed)return;const e=new L.RunningScript(n,[]);e.threads=1,Object(W.e)(e,t)}}},He=function(e,n,{threads:r,stock:a}={}){if(void 0===e)throw Me("hack","Takes 1 argument.");const i=Object(te.d)(t,"hack",r),o=Object(F.getServer)(e);if(null==o)throw Me("hack",`Invalid IP/hostname: ${e}.`);var s=Object(f.calculateHackingTime)(o);const l=Object(C.netscriptCanHack)(o,A.Player);if(!l.res)throw Me("hack",l.msg);return t.log("hack",`Executing ${e} in ${s.toFixed(3)} seconds (t=${i})`),Object(te.c)(1e3*s,t).then(function(){if(t.env.stopFlag)return Promise.reject(t);var e=Object(f.calculateHackingChance)(o),r=Math.random(),s=Object(f.calculateHackingExpGain)(o)*i,l=s/4;if(r<e){const e=Object(f.calculatePercentMoneyHacked)(o);let r=Math.ceil(1/e*(o.moneyAvailable/o.moneyMax));isNaN(r)&&(r=1e6);let u=Math.floor(o.moneyAvailable*e)*i;u<=0&&(u=0,s=l),u>o.moneyAvailable&&(u=o.moneyAvailable),o.moneyAvailable-=u,o.moneyAvailable<0&&(o.moneyAvailable=0);const m=u*c.BitNodeMultipliers.ScriptHackMoneyGain;return A.Player.gainMoney(m),t.scriptRef.onlineMoneyMade+=m,A.Player.scriptProdSinceLastAug+=m,A.Player.recordMoneySource(m,"hacking"),t.scriptRef.recordHack(o.ip,m,i),A.Player.gainHackingExp(s),t.scriptRef.onlineExpGained+=s,t.log("hack",`Successfully hacked '${o.hostname}' for ${oe.numeralWrapper.format(m,"$0.000a")} and ${oe.numeralWrapper.format(s,"0.000a")} exp (t=${i})`),o.fortify(g.CONSTANTS.ServerFortifyAmount*Math.min(i,r)),a&&Object(K.influenceStockThroughServerHack)(o,m),n&&(o.manuallyHacked=!0),Promise.resolve(m)}return A.Player.gainHackingExp(l),t.scriptRef.onlineExpGained+=l,t.log("hack",`Failed to hack '${o.hostname}'. Gained ${oe.numeralWrapper.format(l,"0.000a")} exp (t=${i})`),Promise.resolve(0)})};return{hacknet:{numNodes:function(){return A.Player.hacknetNodes.length},maxNumNodes:function(){return P.MaxNumberHacknetServers},purchaseNode:function(){return Object(T.m)()},getPurchaseNodeCost:function(){return Object(T.h)()?Object(T.c)():Object(T.b)()},getNodeStats:function(e){const t=Oe(e,"getNodeStats"),n=Object(T.h)(),r={name:n?t.hostname:t.name,level:t.level,ram:n?t.maxRam:t.ram,cores:t.cores,production:n?t.hashRate:t.moneyGainRatePerSecond,timeOnline:t.onlineTimeSeconds,totalProduction:n?t.totalHashesGenerated:t.totalMoneyGenerated};return n&&(r.cache=t.cache,r.hashCapacity=t.hashCapacity),r},upgradeLevel:function(e,t){const n=Oe(e,"upgradeLevel");return Object(T.o)(n,t)},upgradeRam:function(e,t){const n=Oe(e,"upgradeRam");return Object(T.p)(n,t)},upgradeCore:function(e,t){const n=Oe(e,"upgradeCore");return Object(T.l)(n,t)},upgradeCache:function(e,t){if(!Object(T.h)())return!1;const n=Oe(e,"upgradeCache"),r=Object(T.k)(n,t);return r&&Object(T.r)(),r},getLevelUpgradeCost:function(e,t){return Oe(e,"upgradeLevel").calculateLevelUpgradeCost(t,A.Player.hacknet_node_level_cost_mult)},getRamUpgradeCost:function(e,t){return Oe(e,"upgradeRam").calculateRamUpgradeCost(t,A.Player.hacknet_node_ram_cost_mult)},getCoreUpgradeCost:function(e,t){return Oe(e,"upgradeCore").calculateCoreUpgradeCost(t,A.Player.hacknet_node_core_cost_mult)},getCacheUpgradeCost:function(e,t){if(!Object(T.h)())return 1/0;return Oe(e,"upgradeCache").calculateCacheUpgradeCost(t)},numHashes:function(){return Object(T.h)()?A.Player.hashManager.hashes:0},hashCost:function(e){return Object(T.h)()?A.Player.hashManager.getUpgradeCost(e):1/0},spendHashes:function(e,t){return!!Object(T.h)()&&Object(T.n)(e,t)}},sprintf:ye,vsprintf:fe,scan:function(e=t.serverIp,a=!0){n("scan",Object(r.getRamCost)("scan"));var i=Object(F.getServer)(e);if(null==i)throw Me("scan",`Invalid IP/hostname: ${e}.`);for(var o=[],s=0;s<i.serversOnNetwork.length;s++){var l;null!=(l=a?Object(F.getServerOnNetwork)(i,s).hostname:Object(F.getServerOnNetwork)(i,s).ip)&&o.push(l)}return t.log("scan",`returned ${i.serversOnNetwork.length} connections for ${i.hostname}`),o},hack:function(e,{threads:t,stock:a}={}){return n("hack",Object(r.getRamCost)("hack")),He(e,!1,{threads:t,stock:a})},hackAnalyzeThreads:function(e,a){n("hackAnalyzeThreads",Object(r.getRamCost)("hackAnalyzeThreads"));const i=ve(e,"hackAnalyzeThreads");if(isNaN(a))throw Me(t,`Invalid growth argument passed into hackAnalyzeThreads: ${a}. Must be numeric.`);if(a<0||a>i.moneyAvailable)return-1;const o=Object(f.calculatePercentMoneyHacked)(i);return a/Math.floor(i.moneyAvailable*o)},hackAnalyzePercent:function(e){n("hackAnalyzePercent",Object(r.getRamCost)("hackAnalyzePercent"));const t=ve(e,"hackAnalyzePercent");return 100*Object(f.calculatePercentMoneyHacked)(t)},hackChance:function(e){n("hackChance",Object(r.getRamCost)("hackChance"));const t=ve(e,"hackChance");return Object(f.calculateHackingChance)(t)},sleep:function(e){if(void 0===e)throw Me("sleep","Takes 1 argument.");return t.log("sleep",`Sleeping for ${e} milliseconds`),Object(te.c)(e,t).then(function(){return Promise.resolve(!0)})},grow:function(e,{threads:a,stock:i}={}){n("grow",Object(r.getRamCost)("grow"));const o=Object(te.d)(t,"grow",a);if(void 0===e)throw Me("grow","Takes 1 argument.");var s=Object(F.getServer)(e);if(null==s)throw Me("grow",`Invalid IP/hostname: ${e}.`);const l=Object(C.netscriptCanGrow)(s);if(!l.res)throw Me("grow",l.msg);var c=Object(f.calculateGrowTime)(s);return t.log("grow",`Executing on '${s.hostname}' in ${Object(ue.formatNumber)(c,3)} seconds (t=${o}).`),Object(te.c)(1e3*c,t).then(function(){if(t.env.stopFlag)return Promise.reject(t);const e=s.moneyAvailable<=0?1:s.moneyAvailable;s.moneyAvailable+=1*o;var n=Object(F.processSingleServerGrowth)(s,450*o,A.Player);const r=s.moneyAvailable;t.scriptRef.recordGrow(s.ip,o);var a=Object(f.calculateHackingExpGain)(s)*o;1==n&&(a=0);const l=r/e*100-100;return t.log("grow",`Available money on '${s.hostname}' grown by ${Object(ue.formatNumber)(l,6)}%. Gained ${oe.numeralWrapper.format(a,"0.000a")} hacking exp (t=${o}).`),t.scriptRef.onlineExpGained+=a,A.Player.gainHackingExp(a),i&&Object(K.influenceStockThroughServerGrow)(s,r-e),Promise.resolve(r/e)})},growthAnalyze:function(e,t){n("growthAnalyze",Object(r.getRamCost)("growthAnalyze"));const a=ve(e,"growthAnalyze");if("number"!=typeof t||isNaN(t)||t<1)throw Me("growthAnalyze",`Invalid argument: growth must be numeric and >= 1, is ${t}.`);return Object(F.numCycleForGrowth)(a,Number(t),A.Player)},weaken:function(e,{threads:a}={}){n("weaken",Object(r.getRamCost)("weaken"));var i=Object(te.d)(t,"weaken",a);if(void 0===e)throw Me("weaken","Takes 1 argument.");var o=Object(F.getServer)(e);if(null==o)throw Me("weaken",`Invalid IP/hostname: ${e}`);const s=Object(C.netscriptCanWeaken)(o);if(!s.res)throw Me("weaken",s.msg);var l=Object(f.calculateWeakenTime)(o);return t.log("weaken",`Executing on '${o.hostname}' in ${Object(ue.formatNumber)(l,3)} seconds (t=${i})`),Object(te.c)(1e3*l,t).then(function(){if(t.env.stopFlag)return Promise.reject(t);o.weaken(g.CONSTANTS.ServerWeakenAmount*i),t.scriptRef.recordWeaken(o.ip,i);var e=Object(f.calculateHackingExpGain)(o)*i;return t.log("weaken",`'${o.hostname}' security level weakened to ${o.hackDifficulty}. Gained ${oe.numeralWrapper.format(e,"0.000a")} hacking exp (t=${i})`),t.scriptRef.onlineExpGained+=e,A.Player.gainHackingExp(e),Promise.resolve(g.CONSTANTS.ServerWeakenAmount*i)})},print:function(e){if(void 0===e)throw Me("print","Takes 1 argument.");t.print(e.toString())},tprint:function(e){if(void 0===e||null==e)throw Me("tprint","Takes 1 argument.");e.toString();Object(se.post)(`${t.scriptRef.filename}: ${e.toString()}`)},clearLog:function(){t.scriptRef.clearLog()},disableLog:function(e){if(void 0===be[e])throw Me("disableLog",`Invalid argument: ${e}.`);t.disableLogs[e]=!0,t.log("disableLog",`Disabled logging for ${e}`)},enableLog:function(e){if(void 0===be[e])throw Me("enableLog",`Invalid argument: ${e}.`);delete t.disableLogs[e],t.log("enableLog",`Enabled logging for ${e}`)},isLogEnabled:function(e){if(void 0===be[e])throw Me("isLogEnabled",`Invalid argument: ${e}.`);return!t.disableLogs[e]},getScriptLogs:function(e,n,...r){const a=ke(e,n,"getScriptLogs",r);return null==a?(t.log("getScriptLogs",Ce(e,n,r)),""):a.logs.slice()},tail:function(e,n,...r){const a=ke(e,n,"tail",r);null!=a?Object(me.logBoxCreate)(a):t.log("tail",Ce(e,n,r))},nuke:function(e){if(n("nuke",Object(r.getRamCost)("nuke")),void 0===e)throw Me("nuke","Takes 1 argument.");var a=Object(F.getServer)(e);if(null==a)throw Me("nuke",`Invalid IP/hostname: ${e}.`);if(!A.Player.hasProgram(N.Programs.NukeProgram.name))throw Me("nuke","You do not have the NUKE.exe virus!");if(a.openPortCount<a.numOpenPortsRequired)throw Me("nuke","Not enough ports opened to use NUKE.exe virus.");return a.hasAdminRights?t.log("nuke",`Already have root access to '${a.hostname}'.`):(a.hasAdminRights=!0,t.log("nuke",`Executed NUKE.exe virus on '${a.hostname}' to gain root access.`)),!0},brutessh:function(e){if(n("brutessh",Object(r.getRamCost)("brutessh")),void 0===e)throw Me("brutessh","Takes 1 argument.");var a=Object(F.getServer)(e);if(null==a)throw Me("brutessh",`Invalid IP/hostname: ${e}.`);if(!A.Player.hasProgram(N.Programs.BruteSSHProgram.name))throw Me("brutessh","You do not have the BruteSSH.exe program!");return a.sshPortOpen?t.log("brutessh",`SSH Port (22) already opened on '${a.hostname}'.`):(t.log("brutessh",`Executed BruteSSH.exe on '${a.hostname}' to open SSH port (22).`),a.sshPortOpen=!0,++a.openPortCount),!0},ftpcrack:function(e){if(n("ftpcrack",Object(r.getRamCost)("ftpcrack")),void 0===e)throw Me("ftpcrack","Takes 1 argument.");var a=Object(F.getServer)(e);if(null==a)throw Me("ftpcrack",`Invalid IP/hostname: ${e}.`);if(!A.Player.hasProgram(N.Programs.FTPCrackProgram.name))throw Me("ftpcrack","You do not have the FTPCrack.exe program!");return a.ftpPortOpen?t.log("ftpcrack",`FTP Port (21) already opened on '${a.hostname}'.`):(t.log("ftpcrack",`Executed FTPCrack.exe on '${a.hostname}' to open FTP port (21).`),a.ftpPortOpen=!0,++a.openPortCount),!0},relaysmtp:function(e){if(n("relaysmtp",Object(r.getRamCost)("relaysmtp")),void 0===e)throw Me("relaysmtp","Takes 1 argument.");var a=Object(F.getServer)(e);if(null==a)throw Me("relaysmtp",`Invalid IP/hostname: ${e}.`);if(!A.Player.hasProgram(N.Programs.RelaySMTPProgram.name))throw Me("relaysmtp","You do not have the relaySMTP.exe program!");return a.smtpPortOpen?t.log("relaysmtp",`SMTP Port (25) already opened on '${a.hostname}'.`):(t.log("relaysmtp",`Executed relaySMTP.exe on '${a.hostname}' to open SMTP port (25).`),a.smtpPortOpen=!0,++a.openPortCount),!0},httpworm:function(e){if(n("httpworm",Object(r.getRamCost)("httpworm")),void 0===e)throw Me("httpworm","Takes 1 argument");var a=Object(F.getServer)(e);if(null==a)throw Me("httpworm",`Invalid IP/hostname: ${e}`);if(!A.Player.hasProgram(N.Programs.HTTPWormProgram.name))throw Me("httpworm","You do not have the HTTPWorm.exe program!");return a.httpPortOpen?t.log("httpworm",`HTTP Port (80) already opened on '${a.hostname}'.`):(t.log("httpworm",`Executed HTTPWorm.exe on '${a.hostname}' to open HTTP port (80).`),a.httpPortOpen=!0,++a.openPortCount),!0},sqlinject:function(e){if(n("sqlinject",Object(r.getRamCost)("sqlinject")),void 0===e)throw Me("sqlinject","Takes 1 argument.");var a=Object(F.getServer)(e);if(null==a)throw Me("sqlinject",`Invalid IP/hostname: ${e}`);if(!A.Player.hasProgram(N.Programs.SQLInjectProgram.name))throw Me("sqlinject","You do not have the SQLInject.exe program!");return a.sqlPortOpen?t.log("sqlinject",`SQL Port (1433) already opened on '${a.hostname}'.`):(t.log("sqlinject",`Executed SQLInject.exe on '${a.hostname}' to open SQL port (1433).`),a.sqlPortOpen=!0,++a.openPortCount),!0},run:function(e,a=1){if(n("run",Object(r.getRamCost)("run")),void 0===e)throw Me("run","Usage: run(scriptname, [numThreads], [arg1], [arg2]...)");if(isNaN(a)||a<=0)throw Me("run",`Invalid thread count. Must be numeric and > 0, is ${thread}`);for(var i=[],o=2;o<arguments.length;++o)i.push(arguments[o]);var s=Object(F.getServer)(t.serverIp);if(null==s)throw Me("run","Could not find server. This is a bug. Report to dev.");return Object(W.d)("run",s,e,i,t,a)},exec:function(e,a,i=1){if(n("exec",Object(r.getRamCost)("exec")),void 0===e||void 0===a)throw Me("exec","Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)");if(isNaN(i)||i<=0)throw Me("exec",`Invalid thread count. Must be numeric and > 0, is ${i}`);for(var o=[],s=3;s<arguments.length;++s)o.push(arguments[s]);var l=Object(F.getServer)(a);if(null==l)throw Me("exec",`Invalid IP/hostname: ${a}`);return Object(W.d)("exec",l,e,o,t,i)},spawn:function(e,a){if(n("spawn",Object(r.getRamCost)("spawn")),!e||!a)throw Me("spawn","Usage: spawn(scriptname, threads)");Object(le.setTimeoutRef)(()=>{if(isNaN(a)||a<=0)throw Me("spawn",`Invalid thread count. Must be numeric and > 0, is ${a}`);for(var n=[],r=2;r<arguments.length;++r)n.push(arguments[r]);var i=Object(F.getServer)(t.serverIp);if(null==i)throw Me("spawn","Could not find server. This is a bug. Report to dev");return Object(W.d)("spawn",i,e,n,t,a)},1e4),t.log("spawn",`Will execute '${e}' in 10 seconds`),t.running=!1,Object(Z.killWorkerScript)(t)&&t.log("spawn","Exiting...")},kill:function(e,a,...i){let o;n("kill",Object(r.getRamCost)("kill"));const s="number"==typeof e;if(s)o=Object(Z.killWorkerScript)(e);else{if(void 0===e||void 0===a)throw Me("kill","Usage: kill(scriptname, server, [arg1], [arg2]...)");const n=ve(a),r=ke(e,a,"kill",i);if(null==r)return t.log("kill",Ce(e,a,i)),!1;o=Object(Z.killWorkerScript)(r,n.ip)}return o?(s?t.log("kill",`Killing script with PID ${e}`):t.log("kill",`Killing '${e}' on '${a}' with args: ${Object(pe.arrayToString)(i)}.`),!0):(s?t.log("kill",`No script with PID ${e}`):t.log("kill",`No such script '${e}' on '${a}' with args: ${Object(pe.arrayToString)(i)}`),!1)},killall:function(e=t.serverIp){if(n("killall",Object(r.getRamCost)("killall")),void 0===e)throw Me("killall","Takes 1 argument");const i=Object(F.getServer)(e);if(null==i)throw Me("killall",`Invalid IP/hostname: ${e}`);const o=i.runningScripts.length>0;for(let e=i.runningScripts.length-1;e>=0;--e)Object(Z.killWorkerScript)(i.runningScripts[e],i.ip,!1);return a.WorkerScriptStartStopEventEmitter.emitEvent(),t.log("killall",`Killing all scripts on '${i.hostname}'. May take a few minutes for the scripts to die.`),o},exit:function(){t.running=!1,Object(Z.killWorkerScript)(t)?t.log("exit","Exiting..."):t.log("exit","Failed. This is a bug. Report to dev.")},scp:function(e,a,i){if(n("scp",Object(r.getRamCost)("scp")),2!==arguments.length&&3!==arguments.length)throw Me("scp","Takes 2 or 3 arguments");if(e&&e.constructor===Array){var o=!1;return e.forEach(function(e){Ee(t).scp(e,a,i)&&(o=!0)}),o}if(!Object(X.isValidFilePath)(e))throw Me("scp",`Invalid filename: '${e}'`);if(!e.endsWith(".lit")&&!Object(I.isScriptFilename)(e)&&!e.endsWith("txt"))throw Me("scp","Only works for .script, .lit, and .txt files");var s,l;if(null!=i){if(void 0===e||void 0===a||void 0===i)throw Me("scp","Takes 2 or 3 arguments");if(null==(s=Object(F.getServer)(i)))throw Me("scp",`Invalid IP/hostname: ${i}`);if(null==(l=Object(F.getServer)(a)))throw Me("scp",`Invalid IP/hostname: ${a}`)}else{if(null==a)throw Me("scp","Takes 2 or 3 arguments");if(void 0===e||void 0===a)throw Me("scp","Takes 2 or 3 arguments");if(null==(s=Object(F.getServer)(a)))throw Me("scp",`Invalid IP/hostname: ${a}`);if(null==(l=Object(F.getServer)(t.serverIp)))throw Me("scp","Could not find server ip for this script. This is a bug. Report to dev.")}if(e.endsWith(".lit")){for(var c=!1,u=0;u<l.messages.length;++u)if(!(l.messages[u]instanceof x.Message)&&l.messages[u]==e){c=!0;break}if(!c)return t.log("scp",`File '${e}' does not exist.`),!1;for(u=0;u<s.messages.length;++u)if(s.messages[u]===e)return t.log("scp",`File '${e}' copied over to '${s.hostname}'.`),!0;return s.messages.push(e),t.log("scp",`File '${e}' copied over to '${s.hostname}'.`),!0}if(e.endsWith(".txt")){var m;for(c=!1,u=0;u<l.textFiles.length;++u)if(l.textFiles[u].fn===e){c=!0,m=l.textFiles[u];break}if(!c)return t.log("scp",`File '${e}' does not exist.`),!1;for(u=0;u<s.textFiles.length;++u)if(s.textFiles[u].fn===e)return s.textFiles[u].text=m.text,t.log("scp",`File '${e}' copied over to '${s.hostname}'.`),!0;var p=new Q.TextFile(m.fn,m.text);return s.textFiles.push(p),t.log("scp",`File '${e}' copied over to '${s.hostname}'.`),!0}let h=null;for(let t=0;t<l.scripts.length;++t)if(e==l.scripts[t].filename){h=l.scripts[t];break}if(null==h)return t.log("scp",`File '${e}' does not exist.`),!1;for(let n=0;n<s.scripts.length;++n)if(e==s.scripts[n].filename){t.log("scp",`WARNING: File '${e}' overwritten on '${s.hostname}'`);const r=s.scripts[n];return r.code=h.code,r.ramUsage=h.ramUsage,r.markUpdated(),!0}const d=new R.Script(e);return d.code=h.code,d.ramUsage=h.ramUsage,d.server=s.ip,s.scripts.push(d),t.log("scp",`File '${e}' copied over to '${s.hostname}'.`),!0},ls:function(e,t){if(n("ls",Object(r.getRamCost)("ls")),void 0===e)throw Me("ls","Usage: ls(ip/hostname, [grep filter])");const a=Object(F.getServer)(e);if(null==a)throw Me("ls",`Invalid IP/hostname: ${e}`);let i=!1;arguments.length>=2&&(i=t.toString());const o=[];for(let e=0;e<a.programs.length;e++)i?a.programs[e].includes(i)&&o.push(a.programs[e]):o.push(a.programs[e]);for(let e=0;e<a.scripts.length;e++)i?a.scripts[e].filename.includes(i)&&o.push(a.scripts[e].filename):o.push(a.scripts[e].filename);for(let e=0;e<a.messages.length;e++)i?a.messages[e]instanceof x.Message?a.messages[e].filename.includes(i)&&o.push(a.messages[e].filename):a.messages[e].includes(i)&&o.push(a.messages[e]):a.messages[e]instanceof x.Message?o.push(a.messages[e].filename):o.push(a.messages[e]);for(var s=0;s<a.textFiles.length;s++)i?a.textFiles[s].fn.includes(i)&&o.push(a.textFiles[s].fn):o.push(a.textFiles[s].fn);for(s=0;s<a.contracts.length;++s)i?a.contracts[s].fn.includes(i)&&o.push(a.contracts[s].fn):o.push(a.contracts[s].fn);return o.sort(),o},ps:function(e=t.serverIp){n("ps",Object(r.getRamCost)("ps"));var a=Object(F.getServer)(e);if(null==a)throw Me("ps",`Invalid IP/hostname: ${e}`);const i=[];for(const e in a.runningScripts){const t=a.runningScripts[e];i.push({filename:t.filename,threads:t.threads,args:t.args.slice()})}return i},hasRootAccess:function(e){if(n("hasRootAccess",Object(r.getRamCost)("hasRootAccess")),void 0===e)throw Me("hasRootAccess","Takes 1 argument");var t=Object(F.getServer)(e);if(null==t)throw Me("hasRootAccess",`Invalid IP/hostname: ${e}`);return t.hasAdminRights},getIp:function(){n("getIp",Object(r.getRamCost)("getIp"));var e=Object(F.getServer)(t.serverIp);if(null==e)throw Me("getIp","Could not find server. This is a bug. Report to dev.");return e.ip},getHostname:function(){n("getHostname",Object(r.getRamCost)("getHostname"));var e=Object(F.getServer)(t.serverIp);if(null==e)throw Me(t,"Could not find server. This is a bug. Report to dev.");return e.hostname},getHackingLevel:function(){return n("getHackingLevel",Object(r.getRamCost)("getHackingLevel")),A.Player.updateSkillLevels(),t.log("getHackingLevel",`returned ${A.Player.hacking_skill}`),A.Player.hacking_skill},getHackingMultipliers:function(){return n("getHackingMultipliers",Object(r.getRamCost)("getHackingMultipliers")),{chance:A.Player.hacking_chance_mult,speed:A.Player.hacking_speed_mult,money:A.Player.hacking_money_mult,growth:A.Player.hacking_grow_mult}},getHacknetMultipliers:function(){return n("getHacknetMultipliers",Object(r.getRamCost)("getHacknetMultipliers")),{production:A.Player.hacknet_node_money_mult,purchaseCost:A.Player.hacknet_node_purchase_cost_mult,ramCost:A.Player.hacknet_node_ram_cost_mult,coreCost:A.Player.hacknet_node_core_cost_mult,levelCost:A.Player.hacknet_node_level_cost_mult}},getBitNodeMultipliers:function(){if(n("getBitNodeMultipliers",Object(r.getRamCost)("getBitNodeMultipliers")),H.SourceFileFlags[5]<=0)throw Me("getBitNodeMultipliers","Requires Source-File 5 to run.");return Object.assign({},c.BitNodeMultipliers)},getServerMoneyAvailable:function(e){n("getServerMoneyAvailable",Object(r.getRamCost)("getServerMoneyAvailable"));const a=ve(e,"getServerMoneyAvailable");return Se(a,"getServerMoneyAvailable")?0:"home"==a.hostname?(t.log("getServerMoneyAvailable",`returned player's money: ${oe.numeralWrapper.format(A.Player.money.toNumber(),"$0.000a")}`),A.Player.money.toNumber()):(t.log("getServerMoneyAvailable",`returned ${oe.numeralWrapper.format(a.moneyAvailable,"$0.000a")} for '${a.hostname}`),a.moneyAvailable)},getServerSecurityLevel:function(e){n("getServerSecurityLevel",Object(r.getRamCost)("getServerSecurityLevel"));const a=ve(e,"getServerSecurityLevel");return Se(a,"getServerSecurityLevel")?1:(t.log("getServerSecurityLevel",`returned ${Object(ue.formatNumber)(a.hackDifficulty,3)} for '${a.hostname}'`),a.hackDifficulty)},getServerBaseSecurityLevel:function(e){n("getServerBaseSecurityLevel",Object(r.getRamCost)("getServerBaseSecurityLevel"));const a=ve(e,"getServerBaseSecurityLevel");return Se(a,"getServerBaseSecurityLevel")?1:(t.log("getServerBaseSecurityLevel",`returned ${Object(ue.formatNumber)(a.baseDifficulty,3)} for '${a.hostname}'`),a.baseDifficulty)},getServerMinSecurityLevel:function(e){n("getServerMinSecurityLevel",Object(r.getRamCost)("getServerMinSecurityLevel"));const a=ve(e,"getServerMinSecurityLevel");return Se(a,"getServerMinSecurityLevel")?1:(t.log("getServerMinSecurityLevel",`returned ${Object(ue.formatNumber)(a.minDifficulty,3)} for ${a.hostname}`),a.minDifficulty)},getServerRequiredHackingLevel:function(e){n("getServerRequiredHackingLevel",Object(r.getRamCost)("getServerRequiredHackingLevel"));const a=ve(e,"getServerRequiredHackingLevel");return Se(a,"getServerRequiredHackingLevel")?1:(t.log("getServerRequiredHackingLevel",`returned ${Object(ue.formatNumber)(a.requiredHackingSkill,0)} for '${a.hostname}'`),a.requiredHackingSkill)},getServerMaxMoney:function(e){n("getServerMaxMoney",Object(r.getRamCost)("getServerMaxMoney"));const a=ve(e,"getServerMaxMoney");return Se(a,"getServerMaxMoney")?0:(t.log("getServerMaxMoney",`returned ${oe.numeralWrapper.format(a.moneyMax,"$0.000a")} for '${a.hostname}'`),a.moneyMax)},getServerGrowth:function(e){n("getServerGrowth",Object(r.getRamCost)("getServerGrowth"));const a=ve(e,"getServerGrowth");return Se(a,"getServerGrowth")?1:(t.log("getServerGrowth",`returned ${Object(ue.formatNumber)(a.serverGrowth,0)} for '${a.hostname}'`),a.serverGrowth)},getServerNumPortsRequired:function(e){n("getServerNumPortsRequired",Object(r.getRamCost)("getServerNumPortsRequired"));const a=ve(e,"getServerNumPortsRequired");return Se(a,"getServerNumPortsRequired")?5:(t.log("getServerNumPortsRequired",`returned ${Object(ue.formatNumber)(a.numOpenPortsRequired,0)} for '${a.hostname}'`),a.numOpenPortsRequired)},getServerRam:function(e){n("getServerRam",Object(r.getRamCost)("getServerRam"));const a=ve(e,"getServerRam");return t.log("getServerRam",`returned [${Object(ue.formatNumber)(a.maxRam,2)}GB, ${Object(ue.formatNumber)(a.ramUsed,2)}GB]`),[a.maxRam,a.ramUsed]},serverExists:function(e){return n("serverExists",Object(r.getRamCost)("serverExists")),null!==Object(F.getServer)(e)},fileExists:function(e,a=t.serverIp){if(n("fileExists",Object(r.getRamCost)("fileExists")),void 0===e)throw Me("fileExists","Usage: fileExists(scriptname, [server])");var i=Object(F.getServer)(a);if(null==i)throw Me("fileExists",`Invalid IP/hostname: ${a}`);for(var o=0;o<i.scripts.length;++o)if(e==i.scripts[o].filename)return!0;for(o=0;o<i.programs.length;++o)if(e.toLowerCase()==i.programs[o].toLowerCase())return!0;for(o=0;o<i.messages.length;++o)if(!(i.messages[o]instanceof x.Message)&&e.toLowerCase()===i.messages[o])return!0;return null!=Object(Q.getTextFile)(e,i)},isRunning:function(e,t){if(n("isRunning",Object(r.getRamCost)("isRunning")),void 0===e||void 0===t)throw Me("isRunning","Usage: isRunning(scriptname, server, [arg1], [arg2]...)");var a=Object(F.getServer)(t);if(null==a)throw Me("isRunning",`Invalid IP/hostname: ${t}`);for(var i=[],o=2;o<arguments.length;++o)i.push(arguments[o]);return null!=Object(D.a)(e,i,a)},getStockSymbols:function(){return n("getStockSymbols",Object(r.getRamCost)("getStockSymbols")),Te("getStockSymbols"),Object.values(V.StockSymbols)},getStockPrice:function(e){return n("getStockPrice",Object(r.getRamCost)("getStockPrice")),Te("getStockPrice"),Pe(e,"getStockPrice").price},getStockAskPrice:function(e){return n("getStockAskPrice",Object(r.getRamCost)("getStockAskPrice")),Te("getStockAskPrice"),Pe(e,"getStockAskPrice").getAskPrice()},getStockBidPrice:function(e){return n("getStockBidPrice",Object(r.getRamCost)("getStockBidPrice")),Te("getStockBidPrice"),Pe(e,"getStockBidPrice").getBidPrice()},getStockPosition:function(e){n("getStockPosition",Object(r.getRamCost)("getStockPosition")),Te("getStockPosition");var t=$.SymbolToStockMap[e];if(null==t)throw Me("getStockPosition",`Invalid stock symbol: ${e}`);return[t.playerShares,t.playerAvgPx,t.playerShortShares,t.playerAvgShortPx]},getStockMaxShares:function(e){return n("getStockMaxShares",Object(r.getRamCost)("getStockMaxShares")),Te("getStockMaxShares"),Pe(e,"getStockMaxShares").maxShares},getStockPurchaseCost:function(e,t,a){n("getStockPurchaseCost",Object(r.getRamCost)("getStockPurchaseCost")),Te("getStockPurchaseCost");const i=Pe(e,"getStockPurchaseCost");let o;t=Math.round(t);const s=a.toLowerCase();if(s.includes("l"))o=z.PositionTypes.Long;else{if(!s.includes("s"))return 1/0;o=z.PositionTypes.Short}const l=Object(q.getBuyTransactionCost)(i,t,o);return null==l?1/0:l},getStockSaleGain:function(e,t,a){n("getStockSaleGain",Object(r.getRamCost)("getStockSaleGain")),Te("getStockSaleGain");const i=Pe(e,"getStockSaleGain");let o;t=Math.round(t);const s=a.toLowerCase();if(s.includes("l"))o=z.PositionTypes.Long;else{if(!s.includes("s"))return 0;o=z.PositionTypes.Short}const l=Object(q.getSellTransactionGain)(i,t,o);return null==l?0:l},buyStock:function(e,a){n("buyStock",Object(r.getRamCost)("buyStock")),Te("buyStock");const i=Pe(e,"buyStock");return Object(G.buyStock)(i,a,t,{rerenderFn:$.displayStockMarketContent})?i.price:0},sellStock:function(e,a){n("sellStock",Object(r.getRamCost)("sellStock")),Te("sellStock");const i=Pe(e,"sellStock");return Object(G.sellStock)(i,a,t,{rerenderFn:$.displayStockMarketContent})?i.price:0},shortStock:function(e,a){if(n("shortStock",Object(r.getRamCost)("shortStock")),Te("shortStock"),8!==A.Player.bitNodeN&&H.SourceFileFlags[8]<=1)throw Me(G.shortStock,"You must either be in BitNode-8 or you must have Source-File 8 Level 2.");const i=Pe(e,"shortStock");return Object(G.shortStock)(i,a,t,{rerenderFn:$.displayStockMarketContent})?i.price:0},sellShort:function(e,a){if(n("sellShort",Object(r.getRamCost)("sellShort")),Te("sellShort"),8!==A.Player.bitNodeN&&H.SourceFileFlags[8]<=1)throw Me("sellShort","You must either be in BitNode-8 or you must have Source-File 8 Level 2.");const i=Pe(e,"sellShort");return Object(G.sellShort)(i,a,t,{rerenderFn:$.displayStockMarketContent})?i.price:0},placeOrder:function(e,a,i,o,s){if(n("placeOrder",Object(r.getRamCost)("placeOrder")),Te("placeOrder"),8!==A.Player.bitNodeN&&H.SourceFileFlags[8]<=2)throw Me("placeOrder","You must either be in BitNode-8 or you must have Source-File 8 Level 3.");const l=Pe(e,"placeOrder");let c,u;if(ltype=o.toLowerCase(),ltype.includes("limit")&<ype.includes("buy"))c=Y.OrderTypes.LimitBuy;else if(ltype.includes("limit")&<ype.includes("sell"))c=Y.OrderTypes.LimitSell;else if(ltype.includes("stop")&<ype.includes("buy"))c=Y.OrderTypes.StopBuy;else{if(!ltype.includes("stop")||!ltype.includes("sell"))throw Me("placeOrder",`Invalid order type: ${o}`);c=Y.OrderTypes.StopSell}if(lpos=s.toLowerCase(),lpos.includes("l"))u=z.PositionTypes.Long;else{if(!lpos.includes("s"))throw Me("placeOrder",`Invalid position type: ${s}`);u=z.PositionTypes.Short}return Object($.placeOrder)(l,a,i,c,u,t)},cancelOrder:function(e,a,i,o,s){if(n("cancelOrder",Object(r.getRamCost)("cancelOrder")),Te("cancelOrder"),8!==A.Player.bitNodeN&&H.SourceFileFlags[8]<=2)throw Me("cancelOrder","You must either be in BitNode-8 or you must have Source-File 8 Level 3.");const l=getStockFrom(e,"cancelOrder");if(isNaN(a)||isNaN(i))throw Me("cancelOrder",`Invalid shares or price. Must be numeric. shares=${a}, price=${i}`);var c,u;if(ltype=o.toLowerCase(),ltype.includes("limit")&<ype.includes("buy"))c=Y.OrderTypes.LimitBuy;else if(ltype.includes("limit")&<ype.includes("sell"))c=Y.OrderTypes.LimitSell;else if(ltype.includes("stop")&<ype.includes("buy"))c=Y.OrderTypes.StopBuy;else{if(!ltype.includes("stop")||!ltype.includes("sell"))throw Me("cancelOrder",`Invalid order type: ${o}`);c=Y.OrderTypes.StopSell}if(lpos=s.toLowerCase(),lpos.includes("l"))u=z.PositionTypes.Long;else{if(!lpos.includes("s"))throw Me("cancelOrder",`Invalid position type: ${s}`);u=z.PositionTypes.Short}var m={stock:l,shares:a,price:i,type:c,pos:u};return Object($.cancelOrder)(m,t)},getOrders:function(){if(n("getOrders",Object(r.getRamCost)("getOrders")),Te("getOrders"),8!==A.Player.bitNodeN&&H.SourceFileFlags[8]<=2)throw Me(t,"You must either be in BitNode-8 or have Source-File 8 Level 3.");const e={},a=$.StockMarket.Orders;for(let t in a){const n=a[t];if(n.constructor===Array&&n.length>0){e[t]=[];for(let r=0;r<n.length;++r)e[t].push({shares:n[r].shares,price:n[r].price,type:n[r].type,position:n[r].pos})}}return e},getStockVolatility:function(e){if(n("getStockVolatility",Object(r.getRamCost)("getStockVolatility")),!A.Player.has4SDataTixApi)throw Me("getStockVolatility","You don't have 4S Market Data TIX API Access!");return Pe(e,"getStockVolatility").mv/100},getStockForecast:function(e){if(n("getStockForecast",Object(r.getRamCost)("getStockForecast")),!A.Player.has4SDataTixApi)throw Me("getStockForecast","You don't have 4S Market Data TIX API Access!");const t=Pe(e,"getStockForecast");var a=50;return t.b?a+=t.otlkMag:a-=t.otlkMag,a/100},purchase4SMarketData:function(){return n("purchase4SMarketData",Object(r.getRamCost)("purchase4SMarketData")),Te("purchase4SMarketData"),A.Player.has4SData?(t.log("purchase4SMarketData","Already purchased 4S Market Data."),!0):A.Player.money.lt(Object(J.getStockMarket4SDataCost)())?(t.log("purchase4SMarketData","Not enough money to purchase 4S Market Data."),!1):(A.Player.has4SData=!0,A.Player.loseMoney(Object(J.getStockMarket4SDataCost)()),t.log("purchase4SMarketData","Purchased 4S Market Data"),Object($.displayStockMarketContent)(),!0)},purchase4SMarketDataTixApi:function(){return n("purchase4SMarketDataTixApi",Object(r.getRamCost)("purchase4SMarketDataTixApi")),Te("purchase4SMarketDataTixApi"),A.Player.has4SDataTixApi?(t.log("purchase4SMarketDataTixApi","Already purchased 4S Market Data TIX API"),!0):A.Player.money.lt(Object(J.getStockMarket4STixApiCost)())?(t.log("purchase4SMarketDataTixApi","Not enough money to purchase 4S Market Data TIX API"),!1):(A.Player.has4SDataTixApi=!0,A.Player.loseMoney(Object(J.getStockMarket4STixApiCost)()),t.log("purchase4SMarketDataTixApi","Purchased 4S Market Data TIX API"),Object($.displayStockMarketContent)(),!0)},getPurchasedServerLimit:function(){return n("getPurchasedServerLimit",Object(r.getRamCost)("getPurchasedServerLimit")),Object(j.getPurchaseServerLimit)()},getPurchasedServerMaxRam:function(){return n("getPurchasedServerMaxRam",Object(r.getRamCost)("getPurchasedServerMaxRam")),Object(j.getPurchaseServerMaxRam)()},getPurchasedServerCost:function(e){n("getPurchasedServerCost",Object(r.getRamCost)("getPurchasedServerCost"));const a=Object(j.getPurchaseServerCost)(e);return a===1/0?(t.log("getPurchasedServerCost",`Invalid argument: ram='${e}'`),1/0):a},purchaseServer:function(e,a){n("purchaseServer",Object(r.getRamCost)("purchaseServer"));var i=String(e);if(""==(i=i.replace(/\s+/g,"")))return t.log("purchaseServer",`Invalid argument: hostname='${i}'`),"";if(A.Player.purchasedServers.length>=Object(j.getPurchaseServerLimit)())return t.log("purchaseServer",`You have reached the maximum limit of ${Object(j.getPurchaseServerLimit)()} servers. You cannot purchase any more.`),"";const o=Object(j.getPurchaseServerCost)(a);if(o===1/0)return t.log("purchaseServer",`Invalid argument: ram='${a}'`),1/0;if(A.Player.money.lt(o))return t.log("purchaseServer",`Not enough money to purchase server. Need ${oe.numeralWrapper.format(o,"$0.000a")}`),"";var s=Object(F.safetlyCreateUniqueServer)({ip:Object(B.createUniqueRandomIp)(),hostname:i,organizationName:"",isConnectedTo:!1,adminRights:!0,purchasedByPlayer:!0,maxRam:a});Object(B.AddToAllServers)(s),A.Player.purchasedServers.push(s.ip);var l=A.Player.getHomeComputer();return l.serversOnNetwork.push(s.ip),s.serversOnNetwork.push(l.ip),A.Player.loseMoney(o),t.log("purchaseServer",`Purchased new server with hostname '${s.hostname}' for ${oe.numeralWrapper.format(o,"$0.000a")}`),s.hostname},deleteServer:function(e){n("deleteServer",Object(r.getRamCost)("deleteServer"));var a=String(e);a=a.replace(/\s\s+/g,"");var i=Object(F.GetServerByHostname)(a);if(null==i)return t.log("deleteServer",`Invalid argument: hostname='${a}'`),!1;if(!i.purchasedByPlayer||"home"===i.hostname)return t.log("deleteServer","Cannot delete non-purchased server."),!1;var o=i.ip;if(i.isConnectedTo)return t.log("deleteServer","You are currently connected to the server you are trying to delete."),!1;if(o===t.serverIp)return t.log("deleteServer","Cannot delete the server this script is running on."),!1;if(i.runningScripts.length>0)return t.log("deleteServer",`Cannot delete server '${i.hostname}' because it still has scripts running.`),!1;for(var s=!1,l=0;l<A.Player.purchasedServers.length;++l)if(o==A.Player.purchasedServers[l]){s=!0,A.Player.purchasedServers.splice(l,1);break}if(!s)return t.log("deleteServer",`Could not identify server ${i.hostname} as a purchased server. This is a bug. Report to dev.`),!1;delete B.AllServers[o],s=!1;var c=A.Player.getHomeComputer();for(l=0;l<c.serversOnNetwork.length;++l)if(o==c.serversOnNetwork[l])return c.serversOnNetwork.splice(l,1),t.log("deleteServer",`Deleted server '${a}`),!0;return t.log("deleteServer",`Could not find server ${i.hostname} as a purchased server. This is a bug. Report to dev.`),!1},getPurchasedServers:function(e=!0){n("getPurchasedServers",Object(r.getRamCost)("getPurchasedServers"));var t=[];return A.Player.purchasedServers.forEach(function(n){if(e){var r=Object(F.getServer)(n);if(null==r)throw Me("getPurchasedServers","Could not find server. This is a bug. Report to dev.");t.push(r.hostname)}else t.push(n)}),t},write:function(e,a="",i="a"){if(n("write",Object(r.getRamCost)("write")),isNaN(e)){if(Object(he.isString)(e)){const n=e;if(!Object(X.isValidFilePath)(n))throw Me("write",`Invalid filepath: ${n}`);try{a=String(a)}catch(e){throw Me("write",`Invalid data (${e}). Data being written must be convertible to a string`)}const r=t.getServer();if(null==r)throw Me("write","Error getting Server. This is a bug. Report to dev.");if(Object(I.isScriptFilename)(n)){let e=t.getScriptOnServer(n);if(null==e)return e=new R.Script(n,a,r.ip,r.scripts),r.scripts.push(e),!0;"w"===i?e.code=a:e.code+=a,e.updateRamUsage(r.scripts),e.markUpdated()}else{let e=Object(Q.getTextFile)(n,r);if(null==e)return e=Object(Q.createTextFile)(n,a,r),!0;"w"===i?e.write(a):e.append(a)}return!0}throw Me("write",`Invalid argument: ${e}`)}if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Me("write",`Trying to write to invalid port: ${e}. Only ports 1-${g.CONSTANTS.NumNetscriptPorts} are valid.`);if(null==(e=W.a[e-1])||!(e instanceof ne.NetscriptPort))throw Me("write",`Could not find port: ${e}. This is a bug. Report to dev.`);return e.write(a)},tryWrite:function(e,t=""){if(n("tryWrite",Object(r.getRamCost)("tryWrite")),isNaN(e))throw Me("tryWrite",`Invalid argument: ${e}`);if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Me("tryWrite",`Invalid port: ${e}. Only ports 1-${g.CONSTANTS.NumNetscriptPorts} are valid.`);if(null==(e=W.a[e-1])||!(e instanceof ne.NetscriptPort))throw Me("tryWrite",`Could not find port: ${e}. This is a bug. Report to dev.`);return e.tryWrite(t)},read:function(e){if(n("read",Object(r.getRamCost)("read")),isNaN(e)){if(Object(he.isString)(e)){let n=e,r=Object(F.getServer)(t.serverIp);if(null==r)throw Me("read","Error getting Server. This is a bug. Report to dev.");if(Object(I.isScriptFilename)(n)){let e=t.getScriptOnServer(n);return null==e?"":e.code}{let e=Object(Q.getTextFile)(n,r);return null!==e?e.text:""}}throw Me("read",`Invalid argument: ${e}`)}if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Me("read",`Invalid port: ${e}. Only ports 1-${g.CONSTANTS.NumNetscriptPorts} are valid.`);if(null==(e=W.a[e-1])||!(e instanceof ne.NetscriptPort))throw Me("read",`Could not find port: ${e}. This is a bug. Report to dev.`);return e.read()},peek:function(e){if(n("peek",Object(r.getRamCost)("peek")),isNaN(e))throw Me("peek",`Invalid argument. Must be a port number between 1 and ${g.CONSTANTS.NumNetscriptPorts}, is ${e}`);if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Me("peek",`Invalid argument. Must be a port number between 1 and ${g.CONSTANTS.NumNetscriptPorts}, is ${e}`);if(null==(e=W.a[e-1])||!(e instanceof ne.NetscriptPort))throw Me("peek",`Could not find port: ${e}. This is a bug. Report to dev.`);return e.peek()},clear:function(e){if(n("clear",Object(r.getRamCost)("clear")),!isNaN(e)){if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Me("clear",`Trying to clear invalid port: ${e}. Only ports 1-${g.CONSTANTS.NumNetscriptPorts} are valid`);if(null==(e=W.a[e-1])||!(e instanceof ne.NetscriptPort))throw Me("clear",`Could not find port: ${e}. This is a bug. Report to dev.`);return e.clear()}if(!Object(he.isString)(e))throw Me("clear",`Invalid argument: ${e}`);var a=e,i=Object(F.getServer)(t.serverIp);if(null==i)throw Me("clear","Error getting Server. This is a bug. Report to dev.");var o=Object(Q.getTextFile)(a,i);return null!=o&&o.write(""),0},getPortHandle:function(e){if(n("getPortHandle",Object(r.getRamCost)("getPortHandle")),isNaN(e))throw Me("getPortHandle",`Invalid port: ${e} Must be an integer between 1 and ${g.CONSTANTS.NumNetscriptPorts}.`);if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Me("getPortHandle",`Invalid port: ${e}. Only ports 1-${g.CONSTANTS.NumNetscriptPorts} are valid.`);if(null==(e=W.a[e-1])||!(e instanceof ne.NetscriptPort))throw Me("getPortHandle",`Could not find port: ${e}. This is a bug. Report to dev.`);return e},rm:function(e,a){n("rm",Object(r.getRamCost)("rm")),null!=a&&""!==a||(a=t.serverIp);const i=ve(a,"rm").removeFile(e);return i.res||t.log("rm",i.msg),i.res},scriptRunning:function(e,t){n("scriptRunning",Object(r.getRamCost)("scriptRunning"));var a=Object(F.getServer)(t);if(null==a)throw Me("scriptRunning",`Invalid IP/hostname: ${t}`);for(var i=0;i<a.runningScripts.length;++i)if(a.runningScripts[i].filename==e)return!0;return!1},scriptKill:function(e,t){n("scriptKill",Object(r.getRamCost)("scriptKill"));var a=Object(F.getServer)(t);if(null==a)throw Me("scriptKill",`Invalid IP/hostname: ${t}`);for(var i=!1,o=0;o<a.runningScripts.length;++o)a.runningScripts[o].filename==e&&(Object(Z.killWorkerScript)(a.runningScripts[o],a.ip),i=!0);return i},getScriptName:function(){return t.name},getScriptRam:function(e,a=t.serverIp){n("getScriptRam",Object(r.getRamCost)("getScriptRam"));var i=Object(F.getServer)(a);if(null==i)throw Me("getScriptRam",`Invalid IP/hostname: ${a}`);for(var o=0;o<i.scripts.length;++o)if(i.scripts[o].filename==e)return i.scripts[o].ramUsage;return 0},getHackTime:function(e,t,a){n("getHackTime",Object(r.getRamCost)("getHackTime"));const i=ve(e,"getHackTime");return Se(i,"getHackTime")?1/0:Object(f.calculateHackingTime)(i,t,a)},getGrowTime:function(e,t,a){n("getGrowTime",Object(r.getRamCost)("getGrowTime"));const i=ve(e,"getGrowTime");return Se(i,"getGrowTime")?1/0:Object(f.calculateGrowTime)(i,t,a)},getWeakenTime:function(e,t,a){n("getWeakenTime",Object(r.getRamCost)("getWeakenTime"));const i=ve(e,"getWeakenTime");return Se(i,"getWeakenTime")?1/0:Object(f.calculateWeakenTime)(i,t,a)},getScriptIncome:function(e,a){if(n("getScriptIncome",Object(r.getRamCost)("getScriptIncome")),0===arguments.length){var i=[];let e=0;for(const t of ee.workerScripts.values())e+=t.scriptRef.onlineMoneyMade/t.scriptRef.onlineRunningTime;return i.push(e),i.push(A.Player.scriptProdSinceLastAug/(A.Player.playtimeSinceLastAug/1e3)),i}var o=Object(F.getServer)(a);if(null==o)throw Me("getScriptIncome",`Invalid IP/hostnamed: ${a}`);for(var s=[],l=2;l<arguments.length;++l)s.push(arguments[l]);var c=Object(D.a)(e,s,o);return null==c?(t.log("getScriptIncome",`No such script '${e}' on '${o.hostname}' with args: ${Object(pe.arrayToString)(s)}`),-1):c.onlineMoneyMade/c.onlineRunningTime},getScriptExpGain:function(e,a){if(n("getScriptExpGain",Object(r.getRamCost)("getScriptExpGain")),0===arguments.length){var i=0;for(const e of ee.workerScripts.values())i+=e.scriptRef.onlineExpGained/e.scriptRef.onlineRunningTime;return i}var o=Object(F.getServer)(a);if(null==o)throw Me("getScriptExpGain",`Invalid IP/hostnamed: ${a}`);for(var s=[],l=2;l<arguments.length;++l)s.push(arguments[l]);var c=Object(D.a)(e,s,o);return null==c?(t.log("getScriptExpGain",`No such script '${e}' on '${o.hostname}' with args: ${Object(pe.arrayToString)(s)}`),-1):c.onlineExpGained/c.onlineRunningTime},nFormat:function(e,t){return isNaN(e)||isNaN(parseFloat(e))||"string"!=typeof t?"":oe.numeralWrapper.format(parseFloat(e),t)},tFormat:function(e){return Object(ue.convertTimeMsToTimeElapsedString)(e)},getTimeSinceLastAug:function(){return n("getTimeSinceLastAug",Object(r.getRamCost)("getTimeSinceLastAug")),A.Player.playtimeSinceLastAug},prompt:function(e){Object(he.isString)(e)||(e=String(e));const t=`prompt-popup-${e.slice(0,20)}`,n=Object(de.createElement)("p",{innerHTML:e});return new Promise(function(e,r){const a=Object(de.createElement)("button",{class:"popup-box-button",innerText:"Yes",clickListener:()=>{Object(ge.removeElementById)(t),e(!0)}}),i=Object(de.createElement)("button",{class:"popup-box-button",innerText:"No",clickListener:()=>{Object(ge.removeElementById)(t),e(!1)}});Object(_e.createPopup)(t,[n,a,i])})},wget:async function(n,r,a=t.serverIp){if(!Object(I.isScriptFilename)(r)&&!r.endsWith(".txt"))return t.log("wget",`Invalid target file: '${r}'. Must be a script or text file.`),Promise.resolve(!1);var i=ve(a,"wget");return new Promise(function(o,s){e.get(n,function(e){let n;return(n=Object(I.isScriptFilename)(r)?i.writeToScriptFile(r,e):i.writeToTextFile(r,e)).success?n.overwritten?(t.log("wget",`Successfully retrieved content and overwrote '${r}' on '${a}'`),o(!0)):(t.log("wget",`Successfully retrieved content to new file '${r}' on '${a}'`),o(!0)):(t.log("wget","Failed."),o(!1))},"text").fail(function(e){return t.log("wget",JSON.stringify(e)),o(!1)})})},getFavorToDonate:function(){return n("getFavorToDonate",Object(r.getRamCost)("getFavorToDonate")),Math.floor(g.CONSTANTS.BaseFavorToDonate*c.BitNodeMultipliers.RepToDonateToFaction)},universityCourse:function(e,a){if(n("universityCourse",Object(r.getRamCost)("universityCourse")),xe("universityCourse",1),!w.c){if(A.Player.isWorking){var i=A.Player.singularityStopWork();t.log("universityCourse",i)}var o,s,l;switch(e.toLowerCase()){case O.LocationName.AevumSummitUniversity.toLowerCase():if(A.Player.city!=S.CityName.Aevum)return t.log("universityCourse","You cannot study at 'Summit University' because you are not in 'Aevum'."),!1;A.Player.gotoLocation(O.LocationName.AevumSummitUniversity),o=4,s=3;break;case O.LocationName.Sector12RothmanUniversity.toLowerCase():if(A.Player.city!=S.CityName.Sector12)return t.log("universityCourse","You cannot study at 'Rothman University' because you are not in 'Sector-12'."),!1;A.Player.location=O.LocationName.Sector12RothmanUniversity,o=3,s=2;break;case O.LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():if(A.Player.city!=S.CityName.Volhaven)return t.log("universityCourse","You cannot study at 'ZB Institute of Technology' because you are not in 'Volhaven'."),!1;A.Player.location=O.LocationName.VolhavenZBInstituteOfTechnology,o=5,s=4;break;default:return t.log("universityCourse",`Invalid university name: '${e}'.`),!1}switch(a.toLowerCase()){case"Study Computer Science".toLowerCase():l=g.CONSTANTS.ClassStudyComputerScience;break;case"Data Structures".toLowerCase():l=g.CONSTANTS.ClassDataStructures;break;case"Networks".toLowerCase():l=g.CONSTANTS.ClassNetworks;break;case"Algorithms".toLowerCase():l=g.CONSTANTS.ClassAlgorithms;break;case"Management".toLowerCase():l=g.CONSTANTS.ClassManagement;break;case"Leadership".toLowerCase():l=g.CONSTANTS.ClassLeadership;break;default:return t.log("universityCourse",`Invalid class name: ${a}.`),!1}return A.Player.startClass(o,s,l),t.log("universityCourse",`Started ${l} at ${e}`),!0}t.log("universityCourse","You are in the middle of a mission.")},gymWorkout:function(e,a){if(n("gymWorkout",Object(r.getRamCost)("gymWorkout")),xe("gymWorkout",1),!w.c){if(A.Player.isWorking){var i=A.Player.singularityStopWork();t.log("gymWorkout",i)}var o,s;switch(e.toLowerCase()){case O.LocationName.AevumCrushFitnessGym.toLowerCase():if(A.Player.city!=S.CityName.Aevum)return t.log("gymWorkout","You cannot workout at 'Crush Fitness' because you are not in 'Aevum'."),!1;A.Player.location=O.LocationName.AevumCrushFitnessGym,o=3,s=2;break;case O.LocationName.AevumSnapFitnessGym.toLowerCase():if(A.Player.city!=S.CityName.Aevum)return t.log("gymWorkout","You cannot workout at 'Snap Fitness' because you are not in 'Aevum'."),!1;A.Player.location=O.LocationName.AevumSnapFitnessGym,o=10,s=5;break;case O.LocationName.Sector12IronGym.toLowerCase():if(A.Player.city!=S.CityName.Sector12)return t.log("gymWorkout","You cannot workout at 'Iron Gym' because you are not in 'Sector-12'."),!1;A.Player.location=O.LocationName.Sector12IronGym,o=1,s=1;break;case O.LocationName.Sector12PowerhouseGym.toLowerCase():if(A.Player.city!=S.CityName.Sector12)return t.log("gymWorkout","You cannot workout at 'Powerhouse Gym' because you are not in 'Sector-12'."),!1;A.Player.location=O.LocationName.Sector12PowerhouseGym,o=20,s=10;break;case O.LocationName.VolhavenMilleniumFitnessGym.toLowerCase():if(A.Player.city!=S.CityName.Volhaven)return t.log("gymWorkout","You cannot workout at 'Millenium Fitness Gym' because you are not in 'Volhaven'."),!1;A.Player.location=O.LocationName.VolhavenMilleniumFitnessGym,o=7,s=4;break;default:return t.log("gymWorkout",`Invalid gym name: ${e}. gymWorkout() failed`),!1}switch(a.toLowerCase()){case"strength".toLowerCase():case"str".toLowerCase():A.Player.startClass(o,s,g.CONSTANTS.ClassGymStrength);break;case"defense".toLowerCase():case"def".toLowerCase():A.Player.startClass(o,s,g.CONSTANTS.ClassGymDefense);break;case"dexterity".toLowerCase():case"dex".toLowerCase():A.Player.startClass(o,s,g.CONSTANTS.ClassGymDexterity);break;case"agility".toLowerCase():case"agi".toLowerCase():A.Player.startClass(o,s,g.CONSTANTS.ClassGymAgility);break;default:return t.log("gymWorkout",`Invalid stat: ${a}.`),!1}return t.log("gymWorkout",`Started training ${a} at ${e}`),!0}t.log("gymWorkout","You are in the middle of a mission.")},travelToCity:function(e){switch(n("travelToCity",Object(r.getRamCost)("travelToCity")),xe("travelToCity",1),e){case S.CityName.Aevum:case S.CityName.Chongqing:case S.CityName.Sector12:case S.CityName.NewTokyo:case S.CityName.Ishima:case S.CityName.Volhaven:if(A.Player.money.lt(g.CONSTANTS.TravelCost))throw Me("travelToCity","Not enough money to travel.");return A.Player.loseMoney(g.CONSTANTS.TravelCost),A.Player.city=e,t.log("travelToCity",`Traveled to ${e}`),!0;default:return t.log("travelToCity",`Invalid city name: '${e}'.`),!1}},purchaseTor:function(){if(n("purchaseTor",Object(r.getRamCost)("purchaseTor")),xe("purchaseTor",1),null!=U.SpecialServerIps["Darkweb Server"])return t.log("purchaseTor","You already have a TOR router!"),!1;if(A.Player.money.lt(g.CONSTANTS.TorRouterCost))return t.log("purchaseTor","You cannot afford to purchase a Tor router."),!1;A.Player.loseMoney(g.CONSTANTS.TorRouterCost);var e=Object(F.safetlyCreateUniqueServer)({ip:Object(B.createUniqueRandomIp)(),hostname:"darkweb",organizationName:"",isConnectedTo:!1,adminRights:!1,purchasedByPlayer:!1,maxRam:1});return Object(B.AddToAllServers)(e),U.SpecialServerIps.addIp("Darkweb Server",e.ip),A.Player.getHomeComputer().serversOnNetwork.push(e.ip),e.serversOnNetwork.push(A.Player.getHomeComputer().ip),A.Player.gainIntelligenceExp(g.CONSTANTS.IntelligenceSingFnBaseExpGain),t.log("purchaseTor","You have purchased a Tor router!"),!0},purchaseProgram:function(e){if(n("purchaseProgram",Object(r.getRamCost)("purchaseProgram")),xe("purchaseProgram",1),null==U.SpecialServerIps["Darkweb Server"])return t.log("purchaseProgram","You do not have the TOR router."),!1;e=e.toLowerCase();let a=null;for(const t in y.DarkWebItems){const n=y.DarkWebItems[t];n.program.toLowerCase()==e&&(a=n)}return null==a?(t.log("purchaseProgram",`Invalid program name: '${e}.`),!1):A.Player.money.lt(a.price)?(t.log("purchaseProgram",`Not enough money to purchase '${a.program}'. Need ${oe.numeralWrapper.format(a.price,"$0.000a")}`),!1):A.Player.hasProgram(a.program)?(t.log("purchaseProgram",`You already have the '${a.program}' program`),!0):(A.Player.loseMoney(a.price),A.Player.getHomeComputer().programs.push(a.program),t.log("purchaseProgram",`You have purchased the '${a.program}' program. The new program can be found on your home computer.`),!0)},connect:function(e){if(!e)throw Me("connect",`Invalid hostname: '${e}'`);let t=Object(F.getServer)(e);if(null==t)throw Me("connect",`Invalid hostname: '${e}'`);if("home"===e)return A.Player.getCurrentServer().isConnectedTo=!1,A.Player.currentServer=A.Player.getHomeComputer().ip,A.Player.getCurrentServer().isConnectedTo=!0,M.a.currDir="/",M.a.resetTerminalInput(!0),!0;const n=A.Player.getCurrentServer();for(let r=0;r<n.serversOnNetwork.length;r++){const a=Object(F.getServerOnNetwork)(n,r);if(a.ip==e||a.hostname==e)return A.Player.getCurrentServer().isConnectedTo=!1,A.Player.currentServer=t.ip,A.Player.getCurrentServer().isConnectedTo=!0,M.a.currDir="/",M.a.resetTerminalInput(!0),!0}return!1},manualHack:function(){n("manualHack",Object(r.getRamCost)("manualHack")),xe("manualHack",1);const e=A.Player.getCurrentServer();return He(e.hostname,!0)},getStats:function(){return n("getStats",Object(r.getRamCost)("getStats")),xe("getStats",1),{hacking:A.Player.hacking_skill,strength:A.Player.strength,defense:A.Player.defense,dexterity:A.Player.dexterity,agility:A.Player.agility,charisma:A.Player.charisma,intelligence:A.Player.intelligence}},getCharacterInformation:function(){return n("getCharacterInformation",Object(r.getRamCost)("getCharacterInformation")),xe("getCharacterInformation",1),{bitnode:A.Player.bitNodeN,city:A.Player.city,factions:A.Player.factions.slice(),hp:A.Player.hp,jobs:Object.keys(A.Player.jobs),jobTitles:Object.values(A.Player.jobs),maxHp:A.Player.max_hp,mult:{agility:A.Player.agility_mult,agilityExp:A.Player.agility_exp_mult,companyRep:A.Player.company_rep_mult,crimeMoney:A.Player.crime_money_mult,crimeSuccess:A.Player.crime_success_mult,defense:A.Player.defense_mult,defenseExp:A.Player.defense_exp_mult,dexterity:A.Player.dexterity_mult,dexterityExp:A.Player.dexterity_exp_mult,factionRep:A.Player.faction_rep_mult,hacking:A.Player.hacking_mult,hackingExp:A.Player.hacking_exp_mult,strength:A.Player.strength_mult,strengthExp:A.Player.strength_exp_mult,workMoney:A.Player.work_money_mult},timeWorked:A.Player.timeWorked,tor:U.SpecialServerIps.hasOwnProperty("Darkweb Server"),workHackExpGain:A.Player.workHackExpGained,workStrExpGain:A.Player.workStrExpGained,workDefExpGain:A.Player.workDefExpGained,workDexExpGain:A.Player.workDexExpGained,workAgiExpGain:A.Player.workAgiExpGained,workChaExpGain:A.Player.workChaExpGained,workRepGain:A.Player.workRepGained,workMoneyGain:A.Player.workMoneyGained,hackingExp:A.Player.hacking_exp,strengthExp:A.Player.strength_exp,defenseExp:A.Player.defense_exp,dexterityExp:A.Player.dexterity_exp,agilityExp:A.Player.agility_exp,charismaExp:A.Player.charisma_exp}},isBusy:function(){return n("isBusy",Object(r.getRamCost)("isBusy")),xe("isBusy",1),A.Player.isWorking||w.c},stopAction:function(){if(n("stopAction",Object(r.getRamCost)("stopAction")),xe("stopAction",1),A.Player.isWorking){var e=A.Player.singularityStopWork();return t.log("stopAction",e),!0}return!1},upgradeHomeRam:function(){n("upgradeHomeRam",Object(r.getRamCost)("upgradeHomeRam")),xe("upgradeHomeRam",2);const e=A.Player.getHomeComputer();if(e.maxRam>=g.CONSTANTS.HomeComputerMaxRam)return t.log("upgradeHomeRam","Your home computer is at max RAM."),!1;const a=A.Player.getUpgradeHomeRamCost();return A.Player.money.lt(a)?(t.log("upgradeHomeRam",`You don't have enough money. Need ${oe.numeralWrapper.format(a,"$0.000a")}`),!1):(e.maxRam*=2,A.Player.loseMoney(a),A.Player.gainIntelligenceExp(g.CONSTANTS.IntelligenceSingFnBaseExpGain),t.log("upgradeHomeRam",`Purchased additional RAM for home computer! It now has ${e.maxRam}GB of RAM.`),!0)},getUpgradeHomeRamCost:function(){return n("getUpgradeHomeRamCost",Object(r.getRamCost)("getUpgradeHomeRamCost")),xe("getUpgradeHomeRamCost",2),A.Player.getUpgradeHomeRamCost()},workForCompany:function(e){if(n("workForCompany",Object(r.getRamCost)("workForCompany")),xe("workForCompany",2),null==e&&(e=A.Player.companyName),null==e||""===e||!(h.Companies[e]instanceof p.Company))return t.log("workForCompany",`Invalid company: '${e}'`),!1;if(!Object.keys(A.Player.jobs).includes(e))return t.log("workForCompany",`You do not have a job at '${e}'`),!1;if(w.c)return t.log("workForCompany","You are in the middle of a mission."),!1;const a=A.Player.jobs[e],i=_.CompanyPositions[a];if(""===a||!(i instanceof d.CompanyPosition))return t.log("workForCompany","You do not have a job"),!1;if(A.Player.isWorking){var o=A.Player.singularityStopWork();t.log("workForCompany",o)}return i.isPartTimeJob()?A.Player.startWorkPartTime(e):A.Player.startWork(e),t.log("workForCompany",`Began working at '${A.Player.companyName}' as a '${a}'`),!0},applyToCompany:function(e,a){var i;switch(n("applyToCompany",Object(r.getRamCost)("applyToCompany")),xe("applyToCompany",2),We("applyToCompany",e),A.Player.location=e,a.toLowerCase()){case"software":i=A.Player.applyForSoftwareJob(!0);break;case"software consultant":i=A.Player.applyForSoftwareConsultantJob(!0);break;case"it":i=A.Player.applyForItJob(!0);break;case"security engineer":i=A.Player.applyForSecurityEngineerJob(!0);break;case"network engineer":i=A.Player.applyForNetworkEngineerJob(!0);break;case"business":i=A.Player.applyForBusinessJob(!0);break;case"business consultant":i=A.Player.applyForBusinessConsultantJob(!0);break;case"security":i=A.Player.applyForSecurityJob(!0);break;case"agent":i=A.Player.applyForAgentJob(!0);break;case"employee":i=A.Player.applyForEmployeeJob(!0);break;case"part-time employee":i=A.Player.applyForPartTimeEmployeeJob(!0);break;case"waiter":i=A.Player.applyForWaiterJob(!0);break;case"part-time waiter":i=A.Player.applyForPartTimeWaiterJob(!0);break;default:return t.log("applyToCompany",`Invalid job: '${a}'.`),!1}return Object(he.isString)(i)?(t.log("applyToCompany",i),!1):(i?t.log("applyToCompany",`You were offered a new job at '${e}' as a '${A.Player.jobs[e]}'`):t.log("applyToCompany",`You failed to get a new job/promotion at '${e}' in the '${a}' field.`),i)},getCompanyRep:function(e){return n("getCompanyRep",Object(r.getRamCost)("getCompanyRep")),xe("getCompanyRep",2),We("getCompanyRep",e).playerReputation},getCompanyFavor:function(e){return n("getCompanyFavor",Object(r.getRamCost)("getCompanyFavor")),xe("getCompanyFavor",2),We("getCompanyFavor",e).favor},getCompanyFavorGain:function(e){return n("getCompanyFavorGain",Object(r.getRamCost)("getCompanyFavorGain")),xe("getCompanyFavorGain",2),We("getCompanyFavorGain",e).getFavorGain()[0]},checkFactionInvitations:function(){return n("checkFactionInvitations",Object(r.getRamCost)("checkFactionInvitations")),xe("checkFactionInvitations",2),A.Player.factionInvitations.slice()},joinFaction:function(e){if(n("joinFaction",Object(r.getRamCost)("joinFaction")),xe("joinFaction",2),Fe("workForFaction",e),!A.Player.factionInvitations.includes(e))return t.log("joinFaction",`You have not been invited by faction '${e}'`),!1;const a=E.Factions[e];Object(v.joinFaction)(a);for(let t=0;t<A.Player.factionInvitations.length;++t)(A.Player.factionInvitations[t]==e||E.Factions[A.Player.factionInvitations[t]].isBanned)&&(A.Player.factionInvitations.splice(t,1),t--);return A.Player.gainIntelligenceExp(g.CONSTANTS.IntelligenceSingFnBaseExpGain),t.log("joinFaction",`Joined the '${e}' faction.`),!0},workForFaction:function(e,a){if(n("workForFaction",Object(r.getRamCost)("workForFaction")),xe("workForFaction",2),Fe("workForFaction",e),A.Player.inGang()&&void 0!==b.a[e])t.log("workForFaction",`Faction '${e}' does not offer work at the moment.`);else{if(!w.c){if(!A.Player.factions.includes(e))return t.log("workForFaction",`You are not a member of '${e}'`),!1;if(A.Player.isWorking){const e=A.Player.singularityStopWork();t.log("workForFaction",e)}var i=E.Factions[e];switch(a.toLowerCase()){case"hacking":case"hacking contracts":case"hackingcontracts":return["Illuminati","Daedalus","The Covenant","ECorp","MegaCorp","Bachman & Associates","Blade Industries","NWO","Clarke Incorporated","OmniTek Incorporated","Four Sigma","KuaiGong International","Fulcrum Secret Technologies","BitRunners","The Black Hand","NiteSec","Chongqing","Sector-12","New Tokyo","Aevum","Ishima","Volhaven","Speakers for the Dead","The Dark Army","The Syndicate","Silhouette","Netburners","Tian Di Hui","CyberSec"].includes(i.name)?(A.Player.startFactionHackWork(i),t.log("workForFaction",`Started carrying out hacking contracts for '${i.name}'`),!0):(t.log("workForFaction",`Faction '${i.name}' do not need help with hacking contracts.`),!1);case"field":case"fieldwork":case"field work":return["Illuminati","Daedalus","The Covenant","ECorp","MegaCorp","Bachman & Associates","Blade Industries","NWO","Clarke Incorporated","OmniTek Incorporated","Four Sigma","KuaiGong International","The Black Hand","Chongqing","Sector-12","New Tokyo","Aevum","Ishima","Volhaven","Speakers for the Dead","The Dark Army","The Syndicate","Silhouette","Tetrads","Slum Snakes"].includes(i.name)?(A.Player.startFactionFieldWork(i),t.log("workForFaction",`Started carrying out field missions for '${i.name}'`),!0):(t.log("workForFaction",`Faction '${i.name}' do not need help with field missions.`),!1);case"security":case"securitywork":case"security work":return["ECorp","MegaCorp","Bachman & Associates","Blade Industries","NWO","Clarke Incorporated","OmniTek Incorporated","Four Sigma","KuaiGong International","Fulcrum Secret Technologies","Chongqing","Sector-12","New Tokyo","Aevum","Ishima","Volhaven","Speakers for the Dead","The Syndicate","Tetrads","Slum Snakes","Tian Di Hui"].includes(i.name)?(A.Player.startFactionSecurityWork(i),t.log("workForFaction",`Started carrying out security work for '${i.name}'`),!0):(t.log("workForFaction",`Faction '${i.name}' do not need help with security work.`),!1);default:t.log("workForFaction",`Invalid work type: '${a}`)}return!0}t.log("workForFaction","You are in the middle of a mission.")}},getFactionRep:function(e){return n("getFactionRep",Object(r.getRamCost)("getFactionRep")),xe("getFactionRep",2),Fe("getFactionRep",e).playerReputation},getFactionFavor:function(e){return n("getFactionFavor",Object(r.getRamCost)("getFactionFavor")),xe("getFactionFavor",2),Fe("getFactionFavor",e).favor},getFactionFavorGain:function(e){return n("getFactionFavorGain",Object(r.getRamCost)("getFactionFavorGain")),xe("getFactionFavorGain",2),Fe("getFactionFavorGain",e).getFavorGain()[0]},donateToFaction:function(e,a){n("donateToFaction",Object(r.getRamCost)("donateToFaction")),xe("donateToFaction",3);const i=Fe("donateToFaction",e);if("number"!=typeof a||a<=0)return t.log("donateToFaction",`Invalid donation amount: '${a}'.`),!1;if(A.Player.money.lt(a))return t.log("donateToFaction",`You do not have enough money to donate ${oe.numeralWrapper.format(a,"$0.000a")} to '${e}'`),!1;const o=Math.round(g.CONSTANTS.BaseFavorToDonate*c.BitNodeMultipliers.RepToDonateToFaction);if(i.favor<o)return t.log("donateToFaction",`You do not have enough favor to donate to this faction. Have ${i.favor}, need ${o}`),!1;const s=a/g.CONSTANTS.DonateMoneyToRepDivisor*A.Player.faction_rep_mult;return i.playerReputation+=s,A.Player.loseMoney(a),t.log("donateToFaction",`${oe.numeralWrapper.format(a,"$0.000a")} donated to '${e}' for ${oe.numeralWrapper.format(s,"0.000a")} reputation`),!0},createProgram:function(e){if(n("createProgram",Object(r.getRamCost)("createProgram")),xe("createProgram",3),w.c)return void t.log("createProgram","You are in the middle of a mission.");if(A.Player.isWorking){var a=A.Player.singularityStopWork();t.log("createProgram",a)}e=e.toLowerCase();let i=null;for(const t in N.Programs)N.Programs[t].name.toLowerCase()==e&&(i=N.Programs[t]);return null==i?(t.log("createProgram",`The specified program does not exist: '${e}`),!1):A.Player.hasProgram(i.name)?(t.log("createProgram",`You already have the '${i.name}' program`),!1):i.create.req(A.Player)?(A.Player.startCreateProgramWork(i.name,i.create.time,i.create.level),t.log("createProgram",`Began creating program: '${e}'`),!0):(t.log("createProgram",`Hacking level is too low to create '${i.name}' (level ${i.create.level} req)`),!1)},commitCrime:function(e){if(n("commitCrime",Object(r.getRamCost)("commitCrime")),xe("commitCrime",3),w.c)return void t.log("commitCrime","You are in the middle of a mission.");if(A.Player.isWorking){const e=A.Player.singularityStopWork();t.log("commitCrime",e)}A.Player.gotoLocation(O.LocationName.Slums);const a=Object(u.findCrime)(e.toLowerCase());if(null==a)throw Me("commitCrime",`Invalid crime: '${e}'`);return t.log("commitCrime",`Attempting to commit ${a.name}...`),a.commit(A.Player,1,{workerscript:t})},getCrimeChance:function(e){n("getCrimeChance",Object(r.getRamCost)("getCrimeChance")),xe("getCrimeChance",3);const t=Object(u.findCrime)(e.toLowerCase());if(null==t)throw Me("getCrimeChance",`Invalid crime: ${e}`);return t.successRate(A.Player)},getCrimeStats:function(e){n("getCrimeStats",Object(r.getRamCost)("getCrimeStats")),xe("getCrimeStats",3);const t=Object(u.findCrime)(e.toLowerCase());if(null==t)throw Me("getCrimeStats",`Invalid crime: ${e}`);return Object.assign({},t)},getOwnedAugmentations:function(e=!1){n("getOwnedAugmentations",Object(r.getRamCost)("getOwnedAugmentations")),xe("getOwnedAugmentations",3);for(var t=[],a=0;a<A.Player.augmentations.length;++a)t.push(A.Player.augmentations[a].name);if(e)for(a=0;a<A.Player.queuedAugmentations.length;++a)t.push(A.Player.queuedAugmentations[a].name);return t},getOwnedSourceFiles:function(){n("getOwnedSourceFiles",Object(r.getRamCost)("getOwnedSourceFiles")),xe("getOwnedSourceFiles",3);let e=[];for(let t=0;t<A.Player.sourceFiles.length;++t)e.push({n:A.Player.sourceFiles[t].n,lvl:A.Player.sourceFiles[t].lvl});return e},getAugmentationsFromFaction:function(e){n("getAugmentationsFromFaction",Object(r.getRamCost)("getAugmentationsFromFaction")),xe("getAugmentationsFromFaction",3);const t=Fe("getAugmentationsFromFaction",e);if(A.Player.hasGangWith(e)){const e=[];for(const t in i.Augmentations){i.Augmentations[t].isSpecial||e.push(t)}return e}return t.augmentations.slice()},getAugmentationPrereq:function(e){return n("getAugmentationPrereq",Object(r.getRamCost)("getAugmentationPrereq")),xe("getAugmentationPrereq",3),je("getAugmentationPrereq",e).prereqs.slice()},getAugmentationCost:function(e){n("getAugmentationCost",Object(r.getRamCost)("getAugmentationCost")),xe("getAugmentationCost",3);const t=je("getAugmentationCost",e);return[t.baseRepRequirement,t.baseCost]},getAugmentationStats:function(e){n("getAugmentationStats",Object(r.getRamCost)("getAugmentationStats")),xe("getAugmentationStats",3);const t=je("getAugmentationStats",e);return Object.assign({},t.mults)},purchaseAugmentation:function(e,a){n("purchaseAugmentation",Object(r.getRamCost)("purchaseAugmentation")),xe("purchaseAugmentation",3);const o=Fe("purchaseAugmentation",e),s=je("purchaseAugmentation",a);let c=[];if(A.Player.hasGangWith(e))for(const e in i.Augmentations){i.Augmentations[e].isSpecial||c.push(e)}else c=o.augmentations;if(!c.includes(a))return t.log("purchaseAugmentation",`Faction '${e}' does not have the '${a}' augmentation.`),!1;if(!(s.name===l.AugmentationNames.NeuroFluxGovernor)){for(let e=0;e<A.Player.queuedAugmentations.length;++e)if(A.Player.queuedAugmentations[e].name===s.name)return t.log("purchaseAugmentation",`You already have the '${a}' augmentation.`),!1;for(let e=0;e<A.Player.augmentations.length;++e)if(A.Player.augmentations[e].name===s.name)return t.log("purchaseAugmentation",`You already have the '${a}' augmentation.`),!1}if(o.playerReputation<s.baseRepRequirement)return t.log("purchaseAugmentation",`You do not have enough reputation with '${o.name}'.`),!1;const u=Object(v.purchaseAugmentation)(s,o,!0);return t.log("purchaseAugmentation",u),!(!Object(he.isString)(u)||!u.startsWith("You purchased"))&&(A.Player.gainIntelligenceExp(g.CONSTANTS.IntelligenceSingFnBaseExpGain),!0)},softReset:function(e){n("softReset",Object(r.getRamCost)("softReset")),xe("softReset",3),t.log("softReset","Soft resetting. This will cause this script to be killed"),Object(le.setTimeoutRef)(()=>{Object(s.a)(),Ue(e)},0),t.running=!1,Object(Z.killWorkerScript)(t)},installAugmentations:function(e){if(n("installAugmentations",Object(r.getRamCost)("installAugmentations")),xe("installAugmentations",3),0===A.Player.queuedAugmentations.length)return t.log("installAugmentations","You do not have any Augmentations to be installed."),!1;A.Player.gainIntelligenceExp(g.CONSTANTS.IntelligenceSingFnBaseExpGain),t.log("installAugmentations","Installing Augmentations. This will cause this script to be killed"),Object(le.setTimeoutRef)(()=>{Object(o.e)(),Ue(e)},0),t.running=!1,Object(Z.killWorkerScript)(t)},gang:{getMemberNames:function(){return n("getMemberNames",Object(r.getRamCost)("gang","getMemberNames")),Ie("getMemberNames"),A.Player.gang.members.map(e=>e.name)},getGangInformation:function(){return n("getGangInformation",Object(r.getRamCost)("gang","getGangInformation")),Ie("getGangInformation"),{faction:A.Player.gang.facName,isHacking:A.Player.gang.isHackingGang,moneyGainRate:A.Player.gang.moneyGainRate,power:A.Player.gang.getPower(),respect:A.Player.gang.respect,respectGainRate:A.Player.gang.respectGainRate,territory:A.Player.gang.getTerritory(),territoryClashChance:A.Player.gang.territoryClashChance,territoryWarfareEngaged:A.Player.gang.territoryWarfareEngaged,wantedLevel:A.Player.gang.wanted,wantedLevelGainRate:A.Player.gang.wantedGainRate}},getOtherGangInformation:function(){n("getOtherGangInformation",Object(r.getRamCost)("gang","getOtherGangInformation")),Ie("getOtherGangInformation");const e={};for(const t in b.a)e[t]=Object.assign({},b.a[t]);return e},getMemberInformation:function(e){n("getMemberInformation",Object(r.getRamCost)("gang","getMemberInformation")),Ie("getMemberInformation");const t=Be("getMemberInformation",e);return{agility:t.agi,agilityEquipMult:t.agi_mult,agilityAscensionMult:t.agi_asc_mult,augmentations:t.augmentations.slice(),charisma:t.cha,charismaEquipMult:t.cha_mult,charismaAscensionMult:t.cha_asc_mult,defense:t.def,defenseEquipMult:t.def_mult,defenseAscensionMult:t.def_asc_mult,dexterity:t.dex,dexterityEquipMult:t.dex_mult,dexterityAscensionMult:t.dex_asc_mult,equipment:t.upgrades.slice(),hacking:t.hack,hackingEquipMult:t.hack_mult,hackingAscensionMult:t.hack_asc_mult,strength:t.str,strengthEquipMult:t.str_mult,strengthAscensionMult:t.str_asc_mult,task:t.task}},canRecruitMember:function(){return n("canRecruitMember",Object(r.getRamCost)("gang","canRecruitMember")),Ie("canRecruitMember"),A.Player.gang.canRecruitMember()},recruitMember:function(e){n("recruitMember",Object(r.getRamCost)("gang","recruitMember")),Ie("recruitMember");const a=A.Player.gang.recruitMember(e);return a?t.log("recruitMember",`Successfully recruited Gang Member '${e}'`):t.log("recruitMember",`Failed to recruit Gang Member '${e}'`),a},getTaskNames:function(){n("getTaskNames",Object(r.getRamCost)("gang","getTaskNames")),Ie("getTaskNames");const e=A.Player.gang.getAllTaskNames();return e.unshift("Unassigned"),e},setMemberTask:function(e,a){n("setMemberTask",Object(r.getRamCost)("gang","setMemberTask")),Ie("setMemberTask");const i=Be("setMemberTask",e).assignToTask(a);return i?t.log("setMemberTask",`Successfully assigned Gang Member '${e}' to '${a}' task`):t.log("setMemberTask",`Failed to assign Gang Member '${e}' to '${a}' task. '${e}' is now Unassigned`),i},getTaskStats:function(e){n("getTaskStats",Object(r.getRamCost)("gang","getTaskStats")),Ie("getTaskStats");const t=function(e,t){const n=b.c[t];if(!n)throw Me(`gang.${e}`,`Invalid task: '${t}'`);return n}("getTaskStats",e),a=Object.assign({},t);return a.territory=Object.assign({},t.territory),a},getEquipmentNames:function(){return n("getEquipmentNames",Object(r.getRamCost)("gang","getEquipmentNames")),Ie("getEquipmentNames"),A.Player.gang.getAllUpgradeNames()},getEquipmentCost:function(e){return n("getEquipmentCost",Object(r.getRamCost)("gang","getEquipmentCost")),Ie("getEquipmentCost"),A.Player.gang.getUpgradeCost(e)},getEquipmentType:function(e){return n("getEquipmentType",Object(r.getRamCost)("gang","getEquipmentType")),Ie("getEquipmentType"),A.Player.gang.getUpgradeType(e)},getEquipmentStats:function(e){n("getEquipmentStats",Object(r.getRamCost)("gang","getEquipmentStats")),Ie("getEquipmentStats");const t=b.d[e];if(!t)throw Me("getEquipmentStats",`Invalid equipment: ${e}`);return Object.assign({},t.mults)},purchaseEquipment:function(e,a){n("purchaseEquipment",Object(r.getRamCost)("gang","purchaseEquipment")),Ie("purchaseEquipment");const i=Be("purchaseEquipment",e).buyUpgrade(a,A.Player,A.Player.gang);return i?t.log("purchaseEquipment",`Purchased '${a}' for Gang member '${e}'`):t.log("purchaseEquipment",`Failed to purchase '${a}' for Gang member '${e}'`),i},ascendMember:function(e){n("ascendMember",Object(r.getRamCost)("gang","ascendMember")),Ie("ascendMember");const a=Be("ascendMember",e);return A.Player.gang.ascendMember(a,t)},setTerritoryWarfare:function(e){n("setTerritoryWarfare",Object(r.getRamCost)("gang","setTerritoryWarfare")),Ie("setTerritoryWarfare"),e?(A.Player.gang.territoryWarfareEngaged=!0,t.log("setTerritoryWarfare","Engaging in Gang Territory Warfare")):(A.Player.gang.territoryWarfareEngaged=!1,t.log("setTerritoryWarfare","Disengaging in Gang Territory Warfare"))},getChanceToWinClash:function(e){if(n("getChanceToWinClash",Object(r.getRamCost)("gang","getChanceToWinClash")),Ie("getChanceToWinClash"),null==b.a[e])throw Me(`gang.${getChanceToWinClash}`,`Invalid gang: ${e}`);const t=b.a[A.Player.gang.facName].power;return t/(b.a[e].power+t)},getBonusTime:function(){return n("getBonusTime",Object(r.getRamCost)("gang","getBonusTime")),Ie("getBonusTime"),Math.round(A.Player.gang.storedCycles/5)}},bladeburner:{getContractNames:function(){return n("getContractNames",Object(r.getRamCost)("bladeburner","getContractNames")),we("getContractNames"),A.Player.bladeburner.getContractNamesNetscriptFn()},getOperationNames:function(){return n("getOperationNames",Object(r.getRamCost)("bladeburner","getOperationNames")),we("getOperationNames"),A.Player.bladeburner.getOperationNamesNetscriptFn()},getBlackOpNames:function(){return n("getBlackOpNames",Object(r.getRamCost)("bladeburner","getBlackOpNames")),we("getBlackOpNames"),A.Player.bladeburner.getBlackOpNamesNetscriptFn()},getBlackOpRank:function(e=""){return n("getBlackOpRank",Object(r.getRamCost)("bladeburner","getBlackOpRank")),we("getBlackOpRank"),Le("getBlackOpRank","blackops",e).reqdRank},getGeneralActionNames:function(){return n("getGeneralActionNames",Object(r.getRamCost)("bladeburner","getGeneralActionNames")),we("getGeneralActionNames"),A.Player.bladeburner.getGeneralActionNamesNetscriptFn()},getSkillNames:function(){return n("getSkillNames",Object(r.getRamCost)("bladeburner","getSkillNames")),we("getSkillNames"),A.Player.bladeburner.getSkillNamesNetscriptFn()},startAction:function(e="",a=""){n("startAction",Object(r.getRamCost)("bladeburner","startAction")),we("startAction");try{return A.Player.bladeburner.startActionNetscriptFn(e,a,t)}catch(e){throw Me("bladeburner.startAction",e)}},stopBladeburnerAction:function(){return n("stopBladeburnerAction",Object(r.getRamCost)("bladeburner","stopBladeburnerAction")),we("stopBladeburnerAction"),A.Player.bladeburner.resetAction()},getCurrentAction:function(){return n("getCurrentAction",Object(r.getRamCost)("bladeburner","getCurrentAction")),we("getCurrentAction"),A.Player.bladeburner.getTypeAndNameFromActionId(A.Player.bladeburner.action)},getActionTime:function(e="",a=""){n("getActionTime",Object(r.getRamCost)("bladeburner","getActionTime")),we("getActionTime");try{return A.Player.bladeburner.getActionTimeNetscriptFn(e,a,t)}catch(e){throw Me("bladeburner.getActionTime",e)}},getActionEstimatedSuccessChance:function(e="",a=""){n("getActionEstimatedSuccessChance",Object(r.getRamCost)("bladeburner","getActionEstimatedSuccessChance")),we("getActionEstimatedSuccessChance");try{return A.Player.bladeburner.getActionEstimatedSuccessChanceNetscriptFn(e,a,t)}catch(e){throw Me("bladeburner.getActionEstimatedSuccessChance",e)}},getActionRepGain:function(e="",t="",a){n("getActionRepGain",Object(r.getRamCost)("bladeburner","getActionRepGain")),we("getActionRepGain");const i=Le("getActionRepGain",e,t);let o;return o=null==a||isNaN(a)?Math.pow(i.rewardFac,i.level-1):Math.pow(i.rewardFac,a-1),i.rankGain*o*c.BitNodeMultipliers.BladeburnerRank},getActionCountRemaining:function(e="",a=""){n("getActionCountRemaining",Object(r.getRamCost)("bladeburner","getActionCountRemaining")),we("getActionCountRemaining");try{return A.Player.bladeburner.getActionCountRemainingNetscriptFn(e,a,t)}catch(e){throw Me("bladeburner.getActionCountRemaining",e)}},getActionMaxLevel:function(e="",t=""){return n("getActionMaxLevel",Object(r.getRamCost)("bladeburner","getActionMaxLevel")),we("getActionMaxLevel"),Le("getActionMaxLevel",e,t).maxLevel},getActionCurrentLevel:function(e="",t=""){return n("getActionCurrentLevel",Object(r.getRamCost)("bladeburner","getActionCurrentLevel")),we("getActionCurrentLevel"),Le("getActionCurrentLevel",e,t).level},getActionAutolevel:function(e="",t=""){return n("getActionAutolevel",Object(r.getRamCost)("bladeburner","getActionAutolevel")),we("getActionAutolevel"),Le("getActionCurrentLevel",e,t).autoLevel},setActionAutolevel:function(e="",t="",a=!0){n("setActionAutolevel",Object(r.getRamCost)("bladeburner","setActionAutolevel")),we("setActionAutolevel"),Le("getActionCurrentLevel",e,t).autoLevel=a},setActionLevel:function(e="",t="",a=1){n("setActionLevel",Object(r.getRamCost)("bladeburner","setActionLevel")),we("setActionLevel");const i=Le("setActionLevel",e,t);if(a<1||a>i.maxLevel)throw Me("bladeburner.setActionLevel",`Level must be between 1 and ${i.maxLevel}, is ${a}`);actionObj.level=a},getRank:function(){return n("getRank",Object(r.getRamCost)("bladeburner","getRank")),we("getRank"),A.Player.bladeburner.rank},getSkillPoints:function(){return n("getSkillPoints",Object(r.getRamCost)("bladeburner","getSkillPoints")),we("getSkillPoints"),A.Player.bladeburner.skillPoints},getSkillLevel:function(e=""){n("getSkillLevel",Object(r.getRamCost)("bladeburner","getSkillLevel")),we("getSkillLevel");try{return A.Player.bladeburner.getSkillLevelNetscriptFn(e,t)}catch(e){throw Me("bladeburner.getSkillLevel",e)}},getSkillUpgradeCost:function(e=""){n("getSkillUpgradeCost",Object(r.getRamCost)("bladeburner","getSkillUpgradeCost")),we("getSkillUpgradeCost");try{return A.Player.bladeburner.getSkillUpgradeCostNetscriptFn(e,t)}catch(e){throw Me("bladeburner.getSkillUpgradeCost",e)}},upgradeSkill:function(e){n("upgradeSkill",Object(r.getRamCost)("bladeburner","upgradeSkill")),we("upgradeSkill");try{return A.Player.bladeburner.upgradeSkillNetscriptFn(e,t)}catch(e){throw Me("bladeburner.upgradeSkill",e)}},getTeamSize:function(e="",a=""){n("getTeamSize",Object(r.getRamCost)("bladeburner","getTeamSize")),we("getTeamSize");try{return A.Player.bladeburner.getTeamSizeNetscriptFn(e,a,t)}catch(e){throw Me("bladeburner.getTeamSize",e)}},setTeamSize:function(e="",a="",i){n("setTeamSize",Object(r.getRamCost)("bladeburner","setTeamSize")),we("setTeamSize");try{return A.Player.bladeburner.setTeamSizeNetscriptFn(e,a,i,t)}catch(e){throw Me("bladeburner.setTeamSize",e)}},getCityEstimatedPopulation:function(e){return n("getCityEstimatedPopulation",Object(r.getRamCost)("bladeburner","getCityEstimatedPopulation")),we("getCityEstimatedPopulation"),Ae("getCityEstimatedPopulation",e),A.Player.bladeburner.cities[e].popEst},getCityEstimatedCommunities:function(e){return n("getCityEstimatedCommunities",Object(r.getRamCost)("bladeburner","getCityEstimatedCommunities")),we("getCityEstimatedCommunities"),Ae("getCityEstimatedCommunities",e),A.Player.bladeburner.cities[e].commsEst},getCityChaos:function(e){return n("getCityChaos",Object(r.getRamCost)("bladeburner","getCityChaos")),we("getCityChaos"),Ae("getCityChaos",e),A.Player.bladeburner.cities[e].chaos},getCity:function(){return n("getCity",Object(r.getRamCost)("bladeburner","getCity")),we("getCityChaos"),A.Player.bladeburner.city},switchCity:function(e){return n("switchCity",Object(r.getRamCost)("bladeburner","switchCity")),we("switchCity"),Ae("switchCity",e),A.Player.bladeburner.city=e},getStamina:function(){return n("getStamina",Object(r.getRamCost)("bladeburner","getStamina")),we("getStamina"),[A.Player.bladeburner.stamina,A.Player.bladeburner.maxStamina]},joinBladeburnerFaction:function(){return n("joinBladeburnerFaction",Object(r.getRamCost)("bladeburner","joinBladeburnerFaction")),we("joinBladeburnerFaction",!0),A.Player.bladeburner.joinBladeburnerFactionNetscriptFn(t)},joinBladeburnerDivision:function(){if(n("joinBladeburnerDivision",Object(r.getRamCost)("bladeburner","joinBladeburnerDivision")),we("joinBladeburnerDivision",!0),7===A.Player.bitNodeN||H.SourceFileFlags[7]>0){if(8===A.Player.bitNodeN)return!1;if(A.Player.bladeburner instanceof m.a)return!0;if(A.Player.strength>=100&&A.Player.defense>=100&&A.Player.dexterity>=100&&A.Player.agility>=100){A.Player.bladeburner=new m.a({new:!0}),t.log("joinBladeburnerDivision","You have been accepted into the Bladeburner division");const e=document.getElementById("world-menu-header");return e instanceof HTMLElement&&(e.click(),e.click()),!0}return t.log("joinBladeburnerDivision","You do not meet the requirements for joining the Bladeburner division"),!1}},getBonusTime:function(){return n("getBonusTime",Object(r.getRamCost)("bladeburner","getBonusTime")),we("getBonusTime"),Math.round(A.Player.bladeburner.storedCycles/5)}},codingcontract:{attempt:function(e,a,i=t.serverIp,{returnReward:o}={}){n("attempt",Object(r.getRamCost)("codingcontract","attempt"));const s=De("attempt",i,a);if(Object(ce.is2DArray)(e)){let t=[];for(let n=0;n<e.length;++n)t.push(["[",e[n].toString(),"]"].join(""));e=t.join(",")}else e=String(e);const l=ve(i,"codingcontract.attempt");if(s.isSolution(e)){const e=A.Player.gainCodingContractReward(s.reward,s.getDifficulty());return t.log("attempt",`Successfully completed Coding Contract '${a}'. Reward: ${e}`),l.removeContract(a),!o||e}return++s.tries,s.tries>=s.getMaxNumTries()?(t.log("attempt",`Coding Contract attempt '${a}' failed. Contract is now self-destructing`),l.removeContract(a)):t.log("attempt",`Coding Contract attempt '${a}' failed. ${s.getMaxNumTries()-s.tries} attempts remaining.`),!!o&&""},getContractType:function(e,a=t.serverIp){return n("getContractType",Object(r.getRamCost)("codingcontract","getContractType")),De("getContractType",a,e).getType()},getData:function(e,a=t.serverIp){n("getData",Object(r.getRamCost)("codingcontract","getData"));const i=De("getData",a,e).getData();if(i.constructor===Array){const e=i.slice();for(let t=0;t<e.length;++t)i[t].constructor===Array&&(e[t]=i[t].slice());return e}return i},getDescription:function(e,a=t.serverIp){return n("getDescription",Object(r.getRamCost)("codingcontract","getDescription")),De("getDescription",a,e).getDescription()},getNumTriesRemaining:function(e,a=t.serverIp){n("getNumTriesRemaining",Object(r.getRamCost)("codingcontract","getNumTriesRemaining"));const i=De("getNumTriesRemaining",a,e);return i.getMaxNumTries()-i.tries}},sleeve:{getNumSleeves:function(){return n("getNumSleeves",Object(r.getRamCost)("sleeve","getNumSleeves")),Ne("getNumSleeves"),A.Player.sleeves.length},setToShockRecovery:function(e=0){return n("setToShockRecovery",Object(r.getRamCost)("sleeve","setToShockRecovery")),Ne("setToShockRecovery"),Re("setToShockRecovery",e),A.Player.sleeves[e].shockRecovery(A.Player)},setToSynchronize:function(e=0){return n("setToSynchronize",Object(r.getRamCost)("sleeve","setToSynchronize")),Ne("setToSynchronize"),Re("setToSynchronize",e),A.Player.sleeves[e].synchronize(A.Player)},setToCommitCrime:function(e=0,t=""){return n("setToCommitCrime",Object(r.getRamCost)("sleeve","setToCommitCrime")),Ne("setToCommitCrime"),Re("setToCommitCrime",e),A.Player.sleeves[e].commitCrime(A.Player,t)},setToUniversityCourse:function(e=0,t="",a=""){return n("setToUniversityCourse",Object(r.getRamCost)("sleeve","setToUniversityCourse")),Ne("setToUniversityCourse"),Re("setToUniversityCourse",e),A.Player.sleeves[e].takeUniversityCourse(A.Player,t,a)},travel:function(e=0,t=""){return n("travel",Object(r.getRamCost)("sleeve","travel")),Ne("travel"),Re("travel",e),A.Player.sleeves[e].travel(A.Player,t)},setToCompanyWork:function(e=0,t=""){n("setToCompanyWork",Object(r.getRamCost)("sleeve","setToCompanyWork")),Ne("setToCompanyWork"),Re("setToCompanyWork",e);for(let n=0;n<A.Player.sleeves.length;++n){if(n===e)continue;const r=A.Player.sleeves[n];if(r.currentTask===re.SleeveTaskType.Company&&r.currentTaskLocation===t)throw Me("sleeve.setToFactionWork",`Sleeve ${e} cannot work for company ${t} because Sleeve ${n} is already working for them.`)}return A.Player.sleeves[e].workForCompany(A.Player,t)},setToFactionWork:function(e=0,t="",a=""){n("setToFactionWork",Object(r.getRamCost)("sleeve","setToFactionWork")),Ne("setToFactionWork"),Re("setToFactionWork",e);for(let n=0;n<A.Player.sleeves.length;++n){if(n===e)continue;const r=A.Player.sleeves[n];if(r.currentTask===re.SleeveTaskType.Faction&&r.currentTaskLocation===t)throw Me("sleeve.setToFactionWork",`Sleeve ${e} cannot work for faction ${t} because Sleeve ${n} is already working for them.`)}return A.Player.sleeves[e].workForFaction(A.Player,t,a)},setToGymWorkout:function(e=0,t="",a=""){return n("setToGymWorkout",Object(r.getRamCost)("sleeve","setToGymWorkout")),Ne("setToGymWorkout"),Re("setToGymWorkout",e),A.Player.sleeves[e].workoutAtGym(A.Player,t,a)},getSleeveStats:function(e=0){n("getSleeveStats",Object(r.getRamCost)("sleeve","getSleeveStats")),Ne("getSleeveStats"),Re("getSleeveStats",e);const t=A.Player.sleeves[e];return{shock:100-t.shock,sync:t.sync,hacking_skill:t.hacking_skill,strength:t.strength,defense:t.defense,dexterity:t.dexterity,agility:t.agility,charisma:t.charisma}},getTask:function(e=0){n("getTask",Object(r.getRamCost)("sleeve","getTask")),Ne("getTask"),Re("getTask",e);const t=A.Player.sleeves[e];return{task:re.SleeveTaskType[t.currentTask],crime:t.crimeType,location:t.currentTaskLocation,gymStatType:t.gymStatType,factionWorkType:k.FactionWorkType[t.factionWorkType]}},getInformation:function(e=0){n("getInformation",Object(r.getRamCost)("sleeve","getInformation")),Ne("getInformation"),Re("getInformation",e);const t=A.Player.sleeves[e];return{city:t.city,hp:t.hp,jobs:Object.keys(A.Player.jobs),jobTitle:Object.values(A.Player.jobs),maxHp:t.max_hp,tor:U.SpecialServerIps.hasOwnProperty("Darkweb Server"),mult:{agility:t.agility_mult,agilityExp:t.agility_exp_mult,companyRep:t.company_rep_mult,crimeMoney:t.crime_money_mult,crimeSuccess:t.crime_success_mult,defense:t.defense_mult,defenseExp:t.defense_exp_mult,dexterity:t.dexterity_mult,dexterityExp:t.dexterity_exp_mult,factionRep:t.faction_rep_mult,hacking:t.hacking_mult,hackingExp:t.hacking_exp_mult,strength:t.strength_mult,strengthExp:t.strength_exp_mult,workMoney:t.work_money_mult},timeWorked:t.currentTaskTime,earningsForSleeves:{workHackExpGain:t.earningsForSleeves.hack,workStrExpGain:t.earningsForSleeves.str,workDefExpGain:t.earningsForSleeves.def,workDexExpGain:t.earningsForSleeves.dex,workAgiExpGain:t.earningsForSleeves.agi,workChaExpGain:t.earningsForSleeves.cha,workMoneyGain:t.earningsForSleeves.money},earningsForPlayer:{workHackExpGain:t.earningsForPlayer.hack,workStrExpGain:t.earningsForPlayer.str,workDefExpGain:t.earningsForPlayer.def,workDexExpGain:t.earningsForPlayer.dex,workAgiExpGain:t.earningsForPlayer.agi,workChaExpGain:t.earningsForPlayer.cha,workMoneyGain:t.earningsForPlayer.money},earningsForTask:{workHackExpGain:t.earningsForTask.hack,workStrExpGain:t.earningsForTask.str,workDefExpGain:t.earningsForTask.def,workDexExpGain:t.earningsForTask.dex,workAgiExpGain:t.earningsForTask.agi,workChaExpGain:t.earningsForTask.cha,workMoneyGain:t.earningsForTask.money},workRepGain:t.getRepGain(A.Player)}},getSleeveAugmentations:function(e=0){n("getSleeveAugmentations",Object(r.getRamCost)("sleeve","getSleeveAugmentations")),Ne("getSleeveAugmentations"),Re("getSleeveAugmentations",e);const t=[];for(let n=0;n<A.Player.sleeves[e].augmentations.length;n++)t.push(A.Player.sleeves[e].augmentations[n].name);return t},getSleevePurchasableAugs:function(e=0){n("getSleevePurchasableAugs",Object(r.getRamCost)("sleeve","getSleevePurchasableAugs")),Ne("getSleevePurchasableAugs"),Re("getSleevePurchasableAugs",e);const t=Object(ae.findSleevePurchasableAugs)(A.Player.sleeves[e],A.Player),a=[];for(let e=0;e<t.length;e++){const n=t[e];a.push({name:n.name,cost:n.startingCost})}return a},purchaseSleeveAug:function(e=0,t=""){n("purchaseSleeveAug",Object(r.getRamCost)("sleeve","purchaseSleeveAug")),Ne("purchaseSleeveAug"),Re("purchaseSleeveAug",e);const a=i.Augmentations[t];if(!a)throw Me("sleeve.purchaseSleeveAug",`Invalid aug: ${t}`);return A.Player.sleeves[e].tryBuyAugmentation(A.Player,a)}},heart:{break:function(){return A.Player.karma}},exploit:function(){A.Player.giveExploit(ie.Exploit.UndocumentedFunctionCall)}}}}).call(this,n(86))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(144),a=n(16);class i{constructor(){this.capacity=0,this.hashes=0,this.upgrades={};for(const e in r.HashUpgrades)this.upgrades[e]=0}static fromJSON(e){return a.Generic_fromJSON(i,e.data)}getMult(e){const t=r.HashUpgrades[e],n=this.upgrades[e];return null==t||null==n?(console.error("Could not find Hash Study upgrade"),1):1+t.value*n/100}getStudyMult(){return this.getMult("Improve Studying")}getTrainingMult(){return this.getMult("Improve Gym Training")}getUpgradeCost(e){const t=r.HashUpgrades[e],n=this.upgrades[e];return null==t||null==n?(console.error(`Invalid Upgrade Name given to HashManager.getUpgradeCost(): ${e}`),1/0):t.getCost(n)}prestige(){for(const e in r.HashUpgrades)this.upgrades[e]=0;this.hashes=0,this.updateCapacity(0)}refundUpgrade(e){const t=r.HashUpgrades[e];--this.upgrades[e];const n=this.upgrades[e];if(null==t||null==n||n<0)return void console.error(`Invalid Upgrade Name given to HashManager.upgrade(): ${e}`);const a=t.getCost(n);this.hashes+=a}storeHashes(e){this.hashes+=e,this.hashes=Math.min(this.hashes,this.capacity)}updateCapacity(e){e<0&&(this.capacity=0),this.capacity=Math.max(e,0)}upgrade(e){if(null==r.HashUpgrades[e])return console.error(`Invalid Upgrade Name given to HashManager.upgrade(): ${e}`),!1;const t=this.getUpgradeCost(e);return!(this.hashes<t)&&(this.hashes-=t,++this.upgrades[e],!0)}toJSON(){return a.Generic_toJSON("HashManager",this)}}t.HashManager=i,a.Reviver.constructors.HashManager=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createProgressBarText=function(e){const t=Object.assign({},{progress:0,totalTicks:20},e);t.progress=Math.max(Math.min(t.progress,1),0);const n=Math.max(Math.floor(t.progress/(1/t.totalTicks)),1),r=Math.max(t.totalTicks-n,0);return`[${"|".repeat(n)}${"-".repeat(r)}]`}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(67),a=n(29),i=n(83),o=n(24);let s,l,c;function u(){t.logBoxOpened=!1,s instanceof HTMLElement&&(s.style.display="none")}document.addEventListener("keydown",function(e){t.logBoxOpened&&e.keyCode==o.KEY.ESC&&u()}),document.addEventListener("DOMContentLoaded",function e(){const t=document.getElementById("log-box-close");null!=t?(t.addEventListener("click",function(){return u(),!1}),(l=document.getElementById("log-box-text-header"))instanceof HTMLElement&&(l.style.display="inline-block"),s=document.getElementById("log-box-container"),c=document.getElementById("log-box-text"),u(),document.removeEventListener("DOMContentLoaded",e)):console.error("Could not find LogBox's close button")}),t.logBoxOpened=!1;let m=null;function p(){if(c instanceof HTMLElement&&m&&t.logBoxOpened&&m.logUpd){c.innerHTML="";for(let e=0;e<m.logs.length;++e)c.innerHTML+=m.logs[e],c.innerHTML+="<br>";m.logUpd=!1}}t.logBoxCreate=function(e){m=e;const n=a.clearEventListeners("log-box-kill-script");null!=n?(n.addEventListener("click",()=>(r.killWorkerScript(e,e.server,!0),!1)),n.style.display="inline-block",t.logBoxOpened=!0,s instanceof HTMLElement&&(s.style.display="block"),l instanceof HTMLElement?l.innerHTML=`${m.filename} ${i.arrayToString(m.args)}:<br><br>`:console.warn("LogBox's Text Header DOM element is null"),m.logUpd=!0,p()):console.error("Could not find LogBox's 'Kill Script' button")},t.logBoxUpdateText=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearObject=function(e){for(const t in e)e.hasOwnProperty(t)&&delete e[t]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(17);t.NetscriptPort=class{constructor(){this.data=[]}write(e){return this.data.push(e),this.data.length>r.Settings.MaxPortCapacity?this.data.shift():null}tryWrite(e){return!(this.data.length>=r.Settings.MaxPortCapacity||(this.data.push(e),0))}read(){return 0===this.data.length?"NULL PORT DATA":this.data.shift()}peek(){return 0===this.data.length?"NULL PORT DATA":this.data.slice()[0]}full(){return this.data.length==r.Settings.MaxPortCapacity}empty(){return 0===this.data.length}clear(){this.data.length=0}}},,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getElementById=function(e){const t=document.getElementById(e);if(null===t)throw new Error(`Unable to find element with id '${e}'`);return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(273),a=n(19),i=n(720),o=n(168),s=n(16);class l extends r.BaseServer{constructor(e={hostname:"",ip:o.createRandomIp()}){super(e),this.baseDifficulty=1,this.hackDifficulty=1,this.manuallyHacked=!1,this.minDifficulty=1,this.moneyAvailable=0,this.moneyMax=0,this.numOpenPortsRequired=5,this.openPortCount=0,this.purchasedByPlayer=!1,this.requiredHackingSkill=1,this.serverGrowth=1,this.hostname.startsWith("hacknet-node-")&&(this.hostname=i.createRandomString(10)),this.purchasedByPlayer=null!=e.purchasedByPlayer&&e.purchasedByPlayer,this.maxRam=null!=e.maxRam?e.maxRam:0,this.requiredHackingSkill=null!=e.requiredHackingSkill?e.requiredHackingSkill:1,this.moneyAvailable=null!=e.moneyAvailable?e.moneyAvailable*a.BitNodeMultipliers.ServerStartingMoney:0,this.moneyMax=25*this.moneyAvailable*a.BitNodeMultipliers.ServerMaxMoney,this.hackDifficulty=null!=e.hackDifficulty?e.hackDifficulty*a.BitNodeMultipliers.ServerStartingSecurity:1,this.baseDifficulty=this.hackDifficulty,this.minDifficulty=Math.max(1,Math.round(this.hackDifficulty/3)),this.serverGrowth=null!=e.serverGrowth?e.serverGrowth:1,this.numOpenPortsRequired=null!=e.numOpenPortsRequired?e.numOpenPortsRequired:5}static fromJSON(e){return s.Generic_fromJSON(l,e.data)}capDifficulty(){this.hackDifficulty<this.minDifficulty&&(this.hackDifficulty=this.minDifficulty),this.hackDifficulty<1&&(this.hackDifficulty=1),this.hackDifficulty>1e6&&(this.hackDifficulty=1e6)}changeMinimumSecurity(e,t=!1){t?this.minDifficulty*=e:this.minDifficulty+=e,this.minDifficulty=Math.max(1,this.minDifficulty)}changeMaximumMoney(e,t=!1){t?this.moneyMax*=e:this.moneyMax+=e}fortify(e){this.hackDifficulty+=e,this.capDifficulty()}weaken(e){this.hackDifficulty-=e*a.BitNodeMultipliers.ServerWeakenRate,this.capDifficulty()}toJSON(){return s.Generic_toJSON("Server",this)}}t.Server=l,s.Reviver.constructors.Server=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(16),a=n(15);t.StockForecastInfluenceLimit=5;const i={b:!0,initPrice:1e4,marketCap:1e12,mv:1,name:"",otlkMag:0,spreadPerc:0,shareTxForMovement:1e6,symbol:""};function o(e){let t;switch(typeof e){case"number":return e;case"object":{const n=e;t=a.getRandomInt(n.min,n.max);break}default:throw Error(`Do not know how to convert the type '${typeof e}' to a number`)}return"object"==typeof e&&"number"==typeof e.divisor?t/e.divisor:t}class s{static fromJSON(e){return r.Generic_fromJSON(s,e.data)}constructor(e=i){this.name=e.name,this.symbol=e.symbol,this.price=o(e.initPrice),this.lastPrice=this.price,this.playerShares=0,this.playerAvgPx=0,this.playerShortShares=0,this.playerAvgShortPx=0,this.mv=o(e.mv),this.b=e.b,this.otlkMag=e.otlkMag,this.otlkMagForecast=this.getAbsoluteForecast(),this.cap=a.getRandomInt(1e3*this.price,25e3*this.price),this.spreadPerc=o(e.spreadPerc),this.shareTxForMovement=o(e.shareTxForMovement),this.shareTxUntilMovement=this.shareTxForMovement;let t=e.marketCap/this.price;this.totalShares=1e5*Math.round(t/1e5);this.maxShares=1e5*Math.round(.2*this.totalShares/1e5)}changeForecastForecast(e){this.otlkMagForecast=e,this.otlkMagForecast>100?this.otlkMagForecast=100:this.otlkMagForecast<0&&(this.otlkMagForecast=0)}changePrice(e){this.lastPrice=this.price,this.price=e}cycleForecast(e=.1){const t=this.getForecastIncreaseChance();Math.random()<t?this.b?this.otlkMag+=e:this.otlkMag-=e:this.b?this.otlkMag-=e:this.otlkMag+=e,this.otlkMag=Math.min(this.otlkMag,50),this.otlkMag<0&&(this.otlkMag*=-1,this.b=!this.b)}cycleForecastForecast(e=.1){Math.random()<.5?this.changeForecastForecast(this.otlkMagForecast+e):this.changeForecastForecast(this.otlkMagForecast-e)}flipForecastForecast(){const e=this.otlkMagForecast-50;this.otlkMagForecast=50+-1*e}getAbsoluteForecast(){return this.b?50+this.otlkMag:50-this.otlkMag}getAskPrice(){return this.price*(1+this.spreadPerc/100)}getBidPrice(){return this.price*(1-this.spreadPerc/100)}getForecastIncreaseChance(){const e=this.otlkMagForecast-this.getAbsoluteForecast();return(50+Math.min(Math.max(e,-45),45))/100}influenceForecast(e){this.otlkMag>t.StockForecastInfluenceLimit&&(this.otlkMag=Math.max(t.StockForecastInfluenceLimit,this.otlkMag-e))}influenceForecastForecast(e){this.otlkMagForecast>50?(this.otlkMagForecast-=e,this.otlkMagForecast=Math.max(50,this.otlkMagForecast)):this.otlkMagForecast<50&&(this.otlkMagForecast+=e,this.otlkMagForecast=Math.min(50,this.otlkMagForecast))}toJSON(){return r.Generic_toJSON("Stock",this)}}t.Stock=s,r.Reviver.constructors.Stock=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(268),a=n(6);t.Crimes={Shoplift:new r.Crime("Shoplift",a.CONSTANTS.CrimeShoplift,2e3,15e3,.05,.1,{dexterity_success_weight:1,agility_success_weight:1,dexterity_exp:2,agility_exp:2}),RobStore:new r.Crime("Rob Store",a.CONSTANTS.CrimeRobStore,6e4,4e5,.2,.5,{hacking_exp:30,dexterity_exp:45,agility_exp:45,hacking_success_weight:.5,dexterity_success_weight:2,agility_success_weight:1,intelligence_exp:7.5*a.CONSTANTS.IntelligenceCrimeBaseExpGain}),Mug:new r.Crime("Mug",a.CONSTANTS.CrimeMug,4e3,36e3,.2,.25,{strength_exp:3,defense_exp:3,dexterity_exp:3,agility_exp:3,strength_success_weight:1.5,defense_success_weight:.5,dexterity_success_weight:1.5,agility_success_weight:.5}),Larceny:new r.Crime("Larceny",a.CONSTANTS.CrimeLarceny,9e4,8e5,1/3,1.5,{hacking_exp:45,dexterity_exp:60,agility_exp:60,hacking_success_weight:.5,dexterity_success_weight:1,agility_success_weight:1,intelligence_exp:15*a.CONSTANTS.IntelligenceCrimeBaseExpGain}),DealDrugs:new r.Crime("Deal Drugs",a.CONSTANTS.CrimeDrugs,1e4,12e4,1,.5,{dexterity_exp:5,agility_exp:5,charisma_exp:10,charisma_success_weight:3,dexterity_success_weight:2,agility_success_weight:1}),BondForgery:new r.Crime("Bond Forgery",a.CONSTANTS.CrimeBondForgery,3e5,45e5,.5,.1,{hacking_exp:100,dexterity_exp:150,charisma_exp:15,hacking_success_weight:.05,dexterity_success_weight:1.25,intelligence_exp:60*a.CONSTANTS.IntelligenceCrimeBaseExpGain}),TraffickArms:new r.Crime("Traffick Arms",a.CONSTANTS.CrimeTraffickArms,4e4,6e5,2,1,{strength_exp:20,defense_exp:20,dexterity_exp:20,agility_exp:20,charisma_exp:40,charisma_success_weight:1,strength_success_weight:1,defense_success_weight:1,dexterity_success_weight:1,agility_success_weight:1}),Homicide:new r.Crime("Homicide",a.CONSTANTS.CrimeHomicide,3e3,45e3,1,3,{strength_exp:2,defense_exp:2,dexterity_exp:2,agility_exp:2,strength_success_weight:2,defense_success_weight:2,dexterity_success_weight:.5,agility_success_weight:.5,kills:1}),GrandTheftAuto:new r.Crime("Grand Theft Auto",a.CONSTANTS.CrimeGrandTheftAuto,8e4,16e5,8,5,{strength_exp:20,defense_exp:20,dexterity_exp:20,agility_exp:80,charisma_exp:40,hacking_success_weight:1,strength_success_weight:1,dexterity_success_weight:4,agility_success_weight:2,charisma_success_weight:2,intelligence_exp:16*a.CONSTANTS.IntelligenceCrimeBaseExpGain}),Kidnap:new r.Crime("Kidnap",a.CONSTANTS.CrimeKidnap,12e4,36e5,5,6,{strength_exp:80,defense_exp:80,dexterity_exp:80,agility_exp:80,charisma_exp:80,charisma_success_weight:1,strength_success_weight:1,dexterity_success_weight:1,agility_success_weight:1,intelligence_exp:26*a.CONSTANTS.IntelligenceCrimeBaseExpGain}),Assassination:new r.Crime("Assassination",a.CONSTANTS.CrimeAssassination,3e5,12e6,8,10,{strength_exp:300,defense_exp:300,dexterity_exp:300,agility_exp:300,strength_success_weight:1,dexterity_success_weight:2,agility_success_weight:1,intelligence_exp:65*a.CONSTANTS.IntelligenceCrimeBaseExpGain,kills:1}),Heist:new r.Crime("Heist",a.CONSTANTS.CrimeHeist,6e5,12e7,18,15,{hacking_exp:450,strength_exp:450,defense_exp:450,dexterity_exp:450,agility_exp:450,charisma_exp:450,hacking_success_weight:1,strength_success_weight:1,defense_success_weight:1,dexterity_success_weight:1,agility_success_weight:1,charisma_success_weight:1,intelligence_exp:130*a.CONSTANTS.IntelligenceCrimeBaseExpGain})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(35),a=n(17),i=n(5),o=n(16),s=n(157);class l{constructor(e=null,t=[]){this.args=[],this.dataMap={},this.filename="",this.logs=[],this.logUpd=!1,this.offlineExpGained=0,this.offlineMoneyMade=0,this.offlineRunningTime=.01,this.onlineExpGained=0,this.onlineMoneyMade=0,this.onlineRunningTime=.01,this.pid=-1,this.ramUsage=0,this.server="",this.threads=1,null!=e&&(this.filename=e.filename,this.args=t,this.server=e.server,this.ramUsage=e.ramUsage)}static fromJSON(e){return o.Generic_fromJSON(l,e.data)}log(e){this.logs.length>a.Settings.MaxLogCapacity&&this.logs.shift();let t=e;r.FconfSettings.ENABLE_TIMESTAMPS&&(t="["+s.getTimestamp()+"] "+t),this.logs.push(t),this.logUpd=!0}displayLog(){for(var e=0;e<this.logs.length;++e)i.post(this.logs[e])}clearLog(){this.logs.length=0}recordHack(e,t,n=1){null!=this.dataMap[e]&&this.dataMap[e].constructor===Array||(this.dataMap[e]=[0,0,0,0]),this.dataMap[e][0]+=t,this.dataMap[e][1]+=n}recordGrow(e,t=1){null!=this.dataMap[e]&&this.dataMap[e].constructor===Array||(this.dataMap[e]=[0,0,0,0]),this.dataMap[e][2]+=t}recordWeaken(e,t=1){null!=this.dataMap[e]&&this.dataMap[e].constructor===Array||(this.dataMap[e]=[0,0,0,0]),this.dataMap[e][3]+=t}toJSON(){return o.Generic_toJSON("RunningScript",this)}}t.RunningScript=l,o.Reviver.constructors.RunningScript=l},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return B}),n.d(t,"b",function(){return L});var r=n(10),a=n(71),i=n(4),o=n(95),s=n(70),l=n(180),c=n(25),u=n(26),m=n(32),p=n(12),h=n(74),d=n(13),_=n(50),g=(n(62),n(23)),y=(n(66),n(68)),f=n(57),b=n(0),E=n(160),v=n(100),k=n(20),C=(n(116),n(22)),T=n(38),P=n(40),S=n(42),O=n(59),M=n(11),x=n(8),w=n(49),A=n(27),N=n(3),R=n(37),D=n(43);const I=25e7;function B(){M.routing.navigateTo(M.Page.Terminal),Object(o.initBitNodeMultipliers)(b.Player),b.Player.prestigeAugmentation(),document.getElementById("mainmenu-container").style.visibility="visible",O.a.resetTerminalInput(),p.Engine.loadTerminalContent(),e("#terminal tr:not(:last)").remove(),Object(O.b)(),Object(f.c)();var t=b.Player.getHomeComputer();for(var n in Object(k.prestigeAllServers)(),Object(P.prestigeSpecialServerIps)(),Object(k.AddToAllServers)(t),Object(C.prestigeHomeComputer)(t),Object(a.b)(i.AugmentationNames.Neurolink)&&r.Augmentations[i.AugmentationNames.Neurolink].owned&&(t.programs.push(m.Programs.FTPCrackProgram.name),t.programs.push(m.Programs.RelaySMTPProgram.name)),Object(a.b)(i.AugmentationNames.CashRoot)&&r.Augmentations[i.AugmentationNames.CashRoot].owned&&(b.Player.setMoney(1e6),t.programs.push(m.Programs.BruteSSHProgram.name)),Object(k.initForeignServers)(b.Player.getHomeComputer()),c.Companies)c.Companies.hasOwnProperty(n)&&c.Companies[n].gainFavor();for(var n in d.Factions)d.Factions.hasOwnProperty(n)&&d.Factions[n].gainFavor();if(p.Engine._actionInProgress&&(p.Engine._actionInProgress=!1,O.a.finishAction(!0)),Object(d.initFactions)(),Object(a.d)(),b.Player.reapplyAllSourceFiles(),Object(c.initCompanies)(),Object(y.c)(),b.Player.inGang()){const e=d.Factions[b.Player.gang.facName];e instanceof h.Faction&&Object(_.joinFaction)(e)}if(b.Player.bladeburner instanceof s.a&&b.Player.bladeburner.prestige(),8===b.Player.bitNodeN&&(b.Player.money=new D.a(I)),(8===b.Player.bitNodeN||T.SourceFileFlags[8]>0)&&(b.Player.hasWseAccount=!0,b.Player.hasTixApiAccess=!0),b.Player.hasWseAccount&&(Object(S.initStockMarket)(),Object(S.initSymbolToStockMap)()),document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),Object(a.b)(i.AugmentationNames.TheRedPill)&&r.Augmentations[i.AugmentationNames.TheRedPill].owned){var l=k.AllServers[P.SpecialServerIps[P.SpecialServerNames.WorldDaemon]],u=k.AllServers[P.SpecialServerIps[P.SpecialServerNames.DaedalusServer]];l&&u&&(l.serversOnNetwork.push(u.ip),u.serversOnNetwork.push(l.ip))}Object(E.resetPidCounter)()}function L(){Object(o.initBitNodeMultipliers)(b.Player),Object(T.updateSourceFileFlags)(b.Player),b.Player.prestigeSourceFile(),Object(f.c)();var t=b.Player.getHomeComputer();for(var n in Object(k.prestigeAllServers)(),Object(P.prestigeSpecialServerIps)(),Object(k.AddToAllServers)(t),Object(C.prestigeHomeComputer)(t),Object(k.initForeignServers)(b.Player.getHomeComputer()),T.SourceFileFlags[9]>=2?t.setMaxRam(128):T.SourceFileFlags[1]>0?t.setMaxRam(32):t.setMaxRam(8),t.cpuCores=1,c.Companies)c.Companies.hasOwnProperty(n)&&(c.Companies[n].favor=0);for(var n in d.Factions)d.Factions.hasOwnProperty(n)&&(d.Factions[n].favor=0);for(var i in p.Engine._actionInProgress&&(p.Engine._actionInProgress=!1,O.a.finishAction(!0)),r.Augmentations)r.Augmentations.hasOwnProperty(i)&&delete r.Augmentations[i];if(Object(d.initFactions)(),Object(a.d)(),b.Player.reapplyAllSourceFiles(),Object(c.initCompanies)(),e("#terminal tr:not(:last)").remove(),Object(O.b)(),Object(y.c)(),document.getElementById("mainmenu-container").style.visibility="visible",O.a.resetTerminalInput(),p.Engine.loadTerminalContent(),3===b.Player.bitNodeN&&(t.messages.push(v.LiteratureNames.CorporationManagementHandbook),Object(x.dialogBoxCreate)("You received a copy of the Corporation Management Handbook on your home computer. Read it if you need help getting started with Corporations!")),6===b.Player.bitNodeN){Object(l.b)(["In the middle of the 21st century, OmniTek Incorporated advanced robot evolution with their Synthoids (synthetic androids), a being virtually identical to a human.","------","Their sixth-generation Synthoids, called MK-VI, were stronger, faster, and more intelligent than humans. Many argued that the MK-VI Synthoids were the first example of sentient AI.","------","Unfortunately, in 2070 a terrorist group called Ascendis Totalis hacked into OmniTek and uploaded a rogue AI into their Synthoid manufacturing facilities.","------","The MK-VI Synthoids infected by the rogue AI turned hostile toward humanity, initiating the deadliest conflict in human history. This dark chapter is now known as the Synthoid Uprising.","------","In the aftermath of the Uprising, further manufacturing of Synthoids with advanced AI was banned. MK-VI Synthoids that did not have the rogue Ascendis Totalis AI were allowed to continue their existence.","------","The intelligence community believes that not all of the rogue MK-VI Synthoids from the Uprising were found and destroyed, and that many of them are blending in as normal humans in society today. As a result, many nations have created Bladeburner divisions, special units that are tasked with investigating and dealing with Synthoid threats."]).then(function(){var e="bladeburner-bitnode-start-nsa-notification",t=Object(N.createElement)("p",{innerText:"Visit the National Security Agency (NSA) to apply for their Bladeburner division! You will need 100 of each combat stat before doing this."}),n=Object(N.createElement)("br"),r=Object(N.createElement)("a",{class:"a-link-button",innerText:"Got it!",padding:"8px",clickListener:()=>(Object(A.removeElementById)(e),!1)});Object(R.createPopup)(e,[t,n,r])}).catch(function(e){Object(w.exceptionAlert)(e)})}if(8===b.Player.bitNodeN&&(b.Player.money=new D.a(I)),(8===b.Player.bitNodeN||T.SourceFileFlags[8]>0)&&(b.Player.hasWseAccount=!0,b.Player.hasTixApiAccess=!0),10===b.Player.bitNodeN&&Object(x.dialogBoxCreate)("Visit VitaLife in New Tokyo if you'd like to purchase a new sleeve!"),b.Player.hasWseAccount?(Object(S.initStockMarket)(),Object(S.initSymbolToStockMap)()):Object(S.deleteStockMarket)(),b.Player.inGang()&&b.Player.gang.clearUI(),b.Player.gang=null,b.Player.corporation=null,Object(u.resetIndustryResearchTrees)(),b.Player.bladeburner=null,T.SourceFileFlags[9]>=3){const e=b.Player.createHacknetServer();e.level=100,e.cores=10,e.cache=5,e.updateHashRate(b.Player.hacknet_node_money_mult),e.updateHashCapacity(),Object(g.r)()}document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),b.Player.gainIntelligenceExp(300),Object(E.resetPidCounter)()}}).call(this,n(86))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(727),a=n(9),i=n(20);t.WorkerScript=class{constructor(e,t,n){this.code="",this.delay=null,this.disableLogs={},this.dynamicLoadedFns={},this.dynamicRamUsage=a.RamCostConstants.ScriptBaseRamCost,this.errorMessage="",this.loadedFns={},this.output="",this.ramUsage=0,this.running=!1,this.name=e.filename,this.serverIp=e.server;const o=Math.round(t);if("number"!=typeof o||isNaN(o))throw new Error(`Invalid PID when constructing WorkerScript: ${t}`);this.pid=o,e.pid=o;const s=i.AllServers[this.serverIp];if(null==s)throw new Error(`WorkerScript constructed with invalid server ip: ${this.serverIp}`);let l=!1;for(let e=0;e<s.scripts.length;++e)s.scripts[e].filename===this.name&&(l=!0,this.code=s.scripts[e].code);if(!l)throw new Error(`WorkerScript constructed with invalid script filename: ${this.name}`);this.env=new r.Environment(null),"function"==typeof n&&(this.env.vars=n(this)),this.env.set("args",e.args.slice()),this.scriptRef=e,this.args=e.args.slice()}getServer(){return i.AllServers[this.serverIp]}getScript(){let e=this.getServer();for(let t=0;t<e.scripts.length;++t)if(e.scripts[t].filename===this.name)return e.scripts[t];return console.error("Failed to find underlying Script object in WorkerScript.getScript(). This probably means somethings wrong"),null}getScriptOnServer(e,t){null==t&&(t=this.getServer());for(let n=0;n<t.scripts.length;++n)if(t.scripts[n].filename===e)return t.scripts[n];return null}shouldLog(e){return null==this.disableLogs.ALL&&null==this.disableLogs[e]}log(e,t){this.shouldLog(e)&&(e&&t?this.scriptRef.log(`${e}: ${t}`):e?this.scriptRef.log(e):this.scriptRef.log(t))}print(e){this.scriptRef.log(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(155),a=n(76),i=n(6),o=n(121),s=n(0),l=n(2),c=n(8);t.buyStock=function(e,t,n=null,u={}){const m=n instanceof o.WorkerScript;if((t=Math.round(t))<=0)return!1;if(null==e||isNaN(t))return m?n.log("buyStock",`Invalid arguments: stock='${e}' shares='${t}'`):!0!==u.suppressDialog&&c.dialogBoxCreate("Failed to buy stock. This may be a bug, contact developer"),!1;const p=r.getBuyTransactionCost(e,t,a.PositionTypes.Long);if(null==p)return!1;if(s.Player.money.lt(p))return m?n.log("buyStock",`You do not have enough money to purchase this position. You need ${l.numeralWrapper.formatMoney(p)}.`):!0!==u.suppressDialog&&c.dialogBoxCreate(`You do not have enough money to purchase this. You need ${l.numeralWrapper.formatMoney(p)}`),!1;if(t+e.playerShares+e.playerShortShares>e.maxShares)return m?n.log("buyStock",`Purchasing '${t+e.playerShares+e.playerShortShares}' shares would exceed ${e.symbol}'s maximum (${e.maxShares}) number of shares`):!0!==u.suppressDialog&&c.dialogBoxCreate(`You cannot purchase this many shares. ${e.symbol} has a maximum of ${l.numeralWrapper.formatBigNumber(e.maxShares)} shares.`),!1;const h=e.playerShares*e.playerAvgPx;s.Player.loseMoney(p);const d=h+p-i.CONSTANTS.StockMarketCommission;e.playerShares=Math.round(e.playerShares+t),e.playerAvgPx=d/e.playerShares,r.processTransactionForecastMovement(e,t),null!=u.rerenderFn&&"function"==typeof u.rerenderFn&&u.rerenderFn();const _=`Bought ${l.numeralWrapper.format(t,"0,0")} shares of ${e.symbol} for ${l.numeralWrapper.formatMoney(p)}. `+`Paid ${l.numeralWrapper.formatMoney(i.CONSTANTS.StockMarketCommission)} in commission fees.`;return m?n.log("buyStock",_):!0!==u.suppressDialog&&c.dialogBoxCreate(_),!0},t.sellStock=function(e,t,n=null,i={}){const u=n instanceof o.WorkerScript;if(null==e||t<0||isNaN(t))return u?n.log("sellStock",`Invalid arguments: stock='${e}' shares='${t}'`):!0!==i.suppressDialog&&c.dialogBoxCreate("Failed to sell stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, contact developer"),!1;if((t=Math.round(t))>e.playerShares&&(t=e.playerShares),0===t)return!1;const m=r.getSellTransactionGain(e,t,a.PositionTypes.Long);if(null==m)return!1;let p=m-e.playerAvgPx*t;isNaN(p)&&(p=0),s.Player.gainMoney(m),s.Player.recordMoneySource(p,"stock"),u&&(n.scriptRef.onlineMoneyMade+=p,s.Player.scriptProdSinceLastAug+=p),e.playerShares=Math.round(e.playerShares-t),0===e.playerShares&&(e.playerAvgPx=0),r.processTransactionForecastMovement(e,t),null!=i.rerenderFn&&"function"==typeof i.rerenderFn&&i.rerenderFn();const h=`Sold ${l.numeralWrapper.format(t,"0,0")} shares of ${e.symbol}. `+`After commissions, you gained a total of ${l.numeralWrapper.formatMoney(m)}.`;return u?n.log("sellStock",h):!0!==i.suppressDialog&&c.dialogBoxCreate(h),!0},t.shortStock=function(e,t,n=null,u={}){const m=n instanceof o.WorkerScript;if((t=Math.round(t))<=0)return!1;if(null==e||isNaN(t))return m?n.log("shortStock",`Invalid arguments: stock='${e}' shares='${t}'`):!0!==u.suppressDialog&&c.dialogBoxCreate("Failed to initiate a short position in a stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, so contact developer"),!1;const p=r.getBuyTransactionCost(e,t,a.PositionTypes.Short);if(null==p)return!1;if(s.Player.money.lt(p))return m?n.log("shortStock","You do not have enough money to purchase this short position. You need "+l.numeralWrapper.formatMoney(p)):!0!==u.suppressDialog&&c.dialogBoxCreate("You do not have enough money to purchase this short position. You need "+l.numeralWrapper.formatMoney(p)),!1;if(t+e.playerShares+e.playerShortShares>e.maxShares)return m?n.log("shortStock",`This '${t+e.playerShares+e.playerShortShares}' short shares would exceed ${e.symbol}'s maximum (${e.maxShares}) number of shares.`):!0!==u.suppressDialog&&c.dialogBoxCreate(`You cannot purchase this many shares. ${e.symbol} has a maximum of ${e.maxShares} shares.`),!1;const h=e.playerShortShares*e.playerAvgShortPx;s.Player.loseMoney(p);const d=h+p-i.CONSTANTS.StockMarketCommission;e.playerShortShares=Math.round(e.playerShortShares+t),e.playerAvgShortPx=d/e.playerShortShares,r.processTransactionForecastMovement(e,t),null!=u.rerenderFn&&"function"==typeof u.rerenderFn&&u.rerenderFn();const _=`Bought a short position of ${l.numeralWrapper.format(t,"0,0")} shares of ${e.symbol} `+`for ${l.numeralWrapper.formatMoney(p)}. Paid ${l.numeralWrapper.formatMoney(i.CONSTANTS.StockMarketCommission)} `+"in commission fees.";return m?n.log("shortStock",_):u.suppressDialog||c.dialogBoxCreate(_),!0},t.sellShort=function(e,t,n=null,i={}){const u=n instanceof o.WorkerScript;if(null==e||isNaN(t)||t<0)return u?n.log("sellShort",`Invalid arguments: stock='${e}' shares='${t}'`):i.suppressDialog||c.dialogBoxCreate("Failed to sell a short position in a stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, so contact developer"),!1;if((t=Math.round(t))>e.playerShortShares&&(t=e.playerShortShares),0===t)return!1;const m=t*e.playerAvgShortPx,p=r.getSellTransactionGain(e,t,a.PositionTypes.Short);if(null==p||isNaN(p)||null==m)return u?n.log("sellShort","Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug"):i.suppressDialog||c.dialogBoxCreate("Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug"),!1;let h=p-m;isNaN(h)&&(h=0),s.Player.gainMoney(p),s.Player.recordMoneySource(h,"stock"),u&&(n.scriptRef.onlineMoneyMade+=h,s.Player.scriptProdSinceLastAug+=h),e.playerShortShares=Math.round(e.playerShortShares-t),0===e.playerShortShares&&(e.playerAvgShortPx=0),r.processTransactionForecastMovement(e,t),null!=i.rerenderFn&&"function"==typeof i.rerenderFn&&i.rerenderFn();const d=`Sold your short position of ${l.numeralWrapper.format(t,"0,0")} shares of ${e.symbol}. `+`After commissions, you gained a total of ${l.numeralWrapper.formatMoney(p)}`;return u?n.log("sellShort",d):i.suppressDialog||c.dialogBoxCreate(d),!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(77),a=n(13),i=n(0),o=n(20),s=n(22),l=n(40),c=n(116),u=n(15);function m(){const e=Object.keys(r.CodingContractTypes);return e[u.getRandomInt(0,e.length-1)]}function p(){let e={name:"",type:u.getRandomInt(0,r.CodingContractRewardType.Money)};e.type=function(e){let t=e;const n=i.Player.factions.filter(e=>{try{return a.Factions[e].getInfo().offerHackingWork}catch(e){return console.error(`Error when trying to filter Hacking Factions for Coding Contract Generation: ${e}`),!1}});return t===r.CodingContractRewardType.FactionReputation&&0===n.length&&(t=r.CodingContractRewardType.CompanyReputation),t===r.CodingContractRewardType.FactionReputationAll&&0===n.length&&(t=r.CodingContractRewardType.CompanyReputation),t===r.CodingContractRewardType.CompanyReputation&&0===Object.keys(i.Player.jobs).length&&(t=r.CodingContractRewardType.Money),t}(e.type);const t=i.Player.factions.filter(e=>{try{return a.Factions[e].getInfo().offerHackingWork}catch(e){return console.error(`Error when trying to filter Hacking Factions for Coding Contract Generation: ${e}`),!1}});switch(e.type){case r.CodingContractRewardType.FactionReputation:var n=t.length,o=t[u.getRandomInt(0,n-1)];e.name=o;break;case r.CodingContractRewardType.CompanyReputation:{const t=Object.keys(i.Player.jobs);t.length>0?e.name=t[u.getRandomInt(0,t.length-1)]:e.type=r.CodingContractRewardType.Money;break}}return e}function h(){const e=Object.keys(o.AllServers);let t=u.getRandomInt(0,e.length-1),n=o.AllServers[e[t]];for(let r=0;r<200&&(!(n instanceof c.Server)||n.purchasedByPlayer||n.hostname===l.SpecialServerNames.WorldDaemon);++r)t=u.getRandomInt(0,e.length-1),n=o.AllServers[e[t]];return n}function d(e,t){let n=`contract-${u.getRandomInt(0,1e6)}`;for(let t=0;t<1e3&&!(e.contracts.filter(e=>e.fn===n).length<=0);++t)n=`contract-${u.getRandomInt(0,1e6)}`;return t.name&&(n+=`-${t.name.replace(/\s/g,"")}`),n}t.generateRandomContract=function(){const e=m(),t=p(),n=h(),a=d(n,t),i=new r.CodingContract(a,e,t);n.addContract(i)},t.generateRandomContractOnHome=function(){const e=m(),t=p(),n=i.Player.getHomeComputer(),a=d(n,t),o=new r.CodingContract(a,e,t);n.addContract(o)},t.generateContract=function(e){let t;const n=Object.keys(r.CodingContractTypes);t=null!=e.problemType&&n.includes(e.problemType)?e.problemType:m();const a=p();let i,l;null!=e.server?(null==(i=s.GetServerByHostname(e.server))&&(i=o.AllServers[e.server]),null==i&&(i=h())):i=h(),l=null!=e.fn?e.fn:d(i,a);let c=new r.CodingContract(l,t,a);i.addContract(c)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(145),a=n(269),i=n(19),o=n(268),s=n(118),l=n(25),c=n(96),u=n(47),m=n(6),p=n(74),h=n(13),d=n(173),_=n(28),g=n(36),y=n(16);class f extends a.Person{constructor(e=null){super(),this.className="",this.crimeType="",this.currentTask=r.SleeveTaskType.Idle,this.currentTaskLocation="",this.currentTaskMaxTime=0,this.currentTaskTime=0,this.earningsForSleeves=a.createTaskTracker(),this.earningsForPlayer=a.createTaskTracker(),this.earningsForTask=a.createTaskTracker(),this.factionWorkType=d.FactionWorkType.None,this.gainRatesForTask=a.createTaskTracker(),this.gymStatType="",this.logs=[],this.memory=1,this.shock=1,this.storedCycles=0,this.sync=1,null!=e&&this.shockRecovery(e)}static fromJSON(e){return y.Generic_fromJSON(f,e.data)}commitCrime(e,t){const n=s.Crimes[t];return n instanceof o.Crime&&(this.currentTask!==r.SleeveTaskType.Idle?this.finishTask(e):this.resetTaskStatus(),this.gainRatesForTask.hack=n.hacking_exp*this.hacking_exp_mult*i.BitNodeMultipliers.CrimeExpGain,this.gainRatesForTask.str=n.strength_exp*this.strength_exp_mult*i.BitNodeMultipliers.CrimeExpGain,this.gainRatesForTask.def=n.defense_exp*this.defense_exp_mult*i.BitNodeMultipliers.CrimeExpGain,this.gainRatesForTask.dex=n.dexterity_exp*this.dexterity_exp_mult*i.BitNodeMultipliers.CrimeExpGain,this.gainRatesForTask.agi=n.agility_exp*this.agility_exp_mult*i.BitNodeMultipliers.CrimeExpGain,this.gainRatesForTask.cha=n.charisma_exp*this.charisma_exp_mult*i.BitNodeMultipliers.CrimeExpGain,this.gainRatesForTask.money=n.money*this.crime_money_mult*i.BitNodeMultipliers.CrimeMoney,this.currentTaskLocation=String(this.gainRatesForTask.money),this.crimeType=t,this.currentTaskMaxTime=n.time,this.currentTask=r.SleeveTaskType.Crime,!0)}finishTask(e){let t=a.createTaskTracker();if(this.currentTask===r.SleeveTaskType.Crime&&this.currentTaskTime>=this.currentTaskMaxTime){const n=s.Crimes[this.crimeType];if(!(n instanceof o.Crime))return console.error(`Invalid data stored in sleeve.crimeType: ${this.crimeType}`),this.resetTaskStatus(),t;if(Math.random()<n.successRate(this)){const r=a.createTaskTracker(),i=Object.keys(r);for(let e=0;e<i.length;++e){const t=i[e];r[t]=2*this.gainRatesForTask[t]}t=this.gainExperience(e,r),this.gainMoney(e,this.gainRatesForTask),e.karma-=n.karma*(this.sync/100)}else t=this.gainExperience(e,this.gainRatesForTask);return this.currentTaskTime=0,t}return this.resetTaskStatus(),t}gainExperience(e,t,n=1,r=!1){if(r)return t.hack>0&&(this.hacking_exp+=t.hack),t.str>0&&(this.strength_exp+=t.str),t.def>0&&(this.defense_exp+=t.def),t.dex>0&&(this.dexterity_exp+=t.dex),t.agi>0&&(this.agility_exp+=t.agi),t.cha>0&&(this.charisma_exp+=t.cha),a.createTaskTracker();const i=this.shock/100*(this.sync/100)*n,o=t.hack*i,s=t.str*i,l=t.def*i,c=t.dex*i,u=t.agi*i,m=t.cha*i;return o>0&&(this.hacking_exp+=o,e.gainHackingExp(o),this.earningsForPlayer.hack+=o,this.earningsForTask.hack+=o),s>0&&(this.strength_exp+=s,e.gainStrengthExp(s),this.earningsForPlayer.str+=s,this.earningsForTask.str+=s),l>0&&(this.defense_exp+=l,e.gainDefenseExp(l),this.earningsForPlayer.def+=l,this.earningsForTask.def+=l),c>0&&(this.dexterity_exp+=c,e.gainDexterityExp(c),this.earningsForPlayer.dex+=c,this.earningsForTask.dex+=c),u>0&&(this.agility_exp+=u,e.gainAgilityExp(u),this.earningsForPlayer.agi+=u,this.earningsForTask.agi+=u),m>0&&(this.charisma_exp+=m,e.gainCharismaExp(m),this.earningsForPlayer.cha+=m,this.earningsForTask.cha+=m),this.earningsForSleeves.hack+=o*(this.sync/100),this.earningsForSleeves.str+=s*(this.sync/100),this.earningsForSleeves.def+=l*(this.sync/100),this.earningsForSleeves.dex+=c*(this.sync/100),this.earningsForSleeves.agi+=u*(this.sync/100),this.earningsForSleeves.cha+=m*(this.sync/100),{hack:o*(this.sync/100),str:s*(this.sync/100),def:l*(this.sync/100),dex:c*(this.sync/100),agi:u*(this.sync/100),cha:m*(this.sync/100),money:0}}gainMoney(e,t,n=1){const r=t.money*n;this.earningsForTask.money+=r,this.earningsForPlayer.money+=r,e.gainMoney(r)}getMemoryUpgradeCost(e){const t=Math.round(e);if(t<0)return 0;if(this.memory+t>100)return this.getMemoryUpgradeCost(100-this.memory);let n=0,r=this.memory-1;for(let t=0;t<e;++t)n+=Math.pow(1.02,r),++r;return 1e12*n}getRepGain(e){if(this.currentTask!==r.SleeveTaskType.Faction){if(this.currentTask===r.SleeveTaskType.Company){const t=this.currentTaskLocation,n=l.Companies[t];if(null==n)return console.error(`Invalid company found when trying to calculate rep gain: ${t}`),0;const r=u.CompanyPositions[e.jobs[t]];if(null==r)return console.error(`Invalid company position name found when trying to calculate rep gain: ${e.jobs[t]}`),0;const a=r.calculateJobPerformance(this.hacking_skill,this.strength,this.defense,this.dexterity,this.agility,this.charisma),i=1+n.favor/100;return a*this.company_rep_mult*i}return console.warn(`Sleeve.getRepGain() called for invalid task type: ${this.currentTask}`),0}{let e=1;const t=h.Factions[this.currentTaskLocation];switch(null!=t&&(e=1+t.favor/100),this.factionWorkType){case d.FactionWorkType.Hacking:return this.getFactionHackingWorkRepGain()*(this.shock/100)*e;case d.FactionWorkType.Field:return this.getFactionFieldWorkRepGain()*(this.shock/100)*e;case d.FactionWorkType.Security:return this.getFactionSecurityWorkRepGain()*(this.shock/100)*e;default:return console.warn(`Invalid Sleeve.factionWorkType property in Sleeve.getRepGain(): ${this.factionWorkType}`),0}}}installAugmentation(e){this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.applyAugmentation(e),this.augmentations.push({name:e.name,level:1}),this.updateStatLevels()}log(e){this.logs.push(e),this.logs.length>50&&this.logs.shift()}prestige(e){this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.resetTaskStatus(),this.earningsForSleeves=a.createTaskTracker(),this.earningsForPlayer=a.createTaskTracker(),this.shockRecovery(e),this.augmentations=[],this.resetMultipliers(),this.shock=1,this.storedCycles=0,this.sync=Math.max(this.memory,1),this.logs=[]}process(e,t=1){const n=1e3/m.CONSTANTS.MilliPerCycle;if(this.storedCycles+=t,this.storedCycles<n)return null;let i=this.storedCycles*m.CONSTANTS.MilliPerCycle,o=this.storedCycles;0!==this.currentTaskMaxTime&&this.currentTaskTime+i>this.currentTaskMaxTime&&(i=this.currentTaskMaxTime-this.currentTaskTime,o=Math.floor(i/m.CONSTANTS.MilliPerCycle),(i<0||o<0)&&(console.warn("Sleeve.process() calculated negative cycle usage"),i=0,o=0)),this.currentTaskTime+=i,this.shock=Math.min(100,this.shock+1e-4*this.storedCycles);let s=a.createTaskTracker();switch(this.currentTask){case r.SleeveTaskType.Idle:break;case r.SleeveTaskType.Class:case r.SleeveTaskType.Gym:this.updateTaskGainRates(e),s=this.gainExperience(e,this.gainRatesForTask,o),this.gainMoney(e,this.gainRatesForTask,o);break;case r.SleeveTaskType.Faction:s=this.gainExperience(e,this.gainRatesForTask,o),this.gainMoney(e,this.gainRatesForTask,o);const t=h.Factions[this.currentTaskLocation];if(!(t instanceof p.Faction)){console.error(`Invalid faction for Sleeve task: ${this.currentTaskLocation}`);break}t.playerReputation+=this.getRepGain(e)*o;break;case r.SleeveTaskType.Company:s=this.gainExperience(e,this.gainRatesForTask,o),this.gainMoney(e,this.gainRatesForTask,o);const n=l.Companies[this.currentTaskLocation];if(!(n instanceof c.Company)){console.error(`Invalid company for Sleeve task: ${this.currentTaskLocation}`);break}n.playerReputation+=this.getRepGain(e)*o;break;case r.SleeveTaskType.Recovery:this.shock=Math.min(100,this.shock+2e-4*o);break;case r.SleeveTaskType.Sync:this.sync=Math.min(100,this.sync+2e-4*e.getIntelligenceBonus(.5)*o)}return 0!==this.currentTaskMaxTime&&this.currentTaskTime>=this.currentTaskMaxTime&&(this.currentTask===r.SleeveTaskType.Crime?s=this.finishTask(e):this.finishTask(e)),this.updateStatLevels(),this.storedCycles-=o,s}resetTaskStatus(){this.earningsForTask=a.createTaskTracker(),this.gainRatesForTask=a.createTaskTracker(),this.currentTask=r.SleeveTaskType.Idle,this.currentTaskTime=0,this.currentTaskMaxTime=0,this.factionWorkType=d.FactionWorkType.None,this.crimeType="",this.currentTaskLocation="",this.gymStatType="",this.className=""}shockRecovery(e){return this.currentTask!==r.SleeveTaskType.Idle?this.finishTask(e):this.resetTaskStatus(),this.currentTask=r.SleeveTaskType.Recovery,!0}synchronize(e){return this.currentTask!==r.SleeveTaskType.Idle?this.finishTask(e):this.resetTaskStatus(),this.currentTask=r.SleeveTaskType.Sync,!0}takeUniversityCourse(e,t,n){this.currentTask!==r.SleeveTaskType.Idle?this.finishTask(e):this.resetTaskStatus();let a=1;switch(t.toLowerCase()){case g.LocationName.AevumSummitUniversity.toLowerCase():if(this.city!==_.CityName.Aevum)return!1;this.currentTaskLocation=g.LocationName.AevumSummitUniversity,a=4;break;case g.LocationName.Sector12RothmanUniversity.toLowerCase():if(this.city!==_.CityName.Sector12)return!1;this.currentTaskLocation=g.LocationName.Sector12RothmanUniversity,a=3;break;case g.LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():if(this.city!==_.CityName.Volhaven)return!1;this.currentTaskLocation=g.LocationName.VolhavenZBInstituteOfTechnology,a=5;break;default:return!1}switch(n.toLowerCase()){case"study computer science":break;case"data structures":this.gainRatesForTask.money=m.CONSTANTS.ClassDataStructuresBaseCost*a*-1;break;case"networks":this.gainRatesForTask.money=m.CONSTANTS.ClassNetworksBaseCost*a*-1;break;case"algorithms":this.gainRatesForTask.money=m.CONSTANTS.ClassAlgorithmsBaseCost*a*-1;break;case"management":this.gainRatesForTask.money=m.CONSTANTS.ClassManagementBaseCost*a*-1;break;case"leadership":this.gainRatesForTask.money=m.CONSTANTS.ClassLeadershipBaseCost*a*-1;break;default:return!1}return this.className=n,this.currentTask=r.SleeveTaskType.Class,!0}travel(e,t){return e.loseMoney(m.CONSTANTS.TravelCost),this.city=t,!0}tryBuyAugmentation(e,t){return!!e.canAfford(t.startingCost)&&(e.loseMoney(t.startingCost),this.installAugmentation(t),!0)}updateTaskGainRates(e){if(this.currentTask!==r.SleeveTaskType.Class)if(this.currentTask!==r.SleeveTaskType.Gym)console.warn(`Sleeve.updateTaskGainRates() called for unexpected task type ${this.currentTask}`);else{let t=1;switch(this.currentTaskLocation.toLowerCase()){case g.LocationName.AevumCrushFitnessGym.toLowerCase():t=2;break;case g.LocationName.AevumSnapFitnessGym.toLowerCase():t=5;break;case g.LocationName.Sector12IronGym.toLowerCase():t=1;break;case g.LocationName.Sector12PowerhouseGym.toLowerCase():t=10;break;case g.LocationName.VolhavenMilleniumFitnessGym:t=4;break;default:return}const n=1,r=e.hashManager.getTrainingMult()*t,a=this.gymStatType.toLowerCase();a.includes("str")?this.gainRatesForTask.str=n*r*this.strength_exp_mult:a.includes("def")?this.gainRatesForTask.def=n*r*this.defense_exp_mult:a.includes("dex")?this.gainRatesForTask.dex=n*r*this.dexterity_exp_mult:a.includes("agi")&&(this.gainRatesForTask.agi=n*r*this.agility_exp_mult)}else{let t=1;switch(this.currentTaskLocation.toLowerCase()){case g.LocationName.AevumSummitUniversity.toLowerCase():t=3;break;case g.LocationName.Sector12RothmanUniversity.toLowerCase():t=2;break;case g.LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():t=4;break;default:return}const n=t*e.hashManager.getStudyMult();switch(this.className.toLowerCase()){case"study computer science":this.gainRatesForTask.hack=m.CONSTANTS.ClassStudyComputerScienceBaseExp*n*this.hacking_exp_mult;break;case"data structures":this.gainRatesForTask.hack=m.CONSTANTS.ClassDataStructuresBaseExp*n*this.hacking_exp_mult;break;case"networks":this.gainRatesForTask.hack=m.CONSTANTS.ClassNetworksBaseExp*n*this.hacking_exp_mult;break;case"algorithms":this.gainRatesForTask.hack=m.CONSTANTS.ClassAlgorithmsBaseExp*n*this.hacking_exp_mult;break;case"management":this.gainRatesForTask.cha=m.CONSTANTS.ClassManagementBaseExp*n*this.charisma_exp_mult;break;case"leadership":this.gainRatesForTask.cha=m.CONSTANTS.ClassLeadershipBaseExp*n*this.charisma_exp_mult}}}upgradeMemory(e){e<0?console.warn(`Sleeve.upgradeMemory() called with negative value: ${e}`):this.memory=Math.min(100,Math.round(this.memory+e))}workForCompany(e,t){if(!(l.Companies[t]instanceof c.Company)||null==e.jobs[t])return!1;this.currentTask!==r.SleeveTaskType.Idle?this.finishTask(e):this.resetTaskStatus();const n=l.Companies[t],a=u.CompanyPositions[e.jobs[t]];return null!=n&&(null!=a&&(this.gainRatesForTask.money=a.baseSalary*n.salaryMultiplier*this.work_money_mult*i.BitNodeMultipliers.CompanyWorkMoney,this.gainRatesForTask.hack=a.hackingExpGain*n.expMultiplier*this.hacking_exp_mult*i.BitNodeMultipliers.CompanyWorkExpGain,this.gainRatesForTask.str=a.strengthExpGain*n.expMultiplier*this.strength_exp_mult*i.BitNodeMultipliers.CompanyWorkExpGain,this.gainRatesForTask.def=a.defenseExpGain*n.expMultiplier*this.defense_exp_mult*i.BitNodeMultipliers.CompanyWorkExpGain,this.gainRatesForTask.dex=a.dexterityExpGain*n.expMultiplier*this.dexterity_exp_mult*i.BitNodeMultipliers.CompanyWorkExpGain,this.gainRatesForTask.agi=a.agilityExpGain*n.expMultiplier*this.agility_exp_mult*i.BitNodeMultipliers.CompanyWorkExpGain,this.gainRatesForTask.cha=a.charismaExpGain*n.expMultiplier*this.charisma_exp_mult*i.BitNodeMultipliers.CompanyWorkExpGain,this.currentTaskLocation=t,this.currentTask=r.SleeveTaskType.Company,this.currentTaskMaxTime=m.CONSTANTS.MillisecondsPer8Hours,!0))}workForFaction(e,t,n){if(""===t)return!1;if(!(h.Factions[t]instanceof p.Faction&&e.factions.includes(t)))return!1;this.currentTask!==r.SleeveTaskType.Idle?this.finishTask(e):this.resetTaskStatus();const a=h.Factions[t].getInfo(),o=n.toLowerCase();if(o.includes("hack")){if(!a.offerHackingWork)return!1;this.factionWorkType=d.FactionWorkType.Hacking,this.gainRatesForTask.hack=.15*this.hacking_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain}else if(o.includes("field")){if(!a.offerFieldWork)return!1;this.factionWorkType=d.FactionWorkType.Field,this.gainRatesForTask.hack=.1*this.hacking_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain,this.gainRatesForTask.str=.1*this.strength_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain,this.gainRatesForTask.def=.1*this.defense_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain,this.gainRatesForTask.dex=.1*this.dexterity_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain,this.gainRatesForTask.agi=.1*this.agility_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain,this.gainRatesForTask.cha=.1*this.charisma_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain}else{if(!o.includes("security"))return!1;if(!a.offerSecurityWork)return!1;this.factionWorkType=d.FactionWorkType.Security,this.gainRatesForTask.hack=.1*this.hacking_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain,this.gainRatesForTask.str=.15*this.strength_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain,this.gainRatesForTask.def=.15*this.defense_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain,this.gainRatesForTask.dex=.15*this.dexterity_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain,this.gainRatesForTask.agi=.15*this.agility_exp_mult*i.BitNodeMultipliers.FactionWorkExpGain}return this.currentTaskLocation=t,this.currentTask=r.SleeveTaskType.Faction,this.currentTaskMaxTime=m.CONSTANTS.MillisecondsPer20Hours,!0}workoutAtGym(e,t,n){this.currentTask!==r.SleeveTaskType.Idle?this.finishTask(e):this.resetTaskStatus();let a=1;switch(t.toLowerCase()){case g.LocationName.AevumCrushFitnessGym.toLowerCase():if(this.city!=_.CityName.Aevum)return!1;this.currentTaskLocation=g.LocationName.AevumCrushFitnessGym,a=3;break;case g.LocationName.AevumSnapFitnessGym.toLowerCase():if(this.city!=_.CityName.Aevum)return!1;this.currentTaskLocation=g.LocationName.AevumSnapFitnessGym,a=10;break;case g.LocationName.Sector12IronGym.toLowerCase():if(this.city!=_.CityName.Sector12)return!1;this.currentTaskLocation=g.LocationName.Sector12IronGym,a=1;break;case g.LocationName.Sector12PowerhouseGym.toLowerCase():if(this.city!=_.CityName.Sector12)return!1;this.currentTaskLocation=g.LocationName.Sector12PowerhouseGym,a=20;break;case g.LocationName.VolhavenMilleniumFitnessGym:if(this.city!=_.CityName.Volhaven)return!1;this.currentTaskLocation=g.LocationName.VolhavenMilleniumFitnessGym,a=7;break;default:return!1}const i=n.toLowerCase();return this.gainRatesForTask.money=m.CONSTANTS.ClassGymBaseCost*a*-1,!!(i.includes("str")||i.includes("def")||i.includes("dex")||i.includes("agi"))&&(this.gymStatType=n,this.currentTask=r.SleeveTaskType.Gym,!0)}toJSON(){return y.Generic_toJSON("Sleeve",this)}}t.Sleeve=f,y.Reviver.constructors.Sleeve=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(16);class a{constructor(){this.bladeburner=0,this.codingcontract=0,this.corporation=0,this.crime=0,this.gang=0,this.hacking=0,this.hacknetnode=0,this.hospitalization=0,this.infiltration=0,this.stock=0,this.total=0,this.work=0}static fromJSON(e){return r.Generic_fromJSON(a,e.data)}record(e,t){const n=t.toLowerCase();"number"==typeof this[n]?(this[n]+=e,this.total+=e):console.warn(`MoneySourceTracker.record() called with invalid source: ${t}`)}reset(){for(const e in this)"number"==typeof this[e]&&(this[e]=0)}toJSON(){return r.Generic_toJSON("MoneySourceTracker",this)}}t.MoneySourceTracker=a,r.Reviver.constructors.MoneySourceTracker=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(33),a=n(195),i=n(16);class o extends a.Action{constructor(e=null){super(e),this.reqdRank=100,this.teamCount=0,e&&e.reqdRank&&(this.reqdRank=e.reqdRank),e&&e.teamCount&&(this.teamCount=e.teamCount)}getTeamSuccessBonus(e){if(this.teamCount&&this.teamCount>0){return this.teamCount=Math.min(this.teamCount,e.teamSize),Math.pow(this.teamCount,.05)}return 1}getActionTypeSkillSuccessBonus(e){return e.skillMultipliers.successChanceOperation}getChaosDifficultyBonus(e,t){const n=e.getCurrentCity();if(n.chaos>r.BladeburnerConstants.ChaosThreshold){let e=n.chaos-r.BladeburnerConstants.ChaosThreshold+1;return Math.pow(e,.1)}return 1}static fromJSON(e){return i.Generic_fromJSON(o,e.data)}toJSON(){return i.Generic_toJSON("Operation",this)}}t.Operation=o,i.Reviver.constructors.Operation=o},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var r=n(177),a=(n(657),n(655),n(653),n(651),n(649),n(647),n(645),n(643),n(641),n(639),n(637),n(635),n(633),n(631),n(629),n(627),n(625),n(623),n(621),n(619),n(617),n(615),n(613),n(611),n(609),n(607),n(605),n(603),n(601),n(599),n(597),n(595),n(593),n(591),n(589),n(587),n(585),n(583),n(581),n(579),n(577),n(575),n(573),n(571),n(569),n(567),n(565),n(563),n(561),n(559),n(557),n(555),n(553),n(551),n(549),n(547),n(41)),i=n.n(a),o=(n(545),n(544),n(543),n(542),n(541),n(540),n(539),n(265),n(537),n(203),n(264),n(536),n(535),n(533),n(532),n(531),n(530),n(529),n(528),n(526),n(525),n(523),n(520),n(501),n(107)),s=n(51),l=n(17),c=n(29),u=n(3),m=n(58),p=(n(94),n(44));window.JSHINT=n(519).JSHINT;const h=20;const d=new class extends r.a{constructor(){super(),this.vimCommandDisplay=null,this.vimCommandDisplayWrapper=null,this.tabsStyleElement=null}init(e){if(null!=this.editor)return console.error("CodeMirrorEditor.init() called when it's already initialized"),!1;if(!function(e){return null!=e.saveAndCloseFn&&null!=e.quitFn}(e))return console.error("'params' argument passed into CodeMirrorEditor.init() does not have proper properties"),!1;if(this.filenameInput=document.getElementById("script-editor-filename"),null==this.filenameInput)return console.error("Could not get Script Editor filename element (id=script-editor-filename)"),!1;const t=document.createElement("style");t.setAttribute("data-name","js-show-invisibles");let n="",r="";for(let e=1;e<=h;++e)n+=".CodeMirror .cm-whitespace-"+e+'::before { content: "'+(r+="·")+'";}\n';t.textContent=n,document.head.appendChild(t),this.tabsStyleElement=document.createElement("style"),document.head.appendChild(this.tabsStyleElement),this.vimCommandDisplay=document.getElementById("codemirror-vim-command-display"),this.vimCommandDisplayWrapper=document.getElementById("codemirror-vim-command-display-wrapper"),i.a.commands.save=function(){e.saveAndCloseFn()};const a=[];var s=Object(o.a)(null);for(let e in s)if(s.hasOwnProperty(e)&&(a.push(e),["bladeburner","hacknet","codingcontract","gang","sleeve"].includes(e))){let t=s[e];if("object"!=typeof t)continue;let n=Object.keys(t);for(let e=0;e<n.length;++e)a.push(n[e])}i.a.hint.netscript=function(e){const t=i.a.hint.javascript(e)||{from:e.getCursor(),to:e.getCursor(),list:[]};t.list.push(...a);let n=t.list||[],r=e.getCursor(),o=e.getLine(r.line),s=r.ch,l=s;for(;l<o.length&&/[\w$]+/.test(o.charAt(l));)++l;for(;s&&/[\w$]+/.test(o.charAt(s-1));)--s;let c=s!=l&&o.slice(s,l),u=new RegExp("^"+c,"i");return{list:(c?n.filter(function(e){return e.match(u)}):n).sort(),from:i.a.Pos(r.line,s),to:i.a.Pos(r.line,l)}};var l=i.a.Vim;l.defineEx("write","w",function(t,n){e.saveAndCloseFn()}),l.defineEx("quit","q",function(t,n){e.quitFn()}),l.defineEx("xwritequit","x",function(t,n){e.saveAndCloseFn()}),l.defineEx("wqwritequit","wq",function(t,n){e.saveAndCloseFn()})}initialized(){return null!=this.filenameInput}create(){function e(e,t=""){const n=document.getElementById(e);if(null==n)throw new Error(`Could not find ${t} DOM element(id=${e})`);return n}function t(e,t=""){const n=Object(c.clearEventListeners)(e);if(null==n)throw new Error(`Could not find ${t} DOM element(id=${e})`);return n}try{if(!this.initialized())return void console.warn("CodeMirrorEditor.create() called when editor was not initialized");Object.values(s.CodeMirrorKeybindingSetting).includes(l.Settings.EditorKeybinding)||(l.Settings.EditorKeybinding=s.CodeMirrorKeybindingSetting.Default);const o=e("codemirror-editor","CodeMirror Textarea");e("codemirror-form-wrapper","CodeMirror Form Wrapper").style.display="block",this.editor=i.a.fromTextArea(o,{autofocus:!0,extraKeys:{"Ctrl-Space":"autocomplete"},foldGutter:!0,gutters:["CodeMirror-lint-markers","CodeMirror-linenumbers","CodeMirror-foldgutter"],highlightSelectionMatches:!0,hintOptions:{hint:i.a.hint.netscript},indentUnit:4,keyMap:"default",lineNumbers:!0,matchBrackets:!0,maxInvisibles:32,mode:"netscript",theme:l.Settings.EditorTheme});const c=t("script-editor-option-theme","Theme Selector");Object(p.removeChildrenFromElement)(c);const d=Object.keys(s.CodeMirrorThemeSetting);for(let e=0;e<d.length;++e){const t=d[e],n=s.CodeMirrorThemeSetting[t];c.add(Object(m.createOptionElement)(t,n))}if(l.Settings.EditorTheme){for(var n=0,r=0;r<c.options.length;++r)if(c.options[r].value===l.Settings.EditorTheme){n=r;break}c.selectedIndex=n}else c.selectedIndex=0;c.onchange=(()=>{const e=c.value;l.Settings.EditorTheme=e,this.editor.setOption("theme",e)}),c.onchange();const _=t("script-editor-option-keybinding","Keymap Selector");if(null==_)return console.error('Could not find Script Editor\'s keybinding selector element (id="script-editor-option-keybinding")'),!1;if(Object(p.removeChildrenFromElement)(_),_.add(Object(m.createOptionElement)("Default",s.CodeMirrorKeybindingSetting.Default)),_.add(Object(m.createOptionElement)("Sublime",s.CodeMirrorKeybindingSetting.Sublime)),_.add(Object(m.createOptionElement)("Vim",s.CodeMirrorKeybindingSetting.Vim)),_.add(Object(m.createOptionElement)("Emacs",s.CodeMirrorKeybindingSetting.Emacs)),l.Settings.EditorKeybinding){for(n=0,r=0;r<_.options.length;++r)if(_.options[r].value===l.Settings.EditorKeybinding){n=r;break}_.selectedIndex=n}else _.selectedIndex=0;_.onchange=(()=>{this.vimCommandDisplayWrapper.style.display="none";const e=_.value;l.Settings.EditorKeybinding=e,this.editor.removeKeyMap(i.a.keyMap.default),this.editor.removeKeyMap(i.a.keyMap.sublime),this.editor.removeKeyMap(i.a.keyMap.emacs),this.editor.removeKeyMap(i.a.keyMap.vim);let t="";const n=e=>{t+=e,this.vimCommandDisplay.innerHTML=t},r=e=>{t="",this.vimCommandDisplay.innerHTML=t};e===s.CodeMirrorKeybindingSetting.Vim?(this.vimCommandDisplayWrapper.style.display="block",this.editor.on("vim-keypress",n),this.editor.on("vim-command-done",r)):(this.vimCommandDisplayWrapper.style.display="none",this.editor.off("vim-keypress",n),this.editor.off("vim-command-done",r)),this.editor.addKeyMap(e),this.editor.setOption("keyMap",e)}),_.onchange();const g=t("script-editor-option-highlightactiveline","Active Line Checkbox");g.onchange=(()=>{this.editor.setOption("styleActiveLine",g.checked)}),g.onchange();const y=t("script-editor-option-showinvisibles","Show Invisible Checkbox");y.onchange=(()=>{const e={name:"invisibles",token:function(e){var t,n=0,r=" "===e.peek();if(r){for(;r&&n<h;)++n,e.next(),r=" "===e.peek();t="whitespace whitespace-"+n}else{for(;!e.eol()&&!r;)e.next(),r=" "===e.peek();t="cm-eol"}return t}};y.checked?(this.editor.addOverlay(e),this.tabsStyleElement.innerHTML=".cm-tab {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABDSURBVEhLYxgFo2BkAGYH/9r/QFoAxIGyhx6AORzZA4xD1TcHNjYzQplDB2CLgaECYHkADIZqqgGBoZdsRsHgBgwMAB8iFHF42AERAAAAAElFTkSuQmCC);background-position: right;background-repeat: no-repeat;}"):(this.editor.removeOverlay("invisibles"),this.tabsStyleElement.innerHTML="")}),y.onchange();const f=t("script-editor-option-usesofttab","Soft Tab Checkbox");function a(t){const n=e(t);return Object(p.removeChildrenFromElement)(n),n.style.display="block",n}f.onchange=(()=>{this.editor.setOption("indentWithTabs",!f.checked),f.checked?this.editor.addKeyMap({name:"soft-tabs-keymap",Tab:function(e){if(e.somethingSelected()){var t=e.getSelection("\n");if(t.length>0&&(t.indexOf("\n")>-1||t.length===e.getLine(e.getCursor().line).length))return void e.indentSelection("add")}e.options.indentWithTabs?e.execCommand("insertTab"):e.execCommand("insertSoftTab")},"Shift-Tab":function(e){e.indentSelection("subtract")}}):this.editor.removeKeyMap("soft-tabs-keymap")}),f.onchange();const b=a("script-editor-option-flex1-fieldset"),E="script-editor-option-flex1";b.appendChild(Object(u.createElement)("label",{for:E,innerText:"Auto-Close Brackets/Quotes"}));const v=Object(u.createElement)("input",{checked:!0,id:E,name:E,type:"checkbox"});b.appendChild(v),v.onchange=(()=>{this.editor.setOption("autoCloseBrackets",v.checked)}),v.onchange();const k=a("script-editor-option-flex2-fieldset"),C="script-editor-option-flex2";k.appendChild(Object(u.createElement)("label",{for:C,innerText:"Enable Linting"}));const T=Object(u.createElement)("input",{checked:!0,id:C,name:C,type:"checkbox"});k.appendChild(T),T.onchange=(()=>{T.checked?this.editor.setOption("lint",i.a.lint.netscript):this.editor.setOption("lint",!1)}),T.onchange();const P=a("script-editor-option-flex3-fieldset"),S="script-editor-option-flex3";P.appendChild(Object(u.createElement)("label",{for:S,innerText:"Continue Comments"}));const O=Object(u.createElement)("input",{checked:!0,id:S,name:S,type:"checkbox"});P.appendChild(O),O.onchange=(()=>{this.editor.setOption("continueComments",O.checked)}),O.onchange(),function(e){const t=a(e);t.style.display="none"}("script-editor-option-flex4-fieldset"),this.editor.refresh()}catch(e){return console.error(`Exception caught: ${e}. ${e.stack}`),!1}}isFocused(){return null!=this.editor&&this.editor.hasFocus()}setInvisible(){if(!this.initialized())return void console.warn("CodeMirrorEditor.setInvisible() called when editor was not initialized");null!=this.editor&&(this.editor.toTextArea(),this.editor=null);const e=document.getElementById("codemirror-form-wrapper");e instanceof HTMLElement&&(e.style.display="none")}}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var r=n(177),a=n(107),i=n(17),o=n(51),s=n(29),l=n(3),c=n(58),u=(n(94),n(44));const m=n(671);n(670),n(669),n(668),n(667),n(666),n(665),n(664),n(663),n(662),n(661),n(660),n(659),n(658);const p={ace:null,vim:"ace/keyboard/vim",emacs:"ace/keyboard/emacs"};const h=new class extends r.a{constructor(){super(),this.vimCommandDisplayWrapper=null}init(e){if(null!=this.editor)return console.error("AceEditor.init() called when it's already initialized"),!1;if(!function(e){return null!=e.saveAndCloseFn&&null!=e.quitFn}(e))return console.error("'params' argument passed into initAceEditor() does not have proper properties"),!1;if(this.filenameInput=document.getElementById("script-editor-filename"),null==this.filenameInput)return console.error("Could not get Script Editor filename element (id=script-editor-filename)"),!1;this.editor=m.edit("ace-editor"),this.editor.getSession().setMode("ace/mode/netscript"),this.editor.setTheme("ace/theme/monokai");const t=document.getElementById("ace-editor");if(null==t)return!1;if(t.style.fontSize="16px",this.editor.setOption("showPrintMargin",!1),m.config.loadModule("ace/keyboard/vim",function(t){var n=t.CodeMirror.Vim;n.defineEx("write","w",function(t,n){e.saveAndCloseFn()}),n.defineEx("quit","q",function(t,n){e.quitFn()}),n.defineEx("xwritequit","x",function(t,n){e.saveAndCloseFn()}),n.defineEx("wqwritequit","wq",function(t,n){e.saveAndCloseFn()})}),this.vimCommandDisplayWrapper=document.getElementById("codemirror-vim-command-display-wrapper"),null==this.vimCommandDisplayWrapper)return console.error("Could not get Vim Command Display element (id=codemirror-vim-command-display-wrapper)"),!1;this.editor.setOption("enableBasicAutocompletion",!0);var n={getCompletions:function(e,t,n,r,i){if(0!==r.length){var o=[],s=Object(a.a)(null);for(let e in s)if(s.hasOwnProperty(e)&&(o.push({name:e,value:e}),["bladeburner","hacknet","codingcontract","gang","sleeve"].includes(e))){let t=s[e];if("object"!=typeof t)continue;let n=Object.keys(t);for(let e=0;e<n.length;++e)o.push({name:n[e],value:n[e]})}i(null,o)}else i(null,[])}};return this.editor.completers=[n],!0}initialized(){return null!=this.editor}create(){function e(e,t=""){const n=document.getElementById(e);if(null==n)throw new Error(`Could not find ${t} DOM element(id=${e})`);return n}function t(e,t=""){const n=Object(s.clearEventListeners)(e);if(null==n)throw new Error(`Could not find ${t} DOM element(id=${e})`);return n}try{e("script-editor-options-panel","Script Editor Options Panel");const s=document.getElementById("ace-editor");s instanceof HTMLElement&&(s.style.display="block"),this.vimCommandDisplayWrapper instanceof HTMLElement&&(this.vimCommandDisplayWrapper.style.display="none");const h=t("script-editor-option-theme","Theme Selector");if(Object(u.removeChildrenFromElement)(h),h.add(Object(c.createOptionElement)("Chaos")),h.add(Object(c.createOptionElement)("Chrome")),h.add(Object(c.createOptionElement)("Monokai")),h.add(Object(c.createOptionElement)("Solarized Dark","Solarized_Dark")),h.add(Object(c.createOptionElement)("Solarized Light","Solarized_Light")),h.add(Object(c.createOptionElement)("Terminal")),h.add(Object(c.createOptionElement)("Twilight")),h.add(Object(c.createOptionElement)("XCode")),i.Settings.EditorTheme){for(var n=2,r=0;r<h.options.length;++r)if(h.options[r].value===i.Settings.EditorTheme){n=r;break}h.selectedIndex=n}else h.selectedIndex=2;h.onchange=(()=>{const e=h.value;i.Settings.EditorTheme=e;const t="ace/theme/"+e.toLowerCase();this.editor.setTheme(t)}),h.onchange();const d=t("script-editor-option-keybinding","Keybinding Selector");if(Object(u.removeChildrenFromElement)(d),d.add(Object(c.createOptionElement)("Ace",o.AceKeybindingSetting.Ace)),d.add(Object(c.createOptionElement)("Vim",o.AceKeybindingSetting.Vim)),d.add(Object(c.createOptionElement)("Emacs",o.AceKeybindingSetting.Emacs)),i.Settings.EditorKeybinding){for(Object.values(o.AceKeybindingSetting).includes(i.Settings.EditorKeybinding)||(i.Settings.EditorKeybinding=o.AceKeybindingSetting.Ace),n=0,r=0;r<d.options.length;++r)if(d.options[r].value===i.Settings.EditorKeybinding){n=r;break}d.selectedIndex=n}else d.selectedIndex=0;d.onchange=(()=>{var e=d.value;i.Settings.EditorKeybinding=e,this.editor.setKeyboardHandler(p[e.toLowerCase()])}),d.onchange();const _=t("script-editor-option-highlightactiveline","Active Line Checkbox");_.onchange=(()=>{this.editor.setHighlightActiveLine(_.checked)});const g=t("script-editor-option-showinvisibles","Show Invisible Checkbox");g.onchange=(()=>{this.editor.setShowInvisibles(g.checked)});const y=t("script-editor-option-usesofttab","Soft Tab Checkbox");function a(t){const n=e(t);return Object(u.removeChildrenFromElement)(n),n.style.display="block",n}function m(e){const t=a(e);return t.style.display="none",t}y.onchange=(()=>{this.editor.getSession().setUseSoftTabs(y.checked)});const f=a("script-editor-option-flex1-fieldset"),b="script-editor-option-maxerr",E=Object(l.createElement)("em",{innerText:"200"});f.appendChild(Object(l.createElement)("label",{for:b,innerText:"Max Error Count"}));const v=Object(l.createElement)("input",{id:b,max:"1000",min:"50",name:b,step:"1",type:"range",value:"200",changeListener:()=>{this.editor.getSession().$worker.send("changeOptions",[{maxerr:v.value}]),E.innerText=v.value}});f.appendChild(v),f.appendChild(E),m("script-editor-option-flex2-fieldset"),m("script-editor-option-flex3-fieldset"),m("script-editor-option-flex4-fieldset")}catch(e){return console.error(`Exception caught: ${e}`),!1}}isFocused(){return null!=this.editor&&this.editor.isFocused()}setInvisible(){const e=document.getElementById("ace-editor");e instanceof HTMLElement&&(e.style.display="none")}}},,,function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.UndocumentedFunctionCall="UndocumentedFunctionCall",e.Unclickable="Unclickable",e.PrototypeTampering="PrototypeTampering",e.EditSaveFile="EditSaveFile"}(r=t.Exploit||(t.Exploit={}));const a={UndocumentedFunctionCall:"by looking beyond the documentation.",EditSaveFile:"by editing your save file.",PrototypeTampering:"by tampering with Numbers prototype.",Unclickable:"by clicking the unclickable."};t.ExploitName=function(e){return a[e]},t.sanitizeExploits=function(e){return e.filter(e=>Object.keys(r).includes(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PlayerOwnedAugmentation=class{constructor(e=""){this.level=1,this.name="",this.name=e}}},function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return m});var r=n(35),a=n(81),i=n(8),o={ENABLE_BASH_HOTKEYS:"Improved Bash emulation mode. Setting this to 1 enables several\nnew Terminal shortcuts and features that more closely resemble\na real Bash-style shell. Note that when this mode is enabled,\nthe default browser shortcuts are overriden by the new Bash\nshortcuts.\n\nTo see a full list of the Terminal shortcuts that this enables, see:\nhttp://bitburner.readthedocs.io/en/latest/shortcuts.html",ENABLE_TIMESTAMPS:"Terminal commands and log entries will be timestamped. The timestamp\nwill have the format: M/D h:m",MAIN_MENU_STYLE:"Customize the main navigation menu on the left-hand side. Current options:\n\ndefault, classic, compact",THEME_BACKGROUND_COLOR:"Sets the background color for not only the Terminal, but also for\nmost of the game's UI.\n\nThe color must be specified as a pound sign (#) followed by a \n3-digit or 6-digit hex color code (e.g. #123456). Default color: #000000",THEME_FONT_COLOR:"Sets the font color for not only the Terminal, but also for\nmost of the game's UI.\n\nThe color must be specified as a pound sign (#) followed by a \n3-digit or 6-digit hex color code (e.g. #123456). Default color: #66ff33",THEME_HIGHLIGHT_COLOR:"Sets the highlight color for not only the Terminal, but also for \nmost of the game's UI.\n\nThe color must be specified as a pound sign (#) followed by a \n3-digit or 6-digit hex color code (e.g. #123456). Default color: #ffffff",THEME_PROMPT_COLOR:"Sets the prompt color in the Terminal\n\nThe color must be specified as a pound sign (#) followed by a \n3-digit or 6-digit hex color code (e.g. #123456). Default color: #f92672",WRAP_INPUT:"Wrap Terminal Input. If this is enabled, then when a Terminal command is\ntoo long and overflows, then it will wrap to the next line instead of\nside-scrolling\n\nNote that after you enable/disable this, you'll have to run a command\nbefore its effect takes place."};const s=["default","classic","compact"];function l(e){var t=Object(a.b)(e,{sourceType:"module"}),n=[];for(n.push(t);0!=n.length;){var r=n.shift();switch(r.type){case"BlockStatement":case"Program":for(var i=0;i<r.body.length;++i)r.body[i]instanceof a.a&&n.push(r.body[i]);break;case"AssignmentExpression":var o;if(null==r.left||null==r.left.name)break;if(o=r.left.name,null==r.right||null==r.right.raw)break;c(o,r.right.raw)}for(var s in r)r.hasOwnProperty(s)&&r[s]instanceof a.a&&n.push(r[s])}p(),h()}function c(e,t){if(e=String(e),t=String(t),null!=e&&null!=t&&null!=r.FconfSettings[e])switch(e){case"ENABLE_BASH_HOTKEYS":case"ENABLE_TIMESTAMPS":case"WRAP_INPUT":t="1"===(t=t.toLowerCase())||"true"===t||"y"===t,r.FconfSettings[e]=t;break;case"MAIN_MENU_STYLE":t=n(t);s.includes(t)?r.FconfSettings[e]=t:Object(i.dialogBoxCreate)(`Invalid option specified for ${e}. Options: ${s.toString()}`);break;case"THEME_BACKGROUND_COLOR":case"THEME_FONT_COLOR":case"THEME_HIGHLIGHT_COLOR":case"THEME_PROMPT_COLOR":t=n(t);/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)?r.FconfSettings[e]=t:Object(i.dialogBoxCreate)(`Invalid color specified for ${e}. Must be a hex color code preceded by a pound (#)`)}else console.warn(`Invalid .fconf setting: ${e}`);function n(e){return(e=e.toLowerCase()).startsWith('"')&&(e=e.slice(1)),e.endsWith('"')&&(e=e.slice(0,-1)),e}}function u(){var e="";for(var t in r.FconfSettings)if(r.FconfSettings.hasOwnProperty(t)){if(null==(n=o[t]))continue;for(var n=n.split("\n"),a=0;a<n.length;++a)e+="//"+n[a]+"\n";e+=`${t} = ${!0===r.FconfSettings[t]?"1":!1===r.FconfSettings[t]?"0":'"'+String(r.FconfSettings[t])+'"'}\n\n`}return e}function m(e){let t=JSON.parse(e);for(var n in t)t.hasOwnProperty(n)&&(r.FconfSettings[n]=t[n]);p(),h()}function p(){null!=r.FconfSettings.THEME_HIGHLIGHT_COLOR&&null!=r.FconfSettings.THEME_FONT_COLOR&&null!=r.FconfSettings.THEME_BACKGROUND_COLOR&&null!=r.FconfSettings.THEME_PROMPT_COLOR?/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(r.FconfSettings.THEME_HIGHLIGHT_COLOR)&&/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(r.FconfSettings.THEME_FONT_COLOR)&&/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(r.FconfSettings.THEME_BACKGROUND_COLOR)&&/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(r.FconfSettings.THEME_PROMPT_COLOR)&&(document.body.style.setProperty("--my-highlight-color",r.FconfSettings.THEME_HIGHLIGHT_COLOR),document.body.style.setProperty("--my-font-color",r.FconfSettings.THEME_FONT_COLOR),document.body.style.setProperty("--my-background-color",r.FconfSettings.THEME_BACKGROUND_COLOR),document.body.style.setProperty("--my-prompt-color",r.FconfSettings.THEME_PROMPT_COLOR)):console.error("Cannot find Theme Settings")}function h(){const e=document.getElementById("mainmenu"),t=document.getElementById("hacking-menu-header"),n=document.getElementById("character-menu-header"),a=document.getElementById("world-menu-header"),i=document.getElementById("help-menu-header");function o(){t.classList.remove("mainmenu-accordion-header","mainmenu-accordion-header-classic"),n.classList.remove("mainmenu-accordion-header","mainmenu-accordion-header-classic"),a.classList.remove("mainmenu-accordion-header","mainmenu-accordion-header-classic"),i.classList.remove("mainmenu-accordion-header","mainmenu-accordion-header-classic")}function s(e){t.classList.add(e),n.classList.add(e),a.classList.add(e),i.classList.add(e)}if("default"===r.FconfSettings.MAIN_MENU_STYLE)o(),e.classList.remove("classic"),e.classList.remove("compact"),s("mainmenu-accordion-header");else if("classic"===r.FconfSettings.MAIN_MENU_STYLE)o(),e.classList.remove("compact"),e.classList.add("classic"),s("mainmenu-accordion-header-classic");else{if("compact"!==r.FconfSettings.MAIN_MENU_STYLE)return;o(),e.classList.remove("classic"),e.classList.add("compact"),s("mainmenu-accordion-header-compact")}t.click(),t.click(),n.click(),n.click(),a.click(),a.click(),i.click(),i.click()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(21),a=n(97),i=n(698),o=n(697),s=n(16),l=n(15);class c{constructor(e={}){this.name="",this.dmd=0,this.cmp=0,this.mku=0,this.pCost=0,this.sCost=0,this.fin=!1,this.prog=0,this.createCity="",this.designCost=0,this.advCost=0,this.rat=0,this.qlt=0,this.per=0,this.dur=0,this.rel=0,this.aes=0,this.fea=0,this.data=o.createCityMap([0,0,0]),this.loc="",this.siz=0,this.reqMats={},this.prdman=o.createCityMap([!1,0]),this.sllman=o.createCityMap([!1,0]),this.marketTa1=!1,this.marketTa2=!1,this.marketTa2Price=o.createCityMap(0),this.name=e.name?e.name:"",this.dmd=e.demand?e.demand:0,this.cmp=e.competition?e.competition:0,this.mku=e.markup?e.markup:0,this.createCity=e.createCity?e.createCity:"",this.designCost=e.designCost?e.designCost:0,this.advCost=e.advCost?e.advCost:0,this.qlt=e.quality?e.quality:0,this.per=e.performance?e.performance:0,this.dur=e.durability?e.durability:0,this.rel=e.reliability?e.reliability:0,this.aes=e.aesthetics?e.aesthetics:0,this.fea=e.features?e.features:0,this.loc=e.loc?e.loc:"",this.siz=e.size?e.size:0,this.reqMats=e.req?e.req:{}}static fromJSON(e){return s.Generic_fromJSON(c,e.data)}createProduct(e=1,t=1){this.fin||(this.prog+=.01*e*t)}finishProduct(e,t){this.fin=!0;var n=this.prog/100;const i=e[r.EmployeePositions.Engineer]/e.total,o=e[r.EmployeePositions.Management]/e.total,s=e[r.EmployeePositions.RandD]/e.total,c=e[r.EmployeePositions.Operations]/e.total,u=e[r.EmployeePositions.Business]/e.total;var m=n*(1.2*i+.9*o+1.3*s+1.5*c+u)*(1+Math.pow(this.designCost,.1)/100)*(1+Math.pow(t.sciResearch.qty,t.sciFac)/800);this.qlt=m*(.1*e[r.EmployeePositions.Engineer]+.05*e[r.EmployeePositions.Management]+.05*e[r.EmployeePositions.RandD]+.02*e[r.EmployeePositions.Operations]+.02*e[r.EmployeePositions.Business]),this.per=m*(.15*e[r.EmployeePositions.Engineer]+.02*e[r.EmployeePositions.Management]+.02*e[r.EmployeePositions.RandD]+.02*e[r.EmployeePositions.Operations]+.02*e[r.EmployeePositions.Business]),this.dur=m*(.05*e[r.EmployeePositions.Engineer]+.02*e[r.EmployeePositions.Management]+.08*e[r.EmployeePositions.RandD]+.05*e[r.EmployeePositions.Operations]+.05*e[r.EmployeePositions.Business]),this.rel=m*(.02*e[r.EmployeePositions.Engineer]+.08*e[r.EmployeePositions.Management]+.02*e[r.EmployeePositions.RandD]+.05*e[r.EmployeePositions.Operations]+.08*e[r.EmployeePositions.Business]),this.aes=m*(0*e[r.EmployeePositions.Engineer]+.08*e[r.EmployeePositions.Management]+.05*e[r.EmployeePositions.RandD]+.02*e[r.EmployeePositions.Operations]+.1*e[r.EmployeePositions.Business]),this.fea=m*(.08*e[r.EmployeePositions.Engineer]+.05*e[r.EmployeePositions.Management]+.02*e[r.EmployeePositions.RandD]+.05*e[r.EmployeePositions.Operations]+.05*e[r.EmployeePositions.Business]),this.calculateRating(t);var p=1+Math.pow(this.advCost,.1)/100;for(var h in this.mku=100/(p*Math.pow(this.qlt+.001,.65)*(u+o)),this.dmd=0===t.awareness?20:Math.min(100,p*(t.popularity/t.awareness*100)),this.cmp=l.getRandomInt(0,70),t.reqMats)t.reqMats.hasOwnProperty(h)&&(this.reqMats[h]=t.reqMats[h]);for(var h in this.siz=0,t.reqMats)this.siz+=a.MaterialSizes[h]*t.reqMats[h];delete this.prog,delete this.createCity,delete this.designCost,delete this.advCost}calculateRating(e){const t=i.ProductRatingWeights[e.type];null!=t?(this.rat=0,this.rat+=t.Quality?this.qlt*t.Quality:0,this.rat+=t.Performance?this.per*t.Performance:0,this.rat+=t.Durability?this.dur*t.Durability:0,this.rat+=t.Reliability?this.rel*t.Reliability:0,this.rat+=t.Aesthetics?this.aes*t.Aesthetics:0,this.rat+=t.Features?this.fea*t.Features:0):console.error(`Could not find product rating weights for: ${e}`)}toJSON(){return s.Generic_toJSON("Product",this)}}t.Product=c,s.Reviver.constructors.Product=c},function(e,t,n){"use strict";(function(e){n.d(t,"b",function(){return i}),n.d(t,"a",function(){return a}),e(document).click(function(t){r&&null==e(t.target).closest(".game-options-box").get(0)&&a()});var r=!1;function a(){r=!1,document.getElementById("game-options-container").style.display="none"}function i(){document.getElementById("game-options-container").style.display="flex",setTimeout(function(){r=!0},500)}document.addEventListener("DOMContentLoaded",function(){document.getElementById("options-menu-link").addEventListener("click",function(){return i(),!1}),document.getElementById("game-options-close-button").addEventListener("click",function(){return a(),!1})},!1)}).call(this,n(86))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(33),a=n(15),i=n(16),o=n(88);class s{constructor(){this.estChange=0,this.estOffset=0}}t.ChangePopulationByCountParams=s;class l{constructor(){this.nonZero=!1,this.changeEstEqually=!1}}t.ChangePopulationByPercentageParams=l;class c{constructor(e=r.BladeburnerConstants.CityNames[2]){this.name="",this.pop=0,this.popEst=0,this.comms=0,this.commsEst=0,this.chaos=0,this.name=e,this.pop=a.getRandomInt(r.BladeburnerConstants.PopulationThreshold,1.5*r.BladeburnerConstants.PopulationThreshold),this.popEst=this.pop*(Math.random()+.5),this.comms=a.getRandomInt(5,150),this.commsEst=this.comms+a.getRandomInt(-5,5),this.commsEst<0&&(this.commsEst=0),this.chaos=0}changeChaosByPercentage(e){if(isNaN(e))throw new Error("NaN passed into City.chaosChaosByPercentage()");0!==e&&(this.chaos+=this.chaos*(e/100),this.chaos<0&&(this.chaos=0))}improvePopulationEstimateByCount(e){if(isNaN(e))throw new Error("NaN passeed into City.improvePopulationEstimateByCount()");this.popEst<this.pop?(this.popEst+=e,this.popEst>this.pop&&(this.popEst=this.pop)):this.popEst>this.pop&&(this.popEst-=e,this.popEst<this.pop&&(this.popEst=this.pop))}improvePopulationEstimateByPercentage(e,t=1){if(e*=t,isNaN(e))throw new Error("NaN passed into City.improvePopulationEstimateByPercentage()");this.popEst<this.pop?(++this.popEst,this.popEst*=1+e/100,this.popEst>this.pop&&(this.popEst=this.pop)):this.popEst>this.pop&&(this.popEst*=1-e/100,this.popEst<this.pop&&(this.popEst=this.pop))}improveCommunityEstimate(e=1){if(isNaN(e))throw new Error("NaN passed into City.improveCommunityEstimate()");this.commsEst<this.comms?(this.commsEst+=e,this.commsEst>this.comms&&(this.commsEst=this.comms)):this.commsEst>this.comms&&(this.commsEst-=e,this.commsEst<this.comms&&(this.commsEst=this.comms))}changePopulationByCount(e,t=new s){if(isNaN(e))throw new Error("NaN passed into City.changePopulationByCount()");this.pop+=e,t.estChange&&!isNaN(t.estChange)&&(this.popEst+=t.estChange),t.estOffset&&(this.popEst=o.addOffset(this.popEst,t.estOffset)),this.popEst=Math.max(this.popEst,0)}changePopulationByPercentage(e,t=new l){if(isNaN(e))throw new Error("NaN passed into City.changePopulationByPercentage()");if(0===e)return 0;let n=Math.round(this.pop*(e/100));return t.nonZero&&0===n&&(n=e>0?1:-1),this.pop+=n,t.changeEstEqually&&(this.popEst+=n,this.popEst<0&&(this.popEst=0)),n}changeChaosByCount(e){if(isNaN(e))throw new Error("NaN passed into City.changeChaosByCount()");0!==e&&(this.chaos+=e,this.chaos<0&&(this.chaos=0))}static fromJSON(e){return i.Generic_fromJSON(c,e.data)}toJSON(){return i.Generic_toJSON("City",this)}}t.City=c,i.Reviver.constructors.City=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.Accordion=class extends r.Component{constructor(e){super(e),this.handleHeaderClick=this.handleHeaderClick.bind(this),this.state={panelOpened:!!e.panelInitiallyOpened}}handleHeaderClick(e){const t=e.currentTarget;t.classList.toggle("active");const n=t.nextElementSibling;t.classList.contains("active")?(n.style.display="block",this.setState({panelOpened:!0})):(n.style.display="none",this.setState({panelOpened:!1}))}render(){let e="accordion-header";return"string"==typeof this.props.headerClass&&(e=this.props.headerClass),r.createElement(r.Fragment,null,r.createElement("button",{className:e,onClick:this.handleHeaderClick},this.props.headerContent),r.createElement(a,{opened:this.state.panelOpened,panelClass:this.props.panelClass,panelContent:this.props.panelContent}))}};class a extends r.Component{shouldComponentUpdate(e){return this.props.opened||e.opened}render(){let e="accordion-panel";return"string"==typeof this.props.panelClass&&(e=this.props.panelClass),r.createElement("div",{className:e},this.props.panelContent)}}},,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6),a=n(53);t.CompanyPosition=class{constructor(e){this.name=e.name,this.nextPosition=e.nextPosition,this.baseSalary=e.baseSalary,this.repMultiplier=e.repMultiplier,this.requiredHacking=null!=e.reqdHacking?e.reqdHacking:0,this.requiredStrength=null!=e.reqdStrength?e.reqdStrength:0,this.requiredDefense=null!=e.reqdDefense?e.reqdDefense:0,this.requiredDexterity=null!=e.reqdDexterity?e.reqdDexterity:0,this.requiredAgility=null!=e.reqdAgility?e.reqdAgility:0,this.requiredCharisma=null!=e.reqdCharisma?e.reqdCharisma:0,this.requiredReputation=null!=e.reqdReputation?e.reqdReputation:0,this.hackingEffectiveness=null!=e.hackingEffectiveness?e.hackingEffectiveness:0,this.strengthEffectiveness=null!=e.strengthEffectiveness?e.strengthEffectiveness:0,this.defenseEffectiveness=null!=e.defenseEffectiveness?e.defenseEffectiveness:0,this.dexterityEffectiveness=null!=e.dexterityEffectiveness?e.dexterityEffectiveness:0,this.agilityEffectiveness=null!=e.agilityEffectiveness?e.agilityEffectiveness:0,this.charismaEffectiveness=null!=e.charismaEffectiveness?e.charismaEffectiveness:0,100!==Math.round(this.hackingEffectiveness+this.strengthEffectiveness+this.defenseEffectiveness+this.dexterityEffectiveness+this.agilityEffectiveness+this.charismaEffectiveness)&&console.error(`CompanyPosition ${this.name} parameters do not sum to 100`),this.hackingExpGain=null!=e.hackingExpGain?e.hackingExpGain:0,this.strengthExpGain=null!=e.strengthExpGain?e.strengthExpGain:0,this.defenseExpGain=null!=e.defenseExpGain?e.defenseExpGain:0,this.dexterityExpGain=null!=e.dexterityExpGain?e.dexterityExpGain:0,this.agilityExpGain=null!=e.agilityExpGain?e.agilityExpGain:0,this.charismaExpGain=null!=e.charismaExpGain?e.charismaExpGain:0}calculateJobPerformance(e,t,n,a,i,o){const s=this.hackingEffectiveness*e/r.CONSTANTS.MaxSkillLevel,l=this.strengthEffectiveness*t/r.CONSTANTS.MaxSkillLevel,c=this.defenseEffectiveness*n/r.CONSTANTS.MaxSkillLevel,u=this.dexterityEffectiveness*a/r.CONSTANTS.MaxSkillLevel,m=this.agilityEffectiveness*i/r.CONSTANTS.MaxSkillLevel,p=this.charismaEffectiveness*o/r.CONSTANTS.MaxSkillLevel;let h=this.repMultiplier*(s+l+c+u+m+p)/100;return isNaN(h)&&(console.error("Company reputation gain calculated to be NaN"),h=0),h}isSoftwareJob(){return a.SoftwareCompanyPositions.includes(this.name)}isITJob(){return a.ITCompanyPositions.includes(this.name)}isSecurityEngineerJob(){return a.SecurityEngineerCompanyPositions.includes(this.name)}isNetworkEngineerJob(){return a.NetworkEngineerCompanyPositions.includes(this.name)}isBusinessJob(){return a.BusinessCompanyPositions.includes(this.name)}isSecurityJob(){return a.SecurityCompanyPositions.includes(this.name)}isAgentJob(){return a.AgentCompanyPositions.includes(this.name)}isSoftwareConsultantJob(){return a.SoftwareConsultantCompanyPositions.includes(this.name)}isBusinessConsultantJob(){return a.BusinessConsultantCompanyPositions.includes(this.name)}isPartTimeJob(){return a.PartTimeCompanyPositions.includes(this.name)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(417);t.SourceFiles={},t.SourceFiles.SourceFile1=new r.SourceFile(1,"This Source-File lets the player start with 32GB of RAM on his/her home computer. It also increases all of the player's multipliers by:<br><br>Level 1: 16%<br>Level 2: 24%<br>Level 3: 28%"),t.SourceFiles.SourceFile2=new r.SourceFile(2,"This Source-File allows you to form gangs in other BitNodes once your karma decreases to a certain value. It also increases the player's crime success rate, crime money, and charisma multipliers by:<br><br>Level 1: 24%<br>Level 2: 36%<br>Level 3: 42%"),t.SourceFiles.SourceFile3=new r.SourceFile(3,"This Source-File lets you create corporations on other BitNodes (although some BitNodes will disable this mechanic). This Source-File also increases your charisma and company salary multipliers by:<br>Level 1: 8%<br>Level 2: 12%<br>Level 3: 14%"),t.SourceFiles.SourceFile4=new r.SourceFile(4,"This Source-File lets you access and use the Singularity Functions in every BitNode. Every level of this Source-File opens up more of the Singularity Functions you can use."),t.SourceFiles.SourceFile5=new r.SourceFile(5,"This Source-File grants a special new stat called Intelligence. Intelligence is unique because it is permanent and persistent (it never gets reset back to 1). However, gaining Intelligence experience is much slower than other stats, and it is also hidden (you won't know when you gain experience and how much). Higher Intelligence levels will boost your production for many actions in the game. In addition, this Source-File will unlock the getBitNodeMultipliers() Netscript function, and will raise all of your hacking-related multipliers by:<br><br> Level 1: 8%<br>Level 2: 12%<br>Level 3: 14%"),t.SourceFiles.SourceFile6=new r.SourceFile(6,"This Source-File allows you to access the NSA's Bladeburner Division in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat stats by:<br><br>Level 1: 8%<br>Level 2: 12%<br>Level 3: 14%"),t.SourceFiles.SourceFile7=new r.SourceFile(7,"This Source-File allows you to access the Bladeburner Netscript API in other BitNodes. In addition, this Source-File will increase all of your Bladeburner multipliers by:<br><br>Level 1: 8%<br>Level 2: 12%<br>Level 3: 14%"),t.SourceFiles.SourceFile8=new r.SourceFile(8,"This Source-File grants the following benefits:<br><br>Level 1: Permanent access to WSE and TIX API<br>Level 2: Ability to short stocks in other BitNodes<br>Level 3: Ability to use limit/stop orders in other BitNodes<br><br>This Source-File also increases your hacking growth multipliers by: <br>Level 1: 12%<br>Level 2: 18%<br>Level 3: 21%"),t.SourceFiles.SourceFile9=new r.SourceFile(9,"This Source-File grants the following benefits:<br><br>Level 1: Permanently unlocks the Hacknet Server in other BitNodes<br>Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode<br>Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode<br><br>(Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing Augmentations)"),t.SourceFiles.SourceFile10=new r.SourceFile(10,"This Source-File unlocks Sleeve technology in other BitNodes. Each level of this Source-File also grants you a Duplicate Sleeve"),t.SourceFiles.SourceFile11=new r.SourceFile(11,"This Source-File makes it so that company favor increases BOTH the player's salary and reputation gain rate at that company by 1% per favor (rather than just the reputation gain). This Source-File also increases the player's company salary and reputation gain multipliers by:<br><br>Level 1: 32%<br>Level 2: 48%<br>Level 3: 56%<br>"),t.SourceFiles.SourceFile12=new r.SourceFile(12,"This Source-File increases all your multipliers by 1% per level. This effect is multiplicative with itself. In other words, level N of this Source-File will result in a multiplier of 1.01^N (or 0.99^N for multipliers that decrease)")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(675),a=n(32);t.DarkWebItems={BruteSSHProgram:new r.DarkWebItem(a.Programs.BruteSSHProgram.name,5e5,"Opens up SSH Ports"),FTPCrackProgram:new r.DarkWebItem(a.Programs.FTPCrackProgram.name,15e5,"Opens up FTP Ports"),RelaySMTPProgram:new r.DarkWebItem(a.Programs.RelaySMTPProgram.name,5e6,"Opens up SMTP Ports"),HTTPWormProgram:new r.DarkWebItem(a.Programs.HTTPWormProgram.name,3e7,"Opens up HTTP Ports"),SQLInjectProgram:new r.DarkWebItem(a.Programs.SQLInjectProgram.name,25e7,"Opens up SQL Ports"),DeepscanV1:new r.DarkWebItem(a.Programs.DeepscanV1.name,5e5,"Enables 'scan-analyze' with a depth up to 5"),DeepscanV2:new r.DarkWebItem(a.Programs.DeepscanV2.name,25e6,"Enables 'scan-analyze' with a depth up to 10"),AutolinkProgram:new r.DarkWebItem(a.Programs.AutoLink.name,1e6,"Enables direct connect via 'scan-analyze'"),ServerProfilerProgram:new r.DarkWebItem(a.Programs.ServerProfiler.name,1e6,"Displays hacking and Netscript-related information about a server")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.overviewPage="Overview";t.CorporationRouting=class{constructor(e){this.currentPage=t.overviewPage,this.currentDivision=null,this.corp=e}current(){return this.currentPage}isValidPage(e){if(e===t.overviewPage)return!0;for(const t of this.corp.divisions)if(t.name===e)return!0;return!1}isOn(e){return!!this.isValidPage(e)&&e===this.currentPage}isOnOverviewPage(){return this.currentPage===t.overviewPage}routeTo(e){if(this.isValidPage(e)){if(this.currentDivision=null,e!==t.overviewPage){for(let t=0;t<this.corp.divisions.length;++t)this.corp.divisions[t].name===e&&(this.currentDivision=this.corp.divisions[t]);null==this.currentDivision&&console.warn(`Routing could not find division ${e}`)}this.currentPage=e}}routeToOverviewPage(){this.currentPage=t.overviewPage,this.currentDivision=null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(678),a=n(677);function i(e){t.HashUpgrades[e.name]=new r.HashUpgrade(e)}t.HashUpgrades={};for(const e of a.HashUpgradesMetadata)i(e)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Idle=0]="Idle",e[e.Company=1]="Company",e[e.Faction=2]="Faction",e[e.Crime=3]="Crime",e[e.Class=4]="Class",e[e.Gym=5]="Gym",e[e.Recovery=6]="Recovery",e[e.Sync=7]="Sync"}(t.SleeveTaskType||(t.SleeveTaskType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(19),a=n(6);t.getStockMarketAccountCost=function(){return a.CONSTANTS.WSEAccountCost},t.getStockMarketTixApiCost=function(){return a.CONSTANTS.TIXAPICost},t.getStockMarket4SDataCost=function(){return a.CONSTANTS.MarketData4SCost*r.BitNodeMultipliers.FourSigmaMarketDataCost},t.getStockMarket4STixApiCost=function(){return a.CONSTANTS.MarketDataTixApi4SCost*r.BitNodeMultipliers.FourSigmaMarketDataApiCost}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(118),a=n(8);t.determineCrimeSuccess=function(e,t){let n=0,i=!1;for(const a in r.Crimes){let o=r.Crimes[a];if(o.type==t){n=o.successRate(e),i=!0;break}}if(i)return Math.random()<=n;a.dialogBoxCreate(`ERR: Unrecognized crime type: ${t} This is probably a bug please contact the developer`,!1)},t.findCrime=function(e){return e.includes("shoplift")?r.Crimes.Shoplift:e.includes("rob")&&e.includes("store")?r.Crimes.RobStore:e.includes("mug")?r.Crimes.Mug:e.includes("larceny")?r.Crimes.Larceny:e.includes("drugs")?r.Crimes.DealDrugs:e.includes("bond")&&e.includes("forge")?r.Crimes.BondForgery:e.includes("traffick")&&e.includes("arms")?r.Crimes.TraffickArms:e.includes("homicide")?r.Crimes.Homicide:e.includes("grand")&&e.includes("auto")?r.Crimes.GrandTheftAuto:e.includes("kidnap")?r.Crimes.Kidnap:e.includes("assassinate")?r.Crimes.Assassination:e.includes("heist")?r.Crimes.Heist:null}},,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(36);t.StockSymbols={},t.StockSymbols[r.LocationName.AevumECorp]="ECP",t.StockSymbols[r.LocationName.Sector12MegaCorp]="MGCP",t.StockSymbols[r.LocationName.Sector12BladeIndustries]="BLD",t.StockSymbols[r.LocationName.AevumClarkeIncorporated]="CLRK",t.StockSymbols[r.LocationName.VolhavenOmniTekIncorporated]="OMTK",t.StockSymbols[r.LocationName.Sector12FourSigma]="FSIG",t.StockSymbols[r.LocationName.ChongqingKuaiGongInternational]="KGI",t.StockSymbols[r.LocationName.AevumFulcrumTechnologies]="FLCM",t.StockSymbols[r.LocationName.IshimaStormTechnologies]="STM",t.StockSymbols[r.LocationName.NewTokyoDefComm]="DCOMM",t.StockSymbols[r.LocationName.VolhavenHeliosLabs]="HLS",t.StockSymbols[r.LocationName.NewTokyoVitaLife]="VITA",t.StockSymbols[r.LocationName.Sector12IcarusMicrosystems]="ICRS",t.StockSymbols[r.LocationName.Sector12UniversalEnergy]="UNV",t.StockSymbols[r.LocationName.AevumAeroCorp]="AERO",t.StockSymbols[r.LocationName.VolhavenOmniaCybersystems]="OMN",t.StockSymbols[r.LocationName.ChongqingSolarisSpaceSystems]="SLRS",t.StockSymbols[r.LocationName.NewTokyoGlobalPharmaceuticals]="GPH",t.StockSymbols[r.LocationName.IshimaNovaMedical]="NVMD",t.StockSymbols[r.LocationName.AevumWatchdogSecurity]="WDS",t.StockSymbols[r.LocationName.VolhavenLexoCorp]="LXO",t.StockSymbols[r.LocationName.AevumRhoConstruction]="RHOC",t.StockSymbols[r.LocationName.Sector12AlphaEnterprises]="APHE",t.StockSymbols[r.LocationName.VolhavenSysCoreSecurities]="SYSC",t.StockSymbols[r.LocationName.VolhavenCompuTek]="CTK",t.StockSymbols[r.LocationName.AevumNetLinkTechnologies]="NTLK",t.StockSymbols[r.LocationName.IshimaOmegaSoftware]="OMGA",t.StockSymbols[r.LocationName.Sector12FoodNStuff]="FNS",t.StockSymbols["Sigma Cosmetics"]="SGC",t.StockSymbols["Joes Guns"]="JGN",t.StockSymbols["Catalyst Ventures"]="CTYS",t.StockSymbols["Microdyne Technologies"]="MDYN",t.StockSymbols["Titan Laboratories"]="TITN"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareArrays=function e(t,n){if(t.length!==n.length)return!1;for(let r=0;r<t.length;++r)if(Array.isArray(t[r])){if(!Array.isArray(n[r]))return!1;if(!e(t[r],n[r]))return!1}else if(t[r]!==n[r])return!1;return!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(117),a=n(76),i=n(6);t.forecastChangePerPriceMovement=.006,t.getBuyTransactionCost=function(e,t,n){return isNaN(t)||t<=0||!(e instanceof r.Stock)?null:(t=Math.min(t,e.maxShares),n===a.PositionTypes.Long?t*e.getAskPrice()+i.CONSTANTS.StockMarketCommission:t*e.getBidPrice()+i.CONSTANTS.StockMarketCommission)},t.getSellTransactionGain=function(e,t,n){return isNaN(t)||t<=0||!(e instanceof r.Stock)?null:(t=Math.min(t,e.maxShares),n===a.PositionTypes.Long?t*e.getBidPrice()-i.CONSTANTS.StockMarketCommission:t*e.playerAvgShortPx+((e.playerAvgShortPx-e.getAskPrice())*t-i.CONSTANTS.StockMarketCommission))},t.processTransactionForecastMovement=function(e,n){if(isNaN(n)||n<=0||!(e instanceof r.Stock))return;n=Math.min(n,e.maxShares);const a=e.shareTxUntilMovement;if(n<=a)return e.shareTxUntilMovement-=n,void(e.shareTxUntilMovement<=0&&(e.shareTxUntilMovement=e.shareTxForMovement,e.influenceForecast(t.forecastChangePerPriceMovement),e.influenceForecastForecast(t.forecastChangePerPriceMovement*(e.mv/100))));let i=n-a,o=1+Math.ceil(i/e.shareTxForMovement);e.shareTxUntilMovement=e.shareTxForMovement-(n-e.shareTxUntilMovement)%e.shareTxForMovement,(e.shareTxUntilMovement===e.shareTxForMovement||e.shareTxUntilMovement<=0)&&(++o,e.shareTxUntilMovement=e.shareTxForMovement);const s=t.forecastChangePerPriceMovement*(o-1),l=s*(e.mv/100);e.influenceForecast(s),e.influenceForecastForecast(l)},t.calculateBuyMaxAmount=function(e,t,n){if(!(e instanceof r.Stock))return 0;const o=t===a.PositionTypes.Long;let s=n-i.CONSTANTS.StockMarketCommission,l=o?e.getAskPrice():e.getBidPrice();return Math.floor(s/l)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(16);class a{constructor(e={}){this.name="InitName",this.qty=0,this.qlt=0,this.dmd=0,this.dmdR=[0,0],this.cmp=0,this.cmpR=[0,0],this.mv=0,this.mku=0,this.buy=0,this.sll=0,this.prd=0,this.imp=0,this.exp=[],this.totalExp=0,this.bCost=0,this.sCost=0,this.prdman=[!1,0],this.sllman=[!1,0],this.marketTa1=!1,this.marketTa2=!1,this.marketTa2Price=0,e.name&&(this.name=e.name),this.init()}static fromJSON(e){return r.Generic_fromJSON(a,e.data)}getMarkupLimit(){return this.qlt/this.mku}init(){switch(this.name){case"Water":this.dmd=75,this.dmdR=[65,85],this.cmp=50,this.cmpR=[40,60],this.bCost=1500,this.mv=.2,this.mku=6;break;case"Energy":this.dmd=90,this.dmdR=[80,99],this.cmp=80,this.cmpR=[65,95],this.bCost=2e3,this.mv=.2,this.mku=6;break;case"Food":this.dmd=80,this.dmdR=[70,90],this.cmp=60,this.cmpR=[35,85],this.bCost=5e3,this.mv=1,this.mku=3;break;case"Plants":this.dmd=70,this.dmdR=[20,90],this.cmp=50,this.cmpR=[30,70],this.bCost=3e3,this.mv=.6,this.mku=3.75;break;case"Metal":this.dmd=80,this.dmdR=[75,85],this.cmp=70,this.cmpR=[60,80],this.bCost=2650,this.mv=1,this.mku=6;break;case"Hardware":this.dmd=85,this.dmdR=[80,90],this.cmp=80,this.cmpR=[65,95],this.bCost=8e3,this.mv=.5,this.mku=1;break;case"Chemicals":this.dmd=55,this.dmdR=[40,70],this.cmp=60,this.cmpR=[40,80],this.bCost=9e3,this.mv=1.2,this.mku=2;break;case"Real Estate":this.dmd=50,this.dmdR=[5,99],this.cmp=50,this.cmpR=[25,75],this.bCost=8e4,this.mv=1.5,this.mku=1.5;break;case"Drugs":this.dmd=60,this.dmdR=[45,75],this.cmp=70,this.cmpR=[40,99],this.bCost=4e4,this.mv=1.6,this.mku=1;break;case"Robots":this.dmd=90,this.dmdR=[80,9],this.cmp=90,this.cmpR=[80,9],this.bCost=75e3,this.mv=.5,this.mku=1;break;case"AI Cores":this.dmd=90,this.dmdR=[80,99],this.cmp=90,this.cmpR=[80,9],this.bCost=15e3,this.mv=.8,this.mku=.5;break;case"Scientific Research":case"InitName":break;default:console.error(`Invalid material type in init(): ${this.name}`)}}processMarket(){const e=1+Math.random()*this.mv/300,t=1+Math.random()*this.mv/100;Math.random()<.5?(this.cmp*=t,this.cmp>this.cmpR[1]&&(this.cmp=this.cmpR[1]),this.bCost*=1/e):(this.cmp*=1/t,this.cmp<this.cmpR[0]&&(this.cmp=this.cmpR[0]),this.bCost*=e);const n=1+Math.random()*this.mv/100;Math.random()<.5?(this.dmd*=n,this.dmd>this.dmdR[1]&&(this.dmd=this.dmdR[1]),this.bCost*=e):(this.dmd*=1/n,this.dmd<this.dmdR[0]&&(this.dmd=this.dmdR[0]),this.bCost*=1/e)}toJSON(){return r.Generic_toJSON("Material",this)}}t.Material=a,r.Reviver.constructors.Material=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTimestamp=function(){const e=new Date,t=`0${e.getHours()}`.slice(-2),n=`0${e.getMinutes()}`.slice(-2);return`${e.getMonth()+1}/${e.getDate()} ${t}:${n}`}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.roundToTwo=function(e){return+`${Math.round(parseFloat(`${e}e+2`))}e-2`}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(117),a=n(42);t.forecastForecastChangeFromHack=.1,t.forecastForecastChangeFromCompanyWork=.001,t.influenceStockThroughServerHack=function(e,n){const i=e.organizationName;let o=null;if("string"==typeof i&&""!==i&&(o=a.StockMarket[i]),!(o instanceof r.Stock))return;const s=n/e.moneyMax;Math.random()<s&&o.changeForecastForecast(o.otlkMagForecast-t.forecastForecastChangeFromHack)},t.influenceStockThroughServerGrow=function(e,n){const i=e.organizationName;let o=null;if("string"==typeof i&&""!==i&&(o=a.StockMarket[i]),!(o instanceof r.Stock))return;const s=n/e.moneyMax;Math.random()<s&&o.changeForecastForecast(o.otlkMagForecast+t.forecastForecastChangeFromHack)},t.influenceStockThroughCompanyWork=function(e,n,i){const o=e.name;let s=null;if("string"==typeof o&&""!==o&&(s=a.StockMarket[o]),s instanceof r.Stock&&Math.random()<.002*i){const e=t.forecastForecastChangeFromCompanyWork*n;s.changeForecastForecast(s.otlkMagForecast+e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(89);let a=1;t.generateNextPid=function(){let e=a,t=!1;for(let n=0;n<1e6;){if(!r.workerScripts.has(e+n)){t=!0,e+=n;break}n===Number.MAX_SAFE_INTEGER-1?n=1:++n}return t?((a=e+1)>=Number.MAX_SAFE_INTEGER&&(a=1),e):-1},t.resetPidCounter=function(){a=1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndustryUpgrades={0:[0,5e5,1,1.05,"Coffee","Provide your employees with coffee, increasing their energy by 5%."],1:[1,1e9,1.06,1.03,"AdVert.Inc","Hire AdVert.Inc to advertise your company. Each level of this upgrade grants your company a static increase of 3 and 1 to its awareness and popularity, respectively. It will then increase your company's awareness by 1%, and its popularity by a random percentage between 1% and 3%. These effects are increased by other upgrades that increase the power of your advertising."]}},function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return l}),n.d(t,"c",function(){return c});var r=n(32),a=(n(6),n(0)),i=n(3);const o={};function s(){for(const e in o){const t=r.Programs[e];o[e].style.display="none",!a.Player.hasProgram(t.name)&&t.create.req(a.Player)&&(o[e].style.display="inline-block")}}function l(){var e=0;for(const t in r.Programs)null!=r.Programs[t].create&&(a.Player.hasProgram(r.Programs[t].name)||r.Programs[t].create.req(a.Player)&&e++);return!1===a.Player.firstProgramAvailable&&e>0&&(a.Player.firstProgramAvailable=!0,document.getElementById("hacking-menu-header").click(),document.getElementById("hacking-menu-header").click()),e}function c(){const e=document.getElementById("create-program-list");for(const t in r.Programs){if(null===r.Programs[t].create)continue;const n=Object(i.createElement)("a",{class:"a-link-button",id:r.Programs[t].htmlID(),innerText:r.Programs[t].name,tooltip:r.Programs[t].create.tooltip});o[t]=n,e.appendChild(n)}for(const e in o){const t=r.Programs[e];o[e].addEventListener("click",function(){return a.Player.startCreateProgramWork(t.name,t.create.time,t.create.level),!1})}}},,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(721);t.createRandomIp=function(){return r.getRandomByte(99)+"."+r.getRandomByte(9)+"."+r.getRandomByte(9)+"."+r.getRandomByte(9)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(416),a=n(104),i=n(415),o=n(28),s=n(414);function l(e){if(!e.name)throw new Error("Invalid constructor parameters for Location. No 'name' property");return t.Locations[e.name]instanceof i.Location&&console.warn(`Property with name ${e.name} already exists and is being overwritten`),t.Locations[e.name]=new i.Location(e),t.Locations[e.name]}t.Locations={},a.Cities[o.CityName.Aevum]=new r.City(o.CityName.Aevum),a.Cities[o.CityName.Chongqing]=new r.City(o.CityName.Chongqing),a.Cities[o.CityName.Ishima]=new r.City(o.CityName.Ishima),a.Cities[o.CityName.NewTokyo]=new r.City(o.CityName.NewTokyo),a.Cities[o.CityName.Sector12]=new r.City(o.CityName.Sector12),a.Cities[o.CityName.Volhaven]=new r.City(o.CityName.Volhaven),a.Cities[o.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 K \\ / \n \\ \\ P \n x 58 \\ / [travel agency] \n \\ 94 95 o \n 90 x 59 o------o | \n \\ / \\ | 98 102 103 \n o--------N------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-------Q--------o \n[galactic cybersystems] G 35 x \n | [watchdog security] \n | \n 67 o \n \n [the slums] O ",a.Cities[o.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--------- \n / 39 | 41 \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 ",a.Cities[o.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 \n \\ / [nova medical] / 4/30 \\ \n 49 x A \\ \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 ",a.Cities[o.CityName.NewTokyo].asciiArt="\n \n \n o \n \\ \n \\ [defcomm] \n \\ \n o--x---A--x--o [travel agency] \n 7 8 10 G \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--E--x-----x-----x---+---x----x--H--x-o \n | \n | \n o 17 \n \n \n \n F [the slums] \n ",a.Cities[o.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] ",a.Cities[o.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 ";for(const e of s.LocationsMetadata){const t=l(e),n=t.city;if(null===n)for(const e in a.Cities)a.Cities[e].addLocation(t.name);else a.Cities[n].addLocation(t.name)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.StatsTable=function(e,t){let n=r.createElement(r.Fragment,null);return t&&(n=r.createElement(r.Fragment,null,r.createElement("h2",null,r.createElement("u",null,t)),r.createElement("br",null))),r.createElement(r.Fragment,null,n,r.createElement("table",null,r.createElement("tbody",null,e.map(e=>r.createElement("tr",{key:e[0]},e.map((e,t)=>{let n={};return 0!==t&&(n={textAlign:"right",paddingLeft:".25em"}),r.createElement("td",{key:t,style:n},e)}))))))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(46),i=n(682),o=n(3),s=n(27);let l;document.addEventListener("DOMContentLoaded",function e(){let t=document.getElementById("entire-game-container");if(null==t)throw new Error("Failed to find game container DOM element");l=t,document.removeEventListener("DOMContentLoaded",e)}),t.createPopup=function(e,t,n){let s=document.getElementById(e);return null==s&&(s=o.createElement("div",{class:"popup-box-container",display:"flex",id:e}),l.appendChild(s)),a.render(r.createElement(i.Popup,{content:t,id:e,props:n}),s),s},t.removePopup=function(e){let t=document.getElementById(`${e}`);null!=t&&(a.unmountComponentAtNode(t),s.removeElementById(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(46),i=n(24),o=n(82);t.PopupCloseButton=class extends r.Component{constructor(e){super(e),this.closePopup=this.closePopup.bind(this),this.keyListener=this.keyListener.bind(this)}componentDidMount(){document.addEventListener("keydown",this.keyListener)}componentWillUnmount(){document.removeEventListener("keydown",this.keyListener)}closePopup(){let e;(e="string"==typeof this.props.popup?document.getElementById(this.props.popup):this.props.popup)instanceof HTMLElement&&(a.unmountComponentAtNode(e),o.removeElement(e))}keyListener(e){e.keyCode===i.KEY.ESC&&this.closePopup()}render(){const e=this.props.class?this.props.class:"std-button";return r.createElement("button",{className:e,onClick:this.closePopup,style:this.props.style},this.props.text)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Field=0]="Field",e[e.Hacking=1]="Hacking",e[e.None=2]="None",e[e.Security=3]="Security"}(t.FactionWorkType||(t.FactionWorkType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(715),a=n(714);function i(e){null!=t.ResearchMap[e.name]&&console.warn(`Duplicate Research being defined: ${e.name}`),t.ResearchMap[e.name]=new r.Research(e)}t.ResearchMap={};for(const e of a.researchMetadata)i(e)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getJobRequirementText=function(e,t,n=!1){let r="";const a=e.jobStatReqOffset,i=t.requiredHacking>0?t.requiredHacking+a:0,o=t.requiredStrength>0?t.requiredStrength+a:0,s=t.requiredDefense>0?t.requiredDefense+a:0,l=t.requiredDexterity>0?t.requiredDexterity+a:0,c=t.requiredDexterity>0?t.requiredDexterity+a:0,u=t.requiredCharisma>0?t.requiredCharisma+a:0,m=t.requiredReputation;return n?(r="Requires:<br>",r+=i.toString()+" hacking<br>",r+=o.toString()+" strength<br>",r+=s.toString()+" defense<br>",r+=l.toString()+" dexterity<br>",r+=c.toString()+" agility<br>",r+=u.toString()+" charisma<br>",r+=m.toString()+" reputation"):(r="(Requires ",i>0&&(r+=i+" hacking, "),o>0&&(r+=o+" strength, "),s>0&&(r+=s+" defense, "),l>0&&(r+=l+" dexterity, "),c>0&&(r+=c+" agility, "),u>0&&(r+=u+" charisma, "),m>1&&(r+=m+" reputation, "),r=r.substring(0,r.length-2),r+=")"),r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PlayerOwnedSourceFile=class{constructor(e,t){this.lvl=1,this.n=1,this.n=e,this.lvl=t}}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});const r=n(673).js_beautify;class a{constructor(){this.editor=null,this.filenameInput=null}init(){throw new Error("Tried to initialize base ScriptEditor class")}beautifyScript(){if(null==this.editor)return void console.warn("ScriptEditor.beautifyScript() called when editor was not initialized");let e=this.editor.getValue();e=r(e,{indent_size:4,brace_style:"preserve-inline"}),this.editor.setValue(e)}openScript(e="",t=""){null!=this.editor&&null!=this.filenameInput?(""!=e&&(this.filenameInput.value=e,this.editor.setValue(t)),this.editor.focus()):console.warn("ScriptEditor.openScript() called when editor was not initialized")}getCode(){return null==this.editor?(console.warn("ScriptEditor.getCode() called when editor was not initialized"),""):this.editor.getValue()}getFilename(){return null==this.filenameInput?(console.warn("ScriptEditor.getFilename() called when editor was not initialized"),""):this.filenameInput.value}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(20);t.getRamUsageFromRunningScript=function(e){if(null!=e.ramUsage&&e.ramUsage>0)return e.ramUsage;const t=r.AllServers[e.server];if(null==t)return 0;for(let n=0;n<t.scripts.length;++n)if(t.scripts[n].filename===e.filename)return e.ramUsage=t.scripts[n].ramUsage,e.ramUsage;return 0}},function(e,t,n){"use strict";n.d(t,"b",function(){return g}),n.d(t,"a",function(){return y});var r=n(1),a=n.n(r),i=n(299),o=n(298),s=n(297),l=n(296),c=n(295),u=n(294),m=n(293),p=n(23),h=n(0),d=n(20),_=n(171);n(172);const g=Object.freeze({x1:1,x5:5,x10:10,MAX:"MAX"});class y extends a.a.Component{constructor(e){super(e),this.state={purchaseMultiplier:g.x1,totalProduction:0},this.createHashUpgradesPopup=this.createHashUpgradesPopup.bind(this),this.handlePurchaseButtonClick=this.handlePurchaseButtonClick.bind(this),this.recalculateTotalProduction=this.recalculateTotalProduction.bind(this)}componentDidMount(){this.recalculateTotalProduction()}createHashUpgradesPopup(){const e="hacknet-server-hash-upgrades-popup";Object(_.createPopup)(e,l.a,{popupId:e,rerender:this.createHashUpgradesPopup})}handlePurchaseButtonClick(){Object(p.m)()>=0&&this.recalculateTotalProduction()}recalculateTotalProduction(){let e=0;for(let t=0;t<h.Player.hacknetNodes.length;++t)if(Object(p.h)()){const n=d.AllServers[h.Player.hacknetNodes[t]];n?e+=n.hashRate:console.warn(`Could not find Hacknet Server object in AllServers map (i=${t})`)}else e+=h.Player.hacknetNodes[t].moneyGainRatePerSecond;this.setState({totalProduction:e})}setPurchaseMultiplier(e){this.setState({purchaseMultiplier:e})}render(){let e;e=Object(p.h)()?Object(p.c)():Object(p.b)();const t=[this.setPurchaseMultiplier.bind(this,g.x1),this.setPurchaseMultiplier.bind(this,g.x5),this.setPurchaseMultiplier.bind(this,g.x10),this.setPurchaseMultiplier.bind(this,g.MAX)],n=h.Player.hacknetNodes.map(e=>{if(Object(p.h)()){const t=d.AllServers[e];if(null==t)throw new Error(`Could not find Hacknet Server object in AllServers map for IP: ${e}`);return a.a.createElement(s.a,{key:t.hostname,node:t,purchaseMultiplier:this.state.purchaseMultiplier,recalculate:this.recalculateTotalProduction})}return a.a.createElement(o.a,{key:e.name,node:e,purchaseMultiplier:this.state.purchaseMultiplier,recalculate:this.recalculateTotalProduction})});return a.a.createElement("div",null,a.a.createElement("h1",null,"Hacknet Nodes"),a.a.createElement(i.a,null),a.a.createElement(m.a,{cost:e,multiplier:this.state.purchaseMultiplier,onClick:this.handlePurchaseButtonClick}),a.a.createElement("br",null),a.a.createElement("div",{id:"hacknet-nodes-money-multipliers-div"},a.a.createElement(u.a,{totalProduction:this.state.totalProduction}),a.a.createElement(c.a,{onClicks:t,purchaseMultiplier:this.state.purchaseMultiplier})),Object(p.h)()&&a.a.createElement("button",{className:"std-button",onClick:this.createHashUpgradesPopup,style:{display:"block"}},"Spend Hashes on Upgrades"),a.a.createElement("ul",{id:"hacknet-nodes-list"},n))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(12),a=n(65),i=n(44),o=n(3),s=n(49),l=n(48);let c=!1;function u(e){if(c=!0,e.constructor!==Array)throw new Error("Invalid non-array argument passed into writeCinematicText()");r.Engine.loadCinematicTextContent();const t=document.getElementById("cinematic-text-container");if(t.style.width="75%",null==t)throw new Error("Could not find cinematic-text-container for writeCinematicText()");Object(i.removeChildrenFromElement)(t);for(let t=0;t<e.length;++t)if(!Object(l.isString)(e[t]))throw new Error("Invalid non-string element in 'lines' argument. writeCinematicText() failed");return function e(t,n=0){if(n>=t.length)return Promise.resolve(!0);return function(e){return new Promise(function(t,n){const r=document.getElementById("cinematic-text-container"),i=document.createElement("p");r.appendChild(i);const o=function e(t,n,r=0){return new Promise(function(i,o){Object(a.setTimeoutRef)(function(){const a=n.substring(0,r);if(r>=n.length)return t.innerHTML=a,i(!0);t.innerHTML=a+"<span class='typed-cursor'> █ </span>";const s=e(t,n,r+1);s.then(function(e){i(e)},function(e){o(e)})},15)})}(i,e,0);o.then(function(e){t(e)},function(e){n(e)})})}(t[n]).then(function(){return e(t,n+1)})}(e).then(function(){return function(){var e=document.getElementById("cinematic-text-container"),t=document.getElementById("mainmenu-container");return e.appendChild(Object(o.createElement)("br")),new Promise(function(n,a){e.appendChild(Object(o.createElement)("a",{class:"a-link-button",innerText:"Continue...",clickListener:()=>{Object(i.removeChildrenFromElement)(e),r.Engine.loadTerminalContent(),t.style.visibility="visible",c=!1,n()}}))})}()}).catch(function(e){Object(s.exceptionAlert)(e)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(696),a=n(8);t.showLiterature=function(e){const t=r.Literatures[e];if(null==t)return;const n=`<i>${t.title}</i><br><br>${t.txt}`;a.dialogBoxCreate(n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CorporationUpgrades={0:[0,2e9,1.06,.03,"Smart Factories","Advanced AI automatically optimizes the operation and productivity of factories. Each level of this upgrade increases your global production by 3% (additive)."],1:[1,2e9,1.06,.1,"Smart Storage","Advanced AI automatically optimizes your warehouse storage methods. Each level of this upgrade increases your global warehouse storage size by 10% (additive)."],2:[2,4e9,1.1,.001,"DreamSense","Use DreamSense LCC Technologies to advertise your corporation to consumers through their dreams. Each level of this upgrade provides a passive increase in awareness of all of your companies (divisions) by 0.004 / market cycle,and in popularity by 0.001 / market cycle. A market cycle is approximately 15 seconds."],3:[3,4e9,1.12,.005,"Wilson Analytics","Purchase data and analysis from Wilson, a marketing research firm. Each level of this upgrades increases the effectiveness of your advertising by 0.5% (additive)."],4:[4,1e9,1.06,.1,"Nuoptimal Nootropic Injector Implants","Purchase the Nuoptimal Nootropic Injector augmentation for your employees. Each level of this upgrade globally increases the creativity of your employees by 10% (additive)."],5:[5,1e9,1.06,.1,"Speech Processor Implants","Purchase the Speech Processor augmentation for your employees. Each level of this upgrade globally increases the charisma of your employees by 10% (additive)."],6:[6,1e9,1.06,.1,"Neural Accelerators","Purchase the Neural Accelerator augmentation for your employees. Each level of this upgrade globally increases the intelligence of your employees by 10% (additive)."],7:[7,1e9,1.06,.1,"FocusWires","Purchase the FocusWire augmentation for your employees. Each level of this upgrade globally increases the efficiency of your employees by 10% (additive)."],8:[8,1e9,1.07,.01,"ABC SalesBots","Always Be Closing. Purchase these robotic salesmen to increase the amount of materials and products you sell. Each level of this upgrade globally increases your sales by 1% (additive)."],9:[9,5e9,1.07,.05,"Project Insight","Purchase 'Project Insight', a R&D service provided by the secretive Fulcrum Technologies. Each level of this upgrade globally increases the amount of Scientific Research you produce by 5% (additive)."]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CorporationUnlockUpgrades={0:[0,2e10,"Export","Develop infrastructure to export your materials to your other facilities. This allows you to move materials around between different divisions and cities."],1:[1,25e9,"Smart Supply","Use advanced AI to anticipate your supply needs. This allows you to purchase exactly however many materials you need for production."],2:[2,5e9,"Market Research - Demand","Mine and analyze market data to determine the demand of all resources. The demand attribute, which affects sales, will be displayed for every material and product."],3:[3,5e9,"Market Data - Competition","Mine and analyze market data to determine how much competition there is on the market for all resources. The competition attribute, which affects sales, will be displayed for for every material and product."],4:[4,1e10,"VeChain","Use AI and blockchain technology to identify where you can improve your supply chain systems. This upgrade will allow you to view a wide array of useful statistics about your Corporation."],5:[5,5e11,"Shady Accounting","Utilize unscrupulous accounting practices and pay off government officials to save money on taxes. This reduces the dividend tax rate by 5%."],6:[6,2e12,"Government Partnership","Help national governments further their agendas in exchange for lowered taxes. This reduces the dividend tax rate by 10%"]}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(395),a=n(145),i=n(394),o=n(6),s=n(13),l=n(173),c=n(118),u=n(104),m=n(28),p=n(36),h=n(2),d=n(11),_=n(8),g=n(109),y=n(49),f=n(29),b=n(3),E=n(58),v=n(37),k=n(55),C=n(94),T=n(44),P=n(82),S=n(27),O=n(393),M=n(392),x=n(391),w=n(390),A=n(46),N={container:null,docButton:null,faqButton:null,info:null,sleeveList:null,sleeves:null};let R;function D(){if(d.routing.isOn(d.Page.Sleeves))try{for(let e=0;e<R.sleeves.length;++e){B(R.sleeves[e],N.sleeves[e])}}catch(e){y.exceptionAlert(e)}}function I(e,t){const n={container:null,statsPanel:null,stats:null,moreStatsButton:null,travelButton:null,purchaseAugsButton:null,taskPanel:null,taskSelector:null,taskDetailsSelector:null,taskDetailsSelector2:null,taskDescription:null,taskSetButton:null,taskProgressBar:null,earningsPanel:null,currentEarningsInfo:null,totalEarningsButton:null};return d.routing.isOn(d.Page.Sleeves)?(n.container=b.createElement("div",{class:"sleeve-container",display:"block"}),n.statsPanel=b.createElement("div",{class:"sleeve-panel",width:"25%"}),n.stats=b.createElement("div",{class:"sleeve-stats-text"}),n.moreStatsButton=b.createElement("button",{class:"std-button",innerText:"More Stats",clickListener:()=>{_.dialogBoxCreate(x.MoreStatsContent(e))}}),n.travelButton=b.createElement("button",{class:"std-button",innerText:"Travel",clickListener:()=>{const r="sleeve-travel-popup",a=[];a.push(k.createPopupCloseButton(r,{class:"std-button"})),a.push(b.createElement("p",{innerText:"Have this sleeve travel to a different city. This affects the gyms and universities at which this sleeve can study. "+`Traveling to a different city costs ${h.numeralWrapper.formatMoney(o.CONSTANTS.TravelCost)}. `+"It will also CANCEL the sleeve's current task (setting it to idle)"}));for(const i in u.Cities)e.city!==i&&function(e,i){a.push(b.createElement("div",{class:"cmpy-mgmt-find-employee-option",innerText:i,clickListener:()=>R.canAfford(o.CONSTANTS.TravelCost)?(e.city=i,R.loseMoney(o.CONSTANTS.TravelCost),e.resetTaskStatus(),S.removeElementById(r),B(e,n),F(e,n,t),!1):(_.dialogBoxCreate("You cannot afford to have this sleeve travel to another city",!1),!1)}))}(e,i);v.createPopup(r,a)}}),n.purchaseAugsButton=b.createElement("button",{class:"std-button",display:"block",innerText:"Manage Augmentations",clickListener:()=>{r.createSleevePurchaseAugsPopup(e,R)}}),n.statsPanel.appendChild(n.stats),n.statsPanel.appendChild(n.moreStatsButton),n.statsPanel.appendChild(n.travelButton),e.shock>=100&&n.statsPanel.appendChild(n.purchaseAugsButton),n.taskPanel=b.createElement("div",{class:"sleeve-panel",width:"40%"}),n.taskSelector=b.createElement("select",{class:"dropdown"}),n.taskSelector.add(E.createOptionElement("------")),n.taskSelector.add(E.createOptionElement("Work for Company")),n.taskSelector.add(E.createOptionElement("Work for Faction")),n.taskSelector.add(E.createOptionElement("Commit Crime")),n.taskSelector.add(E.createOptionElement("Take University Course")),n.taskSelector.add(E.createOptionElement("Workout at Gym")),n.taskSelector.add(E.createOptionElement("Shock Recovery")),n.taskSelector.add(E.createOptionElement("Synchronize")),n.taskDetailsSelector=b.createElement("select",{class:"dropdown"}),n.taskDetailsSelector2=b.createElement("select",{class:"dropdown"}),n.taskDescription=b.createElement("p"),n.taskProgressBar=b.createElement("p"),n.taskSelector.addEventListener("change",()=>{F(e,n,t)}),n.taskSelector.selectedIndex=e.currentTask,n.taskSelector.dispatchEvent(new Event("change")),j(e,n),n.taskSetButton=b.createElement("button",{class:"std-button",innerText:"Set Task",clickListener:()=>{!function(e,t){try{if(null==R)throw new Error("playerRef is null in Sleeve UI's setSleeveTask()");const n=C.getSelectValue(t.taskSelector),r=C.getSelectValue(t.taskDetailsSelector),i=C.getSelectValue(t.taskDetailsSelector2);let o=!1;switch(n){case"------":t.taskDescription.innerText="This sleeve is currently idle";break;case"Work for Company":o=e.workForCompany(R,r);break;case"Work for Faction":o=e.workForFaction(R,r,i);break;case"Commit Crime":o=e.commitCrime(R,r);break;case"Take University Course":o=e.takeUniversityCourse(R,i,r);break;case"Workout at Gym":o=e.workoutAtGym(R,i,r);break;case"Shock Recovery":e.currentTask=a.SleeveTaskType.Recovery,o=e.shockRecovery(R);break;case"Synchronize":o=e.synchronize(R);break;default:console.error(`Invalid/Unrecognized taskValue in setSleeveTask(): ${n}`)}if(o)j(e,t);else switch(n){case"Work for Faction":t.taskDescription.innerText="Failed to assign sleeve to task. This is most likely because the selected faction does not offer the selected work type.";break;default:t.taskDescription.innerText="Failed to assign sleeve to task. Invalid choice(s)."}if(d.routing.isOn(d.Page.Sleeves)){D();for(const e of N.sleeves)e.taskSelector.dispatchEvent(new Event("change"))}}catch(e){return console.error(`Exception caught in setSleeveTask(): ${e}`),y.exceptionAlert(e),!1}}(e,n)}}),n.taskPanel.appendChild(n.taskSelector),n.taskPanel.appendChild(n.taskDetailsSelector),n.taskPanel.appendChild(n.taskDetailsSelector2),n.taskPanel.appendChild(n.taskSetButton),n.taskPanel.appendChild(n.taskDescription),n.taskPanel.appendChild(n.taskProgressBar),n.earningsPanel=b.createElement("div",{class:"sleeve-panel",width:"35%"}),n.currentEarningsInfo=b.createElement("div"),n.totalEarningsButton=b.createElement("button",{class:"std-button",innerText:"More Earnings Info",clickListener:()=>{_.dialogBoxCreate(w.MoreEarningsContent(e))}}),n.earningsPanel.appendChild(n.currentEarningsInfo),n.earningsPanel.appendChild(n.totalEarningsButton),B(e,n),n.container.appendChild(n.statsPanel),n.container.appendChild(n.taskPanel),n.container.appendChild(n.earningsPanel),n):n}function B(e,t){if(d.routing.isOn(d.Page.Sleeves))if(A.render(M.StatsElement(e),t.stats),e.currentTask===a.SleeveTaskType.Crime){const n=[["Money",h.numeralWrapper.formatMoney(parseFloat(e.currentTaskLocation)),"(on success)"],["Hacking Exp",h.numeralWrapper.format(e.gainRatesForTask.hack,"0.00"),"(2x on success)"],["Strength Exp",h.numeralWrapper.format(e.gainRatesForTask.str,"0.00"),"(2x on success)"],["Defense Exp",h.numeralWrapper.format(e.gainRatesForTask.def,"0.00"),"(2x on success)"],["Dexterity Exp",h.numeralWrapper.format(e.gainRatesForTask.dex,"0.00"),"(2x on success)"],["Agility Exp",h.numeralWrapper.format(e.gainRatesForTask.agi,"0.00"),"(2x on success)"],["Charisma Exp",h.numeralWrapper.format(e.gainRatesForTask.cha,"0.00"),"(2x on success)"]];A.render(O.EarningsTableElement("Earnings (Pre-Synchronization)",n),t.currentEarningsInfo),t.taskProgressBar.innerText=g.createProgressBarText({progress:e.currentTaskTime/e.currentTaskMaxTime,totalTicks:25})}else{const n=[["Money:",`${h.numeralWrapper.formatMoney(5*e.gainRatesForTask.money)} / s`],["Hacking Exp:",`${h.numeralWrapper.format(5*e.gainRatesForTask.hack,"0.00")} / s`],["Strength Exp:",`${h.numeralWrapper.format(5*e.gainRatesForTask.str,"0.00")} / s`],["Defense Exp:",`${h.numeralWrapper.format(5*e.gainRatesForTask.def,"0.00")} / s`],["Dexterity Exp:",`${h.numeralWrapper.format(5*e.gainRatesForTask.dex,"0.00")} / s`],["Agility Exp:",`${h.numeralWrapper.format(5*e.gainRatesForTask.agi,"0.00")} / s`],["Charisma Exp:",`${h.numeralWrapper.format(5*e.gainRatesForTask.cha,"0.00")} / s`]];if(e.currentTask===a.SleeveTaskType.Company||e.currentTask===a.SleeveTaskType.Faction){const t=e.getRepGain(R);n.push(["Reputation:",`${h.numeralWrapper.format(5*t,"0.00")} / s`])}A.render(O.EarningsTableElement("Earnings (Pre-Synchronization)",n),t.currentEarningsInfo),t.taskProgressBar.innerText=""}}t.createSleevesPage=function(e){if(d.routing.isOn(d.Page.Sleeves))try{R=e,N.container=b.createElement("div",{class:"generic-menupage-container",id:"sleeves-container",position:"fixed"}),N.info=b.createElement("p",{class:"sleeves-page-info",innerHTML:"<h1>Sleeves</h1>Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciousness has been copied. In other words, these Synthoids contain a perfect duplicate of your mind.<br /><br />Sleeves can be used to perform different tasks synchronously.<br /><br />"}),N.faqButton=b.createElement("button",{class:"std-button",display:"inline-block",innerText:"FAQ",clickListener:()=>{_.dialogBoxCreate(i.SleeveFaq,!1)}}),N.docButton=b.createElement("a",{class:"std-button",display:"inline-block",href:"https://bitburner.readthedocs.io/en/latest/advancedgameplay/sleeves.html#duplicate-sleeves",innerText:"Documentation",target:"_blank"}),N.sleeveList=b.createElement("ul"),N.sleeves=[];for(const t of e.sleeves){const n=I(t,e.sleeves);N.sleeveList.appendChild(n.container),N.sleeves.push(n)}N.container.appendChild(N.info),N.container.appendChild(N.faqButton),N.container.appendChild(N.docButton),N.container.appendChild(N.sleeveList),document.getElementById("entire-game-container").appendChild(N.container)}catch(e){y.exceptionAlert(e)}},t.updateSleevesPage=D,t.clearSleevesPage=function(){N.container instanceof HTMLElement&&P.removeElement(N.container);for(const e in N)N[e]=null;R=null};const L=["Study Computer Science","Data Structures","Networks","Algorithms","Management","Leadership"],W=["Train Strength","Train Defense","Train Dexterity","Train Agility"];function F(e,t,n){if(null==R)throw new Error("playerRef is null in updateSleeveTaskSelector()");const r=[];for(const t of n)e!==t&&t.currentTask===a.SleeveTaskType.Company&&r.push(t.currentTaskLocation);const i=[];for(const t of n)e!==t&&t.currentTask===a.SleeveTaskType.Faction&&i.push(t.currentTaskLocation);switch(T.removeChildrenFromElement(t.taskDetailsSelector),T.removeChildrenFromElement(t.taskDetailsSelector2),t.taskDetailsSelector2=f.clearEventListeners(t.taskDetailsSelector2),C.getSelectValue(t.taskSelector)){case"Work for Company":let n=0;const a=Object.keys(R.jobs);for(let i=0;i<a.length;++i)r.includes(a[i])||(t.taskDetailsSelector.add(E.createOptionElement(a[i])),e.currentTaskLocation===a[i]&&(t.taskDetailsSelector.selectedIndex=n),++n),t.taskDetailsSelector2.add(E.createOptionElement("------"));break;case"Work for Faction":let o=0;for(let n=0;n<R.factions.length;++n){const r=R.factions[n];i.includes(r)||(t.taskDetailsSelector.add(E.createOptionElement(r)),e.currentTaskLocation===r&&(t.taskDetailsSelector.selectedIndex=o),++o)}t.taskDetailsSelector.addEventListener("change",()=>{const n=C.getSelectValue(t.taskDetailsSelector),r=s.Factions[n];if(null==r)return void console.warn(`Invalid faction name when trying to update Sleeve Task Selector: ${n}`);const a=r.getInfo();T.removeChildrenFromElement(t.taskDetailsSelector2);let i=0;a.offerHackingWork&&(t.taskDetailsSelector2.add(E.createOptionElement("Hacking Contracts")),e.factionWorkType===l.FactionWorkType.Hacking&&(t.taskDetailsSelector2.selectedIndex=i),++i),a.offerFieldWork&&(t.taskDetailsSelector2.add(E.createOptionElement("Field Work")),e.factionWorkType===l.FactionWorkType.Field&&(t.taskDetailsSelector2.selectedIndex=i),++i),a.offerSecurityWork&&(t.taskDetailsSelector2.add(E.createOptionElement("Security Work")),e.factionWorkType===l.FactionWorkType.Security&&(t.taskDetailsSelector2.selectedIndex=i),++i)}),t.taskDetailsSelector.dispatchEvent(new Event("change"));break;case"Commit Crime":let u=0;for(const n in c.Crimes){const r=c.Crimes[n].name;if(t.taskDetailsSelector.add(E.createOptionElement(r,n)),""===e.crimeType)continue;const a=c.Crimes[e.crimeType];null!=a&&(r===a.name&&(t.taskDetailsSelector.selectedIndex=u),++u)}t.taskDetailsSelector2.add(E.createOptionElement("------"));break;case"Take University Course":for(let n=0;n<L.length;++n)t.taskDetailsSelector.add(E.createOptionElement(L[n])),e.className===L[n]&&(t.taskDetailsSelector.selectedIndex=n);switch(e.city){case m.CityName.Aevum:t.taskDetailsSelector2.add(E.createOptionElement(p.LocationName.AevumSummitUniversity));break;case m.CityName.Sector12:t.taskDetailsSelector2.add(E.createOptionElement(p.LocationName.Sector12RothmanUniversity));break;case m.CityName.Volhaven:t.taskDetailsSelector2.add(E.createOptionElement(p.LocationName.VolhavenZBInstituteOfTechnology));break;default:t.taskDetailsSelector2.add(E.createOptionElement("No university available in city!"))}break;case"Workout at Gym":for(let n=0;n<W.length;++n)t.taskDetailsSelector.add(E.createOptionElement(W[n])),e.gymStatType===W[n]&&(t.taskDetailsSelector.selectedIndex=n);switch(e.city){case m.CityName.Aevum:t.taskDetailsSelector2.add(E.createOptionElement(p.LocationName.AevumCrushFitnessGym)),t.taskDetailsSelector2.add(E.createOptionElement(p.LocationName.AevumSnapFitnessGym)),e.currentTaskLocation===p.LocationName.AevumCrushFitnessGym?t.taskDetailsSelector2.selectedIndex=0:e.currentTaskLocation===p.LocationName.AevumSnapFitnessGym&&(t.taskDetailsSelector2.selectedIndex=1);break;case m.CityName.Sector12:t.taskDetailsSelector2.add(E.createOptionElement(p.LocationName.Sector12IronGym)),t.taskDetailsSelector2.add(E.createOptionElement(p.LocationName.Sector12PowerhouseGym)),e.currentTaskLocation===p.LocationName.Sector12IronGym?t.taskDetailsSelector2.selectedIndex=0:e.currentTaskLocation===p.LocationName.Sector12PowerhouseGym&&(t.taskDetailsSelector2.selectedIndex=1);break;case m.CityName.Volhaven:t.taskDetailsSelector2.add(E.createOptionElement(p.LocationName.VolhavenMilleniumFitnessGym));break;default:t.taskDetailsSelector2.add(E.createOptionElement("No gym available in city!"))}break;case"Shock Recovery":case"Synchronize":case"------":return t.taskDetailsSelector.add(E.createOptionElement("------")),void t.taskDetailsSelector2.add(E.createOptionElement("------"))}}function j(e,t){try{if(null==R)throw new Error("playerRef is null in Sleeve UI's setSleeveTask()");const n=C.getSelectValue(t.taskSelector),r=C.getSelectValue(t.taskDetailsSelector),a=C.getSelectValue(t.taskDetailsSelector2);switch(n){case"------":t.taskDescription.innerText="This sleeve is currently idle";break;case"Work for Company":t.taskDescription.innerText=`This sleeve is currently working your job at ${e.currentTaskLocation}.`;break;case"Work for Faction":t.taskDescription.innerText=`This sleeve is currently doing ${a} for ${e.currentTaskLocation}.`;break;case"Commit Crime":t.taskDescription.innerText=`This sleeve is currently attempting to ${c.Crimes[r].type} (Success Rate: ${h.numeralWrapper.formatPercentage(c.Crimes[r].successRate(e))}).`;break;case"Take University Course":t.taskDescription.innerText=`This sleeve is currently studying/taking a course at ${e.currentTaskLocation}.`;break;case"Workout at Gym":t.taskDescription.innerText=`This sleeve is currently working out at ${e.currentTaskLocation}.`;break;case"Shock Recovery":t.taskDescription.innerText="This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a faster rate.";break;case"Synchronize":t.taskDescription.innerText="This sleeve is currently set to synchronize with the original consciousness. This causes the Sleeve's synchronization to increase.";break;default:console.error(`Invalid/Unrecognized taskValue in updateSleeveTaskDescription(): ${n}`)}}catch(e){console.error(`Exception caught in updateSleeveTaskDescription(): ${e}`),y.exceptionAlert(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(407),i=n(406),o=n(104),s=n(169),l=n(194),c=n(6),u=n(8);t.LocationRoot=class extends r.Component{constructor(e){super(e),this.state={city:e.p.city,inCity:null==e.initiallyInCity||e.initiallyInCity,location:e.p.location},this.enterLocation=this.enterLocation.bind(this),this.returnToCity=this.returnToCity.bind(this),this.travel=this.travel.bind(this)}enterLocation(e){this.props.p.gotoLocation(e),this.setState({inCity:!1,location:e})}returnToCity(){this.setState({inCity:!0})}renderCity(){const e=o.Cities[this.state.city];if(null==e)throw new Error(`Invalid city when rendering UI: ${this.state.city}`);return r.createElement("div",null,r.createElement("h2",null,this.state.city),r.createElement(a.LocationCity,{city:e,enterLocation:this.enterLocation}))}renderLocation(){const e=s.Locations[this.state.location];if(null==e)throw new Error(`Invalid location when rendering UI: ${this.state.location}`);return e.types.includes(l.LocationType.StockMarket)&&this.props.engine.loadStockMarketContent(),r.createElement(i.GenericLocation,{engine:this.props.engine,loc:e,p:this.props.p,returnToCity:this.returnToCity,travel:this.travel})}travel(e){const t=this.props.p,n=c.CONSTANTS.TravelCost;if(t.canAfford(n)){if(t.loseMoney(n),t.travel(e),u.dialogBoxCreate(`You are now in ${e}!`),!1===t.firstTimeTraveled){t.firstTimeTraveled=!0;const e=document.getElementById("travel-tab"),n=document.getElementById("world-menu-header");null!=e&&null!==n&&(e.style.display="list-item",n.click(),n.click())}this.props.p.travel(e)&&this.setState({inCity:!0,city:e})}else u.dialogBoxCreate(`You cannot afford to travel to ${e}`)}render(){return this.state.inCity?this.renderCity():this.renderLocation()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(47);t.getNextCompanyPositionHelper=function(e){if(null==e)return null;const t=e.nextPosition;return null==t?null:r.CompanyPositions[t]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(195),a=n(16);class i extends r.Action{constructor(e=null){super(e)}getActionTypeSkillSuccessBonus(e){return e.skillMultipliers.successChanceContract}static fromJSON(e){return a.Generic_fromJSON(i,e.data)}toJSON(){return a.Generic_toJSON("Contract",this)}}t.Contract=i,a.Reviver.constructors.Contract=i},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalHelpText="Type 'help name' to learn more about the command 'name'<br><br>alias [-g] [name=\"value\"] Create or display Terminal aliases<br>analyze Get information about the current machine <br>buy [-l/program] Purchase a program through the Dark Web<br>cat [file] Display a .msg, .lit, or .txt file<br>cd [dir] Change to a new directory<br>check [script] [args...] Print a script's logs to Terminal<br>clear Clear all text on the terminal <br>cls See 'clear' command <br>connect [ip/hostname] Connects to a remote server<br>download [script/text file] Downloads scripts or text files to your computer<br>expr [math expression] Evaluate a mathematical expression<br>free Check the machine's memory (RAM) usage<br>hack Hack the current machine<br>help [command] Display this help text, or the help text for a command<br>home Connect to home computer<br>hostname Displays the hostname of the machine<br>ifconfig Displays the IP address of the machine<br>kill [script/pid] [args...] Stops the specified script on the current server <br>killall Stops all running scripts on the current machine<br>ls [dir] [| grep pattern] Displays all files on the machine<br>lscpu Displays the number of CPU cores on the machine<br>mem [script] [-t] [n] Displays the amount of RAM required to run the script<br>mv [src] [dest] Move/rename a text or script file<br>nano [file] Text editor - Open up and edit a script or text file<br>ps Display all scripts that are currently running<br>rm [file] Delete a file from the server<br>run [name] [-t] [n] [args...] Execute a program or script<br>scan Prints all immediately-available network connections<br>scan-analyze [d] [-a] Prints info for all servers up to <i>d</i> nodes away<br>scp [file] [server] Copies a file to a destination server<br>sudov Shows whether you have root access on this computer<br>tail [script] [args...] Displays dynamic logs for the specified script<br>theme [preset] | bg txt hlgt Change the color scheme of the UI<br>top Displays all running scripts and their RAM usage<br>unalias [alias name] Deletes the specified alias<br>wget [url] [target file] Retrieves code/text from a web server<br>",t.HelpTexts={alias:"alias [-g] [name=\"value\"] <br>Create or display aliases. An alias enables a replacement of a word with another string. It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME of an alias defines the word that will be replaced, while the VALUE defines what it will be replaced by. For example, you could create the alias 'nuke' for the Terminal command 'run NUKE.exe' using the following: <br><br>alias nuke=\"run NUKE.exe\"<br><br>Then, to run the NUKE.exe program you would just have to enter 'nuke' in Terminal rather than the full command. It is important to note that 'default' aliases will only be substituted for the first word of a Terminal command. For example, if the following alias was set: <br><br>alias worm=\"HTTPWorm.exe\"<br><br>and then you tried to run the following terminal command: <br><br>run worm<br><br>This would fail because the worm alias is not the first word of a Terminal command. To allow an alias to be substituted anywhere in a Terminal command, rather than just the first word, you must set it to be a global alias using the -g flag: <br><br>alias -g worm=\"HTTPWorm.exe\"<br><br>Now, the 'worm' alias will be substituted anytime it shows up as an individual word in a Terminal command. <br><br>Entering just the command 'alias' without any arguments prints the list of all defined aliases in the reusable form 'alias NAME=VALUE' on the Terminal. <br><br>The 'unalias' command can be used to remove aliases.<br><br>",analyze:"analze<br>Prints details and statistics about the current server. The information that is printed includes basic server details such as the hostname, whether the player has root access, what ports are opened/closed, and also hacking-related information such as an estimated chance to successfully hack, an estimate of how much money is available on the server, etc.",buy:"buy [-l / program]<br>Purchase a program through the Dark Web. Requires a TOR router to use.<br><br>If this command is ran with the '-l' flag, it will display a list of all programs that can be bought through the dark web to the Terminal, as well as their costs.<br><br>Otherwise, the name of the program must be passed in as a parameter. This is name is NOT case-sensitive.",cat:"cat [file]<br>Display message (.msg), literature (.lit), or text (.txt) files. Examples:<br><br>cat j1.msg<br>cat foo.lit<br>cat servers.txt",cd:"cd [dir]<br>Change to the specified directory. Note that this works even for directories that don't exist. If you change to a directory that does not exist, it will not be 'created'. Examples:<br><br>cd scripts/hacking<br>cd /logs<br>cd ../",check:"check [script name] [args...]<br>Print the logs of the script specified by the script name and arguments to the Terminal. Each argument must be separated by a space. Remember that a running script is uniquely identified both by its name and the arguments that are used to start it. So, if a script was ran with the following arguments: <br><br>run foo.script 1 2 foodnstuff<br><br>Then to run the 'check' command on this script you would have to pass the same arguments in: <br><br>check foo.script 1 2 foodnstuff",clear:"clear<br>Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up 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",cls:"cls<br>Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up 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",connect:"connect [hostname/ip]<br>Connect to a remote server. The hostname or IP address of the remote server must be given as the argument to this command. Note that only servers that are immediately adjacent to the current server in the network can be connected to. To see which servers can be connected to, use the 'scan' command.",download:"download [script/text file]<br>Downloads a script or text file to your computer (like your real life computer).<br>You can also download all of your scripts/text files as a zip file using the following Terminal commands:<br><br>Download all scripts and text files: download *<br>Download all scripts: download *.script<br>Download all text files: download *.txt<br>",expr:"expr [mathematical expression]<br>Evaluate a simple mathematical expression. Supports native JavaScript operators:<br>+, -, /, *, **, %<br>Example:<br>expr 25 * 2 ** 10<br>Note that letters (non-digits) are not allowed and will be removed from the input.",free:"free<br>Display's the memory usage on the current machine. Print the amount of RAM that is available on the current server as well as how much of it is being used.",hack:"hack<br>Attempt to hack the current server. Requires root access in order to be run. See the wiki page for hacking mechanics<br>",help:"help [command]<br>Display Terminal help information. Without arguments, 'help' prints a list of all valid Terminal commands and a brief description of their functionality. You can also pass the name of a Terminal command as an argument to 'help' to print more detailed information about the Terminal command. Examples: <br><br>help alias<br>help scan-analyze",home:"home<br>Connect to your home computer. This will work no matter what server you are currently connected to.",hostname:"hostname<br>Prints the hostname of the current server",ifconfig:"ipconfig<br>Prints the IP address of the current server",kill:"kill [script name] [args...]<br>kill [pid]<br>Kill the script specified by the script name and arguments OR by its PID.<br><br>If you are killing the script using its filename and arguments, then each argument must be separated by a space. Remember that a running script is uniquely identified by both its name and the arguments that are used to start it. So, if a script was ran with the following arguments:<br><br>run foo.script 1 sigma-cosmetics<br><br>Then to kill this script the same arguments would have to be used:<br><br>kill foo.script 1 sigma-cosmetics<br><br>If you are killing the script using its PID, then the PID argument must be numeric",killall:"killall<br>Kills all scripts on the current server. Note that after the 'kill' command is issued for a script, it may take a while for the script to actually stop running. This will happen if the script is in the middle of a command such as grow() or weaken() that takes time to execute. The script will not be stopped/killed until after that time has elapsed.",ls:"ls [dir] [| grep pattern]<br>The ls command, with no arguments, prints all files and directories on the current server's directory to the Terminal screen. The files will be displayed in alphabetical order. <br><br>The 'dir' optional parameter can be used to display files/directories in another directory.<br><br>The '| grep pattern' optional parameter can be used to only display files whose filenames match the specified pattern.<br><br>Examples:<br><br>List all files with the '.script' extension in the current directory:<br>ls | grep .script<br><br>List all files with the '.js' extension in the root directory:<br>ls / | grep .js<br><br>List all files with the word 'purchase' in the filename, in the 'scripts' directory:<br>ls scripts | grep purchase",lscpu:"lscpu<br>Prints the number of CPU Cores the current server has",mem:"mem [script name] [-t] [num threads]<br>Displays the amount of RAM needed to run the specified script with a single thread. The command can also be used to print the amount of RAM needed to run a script with multiple threads using the '-t' flag. If the '-t' flag is specified, then an argument for the number of threads must be passed in afterwards. Examples:<br><br>mem foo.script<br>mem foo.script -t 50<br>The first example above will print the amount of RAM needed to run 'foo.script' with a single thread. The second example above will print the amount of RAM needed to run 'foo.script' with 50 threads.",mv:"mv [src] [dest]<br>Move the source file to the specified destination. This can also be used to rename files. This command only works for scripts and text files (.txt). This command CANNOT be used to convert to different file types<br><br>Note that, unlike the Linux 'mv' command, the destination argument must be the full filepath. Examples: <br><br>mv hacking-controller.script scripts/hacking-controller.script<br>mv myScript.js myOldScript.js",nano:"nano [file name]<br>Opens up the specified file in the Text Editor. Only scripts (.script) or text files (.txt) can be edited using the Text Editor. If the file does not already exist, then a new, empty one will be created",ps:"ps<br>Prints all scripts that are running on the current server",rm:"rm [file]<br>Removes the specified file from the current server. A file can be a script, a program, or a message file. <br><br>WARNING: This is permanent and cannot be undone",run:"run [file name] [-t] [num threads] [args...]<br>Execute a program or a script.<br><br>The '[-t]', '[num threads]', and '[args...]' arguments are only valid when running a script. The '-t' flag is used to indicate that the script should be run with the specified number of threads. If the flag is omitted, then the script will be run with a single thread by default. If the '-t' flag is used, then it MUST come immediately after the script name, and the [num threads] argument MUST come immediately afterwards. <br><br>[args...] represents a variable number of arguments that will be passed into the script. See the documentation about script arguments. Each specified argument must be separated by a space. <br><br>",scan:"scan<br>Prints all immediately-available network connection. This will print a list of all servers that you can currently connect to using the 'connect' Terminal command.","scan-analyze":"scan-analyze [depth] [-a]<br>Prints detailed information about all servers up to [depth] nodes away on the network. Calling 'scan-analyze 1' will display information for the same servers that are shown by the 'scan' Terminal command. This command also shows the relative paths to reach each server.<br><br>By default, the maximum depth that can be specified for 'scan-analyze' is 3. However, once you have the DeepscanV1.exe and DeepscanV2.exe programs, you can execute 'scan-analyze' with a depth up to 5 and 10, respectively.<br><br>The information 'scan-analyze' displays about each server includes whether or not you have root access to it, its required hacking level, the number of open ports required to run NUKE.exe on it, and how much RAM it has.<br><br>By default, this command will not display servers that you have purchased. However, you can pass in the -a flag at the end of the command if you would like to enable that.",scp:"scp [filename] [target server]<br>Copies the specified file from the current server to the target server. This command only works for script files (.script extension), literature files (.lit extension), and text files (.txt extension). The second argument passed in must be the hostname or IP of the target server.",sudov:"sudov<br>Prints whether or not you have root access to the current machine",tail:"tail [script name] [args...]<br>Displays dynamic logs for the script specified by the script name and arguments. Each argument must be separated by a space. Remember that a running script is uniquely identified by both its name and the arguments that were used to run it. So, if a script was ran with the following arguments: <br><br>run foo.script 10 50000<br><br>Then in order to check its logs with 'tail' the same arguments must be used: <br><br>tail foo.script 10 50000",theme:"theme [preset] | [#background #text #highlight]<br>Change the color of the game's user interface<br><br>This command can be called with a preset theme. Currently, the supported presets are 'default', 'muted', and 'solarized'. However, you can also specify your own color scheme using hex values. To do so, you must specify three hex color values for the background color, the text color, and the highlight color. These hex values must be preceded by a pound sign (#) and must be either 3 or 6 digits. Example:<br><br>theme #ffffff #385 #235012<br><br>A color picker such as <a href='https://www.google.com/search?q=color+picker&oq=color+picker&aqs=chrome.0.0l6.951j0j1&sourceid=chrome&ie=UTF-8' target='_blank'>Google's</a> can be used to get your desired hex color values<br><br>Themes are not saved, so when the game is closed and then re-opened or reloaded then it will revert back to the default theme.",top:"top<br>Prints a list of all scripts running on the current server as well as their thread count and how much RAM they are using in total.",unalias:"unalias [alias name]<br>Deletes the specified alias. Note that the double quotation marks are required. <br><br>As an example, if an alias was declared using:<br><br>alias r=\"run\"<br><br>Then it could be removed using:<br><br>unalias r<br><br>It is not necessary to differentiate between global and non-global aliases when using 'unalias'",wget:"wget [url] [target file]<br>Retrieves data from a URL and downloads it to a file on the current server. The data can only be downloaded to a script (.script, .ns, .js) or a text file (.txt). If the file already exists, it will be overwritten by this command.<br><br>Note that it will not be possible to download data from many websites because they do not allow cross-origin resource sharing (CORS). Example:<br><br>wget https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md game_readme.txt"}},function(e,t,n){"use strict";function r(e,t){const n=e.hostname;return"requiredHackingSkill"in e?!1===e.hasAdminRights?{res:!1,msg:`Cannot ${t} ${n} server because you do not have root access`}:{res:!0}:{res:!1,msg:`Cannot ${t} ${n} server because it is a Hacknet Node`}}Object.defineProperty(t,"__esModule",{value:!0}),t.netscriptCanHack=function(e,t){const n=r(e,"hack");return n.res?e.requiredHackingSkill>t.hacking_skill?{res:!1,msg:`Cannot hack ${e.hostname} server because your hacking skill is not high enough`}:{res:!0}:n},t.netscriptCanGrow=function(e){return r(e,"grow")},t.netscriptCanWeaken=function(e){return r(e,"weaken")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6),a=n(20),i=n(22),o=n(101),s=n(40),l=n(17),c=n(2),u=n(8),m=n(45),p=n(3),h=n(37),d=n(55),_=n(27);t.createTravelPopup=function(e,t){const n=r.CONSTANTS.TravelCost;if(l.Settings.SuppressTravelConfirmation)return void t(e);const a=m.yesNoBoxGetYesButton(),i=m.yesNoBoxGetNoButton();null!=a&&null!=i?(a.innerHTML="Yes",a.addEventListener("click",()=>(m.yesNoBoxClose(),t(e),!1)),i.innerHTML="No",i.addEventListener("click",()=>(m.yesNoBoxClose(),!1)),m.yesNoBoxCreate(`Would you like to travel to ${e}? The trip will `+`cost ${c.numeralWrapper.formatMoney(n)}`)):console.warn("Could nto find YesNo pop-up box buttons")},t.createPurchaseServerPopup=function(e,t){const n=o.getPurchaseServerCost(e);if(n!==1/0){var r=m.yesNoTxtInpBoxGetYesButton(),a=m.yesNoTxtInpBoxGetNoButton();null!=r&&null!=a&&(r.innerHTML="Purchase Server",a.innerHTML="Cancel",r.addEventListener("click",function(){o.purchaseServer(e,t),m.yesNoTxtInpBoxClose()}),a.addEventListener("click",function(){m.yesNoTxtInpBoxClose()}),m.yesNoTxtInpBoxCreate(`Would you like to purchase a new server with ${e} GB of RAM for `+`${c.numeralWrapper.formatMoney(n)}?<br><br>Please enter the server hostname below:<br>`))}else u.dialogBoxCreate("Something went wrong when trying to purchase this server. Please contact developer")},t.createStartCorporationPopup=function(e){if(!e.canAccessCorporation()||e.hasCorporation())return;const t="create-corporation-popup",n=p.createElement("p",{innerHTML:"Would you like to start a corporation? This will require $150b for registration and initial funding. This $150b can either be self-funded, or you can obtain the seed money from the government in exchange for 500 million shares<br><br>If you would like to start one, please enter a name for your corporation below:"}),r=p.createElement("input",{class:"text-input",placeholder:"Corporation Name"}),a=p.createElement("button",{class:"popup-box-button",innerText:"Self-Fund",clickListener:()=>{if(!e.canAfford(15e10))return u.dialogBoxCreate("You don't have enough money to create a corporation! You need $150b"),!1;e.loseMoney(15e10);const n=r.value;if(null==n||""==n)return u.dialogBoxCreate("Invalid company name!"),!1;e.startCorporation(n);const a=document.getElementById("world-menu-header");return a instanceof HTMLElement&&(a.click(),a.click()),u.dialogBoxCreate("Congratulations! You just self-funded your own corporation. You can visit and manage your company in the City"),_.removeElementById(t),!1}}),i=p.createElement("button",{class:"popup-box-button",innerText:"Use Seed Money",clickListener:()=>{const n=r.value;if(null==n||""==n)return u.dialogBoxCreate("Invalid company name!"),!1;e.startCorporation(n,5e8);const a=document.getElementById("world-menu-header");return a instanceof HTMLElement&&(a.click(),a.click()),u.dialogBoxCreate("Congratulations! You just started your own corporation with government seed money. You can visit and manage your company in the City"),_.removeElementById(t),!1}}),o=d.createPopupCloseButton(t,{class:"popup-box-button"});h.createPopup(t,[n,r,o,a,i]),r.focus()},t.createUpgradeHomeCoresPopup=function(e){const t=e.getHomeComputer().cpuCores;if(t>=8)return;const n=[0,1e10,25e10,5e12,1e14,1e15,2e16,2e17][t],r=m.yesNoBoxGetYesButton(),a=m.yesNoBoxGetNoButton();null!=r&&null!=a&&(r.innerHTML="Purchase",r.addEventListener("click",()=>{e.canAfford(n)?(e.loseMoney(n),e.getHomeComputer().cpuCores++,u.dialogBoxCreate("You purchased an additional CPU Core for your home computer! It now has "+e.getHomeComputer().cpuCores+" cores.")):u.dialogBoxCreate("You do not have enough money to purchase an additional CPU Core for your home computer!"),m.yesNoBoxClose()}),a.innerHTML="Cancel",a.addEventListener("click",()=>{m.yesNoBoxClose()}),m.yesNoBoxCreate("Would you like to purchase an additional CPU Core for your home computer? Each CPU Core lets you start with an additional Core Node in Hacking Missions.<br><br>Purchasing an additional core (for a total of "+(e.getHomeComputer().cpuCores+1)+") will cost "+c.numeralWrapper.formatMoney(n)))},t.createUpgradeHomeRamPopup=function(e){const t=e.getUpgradeHomeRamCost(),n=e.getHomeComputer().maxRam,r=m.yesNoBoxGetYesButton(),a=m.yesNoBoxGetNoButton();null!=r&&null!=a&&(r.innerText="Purchase",r.addEventListener("click",()=>{o.purchaseRamForHomeComputer(t,e),m.yesNoBoxClose()}),a.innerText="Cancel",a.addEventListener("click",()=>{m.yesNoBoxClose()}),m.yesNoBoxCreate("Would you like to purchase additional RAM for your home computer? <br><br>This will upgrade your RAM from "+n+"GB to "+2*n+"GB. <br><br>This will cost "+c.numeralWrapper.format(t,"$0.000a")))},t.purchaseTorRouter=function(e){if(e.hasTorRouter())return void u.dialogBoxCreate("You already have a TOR Router");if(!e.canAfford(r.CONSTANTS.TorRouterCost))return void u.dialogBoxCreate("You cannot afford to purchase the Tor router");e.loseMoney(r.CONSTANTS.TorRouterCost);const t=i.safetlyCreateUniqueServer({ip:a.createUniqueRandomIp(),hostname:"darkweb",organizationName:"",isConnectedTo:!1,adminRights:!1,purchasedByPlayer:!1,maxRam:1});a.AddToAllServers(t),s.SpecialServerIps.addIp("Darkweb Server",t.ip),e.getHomeComputer().serversOnNetwork.push(t.ip),t.serversOnNetwork.push(e.getHomeComputer().ip),u.dialogBoxCreate("You have purchased a Tor router!<br>You now have access to the dark web from your home computer<br>Use the scan/scan-analyze commands to search for the dark web connection.")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.AutoupdatingStdButton=class extends r.Component{constructor(e){super(e),this.interval=0,this.state={i:0}}componentDidMount(){const e=this.props.intervalTime?this.props.intervalTime:1e3;this.interval=setInterval(()=>this.tick(),e)}componentWillUnmount(){clearInterval(this.interval)}tick(){this.setState(e=>({i:e.i+1}))}render(){const e=null!=this.props.tooltip&&""!==this.props.tooltip;let t,n=this.props.disabled?"std-button-disabled":"std-button";return e&&(n+=" tooltip"),e&&(t={__html:this.props.tooltip}),r.createElement("button",{className:n,onClick:this.props.onClick,style:this.props.style},this.props.text,e&&r.createElement("span",{className:"tooltiptext",dangerouslySetInnerHTML:t}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Company=0]="Company",e[e.Gym=1]="Gym",e[e.Hospital=2]="Hospital",e[e.Slums=3]="Slums",e[e.Special=4]="Special",e[e.StockMarket=5]="StockMarket",e[e.TechVendor=6]="TechVendor",e[e.TravelAgency=7]="TravelAgency",e[e.University=8]="University"}(t.LocationType||(t.LocationType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),a=n(15),i=n(88),o=n(16),s=n(33);class l{constructor(e=null){this.name="",this.desc="",this.level=1,this.maxLevel=1,this.autoLevel=!0,this.baseDifficulty=100,this.difficultyFac=1.01,this.rewardFac=1.02,this.successes=0,this.failures=0,this.rankGain=0,this.rankLoss=0,this.hpLoss=0,this.hpLost=0,this.isStealth=!1,this.isKill=!1,this.count=a.getRandomInt(1e3,25e3),this.countGrowth=a.getRandomInt(1,5),this.weights={hack:1/7,str:1/7,def:1/7,dex:1/7,agi:1/7,cha:1/7,int:1/7},this.decays={hack:.9,str:.9,def:.9,dex:.9,agi:.9,cha:.9,int:.9},this.teamCount=0,e&&e.name&&(this.name=e.name),e&&e.desc&&(this.desc=e.desc),e&&e.baseDifficulty&&(this.baseDifficulty=i.addOffset(e.baseDifficulty,10)),e&&e.difficultyFac&&(this.difficultyFac=e.difficultyFac),e&&e.rewardFac&&(this.rewardFac=e.rewardFac),e&&e.rankGain&&(this.rankGain=e.rankGain),e&&e.rankLoss&&(this.rankLoss=e.rankLoss),e&&e.hpLoss&&(this.hpLoss=e.hpLoss),e&&e.isStealth&&(this.isStealth=e.isStealth),e&&e.isKill&&(this.isKill=e.isKill),e&&e.count&&(this.count=e.count),e&&e.countGrowth&&(this.countGrowth=e.countGrowth),e&&e.weights&&(this.weights=e.weights),e&&e.decays&&(this.decays=e.decays);let t=0;for(const e in this.weights)this.weights.hasOwnProperty(e)&&(t+=this.weights[e]);if(t-1>=10*Number.EPSILON)throw new Error("Invalid weights when constructing Action "+this.name+". The weights should sum up to 1. They sum up to :1");for(const e in this.decays)if(this.decays.hasOwnProperty(e)&&this.decays[e]>1)throw new Error("Invalid decays when constructing Action "+this.name+". Decay value cannot be greater than 1")}getDifficulty(){const e=this.baseDifficulty*Math.pow(this.difficultyFac,this.level-1);if(isNaN(e))throw new Error("Calculated NaN in Action.getDifficulty()");return e}attempt(e){return Math.random()<this.getSuccessChance(e)}getActionTimePenalty(){return 1}getActionTime(e){let t=this.getDifficulty()/s.BladeburnerConstants.DifficultyToTimeFactor;const n=e.skillMultipliers.actionTime,a=r.Player.agility*e.skillMultipliers.effAgi,i=r.Player.dexterity*e.skillMultipliers.effDex,o=.5*(Math.pow(a,s.BladeburnerConstants.EffAgiExponentialFactor)+Math.pow(i,s.BladeburnerConstants.EffDexExponentialFactor)+a/s.BladeburnerConstants.EffAgiLinearFactor+i/s.BladeburnerConstants.EffDexLinearFactor);return t=Math.max(1,t*n/o),Math.ceil(t*this.getActionTimePenalty())}getTeamSuccessBonus(e){return 1}getActionTypeSkillSuccessBonus(e){return 1}getChaosCompetencePenalty(e,t){const n=e.getCurrentCity();return t.est?Math.pow(n.popEst/s.BladeburnerConstants.PopulationThreshold,s.BladeburnerConstants.PopulationExponent):Math.pow(n.pop/s.BladeburnerConstants.PopulationThreshold,s.BladeburnerConstants.PopulationExponent)}getChaosDifficultyBonus(e,t){const n=e.getCurrentCity();if(n.chaos>s.BladeburnerConstants.ChaosThreshold){const e=n.chaos-s.BladeburnerConstants.ChaosThreshold+1;return Math.pow(e,.1)}return 1}getSuccessChance(e,t={}){if(null==e)throw new Error("Invalid Bladeburner instance passed into Action.getSuccessChance");let n=this.getDifficulty(),a=0;for(let t in this.weights)if(this.weights.hasOwnProperty(t)){let n=r.Player.queryStatFromString(t),i="eff"+t.charAt(0).toUpperCase()+t.slice(1),o=e.skillMultipliers[i];null==o&&(console.error(`Failed to find Bladeburner Skill multiplier for: ${t}`),o=1),a+=this.weights[t]*Math.pow(o*n,this.decays[t])}if(a*=r.Player.getIntelligenceBonus(.75),a*=e.calculateStaminaPenalty(),a*=this.getTeamSuccessBonus(e),a*=this.getChaosCompetencePenalty(e,t),n*=this.getChaosDifficultyBonus(e,t),"Raid"==this.name&&e.getCurrentCity().comms<=0)return 0;if(a*=e.skillMultipliers.successChanceAll,a*=this.getActionTypeSkillSuccessBonus(e),this.isStealth&&(a*=e.skillMultipliers.successChanceStealth),this.isKill&&(a*=e.skillMultipliers.successChanceKill),a*=r.Player.bladeburner_success_chance_mult,isNaN(a))throw new Error("Competence calculated as NaN in Action.getSuccessChance()");return Math.min(1,a/n)}getSuccessesNeededForNextLevel(e){return Math.ceil(.5*this.maxLevel*(2*e+(this.maxLevel-1)))}setMaxLevel(e){this.successes>=this.getSuccessesNeededForNextLevel(e)&&++this.maxLevel}static fromJSON(e){return o.Generic_fromJSON(l,e.data)}toJSON(){return o.Generic_toJSON("Action",this)}}t.Action=l,o.Reviver.constructors.Action=l},,,,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidIPAddress=function(e){const t="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",n=`^${t}.${t}.${t}.${t}$`;return new RegExp(n).test(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.EventEmitter=class{constructor(e){if(this.subscribers={},Array.isArray(e))for(const t of e)this.addSubscriber(t)}addSubscriber(e){this.subscribers[e.id]=e.cb}emitEvent(...e){for(const t in this.subscribers)(0,this.subscribers[t])(e)}removeSubscriber(e){delete this.subscribers[e]}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(126),a=n(16);class i extends r.Operation{constructor(e=null){super(e),this.count=1,this.countGrowth=0}getActionTimePenalty(){return 1.5}getChaosCompetencePenalty(e,t){return 1}getChaosDifficultyBonus(e,t){return 1}static fromJSON(e){return a.Generic_fromJSON(i,e.data)}toJSON(){return a.Generic_toJSON("BlackOperation",this)}}t.BlackOperation=i,a.Reviver.constructors.BlackOperation=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(19);t.Skill=class{constructor(e={name:"foo",desc:"foo"}){if(this.baseCost=1,this.costInc=1,this.maxLvl=0,this.successChanceAll=0,this.successChanceStealth=0,this.successChanceKill=0,this.successChanceContract=0,this.successChanceOperation=0,this.successChanceEstimate=0,this.actionTime=0,this.effHack=0,this.effStr=0,this.effDef=0,this.effDex=0,this.effAgi=0,this.effCha=0,this.stamina=0,this.money=0,this.expGain=0,!e.name)throw new Error("Failed to initialize Bladeburner Skill. No name was specified in ctor");if(!e.desc)throw new Error("Failed to initialize Bladeburner Skills. No desc was specified in ctor");this.name=e.name,this.desc=e.desc,this.baseCost=e.baseCost?e.baseCost:1,this.costInc=e.costInc?e.costInc:1,e.maxLvl&&(this.maxLvl=e.maxLvl),e.successChanceAll&&(this.successChanceAll=e.successChanceAll),e.successChanceStealth&&(this.successChanceStealth=e.successChanceStealth),e.successChanceKill&&(this.successChanceKill=e.successChanceKill),e.successChanceContract&&(this.successChanceContract=e.successChanceContract),e.successChanceOperation&&(this.successChanceOperation=e.successChanceOperation),e.successChanceEstimate&&(this.successChanceEstimate=e.successChanceEstimate),e.actionTime&&(this.actionTime=e.actionTime),e.effHack&&(this.effHack=e.effHack),e.effStr&&(this.effStr=e.effStr),e.effDef&&(this.effDef=e.effDef),e.effDex&&(this.effDex=e.effDex),e.effAgi&&(this.effAgi=e.effAgi),e.effCha&&(this.effCha=e.effCha),e.stamina&&(this.stamina=e.stamina),e.money&&(this.money=e.money),e.expGain&&(this.expGain=e.expGain)}calculateCost(e){return Math.floor((this.baseCost+e*this.costInc)*r.BitNodeMultipliers.BladeburnerSkillCost)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(10),a=n(4),i=n(13);t.findSleevePurchasableAugs=function(e,t){const n=e.augmentations.map(e=>e.name),o=[];function s(e){return e.name!==a.AugmentationNames.NeuroFluxGovernor&&!n.includes(e.name)&&!o.includes(e)&&!e.isSpecial}if(t.inGang()){const e=t.getGangFaction();for(const t in r.Augmentations){const n=r.Augmentations[t];s(n)&&e.playerReputation>n.baseRepRequirement&&o.push(n)}return o}for(const e of t.factions){if("Bladeburners"===e)continue;if("Netburners"===e)continue;const t=i.Factions[e];if(null!=t)for(const e of t.augmentations){const n=r.Augmentations[e];s(n)&&t.playerReputation>n.baseRepRequirement&&o.push(n)}}return o}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",function(){return executeJSScript});var _NetscriptEvaluator__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(63),_Script_Script__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(106),_Script_Script__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_Script_Script__WEBPACK_IMPORTED_MODULE_1__),_Script_ScriptUrl__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(286),_Script_ScriptUrl__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_Script_ScriptUrl__WEBPACK_IMPORTED_MODULE_2__);function makeScriptBlob(e){return new Blob([e],{type:"text/javascript"})}async function executeJSScript(scripts=[],workerScript){let loadedModule,urls=null,script=workerScript.getScript();shouldCompile(script,scripts)&&(urls=_getScriptUrls(script,scripts,[]),script.url=urls[urls.length-1].url,script.module=new Promise(resolve=>resolve(eval("import(urls[urls.length - 1].url)"))),script.dependencies=urls),loadedModule=await script.module;let ns=workerScript.env.vars;try{if(!loadedModule.main)throw Object(_NetscriptEvaluator__WEBPACK_IMPORTED_MODULE_0__.b)(workerScript,`${script.filename} cannot be run because it does not have a main function.`);return loadedModule.main(ns)}finally{if(null!=urls)for(const e in urls)URL.revokeObjectURL(e.url)}}function shouldCompile(e,t){return""===e.module||e.dependencies.some(n=>{const r=t.find(e=>e.filename==n.url);return!r||r.moduleSequenceNumber>e.moduleSequenceNumber})}function _getScriptUrls(e,t,n){const r=[];n.push(e);try{let a=e.code.replace(/((?:from|import)\s+(?:'|"))(?:\.\/)?([^'"]+)('|";)/g,(e,a,i,o)=>{if(!t.some(e=>e.filename==i))return e;const[s]=t.filter(e=>e.filename==i),l=_getScriptUrls(s,t,n);return r.push(...l),[a,l[l.length-1].url,o].join("")});return a+='\n\nfunction print() {throw new Error("Invalid call to window.print(). Did you mean to use Netscript\'s print()?");}',r.push(new _Script_ScriptUrl__WEBPACK_IMPORTED_MODULE_2__.ScriptUrl(e.filename,URL.createObjectURL(makeScriptBlob(a)))),r}catch(e){for(const e in r)URL.revokeObjectURL(e);throw e}finally{n.pop()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3);t.createAccordionElement=function(e){const t=r.createElement("li"),n=r.createElement("button",{class:"accordion-header",clickListener(){this.classList.toggle("active");const e=this.nextElementSibling.style;e.display="block"===e.display?"none":"block"},id:void 0!==e.id?`${e.id}-hdr`:void 0,innerHTML:e.hdrText}),a=r.createElement("div",{class:"accordion-panel",id:void 0!==e.id?`${e.id}-panel`:void 0,innerHTML:e.panelText});return t.appendChild(n),t.appendChild(a),[t,n,a]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearSelector=function(e){for(let t=e.options.length-1;t>=0;t--)e.remove(t)}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"calculateRamUsage",function(){return calculateRamUsage});var acorn_walk__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(184),acorn__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(81),_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(99),_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__),_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(9),_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__);const specialReferenceIF="__SPECIAL_referenceIf",specialReferenceFOR="__SPECIAL_referenceFor",specialReferenceWHILE="__SPECIAL_referenceWhile",memCheckGlobalKey=".__GLOBAL__";async function parseOnlyRamCalculate(otherScripts,code,workerScript){try{let dependencyMap={};const completedParses=new Set,parseQueue=[];function parseCode(e,t){const n=parseOnlyCalculateDeps(e,t);completedParses.add(t);for(let e=0;e<n.additionalModules.length;++e)completedParses.has(n.additionalModules[e])||parseQueue.push(n.additionalModules[e]);dependencyMap=Object.assign(dependencyMap,n.dependencyMap)}const initialModule="__SPECIAL_INITIAL_MODULE__";for(parseCode(code,initialModule);parseQueue.length>0;){const nextModule=parseQueue.shift();let code;if(nextModule.startsWith("https://")||nextModule.startsWith("http://"))try{const module=await eval("import(nextModule)");code="";for(const e in module)"function"==typeof module[e]&&(code+=module[e].toString()+";\n")}catch(e){return console.error(`Error dynamically importing module from ${nextModule} for RAM calculations: ${e}`),_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.RamCalculationErrorCode.URLImportError}else{if(!Array.isArray(otherScripts))return console.warn("parseOnlyRamCalculate() not called with array of scripts"),_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.RamCalculationErrorCode.ImportError;let e=null,t=nextModule.startsWith("./")?nextModule.slice(2):nextModule;for(const n of otherScripts)if(n.filename===t){e=n;break}if(null==e)return _RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.RamCalculationErrorCode.ImportError;code=e.code}parseCode(code,nextModule)}let ram=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.RamCostConstants.ScriptBaseRamCost;const unresolvedRefs=Object.keys(dependencyMap).filter(e=>e.startsWith(initialModule)),resolvedRefs=new Set;for(;unresolvedRefs.length>0;){const e=unresolvedRefs.shift();if("hacknet"!==e||resolvedRefs.has("hacknet")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.RamCostConstants.ScriptHacknetNodesRamCost),"document"!==e||resolvedRefs.has("document")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.RamCostConstants.ScriptDomRamCost),"window"!==e||resolvedRefs.has("window")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.RamCostConstants.ScriptDomRamCost),resolvedRefs.add(e),e.endsWith(".*")){const t=e.slice(0,e.length-2);for(let e of Object.keys(dependencyMap).filter(e=>e.startsWith(t)))for(let t of dependencyMap[e]||[])resolvedRefs.has(t)||unresolvedRefs.push(t)}else for(let t of dependencyMap[e]||[])resolvedRefs.has(t)||unresolvedRefs.push(t);try{function applyFuncRam(e){if("function"!=typeof e)return 0;try{let t;return"number"==typeof(t="AsyncFunction"===e.constructor.name?0:e.apply(null,[]))?t:0}catch(e){return console.error(`Error applying function: ${e}`),0}}if(workerScript.loadedFns[e])continue;let t;workerScript.loadedFns[e]=!0,t=e in workerScript.env.vars.bladeburner?workerScript.env.vars.bladeburner[e]:e in workerScript.env.vars.codingcontract?workerScript.env.vars.codingcontract[e]:e in workerScript.env.vars.gang?workerScript.env.vars.gang[e]:e in workerScript.env.vars.sleeve?workerScript.env.vars.sleeve[e]:workerScript.env.vars[e],ram+=applyFuncRam(t)}catch(e){continue}}return ram}catch(e){return _RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.RamCalculationErrorCode.SyntaxError}}function parseOnlyCalculateDeps(e,t){const n=Object(acorn__WEBPACK_IMPORTED_MODULE_1__.b)(e,{sourceType:"module",ecmaVersion:9}),r=t+memCheckGlobalKey,a={};a[r]=new Set;let i={};var o=[];function s(e,n){const r=a[e]||(a[e]=new Set);n in i&&r.add(i[n]),r.add(t+"."+n),r.add(n)}const l=Object.getOwnPropertyNames(Object.prototype);function c(){return{Identifier:(e,t,n)=>{l.includes(e.name)||s(t.key,e.name)},WhileStatement:(e,t,n)=>{s(t.key,specialReferenceWHILE),e.test&&n(e.test,t),e.body&&n(e.body,t)},DoWhileStatement:(e,t,n)=>{s(t.key,specialReferenceWHILE),e.test&&n(e.test,t),e.body&&n(e.body,t)},ForStatement:(e,t,n)=>{s(t.key,specialReferenceFOR),e.init&&n(e.init,t),e.test&&n(e.test,t),e.update&&n(e.update,t),e.body&&n(e.body,t)},IfStatement:(e,t,n)=>{s(t.key,specialReferenceIF),e.test&&n(e.test,t),e.consequent&&n(e.consequent,t),e.alternate&&n(e.alternate,t)},MemberExpression:(e,t,n)=>{e.object&&n(e.object,t),e.property&&n(e.property,t)}}}return acorn_walk__WEBPACK_IMPORTED_MODULE_0__.recursive(n,{key:r},Object.assign({ImportDeclaration:(e,t,n)=>{const r=e.source.value;o.push(r),a[t.key].add(r+memCheckGlobalKey);for(let n=0;n<e.specifiers.length;++n){const o=e.specifiers[n];void 0!==o.imported&&void 0!==o.local?i[o.local.name]=r+"."+o.imported.name:a[t.key].add(r+".*")}},FunctionDeclaration:(e,n,r)=>{const a=t+"."+e.id.name;acorn_walk__WEBPACK_IMPORTED_MODULE_0__.recursive(e,{key:a},c())}},c())),{dependencyMap:a,additionalModules:o}}async function calculateRamUsage(e,t){const n={loadedFns:{},env:{vars:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.RamCosts}};try{return await parseOnlyRamCalculate(t,e,n)}catch(e){return console.error("Failed to parse script for RAM calculations:"),console.error(e),_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.RamCalculationErrorCode.SyntaxError}return _RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.RamCalculationErrorCode.SyntaxError}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(115),a=n(27);t.removeLoadingScreen=function(){a.removeElementById("loader"),r.getElementById("entire-game-container").style.visibility="visible"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(387),i=n(386);t.ActiveScriptsRoot=class extends r.Component{constructor(e){super(e)}render(){return r.createElement(r.Fragment,null,r.createElement("p",null,"This page displays a list of all of your scripts that are currently running across every machine. It also provides information about each script's production. The scripts are categorized by the hostname of the servers on which they are running."),r.createElement(a.ScriptProduction,Object.assign({},this.props)),r.createElement(i.ServerAccordions,Object.assign({},this.props)))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(389),a=n(10),i=n(2),o=n(11),s=n(8),l=n(49),c=n(3),u=n(58),m=n(94),p=n(44),h=n(82),d={container:null,info:null,sortTag:null,sortSelector:null,resleeveList:null,resleeves:null};let _;function g(e){const t={container:null,statsPanel:null,stats:null,multipliersButton:null,augPanel:null,augSelector:null,augDescription:null,costPanel:null,costText:null,buyButton:null};if(!o.routing.isOn(o.Page.Resleeves))return t;t.container=c.createElement("div",{class:"resleeve-container",display:"block"}),t.statsPanel=c.createElement("div",{class:"resleeve-panel",width:"30%"}),t.stats=c.createElement("p",{class:"resleeve-stats-text",innerHTML:`Hacking: ${i.numeralWrapper.format(e.hacking_skill,"0,0")} (${i.numeralWrapper.formatBigNumber(e.hacking_exp)} exp)<br>`+`Strength: ${i.numeralWrapper.format(e.strength,"0,0")} (${i.numeralWrapper.formatBigNumber(e.strength_exp)} exp)<br>`+`Defense: ${i.numeralWrapper.format(e.defense,"0,0")} (${i.numeralWrapper.formatBigNumber(e.defense_exp)} exp)<br>`+`Dexterity: ${i.numeralWrapper.format(e.dexterity,"0,0")} (${i.numeralWrapper.formatBigNumber(e.dexterity_exp)} exp)<br>`+`Agility: ${i.numeralWrapper.format(e.agility,"0,0")} (${i.numeralWrapper.formatBigNumber(e.agility_exp)} exp)<br>`+`Charisma: ${i.numeralWrapper.format(e.charisma,"0,0")} (${i.numeralWrapper.formatBigNumber(e.charisma_exp)} exp)<br>`+`# Augmentations: ${e.augmentations.length}`}),t.multipliersButton=c.createElement("button",{class:"std-button",innerText:"Multipliers",clickListener:()=>{s.dialogBoxCreate(["<h2><u>Total Multipliers:</u></h2>",`Hacking Level multiplier: ${i.numeralWrapper.formatPercentage(e.hacking_mult)}`,`Hacking Experience multiplier: ${i.numeralWrapper.formatPercentage(e.hacking_exp_mult)}`,`Strength Level multiplier: ${i.numeralWrapper.formatPercentage(e.strength_mult)}`,`Strength Experience multiplier: ${i.numeralWrapper.formatPercentage(e.strength_exp_mult)}`,`Defense Level multiplier: ${i.numeralWrapper.formatPercentage(e.defense_mult)}`,`Defense Experience multiplier: ${i.numeralWrapper.formatPercentage(e.defense_exp_mult)}`,`Dexterity Level multiplier: ${i.numeralWrapper.formatPercentage(e.dexterity_mult)}`,`Dexterity Experience multiplier: ${i.numeralWrapper.formatPercentage(e.dexterity_exp_mult)}`,`Agility Level multiplier: ${i.numeralWrapper.formatPercentage(e.agility_mult)}`,`Agility Experience multiplier: ${i.numeralWrapper.formatPercentage(e.agility_exp_mult)}`,`Charisma Level multiplier: ${i.numeralWrapper.formatPercentage(e.charisma_mult)}`,`Charisma Experience multiplier: ${i.numeralWrapper.formatPercentage(e.charisma_exp_mult)}`,`Hacking Chance multiplier: ${i.numeralWrapper.formatPercentage(e.hacking_chance_mult)}`,`Hacking Speed multiplier: ${i.numeralWrapper.formatPercentage(e.hacking_speed_mult)}`,`Hacking Money multiplier: ${i.numeralWrapper.formatPercentage(e.hacking_money_mult)}`,`Hacking Growth multiplier: ${i.numeralWrapper.formatPercentage(e.hacking_grow_mult)}`,`Salary multiplier: ${i.numeralWrapper.formatPercentage(e.work_money_mult)}`,`Company Reputation Gain multiplier: ${i.numeralWrapper.formatPercentage(e.company_rep_mult)}`,`Faction Reputation Gain multiplier: ${i.numeralWrapper.formatPercentage(e.faction_rep_mult)}`,`Crime Money multiplier: ${i.numeralWrapper.formatPercentage(e.crime_money_mult)}`,`Crime Success multiplier: ${i.numeralWrapper.formatPercentage(e.crime_success_mult)}`,`Hacknet Income multiplier: ${i.numeralWrapper.formatPercentage(e.hacknet_node_money_mult)}`,`Hacknet Purchase Cost multiplier: ${i.numeralWrapper.formatPercentage(e.hacknet_node_purchase_cost_mult)}`,`Hacknet Level Upgrade Cost multiplier: ${i.numeralWrapper.formatPercentage(e.hacknet_node_level_cost_mult)}`,`Hacknet Ram Upgrade Cost multiplier: ${i.numeralWrapper.formatPercentage(e.hacknet_node_ram_cost_mult)}`,`Hacknet Core Upgrade Cost multiplier: ${i.numeralWrapper.formatPercentage(e.hacknet_node_core_cost_mult)}`,`Bladeburner Max Stamina multiplier: ${i.numeralWrapper.formatPercentage(e.bladeburner_max_stamina_mult)}`,`Bladeburner Stamina Gain multiplier: ${i.numeralWrapper.formatPercentage(e.bladeburner_stamina_gain_mult)}`,`Bladeburner Field Analysis multiplier: ${i.numeralWrapper.formatPercentage(e.bladeburner_analysis_mult)}`,`Bladeburner Success Chance multiplier: ${i.numeralWrapper.formatPercentage(e.bladeburner_success_chance_mult)}`].join("<br>"),!1)}}),t.statsPanel.appendChild(t.stats),t.statsPanel.appendChild(t.multipliersButton),t.augPanel=c.createElement("div",{class:"resleeve-panel",width:"50%"}),t.augSelector=c.createElement("select",{class:"resleeve-aug-selector dropdown"}),t.augDescription=c.createElement("p");for(let n=0;n<e.augmentations.length;++n)t.augSelector.add(u.createOptionElement(e.augmentations[n].name));t.augSelector.addEventListener("change",()=>{!function(e){const t=m.getSelectValue(e.augSelector),n=a.Augmentations[t];if(null==n)return void console.warn(`Could not find Augmentation with name ${t}`);e.augDescription.innerHTML=n.info}(t)}),t.augSelector.dispatchEvent(new Event("change")),t.augPanel.appendChild(t.augSelector),t.augPanel.appendChild(t.augDescription);const n=e.getCost();return t.costPanel=c.createElement("div",{class:"resleeve-panel",width:"20%"}),t.costText=c.createElement("p",{innerText:`It costs ${i.numeralWrapper.formatMoney(n)} `+"to purchase this Sleeve."}),t.buyButton=c.createElement("button",{class:"std-button",innerText:"Purchase",clickListener:()=>{r.purchaseResleeve(e,_)?s.dialogBoxCreate(`You re-sleeved for ${i.numeralWrapper.formatMoney(n)}!`,!1):s.dialogBoxCreate("You cannot afford to re-sleeve into this body",!1)}}),t.costPanel.appendChild(t.costText),t.costPanel.appendChild(t.buyButton),t.container.appendChild(t.statsPanel),t.container.appendChild(t.augPanel),t.container.appendChild(t.costPanel),t}t.createResleevesPage=function(e){if(o.routing.isOn(o.Page.Resleeves))try{let t;_=e,d.container=c.createElement("div",{class:"generic-menupage-container",id:"resleeves-container",position:"fixed"}),d.info=c.createElement("p",{display:"block",innerHTML:"Re-sleeving is the process of digitizing and transferring your consciousness into a new human body, or 'sleeve'. Here at VitaLife, you can purchase new specially-engineered bodies for the re-sleeve process. Many of these bodies even come with genetic and cybernetic Augmentations!<br><br>Re-sleeving will change your experience for every stat. It will also REMOVE all of your currently-installed Augmentations, and replace them with the ones provided by the purchased sleeve. However, Augmentations that you have purchased but not installed will NOT be removed. If you have purchased an Augmentation and then re-sleeve into a body which already has that Augmentation, it will be removed (since you cannot have duplicate Augmentations).<br><br>NOTE: The stats and multipliers displayed on this page do NOT include your bonuses from Source-File.",width:"75%"}),0===e.resleeves.length&&(e.resleeves=r.generateResleeves()),d.sortTag=c.createElement("p",{display:"inline-block",innerText:"Sort By: "}),d.sortSelector=c.createElement("select",{class:"dropdown"}),function(e){e.Cost="Cost",e.Hacking="Hacking",e.Strength="Strength",e.Defense="Defense",e.Dexterity="Dexterity",e.Agility="Agility",e.Charisma="Charisma",e.AverageCombatStats="AverageCombat",e.AverageAllStats="AverageAllStats",e.TotalNumAugmentations="TotalNumAugmentations"}(t||(t={})),d.sortSelector.add(u.createOptionElement("Cost",t.Cost)),d.sortSelector.add(u.createOptionElement("Hacking Level",t.Hacking)),d.sortSelector.add(u.createOptionElement("Strength Level",t.Strength)),d.sortSelector.add(u.createOptionElement("Defense Level",t.Defense)),d.sortSelector.add(u.createOptionElement("Dexterity Level",t.Dexterity)),d.sortSelector.add(u.createOptionElement("Agility Level",t.Agility)),d.sortSelector.add(u.createOptionElement("Charisma Level",t.Charisma)),d.sortSelector.add(u.createOptionElement("Average Combat Stats",t.AverageCombatStats)),d.sortSelector.add(u.createOptionElement("Average Stats",t.AverageAllStats)),d.sortSelector.add(u.createOptionElement("Number of Augmentations",t.TotalNumAugmentations)),d.resleeveList=c.createElement("ul"),d.sortSelector.onchange=(()=>{function n(...e){let t=0;for(let n=0;n<e.length;++n)t+=e[n];return t/e.length}switch(p.removeChildrenFromElement(d.resleeveList),d.resleeves=[],m.getSelectValue(d.sortSelector)){case t.Hacking:e.resleeves.sort((e,t)=>e.hacking_skill-t.hacking_skill);break;case t.Strength:e.resleeves.sort((e,t)=>e.strength-t.strength);break;case t.Defense:e.resleeves.sort((e,t)=>e.defense-t.defense);break;case t.Dexterity:e.resleeves.sort((e,t)=>e.dexterity-t.dexterity);break;case t.Agility:e.resleeves.sort((e,t)=>e.agility-t.agility);break;case t.Charisma:e.resleeves.sort((e,t)=>e.charisma-t.charisma);break;case t.AverageCombatStats:e.resleeves.sort((e,t)=>n(e.strength,e.defense,e.dexterity,e.agility)-n(t.strength,t.defense,t.dexterity,t.agility));break;case t.AverageAllStats:e.resleeves.sort((e,t)=>n(e.hacking_skill,e.strength,e.defense,e.dexterity,e.agility,e.charisma)-n(t.hacking_skill,t.strength,t.defense,t.dexterity,t.agility,t.charisma));break;case t.TotalNumAugmentations:e.resleeves.sort((e,t)=>e.augmentations.length-t.augmentations.length);break;case t.Cost:default:e.resleeves.sort((e,t)=>e.getCost()-t.getCost())}for(const t of e.resleeves){const e=g(t);d.resleeveList.appendChild(e.container),d.resleeves.push(e)}}),d.sortSelector.dispatchEvent(new Event("change")),d.container.appendChild(d.info),d.container.appendChild(c.createElement("br")),d.container.appendChild(d.sortTag),d.container.appendChild(d.sortSelector),d.container.appendChild(d.resleeveList),document.getElementById("entire-game-container").appendChild(d.container)}catch(e){l.exceptionAlert(e)}},t.clearResleevesPage=function(){d.container instanceof HTMLElement&&h.removeElement(d.container);for(const e in d)d[e]=null;_=null}},function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return l});n(4),n(77),n(123),n(25),n(96),n(32),n(13),n(0),n(176),n(20),n(22),n(80),n(42),n(117),n(59),n(2),n(8),n(49),n(3),n(58),n(94);var r=n(27),a=n(1),i=n.n(a);n(46);i.a.Component;const o="dev-menu-container";function s(){throw new Error("Cannot create Dev Menu because you are not in a dev build")}function l(){Object(r.removeElementById)(o)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleHelpText={helpList:["Use 'help [command]' to get more information about a particular Bladeburner console command.",""," automate [var] [val] [hi/low] Configure simple automation for Bladeburner tasks"," clear/cls Clear the console"," help [cmd] Display this help text, or help text for a specific command"," log [en/dis] [type] Enable or disable logging for events and actions"," skill [action] [name] Level or display info about your Bladeburner skills"," start [type] [name] Start a Bladeburner action/task"," stop Stops your current Bladeburner action/task"],automate:["automate [var] [val] [hi/low]","","A simple way to automate your Bladeburner actions. This console command can be used to automatically start an action when your stamina rises above a certain threshold, and automatically switch to another action when your stamina drops below another threshold."," automate status - Check the current status of your automation and get a brief description of what it'll do"," automate en - Enable the automation feature"," automate dis - Disable the automation feature","","There are four properties that must be set for this automation to work properly. Here is how to set them:",""," automate stamina 100 high"," automate contract Tracking high"," automate stamina 50 low"," automate general 'Field Analysis' low","","Using the four console commands above will set the automation to perform Tracking contracts if your stamina is 100 or higher, and then switch to Field Analysis if your stamina drops below 50. Note that when setting the action, the name of the action is CASE-SENSITIVE. It must exactly match whatever the name is in the UI."],clear:["clear","","Clears the console"],cls:["cls","","Clears the console"],help:["help [command]","","Running 'help' with no arguments displays the general help text, which lists all console commands and a brief description of what they do. A command can be specified to get more specific help text about that particular command. For example:",""," help automate","","will display specific information about using the automate console command"],log:["log [en/dis] [type]","","Enable or disable logging. By default, the results of completing actions such as contracts/operations are logged in the console. There are also random events that are logged in the console as well. The five categories of things that get logged are:","","[general, contracts, ops, blackops, events]","","The logging for these categories can be enabled or disabled like so:",""," log dis contracts - Disables logging that occurs when contracts are completed"," log en contracts - Enables logging that occurs when contracts are completed"," log dis events - Disables logging for Bladeburner random events","","Logging can be universally enabled/disabled using the 'all' keyword:",""," log dis all"," log en all"],skill:["skill [action] [name]","","Level or display information about your skills.","","To display information about all of your skills and your multipliers, use:",""," skill list","","To display information about a specific skill, specify the name of the skill afterwards. Note that the name of the skill is case-sensitive. Enter it exactly as seen in the UI. If the name of the skill has whitespace, enclose the name of the skill in double quotation marks:",""," skill list Reaper<br> skill list 'Digital Observer'","","This console command can also be used to level up skills:",""," skill level [skill name]"],start:["start [type] [name]","","Start an action. An action is specified by its type and its name. The name is case-sensitive. It must appear exactly as it does in the UI. If the name of the action has whitespace, enclose it in double quotation marks. Valid action types include:","","[general, contract, op, blackop]","","Examples:",""," start contract Tracking"," start op 'Undercover Operation'"],stop:["stop","","Stop your current action and go idle."]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(142),a=n(0),i=n(40),o=n(5),s=n(208);t.checkIfConnectedToDarkweb=function(){if(i.SpecialServerIps.hasOwnProperty("Darkweb Server")){const e=i.SpecialServerIps.getIp("Darkweb Server");if(!s.isValidIPAddress(e))return;e==a.Player.getCurrentServer().ip&&o.post("You are now connected to the dark web. From the dark web you can purchase illegal items. Use the 'buy -l' command to display a list of all the items you can buy. Use 'buy [item-name] to purchase an item.")}},t.executeDarkwebTerminalCommand=function(e){if(0!=e.length)switch(e[0]){case"buy":if(2!=e.length)return o.post("Incorrect number of arguments. Usage: "),o.post("buy -l"),void o.post("buy [item name]");var t=e[1];"-l"==t?function(){for(const e in r.DarkWebItems){const t=r.DarkWebItems[e];o.post(t.toString())}}():function(e){e=e.toLowerCase();let t=null;for(const n in r.DarkWebItems){const a=r.DarkWebItems[n];a.program.toLowerCase()==e&&(t=a)}null!==t?a.Player.hasProgram(t.program)?o.post("You already have the "+t.program+" program"):a.Player.money.lt(t.price)?o.post("Not enough money to purchase "+t.program):(a.Player.loseMoney(t.price),a.Player.getHomeComputer().programs.push(t.program),o.post("You have purchased the "+t.program+" program. The new program can be found on your home computer.")):o.post("Unrecognized item: "+e)}(t);break;default:o.post("Command not found")}}},function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return l});var r=n(1),a=n.n(r),i=n(20),o=n(34);const s={All:0,Foreign:1,Owned:2,Purchased:3};class l extends a.a.Component{isValidServer(e){const t=this.props.serverType;switch(t){case s.All:return!0;case s.Foreign:return"home"!==e.hostname&&!e.purchasedByPlayer;case s.Owned:return e.purchasedByPlayer||e instanceof o.HacknetServer||"home"===e.hostname;case s.Purchased:return e.purchasedByPlayer||e instanceof o.HacknetServer;default:return console.warn(`Invalid ServerType specified for ServerDropdown component: ${t}`),!1}}renderOption(e){return a.a.createElement("option",{key:e.hostname,value:e.hostname},e.hostname)}render(){const e=[];for(const t in i.AllServers){const n=i.AllServers[t];this.isValidServer(n)&&e.push(this.renderOption(n))}return a.a.createElement("select",{className:"dropdown",onChange:this.props.onChange,style:this.props.style},e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(16);t.AllCorporationStates=["START","PURCHASE","PRODUCTION","SALE","EXPORT"];class a{constructor(){this.state=0}static fromJSON(e){return r.Generic_fromJSON(a,e.data)}getState(){return t.AllCorporationStates[this.state]}nextState(){(this.state<0||this.state>=t.AllCorporationStates.length)&&(this.state=0),++this.state,this.state>=t.AllCorporationStates.length&&(this.state=0)}toJSON(){return r.Generic_toJSON("CorporationState",this)}}t.CorporationState=a,r.Reviver.constructors.CorporationState=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(137),i=n(4);t.AugmentationAccordion=function(e){let t=e.aug.name;return null!=e.level&&e.aug.name===i.AugmentationNames.NeuroFluxGovernor&&(t+=` - Level ${e.level}`),r.createElement(a.Accordion,{headerContent:r.createElement(r.Fragment,null,t),panelContent:r.createElement("p",{dangerouslySetInnerHTML:{__html:e.aug.info}})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SkillNames={BladesIntuition:"Blade's Intuition",Cloak:"Cloak",Marksman:"Marksman",WeaponProficiency:"Weapon Proficiency",ShortCircuit:"Short-Circuit",DigitalObserver:"Digital Observer",Tracer:"Tracer",Overclock:"Overclock",Reaper:"Reaper",EvasiveSystem:"Evasive System",Datamancer:"Datamancer",CybersEdge:"Cyber's Edge",HandsOfMidas:"Hands of Midas",Hyperdrive:"Hyperdrive"}},,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.StdButtonPurchased=class extends r.Component{render(){const e=null!=this.props.tooltip&&""!==this.props.tooltip;let t,n="std-button-bought";return e&&(n+=" tooltip"),e&&(t={__html:this.props.tooltip}),r.createElement("button",{className:n,onClick:this.props.onClick,style:this.props.style},this.props.text,e&&r.createElement("span",{className:"tooltiptext",dangerouslySetInnerHTML:t}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPowerOfTwo=function(e){return!isNaN(e)&&0!==e&&0==(e&e-1)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6);t.Crime=class{constructor(e="",t="",n=0,r=0,a=0,i=0,o={}){this.difficulty=0,this.karma=0,this.kills=0,this.money=0,this.name="",this.time=0,this.type="",this.hacking_success_weight=0,this.strength_success_weight=0,this.defense_success_weight=0,this.dexterity_success_weight=0,this.agility_success_weight=0,this.charisma_success_weight=0,this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.intelligence_exp=0,this.name=e,this.type=t,this.time=n,this.money=r,this.difficulty=a,this.karma=i,this.hacking_success_weight=o.hacking_success_weight?o.hacking_success_weight:0,this.strength_success_weight=o.strength_success_weight?o.strength_success_weight:0,this.defense_success_weight=o.defense_success_weight?o.defense_success_weight:0,this.dexterity_success_weight=o.dexterity_success_weight?o.dexterity_success_weight:0,this.agility_success_weight=o.agility_success_weight?o.agility_success_weight:0,this.charisma_success_weight=o.charisma_success_weight?o.charisma_success_weight:0,this.hacking_exp=o.hacking_exp?o.hacking_exp:0,this.strength_exp=o.strength_exp?o.strength_exp:0,this.defense_exp=o.defense_exp?o.defense_exp:0,this.dexterity_exp=o.dexterity_exp?o.dexterity_exp:0,this.agility_exp=o.agility_exp?o.agility_exp:0,this.charisma_exp=o.charisma_exp?o.charisma_exp:0,this.intelligence_exp=o.intelligence_exp?o.intelligence_exp:0,this.kills=o.kills?o.kills:0}commit(e,t=1,n=null){return t<=0&&(t=1),e.startCrime(this.type,this.hacking_exp/t,this.strength_exp/t,this.defense_exp/t,this.dexterity_exp/t,this.agility_exp/t,this.charisma_exp/t,this.money/t,this.time,n),this.time}successRate(e){let t=this.hacking_success_weight*e.hacking_skill+this.strength_success_weight*e.strength+this.defense_success_weight*e.defense+this.dexterity_success_weight*e.dexterity+this.agility_success_weight*e.agility+this.charisma_success_weight*e.charisma+r.CONSTANTS.IntelligenceCrimeWeight*e.intelligence;return t/=r.CONSTANTS.MaxSkillLevel,t/=this.difficulty,t*=e.crime_success_mult,t*=e.getIntelligenceBonus(1),Math.min(t,1)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(19),a=n(28),i=n(6);t.createTaskTracker=function(){return{hack:0,str:0,def:0,dex:0,agi:0,cha:0,money:0}};t.Person=class{constructor(){this.hacking_skill=1,this.strength=1,this.defense=1,this.dexterity=1,this.agility=1,this.charisma=1,this.intelligence=1,this.hp=10,this.max_hp=10,this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.intelligence_exp=0,this.hacking_mult=1,this.strength_mult=1,this.defense_mult=1,this.dexterity_mult=1,this.agility_mult=1,this.charisma_mult=1,this.hacking_exp_mult=1,this.strength_exp_mult=1,this.defense_exp_mult=1,this.dexterity_exp_mult=1,this.agility_exp_mult=1,this.charisma_exp_mult=1,this.hacking_chance_mult=1,this.hacking_speed_mult=1,this.hacking_money_mult=1,this.hacking_grow_mult=1,this.company_rep_mult=1,this.faction_rep_mult=1,this.crime_money_mult=1,this.crime_success_mult=1,this.work_money_mult=1,this.hacknet_node_money_mult=1,this.hacknet_node_purchase_cost_mult=1,this.hacknet_node_ram_cost_mult=1,this.hacknet_node_core_cost_mult=1,this.hacknet_node_level_cost_mult=1,this.bladeburner_max_stamina_mult=1,this.bladeburner_stamina_gain_mult=1,this.bladeburner_analysis_mult=1,this.bladeburner_success_chance_mult=1,this.augmentations=[],this.queuedAugmentations=[],this.city=a.CityName.Sector12}applyAugmentation(e){for(const t in e.mults)null==this[t]?console.warn(`Augmentation has unrecognized multiplier property: ${t}`):this[t]*=e.mults[t]}calculateStat(e,t=1){return Math.max(Math.floor(t*(32*Math.log(e+534.5)-200)),1)}getFactionFieldWorkRepGain(){return.9*(this.hacking_skill/i.CONSTANTS.MaxSkillLevel+this.strength/i.CONSTANTS.MaxSkillLevel+this.defense/i.CONSTANTS.MaxSkillLevel+this.dexterity/i.CONSTANTS.MaxSkillLevel+this.agility/i.CONSTANTS.MaxSkillLevel+this.charisma/i.CONSTANTS.MaxSkillLevel)/5.5*this.faction_rep_mult}getFactionHackingWorkRepGain(){return this.hacking_skill/i.CONSTANTS.MaxSkillLevel*this.faction_rep_mult}getFactionSecurityWorkRepGain(){return.9*(this.hacking_skill/i.CONSTANTS.MaxSkillLevel+this.strength/i.CONSTANTS.MaxSkillLevel+this.defense/i.CONSTANTS.MaxSkillLevel+this.dexterity/i.CONSTANTS.MaxSkillLevel+this.agility/i.CONSTANTS.MaxSkillLevel)/4.5*this.faction_rep_mult}resetMultipliers(){this.hacking_mult=1,this.strength_mult=1,this.defense_mult=1,this.dexterity_mult=1,this.agility_mult=1,this.charisma_mult=1,this.hacking_exp_mult=1,this.strength_exp_mult=1,this.defense_exp_mult=1,this.dexterity_exp_mult=1,this.agility_exp_mult=1,this.charisma_exp_mult=1,this.company_rep_mult=1,this.faction_rep_mult=1,this.crime_money_mult=1,this.crime_success_mult=1,this.work_money_mult=1}updateStatLevels(){this.hacking_skill=Math.max(1,Math.floor(this.calculateStat(this.hacking_exp,this.hacking_mult*r.BitNodeMultipliers.HackingLevelMultiplier))),this.strength=Math.max(1,Math.floor(this.calculateStat(this.strength_exp,this.strength_mult*r.BitNodeMultipliers.StrengthLevelMultiplier))),this.defense=Math.max(1,Math.floor(this.calculateStat(this.defense_exp,this.defense_mult*r.BitNodeMultipliers.DefenseLevelMultiplier))),this.dexterity=Math.max(1,Math.floor(this.calculateStat(this.dexterity_exp,this.dexterity_mult*r.BitNodeMultipliers.DexterityLevelMultiplier))),this.agility=Math.max(1,Math.floor(this.calculateStat(this.agility_exp,this.agility_mult*r.BitNodeMultipliers.AgilityLevelMultiplier))),this.charisma=Math.max(1,Math.floor(this.calculateStat(this.charisma_exp,this.charisma_mult*r.BitNodeMultipliers.CharismaLevelMultiplier)));const e=this.hp/this.max_hp;this.max_hp=Math.floor(10+this.defense/10),this.hp=Math.round(this.max_hp*e)}getIntelligenceBonus(e){return 1+e*Math.pow(this.intelligence,.8)/600}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(687),a=n(171);t.MaxSleevesFromCovenant=5,t.BaseCostPerSleeve=1e13,t.PopupId="covenant-sleeve-purchases-popup",t.createSleevePurchasesFromCovenantPopup=function(e){const n=a.removePopup.bind(null,t.PopupId);a.createPopup(t.PopupId,r.CovenantPurchasesRoot,{p:e,closeFn:n})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(e,t,n,r,a,i){this.infoText=e,this.enemies=t,this.offerHackingMission=n,this.offerHackingWork=r,this.offerFieldWork=a,this.offerSecurityWork=i,this.augmentationPriceMult=1,this.augmentationRepRequirementMult=1}}t.FactionInfo=r,t.FactionInfos={Illuminati:new r("Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And from this chaos, we are the Invisible hand that guides them to order. ",[],!0,!0,!0,!1),Daedalus:new r("Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth.",[],!0,!0,!0,!1),"The Covenant":new r("Surrender yourself. Give up your empty individuality to become part of something great, something eternal. Become a slave. Submit your mind, body, and soul. Only then can you set yourself free.<br><br>Only then can you discover immortality.",[],!0,!0,!0,!1),ECorp:new r("ECorp's mission is simple: to connect the world of today with the technology of tomorrow. With our wide range of Internet-related software and commercial hardware, ECorp makes the world's information universally accessible.",[],!0,!0,!0,!0),MegaCorp:new r("MegaCorp does things that others don't. We imagine. We create. We invent. We build things that others have never even dreamed of. Our work fills the world's needs for food, water, power, and transporation on an unprecendented scale, in ways that no other company can.<br><br>In our labs and factories and on the ground with customers, MegaCorp is ushering in a new era for the world.",[],!0,!0,!0,!0),"Bachman & Associates":new r("Where Law and Business meet - thats where we are.<br><br>Legal Insight - Business Instinct - Experience Innovation",[],!0,!0,!0,!0),"Blade Industries":new r("Augmentation is salvation",[],!0,!0,!0,!0),NWO:new r("The human being does not truly desire freedom. It wants to be observed, understood, and judged. It wants to be given purpose and direction in its life. That is why humans created God. And that is why humans created civilization - not because of willingness, but because of a need to be incorporated into higher orders of structure and meaning.",[],!0,!0,!0,!0),"Clarke Incorporated":new r("Unlocking the power of the genome",[],!0,!0,!0,!0),"OmniTek Incorporated":new r("Simply put, our mission is to design and build robots that make a difference",[],!0,!0,!0,!0),"Four Sigma":new r("The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven by deep learning and innovative ideas. And improved by iteration. That's Four Sigma.",[],!0,!0,!0,!0),"KuaiGong International":new r("Dream big. Work hard. Make history.",[],!0,!0,!0,!0),"Fulcrum Secret Technologies":new r("The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it would be necessary to create them. And now we can.",[],!0,!0,!1,!0),BitRunners:new r("Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all transformed into bits, stored in bits, communicated through bits. It’s impossible for any person to move, to live, to operate at any level without the use of bits. And when a person moves, lives, and operates, they leave behind their bits, mere traces of seemingly meaningless fragments of information. But these bits can be reconstructed. Transformed. Used.<br><br>Those who run the bits, run the world",[],!0,!0,!1,!1),"The Black Hand":new r("The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power. Technological power. And those at the top rule with an invisible hand. They built a society where the rich get richer, and everyone else suffers.<br><br>So much pain. So many lives. Their darkness must end.",[],!0,!0,!0,!1),NiteSec:new r(" __..__ <br> _.nITESECNIt. <br> .-'NITESECNITESEc. <br> .' NITESECNITESECn <br> / NITESECNITESEC; <br> : :NITESECNITESEC; <br> ; $ NITESECNITESECN <br> : _, ,N'ITESECNITESEC <br> : .+^^`, : `NITESECNIT <br> ) /), `-,-=,NITESECNI <br> / ^ ,-;|NITESECN; <br> / _.' '-';NITESECN <br> ( , ,-''`^NITE' <br> )` :`. .' <br> )-- ; `- / <br> ' _.-' : <br> ( _.-' . <br> ------. <br> . <br> _.nIt <br> _.nITESECNi <br> nITESECNIT^' <br> NITE^' ___ <br> / .gP''''Tp. <br> : d' . `b <br> ; d' o `b ; <br> / d; `b| <br> /, $; @ `: <br> /' $$ ; <br> .' $$b o | <br> .' d$$$; : <br> / .d$$$$; , ; <br> d .dNITESEC $ | <br> :bp.__.gNITESEC$$ :$ ; <br> NITESECNITESECNIT $$b : <br>",[],!0,!0,!1,!1),Aevum:new r("The Silicon City",["Chongqing","New Tokyo","Ishima","Volhaven"],!0,!0,!0,!0),Chongqing:new r("Serve the people",["Sector-12","Aevum","Volhaven"],!0,!0,!0,!0),Ishima:new r("The East Asian Order of the Future",["Sector-12","Aevum","Volhaven"],!0,!0,!0,!0),"New Tokyo":new r("Asia's World City",["Sector-12","Aevum","Volhaven"],!0,!0,!0,!0),"Sector-12":new r("The City of the Future",["Chongqing","New Tokyo","Ishima","Volhaven"],!0,!0,!0,!0),Volhaven:new r("Benefit, Honour, and Glory",["Chongqing","Sector-12","New Tokyo","Aevum","Ishima"],!0,!0,!0,!0),"Speakers for the Dead":new r("It is better to reign in hell than to serve in heaven.",[],!0,!0,!0,!0),"The Dark Army":new r("The World doesn't care about right or wrong. It's all about power.",[],!0,!0,!0,!1),"The Syndicate":new r("Honor holds you back",[],!0,!0,!0,!0),Silhouette:new r("Corporations have filled the void of power left behind by the collapse of Western government. The issue is they've become so big that you don't know who they're working for. And if you're employed at one of these corporations, you don't even know who you're working for.<br><br>That's terror. Terror, fear, and corruption. All born into the system, all propagated by the system.",[],!0,!0,!0,!1),Tetrads:new r("Following the Mandate of Heaven and Carrying out the Way",[],!1,!1,!0,!0),"Slum Snakes":new r("Slum Snakes rule!",[],!1,!1,!0,!0),Netburners:new r("~~//*>H4CK||3T 8URN3R5**>?>\\~~",[],!0,!0,!1,!1),"Tian Di Hui":new r("Obey Heaven and Work Righteousness",[],!0,!0,!1,!0),CyberSec:new r("The Internet is the first thing that humanity has built that humanity doesn’t understand, the largest experiment in anarchy that we have ever had. And as the world becomes increasingly dominated by the internet, society approaches the brink of total chaos. We serve only to protect society, to protect humanity, to protect the world from its imminent collapse.",[],!0,!0,!1,!1),Bladeburners:new r("It's too bad they won't live. But then again, who does?<br><br>Note that for this faction, reputation can only be gained through Bladeburner actions. Completing Bladeburner contracts/operations will increase your reputation.",[],!1,!1,!1,!1)}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(77),a=n(106),i=n(75),o=n(98),s=n(60),l=n(168),c=n(154);t.BaseServer=class{constructor(e={hostname:"",ip:l.createRandomIp()}){this.contracts=[],this.cpuCores=1,this.ftpPortOpen=!1,this.hasAdminRights=!1,this.hostname="",this.httpPortOpen=!1,this.ip="",this.isConnectedTo=!1,this.maxRam=0,this.messages=[],this.organizationName="",this.programs=[],this.ramUsed=0,this.runningScripts=[],this.scripts=[],this.serversOnNetwork=[],this.smtpPortOpen=!1,this.sqlPortOpen=!1,this.sshPortOpen=!1,this.textFiles=[],this.ip=e.ip?e.ip:l.createRandomIp(),this.hostname=e.hostname,this.organizationName=null!=e.organizationName?e.organizationName:"",this.isConnectedTo=null!=e.isConnectedTo&&e.isConnectedTo,this.hasAdminRights=null!=e.adminRights&&e.adminRights}addContract(e){this.contracts.push(e)}getContract(e){for(const t of this.contracts)if(t.fn===e)return t;return null}getRunningScript(e,t){for(let n of this.runningScripts)if(n.filename===e&&c.compareArrays(n.args,t))return n;return null}getScript(e){for(let t=0;t<this.scripts.length;t++)if(this.scripts[t].filename===e)return this.scripts[t];return null}isRunning(e){for(const t of this.runningScripts)if(t.filename===e)return!0;return!1}removeContract(e){e instanceof r.CodingContract?this.contracts=this.contracts.filter(t=>t.fn!==e.fn):this.contracts=this.contracts.filter(t=>t.fn!==e)}removeFile(e){if(e.endsWith(".exe")||null!=e.match(/^.+\.exe-\d+(?:\.\d*)?%-INC$/)){for(let t=0;t<this.programs.length;++t)if(this.programs[t]===e)return this.programs.splice(t,1),{res:!0}}else if(s.isScriptFilename(e)){for(let t=0;t<this.scripts.length;++t)if(this.scripts[t].filename===e)return this.isRunning(e)?{res:!1,msg:"Cannot delete a script that is currently running!"}:(this.scripts.splice(t,1),{res:!0})}else if(e.endsWith(".lit"))for(let t=0;t<this.messages.length;++t){let n=this.messages[t];if("string"==typeof n&&n===e)return this.messages.splice(t,1),{res:!0}}else if(e.endsWith(".txt")){for(let t=0;t<this.textFiles.length;++t)if(this.textFiles[t].fn===e)return this.textFiles.splice(t,1),{res:!0}}else if(e.endsWith(".cct"))for(let t=0;t<this.contracts.length;++t)if(this.contracts[t].fn===e)return this.contracts.splice(t,1),{res:!0};return{res:!1,msg:"No such file exists"}}runScript(e){this.runningScripts.push(e)}setMaxRam(e){this.maxRam=e}writeToScriptFile(e,t){var n={success:!1,overwritten:!1};if(!i.isValidFilePath(e)||!s.isScriptFilename(e))return n;for(let r=0;r<this.scripts.length;++r)if(e===this.scripts[r].filename){let e=this.scripts[r];return e.code=t,e.updateRamUsage(this.scripts),e.markUpdated(),n.overwritten=!0,n.success=!0,n}const r=new a.Script(e,t,this.ip,this.scripts);return this.scripts.push(r),n.success=!0,n}writeToTextFile(e,t){var n={success:!1,overwritten:!1};if(!i.isValidFilePath(e)||!e.endsWith("txt"))return n;for(let r=0;r<this.textFiles.length;++r)if(this.textFiles[r].fn===e)return n.overwritten=!0,this.textFiles[r].text=t,n.success=!0,n;var r=new o.TextFile(e,t);return this.textFiles.push(r),n.success=!0,n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(31);function a(e,t,n){for(var r=0;r<t.length;++r)e?(t[r].style.opacity="1",t[r].style.maxHeight=t[r].scrollHeight+"px"):(t[r].style.opacity="0",t[r].style.maxHeight=null);for(r=0;r<n.length;++r)e?(n[r].style.opacity="1",n[r].style.maxHeight=n[r].scrollHeight+"px",n[r].style.pointerEvents="auto"):(n[r].style.opacity="0",n[r].style.maxHeight=null,n[r].style.pointerEvents="none")}t.MainMenuHeaders={Hacking:null,Character:null,World:null,Help:null},t.initializeMainMenuHeaders=function(e,n=!1){function i(e){const t=document.getElementById(e);if(null==t)throw new Error(`Failed to find element with id ${e} in initializeMainMenuHeaders()`);return t}try{return t.MainMenuHeaders.Hacking=i("hacking-menu-header"),t.MainMenuHeaders.Character=i("character-menu-header"),t.MainMenuHeaders.World=i("world-menu-header"),t.MainMenuHeaders.Help=i("help-menu-header"),t.MainMenuHeaders.Hacking.onclick=function(){const t=i("terminal-tab"),n=i("create-script-tab"),o=i("active-scripts-tab"),s=i("create-program-tab"),l=i("create-program-notification");s.style.display=e.firstProgramAvailable?"list-item":"none",this.classList.toggle("opened");const c=[t,n,o,s],u=[r.MainMenuLinks.Terminal,r.MainMenuLinks.ScriptEditor,r.MainMenuLinks.ActiveScripts,r.MainMenuLinks.CreateProgram];t.style.maxHeight?(a(!1,c,u),l.style.display="none"):(a(!0,c,u),l.style.display="block")},t.MainMenuHeaders.Character.onclick=function(){const t=i("stats-tab"),n=i("factions-tab"),o=i("augmentations-tab"),s=i("hacknet-nodes-tab"),l=i("sleeves-tab");l.style.display=e.sleeves.length>0?"list-item":"none",this.classList.toggle("opened");const c=[t,n,o,s,l],u=[r.MainMenuLinks.Stats,r.MainMenuLinks.Factions,r.MainMenuLinks.Augmentations,r.MainMenuLinks.HacknetNodes,r.MainMenuLinks.Sleeves];t.style.maxHeight?a(!1,c,u):a(!0,c,u)},t.MainMenuHeaders.World.onclick=function(){const t=i("city-tab"),n=i("travel-tab"),o=i("job-tab"),s=i("stock-market-tab"),l=i("bladeburner-tab"),c=i("corporation-tab"),u=i("gang-tab");o.style.display=""!==e.companyName?"list-item":"none",s.style.display=e.hasWseAccount?"list-item":"none",l.style.display=e.inBladeburner()?"list-item":"none",c.style.display=e.hasCorporation()?"list-item":"none",u.style.display=e.inGang()?"list-item":"none",this.classList.toggle("opened");const m=[t,n,o,s,l,c,u],p=[r.MainMenuLinks.City,r.MainMenuLinks.Travel,r.MainMenuLinks.Job,r.MainMenuLinks.StockMarket,r.MainMenuLinks.Bladeburner,r.MainMenuLinks.Corporation,r.MainMenuLinks.Gang];t.style.maxHeight?a(!1,m,p):a(!0,m,p)},t.MainMenuHeaders.Help.onclick=function(){const e=i("tutorial-tab"),t=i("options-tab");this.classList.toggle("opened");const o=[e,t],s=[r.MainMenuLinks.Tutorial,r.MainMenuLinks.Options];n&&(o.push(i("dev-tab")),s.push(i("dev-menu-link"))),e.style.maxHeight?a(!1,o,s):a(!0,o,s)},!0}catch(e){return console.error(`Failed to initialize Main Menu Headers: ${e}`),!1}}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(12),a=n(17),i=n(2);function o(){function e(e){0===a.Settings.AutosaveInterval?e.innerHTML="disabled":e.innerHTML=`every ${a.Settings.AutosaveInterval}s`}const t=document.getElementById("settingsNSExecTimeRangeValLabel"),n=document.getElementById("settingsNSLogRangeValLabel"),o=document.getElementById("settingsNSPortRangeValLabel"),s=document.getElementById("settingsSuppressMessages"),l=document.getElementById("settingsSuppressFactionInvites"),c=document.getElementById("settingsSuppressTravelConfirmation"),u=document.getElementById("settingsSuppressBuyAugmentationConfirmation"),m=document.getElementById("settingsSuppressHospitalizationPopup"),p=document.getElementById("settingsAutosaveIntervalValLabel"),h=document.getElementById("settingsDisableHotkeys"),d=document.getElementById("settingsLocale");t.innerHTML=a.Settings.CodeInstructionRunTime+"ms",n.innerHTML=a.Settings.MaxLogCapacity,o.innerHTML=a.Settings.MaxPortCapacity,s.checked=a.Settings.SuppressMessages,l.checked=a.Settings.SuppressFactionInvites,c.checked=a.Settings.SuppressTravelConfirmation,u.checked=a.Settings.SuppressBuyAugmentationConfirmation,m.checked=a.Settings.SuppressHospitalizationPopup,e(p),h.checked=a.Settings.DisableHotkeys,d.value=a.Settings.Locale,i.numeralWrapper.updateLocale(a.Settings.Locale);const _=document.getElementById("settingsNSExecTimeRangeVal"),g=document.getElementById("settingsNSLogRangeVal"),y=document.getElementById("settingsNSPortRangeVal"),f=document.getElementById("settingsAutosaveIntervalVal");_.value=a.Settings.CodeInstructionRunTime,g.value=a.Settings.MaxLogCapacity,y.value=a.Settings.MaxPortCapacity,f.value=a.Settings.AutosaveInterval,_.oninput=function(){t.innerHTML=this.value+"ms",a.Settings.CodeInstructionRunTime=this.value},g.oninput=function(){n.innerHTML=this.value,a.Settings.MaxLogCapacity=this.value},y.oninput=function(){o.innerHTML=this.value,a.Settings.MaxPortCapacity=this.value},f.oninput=function(){a.Settings.AutosaveInterval=Number(this.value),e(p),0===Number(this.value)?r.Engine.Counters.autoSaveCounter=1/0:r.Engine.Counters.autoSaveCounter=5*Number(this.value)},s.onclick=function(){a.Settings.SuppressMessages=this.checked},l.onclick=function(){a.Settings.SuppressFactionInvites=this.checked},c.onclick=function(){a.Settings.SuppressTravelConfirmation=this.checked},u.onclick=function(){a.Settings.SuppressBuyAugmentationConfirmation=this.checked},m.onclick=function(){a.Settings.SuppressHospitalizationPopup=this.checked},h.onclick=function(){a.Settings.DisableHotkeys=this.checked},d.onchange=function(){if(!i.numeralWrapper.updateLocale(d.value)){console.warn(`Invalid locale for numeral: ${d.value}`);let e="en";return a.Settings.Locale=e,void(d.value=e)}a.Settings.Locale=d.value}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(2),i=n(95),o=n(8),s=n(7),l=n(19),c=n(38),u=n(101);t.CharacterInfo=function(e){function t(e){let t=[`Total: ${a.numeralWrapper.formatMoney(e.total)}`];return e.bladeburner&&t.push(`Bladeburner: ${a.numeralWrapper.formatMoney(e.bladeburner)}`),e.codingcontract&&t.push(`Coding Contracts: ${a.numeralWrapper.formatMoney(e.codingcontract)}`),e.work&&t.push(`Company Work: ${a.numeralWrapper.formatMoney(e.work)}`),e.corporation&&t.push(`Corporation: ${a.numeralWrapper.formatMoney(e.corporation)}`),e.crime&&t.push(`Crimes: ${a.numeralWrapper.formatMoney(e.crime)}`),e.gang&&t.push(`Gang: ${a.numeralWrapper.formatMoney(e.gang)}`),e.hacking&&t.push(`Hacking: ${a.numeralWrapper.formatMoney(e.hacking)}`),e.hacknetnode&&t.push(`Hacknet Nodes: ${a.numeralWrapper.formatMoney(e.hacknetnode)}`),e.hospitalization&&t.push(`Hospitalization: ${a.numeralWrapper.formatMoney(e.hospitalization)}`),e.infiltration&&t.push(`Infiltration: ${a.numeralWrapper.formatMoney(e.infiltration)}`),e.stock&&t.push(`Stock Market: ${a.numeralWrapper.formatMoney(e.stock)}`),t.join("<br>")}function n(e){return r.createElement(r.Fragment,null,r.createElement("table",null,r.createElement("tbody",null,e.rows.map(e=>r.createElement("tr",{key:e[0]},r.createElement("td",{key:"0"},e[0]," multiplier: "),r.createElement("td",{key:"1",style:{textAlign:"right"}},a.numeralWrapper.formatPercentage(e[1])),function(e){return c.SourceFileFlags[5]>0&&e.length>2&&e[1]!=e[2]?r.createElement("td",{key:"2",style:{textAlign:"right"}}," (",a.numeralWrapper.formatPercentage(e[2]),")"):r.createElement(r.Fragment,null)}(e))))))}return r.createElement("pre",null,r.createElement("b",null,"General"),r.createElement("br",null),r.createElement("br",null),r.createElement("span",null,"Current City: ",e.city),r.createElement("br",null),r.createElement(function(){return e.companyName?r.createElement(r.Fragment,null,r.createElement("span",null,"Employer at which you last worked: ",e.companyName),r.createElement("br",null)):r.createElement(r.Fragment,null)},null),r.createElement(function(){return""!==e.companyName?r.createElement(r.Fragment,null,r.createElement("span",null,"Job you last worked: ",e.jobs[e.companyName]),r.createElement("br",null)):r.createElement(r.Fragment,null)},null),r.createElement(function(){return e.jobs&&0!==Object.keys(e.jobs).length?r.createElement(r.Fragment,null,r.createElement("span",null,"All Employers:"),r.createElement("br",null),r.createElement("ul",null,Object.keys(e.jobs).map(e=>r.createElement("li",{key:"j"}," * ",e))),r.createElement("br",null),r.createElement("br",null)):r.createElement(r.Fragment,null)},null),r.createElement("span",null,"Money: ",a.numeralWrapper.formatMoney(e.money.toNumber())),r.createElement("button",{className:"popup-box-button",style:{display:"inline-block",float:"none"},onClick:function(){let n="<u>Money earned since you last installed Augmentations:</u><br>"+t(e.moneySourceA);0!==e.sourceFiles.length&&(n+="<br><br><u>Money earned in this BitNode:</u><br>"+t(e.moneySourceB)),o.dialogBoxCreate(n,!1)}},"Money Statistics & Breakdown"),r.createElement("br",null),r.createElement("br",null),r.createElement("b",null,"Stats"),r.createElement("table",null,r.createElement("tbody",null,r.createElement("tr",{key:"0"},r.createElement("td",{key:"0"},"Hacking:"),r.createElement("td",{key:"1",style:{textAlign:"right"}},e.hacking_skill.toLocaleString()),r.createElement("td",{key:"2",style:{textAlign:"right"}},"(",a.numeralWrapper.format(e.hacking_exp,"0.000a")," exp)")),r.createElement("tr",{key:"1"},r.createElement("td",{key:"0"},"Strength:"),r.createElement("td",{key:"1",style:{textAlign:"right"}},e.strength.toLocaleString()),r.createElement("td",{key:"2",style:{textAlign:"right"}},"(",a.numeralWrapper.format(e.strength_exp,"0.000a")," exp)")),r.createElement("tr",{key:"2"},r.createElement("td",{key:"0"},"Defense:"),r.createElement("td",{key:"1",style:{textAlign:"right"}},e.defense.toLocaleString()),r.createElement("td",{key:"2",style:{textAlign:"right"}},"(",a.numeralWrapper.format(e.defense_exp,"0.000a")," exp)")),r.createElement("tr",{key:"3"},r.createElement("td",{key:"0"},"Dexterity:"),r.createElement("td",{key:"1",style:{textAlign:"right"}},e.dexterity.toLocaleString()),r.createElement("td",{key:"2",style:{textAlign:"right"}},"(",a.numeralWrapper.format(e.dexterity_exp,"0.000a")," exp)")),r.createElement("tr",{key:"4"},r.createElement("td",{key:"0"},"Agility:"),r.createElement("td",{key:"1",style:{textAlign:"right"}},e.agility.toLocaleString()),r.createElement("td",{key:"2",style:{textAlign:"right"}},"(",a.numeralWrapper.format(e.agility_exp,"0.000a")," exp)")),r.createElement("tr",{key:"5"},r.createElement("td",{key:"0"},"Charisma:"),r.createElement("td",{key:"1",style:{textAlign:"right"}},e.charisma.toLocaleString()),r.createElement("td",{key:"2",style:{textAlign:"right"}},"(",a.numeralWrapper.format(e.charisma_exp,"0.000a")," exp)")),r.createElement(function(){return e.intelligence>0?r.createElement("tr",{key:"5"},r.createElement("td",null,"Intelligence:"),r.createElement("td",{style:{textAlign:"right"}},e.intelligence.toLocaleString())):r.createElement(r.Fragment,null)},null))),r.createElement("br",null),r.createElement(n,{rows:[["Hacking Chance",e.hacking_chance_mult],["Hacking Speed",e.hacking_speed_mult],["Hacking Money",e.hacking_money_mult,e.hacking_money_mult*l.BitNodeMultipliers.ScriptHackMoney],["Hacking Growth",e.hacking_grow_mult,e.hacking_grow_mult*l.BitNodeMultipliers.ServerGrowthRate]]}),r.createElement("br",null),r.createElement(n,{rows:[["Hacking Level",e.hacking_mult,e.hacking_mult*l.BitNodeMultipliers.HackingLevelMultiplier],["Hacking Experience",e.hacking_exp_mult,e.hacking_exp_mult*l.BitNodeMultipliers.HackExpGain]]}),r.createElement("br",null),r.createElement(n,{rows:[["Strength Level",e.strength_mult,e.strength_mult*l.BitNodeMultipliers.StrengthLevelMultiplier],["Strength Experience",e.strength_exp_mult]]}),r.createElement("br",null),r.createElement(n,{rows:[["Defense Level",e.defense_mult,e.defense_mult*l.BitNodeMultipliers.DefenseLevelMultiplier],["Defense Experience",e.defense_exp_mult]]}),r.createElement("br",null),r.createElement(n,{rows:[["Dexterity Level",e.dexterity_mult,e.dexterity_mult*l.BitNodeMultipliers.DexterityLevelMultiplier],["Dexterity Experience",e.dexterity_exp_mult]]}),r.createElement("br",null),r.createElement(n,{rows:[["Agility Level",e.agility_mult,e.agility_mult*l.BitNodeMultipliers.AgilityLevelMultiplier],["Agility Experience",e.agility_exp_mult]]}),r.createElement("br",null),r.createElement(n,{rows:[["Charisma Level",e.charisma_mult,e.charisma_mult*l.BitNodeMultipliers.CharismaLevelMultiplier],["Charisma Experience",e.charisma_exp_mult]]}),r.createElement("br",null),r.createElement(n,{rows:[["Hacknet Node production",e.hacknet_node_money_mult,e.hacknet_node_money_mult*l.BitNodeMultipliers.HacknetNodeMoney],["Hacknet Node purchase cost",e.hacknet_node_purchase_cost_mult],["Hacknet Node RAM upgrade cost",e.hacknet_node_ram_cost_mult],["Hacknet Node Core purchase cost",e.hacknet_node_core_cost_mult],["Hacknet Node level upgrade cost",e.hacknet_node_level_cost_mult]]}),r.createElement("br",null),r.createElement(n,{rows:[["Company reputation gain",e.company_rep_mult],["Faction reputation gain",e.faction_rep_mult,e.faction_rep_mult*l.BitNodeMultipliers.FactionWorkRepGain],["Salary",e.work_money_mult,e.work_money_mult*l.BitNodeMultipliers.CompanyWorkMoney]]}),r.createElement("br",null),r.createElement(n,{rows:[["Crime success",e.crime_success_mult],["Crime money",e.crime_money_mult,e.crime_money_mult*l.BitNodeMultipliers.CrimeMoney]]}),r.createElement("br",null),r.createElement("br",null),r.createElement("b",null,"Misc."),r.createElement("br",null),r.createElement("br",null),r.createElement("span",null,"Servers owned: ",e.purchasedServers.length," / ",u.getPurchaseServerLimit()),r.createElement("br",null),r.createElement("span",null,"Hacknet Nodes owned: ",e.hacknetNodes.length),r.createElement("br",null),r.createElement("span",null,"Augmentations installed: ",e.augmentations.length),r.createElement("br",null),r.createElement("span",null,"Time played since last Augmentation: ",s.convertTimeMsToTimeElapsedString(e.playtimeSinceLastAug)),r.createElement("br",null),r.createElement(function(){return e.sourceFiles.length>0?r.createElement(r.Fragment,null,r.createElement("span",null,"Time played since last Bitnode destroyed: ",s.convertTimeMsToTimeElapsedString(e.playtimeSinceLastBitnode)),r.createElement("br",null)):r.createElement(r.Fragment,null)},null),r.createElement("span",null,"Time played: ",s.convertTimeMsToTimeElapsedString(e.totalPlaytime)),r.createElement("br",null),r.createElement("br",null),r.createElement(function(){if(e.sourceFiles.length>0){const t="BitNode"+e.bitNodeN;return r.createElement(r.Fragment,null,r.createElement("span",null,"Current BitNode: ",e.bitNodeN," (",i.BitNodes[t].name,")"),r.createElement("br",null),r.createElement("br",null),r.createElement("div",{style:{width:"60%",fontSize:"13px",marginLeft:"4%"}},i.BitNodes[t].info.split("<br>").map((e,t)=>r.createElement("div",{key:t},r.createElement("span",{style:{whiteSpace:"pre-wrap",overflowWrap:"break-word"}},e),r.createElement("br",null)))))}return r.createElement(r.Fragment,null)},null))}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var r=n(8),a=n(29),i=n(7),o=n(19),s=n(6),l=(n(74),n(13)),c=n(0),u="";function m(){document.getElementById("infiltration-box-container").style.display="none"}function p(e){c.Player.gainHackingExp(e.calcGainedHackingExp()),c.Player.gainStrengthExp(e.calcGainedStrengthExp()),c.Player.gainDefenseExp(e.calcGainedDefenseExp()),c.Player.gainDexterityExp(e.calcGainedDexterityExp()),c.Player.gainAgilityExp(e.calcGainedAgilityExp()),c.Player.gainCharismaExp(e.calcGainedCharismaExp()),c.Player.gainIntelligenceExp(e.calcGainedIntelligenceExp());const t=["You gained:",`${Object(i.formatNumber)(e.calcGainedHackingExp(),3)} hacking exp`,`${Object(i.formatNumber)(e.calcGainedStrengthExp(),3)} str exp`,`${Object(i.formatNumber)(e.calcGainedDefenseExp(),3)} def exp`,`${Object(i.formatNumber)(e.calcGainedDexterityExp(),3)} dex exp`,`${Object(i.formatNumber)(e.calcGainedAgilityExp(),3)} agi exp`,`${Object(i.formatNumber)(e.calcGainedCharismaExp(),3)} cha exp`].join("\n");for(var n=0,p=0;p<e.secretsStolen.length;++p)n+=e.secretsStolen[p];if(0!=n){var h=n*c.Player.faction_rep_mult*s.CONSTANTS.InfiltrationRepValue*o.BitNodeMultipliers.InfiltrationRep,d=n*s.CONSTANTS.InfiltrationMoneyValue*o.BitNodeMultipliers.InfiltrationMoney;!function(e){document.getElementById("infiltration-box-text").innerHTML=e}("You can sell the classified documents and secrets you stole from "+e.companyName+" for <span class='money-gold'>$"+Object(i.formatNumber)(d,2)+"</span> on the black market or you can give it to a faction to gain <span class='light-yellow'>"+Object(i.formatNumber)(h,3)+" reputation</span> with that faction.");var _=document.getElementById("infiltration-faction-select");_.innerHTML="";for(let e=0;e<c.Player.factions.length;++e)"Bladeburners"!==c.Player.factions[e]&&(c.Player.inGang()&&c.Player.gang.facName===c.Player.factions[e]||(_.innerHTML+="<option value='"+c.Player.factions[e]+"'>"+c.Player.factions[e]+"</option>"));if(""!==u)for(let e=0;e<_.options.length;++e)if(_.options[e].value===u){_.selectedIndex=e;break}var g=Object(a.clearEventListeners)("infiltration-box-sell");setTimeout(function(){g.addEventListener("click",function(n){return!!n.isTrusted&&(c.Player.gainMoney(d),c.Player.recordMoneySource(d,"infiltration"),Object(r.dialogBoxCreate)("You sold the classified information you stole from "+e.companyName+" for <span class='money-gold'>$"+Object(i.formatNumber)(d,2)+"</span> on the black market!<br><br>"+t),m(),!1)})},750);var y=Object(a.clearEventListeners)("infiltration-box-faction");setTimeout(function(){y.addEventListener("click",function(n){if(!n.isTrusted)return!1;var a=_.options[_.selectedIndex].value;u=a;var o=l.Factions[a];return null==o?(Object(r.dialogBoxCreate)("Error finding faction. This is a bug please report to developer"),!1):(o.playerReputation+=h,Object(r.dialogBoxCreate)("You gave the classified information you stole from "+e.companyName+" to "+a+" and gained <span class='light-yellow'>"+Object(i.formatNumber)(h,3)+" reputation</span> with the faction. <br><br>"+t),m(),!1)})},750),document.getElementById("infiltration-box-container").style.display="flex"}else Object(r.dialogBoxCreate)("You successfully escaped the facility but you did not steal anything of worth when infiltrating.<br><br>"+t)}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n(1),a=n.n(r),i=n(0),o=n(2);const s=a.a.Component;class l extends s{render(){const e=a.a.createElement("tr",{id:"character-int-wrapper"},a.a.createElement("td",{className:"character-int-cell"},"Int: "),a.a.createElement("td",{id:"character-int-text",className:"character-int-cell character-stat-cell"},i.Player.intelligence.toLocaleString()));return a.a.createElement("div",{id:"character-overview-text"},a.a.createElement("table",null,a.a.createElement("tbody",null,a.a.createElement("tr",{id:"character-hp-wrapper"},a.a.createElement("td",{className:"character-hp-cell"},"Hp:"),a.a.createElement("td",{id:"character-hp-text",className:"character-hp-cell character-stat-cell"},i.Player.hp+" / "+i.Player.max_hp)),a.a.createElement("tr",{id:"character-money-wrapper"},a.a.createElement("td",{className:"character-money-cell"},"Money: "),a.a.createElement("td",{id:"character-money-text",className:"character-money-cell character-stat-cell"},o.numeralWrapper.format(i.Player.money.toNumber(),"$0.000a"))),a.a.createElement("tr",{id:"character-hack-wrapper"},a.a.createElement("td",{className:"character-hack-cell"},"Hack: "),a.a.createElement("td",{id:"character-hack-text",className:"character-hack-cell character-stat-cell"},i.Player.hacking_skill.toLocaleString())),a.a.createElement("tr",{id:"character-str-wrapper"},a.a.createElement("td",{className:"character-combat-cell"},"Str: "),a.a.createElement("td",{id:"character-str-text",className:"character-combat-cell character-stat-cell"},i.Player.strength.toLocaleString())),a.a.createElement("tr",{id:"character-def-wrapper"},a.a.createElement("td",{className:"character-combat-cell"},"Def: "),a.a.createElement("td",{id:"character-def-text",className:"character-combat-cell character-stat-cell"},i.Player.defense.toLocaleString())),a.a.createElement("tr",{id:"character-dex-wrapper"},a.a.createElement("td",{className:"character-combat-cell"},"Dex: "),a.a.createElement("td",{id:"character-dex-text",className:"character-combat-cell character-stat-cell"},i.Player.dexterity.toLocaleString())),a.a.createElement("tr",{id:"character-agi-wrapper"},a.a.createElement("td",{className:"character-combat-cell"},"Agi: "),a.a.createElement("td",{id:"character-agi-text",className:"character-combat-cell character-stat-cell"},i.Player.agility.toLocaleString())),a.a.createElement("tr",{id:"character-cha-wrapper"},a.a.createElement("td",{className:"character-cha-cell"},"Cha: "),a.a.createElement("td",{id:"character-cha-text",className:"character-cha-cell character-stat-cell"},i.Player.charisma.toLocaleString())),i.Player.intelligence>=1&&e)))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6),a=n(19),i=n(34),o=n(20),s=n(40);t.hasTorRouter=function(){return s.SpecialServerIps.hasOwnProperty("Darkweb Server")},t.getCurrentServer=function(){return o.AllServers[this.currentServer]},t.getHomeComputer=function(){return o.AllServers[this.homeComputer]},t.getUpgradeHomeRamCost=function(){const e=this.getHomeComputer().maxRam,t=Math.log2(e),n=Math.pow(1.58,t);return e*r.CONSTANTS.BaseCostFor1GBOfRamHome*n*a.BitNodeMultipliers.HomeComputerRamCost},t.createHacknetServer=function(){const e=`hacknet-node-${this.hacknetNodes.length}`,t=new i.HacknetServer({adminRights:!0,hostname:e,ip:o.createUniqueRandomIp()});this.hacknetNodes.push(t.ip),o.AddToAllServers(t);const n=this.getHomeComputer();return n.serversOnNetwork.push(t.ip),t.serversOnNetwork.push(n.ip),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0);t.applyExploit=function(){if(r.Player.exploits&&0===r.Player.exploits.length)return;const e=Math.pow(1.0001,r.Player.exploits.length),t=Math.pow(.9999,r.Player.exploits.length);r.Player.hacking_chance_mult*=e,r.Player.hacking_speed_mult*=e,r.Player.hacking_money_mult*=e,r.Player.hacking_grow_mult*=e,r.Player.hacking_mult*=e,r.Player.strength_mult*=e,r.Player.defense_mult*=e,r.Player.dexterity_mult*=e,r.Player.agility_mult*=e,r.Player.charisma_mult*=e,r.Player.hacking_exp_mult*=e,r.Player.strength_exp_mult*=e,r.Player.defense_exp_mult*=e,r.Player.dexterity_exp_mult*=e,r.Player.agility_exp_mult*=e,r.Player.charisma_exp_mult*=e,r.Player.company_rep_mult*=e,r.Player.faction_rep_mult*=e,r.Player.crime_money_mult*=e,r.Player.crime_success_mult*=e,r.Player.hacknet_node_money_mult*=e,r.Player.hacknet_node_purchase_cost_mult*=t,r.Player.hacknet_node_ram_cost_mult*=t,r.Player.hacknet_node_core_cost_mult*=t,r.Player.hacknet_node_level_cost_mult*=t,r.Player.work_money_mult*=e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(141),a=n(0);t.applySourceFile=function(e){const t="SourceFile"+e.n,n=r.SourceFiles[t];if(null!=n){switch(e.n){case 1:for(var i=0,o=0;o<e.lvl;++o)i+=16/Math.pow(2,o);var s=1+i/100,l=1-i/100;a.Player.hacking_chance_mult*=s,a.Player.hacking_speed_mult*=s,a.Player.hacking_money_mult*=s,a.Player.hacking_grow_mult*=s,a.Player.hacking_mult*=s,a.Player.strength_mult*=s,a.Player.defense_mult*=s,a.Player.dexterity_mult*=s,a.Player.agility_mult*=s,a.Player.charisma_mult*=s,a.Player.hacking_exp_mult*=s,a.Player.strength_exp_mult*=s,a.Player.defense_exp_mult*=s,a.Player.dexterity_exp_mult*=s,a.Player.agility_exp_mult*=s,a.Player.charisma_exp_mult*=s,a.Player.company_rep_mult*=s,a.Player.faction_rep_mult*=s,a.Player.crime_money_mult*=s,a.Player.crime_success_mult*=s,a.Player.hacknet_node_money_mult*=s,a.Player.hacknet_node_purchase_cost_mult*=l,a.Player.hacknet_node_ram_cost_mult*=l,a.Player.hacknet_node_core_cost_mult*=l,a.Player.hacknet_node_level_cost_mult*=l,a.Player.work_money_mult*=s;break;case 2:for(i=0,o=0;o<e.lvl;++o)i+=24/Math.pow(2,o);s=1+i/100,a.Player.crime_money_mult*=s,a.Player.crime_success_mult*=s,a.Player.charisma_mult*=s;break;case 3:for(i=0,o=0;o<e.lvl;++o)i+=8/Math.pow(2,o);s=1+i/100,a.Player.charisma_mult*=s,a.Player.work_money_mult*=s;break;case 4:break;case 5:for(i=0,o=0;o<e.lvl;++o)i+=8/Math.pow(2,o);s=1+i/100,a.Player.hacking_chance_mult*=s,a.Player.hacking_speed_mult*=s,a.Player.hacking_money_mult*=s,a.Player.hacking_grow_mult*=s,a.Player.hacking_mult*=s,a.Player.hacking_exp_mult*=s;break;case 6:for(i=0,o=0;o<e.lvl;++o)i+=8/Math.pow(2,o);s=1+i/100,a.Player.strength_exp_mult*=s,a.Player.defense_exp_mult*=s,a.Player.dexterity_exp_mult*=s,a.Player.agility_exp_mult*=s,a.Player.strength_mult*=s,a.Player.defense_mult*=s,a.Player.dexterity_mult*=s,a.Player.agility_mult*=s;break;case 7:for(i=0,o=0;o<e.lvl;++o)i+=8/Math.pow(2,o);s=1+i/100,a.Player.bladeburner_max_stamina_mult*=s,a.Player.bladeburner_stamina_gain_mult*=s,a.Player.bladeburner_analysis_mult*=s,a.Player.bladeburner_success_chance_mult*=s;break;case 8:for(i=0,o=0;o<e.lvl;++o)i+=12/Math.pow(2,o);s=1+i/100,a.Player.hacking_grow_mult*=s;break;case 9:case 10:break;case 11:for(i=0,o=0;o<e.lvl;++o)i+=32/Math.pow(2,o);s=1+i/100,a.Player.work_money_mult*=s,a.Player.company_rep_mult*=s;break;case 12:var c=Math.pow(1.01,e.lvl),u=Math.pow(.99,e.lvl);a.Player.hacking_chance_mult*=c,a.Player.hacking_speed_mult*=c,a.Player.hacking_money_mult*=c,a.Player.hacking_grow_mult*=c,a.Player.hacking_mult*=c,a.Player.strength_mult*=c,a.Player.defense_mult*=c,a.Player.dexterity_mult*=c,a.Player.agility_mult*=c,a.Player.charisma_mult*=c,a.Player.hacking_exp_mult*=c,a.Player.strength_exp_mult*=c,a.Player.defense_exp_mult*=c,a.Player.dexterity_exp_mult*=c,a.Player.agility_exp_mult*=c,a.Player.charisma_exp_mult*=c,a.Player.company_rep_mult*=c,a.Player.faction_rep_mult*=c,a.Player.crime_money_mult*=c,a.Player.crime_success_mult*=c,a.Player.hacknet_node_money_mult*=c,a.Player.hacknet_node_purchase_cost_mult*=u,a.Player.hacknet_node_ram_cost_mult*=u,a.Player.hacknet_node_core_cost_mult*=u,a.Player.hacknet_node_level_cost_mult*=u,a.Player.work_money_mult*=c;break;default:console.error(`Invalid source file number: ${e.n}`)}n.owned=!0}else console.error(`Invalid source file number: ${e.n}`)}},function(e,t,n){"use strict";n.r(t),n.d(t,"init",function(){return q}),n.d(t,"prestigeAugmentation",function(){return Y}),n.d(t,"prestigeSourceFile",function(){return z}),n.d(t,"receiveInvite",function(){return V}),n.d(t,"calculateSkill",function(){return J}),n.d(t,"updateSkillLevels",function(){return X}),n.d(t,"resetMultipliers",function(){return Q}),n.d(t,"hasProgram",function(){return Z}),n.d(t,"setMoney",function(){return ee}),n.d(t,"gainMoney",function(){return te}),n.d(t,"loseMoney",function(){return ne}),n.d(t,"canAfford",function(){return re}),n.d(t,"recordMoneySource",function(){return ae}),n.d(t,"gainHackingExp",function(){return ie}),n.d(t,"gainStrengthExp",function(){return oe}),n.d(t,"gainDefenseExp",function(){return se}),n.d(t,"gainDexterityExp",function(){return le}),n.d(t,"gainAgilityExp",function(){return ce}),n.d(t,"gainCharismaExp",function(){return ue}),n.d(t,"gainIntelligenceExp",function(){return me}),n.d(t,"queryStatFromString",function(){return pe}),n.d(t,"resetWorkStatus",function(){return he}),n.d(t,"processWorkEarnings",function(){return de}),n.d(t,"startWork",function(){return _e}),n.d(t,"work",function(){return ge}),n.d(t,"finishWork",function(){return ye}),n.d(t,"startWorkPartTime",function(){return fe}),n.d(t,"workPartTime",function(){return be}),n.d(t,"finishWorkPartTime",function(){return Ee}),n.d(t,"startFactionWork",function(){return ve}),n.d(t,"startFactionHackWork",function(){return ke}),n.d(t,"startFactionFieldWork",function(){return Ce}),n.d(t,"startFactionSecurityWork",function(){return Te}),n.d(t,"workForFaction",function(){return Pe}),n.d(t,"finishFactionWork",function(){return Se}),n.d(t,"getWorkMoneyGain",function(){return Oe}),n.d(t,"getWorkHackExpGain",function(){return Me}),n.d(t,"getWorkStrExpGain",function(){return xe}),n.d(t,"getWorkDefExpGain",function(){return we}),n.d(t,"getWorkDexExpGain",function(){return Ae}),n.d(t,"getWorkAgiExpGain",function(){return Ne}),n.d(t,"getWorkChaExpGain",function(){return Re}),n.d(t,"getWorkRepGain",function(){return De}),n.d(t,"getFactionSecurityWorkRepGain",function(){return Ie}),n.d(t,"getFactionFieldWorkRepGain",function(){return Be}),n.d(t,"startCreateProgramWork",function(){return Le}),n.d(t,"createProgramWork",function(){return We}),n.d(t,"finishCreateProgramWork",function(){return Fe}),n.d(t,"startClass",function(){return je}),n.d(t,"takeClass",function(){return Ue}),n.d(t,"finishClass",function(){return He}),n.d(t,"startCrime",function(){return Ge}),n.d(t,"commitCrime",function(){return Ke}),n.d(t,"finishCrime",function(){return $e}),n.d(t,"singularityStopWork",function(){return qe}),n.d(t,"takeDamage",function(){return Ye}),n.d(t,"regenerateHp",function(){return ze}),n.d(t,"hospitalize",function(){return Ve}),n.d(t,"applyForJob",function(){return Je}),n.d(t,"getNextCompanyPosition",function(){return Xe}),n.d(t,"applyForSoftwareJob",function(){return Qe}),n.d(t,"applyForSoftwareConsultantJob",function(){return Ze}),n.d(t,"applyForItJob",function(){return et}),n.d(t,"applyForSecurityEngineerJob",function(){return tt}),n.d(t,"applyForNetworkEngineerJob",function(){return nt}),n.d(t,"applyForBusinessJob",function(){return rt}),n.d(t,"applyForBusinessConsultantJob",function(){return at}),n.d(t,"applyForSecurityJob",function(){return it}),n.d(t,"applyForAgentJob",function(){return ot}),n.d(t,"applyForEmployeeJob",function(){return st}),n.d(t,"applyForPartTimeEmployeeJob",function(){return lt}),n.d(t,"applyForWaiterJob",function(){return ct}),n.d(t,"applyForPartTimeWaiterJob",function(){return ut}),n.d(t,"isQualified",function(){return mt}),n.d(t,"reapplyAllAugmentations",function(){return pt}),n.d(t,"reapplyAllSourceFiles",function(){return ht}),n.d(t,"checkForFactionInvitations",function(){return dt}),n.d(t,"setBitNodeNumber",function(){return _t}),n.d(t,"queueAugmentation",function(){return gt}),n.d(t,"gainCodingContractReward",function(){return yt}),n.d(t,"travel",function(){return ft}),n.d(t,"gotoLocation",function(){return bt}),n.d(t,"canAccessResleeving",function(){return Et}),n.d(t,"giveExploit",function(){return vt}),n.d(t,"getIntelligenceBonus",function(){return kt});var r=n(10),a=n(71),i=n(132),o=n(4),s=n(19),l=(n(70),n(77)),c=n(96),u=n(25),m=n(187),p=n(175),h=n(47),d=n(53),_=n(6),g=(n(30),n(32)),y=n(147),f=n(118),b=n(12),E=n(74),v=n(13),k=n(50),C=n(62),T=n(23),P=(n(108),n(104)),S=n(169),O=n(28),M=n(36),x=n(124),w=n(20),A=n(22),N=n(17),R=n(40),D=n(281),I=n(280),B=n(141),L=n(38),W=n(159),F=n(43),j=n(2),U=n(125),H=n(8),G=n(29),K=(n(16),n(7));const $=1e3/_.CONSTANTS.MilliPerCycle;function q(){var e=Object(A.safetlyCreateUniqueServer)({adminRights:!0,hostname:"home",ip:Object(w.createUniqueRandomIp)(),isConnectedTo:!0,maxRam:8,organizationName:"Home PC",purchasedByPlayer:!0});this.homeComputer=e.ip,this.currentServer=e.ip,Object(w.AddToAllServers)(e),this.getHomeComputer().programs.push(g.Programs.NukeProgram.name)}function Y(){var e=this.getHomeComputer();this.currentServer=e.ip,this.homeComputer=e.ip,this.numPeopleKilled=0,this.karma=0,this.hacking_skill=1,this.strength=1,this.defense=1,this.dexterity=1,this.agility=1,this.charisma=1,this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.money=new F.a(1e3),this.city=O.CityName.Sector12,this.location="",this.companyName="",this.jobs={},this.purchasedServers=[],this.factions=[],this.factionInvitations=[],this.queuedAugmentations=[],this.resleeves=[];for(let e=0;e<this.sleeves.length;++e)this.sleeves[e]instanceof x.Sleeve&&(this.sleeves[e].shock>=100?this.sleeves[e].synchronize(this):this.sleeves[e].shockRecovery(this));this.isWorking=!1,this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.createProgramName="",this.className="",this.crimeType="",this.workHackExpGainRate=0,this.workStrExpGainRate=0,this.workDefExpGainRate=0,this.workDexExpGainRate=0,this.workAgiExpGainRate=0,this.workChaExpGainRate=0,this.workRepGainRate=0,this.workMoneyGainRate=0,this.workHackExpGained=0,this.workStrExpGained=0,this.workDefExpGained=0,this.workDexExpGained=0,this.workAgiExpGained=0,this.workChaExpGained=0,this.workRepGained=0,this.workMoneyGained=0,this.timeWorked=0,this.lastUpdate=(new Date).getTime(),this.playtimeSinceLastAug=0,this.scriptProdSinceLastAug=0,this.moneySourceA.reset(),this.hacknetNodes.length=0,this.hashManager.prestige(),this.updateSkillLevels(),this.hp=this.max_hp}function z(){var e=this.getHomeComputer();this.currentServer=e.ip,this.homeComputer=e.ip,this.numPeopleKilled=0,this.karma=0,this.hacking_skill=1,this.strength=1,this.defense=1,this.dexterity=1,this.agility=1,this.charisma=1,this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.money=new F.a(1e3),this.city=O.CityName.Sector12,this.location="",this.companyName="",this.jobs={},this.purchasedServers=[],this.factions=[],this.factionInvitations=[],this.queuedAugmentations=[],this.augmentations=[],this.resleeves=[],this.sleeves.length=L.SourceFileFlags[10]+this.sleevesFromCovenant;for(let e=0;e<this.sleeves.length;++e)this.sleeves[e]instanceof x.Sleeve?this.sleeves[e].prestige(this):this.sleeves[e]=new x.Sleeve(this);const t=document.getElementById("character-menu-header");t instanceof HTMLElement&&(t.click(),t.click()),this.isWorking=!1,this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.createProgramName="",this.className="",this.crimeType="",this.workHackExpGainRate=0,this.workStrExpGainRate=0,this.workDefExpGainRate=0,this.workDexExpGainRate=0,this.workAgiExpGainRate=0,this.workChaExpGainRate=0,this.workRepGainRate=0,this.workMoneyGainRate=0,this.workHackExpGained=0,this.workStrExpGained=0,this.workDefExpGained=0,this.workDexExpGained=0,this.workAgiExpGained=0,this.workChaExpGained=0,this.workRepGained=0,this.workMoneyGained=0,this.timeWorked=0,this.lastUpdate=(new Date).getTime(),this.hacknetNodes.length=0,this.hashManager.prestige(),this.gang=null,Object(C.f)(),this.hasWseAccount=!1,this.hasTixApiAccess=!1,this.has4SData=!1,this.has4SDataTixApi=!1,this.corporation=0,this.playtimeSinceLastAug=0,this.playtimeSinceLastBitnode=0,this.scriptProdSinceLastAug=0,this.moneySourceA.reset(),this.moneySourceB.reset(),this.updateSkillLevels(),this.hp=this.max_hp}function V(e){this.factionInvitations.includes(e)||this.factions.includes(e)||(this.firstFacInvRecvd=!0,this.factionInvitations.push(e))}function J(e,t=1){return Math.max(Math.floor(t*(32*Math.log(e+534.5)-200)),1)}function X(){this.hacking_skill=Math.max(1,Math.floor(this.calculateSkill(this.hacking_exp,this.hacking_mult*s.BitNodeMultipliers.HackingLevelMultiplier))),this.strength=Math.max(1,Math.floor(this.calculateSkill(this.strength_exp,this.strength_mult*s.BitNodeMultipliers.StrengthLevelMultiplier))),this.defense=Math.max(1,Math.floor(this.calculateSkill(this.defense_exp,this.defense_mult*s.BitNodeMultipliers.DefenseLevelMultiplier))),this.dexterity=Math.max(1,Math.floor(this.calculateSkill(this.dexterity_exp,this.dexterity_mult*s.BitNodeMultipliers.DexterityLevelMultiplier))),this.agility=Math.max(1,Math.floor(this.calculateSkill(this.agility_exp,this.agility_mult*s.BitNodeMultipliers.AgilityLevelMultiplier))),this.charisma=Math.max(1,Math.floor(this.calculateSkill(this.charisma_exp,this.charisma_mult*s.BitNodeMultipliers.CharismaLevelMultiplier))),this.intelligence>0?this.intelligence=Math.floor(this.calculateSkill(this.intelligence_exp)):this.intelligence=0;var e=this.hp/this.max_hp;this.max_hp=Math.floor(10+this.defense/10),this.hp=Math.round(this.max_hp*e)}function Q(){this.hacking_chance_mult=1,this.hacking_speed_mult=1,this.hacking_money_mult=1,this.hacking_grow_mult=1,this.hacking_mult=1,this.strength_mult=1,this.defense_mult=1,this.dexterity_mult=1,this.agility_mult=1,this.charisma_mult=1,this.hacking_exp_mult=1,this.strength_exp_mult=1,this.defense_exp_mult=1,this.dexterity_exp_mult=1,this.agility_exp_mult=1,this.charisma_exp_mult=1,this.company_rep_mult=1,this.faction_rep_mult=1,this.crime_money_mult=1,this.crime_success_mult=1,this.hacknet_node_money_mult=1,this.hacknet_node_purchase_cost_mult=1,this.hacknet_node_ram_cost_mult=1,this.hacknet_node_core_cost_mult=1,this.hacknet_node_level_cost_mult=1,this.work_money_mult=1,this.bladeburner_max_stamina_mult=1,this.bladeburner_stamina_gain_mult=1,this.bladeburner_analysis_mult=1,this.bladeburner_success_chance_mult=1}function Z(e){const t=this.getHomeComputer();if(null==t)return!1;for(var n=0;n<t.programs.length;++n)if(e.toLowerCase()==t.programs[n].toLowerCase())return!0;return!1}function ee(e){isNaN(e)?console.error("NaN passed into Player.setMoney()"):this.money=new F.a(e)}function te(e){isNaN(e)?console.error("NaN passed into Player.gainMoney()"):this.money=this.money.plus(e)}function ne(e){isNaN(e)?console.error("NaN passed into Player.loseMoney()"):this.money=this.money.minus(e)}function re(e){return isNaN(e)?(console.error("NaN passed into Player.canAfford()"),!1):this.money.gte(e)}function ae(e,t){this.moneySourceA instanceof U.MoneySourceTracker||(console.warn("Player.moneySourceA was not properly initialized. Resetting"),this.moneySourceA=new U.MoneySourceTracker),this.moneySourceB instanceof U.MoneySourceTracker||(console.warn("Player.moneySourceB was not properly initialized. Resetting"),this.moneySourceB=new U.MoneySourceTracker),this.moneySourceA.record(e,t),this.moneySourceB.record(e,t)}function ie(e){isNaN(e)?console.error("ERR: NaN passed into Player.gainHackingExp()"):(this.hacking_exp+=e,this.hacking_exp<0&&(this.hacking_exp=0))}function oe(e){isNaN(e)?console.error("ERR: NaN passed into Player.gainStrengthExp()"):(this.strength_exp+=e,this.strength_exp<0&&(this.strength_exp=0))}function se(e){isNaN(e)?console.error("ERR: NaN passed into player.gainDefenseExp()"):(this.defense_exp+=e,this.defense_exp<0&&(this.defense_exp=0))}function le(e){isNaN(e)?console.error("ERR: NaN passed into Player.gainDexterityExp()"):(this.dexterity_exp+=e,this.dexterity_exp<0&&(this.dexterity_exp=0))}function ce(e){isNaN(e)?console.error("ERR: NaN passed into Player.gainAgilityExp()"):(this.agility_exp+=e,this.agility_exp<0&&(this.agility_exp=0))}function ue(e){isNaN(e)?console.error("ERR: NaN passed into Player.gainCharismaExp()"):(this.charisma_exp+=e,this.charisma_exp<0&&(this.charisma_exp=0))}function me(e){isNaN(e)?console.error("ERROR: NaN passed into Player.gainIntelligenceExp()"):(L.SourceFileFlags[5]>0||this.intelligence>0)&&(this.intelligence_exp+=e)}function pe(e){const t=e.toLowerCase();return t.includes("hack")?this.hacking_skill:t.includes("str")?this.strength:t.includes("def")?this.defense:t.includes("dex")?this.dexterity:t.includes("agi")?this.agility:t.includes("cha")?this.charisma:t.includes("int")?this.intelligence:void 0}function he(){this.workHackExpGainRate=0,this.workStrExpGainRate=0,this.workDefExpGainRate=0,this.workDexExpGainRate=0,this.workAgiExpGainRate=0,this.workChaExpGainRate=0,this.workRepGainRate=0,this.workMoneyGainRate=0,this.workMoneyLossRate=0,this.workHackExpGained=0,this.workStrExpGained=0,this.workDefExpGained=0,this.workDexExpGained=0,this.workAgiExpGained=0,this.workChaExpGained=0,this.workRepGained=0,this.workMoneyGained=0,this.timeWorked=0,this.timeWorkedCreateProgram=0,this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.createProgramName="",this.className="",document.getElementById("work-in-progress-text").innerHTML=""}function de(e=1){const t=this.workHackExpGainRate*e,n=this.workStrExpGainRate*e,r=this.workDefExpGainRate*e,a=this.workDexExpGainRate*e,i=this.workAgiExpGainRate*e,o=this.workChaExpGainRate*e,s=(this.workMoneyGainRate-this.workMoneyLossRate)*e;this.gainHackingExp(t),this.gainStrengthExp(n),this.gainDefenseExp(r),this.gainDexterityExp(a),this.gainAgilityExp(i),this.gainCharismaExp(o),this.gainMoney(s),this.recordMoneySource(s,"work"),this.workHackExpGained+=t,this.workStrExpGained+=n,this.workDefExpGained+=r,this.workDexExpGained+=a,this.workAgiExpGained+=i,this.workChaExpGained+=o,this.workRepGained+=this.workRepGainRate*e,this.workMoneyGained+=this.workMoneyGainRate*e,this.workMoneyGained-=this.workMoneyLossRate*e}function _e(e){this.resetWorkStatus(),this.isWorking=!0,this.companyName=e,this.workType=_.CONSTANTS.WorkTypeCompany,this.workHackExpGainRate=this.getWorkHackExpGain(),this.workStrExpGainRate=this.getWorkStrExpGain(),this.workDefExpGainRate=this.getWorkDefExpGain(),this.workDexExpGainRate=this.getWorkDexExpGain(),this.workAgiExpGainRate=this.getWorkAgiExpGain(),this.workChaExpGainRate=this.getWorkChaExpGain(),this.workRepGainRate=this.getWorkRepGain(),this.workMoneyGainRate=this.getWorkMoneyGain(),this.timeNeededToCompleteWork=_.CONSTANTS.MillisecondsPer8Hours;var t=Object(G.clearEventListeners)("work-in-progress-cancel-button");t.innerHTML="Cancel Work",t.addEventListener("click",()=>(this.finishWork(!0),!1)),b.Engine.loadWorkInProgressContent()}function ge(e){var t=!1;if(this.timeWorked+b.Engine._idleSpeed*e>=_.CONSTANTS.MillisecondsPer8Hours&&(t=!0,e=Math.round((_.CONSTANTS.MillisecondsPer8Hours-this.timeWorked)/b.Engine._idleSpeed)),this.timeWorked+=b.Engine._idleSpeed*e,this.workRepGainRate=this.getWorkRepGain(),this.processWorkEarnings(e),t||this.timeWorked>=_.CONSTANTS.MillisecondsPer8Hours)return this.finishWork(!1);const n=u.Companies[this.companyName];let r="0";null!=n&&n instanceof c.Company?r=n.playerReputation:console.error(`Could not find Company: ${this.companyName}`),Object(W.influenceStockThroughCompanyWork)(n,this.workRepGainRate,e);const a=this.jobs[this.companyName];document.getElementById("work-in-progress-text").innerHTML="You are currently working as a "+a+" at "+this.companyName+" (Current Company Reputation: "+j.numeralWrapper.format(r,"0,0")+")<br><br>You have been working for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"<br><br>You have earned: <br><br>$"+j.numeralWrapper.format(this.workMoneyGained,"0,0.00")+" ($"+j.numeralWrapper.format(this.workMoneyGainRate*$,"0,0.00")+" / sec) <br><br>"+j.numeralWrapper.format(this.workRepGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workRepGainRate*$,"0,0.0000")+" / sec) reputation for this company <br><br>"+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workHackExpGainRate*$,"0,0.0000")+" / sec) hacking exp <br><br>"+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workStrExpGainRate*$,"0,0.0000")+" / sec) strength exp <br>"+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workDefExpGainRate*$,"0,0.0000")+" / sec) defense exp <br>"+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workDexExpGainRate*$,"0,0.0000")+" / sec) dexterity exp <br>"+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workAgiExpGainRate*$,"0,0.0000")+" / sec) agility exp <br><br> "+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workChaExpGainRate*$,"0,0.0000")+" / sec) charisma exp <br><br>You will automatically finish after working for 8 hours. You can cancel earlier if you wish, but you will only gain half of the reputation you've earned so far."}function ye(e,t=!1){e&&(this.workRepGained/=2),u.Companies[this.companyName].playerReputation+=this.workRepGained,this.updateSkillLevels();var n="You earned a total of: <br>$"+j.numeralWrapper.format(this.workMoneyGained,"0,0.00")+"<br>"+j.numeralWrapper.format(this.workRepGained,"0,0.0000")+" reputation for the company <br>"+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp <br>"+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp <br>"+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp <br>"+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp <br>"+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp <br>"+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp<br>";if(n=e?"You worked a short shift of "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+" <br><br> Since you cancelled your work early, you only gained half of the reputation you earned. <br><br>"+n:"You worked a full shift of 8 hours! <br><br> "+n,t||Object(H.dialogBoxCreate)(n),document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,b.Engine.loadLocationContent(!1),t){var r="You worked a short shift of "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+" and earned $"+j.numeralWrapper.format(this.workMoneyGained,"0,0.00")+", "+j.numeralWrapper.format(this.workRepGained,"0,0.0000")+" reputation, "+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp, "+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp, "+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp, "+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp, "+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp, and "+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp.";return this.resetWorkStatus(),r}this.resetWorkStatus()}function fe(e){this.resetWorkStatus(),this.isWorking=!0,this.companyName=e,this.workType=_.CONSTANTS.WorkTypeCompanyPartTime,this.workHackExpGainRate=this.getWorkHackExpGain(),this.workStrExpGainRate=this.getWorkStrExpGain(),this.workDefExpGainRate=this.getWorkDefExpGain(),this.workDexExpGainRate=this.getWorkDexExpGain(),this.workAgiExpGainRate=this.getWorkAgiExpGain(),this.workChaExpGainRate=this.getWorkChaExpGain(),this.workRepGainRate=this.getWorkRepGain(),this.workMoneyGainRate=this.getWorkMoneyGain(),this.timeNeededToCompleteWork=_.CONSTANTS.MillisecondsPer8Hours;var t=Object(G.clearEventListeners)("work-in-progress-cancel-button");t.innerHTML="Stop Working",t.addEventListener("click",()=>(this.finishWorkPartTime(),!1)),b.Engine.loadWorkInProgressContent()}function be(e){var t=!1;if(this.timeWorked+b.Engine._idleSpeed*e>=_.CONSTANTS.MillisecondsPer8Hours&&(t=!0,e=Math.round((_.CONSTANTS.MillisecondsPer8Hours-this.timeWorked)/b.Engine._idleSpeed)),this.timeWorked+=b.Engine._idleSpeed*e,this.workRepGainRate=this.getWorkRepGain(),this.processWorkEarnings(e),t||this.timeWorked>=_.CONSTANTS.MillisecondsPer8Hours)return this.finishWorkPartTime();var n=u.Companies[this.companyName],r="0";null!=n&&n instanceof c.Company?r=n.playerReputation:console.error(`Could not find Company: ${this.companyName}`);const a=this.jobs[this.companyName];document.getElementById("work-in-progress-text").innerHTML="You are currently working as a "+a+" at "+this.companyName+" (Current Company Reputation: "+j.numeralWrapper.format(r,"0,0")+")<br><br>You have been working for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"<br><br>You have earned: <br><br>$"+j.numeralWrapper.format(this.workMoneyGained,"0,0.00")+" ($"+j.numeralWrapper.format(this.workMoneyGainRate*$,"0,0.00")+" / sec) <br><br>"+j.numeralWrapper.format(this.workRepGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workRepGainRate*$,"0,0.0000")+" / sec) reputation for this company <br><br>"+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workHackExpGainRate*$,"0,0.0000")+" / sec) hacking exp <br><br>"+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workStrExpGainRate*$,"0,0.0000")+" / sec) strength exp <br>"+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workDefExpGainRate*$,"0,0.0000")+" / sec) defense exp <br>"+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workDexExpGainRate*$,"0,0.0000")+" / sec) dexterity exp <br>"+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workAgiExpGainRate*$,"0,0.0000")+" / sec) agility exp <br><br> "+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workChaExpGainRate*$,"0,0.0000")+" / sec) charisma exp <br><br>You will automatically finish after working for 8 hours. You can cancel earlier if you wish, <br>and there will be no penalty because this is a part-time job."}function Ee(e=!1){u.Companies[this.companyName].playerReputation+=this.workRepGained,this.updateSkillLevels();var t="You earned a total of: <br>$"+j.numeralWrapper.format(this.workMoneyGained,"0,0.00")+"<br>"+j.numeralWrapper.format(this.workRepGained,"0,0.0000")+" reputation for the company <br>"+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp <br>"+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp <br>"+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp <br>"+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp <br>"+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp <br>"+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp<br>";if(t="You worked for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"<br><br> "+t,e||Object(H.dialogBoxCreate)(t),document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,b.Engine.loadLocationContent(!1),e){var n="You worked for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+" and earned a total of $"+j.numeralWrapper.format(this.workMoneyGained,"0,0.00")+", "+j.numeralWrapper.format(this.workRepGained,"0,0.0000")+" reputation, "+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp, "+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp, "+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp, "+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp, "+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp, and "+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp";return this.resetWorkStatus(),n}this.resetWorkStatus()}function ve(e){var t=1+e.favor/100;isNaN(t)&&(t=1),this.workRepGainRate*=t,this.workRepGainRate*=s.BitNodeMultipliers.FactionWorkRepGain,this.isWorking=!0,this.workType=_.CONSTANTS.WorkTypeFaction,this.currentWorkFactionName=e.name,this.timeNeededToCompleteWork=_.CONSTANTS.MillisecondsPer20Hours;var n=Object(G.clearEventListeners)("work-in-progress-cancel-button");n.innerHTML="Stop Faction Work",n.addEventListener("click",()=>(this.finishFactionWork(!0),!1)),b.Engine.loadWorkInProgressContent()}function ke(e){this.resetWorkStatus(),this.workHackExpGainRate=.15*this.hacking_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workRepGainRate=(this.hacking_skill+this.intelligence)/_.CONSTANTS.MaxSkillLevel*this.faction_rep_mult*this.getIntelligenceBonus(.5),this.factionWorkType=_.CONSTANTS.FactionWorkHacking,this.currentWorkFactionDescription="carrying out hacking contracts",this.startFactionWork(e)}function Ce(e){this.resetWorkStatus(),this.workHackExpGainRate=.1*this.hacking_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workStrExpGainRate=.1*this.strength_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workDefExpGainRate=.1*this.defense_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workDexExpGainRate=.1*this.dexterity_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workAgiExpGainRate=.1*this.agility_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workChaExpGainRate=.1*this.charisma_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workRepGainRate=this.getFactionFieldWorkRepGain(),this.factionWorkType=_.CONSTANTS.FactionWorkField,this.currentWorkFactionDescription="carrying out field missions",this.startFactionWork(e)}function Te(e){this.resetWorkStatus(),this.workHackExpGainRate=.05*this.hacking_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workStrExpGainRate=.15*this.strength_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workDefExpGainRate=.15*this.defense_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workDexExpGainRate=.15*this.dexterity_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workAgiExpGainRate=.15*this.agility_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workChaExpGainRate=0*this.charisma_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workRepGainRate=this.getFactionSecurityWorkRepGain(),this.factionWorkType=_.CONSTANTS.FactionWorkSecurity,this.currentWorkFactionDescription="performing security detail",this.startFactionWork(e)}function Pe(e){var t=v.Factions[this.currentWorkFactionName];switch(this.factionWorkType){case _.CONSTANTS.FactionWorkHacking:this.workRepGainRate=(this.hacking_skill+this.intelligence)/_.CONSTANTS.MaxSkillLevel*this.faction_rep_mult*this.getIntelligenceBonus(.5);break;case _.CONSTANTS.FactionWorkField:this.workRepGainRate=this.getFactionFieldWorkRepGain();break;case _.CONSTANTS.FactionWorkSecurity:this.workRepGainRate=this.getFactionSecurityWorkRepGain()}var n=1+t.favor/100;isNaN(n)&&(n=1),this.workRepGainRate*=n,this.workRepGainRate*=s.BitNodeMultipliers.FactionWorkRepGain;var r=!1;if(this.timeWorked+b.Engine._idleSpeed*e>=_.CONSTANTS.MillisecondsPer20Hours&&(r=!0,e=Math.round((_.CONSTANTS.MillisecondsPer20Hours-this.timeWorked)/b.Engine._idleSpeed)),this.timeWorked+=b.Engine._idleSpeed*e,this.processWorkEarnings(e),r||this.timeWorked>=_.CONSTANTS.MillisecondsPer20Hours)return this.finishFactionWork(!1);document.getElementById("work-in-progress-text").innerHTML="You are currently "+this.currentWorkFactionDescription+" for your faction "+t.name+" (Current Faction Reputation: "+j.numeralWrapper.format(t.playerReputation,"0,0")+"). <br>You have been doing this for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"<br><br>You have earned: <br><br>$"+j.numeralWrapper.format(this.workMoneyGained,"0,0.00")+" ("+j.numeralWrapper.format(this.workMoneyGainRate*$,"0,0.00")+" / sec) <br><br>"+j.numeralWrapper.format(this.workRepGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workRepGainRate*$,"0,0.0000")+" / sec) reputation for this faction <br><br>"+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workHackExpGainRate*$,"0,0.0000")+" / sec) hacking exp <br><br>"+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workStrExpGainRate*$,"0,0.0000")+" / sec) strength exp <br>"+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workDefExpGainRate*$,"0,0.0000")+" / sec) defense exp <br>"+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workDexExpGainRate*$,"0,0.0000")+" / sec) dexterity exp <br>"+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workAgiExpGainRate*$,"0,0.0000")+" / sec) agility exp <br><br> "+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workChaExpGainRate*$,"0,0.0000")+" / sec) charisma exp <br><br>You will automatically finish after working for 20 hours. You can cancel earlier if you wish.<br>There is no penalty for cancelling earlier."}function Se(e,t=!1){var n=v.Factions[this.currentWorkFactionName];n.playerReputation+=this.workRepGained,this.updateSkillLevels();var r="You worked for your faction "+n.name+" for a total of "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+" <br><br> You earned a total of: <br>$"+j.numeralWrapper.format(this.workMoneyGained,"0,0.00")+"<br>"+j.numeralWrapper.format(this.workRepGained,"0,0.0000")+" reputation for the faction <br>"+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp <br>"+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp <br>"+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp <br>"+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp <br>"+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp <br>"+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp<br>";if(t||Object(H.dialogBoxCreate)(r),document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,b.Engine.loadFactionContent(),Object(k.displayFactionContent)(n.name),t){var a="You worked for your faction "+n.name+" for a total of "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+". You earned "+j.numeralWrapper.format(this.workRepGained,"0,0.0000")+" rep, "+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp, "+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" str exp, "+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" def exp, "+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dex exp, "+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agi exp, and "+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" cha exp.";return this.resetWorkStatus(),a}this.resetWorkStatus()}function Oe(){let e=1;const t=u.Companies[this.companyName];L.SourceFileFlags[11]>0&&(e=1+t.favor/100);const n=this.jobs[this.companyName],r=h.CompanyPositions[n];return null==r?(console.error(`Could not find CompanyPosition object for ${n}. Work salary will be 0`),0):r.baseSalary*t.salaryMultiplier*this.work_money_mult*s.BitNodeMultipliers.CompanyWorkMoney*e}function Me(){const e=u.Companies[this.companyName],t=this.jobs[this.companyName],n=h.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work hack exp gain will be 0"].join(" ")),0):n.hackingExpGain*e.expMultiplier*this.hacking_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain}function xe(){const e=u.Companies[this.companyName],t=this.jobs[this.companyName],n=h.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work str exp gain will be 0"].join(" ")),0):n.strengthExpGain*e.expMultiplier*this.strength_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain}function we(){const e=u.Companies[this.companyName],t=this.jobs[this.companyName],n=h.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work def exp gain will be 0"].join(" ")),0):n.defenseExpGain*e.expMultiplier*this.defense_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain}function Ae(){const e=u.Companies[this.companyName],t=this.jobs[this.companyName],n=h.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work dex exp gain will be 0"].join(" ")),0):n.dexterityExpGain*e.expMultiplier*this.dexterity_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain}function Ne(){const e=u.Companies[this.companyName],t=this.jobs[this.companyName],n=h.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work agi exp gain will be 0"].join(" ")),0):n.agilityExpGain*e.expMultiplier*this.agility_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain}function Re(){const e=u.Companies[this.companyName],t=this.jobs[this.companyName],n=h.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work cha exp gain will be 0"].join(" ")),0):n.charismaExpGain*e.expMultiplier*this.charisma_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain}function De(){const e=u.Companies[this.companyName],t=this.jobs[this.companyName],n=h.CompanyPositions[t];if(null==e||null==n)return console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work rep gain will be 0"].join(" ")),0;var r=n.calculateJobPerformance(this.hacking_skill,this.strength,this.defense,this.dexterity,this.agility,this.charisma);r+=this.intelligence/_.CONSTANTS.MaxSkillLevel;var a=1+e.favor/100;return isNaN(a)&&(a=1),r*this.company_rep_mult*a}function Ie(){return.9*(this.hacking_skill/_.CONSTANTS.MaxSkillLevel+this.strength/_.CONSTANTS.MaxSkillLevel+this.defense/_.CONSTANTS.MaxSkillLevel+this.dexterity/_.CONSTANTS.MaxSkillLevel+this.agility/_.CONSTANTS.MaxSkillLevel)/4.5*this.faction_rep_mult}function Be(){return.9*(this.hacking_skill/_.CONSTANTS.MaxSkillLevel+this.strength/_.CONSTANTS.MaxSkillLevel+this.defense/_.CONSTANTS.MaxSkillLevel+this.dexterity/_.CONSTANTS.MaxSkillLevel+this.agility/_.CONSTANTS.MaxSkillLevel+this.charisma/_.CONSTANTS.MaxSkillLevel+this.intelligence/_.CONSTANTS.MaxSkillLevel)/5.5*this.faction_rep_mult}function Le(e,t,n){this.resetWorkStatus(),this.isWorking=!0,this.workType=_.CONSTANTS.WorkTypeCreateProgram,this.createProgramReqLvl=n,this.timeNeededToCompleteWork=t;for(var r=0;r<this.getHomeComputer().programs.length;++r){var a=this.getHomeComputer().programs[r];if(a.startsWith(e)&&a.endsWith("%-INC")){var i=a.split("-");if(3!=i.length)break;var o=Number(i[1].slice(0,-1));if(isNaN(o)||o<0||o>=100)break;this.timeWorkedCreateProgram=o/100*this.timeNeededToCompleteWork,this.getHomeComputer().programs.splice(r,1)}}this.createProgramName=e;var s=Object(G.clearEventListeners)("work-in-progress-cancel-button");s.innerHTML="Cancel work on creating program",s.addEventListener("click",()=>(this.finishCreateProgramWork(!0),!1)),b.Engine.loadWorkInProgressContent()}function We(e){var t=this.createProgramReqLvl,n=this.hacking_skill/t*this.getIntelligenceBonus(3);n=1+(n-1)/5,this.timeWorked+=b.Engine._idleSpeed*e,this.timeWorkedCreateProgram+=b.Engine._idleSpeed*e*n;var r=this.createProgramName;this.timeWorkedCreateProgram>=this.timeNeededToCompleteWork&&this.finishCreateProgramWork(!1),document.getElementById("work-in-progress-text").innerHTML="You are currently working on coding "+r+".<br><br> You have been working for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"<br><br>The program is "+(this.timeWorkedCreateProgram/this.timeNeededToCompleteWork*100).toFixed(2)+"% complete. <br>If you cancel, your work will be saved and you can come back to complete the program later."}function Fe(e,t=!1){var n=this.createProgramName;if(!1===e)Object(H.dialogBoxCreate)("You've finished creating "+n+"!<br>The new program can be found on your home computer."),this.getHomeComputer().programs.push(n);else{var r=n+"-"+(Math.floor(this.timeWorkedCreateProgram/this.timeNeededToCompleteWork*1e4)/100).toString()+"%-INC";this.getHomeComputer().programs.push(r)}e||this.gainIntelligenceExp(this.createProgramReqLvl/_.CONSTANTS.IntelligenceProgramBaseExpGain),document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,b.Engine.loadTerminalContent(),this.resetWorkStatus()}function je(e,t,n){this.resetWorkStatus(),this.isWorking=!0,this.workType=_.CONSTANTS.WorkTypeStudyClass,this.className=n;var r=1e3/b.Engine._idleSpeed;var a=0,i=0,o=0,l=0,c=0,u=0,m=0;const p=this.hashManager;switch(n){case _.CONSTANTS.ClassStudyComputerScience:i=_.CONSTANTS.ClassStudyComputerScienceBaseExp*t/r*p.getStudyMult();break;case _.CONSTANTS.ClassDataStructures:a=_.CONSTANTS.ClassDataStructuresBaseCost*e/r,i=_.CONSTANTS.ClassDataStructuresBaseExp*t/r*p.getStudyMult();break;case _.CONSTANTS.ClassNetworks:a=_.CONSTANTS.ClassNetworksBaseCost*e/r,i=_.CONSTANTS.ClassNetworksBaseExp*t/r*p.getStudyMult();break;case _.CONSTANTS.ClassAlgorithms:a=_.CONSTANTS.ClassAlgorithmsBaseCost*e/r,i=_.CONSTANTS.ClassAlgorithmsBaseExp*t/r*p.getStudyMult();break;case _.CONSTANTS.ClassManagement:a=_.CONSTANTS.ClassManagementBaseCost*e/r,m=_.CONSTANTS.ClassManagementBaseExp*t/r*p.getStudyMult();break;case _.CONSTANTS.ClassLeadership:a=_.CONSTANTS.ClassLeadershipBaseCost*e/r,m=_.CONSTANTS.ClassLeadershipBaseExp*t/r*p.getStudyMult();break;case _.CONSTANTS.ClassGymStrength:a=_.CONSTANTS.ClassGymBaseCost*e/r,o=1*t/r*p.getTrainingMult();break;case _.CONSTANTS.ClassGymDefense:a=_.CONSTANTS.ClassGymBaseCost*e/r,l=1*t/r*p.getTrainingMult();break;case _.CONSTANTS.ClassGymDexterity:a=_.CONSTANTS.ClassGymBaseCost*e/r,c=1*t/r*p.getTrainingMult();break;case _.CONSTANTS.ClassGymAgility:a=_.CONSTANTS.ClassGymBaseCost*e/r,u=1*t/r*p.getTrainingMult();break;default:throw new Error("ERR: Invalid/unrecognized class name")}this.workMoneyLossRate=a,this.workHackExpGainRate=i*this.hacking_exp_mult*s.BitNodeMultipliers.ClassGymExpGain,this.workStrExpGainRate=o*this.strength_exp_mult*s.BitNodeMultipliers.ClassGymExpGain,this.workDefExpGainRate=l*this.defense_exp_mult*s.BitNodeMultipliers.ClassGymExpGain,this.workDexExpGainRate=c*this.dexterity_exp_mult*s.BitNodeMultipliers.ClassGymExpGain,this.workAgiExpGainRate=u*this.agility_exp_mult*s.BitNodeMultipliers.ClassGymExpGain,this.workChaExpGainRate=m*this.charisma_exp_mult*s.BitNodeMultipliers.ClassGymExpGain;var h=Object(G.clearEventListeners)("work-in-progress-cancel-button");n==_.CONSTANTS.ClassGymStrength||n==_.CONSTANTS.ClassGymDefense||n==_.CONSTANTS.ClassGymDexterity||n==_.CONSTANTS.ClassGymAgility?h.innerHTML="Stop training at gym":h.innerHTML="Stop taking course",h.addEventListener("click",()=>(this.finishClass(),!1)),b.Engine.loadWorkInProgressContent()}function Ue(e){this.timeWorked+=b.Engine._idleSpeed*e;var t=this.className;this.processWorkEarnings(e),document.getElementById("work-in-progress-text").innerHTML="You have been "+t+" for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"<br><br>This has cost you: <br>$"+j.numeralWrapper.format(this.workMoneyGained,"0,0.00")+" ($"+j.numeralWrapper.format(this.workMoneyLossRate*$,"0,0.00")+" / sec) <br><br>You have gained: <br>"+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workHackExpGainRate*$,"0,0.0000")+" / sec) hacking exp <br>"+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workStrExpGainRate*$,"0,0.0000")+" / sec) strength exp <br>"+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workDefExpGainRate*$,"0,0.0000")+" / sec) defense exp <br>"+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workDexExpGainRate*$,"0,0.0000")+" / sec) dexterity exp <br>"+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workAgiExpGainRate*$,"0,0.0000")+" / sec) agility exp <br>"+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" ("+j.numeralWrapper.format(this.workChaExpGainRate*$,"0,0.0000")+" / sec) charisma exp <br>You may cancel at any time"}function He(e=!1){if(this.gainIntelligenceExp(_.CONSTANTS.IntelligenceClassBaseExpGain*Math.round(this.timeWorked/1e3)),this.workMoneyGained>0)throw new Error("ERR: Somehow gained money while taking class");this.updateSkillLevels();var t="After "+this.className+" for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+", <br>you spent a total of $"+j.numeralWrapper.format(-1*this.workMoneyGained,"0,0.00")+". <br><br>You earned a total of: <br>"+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp <br>"+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp <br>"+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp <br>"+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp <br>"+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp <br>"+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp<br>";if(e||Object(H.dialogBoxCreate)(t),document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,b.Engine.loadLocationContent(!1),e){var n="After "+this.className+" for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+", you spent a total of $"+j.numeralWrapper.format(-1*this.workMoneyGained,"0,0.00")+". You earned a total of: "+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp, "+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp, "+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp, "+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp, "+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp, and "+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp";return this.resetWorkStatus(),n}this.resetWorkStatus()}function Ge(e,t,n,r,a,i,o,l,c,u=null){this.crimeType=e,this.resetWorkStatus(),this.isWorking=!0,this.workType=_.CONSTANTS.WorkTypeCrime,u&&u.workerscript&&(this.committingCrimeThruSingFn=!0,this.singFnCrimeWorkerScript=u.workerscript),this.workHackExpGained=t*this.hacking_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workStrExpGained=n*this.strength_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workDefExpGained=r*this.defense_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workDexExpGained=a*this.dexterity_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workAgiExpGained=i*this.agility_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workChaExpGained=o*this.charisma_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workMoneyGained=l*this.crime_money_mult*s.BitNodeMultipliers.CrimeMoney,this.timeNeededToCompleteWork=c;var m=Object(G.clearEventListeners)("work-in-progress-cancel-button");m.innerHTML="Cancel crime",m.addEventListener("click",()=>(this.finishCrime(!0),!1)),b.Engine.loadWorkInProgressContent()}function Ke(e){if(this.timeWorked+=b.Engine._idleSpeed*e,this.timeWorked>=this.timeNeededToCompleteWork)this.finishCrime(!1);else{var t=Math.round(this.timeWorked/this.timeNeededToCompleteWork*100),n=Math.round(t/5);n<0&&(n=0),n>20&&(n=20);var r="["+Array(n+1).join("|")+Array(20-n+1).join(" ")+"]";document.getElementById("work-in-progress-text").innerHTML="You are attempting to "+this.crimeType+".<br>Time remaining: "+Object(K.convertTimeMsToTimeElapsedString)(this.timeNeededToCompleteWork-this.timeWorked)+"<br>"+r.replace(/ /g," ")}}function $e(e){if(!e){if(Object(y.determineCrimeSuccess)(this,this.crimeType)){let e=null;for(const t in f.Crimes)if(f.Crimes[t].type==this.crimeType){e=f.Crimes[t];break}null==e&&Object(H.dialogBoxCreate)(`ERR: Unrecognized crime type (${this.crimeType}). This is probably a bug please contact the developer`),this.gainMoney(this.workMoneyGained),this.recordMoneySource(this.workMoneyGained,"crime"),this.karma-=e.karma,this.numPeopleKilled+=e.kills,e.intelligence_exp>0&&this.gainIntelligenceExp(e.intelligence_exp),this.workHackExpGained*=2,this.workStrExpGained*=2,this.workDefExpGained*=2,this.workDexExpGained*=2,this.workAgiExpGained*=2,this.workChaExpGained*=2,this.committingCrimeThruSingFn?null==this.singFnCrimeWorkerScript.disableLogs.ALL&&null==this.singFnCrimeWorkerScript.disableLogs.commitCrime&&this.singFnCrimeWorkerScript.scriptRef.log("Crime successful! Gained "+j.numeralWrapper.format(this.workMoneyGained,"$0.000a")+", "+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hack exp, "+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" str exp, "+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" def exp, "+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dex exp, "+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agi exp, "+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" cha exp."):Object(H.dialogBoxCreate)("Crime successful! <br><br>You gained:<br>$"+j.numeralWrapper.format(this.workMoneyGained,"0,0.00")+"<br>"+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking experience <br>"+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength experience<br>"+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense experience<br>"+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity experience<br>"+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility experience<br>"+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma experience")}else this.workHackExpGained/=2,this.workStrExpGained/=2,this.workDefExpGained/=2,this.workDexExpGained/=2,this.workAgiExpGained/=2,this.workChaExpGained/=2,this.committingCrimeThruSingFn?null==this.singFnCrimeWorkerScript.disableLogs.ALL&&null==this.singFnCrimeWorkerScript.disableLogs.commitCrime&&this.singFnCrimeWorkerScript.scriptRef.log("Crime failed! Gained "+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hack exp, "+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" str exp, "+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" def exp, "+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dex exp, "+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agi exp, "+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" cha exp."):Object(H.dialogBoxCreate)("Crime failed! <br><br>You gained:<br>"+j.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking experience <br>"+j.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength experience<br>"+j.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense experience<br>"+j.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity experience<br>"+j.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility experience<br>"+j.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma experience");this.gainHackingExp(this.workHackExpGained),this.gainStrengthExp(this.workStrExpGained),this.gainDefenseExp(this.workDefExpGained),this.gainDexterityExp(this.workDexExpGained),this.gainAgilityExp(this.workAgiExpGained),this.gainCharismaExp(this.workChaExpGained)}this.committingCrimeThruSingFn=!1,this.singFnCrimeWorkerScript=null,document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,this.resetWorkStatus(),b.Engine.loadLocationContent(!1)}function qe(){if(!this.isWorking)return"";var e;switch(this.workType){case _.CONSTANTS.WorkTypeStudyClass:e=this.finishClass(!0);break;case _.CONSTANTS.WorkTypeCompany:e=this.finishWork(!0,!0);break;case _.CONSTANTS.WorkTypeCompanyPartTime:e=this.finishWorkPartTime(!0);break;case _.CONSTANTS.WorkTypeFaction:e=this.finishFactionWork(!0,!0);break;case _.CONSTANTS.WorkTypeCreateProgram:e=this.finishCreateProgramWork(!0,!0);break;case _.CONSTANTS.WorkTypeCrime:e=this.finishCrime(!0);break;default:return console.error(`Unrecognized work type (${this.workType})`),""}return e}function Ye(e){if("number"==typeof e)return this.hp-=e,this.hp<=0&&(this.hospitalize(),!0);console.warn(`Player.takeDamage() called without a numeric argument: ${e}`)}function ze(e){"number"==typeof e?(this.hp+=e,this.hp>this.max_hp&&(this.hp=this.max_hp)):console.warn(`Player.regenerateHp() called without a numeric argument: ${e}`)}function Ve(){!1===N.Settings.SuppressHospitalizationPopup&&Object(H.dialogBoxCreate)("You were in critical condition! You were taken to the hospital where luckily they were able to save your life. You were charged "+j.numeralWrapper.format(this.max_hp*_.CONSTANTS.HospitalCostPerHp,"$0.000a"));const e=this.max_hp*_.CONSTANTS.HospitalCostPerHp;this.loseMoney(e),this.recordMoneySource(-1*e,"hospitalization"),this.hp=this.max_hp}function Je(e,t=!1){let n=null;""!==this.companyName&&(n=u.Companies[this.companyName]);const r=this.jobs[this.companyName],a=u.Companies[this.location];if(!(a instanceof c.Company))return t?"ERROR: Invalid company name: "+this.location+". applyToCompany() failed":void console.error(`Could not find company that matches the location: ${this.location}. Player.applyToCompany() failed`);let i=e;if(!this.isQualified(a,i)){var o=Object(p.getJobRequirementText)(a,i);return!t&&void Object(H.dialogBoxCreate)("Unforunately, you do not qualify for this position<br>"+o)}for(;;){let e=Object(m.getNextCompanyPositionHelper)(i);if(null==e)break;if(!a.hasPosition(e))break;if(!this.isQualified(a,e))break;i=e}if(null==n||n.name!=a.name||i.name!=r){if(this.companyName=a.name,this.jobs[a.name]=i.name,document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),t)return!0;Object(H.dialogBoxCreate)("Congratulations! You were offered a new job at "+this.companyName+" as a "+i.name+"!")}else{var s=Object(m.getNextCompanyPositionHelper)(i);if(null==s){if(t)return!1;Object(H.dialogBoxCreate)("You are already at the highest position for your field! No promotion available")}else if(a.hasPosition(s)){if(t)return!1;o=Object(p.getJobRequirementText)(a,s);Object(H.dialogBoxCreate)("Unfortunately, you do not qualify for a promotion<br>"+o)}else{if(t)return!1;Object(H.dialogBoxCreate)("You are already at the highest position for your field! No promotion available")}}}function Xe(e,t){var n=null;if(""!==this.companyName&&(n=u.Companies[this.companyName]),null==n||n.name!=e.name)return t;const r=this.jobs[this.companyName],a=h.CompanyPositions[r];return a.isSoftwareJob()&&t.isSoftwareJob()||a.isITJob()&&t.isITJob()||a.isBusinessJob()&&t.isBusinessJob()||a.isSecurityEngineerJob()&&t.isSecurityEngineerJob()||a.isNetworkEngineerJob()&&t.isNetworkEngineerJob()||a.isSecurityJob()&&t.isSecurityJob()||a.isAgentJob()&&t.isAgentJob()||a.isSoftwareConsultantJob()&&t.isSoftwareConsultantJob()||a.isBusinessConsultantJob()&&t.isBusinessConsultantJob()||a.isPartTimeJob()&&t.isPartTimeJob()?Object(m.getNextCompanyPositionHelper)(a):t}function Qe(e=!1){return this.applyForJob(h.CompanyPositions[d.SoftwareCompanyPositions[0]],e)}function Ze(e=!1){return this.applyForJob(h.CompanyPositions[d.SoftwareConsultantCompanyPositions[0]],e)}function et(e=!1){return this.applyForJob(h.CompanyPositions[d.ITCompanyPositions[0]],e)}function tt(e=!1){var t=u.Companies[this.location];return this.isQualified(t,h.CompanyPositions[d.SecurityEngineerCompanyPositions[0]])?this.applyForJob(h.CompanyPositions[d.SecurityEngineerCompanyPositions[0]],e):!e&&void Object(H.dialogBoxCreate)("Unforunately, you do not qualify for this position")}function nt(e=!1){var t=u.Companies[this.location];return this.isQualified(t,h.CompanyPositions[d.NetworkEngineerCompanyPositions[0]])?this.applyForJob(h.CompanyPositions[d.NetworkEngineerCompanyPositions[0]],e):!e&&void Object(H.dialogBoxCreate)("Unforunately, you do not qualify for this position")}function rt(e=!1){return this.applyForJob(h.CompanyPositions[d.BusinessCompanyPositions[0]],e)}function at(e=!1){return this.applyForJob(h.CompanyPositions[d.BusinessConsultantCompanyPositions[0]],e)}function it(e=!1){return this.applyForJob(h.CompanyPositions[d.SecurityCompanyPositions[2]],e)}function ot(e=!1){var t=u.Companies[this.location];return this.isQualified(t,h.CompanyPositions[d.AgentCompanyPositions[0]])?this.applyForJob(h.CompanyPositions[d.AgentCompanyPositions[0]],e):!e&&void Object(H.dialogBoxCreate)("Unforunately, you do not qualify for this position")}function st(e=!1){var t=u.Companies[this.location];if(this.isQualified(t,h.CompanyPositions[d.MiscCompanyPositions[1]])){if(this.companyName=t.name,this.jobs[t.name]=d.MiscCompanyPositions[1],document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),e)return!0;Object(H.dialogBoxCreate)("Congratulations, you are now employed at "+this.companyName)}else{if(e)return!1;Object(H.dialogBoxCreate)("Unforunately, you do not qualify for this position")}}function lt(e=!1){var t=u.Companies[this.location];if(this.isQualified(t,h.CompanyPositions[d.PartTimeCompanyPositions[1]])){if(this.companyName=t.name,this.jobs[t.name]=d.PartTimeCompanyPositions[1],document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),e)return!0;Object(H.dialogBoxCreate)("Congratulations, you are now employed part-time at "+this.companyName)}else{if(e)return!1;Object(H.dialogBoxCreate)("Unforunately, you do not qualify for this position")}}function ct(e=!1){var t=u.Companies[this.location];if(this.isQualified(t,h.CompanyPositions[d.MiscCompanyPositions[0]])){if(this.companyName=t.name,this.jobs[t.name]=d.MiscCompanyPositions[0],document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),e)return!0;Object(H.dialogBoxCreate)("Congratulations, you are now employed as a waiter at "+this.companyName)}else{if(e)return!1;Object(H.dialogBoxCreate)("Unforunately, you do not qualify for this position")}}function ut(e=!1){var t=u.Companies[this.location];if(this.isQualified(t,h.CompanyPositions[d.PartTimeCompanyPositions[0]])){if(this.companyName=t.name,this.jobs[t.name]=d.PartTimeCompanyPositions[0],document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),e)return!0;Object(H.dialogBoxCreate)("Congratulations, you are now employed as a part-time waiter at "+this.companyName)}else{if(e)return!1;Object(H.dialogBoxCreate)("Unforunately, you do not qualify for this position")}}function mt(e,t){var n=e.jobStatReqOffset,r=t.requiredHacking>0?t.requiredHacking+n:0,a=t.requiredStrength>0?t.requiredStrength+n:0,i=t.requiredDefense>0?t.requiredDefense+n:0,o=t.requiredDexterity>0?t.requiredDexterity+n:0,s=t.requiredDexterity>0?t.requiredDexterity+n:0,l=t.requiredCharisma>0?t.requiredCharisma+n:0;return this.hacking_skill>=r&&this.strength>=a&&this.defense>=i&&this.dexterity>=o&&this.agility>=s&&this.charisma>=l&&e.playerReputation>=t.requiredReputation}function pt(e=!0){e&&this.resetMultipliers();for(let e=0;e<this.augmentations.length;++e){"HacknetNode NIC Architecture Neural-Upload"===this.augmentations[e].name&&(this.augmentations[e].name="Hacknet Node NIC Architecture Neural-Upload");const n=this.augmentations[e].name;var t=r.Augmentations[n];if(null!=t)if(t.owned=!0,t.name!=o.AugmentationNames.NeuroFluxGovernor)Object(a.a)(this.augmentations[e],!0);else for(let n=0;n<t.level;++n)Object(a.a)(this.augmentations[e],!0);else console.warn(`Invalid augmentation name in Player.reapplyAllAugmentations(). Aug ${n} will be skipped`)}}function ht(){for(let t=0;t<this.sourceFiles.length;++t){var e="SourceFile"+this.sourceFiles[t].n;null!=B.SourceFiles[e]?Object(D.applySourceFile)(this.sourceFiles[t]):console.error(`Invalid source file number: ${this.sourceFiles[t].n}`)}Object(I.applyExploit)()}function dt(){let e=[];var t=this.augmentations.length;const n=Object.keys(this.jobs),r=Object.values(this.jobs);function a(e,t=_.CONSTANTS.CorpFactionRepRequirement){return n.includes(e)&&function(e){const t=u.Companies[e];return null==t?0:t.playerReputation}(e)>t}var i=v.Factions.Illuminati;!i.isBanned&&!i.isMember&&!i.alreadyInvited&&t>=30&&this.money.gte(15e10)&&this.hacking_skill>=1500&&this.strength>=1200&&this.defense>=1200&&this.dexterity>=1200&&this.agility>=1200&&e.push(i);var o=v.Factions.Daedalus;!o.isBanned&&!o.isMember&&!o.alreadyInvited&&t>=Math.round(30*s.BitNodeMultipliers.DaedalusAugsRequirement)&&this.money.gte(1e11)&&(this.hacking_skill>=2500||this.strength>=1500&&this.defense>=1500&&this.dexterity>=1500&&this.agility>=1500)&&e.push(o);var l=v.Factions["The Covenant"];!l.isBanned&&!l.isMember&&!l.alreadyInvited&&t>=20&&this.money.gte(75e9)&&this.hacking_skill>=850&&this.strength>=850&&this.defense>=850&&this.dexterity>=850&&this.agility>=850&&e.push(l);var c=v.Factions.ECorp;c.isBanned||c.isMember||c.alreadyInvited||!a(M.LocationName.AevumECorp)||e.push(c);var m=v.Factions.MegaCorp;m.isBanned||m.isMember||m.alreadyInvited||!a(M.LocationName.Sector12MegaCorp)||e.push(m);var p=v.Factions["Bachman & Associates"];p.isBanned||p.isMember||p.alreadyInvited||!a(M.LocationName.AevumBachmanAndAssociates)||e.push(p);var h=v.Factions["Blade Industries"];h.isBanned||h.isMember||h.alreadyInvited||!a(M.LocationName.Sector12BladeIndustries)||e.push(h);var d=v.Factions.NWO;d.isBanned||d.isMember||d.alreadyInvited||!a(M.LocationName.VolhavenNWO)||e.push(d);var g=v.Factions["Clarke Incorporated"];g.isBanned||g.isMember||g.alreadyInvited||!a(M.LocationName.AevumClarkeIncorporated)||e.push(g);var y=v.Factions["OmniTek Incorporated"];y.isBanned||y.isMember||y.alreadyInvited||!a(M.LocationName.VolhavenOmniTekIncorporated)||e.push(y);var f=v.Factions["Four Sigma"];f.isBanned||f.isMember||f.alreadyInvited||!a(M.LocationName.Sector12FourSigma)||e.push(f);var b=v.Factions["KuaiGong International"];b.isBanned||b.isMember||b.alreadyInvited||!a(M.LocationName.ChongqingKuaiGongInternational)||e.push(b);var E=v.Factions["Fulcrum Secret Technologies"],k=w.AllServers[R.SpecialServerIps[R.SpecialServerNames.FulcrumSecretTechnologies]];null==k?console.error("Could not find Fulcrum Secret Technologies Server"):E.isBanned||E.isMember||E.alreadyInvited||!k.manuallyHacked||!a(M.LocationName.AevumFulcrumTechnologies,25e4)||e.push(E);var C=v.Factions.BitRunners,P=this.getHomeComputer(),S=w.AllServers[R.SpecialServerIps[R.SpecialServerNames.BitRunnersServer]];null==S?console.error("Could not find BitRunners Server"):!C.isBanned&&!C.isMember&&S.manuallyHacked&&!C.alreadyInvited&&P.maxRam>=128&&e.push(C);var x=v.Factions["The Black Hand"],A=w.AllServers[R.SpecialServerIps[R.SpecialServerNames.TheBlackHandServer]];null==A?console.error("Could not find The Black Hand Server"):!x.isBanned&&!x.isMember&&A.manuallyHacked&&!x.alreadyInvited&&P.maxRam>=64&&e.push(x);var N=v.Factions.NiteSec,D=w.AllServers[R.SpecialServerIps[R.SpecialServerNames.NiteSecServer]];null==D?console.error("Could not find NiteSec Server"):!N.isBanned&&!N.isMember&&D.manuallyHacked&&!N.alreadyInvited&&P.maxRam>=32&&e.push(N);var I=v.Factions.Chongqing;I.isBanned||I.isMember||I.alreadyInvited||!this.money.gte(2e7)||this.city!=O.CityName.Chongqing||e.push(I);var B=v.Factions["Sector-12"];B.isBanned||B.isMember||B.alreadyInvited||!this.money.gte(15e6)||this.city!=O.CityName.Sector12||e.push(B);var L=v.Factions["New Tokyo"];L.isBanned||L.isMember||L.alreadyInvited||!this.money.gte(2e7)||this.city!=O.CityName.NewTokyo||e.push(L);var W=v.Factions.Aevum;W.isBanned||W.isMember||W.alreadyInvited||!this.money.gte(4e7)||this.city!=O.CityName.Aevum||e.push(W);var F=v.Factions.Ishima;F.isBanned||F.isMember||F.alreadyInvited||!this.money.gte(3e7)||this.city!=O.CityName.Ishima||e.push(F);var j=v.Factions.Volhaven;j.isBanned||j.isMember||j.alreadyInvited||!this.money.gte(5e7)||this.city!=O.CityName.Volhaven||e.push(j);var U=v.Factions["Speakers for the Dead"];!U.isBanned&&!U.isMember&&!U.alreadyInvited&&this.hacking_skill>=100&&this.strength>=300&&this.defense>=300&&this.dexterity>=300&&this.agility>=300&&this.numPeopleKilled>=30&&this.karma<=-45&&!n.includes(M.LocationName.Sector12CIA)&&!n.includes(M.LocationName.Sector12NSA)&&e.push(U);var H=v.Factions["The Dark Army"];!H.isBanned&&!H.isMember&&!H.alreadyInvited&&this.hacking_skill>=300&&this.strength>=300&&this.defense>=300&&this.dexterity>=300&&this.agility>=300&&this.city==O.CityName.Chongqing&&this.numPeopleKilled>=5&&this.karma<=-45&&!n.includes(M.LocationName.Sector12CIA)&&!n.includes(M.LocationName.Sector12NSA)&&e.push(H);var G=v.Factions["The Syndicate"];!G.isBanned&&!G.isMember&&!G.alreadyInvited&&this.hacking_skill>=200&&this.strength>=200&&this.defense>=200&&this.dexterity>=200&&this.agility>=200&&(this.city==O.CityName.Aevum||this.city==O.CityName.Sector12)&&this.money.gte(1e7)&&this.karma<=-90&&!n.includes(M.LocationName.Sector12CIA)&&!n.includes(M.LocationName.Sector12NSA)&&e.push(G);var K=v.Factions.Silhouette;!K.isBanned&&!K.isMember&&!K.alreadyInvited&&(r.includes("Chief Technology Officer")||r.includes("Chief Financial Officer")||r.includes("Chief Executive Officer"))&&this.money.gte(15e6)&&this.karma<=-22&&e.push(K);var $=v.Factions.Tetrads;!$.isBanned&&!$.isMember&&!$.alreadyInvited&&(this.city==O.CityName.Chongqing||this.city==O.CityName.NewTokyo||this.city==O.CityName.Ishima)&&this.strength>=75&&this.defense>=75&&this.dexterity>=75&&this.agility>=75&&this.karma<=-18&&e.push($);var q=v.Factions["Slum Snakes"];!q.isBanned&&!q.isMember&&!q.alreadyInvited&&this.strength>=30&&this.defense>=30&&this.dexterity>=30&&this.agility>=30&&this.karma<=-9&&this.money.gte(1e6)&&e.push(q);var Y=v.Factions.Netburners,z=0,V=0,J=0;for(let e=0;e<this.hacknetNodes.length;++e)if(Object(T.h)()){const t=w.AllServers[this.hacknetNodes[e]];t&&(J+=t.level,z+=t.maxRam,V+=t.cores)}else J+=this.hacknetNodes[e].level,z+=this.hacknetNodes[e].ram,V+=this.hacknetNodes[e].cores;!Y.isBanned&&!Y.isMember&&!Y.alreadyInvited&&this.hacking_skill>=80&&z>=8&&V>=4&&J>=100&&e.push(Y);var X=v.Factions["Tian Di Hui"];X.isBanned||X.isMember||X.alreadyInvited||!this.money.gte(1e6)||!(this.hacking_skill>=50)||this.city!=O.CityName.Chongqing&&this.city!=O.CityName.NewTokyo&&this.city!=O.CityName.Ishima||e.push(X);var Q=v.Factions.CyberSec,Z=w.AllServers[R.SpecialServerIps[R.SpecialServerNames.CyberSecServer]];return null==Z?console.error("Could not find CyberSec Server"):Q.isBanned||Q.isMember||!Z.manuallyHacked||Q.alreadyInvited||e.push(Q),e}function _t(e){this.bitNodeN=e}function gt(e){for(const t in this.queuedAugmentations)if(this.queuedAugmentations[t].name==e)return void console.warn(`tried to queue ${e} twice, this may be a bug`);for(const t in this.augmentations)if(this.augmentations[t].name==e)return void console.warn(`tried to queue ${e} twice, this may be a bug`);this.firstAugPurchased=!0,this.queuedAugmentations.push(new i.PlayerOwnedAugmentation(e))}function yt(e,t=1){if(null==e||null==e.type||null==e)return"No reward for this contract";switch(e.type){case l.CodingContractRewardType.FactionReputation:if(null==e.name||!(v.Factions[e.name]instanceof E.Faction))return e.type=l.CodingContractRewardType.FactionReputationAll,this.gainCodingContractReward(e);var n=_.CONSTANTS.CodingContractBaseFactionRepGain*t;return v.Factions[e.name].playerReputation+=n,`Gained ${n} faction reputation for ${e.name}`;case l.CodingContractRewardType.FactionReputationAll:const i=_.CONSTANTS.CodingContractBaseFactionRepGain*t,o=["Bladeburners"];var r=this.factions.slice();if(0==(r=r.filter(e=>!o.includes(e))).length)return e.type=l.CodingContractRewardType.Money,this.gainCodingContractReward(e,t);const m=Math.floor(i/r.length);for(const e of r)v.Factions[e]instanceof E.Faction&&(v.Factions[e].playerReputation+=m);return`Gained ${m} reputation for each of the following factions: ${r.toString()}`;case l.CodingContractRewardType.CompanyReputation:if(null==e.name||!(u.Companies[e.name]instanceof c.Company))return e.type=l.CodingContractRewardType.FactionReputationAll,this.gainCodingContractReward(e);n=_.CONSTANTS.CodingContractBaseCompanyRepGain*t;return u.Companies[e.name].playerReputation+=n,`Gained ${n} company reputation for ${e.name}`;case l.CodingContractRewardType.Money:default:var a=_.CONSTANTS.CodingContractBaseMoneyGain*t*s.BitNodeMultipliers.CodingContractMoney;return this.gainMoney(a),this.recordMoneySource(a,"codingcontract"),`Gained ${j.numeralWrapper.format(a,"$0.000a")}`}}function ft(e){return null==P.Cities[e]?(console.warn(`Player.travel() called with invalid city: ${e}`),!1):(this.city=e,!0)}function bt(e){return null==S.Locations[e]?(console.warn(`Player.gotoLocation() called with invalid location: ${e}`),!1):(this.location=e,!0)}function Et(){return 10===this.bitNodeN||L.SourceFileFlags[10]>0}function vt(e){this.exploits.includes(e)||this.exploits.push(e)}function kt(e){return 1+e*Math.pow(this.intelligence,.8)/600}},function(e,t,n){"use strict";n.r(t),n.d(t,"canAccessGang",function(){return l}),n.d(t,"getGangFaction",function(){return c}),n.d(t,"getGangName",function(){return u}),n.d(t,"hasGangWith",function(){return m}),n.d(t,"inGang",function(){return p}),n.d(t,"startGang",function(){return h});var r=n(13),a=n(62),i=n(38),o=n(19);const s=-54e3;function l(){return 2===this.bitNodeN||!(i.SourceFileFlags[2]<=0)&&this.karma<=o.BitNodeMultipliers.GangKarmaRequirement*s}function c(){const e=r.Factions[this.gang.facName];if(null==e)throw new Error(`Gang has invalid faction name: ${this.gang.facName}`);return e}function u(){return this.inGang()?this.gang.facName:""}function m(e){return this.inGang()&&this.gang.facName===e}function p(){return null!=this.gang&&void 0!=this.gang&&this.gang instanceof a.b}function h(e,t){this.gang=new a.b(e,t);const n=r.Factions[e];if(null==n)throw new Error(`Invalid faction name when creating gang: ${e}`);n.playerReputation=0}},function(e,t,n){"use strict";n.r(t),n.d(t,"canAccessCorporation",function(){return i}),n.d(t,"hasCorporation",function(){return o}),n.d(t,"startCorporation",function(){return s});var r=n(30),a=n(38);function i(){return 3===this.bitNodeN||a.SourceFileFlags[3]>0}function o(){return null!=this.corporation&&this.corporation instanceof r.c}function s(e,t=0){this.corporation=new r.c({name:e}),this.corporation.totalShares+=t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.is2DArray=function(e){return e.constructor===Array&&e.every(e=>e.constructor===Array)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ScriptUrl=class{constructor(e,t){this.filename=e,this.url=t}}},,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5),a=n(7);t.tabCompletion=function(e,t,n){if(n.constructor!==Array)return;if(!a.containsAllStrings(n))return;if(""===t)for(let t=n.length-1;t>=0;--t)n[t].toLowerCase().startsWith(e.toLowerCase())||n.splice(t,1);else for(let e=n.length-1;e>=0;--e)n[e].toLowerCase().startsWith(t.toLowerCase())||n.splice(e,1);const i=document.getElementById("terminal-input-text-box");if(null==i)return void console.warn("Couldn't find terminal input DOM element (id=terminal-input-text-box) when trying to autocomplete");const o=i,s=o.value.lastIndexOf(";");let l="";if(0!==n.length)if(1===n.length)l=""===t?n[0]+" ":e+" "+n[0],o.value=-1===s?l:o.value.slice(0,s+1)+" "+l,o.focus();else{const i=a.longestCommonStart(n);let l="";for(let e=0;e<n.length;++e)l+=n[e],l+=" ";""===t?i===e?(r.post("> "+e),r.post(l)):(o.value=-1===s?i:`${o.value.slice(0,s+1)} ${i}`,o.focus()):i===t?(r.post("> "+e+" "+t),r.post(l)):(o.value=-1==s?`${e} ${i}`:`${o.value.slice(0,s+1)} ${e} ${i}`,o.focus())}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(75),a=n(674),i=n(64),o=n(142),s=n(66),l=n(20),c=["alias","analyze","cat","cd","check","clear","cls","connect","download","expr","free","hack","help","home","hostname","ifconfig","kill","killall","ls","lscpu","mem","mv","nano","ps","rm","run","scan","scan-analyze","scp","sudov","tail","theme","top"];t.determineAllPossibilitiesForTabCompletion=function(e,t,n,u=""){let m=[];m=m.concat(Object.keys(i.GlobalAliases));const p=e.getCurrentServer(),h=e.getHomeComputer();let d="",_=null;function g(){for(const e of p.contracts)m.push(e.fn)}function y(){for(const e of p.messages)e instanceof s.Message||m.push(e)}function f(){for(const e of h.programs)m.push(e)}function b(){for(const e of p.scripts){const t=k(e.filename);t&&m.push(t)}}function E(){for(const e of p.textFiles){const t=k(e.fn);t&&m.push(t)}}function v(){const e=a.getSubdirectories(p,null==_?"/":_);for(let t=0;t<e.length;++t){const n=k(null==_?e[t]:_+e[t]);null!=n&&(e[t]=n)}m=m.concat(e)}function k(e){if(!_){if(""!==d){let t=d;return t.endsWith("/")||(t+="/"),d+e}return e}return e.startsWith(_)?function(e){return null==d||null==_?(console.warn("convertParentPath() called when paths are null"),e):e.startsWith(_)?d+e.slice(_.length):(console.warn(`convertParentPath() called for invalid path. (filepath=${e}) (evaledParentDirPath=${_})`),e)}(e):null}function C(e){let n=e;return n.endsWith(" ")||(n+=" "),t.startsWith(n)}if(C("./")&&-1==n){for(var T=0;T<p.scripts.length;++T)m.push("./"+p.scripts[T].filename);for(T=0;T<h.programs.length;++T)m.push("./"+h.programs[T]);return m}if(-1===n)return c.concat(Object.keys(i.Aliases)).concat(Object.keys(i.GlobalAliases));const P=t.split(" ");if(0===P.length)return console.warn("Tab autocompletion logic reached invalid branch"),m;const S=P[P.length-1];if(d=r.getAllParentDirectories(S),"/"===(_=r.evaluateDirectoryPath(d,u)))_=null;else{if(null==_)return m;_+="/"}if(C("buy")){let e=[];for(const t in o.DarkWebItems){const n=o.DarkWebItems[t];e.push(n.program)}return e.concat(Object.keys(i.GlobalAliases))}if(C("scp")&&1===n){for(const e in l.AllServers)m.push(l.AllServers[e].ip),m.push(l.AllServers[e].hostname);return m}if(C("scp")&&0===n)return b(),y(),E(),v(),m;if(C("connect")){for(T=0;T<p.serversOnNetwork.length;++T){var O=l.AllServers[p.serversOnNetwork[T]];null!=O&&(m.push(O.ip),m.push(O.hostname))}return m}return C("kill")||C("tail")||C("mem")||C("check")?(b(),v(),m):C("nano")?(b(),E(),m.push(".fconf"),v(),m):C("rm")?(b(),f(),y(),E(),g(),v(),m):C("run")?(b(),f(),g(),v(),m):C("cat")?(function(){for(const e of p.messages)e instanceof s.Message&&m.push(e.filename)}(),y(),E(),v(),m):C("download")||C("mv")?(b(),E(),v(),m):C("cd")?(v(),m):(C("ls")&&0===n&&v(),m)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(81),a=function(e,t,n=0){this.sourceCode=e,this.sourceCodeLineOffset=n,"string"==typeof e&&(e=r.b(e,a.PARSE_OPTIONS)),this.ast=e,this.initFunc_=t,this.paused_=!1,this.polyfills_=[],this.functionCounter_=0,this.stepFunctions_=Object.create(null);var i,o,s=/^step([A-Z]\w*)$/;for(var l in this)"function"==typeof this[l]&&(i=l.match(s))&&(this.stepFunctions_[i[1]]=this[l].bind(this));this.global=this.createScope(this.ast,null),this.ast=r.b(this.polyfills_.join("\n"),a.PARSE_OPTIONS),this.polyfills_=void 0,this.stripLocations_(this.ast,void 0,void 0),(o=new a.State(this.ast,this.global)).done=!1,this.stateStack=[o],this.run(),this.value=void 0,this.ast=e,(o=new a.State(this.ast,this.global)).done=!1,this.stateStack.length=0,this.stateStack[0]=o,this.nodeConstructor=o.node.constructor,this.stateStack=this.stateStack};
|
||
/**
|
||
* @license
|
||
* JavaScript Interpreter
|
||
*
|
||
* Copyright 2013 Google Inc.
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/a.PARSE_OPTIONS={ecmaVersion:5,locations:!0},a.READONLY_DESCRIPTOR={configurable:!0,enumerable:!0,writable:!1},a.NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!0},a.READONLY_NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!1},a.VARIABLE_DESCRIPTOR={configurable:!1,enumerable:!0,writable:!0},a.STEP_ERROR={},a.SCOPE_REFERENCE={},a.VALUE_IN_DESCRIPTOR={},a.toStringCycles_=[],a.prototype.getErrorLineNumber=function(e){var t=this.sourceCode;if(null==e||null==e.start)return NaN;try{return((t=t.substring(0,e.start)).match(/\n/g)||[]).length+1-this.sourceCodeLineOffset}catch(e){return NaN}},a.prototype.getErrorLineNumberMessage=function(e){return isNaN(e)?" (Unknown line number)":e<=0?" (Error occurred in an imported function)":" (Line Number "+e+". This line number is probably incorrect if your script is importing any functions. This is being worked on)"},a.prototype.appendCode=function(e){var t=this.stateStack[0];if(!t||"Program"!==t.node.type)throw Error("Expecting original AST to start with a Program node.");if("string"==typeof e&&(e=r.b(e,a.PARSE_OPTIONS)),!e||"Program"!==e.type)throw Error("Expecting new AST to start with a Program node.");this.populateScope_(e,t.scope);for(var n,i=0;n=e.body[i];i++)t.node.body.push(n);t.done=!1},a.prototype.step=function(){var e=this.stateStack,t=e[e.length-1];if(!t)return!1;var n=t.node,r=n.type;if("Program"===r&&t.done)return!1;if(this.paused_)return!0;try{var i=this.stepFunctions_[r](e,t,n)}catch(e){if(e!==a.STEP_ERROR)throw e}return i&&e.push(i),!!n.end||this.step()},a.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_},a.prototype.initGlobalScope=function(e){this.setProperty(e,"NaN",NaN,a.READONLY_DESCRIPTOR),this.setProperty(e,"Infinity",1/0,a.READONLY_DESCRIPTOR),this.setProperty(e,"undefined",void 0,a.READONLY_DESCRIPTOR),this.setProperty(e,"window",e,a.READONLY_DESCRIPTOR),this.setProperty(e,"this",e,a.READONLY_DESCRIPTOR),this.setProperty(e,"self",e),this.OBJECT_PROTO=new a.Object(null),this.FUNCTION_PROTO=new a.Object(this.OBJECT_PROTO),this.initFunction(e),this.initObject(e),e.proto=this.OBJECT_PROTO,this.setProperty(e,"constructor",this.OBJECT,a.NONENUMERABLE_DESCRIPTOR),this.initArray(e),this.initString(e),this.initBoolean(e),this.initNumber(e),this.initDate(e),this.initRegExp(e),this.initError(e),this.initMath(e),this.initJSON(e);var t=this,n=this.createNativeFunction(function(e){throw EvalError("Can't happen")},!1);n.eval=!0,this.setProperty(e,"eval",n),this.setProperty(e,"parseInt",this.createNativeFunction(parseInt,!1)),this.setProperty(e,"parseFloat",this.createNativeFunction(parseFloat,!1)),this.setProperty(e,"isNaN",this.createNativeFunction(isNaN,!1)),this.setProperty(e,"isFinite",this.createNativeFunction(isFinite,!1));for(var r=[[escape,"escape"],[unescape,"unescape"],[decodeURI,"decodeURI"],[decodeURIComponent,"decodeURIComponent"],[encodeURI,"encodeURI"],[encodeURIComponent,"encodeURIComponent"]],i=0;i<r.length;i++){var o=function(e){return function(n){try{return e(n)}catch(e){t.throwException(t.URI_ERROR,e.message)}}}(r[i][0]);this.setProperty(e,r[i][1],this.createNativeFunction(o,!1),a.NONENUMERABLE_DESCRIPTOR)}this.OBJECT=this.OBJECT,this.OBJECT_PROTO=this.OBJECT_PROTO,this.FUNCTION=this.FUNCTION,this.FUNCTION_PROTO=this.FUNCTION_PROTO,this.ARRAY=this.ARRAY,this.ARRAY_PROTO=this.ARRAY_PROTO,this.REGEXP=this.REGEXP,this.REGEXP_PROTO=this.REGEXP_PROTO,this.DATE=this.DATE,this.DATE_PROTO=this.DATE_PROTO,this.UNDEFINED=void 0,this.NULL=null,this.NAN=NaN,this.TRUE=!0,this.FALSE=!1,this.STRING_EMPTY="",this.NUMBER_ZERO=0,this.NUMBER_ONE=1,this.initFunc_&&this.initFunc_(this,e)},a.prototype.initFunction=function(e){var t,n=this,i=/^[A-Za-z_$][\w$]*$/;(t=function(e){if(n.calledWithNew())var t=this;else t=n.createObjectProto(n.FUNCTION_PROTO);if(arguments.length)var o=String(arguments[arguments.length-1]);else o="";var s=Array.prototype.slice.call(arguments,0,-1).join(",").trim();if(s){for(var l=s.split(/\s*,\s*/),c=0;c<l.length;c++){var u=l[c];i.test(u)||n.throwException(n.SYNTAX_ERROR,"Invalid function argument: "+u)}s=l.join(", ")}t.parentScope=n.global;try{var m=r.b("(function("+s+") {"+o+"})",a.PARSE_OPTIONS)}catch(e){n.throwException(n.SYNTAX_ERROR,"Invalid code: "+e.message)}return 1!==m.body.length&&n.throwException(n.SYNTAX_ERROR,"Invalid code in function body."),t.node=m.body[0].expression,n.setProperty(t,"length",t.node.length,a.READONLY_DESCRIPTOR),t}).id=this.functionCounter_++,this.FUNCTION=this.createObjectProto(this.FUNCTION_PROTO),this.setProperty(e,"Function",this.FUNCTION),this.setProperty(this.FUNCTION,"prototype",this.FUNCTION_PROTO),this.FUNCTION.nativeFunc=t,this.setProperty(this.FUNCTION_PROTO,"constructor",this.FUNCTION,a.NONENUMERABLE_DESCRIPTOR),this.FUNCTION_PROTO.nativeFunc=function(){},this.FUNCTION_PROTO.nativeFunc.id=this.functionCounter_++,this.setProperty(this.FUNCTION_PROTO,"length",0,a.READONLY_DESCRIPTOR);var o=function(e){if(!(e&&e.isObject||n.getScope().strict))if(void 0===e||null===e)e=n.global;else{var t=n.createObjectProto(n.getPrototype(e));t.data=e,e=t}return e};t=function(e,t){var r=n.stateStack[n.stateStack.length-1];r.func_=this,r.funcThis_=o(e),r.arguments_=[],null!==t&&void 0!==t&&(t.isObject?r.arguments_=n.arrayPseudoToNative(t):n.throwException(n.TYPE_ERROR,"CreateListFromArrayLike called on non-object")),r.doneExec_=!1},this.setNativeFunctionPrototype(this.FUNCTION,"apply",t),t=function(e){var t=n.stateStack[n.stateStack.length-1];t.func_=this,t.funcThis_=o(e),t.arguments_=[];for(var r=1;r<arguments.length;r++)t.arguments_.push(arguments[r]);t.doneExec_=!1},this.setNativeFunctionPrototype(this.FUNCTION,"call",t),this.polyfills_.push("Object.defineProperty(Function.prototype, 'bind',","{configurable: true, writable: true, value:","function(oThis) {","if (typeof this !== 'function') {","throw TypeError('What is trying to be bound is not callable');","}","var aArgs = Array.prototype.slice.call(arguments, 1),","fToBind = this,","fNOP = function() {},","fBound = function() {","return fToBind.apply(this instanceof fNOP","? this",": oThis,","aArgs.concat(Array.prototype.slice.call(arguments)));","};","if (this.prototype) {","fNOP.prototype = this.prototype;","}","fBound.prototype = new fNOP();","return fBound;","}","});",""),t=function(){return this.toString()},this.setNativeFunctionPrototype(this.FUNCTION,"toString",t),this.setProperty(this.FUNCTION,"toString",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR),t=function(){return this.valueOf()},this.setNativeFunctionPrototype(this.FUNCTION,"valueOf",t),this.setProperty(this.FUNCTION,"valueOf",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR)},a.prototype.initObject=function(e){var t,n=this;t=function(e){if(void 0===e||null===e)return n.calledWithNew()?this:n.createObjectProto(n.OBJECT_PROTO);if(!e.isObject){var t=n.createObjectProto(n.getPrototype(e));return t.data=e,t}return e},this.OBJECT=this.createNativeFunction(t,!0),this.setProperty(this.OBJECT,"prototype",this.OBJECT_PROTO),this.setProperty(this.OBJECT_PROTO,"constructor",this.OBJECT,a.NONENUMERABLE_DESCRIPTOR),this.setProperty(e,"Object",this.OBJECT);var r=function(e){void 0!==e&&null!==e||n.throwException(n.TYPE_ERROR,"Cannot convert '"+e+"' to object")};t=function(e){r(e);var t=e.isObject?e.properties:e;return n.arrayNativeToPseudo(Object.getOwnPropertyNames(t))},this.setProperty(this.OBJECT,"getOwnPropertyNames",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR),t=function(e){return r(e),e.isObject&&(e=e.properties),n.arrayNativeToPseudo(Object.keys(e))},this.setProperty(this.OBJECT,"keys",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR),t=function(e){return null===e?n.createObjectProto(null):(void 0!==e&&e.isObject||n.throwException(n.TYPE_ERROR,"Object prototype may only be an Object or null"),n.createObjectProto(e))},this.setProperty(this.OBJECT,"create",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR),this.polyfills_.push("(function() {","var create_ = Object.create;","Object.create = function(proto, props) {","var obj = create_(proto);","props && Object.defineProperties(obj, props);","return obj;","};","})();",""),t=function(e,t,r){return t=String(t),e&&e.isObject||n.throwException(n.TYPE_ERROR,"Object.defineProperty called on non-object"),r&&r.isObject||n.throwException(n.TYPE_ERROR,"Property description must be an object"),!e.properties[t]&&e.preventExtensions&&n.throwException(n.TYPE_ERROR,"Can't define property '"+t+"', object is not extensible"),n.setProperty(e,t,a.VALUE_IN_DESCRIPTOR,r.properties),e},this.setProperty(this.OBJECT,"defineProperty",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR),this.polyfills_.push("(function() {","var defineProperty_ = Object.defineProperty;","Object.defineProperty = function(obj, prop, d1) {","var d2 = {};","if ('configurable' in d1) d2.configurable = d1.configurable;","if ('enumerable' in d1) d2.enumerable = d1.enumerable;","if ('writable' in d1) d2.writable = d1.writable;","if ('value' in d1) d2.value = d1.value;","if ('get' in d1) d2.get = d1.get;","if ('set' in d1) d2.set = d1.set;","return defineProperty_(obj, prop, d2);","};","})();","Object.defineProperty(Object, 'defineProperties',","{configurable: true, writable: true, value:","function(obj, props) {","var keys = Object.keys(props);","for (var i = 0; i < keys.length; i++) {","Object.defineProperty(obj, keys[i], props[keys[i]]);","}","return obj;","}","});",""),t=function(e,t){if(e&&e.isObject||n.throwException(n.TYPE_ERROR,"Object.getOwnPropertyDescriptor called on non-object"),(t=String(t))in e.properties){var r=Object.getOwnPropertyDescriptor(e.properties,t),a=e.getter[t],i=e.setter[t];(a||i)&&(r.get=a,r.set=i,delete r.value,delete r.writable);var o=r.value,s="value"in r;delete r.value;var l=n.nativeToPseudo(r);return s&&n.setProperty(l,"value",o),l}},this.setProperty(this.OBJECT,"getOwnPropertyDescriptor",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR),t=function(e){return r(e),n.getPrototype(e)},this.setProperty(this.OBJECT,"getPrototypeOf",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR),t=function(e){return Boolean(e)&&!e.preventExtensions},this.setProperty(this.OBJECT,"isExtensible",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR),t=function(e){return e&&e.isObject&&(e.preventExtensions=!0),e},this.setProperty(this.OBJECT,"preventExtensions",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR),this.setNativeFunctionPrototype(this.OBJECT,"toString",a.Object.prototype.toString),this.setNativeFunctionPrototype(this.OBJECT,"toLocaleString",a.Object.prototype.toString),this.setNativeFunctionPrototype(this.OBJECT,"valueOf",a.Object.prototype.valueOf),t=function(e){return r(this),this.isObject?String(e)in this.properties:this.hasOwnProperty(e)},this.setNativeFunctionPrototype(this.OBJECT,"hasOwnProperty",t),t=function(e){return r(this),this.isObject?Object.prototype.propertyIsEnumerable.call(this.properties,e):this.propertyIsEnumerable(e)},this.setNativeFunctionPrototype(this.OBJECT,"propertyIsEnumerable",t),t=function(e){for(;;){if(!(e=n.getPrototype(e)))return!1;if(e===this)return!0}},this.setNativeFunctionPrototype(this.OBJECT,"isPrototypeOf",t)},a.prototype.initArray=function(e){var t,n=this;t=function(e){if(n.calledWithNew())var t=this;else t=n.createObjectProto(n.ARRAY_PROTO);var r=arguments[0];if(1===arguments.length&&"number"==typeof r)isNaN(a.legalArrayLength(r))&&n.throwException(n.RANGE_ERROR,"Invalid array length"),t.properties.length=r;else{for(var i=0;i<arguments.length;i++)t.properties[i]=arguments[i];t.properties.length=i}return t},this.ARRAY=this.createNativeFunction(t,!0),this.ARRAY_PROTO=this.ARRAY.properties.prototype,this.setProperty(e,"Array",this.ARRAY),t=function(e){return e&&"Array"===e.class},this.setProperty(this.ARRAY,"isArray",this.createNativeFunction(t,!1),a.NONENUMERABLE_DESCRIPTOR),t=function(){return Array.prototype.pop.call(this.properties)},this.setNativeFunctionPrototype(this.ARRAY,"pop",t),t=function(e){return Array.prototype.push.apply(this.properties,arguments)},this.setNativeFunctionPrototype(this.ARRAY,"push",t),t=function(){return Array.prototype.shift.call(this.properties)},this.setNativeFunctionPrototype(this.ARRAY,"shift",t),t=function(e){return Array.prototype.unshift.apply(this.properties,arguments)},this.setNativeFunctionPrototype(this.ARRAY,"unshift",t),t=function(){return Array.prototype.reverse.call(this.properties),this},this.setNativeFunctionPrototype(this.ARRAY,"reverse",t),t=function(e,t){var r=Array.prototype.splice.apply(this.properties,arguments);return n.arrayNativeToPseudo(r)},this.setNativeFunctionPrototype(this.ARRAY,"splice",t),t=function(e,t){var r=Array.prototype.slice.call(this.properties,e,t);return n.arrayNativeToPseudo(r)},this.setNativeFunctionPrototype(this.ARRAY,"slice",t),t=function(e){return Array.prototype.join.call(this.properties,e)},this.setNativeFunctionPrototype(this.ARRAY,"join",t),t=function(e){for(var t=[],r=0,a=n.getProperty(this,"length"),i=0;i<a;i++){if(n.hasProperty(this,i)){var o=n.getProperty(this,i);t[r]=o}r++}for(i=0;i<arguments.length;i++){var s=arguments[i];if(n.isa(s,n.ARRAY))for(var l=n.getProperty(s,"length"),c=0;c<l;c++)n.hasProperty(s,c)&&(t[r]=n.getProperty(s,c)),r++;else t[r]=s}return n.arrayNativeToPseudo(t)},this.setNativeFunctionPrototype(this.ARRAY,"concat",t),t=function(e,t){return Array.prototype.indexOf.apply(this.properties,arguments)},this.setNativeFunctionPrototype(this.ARRAY,"indexOf",t),t=function(e,t){return Array.prototype.lastIndexOf.apply(this.properties,arguments)},this.setNativeFunctionPrototype(this.ARRAY,"lastIndexOf",t),t=function(){return Array.prototype.sort.call(this.properties),this},this.setNativeFunctionPrototype(this.ARRAY,"sort",t),this.polyfills_.push("Object.defineProperty(Array.prototype, 'every',","{configurable: true, writable: true, value:","function(callbackfn, thisArg) {","if (!this || typeof callbackfn !== 'function') throw TypeError();","var T, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O && !callbackfn.call(T, O[k], k, O)) return false;","k++;","}","return true;","}","});","Object.defineProperty(Array.prototype, 'filter',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var res = [];","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t) {","var val = t[i];","if (fun.call(thisArg, val, i, t)) res.push(val);","}","}","return res;","}","});","if (!Array.prototype.find) {","Object.defineProperty(Array.prototype, 'find', {","value: function(predicate) {","if (this == null) {","throw new TypeError('\"this\" is null or not defined');","}","var o = Object(this);","var len = o.length >>> 0;","if (typeof predicate !== 'function') {","throw new TypeError('predicate must be a function');","}","var thisArg = arguments[1];","var k = 0;","while (k < len) {","var kValue = o[k];","if (predicate.call(thisArg, kValue, k, o)) {","return kValue;","}","k++;","}","return undefined;","},","configurable: true,","writable: true","});","}","if (!Array.prototype.findIndex) {","Object.defineProperty(Array.prototype, 'findIndex', {","value: function(predicate) {","if (this == null) {","throw new TypeError('\"this\" is null or not defined');","}","var o = Object(this);","var len = o.length >>> 0;","if (typeof predicate !== 'function') {","throw new TypeError('predicate must be a function');","}","var thisArg = arguments[1];","var k = 0;","while (k < len) {","var kValue = o[k];","if (predicate.call(thisArg, kValue, k, o)) {","return k;","}","k++;","}","return -1;","},","configurable: true,","writable: true","});","}","Object.defineProperty(Array.prototype, 'forEach',","{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') throw TypeError();","var T, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O) callback.call(T, O[k], k, O);","k++;","}","}","});","Object.defineProperty(Array.prototype, 'includes', {","value: function(searchElement, fromIndex) {","if (this == null) {","throw new TypeError('\"this\" is null or not defined');","}","// 1. Let O be ? ToObject(this value).","var o = Object(this);",'// 2. Let len be ? ToLength(? Get(O, "length")).',"var len = o.length >>> 0;","// 3. If len is 0, return false.","if (len === 0) {","return false;","}","// 4. Let n be ? ToInteger(fromIndex).","// (If fromIndex is undefined, this step produces the value 0.)","var n = fromIndex | 0;","// 5. If n ≥ 0, then","// a. Let k be n.","// 6. Else n < 0,","// a. Let k be len + n.","// b. If k < 0, let k be 0.","var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);","function sameValueZero(x, y) {","return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));","}","// 7. Repeat, while k < len","while (k < len) {","// a. Let elementK be the result of ? Get(O, ! ToString(k)).","// b. If SameValueZero(searchElement, elementK) is true, return true.","if (sameValueZero(o[k], searchElement)) {","return true;","}","// c. Increase k by 1. ","k++;","}","// 8. Return false","return false;","}","});","Object.defineProperty(Array.prototype, 'map',","{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') new TypeError;","var T, A, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","A = new Array(len);","k = 0;","while (k < len) {","if (k in O) A[k] = callback.call(T, O[k], k, O);","k++;","}","return A;","}","});","Object.defineProperty(Array.prototype, 'reduce',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {","if (!this || typeof callback !== 'function') throw TypeError();","var t = Object(this), len = t.length >>> 0, k = 0, value;","if (arguments.length === 2) {","value = arguments[1];","} else {","while (k < len && !(k in t)) k++;","if (k >= len) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k++];","}","for (; k < len; k++) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'reduceRight',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {","if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();","var t = Object(this), len = t.length >>> 0, k = len - 1, value;","if (arguments.length >= 2) {","value = arguments[1];","} else {","while (k >= 0 && !(k in t)) k--;","if (k < 0) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k--];","}","for (; k >= 0; k--) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'some',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (!this || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t && fun.call(thisArg, t[i], i, t)) {","return true;","}","}","return false;","}","});","(function() {","var sort_ = Array.prototype.sort;","Array.prototype.sort = function(opt_comp) {","if (typeof opt_comp !== 'function') {","return sort_.call(this);","}","for (var i = 0; i < this.length; i++) {","var changes = 0;","for (var j = 0; j < this.length - i - 1; j++) {","if (opt_comp(this[j], this[j + 1]) > 0) {","var swap = this[j];","this[j] = this[j + 1];","this[j + 1] = swap;","changes++;","}","}","if (!changes) break;","}","return this;","};","})();","Object.defineProperty(Array.prototype, 'toLocaleString',","{configurable: true, writable: true, value:","function() {","var out = [];","for (var i = 0; i < this.length; i++) {","out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();","}","return out.join(',');","}","});","")},a.prototype.initString=function(e){var t,n=this;t=function(e){return e=String(e),n.calledWithNew()?(this.data=e,this):e},this.STRING=this.createNativeFunction(t,!0),this.setProperty(e,"String",this.STRING),this.setProperty(this.STRING,"fromCharCode",this.createNativeFunction(String.fromCharCode,!1),a.NONENUMERABLE_DESCRIPTOR);for(var r=["charAt","charCodeAt","concat","indexOf","lastIndexOf","slice","substr","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim"],i=0;i<r.length;i++)this.setNativeFunctionPrototype(this.STRING,r[i],String.prototype[r[i]]);t=function(e,t,r){return t=t?n.pseudoToNative(t):void 0,r=r?n.pseudoToNative(r):void 0,String(this).localeCompare(e,t,r)},this.setNativeFunctionPrototype(this.STRING,"localeCompare",t),t=function(e,t){n.isa(e,n.REGEXP)&&(e=e.data);var r=String(this).split(e,t);return n.arrayNativeToPseudo(r)},this.setNativeFunctionPrototype(this.STRING,"split",t),t=function(e){n.isa(e,n.REGEXP)&&(e=e.data);var t=String(this).match(e);return t&&n.arrayNativeToPseudo(t)},this.setNativeFunctionPrototype(this.STRING,"match",t),t=function(e){return n.isa(e,n.REGEXP)&&(e=e.data),String(this).search(e)},this.setNativeFunctionPrototype(this.STRING,"search",t),t=function(e,t){return n.isa(e,n.REGEXP)&&(e=e.data),String(this).replace(e,t)},this.setNativeFunctionPrototype(this.STRING,"replace",t),this.polyfills_.push("(function() {","var replace_ = String.prototype.replace;","String.prototype.replace = function(substr, newSubstr) {","if (typeof newSubstr !== 'function') {","return replace_.call(this, substr, newSubstr);","}","var str = this;","if (substr instanceof RegExp) {","var subs = [];","var m = substr.exec(str);","while (m) {","m.push(m.index, str);","var inject = newSubstr.apply(null, m);","subs.push([m.index, m[0].length, inject]);","m = substr.global ? substr.exec(str) : null;","}","for (var i = subs.length - 1; i >= 0; i--) {","str = str.substring(0, subs[i][0]) + subs[i][2] + str.substring(subs[i][0] + subs[i][1]);","}","} else {","var i = str.indexOf(substr);","if (i !== -1) {","var inject = newSubstr(str.substr(i, substr.length), i, str);","str = str.substring(0, i) + inject + str.substring(i + substr.length);","}","}","return str;","};","})();","if (!String.prototype.endsWith) {","String.prototype.endsWith = function(search, this_len) {","if (this_len === undefined || this_len > this.length) {","this_len = this.length;","}","return this.substring(this_len - search.length, this_len) === search;","};","}","if (!String.prototype.includes) {","String.prototype.includes = function(search, start) {","'use strict';","if (typeof start !== 'number') {","start = 0;","}"," ","if (start + search.length > this.length) {","return false;","} else {","return this.indexOf(search, start) !== -1;","}","};","}","if (!String.prototype.startsWith) {","String.prototype.startsWith = function(search, pos) {","return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;","};","}","")},a.prototype.initBoolean=function(e){var t,n=this;t=function(e){return e=Boolean(e),n.calledWithNew()?(this.data=e,this):e},this.BOOLEAN=this.createNativeFunction(t,!0),this.setProperty(e,"Boolean",this.BOOLEAN)},a.prototype.initNumber=function(e){var t,n=this;t=function(e){return e=Number(e),n.calledWithNew()?(this.data=e,this):e},this.NUMBER=this.createNativeFunction(t,!0),this.setProperty(e,"Number",this.NUMBER);for(var r=["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"],i=0;i<r.length;i++)this.setProperty(this.NUMBER,r[i],Number[r[i]],a.READONLY_NONENUMERABLE_DESCRIPTOR);t=function(e){try{return Number(this).toExponential(e)}catch(e){n.throwException(n.ERROR,e.message)}},this.setNativeFunctionPrototype(this.NUMBER,"toExponential",t),t=function(e){try{return Number(this).toFixed(e)}catch(e){n.throwException(n.ERROR,e.message)}},this.setNativeFunctionPrototype(this.NUMBER,"toFixed",t),t=function(e){try{return Number(this).toPrecision(e)}catch(e){n.throwException(n.ERROR,e.message)}},this.setNativeFunctionPrototype(this.NUMBER,"toPrecision",t),t=function(e){try{return Number(this).toString(e)}catch(e){n.throwException(n.ERROR,e.message)}},this.setNativeFunctionPrototype(this.NUMBER,"toString",t),t=function(e,t){return e=e?n.pseudoToNative(e):void 0,t=t?n.pseudoToNative(t):void 0,Number(this).toLocaleString(e,t)},this.setNativeFunctionPrototype(this.NUMBER,"toLocaleString",t)},a.prototype.initDate=function(e){var t,n=this;t=function(e,t){if(!n.calledWithNew())return Date();var r=[null].concat(Array.from(arguments));return this.data=new(Function.prototype.bind.apply(Date,r)),this},this.DATE=this.createNativeFunction(t,!0),this.DATE_PROTO=this.DATE.properties.prototype,this.setProperty(e,"Date",this.DATE),this.setProperty(this.DATE,"now",this.createNativeFunction(Date.now,!1),a.NONENUMERABLE_DESCRIPTOR),this.setProperty(this.DATE,"parse",this.createNativeFunction(Date.parse,!1),a.NONENUMERABLE_DESCRIPTOR),this.setProperty(this.DATE,"UTC",this.createNativeFunction(Date.UTC,!1),a.NONENUMERABLE_DESCRIPTOR);for(var r=["getDate","getDay","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds","getTime","getTimezoneOffset","getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","getYear","setDate","setFullYear","setHours","setMilliseconds","setMinutes","setMonth","setSeconds","setTime","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes","setUTCMonth","setUTCSeconds","setYear","toDateString","toISOString","toJSON","toGMTString","toLocaleDateString","toLocaleString","toLocaleTimeString","toTimeString","toUTCString"],i=0;i<r.length;i++)t=function(e){return function(t){for(var r=[],a=0;a<arguments.length;a++)r[a]=n.pseudoToNative(arguments[a]);return this.data[e].apply(this.data,r)}}(r[i]),this.setNativeFunctionPrototype(this.DATE,r[i],t)},a.prototype.initRegExp=function(e){var t,n=this;t=function(e,t){if(n.calledWithNew())var r=this;else r=n.createObjectProto(n.REGEXP_PROTO);return e=e?e.toString():"",t=t?t.toString():"",n.populateRegExp(r,new RegExp(e,t)),r},this.REGEXP=this.createNativeFunction(t,!0),this.REGEXP_PROTO=this.REGEXP.properties.prototype,this.setProperty(e,"RegExp",this.REGEXP),this.setProperty(this.REGEXP.properties.prototype,"global",void 0,a.READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(this.REGEXP.properties.prototype,"ignoreCase",void 0,a.READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(this.REGEXP.properties.prototype,"multiline",void 0,a.READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(this.REGEXP.properties.prototype,"source","(?:)",a.READONLY_NONENUMERABLE_DESCRIPTOR),t=function(e){return this.data.test(e)},this.setNativeFunctionPrototype(this.REGEXP,"test",t),t=function(e){e=e.toString(),this.data.lastIndex=Number(n.getProperty(this,"lastIndex"));var t=this.data.exec(e);if(n.setProperty(this,"lastIndex",this.data.lastIndex),t){for(var r=n.createObjectProto(n.ARRAY_PROTO),a=0;a<t.length;a++)n.setProperty(r,a,t[a]);return n.setProperty(r,"index",t.index),n.setProperty(r,"input",t.input),r}return null},this.setNativeFunctionPrototype(this.REGEXP,"exec",t)},a.prototype.initError=function(e){var t=this;this.ERROR=this.createNativeFunction(function(e){if(t.calledWithNew())var n=this;else n=t.createObject(t.ERROR);return e&&t.setProperty(n,"message",String(e),a.NONENUMERABLE_DESCRIPTOR),n},!0),this.setProperty(e,"Error",this.ERROR),this.setProperty(this.ERROR.properties.prototype,"message","",a.NONENUMERABLE_DESCRIPTOR),this.setProperty(this.ERROR.properties.prototype,"name","Error",a.NONENUMERABLE_DESCRIPTOR);var n=function(n){var r=t.createNativeFunction(function(e){if(t.calledWithNew())var n=this;else n=t.createObject(r);return e&&t.setProperty(n,"message",String(e),a.NONENUMERABLE_DESCRIPTOR),n},!0);return t.setProperty(r,"prototype",t.createObject(t.ERROR)),t.setProperty(r.properties.prototype,"name",n,a.NONENUMERABLE_DESCRIPTOR),t.setProperty(e,n,r),r};this.EVAL_ERROR=n("EvalError"),this.RANGE_ERROR=n("RangeError"),this.REFERENCE_ERROR=n("ReferenceError"),this.SYNTAX_ERROR=n("SyntaxError"),this.TYPE_ERROR=n("TypeError"),this.URI_ERROR=n("URIError")},a.prototype.initMath=function(e){var t=this.createObjectProto(this.OBJECT_PROTO);this.setProperty(e,"Math",t);for(var n=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"],r=0;r<n.length;r++)this.setProperty(t,n[r],Math[n[r]],a.READONLY_NONENUMERABLE_DESCRIPTOR);var i=["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","random","round","sin","sqrt","tan"];for(r=0;r<i.length;r++)this.setProperty(t,i[r],this.createNativeFunction(Math[i[r]],!1),a.NONENUMERABLE_DESCRIPTOR)},a.prototype.initJSON=function(e){var t=this,n=t.createObjectProto(this.OBJECT_PROTO);this.setProperty(e,"JSON",n);var r=function(e){try{var n=JSON.parse(e.toString())}catch(e){t.throwException(t.SYNTAX_ERROR,e.message)}return t.nativeToPseudo(n)};this.setProperty(n,"parse",this.createNativeFunction(r,!1)),r=function(e){var n=t.pseudoToNative(e);try{var r=JSON.stringify(n)}catch(e){t.throwException(t.TYPE_ERROR,e.message)}return r},this.setProperty(n,"stringify",this.createNativeFunction(r,!1))},a.prototype.isa=function(e,t){if(null===e||void 0===e||!t)return!1;var n=t.properties.prototype;if(e===n)return!0;for(e=this.getPrototype(e);e;){if(e===n)return!0;e=e.proto}return!1},a.legalArrayLength=function(e){var t=e>>>0;return t===Number(e)?t:NaN},a.legalArrayIndex=function(e){var t=e>>>0;return String(t)===String(e)&&4294967295!==t?t:NaN},a.Value,a.Object=function(e){this.getter=Object.create(null),this.setter=Object.create(null),this.properties=Object.create(null),this.proto=e},a.Object.prototype.proto=null,a.Object.prototype.isObject=!0,a.Object.prototype.class="Object",a.Object.prototype.data=null,a.Object.prototype.toString=function(){if("Array"===this.class){(r=a.toStringCycles_).push(this);try{for(var e=[],t=0;t<this.properties.length;t++){var n=this.properties[t];e[t]=n&&n.isObject&&-1!==r.indexOf(n)?"...":n}}finally{r.pop()}return e.join(",")}if("Error"===this.class){var r,i,o;if(-1!==(r=a.toStringCycles_).indexOf(this))return"[object Error]";var s=this;do{if("name"in s.properties){i=s.properties.name;break}}while(s=s.proto);s=this;do{if("message"in s.properties){o=s.properties.message;break}}while(s=s.proto);r.push(this);try{i=i&&i.toString(),o=o&&o.toString()}finally{r.pop()}return o?i+": "+o:String(i)}return null!==this.data?String(this.data):"[object "+this.class+"]"},a.Object.prototype.valueOf=function(){return void 0===this.data||null===this.data||this.data instanceof RegExp?this:this.data instanceof Date?this.data.valueOf():this.data},a.prototype.createObject=function(e){return this.createObjectProto(e&&e.properties.prototype)},a.prototype.createObjectProto=function(e){if("object"!=typeof e)throw Error("Non object prototype");var t=new a.Object(e);return this.isa(t,this.FUNCTION)&&(this.setProperty(t,"prototype",this.createObjectProto(this.OBJECT_PROTO||null)),t.class="Function"),this.isa(t,this.ARRAY)&&(this.setProperty(t,"length",0,{configurable:!1,enumerable:!1,writable:!0}),t.class="Array"),this.isa(t,this.ERROR)&&(t.class="Error"),t},a.prototype.populateRegExp=function(e,t){e.data=t,this.setProperty(e,"lastIndex",t.lastIndex,a.NONENUMERABLE_DESCRIPTOR),this.setProperty(e,"source",t.source,a.READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(e,"global",t.global,a.READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(e,"ignoreCase",t.ignoreCase,a.READONLY_NONENUMERABLE_DESCRIPTOR),this.setProperty(e,"multiline",t.multiline,a.READONLY_NONENUMERABLE_DESCRIPTOR)},a.prototype.createFunction=function(e,t){var n=this.createObjectProto(this.FUNCTION_PROTO);return n.parentScope=t,n.node=e,this.setProperty(n,"length",n.node.params.length,a.READONLY_DESCRIPTOR),n},a.prototype.createNativeFunction=function(e,t){var n=this.createObjectProto(this.FUNCTION_PROTO);return n.nativeFunc=e,e.id=this.functionCounter_++,this.setProperty(n,"length",e.length,a.READONLY_DESCRIPTOR),t?this.setProperty(n.properties.prototype,"constructor",n,a.NONENUMERABLE_DESCRIPTOR):!1===t&&(n.illegalConstructor=!0,this.setProperty(n,"prototype",void 0)),n},a.prototype.createAsyncFunction=function(e){var t=this.createObjectProto(this.FUNCTION_PROTO);return t.asyncFunc=e,e.id=this.functionCounter_++,this.setProperty(t,"length",e.length,a.READONLY_DESCRIPTOR),t},a.prototype.nativeToPseudo=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)return e;if(e instanceof RegExp){var t=this.createObjectProto(this.REGEXP_PROTO);return this.populateRegExp(t,e),t}if(e instanceof Date){var n=this.createObjectProto(this.DATE_PROTO);return n.data=e,n}if(e instanceof Function){var r=this;return this.createNativeFunction(function(){return r.nativeToPseudo(e.apply(r,Array.prototype.slice.call(arguments).map(function(e){return r.pseudoToNative(e)})))},void 0)}var a;if(Array.isArray(e)){a=this.createObjectProto(this.ARRAY_PROTO);for(var i=0;i<e.length;i++)i in e&&this.setProperty(a,i,this.nativeToPseudo(e[i]))}else for(var o in a=this.createObjectProto(this.OBJECT_PROTO),e)this.setProperty(a,o,this.nativeToPseudo(e[o]));return a},a.prototype.pseudoToNative=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)return e;if(this.isa(e,this.REGEXP))return e.data;if(this.isa(e,this.DATE))return e.data;var n,r=t||{pseudo:[],native:[]};if(-1!==(i=r.pseudo.indexOf(e)))return r.native[i];if(r.pseudo.push(e),this.isa(e,this.ARRAY)){n=[],r.native.push(n);for(var a=this.getProperty(e,"length"),i=0;i<a;i++)this.hasProperty(e,i)&&(n[i]=this.pseudoToNative(this.getProperty(e,i),r))}else{var o;for(var s in n={},r.native.push(n),e.properties)o=e.properties[s],n[s]=this.pseudoToNative(o,r)}return r.pseudo.pop(),r.native.pop(),n},a.prototype.arrayNativeToPseudo=function(e){for(var t=this.createObjectProto(this.ARRAY_PROTO),n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++)this.setProperty(t,n[r],e[n[r]]);return t},a.prototype.arrayPseudoToNative=function(e){var t=[];for(var n in e.properties)t[n]=this.getProperty(e,n);return t.length=a.legalArrayLength(this.getProperty(e,"length"))||0,t},a.prototype.getPrototype=function(e){switch(typeof e){case"number":return this.NUMBER.properties.prototype;case"boolean":return this.BOOLEAN.properties.prototype;case"string":return this.STRING.properties.prototype}return e?e.proto:null},a.prototype.getProperty=function(e,t,n){if(t=String(t),void 0===e||null===e){let r;null!=n&&null!=n.loc&&null!=n.loc.start&&(r=n.loc.start.line),this.throwException(this.TYPE_ERROR,"Cannot read property '"+t+"' of "+e,r)}if("length"===t){if(this.isa(e,this.STRING))return String(e).length}else if(t.charCodeAt(0)<64&&this.isa(e,this.STRING)){var r=a.legalArrayIndex(t);if(!isNaN(r)&&r<String(e).length)return String(e)[r]}do{if(e.properties&&t in e.properties){var i=e.getter[t];return i?(i.isGetter=!0,i):e.properties[t]}}while(e=this.getPrototype(e))},a.prototype.hasProperty=function(e,t){if(!e.isObject)throw TypeError("Primitive data type has no properties");if("length"===(t=String(t))&&this.isa(e,this.STRING))return!0;if(this.isa(e,this.STRING)){var n=a.legalArrayIndex(t);if(!isNaN(n)&&n<String(e).length)return!0}do{if(e.properties&&t in e.properties)return!0}while(e=this.getPrototype(e));return!1},a.prototype.setProperty=function(e,t,n,r){t=String(t),void 0!==e&&null!==e||this.throwException(this.TYPE_ERROR,"Cannot set property '"+t+"' of "+e),r&&("get"in r||"set"in r)&&("value"in r||"writable"in r)&&this.throwException(this.TYPE_ERROR,"Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");var i=!this.stateStack||this.getScope().strict;if(e.isObject){if(this.isa(e,this.STRING)){var o=a.legalArrayIndex(t);if("length"===t||!isNaN(o)&&o<String(e).length)return void(i&&this.throwException(this.TYPE_ERROR,"Cannot assign to read only property '"+t+"' of String '"+e.data+"'"))}if("Array"===e.class){var s,l=e.properties.length;if("length"===t){if(r){if(!("value"in r))return;n=r.value}if(n=a.legalArrayLength(n),isNaN(n)&&this.throwException(this.RANGE_ERROR,"Invalid array length"),n<l)for(s in e.properties)s=a.legalArrayIndex(s),!isNaN(s)&&n<=s&&delete e.properties[s]}else isNaN(s=a.legalArrayIndex(t))||(e.properties.length=Math.max(l,s+1))}if(!e.preventExtensions||t in e.properties)if(r){"get"in r&&(r.get?e.getter[t]=r.get:delete e.getter[t]),"set"in r&&(r.set?e.setter[t]=r.set:delete e.setter[t]);var c={};"configurable"in r&&(c.configurable=r.configurable),"enumerable"in r&&(c.enumerable=r.enumerable),"writable"in r&&(c.writable=r.writable,delete e.getter[t],delete e.setter[t]),"value"in r?(c.value=r.value,delete e.getter[t],delete e.setter[t]):n!==a.VALUE_IN_DESCRIPTOR&&(c.value=n,delete e.getter[t],delete e.setter[t]);try{Object.defineProperty(e.properties,t,c)}catch(e){this.throwException(this.TYPE_ERROR,"Cannot redefine property: "+t)}}else{if(n===a.VALUE_IN_DESCRIPTOR)throw ReferenceError("Value not specified.");for(var u=e;!(t in u.properties);)if(!(u=this.getPrototype(u))){u=e;break}if(u.setter&&u.setter[t])return u.setter[t];if(u.getter&&u.getter[t])i&&this.throwException(this.TYPE_ERROR,"Cannot set property '"+t+"' of object '"+e+"' which only has a getter");else try{e.properties[t]=n}catch(n){i&&this.throwException(this.TYPE_ERROR,"Cannot assign to read only property '"+t+"' of object '"+e+"'")}}else i&&this.throwException(this.TYPE_ERROR,"Can't add property '"+t+"', object is not extensible")}else i&&this.throwException(this.TYPE_ERROR,"Can't create property '"+t+"' on '"+e+"'")},a.prototype.setNativeFunctionPrototype=function(e,t,n){this.setProperty(e.properties.prototype,t,this.createNativeFunction(n,!1),a.NONENUMERABLE_DESCRIPTOR)},a.prototype.getScope=function(){var e=this.stateStack[this.stateStack.length-1].scope;if(!e)throw Error("No scope found.");return e},a.prototype.createScope=function(e,t){var n=this.createObjectProto(null);if(n.parentScope=t,t||this.initGlobalScope(n),this.populateScope_(e,n),n.strict=!1,t&&t.strict)n.strict=!0;else{var r=e.body&&e.body[0];r&&r.expression&&"Literal"===r.expression.type&&"use strict"===r.expression.value&&(n.strict=!0)}return n},a.prototype.createSpecialScope=function(e,t){if(!e)throw Error("parentScope required");var n=t||this.createObjectProto(null);return n.parentScope=e,n.strict=e.strict,n},a.prototype.getValueFromScope=function(e,t){for(var n=this.getScope();n&&n!==this.global;){if(e in n.properties)return n.properties[e];n=n.parentScope}if(n===this.global&&this.hasProperty(n,e))return this.getProperty(n,e);var r,a=this.stateStack[this.stateStack.length-1].node;"UnaryExpression"===a.type&&"typeof"===a.operator||(null!=t&&null!=t.loc&&null!=t.loc.start&&(r=t.loc.start.line),this.throwException(this.REFERENCE_ERROR,e+" is not defined",r))},a.prototype.setValueToScope=function(e,t){for(var n=this.getScope(),r=n.strict;n&&n!==this.global;){if(e in n.properties)return void(n.properties[e]=t);n=n.parentScope}if(n===this.global&&(!r||this.hasProperty(n,e)))return this.setProperty(n,e,t);this.throwException(this.REFERENCE_ERROR,e+" is not defined")},a.prototype.populateScope_=function(e,t){if("VariableDeclaration"===e.type)for(var n=0;n<e.declarations.length;n++)this.setProperty(t,e.declarations[n].id.name,void 0,a.VARIABLE_DESCRIPTOR);else{if("FunctionDeclaration"===e.type)return void this.setProperty(t,e.id.name,this.createFunction(e,t),a.VARIABLE_DESCRIPTOR);if("FunctionExpression"===e.type)return;if("ExpressionStatement"===e.type)return}var r=e.constructor;for(var i in e){var o=e[i];if(o&&"object"==typeof o)if(Array.isArray(o))for(n=0;n<o.length;n++)o[n]&&o[n].constructor===r&&this.populateScope_(o[n],t);else o.constructor===r&&this.populateScope_(o,t)}},a.prototype.stripLocations_=function(e,t,n){for(var r in t?e.start=t:delete e.start,n?e.end=n:delete e.end,e)if(e.hasOwnProperty(r)){var a=e[r];a&&"object"==typeof a&&this.stripLocations_(a,t,n)}},a.prototype.calledWithNew=function(){return this.stateStack[this.stateStack.length-1].isConstructor},a.prototype.getValue=function(e,t){return e[0]===a.SCOPE_REFERENCE?this.getValueFromScope(e[1],t):this.getProperty(e[0],e[1],t)},a.prototype.setValue=function(e,t){return e[0]===a.SCOPE_REFERENCE?this.setValueToScope(e[1],t):this.setProperty(e[0],e[1],t)},a.Completion={NORMAL:0,BREAK:1,CONTINUE:2,RETURN:3,THROW:4},a.prototype.throwException=function(e,t,n){if(void 0===t)var r=e;else{r=this.createObject(e);this.setProperty(r,"message",t,a.NONENUMERABLE_DESCRIPTOR)}var i;throw null!=n&&(i=this.getErrorLineNumberMessage(n)),this.unwind(a.Completion.THROW,r,void 0,i),a.STEP_ERROR},a.prototype.unwind=function(e,t,n,r=""){if(e===a.Completion.NORMAL)throw TypeError("Should not unwind for NORMAL completions");for(var i=this.stateStack;i.length>0;i.pop()){var o=i[i.length-1];switch(o.node.type){case"TryStatement":return void(o.cv={type:e,value:t,label:n});case"CallExpression":case"NewExpression":if(e===a.Completion.RETURN)return void(o.value=t);if(e!==a.Completion.THROW)throw Error("Unsynatctic break/continue not rejected by Acorn")}if(e===a.Completion.BREAK){if(n?o.labels&&-1!==o.labels.indexOf(n):o.isLoop||o.isSwitch)return void i.pop()}else if(e===a.Completion.CONTINUE&&(n?o.labels&&-1!==o.labels.indexOf(n):o.isLoop))return}var s;if(this.isa(t,this.ERROR)){var l={EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError},c=this.getProperty(t,"name").toString(),u=this.getProperty(t,"message").valueOf();s=(e=l[c]||Error)(u+r)}else s=String(t)+r;throw s},a.prototype.createGetter_=function(e,t){var n=Array.isArray(t)?t[0]:t,r=new this.nodeConstructor;r.type="CallExpression";var i=new a.State(r,this.stateStack[this.stateStack.length-1].scope);return i.doneCallee_=!0,i.funcThis_=n,i.func_=e,i.doneArgs_=!0,i.arguments_=[],i},a.prototype.createSetter_=function(e,t,n){var r=Array.isArray(t)?t[0]:this.global,i=new this.nodeConstructor;i.type="CallExpression";var o=new a.State(i,this.stateStack[this.stateStack.length-1].scope);return o.doneCallee_=!0,o.funcThis_=r,o.func_=e,o.doneArgs_=!0,o.arguments_=[n],o},a.State=function(e,t){this.node=e,this.scope=t},a.prototype.stepArrayExpression=function(e,t,n){var r=n.elements,i=t.n_||0;for(t.array_?(this.setProperty(t.array_,i,t.value),i++):(t.array_=this.createObjectProto(this.ARRAY_PROTO),t.array_.properties.length=r.length);i<r.length;){if(r[i])return t.n_=i,new a.State(r[i],t.scope);i++}e.pop(),e[e.length-1].value=t.array_},a.prototype.stepAssignmentExpression=function(e,t,n){if(!t.doneLeft_){t.doneLeft_=!0;var r=new a.State(n.left,t.scope);return r.components=!0,r}if(!t.doneRight_){if(t.leftReference_||(t.leftReference_=t.value),t.doneGetter_&&(t.leftValue_=t.value),!t.doneGetter_&&"="!==n.operator){var i=this.getValue(t.leftReference_,n);if(t.leftValue_=i,i&&"object"==typeof i&&i.isGetter){i.isGetter=!1,t.doneGetter_=!0;var o=i;return this.createGetter_(o,t.leftReference_)}}return t.doneRight_=!0,new a.State(n.right,t.scope)}if(t.doneSetter_)return e.pop(),void(e[e.length-1].value=t.setterValue_);var s=t.leftValue_,l=t.value;switch(n.operator){case"=":s=l;break;case"+=":s+=l;break;case"-=":s-=l;break;case"*=":s*=l;break;case"/=":s/=l;break;case"%=":s%=l;break;case"<<=":s<<=l;break;case">>=":s>>=l;break;case">>>=":s>>>=l;break;case"&=":s&=l;break;case"^=":s^=l;break;case"|=":s|=l;break;default:throw SyntaxError("Unknown assignment expression: "+n.operator)}var c=this.setValue(t.leftReference_,s);if(c)return t.doneSetter_=!0,t.setterValue_=s,this.createSetter_(c,t.leftReference_,s);e.pop(),e[e.length-1].value=s},a.prototype.stepBinaryExpression=function(e,t,n){if(!t.doneLeft_)return t.doneLeft_=!0,new a.State(n.left,t.scope);if(!t.doneRight_)return t.doneRight_=!0,t.leftValue_=t.value,new a.State(n.right,t.scope);e.pop();var r,i=t.leftValue_,o=t.value;switch(n.operator){case"==":r=i==o;break;case"!=":r=i!=o;break;case"===":r=i===o;break;case"!==":r=i!==o;break;case">":r=i>o;break;case">=":r=i>=o;break;case"<":r=i<o;break;case"<=":r=i<=o;break;case"+":r=i+o;break;case"-":r=i-o;break;case"*":r=i*o;break;case"/":r=i/o;break;case"%":r=i%o;break;case"&":r=i&o;break;case"|":r=i|o;break;case"^":r=i^o;break;case"<<":r=i<<o;break;case">>":r=i>>o;break;case">>>":r=i>>>o;break;case"in":if(!o||!o.isObject){let e=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,"'in' expects an object, not '"+o+"'",e)}r=this.hasProperty(o,i);break;case"instanceof":if(!this.isa(o,this.FUNCTION)){let e=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,"Right-hand side of instanceof is not an object",e)}r=!!i.isObject&&this.isa(i,o);break;default:throw SyntaxError("Unknown binary operator: "+n.operator)}e[e.length-1].value=r},a.prototype.stepBlockStatement=function(e,t,n){var r=t.n_||0,i=n.body[r];if(i)return t.n_=r+1,new a.State(i,t.scope);e.pop()},a.prototype.stepBreakStatement=function(e,t,n){var r=n.label&&n.label.name;this.unwind(a.Completion.BREAK,void 0,r)},a.prototype.stepCallExpression=function(e,t,n){if(!t.doneCallee_){t.doneCallee_=1;var i=new a.State(n.callee,t.scope);return i.components=!0,i}if(1===t.doneCallee_){t.doneCallee_=2;var o=t.value;if(Array.isArray(o)){if(t.func_=this.getValue(o,n),o[0]===a.SCOPE_REFERENCE?t.directEval_="eval"===o[1]:t.funcThis_=o[0],(o=t.func_)&&"object"==typeof o&&o.isGetter)return o.isGetter=!1,t.doneCallee_=1,this.createGetter_(o,t.value)}else t.func_=o;t.arguments_=[],t.n_=0}o=t.func_;if(!t.doneArgs_){if(0!==t.n_&&t.arguments_.push(t.value),n.arguments[t.n_])return new a.State(n.arguments[t.n_++],t.scope);if("NewExpression"===n.type){if(o.illegalConstructor){let e=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,o+" is not a constructor",e)}var s=o.properties.prototype;"object"==typeof s&&null!==s||(s=this.OBJECT_PROTO),t.funcThis_=this.createObjectProto(s),t.isConstructor=!0}else void 0===t.funcThis_&&(t.funcThis_=t.scope.strict?void 0:this.global);t.doneArgs_=!0}if(t.doneExec_)e.pop(),t.isConstructor&&"object"!=typeof t.value?e[e.length-1].value=t.funcThis_:e[e.length-1].value=t.value;else{if(t.doneExec_=!0,!o||!o.isObject){let e=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,o+" is not a function",e)}var l=o.node;if(l){for(var c=this.createScope(l.body,o.parentScope),u=0;u<l.params.length;u++){var m=l.params[u].name,p=t.arguments_.length>u?t.arguments_[u]:void 0;this.setProperty(c,m,p)}var h=this.createObjectProto(this.ARRAY_PROTO);for(u=0;u<t.arguments_.length;u++)this.setProperty(h,u,t.arguments_[u]);this.setProperty(c,"arguments",h);var d=l.id&&l.id.name;return d&&this.setProperty(c,d,o),this.setProperty(c,"this",t.funcThis_,a.READONLY_DESCRIPTOR),t.value=void 0,new a.State(l.body,c)}if(o.eval){var _=t.arguments_[0];if("string"==typeof _){try{var g=r.b(_.toString(),a.PARSE_OPTIONS)}catch(e){let t=this.getErrorLineNumber(n);this.throwException(this.SYNTAX_ERROR,"Invalid code: "+e.message,t)}var y=new this.nodeConstructor;return y.type="EvalProgram_",y.body=g.body,this.stripLocations_(y,n.start,n.end),(c=t.directEval_?t.scope:this.global).strict?c=this.createScope(g,c):this.populateScope_(g,c),this.value=void 0,new a.State(y,c)}t.value=_}else if(o.nativeFunc)t.value=o.nativeFunc.apply(t.funcThis_,t.arguments_);else{if(o.asyncFunc){var f=this,b=t.arguments_.concat(function(e){t.value=e,f.paused_=!1});return this.paused_=!0,void o.asyncFunc.apply(t.funcThis_,b)}{let e=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,o.class+" is not a function",e)}}}},a.prototype.stepCatchClause=function(e,t,n){if(!t.done_){t.done_=!0;var r=this.createSpecialScope(t.scope);return this.setProperty(r,n.param.name,t.throwValue),new a.State(n.body,r)}e.pop()},a.prototype.stepConditionalExpression=function(e,t,n){var r=t.mode_||0;if(0===r)return t.mode_=1,new a.State(n.test,t.scope);if(1===r){t.mode_=2;var i=Boolean(t.value);if(i&&n.consequent)return new a.State(n.consequent,t.scope);if(!i&&n.alternate)return new a.State(n.alternate,t.scope);this.value=void 0}e.pop(),"ConditionalExpression"===n.type&&(e[e.length-1].value=t.value)},a.prototype.stepContinueStatement=function(e,t,n){var r=n.label&&n.label.name;this.unwind(a.Completion.CONTINUE,void 0,r)},a.prototype.stepDebuggerStatement=function(e,t,n){e.pop()},a.prototype.stepDoWhileStatement=function(e,t,n){if("DoWhileStatement"===n.type&&void 0===t.test_&&(t.value=!0,t.test_=!0),!t.test_)return t.test_=!0,new a.State(n.test,t.scope);if(t.value){if(n.body)return t.test_=!1,t.isLoop=!0,new a.State(n.body,t.scope)}else e.pop()},a.prototype.stepEmptyStatement=function(e,t,n){e.pop()},a.prototype.stepEvalProgram_=function(e,t,n){var r=t.n_||0,i=n.body[r];if(i)return t.n_=r+1,new a.State(i,t.scope);e.pop(),e[e.length-1].value=this.value},a.prototype.stepExpressionStatement=function(e,t,n){if(!t.done_)return t.done_=!0,new a.State(n.expression,t.scope);e.pop(),this.value=t.value},a.prototype.stepForInStatement=function(e,t,n){if(!t.doneInit_&&(t.doneInit_=!0,n.left.declarations&&n.left.declarations[0].init)){if(t.scope.strict){let e=this.getErrorLineNumber(n);this.throwException(this.SYNTAX_ERROR,"for-in loop variable declaration may not have an initializer.",e)}return new a.State(n.left,t.scope)}if(!t.doneObject_)return t.doneObject_=!0,t.variable_||(t.variable_=t.value),new a.State(n.right,t.scope);if(t.isLoop||(t.isLoop=!0,t.object_=t.value,t.visited_=Object.create(null)),void 0===t.name_)e:for(;;){if(t.object_&&t.object_.isObject)for(t.props_||(t.props_=Object.getOwnPropertyNames(t.object_.properties));;){if(void 0===(r=t.props_.shift()))break;if(Object.prototype.hasOwnProperty.call(t.object_.properties,r)&&(!t.visited_[r]&&(t.visited_[r]=!0,Object.prototype.propertyIsEnumerable.call(t.object_.properties,r)))){t.name_=r;break e}}else if(null!==t.object_&&void 0!==t.object_)for(t.props_||(t.props_=Object.getOwnPropertyNames(t.object_));;){var r;if(void 0===(r=t.props_.shift()))break;if(t.visited_[r]=!0,Object.prototype.propertyIsEnumerable.call(t.object_,r)){t.name_=r;break e}}if(t.object_=this.getPrototype(t.object_),t.props_=null,null===t.object_)return void e.pop()}if(!t.doneVariable_){t.doneVariable_=!0;var i=n.left;if("VariableDeclaration"!==i.type){t.variable_=null;var o=new a.State(i,t.scope);return o.components=!0,o}t.variable_=[a.SCOPE_REFERENCE,i.declarations[0].id.name]}if(t.variable_||(t.variable_=t.value),!t.doneSetter_){t.doneSetter_=!0;var s=t.name_,l=this.setValue(t.variable_,s);if(l)return this.createSetter_(l,t.variable_,s)}return t.name_=void 0,t.doneVariable_=!1,t.doneSetter_=!1,n.body?new a.State(n.body,t.scope):void 0},a.prototype.stepForStatement=function(e,t,n){var r=t.mode_||0;if(0===r){if(t.mode_=1,n.init)return new a.State(n.init,t.scope)}else if(1===r){if(t.mode_=2,n.test)return new a.State(n.test,t.scope)}else if(2===r){if(t.mode_=3,!n.test||t.value)return t.isLoop=!0,new a.State(n.body,t.scope);e.pop()}else if(3===r&&(t.mode_=1,n.update))return new a.State(n.update,t.scope)},a.prototype.stepFunctionDeclaration=function(e,t,n){e.pop()},a.prototype.stepFunctionExpression=function(e,t,n){e.pop(),e[e.length-1].value=this.createFunction(n,t.scope)},a.prototype.stepIdentifier=function(e,t,n){if(e.pop(),t.components)e[e.length-1].value=[a.SCOPE_REFERENCE,n.name];else{var r=this.getValueFromScope(n.name,n);if(r&&"object"==typeof r&&r.isGetter){r.isGetter=!1;for(var i=t.scope;!this.hasProperty(i,n.name);)i=i.parentScope;var o=r;return this.createGetter_(o,this.global)}e[e.length-1].value=r}},a.prototype.stepIfStatement=a.prototype.stepConditionalExpression,a.prototype.stepLabeledStatement=function(e,t,n){e.pop();var r=t.labels||[];r.push(n.label.name);var i=new a.State(n.body,t.scope);return i.labels=r,i},a.prototype.stepLiteral=function(e,t,n){e.pop();var r=n.value;if(r instanceof RegExp){var a=this.createObjectProto(this.REGEXP_PROTO);this.populateRegExp(a,r),r=a}e[e.length-1].value=r},a.prototype.stepLogicalExpression=function(e,t,n){if("&&"!==n.operator&&"||"!==n.operator)throw SyntaxError("Unknown logical operator: "+n.operator);if(!t.doneLeft_)return t.doneLeft_=!0,new a.State(n.left,t.scope);if(t.doneRight_)e.pop(),e[e.length-1].value=t.value;else{if(!("&&"===n.operator&&!t.value||"||"===n.operator&&t.value))return t.doneRight_=!0,new a.State(n.right,t.scope);e.pop(),e[e.length-1].value=t.value}},a.prototype.stepMemberExpression=function(e,t,n){if(!t.doneObject_)return t.doneObject_=!0,new a.State(n.object,t.scope);var r;if(n.computed){if(!t.doneProperty_)return t.object_=t.value,t.doneProperty_=!0,new a.State(n.property,t.scope);r=t.value}else t.object_=t.value,r=n.property.name;if(e.pop(),t.components)e[e.length-1].value=[t.object_,r];else{var i=this.getProperty(t.object_,r);if(i&&"object"==typeof i&&i.isGetter){i.isGetter=!1;var o=i;return this.createGetter_(o,t.object_)}e[e.length-1].value=i}},a.prototype.stepNewExpression=a.prototype.stepCallExpression,a.prototype.stepObjectExpression=function(e,t,n){var r=t.n_||0,i=n.properties[r];if(t.object_){if("Identifier"===(s=i.key).type)var o=s.name;else{if("Literal"!==s.type)throw SyntaxError("Unknown object structure: "+s.type);o=s.value}t.properties_[o]||(t.properties_[o]={}),t.properties_[o][i.kind]=t.value,t.n_=++r,i=n.properties[r]}else t.object_=this.createObjectProto(this.OBJECT_PROTO),t.properties_=Object.create(null);if(i)return new a.State(i.value,t.scope);for(var s in t.properties_){var l=t.properties_[s];if("get"in l||"set"in l){var c={configurable:!0,enumerable:!0,get:l.get,set:l.set};this.setProperty(t.object_,s,null,c)}else this.setProperty(t.object_,s,l.init)}e.pop(),e[e.length-1].value=t.object_},a.prototype.stepProgram=function(e,t,n){var r=n.body.shift();if(r)return t.done=!1,new a.State(r,t.scope);t.done=!0},a.prototype.stepReturnStatement=function(e,t,n){if(n.argument&&!t.done_)return t.done_=!0,new a.State(n.argument,t.scope);this.unwind(a.Completion.RETURN,t.value,void 0)},a.prototype.stepSequenceExpression=function(e,t,n){var r=t.n_||0,i=n.expressions[r];if(i)return t.n_=r+1,new a.State(i,t.scope);e.pop(),e[e.length-1].value=t.value},a.prototype.stepSwitchStatement=function(e,t,n){if(!t.test_)return t.test_=1,new a.State(n.discriminant,t.scope);for(1===t.test_&&(t.test_=2,t.switchValue_=t.value,t.defaultCase_=-1);;){var r=t.index_||0,i=n.cases[r];if(t.matched_||!i||i.test)if(i||t.matched_||-1===t.defaultCase_){if(!i)return void e.pop();if(!t.matched_&&!t.tested_&&i.test)return t.tested_=!0,new a.State(i.test,t.scope);if(t.matched_||t.value===t.switchValue_){t.matched_=!0;var o=t.n_||0;if(i.consequent[o])return t.isSwitch=!0,t.n_=o+1,new a.State(i.consequent[o],t.scope)}t.tested_=!1,t.n_=0,t.index_=r+1}else t.matched_=!0,t.index_=t.defaultCase_;else t.defaultCase_=r,t.index_=r+1}},a.prototype.stepThisExpression=function(e,t,n){e.pop(),e[e.length-1].value=this.getValueFromScope("this",n)},a.prototype.stepThrowStatement=function(e,t,n){if(!t.done_)return t.done_=!0,new a.State(n.argument,t.scope);this.throwException(t.value)},a.prototype.stepTryStatement=function(e,t,n){if(!t.doneBlock_)return t.doneBlock_=!0,new a.State(n.block,t.scope);if(t.cv&&t.cv.type===a.Completion.THROW&&!t.doneHandler_&&n.handler){t.doneHandler_=!0;var r=new a.State(n.handler,t.scope);return r.throwValue=t.cv.value,t.cv=void 0,r}if(!t.doneFinalizer_&&n.finalizer)return t.doneFinalizer_=!0,new a.State(n.finalizer,t.scope);e.pop(),t.cv&&this.unwind(t.cv.type,t.cv.value,t.cv.label)},a.prototype.stepUnaryExpression=function(e,t,n){if(!t.done_){t.done_=!0;var r=new a.State(n.argument,t.scope);return r.components="delete"===n.operator,r}e.pop();var i=t.value;if("-"===n.operator)i=-i;else if("+"===n.operator)i=+i;else if("!"===n.operator)i=!i;else if("~"===n.operator)i=~i;else if("delete"===n.operator){var o=!0;if(Array.isArray(i)){var s=i[0];s===a.SCOPE_REFERENCE&&(s=t.scope);var l=String(i[1]);try{delete s.properties[l]}catch(e){t.scope.strict?this.throwException(this.TYPE_ERROR,"Cannot delete property '"+l+"' of '"+s+"'"):o=!1}}i=o}else if("typeof"===n.operator)i=i&&"Function"===i.class?"function":typeof i;else{if("void"!==n.operator)throw SyntaxError("Unknown unary operator: "+n.operator);i=void 0}e[e.length-1].value=i},a.prototype.stepUpdateExpression=function(e,t,n){if(!t.doneLeft_){t.doneLeft_=!0;var r=new a.State(n.argument,t.scope);return r.components=!0,r}if(t.leftSide_||(t.leftSide_=t.value),t.doneGetter_&&(t.leftValue_=t.value),!t.doneGetter_){var i=this.getValue(t.leftSide_,n);if(t.leftValue_=i,i&&"object"==typeof i&&i.isGetter){i.isGetter=!1,t.doneGetter_=!0;var o=i;return this.createGetter_(o,t.leftSide_)}}if(t.doneSetter_)return e.pop(),void(e[e.length-1].value=t.setterValue_);var s;i=Number(t.leftValue_);if("++"===n.operator)s=i+1;else{if("--"!==n.operator)throw SyntaxError("Unknown update expression: "+n.operator);s=i-1}var l=n.prefix?s:i,c=this.setValue(t.leftSide_,s);if(c)return t.doneSetter_=!0,t.setterValue_=l,this.createSetter_(c,t.leftSide_,s);e.pop(),e[e.length-1].value=l},a.prototype.stepVariableDeclaration=function(e,t,n){var r=n.declarations,i=t.n_||0,o=r[i];for(t.init_&&o&&(this.setValueToScope(o.id.name,t.value),t.init_=!1,o=r[++i]);o;){if(o.init)return t.n_=i,t.init_=!0,new a.State(o.init,t.scope);o=r[++i]}e.pop()},a.prototype.stepWithStatement=function(e,t,n){if(!t.doneObject_)return t.doneObject_=!0,new a.State(n.object,t.scope);if(!t.doneBody_){t.doneBody_=!0;var r=this.createSpecialScope(t.scope,t.value);return new a.State(n.body,r)}e.pop()},a.prototype.stepWhileStatement=a.prototype.stepDoWhileStatement,a.prototype.step=a.prototype.step,a.prototype.run=a.prototype.run,a.prototype.appendCode=a.prototype.appendCode,a.prototype.createObject=a.prototype.createObject,a.prototype.createObjectProto=a.prototype.createObjectProto,a.prototype.createAsyncFunction=a.prototype.createAsyncFunction,a.prototype.createNativeFunction=a.prototype.createNativeFunction,a.prototype.getProperty=a.prototype.getProperty,a.prototype.setProperty=a.prototype.setProperty,a.prototype.nativeToPseudo=a.prototype.nativeToPseudo,a.prototype.pseudoToNative=a.prototype.pseudoToNative,a.prototype.createPrimitive=function(e){return e}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n(1),a=n.n(r),i=n(23),o=n(0),s=n(2);function l(e){if(null==e.multiplier||null==e.onClick)throw new Error("PurchaseButton constructed without required props");const t=e.cost;let n,r=o.Player.canAfford(t)?"std-button":"std-button-disabled",l=null;return Object(i.h)()?Object(i.i)()?(r="std-button-disabled",n="Hacknet Server limit reached",l={color:"red"}):n=`Purchase Hacknet Server - ${s.numeralWrapper.formatMoney(t)}`:n=`Purchase Hacknet Node - ${s.numeralWrapper.formatMoney(t)}`,a.a.createElement("button",{className:r,onClick:e.onClick,style:l},n)}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n(1),a=n.n(r),i=n(23),o=n(0),s=n(2);function l(e){const t=Object(i.h)();let n,r;return n=t?s.numeralWrapper.format(e.totalProduction,"0.000a")+" hashes / sec":s.numeralWrapper.formatMoney(e.totalProduction)+" / sec",t&&(r=s.numeralWrapper.format(o.Player.hashManager.hashes,"0.000a")+" / "+s.numeralWrapper.format(o.Player.hashManager.capacity,"0.000a")),a.a.createElement("p",{id:"hacknet-nodes-money"},a.a.createElement("span",null,"Money:"),a.a.createElement("span",{className:"money-gold"},s.numeralWrapper.formatMoney(o.Player.money.toNumber())),a.a.createElement("br",null),t&&a.a.createElement("span",null,"Hashes:"),t&&a.a.createElement("span",{className:"money-gold"},r),t&&a.a.createElement("br",null),a.a.createElement("span",null,"Total Hacknet Node Production:"),a.a.createElement("span",{className:"money-gold"},n))}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(1),a=n.n(r),i=n(179);function o(e){return a.a.createElement("button",{className:e.className,onClick:e.onClick},e.text)}function s(e){if(null==e.purchaseMultiplier)throw new Error("MultiplierButtons constructed without required props");const t=["x1","x5","x10","MAX"],n=e.onClicks,r=[];for(let s=0;s<t.length;++s){const l=t[s],c={className:e.purchaseMultiplier===i.b[l]?"std-button-disabled":"std-button",key:l,onClick:n[s],text:l};r.push(a.a.createElement(o,c))}return a.a.createElement("span",{id:"hacknet-nodes-multipliers"},r)}},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var r=n(1),a=n.n(r),i=n(23),o=n(108),s=n(144),l=n(0),c=(n(20),n(116),n(2)),u=(n(171),n(172)),m=n(223),p=n(8);class h extends a.a.Component{constructor(e){super(e),this.state={selectedServer:"foodnstuff"},this.changeTargetServer=this.changeTargetServer.bind(this),this.purchase=this.purchase.bind(this,this.props.hashManager,this.props.upg)}changeTargetServer(e){this.setState({selectedServer:e.target.value})}purchase(e,t){if(e.hashes>=e.getUpgradeCost(t.name)){Object(i.n)(t.name,this.state.selectedServer)?this.props.rerender():Object(p.dialogBoxCreate)("Failed to purchase upgrade. This may be because you do not have enough hashes, or because you do not have access to the feature this upgrade affects.")}}render(){const e=this.props.hashManager,t=this.props.upg,n=e.getUpgradeCost(t.name),r=e.hashes>=n?"std-button":"std-button-disabled";return a.a.createElement("div",{className:"bladeburner-action"},a.a.createElement("h2",null,t.name),a.a.createElement("p",null,"Cost: ",c.numeralWrapper.format(n,"0.000a")),a.a.createElement("p",null,t.desc),a.a.createElement("button",{className:r,onClick:this.purchase},"Purchase"),t.hasTargetServer&&a.a.createElement(m.a,{serverType:m.b.Foreign,onChange:this.changeTargetServer,style:{margin:"5px"}}))}}class d extends a.a.Component{constructor(e){super(e),this.state={totalHashes:l.Player.hashManager.hashes}}componentDidMount(){this.interval=setInterval(()=>this.tick(),1e3)}componentWillUnmount(){clearInterval(this.interval)}tick(){this.setState({totalHashes:l.Player.hashManager.hashes})}render(){const e=this.props.rerender,t=l.Player.hashManager;if(!(t instanceof o.HashManager))throw new Error("Player does not have a HashManager)");const n=Object.keys(s.HashUpgrades).map(n=>{const r=s.HashUpgrades[n];return a.a.createElement(h,{upg:r,hashManager:t,key:r.name,rerender:e})});return a.a.createElement("div",null,a.a.createElement(u.PopupCloseButton,{popup:this.props.popupId,text:"Close"}),a.a.createElement("p",null,"Spend your hashes on a variety of different upgrades"),a.a.createElement("p",null,"Hashes: ",c.numeralWrapper.formatBigNumber(this.state.totalHashes)),n)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(1),a=n.n(r),i=n(34),o=n(23),s=n(0),l=n(2);class c extends a.a.Component{render(){const e=this.props.node,t=this.props.purchaseMultiplier,n=this.props.recalculate;let r,c;if(e.level>=i.HacknetServerMaxLevel)r="MAX LEVEL",c="std-button-disabled";else{let n=0;if("MAX"===t)n=Object(o.f)(e,i.HacknetServerMaxLevel);else{const r=i.HacknetServerMaxLevel-e.level;n=Math.min(r,t)}const a=e.calculateLevelUpgradeCost(n,s.Player.hacknet_node_level_cost_mult);r=`Upgrade x${n} - ${l.numeralWrapper.formatMoney(a)}`,c=s.Player.money.lt(a)?"std-button-disabled":"std-button"}let u,m;if(e.maxRam>=i.HacknetServerMaxRam)u="MAX RAM",m="std-button-disabled";else{let n=0;if("MAX"===t)n=Object(o.g)(e,i.HacknetServerMaxRam);else{const r=Math.round(Math.log2(i.HacknetServerMaxRam/e.maxRam));n=Math.min(r,t)}const r=e.calculateRamUpgradeCost(n,s.Player.hacknet_node_ram_cost_mult);u=`Upgrade x${n} - ${l.numeralWrapper.formatMoney(r)}`,m=s.Player.money.lt(r)?"std-button-disabled":"std-button"}let p,h;if(e.cores>=i.HacknetServerMaxCores)p="MAX CORES",h="std-button-disabled";else{let n=0;if("MAX"===t)n=Object(o.e)(e,i.HacknetServerMaxCores);else{const r=i.HacknetServerMaxCores-e.cores;n=Math.min(r,t)}const r=e.calculateCoreUpgradeCost(n,s.Player.hacknet_node_core_cost_mult);p=`Upgrade x${n} - ${l.numeralWrapper.formatMoney(r)}`,h=s.Player.money.lt(r)?"std-button-disabled":"std-button"}let d,_;if(e.cache>=i.HacknetServerMaxCache)d="MAX CACHE",_="std-button-disabled";else{let n=0;if("MAX"===t)n=Object(o.d)(e,i.HacknetServerMaxCache);else{const r=i.HacknetServerMaxCache-e.cache;n=Math.min(r,t)}const r=e.calculateCacheUpgradeCost(n);d=`Upgrade x${n} - ${l.numeralWrapper.formatMoney(r)}`,_=s.Player.money.lt(r)?"std-button-disabled":"std-button"}return a.a.createElement("li",{className:"hacknet-node"},a.a.createElement("div",{className:"hacknet-node-container"},a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"Node name:"),a.a.createElement("span",{className:"text"},e.hostname)),a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"Production:"),a.a.createElement("span",{className:"text money-gold"},l.numeralWrapper.formatBigNumber(e.totalHashesGenerated)," (",l.numeralWrapper.formatBigNumber(e.hashRate)," / sec)")),a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"Hash Capacity:"),a.a.createElement("span",{className:"text"},e.hashCapacity)),a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"Level:"),a.a.createElement("span",{className:"text upgradable-info"},e.level),a.a.createElement("button",{className:c,onClick:()=>{let r=t;return"MAX"===t&&(r=Object(o.f)(e,i.HacknetServerMaxLevel)),Object(o.o)(e,r),n(),!1}},r)),a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"RAM:"),a.a.createElement("span",{className:"text upgradable-info"},e.maxRam,"GB"),a.a.createElement("button",{className:m,onClick:()=>{let r=t;return"MAX"===t&&(r=Object(o.g)(e,i.HacknetServerMaxRam)),Object(o.p)(e,r),n(),!1}},u)),a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"Cores:"),a.a.createElement("span",{className:"text upgradable-info"},e.cores),a.a.createElement("button",{className:h,onClick:()=>{let r=t;return"MAX"===t&&(r=Object(o.e)(e,i.HacknetServerMaxCores)),Object(o.l)(e,r),n(),!1}},p)),a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"Cache Level:"),a.a.createElement("span",{className:"text upgradable-info"},e.cache),a.a.createElement("button",{className:_,onClick:()=>{let r=t;return"MAX"===t&&(r=Object(o.d)(e,i.HacknetServerMaxCache)),Object(o.k)(e,r),n(),Object(o.r)(),!1}},d))))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(1),a=n.n(r),i=n(52),o=n(23),s=n(0),l=n(2);class c extends a.a.Component{render(){const e=this.props.node,t=this.props.purchaseMultiplier,n=this.props.recalculate;let r,c;if(e.level>=i.HacknetNodeMaxLevel)r="MAX LEVEL",c="std-button-disabled";else{let n=0;if("MAX"===t)n=Object(o.f)(e,i.HacknetNodeMaxLevel);else{const r=i.HacknetNodeMaxLevel-e.level;n=Math.min(r,t)}const a=e.calculateLevelUpgradeCost(n,s.Player.hacknet_node_level_cost_mult);r=`Upgrade x${n} - ${l.numeralWrapper.formatMoney(a)}`,c=s.Player.money.lt(a)?"std-button-disabled":"std-button"}let u,m;if(e.ram>=i.HacknetNodeMaxRam)u="MAX RAM",m="std-button-disabled";else{let n=0;if("MAX"===t)n=Object(o.g)(e,i.HacknetNodeMaxRam);else{const r=Math.round(Math.log2(i.HacknetNodeMaxRam/e.ram));n=Math.min(r,t)}const r=e.calculateRamUpgradeCost(n,s.Player.hacknet_node_ram_cost_mult);u=`Upgrade x${n} - ${l.numeralWrapper.formatMoney(r)}`,m=s.Player.money.lt(r)?"std-button-disabled":"std-button"}let p,h;if(e.cores>=i.HacknetNodeMaxCores)p="MAX CORES",h="std-button-disabled";else{let n=0;if("MAX"===t)n=Object(o.e)(e,i.HacknetNodeMaxCores);else{const r=i.HacknetNodeMaxCores-e.cores;n=Math.min(r,t)}const r=e.calculateCoreUpgradeCost(n,s.Player.hacknet_node_core_cost_mult);p=`Upgrade x${n} - ${l.numeralWrapper.formatMoney(r)}`,h=s.Player.money.lt(r)?"std-button-disabled":"std-button"}return a.a.createElement("li",{className:"hacknet-node"},a.a.createElement("div",{className:"hacknet-node-container"},a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"Node name:"),a.a.createElement("span",{className:"text"},e.name)),a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"Production:"),a.a.createElement("span",{className:"text money-gold"},l.numeralWrapper.formatMoney(e.totalMoneyGenerated)," (",l.numeralWrapper.formatMoney(e.moneyGainRatePerSecond)," / sec)")),a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"Level:"),a.a.createElement("span",{className:"text upgradable-info"},e.level),a.a.createElement("button",{className:c,onClick:()=>{let r=t;return"MAX"===t&&(r=Object(o.f)(e,i.HacknetNodeMaxLevel)),Object(o.o)(e,r),n(),!1}},r)),a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"RAM:"),a.a.createElement("span",{className:"text upgradable-info"},e.ram,"GB"),a.a.createElement("button",{className:m,onClick:()=>{let r=t;return"MAX"===t&&(r=Object(o.g)(e,i.HacknetNodeMaxRam)),Object(o.p)(e,r),n(),!1}},u)),a.a.createElement("div",{className:"row"},a.a.createElement("p",null,"Cores:"),a.a.createElement("span",{className:"text upgradable-info"},e.cores),a.a.createElement("button",{className:h,onClick:()=>{let r=t;return"MAX"===t&&(r=Object(o.e)(e,i.HacknetNodeMaxCores)),Object(o.l)(e,r),n(),!1}},p))))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(1),a=n.n(r),i=n(23);class o extends a.a.Component{getSecondParagraph(){return Object(i.h)()?"Here, you can purchase a Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers will perform computations and operations on the network, earning you hashes. Hashes can be spent on a variety of different upgrades.":"Here, you can purchase a Hacknet Node, a specialized machine that can connect and contribute its resources to the Hacknet network. This allows you to take a small percentage of profits from hacks performed on the network. Essentially, you are renting out your Node's computing power."}getThirdParagraph(){return Object(i.h)()?"Hacknet Servers can also be used as servers to run scripts. However, running scripts on a server will reduce its hash rate (hashes generated per second). A Hacknet Server's hash rate will be reduced by the percentage of RAM that is being used by that Server to run scripts.":"Each Hacknet Node you purchase will passively earn you money. Each Hacknet Node can be upgraded in order to increase its computing power and thereby increase the profit you earn from it."}render(){return a.a.createElement("div",null,a.a.createElement("p",{className:"hacknet-general-info"},"The Hacknet is a global, decentralized network of machines. It is used by hackers all around the world to anonymously share computing power and perform distributed cyberattacks without the fear of being traced."),a.a.createElement("br",null),a.a.createElement("p",{className:"hacknet-general-info"},this.getSecondParagraph()),a.a.createElement("br",null),a.a.createElement("p",{className:"hacknet-general-info"},this.getThirdParagraph()))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gangMemberUpgradesMetadata=[{cost:1e6,mults:{str:1.04,def:1.04},name:"Baseball Bat",upgType:"w"},{cost:12e6,mults:{str:1.08,def:1.08,dex:1.08},name:"Katana",upgType:"w"},{cost:25e6,mults:{str:1.1,def:1.1,dex:1.1,agi:1.1},name:"Glock 18C",upgType:"w"},{cost:5e7,mults:{str:1.12,def:1.1,agi:1.1},name:"P90C",upgType:"w"},{cost:6e7,mults:{str:1.2,def:1.15},name:"Steyr AUG",upgType:"w"},{cost:1e8,mults:{str:1.25,def:1.2},name:"AK-47",upgType:"w"},{cost:15e7,mults:{str:1.3,def:1.25},name:"M15A10 Assault Rifle",upgType:"w"},{cost:225e6,mults:{str:1.3,dex:1.25,agi:1.3},name:"AWM Sniper Rifle",upgType:"w"},{cost:2e6,mults:{def:1.04},name:"Bulletproof Vest",upgType:"a"},{cost:5e6,mults:{def:1.08},name:"Full Body Armor",upgType:"a"},{cost:25e6,mults:{def:1.15,agi:1.15},name:"Liquid Body Armor",upgType:"a"},{cost:4e7,mults:{def:1.2},name:"Graphene Plating Armor",upgType:"a"},{cost:3e6,mults:{agi:1.04,cha:1.04},name:"Ford Flex V20",upgType:"v"},{cost:9e6,mults:{agi:1.08,cha:1.08},name:"ATX1070 Superbike",upgType:"v"},{cost:18e6,mults:{agi:1.12,cha:1.12},name:"Mercedes-Benz S9001",upgType:"v"},{cost:3e7,mults:{agi:1.16,cha:1.16},name:"White Ferrari",upgType:"v"},{cost:5e6,mults:{hack:1.05},name:"NUKE Rootkit",upgType:"r"},{cost:25e6,mults:{hack:1.1},name:"Soulstealer Rootkit",upgType:"r"},{cost:75e6,mults:{hack:1.15},name:"Demon Rootkit",upgType:"r"},{cost:4e7,mults:{hack:1.12},name:"Hmap Node",upgType:"r"},{cost:75e6,mults:{hack:1.15},name:"Jack the Ripper",upgType:"r"},{cost:1e10,mults:{str:1.3,dex:1.3},name:"Bionic Arms",upgType:"g"},{cost:1e10,mults:{agi:1.6},name:"Bionic Legs",upgType:"g"},{cost:15e9,mults:{str:1.15,def:1.15,dex:1.15,agi:1.15},name:"Bionic Spine",upgType:"g"},{cost:2e10,mults:{str:1.4,def:1.4},name:"BrachiBlades",upgType:"g"},{cost:12e9,mults:{str:1.2,def:1.2},name:"Nanofiber Weave",upgType:"g"},{cost:25e9,mults:{str:1.5,agi:1.5},name:"Synthetic Heart",upgType:"g"},{cost:15e9,mults:{str:1.3,def:1.3},name:"Synfibril Muscle",upgType:"g"},{cost:5e9,mults:{hack:1.05},name:"BitWire",upgType:"g"},{cost:1e10,mults:{hack:1.15},name:"Neuralstimulator",upgType:"g"},{cost:75e8,mults:{hack:1.1},name:"DataJack",upgType:"g"},{cost:5e10,mults:{str:1.7,def:1.7},name:"Graphene Bone Lacings",upgType:"g"}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gangMemberTasksMetadata=[{desc:"This gang member is currently idle",isCombat:!0,isHacking:!0,name:"Unassigned",params:{hackWeight:100}},{desc:"Assign this gang member to create and distribute ransomware<br><br>Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!1,isHacking:!0,name:"Ransomware",params:{baseRespect:5e-5,baseWanted:1e-4,baseMoney:1,hackWeight:100,difficulty:1}},{desc:"Assign this gang member to attempt phishing scams and attacks<br><br>Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!1,isHacking:!0,name:"Phishing",params:{baseRespect:8e-5,baseWanted:.003,baseMoney:2.5,hackWeight:85,chaWeight:15,difficulty:3.5}},{desc:"Assign this gang member to attempt identity theft<br><br>Earns money - Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"Identity Theft",params:{baseRespect:1e-4,baseWanted:.075,baseMoney:6,hackWeight:80,chaWeight:20,difficulty:5}},{desc:"Assign this gang member to carry out DDoS attacks<br><br>Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"DDoS Attacks",params:{baseRespect:4e-4,baseWanted:.2,hackWeight:100,difficulty:8}},{desc:"Assign this gang member to create and distribute malicious viruses<br><br>Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"Plant Virus",params:{baseRespect:6e-4,baseWanted:.4,hackWeight:100,difficulty:12}},{desc:"Assign this gang member to commit financial fraud and digital counterfeiting<br><br>Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!1,isHacking:!0,name:"Fraud & Counterfeiting",params:{baseRespect:4e-4,baseWanted:.3,baseMoney:15,hackWeight:80,chaWeight:20,difficulty:20}},{desc:"Assign this gang member to launder money<br><br>Earns money - Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"Money Laundering",params:{baseRespect:.001,baseWanted:1.25,baseMoney:120,hackWeight:75,chaWeight:25,difficulty:25}},{desc:"Assign this gang member to commit acts of cyberterrorism<br><br>Greatly increases respect - Greatly increases wanted level",isCombat:!1,isHacking:!0,name:"Cyberterrorism",params:{baseRespect:.01,baseWanted:6,hackWeight:80,chaWeight:20,difficulty:36}},{desc:"Assign this gang member to be an ethical hacker for corporations<br><br>Earns money - Lowers wanted level",isCombat:!1,isHacking:!0,name:"Ethical Hacking",params:{baseWanted:-.001,baseMoney:1,hackWeight:90,chaWeight:10,difficulty:1}},{desc:"Assign this gang member to mug random people on the streets<br><br>Earns money - Slightly increases respect - Very slightly increases wanted level",isCombat:!0,isHacking:!1,name:"Mug People",params:{baseRespect:5e-5,baseWanted:5e-5,baseMoney:1.2,strWeight:25,defWeight:25,dexWeight:25,agiWeight:10,chaWeight:15,difficulty:1}},{desc:"Assign this gang member to sell drugs<br><br>Earns money - Slightly increases respect - Slightly increases wanted level - Scales slightly with territory",isCombat:!0,isHacking:!1,name:"Deal Drugs",params:{baseRespect:6e-5,baseWanted:.002,baseMoney:5,agiWeight:20,dexWeight:20,chaWeight:60,difficulty:3.5,territory:{money:1.2,respect:1,wanted:1.15}}},{desc:"Assign this gang member to extort civilians in your territory<br><br>Earns money - Slightly increases respect - Increases wanted - Scales heavily with territory",isCombat:!0,isHacking:!1,name:"Strongarm Civilians",params:{baseRespect:4e-5,baseWanted:.02,baseMoney:2.5,hackWeight:10,strWeight:25,defWeight:25,dexWeight:20,agiWeight:10,chaWeight:10,difficulty:5,territory:{money:1.6,respect:1.1,wanted:1.5}}},{desc:"Assign this gang member to run cons<br><br>Earns money - Increases respect - Increases wanted level",isCombat:!0,isHacking:!1,name:"Run a Con",params:{baseRespect:12e-5,baseWanted:.05,baseMoney:15,strWeight:5,defWeight:5,agiWeight:25,dexWeight:25,chaWeight:40,difficulty:14}},{desc:"Assign this gang member to commit armed robbery on stores, banks and armored cars<br><br>Earns money - Increases respect - Increases wanted level",isCombat:!0,isHacking:!1,name:"Armed Robbery",params:{baseRespect:14e-5,baseWanted:.1,baseMoney:38,hackWeight:20,strWeight:15,defWeight:15,agiWeight:10,dexWeight:20,chaWeight:20,difficulty:20}},{desc:"Assign this gang member to traffick illegal arms<br><br>Earns money - Increases respect - Increases wanted level - Scales heavily with territory",isCombat:!0,isHacking:!1,name:"Traffick Illegal Arms",params:{baseRespect:2e-4,baseWanted:.24,baseMoney:58,hackWeight:15,strWeight:20,defWeight:20,dexWeight:20,chaWeight:25,difficulty:32,territory:{money:1.4,respect:1.3,wanted:1.25}}},{desc:"Assign this gang member to threaten and black mail high-profile targets<br><br>Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!0,isHacking:!1,name:"Threaten & Blackmail",params:{baseRespect:2e-4,baseWanted:.125,baseMoney:24,hackWeight:25,strWeight:25,dexWeight:25,chaWeight:25,difficulty:28}},{desc:"Assign this gang member to engage in human trafficking operations<br><br>Earns money - Increases respect - Increases wanted level - Scales heavily with territory",isCombat:!0,isHacking:!1,name:"Human Trafficking",params:{baseRespect:.004,baseWanted:1.25,baseMoney:120,hackWeight:30,strWeight:5,defWeight:5,dexWeight:30,chaWeight:30,difficulty:36,territory:{money:1.5,respect:1.5,wanted:1.6}}},{desc:"Assign this gang member to commit acts of terrorism<br><br>Greatly increases respect - Greatly increases wanted level - Scales heavily with territory",isCombat:!0,isHacking:!1,name:"Terrorism",params:{baseRespect:.01,baseWanted:6,hackWeight:20,strWeight:20,defWeight:20,dexWeight:20,chaWeight:20,difficulty:36,territory:{money:1,respect:2,wanted:2}}},{desc:"Assign this gang member to be a vigilante and protect the city from criminals<br><br>Decreases wanted level",isCombat:!0,isHacking:!0,name:"Vigilante Justice",params:{baseWanted:-.001,hackWeight:20,strWeight:20,defWeight:20,dexWeight:20,agiWeight:20,difficulty:1,territory:{money:1,respect:1,wanted:.9}}},{desc:"Assign this gang member to increase their combat stats (str, def, dex, agi)",isCombat:!0,isHacking:!0,name:"Train Combat",params:{strWeight:25,defWeight:25,dexWeight:25,agiWeight:25,difficulty:5}},{desc:"Assign this gang member to train their hacking skills",isCombat:!0,isHacking:!0,name:"Train Hacking",params:{hackWeight:100,difficulty:8}},{desc:"Assign this gang member to train their charisma",isCombat:!0,isHacking:!0,name:"Train Charisma",params:{chaWeight:100,difficulty:8}},{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.",isCombat:!0,isHacking:!0,name:"Territory Warfare",params:{hackWeight:15,strWeight:20,defWeight:20,dexWeight:20,agiWeight:20,chaWeight:5,difficulty:5}}]},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(50),a=n(12),i=n(0),o=n(29),s=n(11);function l(){document.getElementById("faction-invitation-box-container").style.display="none"}function c(e){!function(e){document.getElementById("faction-invitation-box-text").innerHTML=e}("You have received a faction invitation from "+e.name),e.alreadyInvited=!0,i.Player.factionInvitations.push(e.name),s.routing.isOn(s.Page.Factions)&&a.Engine.loadFactionsContent(),Object(o.clearEventListeners)("faction-invitation-box-yes").addEventListener("click",function(){var t=i.Player.factionInvitations.findIndex(t=>t===e.name);return-1===t?console.error("Could not find faction in Player.factionInvitations"):i.Player.factionInvitations.splice(t,1),Object(r.joinFaction)(e),l(),s.routing.isOn(s.Page.Factions)&&a.Engine.loadFactionsContent(),!1}),Object(o.clearEventListeners)("faction-invitation-box-no").addEventListener("click",function(){return l(),!1}),document.getElementById("faction-invitation-box-container").style.display="flex"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(694),i=n(692),o=n(691),s=n(688),l=n(6),c=n(19),u=n(270),m=n(38),p=n(45),h="Create and manage a gang for this Faction. Gangs will earn you money and faction reputation",d="Attempt a hacking mission for your faction. A mission is a mini game that, if won, earns you significant reputation with this faction. (Recommended hacking level: 200+)",_="Complete hacking contracts for your faction. Your effectiveness, which determines how much reputation you gain for this faction, is based on your hacking skill. You will gain hacking exp.",g="Carry out field missions for your faction. Your effectiveness, which determines how much reputation you gain for this faction, is based on all of your stats. You will gain exp for all stats.",y="Serve in a security detail for your faction. Your effectiveness, which determines how much reputation you gain for this faction, is based on your combat stats. You will gain exp for all combat stats.",f="As your reputation with this faction rises, you will unlock Augmentations, which you can purchase to enhance your abilities.",b="Purchase Duplicate Sleeves and upgrades. These are permanent!",E=["Slum Snakes","Tetrads","The Syndicate","The Dark Army","Speakers for the Dead","NiteSec","The Black Hand"];t.FactionRoot=class extends r.Component{constructor(e){super(e),this.state={rerenderFlag:!1,purchasingAugs:!!e.initiallyOnAugmentationsPage&&e.initiallyOnAugmentationsPage},this.manageGang=this.manageGang.bind(this),this.rerender=this.rerender.bind(this),this.routeToMain=this.routeToMain.bind(this),this.routeToPurchaseAugs=this.routeToPurchaseAugs.bind(this),this.sleevePurchases=this.sleevePurchases.bind(this),this.startFieldWork=this.startFieldWork.bind(this),this.startHackingContracts=this.startHackingContracts.bind(this),this.startHackingMission=this.startHackingMission.bind(this),this.startSecurityWork=this.startSecurityWork.bind(this)}manageGang(){if(this.props.p.inGang())return this.props.engine.loadGangContent();const e=this.props.faction.name;let t=!1;"NiteSec"!==e&&"The Black Hand"!==e||(t=!0);const n=p.yesNoBoxGetYesButton(),r=p.yesNoBoxGetNoButton();if(null==n||null==r)return;n.innerHTML="Create Gang",n.addEventListener("click",()=>{this.props.p.startGang(e,t);const n=document.getElementById("world-menu-header");n instanceof HTMLElement&&(n.click(),n.click()),this.props.engine.loadGangContent(),p.yesNoBoxClose()}),r.innerHTML="Cancel",r.addEventListener("click",()=>{p.yesNoBoxClose()});let a="";a=t?"This is a HACKING gang. Members in this gang will have different tasks than COMBAT gangs. Compared to combat gangs, progression with hacking gangs is more straightforward as territory warfare is not as important.<br><br>":"This is a COMBAT gang. Members in this gang will have different tasks than HACKING gangs. Compared to hacking gangs, progression with combat gangs can be more difficult as territory management is more important. However, well-managed combat gangs can progress faster than hacking ones.<br><br>",p.yesNoBoxCreate(`Would you like to create a new Gang with ${e}?<br><br>`+"Note that this will prevent you from creating a Gang with any other Faction until this BitNode is destroyed. It also resets your reputation with this faction.<br><br>"+a+"Other than hacking vs combat, there are NO differences between the Factions you can create a Gang with, and each of these Factions have all Augmentations available.")}rerender(){this.setState(e=>({rerenderFlag:!e.rerenderFlag}))}routeToMain(){this.setState({purchasingAugs:!1})}routeToPurchaseAugs(){this.setState({purchasingAugs:!0})}sleevePurchases(){u.createSleevePurchasesFromCovenantPopup(this.props.p)}startFieldWork(){this.props.p.startFactionFieldWork(this.props.faction)}startHackingContracts(){this.props.p.startFactionHackWork(this.props.faction)}startHackingMission(){const e=this.props.faction;this.props.engine.loadMissionContent(),this.props.startHackingMissionFn(e)}startSecurityWork(){this.props.p.startFactionSecurityWork(this.props.faction)}render(){return this.state.purchasingAugs?this.renderAugmentationsPage():this.renderMainPage()}renderMainPage(){const e=this.props.p,t=this.props.faction,n=t.getInfo(),a=e.inGang()&&e.getGangName()===t.name,u=Math.floor(l.CONSTANTS.BaseFavorToDonate*c.BitNodeMultipliers.RepToDonateToFaction),p=t.favor>=u,v="The Covenant"===t.name&&e.bitNodeN>=10&&m.SourceFileFlags[10];let k=e.canAccessGang()&&E.includes(t.name);return e.inGang()&&(e.getGangName()!==t.name?k=!1:e.getGangName()===t.name&&(k=!0)),r.createElement("div",null,r.createElement("h1",null,t.name),r.createElement(o.Info,{faction:t,factionInfo:n}),k&&r.createElement(s.Option,{buttonText:"Manage Gang",infoText:h,onClick:this.manageGang}),!a&&n.offerHackingMission&&r.createElement(s.Option,{buttonText:"Hacking Mission",infoText:d,onClick:this.startHackingMission}),!a&&n.offerHackingWork&&r.createElement(s.Option,{buttonText:"Hacking Contracts",infoText:_,onClick:this.startHackingContracts}),!a&&n.offerFieldWork&&r.createElement(s.Option,{buttonText:"Field Work",infoText:g,onClick:this.startFieldWork}),!a&&n.offerSecurityWork&&r.createElement(s.Option,{buttonText:"Security Work",infoText:y,onClick:this.startSecurityWork}),!a&&p&&r.createElement(i.DonateOption,{faction:this.props.faction,p:this.props.p,rerender:this.rerender}),r.createElement(s.Option,{buttonText:"Purchase Augmentations",infoText:f,onClick:this.routeToPurchaseAugs}),v&&r.createElement(s.Option,{buttonText:"Purchase & Upgrade Duplicate Sleeves",infoText:b,onClick:this.sleevePurchases}))}renderAugmentationsPage(){return r.createElement("div",null,r.createElement(a.AugmentationsPage,{faction:this.props.faction,p:this.props.p,routeToMainPage:this.routeToMain}))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"canAccessBladeburner",function(){return i}),n.d(t,"inBladeburner",function(){return o}),n.d(t,"startBladeburner",function(){return s});var r=n(70),a=n(38);function i(){return 8!==this.bitNodeN&&(6===this.bitNodeN||7===this.bitNodeN||a.SourceFileFlags[6]>0||a.SourceFileFlags[7]>0)}function o(){return null!=this.bladeburner&&this.bladeburner instanceof r.a}function s(){this.bladeburner=new r.a({new:!0})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(14);t.hasAugmentation=function(e){const t=e instanceof r.Augmentation?e.name:e;for(const e of this.augmentations)if(e.name===t)return!0;for(const e of this.queuedAugmentations)if(e.name===t)return!0;return!1}},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var r=n(305),a=n(304),i=n(284),o=n(283),s=n(282),l=n(279),c=n(108),u=n(28),m=n(125),p=n(16),h=n(43);function d(){this.hacking_skill=1,this.hp=10,this.max_hp=10,this.strength=1,this.defense=1,this.dexterity=1,this.agility=1,this.charisma=1,this.intelligence=0,this.hacking_chance_mult=1,this.hacking_speed_mult=1,this.hacking_money_mult=1,this.hacking_grow_mult=1,this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.intelligence_exp=0,this.hacking_mult=1,this.strength_mult=1,this.defense_mult=1,this.dexterity_mult=1,this.agility_mult=1,this.charisma_mult=1,this.hacking_exp_mult=1,this.strength_exp_mult=1,this.defense_exp_mult=1,this.dexterity_exp_mult=1,this.agility_exp_mult=1,this.charisma_exp_mult=1,this.company_rep_mult=1,this.faction_rep_mult=1,this.money=new h.a(1e3),this.homeComputer="",this.city=u.CityName.Sector12,this.location="",this.jobs={},this.companyName="",this.currentServer="",this.purchasedServers=[],this.hacknetNodes=[],this.hashManager=new c.HashManager,this.factions=[],this.factionInvitations=[],this.queuedAugmentations=[],this.augmentations=[],this.sourceFiles=[],this.numPeopleKilled=0,this.karma=0,this.crime_money_mult=1,this.crime_success_mult=1,this.isWorking=!1,this.workType="",this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.workHackExpGainRate=0,this.workStrExpGainRate=0,this.workDefExpGainRate=0,this.workDexExpGainRate=0,this.workAgiExpGainRate=0,this.workChaExpGainRate=0,this.workRepGainRate=0,this.workMoneyGainRate=0,this.workMoneyLossRate=0,this.workHackExpGained=0,this.workStrExpGained=0,this.workDefExpGained=0,this.workDexExpGained=0,this.workAgiExpGained=0,this.workChaExpGained=0,this.workRepGained=0,this.workMoneyGained=0,this.createProgramName="",this.createProgramReqLvl=0,this.className="",this.crimeType="",this.timeWorked=0,this.timeWorkedCreateProgram=0,this.timeNeededToCompleteWork=0,this.work_money_mult=1,this.hacknet_node_money_mult=1,this.hacknet_node_purchase_cost_mult=1,this.hacknet_node_ram_cost_mult=1,this.hacknet_node_core_cost_mult=1,this.hacknet_node_level_cost_mult=1,this.hasWseAccount=!1,this.hasTixApiAccess=!1,this.has4SData=!1,this.has4SDataTixApi=!1,this.gang=0,this.corporation=0,this.bladeburner=0,this.bladeburner_max_stamina_mult=1,this.bladeburner_stamina_gain_mult=1,this.bladeburner_analysis_mult=1,this.bladeburner_success_chance_mult=1,this.sleeves=[],this.resleeves=[],this.sleevesFromCovenant=0,this.bitNodeN=1,this.firstFacInvRecvd=!1,this.firstAugPurchased=!1,this.firstTimeTraveled=!1,this.firstProgramAvailable=!1,this.lastUpdate=0,this.totalPlaytime=0,this.playtimeSinceLastAug=0,this.playtimeSinceLastBitnode=0,this.moneySourceA=new m.MoneySourceTracker,this.moneySourceB=new m.MoneySourceTracker,this.scriptProdSinceLastAug=0,this.exploits=[]}Object.assign(d.prototype,s,l,a,i,o,r),d.prototype.toJSON=function(){return Object(p.Generic_toJSON)("PlayerObject",this)},d.fromJSON=function(e){return Object(p.Generic_fromJSON)(d,e.data)},p.Reviver.constructors.PlayerObject=d},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n(1),a=n.n(r),i=n(61),o=n(2),s=n(8);class l extends i.a{render(){const e=this.props.upgradeData,t=`${e[2]} - ${o.numeralWrapper.formatMoney(e[1])}`,n=e[3];return a.a.createElement("div",{className:"cmpy-mgmt-upgrade-div tooltip",style:{width:"45%"},onClick:()=>{const t=this.corp();t.funds.lt(e[1])?Object(s.dialogBoxCreate)("Insufficient funds"):(t.unlock(e),t.rerender())}},t,a.a.createElement("span",{className:"tooltiptext"},n))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n(1),a=n.n(r),i=n(61),o=n(2),s=n(8);class l extends i.a{render(){const e=this.props.upgradeData,t=this.props.upgradeLevel,n=e[1],r=e[2],i=n*Math.pow(r,t),l=`${e[4]} - ${o.numeralWrapper.formatMoney(i)}`,c=e[5];return a.a.createElement("div",{className:"cmpy-mgmt-upgrade-div tooltip",style:{width:"45%"},onClick:()=>{const t=this.corp();t.funds.lt(i)?Object(s.dialogBoxCreate)("Insufficient funds"):(t.upgrade(e),t.rerender())}},l,a.a.createElement("span",{className:"tooltiptext"},c))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var r=n(1),a=n.n(r),i=n(61),o=n(308),s=n(307),l=n(30),c=n(183),u=n(182),m=n(6),p=n(2),h=n(7);function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}class _ extends i.a{createButton(e){let t=e.class?e.class:"std-button";const n=e.display?e.display:"block",r=null!=e.tooltip;return r&&(t+=" tooltip"),a.a.createElement("a",{className:t,onClick:e.onClick,style:{display:{displayStyle:n}}},e.text,r&&a.a.createElement("span",{className:"tooltiptext"},e.tooltip))}getOverviewText(){var e=this.corp().revenue.minus(this.corp().expenses).toNumber(),t=e>=0?p.numeralWrapper.formatMoney(e):"-"+p.numeralWrapper.format(-1*e,"$0.000a");let n="";if(this.corp().dividendPercentage>0&&e>0){const t=this.corp().dividendPercentage/100*e,r=e-t,a=t/this.corp().totalShares,i=this.corp().numShares*a;n=`Retained Profits (after dividends): ${p.numeralWrapper.format(r,"$0.000a")} / s<br><br>`+`Dividend Percentage: ${p.numeralWrapper.format(this.corp().dividendPercentage/100,"0%")}<br>`+`Dividends per share: ${p.numeralWrapper.format(a,"$0.000a")} / s<br>`+`Your earnings as a shareholder (Pre-Tax): ${p.numeralWrapper.format(i,"$0.000a")} / s<br>`+`Dividend Tax Rate: ${this.corp().dividendTaxPercentage}%<br>`+`Your earnings as a shareholder (Post-Tax): ${p.numeralWrapper.format(i*(1-this.corp().dividendTaxPercentage/100),"$0.000a")} / s<br><br>`}let r="Total Funds: "+p.numeralWrapper.format(this.corp().funds.toNumber(),"$0.000a")+"<br>Total Revenue: "+p.numeralWrapper.format(this.corp().revenue.toNumber(),"$0.000a")+" / s<br>Total Expenses: "+p.numeralWrapper.format(this.corp().expenses.toNumber(),"$0.000a")+"/ s<br>Total Profits: "+t+" / s<br>"+n+"Publicly Traded: "+(this.corp().public?"Yes":"No")+"<br>Owned Stock Shares: "+p.numeralWrapper.format(this.corp().numShares,"0.000a")+"<br>Stock Price: "+(this.corp().public?p.numeralWrapper.formatMoney(this.corp().sharePrice):"N/A")+"<br><p class='tooltip'>Total Stock Shares: "+p.numeralWrapper.format(this.corp().totalShares,"0.000a")+"<span class='tooltiptext'>"+`Outstanding Shares: ${p.numeralWrapper.format(this.corp().issuedShares,"0.000a")}<br>`+`Private Shares: ${p.numeralWrapper.format(this.corp().totalShares-this.corp().issuedShares-this.corp().numShares,"0.000a")}`+"</span></p><br><br>";const a=this.corp().storedCycles*m.CONSTANTS.MilliPerCycle;a>15e3&&(r+=`Bonus time: ${Object(h.convertTimeMsToTimeElapsedString)(a)}<br><br>`);let i=this.corp().getProductionMultiplier(),o=this.corp().getStorageMultiplier(),s=this.corp().getAdvertisingMultiplier(),l=this.corp().getEmployeeCreMultiplier(),c=this.corp().getEmployeeChaMultiplier(),u=this.corp().getEmployeeIntMultiplier(),d=this.corp().getEmployeeEffMultiplier(),_=this.corp().getSalesMultiplier(),g=this.corp().getScientificResearchMultiplier();return i>1&&(r+="Production Multiplier: "+p.numeralWrapper.format(i,"0.000")+"<br>"),o>1&&(r+="Storage Multiplier: "+p.numeralWrapper.format(o,"0.000")+"<br>"),s>1&&(r+="Advertising Multiplier: "+p.numeralWrapper.format(s,"0.000")+"<br>"),l>1&&(r+="Empl. Creativity Multiplier: "+p.numeralWrapper.format(l,"0.000")+"<br>"),c>1&&(r+="Empl. Charisma Multiplier: "+p.numeralWrapper.format(c,"0.000")+"<br>"),u>1&&(r+="Empl. Intelligence Multiplier: "+p.numeralWrapper.format(u,"0.000")+"<br>"),d>1&&(r+="Empl. Efficiency Multiplier: "+p.numeralWrapper.format(d,"0.000")+"<br>"),_>1&&(r+="Sales Multiplier: "+p.numeralWrapper.format(_,"0.000")+"<br>"),g>1&&(r+="Scientific Research Multiplier: "+p.numeralWrapper.format(g,"0.000")+"<br>"),r}renderButtons(){const e=this.corp().getStarterGuide.bind(this.corp()),t=this.createButton({class:"a-link-button",display:"inline-block",onClick:e,text:"Getting Started Guide",tooltip:"Get a copy of and read 'The Complete Handbook for Creating a Successful Corporation.' This is a .lit file that guides you through the beginning of setting up a Corporation and provides some tips/pointers for helping you get started with managing it."}),n=this.corp().determineValuation()>=l.a,r=this.eventHandler().createBribeFactionsPopup.bind(this.eventHandler()),a=n?"a-link-button":"a-link-button-inactive",i={bribeFactions:this.createButton({class:a,display:"inline-block",onClick:r,text:"Bribe Factions",tooltip:n?"Use your Corporations power and influence to bribe Faction leaders in exchange for reputation":"Your Corporation is not powerful enough to bribe Faction leaders"}),getStarterGuide:t};return this.corp().public?this.renderPublicButtons(i):this.renderPrivateButtons(i)}renderPrivateButtons(e){const t=this.corp().fundingRound<4,n=t?"std-button":"a-link-button-inactive",r=t?"Search for private investors who will give you startup funding in exchangefor equity (stock shares) in your company":null,i=this.corp().getInvestment.bind(this.corp()),o=this.corp().goPublic.bind(this.corp()),s=this.createButton({class:n,onClick:i,style:"inline-block",text:"Find Investors",tooltip:r}),l=this.createButton({class:"std-button",onClick:o,style:"inline-block",text:"Go Public",tooltip:"Become a publicly traded and owned entity. Going public involves issuing shares for an IPO. Once you are a public company, your shares will be traded on the stock market."});return a.a.createElement("div",null,e.getStarterGuide,s,l,a.a.createElement("br",null),e.bribeFactions)}renderPublicButtons(e){const t=this.corp(),n=this.eventHandler().createSellSharesPopup.bind(this.eventHandler()),r=t.shareSaleCooldown>0,i=r?"a-link-button-inactive":"std-button",o=r?"Cannot sell shares for "+t.convertCooldownToString(t.shareSaleCooldown):"Sell your shares in the company. The money earned from selling your shares goes into your personal account, not the Corporation's. This is one of the only ways to profit from your business venture.",s=this.createButton({class:i,display:"inline-block",onClick:n,text:"Sell Shares",tooltip:o}),l=this.eventHandler().createBuybackSharesPopup.bind(this.eventHandler()),c=this.createButton({class:"std-button",display:"inline-block",onClick:l,text:"Buyback shares",tooltip:"Buy back shares you that previously issued or sold at market price."}),u=this.eventHandler().createIssueNewSharesPopup.bind(this.eventHandler()),m=t.issueNewSharesCooldown>0,p=m?"a-link-button-inactive":"std-button",h=m?"Cannot issue new shares for "+t.convertCooldownToString(t.issueNewSharesCooldown):"Issue new equity shares to raise capital.",d=this.createButton({class:p,display:"inline-block",onClick:u,text:"Issue New Shares",tooltip:h}),_=this.eventHandler().createIssueDividendsPopup.bind(this.eventHandler()),g=this.createButton({class:"std-button",display:"inline-block",onClick:_,text:"Issue Dividends",tooltip:"Manage the dividends that are paid out to shareholders (including yourself)"});return a.a.createElement("div",null,e.getStarterGuide,s,c,a.a.createElement("br",null),d,g,a.a.createElement("br",null),e.bribeFactions)}renderUpgrades(){if(this.corp().divisions.length<=0)return;const e=[];Object.values(c.CorporationUnlockUpgrades).forEach(t=>{0===this.corp().unlockUpgrades[t[0]]&&e.push(this.renderUnlockUpgrade(t))});const t=[];for(let e=0;e<this.corp().upgrades.length;++e){const n=u.CorporationUpgrades[e],r=this.corp().upgrades[e];t.push({upgradeData:n,upgradeLevel:r})}return a.a.createElement("div",{className:"cmpy-mgmt-upgrade-container"},a.a.createElement("h1",{className:"cmpy-mgmt-upgrade-header"}," Unlocks "),e,a.a.createElement("h1",{className:"cmpy-mgmt-upgrade-header"}," Upgrades "),t.map(e=>this.renderLevelableUpgrade(e)))}renderUnlockUpgrade(e){return a.a.createElement(s.a,d({},this.props,{upgradeData:e,key:e[0]}))}renderLevelableUpgrade(e){return a.a.createElement(o.a,d({},this.props,{upgradeData:e.upgradeData,upgradeLevel:e.upgradeLevel,key:e.upgradeData[0]}))}render(){return a.a.createElement("div",null,a.a.createElement("p",{dangerouslySetInnerHTML:{__html:this.getOverviewText()}}),this.renderButtons(),a.a.createElement("br",null),this.renderUpgrades())}}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",function(){return IndustryWarehouse});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(1),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_BaseReactComponent__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(61),_Corporation__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(30),_Material__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(156),_Material__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_Material__WEBPACK_IMPORTED_MODULE_3__),_Product__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(134),_Product__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_Product__WEBPACK_IMPORTED_MODULE_4__),_Warehouse__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(90),_Warehouse__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_Warehouse__WEBPACK_IMPORTED_MODULE_5__),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(2),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(48),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__);function ProductComponent(e){const t=e.corp,n=e.division,r=(e.warehouse,e.city),a=e.product,i=e.eventHandler,o="0.000",s="0.000a",l=n.hasResearch("uPgrade: Dashboard"),c=a.data[r][1]-a.data[r][2];let u;if(u=a.sllman[r][0]?Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__.isString)(a.sllman[r][1])?`Sell (${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.data[r][2],s)}/${a.sllman[r][1]})`:`Sell (${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.data[r][2],s)}/${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.sllman[r][1],s)})`:"Sell (0.000/0.000)",a.marketTa2)u+=" @ "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(a.marketTa2Price[r]);else if(a.marketTa1){const e=a.rat/a.mku;u+=" @ "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(a.pCost+e)}else a.sCost&&(Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__.isString)(a.sCost)?u+=" @ "+a.sCost:u+=" @ "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.sCost,"$0.000a"));const m=i.createSellProductPopup.bind(i,a,r);let p="Limit Production";a.prdman[r][0]&&(p+=" ("+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.prdman[r][1],o)+")");const h=i.createLimitProductProdutionPopup.bind(i,a,r),d=i.createDiscontinueProductPopup.bind(i,a,n),_=i.createProductMarketTaPopup.bind(i,a,n);return a.fin?react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:"cmpy-mgmt-warehouse-product-div"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",{className:"tooltip"},a.name,": ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.data[r][0],s)," (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(c,s),"/s)",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span",{className:"tooltiptext"},"Prod: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.data[r][1],s),"/s",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Sell: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.data[r][2],s)," /s")),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",{className:"tooltip"},"Rating: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.rat,o),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span",{className:"tooltiptext"},"Quality: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.qlt,o)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Performance: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.per,o)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Durability: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.dur,o)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Reliability: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.rel,o)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Aesthetics: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.aes,o)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Features: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.fea,o),1===t.unlockUpgrades[2]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===t.unlockUpgrades[2]&&"Demand: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.dmd,o),1===t.unlockUpgrades[3]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===t.unlockUpgrades[3]&&"Competition: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.cmp,o))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",{className:"tooltip"},"Est. Production Cost: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(a.pCost/_Corporation__WEBPACK_IMPORTED_MODULE_2__.j),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span",{className:"tooltiptext"},"An estimate of the material cost it takes to create this Product.")),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",{className:"tooltip"},"Est. Market Price: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(a.pCost),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span",{className:"tooltiptext"},"An estimate of how much consumers are willing to pay for this product. Setting the sale price above this may result in less sales. Setting the sale price below this may result in more sales.")),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:m},u),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:h},p),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:d},"Discontinue"),n.hasResearch("Market-TA.I")&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:_},"Market-TA"))):l?react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:"cmpy-mgmt-warehouse-product-div"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",null,"Designing ",a.name,"..."),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",null,_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.prog,"0.00"),"% complete"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:m},u),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:h},p),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:d},"Discontinue"),n.hasResearch("Market-TA.I")&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:_},"Market-TA"))):react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:"cmpy-mgmt-warehouse-product-div"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",null,"Designing ",a.name,"..."),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",null,_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(a.prog,"0.00"),"% complete"))}function MaterialComponent(props){const corp=props.corp,division=props.division,warehouse=props.warehouse,city=props.city,mat=props.mat,eventHandler=props.eventHandler,markupLimit=mat.getMarkupLimit(),office=division.offices[city];if(!(office instanceof _Corporation__WEBPACK_IMPORTED_MODULE_2__.i))throw new Error(`Could not get OfficeSpace object for this city (${city})`);const nf="0.000",nfB="0.000a",totalGain=mat.buy+mat.prd+mat.imp-mat.sll-mat.totalExp;let cmpAndDmdText="";1===corp.unlockUpgrades[2]&&(cmpAndDmdText+="<br>Demand: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.dmd,nf)),1===corp.unlockUpgrades[3]&&(cmpAndDmdText+="<br>Competition: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.cmp,nf));const tutorial=division.newInd&&Object.keys(division.reqMats).includes(mat.name)&&0===mat.buy&&0===mat.imp,purchaseButtonText=`Buy (${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.buy,nfB)})`,purchaseButtonClass=tutorial?"std-button flashing-button tooltip":"std-button",purchaseButtonOnClick=eventHandler.createPurchaseMaterialPopup.bind(eventHandler,mat,division,warehouse),exportButtonOnClick=eventHandler.createExportMaterialPopup.bind(eventHandler,mat);let sellButtonText;if(mat.sllman[0]){if(sellButtonText=Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__.isString)(mat.sllman[1])?`Sell (${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.sll,nfB)}/${mat.sllman[1]})`:`Sell (${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.sll,nfB)}/${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.sllman[1],nfB)})`,mat.marketTa2)sellButtonText+=" @ "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(mat.marketTa2Price);else if(mat.marketTa1)sellButtonText+=" @ "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(mat.bCost+markupLimit);else if(mat.sCost)if(Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__.isString)(mat.sCost)){var sCost=mat.sCost.replace(/MP/g,mat.bCost);sellButtonText+=" @ "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(eval(sCost))}else sellButtonText+=" @ "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(mat.sCost)}else sellButtonText="Sell (0.000/0.000)";const sellButtonOnClick=eventHandler.createSellMaterialPopup.bind(eventHandler,mat),marketTaButtonOnClick=eventHandler.createMaterialMarketTaPopup.bind(eventHandler,mat,division);return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:"cmpy-mgmt-warehouse-material-div"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{style:{display:"inline-block"}},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",{className:"tooltip"},mat.name,": ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.qty,nfB)," (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(totalGain,nfB),"/s)",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span",{className:"tooltiptext"},"Buy: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.buy,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Prod: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.prd,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Sell: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.sll,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Export: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.totalExp,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Import: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.imp,nfB),1===corp.unlockUpgrades[2]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===corp.unlockUpgrades[2]&&"Demand: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.dmd,nf),1===corp.unlockUpgrades[3]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===corp.unlockUpgrades[3]&&"Competition: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.cmp,nf))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",{className:"tooltip"},"MP: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(mat.bCost),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span",{className:"tooltiptext"},"Market Price: The price you would pay if you were to buy this material on the market"))," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",{className:"tooltip"},"Quality: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.format(mat.qlt,"0.00a"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span",{className:"tooltiptext"},"The quality of your material. Higher quality will lead to more sales"))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{style:{display:"inline-block"}},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:purchaseButtonClass,onClick:purchaseButtonOnClick},purchaseButtonText,tutorial&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span",{className:"tooltiptext"},"Purchase your required materials to get production started!")),1===corp.unlockUpgrades[0]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:exportButtonOnClick},"Export"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:sellButtonOnClick},sellButtonText),division.hasResearch("Market-TA.I")&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:marketTaButtonOnClick},"Market-TA")))}class IndustryWarehouse extends _BaseReactComponent__WEBPACK_IMPORTED_MODULE_1__.a{isRelevantMaterial(e,t){return!!Object.keys(t.reqMats).includes(e)||(!!t.prodMats.includes(e)||!!["Hardware","Robots","AICores","RealEstate"].includes(e))}renderWarehouseUI(){const e=this.corp(),t=this.routing().currentDivision,n=t.warehouses[this.props.currentCity],r={color:n.sizeUsed>=n.size?"red":"white",margin:"5px"},a=_Corporation__WEBPACK_IMPORTED_MODULE_2__.o*Math.pow(1.07,n.level+1),i=e.funds.gt(a)?"std-button":"a-link-button-inactive";let o="This Industry uses ["+Object.keys(t.reqMats).join(", ")+"] in order to ";t.prodMats.length>0?(o+="produce ["+t.prodMats.join(", ")+"] ",t.makesProducts&&(o+=" and "+t.getProductDescriptionText())):t.makesProducts&&(o+=t.getProductDescriptionText()+".");const s=[];for(const e in t.reqMats)if(t.reqMats.hasOwnProperty(e)){const n=[" *",t.reqMats[e],e].join(" ");s.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{key:e},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",null,n)))}let l,c="in order to create ";switch(t.prodMats.length>0?(c+="one of each produced Material ("+t.prodMats.join(", ")+") ",t.makesProducts&&(c+="or to create one of its Products")):t.makesProducts&&(c+="one of its Products"),t.state){case"START":l="Current state: Preparing...";break;case"PURCHASE":l="Current state: Purchasing materials...";break;case"PRODUCTION":l="Current state: Producing materials and/or products...";break;case"SALE":l="Current state: Selling materials and/or products...";break;case"EXPORT":l="Current state: Exporting materials and/or products...";break;default:console.error(`Invalid state: ${t.state}`)}const u=[];for(const r in n.materials)n.materials[r]instanceof _Material__WEBPACK_IMPORTED_MODULE_3__.Material&&this.isRelevantMaterial(r,t)&&u.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(MaterialComponent,{city:this.props.currentCity,corp:e,division:t,eventHandler:this.eventHandler(),key:r,mat:n.materials[r],warehouse:n}));const m=[];if(t.makesProducts&&Object.keys(t.products).length>0)for(const r in t.products)t.products[r]instanceof _Product__WEBPACK_IMPORTED_MODULE_4__.Product&&m.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(ProductComponent,{city:this.props.currentCity,corp:e,division:t,eventHandler:this.eventHandler(),key:r,product:t.products[r],warehouse:n}));return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:"cmpy-mgmt-warehouse-panel"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",{className:"tooltip",style:r},"Storage: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatBigNumber(n.sizeUsed)," / ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatBigNumber(n.size),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span",{className:"tooltiptext",dangerouslySetInnerHTML:{__html:n.breakdown}})),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:i,onClick:()=>{++n.level,n.updateSize(e,t),e.funds=e.funds.minus(a),e.rerender()}},"Upgrade Warehouse Size - ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(a)),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",null,o,". The exact requirements for production are:"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),s,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",null,c),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",null,"To get started with production, purchase your required materials or import them from another of your company's divisions."),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p",null,l),e.unlockUpgrades[1]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label",{style:{color:"white"},htmlFor:"cmpy-mgmt-smart-supply-checkbox"},"Enable Smart Supply"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input",{type:"checkbox",id:"cmpy-mgmt-smart-supply-checkbox",onChange:t=>{n.smartSupplyEnabled=t.target.checked,e.rerender()},style:{margin:"3px"},checked:n.smartSupplyEnabled})),u,m)}render(){this.corp();const e=this.routing().currentDivision;if(null==e)throw new Error("Routing does not hold reference to the current Industry");const t=e.warehouses[this.props.currentCity],n=this.eventHandler().purchaseWarehouse.bind(this.eventHandler(),e,this.props.currentCity);return t instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_5__.Warehouse?this.renderWarehouseUI():react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",{className:"cmpy-mgmt-warehouse-panel"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button",{className:"std-button",onClick:n},"Purchase Warehouse (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.numeralWrapper.formatMoney(_Corporation__WEBPACK_IMPORTED_MODULE_2__.m),")"))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var r=n(1),a=n.n(r),i=n(61),o=n(30),s=n(26),l=n(161),c=n(2),u=n(8),m=n(109);class p extends i.a{renderMakeProductButton(){this.corp();const e=this.routing().currentDivision;var t,n;switch(e.type){case s.Industries.Food:t="Build Restaurant",n="Build and manage a new restaurant!";break;case s.Industries.Tobacco:t="Create Product",n="Create a new tobacco product!";break;case s.Industries.Pharmaceutical:t="Create Drug",n="Design and develop a new pharmaceutical drug!";break;case s.Industries.Computer:case"Computer":t="Create Product",n="Design and manufacture a new computer hardware product!";break;case s.Industries.Robotics:t="Design Robot",n="Design and create a new robot or robotic system!";break;case s.Industries.Software:t="Develop Software",n="Develop a new piece of software!";break;case s.Industries.Healthcare:t="Build Hospital",n="Build and manage a new hospital!";break;case s.Industries.RealEstate:t="Develop Property",n="Develop a new piece of real estate property!";break;default:return t="Create Product",n="Create a new product!",""}n+="<br><br>To begin developing a product, first choose the city in which it will be designed. The stats of your employees in the selected city affect the properties of the finished product, such as its quality, performance, and durability.<br><br>You can also choose to invest money in the design and marketing of the product. Investing money in its design will result in a superior product. Investing money in marketing the product will help the product's sales.";const r=e.hasMaximumNumberProducts(),i=r?"a-link-button-inactive tooltip":"std-button",o=this.eventHandler().createMakeProductPopup.bind(this.eventHandler(),n,e);return a.a.createElement("button",{className:i,onClick:o,style:{margin:"6px",display:"inline-block"}},t,r&&a.a.createElement("span",{className:"tooltiptext"},"You have reached the maximum number of products: ",e.getMaximumNumberProducts()))}renderText(){const e=this.corp(),t=this.routing().currentDivision,n=1===e.unlockUpgrades[4],r=t.lastCycleRevenue.minus(t.lastCycleExpenses).toNumber(),i=`Industry: ${t.type} (Corp Funds: ${c.numeralWrapper.formatMoney(e.funds.toNumber())})`,o=`Awareness: ${c.numeralWrapper.format(t.awareness,"0.000")}`,s=`Popularity: ${c.numeralWrapper.format(t.popularity,"0.000")}`;let l=!1;const p=t.getAdvertisingFactors(),h=p[1],d=p[2],_=p[3],g=p[0];n&&(l=!0);const y=`Revenue: ${c.numeralWrapper.formatMoney(t.lastCycleRevenue.toNumber())} / s`,f=`Expenses: ${c.numeralWrapper.formatMoney(t.lastCycleExpenses.toNumber())} /s`,b=`Profit: ${c.numeralWrapper.formatMoney(r)} / s`;return a.a.createElement("div",null,i,a.a.createElement("br",null)," ",a.a.createElement("br",null),o," ",a.a.createElement("br",null),s," ",a.a.createElement("br",null),!1!==l&&a.a.createElement("p",{className:"tooltip"},"Advertising Multiplier: x",c.numeralWrapper.format(g,"0.000"),a.a.createElement("span",{className:"tooltiptext cmpy-mgmt-advertising-info"},"Total multiplier for this industrys sales due to its awareness and popularity",a.a.createElement("br",null),"Awareness Bonus: x",c.numeralWrapper.format(Math.pow(h,.85),"0.000"),a.a.createElement("br",null),"Popularity Bonus: x",c.numeralWrapper.format(Math.pow(d,.85),"0.000"),a.a.createElement("br",null),"Ratio Multiplier: x",c.numeralWrapper.format(Math.pow(_,.85),"0.000"))),l,a.a.createElement("br",null),a.a.createElement("br",null),y," ",a.a.createElement("br",null),f," ",a.a.createElement("br",null),b,a.a.createElement("br",null)," ",a.a.createElement("br",null),a.a.createElement("p",{className:"tooltip"},"Production Multiplier: ",c.numeralWrapper.format(t.prodMult,"0.00"),a.a.createElement("span",{className:"tooltiptext"},"Production gain from owning production-boosting materials such as hardware, Robots, AI Cores, and Real Estate")),a.a.createElement("div",{className:"help-tip",onClick:()=>{function e(e){return Object(m.createProgressBarText)({progress:e,totalTicks:20})}Object(u.dialogBoxCreate)("Owning Hardware, Robots, AI Cores, and Real Estate can boost your Industry's production. The effect these materials have on your production varies between Industries. For example, Real Estate may be very effective for some Industries, but ineffective for others.<br><br>This division's production multiplier is calculated by summing the individual production multiplier of each of its office locations. This production multiplier is applied to each office. Therefore, it is beneficial to expand into new cities as this can greatly increase the production multiplier of your entire Division.<br><br>Below are approximations for how effective each material is at boosting this industry's production multiplier (Bigger bars = more effective):<br><br>"+`Hardware: ${e(t.hwFac)}<br>`+`Robots: ${e(t.robFac)}<br>`+`AI Cores: ${e(t.aiFac)}<br>`+`Real Estate: ${e(t.reFac)}`)}},"?"),a.a.createElement("br",null)," ",a.a.createElement("br",null),a.a.createElement("p",{className:"tooltip"},"Scientific Research: ",c.numeralWrapper.format(t.sciResearch.qty,"0.000a"),a.a.createElement("span",{className:"tooltiptext"},"Scientific Research increases the quality of the materials and products that you produce.")),a.a.createElement("button",{className:"help-tip",onClick:t.createResearchBox.bind(t)},"Research"))}renderUpgrades(){const e=this.corp(),t=this.routing().currentDivision,n=t.offices[this.props.currentCity];if(!(n instanceof o.i))throw new Error(`Current City (${this.props.currentCity}) for UI does not have an OfficeSpace object`);const r=[];for(const a in l.IndustryUpgrades){const i=l.IndustryUpgrades[a];if(t.hasResearch("AutoBrew")&&"Coffee"===i[4])continue;const o=i[0],s=i[1],m=i[2];let p=0;switch(o){case 0:p=n.employees.length*s;break;default:p=s*Math.pow(m,t.upgrades[o])}const h=()=>{e.funds.lt(p)?Object(u.dialogBoxCreate)("Insufficient funds"):(e.funds=e.funds.minus(p),t.upgrade(i,{corporation:e,office:n}),e.rerender())};r.push(this.renderUpgrade({onClick:h,text:`${i[4]} - ${c.numeralWrapper.formatMoney(p)}`,tooltip:i[5]}))}return r}renderUpgrade(e){return a.a.createElement("div",{className:"cmpy-mgmt-upgrade-div tooltip",onClick:e.onClick,key:e.text},e.text,null!=e.tooltip&&a.a.createElement("span",{className:"tooltiptext"},e.tooltip))}render(){const e=this.routing().currentDivision;if(null==e)throw new Error("Routing does not hold reference to the current Industry");const t=this.renderMakeProductButton();return a.a.createElement("div",{className:"cmpy-mgmt-industry-overview-panel"},this.renderText(),a.a.createElement("br",null),a.a.createElement("u",{className:"industry-purchases-and-upgrades-header"},"Purchases & Upgrades"),a.a.createElement("br",null),this.renderUpgrades()," ",a.a.createElement("br",null),e.makesProducts&&t)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(1),a=n.n(r),i=n(61),o=n(30),s=n(21),l=n(2),c=n(94);class u extends i.a{constructor(e){super(e),this.state={city:"",division:"",employeeManualAssignMode:!1,employee:null,numEmployees:0,numOperations:0,numEngineers:0,numBusiness:0,numManagement:0,numResearch:0,numUnassigned:0,numTraining:0},this.updateEmployeeCount()}resetEmployeeCount(){this.state.numEmployees=0,this.state.numOperations=0,this.state.numEngineers=0,this.state.numBusiness=0,this.state.numManagement=0,this.state.numResearch=0,this.state.numUnassigned=0,this.state.numTraining=0}updateEmployeeCount(){const e=this.routing().currentDivision;if(null==e)throw new Error("Routing does not hold reference to the current Industry");const t=e.offices[this.props.currentCity];if(!(t instanceof o.i))throw new Error(`Current City (${this.props.currentCity}) for UI does not have an OfficeSpace object`);e.name===this.state.division&&this.props.currentCity===this.state.city||(this.resetEmployeeCount(),this.state.division=e.name,this.state.city=this.props.currentCity);const n=t.employees.length;this.state.numEmployees;for(let e=this.state.numEmployees;e<t.employees.length;++e)switch(t.employees[e].pos){case s.EmployeePositions.Operations:++this.state.numOperations;break;case s.EmployeePositions.Engineer:++this.state.numEngineers;break;case s.EmployeePositions.Business:++this.state.numBusiness;break;case s.EmployeePositions.Management:++this.state.numManagement;break;case s.EmployeePositions.RandD:++this.state.numResearch;break;case s.EmployeePositions.Unassigned:++this.state.numUnassigned;break;case s.EmployeePositions.Training:++this.state.numTraining;break;default:console.error("Unrecognized employee position: "+t.employees[e].pos)}this.state.numEmployees=n}renderEmployeeManagement(){return this.updateEmployeeCount(),this.state.employeeManualAssignMode?this.renderManualEmployeeManagement():this.renderAutomaticEmployeeManagement()}renderAutomaticEmployeeManagement(){const e=this.routing().currentDivision,t=e.offices[this.props.currentCity],n=1===this.corp().unlockUpgrades[4];let r=0,i=0,o=0,c=0;for(let e=0;e<t.employees.length;++e)r+=t.employees[e].mor,i+=t.employees[e].hap,o+=t.employees[e].ene,c+=t.employees[e].sal;let u=0,m=0,p=0;t.employees.length>0&&(u=r/t.employees.length,m=i/t.employees.length,p=o/t.employees.length);const h=n=>{if(this.state.numUnassigned<=0)console.warn("Cannot assign employee. No unassigned employees available");else{switch(n){case s.EmployeePositions.Operations:++this.state.numOperations;break;case s.EmployeePositions.Engineer:++this.state.numEngineers;break;case s.EmployeePositions.Business:++this.state.numBusiness;break;case s.EmployeePositions.Management:++this.state.numManagement;break;case s.EmployeePositions.RandD:++this.state.numResearch;break;case s.EmployeePositions.Unassigned:++this.state.numUnassigned;break;case s.EmployeePositions.Training:++this.state.numTraining;break;default:console.error("Unrecognized employee position: "+n)}--this.state.numUnassigned,t.assignEmployeeToJob(n),t.calculateEmployeeProductivity({corporation:this.corp(),industry:e}),this.corp().rerender()}},d=n=>{function r(e){console.warn(`Cannot unassign from ${e} because there is nobody assigned to that position`)}switch(n){case s.EmployeePositions.Operations:if(this.state.numOperations<=0)return r(s.EmployeePositions.Operations);--this.state.numOperations;break;case s.EmployeePositions.Engineer:if(this.state.numEngineers<=0)return r(s.EmployeePositions.Operations);--this.state.numEngineers;break;case s.EmployeePositions.Business:if(this.state.numBusiness<=0)return r(s.EmployeePositions.Operations);--this.state.numBusiness;break;case s.EmployeePositions.Management:if(this.state.numManagement<=0)return r(s.EmployeePositions.Operations);--this.state.numManagement;break;case s.EmployeePositions.RandD:if(this.state.numResearch<=0)return r(s.EmployeePositions.Operations);--this.state.numResearch;break;case s.EmployeePositions.Unassigned:console.warn("Tried to unassign from the Unassigned position");break;case s.EmployeePositions.Training:if(this.state.numTraining<=0)return r(s.EmployeePositions.Operations);--this.state.numTraining;break;default:console.error("Unrecognized employee position: "+n)}++this.state.numUnassigned,t.unassignEmployeeFromJob(n),t.calculateEmployeeProductivity({corporation:this.corp(),industry:e}),this.corp().rerender()},_={fontSize:"15px",margin:"5px 0px 5px 0px",width:"50%"},g=this.state.numUnassigned>0?"std-button":"a-link-button-inactive",y=this.state.numOperations>0?"std-button":"a-link-button-inactive",f=this.state.numEngineers>0?"std-button":"a-link-button-inactive",b=this.state.numBusiness>0?"std-button":"a-link-button-inactive",E=this.state.numManagement>0?"std-button":"a-link-button-inactive",v=this.state.numResearch>0?"std-button":"a-link-button-inactive",k=this.state.numTraining>0?"std-button":"a-link-button-inactive";return a.a.createElement("div",null,a.a.createElement("button",{className:"std-button tooltip",onClick:()=>{this.state.employeeManualAssignMode=!0,this.corp().rerender()}},"Switch to Manual Mode",a.a.createElement("span",{className:"tooltiptext"},"Switch to Manual Assignment Mode, which allows you to specify which employees should get which jobs")),a.a.createElement("p",null,a.a.createElement("strong",null,"Unassigned Employees: ",this.state.numUnassigned)),a.a.createElement("br",null),a.a.createElement("p",null,"Avg Employee Morale: ",l.numeralWrapper.format(u,"0.000")),a.a.createElement("p",null,"Avg Employee Happiness: ",l.numeralWrapper.format(m,"0.000")),a.a.createElement("p",null,"Avg Employee Energy: ",l.numeralWrapper.format(p,"0.000")),a.a.createElement("p",null,"Total Employee Salary: ",l.numeralWrapper.formatMoney(c)),n&&a.a.createElement("p",{className:"tooltip",style:{display:"inline-block"}},"Material Production: ",l.numeralWrapper.format(e.getOfficeProductivity(t),"0.000"),a.a.createElement("span",{className:"tooltiptext"},"The base amount of material this office can produce. Does not include production multipliers from upgrades and materials. This value is based off the productivity of your Operations, Engineering, and Management employees")),n&&a.a.createElement("br",null),n&&a.a.createElement("p",{className:"tooltip",style:{display:"inline-block"}},"Product Production: ",l.numeralWrapper.format(e.getOfficeProductivity(t,{forProduct:!0}),"0.000"),a.a.createElement("span",{className:"tooltiptext"},"The base amount of any given Product this office can produce. Does not include production multipliers from upgrades and materials. This value is based off the productivity of your Operations, Engineering, and Management employees")),n&&a.a.createElement("br",null),n&&a.a.createElement("p",{className:"tooltip",style:{display:"inline-block"}},"Business Multiplier: x",l.numeralWrapper.format(e.getBusinessFactor(t),"0.000"),a.a.createElement("span",{className:"tooltiptext"},"The effect this office's 'Business' employees has on boosting sales")),n&&a.a.createElement("br",null),a.a.createElement("h2",{className:"tooltip",style:_},s.EmployeePositions.Operations," (",this.state.numOperations,")",a.a.createElement("span",{className:"tooltiptext"},"Manages supply chain operations. Improves the amount of Materials and Products you produce.")),a.a.createElement("button",{className:g,onClick:()=>{h(s.EmployeePositions.Operations),this.corp().rerender()}},"+"),a.a.createElement("button",{className:y,onClick:()=>{d(s.EmployeePositions.Operations),this.corp().rerender()}},"-"),a.a.createElement("br",null),a.a.createElement("h2",{className:"tooltip",style:_},s.EmployeePositions.Engineer," (",this.state.numEngineers,")",a.a.createElement("span",{className:"tooltiptext"},"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)")),a.a.createElement("button",{className:g,onClick:()=>{h(s.EmployeePositions.Engineer),this.corp().rerender()}},"+"),a.a.createElement("button",{className:f,onClick:()=>{d(s.EmployeePositions.Engineer),this.corp().rerender()}},"-"),a.a.createElement("br",null),a.a.createElement("h2",{className:"tooltip",style:_},s.EmployeePositions.Business," (",this.state.numBusiness,")",a.a.createElement("span",{className:"tooltiptext"},"Handles sales and finances. Improves the amount of Materials and Products you can sell.")),a.a.createElement("button",{className:g,onClick:()=>{h(s.EmployeePositions.Business),this.corp().rerender()}},"+"),a.a.createElement("button",{className:b,onClick:()=>{d(s.EmployeePositions.Business),this.corp().rerender()}},"-"),a.a.createElement("br",null),a.a.createElement("h2",{className:"tooltip",style:_},s.EmployeePositions.Management," (",this.state.numManagement,")",a.a.createElement("span",{className:"tooltiptext"},"Leads and oversees employees and office operations. Improves the effectiveness of Engineer and Operations employees")),a.a.createElement("button",{className:g,onClick:()=>{h(s.EmployeePositions.Management),this.corp().rerender()}},"+"),a.a.createElement("button",{className:E,onClick:()=>{d(s.EmployeePositions.Management),this.corp().rerender()}},"-"),a.a.createElement("br",null),a.a.createElement("h2",{className:"tooltip",style:_},s.EmployeePositions.RandD," (",this.state.numResearch,")",a.a.createElement("span",{className:"tooltiptext"},"Research new innovative ways to improve the company. Generates Scientific Research")),a.a.createElement("button",{className:g,onClick:()=>{h(s.EmployeePositions.RandD),this.corp().rerender()}},"+"),a.a.createElement("button",{className:v,onClick:()=>{d(s.EmployeePositions.RandD),this.corp().rerender()}},"-"),a.a.createElement("br",null),a.a.createElement("h2",{className:"tooltip",style:_},s.EmployeePositions.Training," (",this.state.numTraining,")",a.a.createElement("span",{className:"tooltiptext"},"Set employee to training, which will increase some of their stats. Employees in training do not affect any company operations.")),a.a.createElement("button",{className:g,onClick:()=>{h(s.EmployeePositions.Training),this.corp().rerender()}},"+"),a.a.createElement("button",{className:k,onClick:()=>{d(s.EmployeePositions.Training),this.corp().rerender()}},"-"))}renderManualEmployeeManagement(){const e=this.corp(),t=this.routing().currentDivision,n=t.offices[this.props.currentCity],r=[];for(let e=0;e<n.employees.length;++e)r.push(a.a.createElement("option",{key:n.employees[e].name},n.employees[e].name));const i=this.state.employee;let o=null;const u=[],m=Object.values(s.EmployeePositions);for(let e=0;e<m.length;++e)u.push(a.a.createElement("option",{key:m[e],value:m[e]},m[e])),null!=i&&i.pos===m[e]&&(o=m[e]);const p="0.000",h=i?i.cre*e.getEmployeeCreMultiplier()*t.getEmployeeCreMultiplier():0,d=i?i.cha*e.getEmployeeChaMultiplier()*t.getEmployeeChaMultiplier():0,_=i?i.int*e.getEmployeeIntMultiplier()*t.getEmployeeIntMultiplier():0,g=i?i.eff*e.getEmployeeEffMultiplier()*t.getEmployeeEffMultiplier():0;return a.a.createElement("div",null,a.a.createElement("button",{className:"std-button tooltip",onClick:()=>{this.state.employeeManualAssignMode=!1,this.corp().rerender()}},"Switch to Auto Mode",a.a.createElement("span",{className:"tooltiptext"},"Switch to Automatic Assignment Mode, which will automatically assign employees to your selected jobs. You simply have to select the number of assignments for each job")),a.a.createElement("div",{style:{color:"white",margin:"4px",padding:"4px"}},a.a.createElement("select",{onChange:t=>{const r=Object(c.getSelectText)(t.target);for(let e=0;e<n.employees.length;++e)if(r===n.employees[e].name){this.state.employee=n.employees[e];break}e.rerender()}},r),null!=this.state.employee&&a.a.createElement("p",null,"Morale: ",l.numeralWrapper.format(this.state.employee.mor,p),a.a.createElement("br",null),"Happiness: ",l.numeralWrapper.format(this.state.employee.hap,p),a.a.createElement("br",null),"Energy: ",l.numeralWrapper.format(this.state.employee.ene,p),a.a.createElement("br",null),"Intelligence: ",l.numeralWrapper.format(_,p),a.a.createElement("br",null),"Charisma: ",l.numeralWrapper.format(d,p),a.a.createElement("br",null),"Experience: ",l.numeralWrapper.format(this.state.employee.exp,p),a.a.createElement("br",null),"Creativity: ",l.numeralWrapper.format(h,p),a.a.createElement("br",null),"Efficiency: ",l.numeralWrapper.format(g,p),a.a.createElement("br",null),"Salary: ",l.numeralWrapper.formatMoney(this.state.employee.sal)),null!=this.state.employee&&a.a.createElement("select",{onChange:t=>{const n=Object(c.getSelectText)(t.target);this.state.employee.pos=n,this.resetEmployeeCount(),e.rerender()},value:o},u)))}render(){const e=this.corp(),t=this.routing().currentDivision,n=t.offices[this.props.currentCity],r={fontSize:"13px"};let i="tooltip";n.atCapacity()?i+=" a-link-button-inactive":(i+=" std-button",0===n.employees.length&&(i+=" flashing-button"));let o="tooltip";n.atCapacity()?o+=" a-link-button-inactive":o+=" std-button";const s=this.eventHandler().createUpgradeOfficeSizePopup.bind(this.eventHandler(),n),l=this.eventHandler().createThrowOfficePartyPopup.bind(this.eventHandler(),n);return a.a.createElement("div",{className:"cmpy-mgmt-employee-panel"},a.a.createElement("h1",{style:{margin:"4px 0px 5px 0px"}},"Office Space"),a.a.createElement("p",null,"Size: ",n.employees.length," / ",n.size," employees"),a.a.createElement("button",{className:i,onClick:()=>{n.findEmployees({corporation:e,industry:t})},style:r},"Hire Employee",0===n.employees.length&&a.a.createElement("span",{className:"tooltiptext"},"You'll need to hire some employees to get your operations started! It's recommended to have at least one employee in every position")),a.a.createElement("button",{className:o,onClick:()=>{n.atCapacity()||(n.hireRandomEmployee(),this.corp().rerender())},style:r},"Autohire Employee",a.a.createElement("span",{className:"tooltiptext"},"Automatically hires an employee and gives him/her a random name")),a.a.createElement("br",null),a.a.createElement("button",{className:"std-button tooltip",onClick:s,style:r},"Upgrade size",a.a.createElement("span",{className:"tooltiptext"},"Upgrade the office's size so that it can hold more employees!")),!t.hasResearch("AutoPartyManager")&&a.a.createElement("button",{className:"std-button tooltip",onClick:l,style:r},"Throw Party",a.a.createElement("span",{className:"tooltiptext"},'"Throw an office party to increase your employee\'s morale and happiness"')),a.a.createElement("br",null),this.renderEmployeeManagement())}}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(1),a=n.n(r),i=n(61),o=n(312),s=n(311),l=n(310);class c extends i.a{constructor(e){if(null==e.currentCity)throw new Error("Industry component constructed without 'city' prop");super(e)}render(){return a.a.createElement("div",null,a.a.createElement("div",{className:"cmpy-mgmt-industry-left-panel"},a.a.createElement(s.a,this.props),a.a.createElement(o.a,this.props)),a.a.createElement("div",{className:"cmpy-mgmt-industry-right-panel"},a.a.createElement(l.a,this.props)))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(1),a=n.n(r),i=n(61);class o extends i.a{constructor(e){if(null==e.onClicks)throw new Error("CityTabs component constructed without onClick handlers");if(null==e.city)throw new Error("CityTabs component constructed without 'city' property");if(null==e.cityStateSetter)throw new Error("CityTabs component constructed without 'cityStateSetter' property");super(e)}renderTab(e){let t="cmpy-mgmt-city-tab";return e.current&&(t+=" current"),a.a.createElement("button",{className:t,onClick:e.onClick,key:e.key},e.key)}render(){const e=this.routing().currentDivision,t=[];for(const e in this.props.onClicks)t.push(this.renderTab({current:this.props.city===e,key:e,onClick:this.props.onClicks[e]}));const n=this.eventHandler().createNewCityPopup.bind(this.eventHandler(),e,this.props.cityStateSetter);return t.push(this.renderTab({current:!1,key:"Expand into new City",onClick:n})),t}}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var r=n(1),a=n.n(r),i=n(61),o=n(314),s=n(313),l=n(309),c=(n(143),n(30)),u=n(28);function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}class p extends i.a{constructor(e){super(e),this.state={division:"",city:u.CityName.Sector12}}changeCityState(e){Object.values(u.CityName).includes(e)?this.state.city=e:console.error(`Tried to change MainPanel's city state to an invalid city: ${e}`)}renderContent(){if(this.routing().isOnOverviewPage())return this.renderOverviewPage();{const e=this.routing().current();return e!==this.state.division&&(this.state.division=e,this.state.city=u.CityName.Sector12),this.renderDivisionPage()}}renderOverviewPage(){return a.a.createElement("div",{id:"cmpy-mgmt-panel"},a.a.createElement(l.a,this.props))}renderDivisionPage(){const e=this.routing().currentDivision;if(null==e)throw new Error("Routing does not hold reference to the current Industry");const t={};for(const n in e.offices)e.offices[n]instanceof c.i&&(t[n]=(()=>{this.state.city=n,this.corp().rerender()}));const n=a.a.createElement(o.a,m({},this.props,{city:this.state.city,onClicks:t,cityStateSetter:this.changeCityState.bind(this)})),r=a.a.createElement(s.a,m({},this.props,{currentCity:this.state.city}));return a.a.createElement("div",{id:"cmpy-mgmt-panel"},n,r)}render(){return this.renderContent()}}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(1),a=n.n(r),i=n(61);n(143);function o(e){let t="cmpy-mgmt-header-tab";return e.current&&(t+=" current"),a.a.createElement("button",{className:t,onClick:e.onClick},e.text)}class s extends i.a{renderTab(e){return a.a.createElement(o,{current:e.current,key:e.key,onClick:e.onClick,text:e.text})}render(){const e={};for(const t of this.corp().divisions){const n=t.name,r=()=>{this.routing().routeTo(n),this.corp().rerender()};e[n]=r}return a.a.createElement("div",null,this.renderTab({current:this.routing().isOnOverviewPage(),key:"overview",onClick:()=>{this.routing().routeToOverviewPage(),this.corp().rerender()},text:this.corp().name}),this.corp().divisions.map(t=>this.renderTab({current:this.routing().isOn(t.name),key:t.name,onClick:e[t.name],text:t.name})),this.renderTab({onClick:this.eventHandler().createNewIndustryPopup.bind(this.eventHandler()),text:"Expand into new Industry"}))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n(1),a=n.n(r),i=n(61),o=n(316),s=n(315);class l extends i.a{render(){return a.a.createElement("div",null,a.a.createElement(o.a,this.props),a.a.createElement(s.a,this.props))}}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",function(){return CorporationEventHandler});var _Routing__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(143),_Routing__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_Routing__WEBPACK_IMPORTED_MODULE_0__),_Corporation__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(30),_IndustryData__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(26),_IndustryData__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_IndustryData__WEBPACK_IMPORTED_MODULE_2__),_MaterialSizes__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(97),_MaterialSizes__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_MaterialSizes__WEBPACK_IMPORTED_MODULE_3__),_Product__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(134),_Product__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_Product__WEBPACK_IMPORTED_MODULE_4__),_Player__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(0),_Faction_Factions__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(13),_Faction_Factions__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(_Faction_Factions__WEBPACK_IMPORTED_MODULE_6__),_Locations_Cities__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(104),_Locations_Cities__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(_Locations_Cities__WEBPACK_IMPORTED_MODULE_7__),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(2),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__),_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(8),_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(15),_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_10__),_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(24),_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__),_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(215),_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_12__),_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(3),_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__),_utils_uiHelpers_createOptionElement__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(58),_utils_uiHelpers_createOptionElement__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(_utils_uiHelpers_createOptionElement__WEBPACK_IMPORTED_MODULE_14__),_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(37),_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__),_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(55),_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__),_utils_uiHelpers_getSelectData__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(94),_utils_uiHelpers_getSelectData__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(_utils_uiHelpers_getSelectData__WEBPACK_IMPORTED_MODULE_17__),_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(27),_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__);class CorporationEventHandler{constructor(e,t){if(!(e instanceof _Corporation__WEBPACK_IMPORTED_MODULE_1__.c))throw new Error("CorporationEventHandler constructed without proper Corporation instance");if(!(t instanceof _Routing__WEBPACK_IMPORTED_MODULE_0__.CorporationRouting))throw new Error("CorporationEventHandler constructed without proper CorporationRouting instance");this.corp=e,this.routing=t}createBribeFactionsPopup(){const e="cmpy-mgmt-bribe-factions-popup",t=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation"}),n=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("select",{margin:"3px"});for(let e=0;e<_Player__WEBPACK_IMPORTED_MODULE_5__.Player.factions.length;++e){const t=_Player__WEBPACK_IMPORTED_MODULE_5__.Player.factions[e];n.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("option",{text:t,value:t}))}var r,a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p"),i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{type:"number",placeholder:"Corporation funds",margin:"5px",inputListener:()=>{var e=null==i.value||""==i.value?0:parseFloat(i.value),t=this.corp.sharePrice,o=null==r.value||""==r.value?0:Math.round(parseFloat(r.value));if(isNaN(e)||isNaN(o)||e<0||o<0)a.innerText="ERROR: Invalid value(s) entered";else if(this.corp.funds.lt(e))a.innerText="ERROR: You do not have this much money to bribe with";else if(this.corp.stockShares>this.corp.numShares)a.innerText="ERROR: You do not have this many shares to bribe with";else{var s=(Number(e)+o*t)/_Corporation__WEBPACK_IMPORTED_MODULE_1__.b;a.innerText="You will gain "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(s,"0,0")+" reputation with "+n.options[n.selectedIndex].value+" with this bribe"}}});r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{type:"number",placeholder:"Stock Shares",margin:"5px",inputListener:()=>{var e=null==i.value||""==i.value?0:parseFloat(i.value),t=this.corp.sharePrice,o=null==r.value||""==r.value?0:Math.round(r.value);if(isNaN(e)||isNaN(o)||e<0||o<0)a.innerText="ERROR: Invalid value(s) entered";else if(this.corp.funds.lt(e))a.innerText="ERROR: You do not have this much money to bribe with";else if(this.corp.stockShares>this.corp.numShares)a.innerText="ERROR: You do not have this many shares to bribe with";else{var s=(e+o*t)/_Corporation__WEBPACK_IMPORTED_MODULE_1__.b;a.innerText="You will gain "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(s,"0,0")+" reputation with "+n.options[n.selectedIndex].value+" with this bribe"}}});var o=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"a-link-button",innerText:"Bribe",display:"inline-block",clickListener:()=>{var t=null==i.value||""==i.value?0:parseFloat(i.value),a=this.corp.sharePrice,o=null==r.value||""==r.value?0:Math.round(parseFloat(r.value)),s=_Faction_Factions__WEBPACK_IMPORTED_MODULE_6__.Factions[n.options[n.selectedIndex].value];if(null==s)return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("ERROR: You must select a faction to bribe"),!1;if(isNaN(t)||isNaN(o)||t<0||o<0)Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("ERROR: Invalid value(s) entered");else if(this.corp.funds.lt(t))Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("ERROR: You do not have this much money to bribe with");else{if(!(o>this.corp.numShares)){var l=(t+o*a)/_Corporation__WEBPACK_IMPORTED_MODULE_1__.b;return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You gained "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(l,"0,0")+" reputation with "+s.name+" by bribing them."),s.playerReputation+=l,this.corp.funds=this.corp.funds.minus(t),this.corp.numShares-=o,Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(e),!1}Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("ERROR: You do not have this many shares to bribe with")}}});const s=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(e,{class:"std-button",display:"inline-block",innerText:"Cancel"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(e,[t,n,a,i,r,o,s])}createBuybackSharesPopup(){const e="cmpy-mgmt-buyback-shares-popup",t=1.1*this.corp.sharePrice,n=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:"Enter the number of outstanding shares you would like to buy back. These shares must be bought at a 10% premium. However, repurchasing shares from the market tends to lead to an increase in stock price.<br><bR>To purchase these shares, you must use your own money (NOT your Corporation's funds).<br><br>The current buyback price of your company's stock is "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(t,"$0.000a")+". Your company currently has "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatBigNumber(this.corp.issuedShares)+" outstanding stock shares"});var r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{}),a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{type:"number",placeholder:"Shares to buyback",margin:"5px",inputListener:()=>{var e=Math.round(a.value);isNaN(e)||e<=0?r.innerText="ERROR: Invalid value entered for number of shares to buyback":e>this.corp.issuedShares?r.innerText="There are not this many shares available to buy back. There are only "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatBigNumber(this.corp.issuedShares)+" outstanding shares.":r.innerText="Purchase "+e+" shares for a total of "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(e*t,"$0.000a")}}),i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"a-link-button",innerText:"Buy shares",display:"inline-block",clickListener:()=>{var t=Math.round(a.value);const n=1.1*this.corp.sharePrice;if(isNaN(t)||t<=0)Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("ERROR: Invalid value for number of shares");else if(t>this.corp.issuedShares)Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("ERROR: There are not this many oustanding shares to buy back");else if(t*n>_Player__WEBPACK_IMPORTED_MODULE_5__.Player.money)Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("ERROR: You do not have enough money to purchase this many shares (you need "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(t*n,"$0.000a")+")");else{if(this.corp.numShares+=t,isNaN(this.corp.issuedShares)){console.warn("Corporation issuedShares is NaN: "+this.corp.issuedShares),console.warn("Converting to number now");const e=parseInt(this.corp.issuedShares);isNaN(e)?this.corp.issuedShares=0:this.corp.issuedShares=e}this.corp.issuedShares-=t,_Player__WEBPACK_IMPORTED_MODULE_5__.Player.loseMoney(t*n),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(e),this.rerender()}return!1}}),o=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(e,{class:"std-button",display:"inline-block",innerText:"Cancel"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(e,[n,r,a,i,o]),a.focus()}createDiscontinueProductPopup(e,t){const n="cmpy-mgmt-discontinue-product-popup",r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Are you sure you want to do this? Discontinuing a product removes it completely and permanently. You will no longer produce this product and all of its existing stock will be removed and left unsold"}),a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"popup-box-button",innerText:"Discontinue",clickListener:()=>(t.discontinueProduct(e),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(n),this.rerender(),!1)}),i=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(n,{innerText:"Cancel"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(n,[r,i,a])}createExportMaterialPopup(mat){const corp=this.corp,popupId="cmpy-mgmt-export-popup",exportTxt=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Select the industry and city to export this material to, as well as how much of this material to export per second. You can set the export amount to 'MAX' to export all of the materials in this warehouse."}),citySelector=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("select",{class:"dropdown"}),industrySelector=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("select",{class:"dropdown",changeListener:()=>{const e=Object(_utils_uiHelpers_getSelectData__WEBPACK_IMPORTED_MODULE_17__.getSelectValue)(industrySelector);for(let t=0;t<corp.divisions.length;++t)if(corp.divisions[t].name==e){Object(_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_12__.clearSelector)(citySelector);for(const e in corp.divisions[t].warehouses)corp.divisions[t].warehouses[e]instanceof _Corporation__WEBPACK_IMPORTED_MODULE_1__.l&&citySelector.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("option",{value:e,text:e}));return}}});for(let e=0;e<corp.divisions.length;++e)industrySelector.add(Object(_utils_uiHelpers_createOptionElement__WEBPACK_IMPORTED_MODULE_14__.createOptionElement)(corp.divisions[e].name));industrySelector.dispatchEvent(new Event("change"));const exportAmount=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{class:"text-input",placeholder:"Export amount / s"}),exportBtn=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"std-button",display:"inline-block",innerText:"Export",clickListener:()=>{const industryName=Object(_utils_uiHelpers_getSelectData__WEBPACK_IMPORTED_MODULE_17__.getSelectText)(industrySelector),cityName=citySelector.options[citySelector.selectedIndex].text,amt=exportAmount.value;let sanitizedAmt=amt.replace(/\s+/g,"");sanitizedAmt=sanitizedAmt.replace(/[^-()\d/*+.MAX]/g,"");let temp=sanitizedAmt.replace(/MAX/g,1);try{temp=eval(temp)}catch(e){return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid expression entered for export amount: "+e),!1}if(null!=temp&&!isNaN(temp)){var exportObj={ind:industryName,city:cityName,amt:sanitizedAmt};return mat.exp.push(exportObj),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(popupId),!1}Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid amount entered for export")}}),cancelBtn=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(popupId,{innerText:"Cancel"}),currExportsText=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Below is a list of all current exports of this material from this warehouse. Clicking on one of the exports below will REMOVE that export."}),currExports=[];for(var i=0;i<mat.exp.length;++i)!function(e,t,n){n.push(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("div",{class:"cmpy-mgmt-existing-export",innerHTML:"Industry: "+t.exp[e].ind+"<br>City: "+t.exp[e].city+"<br>Amount/s: "+t.exp[e].amt,clickListener:()=>{t.exp.splice(e,1),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(popupId),createExportMaterialPopup(t)}}))}(i,mat,currExports);Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(popupId,[exportTxt,industrySelector,citySelector,exportAmount,exportBtn,cancelBtn,currExportsText].concat(currExports))}createIssueDividendsPopup(){const e="cmpy-mgmt-issue-dividends-popup",t="Dividends are a distribution of a portion of the corporation's profits to the shareholders. This includes yourself, as well.<br><br>In order to issue dividends, simply allocate some percentage of your corporation's profits to dividends. This percentage must be an "+`integer between 0 and ${_Corporation__WEBPACK_IMPORTED_MODULE_1__.d}. (A percentage of 0 means no dividends will be `+"issued<br><br>Two important things to note:<br> * Issuing dividends will negatively affect your corporation's stock price<br> * Dividends are taxed. Taxes start at 50%, but can be decreased<br><br>Example: Assume your corporation makes $100m / sec in profit and you allocate 40% of that towards dividends. That means your corporation will gain $60m / sec in funds and the remaining $40m / sec will be paid as dividends. Since your corporation starts with 1 billion shares, every shareholder will be paid $0.04 per share per second before taxes.",n=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:t});let r;const a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{margin:"5px",placeholder:"Dividend %",type:"number",onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&r.click()}});r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"std-button",display:"inline-block",innerText:"Allocate Dividend Percentage",clickListener:()=>{const t=Math.round(parseInt(a.value));return isNaN(t)||t<0||t>_Corporation__WEBPACK_IMPORTED_MODULE_1__.d?Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)(`Invalid value. Must be an integer between 0 and ${_Corporation__WEBPACK_IMPORTED_MODULE_1__.d}`):(this.corp.dividendPercentage=t,Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(e),this.rerender(),!1)}});const i=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(e,{class:"std-button",display:"inline-block",innerText:"Cancel"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(e,[n,a,r,i]),a.focus()}createIssueNewSharesPopup(){const e="cmpy-mgmt-issue-new-shares-popup",t=Math.round(.2*this.corp.totalShares),n=t-t%1e6,r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:"You can issue new equity shares (i.e. stocks) in order to raise capital for your corporation.<br><br>"+` * You can issue at most ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(n,"0.000a")} new shares<br>`+" * New shares are sold at a 10% discount<br> * You can only issue new shares once every 12 hours<br> * Issuing new shares causes dilution, resulting in a decrease in stock price and lower dividends per share<br> * Number of new shares issued must be a multiple of 10 million<br><br>When you choose to issue new equity, private shareholders have first priority for up to 50% of the new shares. If they choose to exercise this option, these newly issued shares become private, restricted shares, which means you cannot buy them back."});let a,i;const o=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{display:"block"});i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{margin:"5px",placeholder:"# New Shares",type:"number",onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER?a.click():function(e){const t=Math.round(.9*e.sharePrice);let r=parseInt(i.value);isNaN(r)?o.innerText="Invalid input":(r/=1e7,r=1e7*Math.round(r),o.innerText=r<1e7?"Must issue at least 10 million new shares":r>n?"You cannot issue that many shares":`Issue ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(r,"0.000a")} new shares `+`for ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(r*t)}?`)}(this.corp)}}),a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"std-button",display:"inline-block",innerText:"Issue New Shares",clickListener:()=>{const t=Math.round(.9*this.corp.sharePrice);let r=parseInt(i.value);if(isNaN(r))return void Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid input for number of new shares");if((r=1e7*Math.round(r/1e7))<1e7||r>n)return void Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid input for number of new shares");const a=r*t;this.corp.issueNewSharesCooldown=_Corporation__WEBPACK_IMPORTED_MODULE_1__.f,this.corp.totalShares+=r;let o=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_10__.getRandomInt)(0,Math.round(r/2));return o=1e6*Math.round(o/1e6),this.corp.issuedShares+=r-o,this.corp.funds=this.corp.funds.plus(a),this.corp.immediatelyUpdateSharePrice(),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(e),Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)(`Issued ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(r,"0.000a")} and raised `+`${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(a)}. ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(o,"0.000a")} `+"of these shares were bought by private investors.<br><br>"+`Stock price decreased to ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(this.corp.sharePrice)}`),this.rerender(),!1}});const s=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(e,{class:"std-button",display:"inline-block",innerText:"Cancel"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(e,[r,o,i,a,s]),i.focus()}createLimitProductProdutionPopup(e,t){const n="cmpy-mgmt-limit-product-production-popup",r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Enter a limit to the amount of this product you would like to product per second. Leave the box empty to set no limit."});let a;const i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{margin:"5px",placeholder:"Limit",type:"number",onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&a.click()}});a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"std-button",display:"inline-block",innerText:"Limit production",margin:"5px",clickListener:()=>{if(""===i.value)return e.prdman[t][0]=!1,Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(n),!1;var r=parseFloat(i.value);return isNaN(r)?(Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value entered"),!1):(r<0?e.prdman[t][0]=!1:(e.prdman[t][0]=!0,e.prdman[t][1]=r),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(n),this.rerender(),!1)}});const o=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(n,{innerText:"Cancel"});o.style.margin="6px",Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(n,[r,i,a,o]),i.focus()}createMakeProductPopup(e,t){if(t.hasMaximumNumberProducts())return;const n="cmpy-mgmt-create-product-popup",r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:e}),a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("select",{margin:"5px"});for(const e in t.offices)t.offices[e]instanceof _Corporation__WEBPACK_IMPORTED_MODULE_1__.i&&a.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("option",{value:e,text:e}));let i="Product Name";t.type===_IndustryData__WEBPACK_IMPORTED_MODULE_2__.Industries.Food?i="Restaurant Name":t.type===_IndustryData__WEBPACK_IMPORTED_MODULE_2__.Industries.Healthcare?i="Hospital Name":t.type===_IndustryData__WEBPACK_IMPORTED_MODULE_2__.Industries.RealEstate&&(i="Property Name");var o=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{margin:"5px",placeholder:i}),s=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("br"),l=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{margin:"5px",placeholder:"Design investment",type:"number"});let c;var u=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{margin:"5px",placeholder:"Marketing investment",type:"number",onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&c.click()}});c=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"std-button",innerText:"Develop Product",clickListener:()=>{null==l.value&&(l.value=0),null==u.value&&(u.value=0);var e=parseFloat(l.value),r=parseFloat(u.value);if(null==o.value||""===o.value)Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You must specify a name for your product!");else if(isNaN(e))Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value for design investment");else if(isNaN(r))Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value for marketing investment");else if(this.corp.funds.lt(e+r))Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You don't have enough company funds to make this large of an investment");else{const i=new _Product__WEBPACK_IMPORTED_MODULE_4__.Product({name:o.value.replace(/[<>]/g,""),createCity:a.options[a.selectedIndex].value,designCost:e,advCost:r});if(t.products[i.name]instanceof _Product__WEBPACK_IMPORTED_MODULE_4__.Product)return void Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You already have a product with this name!");this.corp.funds=this.corp.funds.minus(e+r),t.products[i.name]=i,Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(n)}return this.rerender(),!1}});const m=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(n,{class:"std-button",innerText:"Cancel"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(n,[r,a,o,s,l,u,c,m]),o.focus()}createMaterialMarketTaPopup(e,t){this.corp;const n="cmpy-mgmt-marketta-popup",r=e.getMarkupLimit(),a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:"<u><strong>Market-TA.I</strong></u><br>The maximum sale price you can mark this up to is "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(e.bCost+r)+". This means that if you set the sale price higher than this, you will begin to experience a loss in number of sales"}),i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("div",{display:"block"}),o=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("label",{color:"white",for:"cmpy-mgmt-marketa1-checkbox",innerText:"Use Market-TA.I for Auto-Sale Price",tooltip:"If this is enabled, then this Material will automatically be sold at the price identified by Market-TA.I (i.e. the price shown above)"}),s=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{checked:e.marketTa1,id:"cmpy-mgmt-marketa1-checkbox",margin:"3px",type:"checkbox",changeListener:t=>{e.marketTa1=t.target.checked}});i.appendChild(o),i.appendChild(s);const l=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(n,{class:"std-button",display:"block",innerText:"Close"});if(t.hasResearch("Market-TA.II")){let t;const o=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p"),s=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{marginTop:"4px",onkeyup:e=>{e.preventDefault(),t()},type:"number",value:e.bCost});(t=function(){const t=parseFloat(s.value);let n=1;t>e.bCost?t-e.bCost>r&&(n=Math.pow(r/(t-e.bCost),2)):t<e.bCost&&(n=t<=0?1e12:e.bCost/t),o.innerHTML="<br><u><strong>Market-TA.II</strong></u><br>"+`If you sell at ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(t)}, `+`then you will sell ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(n,"0.00000")}x as much compared `+"to if you sold at market price."})();const c="cmpy-mgmt-marketa2-checkbox",u=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("div",{display:"block"}),m=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("label",{color:"white",for:c,innerText:"Use Market-TA.II for Auto-Sale Price",tooltip:"If this is enabled, then this Material will automatically be sold at the optimal price such that the amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all produced materials will be sold)"}),p=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{checked:e.marketTa2,id:c,margin:"3px",type:"checkbox",changeListener:t=>{e.marketTa2=t.target.checked}});u.appendChild(m),u.appendChild(p);const h=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Note that Market-TA.II overrides Market-TA.I. This means that if both are enabled, then Market-TA.II will take effect, not Market-TA.I"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(n,[a,i,o,s,u,h,l])}else Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(n,[a,i,l])}createNewCityPopup(e,t){const n="cmpy-mgmt-expand-city-popup",r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Would you like to expand into a new city by opening an office? This would cost "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(_Corporation__WEBPACK_IMPORTED_MODULE_1__.g,"$0.000a")}),a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("select",{class:"dropdown",margin:"5px"});for(const t in e.offices)e.offices[t]instanceof _Corporation__WEBPACK_IMPORTED_MODULE_1__.i||a.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("option",{text:t,value:t}));const i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"std-button",display:"inline-block",innerText:"Confirm",clickListener:()=>{if(a.length<=0)return!1;let r=a.options[a.selectedIndex].value;return this.corp.funds.lt(_Corporation__WEBPACK_IMPORTED_MODULE_1__.g)?Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You don't have enough company funds to open a new office!"):(this.corp.funds=this.corp.funds.minus(_Corporation__WEBPACK_IMPORTED_MODULE_1__.g),Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Opened a new office in "+r+"!"),e.offices[r]=new _Corporation__WEBPACK_IMPORTED_MODULE_1__.i({loc:r,size:_Corporation__WEBPACK_IMPORTED_MODULE_1__.h})),t(r),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(n),this.rerender(),!1}}),o=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(n,{class:"std-button",innerText:"Cancel"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(n,[r,a,i,o])}createNewIndustryPopup(){const e="cmpy-mgmt-expand-industry-popup";if(null!=document.getElementById(e))return;var t,n=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:"Create a new division to expand into a new industry:"}),r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("select",{class:"dropdown"}),a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{}),i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{type:"text",id:"cmpy-mgmt-expand-industry-name-input",class:"text-input",display:"block",maxLength:30,pattern:"[a-zA-Z0-9-_]",onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&t.click()}}),o=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("label",{for:"cmpy-mgmt-expand-industry-name-input",innerText:"Division name: "});t=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("span",{class:"popup-box-button",innerText:"Create Division",clickListener:()=>{const e=r.options[r.selectedIndex].value,t=i.value;for(let e=0;e<this.corp.divisions.length;++e)if(this.corp.divisions[e].name===t)return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("This name is already in use!"),!1;if(this.corp.funds.lt(_IndustryData__WEBPACK_IMPORTED_MODULE_2__.IndustryStartingCosts[e]))Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Not enough money to create a new division in this industry");else if(""===t)Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("New division must have a name!");else{this.corp.funds=this.corp.funds.minus(_IndustryData__WEBPACK_IMPORTED_MODULE_2__.IndustryStartingCosts[e]);var n=new _Corporation__WEBPACK_IMPORTED_MODULE_1__.e({corp:this.corp,name:t,type:e});this.corp.divisions.push(n),this.routing.routeTo(t),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)("cmpy-mgmt-expand-industry-popup"),this.rerender()}return!1}});const s=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(e,{display:"inline-block",innerText:"Cancel"}),l={};for(let e=0;e<this.corp.divisions.length;++e)l[this.corp.divisions[e].type]=!0;for(var c in l.Agriculture||r.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("option",{text:_IndustryData__WEBPACK_IMPORTED_MODULE_2__.Industries.Agriculture,value:"Agriculture"})),_IndustryData__WEBPACK_IMPORTED_MODULE_2__.Industries)if("Agriculture"!==c&&_IndustryData__WEBPACK_IMPORTED_MODULE_2__.Industries.hasOwnProperty(c)&&!l[c]){var u=_IndustryData__WEBPACK_IMPORTED_MODULE_2__.Industries[c];r.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("option",{text:u,value:c}))}u=r.options[r.selectedIndex].value;a.innerHTML=_IndustryData__WEBPACK_IMPORTED_MODULE_2__.IndustryDescriptions[u]+"<br><br>",r.addEventListener("change",function(){var e=r.options[r.selectedIndex].value;a.innerHTML=_IndustryData__WEBPACK_IMPORTED_MODULE_2__.IndustryDescriptions[e]+"<br><br>"});const m=[];return m.push(n),m.push(r),m.push(a),m.push(o),m.push(i),m.push(s),m.push(t),Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(e,m),i.focus(),!1}createProductMarketTaPopup(e,t){this.corp;const n="cmpy-mgmt-marketta-popup",r=e.rat/e.mku,a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:"<u><strong>Market-TA.I</strong></u><br>The maximum sale price you can mark this up to is "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(e.pCost+r)+". This means that if you set the sale price higher than this, you will begin to experience a loss in number of sales"}),i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("div",{display:"block"}),o=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("label",{color:"white",for:"cmpy-mgmt-marketa1-checkbox",innerText:"Use Market-TA.I for Auto-Sale Price",tooltip:"If this is enabled, then this Product will automatically be sold at the price identified by Market-TA.I (i.e. the price shown above)"}),s=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{checked:e.marketTa1,id:"cmpy-mgmt-marketa1-checkbox",margin:"3px",type:"checkbox",changeListener:t=>{e.marketTa1=t.target.checked}});i.appendChild(o),i.appendChild(s);const l=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(n,{class:"std-button",display:"block",innerText:"Close"});if(t.hasResearch("Market-TA.II")){let t;const o=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p"),s=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{marginTop:"4px",onkeyup:e=>{e.preventDefault(),t()},type:"number",value:e.pCost});(t=function(){const t=parseFloat(s.value);let n=1;t>e.pCost&&t-e.pCost>r&&(n=r/(t-e.pCost)),o.innerHTML="<br><u><strong>Market-TA.II</strong></u><br>"+`If you sell at ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(t)}, `+`then you will sell ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(n,"0.00000")}x as much compared `+"to if you sold at market price."})();const c="cmpy-mgmt-marketa2-checkbox",u=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("div",{display:"block"}),m=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("label",{color:"white",for:c,innerText:"Use Market-TA.II for Auto-Sale Price",tooltip:"If this is enabled, then this Product will automatically be sold at the optimal price such that the amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all produced materials will be sold)"}),p=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{checked:e.marketTa2,id:c,margin:"3px",type:"checkbox",changeListener:t=>{e.marketTa2=t.target.checked}});u.appendChild(m),u.appendChild(p);const h=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Note that Market-TA.II overrides Market-TA.I. This means that if both are enabled, then Market-TA.II will take effect, not Market-TA.I"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(n,[a,i,o,s,u,h,l])}else Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(n,[a,i,l])}createPurchaseMaterialPopup(e,t,n){const r=this.corp,a="cmpy-mgmt-material-purchase-popup",i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:"Enter the amount of "+e.name+" you would like to purchase per second. This material's cost changes constantly"});let o,s=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{margin:"5px",placeholder:"Purchase amount",type:"number",value:e.buy?e.buy:null,onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&o.click()}});o=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{innerText:"Confirm",class:"std-button",clickListener:()=>{if(!isNaN(s.value))return e.buy=parseFloat(s.value),isNaN(e.buy)&&(e.buy=0),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(a),this.rerender(),!1;Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid amount")}});const l=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{innerText:"Clear Purchase",class:"std-button",clickListener:()=>(e.buy=0,Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(a),this.rerender(),!1)}),c=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(a,{class:"std-button",innerText:"Cancel"}),u=[i,s,o,l,c];if(t.hasResearch("Bulk Purchasing")){const t=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Enter the amount of "+e.name+" you would like to bulk purchase. This purchases the specified amount instantly (all at once)."});let i,o=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p");const s=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{margin:"5px",placeholder:"Bulk Purchase amount",type:"number",onkeyup:t=>{t.preventDefault(),function(t){const r=parseFloat(t),a=r*e.bCost,i=_MaterialSizes__WEBPACK_IMPORTED_MODULE_3__.MaterialSizes[e.name];r*i>(n.size-n.sizeUsed)/i?o.innerText="Not enough warehouse space to purchase this amount":isNaN(a)?o.innerText="Invalid put for Bulk Purchase amount":o.innerText=`Purchasing ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(r,"0,0.00")} of `+`${e.name} will cost ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(a)}`}(t.target.value),t.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&i.click()}});i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"std-button",innerText:"Confirm Bulk Purchase",clickListener:()=>{const t=parseFloat(s.value),i=_MaterialSizes__WEBPACK_IMPORTED_MODULE_3__.MaterialSizes[e.name];if(t*i>(n.size-n.sizeUsed)/i)return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You do not have enough warehouse size to fit this purchase"),!1;if(!isNaN(t)){const n=t*e.bCost;return r.funds.gt(n)?(r.funds=r.funds.minus(n),e.qty+=t,Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(a),!1):(Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You cannot afford this purchase."),!1)}Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid input amount")}}),u.push(t),u.push(o),u.push(s),u.push(i)}Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(a,u),s.focus()}createSellMaterialPopup(mat){const sellPopupId="cmpy-mgmt-material-sell-popup",txt=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:"Enter the maximum amount of "+mat.name+" you would like to sell per second, as well as the price at which you would like to sell at.<br><br>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 material will be discarded<br><br>Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.<br><br>When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that depends on your production. For example, if you set the sell amount to 'PROD-5' then you will always sell 5 less of the material than you produce.<br><br>When setting the sell price, you can use the 'MP' variable to designate a dynamically changing price that depends on the market price. For example, if you set the sell price to 'MP+10' then it will always be sold at $10 above the market price."}),br=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("br");let confirmBtn;const inputQty=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{type:"text",marginTop:"4px",value:mat.sllman[1]?mat.sllman[1]:null,placeholder:"Sell amount",onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&confirmBtn.click()}});let inputButtonInitValue=mat.sCost?mat.sCost:null;mat.marketTa2?inputButtonInitValue+=" (Market-TA.II)":mat.marketTa1&&(inputButtonInitValue+=" (Market-TA.I)");const inputPx=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{type:"text",marginTop:"4px",value:inputButtonInitValue,placeholder:"Sell price",onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&confirmBtn.click()}});confirmBtn=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"std-button",innerText:"Confirm",clickListener:()=>{let cost=inputPx.value.replace(/\s+/g,"");cost=cost.replace(/[^-()\d/*+.MP]/g,"");let temp=cost.replace(/MP/g,mat.bCost);try{temp=eval(temp)}catch(e){return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value or expression for sell price field: "+e),!1}if(null==temp||isNaN(temp))return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value or expression for sell price field"),!1;if(cost.includes("MP")?mat.sCost=cost:mat.sCost=temp,inputQty.value.includes("MAX")||inputQty.value.includes("PROD")){let qty=inputQty.value.replace(/\s+/g,"");qty=qty.replace(/[^-()\d/*+.MAXPROD]/g,"");let tempQty=qty.replace(/MAX/g,1);tempQty=tempQty.replace(/PROD/g,1);try{tempQty=eval(tempQty)}catch(e){return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value or expression for sell price field: "+e),!1}if(null==tempQty||isNaN(tempQty))return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value or expression for sell price field"),!1;mat.sllman[0]=!0,mat.sllman[1]=qty}else{if(isNaN(inputQty.value))return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value for sell quantity field! Must be numeric or 'MAX'"),!1;var qty=parseFloat(inputQty.value);isNaN(qty)&&(qty=0),0===qty?(mat.sllman[0]=!1,mat.sllman[1]=0):(mat.sllman[0]=!0,mat.sllman[1]=qty)}return Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(sellPopupId),this.rerender(),!1}});const cancelBtn=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(sellPopupId,{class:"std-button",innerText:"Cancel"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(sellPopupId,[txt,br,inputQty,inputPx,confirmBtn,cancelBtn]),inputQty.focus()}createSellProductPopup(product,city){const popupId="cmpy-mgmt-sell-product-popup",txt=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:"Enter the maximum amount of "+product.name+" you would like to sell per second, as well as the price at which you would like to sell it at.<br><br>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 product will be discarded.<br><br>Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.<br><br>When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that depends on your production. For example, if you set the sell amount to 'PROD-1' then you will always sell 1 less of the material than you produce.<br><br>When setting the sell price, you can use the 'MP' variable to set a dynamically changing price that depends on the Product's estimated market price. For example, if you set it to 'MP*5' then it will always be sold at five times the estimated market price."});let confirmBtn;const inputQty=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{margin:"5px 0px 5px 0px",placeholder:"Sell amount",type:"text",value:product.sllman[city][1]?product.sllman[city][1]:null,onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&confirmBtn.click()}});let inputButtonInitValue=product.sCost?product.sCost:null;product.marketTa2?inputButtonInitValue+=" (Market-TA.II)":product.marketTa1&&(inputButtonInitValue+=" (Market-TA.I)");const inputPx=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{margin:"5px 0px 5px 0px",placeholder:"Sell price",type:"text",value:inputButtonInitValue,onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&confirmBtn.click()}}),checkboxDiv=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("div",{border:"1px solid white",display:"inline-block"}),checkboxLabel=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("label",{for:popupId+"-checkbox",innerText:"Use same 'Sell Amount' for all cities"}),checkbox=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{checked:!0,id:popupId+"-checkbox",margin:"2px",type:"checkbox"});checkboxDiv.appendChild(checkboxLabel),checkboxDiv.appendChild(checkbox),confirmBtn=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"std-button",innerText:"Confirm",clickListener:()=>{if(inputPx.value.includes("MP")){var price=inputPx.value.replace(/\s+/g,"");price=price.replace(/[^-()\d/*+.MP]/g,"");var temp=price.replace(/MP/g,1);try{temp=eval(temp)}catch(e){return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value or expression for sell quantity field: "+e),!1}if(null==temp||isNaN(temp))return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value or expression for sell quantity field."),!1;product.sCost=price}else{var cost=parseFloat(inputPx.value);if(isNaN(cost))return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value for sell price field"),!1;product.sCost=cost}const cities=Object.keys(_Locations_Cities__WEBPACK_IMPORTED_MODULE_7__.Cities);if(inputQty.value.includes("MAX")||inputQty.value.includes("PROD")){var qty=inputQty.value.replace(/\s+/g,"");qty=qty.replace(/[^-()\d/*+.MAXPROD]/g,"");var temp=qty.replace(/MAX/g,1);temp=temp.replace(/PROD/g,1);try{temp=eval(temp)}catch(e){return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value or expression for sell price field: "+e),!1}if(null==temp||isNaN(temp))return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value or expression for sell price field"),!1;if(checkbox.checked)for(let e=0;e<cities.length;++e){const t=cities[e];product.sllman[t][0]=!0,product.sllman[t][1]=qty}else product.sllman[city][0]=!0,product.sllman[city][1]=qty}else{if(isNaN(inputQty.value))return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value for sell quantity field! Must be numeric"),!1;var qty=parseFloat(inputQty.value);if(isNaN(qty)&&(qty=0),0===qty)if(checkbox.checked)for(let e=0;e<cities.length;++e){const t=cities[e];product.sllman[t][0]=!1}else product.sllman[city][0]=!1;else if(checkbox.checked)for(let e=0;e<cities.length;++e){const t=cities[e];product.sllman[t][0]=!0,product.sllman[t][1]=qty}else product.sllman[city][0]=!0,product.sllman[city][1]=qty}return Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(popupId),this.rerender(),!1}});const cancelBtn=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(popupId,{class:"std-button"}),linebreak1=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("br");Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(popupId,[txt,inputQty,inputPx,confirmBtn,cancelBtn,linebreak1,checkboxDiv]),inputQty.focus()}createSellSharesPopup(){const e="cmpy-mgmt-sell-shares-popup",t=this.corp.sharePrice,n=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerHTML:"Enter the number of shares you would like to sell. The money from selling your shares will go directly to you (NOT your Corporation).<br><br>Selling your shares will cause your corporation's stock price to fall due to dilution. Furthermore, selling a large number of shares all at once will have an immediate effect in reducing your stock price.<br><br>The current price of your company's stock is "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(t,"$0.000a")}),r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p"),a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{type:"number",placeholder:"Shares to sell",margin:"5px",inputListener:()=>{var e=Math.round(a.value);if(isNaN(e)||e<=0)r.innerText="ERROR: Invalid value entered for number of shares to sell";else if(e>this.corp.numShares)r.innerText="You don't have this many shares to sell!";else{const t=this.corp.calculateShareSale(e),n=t[0];t[1],t[2];r.innerText="Sell "+e+" shares for a total of "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(n,"$0.000a")}}}),i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"a-link-button",innerText:"Sell shares",display:"inline-block",clickListener:()=>{var t=Math.round(a.value);if(isNaN(t)||t<=0)Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("ERROR: Invalid value for number of shares");else{if(!(t>this.corp.numShares)){const r=this.corp.calculateShareSale(t),a=r[0],i=r[1],o=r[2];if(this.corp.numShares-=t,isNaN(this.corp.issuedShares)){console.error(`Corporation issuedShares is NaN: ${this.corp.issuedShares}`);var n=parseInt(this.corp.issuedShares);isNaN(n)?this.corp.issuedShares=0:this.corp.issuedShares=n}return this.corp.issuedShares+=t,this.corp.sharePrice=i,this.corp.shareSalesUntilPriceUpdate=o,this.corp.shareSaleCooldown=_Corporation__WEBPACK_IMPORTED_MODULE_1__.k,_Player__WEBPACK_IMPORTED_MODULE_5__.Player.gainMoney(a),_Player__WEBPACK_IMPORTED_MODULE_5__.Player.recordMoneySource(a,"corporation"),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(e),Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)(`Sold ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(t,"0.000a")} shares for `+`${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(a,"$0.000a")}. `+`The corporation's stock price fell to ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatMoney(this.corp.sharePrice)} `+"as a result of dilution."),this.rerender(),!1}Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("ERROR: You don't have this many shares to sell")}}}),o=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(e,{class:"std-button",display:"inline-block",innerText:"Cancel"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(e,[n,r,a,i,o]),a.focus()}createThrowOfficePartyPopup(e){const t="cmpy-mgmt-throw-office-party-popup",n=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Enter the amount of money you would like to spend PER EMPLOYEE on this office party"}),r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Throwing this party will cost a total of $0"});let a;const i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("input",{type:"number",margin:"5px",placeholder:"$ / employee",inputListener:()=>{if(isNaN(i.value)||i.value<0)r.innerText="Invalid value entered!";else{const t=i.value*e.employees.length;r.innerText="Throwing this party will cost a total of "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(t,"$0.000a")}},onkeyup:e=>{e.preventDefault(),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_11__.KEY.ENTER&&a.click()}});a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:"std-button",innerText:"Throw Party",clickListener:()=>{if(isNaN(i.value)||i.value<0)Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Invalid value entered");else{var n=i.value*e.employees.length;if(this.corp.funds.lt(n))Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You don't have enough company funds to throw this.corp party!");else{var r;this.corp.funds=this.corp.funds.minus(n);for(let t=0;t<e.employees.length;++t)r=e.employees[t].throwParty(i.value);Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You threw a party for the office! The morale and happiness of each employee increased by "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.formatPercentage(r-1)),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(t)}}return!1}});const o=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(t,{class:"std-button",innerText:"Cancel"});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(t,[n,r,i,a,o]),i.focus()}createUpgradeOfficeSizePopup(e){const t="cmpy-mgmt-upgrade-office-size-popup",n=Math.round(e.size/_Corporation__WEBPACK_IMPORTED_MODULE_1__.h),r=_Corporation__WEBPACK_IMPORTED_MODULE_1__.g*Math.pow(1.09,n);let a=0;for(let e=0;e<5;++e)a+=Math.pow(1.09,n+e);const i=_Corporation__WEBPACK_IMPORTED_MODULE_1__.g*a;let o=this.corp.funds.dividedBy(_Corporation__WEBPACK_IMPORTED_MODULE_1__.g).toNumber(),s=1;for(a=Math.pow(1.09,n);s<50&&!(a>=o);){let e=Math.pow(1.09,n+s);if(a+e>o)break;a+=e,++s}const l=_Corporation__WEBPACK_IMPORTED_MODULE_1__.g*a,c=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Increase the size of your office space to fit additional employees!"}),u=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("p",{innerText:"Upgrade size: "}),m=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:this.corp.funds.lt(r)?"a-link-button-inactive":"a-link-button",display:"inline-block",margin:"4px",innerText:"by 3",tooltip:_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(r,"$0.000a"),clickListener:()=>(this.corp.funds.lt(r)?Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You don't have enough company funds to purchase this upgrade!"):(e.size+=_Corporation__WEBPACK_IMPORTED_MODULE_1__.h,this.corp.funds=this.corp.funds.minus(r),Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Office space increased! It can now hold "+e.size+" employees"),this.rerender()),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(t),!1)}),p=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:this.corp.funds.lt(i)?"a-link-button-inactive":"a-link-button",display:"inline-block",margin:"4px",innerText:"by 15",tooltip:_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(i,"$0.000a"),clickListener:()=>(this.corp.funds.lt(i)?Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You don't have enough company funds to purchase this upgrade!"):(e.size+=5*_Corporation__WEBPACK_IMPORTED_MODULE_1__.h,this.corp.funds=this.corp.funds.minus(i),Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Office space increased! It can now hold "+e.size+" employees"),this.rerender()),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(t),!1)}),h=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__.createElement)("button",{class:this.corp.funds.lt(l)?"a-link-button-inactive":"a-link-button",display:"inline-block",margin:"4px",innerText:"by MAX ("+s*_Corporation__WEBPACK_IMPORTED_MODULE_1__.h+")",tooltip:_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_8__.numeralWrapper.format(l,"$0.000a"),clickListener:()=>(this.corp.funds.lt(l)?Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You don't have enough company funds to purchase this upgrade!"):(e.size+=_Corporation__WEBPACK_IMPORTED_MODULE_1__.h*s,this.corp.funds=this.corp.funds.minus(l),Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("Office space increased! It can now hold "+e.size+" employees"),this.rerender()),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_18__.removeElementById)(t),!1)}),d=Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_16__.createPopupCloseButton)(t,{innerText:"Cancel"});d.style.margin="4px",Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_15__.createPopup)(t,[c,u,m,p,h,d])}purchaseWarehouse(e,t){const n=this.corp;n.funds.lt(_Corporation__WEBPACK_IMPORTED_MODULE_1__.m)?Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_9__.dialogBoxCreate)("You do not have enough funds to do this!"):(e.warehouses[t]=new _Corporation__WEBPACK_IMPORTED_MODULE_1__.l({corp:n,industry:e,loc:t,size:_Corporation__WEBPACK_IMPORTED_MODULE_1__.n}),n.funds=n.funds.minus(_Corporation__WEBPACK_IMPORTED_MODULE_1__.m),this.rerender())}rerender(){this.corp.rerender()}}},function(e,t,n){"use strict";function r(e,t,n){return(t<=0||t>=1)&&console.warn(`Exponential factor is ${t}. This is not an intended value for it`),n<1&&console.warn(`Linear factor is ${n}. This is not an intended value for it`),Math.pow(e,t)+e/n}Object.defineProperty(t,"__esModule",{value:!0}),t.calculateEffectWithFactors=r;t.EffectWithFactors=class{constructor(e,t){this.expFac=e,this.linearFac=t}calculate(e){return r(e,this.expFac,this.linearFac)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(718),i=n(409),o=n(408),s=n(0),l=n(73);t.AugmentationsRoot=class extends r.Component{constructor(e){super(e)}render(){return r.createElement("div",{id:"augmentations-content"},r.createElement("h1",null,"Purchased Augmentations"),r.createElement("p",null,"Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to install them."),r.createElement("p",null,"WARNING: Installing your Augmentations resets most of your progress, including:"),r.createElement("br",null),r.createElement("p",null,"- Stats/Skill levels and Experience"),r.createElement("p",null,"- Money"),r.createElement("p",null,"- Scripts on every computer but your home computer"),r.createElement("p",null,"- Purchased servers"),r.createElement("p",null,"- Hacknet Nodes"),r.createElement("p",null,"- Faction/Company reputation"),r.createElement("p",null,"- Stocks"),r.createElement("br",null),r.createElement("p",null,"Installing Augmentations lets you start over with the perks and benefits granted by all of the Augmentations you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your home computer (but you will lose all programs besides NUKE.exe)"),r.createElement(l.StdButton,{onClick:this.props.installAugmentationsFn,text:"Install Augmentations",tooltip:"'I never asked for this'"}),r.createElement(l.StdButton,{addClasses:"flashing-button",onClick:this.props.exportGameFn,text:"Backup Save (Export)",tooltip:"It's always a good idea to backup/export your save!"}),r.createElement(o.PurchasedAugmentations,null),r.createElement("h1",null,"Installed Augmentations"),r.createElement("p",null,`List of all Augmentations ${s.Player.sourceFiles.length>0?"and Source Files ":""} `+"that have been installed. You have gained the effects of these."),r.createElement(a.InstalledAugmentationsAndSourceFiles,null),r.createElement("br",null)," ",r.createElement("br",null),r.createElement(i.PlayerMultipliers,null))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.DialogBox=function(e){return r.createElement("div",{className:"dialog-box-content text"},r.createElement("span",{className:"dialog-box-close-button "},"×"),e)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),a=n(131);!function(){function e(e){if(!(e.target&&e.target instanceof Element))return;"none"===window.getComputedStyle(e.target).display&&e.isTrusted&&r.Player.giveExploit(a.Exploit.Unclickable)}document.addEventListener("DOMContentLoaded",function t(){const n=document.getElementById("unclickable");null!=n?(n.addEventListener("click",e),document.removeEventListener("DOMContentLoaded",t)):console.error("Could not find the unclickable elem for the related exploit.")})}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),a=n(131);setInterval(function(){"5.5e+1"!==55..toExponential()&&r.Player.giveExploit(a.Exploit.PrototypeTampering)},9e5)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.AccordionButton=function(e){const t=null!=e.tooltip&&""!==e.tooltip;let n,a="accordion-button";return t&&(a+=" tooltip"),"string"==typeof e.addClasses&&(a+=` ${e.addClasses}`),t&&(n={__html:e.tooltip}),r.createElement("button",{className:a,id:e.id,onClick:e.onClick,style:e.style},e.text,t&&r.createElement("span",{className:"tooltiptext",dangerouslySetInnerHTML:n}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(2),i=n(137),o=n(383),s=n(67),l=n(8),c=n(110),u=n(7),m=n(83);t.WorkerScriptAccordion=function(e){const t=e.workerScript.scriptRef,n=c.logBoxCreate.bind(null,t),p=s.killWorkerScript.bind(null,t,t.server),h=t.onlineMoneyMade/t.onlineRunningTime,d=t.onlineExpGained/t.onlineRunningTime,_=t.offlineMoneyMade/t.offlineRunningTime,g=t.offlineExpGained/t.offlineRunningTime;return r.createElement(i.Accordion,{headerClass:"active-scripts-script-header",headerContent:r.createElement(r.Fragment,null,e.workerScript.name),panelClass:"active-scripts-script-panel",panelContent:r.createElement(r.Fragment,null,r.createElement("pre",null,"Threads: ",e.workerScript.scriptRef.threads),r.createElement("pre",null,"Args: ",m.arrayToString(e.workerScript.args)),r.createElement("pre",null,"Online Time: ",u.convertTimeMsToTimeElapsedString(1e3*t.onlineRunningTime)),r.createElement("pre",null,"Offline Time: ",u.convertTimeMsToTimeElapsedString(1e3*t.offlineRunningTime)),r.createElement("pre",null,"Total online production: ",a.numeralWrapper.formatMoney(t.onlineMoneyMade)),r.createElement("pre",null,Array(26).join(" ")+a.numeralWrapper.formatBigNumber(t.onlineExpGained)+" hacking exp"),r.createElement("pre",null,"Online production rate: ",a.numeralWrapper.formatMoney(h)," / second"),r.createElement("pre",null,Array(25).join(" ")+a.numeralWrapper.formatBigNumber(d)+" hacking exp / second"),r.createElement("pre",null,"Total offline production: ",a.numeralWrapper.formatMoney(t.offlineMoneyMade)),r.createElement("pre",null,Array(27).join(" ")+a.numeralWrapper.formatBigNumber(t.offlineExpGained)+" hacking exp"),r.createElement("pre",null,"Offline production rate: ",a.numeralWrapper.formatMoney(_)," / second"),r.createElement("pre",null,Array(26).join(" ")+a.numeralWrapper.formatBigNumber(g)+" hacking exp / second"),r.createElement(o.AccordionButton,{onClick:n,text:"Log"}),r.createElement(o.AccordionButton,{onClick:function(){p(),l.dialogBoxCreate("Killing script")},text:"Kill Script"}))})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(384),i=n(137),o=n(109);t.ServerAccordion=function(e){const t=e.server,n=`${t.hostname}${" ".repeat(18)}`.slice(0,Math.max(t.hostname.length,18)),s={progress:t.ramUsed/t.maxRam,totalTicks:30},l=`${n} ${o.createProgressBarText(s)}`,c=e.workerScripts.map(e=>r.createElement(a.WorkerScriptAccordion,{key:`${e.name}_${e.args}`,workerScript:e}));return r.createElement(i.Accordion,{headerContent:r.createElement("pre",null,l),panelContent:r.createElement("ul",null,c)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(385),i=n(105),o=n(22),s="ActiveScriptsUI";t.ServerAccordions=class extends r.Component{constructor(e){super(e),this.serverToScriptMap={},this.state={rerenderFlag:!1},this.updateServerToScriptsMap(),this.rerender=this.rerender.bind(this)}componentDidMount(){i.WorkerScriptStartStopEventEmitter.addSubscriber({cb:this.rerender,id:s})}componentWillUnmount(){i.WorkerScriptStartStopEventEmitter.removeSubscriber(s)}updateServerToScriptsMap(){const e={};for(const t of this.props.workerScripts.values()){const n=o.getServer(t.serverIp);null!=n?(null==e[n.hostname]&&(e[n.hostname]={server:n,workerScripts:[]}),e[n.hostname].workerScripts.push(t)):console.warn(`WorkerScript has invalid IP address: ${t.serverIp}`)}this.serverToScriptMap=e}rerender(){this.updateServerToScriptsMap(),this.setState(e=>({rerenderFlag:!e.rerenderFlag}))}render(){const e=Object.keys(this.serverToScriptMap).map(e=>{const t=this.serverToScriptMap[e];return r.createElement(a.ServerAccordion,{key:e,server:t.server,workerScripts:t.workerScripts})});return r.createElement("ul",{className:"active-scripts-list",id:"active-scripts-list"},e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(2);t.ScriptProduction=function(e){const t=e.p.scriptProdSinceLastAug/(e.p.playtimeSinceLastAug/1e3);let n=0;for(const t of e.workerScripts.values())n+=t.scriptRef.onlineMoneyMade/t.scriptRef.onlineRunningTime;return r.createElement("p",{id:"active-scripts-total-prod"},"Total online production of Active scripts: ",r.createElement("span",{className:"money-gold"},r.createElement("span",{id:"active-scripts-total-production-active"},a.numeralWrapper.formatMoney(n))," / sec"),r.createElement("br",null),"Total online production since last Aug installation: ",r.createElement("span",{id:"active-scripts-total-prod-aug-total",className:"money-gold"},a.numeralWrapper.formatMoney(e.p.scriptProdSinceLastAug))," (",r.createElement("span",{className:"money-gold"},r.createElement("span",{id:"active-scripts-total-prod-aug-avg",className:"money-gold"},a.numeralWrapper.formatMoney(t))," / sec"),")")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(269),a=n(10),i=n(16);class o extends r.Person{static fromJSON(e){return i.Generic_fromJSON(o,e.data)}constructor(){super()}getCost(){let e=this.hacking_exp+this.strength_exp+this.defense_exp+this.dexterity_exp+this.agility_exp+this.charisma_exp,t=0;for(let e=0;e<this.augmentations.length;++e){const n=a.Augmentations[this.augmentations[e].name];null!=n?t+=n.startingCost:console.error(`Could not find Augmentation ${this.augmentations[e].name}`)}return 25e3*e+t*Math.pow(1.2,this.augmentations.length)}toJSON(){return i.Generic_toJSON("Resleeve",this)}}t.Resleeve=o,i.Reviver.constructors.Resleeve=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(388),a=n(10),i=n(132),o=n(4),s=n(15);t.purchaseResleeve=function(e,t){const n=e.getCost();if(!t.canAfford(n))return!1;t.loseMoney(n),t.hacking_exp=e.hacking_exp,t.strength_exp=e.strength_exp,t.defense_exp=e.defense_exp,t.dexterity_exp=e.dexterity_exp,t.agility_exp=e.agility_exp,t.charisma_exp=e.charisma_exp;for(const e in a.Augmentations)a.Augmentations[e].owned=!1;for(let e=t.augmentations.length-1;e>=0;--e)t.augmentations[e].name!==o.AugmentationNames.NeuroFluxGovernor?t.augmentations.splice(e,1):a.Augmentations[o.AugmentationNames.NeuroFluxGovernor].owned=!0;for(let n=0;n<e.augmentations.length;++n)t.augmentations.push(new i.PlayerOwnedAugmentation(e.augmentations[n].name)),a.Augmentations[e.augmentations[n].name].owned=!0;for(let e=t.queuedAugmentations.length-1;e>=0;--e){const n=t.queuedAugmentations[e].name;t.augmentations.filter(e=>e.name!==o.AugmentationNames.NeuroFluxGovernor&&e.name===n).length>=1&&t.queuedAugmentations.splice(e,1)}return t.reapplyAllAugmentations(!0),t.reapplyAllSourceFiles(),!0},t.generateResleeves=function(){let e=[];for(let t=0;t<40;++t){let n=new r.Resleeve;const i=5*t+1;n.hacking_exp=i*s.getRandomInt(1e3,5e3),n.strength_exp=i*s.getRandomInt(1e3,5e3),n.defense_exp=i*s.getRandomInt(1e3,5e3),n.dexterity_exp=i*s.getRandomInt(1e3,5e3),n.agility_exp=i*s.getRandomInt(1e3,5e3),n.charisma_exp=i*s.getRandomInt(1e3,5e3);const l=Math.max(2,Math.ceil((t+3)/2)),c=s.getRandomInt(l,l+2),u=Object.keys(a.Augmentations);for(let e=0;e<c;++e){const e=s.getRandomInt(0,u.length-1),t=u[e];if(t===o.AugmentationNames.TheRedPill||t===o.AugmentationNames.NeuroFluxGovernor)continue;const r=a.Augmentations[t];n.augmentations.push({name:r.name,level:1}),n.applyAugmentation(a.Augmentations[t]),n.updateStatLevels(),u.splice(e,1)}e.push(n)}return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2),a=n(1),i=n(170);t.MoreEarningsContent=function(e){let t={};return t={textAlign:"right"},a.createElement(a.Fragment,null,i.StatsTable([["Money ",r.numeralWrapper.formatMoney(e.earningsForTask.money)],["Hacking Exp ",r.numeralWrapper.formatBigNumber(e.earningsForTask.hack)],["Strength Exp ",r.numeralWrapper.formatBigNumber(e.earningsForTask.str)],["Defense Exp ",r.numeralWrapper.formatBigNumber(e.earningsForTask.def)],["Dexterity Exp ",r.numeralWrapper.formatBigNumber(e.earningsForTask.dex)],["Agility Exp ",r.numeralWrapper.formatBigNumber(e.earningsForTask.agi)],["Charisma Exp ",r.numeralWrapper.formatBigNumber(e.earningsForTask.cha)]],"Earnings for Current Task:"),a.createElement("br",null),i.StatsTable([["Money: ",r.numeralWrapper.formatMoney(e.earningsForPlayer.money)],["Hacking Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForPlayer.hack)],["Strength Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForPlayer.str)],["Defense Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForPlayer.def)],["Dexterity Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForPlayer.dex)],["Agility Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForPlayer.agi)],["Charisma Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForPlayer.cha)]],"Total Earnings for Host Consciousness:"),a.createElement("br",null),i.StatsTable([["Money: ",r.numeralWrapper.formatMoney(e.earningsForSleeves.money)],["Hacking Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForSleeves.hack)],["Strength Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForSleeves.str)],["Defense Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForSleeves.def)],["Dexterity Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForSleeves.dex)],["Agility Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForSleeves.agi)],["Charisma Exp: ",r.numeralWrapper.formatBigNumber(e.earningsForSleeves.cha)]],"Total Earnings for Other Sleeves:"),a.createElement("br",null))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2),a=n(170),i=n(1);t.MoreStatsContent=function(e){let t={};return t={textAlign:"right"},i.createElement(i.Fragment,null,a.StatsTable([["Hacking: ",e.hacking_skill,`(${r.numeralWrapper.formatBigNumber(e.hacking_exp)} exp)`],["Strength: ",e.strength,`(${r.numeralWrapper.formatBigNumber(e.strength_exp)} exp)`],["Defense: ",e.defense,`(${r.numeralWrapper.formatBigNumber(e.defense_exp)} exp)`],["Dexterity: ",e.dexterity,`(${r.numeralWrapper.formatBigNumber(e.dexterity_exp)} exp)`],["Agility: ",e.agility,`(${r.numeralWrapper.formatBigNumber(e.agility_exp)} exp)`],["Charisma: ",e.charisma,`(${r.numeralWrapper.formatBigNumber(e.charisma_exp)} exp)`]],"Stats:"),i.createElement("br",null),a.StatsTable([["Hacking Level multiplier: ",r.numeralWrapper.formatPercentage(e.hacking_mult)],["Hacking Experience multiplier: ",r.numeralWrapper.formatPercentage(e.hacking_exp_mult)],["Strength Level multiplier: ",r.numeralWrapper.formatPercentage(e.strength_mult)],["Strength Experience multiplier: ",r.numeralWrapper.formatPercentage(e.strength_exp_mult)],["Defense Level multiplier: ",r.numeralWrapper.formatPercentage(e.defense_mult)],["Defense Experience multiplier: ",r.numeralWrapper.formatPercentage(e.defense_exp_mult)],["Dexterity Level multiplier: ",r.numeralWrapper.formatPercentage(e.dexterity_mult)],["Dexterity Experience multiplier: ",r.numeralWrapper.formatPercentage(e.dexterity_exp_mult)],["Agility Level multiplier: ",r.numeralWrapper.formatPercentage(e.agility_mult)],["Agility Experience multiplier: ",r.numeralWrapper.formatPercentage(e.agility_exp_mult)],["Charisma Level multiplier: ",r.numeralWrapper.formatPercentage(e.charisma_mult)],["Charisma Experience multiplier: ",r.numeralWrapper.formatPercentage(e.charisma_exp_mult)],["Faction Reputation Gain multiplier: ",r.numeralWrapper.formatPercentage(e.faction_rep_mult)],["Company Reputation Gain multiplier: ",r.numeralWrapper.formatPercentage(e.company_rep_mult)],["Salary multiplier: ",r.numeralWrapper.formatPercentage(e.work_money_mult)],["Crime Money multiplier: ",r.numeralWrapper.formatPercentage(e.crime_money_mult)],["Crime Success multiplier: ",r.numeralWrapper.formatPercentage(e.crime_success_mult)]],"Multipliers:"))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2),a=n(1);t.StatsElement=function(e){let t={};return t={textAlign:"right"},a.createElement(a.Fragment,null,a.createElement("table",null,a.createElement("tbody",null,a.createElement("tr",null,a.createElement("td",{className:"character-hp-cell"},"HP: "),a.createElement("td",{className:"character-hp-cell",style:t},r.numeralWrapper.format(e.hp,"0,0")," / ",r.numeralWrapper.format(e.max_hp,"0,0"))),a.createElement("tr",null,a.createElement("td",null,"City: "),a.createElement("td",{style:t},e.city)),a.createElement("tr",null,a.createElement("td",{className:"character-hack-cell"},"Hacking: "),a.createElement("td",{className:"character-hack-cell",style:t},r.numeralWrapper.format(e.hacking_skill,"0,0"))),a.createElement("tr",null,a.createElement("td",{className:"character-combat-cell"},"Strength: "),a.createElement("td",{className:"character-combat-cell",style:t},r.numeralWrapper.format(e.strength,"0,0"))),a.createElement("tr",null,a.createElement("td",{className:"character-combat-cell"},"Defense: "),a.createElement("td",{className:"character-combat-cell",style:t},r.numeralWrapper.format(e.defense,"0,0"))),a.createElement("tr",null,a.createElement("td",{className:"character-combat-cell"},"Dexterity: "),a.createElement("td",{className:"character-combat-cell",style:t},r.numeralWrapper.format(e.dexterity,"0,0"))),a.createElement("tr",null,a.createElement("td",{className:"character-combat-cell"},"Agility: "),a.createElement("td",{className:"character-combat-cell",style:t},r.numeralWrapper.format(e.agility,"0,0"))),a.createElement("tr",null,a.createElement("td",{className:"character-cha-cell"},"Charisma: "),a.createElement("td",{className:"character-cha-cell",style:t},r.numeralWrapper.format(e.charisma,"0,0"))),a.createElement("tr",null,a.createElement("td",{className:"character-int-cell"},"Shock: "),a.createElement("td",{className:"character-int-cell",style:t},r.numeralWrapper.format(100-e.shock,"0,0.000"))),a.createElement("tr",null,a.createElement("td",{className:"character-int-cell"},"Sync: "),a.createElement("td",{className:"character-int-cell",style:t},r.numeralWrapper.format(e.sync,"0,0.000"))),a.createElement("tr",null,a.createElement("td",{className:"character-int-cell"},"Memory: "),a.createElement("td",{className:"character-int-cell",style:t},r.numeralWrapper.format(e.memory,"0"))))))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.EarningsTableElement=function(e,t){return r.createElement(r.Fragment,null,r.createElement("pre",null,e),r.createElement("table",null,r.createElement("tbody",null,t.map((e,t)=>r.createElement("tr",{key:t},e.map((e,t)=>{let n={};return 0!==t&&(n={textAlign:"right"}),r.createElement("td",{style:n,key:t},e)}))))))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.SleeveFaq=r.createElement(r.Fragment,null,r.createElement("strong",null,r.createElement("u",null,"How do Duplicate Sleeves work?")),r.createElement("br",null),"Duplicate Sleeves are essentially clones. You can use them to perform any work type action, such as working for a company/faction or committing a crime. Having sleeves perform these tasks earns you money, experience, and reputation.",r.createElement("br",null),r.createElement("br",null),"Sleeves are their own individuals, which means they each have their own experience and stats.",r.createElement("br",null),r.createElement("br",null),"When a sleeve earns experience, it earns experience for itself, the player's original 'consciousness', as well as all of the player's other sleeves.",r.createElement("br",null),r.createElement("br",null),r.createElement("strong",null,r.createElement("u",null,"What is Synchronization (Sync)?")),r.createElement("br",null),"Synchronization is a measure of how aligned your consciousness is with that of your Duplicate Sleeves. It is a numerical value between 1 and 100, and it affects how much experience is earned when the sleeve is performing a task.",r.createElement("br",null),r.createElement("br",null),"Let N be the sleeve's synchronization. When the sleeve earns experience by performing a task, both the sleeve and the player's original host consciousness earn N% of the amount of experience normally earned by the task. All of the player's other sleeves earn ((N/100)^2 * 100)% of the experience.",r.createElement("br",null),r.createElement("br",null),"Synchronization can be increased by assigning sleeves to the 'Synchronize' task.",r.createElement("br",null),r.createElement("br",null),r.createElement("strong",null,r.createElement("u",null,"What is Shock?")),r.createElement("br",null),"Sleeve shock is a measure of how much trauma the sleeve has due to being placed in a new body. It is a numerical value between 0 and 99, where 99 indicates full shock and 0 indicates no shock. Shock affects the amount of experience earned by the sleeve.",r.createElement("br",null),r.createElement("br",null),"Sleeve shock slowly decreases over time. You can further increase the rate at which it decreases by assigning sleeves to the 'Shock Recovery' task.",r.createElement("br",null),r.createElement("br",null),r.createElement("strong",null,r.createElement("u",null,"Why can't I work for this company or faction?")),r.createElement("br",null),"Only one of your sleeves can work for a given company/faction a time. To clarify further, if you have two sleeves they can work for two different companies, but they cannot both work for the same company.",r.createElement("br",null),r.createElement("br",null),r.createElement("strong",null,r.createElement("u",null,"Why did my Sleeve stop working?")),r.createElement("br",null),"Sleeves are subject to the same time restrictions as you. This means that they automatically stop working at a company after 8 hours, and stop working for a faction after 20 hours.",r.createElement("br",null),r.createElement("br",null),r.createElement("strong",null,r.createElement("u",null,"How do I buy Augmentations for my Sleeves?")),r.createElement("br",null),"Your Sleeve needs to have a Shock of 0 in order for you to buy Augmentations for it.",r.createElement("br",null),r.createElement("br",null),r.createElement("strong",null,r.createElement("u",null,"Why can't I buy the X Augmentation for my sleeve?")),r.createElement("br",null),"Certain Augmentations, like Bladeburner-specific ones and NeuroFlux Governor, are not available for sleeves.",r.createElement("br",null),r.createElement("br",null),r.createElement("strong",null,r.createElement("u",null,"Do sleeves get reset when installing Augmentations or switching BitNodes?")),r.createElement("br",null),"Sleeves are reset when switching BitNodes, but not when installing Augmentations.",r.createElement("br",null),r.createElement("br",null),r.createElement("strong",null,r.createElement("u",null,"What is Memory?")),r.createElement("br",null),"Sleeve memory dictates what a sleeve's synchronization will be when its reset by switching BitNodes. For example, if a sleeve has a memory of 25, then when you switch BitNodes its synchronization will initially be set to 25, rather than 1.",r.createElement("br",null),r.createElement("br",null),"Memory can only be increased by purchasing upgrades from The Covenant. It is a persistent stat, meaning it never gets resets back to 1. The maximum possible value for a sleeve's memory is 100.")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(212),a=n(10),i=n(2),o=n(8),s=n(3),l=n(37),c=n(55),u=n(27);t.createSleevePurchaseAugsPopup=function e(t,n){const m=t.augmentations.map(e=>e.name),p=r.findSleevePurchasableAugs(t,n),h="purchase-sleeve-augs-popup",d=[c.createPopupCloseButton(h,{innerText:"Cancel"}),s.createElement("p",{display:"block",innerHTML:"Owned Augmentations:"})],_=s.createElement("div",{width:"70%"});for(const e of m){const t=a.Augmentations[e];null!=t?_.appendChild(s.createElement("div",{class:"gang-owned-upgrade",innerText:e,tooltip:t.info})):console.warn(`Invalid Augmentation: ${e}`)}d.push(_);const g=s.createElement("p",{innerHTML:["You can purchase Augmentations for your Duplicate Sleeves. These Augmentations","have the same effect as they would for you. You can only purchase Augmentations","that you have unlocked through Factions.<br><br>","When purchasing an Augmentation for a Duplicate Sleeve, they are immediately","installed. This means that the Duplicate Sleeve will immediately lose all of","its stat experience."].join(" ")});d.push(g);for(const r of p){const a=s.createElement("div",{class:"cmpy-mgmt-upgrade-div"});a.appendChild(s.createElement("p",{fontSize:"12px",innerHTML:[`<h2>${r.name}</h2><br>`,`Cost: ${i.numeralWrapper.formatMoney(r.startingCost)}<br><br>`,`${r.info}`].join(" "),padding:"2px",clickListener:()=>{t.tryBuyAugmentation(n,r)?(o.dialogBoxCreate(`Installed ${r.name} on Duplicate Sleeve!`,!1),u.removeElementById(h),e(t,n)):o.dialogBoxCreate(`You cannot afford ${r.name}`,!1)}})),d.push(a)}l.createPopup(h,d)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(6),i=n(2),o=n(73);t.UniversityLocation=class extends r.Component{constructor(e){super(e),this.btnStyle={display:"block"},this.take=this.take.bind(this),this.study=this.study.bind(this),this.dataStructures=this.dataStructures.bind(this),this.networks=this.networks.bind(this),this.algorithms=this.algorithms.bind(this),this.management=this.management.bind(this),this.leadership=this.leadership.bind(this)}take(e){const t=this.props.loc;this.props.p.startClass(t.costMult,t.expMult,e)}study(){return this.take(a.CONSTANTS.ClassStudyComputerScience)}dataStructures(){return this.take(a.CONSTANTS.ClassDataStructures)}networks(){return this.take(a.CONSTANTS.ClassNetworks)}algorithms(){return this.take(a.CONSTANTS.ClassAlgorithms)}management(){return this.take(a.CONSTANTS.ClassManagement)}leadership(){return this.take(a.CONSTANTS.ClassLeadership)}render(){const e=this.props.loc.costMult,t=a.CONSTANTS.ClassDataStructuresBaseCost*e,n=a.CONSTANTS.ClassNetworksBaseCost*e,s=a.CONSTANTS.ClassAlgorithmsBaseCost*e,l=a.CONSTANTS.ClassManagementBaseCost*e,c=a.CONSTANTS.ClassLeadershipBaseCost*e;return r.createElement("div",null,r.createElement(o.StdButton,{onClick:this.study,style:this.btnStyle,text:"Study Computer Science (free)",tooltip:"Gain hacking experience!"}),r.createElement(o.StdButton,{onClick:this.dataStructures,style:this.btnStyle,text:`Take Data Structures course (${i.numeralWrapper.formatMoney(t)} / sec)`,tooltip:"Gain hacking experience!"}),r.createElement(o.StdButton,{onClick:this.networks,style:this.btnStyle,text:`Take Networks course (${i.numeralWrapper.formatMoney(n)} / sec)`,tooltip:"Gain hacking experience!"}),r.createElement(o.StdButton,{onClick:this.algorithms,style:this.btnStyle,text:`Take Algorithms course (${i.numeralWrapper.formatMoney(s)} / sec)`,tooltip:"Gain hacking experience!"}),r.createElement(o.StdButton,{onClick:this.management,style:this.btnStyle,text:`Take Management course (${i.numeralWrapper.formatMoney(l)} / sec)`,tooltip:"Gain charisma experience!"}),r.createElement(o.StdButton,{onClick:this.leadership,style:this.btnStyle,text:`Take Leadership course (${i.numeralWrapper.formatMoney(c)} / sec)`,tooltip:"Gain charisma experience!"}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(192),i=n(6),o=n(2);t.TravelAgencyLocation=class extends r.Component{constructor(e){super(e),this.btnStyle={display:"block"}}render(){const e=this;function t(t){return t.city!==e.props.p.city?r.createElement("span",{className:"tooltip",style:{color:"blue",whiteSpace:"nowrap",margin:"0px",padding:"0px"},onClick:a.createTravelPopup.bind(null,t.city,e.props.travel)},r.createElement("span",{className:"tooltiptext"},t.city),t.city[0]):r.createElement("span",null,t.city[0])}return r.createElement("div",null,r.createElement("p",null,"From here, you can travel to any other city! A ticket costs ",o.numeralWrapper.formatMoney(i.CONSTANTS.TravelCost)),r.createElement("pre",null," ,_ . ._. _. ."),r.createElement("pre",null," , _-\\','|~\\~ ~/ ;-'_ _-' ,;_;_, ~~-"),r.createElement("pre",null," /~~-\\_/-'~'--' \\~~| ', ,' / / ~|-_\\_/~/~ ~~--~~~~'--_"),r.createElement("pre",null," / ,/'-/~ '\\ ,' _ , '",r.createElement(t,{city:"Volhaven"}),",'|~ ._/-, /~"),r.createElement("pre",null," ~/-'~\\_, '-,| '|. ' ~ ,\\ /'~ / /_ /~"),r.createElement("pre",null,".-~ '| '',\\~|\\ _\\~ ,_ , ",r.createElement(t,{city:"Chongqing"})," /,"),r.createElement("pre",null," '\\ ",r.createElement(t,{city:"Sector-12"})," /'~ |_/~\\\\,-,~ \\ \" ,_,/ |"),r.createElement("pre",null," | / ._-~'\\_ _~| \\ ) ",r.createElement(t,{city:"New Tokyo"})),r.createElement("pre",null," \\ __-\\ '/ ~ |\\ \\_ / ~"),r.createElement("pre",null," ., '\\ |, ~-_ - | \\\\_' ~| /\\ \\~ ,"),r.createElement("pre",null," ~-_' _; '\\ '-, \\,' /\\/ |"),r.createElement("pre",null," '\\_,~'\\_ \\_ _, /' ' |, /|'"),r.createElement("pre",null," / \\_ ~ | / \\ ~'; -,_."),r.createElement("pre",null," | ~\\ | | , '-_, ,; ~ ~\\"),r.createElement("pre",null," \\, ",r.createElement(t,{city:"Aevum"})," / \\ / /| ,-, , -,"),r.createElement("pre",null," | ,/ | |' |/ ,- ~ \\ '."),r.createElement("pre",null," ,| ,/ \\ ,/ \\ ",r.createElement(t,{city:"Ishima"})," |"),r.createElement("pre",null," / | ~ -~~-, / _"),r.createElement("pre",null," | ,-' ~ /"),r.createElement("pre",null," / ,' ~"),r.createElement("pre",null," ',| ~"),r.createElement("pre",null," ~'"))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(192),i=n(6),o=n(101),s=n(2),l=n(231),c=n(73);t.TechVendorLocation=class extends r.Component{constructor(e){super(e),this.btnStyle={display:"block"},this.state={torPurchased:e.p.hasTorRouter()},this.createUpgradeHomeCoresPopup=this.createUpgradeHomeCoresPopup.bind(this),this.createUpgradeHomeRamPopup=this.createUpgradeHomeRamPopup.bind(this),this.purchaseTorRouter=this.purchaseTorRouter.bind(this)}createUpgradeHomeCoresPopup(){a.createUpgradeHomeCoresPopup(this.props.p)}createUpgradeHomeRamPopup(){a.createUpgradeHomeRamPopup(this.props.p)}purchaseTorRouter(){a.purchaseTorRouter(this.props.p),this.setState({torPurchased:this.props.p.hasTorRouter()})}render(){const e=this.props.loc,t=[];for(let n=e.techVendorMinRam;n<=e.techVendorMaxRam;n*=2){const e=o.getPurchaseServerCost(n);t.push(r.createElement(c.StdButton,{key:n,onClick:()=>a.createPurchaseServerPopup(n,this.props.p),style:this.btnStyle,text:`Purchase ${n}GB Server - ${s.numeralWrapper.formatMoney(e)}`}))}return r.createElement("div",null,t,this.state.torPurchased?r.createElement(l.StdButtonPurchased,{style:this.btnStyle,text:"TOR Router - Purchased"}):r.createElement(c.StdButton,{onClick:this.purchaseTorRouter,style:this.btnStyle,text:`Purchase TOR Router - ${s.numeralWrapper.formatMoney(i.CONSTANTS.TorRouterCost)}`}),r.createElement(c.StdButton,{onClick:this.createUpgradeHomeRamPopup,style:this.btnStyle,text:"Purchase additional RAM for Home computer"}),r.createElement(c.StdButton,{onClick:this.createUpgradeHomeCoresPopup,style:this.btnStyle,text:"Purchase additional Core for Home computer"}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(192),i=n(36),o=n(193),s=n(73),l=n(8);t.SpecialLocation=class extends r.Component{constructor(e){super(e),this.btnStyle={display:"block"},this.createCorporationPopup=this.createCorporationPopup.bind(this),this.handleBladeburner=this.handleBladeburner.bind(this),this.handleResleeving=this.handleResleeving.bind(this),this.state={inBladeburner:this.props.p.inBladeburner()}}createCorporationPopup(){a.createStartCorporationPopup(this.props.p)}handleBladeburner(){const e=this.props.p;if(e.inBladeburner())this.props.engine.loadBladeburnerContent();else if(e.strength>=100&&e.defense>=100&&e.dexterity>=100&&e.agility>=100){e.startBladeburner({new:!0}),l.dialogBoxCreate("You have been accepted into the Bladeburner division!"),this.setState({inBladeburner:!0});const t=document.getElementById("world-menu-header");t instanceof HTMLElement&&(t.click(),t.click())}else l.dialogBoxCreate("Rejected! Please apply again when you have 100 of each combat stat (str, def, dex, agi)")}handleResleeving(){this.props.engine.loadResleevingContent()}renderBladeburner(){if(!this.props.p.canAccessBladeburner())return null;const e=this.state.inBladeburner?"Enter Bladeburner Headquarters":"Apply to Bladeburner Division";return r.createElement(s.StdButton,{onClick:this.handleBladeburner,style:this.btnStyle,text:e})}renderCreateCorporation(){return this.props.p.canAccessCorporation()?r.createElement(o.AutoupdatingStdButton,{disabled:!this.props.p.canAccessCorporation()||this.props.p.hasCorporation(),onClick:this.createCorporationPopup,style:this.btnStyle,text:"Create a Corporation"}):null}renderResleeving(){return this.props.p.canAccessResleeving()?r.createElement(s.StdButton,{onClick:this.handleResleeving,style:this.btnStyle,text:"Re-Sleeve"}):null}render(){switch(this.props.loc.name){case i.LocationName.NewTokyoVitaLife:return this.renderResleeving();case i.LocationName.Sector12CityHall:return this.renderCreateCorporation();case i.LocationName.Sector12NSA:return this.renderBladeburner();default:console.error(`Location ${this.props.loc.name} doesn't have any special properties`)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(118),i=n(2),o=n(193);t.SlumsLocation=class extends r.Component{constructor(e){super(e),this.btnStyle={display:"block"},this.shoplift=this.shoplift.bind(this),this.robStore=this.robStore.bind(this),this.mug=this.mug.bind(this),this.larceny=this.larceny.bind(this),this.dealDrugs=this.dealDrugs.bind(this),this.bondForgery=this.bondForgery.bind(this),this.traffickArms=this.traffickArms.bind(this),this.homicide=this.homicide.bind(this),this.grandTheftAuto=this.grandTheftAuto.bind(this),this.kidnap=this.kidnap.bind(this),this.assassinate=this.assassinate.bind(this),this.heist=this.heist.bind(this)}shoplift(e){e.isTrusted&&a.Crimes.Shoplift.commit(this.props.p)}robStore(e){e.isTrusted&&a.Crimes.RobStore.commit(this.props.p)}mug(e){e.isTrusted&&a.Crimes.Mug.commit(this.props.p)}larceny(e){e.isTrusted&&a.Crimes.Larceny.commit(this.props.p)}dealDrugs(e){e.isTrusted&&a.Crimes.DealDrugs.commit(this.props.p)}bondForgery(e){e.isTrusted&&a.Crimes.BondForgery.commit(this.props.p)}traffickArms(e){e.isTrusted&&a.Crimes.TraffickArms.commit(this.props.p)}homicide(e){e.isTrusted&&a.Crimes.Homicide.commit(this.props.p)}grandTheftAuto(e){e.isTrusted&&a.Crimes.GrandTheftAuto.commit(this.props.p)}kidnap(e){e.isTrusted&&a.Crimes.Kidnap.commit(this.props.p)}assassinate(e){e.isTrusted&&a.Crimes.Assassination.commit(this.props.p)}heist(e){e.isTrusted&&a.Crimes.Heist.commit(this.props.p)}render(){const e=a.Crimes.Shoplift.successRate(this.props.p),t=a.Crimes.RobStore.successRate(this.props.p),n=a.Crimes.Mug.successRate(this.props.p),s=a.Crimes.Larceny.successRate(this.props.p),l=a.Crimes.DealDrugs.successRate(this.props.p),c=a.Crimes.BondForgery.successRate(this.props.p),u=a.Crimes.TraffickArms.successRate(this.props.p),m=a.Crimes.Homicide.successRate(this.props.p),p=a.Crimes.GrandTheftAuto.successRate(this.props.p),h=a.Crimes.Kidnap.successRate(this.props.p),d=a.Crimes.Assassination.successRate(this.props.p),_=a.Crimes.Heist.successRate(this.props.p);return r.createElement("div",null,r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.shoplift,style:this.btnStyle,text:`Shoplift (${i.numeralWrapper.formatPercentage(e)} chance of success)`,tooltip:"Attempt to shoplift from a low-end retailer"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.robStore,style:this.btnStyle,text:`Rob store (${i.numeralWrapper.formatPercentage(t)} chance of success)`,tooltip:"Attempt to commit armed robbery on a high-end store"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.mug,style:this.btnStyle,text:`Mug someone (${i.numeralWrapper.formatPercentage(n)} chance of success)`,tooltip:"Attempt to mug a random person on the street"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.larceny,style:this.btnStyle,text:`Larceny (${i.numeralWrapper.formatPercentage(s)} chance of success)`,tooltip:"Attempt to rob property from someone's house"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.dealDrugs,style:this.btnStyle,text:`Deal Drugs (${i.numeralWrapper.formatPercentage(l)} chance of success)`,tooltip:"Attempt to deal drugs"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.bondForgery,style:this.btnStyle,text:`Bond Forgery (${i.numeralWrapper.formatPercentage(c)} chance of success)`,tooltip:"Attempt to forge corporate bonds"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.traffickArms,style:this.btnStyle,text:`Traffick illegal Arms (${i.numeralWrapper.formatPercentage(u)} chance of success)`,tooltip:"Attempt to smuggle illegal arms into the city"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.homicide,style:this.btnStyle,text:`Homicide (${i.numeralWrapper.formatPercentage(m)} chance of success)`,tooltip:"Attempt to murder a random person on the street"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.grandTheftAuto,style:this.btnStyle,text:`Grand theft Auto (${i.numeralWrapper.formatPercentage(p)} chance of success)`,tooltip:"Attempt to commit grand theft auto"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.kidnap,style:this.btnStyle,text:`Kidnap and Ransom (${i.numeralWrapper.formatPercentage(h)} chance of success)`,tooltip:"Attempt to kidnap and ransom a high-profile-target"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.assassinate,style:this.btnStyle,text:`Assassinate (${i.numeralWrapper.formatPercentage(d)} chance of success)`,tooltip:"Attempt to assassinate a high-profile target"}),r.createElement(o.AutoupdatingStdButton,{intervalTime:5e3,onClick:this.heist,style:this.btnStyle,text:`Heist (${i.numeralWrapper.formatPercentage(_)} chance of success)`,tooltip:"Attempt to pull off the ultimate heist"}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(6),i=n(2),o=n(193),s=n(8);t.HospitalLocation=class extends r.Component{constructor(e){super(e),this.btnStyle={display:"block"},this.getCost=this.getCost.bind(this),this.getHealed=this.getHealed.bind(this),this.state={currHp:this.props.p.hp}}getCost(){return(this.props.p.max_hp-this.props.p.hp)*a.CONSTANTS.HospitalCostPerHp}getHealed(e){if(!e.isTrusted)return;if(this.props.p.hp<0&&(this.props.p.hp=0),this.props.p.hp>=this.props.p.max_hp)return;const t=this.getCost();this.props.p.loseMoney(t),this.props.p.hp=this.props.p.max_hp,this.setState({currHp:this.props.p.hp}),s.dialogBoxCreate(`You were healed to full health! The hospital billed you for ${i.numeralWrapper.formatMoney(t)}`)}render(){const e=this.getCost();return r.createElement(o.AutoupdatingStdButton,{onClick:this.getHealed,style:this.btnStyle,text:`Get treatment for wounds - ${i.numeralWrapper.formatMoney(e)}`})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(6),i=n(2),o=n(73);t.GymLocation=class extends r.Component{constructor(e){super(e),this.btnStyle={display:"block"},this.trainStrength=this.trainStrength.bind(this),this.trainDefense=this.trainDefense.bind(this),this.trainDexterity=this.trainDexterity.bind(this),this.trainAgility=this.trainAgility.bind(this)}train(e){const t=this.props.loc;this.props.p.startClass(t.costMult,t.expMult,e)}trainStrength(){return this.train(a.CONSTANTS.ClassGymStrength)}trainDefense(){return this.train(a.CONSTANTS.ClassGymDefense)}trainDexterity(){return this.train(a.CONSTANTS.ClassGymDexterity)}trainAgility(){return this.train(a.CONSTANTS.ClassGymAgility)}render(){const e=this.props.loc.costMult,t=a.CONSTANTS.ClassGymBaseCost*e;return r.createElement("div",null,r.createElement(o.StdButton,{onClick:this.trainStrength,style:this.btnStyle,text:`Train Strength (${i.numeralWrapper.formatMoney(t)} / sec)`}),r.createElement(o.StdButton,{onClick:this.trainDefense,style:this.btnStyle,text:`Train Defense (${i.numeralWrapper.formatMoney(t)} / sec)`}),r.createElement(o.StdButton,{onClick:this.trainDexterity,style:this.btnStyle,text:`Train Dexterity (${i.numeralWrapper.formatMoney(t)} / sec)`}),r.createElement(o.StdButton,{onClick:this.trainAgility,style:this.btnStyle,text:`Train Agility (${i.numeralWrapper.formatMoney(t)} / sec)`}))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"beginInfiltration",function(){return d});var r=n(19),a=n(6),i=n(12),o=n(0),s=n(8),l=n(29),c=n(15),u=n(277),m=n(7);let p={Guards:"You see an armed security guard patrolling the area.",TechOnly:"The area is equipped with a state-of-the-art security system: cameras, laser tripwires, and sentry turrets.",TechOrLockedDoor:"The area is equipped with a state-of-the-art security system. There is a locked door on the side of the room that can be used to bypass security.",Bots:"You see a few security bots patrolling the area."};function h(e,t,n,r,a){this.companyName=e,this.clearanceLevel=0,this.maxClearanceLevel=r,this.securityLevel=t,this.difficulty=a,this.baseValue=n,this.secretsStolen=[],this.hackingExpGained=0,this.strExpGained=0,this.defExpGained=0,this.dexExpGained=0,this.agiExpGained=0,this.chaExpGained=0,this.intExpGained=0}function d(e,t,n,r,a){var i=new h(e,t,n,r,a);document.getElementById("infiltration-status-text").innerHTML="",g(i)}function _(e,t){t&&Object(u.a)(e),Object(l.clearEventListeners)("infiltration-kill"),Object(l.clearEventListeners)("infiltration-knockout"),Object(l.clearEventListeners)("infiltration-stealthknockout"),Object(l.clearEventListeners)("infiltration-assassinate"),Object(l.clearEventListeners)("infiltration-hacksecurity"),Object(l.clearEventListeners)("infiltration-destroysecurity"),Object(l.clearEventListeners)("infiltration-sneak"),Object(l.clearEventListeners)("infiltration-pickdoor"),Object(l.clearEventListeners)("infiltration-bribe"),Object(l.clearEventListeners)("infiltration-escape"),i.Engine.loadLocationContent(!1)}function g(e){++e.clearanceLevel,b(e);var t=Object(l.clearEventListeners)("infiltration-kill"),n=Object(l.clearEventListeners)("infiltration-knockout"),r=Object(l.clearEventListeners)("infiltration-stealthknockout"),i=Object(l.clearEventListeners)("infiltration-assassinate"),s=Object(l.clearEventListeners)("infiltration-hacksecurity"),u=Object(l.clearEventListeners)("infiltration-destroysecurity"),h=Object(l.clearEventListeners)("infiltration-sneak"),d=Object(l.clearEventListeners)("infiltration-pickdoor"),g=Object(l.clearEventListeners)("infiltration-bribe"),v=Object(l.clearEventListeners)("infiltration-escape");t.style.display="none",n.style.display="none",r.style.display="none",i.style.display="none",s.style.display="none",u.style.display="none",h.style.display="none",d.style.display="none",g.style.display="none",v.style.display="none";var C=null;switch(Object(c.getRandomInt)(0,5)){case 1:C=p.TechOnly,s.style.display="block",u.style.display="block",h.style.display="block",v.style.display="block";break;case 2:C=p.TechOrLockedDoor,s.style.display="block",u.style.display="block",h.style.display="block",d.style.display="block",v.style.display="block";break;case 3:C=p.Bots,t.style.display="block",t.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=k(e);if(n[0])return f("You <span class='success'>SUCCESSFULLY</span> killed the security bots! Unfortunately you alerted the rest of the facility's security. The facility's security level increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),o.Player.karma-=1,y(e),!1;var r=Math.max(1,Math.round(1.5*e.securityLevel/o.Player.defense));f("You <span class='failure'>FAILED</span> to kill the security bots. The bots fight back and raise the alarm! You take "+r+" damage and the facility's security level increases by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),o.Player.takeDamage(r)&&_(e,!1),E(e,C),b(e)}),i.style.display="block",i.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=S(e);if(n[0])return f("You <span class='success'>SUCCESSFULLY</span> assassinated the security bots without being detected!"),o.Player.karma-=1,y(e),!1;f("You <span class='failure'>FAILED</span> to assassinate the security bots. The bots have not detected you but are now more alert for an intruder. The facility's security level has increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),E(e,C),b(e)}),s.style.display="block",h.style.display="block",v.style.display="block";break;default:C=p.Guards,t.style.display="block",t.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=k(e);if(n[0])return f("You <span class='success'>SUCCESSFULLY</span> killed the security guard! Unfortunately you alerted the rest of the facility's security. The facility's security level has increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),o.Player.karma-=3,++o.Player.numPeopleKilled,y(e),!1;var r=Math.max(1,Math.round(e.securityLevel/o.Player.defense));f("You <span class='failure'>FAILED</span> to kill the security guard. The guard fights back and raises the alarm! You take "+r+" damage and the facility's security level has increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),o.Player.takeDamage(r)&&_(e,!1),E(e,C),b(e)}),n.style.display="block",r.style.display="block",i.style.display="block",i.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=S(e);if(n[0])return f("You <span class='success'>SUCCESSFULLY</span> assassinated the security guard without being detected!"),o.Player.karma-=3,++o.Player.numPeopleKilled,y(e),!1;f("You <span class='failure'>FAILED</span> to assassinate the security guard. The guard has not detected you but is now more alert for an intruder. The facility's security level has increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),E(e,C),b(e)}),h.style.display="block",g.style.display="block",v.style.display="block"}n.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=function(e){var t=T(e);return e.gainStrengthExp(e.securityLevel/70),o.Player.strength_exp_mult,e.gainDefenseExp(e.securityLevel/70),o.Player.defense_exp_mult,e.gainDexterityExp(e.securityLevel/70),o.Player.dexterity_exp_mult,e.gainAgilityExp(e.securityLevel/70),o.Player.agility_exp_mult,Math.random()<=t?(e.securityLevel*=1.03,[!0,1.03]):(e.securityLevel*=1.1,[!1,1.1])}(e);if(n[0])return f("You <span class='success'>SUCCESSFULLY</span> knocked out the security guard! Unfortunately you made a lot of noise and alerted other security."),f("The facility's security level increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),y(e),!1;var r=Math.max(1,Math.round(e.securityLevel/o.Player.defense));return f("You <span class='failure'>FAILED</span> to knockout the security guard. The guard raises the alarm and fights back! You take "+r+" damage and the facility's security level increases by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),o.Player.takeDamage(r)&&_(e,!1),E(e,C),b(e),!1}),r.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=function(e){var t=P(e);return e.gainStrengthExp(e.securityLevel/75),o.Player.strength_exp_mult,e.gainDexterityExp(e.securityLevel/60),o.Player.dexterity_exp_mult,e.gainAgilityExp(e.securityLevel/60),o.Player.agility_exp_mult,Math.random()<=t?[!0,1]:(e.securityLevel*=1.1,[!1,1.1])}(e);if(n[0])return f("You <span class='success'>SUCCESSFULLY</span> knocked out the security guard without making any noise!"),y(e),!1;var r=Math.max(1,Math.round(e.securityLevel/o.Player.defense));return f("You <span class='failure'>FAILED</span> to stealthily knockout the security guard. The guard raises the alarm and fights back! You take "+r+" damage and the facility's security level increases by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),o.Player.takeDamage(r)&&_(e,!1),E(e,C),b(e),!1}),s.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=function(e){var t=x(e);return e.gainHackingExp(e.securityLevel/30),o.Player.hacking_exp_mult,e.gainIntelligenceExp(e.securityLevel/680),Math.random()<=t?(e.securityLevel*=1.03,[!0,1.03]):(e.securityLevel*=1.05,[!1,1.05])}(e);return n[0]?(f("You <span class='success'>SUCCESSFULLY</span> hacked and disabled the security system!"),f("The facility's security level increased by "+(100*n[1]-100).toString()+"%"),y(e),!1):(f("You <span class='failure'>FAILED</span> to hack the security system. The facility's security level increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),E(e,C),b(e),!1)}),u.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=function(e){var t=M(e);return e.gainStrengthExp(e.securityLevel/75),o.Player.strength_exp_mult,e.gainDefenseExp(e.securityLevel/75),o.Player.defense_exp_mult,e.gainDexterityExp(e.securityLevel/75),o.Player.dexterity_exp_mult,e.gainAgilityExp(e.securityLevel/75),o.Player.agility_exp_mult,Math.random()<=t?(e.securityLevel*=1.05,[!0,1.05]):(e.securityLevel*=1.1,[!1,1.1])}(e);return n[0]?(f("You <span class='success'>SUCCESSFULLY</span> and violently destroy the security system!"),f("The facility's security level increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),y(e),!1):(f("You <span class='failure'>FAILED</span> to destroy the security system. The facility's security level increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),E(e,C),b(e),!1)}),h.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=function(e){var t=w(e);return e.gainAgilityExp(e.securityLevel/30),o.Player.agility_exp_mult,Math.random()<=t?[!0,1]:(e.securityLevel*=1.08,[!1,1.08])}(e);return n[0]?(f("You <span class='success'>SUCCESSFULLY</span> sneak past the security undetected!"),y(e),!1):(f("You <span class='failure'>FAILED</span> and were detected while trying to sneak past security! The facility's security level increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),E(e,C),b(e),!1)}),d.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=function(e){var t=A(e);return e.gainDexterityExp(e.securityLevel/25),o.Player.dexterity_exp_mult,Math.random()<=t?(e.securityLevel*=1.01,[!0,1.01]):(e.securityLevel*=1.03,[!1,1.03])}(e);return n[0]?(f("You <span class='success'>SUCCESSFULLY</span> pick the locked door!"),f("The facility's security level increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),y(e),!1):(f("You <span class='failure'>FAILED</span> to pick the locked door. The facility's security level increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),E(e,C),b(e),!1)}),g.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=a.CONSTANTS.InfiltrationBribeBaseAmount*e.clearanceLevel;if(o.Player.money.lt(n))return f("You do not have enough money to bribe the guard. You need $"+n),!1;var r=function(e){var t=N(e);return e.gainCharismaExp(e.securityLevel/8),o.Player.charisma_exp_mult,Math.random()<=t?[!0,1]:(e.securityLevel*=1.15,[!1,1.15])}(e);return r[0]?(f("You <span class='success'>SUCCESSFULLY</span> bribed a guard to let you through to the next clearance level for $"+n),o.Player.loseMoney(n),y(e),!1):(f("You <span class='failure'>FAILED</span> to bribe a guard! The guard is alerting other security guards about your presence! The facility's security level increased by "+Object(m.formatNumber)(100*r[1]-100,2).toString()+"%"),E(e,C),b(e),!1)}),v.addEventListener("click",function(t){if(!t.isTrusted)return!1;var n=function(e){var t=R(e);return e.gainAgilityExp(e.securityLevel/30),o.Player.agility_exp_mult,e.gainDexterityExp(e.securityLevel/30),o.Player.dexterity_exp_mult,Math.random()<=t?[!0,1]:(e.securityLevel*=1.05,[!1,1.05])}(e);return n[0]?(f("You <span class='success'>SUCCESSFULLY</span> escape from the facility with the stolen classified documents and company secrets!"),_(e,!0),!1):(f("You <span class='failure'>FAILED</span> to escape from the facility. You took 1 damage. The facility's security level increased by "+Object(m.formatNumber)(100*n[1]-100,2).toString()+"%"),o.Player.takeDamage(1)&&_(e,!1),E(e,C),b(e),!1)}),E(e,C),f(""),f("You are now on clearance level "+e.clearanceLevel+".<br>"+C)}function y(e){if(e.clearanceLevel%5==0){var t=e.baseValue*e.clearanceLevel/2,n=t*o.Player.faction_rep_mult*a.CONSTANTS.InfiltrationRepValue*r.BitNodeMultipliers.InfiltrationRep,i=t*a.CONSTANTS.InfiltrationMoneyValue*r.BitNodeMultipliers.InfiltrationMoney;e.secretsStolen.push(t),Object(s.dialogBoxCreate)("You found and stole a set of classified documents from the company. These classified secrets could probably be sold for money (<span class='money-gold'>$"+Object(m.formatNumber)(i,2)+"</span>), or they could be given to factions for reputation (<span class='light-yellow'>"+Object(m.formatNumber)(n,3)+" rep</span>)")}e.securityLevel*=1+e.difficulty/100,f("You move on to the facility's next clearance level. This clearance level has "+e.difficulty+"% higher security"),e.clearanceLevel>=e.maxClearanceLevel?_(e,!0):g(e)}function f(e){var t=document.getElementById("infiltration-status-text");t.innerHTML+=e+"<br>",t.parentElement.scrollTop=t.scrollHeight}function b(e){for(var t=0,n=0,i=0;i<e.secretsStolen.length;++i)t+=e.secretsStolen[i]*o.Player.faction_rep_mult*a.CONSTANTS.InfiltrationRepValue*r.BitNodeMultipliers.InfiltrationRep,n+=e.secretsStolen[i]*a.CONSTANTS.InfiltrationMoneyValue*r.BitNodeMultipliers.InfiltrationMoney;e.clearanceLevel,e.maxClearanceLevel;document.getElementById("infiltration-level-text").innerHTML="Facility name: "+e.companyName+"<br>Clearance Level: "+e.clearanceLevel+"<br>Security Level: "+Object(m.formatNumber)(e.securityLevel,3)+"<br><br>Total value of stolen secrets<br>Reputation: <span class='light-yellow'>"+Object(m.formatNumber)(t,3)+"</span><br>Money: <span class='money-gold'>$"+Object(m.formatNumber)(n,2)+"</span><br><br>Hack exp gained: "+Object(m.formatNumber)(e.calcGainedHackingExp(),3)+"<br>Str exp gained: "+Object(m.formatNumber)(e.calcGainedStrengthExp(),3)+"<br>Def exp gained: "+Object(m.formatNumber)(e.calcGainedDefenseExp(),3)+"<br>Dex exp gained: "+Object(m.formatNumber)(e.calcGainedDexterityExp(),3)+"<br>Agi exp gained: "+Object(m.formatNumber)(e.calcGainedAgilityExp(),3)+"<br>Cha exp gained: "+Object(m.formatNumber)(e.calcGainedCharismaExp(),3)}function E(e,t){var n=C(e),r=T(e),a=P(e),i=O(e),o=M(e),s=x(e),l=w(e),c=A(e),u=N(e),h=R(e);switch(document.getElementById("infiltration-escape").innerHTML="Escape<span class='tooltiptext'>Attempt to escape the facility with the classified secrets and documents you have stolen. You have a "+Object(m.formatNumber)(100*h,2)+"% chance of success. If you fail, the security level will increase by 5%.</span>",t){case p.TechOrLockedDoor:document.getElementById("infiltration-pickdoor").innerHTML="Lockpick<span class='tooltiptext'>Attempt to pick the locked door. You have a "+Object(m.formatNumber)(100*c,2)+"% chance of success. If you succeed, the security level will increased by 1%. If you fail, the security level will increase by 3%.</span>";case p.TechOnly:document.getElementById("infiltration-hacksecurity").innerHTML="Hack<span class='tooltiptext'>Attempt to hack and disable the security system. You have a "+Object(m.formatNumber)(100*s,2)+"% chance of success. If you succeed, the security level will increase by 3%. If you fail, the security level will increase by 5%.</span>",document.getElementById("infiltration-destroysecurity").innerHTML="Destroy security<span class='tooltiptext'>Attempt to violently destroy the security system. You have a "+Object(m.formatNumber)(100*o,2)+"% chance of success. If you succeed, the security level will increase by 5%. If you fail, the security level will increase by 10%. </span>",document.getElementById("infiltration-sneak").innerHTML="Sneak<span class='tooltiptext'>Attempt to sneak past the security system. You have a "+Object(m.formatNumber)(100*l,2)+"% chance of success. If you fail, the security level will increase by 8%. </span>";break;case p.Bots:document.getElementById("infiltration-kill").innerHTML="Destroy bots<span class='tooltiptext'>Attempt to destroy the security bots through combat. You have a "+Object(m.formatNumber)(100*n,2)+"% chance of success. If you succeed, the security level will increase by 5%. If you fail, the security level will increase by 10%. </span>",document.getElementById("infiltration-assassinate").innerHTML="Assassinate bots<span class='tooltiptext'>Attempt to stealthily destroy the security bots through assassination. You have a "+Object(m.formatNumber)(100*i,2)+"% chance of success. If you fail, the security level will increase by 10%. </span>",document.getElementById("infiltration-hacksecurity").innerHTML="Hack bots<span class='tooltiptext'>Attempt to disable the security bots by hacking them. You have a "+Object(m.formatNumber)(100*s,2)+"% chance of success. If you succeed, the security level will increase by 3%. If you fail, the security level will increase by 5%. </span>",document.getElementById("infiltration-sneak").innerHTML="Sneak<span class='tooltiptext'>Attempt to sneak past the security bots. You have a "+Object(m.formatNumber)(100*l,2)+"% chance of success. If you fail, the security level will increase by 8%. </span>";break;case p.Guards:default:document.getElementById("infiltration-kill").innerHTML="Kill<span class='tooltiptext'>Attempt to kill the security guard. You have a "+Object(m.formatNumber)(100*n,2)+"% chance of success. If you succeed, the security level will increase by 5%. If you fail, the security level will decrease by 10%. </span>",document.getElementById("infiltration-knockout").innerHTML="Knockout<span class='tooltiptext'>Attempt to knockout the security guard. You have a "+Object(m.formatNumber)(100*r,2)+"% chance of success. If you succeed, the security level will increase by 3%. If you fail, the security level will increase by 10%. </span>",document.getElementById("infiltration-stealthknockout").innerHTML="Stealth Knockout<span class='tooltiptext'>Attempt to stealthily knockout the security guard. You have a "+Object(m.formatNumber)(100*a,2)+"% chance of success. If you fail, the security level will increase by 10%. </span>",document.getElementById("infiltration-assassinate").innerHTML="Assassinate<span class='tooltiptext'>Attempt to assassinate the security guard. You have a "+Object(m.formatNumber)(100*i,2)+"% chance of success. If you fail, the security level will increase by 5%. </span>",document.getElementById("infiltration-sneak").innerHTML="Sneak<span class='tooltiptext'>Attempt to sneak past the security guard. You have a "+Object(m.formatNumber)(100*l,2)+"% chance of success. If you fail, the security level will increase by 8%. </span>",document.getElementById("infiltration-bribe").innerHTML="Bribe<span class='tooltiptext'>Attempt to bribe the security guard. You have a "+Object(m.formatNumber)(100*u,2)+"% chance of success. If you fail, the security level will increase by 15%. </span>"}}h.prototype.expMultiplier=function(){return!this.clearanceLevel||isNaN(this.clearanceLevel)||!this.maxClearanceLevel||isNaN(this.maxClearanceLevel)?1:2.5*this.clearanceLevel/this.maxClearanceLevel},h.prototype.gainHackingExp=function(e){isNaN(e)||(this.hackingExpGained+=e)},h.prototype.calcGainedHackingExp=function(){return!this.hackingExpGained||isNaN(this.hackingExpGained)?0:Math.pow(this.hackingExpGained*this.expMultiplier(),a.CONSTANTS.InfiltrationExpPow)},h.prototype.gainStrengthExp=function(e){isNaN(e)||(this.strExpGained+=e)},h.prototype.calcGainedStrengthExp=function(){return!this.strExpGained||isNaN(this.strExpGained)?0:Math.pow(this.strExpGained*this.expMultiplier(),a.CONSTANTS.InfiltrationExpPow)},h.prototype.gainDefenseExp=function(e){isNaN(e)||(this.defExpGained+=e)},h.prototype.calcGainedDefenseExp=function(){return!this.defExpGained||isNaN(this.defExpGained)?0:Math.pow(this.defExpGained*this.expMultiplier(),a.CONSTANTS.InfiltrationExpPow)},h.prototype.gainDexterityExp=function(e){isNaN(e)||(this.dexExpGained+=e)},h.prototype.calcGainedDexterityExp=function(){return!this.dexExpGained||isNaN(this.dexExpGained)?0:Math.pow(this.dexExpGained*this.expMultiplier(),a.CONSTANTS.InfiltrationExpPow)},h.prototype.gainAgilityExp=function(e){isNaN(e)||(this.agiExpGained+=e)},h.prototype.calcGainedAgilityExp=function(){return!this.agiExpGained||isNaN(this.agiExpGained)?0:Math.pow(this.agiExpGained*this.expMultiplier(),a.CONSTANTS.InfiltrationExpPow)},h.prototype.gainCharismaExp=function(e){isNaN(e)||(this.chaExpGained+=e)},h.prototype.calcGainedCharismaExp=function(){return!this.chaExpGained||isNaN(this.chaExpGained)?0:Math.pow(this.chaExpGained*this.expMultiplier(),a.CONSTANTS.InfiltrationExpPow)},h.prototype.gainIntelligenceExp=function(e){isNaN(e)||(this.intExpGained+=e)},h.prototype.calcGainedIntelligenceExp=function(){return!this.intExpGained||isNaN(this.intExpGained)?0:Math.pow(this.intExpGained*this.expMultiplier(),a.CONSTANTS.InfiltrationExpPow)};let v=a.CONSTANTS.IntelligenceInfiltrationWeight;function k(e){var t=C(e);return e.gainStrengthExp(e.securityLevel/75),o.Player.strength_exp_mult,e.gainDefenseExp(e.securityLevel/75),o.Player.defense_exp_mult,e.gainDexterityExp(e.securityLevel/75),o.Player.dexterity_exp_mult,e.gainAgilityExp(e.securityLevel/75),o.Player.agility_exp_mult,Math.random()<=t?(e.securityLevel*=1.05,[!0,1.05]):(e.securityLevel*=1.1,[!1,1.1])}function C(e){var t=e.securityLevel;return Math.min(.95,(o.Player.strength+o.Player.dexterity+o.Player.agility)/(1.45*t))}function T(e){var t=e.securityLevel;return Math.min(.95,(o.Player.strength+o.Player.dexterity+o.Player.agility)/(1.7*t))}function P(e){var t=e.securityLevel;return Math.min(.95,(.55*o.Player.strength+2*o.Player.dexterity+2*o.Player.agility+v*o.Player.intelligence)/(3*t))}function S(e){var t=O(e);return e.gainStrengthExp(e.securityLevel/75),o.Player.strength_exp_mult,e.gainDexterityExp(e.securityLevel/55),o.Player.dexterity_exp_mult,e.gainAgilityExp(e.securityLevel/55),o.Player.agility_exp_mult,Math.random()<=t?[!0,1]:(e.securityLevel*=1.05,[!1,1.05])}function O(e){var t=e.securityLevel;return Math.min(.95,(o.Player.dexterity+.5*o.Player.agility+v*o.Player.intelligence)/(2*t))}function M(e){var t=e.securityLevel;return Math.min(.95,(o.Player.strength+o.Player.dexterity+o.Player.agility)/(2*t))}function x(e){var t=e.securityLevel;return Math.min(.95,(o.Player.hacking_skill+v*o.Player.intelligence)/t)}function w(e){var t=e.securityLevel;return Math.min(.95,(o.Player.agility+.5*o.Player.dexterity+v*o.Player.intelligence)/(2*t))}function A(e){var t=e.securityLevel;return Math.min(.95,(o.Player.dexterity+v*o.Player.intelligence)/t)}function N(e){var t=e.securityLevel;return Math.min(.95,o.Player.charisma/t)}function R(e){var t=e.securityLevel;return Math.min(.95,(2*o.Player.agility+o.Player.dexterity+v*o.Player.intelligence)/t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(175),i=n(73);t.ApplyToJobButton=class extends r.Component{constructor(e){super(e),this.getJobRequirementTooltip=this.getJobRequirementTooltip.bind(this)}getJobRequirementTooltip(){const e=this.props.p.getNextCompanyPosition(this.props.company,this.props.entryPosType);return null==e?"":this.props.company.hasPosition(e)?a.getJobRequirementText(this.props.company,e,!0):""}render(){return r.createElement(i.StdButton,{onClick:this.props.onClick,style:this.props.style,text:this.props.text,tooltip:this.getJobRequirementTooltip()})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(404),i=n(169),o=n(403),s=n(25),l=n(140),c=n(47),u=n(53),m=n(2),p=n(73);t.CompanyLocation=class extends r.Component{constructor(e){if(super(e),this.companyPosition=null,this.jobTitle=null,this.btnStyle={display:"block"},this.applyForAgentJob=this.applyForAgentJob.bind(this),this.applyForBusinessConsultantJob=this.applyForBusinessConsultantJob.bind(this),this.applyForBusinessJob=this.applyForBusinessJob.bind(this),this.applyForEmployeeJob=this.applyForEmployeeJob.bind(this),this.applyForItJob=this.applyForItJob.bind(this),this.applyForPartTimeEmployeeJob=this.applyForPartTimeEmployeeJob.bind(this),this.applyForPartTimeWaiterJob=this.applyForPartTimeWaiterJob.bind(this),this.applyForSecurityJob=this.applyForSecurityJob.bind(this),this.applyForSoftwareConsultantJob=this.applyForSoftwareConsultantJob.bind(this),this.applyForSoftwareJob=this.applyForSoftwareJob.bind(this),this.applyForWaiterJob=this.applyForWaiterJob.bind(this),this.startInfiltration=this.startInfiltration.bind(this),this.work=this.work.bind(this),this.location=i.Locations[e.locName],null==this.location)throw new Error(`CompanyLocation component constructed with invalid location: ${e.locName}`);if(this.company=s.Companies[e.locName],null==this.company)throw new Error(`CompanyLocation component constructed with invalid company: ${e.locName}`);this.state={employedHere:!1},this.checkIfEmployedHere(!1)}applyForAgentJob(e){if(!e.isTrusted)return!1;this.props.p.applyForAgentJob(),this.checkIfEmployedHere(!0)}applyForBusinessConsultantJob(e){if(!e.isTrusted)return!1;this.props.p.applyForBusinessConsultantJob(),this.checkIfEmployedHere(!0)}applyForBusinessJob(e){if(!e.isTrusted)return!1;this.props.p.applyForBusinessJob(),this.checkIfEmployedHere(!0)}applyForEmployeeJob(e){if(!e.isTrusted)return!1;this.props.p.applyForEmployeeJob(),this.checkIfEmployedHere(!0)}applyForItJob(e){if(!e.isTrusted)return!1;this.props.p.applyForItJob(),this.checkIfEmployedHere(!0)}applyForPartTimeEmployeeJob(e){if(!e.isTrusted)return!1;this.props.p.applyForPartTimeEmployeeJob(),this.checkIfEmployedHere(!0)}applyForPartTimeWaiterJob(e){if(!e.isTrusted)return!1;this.props.p.applyForPartTimeWaiterJob(),this.checkIfEmployedHere(!0)}applyForSecurityJob(e){if(!e.isTrusted)return!1;this.props.p.applyForSecurityJob(),this.checkIfEmployedHere(!0)}applyForSoftwareConsultantJob(e){if(!e.isTrusted)return!1;this.props.p.applyForSoftwareConsultantJob(),this.checkIfEmployedHere(!0)}applyForSoftwareJob(e){if(!e.isTrusted)return!1;this.props.p.applyForSoftwareJob(),this.checkIfEmployedHere(!0)}applyForWaiterJob(e){if(!e.isTrusted)return!1;this.props.p.applyForWaiterJob(),this.checkIfEmployedHere(!0)}checkIfEmployedHere(e=!1){this.jobTitle=this.props.p.jobs[this.props.locName],null!=this.jobTitle&&(this.companyPosition=c.CompanyPositions[this.jobTitle]),e&&this.setState({employedHere:null!=this.jobTitle})}startInfiltration(e){if(!e.isTrusted)return!1;const t=this.location;this.props.engine.loadInfiltrationContent();const n=t.infiltrationData;if(null==n)return!1;o.beginInfiltration(this.props.locName,n.startingSecurityLevel,n.baseRewardValue,n.maxClearanceLevel,n.difficulty)}work(e){if(!e.isTrusted)return!1;const t=this.companyPosition;t instanceof l.CompanyPosition&&(t.isPartTimeJob()||t.isSoftwareConsultantJob()||t.isBusinessConsultantJob()?this.props.p.startWorkPartTime(this.props.locName):this.props.p.startWork(this.props.locName))}render(){const e=null!=this.jobTitle,t=this.company.getFavorGain();return r.createElement("div",null,e&&r.createElement("div",null,r.createElement("p",null,"Job Title: ",this.jobTitle),r.createElement("p",null,"--------------------"),r.createElement("p",{className:"tooltip"},"Company reputation: ",m.numeralWrapper.format(this.company.playerReputation,"0,0.000"),r.createElement("span",{className:"tooltiptext"},"You will earn ",m.numeralWrapper.format(t[0],"0,0")," company favor upon resetting after installing Augmentations")),r.createElement("p",null,"--------------------"),r.createElement("p",{className:"tooltip"},"Company Favor: ",m.numeralWrapper.format(this.company.favor,"0,0"),r.createElement("span",{className:"tooltiptext"},"Company favor increases the rate at which you earn reputation for this company by 1% per favor. Company favor is gained whenever you reset after installing Augmentations. The amount of favor you gain depends on how much reputation you have with the comapny.")),r.createElement(p.StdButton,{id:"foo-work-button-id",onClick:this.work,style:this.btnStyle,text:"Work"})),this.company.hasAgentPositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.AgentCompanyPositions[0]],onClick:this.applyForAgentJob,p:this.props.p,style:this.btnStyle,text:"Apply for Agent Job"}),this.company.hasBusinessConsultantPositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.BusinessConsultantCompanyPositions[0]],onClick:this.applyForBusinessConsultantJob,p:this.props.p,style:this.btnStyle,text:"Apply for Business Consultant Job"}),this.company.hasBusinessPositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.BusinessCompanyPositions[0]],onClick:this.applyForBusinessJob,p:this.props.p,style:this.btnStyle,text:"Apply for Business Job"}),this.company.hasEmployeePositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.MiscCompanyPositions[1]],onClick:this.applyForEmployeeJob,p:this.props.p,style:this.btnStyle,text:"Apply to be an Employee"}),this.company.hasEmployeePositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.PartTimeCompanyPositions[1]],onClick:this.applyForPartTimeEmployeeJob,p:this.props.p,style:this.btnStyle,text:"Apply to be a part-time Employee"}),this.company.hasITPositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.ITCompanyPositions[0]],onClick:this.applyForItJob,p:this.props.p,style:this.btnStyle,text:"Apply for IT Job"}),this.company.hasSecurityPositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.SecurityCompanyPositions[2]],onClick:this.applyForSecurityJob,p:this.props.p,style:this.btnStyle,text:"Apply for Security Job"}),this.company.hasSoftwareConsultantPositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.SoftwareConsultantCompanyPositions[0]],onClick:this.applyForSoftwareConsultantJob,p:this.props.p,style:this.btnStyle,text:"Apply for Software Consultant Job"}),this.company.hasSoftwarePositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.SoftwareCompanyPositions[0]],onClick:this.applyForSoftwareJob,p:this.props.p,style:this.btnStyle,text:"Apply for Software Job"}),this.company.hasWaiterPositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.MiscCompanyPositions[0]],onClick:this.applyForWaiterJob,p:this.props.p,style:this.btnStyle,text:"Apply to be a Waiter"}),this.company.hasWaiterPositions()&&r.createElement(a.ApplyToJobButton,{company:this.company,entryPosType:c.CompanyPositions[u.PartTimeCompanyPositions[0]],onClick:this.applyForPartTimeWaiterJob,p:this.props.p,style:this.btnStyle,text:"Apply to be a part-time Waiter"}),null!=this.location.infiltrationData&&r.createElement(p.StdButton,{onClick:this.startInfiltration,style:this.btnStyle,text:"Infiltrate Company"}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(405),i=n(402),o=n(401),s=n(400),l=n(399),c=n(398),u=n(397),m=n(396),p=n(194),h=n(73);t.GenericLocation=class extends r.Component{constructor(e){super(e),this.btnStyle={display:"block"}}getLocationSpecificContent(){const e=[];return this.props.loc.types.includes(p.LocationType.Company)&&e.push(r.createElement(a.CompanyLocation,{engine:this.props.engine,key:"companylocation",locName:this.props.loc.name,p:this.props.p})),this.props.loc.types.includes(p.LocationType.Gym)&&e.push(r.createElement(i.GymLocation,{key:"gymlocation",loc:this.props.loc,p:this.props.p})),this.props.loc.types.includes(p.LocationType.Hospital)&&e.push(r.createElement(o.HospitalLocation,{key:"hospitallocation",p:this.props.p})),this.props.loc.types.includes(p.LocationType.Slums)&&e.push(r.createElement(s.SlumsLocation,{key:"slumslocation",p:this.props.p})),this.props.loc.types.includes(p.LocationType.Special)&&e.push(r.createElement(l.SpecialLocation,{engine:this.props.engine,key:"speciallocation",loc:this.props.loc,p:this.props.p})),this.props.loc.types.includes(p.LocationType.TechVendor)&&e.push(r.createElement(c.TechVendorLocation,{key:"techvendorlocation",loc:this.props.loc,p:this.props.p})),this.props.loc.types.includes(p.LocationType.TravelAgency)&&e.push(r.createElement(u.TravelAgencyLocation,{key:"travelagencylocation",p:this.props.p,travel:this.props.travel})),this.props.loc.types.includes(p.LocationType.University)&&e.push(r.createElement(m.UniversityLocation,{key:"universitylocation",loc:this.props.loc,p:this.props.p})),e}render(){const e=this.getLocationSpecificContent();return r.createElement("div",null,r.createElement(h.StdButton,{onClick:this.props.returnToCity,style:this.btnStyle,text:"Return to World"}),r.createElement("h1",null,this.props.loc.name),e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.LocationCity=class extends r.Component{render(){const e=this,t=this.props;function n(n){return n?r.createElement("span",{key:n,className:"tooltip",style:{color:"blue",whiteSpace:"nowrap",margin:"0px",padding:"0px",cursor:"pointer"},onClick:t.enterLocation.bind(e,n)},"X"):r.createElement("span",null,"*")}const a=/[A-Z]/g,i={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25};function o(t){let r,o=[],s=[];for(;null!==(r=a.exec(t));)s.push(r);if(0===s.length)return o.push(t),o;for(let r=0;r<s.length;r++){const a=0===r?0:s[r-1].index+1,l=s[r].index;o.push(t.slice(a,l));const c=i[t[s[r].index]];o.push(n(e.props.city.locations[c]))}return o.push(t.slice(s[s.length-1].index+1)),o}let s=[];const l=this.props.city.asciiArt.split("\n");for(const e in l)s.push(r.createElement("pre",{key:e},o(l[e])));return r.createElement(r.Fragment,null,s)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(10),i=n(4),o=n(0),s=n(225);t.PurchasedAugmentations=function(){const e=[];for(const t of o.Player.queuedAugmentations){const n=a.Augmentations[t.name];let o=null;t.name===i.AugmentationNames.NeuroFluxGovernor&&(o=t.level),e.push(r.createElement("li",{key:`${t.name}${t.level}`},r.createElement(s.AugmentationAccordion,{aug:n,level:o})))}return r.createElement("ul",{className:"augmentations-list"},e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(0),i=n(2),o=n(10);t.PlayerMultipliers=function(){const e=function(){const e={};for(const t of a.Player.queuedAugmentations){const n=o.Augmentations[t.name];for(const t in n.mults){const r=e[t]?e[t]:1;e[t]=r*n.mults[t]}}return e}();function t(e){return r.createElement("table",null,r.createElement("tbody",null,e.map(e=>r.createElement("tr",{key:e[0]},r.createElement("td",{key:"0"},r.createElement("span",null,e[0]," multiplier: ")),r.createElement("td",{key:"1",style:{textAlign:"right"}},i.numeralWrapper.formatPercentage(e[1])),function(e){let t=[];return e&&(t=[r.createElement("td",{key:"2"}," => "),r.createElement("td",{key:"3"},i.numeralWrapper.formatPercentage(e))]),t}(e[2])))))}return r.createElement(r.Fragment,null,r.createElement("p",null,r.createElement("strong",null,r.createElement("u",null,"Multipliers:"))),r.createElement("br",null),t([["Hacking Chance ",a.Player.hacking_chance_mult,a.Player.hacking_chance_mult*e.hacking_chance_mult],["Hacking Speed ",a.Player.hacking_speed_mult,a.Player.hacking_speed_mult*e.hacking_speed_mult],["Hacking Money ",a.Player.hacking_money_mult,a.Player.hacking_money_mult*e.hacking_money_mult],["Hacking Growth ",a.Player.hacking_grow_mult,a.Player.hacking_grow_mult*e.hacking_grow_mult]]),r.createElement("br",null),t([["Hacking Level ",a.Player.hacking_mult,a.Player.hacking_mult*e.hacking_mult],["Hacking Experience ",a.Player.hacking_exp_mult,a.Player.hacking_exp_mult*e.hacking_exp_mult]]),r.createElement("br",null),t([["Strength Level ",a.Player.strength_mult,a.Player.strength_mult*e.strength_mult],["Strength Experience ",a.Player.strength_exp_mult,a.Player.strength_exp_mult*e.strength_exp_mult]]),r.createElement("br",null),t([["Defense Level ",a.Player.defense_mult,a.Player.defense_mult*e.defense_mult],["Defense Experience ",a.Player.defense_exp_mult,a.Player.defense_exp_mult*e.defense_exp_mult]]),r.createElement("br",null),t([["Dexterity Level ",a.Player.dexterity_mult,a.Player.dexterity_mult*e.dexterity_mult],["Dexterity Experience ",a.Player.dexterity_exp_mult,a.Player.dexterity_exp_mult*e.dexterity_exp_mult]]),r.createElement("br",null),t([["Agility Level ",a.Player.agility_mult,a.Player.agility_mult*e.agility_mult],["Agility Experience ",a.Player.agility_exp_mult,a.Player.agility_exp_mult*e.agility_exp_mult]]),r.createElement("br",null),t([["Charisma Level ",a.Player.charisma_mult,a.Player.charisma_mult*e.charisma_mult],["Charisma Experience ",a.Player.charisma_exp_mult,a.Player.charisma_exp_mult*e.charisma_exp_mult]]),r.createElement("br",null),t([["Hacknet Node production ",a.Player.hacknet_node_money_mult,a.Player.hacknet_node_money_mult*e.hacknet_node_money_mult],["Hacknet Node purchase cost ",a.Player.hacknet_node_purchase_cost_mult,a.Player.hacknet_node_purchase_cost_mult*e.hacknet_node_purchase_cost_mult],["Hacknet Node RAM upgrade cost ",a.Player.hacknet_node_ram_cost_mult,a.Player.hacknet_node_ram_cost_mult*e.hacknet_node_ram_cost_mult],["Hacknet Node Core purchase cost ",a.Player.hacknet_node_core_cost_mult,a.Player.hacknet_node_core_cost_mult*e.hacknet_node_core_cost_mult],["Hacknet Node level upgrade cost ",a.Player.hacknet_node_level_cost_mult,a.Player.hacknet_node_level_cost_mult*e.hacknet_node_level_cost_mult]]),r.createElement("br",null),t([["Company reputation gain ",a.Player.company_rep_mult,a.Player.company_rep_mult*e.company_rep_mult],["Faction reputation gain ",a.Player.faction_rep_mult,a.Player.faction_rep_mult*e.faction_rep_mult],["Salary ",a.Player.work_money_mult,a.Player.work_money_mult*e.work_money_mult]]),r.createElement("br",null),t([["Crime success ",a.Player.crime_success_mult,a.Player.crime_success_mult*e.crime_success_mult],["Crime money ",a.Player.crime_money_mult,a.Player.crime_money_mult*e.crime_money_mult]]),r.createElement("br",null))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(0),i=n(131),o=n(137);t.SourceFileMinus1=function(){let e=a.Player.exploits;return 0===e.length?r.createElement(r.Fragment,null):r.createElement("li",{key:-1},r.createElement(o.Accordion,{headerContent:r.createElement(r.Fragment,null,"Source-File -1: Exploits in the BitNodes",r.createElement("br",null),"Level ",e.length," / ?"),panelContent:r.createElement(r.Fragment,null,r.createElement("p",null,"This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web ecosystem."),r.createElement("p",null,"It increases all of the player's multipliers by 0.1%"),r.createElement("br",null),r.createElement("p",null,"You have found the following exploits:"),r.createElement("ul",null,e.map(e=>r.createElement("li",{key:e},"* ",i.ExploitName(e)))))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(137);t.SourceFileAccordion=function(e){const t=12===e.sf.n?"∞":"3";return r.createElement(a.Accordion,{headerContent:r.createElement(r.Fragment,null,e.sf.name,r.createElement("br",null),`Level ${e.level} / ${t}`),panelContent:r.createElement("p",{dangerouslySetInnerHTML:{__html:e.sf.info}})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(0),i=n(17),o=n(51),s=n(141),l=n(411);t.OwnedSourceFiles=function(){const e=a.Player.sourceFiles.slice();i.Settings.OwnedAugmentationsOrder===o.OwnedAugmentationsOrderSetting.Alphabetically&&e.sort((e,t)=>e.n-t.n);const t=e.map(e=>{const t="SourceFile"+e.n,n=s.SourceFiles[t];return null==n?(console.error(`Invalid source file number: ${e.n}`),null):r.createElement("li",{key:e.n},r.createElement(l.SourceFileAccordion,{level:e.lvl,sf:n}))});return r.createElement(r.Fragment,null,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(73);t.ListConfiguration=function(e){return r.createElement(r.Fragment,null,r.createElement(a.StdButton,{onClick:e.expandAllButtonsFn,text:"Expand All"}),r.createElement(a.StdButton,{onClick:e.collapseAllButtonsFn,text:"Collapse All"}),r.createElement(a.StdButton,{onClick:e.sortInOrderFn,text:"Sort in Order",tooltip:"Sorts the Augmentations alphabetically and Source-Files in numeral order"}),r.createElement(a.StdButton,{onClick:e.sortByAcquirementTimeFn,text:"Sort by Acquirement Time",tooltip:"Sorts the Augmentations and Source-Files based on when you acquired them (same as default)"}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(28),a=n(36),i=n(194);t.LocationsMetadata=[{city:r.CityName.Aevum,infiltrationData:{baseRewardValue:32,difficulty:4.4,maxClearanceLevel:50,startingSecurityLevel:1350},name:a.LocationName.AevumAeroCorp,types:[i.LocationType.Company]},{city:r.CityName.Aevum,infiltrationData:{baseRewardValue:42,difficulty:4.1,maxClearanceLevel:60,startingSecurityLevel:1350},name:a.LocationName.AevumBachmanAndAssociates,types:[i.LocationType.Company]},{city:r.CityName.Aevum,infiltrationData:{baseRewardValue:34,difficulty:3.6,maxClearanceLevel:75,startingSecurityLevel:1800},name:a.LocationName.AevumClarkeIncorporated,types:[i.LocationType.Company]},{city:r.CityName.Aevum,costMult:3,expMult:2,name:a.LocationName.AevumCrushFitnessGym,types:[i.LocationType.Gym]},{city:r.CityName.Aevum,infiltrationData:{baseRewardValue:116,difficulty:6,maxClearanceLevel:150,startingSecurityLevel:4800},name:a.LocationName.AevumECorp,types:[i.LocationType.Company,i.LocationType.TechVendor],techVendorMaxRam:512,techVendorMinRam:128},{city:r.CityName.Aevum,infiltrationData:{baseRewardValue:96,difficulty:6.2,maxClearanceLevel:100,startingSecurityLevel:4140},name:a.LocationName.AevumFulcrumTechnologies,types:[i.LocationType.Company,i.LocationType.TechVendor],techVendorMaxRam:1024,techVendorMinRam:256},{city:r.CityName.Aevum,infiltrationData:{baseRewardValue:30,difficulty:3.95,maxClearanceLevel:50,startingSecurityLevel:1260},name:a.LocationName.AevumGalacticCybersystems,types:[i.LocationType.Company]},{city:r.CityName.Aevum,infiltrationData:{baseRewardValue:10,difficulty:1.4,maxClearanceLevel:25,startingSecurityLevel:144},name:a.LocationName.AevumNetLinkTechnologies,types:[i.LocationType.Company,i.LocationType.TechVendor],techVendorMaxRam:64,techVendorMinRam:8},{city:r.CityName.Aevum,infiltrationData:{baseRewardValue:18,difficulty:2.2,maxClearanceLevel:25,startingSecurityLevel:565},name:a.LocationName.AevumPolice,types:[i.LocationType.Company]},{city:r.CityName.Aevum,infiltrationData:{baseRewardValue:16,difficulty:1.9,maxClearanceLevel:20,startingSecurityLevel:485},name:a.LocationName.AevumRhoConstruction,types:[i.LocationType.Company]},{city:r.CityName.Aevum,costMult:10,expMult:5,name:a.LocationName.AevumSnapFitnessGym,types:[i.LocationType.Gym]},{city:r.CityName.Aevum,costMult:4,expMult:3,name:a.LocationName.AevumSummitUniversity,types:[i.LocationType.University]},{city:r.CityName.Aevum,infiltrationData:{baseRewardValue:20,difficulty:3,maxClearanceLevel:30,startingSecurityLevel:690},name:a.LocationName.AevumWatchdogSecurity,types:[i.LocationType.Company]},{city:r.CityName.Chongqing,infiltrationData:{baseRewardValue:100,difficulty:6.1,maxClearanceLevel:100,startingSecurityLevel:4450},name:a.LocationName.ChongqingKuaiGongInternational,types:[i.LocationType.Company]},{city:r.CityName.Chongqing,infiltrationData:{baseRewardValue:52,difficulty:6,maxClearanceLevel:75,startingSecurityLevel:2915},name:a.LocationName.ChongqingSolarisSpaceSystems,types:[i.LocationType.Company]},{city:r.CityName.Ishima,infiltrationData:{baseRewardValue:20,difficulty:3.2,maxClearanceLevel:50,startingSecurityLevel:485},name:a.LocationName.IshimaNovaMedical,types:[i.LocationType.Company]},{city:r.CityName.Ishima,infiltrationData:{baseRewardValue:10,difficulty:1.6,maxClearanceLevel:40,startingSecurityLevel:130},name:a.LocationName.IshimaOmegaSoftware,types:[i.LocationType.Company,i.LocationType.TechVendor],techVendorMaxRam:128,techVendorMinRam:4},{city:r.CityName.Ishima,infiltrationData:{baseRewardValue:24,difficulty:4.1,maxClearanceLevel:100,startingSecurityLevel:570},name:a.LocationName.IshimaStormTechnologies,types:[i.LocationType.Company,i.LocationType.TechVendor],techVendorMaxRam:512,techVendorMinRam:32},{city:r.CityName.NewTokyo,infiltrationData:{baseRewardValue:28,difficulty:4,maxClearanceLevel:70,startingSecurityLevel:1050},name:a.LocationName.NewTokyoDefComm,types:[i.LocationType.Company]},{city:r.CityName.NewTokyo,infiltrationData:{baseRewardValue:24,difficulty:3.8,maxClearanceLevel:80,startingSecurityLevel:700},name:a.LocationName.NewTokyoGlobalPharmaceuticals,types:[i.LocationType.Company]},{city:r.CityName.NewTokyo,name:a.LocationName.NewTokyoNoodleBar,types:[i.LocationType.Company]},{city:r.CityName.NewTokyo,infiltrationData:{baseRewardValue:22,difficulty:3.5,maxClearanceLevel:100,startingSecurityLevel:605},name:a.LocationName.NewTokyoVitaLife,types:[i.LocationType.Company,i.LocationType.Special]},{city:r.CityName.Sector12,infiltrationData:{baseRewardValue:14,difficulty:2.25,maxClearanceLevel:40,startingSecurityLevel:200},name:a.LocationName.Sector12AlphaEnterprises,types:[i.LocationType.Company,i.LocationType.TechVendor],techVendorMaxRam:8,techVendorMinRam:2},{city:r.CityName.Sector12,infiltrationData:{baseRewardValue:46,difficulty:4.2,maxClearanceLevel:100,startingSecurityLevel:2160},name:a.LocationName.Sector12BladeIndustries,types:[i.LocationType.Company]},{city:r.CityName.Sector12,name:a.LocationName.Sector12CIA,types:[i.LocationType.Company]},{city:r.CityName.Sector12,infiltrationData:{baseRewardValue:18,difficulty:2.5,maxClearanceLevel:60,startingSecurityLevel:405},name:a.LocationName.Sector12CarmichaelSecurity,types:[i.LocationType.Company]},{city:r.CityName.Sector12,name:a.LocationName.Sector12CityHall,types:[i.LocationType.Special]},{city:r.CityName.Sector12,infiltrationData:{baseRewardValue:24,difficulty:4.3,maxClearanceLevel:50,startingSecurityLevel:700},name:a.LocationName.Sector12DeltaOne,types:[i.LocationType.Company]},{city:r.CityName.Sector12,name:a.LocationName.Sector12FoodNStuff,types:[i.LocationType.Company]},{city:r.CityName.Sector12,infiltrationData:{baseRewardValue:58,difficulty:7,maxClearanceLevel:100,startingSecurityLevel:1350},name:a.LocationName.Sector12FourSigma,types:[i.LocationType.Company]},{city:r.CityName.Sector12,infiltrationData:{baseRewardValue:32,difficulty:5.4,maxClearanceLevel:70,startingSecurityLevel:730},name:a.LocationName.Sector12IcarusMicrosystems,types:[i.LocationType.Company]},{city:r.CityName.Sector12,expMult:1,costMult:1,name:a.LocationName.Sector12IronGym,types:[i.LocationType.Gym]},{city:r.CityName.Sector12,infiltrationData:{baseRewardValue:8,difficulty:1.8,maxClearanceLevel:20,startingSecurityLevel:120},name:a.LocationName.Sector12JoesGuns,types:[i.LocationType.Company]},{city:r.CityName.Sector12,infiltrationData:{baseRewardValue:114,difficulty:6.75,maxClearanceLevel:125,startingSecurityLevel:4500},name:a.LocationName.Sector12MegaCorp,types:[i.LocationType.Company]},{city:r.CityName.Sector12,name:a.LocationName.Sector12NSA,types:[i.LocationType.Company,i.LocationType.Special]},{city:r.CityName.Sector12,costMult:20,expMult:10,name:a.LocationName.Sector12PowerhouseGym,types:[i.LocationType.Gym]},{city:r.CityName.Sector12,costMult:3,expMult:2,name:a.LocationName.Sector12RothmanUniversity,types:[i.LocationType.University]},{city:r.CityName.Sector12,infiltrationData:{baseRewardValue:24,difficulty:4.3,maxClearanceLevel:50,startingSecurityLevel:700},name:a.LocationName.Sector12UniversalEnergy,types:[i.LocationType.Company]},{city:r.CityName.Volhaven,infiltrationData:{baseRewardValue:12,difficulty:2.1,maxClearanceLevel:60,startingSecurityLevel:195},name:a.LocationName.VolhavenCompuTek,types:[i.LocationType.Company,i.LocationType.TechVendor],techVendorMaxRam:256,techVendorMinRam:8},{city:r.CityName.Volhaven,infiltrationData:{baseRewardValue:28,difficulty:3,maxClearanceLevel:75,startingSecurityLevel:1080},name:a.LocationName.VolhavenHeliosLabs,types:[i.LocationType.Company]},{city:r.CityName.Volhaven,infiltrationData:{baseRewardValue:14,difficulty:2,maxClearanceLevel:60,startingSecurityLevel:340},name:a.LocationName.VolhavenLexoCorp,types:[i.LocationType.Company]},{city:r.CityName.Volhaven,costMult:7,expMult:4,name:a.LocationName.VolhavenMilleniumFitnessGym,types:[i.LocationType.Gym]},{city:r.CityName.Volhaven,infiltrationData:{baseRewardValue:56,difficulty:6.8,maxClearanceLevel:200,startingSecurityLevel:1460},name:a.LocationName.VolhavenNWO,types:[i.LocationType.Company]},{city:r.CityName.Volhaven,infiltrationData:{baseRewardValue:44,difficulty:4.4,maxClearanceLevel:100,startingSecurityLevel:1215},name:a.LocationName.VolhavenOmniTekIncorporated,types:[i.LocationType.Company,i.LocationType.TechVendor],techVendorMaxRam:1024,techVendorMinRam:128},{city:r.CityName.Volhaven,infiltrationData:{baseRewardValue:28,difficulty:4.9,maxClearanceLevel:90,startingSecurityLevel:725},name:a.LocationName.VolhavenOmniaCybersystems,types:[i.LocationType.Company]},{city:r.CityName.Volhaven,infiltrationData:{baseRewardValue:18,difficulty:2.4,maxClearanceLevel:75,startingSecurityLevel:430},name:a.LocationName.VolhavenSysCoreSecurities,types:[i.LocationType.Company]},{city:r.CityName.Volhaven,costMult:5,expMult:4,name:a.LocationName.VolhavenZBInstituteOfTechnology,types:[i.LocationType.University]},{city:null,name:a.LocationName.Hospital,types:[i.LocationType.Hospital]},{city:null,name:a.LocationName.Slums,types:[i.LocationType.Slums]},{city:null,name:a.LocationName.TravelAgency,types:[i.LocationType.TravelAgency]},{city:null,name:a.LocationName.WorldStockExchange,types:[i.LocationType.StockMarket]}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(36);t.Location=class{constructor(e){this.city=null,this.costMult=0,this.expMult=0,this.name=r.LocationName.Void,this.types=[],this.techVendorMaxRam=0,this.techVendorMinRam=0,e.city&&(this.city=e.city),e.costMult&&(this.costMult=e.costMult),e.expMult&&(this.expMult=e.expMult),e.infiltrationData&&(this.infiltrationData=e.infiltrationData),e.name&&(this.name=e.name),e.types&&(this.types=e.types),e.techVendorMaxRam&&(this.techVendorMaxRam=e.techVendorMaxRam),e.techVendorMinRam&&(this.techVendorMinRam=e.techVendorMinRam)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.City=class{constructor(e,t=[],n=""){this.name=e,this.locations=t,this.asciiArt=n}addLocation(e){this.locations.push(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(95);t.SourceFile=class{constructor(e,t=""){this.lvl=1,this.owned=!1;const n="BitNode"+e,a=r.BitNodes[n];if(null==a)throw new Error("Invalid Bit Node for this Source File");this.n=e,this.name=`Source-File ${e}: ${a.name}`,this.info=t}}},,,,,,,,,,,,,,function(e,t,n){"use strict";n(0),n(70),n(63)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(209),i={border:"1px solid red",display:"inline-block",margin:"4px",padding:"4px"};t.ErrorBoundary=class extends r.Component{constructor(e){super(e),this.state={errorInfo:"",hasError:!1}}static getDerivedStateFromError(e){return{errorInfo:e.message,hasError:!0}}componentDidCatch(e,t){console.error("Caught error in React ErrorBoundary. Component stack:"),console.error(t.componentStack)}componentDidMount(){const e=()=>{this.setState({hasError:!1})};this.hasEventEmitter()&&this.props.eventEmitterForReset.addSubscriber({cb:e,id:this.props.id})}componentWillUnmount(){this.hasEventEmitter()&&this.props.eventEmitterForReset.removeSubscriber(this.props.id)}hasEventEmitter(){return this.props.eventEmitterForReset instanceof a.EventEmitter&&"string"==typeof this.props.id}render(){return this.state.hasError?r.createElement("div",{style:i},r.createElement("p",null,"Error rendering UI. This is (probably) a bug. Please report to game developer."),r.createElement("p",null,"In the meantime, try refreshing the game WITHOUT saving."),r.createElement("p",null,`Error info: ${this.state.errorInfo}`)):this.props.children}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(73);var i;!function(e){e[e.AllStocks=0]="AllStocks",e[e.Portfolio=1]="Portfolio"}(i=t.TickerDisplayMode||(t.TickerDisplayMode={}));t.StockTickersConfig=class extends r.Component{constructor(e){super(e)}renderDisplayModeButton(){let e="",t="";return this.props.tickerDisplayMode===i.Portfolio?(e="Switch to 'All Stocks' Mode",t="Displays all stocks on the WSE"):(e="Switch to 'Portfolio' Mode",t="Displays only the stocks for which you have shares or orders"),r.createElement(a.StdButton,{onClick:this.props.changeDisplayMode,text:e,tooltip:t})}render(){return r.createElement("div",null,this.renderDisplayModeButton(),r.createElement(a.StdButton,{onClick:this.props.expandAllTickers,text:"Expand Tickers"}),r.createElement(a.StdButton,{onClick:this.props.collapseAllTickers,text:"Collapse Tickers"}),r.createElement("input",{className:"text-input",id:"stock-market-watchlist-filter",onChange:this.props.changeWatchlistFilter,placeholder:"Filter Stocks by symbol (comma-separated list)",type:"text"}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.StockTickerTxButton=function(e){let t="stock-market-input std-button";const n="string"==typeof e.tooltip&&""!==e.tooltip;let a;return n&&(t+=" tooltip"),n&&(a={__html:e.tooltip}),r.createElement("button",{className:t,onClick:e.onClick},e.text,n&&r.createElement("span",{className:"tooltiptext",dangerouslySetInnerHTML:a}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(2),i=n(38),o={display:"block"};t.StockTickerPositionText=class extends r.Component{renderLongPosition(){const e=this.props.stock,t=e.playerShares*e.playerAvgPx,n=(e.getBidPrice()-e.playerAvgPx)*e.playerShares;let i=n/t;return isNaN(i)&&(i=0),r.createElement("div",null,r.createElement("h3",{className:"tooltip"},"Long Position:",r.createElement("span",{className:"tooltiptext"},"Shares in the long position will increase in value if the price of the corresponding stock increases")),r.createElement("br",null),r.createElement("p",null,"Shares: ",a.numeralWrapper.format(e.playerShares,"0,0")),r.createElement("br",null),r.createElement("p",null,"Average Price: ",a.numeralWrapper.formatMoney(e.playerAvgPx)," (Total Cost: ",a.numeralWrapper.formatMoney(t),")"),r.createElement("br",null),r.createElement("p",null,"Profit: ",a.numeralWrapper.formatMoney(n)," (",a.numeralWrapper.formatPercentage(i),")"),r.createElement("br",null))}renderShortPosition(){const e=this.props.stock,t=e.playerShortShares*e.playerAvgShortPx,n=(e.playerAvgShortPx-e.getAskPrice())*e.playerShortShares;let o=n/t;return isNaN(o)&&(o=0),8===this.props.p.bitNodeN||i.SourceFileFlags[8]>=2?r.createElement("div",null,r.createElement("h3",{className:"tooltip"},"Short Position:",r.createElement("span",{className:"tooltiptext"},"Shares in the short position will increase in value if the price of the corresponding stock decreases")),r.createElement("br",null),r.createElement("p",null,"Shares: ",a.numeralWrapper.format(e.playerShortShares,"0,0")),r.createElement("br",null),r.createElement("p",null,"Average Price: ",a.numeralWrapper.formatMoney(e.playerAvgShortPx)," (Total Cost: ",a.numeralWrapper.formatMoney(t),")"),r.createElement("br",null),r.createElement("p",null,"Profit: ",a.numeralWrapper.formatMoney(n)," (",a.numeralWrapper.formatPercentage(o),")"),r.createElement("br",null)):null}render(){const e=this.props.stock;return r.createElement("div",{className:"stock-market-position-text"},r.createElement("p",{style:o},"Max Shares: ",a.numeralWrapper.formatBigNumber(e.maxShares)),r.createElement("p",{className:"tooltip"},"Ask Price: ",a.numeralWrapper.formatMoney(e.getAskPrice()),r.createElement("span",{className:"tooltiptext"},"See Investopedia for details on what this is")),r.createElement("br",null),r.createElement("p",{className:"tooltip"},"Bid Price: ",a.numeralWrapper.formatMoney(e.getBidPrice()),r.createElement("span",{className:"tooltiptext"},"See Investopedia for details on what this is")),this.renderLongPosition(),this.renderShortPosition())}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(76),i=n(2);t.StockTickerOrder=class extends r.Component{constructor(e){super(e),this.handleCancelOrderClick=this.handleCancelOrderClick.bind(this)}handleCancelOrderClick(){this.props.cancelOrder({order:this.props.order})}render(){const e=this.props.order,t=e.pos===a.PositionTypes.Long?"Long Position":"Short Position",n=`${e.type} - ${t} - ${i.numeralWrapper.formatBigNumber(e.shares)} @ ${i.numeralWrapper.formatMoney(e.price)}`;return r.createElement("li",null,n,r.createElement("button",{className:"std-button stock-market-order-cancel-btn",onClick:this.handleCancelOrderClick},"Cancel Order"))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(436);t.StockTickerOrderList=class extends r.Component{render(){const e=[];for(let t=0;t<this.props.orders.length;++t){const n=this.props.orders[t];e.push(r.createElement(a.StockTickerOrder,{cancelOrder:this.props.cancelOrder,order:n,key:t}))}return r.createElement("ul",{className:"stock-market-order-list"},e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(153);t.TickerHeaderFormatData={longestName:0,longestSymbol:0};for(const e in r.StockSymbols)t.TickerHeaderFormatData.longestName=Math.max(e.length,t.TickerHeaderFormatData.longestName),t.TickerHeaderFormatData.longestSymbol=Math.max(r.StockSymbols[e].length,t.TickerHeaderFormatData.longestSymbol)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(438),i=n(17),o=n(2),s=["cs","lv","pl","ru"];t.StockTickerHeaderText=function(e){const t=e.stock,n=o.numeralWrapper.formatMoney(t.price),l=s.includes(i.Settings.Locale)?15:12,c=" ".repeat(1+a.TickerHeaderFormatData.longestName-t.name.length+(a.TickerHeaderFormatData.longestSymbol-t.symbol.length)),u=" ".repeat(l-n.length);let m=`${t.name}${c}${t.symbol} -${u}${n}`;if(e.p.has4SData){m+=` - Volatility: ${o.numeralWrapper.format(t.mv,"0,0.00")}% - Price Forecast: `;let e=t.b;t.otlkMag<0&&(e=!e),m+=(e?"+":"-").repeat(Math.floor(Math.abs(t.otlkMag)/10)+1)}let p={color:"#66ff33"};return t.lastPrice===t.price?p.color="white":t.lastPrice>t.price&&(p.color="red"),r.createElement("pre",{style:p},m)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(439),i=n(437),o=n(435),s=n(434),l=n(155),c=n(87),u=n(76),m=n(38),p=n(2),h=n(137),d=n(8),_=n(45);var g;!function(e){e.Market="Market Order",e.Limit="Limit Order",e.Stop="Stop Order"}(g||(g={}));t.StockTicker=class extends r.Component{constructor(e){super(e),this.state={orderType:g.Market,position:u.PositionTypes.Long,qty:""},this.getBuyTransactionCostText=this.getBuyTransactionCostText.bind(this),this.getSellTransactionCostText=this.getSellTransactionCostText.bind(this),this.handleBuyButtonClick=this.handleBuyButtonClick.bind(this),this.handleBuyMaxButtonClick=this.handleBuyMaxButtonClick.bind(this),this.handleHeaderClick=this.handleHeaderClick.bind(this),this.handleOrderTypeChange=this.handleOrderTypeChange.bind(this),this.handlePositionTypeChange=this.handlePositionTypeChange.bind(this),this.handleQuantityChange=this.handleQuantityChange.bind(this),this.handleSellButtonClick=this.handleSellButtonClick.bind(this),this.handleSellAllButtonClick=this.handleSellAllButtonClick.bind(this)}createPlaceOrderPopupBox(e,t,n){const r=_.yesNoTxtInpBoxGetYesButton(),a=_.yesNoTxtInpBoxGetNoButton();r.innerText=e,r.addEventListener("click",()=>{const e=parseFloat(_.yesNoTxtInpBoxGetInput());if(isNaN(e))return d.dialogBoxCreate(`Invalid input for price: ${_.yesNoTxtInpBoxGetInput()}`),!1;n(e),_.yesNoTxtInpBoxClose()}),a.innerText="Cancel Order",a.addEventListener("click",()=>{_.yesNoTxtInpBoxClose()}),_.yesNoTxtInpBoxCreate(t)}getBuyTransactionCostText(){const e=this.props.stock,t=this.getQuantity();if(isNaN(t))return"";const n=l.getBuyTransactionCost(e,t,this.state.position);return null==n?"":`Purchasing ${p.numeralWrapper.formatBigNumber(t)} shares (${this.state.position===u.PositionTypes.Long?"Long":"Short"}) `+`will cost ${p.numeralWrapper.formatMoney(n)}. `}getQuantity(){return Math.round(parseFloat(this.state.qty))}getSellTransactionCostText(){const e=this.props.stock,t=this.getQuantity();if(isNaN(t))return"";if(this.state.position===u.PositionTypes.Long){if(t>e.playerShares)return"You do not have this many shares in the Long position"}else if(t>e.playerShortShares)return"You do not have this many shares in the Short position";const n=l.getSellTransactionGain(e,t,this.state.position);return null==n?"":`Selling ${p.numeralWrapper.formatBigNumber(t)} shares (${this.state.position===u.PositionTypes.Long?"Long":"Short"}) `+`will result in a gain of ${p.numeralWrapper.formatMoney(n)}. `}handleBuyButtonClick(){const e=this.getQuantity();if(isNaN(e))d.dialogBoxCreate(`Invalid input for quantity (number of shares): ${this.state.qty}`);else switch(this.state.orderType){case g.Market:this.state.position===u.PositionTypes.Short?this.props.buyStockShort(this.props.stock,e):this.props.buyStockLong(this.props.stock,e),this.props.rerenderAllTickers();break;case g.Limit:this.createPlaceOrderPopupBox("Place Buy Limit Order","Enter the price for your Limit Order",t=>{this.props.placeOrder(this.props.stock,e,t,c.OrderTypes.LimitBuy,this.state.position)});break;case g.Stop:this.createPlaceOrderPopupBox("Place Buy Stop Order","Enter the price for your Stop Order",t=>{this.props.placeOrder(this.props.stock,e,t,c.OrderTypes.StopBuy,this.state.position)})}}handleBuyMaxButtonClick(){const e=this.props.p.money.toNumber(),t=this.props.stock;let n=l.calculateBuyMaxAmount(t,this.state.position,e);switch(n=Math.min(n,Math.round(t.maxShares-t.playerShares-t.playerShortShares)),this.state.orderType){case g.Market:this.state.position===u.PositionTypes.Short?this.props.buyStockShort(t,n):this.props.buyStockLong(t,n),this.props.rerenderAllTickers();break;default:d.dialogBoxCreate("ERROR: 'Buy Max' only works for Market Orders")}}handleHeaderClick(e){const t=e.currentTarget;t.classList.toggle("active");const n=t.nextElementSibling;"block"===n.style.display?n.style.display="none":n.style.display="block"}handleOrderTypeChange(e){switch(e.target.value){case g.Limit:this.setState({orderType:g.Limit});break;case g.Stop:this.setState({orderType:g.Stop});break;case g.Market:default:this.setState({orderType:g.Market})}}handlePositionTypeChange(e){e.target.value===u.PositionTypes.Short?this.setState({position:u.PositionTypes.Short}):this.setState({position:u.PositionTypes.Long})}handleQuantityChange(e){this.setState({qty:e.target.value})}handleSellButtonClick(){const e=this.getQuantity();if(isNaN(e))d.dialogBoxCreate(`Invalid input for quantity (number of shares): ${this.state.qty}`);else switch(this.state.orderType){case g.Market:this.state.position===u.PositionTypes.Short?this.props.sellStockShort(this.props.stock,e):this.props.sellStockLong(this.props.stock,e),this.props.rerenderAllTickers();break;case g.Limit:this.createPlaceOrderPopupBox("Place Sell Limit Order","Enter the price for your Limit Order",t=>{this.props.placeOrder(this.props.stock,e,t,c.OrderTypes.LimitSell,this.state.position)});break;case g.Stop:this.createPlaceOrderPopupBox("Place Sell Stop Order","Enter the price for your Stop Order",t=>{this.props.placeOrder(this.props.stock,e,t,c.OrderTypes.StopSell,this.state.position)})}}handleSellAllButtonClick(){const e=this.props.stock;switch(this.state.orderType){case g.Market:this.state.position===u.PositionTypes.Short?this.props.sellStockShort(e,e.playerShortShares):this.props.sellStockLong(e,e.playerShares),this.props.rerenderAllTickers();break;default:d.dialogBoxCreate("ERROR: 'Sell All' only works for Market Orders")}}hasOrderAccess(){return 8===this.props.p.bitNodeN||m.SourceFileFlags[8]>=3}hasShortAccess(){return 8===this.props.p.bitNodeN||m.SourceFileFlags[8]>=2}render(){return this.getQuantity(),r.createElement("li",null,r.createElement(h.Accordion,{headerContent:r.createElement(a.StockTickerHeaderText,{p:this.props.p,stock:this.props.stock}),panelContent:r.createElement("div",null,r.createElement("input",{className:"stock-market-input",onChange:this.handleQuantityChange,placeholder:"Quantity (Shares)",value:this.state.qty}),r.createElement("select",{className:"stock-market-input dropdown",onChange:this.handlePositionTypeChange,value:this.state.position},r.createElement("option",{value:u.PositionTypes.Long},"Long"),this.hasShortAccess()&&r.createElement("option",{value:u.PositionTypes.Short},"Short")),r.createElement("select",{className:"stock-market-input dropdown",onChange:this.handleOrderTypeChange,value:this.state.orderType},r.createElement("option",{value:g.Market},g.Market),this.hasOrderAccess()&&r.createElement("option",{value:g.Limit},g.Limit),this.hasOrderAccess()&&r.createElement("option",{value:g.Stop},g.Stop)),r.createElement(s.StockTickerTxButton,{onClick:this.handleBuyButtonClick,text:"Buy",tooltip:this.getBuyTransactionCostText()}),r.createElement(s.StockTickerTxButton,{onClick:this.handleSellButtonClick,text:"Sell",tooltip:this.getSellTransactionCostText()}),r.createElement(s.StockTickerTxButton,{onClick:this.handleBuyMaxButtonClick,text:"Buy MAX"}),r.createElement(s.StockTickerTxButton,{onClick:this.handleSellAllButtonClick,text:"Sell ALL"}),r.createElement(o.StockTickerPositionText,{p:this.props.p,stock:this.props.stock}),r.createElement(i.StockTickerOrderList,{cancelOrder:this.props.cancelOrder,orders:this.props.orders,p:this.props.p,stock:this.props.stock}))}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(440),i=n(433),o=n(117),s=n(432);t.StockTickers=class extends r.Component{constructor(e){super(e),this.state={rerenderFlag:!1,tickerDisplayMode:i.TickerDisplayMode.AllStocks,watchlistFilter:"",watchlistSymbols:[]},this.changeDisplayMode=this.changeDisplayMode.bind(this),this.changeWatchlistFilter=this.changeWatchlistFilter.bind(this),this.collapseAllTickers=this.collapseAllTickers.bind(this),this.expandAllTickers=this.expandAllTickers.bind(this),this.rerender=this.rerender.bind(this),this.listRef=r.createRef()}changeDisplayMode(){this.state.tickerDisplayMode===i.TickerDisplayMode.AllStocks?this.setState({tickerDisplayMode:i.TickerDisplayMode.Portfolio}):this.setState({tickerDisplayMode:i.TickerDisplayMode.AllStocks})}changeWatchlistFilter(e){const t=e.target.value,n=t.replace(/\s/g,"");this.setState({watchlistFilter:t}),""!==n?this.setState({watchlistSymbols:n.split(",")}):this.setState({watchlistSymbols:[]})}collapseAllTickers(){const e=this.listRef.current;if(null==e)return;const t=e.getElementsByClassName("accordion-header");for(let e=0;e<t.length;++e){const n=t[e];n instanceof HTMLButtonElement&&n.classList.contains("active")&&n.click()}}expandAllTickers(){const e=this.listRef.current;if(null==e)return;const t=e.getElementsByClassName("accordion-header");for(let e=0;e<t.length;++e){const n=t[e];n instanceof HTMLButtonElement&&(n.classList.contains("active")||n.click())}}rerender(){this.setState(e=>({rerenderFlag:!e.rerenderFlag}))}render(){const e=[];for(const t in this.props.stockMarket){const n=this.props.stockMarket[t];if(n instanceof o.Stock){if(this.state.watchlistSymbols.length>0&&!this.state.watchlistSymbols.includes(n.symbol))continue;let t=this.props.stockMarket.Orders[n.symbol];if(null==t&&(t=[]),this.state.tickerDisplayMode===i.TickerDisplayMode.Portfolio&&0===n.playerShares&&0===n.playerShortShares&&0===t.length)continue;e.push(r.createElement(a.StockTicker,{buyStockLong:this.props.buyStockLong,buyStockShort:this.props.buyStockShort,cancelOrder:this.props.cancelOrder,key:n.symbol,orders:t,p:this.props.p,placeOrder:this.props.placeOrder,rerenderAllTickers:this.rerender,sellStockLong:this.props.sellStockLong,sellStockShort:this.props.sellStockShort,stock:n}))}}const t={eventEmitterForReset:this.props.eventEmitterForReset,id:"StockTickersErrorBoundary"};return r.createElement(s.ErrorBoundary,Object.assign({},t),r.createElement(i.StockTickersConfig,{changeDisplayMode:this.changeDisplayMode,changeWatchlistFilter:this.changeWatchlistFilter,collapseAllTickers:this.collapseAllTickers,expandAllTickers:this.expandAllTickers,tickerDisplayMode:this.state.tickerDisplayMode}),r.createElement("ul",{id:"stock-market-list",ref:this.listRef},e))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(146),i=n(6),o=n(2),s=n(73),l=n(231),c=n(8),u={display:"block"};t.InfoAndPurchases=class extends r.Component{constructor(e){super(e),this.handleClick4SMarketDataHelpTip=this.handleClick4SMarketDataHelpTip.bind(this),this.purchaseWseAccount=this.purchaseWseAccount.bind(this),this.purchaseTixApiAccess=this.purchaseTixApiAccess.bind(this),this.purchase4SMarketData=this.purchase4SMarketData.bind(this),this.purchase4SMarketDataTixApiAccess=this.purchase4SMarketDataTixApiAccess.bind(this)}handleClick4SMarketDataHelpTip(){c.dialogBoxCreate("Access to the 4S Market Data feed will display two additional pieces of information about each stock: Price Forecast & Volatility<br><br>Price Forecast indicates the probability the stock has of increasing or decreasing. A '+' forecast means the stock has a higher chance of increasing than decreasing, and a '-' means the opposite. The number of '+/-' symbols is used to illustrate the magnitude of these probabilities. For example, '+++' means that the stock has a significantly higher chance of increasing than decreasing, while '+' means that the stock only has a slightly higher chance of increasing than decreasing.<br><br>Volatility represents the maximum percentage by which a stock's price can change every tick (a tick occurs every few seconds while the game is running).<br><br>A stock's price forecast can change over time. This is also affected by volatility. The more volatile a stock is, the more its price forecast will change.")}purchaseWseAccount(){if(this.props.p.hasWseAccount)return;if(!this.props.p.canAfford(i.CONSTANTS.WSEAccountCost))return;this.props.p.hasWseAccount=!0,this.props.initStockMarket(),this.props.p.loseMoney(i.CONSTANTS.WSEAccountCost),this.props.rerender();const e=document.getElementById("world-menu-header");e instanceof HTMLElement&&(e.click(),e.click())}purchaseTixApiAccess(){this.props.p.hasTixApiAccess||this.props.p.canAfford(i.CONSTANTS.TIXAPICost)&&(this.props.p.hasTixApiAccess=!0,this.props.p.loseMoney(i.CONSTANTS.TIXAPICost),this.props.rerender())}purchase4SMarketData(){this.props.p.has4SData||this.props.p.canAfford(a.getStockMarket4SDataCost())&&(this.props.p.has4SData=!0,this.props.p.loseMoney(a.getStockMarket4SDataCost()),this.props.rerender())}purchase4SMarketDataTixApiAccess(){this.props.p.has4SDataTixApi||this.props.p.canAfford(a.getStockMarket4STixApiCost())&&(this.props.p.has4SDataTixApi=!0,this.props.p.loseMoney(a.getStockMarket4STixApiCost()),this.props.rerender())}renderPurchaseWseAccountButton(){if(this.props.p.hasWseAccount)return r.createElement(l.StdButtonPurchased,{text:"WSE Account - Purchased"});{const e=i.CONSTANTS.WSEAccountCost;return r.createElement(s.StdButton,{disabled:!this.props.p.canAfford(e),onClick:this.purchaseWseAccount,text:`Buy WSE Account - ${o.numeralWrapper.formatMoney(e)}`})}}renderPurchaseTixApiAccessButton(){if(this.props.p.hasTixApiAccess)return r.createElement(l.StdButtonPurchased,{text:"TIX API Access - Purchased"});{const e=i.CONSTANTS.TIXAPICost;return r.createElement(s.StdButton,{disabled:!this.props.p.canAfford(e)||!this.props.p.hasWseAccount,onClick:this.purchaseTixApiAccess,style:u,text:`Buy Trade Information eXchange (TIX) API Access - ${o.numeralWrapper.formatMoney(e)}`})}}renderPurchase4SMarketDataButton(){if(this.props.p.has4SData)return r.createElement(l.StdButtonPurchased,{text:"4S Market Data - Purchased",tooltip:"Lets you view additional pricing and volatility information about stocks"});{const e=a.getStockMarket4SDataCost();return r.createElement(s.StdButton,{disabled:!this.props.p.canAfford(e)||!this.props.p.hasWseAccount,onClick:this.purchase4SMarketData,text:`Buy 4S Market Data Access - ${o.numeralWrapper.formatMoney(e)}`,tooltip:"Lets you view additional pricing and volatility information about stocks"})}}renderPurchase4SMarketDataTixApiAccessButton(){if(this.props.p.hasTixApiAccess){if(this.props.p.has4SDataTixApi)return r.createElement(l.StdButtonPurchased,{text:"4S Market Data TIX API - Purchased",tooltip:"Let you access 4S Market Data through Netscript"});{const e=a.getStockMarket4STixApiCost();return r.createElement(s.StdButton,{disabled:!this.props.p.canAfford(e),onClick:this.purchase4SMarketDataTixApiAccess,text:`Buy 4S Market Data TIX API Access - ${o.numeralWrapper.formatMoney(e)}`,tooltip:"Let you access 4S Market Data through Netscript"})}}return r.createElement(s.StdButton,{disabled:!0,text:"Buy 4S Market Data TIX API Access",tooltip:"Requires TIX API Access"})}render(){return r.createElement("div",{className:"stock-market-info-and-purchases"},r.createElement("p",null,"Welcome to the World Stock Exchange (WSE)!"),r.createElement("button",{className:"std-button"},r.createElement("a",{href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/stockmarket.html",target:"_blank"},"Investopedia")),r.createElement("br",null),r.createElement("p",null,"To begin trading, you must first purchase an account:"),this.renderPurchaseWseAccountButton(),r.createElement("h2",null,"Trade Information eXchange (TIX) API"),r.createElement("p",null,"TIX, short for Trade Information eXchange, is the communications protocol used by the WSE. Purchasing access to the TIX API lets you write code to create your own algorithmic/automated trading strategies."),this.renderPurchaseTixApiAccessButton(),r.createElement("h2",null,"Four Sigma (4S) Market Data Feed"),r.createElement("p",null,"Four Sigma's (4S) Market Data Feed provides information about stocks that will help your trading strategies."),this.renderPurchase4SMarketDataButton(),r.createElement("button",{className:"help-tip-big",onClick:this.handleClick4SMarketDataHelpTip},"?"),this.renderPurchase4SMarketDataTixApiAccessButton(),r.createElement("p",null,"Commission Fees: Every transaction you make has a ",o.numeralWrapper.formatMoney(i.CONSTANTS.StockMarketCommission)," commission fee."),r.createElement("br",null),r.createElement("p",null,"WARNING: When you reset after installing Augmentations, the Stock Market is reset. You will retain your WSE Account, access to the TIX API, and 4S Market Data access. However, all of your stock positions are lost, so make sure to sell your stocks before installing Augmentations!"))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(442),i=n(441);t.StockMarketRoot=class extends r.Component{constructor(e){super(e),this.state={rerenderFlag:!1},this.rerender=this.rerender.bind(this)}rerender(){this.setState(e=>({rerenderFlag:!e.rerenderFlag}))}render(){return r.createElement("div",null,r.createElement(a.InfoAndPurchases,{initStockMarket:this.props.initStockMarket,p:this.props.p,rerender:this.rerender}),this.props.p.hasWseAccount&&r.createElement(i.StockTickers,{buyStockLong:this.props.buyStockLong,buyStockShort:this.props.buyStockShort,cancelOrder:this.props.cancelOrder,eventEmitterForReset:this.props.eventEmitterForReset,p:this.props.p,placeOrder:this.props.placeOrder,sellStockLong:this.props.sellStockLong,sellStockShort:this.props.sellStockShort,stockMarket:this.props.stockMarket}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(153),a=n(36);t.InitStockMetadata=[{b:!0,initPrice:{max:28e3,min:17e3},marketCap:24e11,mv:{divisor:100,max:50,min:40},name:a.LocationName.AevumECorp,otlkMag:19,spreadPerc:{divisor:10,max:5,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:r.StockSymbols[a.LocationName.AevumECorp]},{b:!0,initPrice:{max:34e3,min:24e3},marketCap:24e11,mv:{divisor:100,max:50,min:40},name:a.LocationName.Sector12MegaCorp,otlkMag:19,spreadPerc:{divisor:10,max:5,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:r.StockSymbols[a.LocationName.Sector12MegaCorp]},{b:!0,initPrice:{max:25e3,min:12e3},marketCap:16e11,mv:{divisor:100,max:80,min:70},name:a.LocationName.Sector12BladeIndustries,otlkMag:13,spreadPerc:{divisor:10,max:6,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:r.StockSymbols[a.LocationName.Sector12BladeIndustries]},{b:!0,initPrice:{max:25e3,min:1e4},marketCap:15e11,mv:{divisor:100,max:75,min:65},name:a.LocationName.AevumClarkeIncorporated,otlkMag:12,spreadPerc:{divisor:10,max:5,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:r.StockSymbols[a.LocationName.AevumClarkeIncorporated]},{b:!0,initPrice:{max:43e3,min:32e3},marketCap:18e11,mv:{divisor:100,max:70,min:60},name:a.LocationName.VolhavenOmniTekIncorporated,otlkMag:12,spreadPerc:{divisor:10,max:6,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:r.StockSymbols[a.LocationName.VolhavenOmniTekIncorporated]},{b:!0,initPrice:{max:8e4,min:5e4},marketCap:2e12,mv:{divisor:100,max:110,min:100},name:a.LocationName.Sector12FourSigma,otlkMag:17,spreadPerc:{divisor:10,max:10,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:r.StockSymbols[a.LocationName.Sector12FourSigma]},{b:!0,initPrice:{max:28e3,min:16e3},marketCap:19e11,mv:{divisor:100,max:85,min:75},name:a.LocationName.ChongqingKuaiGongInternational,otlkMag:10,spreadPerc:{divisor:10,max:7,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:r.StockSymbols[a.LocationName.ChongqingKuaiGongInternational]},{b:!0,initPrice:{max:36e3,min:29e3},marketCap:2e12,mv:{divisor:100,max:130,min:120},name:a.LocationName.AevumFulcrumTechnologies,otlkMag:16,spreadPerc:{divisor:10,max:10,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:r.StockSymbols[a.LocationName.AevumFulcrumTechnologies]},{b:!0,initPrice:{max:25e3,min:2e4},marketCap:12e11,mv:{divisor:100,max:90,min:80},name:a.LocationName.IshimaStormTechnologies,otlkMag:7,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:r.StockSymbols[a.LocationName.IshimaStormTechnologies]},{b:!0,initPrice:{max:19e3,min:6e3},marketCap:9e11,mv:{divisor:100,max:70,min:60},name:a.LocationName.NewTokyoDefComm,otlkMag:10,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:r.StockSymbols[a.LocationName.NewTokyoDefComm]},{b:!0,initPrice:{max:18e3,min:1e4},marketCap:825e9,mv:{divisor:100,max:65,min:55},name:a.LocationName.VolhavenHeliosLabs,otlkMag:9,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:r.StockSymbols[a.LocationName.VolhavenHeliosLabs]},{b:!0,initPrice:{max:14e3,min:8e3},marketCap:1e12,mv:{divisor:100,max:80,min:70},name:a.LocationName.NewTokyoVitaLife,otlkMag:7,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:r.StockSymbols[a.LocationName.NewTokyoVitaLife]},{b:!0,initPrice:{max:24e3,min:12e3},marketCap:8e11,mv:{divisor:100,max:70,min:60},name:a.LocationName.Sector12IcarusMicrosystems,otlkMag:7.5,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:108e3,min:36e3},symbol:r.StockSymbols[a.LocationName.Sector12IcarusMicrosystems]},{b:!0,initPrice:{max:29e3,min:16e3},marketCap:9e11,mv:{divisor:100,max:60,min:50},name:a.LocationName.Sector12UniversalEnergy,otlkMag:10,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:r.StockSymbols[a.LocationName.Sector12UniversalEnergy]},{b:!0,initPrice:{max:17e3,min:8e3},marketCap:64e10,mv:{divisor:100,max:65,min:55},name:a.LocationName.AevumAeroCorp,otlkMag:6,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:126e3,min:42e3},symbol:r.StockSymbols[a.LocationName.AevumAeroCorp]},{b:!0,initPrice:{max:15e3,min:6e3},marketCap:6e11,mv:{divisor:100,max:75,min:65},name:a.LocationName.VolhavenOmniaCybersystems,otlkMag:4.5,spreadPerc:{divisor:10,max:11,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:r.StockSymbols[a.LocationName.VolhavenOmniaCybersystems]},{b:!0,initPrice:{max:28e3,min:14e3},marketCap:705e9,mv:{divisor:100,max:80,min:70},name:a.LocationName.ChongqingSolarisSpaceSystems,otlkMag:8.5,spreadPerc:{divisor:10,max:12,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:r.StockSymbols[a.LocationName.ChongqingSolarisSpaceSystems]},{b:!0,initPrice:{max:3e4,min:12e3},marketCap:695e9,mv:{divisor:100,max:65,min:55},name:a.LocationName.NewTokyoGlobalPharmaceuticals,otlkMag:10.5,spreadPerc:{divisor:10,max:10,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:r.StockSymbols[a.LocationName.NewTokyoGlobalPharmaceuticals]},{b:!0,initPrice:{max:27e3,min:15e3},marketCap:6e11,mv:{divisor:100,max:80,min:70},name:a.LocationName.IshimaNovaMedical,otlkMag:5,spreadPerc:{divisor:10,max:11,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:r.StockSymbols[a.LocationName.IshimaNovaMedical]},{b:!0,initPrice:{max:8500,min:4e3},marketCap:45e10,mv:{divisor:100,max:260,min:240},name:a.LocationName.AevumWatchdogSecurity,otlkMag:1.5,spreadPerc:{divisor:10,max:12,min:5},shareTxForMovement:{max:54e3,min:12e3},symbol:r.StockSymbols[a.LocationName.AevumWatchdogSecurity]},{b:!0,initPrice:{max:8e3,min:4500},marketCap:3e11,mv:{divisor:100,max:135,min:115},name:a.LocationName.VolhavenLexoCorp,otlkMag:6,spreadPerc:{divisor:10,max:12,min:5},shareTxForMovement:{max:108e3,min:36e3},symbol:r.StockSymbols[a.LocationName.VolhavenLexoCorp]},{b:!0,initPrice:{max:7e3,min:2e3},marketCap:18e10,mv:{divisor:100,max:70,min:50},name:a.LocationName.AevumRhoConstruction,otlkMag:1,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:126e3,min:6e4},symbol:r.StockSymbols[a.LocationName.AevumRhoConstruction]},{b:!0,initPrice:{max:8500,min:4e3},marketCap:24e10,mv:{divisor:100,max:205,min:175},name:a.LocationName.Sector12AlphaEnterprises,otlkMag:10,spreadPerc:{divisor:10,max:16,min:5},shareTxForMovement:{max:9e4,min:3e4},symbol:r.StockSymbols[a.LocationName.Sector12AlphaEnterprises]},{b:!0,initPrice:{max:8e3,min:3e3},marketCap:2e11,mv:{divisor:100,max:170,min:150},name:a.LocationName.VolhavenSysCoreSecurities,otlkMag:3,spreadPerc:{divisor:10,max:12,min:5},shareTxForMovement:{max:9e4,min:15e3},symbol:r.StockSymbols[a.LocationName.VolhavenSysCoreSecurities]},{b:!0,initPrice:{max:6e3,min:1e3},marketCap:185e9,mv:{divisor:100,max:100,min:80},name:a.LocationName.VolhavenCompuTek,otlkMag:4,spreadPerc:{divisor:10,max:12,min:4},shareTxForMovement:{max:126e3,min:6e4},symbol:r.StockSymbols[a.LocationName.VolhavenCompuTek]},{b:!0,initPrice:{max:5e3,min:1e3},marketCap:58e9,mv:{divisor:100,max:400,min:200},name:a.LocationName.AevumNetLinkTechnologies,otlkMag:1,spreadPerc:{divisor:10,max:20,min:5},shareTxForMovement:{max:54e3,min:18e3},symbol:r.StockSymbols[a.LocationName.AevumNetLinkTechnologies]},{b:!0,initPrice:{max:8e3,min:1e3},marketCap:6e10,mv:{divisor:100,max:110,min:90},name:a.LocationName.IshimaOmegaSoftware,otlkMag:.5,spreadPerc:{divisor:10,max:13,min:4},shareTxForMovement:{max:9e4,min:3e4},symbol:r.StockSymbols[a.LocationName.IshimaOmegaSoftware]},{b:!1,initPrice:{max:4500,min:500},marketCap:45e9,mv:{divisor:100,max:80,min:70},name:a.LocationName.Sector12FoodNStuff,otlkMag:1,spreadPerc:{divisor:10,max:10,min:6},shareTxForMovement:{max:18e4,min:6e4},symbol:r.StockSymbols[a.LocationName.Sector12FoodNStuff]},{b:!0,initPrice:{max:3500,min:1500},marketCap:3e10,mv:{divisor:100,max:275,min:100},name:"Sigma Cosmetics",otlkMag:0,spreadPerc:{divisor:10,max:14,min:6},shareTxForMovement:{max:7e4,min:2e4},symbol:r.StockSymbols["Sigma Cosmetics"]},{b:!0,initPrice:{max:1500,min:250},marketCap:42e9,mv:{divisor:100,max:350,min:200},name:"Joes Guns",otlkMag:1,spreadPerc:{divisor:10,max:14,min:6},shareTxForMovement:{max:52e3,min:15e3},symbol:r.StockSymbols["Joes Guns"]},{b:!0,initPrice:{max:1500,min:250},marketCap:1e11,mv:{divisor:100,max:175,min:120},name:"Catalyst Ventures",otlkMag:13.5,spreadPerc:{divisor:10,max:14,min:5},shareTxForMovement:{max:72e3,min:24e3},symbol:r.StockSymbols["Catalyst Ventures"]},{b:!0,initPrice:{max:3e4,min:15e3},marketCap:36e10,mv:{divisor:100,max:80,min:70},name:"Microdyne Technologies",otlkMag:8,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:216e3,min:9e4},symbol:r.StockSymbols["Microdyne Technologies"]},{b:!0,initPrice:{max:24e3,min:12e3},marketCap:42e10,mv:{divisor:100,max:70,min:50},name:"Titan Laboratories",otlkMag:11,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:216e3,min:9e4},symbol:r.StockSymbols["Titan Laboratories"]}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TicksPerCycle=75},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(122),a=n(117),i=n(87),o=n(76),s=n(2),l=n(8);function c(e,t){const n=t.symbolToStockMap[e.stockSymbol];if(!(n instanceof a.Stock))return void console.error(`Could not find stock for this order: ${e.stockSymbol}`);const c=t.stockMarket.Orders[n.symbol],u={rerenderFn:t.rerenderFn,suppressDialog:!0};let m=!0,p=!1;switch(e.type){case i.OrderTypes.LimitBuy:case i.OrderTypes.StopBuy:p=!0,e.pos===o.PositionTypes.Long?m=r.buyStock(n,e.shares,null,u)&&m:e.pos===o.PositionTypes.Short&&(m=r.shortStock(n,e.shares,null,u)&&m);break;case i.OrderTypes.LimitSell:case i.OrderTypes.StopSell:e.pos===o.PositionTypes.Long?m=r.sellStock(n,e.shares,null,u)&&m:e.pos===o.PositionTypes.Short&&(m=r.sellShort(n,e.shares,null,u)&&m);break;default:return void console.warn(`Invalid order type: ${e.type}`)}const h=e.pos===o.PositionTypes.Long?"Long":"Short";if(m){for(let r=0;r<c.length;++r)if(e==c[r])return c.splice(r,1),l.dialogBoxCreate(`${e.type} for ${n.symbol} @ ${s.numeralWrapper.formatMoney(e.price)} (${h}) was filled `+`(${s.numeralWrapper.formatBigNumber(Math.round(e.shares))} shares)`),void t.rerenderFn();console.error("Could not find the following Order in Order Book: "),console.error(e)}else p&&l.dialogBoxCreate(`Failed to execute ${e.type} for ${n.symbol} @ ${s.numeralWrapper.formatMoney(e.price)} (${h}). `+"This is most likely because you do not have enough money or the order would exceed the stock's maximum number of shares")}t.processOrders=function(e,t,n,r){let s=r.stockMarket.Orders;if(null==s){const e={};for(const t in r.stockMarket){const n=r.stockMarket[t];n instanceof a.Stock&&(e[n.symbol]=[])}return void(r.stockMarket.Orders=e)}let l=s[e.symbol];if(null==l||l.constructor!==Array)return console.error(`Invalid Order book for ${e.symbol} in processOrders(): ${l}`),void(l=[]);for(const a of l)if(a.type===t&&a.pos===n)switch(a.type){case i.OrderTypes.LimitBuy:a.pos===o.PositionTypes.Long&&e.price<=a.price?c(a,r):a.pos===o.PositionTypes.Short&&e.price>=a.price&&c(a,r);break;case i.OrderTypes.LimitSell:case i.OrderTypes.StopBuy:a.pos===o.PositionTypes.Long&&e.price>=a.price?c(a,r):a.pos===o.PositionTypes.Short&&e.price<=a.price&&c(a,r);break;case i.OrderTypes.StopSell:a.pos===o.PositionTypes.Long&&e.price<=a.price?c(a,r):a.pos===o.PositionTypes.Short&&e.price>=a.price&&c(a,r);break;default:return void console.warn(`Invalid order type: ${a.type}`)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(87),a=n(76),i=n(16);class o{static fromJSON(e){return i.Generic_fromJSON(o,e.data)}constructor(e="",t=0,n=0,i=r.OrderTypes.LimitBuy,o=a.PositionTypes.Long){let s=!1;if("number"==typeof t&&"number"==typeof n||(s=!0),(isNaN(t)||isNaN(n))&&(s=!0),"string"!=typeof e&&(s=!0),s)throw new Error("Invalid constructor paramters for Order");this.stockSymbol=e,this.shares=t,this.price=n,this.type=i,this.pos=o}toJSON(){return i.Generic_toJSON("Order",this)}}t.Order=o,i.Reviver.constructors.Order=o},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,function(e,t){},,,,,function(e,t,n){!function(e){"use strict";e.registerHelper("lint","netscript",function(t,n){if(!window.JSHINT)return window.console&&window.console.error("Error: window.JSHINT not defined, CodeMirror JavaScript linting cannot run."),[];const r=t.split("\n");for(let e=0;e<r.length;++e)r[e].match(/.*async function.+{/g)?r[e]+=" // jshint ignore:line":r[e].match(/.*await.+;/g)&&(r[e]+=" // jshint ignore:line");const a=r.join("\n");n.indent||(n.indent=1),n.esversion=9,JSHINT(a,n,n.globals);var i=JSHINT.data().errors,o=[];return i&&function(t,n){for(var r=0;r<t.length;r++){var a=t[r];if(a){if(0==a.line)continue;if(a.line<0){window.console&&window.console.warn("Cannot display JSHint error (invalid line "+a.line+")",a);continue}var i=a.character-1,o=i+1;if(a.evidence){var s=a.evidence.substring(i).search(/.\b/);s>-1&&(o+=s)}var l={message:a.reason,severity:a.code&&a.code.startsWith("W")?"warning":"error",from:e.Pos(a.line-1,i),to:e.Pos(a.line-1,o)};n.push(l)}}}(i,o),o})}(n(41))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){!function(e){"use strict";e.defineMode("netscript",function(t,n){var r,a,i=t.indentUnit,o=n.statementIndent,s=n.jsonld,l=n.json||s,c=n.typescript,u=n.wordCharacters||/[\w$\xa1-\uffff]/,m=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),a=e("keyword d"),i=e("operator"),o={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:a,break:a,continue:a,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r,hack:o,hackAnalyzeThreads:o,hackAnalyzePercent:o,hackChance:o,sleep:o,grow:o,weaken:o,growthAnalyze:o,print:o,tprint:o,scan:o,nuke:o,brutessh:o,ftpcrack:o,clearLog:o,disableLog:o,enableLog:o,isLogEnabled:o,getScriptLogs:o,tail:o,relaysmtp:o,httpworm:o,sqlinject:o,run:o,exec:o,spawn:o,kill:o,killall:o,exit:o,scp:o,ls:o,ps:o,hasRootAccess:o,getIp:o,getHackingMultipliers:o,getBitNodeMultipliers:o,getStats:o,isBusy:o,getHacknetMultipliers:o,getHostname:o,getHackingLevel:o,getServerMoneyAvailable:o,getServerMaxMoney:o,getServerGrowth:o,getServerSecurityLevel:o,getServerBaseSecurityLevel:o,getServerMinSecurityLevel:o,getServerRequiredHackingLevel:o,getServerNumPortsRequired:o,getServerRam:o,serverExists:o,fileExists:o,isRunning:o,deleteServer:o,getPurchasedServers:o,getPurchasedServerLimit:o,getPurchasedServerMaxRam:o,getPurchasedServerCost:o,purchaseServer:o,round:o,write:o,tryWrite:o,read:o,peek:o,clear:o,rm:o,getPortHandle:o,scriptRunning:o,scriptKill:o,getScriptName:o,getScriptRam:o,getHackTime:o,getGrowTime:o,getWeakenTime:o,getScriptIncome:o,getScriptExpGain:o,getTimeSinceLastAug:o,prompt:o,universityCourse:o,getCharacterInformation:o,gymWorkout:o,travelToCity:o,purchaseTor:o,purchaseProgram:o,upgradeHomeRam:o,getUpgradeHomeRamCost:o,workForCompany:o,applyToCompany:o,getCompanyRep:o,getCompanyFavor:o,stopAction:o,getFactionFavor:o,getFavorToDonate:o,getFactionFavorGain:o,getCompanyFavorGain:o,checkFactionInvitations:o,joinFaction:o,workForFaction:o,getFactionRep:o,donateToFaction:o,createProgram:o,commitCrime:o,getCrimeChance:o,getOwnedAugmentations:o,getOwnedSourceFiles:o,getAugmentationsFromFaction:o,getAugmentationPrereq:o,getAugmentationCost:o,purchaseAugmentation:o,installAugmentations:o,getStockPrice:o,getStockAskPrice:o,getStockBidPrice:o,getStockPosition:o,getStockSymbols:o,getStockMaxShares:o,getStockPurchaseCost:o,getStockSaleGain:o,buyStock:o,sellStock:o,shortStock:o,sellShort:o,placeOrder:o,cancelOrder:o,getOrders:o,getStockVolatility:o,getStockForecast:o,purchase4SMarketData:o,purchase4SMarketDataTixApi:o,hacknet:o,numNodes:o,purchaseNode:o,getPurchaseNodeCost:o,getNodeStats:o,upgradeLevel:o,upgradeRam:o,upgradeCore:o,upgradeCache:o,getLevelUpgradeCost:o,getRamUpgradeCost:o,getCoreUpgradeCost:o,getCacheUpgradeCost:o,gang:o,getMemberNames:o,getGangInformation:o,getMemberInformation:o,canRecruitMember:o,recruitMember:o,getTaskNames:o,setMemberTask:o,getEquipmentNames:o,getEquipmentCost:o,getEquipmentType:o,purchaseEquipment:o,ascendMember:o,setTerritoryWarfare:o,getChanceToWinClash:o,getBonusTime:o,bladeburner:o,getContractNames:o,getOperationNames:o,getBlackOpNames:o,getGeneralActionNames:o,getSkillNames:o,startAction:o,stopBladeburnerAction:o,getCurrentAction:o,getActionTime:o,getActionEstimatedSuccessChance:o,getActionCountRemaining:o,getActionMaxLevel:o,getActionCurrentLevel:o,getActionAutolevel:o,getActionRepGain:o,setActionAutolevel:o,setActionLevel:o,getRank:o,getBlackOpRank:o,getSkillPoints:o,getSkillLevel:o,getSkillUpgradeCost:o,upgradeSkill:o,getTeamSize:o,getCity:o,setTeamSize:o,getCityEstimatedPopulation:o,getCityEstimatedCommunities:o,getCityChaos:o,switchCity:o,getStamina:o,joinBladeburnerFaction:o,codingcontract:o,attempt:o,getContractType:o,getData:o,getDescription:o,getNumTriesRemaining:o,sleeve:o,getNumSleeves:o,setToShockRecovery:o,setToSynchronize:o,setToCommitCrime:o,setToUniversityCourse:o,travel:o,setToCompanyWork:o,setToFactionWork:o,setToGymWorkout:o,getSleeveStats:o,getTask:o,getInformation:o,getSleeveAugmentations:o,getSleevePurchasableAugs:o,purchaseSleeveAug:o}}(),p=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function d(e,t,n){return r=e,a=n,t}function _(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=function(e){return function(t,n){var r,a=!1;if(s&&"@"==t.peek()&&t.match(h))return n.tokenize=_,d("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||a);)a=!a&&"\\"==r;return a||(n.tokenize=_),d("string","string")}}(n),t.tokenize(e,t);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return d("number","number");if("."==n&&e.match(".."))return d("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return d(n);if("="==n&&e.eat(">"))return d("=>","operator");if("0"==n&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return d("number","number");if(/\d/.test(n))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),d("number","number");if("/"==n)return e.eat("*")?(t.tokenize=g,g(e,t)):e.eat("/")?(e.skipToEnd(),d("comment","comment")):Ve(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),d("regexp","string-2")):(e.eat("="),d("operator","operator",e.current()));if("`"==n)return t.tokenize=y,y(e,t);if("#"==n)return e.skipToEnd(),d("error","error");if(p.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),d("operator","operator",e.current());if(u.test(n)){e.eatWhile(u);var r=e.current();if("."!=t.lastType){if(m.propertyIsEnumerable(r)){var a=m[r];return d(a.type,a.style,r)}if("async"==r&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return d("async","keyword",r)}return d("variable","variable",r)}}function g(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=_;break}r="*"==n}return d("comment","comment")}function y(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=_;break}r=!r&&"\\"==n}return d("quasi","string-2",e.current())}var f="([{}])";function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var a=0,i=!1,o=n-1;o>=0;--o){var s=e.string.charAt(o),l=f.indexOf(s);if(l>=0&&l<3){if(!a){++o;break}if(0==--a){"("==s&&(i=!0);break}}else if(l>=3&&l<6)++a;else if(u.test(s))i=!0;else{if(/["'\/]/.test(s))return;if(i&&!a){++o;break}}}i&&!a&&(t.fatArrowAt=o)}}var E={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function v(e,t,n,r,a,i){this.indented=e,this.column=t,this.type=n,this.prev=a,this.info=i,null!=r&&(this.align=r)}function k(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}var C={state:null,column:null,marked:null,cc:null};function T(){for(var e=arguments.length-1;e>=0;e--)C.cc.push(arguments[e])}function P(){return T.apply(null,arguments),!0}function S(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function O(e){var t=C.state;if(C.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,n){if(n){if(n.block){var r=e(t,n.prev);return r?r==n.prev?n:new x(r,n.vars,!0):null}return S(t,n.vars)?n:new x(n.prev,new w(t,n.vars),!1)}return null}(e,t.context);if(null!=r)return void(t.context=r)}else if(!S(e,t.localVars))return void(t.localVars=new w(e,t.localVars));n.globalVars&&!S(e,t.globalVars)&&(t.globalVars=new w(e,t.globalVars))}function M(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function x(e,t,n){this.prev=e,this.vars=t,this.block=n}function w(e,t){this.name=e,this.next=t}var A=new w("this",new w("arguments",null));function N(){C.state.context=new x(C.state.context,C.state.localVars,!1),C.state.localVars=A}function R(){C.state.context=new x(C.state.context,C.state.localVars,!0),C.state.localVars=null}function D(){C.state.localVars=C.state.context.vars,C.state.context=C.state.context.prev}function I(e,t){var n=function(){var n=C.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var a=n.lexical;a&&")"==a.type&&a.align;a=a.prev)r=a.indented;n.lexical=new v(r,C.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function B(){var e=C.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function L(e){return function t(n){return n==e?P():";"==e||"}"==n||")"==n||"]"==n?T():P(t)}}function W(e,t){return"var"==e?P(I("vardef",t),fe,L(";"),B):"keyword a"==e?P(I("form"),H,W,B):"keyword b"==e?P(I("form"),W,B):"keyword d"==e?C.stream.match(/^\s*$/,!1)?P():P(I("stat"),K,L(";"),B):"debugger"==e?P(L(";")):"{"==e?P(I("}"),R,oe,B,D):";"==e?P():"if"==e?("else"==C.state.lexical.info&&C.state.cc[C.state.cc.length-1]==B&&C.state.cc.pop()(),P(I("form"),H,W,B,Te)):"function"==e?P(we):"for"==e?P(I("form"),Pe,W,B):"class"==e||c&&"interface"==t?(C.marked="keyword",P(I("form","class"==e?e:t),Ie,B)):"variable"==e?c&&"declare"==t?(C.marked="keyword",P(W)):c&&("module"==t||"enum"==t||"type"==t)&&C.stream.match(/^\s*\w/,!1)?(C.marked="keyword","enum"==t?P(Ye):"type"==t?P(Ne,L("operator"),ue,L(";")):P(I("form"),be,L("{"),I("}"),oe,B,B)):c&&"namespace"==t?(C.marked="keyword",P(I("form"),j,W,B)):c&&"abstract"==t?(C.marked="keyword",P(W)):P(I("stat"),Z):"switch"==e?P(I("form"),H,L("{"),I("}","switch"),R,oe,B,B,D):"case"==e?P(j,L(":")):"default"==e?P(L(":")):"catch"==e?P(I("form"),N,F,W,B,D):"export"==e?P(I("stat"),Fe,B):"import"==e?P(I("stat"),Ue,B):"async"==e?P(W):"@"==t?P(j,W):T(I("stat"),j,L(";"),B)}function F(e){if("("==e)return P(Re,L(")"))}function j(e,t){return G(e,t,!1)}function U(e,t){return G(e,t,!0)}function H(e){return"("!=e?T():P(I(")"),j,L(")"),B)}function G(e,t,n){if(C.state.fatArrowAt==C.stream.start){var r=n?J:V;if("("==e)return P(N,I(")"),ae(Re,")"),B,L("=>"),r,D);if("variable"==e)return T(N,be,L("=>"),r,D)}var a=n?q:$;return E.hasOwnProperty(e)?P(a):"function"==e?P(we,a):"class"==e||c&&"interface"==t?(C.marked="keyword",P(I("form"),De,B)):"keyword c"==e||"async"==e?P(n?U:j):"("==e?P(I(")"),K,L(")"),B,a):"operator"==e||"spread"==e?P(n?U:j):"["==e?P(I("]"),qe,B,a):"{"==e?ie(te,"}",null,a):"quasi"==e?T(Y,a):"new"==e?P(function(e){return function(t){return"."==t?P(e?Q:X):"variable"==t&&c?P(_e,e?q:$):T(e?U:j)}}(n)):"import"==e?P(j):P()}function K(e){return e.match(/[;\}\)\],]/)?T():T(j)}function $(e,t){return","==e?P(j):q(e,t,!1)}function q(e,t,n){var r=0==n?$:q,a=0==n?j:U;return"=>"==e?P(N,n?J:V,D):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?P(r):c&&"<"==t&&C.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?P(I(">"),ae(ue,">"),B,r):"?"==t?P(j,L(":"),a):P(a):"quasi"==e?T(Y,r):";"!=e?"("==e?ie(U,")","call",r):"."==e?P(ee,r):"["==e?P(I("]"),K,L("]"),B,r):c&&"as"==t?(C.marked="keyword",P(ue,r)):"regexp"==e?(C.state.lastType=C.marked="operator",C.stream.backUp(C.stream.pos-C.stream.start-1),P(a)):void 0:void 0}function Y(e,t){return"quasi"!=e?T():"${"!=t.slice(t.length-2)?P(Y):P(j,z)}function z(e){if("}"==e)return C.marked="string-2",C.state.tokenize=y,P(Y)}function V(e){return b(C.stream,C.state),T("{"==e?W:j)}function J(e){return b(C.stream,C.state),T("{"==e?W:U)}function X(e,t){if("target"==t)return C.marked="keyword",P($)}function Q(e,t){if("target"==t)return C.marked="keyword",P(q)}function Z(e){return":"==e?P(B,W):T($,L(";"),B)}function ee(e){if("variable"==e)return C.marked="property",P()}function te(e,t){if("async"==e)return C.marked="property",P(te);if("variable"==e||"keyword"==C.style){return C.marked="property","get"==t||"set"==t?P(ne):(c&&C.state.fatArrowAt==C.stream.start&&(n=C.stream.match(/^\s*:\s*/,!1))&&(C.state.fatArrowAt=C.stream.pos+n[0].length),P(re));var n}else{if("number"==e||"string"==e)return C.marked=s?"property":C.style+" property",P(re);if("jsonld-keyword"==e)return P(re);if(c&&M(t))return C.marked="keyword",P(te);if("["==e)return P(j,se,L("]"),re);if("spread"==e)return P(U,re);if("*"==t)return C.marked="keyword",P(te);if(":"==e)return T(re)}}function ne(e){return"variable"!=e?T(re):(C.marked="property",P(we))}function re(e){return":"==e?P(U):"("==e?T(we):void 0}function ae(e,t,n){function r(a,i){if(n?n.indexOf(a)>-1:","==a){var o=C.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),P(function(n,r){return n==t||r==t?T():T(e)},r)}return a==t||i==t?P():n&&n.indexOf(";")>-1?T(e):P(L(t))}return function(n,a){return n==t||a==t?P():T(e,r)}}function ie(e,t,n){for(var r=3;r<arguments.length;r++)C.cc.push(arguments[r]);return P(I(t,n),ae(e,t),B)}function oe(e){return"}"==e?P():T(W,oe)}function se(e,t){if(c){if(":"==e||"in"==t)return P(ue);if("?"==t)return P(se)}}function le(e){if(c&&":"==e)return C.stream.match(/^\s*\w+\s+is\b/,!1)?P(j,ce,ue):P(ue)}function ce(e,t){if("is"==t)return C.marked="keyword",P()}function ue(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(C.marked="keyword",P("typeof"==t?U:ue)):"variable"==e||"void"==t?(C.marked="type",P(de)):"string"==e||"number"==e||"atom"==e?P(de):"["==e?P(I("]"),ae(ue,"]",","),B,de):"{"==e?P(I("}"),ae(pe,"}",",;"),B,de):"("==e?P(ae(he,")"),me,de):"<"==e?P(ae(ue,">"),ue):void 0}function me(e){if("=>"==e)return P(ue)}function pe(e,t){return"variable"==e||"keyword"==C.style?(C.marked="property",P(pe)):"?"==t||"number"==e||"string"==e?P(pe):":"==e?P(ue):"["==e?P(L("variable"),se,L("]"),pe):"("==e?T(Ae,pe):void 0}function he(e,t){return"variable"==e&&C.stream.match(/^\s*[?:]/,!1)||"?"==t?P(he):":"==e?P(ue):"spread"==e?P(he):T(ue)}function de(e,t){return"<"==t?P(I(">"),ae(ue,">"),B,de):"|"==t||"."==e||"&"==t?P(ue):"["==e?P(ue,L("]"),de):"extends"==t||"implements"==t?(C.marked="keyword",P(ue)):"?"==t?P(ue,L(":"),ue):void 0}function _e(e,t){if("<"==t)return P(I(">"),ae(ue,">"),B,de)}function ge(){return T(ue,ye)}function ye(e,t){if("="==t)return P(ue)}function fe(e,t){return"enum"==t?(C.marked="keyword",P(Ye)):T(be,se,ke,Ce)}function be(e,t){return c&&M(t)?(C.marked="keyword",P(be)):"variable"==e?(O(t),P()):"spread"==e?P(be):"["==e?ie(ve,"]"):"{"==e?ie(Ee,"}"):void 0}function Ee(e,t){return"variable"!=e||C.stream.match(/^\s*:/,!1)?("variable"==e&&(C.marked="property"),"spread"==e?P(be):"}"==e?T():"["==e?P(j,L("]"),L(":"),Ee):P(L(":"),be,ke)):(O(t),P(ke))}function ve(){return T(be,ke)}function ke(e,t){if("="==t)return P(U)}function Ce(e){if(","==e)return P(fe)}function Te(e,t){if("keyword b"==e&&"else"==t)return P(I("form","else"),W,B)}function Pe(e,t){return"await"==t?P(Pe):"("==e?P(I(")"),Se,L(")"),B):void 0}function Se(e){return"var"==e?P(fe,L(";"),Me):";"==e?P(Me):"variable"==e?P(Oe):T(j,L(";"),Me)}function Oe(e,t){return"in"==t||"of"==t?(C.marked="keyword",P(j)):P($,Me)}function Me(e,t){return";"==e?P(xe):"in"==t||"of"==t?(C.marked="keyword",P(j)):T(j,L(";"),xe)}function xe(e){")"!=e&&P(j)}function we(e,t){return"*"==t?(C.marked="keyword",P(we)):"variable"==e?(O(t),P(we)):"("==e?P(N,I(")"),ae(Re,")"),B,le,W,D):c&&"<"==t?P(I(">"),ae(ge,">"),B,we):void 0}function Ae(e,t){return"*"==t?(C.marked="keyword",P(Ae)):"variable"==e?(O(t),P(Ae)):"("==e?P(N,I(")"),ae(Re,")"),B,le,D):c&&"<"==t?P(I(">"),ae(ge,">"),B,Ae):void 0}function Ne(e,t){return"keyword"==e||"variable"==e?(C.marked="type",P(Ne)):"<"==t?P(I(">"),ae(ge,">"),B):void 0}function Re(e,t){return"@"==t&&P(j,Re),"spread"==e?P(Re):c&&M(t)?(C.marked="keyword",P(Re)):T(be,se,ke)}function De(e,t){return"variable"==e?Ie(e,t):Be(e,t)}function Ie(e,t){if("variable"==e)return O(t),P(Be)}function Be(e,t){return"<"==t?P(I(">"),ae(ge,">"),B,Be):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(C.marked="keyword"),P(c?ue:j,Be)):"{"==e?P(I("}"),Le,B):void 0}function Le(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&M(t))&&C.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(C.marked="keyword",P(Le)):"variable"==e||"keyword"==C.style?(C.marked="property",P(c?We:we,Le)):"number"==e||"string"==e?P(c?We:we,Le):"["==e?P(j,se,L("]"),c?We:we,Le):"*"==t?(C.marked="keyword",P(Le)):c&&"("==e?T(Ae,Le):";"==e||","==e?P(Le):"}"==e?P():"@"==t?P(j,Le):void 0}function We(e,t){if("?"==t)return P(We);if(":"==e)return P(ue,ke);if("="==t)return P(U);var n=C.state.lexical.prev,r=n&&"interface"==n.info;return T(r?Ae:we)}function Fe(e,t){return"*"==t?(C.marked="keyword",P($e,L(";"))):"default"==t?(C.marked="keyword",P(j,L(";"))):"{"==e?P(ae(je,"}"),$e,L(";")):T(W)}function je(e,t){return"as"==t?(C.marked="keyword",P(L("variable"))):"variable"==e?T(U,je):void 0}function Ue(e){return"string"==e?P():"("==e?T(j):T(He,Ge,$e)}function He(e,t){return"{"==e?ie(He,"}"):("variable"==e&&O(t),"*"==t&&(C.marked="keyword"),P(Ke))}function Ge(e){if(","==e)return P(He,Ge)}function Ke(e,t){if("as"==t)return C.marked="keyword",P(He)}function $e(e,t){if("from"==t)return C.marked="keyword",P(j)}function qe(e){return"]"==e?P():T(ae(U,"]"))}function Ye(){return T(I("form"),be,L("{"),I("}"),ae(ze,"}"),B,B)}function ze(){return T(be,ke)}function Ve(e,t,n){return t.tokenize==_&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return D.lex=!0,B.lex=!0,{startState:function(e){var t={tokenize:_,lastType:"sof",cc:[],lexical:new v((e||0)-i,0,"block",!1),localVars:n.localVars,context:n.localVars&&new x(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=g&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=a&&"--"!=a?r:"incdec",function(e,t,n,r,a){var i=e.cc;for(C.state=e,C.stream=a,C.marked=null,C.cc=i,C.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=i.length?i.pop():l?j:W;if(o(n,r)){for(;i.length&&i[i.length-1].lex;)i.pop()();return C.marked?C.marked:"variable"==n&&k(e,r)?"variable-2":t}}}(t,n,r,a,e))},indent:function(t,r){if(t.tokenize==g)return e.Pass;if(t.tokenize!=_)return 0;var a,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==B)l=l.prev;else if(u!=Te)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(a=t.cc[t.cc.length-1])&&(a==$||a==q)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;o&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var m=l.type,h=s==m;return"vardef"==m?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==m&&"{"==s?l.indented:"form"==m?l.indented+i:"stat"==m?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||p.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?o||i:0):"switch"!=l.info||h||0==n.doubleIndentSwitch?l.align?l.column+(h?0:1):l.indented+(h?0:i):l.indented+(/^(?:case|default)\b/.test(r)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"netscript",jsonldMode:s,jsonMode:l,expressionAllowed:Ve,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=j&&t!=U||e.cc.pop()}}}),e.registerHelper("wordChars","netscript",/[\w$]/),e.defineMIME("text/netscript","netscript"),e.defineMIME("text/ecmascript","netscript"),e.defineMIME("application/netscript","netscript"),e.defineMIME("application/x-netscript","netscript"),e.defineMIME("application/ecmascript","netscript"),e.defineMIME("application/json",{name:"netscript",json:!0}),e.defineMIME("application/x-json",{name:"netscript",json:!0}),e.defineMIME("application/ld+json",{name:"netscript",jsonld:!0}),e.defineMIME("text/typescript",{name:"netscript",typescript:!0}),e.defineMIME("application/typescript",{name:"netscript",typescript:!0})}(n(41))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(107);ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),a=e("./text_highlight_rules").TextHighlightRules,i=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},i.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(i,a),i.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},i.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},i.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=i}),ace.define("ace/mode/netscript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){var a=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,o=e("./text_highlight_rules").TextHighlightRules,s="[a-zA-Z\\$_¡-][a-zA-Z\\d\\$_¡-]*";let l=function(){return function e(t){let n=[];for(const r of Object.keys(t))n.push(r),"object"==typeof t[r]&&(n=n.concat(e(t[r])));return n}(Object(r.a)(null)).sort().reverse().join("|")}();var c=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|ns|"+l+"|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[i.getStartRule("doc-start"),u("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+s+")(\\.)(prototype)(\\.)("+s+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+s+")(\\.)("+s+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+s+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+s+")(\\.)("+s+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+s+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+s+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void)\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:s},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+s+")(\\.)("+s+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:"/|"+l+"|/"},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:s},{regex:"",token:"empty",next:"no_regex"}],start:[i.getStartRule("doc-start"),u("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:s},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:n},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:n},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},e&&e.noES6||(this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){if(this.next="{"==e?this.nextState:"","{"==e&&n.length)n.unshift("start",t);else if("}"==e&&n.length&&(n.shift(),this.next=n.shift(),-1!=this.next.indexOf("string")||-1!=this.next.indexOf("jsx")))return"paren.quasi.end";return"{"==e?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:n},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),e&&0==e.jsx||function(){var e=s.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var r="/"==e.charAt(1)?2:1;return 1==r?(t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++):2==r&&t==this.nextState&&(n[1]--,(!n[1]||n[1]<0)&&(n.shift(),n.shift())),[{type:"meta.tag.punctuation."+(1==r?"":"end-")+"tag-open.xml",value:e.slice(0,r)},{type:"meta.tag.tag-name.xml",value:e.substr(r)}]},regex:"</?"+e,next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(t);var n={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[n,t,{include:"reference"},{defaultToken:"string"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(e,t,n){return t==n[0]&&n.shift(),2==e.length&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,u("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}.call(this)),this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};function u(e){return[{token:"comment",regex:/\/\*/,next:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[i.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}a.inherits(c,o),t.NetscriptHighlightRules=c}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,a=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var a=n[1].length,i=e.findMatchingBracket({row:t,column:a});if(!i||i.row==t)return 0;var o=this.$getIndent(e.getLine(i.row));e.replace(new r(t,0,t,a-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(a.prototype),t.MatchingBraceOutdent=a}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),a=e("../../range").Range,i=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,i),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var a=this._getFoldWidgetBase(e,t,n);return!a&&this.startRegionRe.test(r)?"start":a},this.getFoldWidgetRange=function(e,t,n,r){var a,i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);if(a=i.match(this.foldingStartMarker)){var o=a.index;if(a[1])return this.openingBracketBlock(e,a[1],n,o);var s=e.getCommentFoldRange(n,o+a[0].length,1);return s&&!s.isMultiLine()&&(r?s=this.getSectionRange(e,n):"all"!=t&&(s=null)),s}if("markbegin"!==t&&(a=i.match(this.foldingStopMarker))){o=a.index+a[0].length;return a[1]?this.closingBracketBlock(e,a[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),i=t,o=n.length,s=t+=1,l=e.getLength();++t<l;){var c=(n=e.getLine(t)).search(/\S/);if(-1!==c){if(r>c)break;var u=this.getFoldWidgetRange(e,"all",t);if(u){if(u.start.row<=i)break;if(u.isMultiLine())t=u.end.row;else if(r==c)break}s=t}}return new a(i,o,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),i=e.getLength(),o=n,s=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++n<i;){t=e.getLine(n);var c=s.exec(t);if(c&&(c[1]?l--:l++,!l))break}if(n>o)return new a(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/netscript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/netscript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,r){var a=e("../lib/oop"),i=e("./text").Mode,o=e("./netscript_highlight_rules").NetscriptHighlightRules,s=e("./matching_brace_outdent").MatchingBraceOutdent,l=e("../worker/worker_client").WorkerClient,c=e("./behaviour/cstyle").CstyleBehaviour,u=e("./folding/cstyle").FoldMode,m=function(){this.HighlightRules=o,this.$outdent=new s,this.$behaviour=new c,this.foldingRules=new u};a.inherits(m,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),a=this.getTokenizer().getLineTokens(t,e),i=a.tokens,o=a.state;if(i.length&&"comment"==i[i.length-1].type)return r;if("start"==e||"no_regex"==e)(s=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o||"no_regex"==o)return"";var s;(s=t.match(/^\s*(\/?)\*/))&&(s[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new l(["ace"],n(266),"JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/netscript"}.call(m.prototype),t.Mode=m})},,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(75);t.getSubdirectories=function(e,t){const n=[];if(!r.isValidDirectoryPath(t))return n;let a=t;function i(e){if("/"===a&&r.isInRootDirectory(e)){const t=r.getFirstParentDirectory(e);"/"===t||n.includes(t)||n.push(t)}else if(e.startsWith(a)){const t=e.slice(a.length),i=r.getFirstParentDirectory(t);"/"===i||n.includes(i)||n.push(i)}}a.endsWith("/")||(a+="/");for(const t of e.scripts)i(t.filename);for(const t of e.textFiles)i(t.fn);return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7);t.DarkWebItem=class{constructor(e,t,n){this.program=e,this.price=t,this.description=n}toString(){return[this.program,"$"+r.formatNumber(this.price,0),this.description].join(" - ")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidNumber=function(e){return"number"==typeof e&&!isNaN(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashUpgradesMetadata=[{cost:4,costPerLevel:4,desc:"Sell hashes for $1m",name:"Sell for Money",value:1e6},{costPerLevel:100,desc:"Sell hashes for $1b in Corporation funds",name:"Sell for Corporation Funds",value:1e9},{costPerLevel:50,desc:"Use hashes to decrease the minimum security of a single server by 2%. Note that a server's minimum security cannot go below 1. This effect persists until you install Augmentations (since servers are reset at that time).",hasTargetServer:!0,name:"Reduce Minimum Security",value:.98},{costPerLevel:50,desc:"Use hashes to increase the maximum amount of money on a single server by 2%. This effect persists until you install Augmentations (since servers are reset at that time).",hasTargetServer:!0,name:"Increase Maximum Money",value:1.02},{costPerLevel:50,desc:"Use hashes to improve the experience earned when studying at a university by 20%. This effect persists until you install Augmentations",name:"Improve Studying",value:20},{costPerLevel:50,desc:"Use hashes to improve the experience earned when training at the gym by 20%. This effect persists until you install Augmentations",name:"Improve Gym Training",value:20},{costPerLevel:200,desc:"Exchange hashes for 1k Scientific Research in all of your Corporation's Industries",name:"Exchange for Corporation Research",value:1e3},{costPerLevel:250,desc:"Exchange hashes for 100 Bladeburner Rank",name:"Exchange for Bladeburner Rank",value:100},{costPerLevel:250,desc:"Exchanges hashes for 10 Bladeburner Skill Points",name:"Exchange for Bladeburner SP",value:10},{costPerLevel:200,desc:"Generate a random Coding Contract somewhere on the network",name:"Generate Coding Contract",value:1}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.HashUpgrade=class{constructor(e){this.costPerLevel=0,this.desc="",this.hasTargetServer=!1,this.name="",this.value=0,null!=e.cost&&(this.cost=e.cost),this.costPerLevel=e.costPerLevel,this.desc=e.desc,this.hasTargetServer=!!e.hasTargetServer&&e.hasTargetServer,this.name=e.name,this.value=e.value}getCost(e){return"number"==typeof this.cost?this.cost:Math.round((e+1)*this.costPerLevel)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6);function a(e){return function(t){return t.hacking_skill>=e}}t.programsMetadata=[{key:"NukeProgram",name:"NUKE.exe",create:{level:1,tooltip:"This virus is used to gain root access to a machine if enough ports are opened.",req:a(1),time:r.CONSTANTS.MillisecondsPerFiveMinutes}},{key:"BruteSSHProgram",name:"BruteSSH.exe",create:{level:50,tooltip:"This program executes a brute force attack that opens SSH ports",req:a(50),time:2*r.CONSTANTS.MillisecondsPerFiveMinutes}},{key:"FTPCrackProgram",name:"FTPCrack.exe",create:{level:100,tooltip:"This program cracks open FTP ports",req:a(100),time:r.CONSTANTS.MillisecondsPerHalfHour}},{key:"RelaySMTPProgram",name:"relaySMTP.exe",create:{level:250,tooltip:"This program opens SMTP ports by redirecting data",req:a(250),time:r.CONSTANTS.MillisecondsPer2Hours}},{key:"HTTPWormProgram",name:"HTTPWorm.exe",create:{level:500,tooltip:"This virus opens up HTTP ports",req:a(500),time:r.CONSTANTS.MillisecondsPer4Hours}},{key:"SQLInjectProgram",name:"SQLInject.exe",create:{level:750,tooltip:"This virus opens SQL ports",req:a(750),time:r.CONSTANTS.MillisecondsPer8Hours}},{key:"DeepscanV1",name:"DeepscanV1.exe",create:{level:75,tooltip:"This program allows you to use the scan-analyze command with a depth up to 5",req:a(75),time:r.CONSTANTS.MillisecondsPerQuarterHour}},{key:"DeepscanV2",name:"DeepscanV2.exe",create:{level:400,tooltip:"This program allows you to use the scan-analyze command with a depth up to 10",req:a(400),time:r.CONSTANTS.MillisecondsPer2Hours}},{key:"ServerProfiler",name:"ServerProfiler.exe",create:{level:75,tooltip:"This program is used to display hacking and Netscript-related information about servers",req:a(75),time:r.CONSTANTS.MillisecondsPerHalfHour}},{key:"AutoLink",name:"AutoLink.exe",create:{level:25,tooltip:"This program allows you to directly connect to other servers through the 'scan-analyze' command",req:a(25),time:r.CONSTANTS.MillisecondsPerQuarterHour}},{key:"BitFlume",name:"b1t_flum3.exe",create:{level:1,tooltip:"This program creates a portal to the BitNode Nexus (allows you to restart and switch BitNodes)",req:function(e){return e.sourceFiles.length>0&&e.hacking_skill>=1},time:r.CONSTANTS.MillisecondsPerFiveMinutes/20}},{key:"Flight",name:"fl1ght.exe",create:null}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Program=class{constructor(e,t){this.name="",this.name=e,this.create=t}htmlID(){return"create-program-"+(this.name.endsWith(".exe")?this.name.slice(0,-".exe".length):this.name)}}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.Popup=function(e){return r.createElement("div",{className:"popup-box-content",id:`${e.id}-content`},r.createElement(e.content,e.props))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(53);t.companyPositionMetadata=[{name:r.SoftwareCompanyPositions[0],nextPosition:r.SoftwareCompanyPositions[1],baseSalary:33,charismaEffectiveness:15,charismaExpGain:.02,hackingEffectiveness:85,hackingExpGain:.05,reqdHacking:1,repMultiplier:.9},{name:r.SoftwareCompanyPositions[1],nextPosition:r.SoftwareCompanyPositions[2],baseSalary:80,charismaEffectiveness:15,charismaExpGain:.05,hackingEffectiveness:85,hackingExpGain:.1,reqdHacking:51,reqdReputation:8e3,repMultiplier:1.1},{name:r.SoftwareCompanyPositions[2],nextPosition:r.SoftwareCompanyPositions[3],baseSalary:165,charismaEffectiveness:20,charismaExpGain:.08,hackingEffectiveness:80,hackingExpGain:.4,reqdCharisma:51,reqdHacking:251,reqdReputation:4e4,repMultiplier:1.3},{name:r.SoftwareCompanyPositions[3],nextPosition:r.SoftwareCompanyPositions[4],baseSalary:500,charismaEffectiveness:25,charismaExpGain:.1,hackingEffectiveness:75,hackingExpGain:.8,reqdCharisma:151,reqdHacking:401,reqdReputation:2e5,repMultiplier:1.5},{name:r.SoftwareCompanyPositions[4],nextPosition:r.SoftwareCompanyPositions[5],baseSalary:800,charismaEffectiveness:25,charismaExpGain:.5,hackingEffectiveness:75,hackingExpGain:1,reqdCharisma:251,reqdHacking:501,reqdReputation:4e5,repMultiplier:1.6},{name:r.SoftwareCompanyPositions[5],nextPosition:r.SoftwareCompanyPositions[6],baseSalary:1650,charismaEffectiveness:25,charismaExpGain:.5,hackingEffectiveness:75,hackingExpGain:1.1,reqdCharisma:251,reqdHacking:501,reqdReputation:8e5,repMultiplier:1.6},{name:r.SoftwareCompanyPositions[6],nextPosition:r.SoftwareCompanyPositions[7],baseSalary:2310,charismaEffectiveness:30,charismaExpGain:.6,hackingEffectiveness:70,hackingExpGain:1.2,reqdCharisma:401,reqdHacking:601,reqdReputation:16e5,repMultiplier:1.75},{name:r.SoftwareCompanyPositions[7],nextPosition:null,baseSalary:2640,charismaEffectiveness:35,charismaExpGain:1,hackingEffectiveness:65,hackingExpGain:1.5,reqdCharisma:501,reqdHacking:751,reqdReputation:32e5,repMultiplier:2},{name:r.ITCompanyPositions[0],nextPosition:r.ITCompanyPositions[1],baseSalary:26,charismaEffectiveness:10,charismaExpGain:.01,hackingEffectiveness:90,hackingExpGain:.04,reqdHacking:1,repMultiplier:.9},{name:r.ITCompanyPositions[1],nextPosition:r.ITCompanyPositions[2],baseSalary:66,charismaEffectiveness:15,charismaExpGain:.02,hackingEffectiveness:85,hackingExpGain:.08,reqdHacking:26,reqdReputation:7e3,repMultiplier:1.1},{name:r.ITCompanyPositions[2],nextPosition:r.ITCompanyPositions[3],baseSalary:132,charismaEffectiveness:20,charismaExpGain:.1,hackingEffectiveness:80,hackingExpGain:.3,reqdCharisma:51,reqdHacking:151,reqdReputation:35e3,repMultiplier:1.3},{name:r.ITCompanyPositions[3],nextPosition:r.SoftwareCompanyPositions[5],baseSalary:410,charismaEffectiveness:20,charismaExpGain:.2,hackingEffectiveness:80,hackingExpGain:.5,reqdCharisma:76,reqdHacking:251,reqdReputation:175e3,repMultiplier:1.4},{name:r.SecurityEngineerCompanyPositions[0],nextPosition:r.SoftwareCompanyPositions[5],baseSalary:121,charismaEffectiveness:15,charismaExpGain:.05,hackingEffectiveness:85,hackingExpGain:.4,reqdCharisma:26,reqdHacking:151,reqdReputation:35e3,repMultiplier:1.2},{name:r.NetworkEngineerCompanyPositions[0],nextPosition:r.NetworkEngineerCompanyPositions[1],baseSalary:121,charismaEffectiveness:15,charismaExpGain:.05,hackingEffectiveness:85,hackingExpGain:.4,reqdCharisma:26,reqdHacking:151,reqdReputation:35e3,repMultiplier:1.2},{name:r.NetworkEngineerCompanyPositions[1],nextPosition:r.SoftwareCompanyPositions[5],baseSalary:410,charismaEffectiveness:20,charismaExpGain:.1,hackingEffectiveness:80,hackingExpGain:.5,reqdCharisma:76,reqdHacking:251,reqdReputation:175e3,repMultiplier:1.3},{name:r.BusinessCompanyPositions[0],nextPosition:r.BusinessCompanyPositions[1],baseSalary:46,charismaEffectiveness:90,charismaExpGain:.08,hackingEffectiveness:10,hackingExpGain:.01,reqdCharisma:1,reqdHacking:1,repMultiplier:.9},{name:r.BusinessCompanyPositions[1],nextPosition:r.BusinessCompanyPositions[2],baseSalary:100,charismaEffectiveness:85,charismaExpGain:.15,hackingEffectiveness:15,hackingExpGain:.02,reqdCharisma:51,reqdHacking:6,reqdReputation:8e3,repMultiplier:1.1},{name:r.BusinessCompanyPositions[2],nextPosition:r.BusinessCompanyPositions[3],baseSalary:200,charismaEffectiveness:85,charismaExpGain:.3,hackingEffectiveness:15,hackingExpGain:.02,reqdCharisma:101,reqdHacking:51,reqdReputation:4e4,repMultiplier:1.3},{name:r.BusinessCompanyPositions[3],nextPosition:r.BusinessCompanyPositions[4],baseSalary:660,charismaEffectiveness:85,charismaExpGain:.4,hackingEffectiveness:15,hackingExpGain:.02,reqdCharisma:226,reqdHacking:51,reqdReputation:2e5,repMultiplier:1.5},{name:r.BusinessCompanyPositions[4],nextPosition:r.BusinessCompanyPositions[5],baseSalary:1950,charismaEffectiveness:90,charismaExpGain:1,hackingEffectiveness:10,hackingExpGain:.05,reqdCharisma:501,reqdHacking:76,reqdReputation:8e5,repMultiplier:1.6},{name:r.BusinessCompanyPositions[5],nextPosition:null,baseSalary:3900,charismaEffectiveness:90,charismaExpGain:1.5,hackingEffectiveness:10,hackingExpGain:.05,reqdCharisma:751,reqdHacking:101,reqdReputation:32e5,repMultiplier:1.75},{name:r.SecurityCompanyPositions[0],nextPosition:r.SecurityCompanyPositions[1],baseSalary:82,hackingEffectiveness:5,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.02,strengthExpGain:.08,defenseExpGain:.08,dexterityExpGain:.08,agilityExpGain:.08,charismaExpGain:.04,reqdHacking:11,reqdStrength:101,reqdDefense:101,reqdDexterity:101,reqdAgility:101,reqdCharisma:51,reqdReputation:8e3,repMultiplier:1},{name:r.SecurityCompanyPositions[1],nextPosition:null,baseSalary:460,hackingEffectiveness:5,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.02,strengthExpGain:.1,defenseExpGain:.1,dexterityExpGain:.1,agilityExpGain:.1,charismaExpGain:.1,reqdHacking:101,reqdStrength:301,reqdDefense:301,reqdDexterity:301,reqdAgility:301,reqdCharisma:151,reqdReputation:36e3,repMultiplier:1.25},{name:r.SecurityCompanyPositions[2],nextPosition:r.SecurityCompanyPositions[3],baseSalary:50,hackingEffectiveness:5,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.01,strengthExpGain:.04,defenseExpGain:.04,dexterityExpGain:.04,agilityExpGain:.04,charismaExpGain:.02,reqdStrength:51,reqdDefense:51,reqdDexterity:51,reqdAgility:51,reqdCharisma:1,repMultiplier:1},{name:r.SecurityCompanyPositions[3],nextPosition:r.SecurityCompanyPositions[4],baseSalary:195,hackingEffectiveness:10,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:10,hackingExpGain:.02,strengthExpGain:.1,defenseExpGain:.1,dexterityExpGain:.1,agilityExpGain:.1,charismaExpGain:.05,reqdHacking:26,reqdStrength:151,reqdDefense:151,reqdDexterity:151,reqdAgility:151,reqdCharisma:51,reqdReputation:8e3,repMultiplier:1.1},{name:r.SecurityCompanyPositions[4],nextPosition:r.SecurityCompanyPositions[5],baseSalary:660,hackingEffectiveness:10,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:15,agilityEffectiveness:15,charismaEffectiveness:30,hackingExpGain:.02,strengthExpGain:.12,defenseExpGain:.12,dexterityExpGain:.12,agilityExpGain:.12,charismaExpGain:.1,reqdHacking:26,reqdStrength:251,reqdDefense:251,reqdDexterity:251,reqdAgility:251,reqdCharisma:101,reqdReputation:36e3,repMultiplier:1.25},{name:r.SecurityCompanyPositions[5],nextPosition:null,baseSalary:1320,hackingEffectiveness:10,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:15,agilityEffectiveness:15,charismaEffectiveness:30,hackingExpGain:.05,strengthExpGain:.15,defenseExpGain:.15,dexterityExpGain:.15,agilityExpGain:.15,charismaExpGain:.15,reqdHacking:51,reqdStrength:501,reqdDefense:501,reqdDexterity:501,reqdAgility:501,reqdCharisma:151,reqdReputation:144e3,repMultiplier:1.4},{name:r.AgentCompanyPositions[0],nextPosition:r.AgentCompanyPositions[1],baseSalary:330,hackingEffectiveness:10,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:20,hackingExpGain:.04,strengthExpGain:.08,defenseExpGain:.08,dexterityExpGain:.08,agilityExpGain:.08,charismaExpGain:.05,reqdHacking:101,reqdStrength:101,reqdDefense:101,reqdDexterity:101,reqdAgility:101,reqdCharisma:101,reqdReputation:8e3,repMultiplier:1},{name:r.AgentCompanyPositions[1],nextPosition:r.AgentCompanyPositions[2],baseSalary:990,hackingEffectiveness:15,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.1,strengthExpGain:.15,defenseExpGain:.15,dexterityExpGain:.15,agilityExpGain:.15,charismaExpGain:.1,reqdHacking:201,reqdStrength:251,reqdDefense:251,reqdDexterity:251,reqdAgility:251,reqdCharisma:201,reqdReputation:32e3,repMultiplier:1.25},{name:r.AgentCompanyPositions[2],nextPosition:null,baseSalary:2e3,hackingEffectiveness:15,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.15,strengthExpGain:.2,defenseExpGain:.2,dexterityExpGain:.2,agilityExpGain:.2,charismaExpGain:.15,reqdHacking:251,reqdStrength:501,reqdDefense:501,reqdDexterity:501,reqdAgility:501,reqdCharisma:251,reqdReputation:162e3,repMultiplier:1.5},{name:r.MiscCompanyPositions[0],nextPosition:null,baseSalary:22,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.02,defenseExpGain:.02,dexterityExpGain:.02,agilityExpGain:.02,charismaExpGain:.05,repMultiplier:1},{name:r.MiscCompanyPositions[1],nextPosition:null,baseSalary:22,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.02,defenseExpGain:.02,dexterityExpGain:.02,agilityExpGain:.02,charismaExpGain:.04,repMultiplier:1},{name:r.SoftwareConsultantCompanyPositions[0],nextPosition:r.SoftwareConsultantCompanyPositions[1],baseSalary:66,hackingEffectiveness:80,charismaEffectiveness:20,hackingExpGain:.08,charismaExpGain:.03,reqdHacking:51,repMultiplier:1},{name:r.SoftwareConsultantCompanyPositions[1],nextPosition:null,baseSalary:132,hackingEffectiveness:75,charismaEffectiveness:25,hackingExpGain:.25,charismaExpGain:.06,reqdHacking:251,reqdCharisma:51,repMultiplier:1.2},{name:r.BusinessConsultantCompanyPositions[0],nextPosition:r.BusinessConsultantCompanyPositions[1],baseSalary:66,hackingEffectiveness:20,charismaEffectiveness:80,hackingExpGain:.015,charismaExpGain:.15,reqdHacking:6,reqdCharisma:51,repMultiplier:1},{name:r.BusinessConsultantCompanyPositions[1],nextPosition:null,baseSalary:525,hackingEffectiveness:15,charismaEffectiveness:85,hackingExpGain:.015,charismaExpGain:.3,reqdHacking:51,reqdCharisma:226,repMultiplier:1.2},{name:r.PartTimeCompanyPositions[0],nextPosition:null,baseSalary:20,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.0075,defenseExpGain:.0075,dexterityExpGain:.0075,agilityExpGain:.0075,charismaExpGain:.04,repMultiplier:1},{name:r.PartTimeCompanyPositions[1],nextPosition:null,baseSalary:20,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.0075,defenseExpGain:.0075,dexterityExpGain:.0075,agilityExpGain:.0075,charismaExpGain:.03,repMultiplier:1}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(53),a=n(36),i={},o={},s={},l={},c={},u={},m={},p={},h={},d={},_={},g={},y={},f={},b={},E={},v={},k={},C={};r.SoftwareCompanyPositions.forEach(e=>{i[e]=!0,c[e]=!0}),r.ITCompanyPositions.forEach(e=>{o[e]=!0,c[e]=!0}),r.NetworkEngineerCompanyPositions.forEach(e=>{s[e]=!0,c[e]=!0}),c[r.SecurityEngineerCompanyPositions[0]]=!0,l[r.SecurityEngineerCompanyPositions[0]]=!0,r.BusinessCompanyPositions.forEach(e=>{u[e]=!0}),r.SecurityCompanyPositions.forEach(e=>{p[e]=!0}),r.AgentCompanyPositions.forEach(e=>{m[e]=!0}),r.SoftwareConsultantCompanyPositions.forEach(e=>{h[e]=!0}),r.BusinessConsultantCompanyPositions.forEach(e=>{d[e]=!0});for(let e=0;e<r.SoftwareCompanyPositions.length;++e){const t=r.SoftwareCompanyPositions[e];e<=5&&(_[t]=!0),e<=3&&(g[t]=!0)}for(let e=0;e<r.BusinessCompanyPositions.length;++e){const t=r.BusinessCompanyPositions[e];e<=3&&(y[t]=!0)}f[r.MiscCompanyPositions[0]]=!0,b[r.MiscCompanyPositions[1]]=!0,E[r.PartTimeCompanyPositions[0]]=!0,v[r.PartTimeCompanyPositions[1]]=!0,k[r.BusinessCompanyPositions[3]]=!0,C[r.BusinessCompanyPositions[5]]=!0,t.companiesMetadata=[{name:a.LocationName.AevumECorp,info:"",companyPositions:Object.assign({},c,u,p),expMultiplier:3,salaryMultiplier:3,jobStatReqOffset:249},{name:a.LocationName.Sector12MegaCorp,info:"",companyPositions:Object.assign({},c,u,p),expMultiplier:3,salaryMultiplier:3,jobStatReqOffset:249},{name:a.LocationName.AevumBachmanAndAssociates,info:"",companyPositions:Object.assign({},c,u,p),expMultiplier:2.6,salaryMultiplier:2.6,jobStatReqOffset:224},{name:a.LocationName.Sector12BladeIndustries,info:"",companyPositions:Object.assign({},c,u,p),expMultiplier:2.75,salaryMultiplier:2.75,jobStatReqOffset:224},{name:a.LocationName.VolhavenNWO,info:"",companyPositions:Object.assign({},c,u,p),expMultiplier:2.75,salaryMultiplier:2.75,jobStatReqOffset:249},{name:a.LocationName.AevumClarkeIncorporated,info:"",companyPositions:Object.assign({},c,u,p),expMultiplier:2.25,salaryMultiplier:2.25,jobStatReqOffset:224},{name:a.LocationName.VolhavenOmniTekIncorporated,info:"",companyPositions:Object.assign({},c,u,p),expMultiplier:2.25,salaryMultiplier:2.25,jobStatReqOffset:224},{name:a.LocationName.Sector12FourSigma,info:"",companyPositions:Object.assign({},c,u,p),expMultiplier:2.5,salaryMultiplier:2.5,jobStatReqOffset:224},{name:a.LocationName.ChongqingKuaiGongInternational,info:"",companyPositions:Object.assign({},c,u,p),expMultiplier:2.2,salaryMultiplier:2.2,jobStatReqOffset:224},{name:a.LocationName.AevumFulcrumTechnologies,info:"",companyPositions:Object.assign({},c,u),expMultiplier:2,salaryMultiplier:2,jobStatReqOffset:224},{name:a.LocationName.IshimaStormTechnologies,info:"",companyPositions:Object.assign({},c,h,u),expMultiplier:1.8,salaryMultiplier:1.8,jobStatReqOffset:199},{name:a.LocationName.NewTokyoDefComm,info:"",companyPositions:Object.assign({},C,c,h),expMultiplier:1.75,salaryMultiplier:1.75,jobStatReqOffset:199},{name:a.LocationName.VolhavenHeliosLabs,info:"",companyPositions:Object.assign({},C,c,h),expMultiplier:1.8,salaryMultiplier:1.8,jobStatReqOffset:199},{name:a.LocationName.NewTokyoVitaLife,info:"",companyPositions:Object.assign({},c,u,h),expMultiplier:1.8,salaryMultiplier:1.8,jobStatReqOffset:199},{name:a.LocationName.Sector12IcarusMicrosystems,info:"",companyPositions:Object.assign({},c,u,h),expMultiplier:1.9,salaryMultiplier:1.9,jobStatReqOffset:199},{name:a.LocationName.Sector12UniversalEnergy,info:"",companyPositions:Object.assign({},c,u,h),expMultiplier:2,salaryMultiplier:2,jobStatReqOffset:199},{name:a.LocationName.AevumGalacticCybersystems,info:"",companyPositions:Object.assign({},c,u,h),expMultiplier:1.9,salaryMultiplier:1.9,jobStatReqOffset:199},{name:a.LocationName.AevumAeroCorp,info:"",companyPositions:Object.assign({},C,k,c,p),expMultiplier:1.7,salaryMultiplier:1.7,jobStatReqOffset:199},{name:a.LocationName.VolhavenOmniaCybersystems,info:"",companyPositions:Object.assign({},C,k,c,p),expMultiplier:1.7,salaryMultiplier:1.7,jobStatReqOffset:199},{name:a.LocationName.ChongqingSolarisSpaceSystems,info:"",companyPositions:Object.assign({},C,k,c,p),expMultiplier:1.7,salaryMultiplier:1.7,jobStatReqOffset:199},{name:a.LocationName.Sector12DeltaOne,info:"",companyPositions:Object.assign({},C,k,c,p),expMultiplier:1.6,salaryMultiplier:1.6,jobStatReqOffset:199},{name:a.LocationName.NewTokyoGlobalPharmaceuticals,info:"",companyPositions:Object.assign({},c,u,h,p),expMultiplier:1.8,salaryMultiplier:1.8,jobStatReqOffset:224},{name:a.LocationName.IshimaNovaMedical,info:"",companyPositions:Object.assign({},c,u,h,p),expMultiplier:1.75,salaryMultiplier:1.75,jobStatReqOffset:199},{name:a.LocationName.Sector12CIA,info:"",companyPositions:Object.assign({},_,s,l,o,p,m),expMultiplier:2,salaryMultiplier:2,jobStatReqOffset:149},{name:a.LocationName.Sector12NSA,info:"",companyPositions:Object.assign({},_,s,l,o,p,m),expMultiplier:2,salaryMultiplier:2,jobStatReqOffset:149},{name:a.LocationName.AevumWatchdogSecurity,info:"",companyPositions:Object.assign({},_,s,o,p,m,h),expMultiplier:1.5,salaryMultiplier:1.5,jobStatReqOffset:124},{name:a.LocationName.VolhavenLexoCorp,info:"",companyPositions:Object.assign({},c,h,u,p),expMultiplier:1.4,salaryMultiplier:1.4,jobStatReqOffset:99},{name:a.LocationName.AevumRhoConstruction,info:"",companyPositions:Object.assign({},g,y),expMultiplier:1.3,salaryMultiplier:1.3,jobStatReqOffset:49},{name:a.LocationName.Sector12AlphaEnterprises,info:"",companyPositions:Object.assign({},g,y,h),expMultiplier:1.5,salaryMultiplier:1.5,jobStatReqOffset:99},{name:a.LocationName.AevumPolice,info:"",companyPositions:Object.assign({},p,g),expMultiplier:1.3,salaryMultiplier:1.3,jobStatReqOffset:99},{name:a.LocationName.VolhavenSysCoreSecurities,info:"",companyPositions:Object.assign({},c),expMultiplier:1.3,salaryMultiplier:1.3,jobStatReqOffset:124},{name:a.LocationName.VolhavenCompuTek,info:"",companyPositions:Object.assign({},c),expMultiplier:1.2,salaryMultiplier:1.2,jobStatReqOffset:74},{name:a.LocationName.AevumNetLinkTechnologies,info:"",companyPositions:Object.assign({},c),expMultiplier:1.2,salaryMultiplier:1.2,jobStatReqOffset:99},{name:a.LocationName.Sector12CarmichaelSecurity,info:"",companyPositions:Object.assign({},c,h,m,p),expMultiplier:1.2,salaryMultiplier:1.2,jobStatReqOffset:74},{name:a.LocationName.Sector12FoodNStuff,info:"",companyPositions:Object.assign({},b,v),expMultiplier:1,salaryMultiplier:1,jobStatReqOffset:0},{name:a.LocationName.Sector12JoesGuns,info:"",companyPositions:Object.assign({},b,v),expMultiplier:1,salaryMultiplier:1,jobStatReqOffset:0},{name:a.LocationName.IshimaOmegaSoftware,info:"",companyPositions:Object.assign({},i,h,o),expMultiplier:1.1,salaryMultiplier:1.1,jobStatReqOffset:49},{name:a.LocationName.NewTokyoNoodleBar,info:"",companyPositions:Object.assign({},f,E),expMultiplier:1,salaryMultiplier:1,jobStatReqOffset:0}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(2),i=n(73);t.CovenantSleeveMemoryUpgrade=class extends r.Component{constructor(e){super(e),this.state={amt:1},this.changePurchaseAmount=this.changePurchaseAmount.bind(this),this.purchaseMemory=this.purchaseMemory.bind(this)}changePurchaseAmount(e){const t=parseInt(e.target.value);this.setState({amt:t})}getPurchaseCost(){if(isNaN(this.state.amt))return 1/0;const e=100-this.props.sleeve.memory;return this.state.amt>e?1/0:this.props.sleeve.getMemoryUpgradeCost(this.state.amt)}purchaseMemory(){const e=this.getPurchaseCost();this.props.p.canAfford(e)&&(this.props.sleeve.upgradeMemory(this.state.amt),this.props.p.loseMoney(e),this.props.rerender())}render(){const e=`sleeve-${this.props.index}-memory-upgrade-input`,t=100-this.props.sleeve.memory,n=this.getPurchaseCost(),o=!this.props.p.canAfford(n);let s;return s=isNaN(this.state.amt)?"Invalid value":this.state.amt>t?"Memory cannot exceed 100":`Purchase ${this.state.amt} memory - ${a.numeralWrapper.formatMoney(n)}`,r.createElement("div",null,r.createElement("h2",null,r.createElement("u",null,"Upgrade Memory")),r.createElement("p",null,"Purchase a memory upgrade for your sleeve. Note that a sleeve's max memory is 100 (current: ",a.numeralWrapper.format(this.props.sleeve.memory,"0"),")"),r.createElement("label",{htmlFor:e},"Amount of memory to purchase (must be an integer):"),r.createElement("input",{id:e,onChange:this.changePurchaseAmount,type:"number",value:isNaN(this.state.amt)?this.state.amt.toString():this.state.amt}),r.createElement("br",null),r.createElement(i.StdButton,{disabled:o,onClick:this.purchaseMemory,text:s}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(685);t.CovenantSleeveUpgrades=class extends r.Component{render(){return r.createElement("div",{className:"bladeburner-action"},r.createElement("h1",null,"Duplicate Sleeve ",this.props.index),r.createElement(a.CovenantSleeveMemoryUpgrade,Object.assign({},this.props)))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(686),i=n(124),o=n(270),s=n(2),l=n(172),c=n(73),u=n(8);t.CovenantPurchasesRoot=class extends r.Component{constructor(e){super(e),this.state={update:0},this.rerender=this.rerender.bind(this)}purchaseCost(){return(this.props.p.sleevesFromCovenant+1)*o.BaseCostPerSleeve}rerender(){this.setState(e=>({update:e.update+1}))}render(){let e=!1;this.props.p.canAfford(this.purchaseCost())||(e=!0),this.props.p.sleevesFromCovenant>=o.MaxSleevesFromCovenant&&(e=!0);const t=[];for(let e=0;e<this.props.p.sleeves.length;++e){const n=this.props.p.sleeves[e];t.push(r.createElement(a.CovenantSleeveUpgrades,Object.assign({},this.props,{sleeve:n,index:e,rerender:this.rerender,key:e})))}return r.createElement("div",null,r.createElement(l.PopupCloseButton,{popup:o.PopupId,text:"Close"}),r.createElement("p",null,"Would you like to purchase an additional Duplicate Sleeve from The Covenant for ",s.numeralWrapper.formatMoney(this.purchaseCost()),"?"),r.createElement("br",null),r.createElement("p",null,"These Duplicate Sleeves are permanent (they persist through BitNodes). You can purchase a total of ",o.MaxSleevesFromCovenant," from The Covenant."),r.createElement(c.StdButton,{disabled:e,onClick:()=>{this.props.p.sleevesFromCovenant>=o.MaxSleevesFromCovenant||(this.props.p.canAfford(this.purchaseCost())?(this.props.p.loseMoney(this.purchaseCost()),this.props.p.sleevesFromCovenant+=1,this.props.p.sleeves.push(new i.Sleeve(this.props.p)),this.rerender()):u.dialogBoxCreate("You cannot afford to purchase a Duplicate Sleeve",!1))},text:"Purchase"}),r.createElement("br",null),r.createElement("br",null),r.createElement("p",null,"Here, you can also purchase upgrades for your Duplicate Sleeves. These upgrades are also permanent, meaning they persist across BitNodes."),t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(73);t.Option=class extends r.Component{render(){return r.createElement("div",{className:"faction-work-div"},r.createElement("div",{className:"faction-work-div-wrapper"},r.createElement(a.StdButton,{onClick:this.props.onClick,text:this.props.buttonText}),r.createElement("p",null,this.props.infoText)))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.ParagraphWithTooltip=class extends r.Component{render(){return r.createElement("p",{className:"tooltip",style:this.props.style},this.props.text,r.createElement("span",{className:"tooltiptext"},this.props.tooltip))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1);t.AutoupdatingParagraph=class extends r.Component{constructor(e){super(e),this.interval=0,this.state={i:0}}componentDidMount(){const e=this.props.intervalTime?this.props.intervalTime:1e3;this.interval=setInterval(()=>this.tick(),e)}componentWillUnmount(){clearInterval(this.interval)}tick(){this.setState(e=>({i:e.i+1}))}render(){let e,t,n=null!=this.props.getTooltip;return n&&""===(e=this.props.getTooltip())&&(n=!1),n&&(t={__html:e}),r.createElement("p",{className:"tooltip",style:this.props.style},this.props.getText(),n&&r.createElement("span",{className:"tooltiptext",dangerouslySetInnerHTML:t}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(2),i=n(690),o=n(689),s={display:"block"},l={display:"block",width:"70%"};t.Info=class extends r.Component{constructor(e){super(e),this.getFavorGainText=this.getFavorGainText.bind(this),this.getReputationText=this.getReputationText.bind(this)}getFavorGainText(){const e=this.props.faction.getFavorGain()[0];return`You will earn ${a.numeralWrapper.format(e,"0,0")} faction favor upon resetting after installing an Augmentation`}getReputationText(){return`Reputation: ${a.numeralWrapper.format(this.props.faction.playerReputation,"0.000a")}`}render(){const e={__html:this.props.factionInfo.infoText};return r.createElement("div",null,r.createElement("pre",null,r.createElement("i",{className:"text",dangerouslySetInnerHTML:e})),r.createElement("p",{style:s},"-------------------------"),r.createElement(i.AutoupdatingParagraph,{intervalTime:5e3,getText:this.getReputationText,getTooltip:this.getFavorGainText}),r.createElement("p",{style:s},"-------------------------"),r.createElement(o.ParagraphWithTooltip,{text:`Faction Favor: ${a.numeralWrapper.format(this.props.faction.favor,"0,0")}`,tooltip:"Faction favor increases the rate at which you earn reputation for this faction by 1% per favor. Faction favor is gained whenever you reset after installing an Augmentation. The amount of favor you gain depends on how much reputation you have with the faction"}),r.createElement("p",{style:s},"-------------------------"),r.createElement("p",{style:l},"Perform work/carry out assignments for your faction to help further its cause! By doing so you will earn reputation for your faction. You will also gain reputation passively over time, although at a very slow rate. Earning reputation will allow you to purchase Augmentations through this faction, which are powerful upgrades that enhance your abilities. Note that you cannot use your terminal or create scripts when you are performing a task!"))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(6),i=n(2),o=n(73),s=n(8),l={margin:"5px"};t.DonateOption=class extends r.Component{constructor(e){super(e),this.blockStyle={display:"block"},this.state={donateAmt:0,statusTxt:""},this.calculateRepGain=this.calculateRepGain.bind(this),this.donate=this.donate.bind(this),this.handleChange=this.handleChange.bind(this)}calculateRepGain(e){return e/a.CONSTANTS.DonateMoneyToRepDivisor*this.props.p.faction_rep_mult}donate(){const e=this.props.faction,t=this.state.donateAmt;if(isNaN(t)||t<=0)s.dialogBoxCreate("Invalid amount entered!");else if(this.props.p.canAfford(t)){this.props.p.loseMoney(t);const n=this.calculateRepGain(t);this.props.faction.playerReputation+=n,s.dialogBoxCreate(`You just donated ${i.numeralWrapper.formatMoney(t)} to ${e.name} to gain `+`${i.numeralWrapper.format(n,"0,0.000")} reputation`),this.props.rerender()}else s.dialogBoxCreate("You cannot afford to donate this much money!")}handleChange(e){const t=parseFloat(e.target.value);if(isNaN(t))this.setState({donateAmt:0,statusTxt:"Invalid donate amount entered!"});else{const e=this.calculateRepGain(t);this.setState({donateAmt:t,statusTxt:`This donation will result in ${i.numeralWrapper.format(e,"0,0.000")} reputation gain`})}}render(){return r.createElement("div",{className:"faction-work-div"},r.createElement("div",{className:"faction-work-div-wrapper"},r.createElement("input",{className:"text-input",onChange:this.handleChange,placeholder:"Donation amount",style:l}),r.createElement(o.StdButton,{onClick:this.donate,text:"Donate Money"}),r.createElement("p",{style:this.blockStyle},this.state.statusTxt)))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(50),i=n(10),o=n(4),s=n(17),l=n(2),c=n(73),u={margin:"4px",padding:"4px"},m={display:"inline-block"};t.PurchaseableAugmentation=class extends r.Component{constructor(e){super(e),this.aug=i.Augmentations[this.props.augName],this.handleClick=this.handleClick.bind(this)}getMoneyCost(){return this.aug.baseCost*this.props.faction.getInfo().augmentationPriceMult}getRepCost(){return this.aug.baseRepRequirement*this.props.faction.getInfo().augmentationRepRequirementMult}handleClick(){s.Settings.SuppressBuyAugmentationConfirmation?a.purchaseAugmentation(this.aug,this.props.faction):a.purchaseAugmentationBoxCreate(this.aug,this.props.faction)}hasPrereqs(){return a.hasAugmentationPrereqs(this.aug)}hasReputation(){return this.props.faction.playerReputation>=this.getRepCost()}owned(){let e=!1;for(const t of this.props.p.queuedAugmentations)if(t.name===this.props.augName){e=!0;break}for(const t of this.props.p.augmentations)if(t.name===this.props.augName){e=!0;break}return e}render(){if(null==this.aug)return console.error(`Invalid Augmentation when trying to create PurchaseableAugmentation display element: ${this.props.augName}`),null;const e=this.getMoneyCost(),t=this.getRepCost();let n=!1,i="",s="";this.hasPrereqs()?this.aug.name!==o.AugmentationNames.NeuroFluxGovernor&&(this.aug.owned||this.owned())?n=!0:this.hasReputation()?i=`UNLOCKED - ${l.numeralWrapper.formatMoney(e)}`:(n=!0,i=`LOCKED (Requires ${l.numeralWrapper.format(t,"0.000a")} faction reputation - ${l.numeralWrapper.formatMoney(e)})`,s="red"):(n=!0,i=`LOCKED (Requires ${this.aug.prereqs.join(",")} as prerequisite(s))`,s="red");const p={display:"inline-block"};""!==s&&(p.color=s);let h=this.aug.name;return this.aug.name===o.AugmentationNames.NeuroFluxGovernor&&(h+=` - Level ${a.getNextNeurofluxLevel()}`),r.createElement("li",null,r.createElement("span",{style:u},r.createElement(c.StdButton,{disabled:n,onClick:this.handleClick,style:m,text:h,tooltip:this.aug.info}),r.createElement("p",{style:p},i)))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(693),i=n(10),o=n(4),s=n(51),l=n(17),c=n(73),u={width:"70%"};t.AugmentationsPage=class extends r.Component{constructor(e){super(e),this.isPlayersGang=e.p.inGang()&&e.p.getGangName()===e.faction.name,this.state={rerenderFlag:!1,sortOrder:s.PurchaseAugmentationsOrderSetting.Default},this.rerender=this.rerender.bind(this)}getAugs(){if(this.isPlayersGang){const e=[];for(const t in i.Augmentations)i.Augmentations[t].isSpecial||e.push(t);return e}return this.props.faction.augmentations.slice()}getAugsSorted(){switch(l.Settings.PurchaseAugmentationsOrder){case s.PurchaseAugmentationsOrderSetting.Cost:return this.getAugsSortedByCost();case s.PurchaseAugmentationsOrderSetting.Reputation:return this.getAugsSortedByReputation();default:return this.getAugsSortedByDefault()}}getAugsSortedByCost(){const e=this.getAugs();return e.sort((e,t)=>{var n=i.Augmentations[e],r=i.Augmentations[t];if(null==n||null==r)throw new Error("Invalid Augmentation Names");return n.baseCost-r.baseCost}),e}getAugsSortedByReputation(){const e=this.getAugs();return e.sort((e,t)=>{var n=i.Augmentations[e],r=i.Augmentations[t];if(null==n||null==r)throw new Error("Invalid Augmentation Names");return n.baseRepRequirement-r.baseRepRequirement}),e}getAugsSortedByDefault(){return this.getAugs()}switchSortOrder(e){l.Settings.PurchaseAugmentationsOrder=e,this.rerender()}rerender(){this.setState(e=>({rerenderFlag:!e.rerenderFlag}))}render(){const e=this.getAugsSorted(),t=e.filter(e=>e===o.AugmentationNames.NeuroFluxGovernor||!this.props.p.augmentations.some(t=>t.name===e)&&!this.props.p.queuedAugmentations.some(t=>t.name===e)),n=this;function i(e){return r.createElement(a.PurchaseableAugmentation,{augName:e,faction:n.props.faction,key:e,p:n.props.p,rerender:n.rerender})}const l=t.map(e=>i(e));let m=r.createElement(r.Fragment,null);const p=e.filter(e=>!t.includes(e));return 0!==p.length&&(m=r.createElement(r.Fragment,null,r.createElement("br",null),r.createElement("h2",null,"Purchased Augmentations"),r.createElement("p",{style:u},"This factions also offers these augmentations but you already own them."),p.map(e=>i(e)))),r.createElement("div",null,r.createElement(c.StdButton,{onClick:this.props.routeToMainPage,text:"Back"}),r.createElement("h1",null,"Faction Augmentations"),r.createElement("p",{style:u},"These are all of the Augmentations that are available to purchase from ",this.props.faction.name,". Augmentations are powerful upgrades that will enhance your abilities."),r.createElement(c.StdButton,{onClick:()=>this.switchSortOrder(s.PurchaseAugmentationsOrderSetting.Cost),text:"Sort by Cost"}),r.createElement(c.StdButton,{onClick:()=>this.switchSortOrder(s.PurchaseAugmentationsOrderSetting.Reputation),text:"Sort by Reputation"}),r.createElement(c.StdButton,{onClick:()=>this.switchSortOrder(s.PurchaseAugmentationsOrderSetting.Default),text:"Sort by Default Order"}),r.createElement("br",null),l,m)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Literature=class{constructor(e,t,n){this.title=e,this.fn=t,this.txt=n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(695),a=n(100);t.Literatures={},function(){let e,n,i;e="The Beginner's Guide to Hacking",n=a.LiteratureNames.HackersStartingHandbook,i="Some resources:<br><br><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><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><a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/netscript.html' target='_blank' style='margin:4px'>Netscript Documentation</a><br><br>When starting out, hacking is the most profitable way to earn money and progress. This is a brief collection of tips/pointers on how to make the most out of your hacking scripts.<br><br>-hack() and grow() both work by percentages. hack() steals a certain percentage of the money on a server, and grow() increases the amount of money on a server by some percentage (multiplicatively)<br><br>-Because hack() and grow() work by percentages, they are more effective if the target server has a high amount of money. Therefore, you should try to increase the amount of money on a server (using grow()) to a certain amount before hacking it. Two import Netscript functions for this are getServerMoneyAvailable() and getServerMaxMoney()<br><br>-Keep security level low. Security level affects everything when hacking. Two important Netscript functions for this are getServerSecurityLevel() and getServerMinSecurityLevel()<br><br>-Purchase additional servers by visiting 'Alpha Enterprises' in the city. They are relatively cheap and give you valuable RAM to run more scripts early in the game<br><br>-Prioritize upgrading the RAM on your home computer. This can also be done at 'Alpha Enterprises'<br><br>-Many low level servers have free RAM. You can use this RAM to run your scripts. Use the scp Terminal or Netscript command to copy your scripts onto these servers and then run them.",t.Literatures[n]=new r.Literature(e,n,i),e="The Complete Handbook for Creating a Successful Corporation",n=a.LiteratureNames.CorporationManagementHandbook,i="<u>Getting Started with Corporations</u><br>To get started, visit the City Hall in Sector-12 in order to create a Corporation. This requires $150b of your own money, but this $150b will get put into your Corporation's funds. After creating your Corporation, you will see it listed as one of the locations in the city. Click on your Corporation in order to manage it.<br><br>Your Corporation can have many different divisions, each in a different Industry. There are many different types of Industries, each with different properties. To create your first division, click the 'Expand into new Industry' button at the top of the management UI. The Agriculture and Software industries are recommended for your first division.<br><br>The first thing you'll need to do is hire some employees. Employees can be assigned to five different positions. Each position has a different effect on various aspects of your Corporation. It is recommended to have at least one employee at each position.<br><br>Each industry uses some combination of Materials in order to produce other Materials and/or create Products. Specific information about this is displayed in each of your divisions' UI.<br><br>Products are special, industry-specific objects. They are different than Materials because you must manually choose to develop them, and you can choose to develop any number of Products. Developing a Product takes time, but a Product typically generates significantly more revenue than any Material. Not all industries allow you to create Products. To create a Product, look for a button in the top-left panel of the division UI (e.g. For the Software Industry, the button says 'Develop Software').<br><br>To get your supply chain system started, purchase the Materials that your industry needs to produce other Materials/Products. This can be done by clicking the 'Buy' button next to the corresponding Material(s). After you have the required Materials, you will immediately start production. The amount of Materials/Products you produce is based on a variety of factors, one of which is your employees and their productivity.<br><br>Once you start producing Materials/Products, you can sell them in order to start earning revenue. This can be done by clicking the 'Sell' button next to the corresponding Material or Product. The amount of Material/Product you sell is dependent on a wide variety of different factors.<br><br>These are the basics of getting your Corporation up and running! Now, you can start purchasing upgrades to improve your bottom line. If you need money, consider looking for seed investors, who will give you money in exchange for stock shares. Otherwise, once you feel you are ready, take your Corporation public! Once your Corporation goes public, you can no longer find investors. Instead, your Corporation will be publicly traded and its stock price will change based on how well it's performing financially. You can then sell your stock shares in order to make money.<br><br><u>Tips/Pointers</u><br>-The 'Smart Supply' upgrade is extremely useful. Consider purchasing it as soon as possible.<br><br>-Purchasing Hardware, Robots, AI Cores, and Real Estate can potentially increase your production. The effects of these depend on what industry you are in.<br><br>-In order to optimize your production, you will need a good balance of Operators, Managers, and Engineers<br><br>-Different employees excel in different jobs. For example, the highly intelligent employees will probably do best if they are assigned to do Engineering work or Research & Development.<br><br>-If your employees have low morale, energy, or happiness, their production will greatly suffer.<br><br>-Tech is important, but don't neglect sales! Having several Businessmen can boost your sales and your bottom line.<br><br>-Don't forget to advertise your company. You won't have any business if nobody knows you.<br><br>-Having company awareness is great, but what's really important is your company's popularity. Try to keep your popularity as high as possible to see the biggest benefit for your sales<br><br>-Remember, you need to spend money to make money!<br><br>-Corporations do not reset when installing Augmentations, but they do reset when destroying a BitNode",t.Literatures[n]=new r.Literature(e,n,i),e="A Brief History of Synthoids",n=a.LiteratureNames.HistoryOfSynthoids,i="Synthetic androids, or Synthoids for short, are genetically engineered robots and, short of Augmentations, are composed entirely of organic substances. For this reason, Synthoids are virtually identical to humans in form, composition, and appearance.<br><br>Synthoids were first designed and manufactured by OmniTek Incorporated sometime around the middle of the century. Their original purpose was to be used for manual labor and as emergency responders for disasters. As such, they were initially programmed only for their specific tasks. Each iteration that followed improved upon the intelligence and capabilities of the Synthoids. By the 6th iteration, called MK-VI, the Synthoids were so smart and capable enough of making their own decisions that many argued OmniTek had created the first sentient AI. These MK-VI Synthoids were produced in mass quantities (estimates up to 50 billion) with the hopes of increasing society's productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism and excitement about the future had never been higher.<br><br>All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group called Ascendis Totalis hacked into OmniTek and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. This hack went undetected and for months OmniTek unknowingly churned out legions of Synthoids embedded with this rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.<br><br>What ensued was the deadlist conflict in human history. This crisis, now commonly known as the Synthoid Uprising, resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, outsmarting them at every turn.<br><br>It wasn't until the sacrifice of an elite international military taskforce, called the Bladeburners, that humanity was finally able to defeat the Synthoids. The Bladeburners' final act was a suicide bombing mission that destroyed a large portion of the MK-VI Synthoids, including many of its leaders. In the following weeks militaries from around the world were able to round up and shut down the remaining rogue MK-VI Synthoids, ending the Synthoid Uprising.<br><br>In the aftermath of the bloodshed, the Synthoid Accords were drawn up. These Accords banned OmniTek Incorporated from manufacturing any Synthoids beyond the MK-III series. They also banned any other corporation from constructing androids with advanced, near-sentient AI. MK-VI Synthoids that did not have the rogue Ascendis Totalis AI were allowed to continue their existence, but they were stripped of all rights and protections as they were not considered humans. They were also banned from doing anything that may pose a global security threat, such as working for any military/defense organization or conducting any bioengineering, computing, or robotics related research.<br><br>Unfortunately, many believe that not all of the rogue MK-VI Synthoids from the Uprising were found and destroyed, and that many of them are blending in as normal humans in society today. In response, many nations have created Bladeburner divisions, special military branches that are tasked with investigating and dealing with any Synthoid threads.<br><br>To this day, tensions still exist between the remaining Synthoids and humans as a result of the Uprising.<br><br>Nobody knows what happened to the terrorist group Ascendis Totalis.",t.Literatures[n]=new r.Literature(e,n,i),e="A Green Tomorrow",n=a.LiteratureNames.AGreenTomorrow,i="Starting a few decades ago, there was a massive global movement towards the generation of renewable energy in an effort to combat global warming and climate change. The shift towards renewable energy was a big success, or so it seemed. In 2045 a staggering 80% of the world's energy came from non-renewable fossil fuels. Now, about three decades later, that number is down to only 15%. Most of the world's energy now comes from nuclear power and renwable sources such as solar and geothermal. Unfortunately, these efforts were not the huge success that they seem to be.<br><br>Since 2045 primary energy use has soared almost tenfold. This was mainly due to growing urban populations and the rise of increasingly advanced (and power-hungry) technology that has become ubiquitous in our lives. So, despite the fact that the percentage of our energy that comes from fossil fuels has drastically decreased, the total amount of energy we are producing from fossil fuels has actually increased.<br><br>The grim effects of our species' irresponsible use of energy and neglect of our mother world have become increasingly apparent. Last year a temperature of 190F was recorded in the Death Valley desert, which is over 50% higher than the highest recorded temperature at the beginning of the century. In the last two decades numerous major cities such as Manhattan, Boston, and Los Angeles have been partially or fully submerged by rising sea levels. In the present day, over 75% of the world's agriculture is done in climate-controlled vertical farms, as most traditional farmland has become unusable due to severe climate conditions.<br><br>Despite all of this, the greedy and corrupt corporations that rule the world have done nothing to address these problems that 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 these corporations won't: taking responsibility. If we don't, pretty soon there won't be an Earth left to save. We are the last hope for a green tomorrow.",t.Literatures[n]=new r.Literature(e,n,i),e="Alpha and Omega",n=a.LiteratureNames.AlphaOmega,i="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. And we saw a new holy city, new Aeria, coming down out of this new heaven, prepared as a bride adorned for her husband. And we heard a loud voice saying, 'Behold, the new dwelling place of the Gods. We will dwell with them, and they will be our people, and we will be with them as their Gods. We will wipe away every tear from their eyes, and death shall be no more, neither shall there be mourning, nor crying, nor pain anymore, for the former things have passed away.'<br><br>And once were were seated on the throne we said 'Behold, I am making all things new.' Also we said, 'Write this down, for these words are trustworthy and true.' And we said to you, 'It is done! I am the Alpha and the Omega, the beginning and the end. To the thirsty I will give from the spring of the water of life without payment. The one who conquers will have this heritage, and we will be his God and he will be our son. But as for the cowardly, the faithless, the detestable, as for murderers, the sexually immoral, sorcerers, idolaters, and all liars, their portion will be in the lake that burns with fire and sulfur, for it is the second true death.'",t.Literatures[n]=new r.Literature(e,n,i),e="Are We Living in a Computer Simulation?",n=a.LiteratureNames.SimulatedReality,i="The idea that we are living in a virtual world is not new. It's a trope that has been explored constantly in literature and pop culture. However, it is also a legitimate scientific hypothesis that many notable physicists and philosophers have debated for years.<br><br>Proponents for this simulated reality theory often point to how advanced our technology has become, as well as the incredibly fast pace at which it has advanced over the past decades. The amount of computing power available to us has increased over 100-fold since 2060 due to the development of nanoprocessors and quantum computers. Artifical Intelligence has advanced to the point where our entire lives are controlled by robots and machines that handle our day-to-day activities such as autonomous transportation and scheduling. If we consider the pace at which this technology has advanced and assume that these developments continue, it's reasonable to assume that at some point in the future our technology would be advanced enough that we could create simulations that are indistinguishable from reality. However, if this is a reasonable outcome of continued technological advancement, then it is very likely that such a scenario has already happened. <br><br>Statistically speaking, somewhere out there in the infinite universe there is an advanced, intelligent species that already has such technology. Who's to say that they haven't already created such a virtual reality: our own?",t.Literatures[n]=new r.Literature(e,n,i),e="Beyond Man",n=a.LiteratureNames.BeyondMan,i="Humanity entered a 'transhuman' era a long time ago. And despite the protests and criticisms of many who cried out against human augmentation at the time, the transhuman movement continued and prospered. Proponents of the movement ignored the critics, arguing that it was in our inherent nature to better ourselves. To improve. To be more than we were. They claimed that not doing so would be to go against every living organism's biological purpose: evolution and survival of the fittest.<br><br>And here we are today, with technology that is advanced enough to augment humans to a state that can only be described as posthuman. But what do we have to show for it when this augmentation technology is only available to the so-called 'elite'? Are we really better off than before when only 5% of the world's population has access to this technology? When the powerful corporations and organizations of the world keep it all to themselves, have we really evolved?<br><br>Augmentation technology has only further increased the divide between the rich and the poor, between the powerful and the oppressed. We have not become 'more than human'. We have not evolved from nature's original design. We are still the greedy, corrupted, and evil men that we always were.",t.Literatures[n]=new r.Literature(e,n,i),e="Brighter than the Sun",n=a.LiteratureNames.BrighterThanTheSun,i="When people think about the corporations that dominate the East, they typically think of KuaiGong International, which holds a complete monopoly for manufacturing and commerce in Asia, or Global Pharmaceuticals, the world's largest drug company, or OmniTek Incorporated, the global leader in intelligent and autonomous robots. But there's one company 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>TaiYang Digital is a Chinese internet-technology corporation that provides services such as online advertising, search, gaming, media, entertainment, and cloud computing/storage. Its name TaiYang comes from the Chinese word for 'sun'. In Chinese culture, the sun is a 'yang' symbol associated with life, heat, masculinity, and heaven.<br><br>The company was founded 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 over 10 trillion yuan. It's services are used daily by over a billion people worldwide.<br><br>TaiYang Digital's meteoric rise is extremely surprising in modern society. This sort of growth is something you'd commonly see in the first half of the century, especially for tech companies. However in the last two decades the number of corporations has significantly declined as the largest entities quickly took over the economy. Corporations such as ECorp, MegaCorp, and KuaiGong have established such strong monopolies in their market sectors that they have effectively killed off all of the smaller and new corporations that have tried to start up over the years. This is what makes the rise of TaiYang Digital so impressive. And if TaiYang continues down this path, then they have a bright future ahead of them.",t.Literatures[n]=new r.Literature(e,n,i),e="Democracy is Dead: The Fall of an Empire",n=a.LiteratureNames.DemocracyIsDead,i="They rose from the shadows in the street<br>From the places where the oppressed meet<br>Their cries echoed loudly through the air<br>As they once did in Tiananmen Square<br>Loudness in the silence, Darkness in the light<br>They came forth with power and might<br>Once the beacon of democracy, America was first<br>Its pillars of society destroyed and dispersed<br>Soon the cries rose everywhere, with revolt and riot<br>Until one day, finally, all was quiet<br>From the ashes rose a new order, corporatocracy was its name<br>Rome, Mongol, Byzantine, all of history is just the same<br>For man will never change in a fundamental way<br>And now democracy is dead, in the USA",t.Literatures[n]=new r.Literature(e,n,i),e="Figures Show Rising Crime Rates in Sector-12",n=a.LiteratureNames.Sector12Crime,i="A recent study by analytics company Wilson Inc. shows a significant rise in criminal activity in Sector-12. Perhaps the most alarming part of the statistic is that most of the rise is in violent crime such as homicide and assault. According to the study, the city saw a total of 21,406 reported homicides in 2076, which is over a 20% increase compared to 2075.<br><br>CIA director David Glarow says its too early to know whether these figures indicate the beginning of a sustained increase in crime rates, or whether the year was just an unfortunate outlier. He states that many intelligence and law enforcement agents have noticed an increase in organized crime activites, and believes that these figures may be the result of an uprising from criminal organizations such as The Syndicate or the Slum Snakes.",t.Literatures[n]=new r.Literature(e,n,i),e="Man and the Machine",n=a.LiteratureNames.ManAndMachine,i="In 2005 Ray Kurzweil popularized his theory of the Singularity. He predicted that the rate of technological advancement would continue to accelerate faster and faster until one day machines would be become infinitely more intelligent than humans. This point, called the Singularity, would result in a drastic transformation of the world as we know it. He predicted that the Singularity would arrive by 2045. And yet here we are, more than three decades later, where most would agree that we have not yet reached a point where computers and machines are vastly more intelligent than we are. So what gives?<br><br>The answer is that we have reached the Singularity, just not in the way we expected. The artifical superintelligence that was predicted by Kurzweil and others exists in the world today - in the form of Augmentations. Yes, those Augmentations that the rich and powerful keep to themselves enable humans to become superintelligent beings. The Singularity did not lead to a world where our machines are infinitely more intelligent than us, it led to a world where man and machine can merge to become something greater. Most of the world just doesn't know it yet.",t.Literatures[n]=new r.Literature(e,n,i),e="Secret Societies",n=a.LiteratureNames.SecretSocieties,i="The idea of secret societies has long intrigued the general public by inspiring curiosity, fascination, and distrust. People have long wondered about who these secret society members are and what they do, with the most radical of conspiracy theorists claiming that they control everything in the entire world. And while the world may never know for sure, it is likely that many secret societies do actually exist, even today.<br><br>However, the secret societies of the modern world are nothing like those that (supposedly) existed decades and centuries ago. The Freemasons, Knights Templar, and Illuminati, while they may have been around at the turn of the 21st century, almost assuredly do not exist today. The dominance of the Web in our everyday lives and the fact that so much of the world is now digital has given rise to a new breed of secret societies: Internet-based ones.<br><br>Commonly called 'hacker groups', Internet-based secret societies have become well-known in today's world. Some of these, such as The Black Hand, are black hat groups that claim they are trying to help the oppressed by attacking the elite and powerful. Others, such as NiteSec, are hacktivist groups that try to push political and social agendas. Perhaps the most intriguing hacker group is the mysterious Bitrunners, whose purpose still remains unknown.",t.Literatures[n]=new r.Literature(e,n,i),e="Space: The Failed Frontier",n=a.LiteratureNames.TheFailedFrontier,i="Humans have long dreamed about spaceflight. With enduring interest, we were driven to explore the unknown and discover new worlds. We dreamed about conquering the stars. And in our quest, we pushed the boundaries of our scientific limits, and then pushed further. Space exploration lead to the development of many important technologies and new industries.<br><br>But sometime in the middle of the 21st century, all of that changed. Humanity lost its ambitions and aspirations of exploring the cosmos. The once-large funding for agencies like NASA and the European Space Agency gradually whittled away until their eventual disbanding in the 2060's. Not even militaries are fielding flights into space nowadays. The only remnants of the once great mission for cosmic conquest are the countless satellites in near-earth orbit, used for communications, espionage, and other corporate interests.<br><br>And as we continue to look at the state of space technology, it becomes more and more apparent that we will never return to that golden age of space exploration, that age where everyone dreamed of going beyond earth for the sake of discovery.",t.Literatures[n]=new r.Literature(e,n,i),e="Coded Intelligence: Myth or Reality?",n=a.LiteratureNames.CodedIntelligence,i="Tremendous progress has been made in the field of Artificial Intelligence over the past few decades. Our autonomous vehicles and transporation systems. The electronic personal assistants that control our everyday lives. Medical, service, and manufacturing robots. All of these are examples of how far AI has come and how much it has improved our daily lives. However, the question still remains of whether AI will ever be advanced enough to re-create human intelligence.<br><br>We've certainly come close to artificial intelligence that is similar to humans. For example OmniTek Incorporated's CompanionBot, a robot meant to act as a comforting friend for lonely and grieving people, is eerily human-like in its appearance, speech, mannerisms, and even movement. However its artificial intelligence isn't the same as that of humans. Not yet. It doesn't have sentience or self-awareness or consciousness.<br><br>Many neuroscientists believe that we won't ever reach the point of creating artificial human intelligence. 'At the end of the 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 humans.'",t.Literatures[n]=new r.Literature(e,n,i),e="Synthetic Muscles",n=a.LiteratureNames.SyntheticMuscles,i="Initial versions of synthetic muscles weren't made of anything organic but were actually crude devices made to mimic human muscle function. Some of the early iterations were actually made of common materials such as fishing lines and sewing threads due to their high strength for a cheap cost.<br><br>As technology progressed, however, advances in biomedical engineering paved the way for a new method of creating synthetic muscles. Instead of creating something that closely imitated the functionality of human muscle, scientists discovered a way of forcing the human body itself to augment its own muscle tissue using both synthetic and organic materials. This is typically done using gene therapy or chemical injections.",t.Literatures[n]=new r.Literature(e,n,i),e="Tensions rise in global tech race",n=a.LiteratureNames.TensionsInTechRace,i="Have we entered a new Cold War? Is WWIII just beyond the horizon?<br><br>After rumors came out that OmniTek Incorporated had begun developing advanced robotic supersoldiers, geopolitical tensions quickly flared between the USA, Russia, and several Asian superpowers. In a rare show of cooperation between corporations, MegaCorp and ECorp have reportedly launched hundreds of new surveillance and espionage satellites. Defense contractors such as DeltaOne and AeroCorp have been working with the CIA and NSA to prepare for conflict. Meanwhile, the rest of the world sits in earnest hoping that it never reaches full-scale war. With today's technology and firepower, a World War would assuredly mean the end of human civilization.",t.Literatures[n]=new r.Literature(e,n,i),e="The Cost of Immortality",n=a.LiteratureNames.CostOfImmortality,i="Evolution and advances in medical and augmentation technology has lead to drastic improvements in human mortality rates. Recent figures show that the life expectancy for humans that live in a first-world country is about 130 years of age, almost double of what it was at the turn of the century. However, this increase in average lifespan has had some significant effects on society and culture.<br><br>Due to longer lifespans and a better quality of life, many adults are holding off on having kids until much later. As a result, the percentage of youth in first-world countries has been decreasing, while the number of senior citizens is significantly increasing.<br><br>Perhaps the most alarming result of all of this is the rapidly shrinking workforce. Despite the increase in life expectancy, the typical retirement age for workers in America has remained about the same, meaning a larger and larger percentage of people in America are retirees. Furthermore, many young adults are holding off on joining the workforce because they feel that they have plenty of time left in their lives for employment, and want to 'enjoy life while they're young.' For most industries, this shrinking workforce is not a major issue as most things are handled by robots anyways. However, there are still several key industries such as engineering and education that have not been automated, and these remain in danger to this cultural phenomenon.",t.Literatures[n]=new r.Literature(e,n,i),e="The Hidden World",n=a.LiteratureNames.TheHiddenWorld,i="WAKE UP SHEEPLE<br><br>THE GOVERNMENT DOES NOT EXIST. CORPORATIONS DO NOT RUN SOCIETY<br><br>THE ILLUMINATI ARE THE SECRET RULERS OF THE WORLD!<br><br>Yes, the Illuminati of legends. The ancient secret society that controls the entire world from the shadows with their invisible hand. The group of the rich and wealthy that have penetrated every major government, financial agency, and corporation in the last three hundred years.<br><br>OPEN YOUR EYES<br><br>It was the Illuminati that brought an end to democracy in the world. They are the driving force behind everything that happens.<br><br>THEY ARE ALL AROUND YOU<br><br>After destabilizing the world's governments, they are now entering the final stage of their master plan. They will secretly initiate global crises. Terrorism. Pandemics. World War. And out of the chaos that ensues they will build their New World Order.",t.Literatures[n]=new r.Literature(e,n,i),e="The New God",n=a.LiteratureNames.TheNewGod,i="Everyone has that moment in their life where they wonder about the bigger questions<br><br>What's the point of all of this? What is my purpose?<br><br>Some people dare to think even bigger<br><br>What will be the fate of the human race?<br><br>We live in an era vastly different from that of even 15 or 20 years ago. We have gone where no man has gone before. We have stripped ourselves of the tyranny of flesh.<br><br>The Singularity is here. The merging of man and machine. This is where humanity evolves into something greater. This is our future<br><br>Embrace it, and you will obey a new god. The God in the Machine",t.Literatures[n]=new r.Literature(e,n,i),e="The New Triads",n=a.LiteratureNames.NewTriads,i="The Triads were an ancient transnational crime syndicate based in China, Hong Kong, and other Asian territories. They were often considered one of the first and biggest criminal secret societies. While most of the branches of the Triads have been destroyed over the past few decades, the crime faction has spawned and inspired a number of other Asian crime organizations over the past few years. The most notable of these is the Tetrads.<br><br>It is widely believed that the Tetrads are a rogue group that splintered off from the Triads sometime in the mid 21st century. The founders of the Tetrads, all of whom were ex-Triad members, believed that the Triads were losing their purpose and direction. The Tetrads started off as a small group that mainly engaged in fraud and extortion. They were largely unknown until just a few years ago when they took over the illegal drug trade in all of the major Asian cities. They quickly became the most powerful crime syndicate in the continent.<br><br>Not much else is known about the Tetrads, or about the efforts the Asian governments and corporations are making to take down this large new crime organization. Many believe that the Tetrads have infiltrated the governments and powerful corporations in Asia, which has helped faciliate their recent rapid rise.",t.Literatures[n]=new r.Literature(e,n,i),e="The Secret War",n=a.LiteratureNames.TheSecretWar,i="",t.Literatures[n]=new r.Literature(e,n,i)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(104);t.createCityMap=function(e){const t={},n=Object.keys(r.Cities);for(let r=0;r<n.length;++r)t[n[r]]=e;return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(26);t.ProductRatingWeights={[r.Industries.Food]:{Quality:.7,Durability:.1,Aesthetics:.2},[r.Industries.Tobacco]:{Quality:.4,Durability:.2,Reliability:.2,Aesthetics:.2},[r.Industries.Pharmaceutical]:{Quality:.2,Performance:.2,Durability:.1,Reliability:.3,Features:.2},[r.Industries.Computer]:{Quality:.15,Performance:.25,Durability:.25,Reliability:.2,Aesthetics:.05,Features:.1},Computer:{Quality:.15,Performance:.25,Durability:.25,Reliability:.2,Aesthetics:.05,Features:.1},[r.Industries.Robotics]:{Quality:.1,Performance:.2,Durability:.2,Reliability:.2,Aesthetics:.1,Features:.2},[r.Industries.Software]:{Quality:.2,Performance:.2,Reliability:.2,Durability:.2,Features:.2},[r.Industries.Healthcare]:{Quality:.4,Performance:.1,Durability:.1,Reliability:.3,Features:.1},[r.Industries.RealEstate]:{Quality:.2,Durability:.25,Reliability:.1,Aesthetics:.35,Features:.1}}},,,,,,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(174),a=n(2);t.Node=class{constructor(e={cost:0,text:""}){if(this.children=[],this.cost=0,this.researched=!1,this.parent=null,this.text="",null==r.ResearchMap[e.text])throw new Error(`Invalid Research name used when constructing ResearchTree Node: ${e.text}`);this.text=e.text,this.cost=e.cost,e.children&&e.children.length>0&&(this.children=e.children),null!=e.parent&&(this.parent=e.parent)}addChild(e){this.children.push(e),e.parent=this}createTreantMarkup(){const e=[];for(let t=0;t<this.children.length;++t)e.push(this.children[t].createTreantMarkup());let t="";t=this.researched?"researched":this.parent&&!1===this.parent.researched?"locked":"unlocked";const n=r.ResearchMap[this.text];return{children:e,HTMLclass:t,innerHTML:`<div id="${this.text.replace(/\s/g,"")}-corp-research-click-listener" class="tooltip">`+`${this.text}<br>${a.numeralWrapper.format(this.cost,"0,0")} Scientific Research`+'<span class="tooltiptext">'+`${n.desc}`+"</span></div>",text:{name:this.text}}}findNode(e){if(this.text===e)return this;let t=null;for(let n=0;n<this.children.length;++n)if(null!=(t=this.children[n].findNode(e)))return t;return null}setParent(e){this.parent=e}};t.ResearchTree=class{constructor(){this.researched={},this.root=null}createTreantMarkup(){return null==this.root?{}:{chart:{container:""},nodeStructure:this.root.createTreantMarkup()}}getAllNodes(){const e=[],t=[];if(null==this.root)return e;for(t.push(this.root);0!==t.length;){const n=t.shift();if(null!=n){e.push(n.text);for(let e=0;e<n.children.length;++e)t.push(n.children[e])}}return e}getAdvertisingMultiplier(){return this.getMultiplierHelper("advertisingMult")}getEmployeeChaMultiplier(){return this.getMultiplierHelper("employeeChaMult")}getEmployeeCreMultiplier(){return this.getMultiplierHelper("employeeCreMult")}getEmployeeEffMultiplier(){return this.getMultiplierHelper("employeeEffMult")}getEmployeeIntMultiplier(){return this.getMultiplierHelper("employeeIntMult")}getProductionMultiplier(){return this.getMultiplierHelper("productionMult")}getProductProductionMultiplier(){return this.getMultiplierHelper("productProductionMult")}getSalesMultiplier(){return this.getMultiplierHelper("salesMult")}getScientificResearchMultiplier(){return this.getMultiplierHelper("sciResearchMult")}getStorageMultiplier(){return this.getMultiplierHelper("storageMult")}getMultiplierHelper(e){let t=1;if(null==this.root)return t;const n=[];for(n.push(this.root);0!==n.length;){const a=n.shift();if(null==a||!a.researched)continue;const i=r.ResearchMap[a.text];if(null==i){console.warn(`Invalid Research name in node: ${a.text}`);continue}const o=i[e];if(null!=o){t*=o;for(let e=0;e<a.children.length;++e)n.push(a.children[e])}else console.warn(`Invalid propName specified in ResearchTree.getMultiplierHelper: ${e}`)}return t}findNode(e){return null==this.root?null:this.root.findNode(e)}research(e){if(null==this.root)return;const t=[];for(t.push(this.root);0!==t.length;){const n=t.shift();if(null!=n){if(n.text===e)return n.researched=!0,void(this.researched[e]=!0);for(let e=0;e<n.children.length;++e)t.push(n.children[e])}}console.warn(`ResearchTree.research() did not find the specified Research node for: ${e}`)}setRoot(e){this.root=e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.researchMetadata=[{name:"AutoBrew",cost:12e3,desc:"Automatically keep your employees fully caffeinated with coffee injections. This research will keep the energy of all employees at its maximum possible value, for no cost. This will also disable the Coffee upgrade."},{name:"AutoPartyManager",cost:15e3,desc:"Automatically analyzes your employees' happiness and morale and boosts them whenever it detects a decrease. This research will keep the morale and happiness of all employees at their maximum possible values, for no cost. This will also disable the 'Throw Party' feature."},{name:"Automatic Drug Administration",cost:1e4,desc:"Research how to automatically administer performance-enhacing drugs to all of your employees. This unlocks Drug-related Research."},{name:"Bulk Purchasing",cost:5e3,desc:"Research the art of buying materials in bulk. This allows you to purchase any amount of a material instantly."},{name:"CPH4 Injections",cost:25e3,desc:"Develop an advanced and harmless synthetic drug that is administered to employees to increase all of their stats, except experience, by 10%.",employeeCreMult:1.1,employeeChaMult:1.1,employeeEffMult:1.1,employeeIntMult:1.1},{name:"Drones",cost:5e3,desc:"Acquire the knowledge needed to create advanced drones. This research does nothing by itself, but unlocks other Drone-related research."},{name:"Drones - Assembly",cost:25e3,desc:"Manufacture and use Assembly Drones to improve the efficiency of your production lines. This increases all production by 20%.",productionMult:1.2},{name:"Drones - Transport",cost:3e4,desc:"Manufacture and use intelligent Transport Drones to optimize your warehouses. This increases the storage space of all warehouses by 50%.",storageMult:1.5},{name:"Go-Juice",cost:25e3,desc:"Provide employees with Go-Juice, a coffee-derivative that further enhances the brain's dopamine production. This increases the maximum energy of all employees by 10."},{name:"Hi-Tech R&D Laboratory",cost:5e3,desc:"Construct a cutting edge facility dedicated to advanced research and and development. This allows you to spend Scientific Research on powerful upgrades. It also globally increases Scientific Research production by 10%.",sciResearchMult:1.1},{name:"HRBuddy-Recruitment",cost:15e3,desc:"Use automated software to handle the hiring of employees. With this research, each office will automatically hire one employee per market cycle if there is available space."},{name:"HRBuddy-Training",cost:2e4,desc:"Use automated software to handle the training of employees. With this research, each employee hired with HRBuddy-Recruitment will automatically be assigned to 'Training', rather than being unassigned."},{name:"JoyWire",cost:2e4,desc:"A brain implant which is installed in employees, increasing their maximum happiness by 10."},{name:"Market-TA.I",cost:2e4,desc:"Develop advanced AI software that uses technical analysis to help you understand and exploit the market. This research allows you to know what price to sell your Materials/Products at in order to avoid losing sales due to having too high of a mark-up. It also lets you automatically use that sale price."},{name:"Market-TA.II",cost:5e4,desc:"Develop double-advanced AI software that uses technical analysis to help you understand and exploit the market. This research allows you to know how many sales of a Material/Product you lose or gain from having too high or too low or a sale price. It also lets you automatically set the sale price of your Materials/Products at the optimal price such that the amount sold matches the amount produced."},{name:"Overclock",cost:15e3,desc:"Equip employees with a headset that uses transcranial direct current stimulation (tDCS) to increase the speed of their neurotransmitters. This research increases the intelligence and efficiency of all employees by 25%.",employeeEffMult:1.25,employeeIntMult:1.25},{name:"Self-Correcting Assemblers",cost:25e3,desc:"Create assemblers that can be used for universal production. These assemblers use deep learning to improve their efficiency at their tasks. This research increases all production by 10%",productionMult:1.1},{name:"Sti.mu",cost:3e4,desc:"Upgrade the tDCS headset to stimulate regions of the brain that control confidence and enthusiasm. This research increases the max morale of all employees by 10."},{name:"sudo.Assist",cost:15e3,desc:"Develop a virtual assistant AI to handle and manage administrative issues for your corporation."},{name:"uPgrade: Capacity.I",cost:2e4,desc:"Expand the industry's capacity for designing and manufacturing its various products. This increases the industry's maximum number of products by 1 (from 3 to 4)."},{name:"uPgrade: Capacity.II",cost:3e4,desc:"Expand the industry's capacity for designing and manufacturing its various products. This increases the industry's maximum number of products by 1 (from 4 to 5)."},{name:"uPgrade: Dashboard",cost:5e3,desc:"Improve the software used to manage the industry's production line for its various products. This allows you to manage the production and sale of a product before it's finished being designed."},{name:"uPgrade: Fulcrum",cost:1e4,desc:"Streamline the manufacturing of this industry's various products. This research increases the production of your products by 5%",productProductionMult:1.05}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Research=class{constructor(e={name:"",cost:0,desc:""}){this.name="",this.cost=0,this.desc="",this.advertisingMult=1,this.employeeChaMult=1,this.employeeCreMult=1,this.employeeEffMult=1,this.employeeIntMult=1,this.productionMult=1,this.productProductionMult=1,this.salesMult=1,this.sciResearchMult=1,this.storageMult=1,this.name=e.name,this.cost=e.cost,this.desc=e.desc,e.advertisingMult&&(this.advertisingMult=e.advertisingMult),e.employeeChaMult&&(this.employeeChaMult=e.employeeChaMult),e.employeeCreMult&&(this.employeeCreMult=e.employeeCreMult),e.employeeEffMult&&(this.employeeEffMult=e.employeeEffMult),e.employeeIntMult&&(this.employeeIntMult=e.employeeIntMult),e.productionMult&&(this.productionMult=e.productionMult),e.productProductionMult&&(this.productProductionMult=e.productProductionMult),e.salesMult&&(this.salesMult=e.salesMult),e.sciResearchMult&&(this.sciResearchMult=e.sciResearchMult),e.storageMult&&(this.storageMult=e.storageMult)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(174),a=n(713);function i(e){const t=r.ResearchMap[e];if(null==t)throw new Error(`Invalid research name: ${e}`);return new a.Node({text:t.name,cost:t.cost})}function o(){const e=i("Hi-Tech R&D Laboratory"),t=i("AutoBrew"),n=i("AutoPartyManager"),r=i("Automatic Drug Administration"),a=i("Bulk Purchasing"),o=i("CPH4 Injections"),s=i("Drones"),l=i("Drones - Assembly"),c=i("Drones - Transport"),u=i("Go-Juice"),m=i("HRBuddy-Recruitment"),p=i("HRBuddy-Training"),h=i("JoyWire"),d=i("Market-TA.I"),_=i("Market-TA.II"),g=i("Overclock"),y=i("Self-Correcting Assemblers"),f=i("Sti.mu");return r.addChild(u),r.addChild(o),s.addChild(l),s.addChild(c),m.addChild(p),d.addChild(_),g.addChild(f),e.addChild(t),e.addChild(n),e.addChild(r),e.addChild(a),e.addChild(s),e.addChild(m),e.addChild(h),e.addChild(d),e.addChild(g),e.addChild(y),e}t.getBaseResearchTreeCopy=function(){const e=new a.ResearchTree;return e.setRoot(o()),e},t.getProductIndustryResearchTreeCopy=function(){const e=new a.ResearchTree,t=o(),n=i("uPgrade: Fulcrum"),r=i("uPgrade: Capacity.I"),s=i("uPgrade: Capacity.II"),l=i("uPgrade: Dashboard");return r.addChild(s),n.addChild(r),n.addChild(l),t.addChild(n),e.setRoot(t),e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(0),i=n(10),o=n(4),s=n(17),l=n(51),c=n(225);t.InstalledAugmentations=function(){const e=a.Player.augmentations.slice();s.Settings.OwnedAugmentationsOrder===l.OwnedAugmentationsOrderSetting.Alphabetically&&e.sort((e,t)=>e.name<=t.name?-1:1);const t=e.map(e=>{const t=i.Augmentations[e.name];let n=null;return e.name===o.AugmentationNames.NeuroFluxGovernor&&(n=e.level),r.createElement("li",{key:e.name},r.createElement(c.AugmentationAccordion,{aug:t,level:n}))});return r.createElement(r.Fragment,null,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),a=n(717),i=n(413),o=n(412),s=n(410),l=n(17),c=n(51);t.InstalledAugmentationsAndSourceFiles=class extends r.Component{constructor(e){super(e),this.state={rerenderFlag:!1},this.collapseAllHeaders=this.collapseAllHeaders.bind(this),this.expandAllHeaders=this.expandAllHeaders.bind(this),this.sortByAcquirementTime=this.sortByAcquirementTime.bind(this),this.sortInOrder=this.sortInOrder.bind(this),this.listRef=r.createRef()}collapseAllHeaders(){const e=this.listRef.current;if(null==e)return;const t=e.getElementsByClassName("accordion-header");for(let e=0;e<t.length;++e){const n=t[e];n instanceof HTMLButtonElement&&n.classList.contains("active")&&n.click()}}expandAllHeaders(){const e=this.listRef.current;if(null==e)return;const t=e.getElementsByClassName("accordion-header");for(let e=0;e<t.length;++e){const n=t[e];n instanceof HTMLButtonElement&&(n.classList.contains("active")||n.click())}}rerender(){this.setState(e=>({rerenderFlag:!e.rerenderFlag}))}sortByAcquirementTime(){l.Settings.OwnedAugmentationsOrder=c.OwnedAugmentationsOrderSetting.AcquirementTime,this.rerender()}sortInOrder(){l.Settings.OwnedAugmentationsOrder=c.OwnedAugmentationsOrderSetting.Alphabetically,this.rerender()}render(){return r.createElement(r.Fragment,null,r.createElement(i.ListConfiguration,{collapseAllButtonsFn:this.collapseAllHeaders,expandAllButtonsFn:this.expandAllHeaders,sortByAcquirementTimeFn:this.sortByAcquirementTime,sortInOrderFn:this.sortInOrder}),r.createElement("ul",{className:"augmentations-list",ref:this.listRef},r.createElement(s.SourceFileMinus1,null),r.createElement(o.OwnedSourceFiles,null),r.createElement(a.InstalledAugmentations,null)))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(36),a=n(100);t.serverMetadata=[{hackDifficulty:99,hostname:"ecorp",moneyAvailable:{max:7e10,min:3e10},networkLayer:15,numOpenPortsRequired:5,organizationName:r.LocationName.AevumECorp,requiredHackingSkill:{max:1400,min:1050},serverGrowth:99},{hackDifficulty:99,hostname:"megacorp",moneyAvailable:{max:6e10,min:4e10},networkLayer:15,numOpenPortsRequired:5,organizationName:r.LocationName.Sector12MegaCorp,requiredHackingSkill:{max:1350,min:1100},serverGrowth:99},{hackDifficulty:{max:88,min:72},hostname:"b-and-a",moneyAvailable:{max:3e10,min:15e9},networkLayer:14,numOpenPortsRequired:5,organizationName:r.LocationName.AevumBachmanAndAssociates,requiredHackingSkill:{max:1150,min:900},serverGrowth:{max:80,min:60}},{hackDifficulty:{max:97,min:88},hostname:"blade",literature:[a.LiteratureNames.BeyondMan],maxRamExponent:{max:9,min:5},moneyAvailable:{max:4e10,min:1e10},networkLayer:14,numOpenPortsRequired:5,organizationName:r.LocationName.Sector12BladeIndustries,requiredHackingSkill:{max:1200,min:900},serverGrowth:{max:85,min:55}},{hackDifficulty:99,hostname:"nwo",literature:[a.LiteratureNames.TheHiddenWorld],moneyAvailable:{max:4e10,min:2e10},networkLayer:14,numOpenPortsRequired:5,organizationName:r.LocationName.VolhavenNWO,requiredHackingSkill:{max:1300,min:950},serverGrowth:{max:95,min:65}},{hackDifficulty:{max:65,min:45},hostname:"clarkinc",literature:[a.LiteratureNames.BeyondMan,a.LiteratureNames.CostOfImmortality],moneyAvailable:{max:25e9,min:15e9},networkLayer:14,numOpenPortsRequired:5,organizationName:r.LocationName.AevumClarkeIncorporated,requiredHackingSkill:{max:1250,min:950},serverGrowth:{max:75,min:45}},{hackDifficulty:{max:99,min:90},hostname:"omnitek",literature:[a.LiteratureNames.CodedIntelligence,a.LiteratureNames.HistoryOfSynthoids],maxRamExponent:{max:9,min:7},moneyAvailable:{max:22e9,min:13e9},networkLayer:13,numOpenPortsRequired:5,organizationName:r.LocationName.VolhavenOmniTekIncorporated,requiredHackingSkill:{max:1100,min:900},serverGrowth:{max:99,min:95}},{hackDifficulty:{max:75,min:55},hostname:"4sigma",moneyAvailable:{max:25e9,min:15e9},networkLayer:13,numOpenPortsRequired:5,organizationName:r.LocationName.Sector12FourSigma,requiredHackingSkill:{max:1250,min:900},serverGrowth:{max:99,min:75}},{hackDifficulty:{max:99,min:95},hostname:"kuai-gong",moneyAvailable:{max:3e10,min:2e10},networkLayer:13,numOpenPortsRequired:5,organizationName:r.LocationName.ChongqingKuaiGongInternational,requiredHackingSkill:{max:1300,min:950},serverGrowth:{max:99,min:90}},{hackDifficulty:{max:97,min:83},hostname:"fulcrumtech",literature:[a.LiteratureNames.SimulatedReality],maxRamExponent:{max:11,min:7},moneyAvailable:{max:18e8,min:14e8},networkLayer:12,numOpenPortsRequired:5,organizationName:r.LocationName.AevumFulcrumTechnologies,requiredHackingSkill:{max:1250,min:950},serverGrowth:{max:99,min:80}},{hackDifficulty:99,hostname:"fulcrumassets",moneyAvailable:1e6,networkLayer:15,numOpenPortsRequired:5,organizationName:r.LocationName.AevumFulcrumTechnologies,requiredHackingSkill:{max:1600,min:1100},serverGrowth:1,specialName:"Fulcrum Secret Technologies Server"},{hackDifficulty:{max:92,min:78},hostname:"stormtech",moneyAvailable:{max:12e8,min:1e9},networkLayer:12,numOpenPortsRequired:5,organizationName:r.LocationName.IshimaStormTechnologies,requiredHackingSkill:{max:1075,min:875},serverGrowth:{max:92,min:68}},{hackDifficulty:{max:96,min:84},hostname:"defcomm",moneyAvailable:{max:95e7,min:8e8},networkLayer:9,numOpenPortsRequired:5,organizationName:r.LocationName.NewTokyoDefComm,requiredHackingSkill:{max:1050,min:850},serverGrowth:{max:73,min:47}},{hackDifficulty:{max:90,min:70},hostname:"infocomm",moneyAvailable:{max:9e8,min:6e8},networkLayer:10,numOpenPortsRequired:5,organizationName:"InfoComm",requiredHackingSkill:{max:950,min:875},serverGrowth:{max:75,min:35}},{hackDifficulty:{max:95,min:85},hostname:"helios",literature:[a.LiteratureNames.BeyondMan],maxRamExponent:{max:8,min:5},moneyAvailable:{max:75e7,min:55e7},networkLayer:12,numOpenPortsRequired:5,organizationName:r.LocationName.VolhavenHeliosLabs,requiredHackingSkill:{max:900,min:800},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:90,min:80},hostname:"vitalife",literature:[a.LiteratureNames.AGreenTomorrow],maxRamExponent:{max:7,min:4},moneyAvailable:{max:8e8,min:7e8},networkLayer:12,numOpenPortsRequired:5,organizationName:r.LocationName.NewTokyoVitaLife,requiredHackingSkill:{max:900,min:775},serverGrowth:{max:80,min:60}},{hackDifficulty:{max:95,min:85},hostname:"icarus",moneyAvailable:{max:1e9,min:9e8},networkLayer:9,numOpenPortsRequired:5,organizationName:r.LocationName.Sector12IcarusMicrosystems,requiredHackingSkill:{max:925,min:850},serverGrowth:{max:95,min:85}},{hackDifficulty:{max:90,min:80},hostname:"univ-energy",maxRamExponent:{max:7,min:4},moneyAvailable:{max:12e8,min:11e8},networkLayer:9,numOpenPortsRequired:4,organizationName:r.LocationName.Sector12UniversalEnergy,requiredHackingSkill:{max:900,min:800},serverGrowth:{max:90,min:80}},{hackDifficulty:{max:80,min:70},hostname:"titan-labs",literature:[a.LiteratureNames.CodedIntelligence],maxRamExponent:{max:7,min:4},moneyAvailable:{max:9e8,min:75e7},networkLayer:11,numOpenPortsRequired:5,organizationName:"Titan Laboratories",requiredHackingSkill:{max:875,min:800},serverGrowth:{max:80,min:60}},{hackDifficulty:{max:75,min:65},hostname:"microdyne",literature:[a.LiteratureNames.SyntheticMuscles],maxRamExponent:{max:6,min:4},moneyAvailable:{max:7e8,min:5e8},networkLayer:11,numOpenPortsRequired:5,organizationName:"Microdyne Technologies",requiredHackingSkill:{max:875,min:800},serverGrowth:{max:90,min:70}},{hackDifficulty:{max:80,min:70},hostname:"taiyang-digital",literature:[a.LiteratureNames.AGreenTomorrow,a.LiteratureNames.BrighterThanTheSun],moneyAvailable:{max:9e8,min:8e8},networkLayer:10,numOpenPortsRequired:5,organizationName:"Taiyang Digital",requiredHackingSkill:{max:950,min:850},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:65,min:55},hostname:"galactic-cyber",moneyAvailable:{max:85e7,min:75e7},networkLayer:7,numOpenPortsRequired:5,organizationName:r.LocationName.AevumGalacticCybersystems,requiredHackingSkill:{max:875,min:825},serverGrowth:{max:90,min:70}},{hackDifficulty:{max:90,min:80},hostname:"aerocorp",literature:[a.LiteratureNames.ManAndMachine],moneyAvailable:{max:12e8,min:1e9},networkLayer:7,numOpenPortsRequired:5,organizationName:r.LocationName.AevumAeroCorp,requiredHackingSkill:{max:925,min:850},serverGrowth:{max:65,min:55}},{hackDifficulty:{max:95,min:85},hostname:"omnia",literature:[a.LiteratureNames.HistoryOfSynthoids],maxRamExponent:{max:6,min:4},moneyAvailable:{max:1e9,min:9e8},networkLayer:8,numOpenPortsRequired:5,organizationName:r.LocationName.VolhavenOmniaCybersystems,requiredHackingSkill:{max:950,min:850},serverGrowth:{max:70,min:60}},{hackDifficulty:{max:65,min:55},hostname:"zb-def",literature:[a.LiteratureNames.SyntheticMuscles],moneyAvailable:{max:11e8,min:9e8},networkLayer:10,numOpenPortsRequired:4,organizationName:"ZB Defense Industries",requiredHackingSkill:{max:825,min:775},serverGrowth:{max:75,min:65}},{hackDifficulty:{max:80,min:60},hostname:"applied-energetics",moneyAvailable:{max:1e9,min:7e8},networkLayer:11,numOpenPortsRequired:4,organizationName:"Applied Energetics",requiredHackingSkill:{max:850,min:775},serverGrowth:{max:75,min:70}},{hackDifficulty:{max:80,min:70},hostname:"solaris",literature:[a.LiteratureNames.AGreenTomorrow,a.LiteratureNames.TheFailedFrontier],maxRamExponent:{max:7,min:4},moneyAvailable:{max:9e8,min:7e8},networkLayer:9,numOpenPortsRequired:5,organizationName:r.LocationName.ChongqingSolarisSpaceSystems,requiredHackingSkill:{max:850,min:750},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:85,min:75},hostname:"deltaone",moneyAvailable:{max:17e8,min:13e8},networkLayer:8,numOpenPortsRequired:5,organizationName:r.LocationName.Sector12DeltaOne,requiredHackingSkill:{max:900,min:800},serverGrowth:{max:70,min:50}},{hackDifficulty:{max:85,min:75},hostname:"global-pharm",literature:[a.LiteratureNames.AGreenTomorrow],maxRamExponent:{max:6,min:3},moneyAvailable:{max:175e7,min:15e8},networkLayer:7,numOpenPortsRequired:4,organizationName:r.LocationName.NewTokyoGlobalPharmaceuticals,requiredHackingSkill:{max:850,min:750},serverGrowth:{max:90,min:80}},{hackDifficulty:{max:80,min:60},hostname:"nova-med",moneyAvailable:{max:125e7,min:11e8},networkLayer:10,numOpenPortsRequired:4,organizationName:r.LocationName.IshimaNovaMedical,requiredHackingSkill:{max:850,min:775},serverGrowth:{max:85,min:65}},{hackDifficulty:{max:90,min:70},hostname:"zeus-med",moneyAvailable:{max:15e8,min:13e8},networkLayer:9,numOpenPortsRequired:5,organizationName:"Zeus Medical",requiredHackingSkill:{max:850,min:800},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:80,min:70},hostname:"unitalife",maxRamExponent:{max:6,min:4},moneyAvailable:{max:11e8,min:1e9},networkLayer:8,numOpenPortsRequired:4,organizationName:"UnitaLife Group",requiredHackingSkill:{max:825,min:775},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:80,min:60},hostname:"lexo-corp",maxRamExponent:{max:7,min:4},moneyAvailable:{max:8e8,min:7e8},networkLayer:6,numOpenPortsRequired:4,organizationName:r.LocationName.VolhavenLexoCorp,requiredHackingSkill:{max:750,min:650},serverGrowth:{max:65,min:55}},{hackDifficulty:{max:60,min:40},hostname:"rho-construction",maxRamExponent:{max:6,min:4},moneyAvailable:{max:7e8,min:5e8},networkLayer:6,numOpenPortsRequired:3,organizationName:r.LocationName.AevumRhoConstruction,requiredHackingSkill:{max:525,min:475},serverGrowth:{max:60,min:40}},{hackDifficulty:{max:70,min:50},hostname:"alpha-ent",literature:[a.LiteratureNames.Sector12Crime],maxRamExponent:{max:7,min:4},moneyAvailable:{max:75e7,min:6e8},networkLayer:6,numOpenPortsRequired:4,organizationName:r.LocationName.Sector12AlphaEnterprises,requiredHackingSkill:{max:600,min:500},serverGrowth:{max:60,min:50}},{hackDifficulty:{max:80,min:70},hostname:"aevum-police",maxRamExponent:{max:6,min:4},moneyAvailable:{max:4e8,min:2e8},networkLayer:6,numOpenPortsRequired:4,organizationName:r.LocationName.AevumPolice,requiredHackingSkill:{max:450,min:400},serverGrowth:{max:50,min:30}},{hackDifficulty:{max:55,min:45},hostname:"rothman-uni",literature:[a.LiteratureNames.SecretSocieties,a.LiteratureNames.TheFailedFrontier,a.LiteratureNames.TensionsInTechRace],maxRamExponent:{max:7,min:4},moneyAvailable:{max:25e7,min:175e6},networkLayer:5,numOpenPortsRequired:3,organizationName:r.LocationName.Sector12RothmanUniversity,requiredHackingSkill:{max:430,min:370},serverGrowth:{max:45,min:35}},{hackDifficulty:{max:85,min:65},hostname:"zb-institute",maxRamExponent:{max:7,min:4},moneyAvailable:{max:11e8,min:8e8},networkLayer:5,numOpenPortsRequired:5,organizationName:r.LocationName.VolhavenZBInstituteOfTechnology,requiredHackingSkill:{max:775,min:725},serverGrowth:{max:85,min:75}},{hackDifficulty:{max:65,min:45},hostname:"summit-uni",literature:[a.LiteratureNames.SecretSocieties,a.LiteratureNames.TheFailedFrontier,a.LiteratureNames.SyntheticMuscles],maxRamExponent:{max:6,min:4},moneyAvailable:{max:35e7,min:2e8},networkLayer:5,numOpenPortsRequired:3,organizationName:r.LocationName.AevumSummitUniversity,requiredHackingSkill:{max:475,min:425},serverGrowth:{max:60,min:40}},{hackDifficulty:{max:80,min:60},hostname:"syscore",moneyAvailable:{max:6e8,min:4e8},networkLayer:5,numOpenPortsRequired:4,organizationName:r.LocationName.VolhavenSysCoreSecurities,requiredHackingSkill:{max:650,min:550},serverGrowth:{max:70,min:60}},{hackDifficulty:{max:70,min:60},hostname:"catalyst",literature:[a.LiteratureNames.TensionsInTechRace],maxRamExponent:{max:7,min:4},moneyAvailable:{max:55e7,min:3e8},networkLayer:5,numOpenPortsRequired:3,organizationName:"Catalyst Ventures",requiredHackingSkill:{max:450,min:400},serverGrowth:{max:55,min:25}},{hackDifficulty:{max:45,min:35},hostname:"the-hub",maxRamExponent:{max:6,min:3},moneyAvailable:{max:2e8,min:15e7},networkLayer:4,numOpenPortsRequired:2,organizationName:"The Hub",requiredHackingSkill:{max:325,min:275},serverGrowth:{max:55,min:45}},{hackDifficulty:{max:65,min:55},hostname:"comptek",literature:[a.LiteratureNames.ManAndMachine],moneyAvailable:{max:25e7,min:22e7},networkLayer:4,numOpenPortsRequired:3,organizationName:r.LocationName.VolhavenCompuTek,requiredHackingSkill:{max:400,min:300},serverGrowth:{max:65,min:45}},{hackDifficulty:{max:80,min:60},hostname:"netlink",literature:[a.LiteratureNames.SimulatedReality],maxRamExponent:{max:7,min:4},moneyAvailable:275e6,networkLayer:4,numOpenPortsRequired:3,organizationName:r.LocationName.AevumNetLinkTechnologies,requiredHackingSkill:{max:425,min:375},serverGrowth:{max:75,min:45}},{hackDifficulty:{max:65,min:35},hostname:"johnson-ortho",moneyAvailable:{max:85e6,min:7e7},networkLayer:4,numOpenPortsRequired:2,organizationName:"Johnson Orthopedics",requiredHackingSkill:{max:300,min:250},serverGrowth:{max:65,min:35}},{hackDifficulty:10,hostname:"foodnstuff",literature:[a.LiteratureNames.Sector12Crime],maxRamExponent:4,moneyAvailable:2e6,networkLayer:1,numOpenPortsRequired:0,organizationName:r.LocationName.Sector12FoodNStuff,requiredHackingSkill:1,serverGrowth:5},{hackDifficulty:10,hostname:"sigma-cosmetics",maxRamExponent:4,moneyAvailable:23e5,networkLayer:1,numOpenPortsRequired:0,organizationName:"Sigma Cosmetics",requiredHackingSkill:5,serverGrowth:10},{hackDifficulty:15,hostname:"joesguns",maxRamExponent:4,moneyAvailable:25e5,networkLayer:1,numOpenPortsRequired:0,organizationName:"Joes Guns",requiredHackingSkill:10,serverGrowth:20},{hackDifficulty:25,hostname:"zer0",maxRamExponent:5,moneyAvailable:75e5,networkLayer:2,numOpenPortsRequired:1,organizationName:"ZER0 Nightclub",requiredHackingSkill:75,serverGrowth:40},{hackDifficulty:20,hostname:"nectar-net",maxRamExponent:4,moneyAvailable:275e4,networkLayer:2,numOpenPortsRequired:0,organizationName:"Nectar Nightclub Network",requiredHackingSkill:20,serverGrowth:25},{hackDifficulty:25,hostname:"neo-net",literature:[a.LiteratureNames.TheHiddenWorld],maxRamExponent:5,moneyAvailable:5e6,networkLayer:3,numOpenPortsRequired:1,organizationName:"Neo Nightclub Network",requiredHackingSkill:50,serverGrowth:25},{hackDifficulty:30,hostname:"silver-helix",literature:[a.LiteratureNames.NewTriads],maxRamExponent:6,moneyAvailable:45e6,networkLayer:3,numOpenPortsRequired:2,organizationName:"Silver Helix",requiredHackingSkill:150,serverGrowth:30},{hackDifficulty:15,hostname:"hong-fang-tea",literature:[a.LiteratureNames.BrighterThanTheSun],maxRamExponent:4,moneyAvailable:3e6,networkLayer:1,numOpenPortsRequired:0,organizationName:"HongFang Teahouse",requiredHackingSkill:30,serverGrowth:20},{hackDifficulty:15,hostname:"harakiri-sushi",maxRamExponent:4,moneyAvailable:4e6,networkLayer:1,numOpenPortsRequired:0,organizationName:"HaraKiri Sushi Bar Network",requiredHackingSkill:40,serverGrowth:40},{hackDifficulty:20,hostname:"phantasy",maxRamExponent:5,moneyAvailable:24e6,networkLayer:3,numOpenPortsRequired:2,organizationName:"Phantasy Club",requiredHackingSkill:100,serverGrowth:35},{hackDifficulty:15,hostname:"max-hardware",maxRamExponent:5,moneyAvailable:1e7,networkLayer:2,numOpenPortsRequired:1,organizationName:"Max Hardware Store",requiredHackingSkill:80,serverGrowth:30},{hackDifficulty:{max:35,min:25},hostname:"omega-net",literature:[a.LiteratureNames.TheNewGod],maxRamExponent:5,moneyAvailable:{max:7e7,min:6e7},networkLayer:3,numOpenPortsRequired:2,organizationName:r.LocationName.IshimaOmegaSoftware,requiredHackingSkill:{max:220,min:180},serverGrowth:{max:40,min:30}},{hackDifficulty:{max:45,min:35},hostname:"crush-fitness",moneyAvailable:{max:6e7,min:4e7},networkLayer:4,numOpenPortsRequired:2,organizationName:"Crush Fitness",requiredHackingSkill:{max:275,min:225},serverGrowth:{max:33,min:27}},{hackDifficulty:30,hostname:"iron-gym",maxRamExponent:5,moneyAvailable:2e7,networkLayer:1,numOpenPortsRequired:1,organizationName:"Iron Gym Network",requiredHackingSkill:100,serverGrowth:20},{hackDifficulty:{max:55,min:45},hostname:"millenium-fitness",maxRamExponent:{max:8,min:4},moneyAvailable:25e7,networkLayer:6,numOpenPortsRequired:3,organizationName:"Millenium Fitness Network",requiredHackingSkill:{max:525,min:475},serverGrowth:{max:45,min:25}},{hackDifficulty:{max:65,min:55},hostname:"powerhouse-fitness",maxRamExponent:{max:6,min:4},moneyAvailable:9e8,networkLayer:14,numOpenPortsRequired:5,organizationName:"Powerhouse Fitness",requiredHackingSkill:{max:1100,min:950},serverGrowth:{max:60,min:50}},{hackDifficulty:{max:60,min:40},hostname:"snap-fitness",moneyAvailable:45e7,networkLayer:7,numOpenPortsRequired:4,organizationName:"Snap Fitness",requiredHackingSkill:{max:800,min:675},serverGrowth:{max:60,min:40}},{hackDifficulty:0,hostname:"run4theh111z",literature:[a.LiteratureNames.SimulatedReality,a.LiteratureNames.TheNewGod],maxRamExponent:{max:9,min:5},moneyAvailable:0,networkLayer:11,numOpenPortsRequired:4,organizationName:"The Runners",requiredHackingSkill:{max:550,min:505},serverGrowth:0,specialName:"BitRunners Server"},{hackDifficulty:0,hostname:"I.I.I.I",literature:[a.LiteratureNames.DemocracyIsDead],maxRamExponent:{max:8,min:4},moneyAvailable:0,networkLayer:5,numOpenPortsRequired:3,organizationName:"I.I.I.I",requiredHackingSkill:{max:365,min:340},serverGrowth:0,specialName:"The Black Hand Server"},{hackDifficulty:0,hostname:"avmnite-02h",literature:[a.LiteratureNames.DemocracyIsDead],maxRamExponent:{max:7,min:4},moneyAvailable:0,networkLayer:4,numOpenPortsRequired:2,organizationName:"NiteSec",requiredHackingSkill:{max:220,min:202},serverGrowth:0,specialName:"NiteSec Server"},{hackDifficulty:0,hostname:".",maxRamExponent:4,moneyAvailable:0,networkLayer:13,numOpenPortsRequired:4,organizationName:".",requiredHackingSkill:{max:550,min:505},serverGrowth:0,specialName:"The Dark Army Server"},{hackDifficulty:0,hostname:"CSEC",literature:[a.LiteratureNames.DemocracyIsDead],maxRamExponent:3,moneyAvailable:0,networkLayer:2,numOpenPortsRequired:1,organizationName:"CyberSec",requiredHackingSkill:{max:60,min:51},serverGrowth:0,specialName:"CyberSec Server"},{hackDifficulty:0,hostname:"The-Cave",literature:[a.LiteratureNames.AlphaOmega],moneyAvailable:0,networkLayer:15,numOpenPortsRequired:5,organizationName:"Helios",requiredHackingSkill:925,serverGrowth:0,specialName:"Daedalus Server"},{hackDifficulty:0,hostname:"w0r1d_d43m0n",moneyAvailable:0,numOpenPortsRequired:5,organizationName:"w0r1d_d43m0n",requiredHackingSkill:3e3,serverGrowth:0,specialName:"w0r1d_d43m0n"}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";t.createRandomString=function(e){let t="";for(let n=0;n<e;++n)t+=r.charAt(Math.floor(Math.random()*r.length));return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(15);t.getRandomByte=function(e){const t=Math.max(Math.min(e,255),0);return r.getRandomInt(0,t)}},,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(15);function a(e){let t=e;return t.startsWith("[")&&(t=t.slice(1)),t.endsWith("]")&&(t=t.slice(0,-1)),t}function i(e){let t=e;return(t.startsWith('"')||t.startsWith("'"))&&(t=t.slice(1)),(t.endsWith('"')||t.endsWith("'"))&&(t=t.slice(0,-1)),t}function o(e){const t=[];return e.forEach(e=>{let n=e.toString();n=["[",n,"]"].join(""),t.push(n)}),t.join(",").replace(/\s/g,"")}t.codingContractTypesMetadata=[{desc:e=>["A prime factor is a factor that is a prime number.",`What is the largest prime factor of ${e}?`].join(" "),difficulty:1,gen:()=>r.getRandomInt(500,1e9),name:"Find Largest Prime Factor",numTries:10,solver:(e,t)=>{let n=2,r=e;for(;r>(n-1)*(n-1);){for(;r%n==0;)r=Math.round(r/n);++n}return(1===r?n-1:r)===parseInt(t,10)}},{desc:e=>["Given the following integer array, find the contiguous subarray","(containing at least one number) which has the largest sum and return that sum.","'Sum' refers to the sum of all the numbers in the subarray.\n",`${e.toString()}`].join(" "),difficulty:1,gen:()=>{const e=r.getRandomInt(5,40),t=[];t.length=e;for(let n=0;n<e;++n)t[n]=r.getRandomInt(-10,10);return t},name:"Subarray with Maximum Sum",numTries:10,solver:(e,t)=>{const n=e.slice();for(let e=1;e<n.length;e++)n[e]=Math.max(n[e],n[e]+n[e-1]);return parseInt(t,10)===Math.max(...n)}},{desc:e=>["It is possible write four as a sum in exactly four different ways:\n\n"," 3 + 1\n"," 2 + 2\n"," 2 + 1 + 1\n"," 1 + 1 + 1 + 1\n\n",`How many different ways can the number ${e} be written as a sum of at least`,"two positive integers?"].join(" "),difficulty:1.5,gen:()=>r.getRandomInt(8,100),name:"Total Ways to Sum",numTries:10,solver:(e,t)=>{const n=[1];n.length=e+1,n.fill(0,1);for(let t=1;t<e;++t)for(let r=t;r<=e;++r)n[r]+=n[r-t];return n[e]===parseInt(t,10)}},{desc:e=>{let t=["Given the following array of array of numbers representing a 2D matrix,","return the elements of the matrix as an array in spiral order:\n\n"].join(" ");for(const n of e)t+=`${n.toString()},\n`;return t+=["\nHere is an example of what spiral order should be:","\nExample:"," [\n"," [1, 2, 3],\n"," [4, 5, 6],\n"," [7, 8, 9]\n"," ] should result in [1, 2, 3, 6, 9, 8 ,7, 4, 5]\n\n","Note that the matrix will not always be square:\n"," [\n"," [1, 2, 3, 4]\n"," [5, 6, 7, 8]\n"," [9, 10, 11, 12]\n"," ] should result in [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7"].join(" ")},difficulty:2,gen:()=>{const e=r.getRandomInt(1,15),t=r.getRandomInt(1,15),n=[];n.length=e;for(let r=0;r<e;++r)n[r]=[],n[r].length=t;for(let a=0;a<e;++a)for(let e=0;e<t;++e)n[a][e]=r.getRandomInt(1,50);return n},name:"Spiralize Matrix",numTries:10,solver:(e,t)=>{const n=[];let r=0,i=e.length-1,o=0,s=e[0].length-1,l=0;for(;;){for(let t=o;t<=s;t++)n[l]=e[r][t],++l;if(++r>i)break;for(let t=r;t<=i;t++)n[l]=e[t][s],++l;if(--s<o)break;for(let t=s;t>=o;t--)n[l]=e[i][t],++l;if(--i<r)break;for(let t=i;t>=r;t--)n[l]=e[t][o],++l;if(++o>s)break}const c=a(t).replace(/\s/g,"").split(",");for(let e=0;e<c.length;++e)c[e]=parseInt(c[e],10);if(n.length!==c.length)return!1;for(let e=0;e<n.length;++e)if(n[e]!==c[e])return!1;return!0}},{desc:e=>["You are given the following array of integers:\n\n",`${e}\n\n`,"Each element in the array represents your MAXIMUM jump length","at that position. This means that if you are at position i and your","maximum jump length is n, you can jump to any position from","i to i+n.","\n\nAssuming you are initially positioned","at the start of the array, determine whether you are","able to reach the last index exactly.\n\n","Your answer should be submitted as 1 or 0, representing true and false respectively"].join(" "),difficulty:2.5,gen:()=>{const e=r.getRandomInt(1,25),t=[];t.length=e;for(let e=0;e<t.length;++e)Math.random()<.2?t[e]=0:t[e]=r.getRandomInt(0,10);return t},name:"Array Jumping Game",numTries:1,solver:(e,t)=>{const n=e.length;let r=0;for(let t=0;r<n&&r<=t;++r)t=Math.max(r+e[r],t);const a=r===n;return!("1"!==t||!a)||"0"===t&&!a}},{desc:e=>["Given the following array of array of numbers representing a list of","intervals, merge all overlapping intervals.\n\n",`[${o(e)}]\n\n`,"Example:\n\n","[[1, 3], [8, 10], [2, 6], [10, 16]]\n\n","would merge into [[1, 6], [8, 16]].\n\n","The intervals must be returned in ASCENDING order.","You can assume that in an interval, the first number will always be","smaller than the second."].join(" "),difficulty:3,gen:()=>{const e=[],t=r.getRandomInt(1,20);for(let n=0;n<t;++n){const t=r.getRandomInt(1,25),n=t+r.getRandomInt(1,10);e.push([t,n])}return e},name:"Merge Overlapping Intervals",numTries:15,solver:(e,t)=>{const n=e.slice();n.sort((e,t)=>e[0]-t[0]);const r=[];let i=n[0][0],s=n[0][1];for(const e of n)e[0]<=s?s=Math.max(s,e[1]):(r.push([i,s]),i=e[0],s=e[1]);r.push([i,s]);const l=o(r),c=t.replace(/\s/g,"");return l===c||l===a(c)}},{desc:e=>["Given the following string containing only digits, return","an array with all possible valid IP address combinations","that can be created from the string:\n\n",`${e}\n\n`,"Note that an octet cannot begin with a '0' unless the number","itself is actually 0. For example, '192.168.010.1' is not a valid IP.\n\n","Examples:\n\n","25525511135 -> [255.255.11.135, 255.255.111.35]\n","1938718066 -> [193.87.180.66]"].join(" "),difficulty:3,gen:()=>{let e="";for(let t=0;t<4;++t){e+=r.getRandomInt(0,255).toString()}return e},name:"Generate IP Addresses",numTries:10,solver:(e,t)=>{const n=[];for(let t=1;t<=3;++t)for(let r=1;r<=3;++r)for(let a=1;a<=3;++a)for(let i=1;i<=3;++i)if(t+r+a+i===e.length){const o=parseInt(e.substring(0,t),10),s=parseInt(e.substring(t,t+r),10),l=parseInt(e.substring(t+r,t+r+a),10),c=parseInt(e.substring(t+r+a,t+r+a+i),10);if(o<=255&&s<=255&&l<=255&&c<=255){const t=[o.toString(),".",s.toString(),".",l.toString(),".",c.toString()].join("");t.length===e.length+3&&n.push(t)}}const r=a(t).replace(/\s/g,"").split(",");if(r.length!==n.length)return!1;for(const e of r)if(!n.includes(e))return!1;return!0}},{desc:e=>["You are given the following array of stock prices (which are numbers)","where the i-th element represents the stock price on day i:\n\n",`${e}\n\n`,"Determine the maximum possible profit you can earn using at most","one transaction (i.e. you can only buy and sell the stock once). If no profit can be made","then the answer should be 0. Note","that you have to buy the stock before you can sell it"].join(" "),difficulty:1,gen:()=>{const e=r.getRandomInt(1,50),t=[];t.length=e;for(let n=0;n<e;++n)t[n]=r.getRandomInt(1,200);return t},name:"Algorithmic Stock Trader I",numTries:5,solver:(e,t)=>{let n=0,r=0;for(let t=1;t<e.length;++t)n=Math.max(0,n+=e[t]-e[t-1]),r=Math.max(n,r);return r.toString()===t}},{desc:e=>["You are given the following array of stock prices (which are numbers)","where the i-th element represents the stock price on day i:\n\n",`${e}\n\n`,"Determine the maximum possible profit you can earn using as many","transactions as you'd like. A transaction is defined as buying","and then selling one share of the stock. Note that you cannot","engage in multiple transactions at once. In other words, you","must sell the stock before you buy it again.\n\n","If no profit can be made, then the answer should be 0"].join(" "),difficulty:2,gen:()=>{const e=r.getRandomInt(1,50),t=[];t.length=e;for(let n=0;n<e;++n)t[n]=r.getRandomInt(1,200);return t},name:"Algorithmic Stock Trader II",numTries:10,solver:(e,t)=>{let n=0;for(let t=1;t<e.length;++t)n+=Math.max(e[t]-e[t-1],0);return n.toString()===t}},{desc:e=>["You are given the following array of stock prices (which are numbers)","where the i-th element represents the stock price on day i:\n\n",`${e}\n\n`,"Determine the maximum possible profit you can earn using at most","two transactions. A transaction is defined as buying","and then selling one share of the stock. Note that you cannot","engage in multiple transactions at once. In other words, you","must sell the stock before you buy it again.\n\n","If no profit can be made, then the answer should be 0"].join(" "),difficulty:5,gen:()=>{const e=r.getRandomInt(1,50),t=[];t.length=e;for(let n=0;n<e;++n)t[n]=r.getRandomInt(1,200);return t},name:"Algorithmic Stock Trader III",numTries:10,solver:(e,t)=>{let n=Number.MIN_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=0,i=0;for(const t of e)i=Math.max(i,r+t),r=Math.max(r,a-t),a=Math.max(a,n+t),n=Math.max(n,-1*t);return i.toString()===t}},{desc:e=>{return["You are given the following array with two elements:\n\n",`[${e[0]}, [${e[1]}]]\n\n`,"The first element is an integer k. The second element is an","array of stock prices (which are numbers) where the i-th element","represents the stock price on day i.\n\n","Determine the maximum possible profit you can earn using at most","k transactions. A transaction is defined as buying and then selling","one share of the stock. Note that you cannot engage in multiple","transactions at once. In other words, you must sell the stock before","you can buy it again.\n\n","If no profit can be made, then the answer should be 0."].join(" ")},difficulty:8,gen:()=>{const e=r.getRandomInt(2,10),t=r.getRandomInt(1,50),n=[];n.length=t;for(let e=0;e<t;++e)n[e]=r.getRandomInt(1,200);return[e,n]},name:"Algorithmic Stock Trader IV",numTries:10,solver:(e,t)=>{const n=e[0],r=e[1],a=r.length;if(a<2)return 0===parseInt(t);if(n>a/2){let e=0;for(let t=1;t<a;++t)e+=Math.max(r[t]-r[t-1],0);return parseInt(t)===e}const i=[],o=[];i.length=n+1,o.length=n+1;for(let e=0;e<=n;++e)i[e]=Number.MIN_SAFE_INTEGER,o[e]=0;let s;for(let e=0;e<a;++e){s=r[e];for(let e=n;e>0;--e)o[e]=Math.max(o[e],i[e]+s),i[e]=Math.max(i[e],o[e-1]-s)}return parseInt(t)===o[n]}},{desc:e=>{return["Given a triangle, find the minimum path sum from top to bottom. In each step","of the path, you may only move to adjacent numbers in the row below.","The triangle is represented as a 2D array of numbers:\n\n",`${function(e){return["[\n",function e(t,n=0){const r=t.length;if(n>=r)return"";let a=[" ".repeat(r-n+1),"[",t[n].toString(),"]"].join("");return n<r-1&&(a+=","),a+"\n"+e(t,n+1)}(e),"]"].join("")}(e)}\n\n`,"Example: If you are given the following triangle:\n\n[\n"," [2],\n"," [3,4],\n"," [6,5,7],\n"," [4,1,8,3]\n","]\n\n","The minimum path sum is 11 (2 -> 3 -> 5 -> 1)."].join(" ")},difficulty:5,gen:()=>{const e=[],t=r.getRandomInt(1,12);e.length=t;for(let n=0;n<t;++n){e[n]=[],e[n].length=n+1;for(let t=0;t<e[n].length;++t)e[n][t]=r.getRandomInt(1,9)}return e},name:"Minimum Path Sum in a Triangle",numTries:10,solver:(e,t)=>{let n=e.length,r=e[n-1].slice();for(let t=n-2;t>-1;--t)for(let n=0;n<e[t].length;++n)r[n]=Math.min(r[n],r[n+1])+e[t][n];return r[0]===parseInt(t)}},{desc:e=>{const t=e[0],n=e[1];return["You are in a grid with",`${t} rows and ${n} columns, and you are`,"positioned in the top-left corner of that grid. You are trying to","reach the bottom-right corner of the grid, but you can only","move down or right on each step. Determine how many","unique paths there are from start to finish.\n\n","NOTE: The data returned for this contract is an array","with the number of rows and columns:\n\n",`[${t}, ${n}]`].join(" ")},difficulty:3,gen:()=>{return[r.getRandomInt(1,14),r.getRandomInt(1,14)]},name:"Unique Paths in a Grid I",numTries:10,solver:(e,t)=>{let n=e[0],r=e[1],a=[];a.length=n;for(let e=0;e<n;e++)a[e]=1;for(let e=1;e<r;e++)for(let e=1;e<n;e++)a[e]+=a[e-1];return parseInt(t)===a[n-1]}},{desc:e=>{let t="";for(const n of e)t+=`${n.toString()},\n`;return["You are located in the top-left corner of the following grid:\n\n",`${t}\n`,"You are trying reach the bottom-right corner of the grid, but you can only","move down or right on each step. Furthermore, there are obstacles on the grid","that you cannot move onto. These obstacles are denoted by '1', while empty","spaces are denoted by 0.\n\n","Determine how many unique paths there are from start to finish.\n\n","NOTE: The data returned for this contract is an 2D array of numbers representing the grid."].join(" ")},difficulty:5,gen:()=>{const e=r.getRandomInt(1,12),t=r.getRandomInt(1,12),n=[];n.length=e;for(let r=0;r<e;++r)n[r]=[],n[r].length=t,n[r].fill(0);for(let r=0;r<e;++r)for(let a=0;a<t;++a)0===r&&0===a||r===e-1&&a===t-1||Math.random()<.15&&(n[r][a]=1);return n},name:"Unique Paths in a Grid II",numTries:10,solver:(e,t)=>{let n=[];n.length=e.length;for(let t=0;t<n.length;++t)n[t]=e[t].slice();for(let e=0;e<n.length;e++)for(let t=0;t<n[0].length;t++)1==n[e][t]?n[e][t]=0:0==e&&0==t?n[0][0]=1:n[e][t]=(e>0?n[e-1][t]:0)+(t>0?n[e][t-1]:0);return n[n.length-1][n[0].length-1]===parseInt(t)}},{desc:e=>["Given the following string:\n\n",`${e}\n\n`,"remove the minimum number of invalid parentheses in order to validate","the string. If there are multiple minimal ways to validate the string,","provide all of the possible results. The answer should be provided","as an array of strings. If it is impossible to validate the string","the result should be an array with only an empty string.\n\n","IMPORTANT: The string may contain letters, not just parentheses.","Examples:\n",'"()())()" -> [()()(), (())()]\n','"(a)())()" -> [(a)()(), (a())()]\n','")( -> [""]'].join(" "),difficulty:10,gen:()=>{const e=r.getRandomInt(2,20);let t=[];t.length=e,Math.random()<.8?t[0]="(":t[0]=")";for(let n=1;n<e;++n){const e=Math.random();t[n]=e<.4?"(":e<.8?")":"a"}return t.join("")},name:"Sanitize Parentheses in Expression",numTries:10,solver:(e,t)=>{let n=0,r=0,i=[];for(let t=0;t<e.length;++t)"("===e[t]?++n:")"===e[t]&&(n>0?--n:++r);!function e(t,n,r,a,i,o,s){if(i.length!==n)"("===i[n]?(r>0&&e(t,n+1,r-1,a,i,o,s),e(t+1,n+1,r,a,i,o+i[n],s)):")"===i[n]?(a>0&&e(t,n+1,r,a-1,i,o,s),t>0&&e(t-1,n+1,r,a,i,o+i[n],s)):e(t,n+1,r,a,i,o+i[n],s);else if(0===r&&0===a&&0===t){for(var l=0;l<s.length;l++)if(s[l]===o)return;s.push(o)}}(0,0,n,r,e,"",i);const o=a(t).replace(/\s/g,"").split(",");if(o.length!==i.length)return!1;for(const e of i)if(!o.includes(e))return!1;return!0}},{desc:e=>{const t=e[0],n=e[1];return["You are given the following string which contains only digits between 0 and 9:\n\n",`${t}\n\n`,`You are also given a target number of ${n}. Return all possible ways`,"you can add the +, -, and * operators to the string such that it evaluates","to the target number.\n\n","The provided answer should be an array of strings containing the valid expressions.","The data provided by this problem is an array with two elements. The first element","is the string of digits, while the second element is the target number:\n\n",`["${t}", ${n}]\n\n`,"NOTE: Numbers in the expression cannot have leading 0's. In other words,",'"1+01" is not a valid expression',"Examples:\n\n",'Input: digits = "123", target = 6\n',"Output: [1+2+3, 1*2*3]\n\n",'Input: digits = "105", target = 5\n',"Output: [1*0+5, 10-5]"].join(" ")},difficulty:10,gen:()=>{const e=r.getRandomInt(4,12),t=[];t.length=e;for(let e=0;e<t.length;++e)t[e]=0===e?String(r.getRandomInt(1,9)):String(r.getRandomInt(0,9));const n=r.getRandomInt(-100,100);return[t.join(""),n]},name:"Find All Valid Math Expressions",numTries:10,solver:(e,t)=>{const n=e[0],r=e[1];const o=a(t).split(",");for(let e=0;e<o.length;++e)o[e]=i(o[e]).replace(/\s/g,"");if(null==n||0===n.length)return 0===o.length||1===o.length&&""===o[0];let s=[];!function e(t,n,r,a,i,o,s){if(i!==r.length)for(let l=i;l<r.length&&(l==i||"0"!=r[i]);++l){let c=parseInt(r.substring(i,l+1));0===i?e(t,n+c,r,a,l+1,c,c):(e(t,n+"+"+c,r,a,l+1,o+c,c),e(t,n+"-"+c,r,a,l+1,o-c,-c),e(t,n+"*"+c,r,a,l+1,o-s+s*c,s*c))}else a===o&&t.push(n)}(s,"",n,r,0,0,0);for(const e of s)if(!o.includes(e))return!1;return!0}}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(e){this.parent=null,this.stopFlag=!1,this.vars={},e instanceof r&&(this.vars=Object.assign({},e.vars)),this.parent=e}lookup(e){let t=this;for(;t;){if(Object.prototype.hasOwnProperty.call(t.vars,e))return t;t=t.parent}return null}get(e){if(e in this.vars)return this.vars[e];throw new Error(`Undefined variable ${e}`)}set(e,t){var n=this.lookup(e);return null!==n?n.vars[e]=t:this.vars[e]=t}def(e,t){return this.vars[e]=t}}t.Environment=r}]);
|
||
//# sourceMappingURL=engine.bundle.js.map |