CM={Backup:{},Cache:{},Config:{},Data:{Config:{}},Disp:{},Footer:{},Main:{},Options:{},Sim:{},VersionMajor:"2.031",VersionMinor:"5"};(()=>{CM.Cache.InitCache=function(){CM.Cache.CacheDragonAuras(),CM.Cache.CacheWrinklers(),CM.Cache.CacheStats(),CM.Cache.CacheGoldenAndWrathCookiesMults(),CM.Cache.CacheChain(),CM.Cache.CacheMissingUpgrades(),CM.Cache.CacheSeaSpec(),CM.Cache.InitCookiesDiff(),CM.Cache.HeavenlyChipsDiff=new e(5),CM.Cache.CacheHeavenlyChipsPS(),CM.Cache.CacheAvgCPS(),CM.Cache.CacheIncome(),CM.Cache.CacheBuildingsPrices(),CM.Cache.CachePP()},CM.Cache.LoopCache=function(){CM.Cache.CacheWrinklers(),CM.Cache.CachePP(),CM.Cache.CacheCurrWrinklerCPS(),CM.Cache.CacheAvgCPS(),CM.Cache.CacheHeavenlyChipsPS();const e=Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset);CM.Cache.TimeTillNextPrestige=CM.Disp.FormatTime(e/CM.Disp.GetCPS())};class e{constructor(e){this.maxLength=e,this.queue=[]}addLatest(e){this.queue.push(e)>this.maxLength&&this.queue.shift()}calcAverage(e){e>this.maxLength&&(e=this.maxLength),e>this.queue.length&&(e=this.queue.length);let a=0;for(let C=this.queue.length-1;C>=0&&C>this.queue.length-1-e;C--)a+=this.queue[C];return 0===a?0:a/e}}CM.Cache.CacheDragonAuras=function(){CM.Cache.dragonAura=Game.dragonAura,CM.Cache.dragonAura2=Game.dragonAura2},CM.Cache.CacheWrinklers=function(){CM.Cache.WrinklersTotal=0,CM.Cache.WrinklersNormal=0,CM.Cache.WrinklersFattest=[0,null];for(let e=0;eCM.Cache.WrinklersFattest[0]&&(CM.Cache.WrinklersFattest=[a,e]))}},CM.Cache.CacheStats=function(){CM.Cache.Lucky=900*CM.Cache.NoGoldSwitchCookiesPS/.15,CM.Cache.Lucky*=CM.Cache.DragonsFortuneMultAdjustment;const e=CM.Cache.getCPSBuffMult();e>0?CM.Cache.Lucky/=e:CM.Cache.Lucky=0,CM.Cache.LuckyReward=CM.Cache.GoldenCookiesMult*(.15*CM.Cache.Lucky)+13,CM.Cache.LuckyWrathReward=CM.Cache.WrathCookiesMult*(.15*CM.Cache.Lucky)+13,CM.Cache.LuckyFrenzy=7*CM.Cache.Lucky,CM.Cache.LuckyRewardFrenzy=CM.Cache.GoldenCookiesMult*(.15*CM.Cache.LuckyFrenzy)+13,CM.Cache.LuckyWrathRewardFrenzy=CM.Cache.WrathCookiesMult*(.15*CM.Cache.LuckyFrenzy)+13,CM.Cache.Conjure=2*CM.Cache.Lucky,CM.Cache.ConjureReward=.15*CM.Cache.Conjure,CM.Cache.Edifice=0;let a=0,C=0;for(const e of Object.keys(Game.Objects))Game.Objects[e].amount>a&&(a=Game.Objects[e].amount),Game.Objects[e].amount>0&&C++;for(const e of Object.keys(Game.Objects))(Game.Objects[e].amountCM.Cache.Edifice&&(CM.Cache.Edifice=2*Game.Objects[e].price,CM.Cache.EdificeBuilding=e)},CM.Cache.CacheGoldenAndWrathCookiesMults=function(){if(CM.Footer.isInitzializing)CM.Cache.GoldenCookiesMult=1,CM.Cache.WrathCookiesMult=1,CM.Cache.DragonsFortuneMultAdjustment=1;else{let e=1,a=1,C=1;CM.Sim.Has("Green yeast digestives")&&(C*=1.01),CM.Sim.Has("Dragon fang")&&(C*=1.03),e*=1+.1*Game.auraMult("Ancestral Metamorphosis"),e*=Game.eff("goldenCookieGain"),a*=1+.1*Game.auraMult("Unholy Dominion"),a*=Game.eff("wrathCookieGain"),CM.Cache.GoldenCookiesMult=C*e,CM.Cache.WrathCookiesMult=C*a,CM.Cache.DragonsFortuneMultAdjustment=1,0===Game.shimmerTypes.golden.n&&(CM.Cache.DragonsFortuneMultAdjustment*=1+1.23*Game.auraMult("Dragon's Fortune"))}},CM.Cache.MaxChainCookieReward=function(e,a,C){let c=0,o=0,i=0,s=0,t=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);for(;i0?e/=a:e=0,CM.Cache.ChainMaxReward=CM.Cache.MaxChainCookieReward(7,e,CM.Cache.GoldenCookiesMult),CM.Cache.ChainRequired=2*CM.Cache.ChainMaxReward[1]/CM.Cache.GoldenCookiesMult,CM.Cache.ChainRequiredNext=CM.Cache.ChainMaxReward[2]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment,CM.Cache.ChainMaxWrathReward=CM.Cache.MaxChainCookieReward(6,e,CM.Cache.WrathCookiesMult),CM.Cache.ChainWrathRequired=2*CM.Cache.ChainMaxWrathReward[1]/CM.Cache.WrathCookiesMult,CM.Cache.ChainWrathRequiredNext=CM.Cache.ChainMaxWrathReward[2]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment,CM.Cache.ChainFrenzyMaxReward=CM.Cache.MaxChainCookieReward(7,7*e,CM.Cache.GoldenCookiesMult),CM.Cache.ChainFrenzyRequired=2*CM.Cache.ChainFrenzyMaxReward[1]/CM.Cache.GoldenCookiesMult,CM.Cache.ChainFrenzyRequiredNext=CM.Cache.ChainFrenzyMaxReward[2]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment,CM.Cache.ChainFrenzyMaxWrathReward=CM.Cache.MaxChainCookieReward(6,7*e,CM.Cache.WrathCookiesMult),CM.Cache.ChainFrenzyWrathRequired=2*CM.Cache.ChainFrenzyMaxWrathReward[1]/CM.Cache.WrathCookiesMult,CM.Cache.ChainFrenzyWrathRequiredNext=CM.Cache.ChainFrenzyMaxWrathReward[2]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment},CM.Cache.CacheMissingUpgrades=function(){CM.Cache.MissingUpgrades="",CM.Cache.MissingUpgradesCookies="",CM.Cache.MissingUpgradesPrestige="";const e=[];for(const a of Object.keys(Game.Upgrades))e.push(Game.Upgrades[a]);e.sort((function(e,a){return e.order>a.order?1:e.order0&&(a+=CM.Cache.WrinklersTotal),CM.Cache.RealCookiesEarned=Math.max(Game.cookiesEarned,a),a*=.05;const C=e-CM.Cache.lastCPSCheck,c=Math.max(0,Game.cookies-CM.Cache.lastCookies)/C,o=Math.max(0,CM.Cache.WrinklersTotal-CM.Cache.lastWrinkCookies)/C,i=Math.max(0,CM.Cache.WrinklersFattest[0]-CM.Cache.lastWrinkFattestCookies)/C,s=Math.max(0,a-CM.Cache.lastChoEgg)/C,t=(Game.cookieClicks-CM.Cache.lastClicks)/C;for(let e=0;eCM.Cache.max?CM.Disp.colorPurple:e.pp>CM.Cache.mid?CM.Disp.colorOrange:CM.Disp.colorYellow,0!==Number(CM.Options.PPSecondsLowerLimit)&&a/CM.Disp.GetCPS()0&&(C=CM.Disp.colorRed),C},CM.Cache.CacheBuildingsPP=function(){if(CM.Cache.min=1/0,CM.Cache.max=1,CM.Cache.ArrayOfPPs=[],void 0===CM.Options.PPExcludeTop&&(CM.Options.PPExcludeTop=0),0===CM.Options.ColorPPBulkMode&&Game.buyMode>0){for(const e of Object.keys(CM.Cache.Objects1))Game.cookiesPs?CM.Cache.Objects1[e].pp=Math.max(Game.Objects[e].getPrice()-(Game.cookies+CM.Disp.GetWrinkConfigBank()),0)/Game.cookiesPs+Game.Objects[e].getPrice()/CM.Cache.Objects1[e].bonus:CM.Cache.Objects1[e].pp=Game.Objects[e].getPrice()/CM.Cache.Objects1[e].bonus,CM.Cache.ArrayOfPPs.push([CM.Cache.Objects1[e].pp,Game.Objects[e].getPrice()]);if(CM.Cache.ArrayOfPPs.sort(((e,a)=>e[0]-a[0])),CM.Options.PPOnlyConsiderBuyable)for(;CM.Cache.ArrayOfPPs[0][1]>Game.cookies&&1!==CM.Cache.ArrayOfPPs.length;)CM.Cache.ArrayOfPPs.shift();CM.Cache.min=CM.Cache.ArrayOfPPs[CM.Options.PPExcludeTop][0],CM.Cache.max=CM.Cache.ArrayOfPPs[CM.Cache.ArrayOfPPs.length-1][0],CM.Cache.mid=(CM.Cache.max-CM.Cache.min)/2+CM.Cache.min;for(const e of Object.keys(CM.Cache.Objects1)){CM.Cache.Objects1[e].color=CM.Cache.ColourOfPP(CM.Cache.Objects1[e],Game.Objects[e].getPrice());for(let a=0;a0){const e=`Objects${Game.buyBulk}`;for(const a of Object.keys(CM.Cache[e]))Game.cookiesPs?CM.Cache[e][a].pp=Math.max(Game.Objects[a].bulkPrice-(Game.cookies+CM.Disp.GetWrinkConfigBank()),0)/Game.cookiesPs+Game.Objects[a].bulkPrice/CM.Cache[e][a].bonus:CM.Cache[e][a].pp=Game.Objects[a].bulkPrice/CM.Cache[e][a].bonus,CM.Cache.ArrayOfPPs.push([CM.Cache[e][a].pp,Game.Objects[a].bulkPrice]);if(CM.Cache.ArrayOfPPs.sort(((e,a)=>e[0]-a[0])),CM.Options.PPOnlyConsiderBuyable)for(;CM.Cache.ArrayOfPPs[0][1]>Game.cookies&&1!==CM.Cache.ArrayOfPPs.length;)CM.Cache.ArrayOfPPs.shift();CM.Cache.min=CM.Cache.ArrayOfPPs[CM.Options.PPExcludeTop][0],CM.Cache.max=CM.Cache.ArrayOfPPs[CM.Cache.ArrayOfPPs.length-1][0],CM.Cache.mid=(CM.Cache.max-CM.Cache.min)/2+CM.Cache.min;for(const a of Object.keys(CM.Cache.Objects1)){CM.Cache[e][a].color=CM.Cache.ColourOfPP(CM.Cache[e][a],Game.Objects[a].bulkPrice);for(let C=0;C-1&&CM.Options[o]-1&&CM.Options[o][n]<2||(i=!0,CM.Options[o][n]=CM.Data.ConfigDefault[o][n]);else for(const n in CM.Data.ConfigDefault.Colors)void 0!==CM.Options[o][n]&&"string"==typeof CM.Options[o][n]||(i=!0,CM.Options[o][n]=CM.Data.ConfigDefault[o][n]);i&&CM.Config.SaveConfig(),CM.Main.Loop();for(const o in CM.Data.ConfigDefault)"Header"!==o&&void 0!==CM.Data.Config[o].func&&CM.Data.Config[o].func()}else CM.Config.RestoreDefault()},CM.Config.RestoreDefault=function(){CM.Config.LoadConfig(CM.Data.ConfigDefault),CM.Config.SaveConfig(),Game.UpdateMenu()},CM.Config.ToggleConfig=function(o){CM.Options[o]++,CM.Options[o]===CM.Data.Config[o].label.length?(CM.Options[o]=0,CM.Data.Config[o].toggle&&(l(CM.Config.ConfigPrefix+o).className="option off")):l(CM.Config.ConfigPrefix+o).className="option",void 0!==CM.Data.Config[o].func&&CM.Data.Config[o].func(),l(CM.Config.ConfigPrefix+o).innerHTML=CM.Data.Config[o].label[CM.Options[o]],CM.Config.SaveConfig()},CM.Config.ToggleConfigVolume=function(o){null!==l(`slider${o}`)&&(l(`slider${o}right`).innerHTML=`${l(`slider${o}`).value}%`,CM.Options[o]=Math.round(l(`slider${o}`).value)),CM.Config.SaveConfig()},CM.Config.ToggleHeader=function(o){CM.Options.Header[o]++,CM.Options.Header[o]>1&&(CM.Options.Header[o]=0),CM.Config.SaveConfig()},CM.Config.CheckNotificationPermissions=function(o){if(1===o){const o=function(){try{Notification.requestPermission().then()}catch(o){return!1}return!0};"Notification"in window?o()?Notification.requestPermission().then():Notification.requestPermission():console.log("This browser does not support notifications.")}},CM.Config.ConfigPrefix="CMConfig";(()=>{"use strict";CM.Data={Fortunes:["Fortune #001","Fortune #002","Fortune #003","Fortune #004","Fortune #005","Fortune #006","Fortune #007","Fortune #008","Fortune #009","Fortune #010","Fortune #011","Fortune #012","Fortune #013","Fortune #014","Fortune #015","Fortune #016","Fortune #017","Fortune #018","Fortune #100","Fortune #101","Fortune #102","Fortune #103","Fortune #104"],HalloCookies:["Skull cookies","Ghost cookies","Bat cookies","Slime cookies","Pumpkin cookies","Eyeball cookies","Spider cookies"],ChristCookies:["Christmas tree biscuits","Snowflake biscuits","Snowman biscuits","Holly biscuits","Candy cane biscuits","Bell biscuits","Present biscuits"],ValCookies:["Pure heart biscuits","Ardent heart biscuits","Sour heart biscuits","Weeping heart biscuits","Golden heart biscuits","Eternal heart biscuits","Prism heart biscuits"],PlantDrops:["Elderwort biscuits","Bakeberry cookies","Duketater cookies","Green yeast digestives","Wheat slims","Fern tea","Ichor syrup"],Effects:{buildingCost:"Building prices",click:"Cookies per click",cps:"Total CPS",cursorCps:"Cursor CPS",goldenCookieDur:"Golden cookie duration",goldenCookieEffDur:"Golden cookie effect duration",goldenCookieFreq:"Golden cookie frequency",goldenCookieGain:"Golden cookie gains",grandmaCps:"Grandma CPS",itemDrops:"Random item drop chance",milk:"Effect from milk",reindeerDur:"Reindeer duration",reindeerFreq:"Reindeer frequency",reindeerGain:"Reindeer gains",upgradeCost:"Upgrade prices",wrathCookieDur:"Wrath cookie duration",wrathCookieEffDur:"Wrath cookie effect duration",wrathCookieFreq:"Wrath cookie frequency",wrathCookieGain:"Wrath cookie gains",wrinklerEat:"Wrinkler ",wrinklerSpawn:"Wrinkler spawn frequency"},ModDescription:'
\n Cookie Monster\n offers a wide range of tools and statistics to enhance your game experience.\n It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.
\n Progess on new updates and all previous release notes can be found on the GitHub page linked above!
\n Please also report any bugs you may find over there!
\n
\n ',LatestReleaseNotes:'
\n The latest update (v 2.031.4) has introduced the following features:
\n - Added a changelog to the info tab and notification indicating a new version
\n - Warnings in tooltips are now based on the income after buying the upgrade
\n - A new warning and stat for Conjure Baked Goods in combination with Frenzy has been added
\n - User can now set a custom tooltip warning ("x times cps") in the settings
\n - Garden plots with plants that give cookies on harvest now display a tooltip with current and maximum reward
\n - The Harvest All button in the Garden now has a tooltip displaying the current reward
\n - The Ascend button can now display additional info (this can be turned off in the settings)
\n - The statistics page now displays the Heavenly Chips per second
\n - The statistics page now displays the CPS needed for the next level in Chain Cookies
\n - The statistics page now displays the cookies needed for optimal rewards for garden plants
\n - You can now set a Heavenly Chips target in the settings which will be counted down to in the statistics page
\n - The color picker in the settings has been updated to its latest version
\n - The overlay of seconds/percentage of timers is now toggle able and more readable
\n - You can now toggle to disable bulk-buying from buying less than the selected amount (i.e., buying 7 of a building by pressing the buy 10 when you don\'t have enough for 10)
\n - CookieMonster now uses the Modding API provided by the base game
\n - There is a new option that allows the decoupling of the base game volume setting and the volumes of sounds created by the mod
\n - The tab title now displays a "!" if a Golden Cookie or Reindeer can spawn
\n - PP calculation can now be set to: 1) Exclude the 1st, 2nd or 3rd most optimal building (if you never want to buy that it), 2) Always consider optimal buildings that cost below "xx seconds of CPS" (toggleable in the settings), 3) Ignore any building or upgrade that is not purchasable at the moment
\n
\n This update fixes the following bugs:
\n - Minigames with enhanced tooltips will now also show these if the minigames were not loaded when CookieMonster was loaded
\n - Sound, Flashes and Notifications will no longer play when the mod is initializing
\n - The color picker should now update its display consistently
\n - Fixed some typo\'s
\n - Fixed a game breaking bug when the player had not purchased any upgrades
\n - Fixed a number of console errors thrown by CM
\n - Fixed the integration with mods that provide additional content, they should now no longer break CookieMonster
\n - The Timer bar will now disappear correctly when the Golden Switch has been activated
\n - Fixed errors in the calculation of the Chain Cookies and Wrinkler stats
\n - Fixed buy warnings showing incorrectly
\n
\n ',metric:["","","M","G","T","P","E","Z","Y"],shortScale:["","","M","B","Tr","Quadr","Quint","Sext","Sept","Oct","Non","Dec","Undec","Duodec","Tredec","Quattuordec","Quindec","Sexdec","Septendec","Octodec","Novemdec","Vigint","Unvigint","Duovigint","Trevigint","Quattuorvigint"],shortScaleAbbreviated:["","K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","De","UDe","DDe","TDe","QaDe","QiDe","SxDe","SpDe","ODe","NDe","Vi","UVi","DVi","TVi","QaVi","QiVi","SxVi","SpVi","OVi","NVi","Tr","UTr","DTr","TTr","QaTr","QiTr","SxTr","SpTr","OTr","NTr","Qaa","UQa","DQa","TQa","QaQa","QiQa","SxQa","SpQa","OQa","NQa","Qia","UQi","DQi","TQi","QaQi","QiQi","SxQi","SpQi","OQi","NQi","Sxa","USx","DSx","TSx","QaSx","QiSx","SxSx","SpSx","OSx","NSx","Spa","USp","DSp","TSp","QaSp","QiSp","SxSp","SpSp","OSp","NSp","Oco","UOc","DOc","TOc","QaOc","QiOc","SxOc","SpOc","OOc","NOc","Noa","UNo","DNo","TNo","QaNo","QiNo","SxNo","SpNo","ONo","NNo","Ct","UCt"],ConfigGroups:{BarsColors:"Bars/Colors",Calculation:"Calculation",Notification:"Notification",Tooltip:"Tooltips and additional insights",Statistics:"Statistics",Notation:"Notation",Miscellaneous:"Miscellaneous"},ConfigGroupsNotification:{NotificationGeneral:"General Notifications",NotificationGC:"Golden Cookie",NotificationFC:"Fortune Cookie",NotificationSea:"Season Special",NotificationGard:"Garden Tick",NotificationMagi:"Full Magic Bar",NotificationWrink:"Wrinkler",NotificationWrinkMax:"Maximum Wrinklers"},Config:{}},CM.Data.Config.BotBar={type:"bool",group:"BarsColors",label:["Bottom Bar OFF","Bottom Bar ON"],desc:"Building Information",toggle:!0,func:function(){CM.Disp.ToggleBotBar()}},CM.Data.Config.TimerBar={type:"bool",group:"BarsColors",label:["Timer Bar OFF","Timer Bar ON"],desc:"Timers of Golden Cookie, Season Popup, Frenzy (Normal, Clot, Elder), Click Frenzy",toggle:!0,func:function(){CM.Disp.ToggleTimerBar()}},CM.Data.Config.TimerBarPos={type:"bool",group:"BarsColors",label:["Timer Bar Position (Top Left)","Timer Bar Position (Bottom)"],desc:"Placement of the Timer Bar",toggle:!1,func:function(){CM.Disp.ToggleTimerBarPos()}},CM.Data.Config.TimerBarOverlay={type:"bool",group:"BarsColors",label:["Timer Bar Overlay OFF","Timer Bar Overlay Only Seconds","Timer Bar Overlay Full"],desc:"Overlay on timers displaying seconds and/or percentage left",toggle:!0},CM.Data.Config.SortBuildings={type:"bool",group:"BarsColors",label:["Sort Buildings: Default","Sort Buildings: PP"],desc:"Sort the display of buildings in either default order or by PP",toggle:!1,func:function(){CM.Disp.UpdateBuildings()}},CM.Data.Config.SortUpgrades={type:"bool",group:"BarsColors",label:["Sort Upgrades: Default","Sort Upgrades: PP"],desc:"Sort the display of upgrades in either default order or by PP",toggle:!1,func:function(){CM.Disp.UpdateUpgrades()}},CM.Data.Config.BuildColor={type:"bool",group:"BarsColors",label:["Building Colors OFF","Building Colors ON"],desc:"Color code buildings",toggle:!0,func:function(){CM.Disp.UpdateBuildings()}},CM.Data.Config.BulkBuildColor={type:"bool",group:"BarsColors",label:["Bulk Building Colors (Single Building Color)","Bulk Building Colors (Calculated Bulk Color)"],desc:"Color code bulk buildings based on single buildings color or calculated bulk value color",toggle:!1,func:function(){CM.Disp.UpdateBuildings()}},CM.Data.Config.UpBarColor={type:"bool",group:"BarsColors",label:["Upgrade Colors/Bar OFF","Upgrade Colors with Bar ON","Upgrade Colors without Bar ON"],desc:"Color code upgrades and optionally add a counter bar",toggle:!1,func:function(){CM.Disp.ToggleUpgradeBarAndColor()}},CM.Data.Config.Colors={type:"color",group:"BarsColors",desc:{Blue:"Color Blue. Used to show better than best PP building, for Click Frenzy bar, and for various labels",Green:"Color Green. Used to show best PP building, for Blood Frenzy bar, and for various labels",Yellow:"Color Yellow. Used to show between best and worst PP buildings closer to best, for Frenzy bar, and for various labels",Orange:"Color Orange. Used to show between best and worst PP buildings closer to worst, for Next Reindeer bar, and for various labels",Red:"Color Red. Used to show worst PP building, for Clot bar, and for various labels",Purple:"Color Purple. Used to show worse than worst PP building, for Next Cookie bar, and for various labels",Gray:"Color Gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar",Pink:"Color Pink. Used for Dragonflight bar",Brown:"Color Brown. Used for Dragon Harvest bar"},func:function(){CM.Disp.UpdateColors()}},CM.Data.Config.UpgradeBarFixedPos={type:"bool",group:"BarsColors",label:["Upgrade Bar Fixed Position OFF","Upgrade Bar Fixed Position ON"],desc:"Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling",toggle:!0,func:function(){CM.Disp.ToggleUpgradeBarFixedPos()}},CM.Data.Config.CalcWrink={type:"bool",group:"Calculation",label:["Calculate with Wrinklers OFF","Calculate with Wrinklers ON","Calculate with Single Fattest Wrinkler ON"],desc:"Calculate times and average Cookies Per Second with (only the single non-shiny fattest) Wrinklers",toggle:!0},CM.Data.Config.CPSMode={type:"bool",group:"Calculation",label:["Current Cookies Per Second","Average Cookies Per Second"],desc:"Calculate times using current Cookies Per Second or average Cookies Per Second",toggle:!1},CM.Data.Config.AvgCPSHist={type:"bool",group:"Calculation",label:["Average CPS for past 10s","Average CPS for past 15s","Average CPS for past 30s","Average CPS for past 1m","Average CPS for past 5m","Average CPS for past 10m","Average CPS for past 15m","Average CPS for past 30m"],desc:"How much time average Cookies Per Second should consider",toggle:!1},CM.Data.Config.AvgClicksHist={type:"bool",group:"Calculation",label:["Average Cookie Clicks for past 1s","Average Cookie Clicks for past 5s","Average Cookie Clicks for past 10s","Average Cookie Clicks for past 15s","Average Cookie Clicks for past 30s"],desc:"How much time average Cookie Clicks should consider",toggle:!1},CM.Data.Config.ColorPPBulkMode={type:"bool",group:"Calculation",label:["Color of PP (Compared to Single)","Color of PP (Compared to Bulk)"],desc:"Color PP-values based on comparison with single purchase or with selected bulk-buy mode",toggle:!1,func:function(){CM.Cache.CachePP()}},CM.Data.Config.PPExcludeTop={type:"bool",group:"Calculation",label:["Don't Ignore Any","Ignore 1st Best","Ignore 1st and 2nd Best","Ignore 1st, 2nd and 3rd Best"],desc:"Makes CookieMonster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values",toggle:!0},CM.Data.Config.PPSecondsLowerLimit={type:"numscale",group:"Calculation",label:"Lower limit for PP (in seconds): ",desc:'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option',min:0,max:1/0},CM.Data.Config.PPOnlyConsiderBuyable={type:"bool",group:"Calculation",label:["Don't Ignore Non-Buyable","Ignore Non-Buyable"],desc:"Makes CookieMonster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'",toggle:!0},CM.Data.Config.ToolWarnBon={type:"bool",group:"Calculation",label:["Calculate Tooltip Warning With Bonus CPS OFF","Calculate Tooltip Warning With Bonus CPS ON"],desc:"Calculate the warning with or without the bonus CPS you get from buying",toggle:!0},CM.Data.Config.Title={type:"bool",group:"NotificationGeneral",label:["Title OFF","Title ON","Title Pinned Tab Highlight"],desc:'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns; "!" means that Golden Cookie/Reindeer can spawn',toggle:!0},CM.Data.Config.GeneralSound={type:"bool",group:"NotificationGeneral",label:["Consider Game Volume Setting OFF","Consider Game Volume Setting ON"],desc:'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down',toggle:!0},CM.Data.Config.GCNotification={type:"bool",group:"NotificationGC",label:["Notification OFF","Notification ON"],desc:"Create a notification when Golden Cookie spawns",toggle:!0,func:function(){CM.Config.CheckNotificationPermissions(CM.Options.GCNotification)}},CM.Data.Config.GCFlash={type:"bool",group:"NotificationGC",label:["Flash OFF","Flash ON"],desc:"Flash screen on Golden Cookie",toggle:!0},CM.Data.Config.GCSound={type:"bool",group:"NotificationGC",label:["Sound OFF","Sound ON"],desc:"Play a sound on Golden Cookie",toggle:!0},CM.Data.Config.GCVolume={type:"vol",group:"NotificationGC",label:[],desc:"Volume"};for(let o=0;o<101;o++)CM.Data.Config.GCVolume.label[o]=`${o}%`;CM.Data.Config.GCSoundURL={type:"url",group:"NotificationGC",label:"Sound URL:",desc:"URL of the sound to be played when a Golden Cookie spawns"},CM.Data.Config.FortuneNotification={type:"bool",group:"NotificationFC",label:["Notification OFF","Notification ON"],desc:"Create a notification when Fortune Cookie is on the Ticker",toggle:!0,func:function(){CM.Config.CheckNotificationPermissions(CM.Options.FortuneNotification)}},CM.Data.Config.FortuneFlash={type:"bool",group:"NotificationFC",label:["Flash OFF","Flash ON"],desc:"Flash screen on Fortune Cookie",toggle:!0},CM.Data.Config.FortuneSound={type:"bool",group:"NotificationFC",label:["Sound OFF","Sound ON"],desc:"Play a sound on Fortune Cookie",toggle:!0},CM.Data.Config.FortuneVolume={type:"vol",group:"NotificationFC",label:[],desc:"Volume"};for(let o=0;o<101;o++)CM.Data.Config.FortuneVolume.label[o]=`${o}%`;CM.Data.Config.FortuneSoundURL={type:"url",group:"NotificationFC",label:"Sound URL:",desc:"URL of the sound to be played when the Ticker has a Fortune Cookie"},CM.Data.Config.SeaNotification={type:"bool",group:"NotificationSea",label:["Notification OFF","Notification ON"],desc:"Create a notification on Season Popup",toggle:!0,func:function(){CM.Config.CheckNotificationPermissions(CM.Options.SeaNotification)}},CM.Data.Config.SeaFlash={type:"bool",group:"NotificationSea",label:["Flash OFF","Flash ON"],desc:"Flash screen on Season Popup",toggle:!0},CM.Data.Config.SeaSound={type:"bool",group:"NotificationSea",label:["Sound OFF","Sound ON"],desc:"Play a sound on Season Popup",toggle:!0},CM.Data.Config.SeaVolume={type:"vol",group:"NotificationSea",label:[],desc:"Volume"};for(let o=0;o<101;o++)CM.Data.Config.SeaVolume.label[o]=`${o}%`;CM.Data.Config.SeaSoundURL={type:"url",group:"NotificationSea",label:"Sound URL:",desc:"URL of the sound to be played when a Season Special spawns"},CM.Data.Config.GardFlash={type:"bool",group:"NotificationGard",label:["Garden Tick Flash OFF","Flash ON"],desc:"Flash screen on Garden Tick",toggle:!0},CM.Data.Config.GardSound={type:"bool",group:"NotificationGard",label:["Sound OFF","Sound ON"],desc:"Play a sound on Garden Tick",toggle:!0},CM.Data.Config.GardVolume={type:"vol",group:"NotificationGard",label:[],desc:"Volume"};for(let o=0;o<101;o++)CM.Data.Config.GardVolume.label[o]=`${o}%`;CM.Data.Config.GardSoundURL={type:"url",group:"NotificationGard",label:"Garden Tick Sound URL:",desc:"URL of the sound to be played when the garden ticks"},CM.Data.Config.MagicNotification={type:"bool",group:"NotificationMagi",label:["Notification OFF","Notification ON"],desc:"Create a notification when magic reaches maximum",toggle:!0,func:function(){CM.Config.CheckNotificationPermissions(CM.Options.MagicNotification)}},CM.Data.Config.MagicFlash={type:"bool",group:"NotificationMagi",label:["Flash OFF","Flash ON"],desc:"Flash screen when magic reaches maximum",toggle:!0},CM.Data.Config.MagicSound={type:"bool",group:"NotificationMagi",label:["Sound OFF","Sound ON"],desc:"Play a sound when magic reaches maximum",toggle:!0},CM.Data.Config.MagicVolume={type:"vol",group:"NotificationMagi",label:[],desc:"Volume"};for(let o=0;o<101;o++)CM.Data.Config.MagicVolume.label[o]=`${o}%`;CM.Data.Config.MagicSoundURL={type:"url",group:"NotificationMagi",label:"Sound URL:",desc:"URL of the sound to be played when magic reaches maxium"},CM.Data.Config.WrinklerNotification={type:"bool",group:"NotificationWrink",label:["Notification OFF","Notification ON"],desc:"Create a notification when a Wrinkler appears",toggle:!0,func:function(){CM.Config.CheckNotificationPermissions(CM.Options.WrinklerNotification)}},CM.Data.Config.WrinklerFlash={type:"bool",group:"NotificationWrink",label:["Flash OFF","Flash ON"],desc:"Flash screen when a Wrinkler appears",toggle:!0},CM.Data.Config.WrinklerSound={type:"bool",group:"NotificationWrink",label:["Sound OFF","Sound ON"],desc:"Play a sound when a Wrinkler appears",toggle:!0},CM.Data.Config.WrinklerVolume={type:"vol",group:"NotificationWrink",label:[],desc:"Volume"};for(let o=0;o<101;o++)CM.Data.Config.WrinklerVolume.label[o]=`${o}%`;CM.Data.Config.WrinklerSoundURL={type:"url",group:"NotificationWrink",label:"Sound URL:",desc:"URL of the sound to be played when a Wrinkler appears"},CM.Data.Config.WrinklerMaxNotification={type:"bool",group:"NotificationWrinkMax",label:["Notification OFF","Notification ON"],desc:"Create a notification when the maximum amount of Wrinklers has appeared",toggle:!0,func:function(){CM.Config.CheckNotificationPermissions(CM.Options.WrinklerMaxNotification)}},CM.Data.Config.WrinklerMaxFlash={type:"bool",group:"NotificationWrinkMax",label:["Flash OFF","Flash ON"],desc:"Flash screen when the maximum amount of Wrinklers has appeared",toggle:!0},CM.Data.Config.WrinklerMaxSound={type:"bool",group:"NotificationWrinkMax",label:["Sound OFF","Sound ON"],desc:"Play a sound when the maximum amount of Wrinklers has appeared",toggle:!0},CM.Data.Config.WrinklerMaxVolume={type:"vol",group:"NotificationWrinkMax",label:[],desc:"Volume"};for(let o=0;o<101;o++)CM.Data.Config.WrinklerMaxVolume.label[o]=`${o}%`;CM.Data.Config.WrinklerMaxSoundURL={type:"url",group:"NotificationWrinkMax",label:"Sound URL:",desc:"URL of the sound to be played when the maximum amount of Wrinklers has appeared"},CM.Data.Config.TooltipBuildUpgrade={type:"bool",group:"Tooltip",label:["Building/Upgrade Tooltip Information OFF","Building/Upgrade Tooltip Information ON"],desc:"Extra information in Building/Upgrade tooltips",toggle:!0},CM.Data.Config.TooltipAmor={type:"bool",group:"Tooltip",label:["Buildings Tooltip Amortization Information OFF","Buildings Tooltip Amortization Information ON"],desc:"Add amortization information to buildings tooltip",toggle:!0},CM.Data.Config.ToolWarnLucky={type:"bool",group:"Tooltip",label:["Tooltip Lucky Warning OFF","Tooltip Lucky Warning ON"],desc:'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards',toggle:!0},CM.Data.Config.ToolWarnLuckyFrenzy={type:"bool",group:"Tooltip",label:["Tooltip Lucky Frenzy Warning OFF","Tooltip Lucky Frenzy Warning ON"],desc:'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards',toggle:!0},CM.Data.Config.ToolWarnConjure={type:"bool",group:"Tooltip",label:["Tooltip Conjure Warning OFF","Tooltip Conjure Warning ON"],desc:'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards',toggle:!0},CM.Data.Config.ToolWarnConjureFrenzy={type:"bool",group:"Tooltip",label:["Tooltip Conjure Frenzy Warning OFF","Tooltip Conjure Frenzy Warning ON"],desc:'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active',toggle:!0},CM.Data.Config.ToolWarnEdifice={type:"bool",group:"Tooltip",label:["Tooltip Edifice Warning OFF","Tooltip Edifice Warning ON"],desc:'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building',toggle:!0},CM.Data.Config.ToolWarnUser={type:"numscale",group:"Tooltip",label:"Tooltip Warning At x times CPS: ",desc:"Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether",min:0,max:1/0},CM.Data.Config.ToolWarnPos={type:"bool",group:"Tooltip",label:["Tooltip Warning Position (Left)","Tooltip Warning Position (Bottom)"],desc:"Placement of the warning boxes",toggle:!1,func:function(){CM.Disp.ToggleToolWarnPos()}},CM.Data.Config.TooltipGrim={type:"bool",group:"Tooltip",label:["Grimoire Tooltip Information OFF","Grimoire Tooltip Information ON"],desc:"Extra information in tooltip for grimoire",toggle:!0},CM.Data.Config.TooltipWrink={type:"bool",group:"Tooltip",label:["Wrinkler Tooltip OFF","Wrinkler Tooltip ON"],desc:"Shows the amount of cookies a wrinkler will give when popping it",toggle:!0},CM.Data.Config.TooltipLump={type:"bool",group:"Tooltip",label:["Sugar Lump Tooltip OFF","Sugar Lump Tooltip ON"],desc:"Shows the current Sugar Lump type in Sugar lump tooltip.",toggle:!0},CM.Data.Config.TooltipPlots={type:"bool",group:"Tooltip",label:["Garden Plots Tooltip OFF","Garden Plots Tooltip ON"],desc:"Shows a tooltip for plants that have a cookie reward.",toggle:!0},CM.Data.Config.DragonAuraInfo={type:"bool",group:"Tooltip",label:["Extra Dragon Aura Info OFF","Extra Dragon Aura Info ON"],desc:"Shows information about changes in CPS and costs in the dragon aura interface.",toggle:!0},CM.Data.Config.TooltipAscendButton={type:"bool",group:"Tooltip",label:["Show Extra Info Ascend Tooltip OFF","Show Extra Info Ascend Tooltip ON"],desc:"Shows additional info in the ascend tooltip",toggle:!0},CM.Data.Config.Stats={type:"bool",group:"Statistics",label:["Statistics OFF","Statistics ON"],desc:"Extra Cookie Monster statistics!",toggle:!0},CM.Data.Config.MissingUpgrades={type:"bool",group:"Statistics",label:["Missing Upgrades OFF","Missing Upgrades ON"],desc:"Shows Missing upgrades in Stats Menu. This feature can be laggy for users with a low amount of unlocked achievements.",toggle:!0},CM.Data.Config.UpStats={type:"bool",group:"Statistics",label:["Statistics Update Rate (Default)","Statistics Update Rate (1s)"],desc:"Default Game rate is once every 5 seconds",toggle:!1},CM.Data.Config.TimeFormat={type:"bool",group:"Statistics",label:["Time XXd, XXh, XXm, XXs","Time XX:XX:XX:XX:XX"],desc:"Change the time format",toggle:!1},CM.Data.Config.DetailedTime={type:"bool",group:"Statistics",label:["Detailed Time OFF","Detailed Time ON"],desc:"Change how time is displayed in certain statistics and tooltips",toggle:!0,func:function(){CM.Disp.ToggleDetailedTime()}},CM.Data.Config.GrimoireBar={type:"bool",group:"Statistics",label:["Grimoire Magic Meter Timer OFF","Grimoire Magic Meter Timer ON"],desc:"A timer on how long before the Grimoire magic meter is full",toggle:!0},CM.Data.Config.HeavenlyChipsTarget={type:"numscale",group:"Statistics",label:"Heavenly Chips Target: ",desc:'Use this to set a Heavenly Chips target that will be counted towards in the "prestige" statsistics sections',min:1,max:1/0},CM.Data.Config.ShowMissedGC={type:"bool",group:"Statistics",label:["Missed GC OFF","Missed GC ON"],desc:"Show a stat in the statistics screen that counts how many Golden Cookies you have missed",toggle:!0},CM.Data.Config.Scale={type:"bool",group:"Notation",label:["Game's Setting Scale","Metric","Short Scale","Short Scale (Abbreviated)","Scientific Notation","Engineering Notation"],desc:"Change how long numbers are handled",toggle:!1,func:function(){CM.Disp.RefreshScale()}},CM.Data.Config.ScaleDecimals={type:"bool",group:"Notation",label:["1 decimals","2 decimals","3 decimals"],desc:"Set the number of decimals used when applicable",toggle:!1,func:function(){CM.Disp.RefreshScale()}},CM.Data.Config.ScaleSeparator={type:"bool",group:"Notation",label:[". for decimals (Standard)",". for thousands"],desc:"Set the separator used for decimals and thousands",toggle:!1,func:function(){CM.Disp.RefreshScale()}},CM.Data.Config.ScaleCutoff={type:"numscale",group:"Notation",label:"Notation Cut-off Point: ",desc:"The number from which CookieMonster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations",min:1,max:999999999},CM.Data.Config.GCTimer={type:"bool",group:"Miscellaneous",label:["Golden Cookie Timer OFF","Golden Cookie Timer ON"],desc:"A timer on the Golden Cookie when it has been spawned",toggle:!0,func:function(){CM.Disp.ToggleGCTimer()}},CM.Data.Config.Favicon={type:"bool",group:"Miscellaneous",label:["Favicon OFF","Favicon ON"],desc:"Update favicon with Golden/Wrath Cookie",toggle:!0,func:function(){CM.Disp.UpdateFavicon()}},CM.Data.Config.WrinklerButtons={type:"bool",group:"Miscellaneous",label:["Extra Buttons OFF","Extra Buttons ON"],desc:"Show buttons for popping wrinklers at bottom of cookie section",toggle:!0,func:function(){CM.Disp.UpdateWrinklerButtons()}},CM.Data.Config.BulkBuyBlock={type:"bool",group:"Miscellaneous",label:["Block Bulk Buying OFF","Block Bulk Buying ON"],desc:"Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.",toggle:!0},CM.Data.ConfigDefault={BotBar:1,TimerBar:1,TimerBarPos:0,TimerBarOverlay:2,BuildColor:1,BulkBuildColor:0,UpBarColor:1,UpgradeBarFixedPos:1,CalcWrink:0,CPSMode:1,AvgCPSHist:3,AvgClicksHist:0,ColorPPBulkMode:1,PPExcludeTop:0,PPSecondsLowerLimit:0,PPOnlyConsiderBuyable:0,ToolWarnBon:0,Title:1,GeneralSound:1,GCNotification:0,GCFlash:1,GCSound:1,GCVolume:100,GCSoundURL:"https://freesound.org/data/previews/66/66717_931655-lq.mp3",FortuneNotification:0,FortuneFlash:1,FortuneSound:1,FortuneVolume:100,FortuneSoundURL:"https://freesound.org/data/previews/174/174027_3242494-lq.mp3",SeaNotification:0,SeaFlash:1,SeaSound:1,SeaVolume:100,SeaSoundURL:"https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3",GardFlash:1,GardSound:1,GardVolume:100,GardSoundURL:"https://freesound.org/data/previews/103/103046_861714-lq.mp3",MagicNotification:0,MagicFlash:1,MagicSound:1,MagicVolume:100,MagicSoundURL:"https://freesound.org/data/previews/221/221683_1015240-lq.mp3",WrinklerNotification:0,WrinklerFlash:1,WrinklerSound:1,WrinklerVolume:100,WrinklerSoundURL:"https://freesound.org/data/previews/124/124186_8043-lq.mp3",WrinklerMaxNotification:0,WrinklerMaxFlash:1,WrinklerMaxSound:1,WrinklerMaxVolume:100,WrinklerMaxSoundURL:"https://freesound.org/data/previews/152/152743_15663-lq.mp3",TooltipBuildUpgrade:1,TooltipAmor:0,ToolWarnLucky:1,ToolWarnLuckyFrenzy:1,ToolWarnConjure:1,ToolWarnConjureFrenzy:1,ToolWarnEdifice:1,ToolWarnUser:0,ToolWarnPos:1,TooltipGrim:1,TooltipWrink:1,TooltipLump:1,TooltipPlots:1,DragonAuraInfo:1,TooltipAscendButton:1,Stats:1,MissingUpgrades:1,UpStats:1,TimeFormat:0,DetailedTime:1,GrimoireBar:1,HeavenlyChipsTarget:1,ShowMissedGC:1,Scale:2,ScaleDecimals:2,ScaleSeparator:0,ScaleCutoff:999999,Colors:{Blue:"#4bb8f0",Green:"#00ff00",Yellow:"#ffff00",Orange:"#ff7f00",Red:"#ff0000",Purple:"#ff00ff",Gray:"#b3b3b3",Pink:"#ff1493",Brown:"#8b4513"},SortBuildings:0,SortUpgrades:0,GCTimer:1,Favicon:1,WrinklerButtons:1,BulkBuyBlock:0,Header:{BarsColors:1,Calculation:1,Notification:1,NotificationGeneral:1,NotificationGC:1,NotificationFC:1,NotificationSea:1,NotificationGard:1,NotificationMagi:1,NotificationWrink:1,NotificationWrinkMax:1,Tooltip:1,Statistics:1,Notation:1,Miscellaneous:1,Lucky:1,Chain:1,Spells:1,Garden:1,Prestige:1,Wrink:1,Sea:1,Misc:1,InfoTab:1}}})();(()=>{"use strict";const e={FormatTime:function(e,t){if(e===1/0)return e;e=Math.ceil(e);const i=Math.floor(e/31557600),o=Math.floor(e%31557600/86400),a=Math.floor(e%86400/3600),n=Math.floor(e%3600/60),s=Math.floor(e%60);let r="";if(CM.Options.TimeFormat){if(e>315576e4)return"XX:XX:XX:XX:XX";r+=(i<10?"0":"")+i+":",r+=(o<10?"0":"")+o+":",r+=(a<10?"0":"")+a+":",r+=(n<10?"0":"")+n+":",r+=(s<10?"0":"")+s}else{if(e>7776e5)return t?"Over 9000 days!":">9000d";r+=i>0?i+(t?1===i?" year":" years":"y")+", ":"",r+=o>0?o+(t?1===o?" day":" days":"d")+", ":"",(r.length>0||a>0)&&(r+=a+(t?1===a?" hour":" hours":"h")+", "),(r.length>0||n>0)&&(r+=n+(t?1===n?" minute":" minutes":"m")+", "),r+=s+(t?1===s?" second":" seconds":"s")}return r}};CM.Disp=e,CM.Disp.GetWrinkConfigBank=function(){return 1===CM.Options.CalcWrink?CM.Cache.WrinklersTotal:2===CM.Options.CalcWrink?CM.Cache.WrinklersFattest[0]:0},CM.Disp.PopAllNormalWrinklers=function(){for(const e of Object.keys(Game.wrinklers))Game.wrinklers[e].sucked>0&&0===Game.wrinklers[e].type&&(Game.wrinklers[e].hp=0)},CM.Disp.GetCPS=function(){return CM.Options.CPSMode?CM.Cache.AvgCPS:0===CM.Options.CalcWrink?Game.cookiesPs*(1-Game.cpsSucked):1===CM.Options.CalcWrink?Game.cookiesPs*(CM.Cache.CurrWrinklerCPSMult+(1-.05*CM.Cache.CurrWrinklerCount)):2===CM.Options.CalcWrink&&1===Game.wrinklers[CM.Cache.WrinklersFattest[1]].type?Game.cookiesPs*(3*CM.Cache.CurrWrinklerCPSMult/CM.Cache.CurrWrinklerCount+(1-.05*CM.Cache.CurrWrinklerCount)):Game.cookiesPs*(CM.Cache.CurrWrinklerCPSMult/CM.Cache.CurrWrinklerCount+(1-.05*CM.Cache.CurrWrinklerCount))},CM.Disp.CalculateGrimoireRefillTime=function(e,t,i){let o=0;for(;e300?CM.Disp.colorRed:e>60?CM.Disp.colorOrange:CM.Disp.colorYellow),{text:i,color:t}},CM.Disp.Beautify=function(e,t,i){const o=CM.Options.ScaleDecimals+1;if(e===1/0)return"Infinity";if(void 0===e)return"0";if(0===CM.Options.Scale)return CM.Backup.Beautify(e,t);if(Number.isFinite(e)){let a="";if(0===e)return e.toString();if(e>.001&&e=.01&&e=.01&&e=.01&&e=1?l("CMTimerBarGCMinBar").textContent=Math.ceil((Game.shimmerTypes.golden.minTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCMinBar").textContent="",Game.shimmerTypes.golden.minTime===Game.shimmerTypes.golden.maxTime?(l("CMTimerBarGCMinBar").style.borderTopRightRadius="10px",l("CMTimerBarGCMinBar").style.borderBottomRightRadius="10px"):(l("CMTimerBarGCMinBar").style.borderTopRightRadius="",l("CMTimerBarGCMinBar").style.borderBottomRightRadius=""),l("CMTimerBarGCBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)*e/Game.shimmerTypes.golden.maxTime)}px`,CM.Options.TimerBarOverlay>=1?l("CMTimerBarGCBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCBar").textContent="",l("CMTimerBarGCTime").textContent=Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps),i++),"christmas"===Game.season&&0===Game.shimmerTypes.reindeer.spawned?(CM.Disp.TimerBars.CMTimerBarRen.style.display="",l("CMTimerBarRenMinBar").style.width=`${Math.round(Math.max(0,Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)*e/Game.shimmerTypes.reindeer.maxTime)}px`,CM.Options.TimerBarOverlay>=1?l("CMTimerBarRenMinBar").textContent=Math.ceil((Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenMinBar").textContent="",l("CMTimerBarRenBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)*e/Game.shimmerTypes.reindeer.maxTime)}px`,CM.Options.TimerBarOverlay>=1?l("CMTimerBarRenBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenBar").textContent="",l("CMTimerBarRenTime").textContent=Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps),i++):CM.Disp.TimerBars.CMTimerBarRen.style.display="none";for(const e of Object.keys(CM.Disp.BuffTimerBars))CM.Disp.BuffTimerBars[e].remove();CM.Disp.BuffTimerBars={};for(const e of Object.keys(Game.buffs))if(Game.buffs[e]){const o=CM.Disp.TimerBarCreateBar(Game.buffs[e].name,Game.buffs[e].name,[{id:`${Game.buffs[e].name}Bar`}]);o.style.display="";let a="";a=void 0!==CM.Disp.buffColors[Game.buffs[e].name]?CM.Disp.buffColors[Game.buffs[e].name]:CM.Disp.colorPurple,o.lastChild.children[1].className=CM.Disp.colorBackPre+a,o.lastChild.children[1].style.color="black",2===CM.Options.TimerBarOverlay?o.lastChild.children[1].textContent=`${Math.round(Game.buffs[e].time/Game.buffs[e].maxTime*100)}%`:o.lastChild.children[1].textContent="",o.lastChild.children[1].style.width=`${Math.round(Game.buffs[e].time*(t-8*Math.ceil(Game.buffs[e].time/Game.fps).toString().length)/Game.buffs[e].maxTime)}px`,o.lastChild.children[2].textContent=Math.ceil(Game.buffs[e].time/Game.fps),i++,CM.Disp.BuffTimerBars[Game.buffs[e].name]=o}for(const e of Object.keys(CM.Disp.BuffTimerBars))CM.Disp.TimerBar.appendChild(CM.Disp.BuffTimerBars[e]);0!==i&&(CM.Disp.TimerBar.style.height=12*i+2+"px"),CM.Disp.LastNumberOfTimers!==i&&(CM.Disp.LastNumberOfTimers=i,CM.Disp.UpdateBotTimerBarPosition())}},CM.Disp.ToggleTimerBar=function(){1===CM.Options.TimerBar?CM.Disp.TimerBar.style.display="":CM.Disp.TimerBar.style.display="none",CM.Disp.UpdateBotTimerBarPosition()},CM.Disp.ToggleTimerBarPos=function(){0===CM.Options.TimerBarPos?(CM.Disp.TimerBar.style.width="30%",CM.Disp.TimerBar.style.bottom="",l("game").insertBefore(CM.Disp.TimerBar,l("sectionLeft"))):(CM.Disp.TimerBar.style.width="100%",CM.Disp.TimerBar.style.bottom="0px",l("wrapper").appendChild(CM.Disp.TimerBar)),CM.Disp.UpdateBotTimerBarPosition()},CM.Disp.UpdateBotTimerBarPosition=function(){1===CM.Options.BotBar&&1===CM.Options.TimerBar&&1===CM.Options.TimerBarPos?(CM.Disp.BotBar.style.bottom=CM.Disp.TimerBar.style.height,l("game").style.bottom=`${Number(CM.Disp.TimerBar.style.height.replace("px",""))+70}px`):1===CM.Options.BotBar?(CM.Disp.BotBar.style.bottom="0px",l("game").style.bottom="70px"):1===CM.Options.TimerBar&&1===CM.Options.TimerBarPos?l("game").style.bottom=CM.Disp.TimerBar.style.height:l("game").style.bottom="0px",1===CM.Options.TimerBar&&0===CM.Options.TimerBarPos?l("sectionLeft").style.top=CM.Disp.TimerBar.style.height:l("sectionLeft").style.top="",CM.Disp.UpdateBackground()},CM.Disp.UpdateBuildings=function(){let e=`Objects${Game.buyBulk}`;if(1===Game.buyMode?CM.Disp.LastTargetBuildings=e:e=CM.Disp.LastTargetBuildings,1===Game.buyMode)if(1===CM.Options.BuildColor)for(const t of Object.keys(CM.Cache[e]))l(`productPrice${Game.Objects[t].id}`).style.color=CM.Options.Colors[CM.Cache[e][t].color];else for(const e of Object.keys(Game.Objects))l(`productPrice${Game.Objects[e].id}`).style.removeProperty("color");else if(-1===Game.buyMode)for(const e of Object.keys(CM.Cache.Objects1)){const t=Game.Objects[e];l(`productPrice${t.id}`).style.color="",l(`productPrice${t.id}`).innerHTML=Beautify(CM.Sim.BuildingSell(t,t.basePrice,t.amount,t.free,Game.buyBulk,1))}if(1===Game.buyMode&&CM.Options.SortBuildings){const t=Object.keys(CM.Cache[e]).map((t=>{const i=CM.Cache[e][t];return i.name=t,i.id=Game.Objects[t].id,i}));t.sort((function(e,t){return CM.Disp.colors.indexOf(e.color)>CM.Disp.colors.indexOf(t.color)?1:CM.Disp.colors.indexOf(e.color){const t=CM.Cache.Objects1[e];return t.name=e,t.id=Game.Objects[e].id,t}));e.sort(((e,t)=>e.id-t.id));for(let t=0;t0){let e=0,t=0,i=0,o=0,a=0,n=0,s=0;for(const r of Object.keys(Game.UpgradesInStore)){const p=Game.UpgradesInStore[r];let C=!1;for(let e=0;eCM.Disp.colors.indexOf(t.color)?1:CM.Disp.colors.indexOf(e.color)e.price-t.price));const t=function(e,t){return e.findIndex((e=>e.name===t.name))};for(let i=0;i0?CM.Cache.spawnedGoldenShimmer.wrath?CM.Disp.Favicon.href="https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico":CM.Disp.Favicon.href="https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico":CM.Disp.Favicon.href="https://orteil.dashnet.org/cookieclicker/favicon.ico"},CM.Disp.UpdateTitle=function(){if(Game.OnAscend||0===CM.Options.Title)document.title=CM.Disp.Title;else if(1===CM.Options.Title){let e,t,i,o=!1,a=!1;e=CM.Cache.spawnedGoldenShimmer?CM.Cache.spawnedGoldenShimmer.wrath?`[W${Math.ceil(CM.Cache.spawnedGoldenShimmer.life/Game.fps)}]`:`[G${Math.ceil(CM.Cache.spawnedGoldenShimmer.life/Game.fps)}]`:Game.Has("Golden switch [off]")?"[GS]":`[${Number(l("CMTimerBarGCMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps)}]`,CM.Main.lastTickerFortuneState&&(o=!0,t="[F]"),"christmas"===Game.season&&(a=!0,i=CM.Main.lastSeasonPopupState?`[R${Math.ceil(CM.Cache.seasonPopShimmer.life/Game.fps)}]`:`[${Number(l("CMTimerBarRenMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps)}]`);let n=CM.Disp.Title;"["===n.charAt(0)&&(n=n.substring(n.lastIndexOf("]")+1)),document.title=`${e+(o?t:"")+(a?i:"")} ${n}`}else if(2===CM.Options.Title){let e="",t=!1;CM.Cache.spawnedGoldenShimmer&&(t=!0,CM.Cache.spawnedGoldenShimmer.wrath?e+=`[W${Math.ceil(CM.Cache.spawnedGoldenShimmer.life/Game.fps)}]`:e+=`[G${Math.ceil(CM.Cache.spawnedGoldenShimmer.life/Game.fps)}]`),CM.Main.lastTickerFortuneState&&(t=!0,e+="[F]"),"christmas"===Game.season&&CM.Main.lastSeasonPopupState&&(e+=`[R${Math.ceil(CM.Cache.seasonPopShimmer.life/Game.fps)}]`,t=!0),t&&(e+=" - ");let i="Cookie Clicker";"fools"===Game.season&&(i="Cookie Baker"),e+=i,document.title=e}},CM.Disp.CreateGCTimer=function(e){const t=document.createElement("div");t.id=`GCTimer${e.id}`,t.style.width="96px",t.style.height="96px",t.style.position="absolute",t.style.zIndex="10000000001",t.style.textAlign="center",t.style.lineHeight="96px",t.style.fontFamily='"Kavoon", Georgia, serif',t.style.fontSize="35px",t.style.cursor="pointer",t.style.display="block",0===CM.Options.GCTimer&&(t.style.display="none"),t.style.left=e.l.style.left,t.style.top=e.l.style.top,t.onclick=function(){e.pop()},t.onmouseover=function(){e.l.style.filter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))",e.l.style.webkitFilter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))"},t.onmouseout=function(){e.l.style.filter="",e.l.style.webkitFilter=""},CM.Disp.GCTimers[e.id]=t,l("shimmers").appendChild(t)},CM.Disp.ToggleGCTimer=function(){if(1===CM.Options.GCTimer)for(const e of Object.keys(CM.Disp.GCTimers))CM.Disp.GCTimers[e].style.display="block",CM.Disp.GCTimers[e].style.left=CM.Cache.goldenShimmersByID[e].l.style.left,CM.Disp.GCTimers[e].style.top=CM.Cache.goldenShimmersByID[e].l.style.top;else for(const e of Object.keys(CM.Disp.GCTimers))CM.Disp.GCTimers[e].style.display="none"},CM.Disp.CreateSimpleTooltip=function(e,t,i){CM.Disp[e]=document.createElement("div");const o=document.createElement("div");o.style.minWidth=i,o.style.marginBottom="4px";const a=document.createElement("div");a.style.textAlign="left",a.textContent=t,o.appendChild(a),CM.Disp[e].appendChild(o)},CM.Disp.ReplaceTooltipUpgrade=function(){CM.Disp.TooltipUpgradeBackup=[];for(const e of Object.keys(Game.UpgradesInStore))null!==l(`upgrade${e}`).onmouseover&&(CM.Disp.TooltipUpgradeBackup[e]=l(`upgrade${e}`).onmouseover,l(`upgrade${e}`).onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return CM.Disp.Tooltip("u",`${e}`)}),"store"),Game.tooltip.wobble())})},CM.Disp.Tooltip=function(e,t){if("b"===e){if(l("tooltip").innerHTML=Game.Objects[t].tooltip(),1===CM.Options.TooltipAmor){const e=CM.Sim.BuildingGetPrice(Game.Objects[t],Game.Objects[t].basePrice,0,Game.Objects[t].free,Game.Objects[t].amount),i=e-Game.Objects[t].totalCookies;i>0&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split("so far").join(`so far
${Beautify(i)} ${1===Math.floor(i)?"cookie":"cookies"} left to amortize (${CM.Disp.GetTimeColor((e-Game.Objects[t].totalCookies)/(Game.Objects[t].storedTotalCps*Game.globalCpsMult)).text})`))}-1===Game.buyMode&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split(Beautify(Game.Objects[t].bulkPrice)).join(Beautify(CM.Sim.BuildingSell(Game.Objects[t],Game.Objects[t].basePrice,Game.Objects[t].amount,Game.Objects[t].free,Game.buyBulk,1))))}else if("u"===e){if(!Game.UpgradesInStore[t])return"";l("tooltip").innerHTML=Game.crateTooltip(Game.UpgradesInStore[t],"store")}else"s"===e?l("tooltip").innerHTML=Game.lumpTooltip():"g"===e?l("tooltip").innerHTML=Game.Objects["Wizard tower"].minigame.spellTooltip(t)():"p"===e?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.tileTooltip(t[0],t[1])():"ha"===e&&(l("tooltip").innerHTML=Game.ObjectsById[2].minigame.toolTooltip(1)());if("b"===e&&1===Game.buyMode||"u"===e||"s"===e||"g"===e||"p"===e&&!Game.keys[16]||"ha"===e){const e=document.createElement("div");e.id="CMTooltipArea",l("tooltip").appendChild(e)}return CM.Disp.tooltipType=e,CM.Disp.tooltipName=t,CM.Disp.UpdateTooltip(),l("tooltip").innerHTML},CM.Disp.TooltipCreateTooltipBox=function(){l("tooltip").firstChild.style.paddingBottom="4px";const e=document.createElement("div");return e.style.border="1px solid",e.style.padding="4px",e.style.margin="0px -4px",e.id="CMTooltipBorder",e.className=CM.Disp.colorTextPre+CM.Disp.colorGray,e},CM.Disp.TooltipCreateHeader=function(e){const t=document.createElement("div");return t.style.fontWeight="bold",t.id=`${e}Title`,t.className=CM.Disp.colorTextPre+CM.Disp.colorBlue,t.textContent=e,t},CM.Disp.TooltipCreateCalculationSection=function(e){e.appendChild(CM.Disp.TooltipCreateHeader("Bonus Income"));const t=document.createElement("div");t.style.marginBottom="4px",t.style.color="white",t.id="CMTooltipIncome",e.appendChild(t),e.appendChild(CM.Disp.TooltipCreateHeader("Bonus Cookies per Click")),e.lastChild.style.display="none";const i=document.createElement("div");i.style.marginBottom="4px",i.style.color="white",i.style.display="none",i.id="CMTooltipCookiePerClick",e.appendChild(i),e.appendChild(CM.Disp.TooltipCreateHeader("Payback Period"));const o=document.createElement("div");o.style.marginBottom="4px",o.id="CMTooltipPP",e.appendChild(o),e.appendChild(CM.Disp.TooltipCreateHeader("Time Left"));const a=document.createElement("div");if(a.id="CMTooltipTime",e.appendChild(a),"b"===CM.Disp.tooltipType){e.appendChild(CM.Disp.TooltipCreateHeader("Production left till next achievement")),e.lastChild.id="CMTooltipProductionHeader";const t=document.createElement("div");t.id="CMTooltipProduction",e.appendChild(t)}},CM.Disp.TooltipCreateWarningSection=function(){CM.Disp.TooltipWarn=document.createElement("div"),CM.Disp.TooltipWarn.style.position="absolute",CM.Disp.TooltipWarn.style.display="block",CM.Disp.TooltipWarn.style.left="auto",CM.Disp.TooltipWarn.style.bottom="auto",CM.Disp.TooltipWarn.id="CMDispTooltipWarningParent";const e=function(e,t,i,o,a){const n=document.createElement("div");n.id=e,n.style.display="none",n.style.transition="opacity 0.1s ease-out",n.className=CM.Disp.colorBorderPre+t,n.style.padding="2px",n.style.background="#000 url(img/darkNoise.png)";const s=document.createElement("div");n.appendChild(s);const r=document.createElement("span");r.className=CM.Disp.colorTextPre+t,r.style.fontWeight="bold",r.textContent=i,s.appendChild(r),s.appendChild(document.createTextNode(o));const l=document.createElement("div");n.appendChild(l);const p=document.createElement("span");return p.id=a,l.appendChild(document.createTextNode("Deficit: ")),l.appendChild(p),n};return CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnLucky",CM.Disp.colorRed,"Warning: ",'Purchase of this item will put you under the number of Cookies required for "Lucky!"',"CMDispTooltipWarnLuckyText")),CM.Disp.TooltipWarn.firstChild.style.marginBottom="4px",CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnLuckyFrenzy",CM.Disp.colorYellow,"Warning: ",'Purchase of this item will put you under the number of Cookies required for "Lucky!" (Frenzy)',"CMDispTooltipWarnLuckyFrenzyText")),CM.Disp.TooltipWarn.lastChild.style.marginBottom="4px",CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnConjure",CM.Disp.colorPurple,"Warning: ",'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods"',"CMDispTooltipWarnConjureText")),CM.Disp.TooltipWarn.lastChild.style.marginBottom="4px",CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnConjureFrenzy",CM.Disp.colorPurple,"Warning: ",'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods" (Frenzy)',"CMDispTooltipWarnConjureFrenzyText")),CM.Disp.TooltipWarn.lastChild.style.marginBottom="4px",CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnEdifice",CM.Disp.colorPurple,"Warning: ",'Purchase of this item will put you under the number of Cookies needed for "Spontaneous Edifice" to possibly give you your most expensive building"',"CMDispTooltipWarnEdificeText")),CM.Disp.TooltipWarn.lastChild.style.marginBottom="4px",CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnUser",CM.Disp.colorRed,"Warning: ",`Purchase of this item will put you under the number of Cookies equal to ${CM.Options.ToolWarnUser} seconds of CPS`,"CMDispTooltipWarnUserText")),CM.Disp.TooltipWarn},CM.Disp.UpdateTooltip=function(){if(CM.Sim.CopyData(),"none"!==l("tooltipAnchor").style.display&&l("CMTooltipArea")){l("CMTooltipArea").innerHTML="";const e=CM.Disp.TooltipCreateTooltipBox();l("CMTooltipArea").appendChild(e),"b"===CM.Disp.tooltipType?CM.Disp.UpdateTooltipBuilding():"u"===CM.Disp.tooltipType?CM.Disp.UpdateTooltipUpgrade():"s"===CM.Disp.tooltipType?CM.Disp.UpdateTooltipSugarLump():"g"===CM.Disp.tooltipType?CM.Disp.UpdateTooltipGrimoire():"p"===CM.Disp.tooltipType?CM.Disp.UpdateTooltipGardenPlots():"ha"===CM.Disp.tooltipType&&CM.Disp.UpdateTooltipHarvestAll(),CM.Disp.UpdateTooltipWarnings()}else null===l("CMTooltipArea")&&null!==l("CMDispTooltipWarningParent")&&l("CMDispTooltipWarningParent").remove()},CM.Disp.UpdateTooltipBuilding=function(){if(1===CM.Options.TooltipBuildUpgrade&&1===Game.buyMode){const e=l("CMTooltipBorder");CM.Disp.TooltipCreateCalculationSection(e);let t=`Objects${Game.buyBulk}`;if(1===Game.buyMode?CM.Disp.LastTargetTooltipBuilding=t:t=CM.Disp.LastTargetTooltipBuilding,CM.Disp.TooltipPrice=Game.Objects[CM.Disp.tooltipName].bulkPrice,CM.Disp.TooltipBonusIncome=CM.Cache[t][CM.Disp.tooltipName].bonus,1===CM.Options.TooltipBuildUpgrade&&1===Game.buyMode){l("CMTooltipIncome").textContent=Beautify(CM.Disp.TooltipBonusIncome,2);const e=Math.round(CM.Disp.TooltipBonusIncome/Game.cookiesPs*1e4);Number.isFinite(e)&&0!==e&&(l("CMTooltipIncome").textContent+=` (${e/100}% of income)`),l("CMTooltipBorder").className=CM.Disp.colorTextPre+CM.Cache[t][CM.Disp.tooltipName].color,l("CMTooltipPP").textContent=Beautify(CM.Cache[t][CM.Disp.tooltipName].pp,2),l("CMTooltipPP").className=CM.Disp.colorTextPre+CM.Cache[t][CM.Disp.tooltipName].color;const i=CM.Disp.GetTimeColor((CM.Disp.TooltipPrice-(Game.cookies+CM.Disp.GetWrinkConfigBank()))/CM.Disp.GetCPS());l("CMTooltipTime").textContent=i.text,"Done!"===i.text&&Game.cookiese.plantsById[e.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0]-1].matureBase,i=e.plantsById[e.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0]-1].name;l("CMTooltipBorder").appendChild(CM.Disp.TooltipCreateHeader("Reward (Current / Maximum)"));const o=document.createElement("div");o.id="CMTooltipPlantReward",l("CMTooltipBorder").appendChild(o),"Bakeberry"===i?l("CMTooltipPlantReward").textContent=`${t?CM.Disp.Beautify(Math.min(.03*Game.cookies,60*Game.cookiesPs*30)):"0"} / ${CM.Disp.Beautify(60*Game.cookiesPs*30)}`:"Chocoroot"===i||"White chocoroot"===i?l("CMTooltipPlantReward").textContent=`${t?CM.Disp.Beautify(Math.min(.03*Game.cookies,60*Game.cookiesPs*3)):"0"} / ${CM.Disp.Beautify(60*Game.cookiesPs*3)}`:"Queenbeet"===i?l("CMTooltipPlantReward").textContent=`${t?CM.Disp.Beautify(Math.min(.04*Game.cookies,60*Game.cookiesPs*60)):"0"} / ${CM.Disp.Beautify(60*Game.cookiesPs*60)}`:"Duketater"===i?l("CMTooltipPlantReward").textContent=`${t?CM.Disp.Beautify(Math.min(.08*Game.cookies,60*Game.cookiesPs*120)):"0"} / ${CM.Disp.Beautify(60*Game.cookiesPs*120)}`:l("CMTooltipArea").style.display="none"}else l("CMTooltipArea").style.display="none"},CM.Disp.UpdateTooltipHarvestAll=function(){const e=Game.Objects.Farm.minigame;if(CM.Options.TooltipLump){l("CMTooltipBorder").appendChild(CM.Disp.TooltipCreateHeader("Cookies gained from harvesting:"));let t=0,i=0;Game.keys[16]&&Game.keys[17]&&(i=1);for(let o=0;o<6;o++)for(let a=0;a<6;a++)if(e.plot[o][a][0]>=1){const n=e.plot[o][a],s=e.plantsById[n[0]-1],r=s.name;let l=!0;i&&s.immortal&&(l=!1),n[1]0&&e0&&i.selected){if(e=!0,0!==CM.Disp.TooltipWrinklerBeingShown[t]&&void 0!==CM.Disp.TooltipWrinklerBeingShown[t])break;{const e=document.createElement("div"),i=document.createElement("div");i.style.minWidth="120px",i.style.marginBottom="4px";const o=document.createElement("div");o.style.textAlign="center",o.id="CMTooltipWrinkler",i.appendChild(o),e.appendChild(i),Game.tooltip.draw(this,escape(e.innerHTML)),CM.Disp.TooltipWrinkler=t,CM.Disp.TooltipWrinklerBeingShown[t]=1}}else CM.Disp.TooltipWrinklerBeingShown[t]=0}e||Game.tooltip.hide()}},CM.Disp.UpdateWrinklerTooltip=function(){if(1===CM.Options.TooltipWrink&&null!==l("CMTooltipWrinkler")){let e=Game.wrinklers[CM.Disp.TooltipWrinkler].sucked,t=1.1;if(Game.Has("Sacrilegious corruption")&&(t*=1.05),1===Game.wrinklers[CM.Disp.TooltipWrinkler].type&&(t*=3),e*=t,Game.Has("Wrinklerspawn")&&(e*=1.05),CM.Sim.Objects.Temple.minigameLoaded){const t=Game.hasGod("scorn");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05)}l("CMTooltipWrinkler").textContent=Beautify(e)}},CM.Disp.AddAuraInfo=function(e){if(1===CM.Options.DragonAuraInfo){const[t,i]=CM.Sim.CalculateChangeAura(e),o=CM.Disp.FormatTime(i/(t+Game.cookiesPs)),a=CM.Disp.Beautify(t/Game.cookiesPs);l("dragonAuraInfo").style.minHeight="60px",l("dragonAuraInfo").style.margin="8px",l("dragonAuraInfo").appendChild(document.createElement("div")).className="line";const n=document.createElement("div");n.style.minWidth="200px",n.style.textAlign="center",n.textContent=`Picking this aura will change CPS by ${CM.Disp.Beautify(t)} (${a}% of current CPS).`,l("dragonAuraInfo").appendChild(n);const s=document.createElement("div");s.style.minWidth="200px",s.style.textAlign="center",s.textContent=`It will take ${o} to recover the cost.`,l("dragonAuraInfo").appendChild(s)}},CM.Disp.AddDragonLevelUpTooltip=function(){if(null!==(l("specialPopup").className.match(/onScreen/)&&l("specialPopup").children[0].style.background.match(/dragon/)))for(let e=0;e${CM.Cache.CostDragonUpgrade}`,"this"),Game.tooltip.wobble()},l("specialPopup").children[e].onmouseout=function(){Game.tooltip.shouldHide=1})},CM.Disp.AddMenu=function(){const e=document.createElement("div");e.className="title","prefs"===Game.onMenu?(e.textContent="Cookie Monster Settings",CM.Disp.AddMenuPref(e)):"stats"===Game.onMenu?CM.Options.Stats&&(e.textContent="Cookie Monster Statistics",CM.Disp.AddMenuStats(e)):"log"===Game.onMenu&&(e.textContent="Cookie Monster ",CM.Disp.AddMenuInfo(e))},CM.Disp.RefreshMenu=function(){CM.Options.UpStats&&"stats"===Game.onMenu&&(Game.drawT-1)%(5*Game.fps)!=0&&(Game.drawT-1)%Game.fps==0&&Game.UpdateMenu()},CM.Disp.AddMenuPref=function(e){const t=document.createDocumentFragment();t.appendChild(e);for(const e of Object.keys(CM.Data.ConfigGroups)){const i=CM.Disp.CreatePrefHeader(e,CM.Data.ConfigGroups[e]);if(t.appendChild(i),CM.Options.Header[e])if("Notification"===e)for(const e of Object.keys(CM.Data.ConfigGroupsNotification)){const i=CM.Disp.CreatePrefHeader(e,CM.Data.ConfigGroupsNotification[e]);if(i.style.fontSize="15px",i.style.opacity="0.5",t.appendChild(i),CM.Options.Header[e])for(const i in CM.Data.Config)CM.Data.Config[i].group===e&&t.appendChild(CM.Disp.CreatePrefOption(i))}else for(const i of Object.keys(CM.Data.Config))CM.Data.Config[i].group===e&&t.appendChild(CM.Disp.CreatePrefOption(i))}const i=document.createElement("div");i.className="listing";const o=document.createElement("a");o.className="option",o.onclick=function(){CM.Config.RestoreDefault()},o.textContent="Restore Default",i.appendChild(o),t.appendChild(i),l("menu").childNodes[2].insertBefore(t,l("menu").childNodes[2].childNodes[l("menu").childNodes[2].childNodes.length-1])},CM.Disp.CreatePrefHeader=function(e,t){const i=document.createElement("div");i.className="title",i.style.opacity="0.7",i.style.fontSize="17px",i.appendChild(document.createTextNode(`${t} `));const o=document.createElement("span");return o.style.cursor="pointer",o.style.display="inline-block",o.style.height="14px",o.style.width="14px",o.style.borderRadius="7px",o.style.textAlign="center",o.style.backgroundColor="#C0C0C0",o.style.color="black",o.style.fontSize="13px",o.style.verticalAlign="middle",o.textContent=CM.Options.Header[e]?"-":"+",o.onclick=function(){CM.Config.ToggleHeader(e),Game.UpdateMenu()},i.appendChild(o),i},CM.Disp.CreatePrefOption=function(e){const t=document.createElement("div");if(t.className="listing","bool"===CM.Data.Config[e].type){const i=document.createElement("a");CM.Data.Config[e].toggle&&0===CM.Options[e]?i.className="option off":i.className="option",i.id=CM.Config.ConfigPrefix+e,i.onclick=function(){CM.Config.ToggleConfig(e)},i.textContent=CM.Data.Config[e].label[CM.Options[e]],t.appendChild(i);const o=document.createElement("label");return o.textContent=CM.Data.Config[e].desc,t.appendChild(o),t}if("vol"===CM.Data.Config[e].type){const i=document.createElement("div");i.className="sliderBox";const o=document.createElement("div");o.style.float="left",o.innerHTML=CM.Data.Config[e].desc,i.appendChild(o);const a=document.createElement("div");a.id=`slider${e}right`,a.style.float="right",a.innerHTML=`${CM.Options[e]}%`,i.appendChild(a);const n=document.createElement("input");return n.className="slider",n.id=`slider${e}`,n.style.clear="both",n.type="range",n.min="0",n.max="100",n.step="1",n.value=CM.Options[e],n.oninput=function(){CM.Config.ToggleConfigVolume(e)},n.onchange=function(){CM.Config.ToggleConfigVolume(e)},i.appendChild(n),t.appendChild(i),t}if("url"===CM.Data.Config[e].type){const i=document.createElement("span");i.className="option",i.textContent=`${CM.Data.Config[e].label} `,t.appendChild(i);const o=document.createElement("input");o.id=CM.Config.ConfigPrefix+e,o.className="option",o.type="text",o.readOnly=!0,o.setAttribute("value",CM.Options[e]),o.style.width="300px",t.appendChild(o),t.appendChild(document.createTextNode(" "));const a=document.createElement("input");a.id=`${CM.Config.ConfigPrefix+e}Prompt`,a.className="option",a.type="text",a.setAttribute("value",CM.Options[e]);const n=document.createElement("a");n.className="option",n.onclick=function(){Game.Prompt(a.outerHTML,[["Save",`CM.Options['${e}'] = l(CM.Config.ConfigPrefix + '${e}' + 'Prompt').value; CM.Config.SaveConfig(); Game.ClosePrompt(); Game.UpdateMenu();`],"Cancel"])},n.textContent="Edit",t.appendChild(n);const s=document.createElement("label");return s.textContent=CM.Data.Config[e].desc,t.appendChild(s),t}if("color"===CM.Data.Config[e].type){t.className="";for(let e=0;ethis.max&&console.log("TEST"),CM.Options[e]=this.value,CM.Config.SaveConfig(),CM.Disp.RefreshScale()},t.appendChild(o),t.appendChild(document.createTextNode(" "));const a=document.createElement("label");return a.textContent=CM.Data.Config[e].desc,t.appendChild(a),t}return t},CM.Disp.ToggleDetailedTime=function(){1===CM.Options.DetailedTime?Game.sayTime=CM.Disp.sayTime:Game.sayTime=CM.Backup.sayTime},CM.Disp.RefreshScale=function(){BeautifyAll(),Game.RefreshStore(),Game.RebuildUpgrades(),CM.Disp.UpdateBotBar(),CM.Disp.UpdateBuildings(),CM.Disp.UpdateUpgrades()},CM.Disp.UpdateColors=function(){let e="";for(let t=0;t0&&(t.appendChild(CM.Disp.CreateStatsHeader("Wrinklers","Wrink")),CM.Options.Header.Wrink)){const e=document.createDocumentFragment();e.appendChild(document.createTextNode(`${Beautify(CM.Cache.WrinklersTotal)} / ${Beautify(CM.Cache.WrinklersNormal)} `));const i=document.createElement("a");i.textContent="Pop All Normal",i.className="option",i.onclick=function(){CM.Disp.PopAllNormalWrinklers()},e.appendChild(i),t.appendChild(CM.Disp.CreateStatsListing("basic","Rewards of Popping (All/Normal)",e));const o=document.createDocumentFragment();o.appendChild(document.createTextNode(`${Beautify(CM.Cache.WrinklersFattest[0])} `));const a=document.createElement("a");a.textContent="Pop Single Fattest",a.className="option",a.onclick=function(){null!==CM.Cache.WrinklersFattest[1]&&(Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp=0)},o.appendChild(a),t.appendChild(CM.Disp.CreateStatsListing("basic",`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${null!==CM.Cache.WrinklersFattest[1]?CM.Cache.WrinklersFattest[1]:"None"})`,o))}let i=!1;const o=[];for(const e of Object.keys(CM.Data.HalloCookies))Game.Has(CM.Data.HalloCookies[e])||(o.push(CM.Data.HalloCookies[e]),i=!0);const a=[];for(const e of Object.keys(CM.Data.ChristCookies))Game.Has(CM.Data.ChristCookies[e])||(a.push(CM.Data.ChristCookies[e]),i=!0);const n=[];for(const e of Object.keys(CM.Data.ValCookies))Game.Has(CM.Data.ValCookies[e])||(n.push(CM.Data.ValCookies[e]),i=!0);const s=[];for(const e of Object.keys(Game.eggDrops))Game.HasUnlocked(Game.eggDrops[e])||(s.push(Game.eggDrops[e]),i=!0);const r=[];for(const e of Object.keys(Game.rareEggDrops))Game.HasUnlocked(Game.rareEggDrops[e])||(r.push(Game.rareEggDrops[e]),i=!0);const p=[];for(const e of Object.keys(CM.Data.PlantDrops))Game.HasUnlocked(CM.Data.PlantDrops[e])||(p.push(CM.Data.PlantDrops[e]),i=!0);const C=Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg"),c=Game.Has("Century egg");if(("christmas"===Game.season||i||C||c)&&(t.appendChild(CM.Disp.CreateStatsHeader("Season Specials","Sea")),CM.Options.Header.Sea&&(0!==o.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Halloween Cookies Left to Buy",CM.Disp.CreateStatsMissDisp(o))),0!==a.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Christmas Cookies Left to Buy",CM.Disp.CreateStatsMissDisp(a))),0!==n.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Valentine Cookies Left to Buy",CM.Disp.CreateStatsMissDisp(n))),0!==s.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Normal Easter Eggs Left to Unlock",CM.Disp.CreateStatsMissDisp(s))),0!==r.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Rare Easter Eggs Left to Unlock",CM.Disp.CreateStatsMissDisp(r))),0!==p.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Rare Plant Drops Left to Unlock",CM.Disp.CreateStatsMissDisp(p))),"christmas"===Game.season&&t.appendChild(CM.Disp.CreateStatsListing("basic","Reindeer Reward",document.createTextNode(Beautify(CM.Cache.SeaSpec)))),C&&t.appendChild(CM.Disp.CreateStatsListing("withTooltip","Chocolate Egg Cookies",document.createTextNode(Beautify(CM.Cache.lastChoEgg)),"ChoEggTooltipPlaceholder")),c&&t.appendChild(CM.Disp.CreateStatsListing("basic","Century Egg Multiplier",document.createTextNode(Math.round(1e4*(CM.Cache.CentEgg-1))/100+"%"))))),t.appendChild(CM.Disp.CreateStatsHeader("Miscellaneous","Misc")),CM.Options.Header.Misc){if(t.appendChild(CM.Disp.CreateStatsListing("basic",`Average Cookies Per Second (Past ${CM.Disp.cookieTimes[CM.Options.AvgCPSHist]<60?`${CM.Disp.cookieTimes[CM.Options.AvgCPSHist]} seconds`:CM.Disp.cookieTimes[CM.Options.AvgCPSHist]/60+(3===CM.Options.AvgCPSHist?" minute":" minutes")})`,document.createTextNode(Beautify(CM.Disp.GetCPS(),3)))),t.appendChild(CM.Disp.CreateStatsListing("basic",`Average Cookie Clicks Per Second (Past ${CM.Disp.clickTimes[CM.Options.AvgClicksHist]}${0===CM.Options.AvgClicksHist?" second":" seconds"})`,document.createTextNode(Beautify(CM.Cache.AverageClicks,1)))),Game.Has("Fortune cookies")){const e=[];for(const t of Object.keys(CM.Data.Fortunes))Game.Has(CM.Data.Fortunes[t])||e.push(CM.Data.Fortunes[t]);0!==e.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Fortune Upgrades Left to Buy",CM.Disp.CreateStatsMissDisp(e)))}if(CM.Options.ShowMissedGC&&t.appendChild(CM.Disp.CreateStatsListing("basic","Missed Golden Cookies",document.createTextNode(Beautify(Game.missedGoldenClicks)))),Game.prefs.autosave){const e=document.createElement("span");e.id="CMStatsAutosaveTimer",e.innerText=Game.sayTime(60*Game.fps-(Game.OnAscend?0:Game.T%(60*Game.fps)),4),t.appendChild(CM.Disp.CreateStatsListing("basic","Time till autosave",e))}}l("menu").insertBefore(t,l("menu").childNodes[2]),CM.Options.MissingUpgrades&&CM.Disp.AddMissingUpgrades()},CM.Disp.CreateStatsHeader=function(e,t){const i=document.createElement("div");i.className="title",i.style.padding="0px 16px",i.style.opacity="0.7",i.style.fontSize="17px",i.style.fontFamily='"Kavoon", Georgia, serif',i.appendChild(document.createTextNode(`${e} `));const o=document.createElement("span");return o.style.cursor="pointer",o.style.display="inline-block",o.style.height="14px",o.style.width="14px",o.style.borderRadius="7px",o.style.textAlign="center",o.style.backgroundColor="#C0C0C0",o.style.color="black",o.style.fontSize="13px",o.style.verticalAlign="middle",o.textContent=CM.Options.Header[t]?"-":"+",o.onclick=function(){CM.Config.ToggleHeader(t),Game.UpdateMenu()},i.appendChild(o),i},CM.Disp.CreateStatsListing=function(e,t,i,o){const a=document.createElement("div");a.className="listing";const n=document.createElement("b");if(n.textContent=t,a.appendChild(n),"withTooltip"===e){a.className="listing",a.appendChild(document.createTextNode(" "));const e=document.createElement("span");e.onmouseout=function(){Game.tooltip.hide()},e.onmouseover=function(){Game.tooltip.draw(this,escape(CM.Disp[o].innerHTML))},e.style.cursor="default",e.style.display="inline-block",e.style.height="10px",e.style.width="10px",e.style.borderRadius="5px",e.style.textAlign="center",e.style.backgroundColor="#C0C0C0",e.style.color="black",e.style.fontSize="9px",e.style.verticalAlign="bottom",e.textContent="?",a.appendChild(e)}return a.appendChild(document.createTextNode(": ")),a.appendChild(i),a},CM.Disp.CreateStatsMissDisp=function(e){const t=document.createDocumentFragment();t.appendChild(document.createTextNode(`${e.length} `));const i=document.createElement("span");i.onmouseout=function(){Game.tooltip.hide()};const o=document.createElement("div"),a=document.createElement("div");a.style.minWidth="140px",a.style.marginBottom="4px";const n=document.createElement("div");n.className="name",n.style.marginBottom="4px",n.style.textAlign="center",n.textContent="Missing",a.appendChild(n);for(const t of Object.keys(e)){const i=document.createElement("div");i.style.textAlign="center",i.appendChild(document.createTextNode(e[t])),a.appendChild(i)}return o.appendChild(a),i.onmouseover=function(){Game.tooltip.draw(this,escape(o.innerHTML))},i.style.cursor="default",i.style.display="inline-block",i.style.height="10px",i.style.width="10px",i.style.borderRadius="5px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="9px",i.style.verticalAlign="bottom",i.textContent="?",t.appendChild(i),t},CM.Disp.CreateStatsLuckySection=function(){const e=Game.auraMult("Dragon's Fortune")?"GoldCookDragonsFortuneTooltipPlaceholder":"GoldCookTooltipPlaceholder",t=document.createElement("div");t.className="CMStatsLuckySection";const i=Game.cookies+CM.Disp.GetWrinkConfigBank()0&&(e.appendChild(CM.Disp.CreateStatsListing("basic","Heavenly Chips To Target Set In Settings (CUR)",document.createTextNode(Beautify(t)))),e.appendChild(CM.Disp.CreateStatsListing("basic","Time To Target (CUR, Current 5 Second Average)",document.createTextNode(CM.Disp.FormatTime(t/CM.Cache.HCPerSecond)))))}const s=CM.Sim.ResetBonus(t),r=document.createDocumentFragment();r.appendChild(document.createTextNode(Beautify(s)));const l=Math.round(s/Game.cookiesPs*1e4);if(isFinite(l)&&0!==l){const e=document.createElement("small");e.textContent=` (${l/100}% of income)`,r.appendChild(e)}e.appendChild(CM.Disp.CreateStatsListing("withTooltip","Reset Bonus Income",r,"ResetTooltipPlaceholder"));const p=Math.floor(Game.HowMuchPrestige(Game.cookiesReset)),C=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned)),c=C-p;if(!Game.Has("Lucky digit")){let t=7-C%10;t<0&&(t+=10);const i=c+t,o=C+t,a=document.createDocumentFragment();a.appendChild(document.createTextNode(`${o.toLocaleString()} / ${i.toLocaleString()} (+${t})`)),e.appendChild(CM.Disp.CreateStatsListing("basic",'Next "Lucky Digit" (total / reset)',a))}if(!Game.Has("Lucky number")){let t=777-C%1e3;t<0&&(t+=1e3);const i=c+t,o=C+t,a=document.createDocumentFragment();a.appendChild(document.createTextNode(`${o.toLocaleString()} / ${i.toLocaleString()} (+${t})`)),e.appendChild(CM.Disp.CreateStatsListing("basic",'Next "Lucky Number" (total / reset)',a))}if(!Game.Has("Lucky payout")){let t=777777-C%1e6;t<0&&(t+=1e6);const i=c+t,o=C+t,a=document.createDocumentFragment();a.appendChild(document.createTextNode(`${o.toLocaleString()} / ${i.toLocaleString()} (+${t})`)),e.appendChild(CM.Disp.CreateStatsListing("basic",'Next "Lucky Payout" (total / reset)',a))}return e},CM.Disp.AddMissingUpgrades=function(){for(const e of l("menu").children)if(e.children[0])if("Prestige"===e.children[0].innerHTML&&CM.Cache.MissingUpgradesPrestige){const t=CM.Cache.MissingUpgradesPrestige.match(new RegExp("div","g")||0).length/2,i=document.createElement("div");i.id="CMMissingUpgradesPrestigeTitle",i.className="listing";const o=document.createElement("div");o.innerHTML=`Missing Prestige upgrades: ${t}/${Game.PrestigeUpgrades.length} (${Math.floor(t/Game.PrestigeUpgrades.length*100)}%)`,i.appendChild(o),e.appendChild(i);const a=document.createElement("div");a.className="listing crateBox",a.innerHTML=CM.Cache.MissingUpgradesPrestige,e.appendChild(a)}else if("Upgrades"===e.children[0].innerHTML){if(CM.Cache.MissingUpgrades){const t=CM.Cache.MissingUpgrades.match(new RegExp("div","g")||0).length/2,i=document.createElement("div");i.id="CMMissingUpgradesTitle",i.className="listing";const o=document.createElement("div");o.innerHTML=`Missing normal upgrades: ${t}/${Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length} (${Math.floor(t/(Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length)*100)}%)`,i.appendChild(o),e.insertBefore(i,e.childNodes[3]);const a=document.createElement("div");a.className="listing crateBox",a.innerHTML=CM.Cache.MissingUpgrades,e.insertBefore(a,document.getElementById("CMMissingUpgradesTitle").nextSibling)}if(CM.Cache.MissingUpgradesCookies){const t=CM.Cache.MissingUpgradesCookies.match(new RegExp("div","g")||0).length/2,i=document.createElement("div");i.id="CMMissingUpgradesCookiesTitle",i.className="listing";const o=document.createElement("div");o.innerHTML=`Missing Cookie upgrades: ${t}/${Game.UpgradesByPool.cookie.length} (${Math.floor(t/Game.UpgradesByPool.cookie.length*100)}%)`,i.appendChild(o),e.appendChild(i);const a=document.createElement("div");a.className="listing crateBox",a.innerHTML=CM.Cache.MissingUpgradesCookies,e.appendChild(a)}}},CM.Disp.crateMissing=function(e){let t="crate upgrade missing";"prestige"===e.pool&&(t+=" heavenly");let i=0;Game.prefs.crates||(i=1),i&&(t+=" noFrame");let o=e.icon;e.iconFunction&&(o=e.iconFunction());const a=`function() {return Game.crateTooltip(Game.UpgradesById[${e.id}], 'stats');}`;return`
\n\t
`},CM.Disp.AddMenuInfo=function(e){const t=document.createElement("div");t.className="subsection";const i=document.createElement("span");if(i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=CM.Options.Header.InfoTab?"-":"+",i.onclick=function(){CM.Config.ToggleHeader("InfoTab"),Game.UpdateMenu()},e.appendChild(i),t.appendChild(e),CM.Options.Header.InfoTab){const e=document.createElement("div");e.innerHTML=CM.Data.ModDescription,t.appendChild(e);const i=document.createElement("div");i.innerHTML=CM.Data.LatestReleaseNotes,t.appendChild(i)}const o=l("menu").children[1];o.insertBefore(t,o.children[1])},CM.Disp.CreateWrinklerButtons=function(){const e=document.createElement("a");e.id="PopAllNormalWrinklerButton",e.textContent="Pop All Normal",e.className="option",e.onclick=function(){CM.Disp.PopAllNormalWrinklers()},l("sectionLeftExtra").children[0].append(e);const t=document.createElement("a");t.id="PopFattestWrinklerButton",t.textContent="Pop Single Fattest",t.className="option",t.onclick=function(){null!==CM.Cache.WrinklersFattest[1]&&(Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp=0)},l("sectionLeftExtra").children[0].append(t)},CM.Disp.UpdateWrinklerButtons=function(){CM.Options.WrinklerButtons?(l("PopAllNormalWrinklerButton").style.display="",l("PopFattestWrinklerButton").style.display=""):(l("PopAllNormalWrinklerButton").style.display="none",l("PopFattestWrinklerButton").style.display="none")},CM.Disp.TooltipText=[["GoldCookTooltipPlaceholder","Calculated with Golden Switch off","200px"],["GoldCookDragonsFortuneTooltipPlaceholder","Calculated with Golden Switch off and at least one golden cookie on-screen","240px"],["PrestMaxTooltipPlaceholder","The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","320px"],["NextPrestTooltipPlaceholder","Calculated with cookies gained from wrinklers and Chocolate egg","200px"],["HeavenChipMaxTooltipPlaceholder","The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","330px"],["ResetTooltipPlaceholder","The bonus income you would get from new prestige levels unlocked at 100% of its potential and from ascension achievements if you have the same buildings/upgrades after reset","370px"],["ChoEggTooltipPlaceholder","The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg","300px"],["ChainNextLevelPlaceholder","Cheated cookies might break this formula","250px"]],CM.Disp.colorTextPre="CMText",CM.Disp.colorBackPre="CMBack",CM.Disp.colorBorderPre="CMBorder",CM.Disp.colorBlue="Blue",CM.Disp.colorGreen="Green",CM.Disp.colorYellow="Yellow",CM.Disp.colorOrange="Orange",CM.Disp.colorRed="Red",CM.Disp.colorPurple="Purple",CM.Disp.colorGray="Gray",CM.Disp.colorPink="Pink",CM.Disp.colorBrown="Brown",CM.Disp.colors=[CM.Disp.colorGray,CM.Disp.colorBlue,CM.Disp.colorGreen,CM.Disp.colorYellow,CM.Disp.colorOrange,CM.Disp.colorRed,CM.Disp.colorPurple,CM.Disp.colorPink,CM.Disp.colorBrown],CM.Disp.buffColors={Frenzy:CM.Disp.colorYellow,"Dragon Harvest":CM.Disp.colorBrown,"Elder frenzy":CM.Disp.colorGreen,Clot:CM.Disp.colorRed,"Click frenzy":CM.Disp.colorBlue,Dragonflight:CM.Disp.colorPink},CM.Disp.GCTimers={},CM.Disp.cookieTimes=[10,15,30,60,300,600,900,1800],CM.Disp.clickTimes=[1,5,10,15,30],CM.Disp.TooltipWrinklerBeingShown=[],CM.Disp.TooltipWrinklerArea=0,CM.Disp.TooltipWrinkler=-1,CM.Disp.Title="",CM.Disp.LastTargetBotBar=1,CM.Disp.LastTargetBuildings=1,CM.Disp.LastTargetTooltipBuilding=1})();(()=>{var __webpack_exports__={};CM.Main.Loop=function(){if(CM.Disp.lastAscendState!==Game.OnAscend&&(CM.Disp.lastAscendState=Game.OnAscend,CM.Disp.UpdateAscendState()),!Game.OnAscend&&0===Game.AscendTimer){CM.Main.LastModCount!==Object.keys(Game.mods).length&&(CM.Sim.CreateSimFunctions(),CM.Sim.InitData(),CM.Cache.InitCache(),CM.Main.LastModCount=Object.keys(Game.mods).length),CM.Sim.DoSims&&(CM.Cache.CacheIncome(),CM.Cache.NoGoldSwitchCPS(),CM.Cache.CacheGoldenAndWrathCookiesMults(),CM.Cache.CacheStats(),CM.Cache.CacheMissingUpgrades(),CM.Cache.CacheChain(),CM.Cache.CacheDragonCost(),CM.Cache.CacheSeaSpec(),CM.Cache.CacheSellForChoEgg(),CM.Sim.DoSims=0);const e=Game.auraMult("Fierce Hoarder")>0;!CM.Cache.HadBuildAura&&e?(CM.Cache.HadBuildAura=!0,CM.Cache.DoRemakeBuildPrices=1):CM.Cache.HadBuildAura&&!e&&(CM.Cache.HadBuildAura=!1,CM.Cache.DoRemakeBuildPrices=1),CM.Cache.DoRemakeBuildPrices&&(CM.Cache.CacheBuildingsPrices(),CM.Cache.DoRemakeBuildPrices=0),CM.Cache.LoopCache(),CM.Main.CheckGoldenCookie(),CM.Main.CheckTickerFortune(),CM.Main.CheckSeasonPopup(),CM.Main.CheckGardenTick(),CM.Main.CheckMagicMeter(),CM.Main.CheckWrinklerCount()}},CM.Main.DelayInit=function(){CM.Sim.CreateSimFunctions(),CM.Sim.InitData(),CM.Cache.InitCache(),CM.Main.LastModCount=Object.keys(Game.mods).length,CM.Disp.CreateCssArea(),CM.Disp.CreateBotBar(),CM.Disp.CreateTimerBar(),CM.Disp.CreateUpgradeBar(),CM.Disp.CreateWhiteScreen(),CM.Disp.CreateFavicon();for(const e of Object.keys(CM.Disp.TooltipText))CM.Disp.CreateSimpleTooltip(CM.Disp.TooltipText[e][0],CM.Disp.TooltipText[e][1],CM.Disp.TooltipText[e][2]);CM.Disp.CreateWrinklerButtons(),CM.Disp.UpdateBuildingUpgradeStyle(),CM.Main.ReplaceTooltips(),CM.Main.AddWrinklerAreaDetect(),CM.Main.ReplaceNative(),CM.Main.ReplaceNativeGrimoire(),Game.CalculateGains(),CM.Config.LoadConfig(),CM.Disp.lastAscendState=Game.OnAscend,Game.prefs.popups?Game.Popup(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} loaded!`):Game.Notify(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} loaded!`,"","",1,1),Game.Win("Third-party")},CM.Main.ReplaceNative=function(){CM.Backup.Beautify=Beautify,Beautify=CM.Disp.Beautify,CM.Backup.CalculateGains=Game.CalculateGains,eval(`CM.Backup.CalculateGainsMod = ${Game.CalculateGains.toString().split("ages');").join("ages');CM.Sim.DateAges = Date.now();").split("if (Game.Has('Century").join("CM.Sim.DateCentury = Date.now();if (Game.Has('Century")}`),Game.CalculateGains=function(){CM.Backup.CalculateGainsMod(),CM.Sim.DoSims=1},CM.Backup.tooltip={},CM.Backup.tooltip.draw=Game.tooltip.draw,eval(`CM.Backup.tooltip.drawMod = ${Game.tooltip.draw.toString().split("this").join("Game.tooltip")}`),Game.tooltip.draw=function(e,i,a){CM.Backup.tooltip.drawMod(e,i,a)},CM.Backup.tooltip.update=Game.tooltip.update,eval(`CM.Backup.tooltip.updateMod = ${Game.tooltip.update.toString().split("this.").join("Game.tooltip.")}`),Game.tooltip.update=function(){CM.Backup.tooltip.updateMod(),CM.Disp.UpdateTooltipLocation()},CM.Backup.UpdateWrinklers=Game.UpdateWrinklers,Game.UpdateWrinklers=function(){CM.Main.FixMouseY(CM.Backup.UpdateWrinklers)},CM.Backup.UpdateSpecial=Game.UpdateSpecial,Game.UpdateSpecial=function(){CM.Main.FixMouseY(CM.Backup.UpdateSpecial)},l("bigCookie").removeEventListener("click",Game.ClickCookie,!1),l("bigCookie").addEventListener("click",(function(){CM.Main.FixMouseY(Game.ClickCookie)}),!1),CM.Backup.RebuildUpgrades=Game.RebuildUpgrades,Game.RebuildUpgrades=function(){CM.Backup.RebuildUpgrades(),CM.Disp.ReplaceTooltipUpgrade(),Game.CalculateGains()},CM.Backup.ClickProduct=Game.ClickProduct,Game.ClickProduct=function(e){(!CM.Options.BulkBuyBlock||Game.ObjectsById[e].bulkPrice for the next level.
';").join("` more cookies for the next level.
${CM.Options.TooltipAscendButton ? `
It takes ${CM.Cache.TimeTillNextPrestige} to reach the next level and you are making ${Beautify(CM.Cache.HCPerSecond, 2)} chips on average in the last 5 seconds.
` : ``}`;")}`)(),Game.Logic=function(){CM.Backup.LogicMod(),CM.Disp.UpdateTitle()}},CM.Main.ReplaceNativeGrimoire=function(){CM.Main.ReplaceNativeGrimoireLaunch(),CM.Main.ReplaceNativeGrimoireDraw()},CM.Main.ReplaceNativeGrimoireLaunch=function(){if(!CM.Main.HasReplaceNativeGrimoireLaunch&&Game.Objects["Wizard tower"].minigameLoaded){const minigame=Game.Objects["Wizard tower"].minigame;CM.Backup.GrimoireLaunch=minigame.launch,eval(`CM.Backup.GrimoireLaunchMod = ${minigame.launch.toString().split("=this").join("= Game.Objects['Wizard tower'].minigame")}`),Game.Objects["Wizard tower"].minigame.launch=function(){CM.Backup.GrimoireLaunchMod(),CM.Main.ReplaceTooltipGrimoire(),CM.HasReplaceNativeGrimoireDraw=!1,CM.Main.ReplaceNativeGrimoireDraw()},CM.Main.HasReplaceNativeGrimoireLaunch=!0}},CM.Main.ReplaceNativeGrimoireDraw=function(){if(!CM.Main.HasReplaceNativeGrimoireDraw&&Game.Objects["Wizard tower"].minigameLoaded){const e=Game.Objects["Wizard tower"].minigame;CM.Backup.GrimoireDraw=e.draw,Game.Objects["Wizard tower"].minigame.draw=function(){CM.Backup.GrimoireDraw(),1===CM.Options.GrimoireBar&&e.magic{const i=e.id.slice(-3);e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return CM.Disp.Tooltip("p",[`${i[0]}`,`${i[2]}`])}),"this"),Game.tooltip.wobble()}})))},CM.Main.FindShimmer=function(){CM.Main.currSpawnedGoldenCookieState=0,CM.Cache.goldenShimmersByID={};for(const e of Object.keys(Game.shimmers))CM.Cache.goldenShimmersByID[Game.shimmers[e].id]=Game.shimmers[e],Game.shimmers[e].spawnLead&&"golden"===Game.shimmers[e].type&&(CM.Cache.spawnedGoldenShimmer=Game.shimmers[e],CM.Main.currSpawnedGoldenCookieState+=1)},CM.Main.CheckGoldenCookie=function(){CM.Main.FindShimmer();for(const e of Object.keys(CM.Disp.GCTimers))void 0===CM.Cache.goldenShimmersByID[e]&&(CM.Disp.GCTimers[e].parentNode.removeChild(CM.Disp.GCTimers[e]),delete CM.Disp.GCTimers[e]);if(CM.Main.lastGoldenCookieState!==Game.shimmerTypes.golden.n){if(CM.Main.lastGoldenCookieState=Game.shimmerTypes.golden.n,CM.Main.lastGoldenCookieState){CM.Main.lastSpawnedGoldenCookieState0){let e=0;for(const i in Game.wrinklers)2===Game.wrinklers[i].phase&&e++;e>CM.Main.lastWrinklerCount?(CM.Main.lastWrinklerCount=e,e===Game.getWrinklersMax()&&CM.Options.WrinklerMaxFlash?CM.Disp.Flash(3,"WrinklerMaxFlash"):CM.Disp.Flash(3,"WrinklerFlash"),e===Game.getWrinklersMax()&&CM.Options.WrinklerMaxSound?CM.Disp.PlaySound(CM.Options.WrinklerMaxSoundURL,"WrinklerMaxSound","WrinklerMaxVolume"):CM.Disp.PlaySound(CM.Options.WrinklerSoundURL,"WrinklerSound","WrinklerVolume"),e===Game.getWrinklersMax()&&CM.Options.WrinklerMaxNotification?CM.Disp.Notification("WrinklerMaxNotification","Maximum Wrinklers Reached","You have reached your maximum ammount of wrinklers"):CM.Disp.Notification("WrinklerNotification","A Wrinkler appeared","A new wrinkler has appeared")):CM.Main.lastWrinklerCount=e}},CM.Main.AddWrinklerAreaDetect=function(){l("backgroundLeftCanvas").onmouseover=function(){CM.Disp.TooltipWrinklerArea=1},l("backgroundLeftCanvas").onmouseout=function(){CM.Disp.TooltipWrinklerArea=0,Game.tooltip.hide();for(const e of Object.keys(Game.wrinklers))CM.Disp.TooltipWrinklerBeingShown[e]=0}},CM.Main.FixMouseY=function(e){if(1===CM.Options.TimerBar&&0===CM.Options.TimerBarPos){const i=parseInt(CM.Disp.TimerBar.style.height);Game.mouseY-=i,e(),Game.mouseY+=i}else e()}})();CM.Sim.BuildingGetPrice=function(e,i,a,n,m){let s=0;for(let t=0;t0&&(t+=m,a--)}return t},CM.Sim.ReplaceFunction=function(e){return e.toString().split("Game.Upgrades[").join("CM.Sim.Upgrades[").split("Game.Achievements").join("CM.Sim.Achievements").split("Game.Has").join("CM.Sim.Has").split("Game.dragonAura]").join("CM.Sim.dragonAura]").split("Game.dragonAura2]").join("CM.Sim.dragonAura2]").split("Game.auraMult").join("CM.Sim.auraMult").split("Game.hasGod").join("CM.Sim.hasGod").split("Game.effs").join("CM.Sim.effs").split("Game.Objects").join("CM.Sim.Objects").split("Game.GetTieredCpsMult").join("CM.Sim.GetTieredCpsMult").split("Game.eff").join("CM.Sim.eff")},CM.Sim.CreateSimFunctions=function(){CM.Sim.Has=new Function(`return ${CM.Sim.ReplaceFunction(Game.Has)}`)(),CM.Sim.HasAchiev=new Function(`return ${CM.Sim.ReplaceFunction(Game.HasAchiev)}`)(),CM.Sim.hasAura=new Function(`return ${CM.Sim.ReplaceFunction(Game.hasAura)}`)(),CM.Sim.GetHeavenlyMultiplier=new Function(`return ${CM.Sim.ReplaceFunction(Game.GetHeavenlyMultiplier)}`)(),CM.Sim.auraMult=new Function(`return ${CM.Sim.ReplaceFunction(Game.auraMult)}`)(),CM.Sim.eff=new Function(`return ${CM.Sim.ReplaceFunction(Game.eff)}`)(),CM.Sim.GetTieredCpsMult=new Function(`return ${CM.Sim.ReplaceFunction(Game.GetTieredCpsMult)}`)()},CM.Sim.Win=function(e){CM.Sim.Achievements[e]&&0===CM.Sim.Achievements[e].won&&(CM.Sim.Achievements[e].won=1,"shadow"!==Game.Achievements[e].pool&&CM.Sim.AchievementsOwned++)},CM.Sim.hasGod=function(e){if(Game.hasGod){const i=CM.Sim.Objects.Temple.minigame.gods[e];for(let e=0;e<3;e++)if(CM.Sim.Objects.Temple.minigame.slot[e]===i.id)return e+1}return!1},CM.Sim.InitialBuildingData=function(e){const i=Game.Objects[e],a={};return a.cps=new Function(`return ${CM.Sim.ReplaceFunction(i.cps)}`)(),a.baseCps=i.baseCps,a.name=i.name,a.tieredUpgrades=i.tieredUpgrades,a.synergies=i.synergies,a.fortune=i.fortune,a.grandma=i.grandma,a.baseCPS=i.baseCps,a.id=i.id,a.vanilla=i.vanilla,a},CM.Sim.InitUpgrade=function(e){const i=Game.Upgrades[e],a={};return a.power=i.power,"function"==typeof i.power&&(i.power=new Function(`return ${CM.Sim.ReplaceFunction(i.power)}`)()),a.pool=i.pool,a.name=i.name,a},CM.Sim.InitAchievement=function(e){const i=Game.Achievements[e],a={};return a.name=i.name,a},CM.Sim.InitData=function(){CM.Sim.Objects=[];for(const e of Object.keys(Game.Objects))CM.Sim.Objects[e]=CM.Sim.InitialBuildingData(e);CM.Sim.Upgrades=[];for(const e of Object.keys(Game.Upgrades))CM.Sim.Upgrades[e]=CM.Sim.InitUpgrade(e);CM.Sim.Achievements=[];for(const e of Object.keys(Game.Achievements))CM.Sim.Achievements[e]=CM.Sim.InitAchievement(e);CM.Sim.CopyData()},CM.Sim.CopyData=function(){CM.Sim.UpgradesOwned=Game.UpgradesOwned,CM.Sim.pledges=Game.pledges,CM.Sim.AchievementsOwned=Game.AchievementsOwned,CM.Sim.heavenlyPower=Game.heavenlyPower,CM.Sim.prestige=Game.prestige;for(const e of Object.keys(Game.Objects)){const i=Game.Objects[e];let a=CM.Sim.Objects[e];void 0===a&&(CM.Sim.Objects[e]=CM.Sim.InitialBuildingData(e),a=CM.Sim.Objects[e],CM.Disp.CreateBotBarBuildingColumn(e)),a.amount=i.amount,a.level=i.level,a.totalCookies=i.totalCookies,a.basePrice=i.basePrice,a.free=i.free,i.minigameLoaded&&(a.minigameLoaded=i.minigameLoaded,a.minigame=i.minigame)}for(const e of Object.keys(Game.Upgrades)){const i=Game.Upgrades[e];let a=CM.Sim.Upgrades[e];void 0===a&&(CM.Sim.Upgrades[e]=CM.Sim.InitUpgrade(e),a=CM.Sim.Upgrades[e]),a.bought=i.bought}for(const e of Object.keys(Game.Achievements)){const i=Game.Achievements[e];let a=CM.Sim.Achievements[e];void 0===a&&(CM.Sim.Achievements[e]=CM.Sim.InitAchievement(e),a=CM.Sim.Achievements[e]),a.won=i.won}CM.Cache.CacheDragonAuras(),CM.Sim.dragonAura=CM.Cache.dragonAura,CM.Sim.dragonAura2=CM.Cache.dragonAura2},CM.Sim.CalculateGains=function(){CM.Sim.cookiesPs=0;let e=1;const i={};for(const e of Object.keys(Game.Objects))if(Game.Objects[e].minigameLoaded&&Game.Objects[e].minigame.effs){const a=Game.Objects[e].minigame.effs;for(const e in a)i[e]?i[e]*=a[e]:i[e]=a[e]}CM.Sim.effs=i,1!==Game.ascensionMode&&(e+=.01*parseFloat(CM.Sim.prestige)*CM.Sim.heavenlyPower*CM.Sim.GetHeavenlyMultiplier()),e*=CM.Sim.eff("cps"),CM.Sim.Has("Heralds")&&1!==Game.ascensionMode&&(e*=1+.01*Game.heralds);for(const i of Object.keys(Game.cookieUpgrades)){const a=Game.cookieUpgrades[i];CM.Sim.Has(a.name)&&("function"==typeof a.power?e*=1+.01*CM.Sim.Upgrades[a.name].power(CM.Sim.Upgrades[a.name]):e*=1+.01*a.power)}CM.Sim.Has("Specialized chocolate chips")&&(e*=1.01),CM.Sim.Has("Designer cocoa beans")&&(e*=1.02),CM.Sim.Has("Underworld ovens")&&(e*=1.03),CM.Sim.Has("Exotic nuts")&&(e*=1.04),CM.Sim.Has("Arcane sugar")&&(e*=1.05),CM.Sim.Has("Increased merriness")&&(e*=1.15),CM.Sim.Has("Improved jolliness")&&(e*=1.15),CM.Sim.Has("A lump of coal")&&(e*=1.01),CM.Sim.Has("An itchy sweater")&&(e*=1.01),CM.Sim.Has("Santa's dominion")&&(e*=1.2),CM.Sim.Has("Fortune #100")&&(e*=1.01),CM.Sim.Has("Fortune #101")&&(e*=1.07),CM.Sim.Has("Dragon scale")&&(e*=1.03);let a=1;if(CM.Sim.hasGod){let i=CM.Sim.hasGod("asceticism");1===i?e*=1.15:2===i?e*=1.1:3===i&&(e*=1.05),i=CM.Sim.hasGod("ages"),1===i?e*=1+.15*Math.sin(CM.Sim.DateAges/1e3/10800*Math.PI*2):2===i?e*=1+.15*Math.sin(CM.Sim.DateAges/1e3/43200*Math.PI*2):3===i&&(e*=1+.15*Math.sin(CM.Sim.DateAges/1e3/86400*Math.PI*2)),i=CM.Sim.hasGod("decadence"),1===i?a*=.93:2===i?a*=.95:3===i&&(a*=.98),i=CM.Sim.hasGod("industry"),1===i?a*=1.1:2===i?a*=1.06:3===i&&(a*=1.03),i=CM.Sim.hasGod("labor"),1===i?a*=.97:2===i?a*=.98:3===i&&(a*=.99)}CM.Sim.Has("Santa's legacy")&&(e*=1+.03*(Game.santaLevel+1));const n=CM.Sim.AchievementsOwned/25;let m=1;if(CM.Sim.Has("Santa's milk and cookies")&&(m*=1.05),m*=1+.05*CM.Sim.auraMult("Breath of Milk"),CM.Sim.hasGod){const e=CM.Sim.hasGod("mother");1===e?m*=1.1:2===e?m*=1.05:3===e&&(m*=1.03)}m*=CM.Sim.eff("milk");let s=1;CM.Sim.Has("Kitten helpers")&&(s*=1+.1*n*m),CM.Sim.Has("Kitten workers")&&(s*=1+.125*n*m),CM.Sim.Has("Kitten engineers")&&(s*=1+.15*n*m),CM.Sim.Has("Kitten overseers")&&(s*=1+.175*n*m),CM.Sim.Has("Kitten managers")&&(s*=1+.2*n*m),CM.Sim.Has("Kitten accountants")&&(s*=1+.2*n*m),CM.Sim.Has("Kitten specialists")&&(s*=1+.2*n*m),CM.Sim.Has("Kitten experts")&&(s*=1+.2*n*m),CM.Sim.Has("Kitten consultants")&&(s*=1+.2*n*m),CM.Sim.Has("Kitten assistants to the regional manager")&&(s*=1+.175*n*m),CM.Sim.Has("Kitten marketeers")&&(s*=1+.15*n*m),CM.Sim.Has("Kitten analysts")&&(s*=1+.125*n*m),CM.Sim.Has("Kitten executives")&&(s*=1+.115*n*m),CM.Sim.Has("Kitten angels")&&(s*=1+.1*n*m),CM.Sim.Has("Fortune #103")&&(s*=1+.05*n*m);for(const e of Object.keys(CM.Sim.Objects)){const i=CM.Sim.Objects[e];let s=i.cps(i);1!==Game.ascensionMode&&(s*=(1+.01*i.level)*a),"Grandma"===i.name&&CM.Sim.Has("Milkhelp® lactose intolerance relief tablets")&&(s*=1+.05*n*m),CM.Sim.cookiesPs+=i.amount*s}CM.Sim.Has('"egg"')&&(CM.Sim.cookiesPs+=9),e*=s;let t=1;if(CM.Sim.Has("Chicken egg")&&(t*=1.01),CM.Sim.Has("Duck egg")&&(t*=1.01),CM.Sim.Has("Turkey egg")&&(t*=1.01),CM.Sim.Has("Quail egg")&&(t*=1.01),CM.Sim.Has("Robin egg")&&(t*=1.01),CM.Sim.Has("Ostrich egg")&&(t*=1.01),CM.Sim.Has("Cassowary egg")&&(t*=1.01),CM.Sim.Has("Salmon roe")&&(t*=1.01),CM.Sim.Has("Frogspawn")&&(t*=1.01),CM.Sim.Has("Shark egg")&&(t*=1.01),CM.Sim.Has("Turtle egg")&&(t*=1.01),CM.Sim.Has("Ant larva")&&(t*=1.01),CM.Sim.Has("Century egg")){let e=10*Math.floor((CM.Sim.DateCentury-Game.startDate)/1e3/10)/60/60/24;e=Math.min(e,100),CM.Cache.CentEgg=1+.1*(1-(1-e/100)**3),t*=CM.Cache.CentEgg}e*=t,CM.Sim.Has("Sugar baking")&&(e*=1+.01*Math.min(100,Game.lumps)),e*=1+CM.Sim.auraMult("Radiant Appetite");const o=CM.Sim.cookiesPs*e;for(const e of Object.keys(Game.CpsAchievements))o>=Game.CpsAchievements[e].threshold&&CM.Sim.Win(Game.CpsAchievements[e].name);CM.Sim.cookiesPsRaw=o;const C=Game.shimmerTypes.golden.n,M=CM.Sim.auraMult("Dragon's Fortune");for(let i=0;i=7&&CM.Sim.Win("Elder"),!CM.Sim.HasAchiev("Veteran")&&e>=14&&CM.Sim.Win("Veteran");let i=0,a=1,n=1,m=1e5;for(const e of Object.keys(CM.Sim.Objects))i+=CM.Sim.Objects[e].amount,m=Math.min(CM.Sim.Objects[e].amount,m),CM.Sim.HasAchiev("Mathematician")||CM.Sim.Objects[e].amount=1&&CM.Sim.Win("One with everything"),1===a&&CM.Sim.Win("Mathematician"),1===n&&CM.Sim.Win("Base 10"),m>=100&&CM.Sim.Win("Centennial"),m>=150&&CM.Sim.Win("Centennial and a half"),m>=200&&CM.Sim.Win("Bicentennial"),m>=250&&CM.Sim.Win("Bicentennial and a half"),m>=300&&CM.Sim.Win("Tricentennial"),m>=350&&CM.Sim.Win("Tricentennial and a half"),m>=400&&CM.Sim.Win("Quadricentennial"),m>=450&&CM.Sim.Win("Quadricentennial and a half"),m>=500&&CM.Sim.Win("Quincentennial"),m>=550&&CM.Sim.Win("Quincentennial and a half"),m>=600&&CM.Sim.Win("Sexcentennial"),i>=100&&CM.Sim.Win("Builder"),i>=500&&CM.Sim.Win("Architect"),i>=1e3&&CM.Sim.Win("Engineer"),i>=2e3&&CM.Sim.Win("Lord of Constructs"),i>=4e3&&CM.Sim.Win("Grand design"),i>=8e3&&CM.Sim.Win("Ecumenopolis"),CM.Sim.UpgradesOwned>=20&&CM.Sim.Win("Enhancer"),CM.Sim.UpgradesOwned>=50&&CM.Sim.Win("Augmenter"),CM.Sim.UpgradesOwned>=100&&CM.Sim.Win("Upgrader"),CM.Sim.UpgradesOwned>=200&&CM.Sim.Win("Lord of Progress"),CM.Sim.UpgradesOwned>=300&&CM.Sim.Win("The full picture"),CM.Sim.UpgradesOwned>=400&&CM.Sim.Win("When there's nothing left to add"),i>=4e3&&CM.Sim.UpgradesOwned>=300&&CM.Sim.Win("Polymath"),i>=8e3&&CM.Sim.UpgradesOwned>=400&&CM.Sim.Win("Renaissance baker"),CM.Sim.Objects.Cursor.amount+CM.Sim.Objects.Grandma.amount>=777&&CM.Sim.Win("The elder scrolls");let s=!0;for(const e of Object.keys(CM.Data.HalloCookies))CM.Sim.Has(CM.Data.HalloCookies[e])||(s=!1);s&&CM.Sim.Win("Spooky cookies");let t=!0;for(const e of Object.keys(CM.Data.ChristCookies))CM.Sim.Has(CM.Data.ChristCookies[e])||(t=!1);if(t&&CM.Sim.Win("Let it snow"),CM.Sim.Has("Fortune cookies")){const e=Game.Tiers.fortune.upgrades;let i=0;for(const a of Object.keys(e))CM.Sim.Has(e[a].name)&&i++;i>=e.length&&CM.Sim.Win("O Fortuna")}},CM.Sim.NoGoldSwitchCPS=function(){return CM.Sim.CopyData(),CM.Sim.Upgrades["Golden switch [off]"].bought=0,CM.Sim.CalculateGains(),CM.Sim.cookiesPs},CM.Sim.BuyBuildingsBonusIncome=function(e,i){CM.Sim.CopyData();const a=CM.Sim.Objects[e];if(a.amount+=i,"Cursor"===e)a.amount>=1&&CM.Sim.Win("Click"),a.amount>=2&&CM.Sim.Win("Double-click"),a.amount>=50&&CM.Sim.Win("Mouse wheel"),a.amount>=100&&CM.Sim.Win("Of Mice and Men"),a.amount>=200&&CM.Sim.Win("The Digital"),a.amount>=300&&CM.Sim.Win("Extreme polydactyly"),a.amount>=400&&CM.Sim.Win("Dr. T"),a.amount>=500&&CM.Sim.Win("Thumbs, phalanges, metacarpals"),a.amount>=600&&CM.Sim.Win("With her finger and her thumb"),a.amount>=700&&CM.Sim.Win("Gotta hand it to you"),a.amount>=800&&CM.Sim.Win("The devil's workshop");else for(const e in Game.Objects[a.name].tieredAchievs)a.amount>=Game.Tiers[Game.Objects[a.name].tieredAchievs[e].tier].achievUnlock&&CM.Sim.Win(Game.Objects[a.name].tieredAchievs[e].name);const n=CM.Sim.AchievementsOwned;return CM.Sim.CalculateGains(),CM.Sim.CheckOtherAchiev(),n!==CM.Sim.AchievementsOwned&&CM.Sim.CalculateGains(),CM.Sim.cookiesPs-Game.cookiesPs},CM.Sim.BuyUpgradesBonusIncome=function(e){if("toggle"===Game.Upgrades[e].pool||0===Game.Upgrades[e].bought&&Game.Upgrades[e].unlocked&&"prestige"!==Game.Upgrades[e].pool){CM.Sim.CopyData();const i=CM.Sim.Upgrades[e];"Shimmering veil [on]"===i.name?CM.Sim.Upgrades["Shimmering veil [off]"].bought=0:"Golden switch [on]"===i.name?CM.Sim.Upgrades["Golden switch [off]"].bought=0:i.bought=(i.bought+1)%2,Game.CountsAsUpgradeOwned(Game.Upgrades[e].pool)&&CM.Sim.UpgradesOwned++,"Elder Pledge"===e?(CM.Sim.pledges++,CM.Sim.pledges>0&&CM.Sim.Win("Elder nap"),CM.Sim.pledges>=5&&CM.Sim.Win("Elder slumber")):"Elder Covenant"===e?CM.Sim.Win("Elder calm"):"Prism heart biscuits"===e?CM.Sim.Win("Lovely cookies"):"Heavenly key"===e&&CM.Sim.Win("Wholesome");const a=CM.Sim.AchievementsOwned;CM.Sim.CalculateGains(),CM.Sim.CheckOtherAchiev(),a!==CM.Sim.AchievementsOwned&&CM.Sim.CalculateGains();const n=CM.Sim.mouseCps()-Game.computedMouseCps;return n?[CM.Sim.cookiesPs-Game.cookiesPs,n]:[CM.Sim.cookiesPs-Game.cookiesPs]}return[]},CM.Sim.mouseCps=function(){let e=0;CM.Sim.Has("Thousand fingers")&&(e+=.1),CM.Sim.Has("Million fingers")&&(e*=5),CM.Sim.Has("Billion fingers")&&(e*=10),CM.Sim.Has("Trillion fingers")&&(e*=20),CM.Sim.Has("Quadrillion fingers")&&(e*=20),CM.Sim.Has("Quintillion fingers")&&(e*=20),CM.Sim.Has("Sextillion fingers")&&(e*=20),CM.Sim.Has("Septillion fingers")&&(e*=20),CM.Sim.Has("Octillion fingers")&&(e*=20),CM.Sim.Has("Nonillion fingers")&&(e*=20);let i=0;for(const e of Object.keys(CM.Sim.Objects))i+=CM.Sim.Objects[e].amount;i-=CM.Sim.Objects.Cursor.amount,e*=i,CM.Sim.Has("Plastic mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Iron mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Titanium mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Adamantium mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Unobtainium mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Eludium mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Wishalloy mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Fantasteel mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Nevercrack mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Armythril mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Technobsidian mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Plasmarble mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Miraculite mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Fortune #104")&&(e+=.01*CM.Sim.cookiesPs);let a=1;if(CM.Sim.Has("Santa's helpers")&&(a*=1.1),CM.Sim.Has("Cookie egg")&&(a*=1.1),CM.Sim.Has("Halo gloves")&&(a*=1.1),CM.Sim.Has("Dragon claw")&&(a*=1.03),CM.Sim.Has("Aura gloves")&&(a*=1+.05*Math.min(Game.Objects.Cursor.level,CM.Sim.Has("Luminous gloves")?20:10)),a*=CM.Sim.eff("click"),CM.Sim.Objects.Temple.minigameLoaded&&CM.Sim.hasGod){const e=CM.Sim.hasGod("labor");1===e?a*=1.15:2===e?a*=1.1:3===e&&(a*=1.05)}for(const e of Object.keys(Game.buffs))void 0!==Game.buffs[e].multClick&&(a*=Game.buffs[e].multClick);a*=1+.05*CM.Sim.auraMult("Dragon Cursor");let n=a*Game.ComputeCps(1,CM.Sim.Has("Reinforced index finger")+CM.Sim.Has("Carpal tunnel prevention cream")+CM.Sim.Has("Ambidextrous"),e);return n=Game.runModHookOnValue("cookiesPerClick",n),Game.hasBuff("Cursed finger")&&(n=Game.buffs["Cursed finger"].power),n},CM.Sim.CalculateChangeAura=function(e){CM.Sim.CopyData(),l("promptContent").children[0].innerHTML.includes("secondary")?CM.Sim.dragonAura2=e:CM.Sim.dragonAura=e;let i=0;if(CM.Sim.dragonAura!==CM.Cache.dragonAura||CM.Sim.dragonAura2!==CM.Cache.dragonAura2)for(let e=Game.ObjectsById.length-1;e>-1;--e)if(Game.ObjectsById[e-1].amount>0){const a=CM.Sim.Objects[Game.ObjectsById[e].name].name;CM.Sim.Objects[a].amount-=1,CM.Sim.buildingsOwned-=1,i=CM.Sim.Objects[a].basePrice*Game.priceIncrease**Math.max(0,CM.Sim.Objects[a].amount-1-CM.Sim.Objects[a].free),i=Game.modifyBuildingPrice(CM.Sim.Objects[a],i),i=Math.ceil(i);break}const a=CM.Sim.AchievementsOwned;return CM.Sim.CalculateGains(),CM.Sim.CheckOtherAchiev(),a!==CM.Sim.AchievementsOwned&&CM.Sim.CalculateGains(),[CM.Sim.cookiesPs-Game.cookiesPs,i]},CM.Sim.ResetBonus=function(e){let i=Game.cookiesPs;CM.Sim.CopyData(),0===CM.Sim.Upgrades["Heavenly key"].bought&&(CM.Sim.Upgrades["Heavenly chip secret"].bought=1,CM.Sim.Upgrades["Heavenly cookie stand"].bought=1,CM.Sim.Upgrades["Heavenly bakery"].bought=1,CM.Sim.Upgrades["Heavenly confectionery"].bought=1,CM.Sim.Upgrades["Heavenly key"].bought=1,CM.Sim.CalculateGains(),i=CM.Sim.cookiesPs,CM.Sim.CopyData()),CM.Cache.RealCookiesEarned>=1e6&&CM.Sim.Win("Sacrifice"),CM.Cache.RealCookiesEarned>=1e9&&CM.Sim.Win("Oblivion"),CM.Cache.RealCookiesEarned>=1e12&&CM.Sim.Win("From scratch"),CM.Cache.RealCookiesEarned>=1e15&&CM.Sim.Win("Nihilism"),CM.Cache.RealCookiesEarned>=1e18&&CM.Sim.Win("Dematerialize"),CM.Cache.RealCookiesEarned>=1e21&&CM.Sim.Win("Nil zero zilch"),CM.Cache.RealCookiesEarned>=1e24&&CM.Sim.Win("Transcendence"),CM.Cache.RealCookiesEarned>=1e27&&CM.Sim.Win("Obliterate"),CM.Cache.RealCookiesEarned>=1e30&&CM.Sim.Win("Negative void"),CM.Cache.RealCookiesEarned>=1e33&&CM.Sim.Win("To crumbs, you say?"),CM.Cache.RealCookiesEarned>=1e36&&CM.Sim.Win("You get nothing"),CM.Cache.RealCookiesEarned>=1e39&&CM.Sim.Win("Humble rebeginnings"),CM.Cache.RealCookiesEarned>=1e42&&CM.Sim.Win("The end of the world"),CM.Cache.RealCookiesEarned>=1e45&&CM.Sim.Win("Oh, you're back"),CM.Cache.RealCookiesEarned>=1e48&&CM.Sim.Win("Lazarus"),CM.Cache.RealCookiesEarned>=1e51&&CM.Sim.Win("Smurf account"),CM.Cache.RealCookiesEarned>=1e54&&CM.Sim.Win("If at first you don't succeed"),CM.Sim.Upgrades["Heavenly chip secret"].bought=1,CM.Sim.Upgrades["Heavenly cookie stand"].bought=1,CM.Sim.Upgrades["Heavenly bakery"].bought=1,CM.Sim.Upgrades["Heavenly confectionery"].bought=1,CM.Sim.Upgrades["Heavenly key"].bought=1,CM.Sim.prestige=e;const a=CM.Sim.AchievementsOwned;CM.Sim.CalculateGains(),CM.Sim.CheckOtherAchiev(),a!==CM.Sim.AchievementsOwned&&CM.Sim.CalculateGains();const n=CM.Sim.cookiesPs-i;return CM.Sim.prestige=Game.prestige,n},CM.Sim.SellBuildingsForChoEgg=function(){let e=0;CM.Sim.CopyData();let i=2;5!==CM.Sim.dragonAura&&18!==CM.Sim.dragonAura||--i,5!==CM.Sim.dragonAura2&&18!==CM.Sim.dragonAura2||--i,CM.Sim.dragonAura=5,CM.Sim.dragonAura2=18;for(let e=0;e0&&(e=CM.Sim.Objects[i]);e.amount--,CM.Sim.buildingsOwned--}for(const i of Object.keys(CM.Sim.Objects)){const a=CM.Sim.Objects[i];e+=CM.Sim.BuildingSell(Game.Objects[a.name],Game.Objects[i].basePrice,a.amount,Game.Objects[i].free,a.amount)}return e};(()=>{if(CM.init=function(){CM.Footer.isInitzializing=!0;let o=!0;Game.version!==Number(CM.VersionMajor)&&(o=confirm(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} is meant for Game version ${CM.VersionMajor}. Loading a different version may cause errors. Do you still want to load Cookie Monster?`)),o&&(CM.Main.DelayInit(),Game.registerHook("draw",CM.Disp.Draw),Game.registerHook("logic",CM.Main.Loop),CM.Footer.isInitzializing=!1)},CM.save=function(){return JSON.stringify({settings:CM.Options,version:`${CM.VersionMajor}.${CM.VersionMinor}`})},CM.load=function(o){const e=JSON.parse(o);CM.Sim.InitData(),CM.Config.LoadConfig(e.settings),e.version!==`${CM.VersionMajor}.${CM.VersionMinor}`&&(Game.prefs.popups?Game.Popup("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!"):Game.Notify("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!","","",0,1))},CM.Footer.AddJscolor=function(){CM.Footer.Jscolor=document.createElement("script"),CM.Footer.Jscolor.type="text/javascript",CM.Footer.Jscolor.setAttribute("src","https://aktanusa.github.io/CookieMonster/jscolor/jscolor.js"),document.head.appendChild(CM.Footer.Jscolor)},void 0===CM.Footer.isInitzializing){CM.Footer.AddJscolor();const o=setInterval((function(){"undefined"!=typeof jscolor&&(jscolor.init(),Game.registerMod("CookieMonster",CM),clearInterval(o))}),500)}})();