Advent-Incremental/assets/index.c24e12fc.js

19 lines
261 KiB
JavaScript

/* empty css */import"./vue.92681fcb.js";import{Z as f,l as ht,aa as Ae,t as V,ay as ua,ar as _l,aE as k,a0 as I,aK as Qt,a1 as g,O as S,aG as Zl,A as Bt,_ as ye,a8 as i,b6 as pe,b8 as da,bs as sn,C as u,aq as Sl,bu as Ll,bb as ca,T as li,a7 as s,u as pa,j as ai,bv as _a,q as jl,b1 as Xt,G as ct,aC as rn,w as $t,b2 as qt,ao as ni,I as yt,aN as nt,$ as G,J as Ne,aH as ol,aF as sl,z as Yt,al as la,aL as gl,H as ii,aJ as un,bn as oi,br as si,be as ri}from"./@vue.4ce677c2.js";import{c as dn}from"./nanoevents.1080beb7.js";import{L as ml}from"./lz-string.731cedc5.js";import{i as ui}from"./is-plain-object.906d88e8.js";import{Y as di}from"./vue-next-select.a2bfab1d.js";import{s as ci,u as cn}from"./vue-toastification.6f567382.js";import{D as pi}from"./vuedraggable.7949458c.js";import{p as mi}from"./vue-textarea-autosize.35804eaf.js";import{v as vi,n as fi}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const gi=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const d of r.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&n(d)}).observe(document,{childList:!0,subtree:!0});function l(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(o){if(o.ep)return;o.ep=!0;const r=l(o);fetch(o.href,r)}};gi();const hi="modulepreload",Ha={},yi="./",aa=function(t,l){return!l||l.length===0?t():Promise.all(l.map(n=>{if(n=`${yi}${n}`,n in Ha)return;Ha[n]=!0;const o=n.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${r}`))return;const d=document.createElement("link");if(d.rel=o?"stylesheet":hi,o||(d.as="script",d.crossOrigin=""),d.href=n,document.head.appendChild(d),o)return new Promise((c,p)=>{d.addEventListener("load",c),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},bi="./projInfo-schema.json",wi="Advent Incremental",Ai="An incremental game you play a day at a time, leading up to Christmas!",Ci="advent-incremental",ki="thepaperpilot and friends",Ei="",_i="",Si="0.5",Bi="Initial Commit",Mi=!0,Ni=!1,xi=2,Ii=!0,Di=null,Pi="",Ti=["main"],Fi=3600,Ui=0,Ri=!0,Oi="base64";var je={$schema:bi,title:wi,description:Ai,id:Ci,author:ki,discordName:Ei,discordLink:_i,versionNumber:Si,versionTitle:Bi,allowGoBack:Mi,defaultShowSmall:Ni,defaultDecimalsShown:xi,useHeader:Ii,banner:Di,logo:Pi,initialTabs:Ti,maxTickLength:Fi,offlineLimit:Ui,enablePausing:Ri,exportEncoding:Oi};const wa=17,qi=9e15,Gi=Math.log10(9e15),Li=1/9e15,Qi=308,$i=-324,ja=5,Vi=function(){const e=[];for(let l=$i+1;l<=Qi;l++)e.push(Number("1e"+l));const t=323;return function(l){return e[l+t]}}(),Cl=[2,Math.E,3,4,5,6,7,8,9,10],Hi=[[1,1.0891168053867777,1.1789745164521264,1.2701428397304229,1.3632066654400328,1.4587804913784246,1.557523817412741,1.660158301473385,1.767487542936873,1.8804205225512542,2],[1,1.1121114330934,1.23103892493161,1.35838369631113,1.49605193039935,1.64635423375119,1.81213853570186,1.99697132461829,2.20538955455724,2.44325744833852,Math.E],[1,1.1187738849693603,1.2464963939368214,1.38527004705667,1.5376664685821402,1.7068895236551784,1.897001227148399,2.1132403089001035,2.362480153784171,2.6539010333870774,3],[1,1.1367350847096405,1.2889510672956703,1.4606478703324786,1.6570295196661111,1.8850062585672889,2.1539465047453485,2.476829779693097,2.872061932789197,3.3664204535587183,4],[1,1.1494592900767588,1.319708228183931,1.5166291280087583,1.748171114438024,2.0253263297298045,2.3636668498288547,2.7858359149579424,3.3257226212448145,4.035730287722532,5],[1,1.159225940787673,1.343712473580932,1.5611293155111927,1.8221199554561318,2.14183924486326,2.542468319282638,3.0574682501653316,3.7390572020926873,4.6719550537360774,6],[1,1.1670905356972596,1.3632807444991446,1.5979222279405536,1.8842640123816674,2.2416069644878687,2.69893426559423,3.3012632110403577,4.121250340630164,5.281493033448316,7],[1,1.1736630594087796,1.379783782386201,1.6292821855668218,1.9378971836180754,2.3289975651071977,2.8384347394720835,3.5232708454565906,4.478242031114584,5.868592169644505,8],[1,1.1793017514670474,1.394054150657457,1.65664127441059,1.985170999970283,2.4069682290577457,2.9647310119960752,3.7278665320924946,4.814462547283592,6.436522247411611,9],[1,1.18422737399915,1.4066113788546144,1.680911177655277,2.027492094355525,2.4775152854601967,3.080455730250329,3.918234505962507,5.1332705696484595,6.9878696918072905,10]],ji=[[-1,-.9194161097107025,-.8335625019330468,-.7425599821143978,-.6466611521029437,-.5462617907227869,-.4419033816638769,-.3342645487554494,-.224140440909962,-.11241087890006762,0],[-1,-.90603157029014,-.80786507256596,-.7064666939634,-.60294836853664,-.49849837513117,-.39430303318768,-.29147201034755,-.19097820800866,-.09361896280296,0],[-1,-.9021579584316141,-.8005762598234203,-.6964780623319391,-.5911906810998454,-.486050182576545,-.3823089430815083,-.28106046722897615,-.1831906535795894,-.08935809204418144,0],[-1,-.8917227442365535,-.781258746326964,-.6705130326902455,-.5612813129406509,-.4551067709033134,-.35319256652135966,-.2563741554088552,-.1651412821106526,-.0796919581982668,0],[-1,-.8843387974366064,-.7678744063886243,-.6529563724510552,-.5415870994657841,-.4352842206588936,-.33504449124791424,-.24138853420685147,-.15445285440944467,-.07409659641336663,0],[-1,-.8786709358426346,-.7577735191184886,-.6399546189952064,-.527284921869926,-.4211627631006314,-.3223479611761232,-.23107655627789858,-.1472057700818259,-.07035171210706326,0],[-1,-.8740862815291583,-.7497032990976209,-.6297119746181752,-.5161838335958787,-.41036238255751956,-.31277212146489963,-.2233976621705518,-.1418697367979619,-.06762117662323441,0],[-1,-.8702632331800649,-.7430366914122081,-.6213373075161548,-.5072025698095242,-.40171437727184167,-.30517930701410456,-.21736343968190863,-.137710238299109,-.06550774483471955,0],[-1,-.8670016295947213,-.7373984232432306,-.6143173985094293,-.49973884395492807,-.394584953527678,-.2989649949848695,-.21245647317021688,-.13434688362382652,-.0638072667348083,0],[-1,-.8641642839543857,-.732534623168535,-.6083127477059322,-.4934049257184696,-.3885773075899922,-.29376029055315767,-.2083678561173622,-.13155653399373268,-.062401588652553186,0]],C=function(t){return a.fromValue_noAlloc(t)},be=function(e,t,l){return a.fromComponents(e,t,l)},De=function(t,l,n){return a.fromComponents_noNormalize(t,l,n)},cl=function(t,l){const n=l+1,o=Math.ceil(Math.log10(Math.abs(t))),r=Math.round(t*Math.pow(10,n-o))*Math.pow(10,o-n);return parseFloat(r.toFixed(Math.max(n-o,0)))},Aa=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Wi=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let l=.9189385332046727;l=l+(e+.5)*Math.log(e),l=l-e;const n=e*e;let o=e;return l=l+1/(12*o),o=o*n,l=l+1/(360*o),o=o*n,l=l+1/(1260*o),o=o*n,l=l+1/(1680*o),o=o*n,l=l+1/(1188*o),o=o*n,l=l+691/(360360*o),o=o*n,l=l+7/(1092*o),o=o*n,l=l+3617/(122400*o),Math.exp(l)/t},pn=.5671432904097838,Wa=function(e,t=1e-10){let l,n;if(!Number.isFinite(e)||e===0)return e;if(e===1)return pn;e<10?l=0:l=Math.log(e)-Math.log(Math.log(e));for(let o=0;o<100;++o){if(n=(e*Math.exp(-l)+l*l)/(l+1),Math.abs(n-l)<t*Math.abs(n))return n;l=n}throw Error(`Iteration failed to converge: ${e.toString()}`)};function Ja(e,t=1e-10){let l,n,o,r;if(!Number.isFinite(e.mag)||e===a.dZero)return e;if(e===a.dOne)return C(pn);a.abs(e),l=a.ln(e);for(let d=0;d<100;++d){if(n=a.exp(-l),o=l.sub(e.mul(n)),r=l.sub(o.div(l.add(1).sub(l.add(2).mul(o).div(a.mul(2,l).add(2))))),a.abs(r.sub(l)).lt(a.abs(r).mul(t)))return r;l=r}throw Error(`Iteration failed to converge: ${e.toString()}`)}const x=class{constructor(e){this.sign=Number.NaN,this.mag=Number.NaN,this.layer=Number.NaN,e instanceof x||e!=null&&typeof e=="object"&&"sign"in e&&"mag"in e&&"layer"in e?this.fromDecimal(e):typeof e=="number"?this.fromNumber(e):typeof e=="string"?this.fromString(e):(this.sign=0,this.layer=0,this.mag=0)}get m(){if(this.sign===0)return 0;if(this.layer===0){const e=Math.floor(Math.log10(this.mag));let t;return this.mag===5e-324?t=5:t=this.mag/Vi(e),this.sign*t}else if(this.layer===1){const e=this.mag-Math.floor(this.mag);return this.sign*Math.pow(10,e)}else return this.sign}set m(e){this.layer<=2?this.fromMantissaExponent(e,this.e):(this.sign=Math.sign(e),this.sign===0&&(this.layer,this.exponent))}get e(){return this.sign===0?0:this.layer===0?Math.floor(Math.log10(this.mag)):this.layer===1?Math.floor(this.mag):this.layer===2?Math.floor(Math.sign(this.mag)*Math.pow(10,Math.abs(this.mag))):this.mag*Number.POSITIVE_INFINITY}set e(e){this.fromMantissaExponent(this.m,e)}get s(){return this.sign}set s(e){e===0?(this.sign=0,this.layer=0,this.mag=0):this.sign=e}get mantissa(){return this.m}set mantissa(e){this.m=e}get exponent(){return this.e}set exponent(e){this.e=e}static fromComponents(e,t,l){return new x().fromComponents(e,t,l)}static fromComponents_noNormalize(e,t,l){return new x().fromComponents_noNormalize(e,t,l)}static fromMantissaExponent(e,t){return new x().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new x().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new x().fromDecimal(e)}static fromNumber(e){return new x().fromNumber(e)}static fromString(e){return new x().fromString(e)}static fromValue(e){return new x().fromValue(e)}static fromValue_noAlloc(e){return e instanceof x?e:new x(e)}static abs(e){return C(e).abs()}static neg(e){return C(e).neg()}static negate(e){return C(e).neg()}static negated(e){return C(e).neg()}static sign(e){return C(e).sign}static sgn(e){return C(e).sign}static round(e){return C(e).round()}static floor(e){return C(e).floor()}static ceil(e){return C(e).ceil()}static trunc(e){return C(e).trunc()}static add(e,t){return C(e).add(t)}static plus(e,t){return C(e).add(t)}static sub(e,t){return C(e).sub(t)}static subtract(e,t){return C(e).sub(t)}static minus(e,t){return C(e).sub(t)}static mul(e,t){return C(e).mul(t)}static multiply(e,t){return C(e).mul(t)}static times(e,t){return C(e).mul(t)}static div(e,t){return C(e).div(t)}static divide(e,t){return C(e).div(t)}static recip(e){return C(e).recip()}static reciprocal(e){return C(e).recip()}static reciprocate(e){return C(e).reciprocate()}static cmp(e,t){return C(e).cmp(t)}static cmpabs(e,t){return C(e).cmpabs(t)}static compare(e,t){return C(e).cmp(t)}static isNaN(e){return e=C(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=C(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return C(e).eq(t)}static equals(e,t){return C(e).eq(t)}static neq(e,t){return C(e).neq(t)}static notEquals(e,t){return C(e).notEquals(t)}static lt(e,t){return C(e).lt(t)}static lte(e,t){return C(e).lte(t)}static gt(e,t){return C(e).gt(t)}static gte(e,t){return C(e).gte(t)}static max(e,t){return C(e).max(t)}static min(e,t){return C(e).min(t)}static minabs(e,t){return C(e).minabs(t)}static maxabs(e,t){return C(e).maxabs(t)}static clamp(e,t,l){return C(e).clamp(t,l)}static clampMin(e,t){return C(e).clampMin(t)}static clampMax(e,t){return C(e).clampMax(t)}static cmp_tolerance(e,t,l){return C(e).cmp_tolerance(t,l)}static compare_tolerance(e,t,l){return C(e).cmp_tolerance(t,l)}static eq_tolerance(e,t,l){return C(e).eq_tolerance(t,l)}static equals_tolerance(e,t,l){return C(e).eq_tolerance(t,l)}static neq_tolerance(e,t,l){return C(e).neq_tolerance(t,l)}static notEquals_tolerance(e,t,l){return C(e).notEquals_tolerance(t,l)}static lt_tolerance(e,t,l){return C(e).lt_tolerance(t,l)}static lte_tolerance(e,t,l){return C(e).lte_tolerance(t,l)}static gt_tolerance(e,t,l){return C(e).gt_tolerance(t,l)}static gte_tolerance(e,t,l){return C(e).gte_tolerance(t,l)}static pLog10(e){return C(e).pLog10()}static absLog10(e){return C(e).absLog10()}static log10(e){return C(e).log10()}static log(e,t){return C(e).log(t)}static log2(e){return C(e).log2()}static ln(e){return C(e).ln()}static logarithm(e,t){return C(e).logarithm(t)}static pow(e,t){return C(e).pow(t)}static pow10(e){return C(e).pow10()}static root(e,t){return C(e).root(t)}static factorial(e,t){return C(e).factorial()}static gamma(e,t){return C(e).gamma()}static lngamma(e,t){return C(e).lngamma()}static exp(e){return C(e).exp()}static sqr(e){return C(e).sqr()}static sqrt(e){return C(e).sqrt()}static cube(e){return C(e).cube()}static cbrt(e){return C(e).cbrt()}static tetrate(e,t=2,l=De(1,0,1)){return C(e).tetrate(t,l)}static iteratedexp(e,t=2,l=De(1,0,1)){return C(e).iteratedexp(t,l)}static iteratedlog(e,t=10,l=1){return C(e).iteratedlog(t,l)}static layeradd10(e,t){return C(e).layeradd10(t)}static layeradd(e,t,l=10){return C(e).layeradd(t,l)}static slog(e,t=10){return C(e).slog(t)}static lambertw(e){return C(e).lambertw()}static ssqrt(e){return C(e).ssqrt()}static pentate(e,t=2,l=De(1,0,1)){return C(e).pentate(t,l)}static affordGeometricSeries(e,t,l,n){return this.affordGeometricSeries_core(C(e),C(t),C(l),n)}static sumGeometricSeries(e,t,l,n){return this.sumGeometricSeries_core(e,C(t),C(l),n)}static affordArithmeticSeries(e,t,l,n){return this.affordArithmeticSeries_core(C(e),C(t),C(l),C(n))}static sumArithmeticSeries(e,t,l,n){return this.sumArithmeticSeries_core(C(e),C(t),C(l),C(n))}static efficiencyOfPurchase(e,t,l){return this.efficiencyOfPurchase_core(C(e),C(t),C(l))}static randomDecimalForTesting(e){if(Math.random()*20<1)return De(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return De(t,0,1);const l=Math.floor(Math.random()*(e+1));let n=l===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(n=Math.trunc(n));let o=Math.pow(10,n);return Math.random()>.9&&(o=Math.trunc(o)),be(t,l,o)}static affordGeometricSeries_core(e,t,l,n){const o=t.mul(l.pow(n));return x.floor(e.div(o).mul(l.sub(1)).add(1).log10().div(l.log10()))}static sumGeometricSeries_core(e,t,l,n){return t.mul(l.pow(n)).mul(x.sub(1,l.pow(e))).div(x.sub(1,l))}static affordArithmeticSeries_core(e,t,l,n){const r=t.add(n.mul(l)).sub(l.div(2)),d=r.pow(2);return r.neg().add(d.add(l.mul(e).mul(2)).sqrt()).div(l).floor()}static sumArithmeticSeries_core(e,t,l,n){const o=t.add(n.mul(l));return e.div(2).mul(o.mul(2).plus(e.sub(1).mul(l)))}static efficiencyOfPurchase_core(e,t,l){return e.div(t).add(e.div(l))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag<Li)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=qi)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<Gi&&this.layer>0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,l){return this.sign=e,this.layer=t,this.mag=l,this.normalize(),this}fromComponents_noNormalize(e,t,l){return this.sign=e,this.layer=t,this.mag=l,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){e=e.replace(",","");const t=e.split("^^^");if(t.length===2){const A=parseFloat(t[0]),v=parseFloat(t[1]),_=t[1].split(";");let N=1;if(_.length===2&&(N=parseFloat(_[1]),isFinite(N)||(N=1)),isFinite(A)&&isFinite(v)){const D=x.pentate(A,v,N);return this.sign=D.sign,this.layer=D.layer,this.mag=D.mag,this}}const l=e.split("^^");if(l.length===2){const A=parseFloat(l[0]),v=parseFloat(l[1]),_=l[1].split(";");let N=1;if(_.length===2&&(N=parseFloat(_[1]),isFinite(N)||(N=1)),isFinite(A)&&isFinite(v)){const D=x.tetrate(A,v,N);return this.sign=D.sign,this.layer=D.layer,this.mag=D.mag,this}}const n=e.split("^");if(n.length===2){const A=parseFloat(n[0]),v=parseFloat(n[1]);if(isFinite(A)&&isFinite(v)){const _=x.pow(A,v);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,this}}e=e.trim().toLowerCase();let o,r,d=e.split("pt");if(d.length===2){o=10,r=parseFloat(d[0]),d[1]=d[1].replace("(",""),d[1]=d[1].replace(")","");let A=parseFloat(d[1]);if(isFinite(A)||(A=1),isFinite(o)&&isFinite(r)){const v=x.tetrate(o,r,A);return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,this}}if(d=e.split("p"),d.length===2){o=10,r=parseFloat(d[0]),d[1]=d[1].replace("(",""),d[1]=d[1].replace(")","");let A=parseFloat(d[1]);if(isFinite(A)||(A=1),isFinite(o)&&isFinite(r)){const v=x.tetrate(o,r,A);return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,this}}const c=e.split("e"),p=c.length-1;if(p===0){const A=parseFloat(e);if(isFinite(A))return this.fromNumber(A)}else if(p===1){const A=parseFloat(e);if(isFinite(A)&&A!==0)return this.fromNumber(A)}const m=e.split("e^");if(m.length===2){this.sign=1,m[0].charAt(0)=="-"&&(this.sign=-1);let A="";for(let v=0;v<m[1].length;++v){const _=m[1].charCodeAt(v);if(_>=43&&_<=57||_===101)A+=m[1].charAt(v);else return this.layer=parseFloat(A),this.mag=parseFloat(m[1].substr(v+1)),this.normalize(),this}}if(p<1)return this.sign=0,this.layer=0,this.mag=0,this;const b=parseFloat(c[0]);if(b===0)return this.sign=0,this.layer=0,this.mag=0,this;let h=parseFloat(c[c.length-1]);if(p>=2){const A=parseFloat(c[c.length-2]);isFinite(A)&&(h*=Math.sign(A),h+=Aa(A))}if(!isFinite(b))this.sign=c[0]==="-"?-1:1,this.layer=p,this.mag=h;else if(p===1)this.sign=Math.sign(b),this.layer=1,this.mag=h+Math.log10(Math.abs(b));else if(this.sign=Math.sign(b),this.layer=p,p===2){const A=x.mul(be(1,2,h),C(b));return this.sign=A.sign,this.layer=A.layer,this.mag=A.mag,this}else this.mag=h;return this.normalize(),this}fromValue(e){return e instanceof x||e!=null&&typeof e=="object"&&"sign"in e&&"mag"in e&&"layer"in e?this.fromDecimal(e):typeof e=="number"?this.fromNumber(e):typeof e=="string"?this.fromString(e):(this.sign=0,this.layer=0,this.mag=0,this)}toNumber(){return Number.isFinite(this.layer)?this.layer===0?this.sign*this.mag:this.layer===1?this.sign*Math.pow(10,this.mag):this.mag>0?this.sign>0?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:0:Number.NaN}mantissaWithDecimalPlaces(e){return isNaN(this.m)?Number.NaN:this.m===0?0:cl(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:cl(this.mag,e)}toString(){return isNaN(this.layer)||isNaN(this.sign)||isNaN(this.mag)?"NaN":this.mag===Number.POSITIVE_INFINITY||this.layer===Number.POSITIVE_INFINITY?this.sign===1?"Infinity":"-Infinity":this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toString():this.m+"e"+this.e:this.layer===1?this.m+"e"+this.e:this.layer<=ja?(this.sign===-1?"-":"")+"e".repeat(this.layer)+this.mag:(this.sign===-1?"-":"")+"(e^"+this.layer+")"+this.mag}toExponential(e){return this.layer===0?(this.sign*this.mag).toExponential(e):this.toStringWithDecimalPlaces(e)}toFixed(e){return this.layer===0?(this.sign*this.mag).toFixed(e):this.toStringWithDecimalPlaces(e)}toPrecision(e){return this.e<=-7?this.toExponential(e-1):e>this.e?this.toFixed(e-this.exponent-1):this.toExponential(e-1)}valueOf(){return this.toString()}toJSON(){return this.toString()}toStringWithDecimalPlaces(e){return this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toFixed(e):cl(this.m,e)+"e"+cl(this.e,e):this.layer===1?cl(this.m,e)+"e"+cl(this.e,e):this.layer<=ja?(this.sign===-1?"-":"")+"e".repeat(this.layer)+cl(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+cl(this.mag,e)}abs(){return De(this.sign===0?0:1,this.layer,this.mag)}neg(){return De(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?x.dZero:this.layer===0?be(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?x.dZero:this.layer===0?be(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?x.dZero:this.layer===0?be(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?x.dZero:this.layer===0?be(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=C(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer)||this.sign===0)return t;if(t.sign===0)return this;if(this.sign===-t.sign&&this.layer===t.layer&&this.mag===t.mag)return De(0,0,0);let l,n;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(x.cmpabs(this,t)>0?(l=this,n=t):(l=t,n=this),l.layer===0&&n.layer===0)return C(l.sign*l.mag+n.sign*n.mag);const o=l.layer*Math.sign(l.mag),r=n.layer*Math.sign(n.mag);if(o-r>=2)return l;if(o===0&&r===-1){if(Math.abs(n.mag-Math.log10(l.mag))>wa)return l;{const d=Math.pow(10,Math.log10(l.mag)-n.mag),c=n.sign+l.sign*d;return be(Math.sign(c),1,n.mag+Math.log10(Math.abs(c)))}}if(o===1&&r===0){if(Math.abs(l.mag-Math.log10(n.mag))>wa)return l;{const d=Math.pow(10,l.mag-Math.log10(n.mag)),c=n.sign+l.sign*d;return be(Math.sign(c),1,Math.log10(n.mag)+Math.log10(Math.abs(c)))}}if(Math.abs(l.mag-n.mag)>wa)return l;{const d=Math.pow(10,l.mag-n.mag),c=n.sign+l.sign*d;return be(Math.sign(c),1,n.mag+Math.log10(Math.abs(c)))}}plus(e){return this.add(e)}sub(e){return this.add(C(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=C(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return De(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return De(this.sign*t.sign,0,1);let l,n;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(l=this,n=t):(l=t,n=this),l.layer===0&&n.layer===0)return C(l.sign*n.sign*l.mag*n.mag);if(l.layer>=3||l.layer-n.layer>=2)return be(l.sign*n.sign,l.layer,l.mag);if(l.layer===1&&n.layer===0)return be(l.sign*n.sign,1,l.mag+Math.log10(n.mag));if(l.layer===1&&n.layer===1)return be(l.sign*n.sign,1,l.mag+n.mag);if(l.layer===2&&n.layer===1){const o=be(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(be(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)));return be(l.sign*n.sign,o.layer+1,o.sign*o.mag)}if(l.layer===2&&n.layer===2){const o=be(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(be(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)));return be(l.sign*n.sign,o.layer+1,o.sign*o.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=C(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?x.dNaN:this.layer===0?be(this.sign,0,1/this.mag):be(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=C(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=C(e),l=this.mag>0?this.layer:-this.layer,n=t.mag>0?t.layer:-t.layer;return l>n?1:l<n?-1:this.mag>t.mag?1:this.mag<t.mag?-1:0}compare(e){return this.cmp(e)}isNan(){return isNaN(this.sign)||isNaN(this.layer)||isNaN(this.mag)}isFinite(){return isFinite(this.sign)&&isFinite(this.layer)&&isFinite(this.mag)}eq(e){const t=C(e);return this.sign===t.sign&&this.layer===t.layer&&this.mag===t.mag}equals(e){return this.eq(e)}neq(e){return!this.eq(e)}notEquals(e){return this.neq(e)}lt(e){return this.cmp(e)===-1}lte(e){return!this.gt(e)}gt(e){return this.cmp(e)===1}gte(e){return!this.lt(e)}max(e){const t=C(e);return this.lt(t)?t:this}min(e){const t=C(e);return this.gt(t)?t:this}maxabs(e){const t=C(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=C(e);return this.cmpabs(t)>0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const l=C(e);return this.eq_tolerance(l,t)?0:this.cmp(l)}compare_tolerance(e,t){return this.cmp_tolerance(e,t)}eq_tolerance(e,t){const l=C(e);if(t==null&&(t=1e-7),this.sign!==l.sign||Math.abs(this.layer-l.layer)>1)return!1;let n=this.mag,o=l.mag;return this.layer>l.layer&&(o=Aa(o)),this.layer<l.layer&&(n=Aa(n)),Math.abs(n-o)<=t*Math.max(Math.abs(n),Math.abs(o))}equals_tolerance(e,t){return this.eq_tolerance(e,t)}neq_tolerance(e,t){return!this.eq_tolerance(e,t)}notEquals_tolerance(e,t){return this.neq_tolerance(e,t)}lt_tolerance(e,t){const l=C(e);return!this.eq_tolerance(l,t)&&this.lt(l)}lte_tolerance(e,t){const l=C(e);return this.eq_tolerance(l,t)||this.lt(l)}gt_tolerance(e,t){const l=C(e);return!this.eq_tolerance(l,t)&&this.gt(l)}gte_tolerance(e,t){const l=C(e);return this.eq_tolerance(l,t)||this.gt(l)}pLog10(){return this.lt(x.dZero)?x.dZero:this.log10()}absLog10(){return this.sign===0?x.dNaN:this.layer>0?be(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):be(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?x.dNaN:this.layer>0?be(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):be(this.sign,0,Math.log10(this.mag))}log(e){return e=C(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?x.dNaN:this.layer===0&&e.layer===0?be(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):x.div(this.log10(),e.log10())}log2(){return this.sign<=0?x.dNaN:this.layer===0?be(this.sign,0,Math.log2(this.mag)):this.layer===1?be(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?be(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):be(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?x.dNaN:this.layer===0?be(this.sign,0,Math.log(this.mag)):this.layer===1?be(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?be(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):be(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=C(e),l=this,n=t;if(l.sign===0)return n.eq(0)?De(1,0,1):l;if(l.sign===1&&l.layer===0&&l.mag===1)return l;if(n.sign===0)return De(1,0,1);if(n.sign===1&&n.layer===0&&n.mag===1)return l;const o=l.absLog10().mul(n).pow10();return this.sign===-1?Math.abs(n.toNumber()%2)%2===1?o.neg():Math.abs(n.toNumber()%2)%2===0?o:x.dNaN:o}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return x.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return be(1,0,t);if(e.sign===0)return x.dOne;e=De(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?be(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?be(-e.sign,e.layer+1,-e.mag):x.dOne}pow_base(e){return C(e).pow(this)}root(e){const t=C(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?x.exp(x.mul(this,x.ln(this).sub(1))):x.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(De(1,0,24)))return C(Wi(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const l=e*e;let n=e,o=12*n,r=1/o,d=t+r;if(d===t||(t=d,n=n*l,o=360*n,r=1/o,d=t-r,d===t))return x.exp(t);t=d,n=n*l,o=1260*n;let c=1/o;return t=t+c,n=n*l,o=1680*n,c=1/o,t=t-c,x.exp(t)}else return this.layer===1?x.exp(x.mul(this,x.ln(this).sub(1))):x.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?x.dOne:this.layer===0&&this.mag<=709.7?C(Math.exp(this.sign*this.mag)):this.layer===0?be(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?be(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):be(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return C(Math.sqrt(this.sign*this.mag));if(this.layer===1)return be(1,2,Math.log10(this.mag)-.3010299956639812);{const e=x.div(De(this.sign,this.layer-1,this.mag),De(1,0,2));return e.layer+=1,e.normalize(),e}}cube(){return this.pow(3)}cbrt(){return this.pow(1/3)}tetrate(e=2,t=De(1,0,1)){if(e===1)return x.pow(this,t);if(e===0)return new x(t);if(this.eq(x.dOne))return x.dOne;if(this.eq(-1))return x.pow(this,t);if(e===Number.POSITIVE_INFINITY){const o=this.toNumber();if(o<=1.444667861009766&&o>=.06598803584531254){if(o>1.444667861009099)return new x(Math.E);const r=x.ln(this).neg();return r.lambertw().div(r)}else return o>1.444667861009766?new x(Number.POSITIVE_INFINITY):x.dNaN}if(this.eq(x.dZero)){let o=Math.abs((e+1)%2);return o>1&&(o=2-o),new x(o)}if(e<0)return x.iteratedlog(t,this,-e);t=C(t);const l=e;e=Math.trunc(e);const n=l-e;if(this.gt(x.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let o=0;o<e;++o){const r=t;if(t=this.pow(t),r.eq(t))return t}if(n!=0){const o=this.pow(t);return t.mul(1-n).add(o.mul(n))}return t}n!==0&&(t.eq(x.dOne)?this.gt(10)?t=this.pow(n):(t=C(x.tetrate_critical(this.toNumber(),n)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(n):t=t.layeradd(n,this));for(let o=0;o<e;++o){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return De(t.sign,t.layer+(e-o-1),t.mag);if(o>1e4)return t}return t}iteratedexp(e=2,t=De(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return x.tetrate(e,-t,this);e=C(e);let l=C(this);const n=t;t=Math.trunc(t);const o=n-t;if(l.layer-e.layer>3){const r=Math.min(t,l.layer-e.layer-3);t-=r,l.layer-=r}for(let r=0;r<t;++r){if(l=l.log(e),!isFinite(l.layer)||!isFinite(l.mag))return l.normalize();if(r>1e4)return l}return o>0&&o<1&&(e.eq(10)?l=l.layeradd10(-o):l=l.layeradd(-o,e)),l}slog(e=10){if(e=C(e),e.lte(x.dZero)||e.eq(x.dOne))return x.dNaN;if(e.lt(x.dOne))return this.eq(x.dOne)?x.dZero:this.eq(x.dZero)?x.dNegOne:x.dNaN;if(this.mag<0||this.eq(x.dZero))return x.dNegOne;let t=0,l=C(this);if(l.layer-e.layer>3){const n=l.layer-e.layer-3;t+=n,l.layer-=n}for(let n=0;n<100;++n)if(l.lt(x.dZero))l=x.pow(e,l),t-=1;else{if(l.lte(x.dOne))return C(t+x.slog_critical(e.toNumber(),l.toNumber()));t+=1,l=x.log(l,e)}return C(t)}static slog_critical(e,t){return e>10?t-1:x.critical_section(e,t,ji)}static tetrate_critical(e,t){return x.critical_section(e,t,Hi)}static critical_section(e,t,l){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let n=0,o=0;for(let c=0;c<Cl.length;++c)if(Cl[c]==e){n=l[c][Math.floor(t)],o=l[c][Math.ceil(t)];break}else if(Cl[c]<e&&Cl[c+1]>e){const p=(e-Cl[c])/(Cl[c+1]-Cl[c]);n=l[c][Math.floor(t)]*(1-p)+l[c+1][Math.floor(t)]*p,o=l[c][Math.ceil(t)]*(1-p)+l[c+1][Math.ceil(t)]*p;break}const r=t-Math.floor(t);return n*(1-r)+o*r}layeradd10(e){e=x.fromValue_noAlloc(e).toNumber();const t=C(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const l=Math.trunc(e);e-=l,t.layer+=l}if(e<=-1){const l=Math.trunc(e);if(e-=l,t.layer+=l,t.layer<0)for(let n=0;n<100;++n){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const n=this.slog(t).toNumber()+e;return n>=0?x.tetrate(t,n):Number.isFinite(n)?n>=-1?x.log(x.tetrate(t,n+1),t):x.log(x.log(x.tetrate(t,n+2),t),t):x.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return C(Wa(this.toNumber()));if(this.layer===0)return C(Wa(this.sign*this.mag));if(this.layer===1)return Ja(this);if(this.layer===2)return Ja(this);if(this.layer>=3)return De(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return De(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=De(1,0,1)){t=C(t);const l=e;e=Math.trunc(e);const n=l-e;n!==0&&(t.eq(x.dOne)?(++e,t=new x(n)):this.eq(10)?t=t.layeradd10(n):t=t.layeradd(n,this));for(let o=0;o<e;++o){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(o>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?C(Math.sin(this.sign*this.mag)):De(0,0,0)}cos(){return this.mag<0?x.dOne:this.layer===0?C(Math.cos(this.sign*this.mag)):De(0,0,0)}tan(){return this.mag<0?this:this.layer===0?C(Math.tan(this.sign*this.mag)):De(0,0,0)}asin(){return this.mag<0?this:this.layer===0?C(Math.asin(this.sign*this.mag)):De(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?C(Math.acos(this.toNumber())):this.layer===0?C(Math.acos(this.sign*this.mag)):De(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?C(Math.atan(this.sign*this.mag)):C(Math.atan(this.sign*(1/0)))}sinh(){return this.exp().sub(this.negate().exp()).div(2)}cosh(){return this.exp().add(this.negate().exp()).div(2)}tanh(){return this.sinh().div(this.cosh())}asinh(){return x.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return x.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?De(Number.NaN,Number.NaN,Number.NaN):x.ln(this.add(1).div(C(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(x.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let a=x;a.dZero=De(0,0,0);a.dOne=De(1,0,1);a.dNegOne=De(-1,0,1);a.dTwo=De(1,0,2);a.dTen=De(1,0,10);a.dNaN=De(Number.NaN,Number.NaN,Number.NaN);a.dInf=De(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);a.dNegInf=De(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);a.dNumberMax=be(1,0,Number.MAX_VALUE);a.dNumberMin=be(1,0,Number.MIN_VALUE);const Ji=new a(1);function ql(e,t,l=!0){let n=a.log10(e).floor(),o=a.div(e,a.pow(10,n));o.toStringWithDecimalPlaces(t)==="10"&&(o=Ji,n=n.add(1));const r=n.gte(1e9)?Ee(n,Math.max(Math.max(t,3),je.defaultDecimalsShown)):n.gte(1e4)?na(n,0):n.toStringWithDecimalPlaces(0);return l?o.toStringWithDecimalPlaces(t)+"e"+r:"e"+r}function na(e,t){if(e==null)return"NaN";if(e=new a(e),e.mag<.001)return 0 .toFixed(t);const n=e.toStringWithDecimalPlaces(t).split(".");return n[0]=n[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),n.length==1?n[0]:n[0]+"."+n[1]}function mn(e,t){return e==null?"NaN":(e=new a(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),je.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Ki=new a("eeee1000"),zi=new a("e100000"),Ka=new a("e1000"),vn=new a(1e9),Xi=new a(1e6),Yi=new a(1e3),Zi=new a(.98),eo=new a(.001),fn=new a(0);function Ee(e,t,l){if(t==null&&(t=je.defaultDecimalsShown),l=l!=null?l:je.defaultShowSmall,e=new a(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Ee(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Ki)){const n=e.slog();return n.gte(Xi)?"F"+Ee(n.floor()):a.pow(10,n.sub(n.floor())).toStringWithDecimalPlaces(3)+"F"+na(n.floor(),0)}else{if(e.gte(zi))return ql(e,0,!1);if(e.gte(Ka))return ql(e,0);if(e.gte(vn))return ql(e,t);if(e.gte(Yi))return na(e,0);if(e.gte(eo)||!l)return mn(e,t);if(e.eq(fn))return 0 .toFixed(t)}return e=gn(e),e.lt(Ka)?ql(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Ee(e,t)+"\u207B\xB9"}function we(e){return e=new a(e),e.sign<0?"-"+we(e.neg()):e.gte(vn)||e.lte(Zi)&&!e.eq(fn)?Ee(e):Ee(e,0)}function Ba(e,t){return t==null&&(t=je.defaultDecimalsShown),a.lt(e,0)?"-"+Ba(a.neg(e),t):a.gt(e,2**51)?Ee(a.div(e,31536e3))+"y":(e=new a(e).toNumber(),e<60?Ee(e)+"s":e<3600?we(Math.floor(e/60))+"m "+Ee(e%60,t)+"s":e<86400?we(Math.floor(e/3600))+"h "+we(Math.floor(e/60)%60)+"m "+we(e%60)+"s":e<31536e3?we(Math.floor(e/84600)%365)+"d "+we(Math.floor(e/3600)%24)+"h "+we(Math.floor(e/60)%60)+"m":we(Math.floor(e/31536e3))+"y "+we(Math.floor(e/84600)%365)+"d "+we(Math.floor(e/3600)%24)+"h")}function to(e,t,l){e=new a(e);let n=e.toStringWithDecimalPlaces(t);return new a(n).gte(l)&&(n=a.sub(l,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),n}function lo(e,t){return Ee(e,t,!0)}function gn(e){let t=a.log10(e).ceil();const l=a.div(e,a.pow(10,t));return t=t.neg(),e=new a(10).pow(t).times(l),e}function hn(e,t,l=a.dOne){let n=e[0][0],o=e[0][1];for(let r=1;r<e.length;r++)a.lt(e[r][0],n)&&(n=e[r][0],o=e[r][1]);return Ee(a.times(n,l))+t+", limited by "+o}function yn(e){return{[-1]:`${Ee(e)}/s`,0:"",1:`+${Ee(e)}/s`}[a.compare(e,0)]}var ao=Object.freeze(Object.defineProperty({__proto__:null,default:a,exponentialFormat:ql,commaFormat:na,regularFormat:mn,format:Ee,formatWhole:we,formatTime:Ba,toPlaces:to,formatSmall:lo,invertOOM:gn,formatLimit:hn,formatGain:yn},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:no,commaFormat:io,regularFormat:oo,format:L,formatWhole:X,formatTime:Wl,toPlaces:so,formatSmall:ro,formatLimit:bn,invertOOM:uo,formatGain:ia}=ao;window.Decimal=a;window.exponentialFormat=no;window.commaFormat=io;window.regularFormat=oo;window.format=L;window.formatWhole=X;window.formatTime=Wl;window.toPlaces=so;window.formatSmall=ro;window.formatLimit=bn;window.invertOOM=uo;window.formatGain=ia;function wn(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Sa(e){return typeof e=="function"}var Pe=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(Pe||{});const Ql=Symbol("DoNotCache");function z(e,t){const l=e[t];Sa(l)&&l.length===0&&!l[Ql]?e[t]=f(l.bind(e)):Sa(l)&&(e[t]=l.bind(e),e[t][Ql]=!0)}function Et(e){return Sa(e)&&!e[Ql]&&(e=f(e)),e}const yl=Symbol("Component"),bl=Symbol("GatherProps");let co=0;function Tl(e="feature-"){return e+co++}var bt=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(bt||{});function B(e){return e[Ql]=!0,e}function y(e,t=2){return e?0:t}function St(e,t,l){e[t]===void 0&&l!=null&&(e[t]=l)}function An(e,...t){const l=[],n=o=>{Object.keys(o).forEach(r=>{const d=o[r];d&&typeof d=="object"&&(t.includes(d.type)?l.push(d):!(d instanceof a)&&!ht(d)&&n(d))})};return n(e),l}const kl={variables:{"--foreground":"#dfdfdf","--background":"#0f0f0f","--feature-foreground":"#0f0f0f","--tooltip-background":"rgba(0, 0, 0, 0.75)","--raised-background":"#0f0f0f","--points":"#ffffff","--locked":"#bf8f8f","--highlighted":"#333","--bought":"#77bf5f","--danger":"rgb(220, 53, 69)","--link":"#02f2f2","--outline":"#dfdfdf","--accent1":"#627a82","--accent2":"#658262","--accent3":"#7c6282","--border-radius":"15px","--modal-border":"solid 2px var(--color)","--feature-margin":"0px"},floatingTabs:!0,mergeAdjacent:!0,showPin:!0};var Ma=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Ma||{}),Fl={classic:kl,paper:{...kl,variables:{...kl.variables,"--background":"#2a323d","--feature-foreground":"#000","--raised-background":"#333c4a","--locked":"#3a3e45","--bought":"#5C8A58","--outline":"#333c4a","--border-radius":"4px","--modal-border":"","--feature-margin":"5px"},floatingTabs:!1},nordic:{...kl,variables:{...kl.variables,"--foreground":"#D8DEE9","--background":"#2E3440","--feature-foreground":"#000","--raised-background":"#3B4252","--points":"#E5E9F0","--locked":"#4c566a","--highlighted":"#434c5e","--bought":"#8FBCBB","--danger":"#D08770","--link":"#88C0D0","--outline":"#3B4252","--accent1":"#B48EAD","--accent2":"#A3BE8C","--accent3":"#EBCB8B","--border-radius":"4px","--modal-border":"solid 2px #3B4252","--feature-margin":"5px"},floatingTabs:!1},aqua:{...kl,variables:{...kl.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Xe=dn();document.fonts.onloadingdone=()=>Xe.emit("fontsLoaded");var po=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Xe},Symbol.toStringTag,{value:"Module"}));var $e=(e,t)=>{const l=e.__vccOpts||e;for(const[n,o]of t)l[n]=o;return l};const mo=Ae({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var b;const l=V({}),n=new ResizeObserver(c),o=V(null);ua(()=>{const h=o.value;h!=null&&n.observe(h)});let r=!0,d=V((b=o.value)==null?void 0:b.getBoundingClientRect());function c(){r&&(r=!1,_l(()=>{var h;d.value=(h=o.value)==null?void 0:h.getBoundingClientRect(),Object.values(l.value).filter(A=>A).forEach(A=>A.rect=A.element.getBoundingClientRect()),t("updateNodes",l.value),r=!0}))}Xe.on("fontsLoaded",c);const p={attributes:!1,childList:!0,subtree:!1};Zl(Na,(h,A)=>{const v=new MutationObserver(()=>m(h));v.observe(A,p),l.value[h]={element:A,observer:v,rect:A.getBoundingClientRect()},c()}),Zl(xa,h=>{var A;(A=l.value[h])==null||A.observer.disconnect(),l.value[h]=void 0,c()}),Zl(Ia,l),Zl(Da,d);function m(h){const A=l.value[h];A!=null&&(A.rect=A.element.getBoundingClientRect(),t("updateNodes",l.value))}return(h,A)=>(k(),I(S,null,[Qt(h.$slots,"default",{},void 0,!0),g("div",{ref_key:"resizeListener",ref:o,class:"resize-listener"},null,512)],64))}});var Cn=$e(mo,[["__scopeId","data-v-2b1dc1bc"]]);const vo=["onPointerdown"],fo={class:"modal-wrapper"},go={class:"modal-container"},ho={class:"modal-header"},yo=s(" default header "),bo={class:"modal-body"},wo=s(" default body "),Ao={class:"modal-footer"},Co=g("div",{class:"modal-default-flex-grow"},null,-1),wt=Ae({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:l}){const o=Bt(e),r=f(()=>o.modelValue||c.value);function d(){l("update:modelValue",!1)}const c=V(!1),p=V(null),m=f(()=>{var b,h;return(h=(b=p.value)==null?void 0:b.nodes)!=null?h:null});return t({isOpen:r,nodes:m}),(b,h)=>(k(),ye(li,{to:"#modal-root"},[i(ca,{name:"modal",onBeforeEnter:h[0]||(h[0]=A=>c.value=!0),onAfterLeave:h[1]||(h[1]=A=>c.value=!1)},{default:pe(()=>[da(g("div",Sl({class:"modal-mask",onPointerdown:Ll(d,["self"])},b.$attrs),[g("div",fo,[g("div",go,[g("div",ho,[Qt(b.$slots,"header",{shown:u(r)},()=>[yo])]),g("div",bo,[i(Cn,{ref_key:"contextRef",ref:p},{default:pe(()=>[Qt(b.$slots,"body",{shown:u(r)},()=>[wo])]),_:3},512)]),g("div",Ao,[Qt(b.$slots,"footer",{shown:u(r)},()=>[g("div",{class:"modal-default-footer"},[Co,g("button",{class:"button modal-default-button",onClick:d}," Close ")])])])])])],16,vo),[[sn,e.modelValue]])]),_:3})]))}}),Na=Symbol("RegisterNode"),xa=Symbol("UnregisterNode"),Ia=Symbol("Nodes"),Da=Symbol("Bounds"),_t=pa({});window.layers=_t;const xl={},Wt=[];function Rt(e,t){return Ot(()=>{const l={},n=l.emitter=dn();if(l.on=n.on.bind(n),l.emit=n.emit.bind(n),l.nodes=V({}),l.id=e,Wt.push(e),xl[e]=new Set,l.minimized=Se(!1),Object.assign(l,t.call(l)),Wt[Wt.length-1]==null||Wt[Wt.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${Wt}
Trying to pop ${l.id}`;return Wt.pop(),z(l,"color"),z(l,"display"),z(l,"name"),St(l,"name",l.id),z(l,"minWidth"),St(l,"minWidth",600),z(l,"minimizable"),St(l,"minimizable",!0),l})}function kn(e,t){if(console.info("Adding layer",e.id),_t[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,_t[e.id]);return}St(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),_t[e.id]=e,Xe.emit("addLayer",e,t.layers[e.id])}function ko(e){return _t[e]}function En(e){console.info("Removing layer",e.id),Xe.emit("removeLayer",e),_t[e.id]=void 0}function Eo(e){En(e),kn(e,de)}function _o(e){const t=V(!1);return{openModal:()=>t.value=!0,modal:B(()=>i(wt,{modelValue:t.value,"onUpdate:modelValue":l=>t.value=l},{header:()=>i("h2",null,[u(e.name)]),body:u(e.display)}))}}Xe.on("update",function(t){Object.values(_t).forEach(l=>{l==null||l.emit("preUpdate",t)}),Object.values(_t).forEach(l=>{l==null||l.emit("update",t)}),Object.values(_t).forEach(l=>{l==null||l.emit("postUpdate",t)})});var So=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Na,UnregisterNodeInjectionKey:xa,NodesInjectionKey:Ia,BoundsInjectionKey:Da,layers:_t,persistentRefs:xl,addingLayers:Wt,createLayer:Rt,addLayer:kn,getLayer:ko,removeLayer:En,reloadLayer:Eo,setupLayerModal:_o},Symbol.toStringTag,{value:"Module"}));const Pa=Symbol("PersistentState"),fl=Symbol("DefaultValue"),oa=Symbol("StackTrace"),_n=Symbol("Deleted"),$l=Symbol("NonPersistent"),Gl=Symbol("SaveDataPath");function Bo(){var e;return((e=new Error().stack)==null?void 0:e.split(`
`).slice(3,5).map(t=>t.trim()).join(`
`))||""}function Se(e){const t=ht(e)?e:V(e);t[Pa]=t,t[fl]=ht(e)?e.value:e,t[oa]=Bo(),t[_n]=!1;const l=f({get(){return t.value},set(n){t.value=n}});return l[fl]=t[fl],t[$l]=l,t[Gl]=void 0,Wt.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
Created at:
`+t[oa]):xl[Wt[Wt.length-1]].add(t),t}function Mo(e){return e&&typeof e=="object"&&Pa in e}function U(e){return e[$l]}Xe.on("addLayer",(e,t)=>{const l=[],n=(o,r=[])=>{let d=!1;return Object.keys(o).forEach(c=>{let p=o[c];if(p&&typeof p=="object")if(ot in p&&(p=p[ot]),Mo(p)){if(d=!0,p[_n]){console.warn("Deleted persistent ref present in returned object. Ignoring...",p,`
Created at:
`+p[oa]);return}xl[e.id].delete(p);const m=[e.id,...r,c];p[Gl]!=null&&JSON.stringify(m)!==JSON.stringify(p[Gl])&&console.error(`Persistent ref is being saved to \`${m.join(".")}\` when it's already present at \`${p[Gl].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,p),p[Gl]=m;const b=r.reduce((A,v)=>(v in A||(A[v]={}),A[v]),t),h=b[c];b[c]=p[Pa],ai(b)?h!=null?b[c]=h:b[c]=p[fl]:h!=null?b[c].value=h:b[c].value=p[fl]}else!(p instanceof a)&&!ht(p)&&!l.includes(p)&&(typeof p.type=="symbol"&&l.push(p),n(p,[...r,c])&&(_a(p)&&!_a(o)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",ot in o?o[ot]:o,c):d=!0))}),d};n(e[ot]),xl[e.id].forEach(o=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,o,`
Created at:
`+o[oa])}),xl[e.id].clear()});const ot=Symbol("ProxyState"),Nl=Symbol("ProxyPath");function Ot(e,t={}){const l=t;let n=!1;function o(){return n||(Object.assign(l,e(l)),n=!0),l}return new Proxy(l,{get(r,d){if(d===ot)return o();const c=o()[d];return c&&typeof c=="object"&&$l in c?c[$l]:c},set(r,d,c){return o()[d]=c,!0},has(r,d){return d===ot?!0:Reflect.has(o(),d)},ownKeys(){return Reflect.ownKeys(o())},getOwnPropertyDescriptor(r,d){return n||(Object.assign(l,e(l)),n=!0),Object.getOwnPropertyDescriptor(r,d)}})}var rt=window.state=pa({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Sn=jl({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{},usingLog:!1});function Bn(e){return JSON.stringify(e,(t,l)=>u(l))}const Mn={get(e,t){var n;if(t===ot||t===Nl)return e[t];const l=e[ot][t];if(t!=="value"&&(ui(l)||Array.isArray(l))){if(l!==((n=e[t])==null?void 0:n[ot])){const o=[...e[Nl],t];e[t]=new Proxy({[ot]:l,[Nl]:o},Mn)}return e[t]}return l},set(e,t,l,n){if(!rt.hasNaN&&(typeof l=="number"&&isNaN(l)||l instanceof a&&(isNaN(l.sign)||isNaN(l.layer)||isNaN(l.mag)))){const o=e[ot][t];if(!(typeof o=="number"&&isNaN(o)||o instanceof a&&(isNaN(o.sign)||isNaN(o.layer)||isNaN(o.mag))))throw Sn.autosave=!1,rt.hasNaN=!0,rt.NaNPath=[...e[Nl],t],rt.NaNReceiver=n,console.error("Attempted to set NaN value",[...e[Nl],t],e[ot]),"Attempted to set NaN value. See above for details"}return e[ot][t]=l,!0},ownKeys(e){return Reflect.ownKeys(e[ot])},has(e,t){return Reflect.has(e[ot],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[ot],t)}};var de=window.player=new Proxy({[ot]:Sn,[Nl]:["player"]},Mn);function Nn(e={}){return Object.assign({id:`${je.id}-0`,name:"Default Save",tabs:je.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:je.id,modVersion:je.versionNumber,layers:{}},e)}function Jt(e){const t=ml.compressToUTF16(Bn(e!=null?e:de[ot]));return localStorage.setItem((e!=null?e:de[ot]).id,t),t}async function No(){Io();try{let e=localStorage.getItem(at.active);if(e==null){await El(Il());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=ml.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==je.id){await El(Il());return}t.id=at.active,await El(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
`,e),await El(Il())}}function Il(){const e=ta(),t=Nn({id:e});return Jt(t),at.saves.push(e),t}function ta(){let e,t=0;do e=`${je.id}-${t++}`;while(localStorage.getItem(e));return e}const Ta=V(!1);async function El(e){console.info("Loading save",e),Ta.value=!0;const{layers:t,removeLayer:l,addLayer:n}=await aa(()=>Promise.resolve().then(function(){return So}),void 0),{fixOldSave:o,getInitialLayers:r}=await aa(()=>Promise.resolve().then(function(){return Nr}),void 0);for(const d in t){const c=t[d];c&&l(c)}r(e).forEach(d=>n(d,e)),e=Nn(e),e.offlineProd&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,je.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==je.versionNumber&&(o(e.modVersion,e),e.modVersion=je.versionNumber),Object.assign(de,e),at.active=de.id,Xe.emit("onLoad")}setInterval(()=>{de.autosave&&Jt()},1e3);window.onbeforeunload=()=>{de.autosave&&Jt()};window.save=Jt;const xo=window.hardReset=async()=>{await El(Il())},Vl=jl({active:"",saves:[],showTPS:!0,theme:Ma.Nordic,unthrottled:!1});Xt(Vl,e=>{const t=ml.compressToUTF16(JSON.stringify(e));localStorage.setItem(je.id,t)},{deep:!0});var at=window.settings=Vl;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Ma.Nordic};Xe.emit("loadSettings",e),Object.assign(Vl,e),xo()};function Io(){try{let e=localStorage.getItem(je.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=ml.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Vl,t)}Xe.emit("loadSettings",Vl)}catch{}}const xn=jl([]);function Do(e){xn.push(e)}const In=jl([]);function Po(e){In.push(e)}const To=jl([]),Fo={class:"table"},Ut=Ae({__name:"Column",setup(e){const t=f(()=>Fl[at.theme].mergeAdjacent);return(l,n)=>(k(),I("div",Fo,[g("div",{class:ct(["col",{mergeAdjacent:u(t)}])},[Qt(l.$slots,"default")],2)]))}}),Uo={class:"table"},Pl=Ae({__name:"Row",setup(e){const t=f(()=>Fl[at.theme].mergeAdjacent);return(l,n)=>(k(),I("div",Uo,[g("div",{class:ct(["row",{mergeAdjacent:u(t)}])},[Qt(l.$slots,"default")],2)]))}});function Fa(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ni(e)}function Qe(e,t="span"){return typeof e=="function"?Ae({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),Ae({template:e})):Ae({render:()=>({})}):e}function se(e){if(il(e))return typeof e=="function"?e():Qe(e);const t=e[yl];return i(t,e[bl](),null)}function Ye(...e){let t;return i(Pl,null,Fa(t=e.map(se))?t:{default:()=>[t]})}function Vt(...e){let t;return i(Ut,null,Fa(t=e.map(se))?t:{default:()=>[t]})}function Bl(...e){return i("div",{class:"table-grid"},[e.map(t=>i("div",{class:{["row-grid"]:!0,mergeAdjacent:Fl[at.theme].mergeAdjacent}},[t.map(se)]))])}function zt(e){if(il(e))return typeof e=="function"?e():typeof e=="string"?i(S,null,[e]):i(e,null,null);const t=e[yl];return i(t,e[bl](),null)}function Ro(...e){let t;return i(Ut,null,Fa(t=e.map(zt))?t:{default:()=>[t]})}function il(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Ql]===!0}function Dn(e,t,l){const n=V(null),o=V(void 0);function r(p){n.value||(n.value=setInterval(c,250)),o.value=p,l&&(l.value=!0)}function d(){n.value&&(clearInterval(n.value),n.value=null),l&&(l.value=!1)}function c(){t&&t.value?t.value():e&&e.value&&e.value(o.value)}return rn(d),{start:r,stop:d,handleHolding:c}}function Oo(e,t){const l=f(()=>e.filter(n=>u(n.visibility)===bt.Visible&&t(n)));return{firstFeature:f(()=>l.value[0]),collapsedContent:B(()=>Vt(...l.value.slice(1))),hasCollapsedContent:f(()=>l.value.length>1)}}function sa(e,t="div"){const l=$t();return qt(()=>{l.value=Qe(kt(e),t)}),l}function hl(e,t="div"){const l=$t(null);return qt(()=>{const n=kt(e);l.value=n==null?null:Qe(n,t)}),l}function qo(e){return f(()=>kt(e))}function kt(e){return u(u(e))}function Y(...e){return e.includes(Object)||e.push(Object),e}const _e=Ae({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,l)=>(k(),I("div",{style:yt({width:e.width,height:e.height})},null,4))}});const Go={},Lo={class:"notif"};function Qo(e,t){return k(),I("div",Lo,"!")}var za=$e(Go,[["render",Qo],["__scopeId","data-v-66323fd4"]]),$o=Ae({props:{element:Object,display:{type:Y(Object,String,Function),required:!0},style:Y(Object,String,Array),classes:Y(Object),direction:Y(String),xoffset:Y(String),yoffset:Y(String),pinned:Object},setup(e){const{element:t,display:l,pinned:n}=Bt(e),o=V(!1),r=f(()=>(kt(n)||o.value)&&d.value),d=hl(l),c=$t(Qe(B(()=>{const b=kt(t);return b==null?"":zt(b)})));function p(b){const h=n;b.shiftKey&&h&&(h.value=!h.value,b.stopPropagation(),b.preventDefault())}const m=f(()=>kt(n)&&Fl[at.theme].showPin);return{Direction:Pe,isHovered:o,isShown:r,comp:d,elementComp:c,unref:u,togglePinned:p,showPin:m}}});const Vo={key:0,class:"material-icons pinned"};function Ho(e,t,l,n,o,r){return k(),I("div",{class:ct(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=d=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=d=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...d)=>e.togglePinned&&e.togglePinned(...d))},[Qt(e.$slots,"default",{},void 0,!0),e.elementComp?(k(),ye(nt(e.elementComp),{key:0})):G("",!0),i(ca,{name:"fade"},{default:pe(()=>{var d;return[e.isShown?(k(),I("div",{key:0,class:ct(["tooltip",{top:e.unref(e.direction)===e.Direction.Up,left:e.unref(e.direction)===e.Direction.Left,right:e.unref(e.direction)===e.Direction.Right,bottom:e.unref(e.direction)===e.Direction.Down,...e.unref(e.classes)}]),style:yt([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(d=e.unref(e.style))!=null?d:{}])},[e.showPin?(k(),I("span",Vo,"push_pin")):G("",!0),e.comp?(k(),ye(nt(e.comp),{key:1})):G("",!0)],6)):G("",!0)]}),_:1})],34)}var ut=$e($o,[["render",Ho],["__scopeId","data-v-6102fa3a"]]);const ma=e=>(ol("data-v-14ecc7bd"),e=e(),sl(),e),jo={key:0,class:"day feature dontMerge opened"},Wo={class:"date"},Jo=s("Dec"),Ko=ma(()=>g("br",null,null,-1)),zo={class:"date"},Xo=s("Dec"),Yo=ma(()=>g("br",null,null,-1)),Zo=ma(()=>g("div",{class:"doors"},null,-1)),es={class:"date"},ts=s("Dec"),ls=ma(()=>g("br",null,null,-1)),as={key:0,class:"material-icons lock"},ns={key:1,class:"timer"},is=Ae({__name:"Day",props:{day:null,symbol:null,layer:null,opened:null,recentlyUpdated:null,shouldNotify:null},emits:["openLore","openLayer","unlockLayer"],setup(e,{emit:t}){const l=e,n=f(()=>l.layer&&a.gte(R.day.value,l.day)&&new Date().getMonth()===11&&new Date().getDate()>=l.day);function o(){n.value&&t("unlockLayer")}return(r,d)=>{var c,p,m;return e.opened.value?(k(),I("div",jo,[i(ut,{display:(m=(p=u(_t)[(c=e.layer)!=null?c:""])==null?void 0:p.name)!=null?m:"",direction:u(Pe).Up,yoffset:"5px"},{default:pe(()=>[i(ca,{appear:"",name:"door"},{default:pe(()=>[g("div",{class:"doors",onClick:d[0]||(d[0]=b=>t("openLayer"))},[g("div",Wo,[Jo,Ko,s(Ne(e.day),1)]),g("div",zo,[Xo,Yo,s(Ne(e.day),1)])])]),_:1}),g("div",{class:"icon",onClick:d[1]||(d[1]=b=>t("openLayer")),style:yt({backgroundImage:`url(${e.symbol})`})},null,4),g("div",{class:"lore",onClick:d[2]||(d[2]=b=>t("openLore"))},"?"),u(e.shouldNotify)?(k(),ye(za,{key:0})):G("",!0)]),_:1},8,["display","direction"])])):(k(),I("div",{key:1,class:ct(["day feature dontMerge",{can:u(n),locked:!u(n),canOpen:u(n)}]),onClick:o},[Zo,g("div",es,[ts,ls,s(Ne(e.day),1)]),u(n)?G("",!0):(k(),I("div",as,"lock")),u(R).day.value===e.day&&!u(n)?(k(),I("div",ns,Ne(u(R).timeUntilNewDay.value<0?"NYI, sorry":u(Ba)(u(R).timeUntilNewDay.value,0)),1)):G("",!0),u(n)?(k(),ye(za,{key:2})):G("",!0)],2))}}});var os=$e(is,[["__scopeId","data-v-14ecc7bd"]]);const ss=Ae({__name:"Collapsible",props:{collapsed:null,display:null,content:null},setup(e){const t=e,l=sa(Yt(t,"display")),n=sa(Yt(t,"content"));return(o,r)=>(k(),ye(Ut,{class:"collapsible-container"},{default:pe(()=>[g("button",{onClick:r[0]||(r[0]=d=>e.collapsed.value=!e.collapsed.value),class:"feature collapsible-toggle"},[(k(),ye(nt(u(l))))]),e.collapsed.value?G("",!0):(k(),ye(nt(u(n)),{key:0}))]),_:1}))}});var rs=$e(ss,[["__scopeId","data-v-a72c16aa"]]);const us={key:0},ds={key:0,class:"mark star"},cs=["src"],ps=Ae({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,l)=>e.mark?(k(),I("div",us,[e.mark===!0?(k(),I("div",ds)):(k(),I("img",{key:1,class:"mark",src:e.mark},null,8,cs))])):G("",!0)}});var va=$e(ps,[["__scopeId","data-v-2207999f"]]);const ms=Ae({__name:"Node",props:{id:null},setup(e){const l=Bt(e),n=la(Na,()=>{}),o=la(xa,()=>{}),r=$t(null),d=f(()=>r.value&&r.value.parentElement);return Xt([d,l.id],([c,p],[m,b])=>{m&&o(u(b)),c&&n(p,c)}),rn(()=>o(u(l.id))),(c,p)=>(k(),I("div",{class:"node",ref_key:"node",ref:r},null,512))}});var Jl=$e(ms,[["__scopeId","data-v-a48cb382"]]);const vs=Ae({props:{progress:{type:Y(String,Object,Number),required:!0},width:{type:Y(Number),required:!0},height:{type:Y(Number),required:!0},direction:{type:Y(String),required:!0},display:Y(Object,String,Function),visibility:{type:Y(Number),required:!0},style:Y(Object,String,Array),classes:Y(Object),borderStyle:Y(Object,String,Array),textStyle:Y(Object,String,Array),baseStyle:Y(Object,String,Array),fillStyle:Y(Object,String,Array),mark:Y(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:va,Node:Jl},setup(e){const{progress:t,width:l,height:n,direction:o,display:r}=Bt(e),d=f(()=>{let m=t.value instanceof a?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(m,0),1))*100}),c=f(()=>{const m={width:kt(l)+.5+"px",height:kt(n)+.5+"px"};switch(u(o)){case Pe.Up:m.clipPath=`inset(${d.value}% -2px -2px -2px)`,m.width=kt(l)+2+"px";break;case Pe.Down:m.clipPath=`inset(-2px -2px ${d.value}% -2px)`,m.width=kt(l)+2+"px";break;case Pe.Right:m.clipPath=`inset(-2px ${d.value}% -2px -2px)`;break;case Pe.Left:m.clipPath=`inset(-2px -2px -2px ${d.value} + '%)`;break;case Pe.Default:m.clipPath="inset(-2px 50% -2px -2px)";break}return m}),p=hl(r);return{normalizedProgress:d,barStyle:c,component:p,unref:u,Visibility:bt}}});function fs(e,t,l,n,o,r){var p,m,b,h,A,v,_;const d=gl("MarkNode"),c=gl("Node");return e.unref(e.visibility)!==e.Visibility.None?(k(),I("div",{key:0,style:yt([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(p=e.unref(e.style))!=null?p:{}]),class:ct({bar:!0,...e.unref(e.classes)})},[g("div",{class:"overlayTextContainer border",style:yt([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(m=e.unref(e.borderStyle))!=null?m:{}])},[e.component?(k(),I("span",{key:0,class:"overlayText",style:yt(e.unref(e.textStyle))},[(k(),ye(nt(e.component)))],4)):G("",!0)],4),g("div",{class:"border",style:yt([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(b=e.unref(e.style))!=null?b:{},(h=e.unref(e.baseStyle))!=null?h:{},(A=e.unref(e.borderStyle))!=null?A:{}])},[g("div",{class:"fill",style:yt([e.barStyle,(v=e.unref(e.style))!=null?v:{},(_=e.unref(e.fillStyle))!=null?_:{}])},null,4)],4),i(d,{mark:e.unref(e.mark)},null,8,["mark"]),i(c,{id:e.id},null,8,["id"])],6)):G("",!0)}var gs=$e(vs,[["render",fs],["__scopeId","data-v-730cc7a0"]]);const hs=Symbol("Bar");function Ht(e){return Ot(()=>{const t=e();return t.id=Tl("bar-"),t.type=hs,t[yl]=gs,z(t,"visibility"),St(t,"visibility",bt.Visible),z(t,"width"),z(t,"height"),z(t,"direction"),z(t,"style"),z(t,"classes"),z(t,"borderStyle"),z(t,"baseStyle"),z(t,"textStyle"),z(t,"fillStyle"),z(t,"progress"),z(t,"display"),z(t,"mark"),t[bl]=function(){const{progress:l,width:n,height:o,direction:r,display:d,visibility:c,style:p,classes:m,borderStyle:b,textStyle:h,baseStyle:A,fillStyle:v,mark:_,id:N}=this;return{progress:l,width:n,height:o,direction:r,display:d,visibility:c,style:u(p),classes:m,borderStyle:b,textStyle:h,baseStyle:A,fillStyle:v,mark:_,id:N}},t})}var ys=Ae({props:{display:{type:Y(Object,String,Function),required:!0},visibility:{type:Y(Number),required:!0},style:Y(Object,String,Array),classes:Y(Object),onClick:Function,onHold:Function,canClick:{type:Y(Boolean),required:!0},small:Boolean,mark:Y(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:Jl,MarkNode:va},setup(e){const{display:t,onClick:l,onHold:n}=Bt(e),o=$t("");qt(()=>{const c=kt(t);if(c==null){o.value="";return}if(il(c)){o.value=Qe(c);return}const p=Qe(c.title||"","h3"),m=Qe(c.description,"div");o.value=Qe(B(()=>i("span",null,[c.title?i("div",null,[i(p,null,null)]):null,i(m,null,null)])))});const{start:r,stop:d}=Dn(l,n,e.isHolding);return{start:r,stop:d,comp:o,Visibility:bt,unref:u}}});function bs(e,t,l,n,o,r){var p;const d=gl("MarkNode"),c=gl("Node");return e.unref(e.visibility)!==e.Visibility.None?(k(),I("button",{key:0,style:yt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(p=e.unref(e.style))!=null?p:[]]),onClick:t[0]||(t[0]=(...m)=>e.onClick&&e.onClick(...m)),onMousedown:t[1]||(t[1]=(...m)=>e.start&&e.start(...m)),onMouseleave:t[2]||(t[2]=(...m)=>e.stop&&e.stop(...m)),onMouseup:t[3]||(t[3]=(...m)=>e.stop&&e.stop(...m)),onTouchstartPassive:t[4]||(t[4]=(...m)=>e.start&&e.start(...m)),onTouchendPassive:t[5]||(t[5]=(...m)=>e.stop&&e.stop(...m)),onTouchcancelPassive:t[6]||(t[6]=(...m)=>e.stop&&e.stop(...m)),class:ct({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(k(),ye(nt(e.unref(e.comp)),{key:0})):G("",!0),i(d,{mark:e.unref(e.mark)},null,8,["mark"]),i(c,{id:e.id},null,8,["id"])],38)):G("",!0)}var Pn=$e(ys,[["render",bs],["__scopeId","data-v-8cedd7da"]]);const ws=Symbol("Clickable");function Pt(e){return Ot(()=>{var l;const t=(l=e==null?void 0:e())!=null?l:{};if(t.id=Tl("clickable-"),t.type=ws,t[yl]=Pn,t.isHolding=V(!1),z(t,"visibility"),St(t,"visibility",bt.Visible),z(t,"canClick"),St(t,"canClick",!0),z(t,"classes"),z(t,"style"),z(t,"mark"),z(t,"display"),t.onClick){const n=t.onClick.bind(t);t.onClick=function(o){u(t.canClick)&&n(o)}}if(t.onHold){const n=t.onHold.bind(t);t.onHold=function(){u(t.canClick)&&n()}}return t[bl]=function(){const{display:n,visibility:o,style:r,classes:d,onClick:c,onHold:p,isHolding:m,canClick:b,small:h,mark:A,id:v}=this;return{display:n,visibility:o,style:u(r),classes:d,onClick:c,onHold:p,isHolding:m,canClick:b,small:h,mark:A,id:v}},t})}function dt(e,t="points",l=0,n=void 0){const o=ht(e)?e:Se(e);if(o.displayName=t,o.precision=l,o.small=n,!ht(e)){const r=o[$l];r.displayName=t,r.precision=l,r.small=n}return o}function Xa(e){const t=Se(e.value);return Xt(e,l=>{Ta.value||a.gt(l,t.value)&&(t.value=l)}),t}function As(e){const t=Se(e.value);return Xt(e,(l,n)=>{Ta.value||a.gt(l,n)&&(t.value=a.add(t.value,a.sub(l,n)))}),t}new a("10^^8");new a("1e100");function Kl(e,t){const l=t!=null?t:e.value;return a.eq(e.precision,0)?X(e.small?l:a.floor(l)):L(l,e.precision,e.small)}const Cs=["x1","y1","x2","y2"],ks=Ae({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const l=Bt(e),n=f(()=>{const r=l.startNode.value.rect,d=l.boundingRect.value,c=d?{x:r.x+r.width/2-d.x,y:r.y+r.height/2-d.y}:{x:0,y:0};return l.link.value.offsetStart&&(c.x+=l.link.value.offsetStart.x,c.y+=l.link.value.offsetStart.y),c}),o=f(()=>{const r=l.endNode.value.rect,d=l.boundingRect.value,c=d?{x:r.x+r.width/2-d.x,y:r.y+r.height/2-d.y}:{x:0,y:0};return l.link.value.offsetEnd&&(c.x+=l.link.value.offsetEnd.x,c.y+=l.link.value.offsetEnd.y),c});return(r,d)=>(k(),I("line",Sl({"stroke-width":"15px",stroke:"white"},e.link,{x1:u(n).x,y1:u(n).y,x2:u(o).x,y2:u(o).y}),null,16,Cs))}});const Es=Ae({__name:"Links",props:{links:null},setup(e){var p;const l=Yt(e,"links"),n=V(null),o=la(Ia,V({})),r=la(Da,V(void 0)),d=V((p=n.value)==null?void 0:p.getBoundingClientRect());Xt(r,()=>{var m;return d.value=(m=n.value)==null?void 0:m.getBoundingClientRect()}),ua(()=>{var m;return d.value=(m=n.value)==null?void 0:m.getBoundingClientRect()});const c=f(()=>{var b,h;const m=o.value;return(h=(b=l.value)==null?void 0:b.filter(A=>{var v,_;return((v=m[A.startNode.id])==null?void 0:v.rect)&&((_=m[A.startNode.id])==null?void 0:_.rect)}))!=null?h:[]});return(m,b)=>(k(),I(S,null,[u(c)?(k(),I("svg",ii(Sl({key:0},m.$attrs)),[(k(!0),I(S,null,un(u(c),(h,A)=>(k(),ye(ks,{key:A,link:h,boundingRect:d.value,startNode:u(o)[h.startNode.id],endNode:u(o)[h.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):G("",!0),g("div",{ref_key:"resizeListener",ref:n,class:"resize-listener"},null,512)],64))}});var _s=$e(Es,[["__scopeId","data-v-063f6d6b"]]);Ae({props:{nodes:{type:Y(Array),required:!0},leftSideNodes:Y(Array),rightSideNodes:Y(Array),branches:Y(Array)},components:{Links:_s},setup(e){const{nodes:t,leftSideNodes:l,rightSideNodes:n}=Bt(e),o=$t();qt(()=>{const c=kt(t);o.value=Qe(B(()=>i(S,null,[c.map(p=>i("span",{class:"row tree-row",style:"margin: 50px auto;"},[p.map(zt)]))])))});const r=$t();qt(()=>{const c=kt(l);r.value=c?Qe(B(()=>i("span",{class:"left-side-nodes small"},[c.map(zt)]))):""});const d=$t();return qt(()=>{const c=kt(n);d.value=c?Qe(B(()=>i("span",{class:"side-nodes small"},[c.map(zt)]))):""}),{unref:u,nodesComp:o,leftNodesComp:r,rightNodesComp:d}}});Ae({props:{display:Y(Object,String,Function),visibility:{type:Y(Number),required:!0},style:Y(String,Object,Array),classes:Y(Object),onClick:Function,onHold:Function,color:Y(String),glowColor:Y(String),canClick:{type:Y(Boolean),required:!0},mark:Y(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:va,Node:Jl},setup(e){const{onClick:t,onHold:l,display:n}=Bt(e),o=hl(n),{start:r,stop:d}=Dn(t,l);return{start:r,stop:d,comp:o,unref:u,Visibility:bt,isCoercableComponent:il}}});function Zt(e){const t=[],l={};let n=!1;function o(){return n||(t.push(...e()),l.base=t.map(c=>Et(c.base)),l.baseText=t.map(c=>Et(c.baseText)),l.visible=t.map(c=>Et(c.visible)),n=!0),t}const r=Se({});return[B(()=>{const c=o();let p=!0;const m=c.map((b,h)=>{var N,D,H;if(u(l.visible[h])===!1)return null;const A=i("h3",{onClick:()=>r.value[h]=!r.value[h],style:"cursor: pointer"},[i("span",{class:"modifier-toggle"+(u(r.value[h])?" collapsed":"")},[s("\u25BC")]),b.title,b.subtitle?i("span",{class:"subtitle"},[s(" ("),b.subtitle,s(")")]):null]),v=u(r.value[h])?null:i(S,null,[i("div",{class:"modifier-container"},[i("span",{class:"modifier-description"},[zt((N=u(l.baseText[h]))!=null?N:"Base")]),i("span",{class:"modifier-amount"},[L((D=u(l.base[h]))!=null?D:1),b.unit])]),zt(u(b.modifier.description))]),_=!p;return p=!1,i(S,null,[_?i("br",null,null):null,i("div",null,[A,i("br",null,null),v,i("hr",null,null),i("div",{class:"modifier-container"},[i("span",{class:"modifier-description"},[s("Total")]),i("span",{class:"modifier-amount"},[L(b.modifier.apply((H=u(l.base[h]))!=null?H:1)),b.unit])])])])});return i(S,null,[m])}),r]}function Hl(e){const t=Object.values(e).reverse(),l=Se(!0),n=f(()=>t.filter(p=>p.earned.value===!1)),{firstFeature:o,collapsedContent:r,hasCollapsedContent:d}=Oo(t,p=>p.earned.value),c=B(()=>{const p=[...n.value];return o.value&&p.push(o.value),Ro(...p,B(()=>da(i(rs,{collapsed:l,content:r,display:l.value?"Show other completed milestones":"Hide other completed milestones"},null),[[sn,u(d)]])))});return{collapseMilestones:l,display:c}}function rl(e){const t=e.ignoreTotal?e.resource:As(e.resource),l=()=>{var c,p;if(R.day.value!==e.day)return 1;let r=a.add(t.value,1),d=e.goal;return((p=(c=e.usingLog)==null?void 0:c.value)!=null?p:de.usingLog)&&(r=r.log10(),d=a.log10(d)),a.div(r,d)},n=Ht(()=>({direction:Pe.Right,width:600,height:25,fillStyle:{backgroundColor:e.color},textStyle:e.textColor?{color:e.textColor}:void 0,progress:l,display:B(()=>R.day.value===e.day?i(S,null,[we(t.value),s("/"),we(e.goal)]):"")})),o=B(()=>i(S,null,[i("div",null,[R.day.value===e.day?i(S,null,[s("Reach "),we(e.goal),s(" "),e.ignoreTotal?"":"total ",e.resource.displayName,s(" to complete the day")]):i(S,null,[e.name,s(" Complete!")]),e.modal?i(S,null,[" ",s("-")," ",i("button",{class:"button",style:"display: inline-block;",onClick:()=>e.modal.show.value=!0},[s("Check Modifiers")])]):void 0]),se(n),e.modal?se(e.modal.display):void 0]));return qt(()=>{R.day.value===e.day&&a.gte(t.value,e.goal)&&R.completeDay()}),{total:t,trackerDisplay:o}}function Kt(e){var d;const t=(d=e.style)!=null?d:{minHeight:"20px",width:"40px",color:"var(--foreground)"},l=Pt(()=>({display:"0",style:t,canClick(){return a.gt(e.active.value,0)},onClick(){e.active.value=0}})),n=Pt(()=>({display:"-",style:t,canClick(){return a.gt(e.active.value,0)},onClick(){e.active.value=a.sub(e.active.value,1)}})),o=Pt(()=>({display:"+",style:t,canClick(){return a.lt(e.active.value,e.buyable.amount.value)},onClick(){e.active.value=a.add(e.active.value,1)}})),r=Pt(()=>({display:"Max",style:t,canClick(){return a.lt(e.active.value,e.buyable.amount.value)},onClick(){e.active.value=e.buyable.amount.value}}));return{min:l,remove:n,add:o,max:r}}const Ss=Symbol("Buyable");function Re(e){const t=Se(0);return Ot(()=>{var r,d,c;const l=e();if(l.canPurchase==null&&(l.resource==null||l.cost==null))throw console.warn("Cannot create buyable without a canPurchase property or a resource and cost property",l),"Cannot create buyable without a canPurchase property or a resource and cost property";l.id=Tl("buyable-"),l.type=Ss,l[yl]=Pn,l.amount=t,l.amount[fl]=(r=l.initialValue)!=null?r:0,l.canAfford=f(()=>{const p=l,m=u(p.cost);return p.resource!=null&&m!=null&&a.gte(p.resource.value,m)}),l.canPurchase==null&&(l.canPurchase=f(()=>u(l.visibility)===bt.Visible&&u(l.canAfford)&&a.lt(l.amount.value,u(l.purchaseLimit)))),l.maxed=f(()=>a.gte(l.amount.value,u(l.purchaseLimit))),z(l,"classes");const n=l.classes;l.classes=f(()=>{const p=u(n)||{};return l.maxed.value&&(p.bought=!0),p}),z(l,"canPurchase"),l.canClick=l.canPurchase,l.onClick=l.purchase=(c=(d=l.onClick)!=null?d:l.purchase)!=null?c:function(){var b;const p=l;if(!u(p.canPurchase))return;const m=u(p.cost);p.cost!=null&&p.resource!=null&&(p.resource.value=a.sub(p.resource.value,m),p.amount.value=a.add(p.amount.value,1)),(b=p.onPurchase)==null||b.call(p,m)},z(l,"display");const o=l.display;return l.display=B(()=>{const p=u(o);if(il(p)){const m=Qe(p);return i(m,null,null)}if(p!=null&&l.cost!=null&&l.resource!=null){const m=l,b=Qe(p.title||"","h3"),h=Qe(p.description||""),A=Qe(p.effectDisplay||"");return i("span",null,[p.title?i("div",null,[i(b,null,null)]):null,p.description?i(h,null,null):null,p.showAmount===!1?null:i("div",null,[i("br",null,null),u(m.purchaseLimit)===a.dInf?i(S,null,[s("Amount: "),X(m.amount.value)]):i(S,null,[s("Amount: "),X(m.amount.value),s(" /")," ",X(u(m.purchaseLimit))])]),p.effectDisplay?i("div",null,[i("br",null,null),s("Currently: "),i(A,null,null)]):null,m.cost&&!m.maxed.value?i("div",null,[s("Cost: "),L(u(m.cost)||0)," ",l.resource.displayName]):null])}return""}),z(l,"visibility"),St(l,"visibility",bt.Visible),z(l,"cost"),z(l,"resource"),z(l,"purchaseLimit"),St(l,"purchaseLimit",a.dInf),z(l,"style"),z(l,"mark"),z(l,"small"),l[bl]=function(){const{display:p,visibility:m,style:b,classes:h,onClick:A,canClick:v,small:_,mark:N,id:D}=this;return{display:p,visibility:m,style:u(b),classes:h,onClick:A,canClick:v,small:_,mark:N,id:D}},l})}const fa=pa({}),Ua=Symbol("Hotkey");function Dl(e){return Ot(()=>{const t=e();return t.type=Ua,z(t,"enabled"),St(t,"enabled",!0),z(t,"description"),t})}Xe.on("addLayer",e=>{An(e,Ua).forEach(t=>{fa[t.key]=t})});Xe.on("removeLayer",e=>{An(e,Ua).forEach(t=>{fa[t.key]=void 0})});document.onkeydown=function(e){var n;if(((n=e.target)==null?void 0:n.tagName)==="INPUT"||qa.value&&!de.keepGoing)return;let t=e.key;e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const l=fa[t];l&&u(l.enabled)&&(e.preventDefault(),l.onPress())};Po(B(()=>{const e=Object.values(fa).filter(t=>u(t==null?void 0:t.enabled));return e.length===0?"":i("div",null,[i("br",null,null),i("h4",null,[s("Hotkeys")]),e.map(t=>i("div",null,[t==null?void 0:t.key,s(": "),t==null?void 0:t.description]))])}));const Bs=Ae({__name:"Sticky",setup(e){const t=V("0"),l=new ResizeObserver(o),n=$t(null);function o(){let r=n.value;if(r==null)return;let d=0;for(;r.previousSibling;){const c=r.previousSibling;c.dataset&&"vSticky"in c.dataset&&(d+=c.offsetHeight),r=c}t.value=d+"px"}return _l(o),document.fonts.ready.then(o),ua(()=>{var d;const r=(d=n.value)==null?void 0:d.parentElement;r&&l.observe(r)}),(r,d)=>(k(),I("div",{class:"sticky",style:yt({top:t.value}),ref_key:"element",ref:n,"data-v-sticky":""},[Qt(r.$slots,"default",{},void 0,!0)],4))}});var Ms=$e(Bs,[["__scopeId","data-v-cccac690"]]);const Ya=Ae({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,l=f(()=>Kl(t.resource));return(n,o)=>(k(),I("h2",{style:yt({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},Ne(u(l)),5))}});const Ns={class:"main-display"},xs={key:0},Is={key:1},Ds=s(", "),Ps={key:2},Ts=g("br",null,null,-1),Fs={class:"main-display"},Us={key:0},Rs={key:1},Os=s(", "),qs={key:2},Gs=g("br",null,null,-1),Tt=Ae({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null,productionDisplay:null,sticky:{type:Boolean,default:!0}},setup(e){const l=Bt(e),n=V(null),o=hl(l.effectDisplay),r=V(null),d=hl(l.productionDisplay),c=f(()=>a.lt(l.resource.value,"1e1000"));return(p,m)=>{var b,h;return e.sticky?(k(),ye(Ms,{key:0},{default:pe(()=>{var A,v,_,N;return[g("div",{class:ct(["main-display-container",(A=e.classes)!=null?A:{}]),style:yt([{"min-height":`${((_=(v=n.value)==null?void 0:v.$el.clientHeight)!=null?_:0)+50}px`},(N=e.style)!=null?N:{}])},[g("div",Ns,[u(c)?(k(),I("span",xs,"You have ")):G("",!0),i(Ya,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),s(" "+Ne(e.resource.displayName),1),u(o)?(k(),I("span",Is,[Ds,(k(),ye(nt(u(o)),{ref_key:"effectRef",ref:n},null,512))])):G("",!0),u(d)?(k(),I("span",Ps,[Ts,(k(),ye(nt(u(d)),{ref_key:"productionRef",ref:r},null,512))])):G("",!0)])],6)]}),_:1})):(k(),I("div",{key:1,class:ct(["main-display-container",(b=e.classes)!=null?b:{}]),style:yt([{"min-height":"50px"},(h=e.style)!=null?h:{}])},[g("div",Fs,[u(c)?(k(),I("span",Us,"You have ")):G("",!0),i(Ya,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),s(" "+Ne(e.resource.displayName),1),u(o)?(k(),I("span",Rs,[Os,(k(),ye(nt(u(o)),{ref_key:"effectRef",ref:n},null,512))])):G("",!0),u(d)?(k(),I("span",qs,[Gs,(k(),ye(nt(u(d)),{ref_key:"productionRef",ref:r},null,512))])):G("",!0)])],6))}}});var Ls=Ae({props:{display:{type:Y(String,Object,Function),required:!0},visibility:{type:Y(Number),required:!0},style:Y(String,Object,Array),classes:Y(Object),resource:Object,cost:Y(String,Object,Number),canPurchase:{type:Y(Boolean),required:!0},bought:{type:Y(Boolean),required:!0},mark:Y(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Jl,MarkNode:va},setup(e){const{display:t,cost:l}=Bt(e),n=$t("");return qt(()=>{const o=kt(t);if(o==null){n.value="";return}if(il(o)){n.value=Qe(o);return}const r=kt(l),d=Qe(o.title||"","h3"),c=Qe(o.description,"div"),p=Qe(o.effectDisplay||"");n.value=Qe(B(()=>{var m;return i("span",null,[o.title?i("div",null,[i(d,null,null)]):null,i(c,null,null),o.effectDisplay?i("div",null,[s("Currently: "),i(p,null,null)]):null,e.resource!=null&&o.showCost!==!1?i(S,null,[i("br",null,null),s("Cost: "),e.resource&&Kl(e.resource,r)," ",(m=e.resource)==null?void 0:m.displayName]):null])}))}),{component:n,unref:u,Visibility:bt}}});const Qs=["disabled"];function $s(e,t,l,n,o,r){var p;const d=gl("MarkNode"),c=gl("Node");return e.unref(e.visibility)!==e.Visibility.None?(k(),I("button",{key:0,style:yt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(p=e.unref(e.style))!=null?p:{}]),onClick:t[0]||(t[0]=(...m)=>e.purchase&&e.purchase(...m)),class:ct({feature:!0,upgrade:!0,can:e.unref(e.canPurchase),locked:!e.unref(e.canPurchase),bought:e.unref(e.bought),...e.unref(e.classes)}),disabled:!e.unref(e.canPurchase)},[e.unref(e.component)?(k(),ye(nt(e.unref(e.component)),{key:0})):G("",!0),i(d,{mark:e.unref(e.mark)},null,8,["mark"]),i(c,{id:e.id},null,8,["id"])],14,Qs)):G("",!0)}var Vs=$e(Ls,[["render",$s],["__scopeId","data-v-7f411ac8"]]);const Hs=Symbol("Upgrade");function O(e){const t=Se(!1);return Ot(()=>{const l=e();return l.id=Tl("upgrade-"),l.type=Hs,l[yl]=Vs,l.canAfford==null&&(l.resource==null||l.cost==null)&&console.warn("Error: can't create upgrade without a canAfford property or a resource and cost property",l),l.bought=t,l.canAfford==null?l.canAfford=f(()=>{const n=l;return n.resource!=null&&n.cost!=null&&a.gte(n.resource.value,u(n.cost))}):z(l,"canAfford"),l.canPurchase=f(()=>u(l.visibility)===bt.Visible&&u(l.canAfford)&&!u(l.bought)),l.purchase=function(){var o;const n=l;!u(n.canPurchase)||(n.resource!=null&&n.cost!=null&&(n.resource.value=a.sub(n.resource.value,u(n.cost))),t.value=!0,(o=n.onPurchase)==null||o.call(n))},z(l,"visibility"),St(l,"visibility",bt.Visible),z(l,"classes"),z(l,"style"),z(l,"display"),z(l,"mark"),z(l,"cost"),z(l,"resource"),l[bl]=function(){const{display:n,visibility:o,style:r,classes:d,resource:c,cost:p,canPurchase:m,bought:b,mark:h,id:A,purchase:v}=this;return{display:n,visibility:o,style:u(r),classes:d,resource:c,cost:p,canPurchase:m,bought:b,mark:h,id:A,purchase:v}},l})}function ce(e){return Ot(()=>{const{addend:t,description:l,enabled:n}=e(),o=Et(t),r=Et(l),d=n==null?void 0:Et(n);return{apply:c=>a.add(c,u(o)),revert:c=>a.sub(c,u(o)),enabled:d,description:l==null?void 0:B(()=>i("div",{class:"modifier-container"},[u(r)?i("span",{class:"modifier-description"},[zt(u(r))]):null,i("span",{class:"modifier-amount"},[a.gte(u(o),0)?"+":"",L(u(o))])]))}})}function w(e){return Ot(()=>{const{multiplier:t,description:l,enabled:n}=e(),o=Et(t),r=Et(l),d=n==null?void 0:Et(n);return{apply:c=>a.times(c,u(o)),revert:c=>a.div(c,u(o)),enabled:d,description:l==null?void 0:B(()=>i("div",{class:"modifier-container"},[u(r)?i("span",{class:"modifier-description"},[zt(u(r))]):null,i("span",{class:"modifier-amount"},[s("\xD7"),L(u(o))])]))}})}function ra(e){return Ot(()=>{const{exponent:t,description:l,enabled:n,supportLowNumbers:o}=e(),r=Et(t),d=Et(l),c=n==null?void 0:Et(n);return{apply:p=>{let m=p;return o&&(m=a.add(m,1)),m=a.pow(m,u(r)),o&&(m=a.sub(m,1)),m},revert:p=>{let m=p;return o&&(m=a.add(m,1)),m=a.root(m,u(r)),o&&(m=a.sub(m,1)),m},enabled:c,description:l==null?void 0:B(()=>i("div",{class:"modifier-container"},[u(d)?i("span",{class:"modifier-description"},[zt(u(d)),o?" (+1 effective)":null]):null,i("span",{class:"modifier-amount"},[s("^"),L(u(r))])]))}})}function le(e){return Ot(()=>{const t=e();return{apply:l=>t.filter(n=>u(n.enabled)!==!1).reduce((n,o)=>o.apply(n),l),revert:t.every(l=>l.revert!=null)?l=>t.filter(n=>u(n.enabled)!==!1).reduceRight((n,o)=>o.revert(n),l):void 0,enabled:f(()=>t.filter(l=>u(l.enabled)!==!1).length>0),description:B(()=>i(S,null,[t.filter(l=>u(l.enabled)!==!1).map(l=>u(l.description)).filter(l=>l).map(zt)]))}})}function Tn(e){return Ot(()=>{const t=e();return t.currentGain==null&&(t.currentGain=f(()=>{let l=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return l=a.floor(l).max(0),u(t.buyMax)||(l=l.min(1)),l})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=f(()=>{let l=t.scaling.currentAt(t);return t.roundUpCost&&(l=a.ceil(l)),l})),t.nextAt==null&&(t.nextAt=f(()=>{let l=t.scaling.nextAt(t);return t.roundUpCost&&(l=a.ceil(l)),l})),t.convert==null&&(t.convert=function(){var o;const l=u(t.currentGain),n=u(t.currentAt);t.gainResource.value=a.add(t.gainResource.value,l),t.spend(l,n),(o=t.onConvert)==null||o.call(t,l)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),z(t,"currentGain"),z(t,"actualGain"),z(t,"currentAt"),z(t,"nextAt"),z(t,"buyMax"),St(t,"buyMax",!0),z(t,"roundUpCost"),St(t,"roundUpCost",!0),t})}function Ra(e,t){const l=Et(e),n=Et(t);return{currentGain(o){let r=u(o.baseResource.value);if(o.costModifier&&(r=o.costModifier.apply(r)),a.lt(r,u(l)))return 0;const d=a.div(r,u(l)).pow(u(n));return d.isNan()?new a(0):d},currentAt(o){let r=u(o.currentGain);return o.gainModifier&&(r=o.gainModifier.revert(r)),r=a.max(0,r).root(u(n)).times(u(l)),o.costModifier&&(r=o.costModifier.revert(r)),r},nextAt(o){let r=a.add(u(o.currentGain),1).floor();return o.gainModifier&&(r=o.gainModifier.revert(r)),r=a.max(0,r).root(u(n)).times(u(l)).max(u(l)),o.costModifier&&(r=o.costModifier.revert(r)),r}}}function Fn(e){return Tn(e)}function js(e){return Tn(()=>{const t=e();return St(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=f(()=>{let l=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return l=a.floor(l).max(t.gainResource.value),u(t.buyMax)||(l=l.min(a.add(t.gainResource.value,1))),l})),t.actualGain==null&&(t.actualGain=f(()=>{let l=a.sub(a.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return u(t.buyMax)||(l=l.min(1)),l})),St(t,"convert",function(){var o;const l=u(t.actualGain),n=u(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(u(t.currentGain)):u(t.currentGain),t.spend(l,n),(o=t.onConvert)==null||o.call(t,l)}),t})}const Ws={},Js={style:{"white-space":"nowrap"}},Ks=g("span",{style:{"font-size":"larger","font-family":"initial"}},"\u221A",-1),zs={style:{display:"inline-block","border-top":"1px solid","padding-left":".2em"}};function Xs(e,t){return k(),I("span",Js,[Ks,g("div",zs,[Qt(e.$slots,"default")])])}var pl=$e(Ws,[["render",Xs]]);const Ys={},Zs={class:"fraction"};function er(e,t){return k(),I("div",Zs,[Qt(e.$slots,"default")])}var tr=$e(Ys,[["render",er]]);const lr={class:"field"},ar={key:0,class:"field-title"},Oa=Ae({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var d;const l=e,n=hl(Yt(l,"title"),"span"),o=V((d=l.options.find(c=>c.value===l.modelValue))!=null?d:null);Xt(Yt(l,"modelValue"),c=>{var p;kt(o)!==c&&(o.value=(p=l.options.find(m=>m.value===c))!=null?p:null)});function r(c){t("update:modelValue",c.value)}return(c,p)=>(k(),I("div",lr,[u(n)?(k(),I("span",ar,[(k(),ye(nt(u(n))))])):G("",!0),i(u(di),{options:e.options,modelValue:o.value,"onUpdate:modelValue":[p[0]||(p[0]=m=>o.value=m),r],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var nr=Ae({props:{visibility:{type:Y(Number),required:!0},display:{type:Y(String,Object,Function),required:!0},style:Y(String,Object,Array),classes:Y(Object),earned:{type:Y(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:Jl},setup(e){const{display:t}=Bt(e),l=$t("");return qt(()=>{const n=kt(t);if(n==null){l.value="";return}if(il(n)){l.value=Qe(n);return}const o=Qe(n.requirement,"h3"),r=Qe(n.effectDisplay||"","b"),d=Qe(n.optionsDisplay||"","span");l.value=Qe(B(()=>i("span",null,[i(o,null,null),n.effectDisplay?i("div",null,[i(r,null,null)]):null,n.optionsDisplay?i("div",{class:"equal-spaced"},[i(d,null,null)]):null])))}),{comp:l,unref:u,Visibility:bt}}});function ir(e,t,l,n,o,r){var c;const d=gl("Node");return e.unref(e.visibility)!==e.Visibility.None?(k(),I("div",{key:0,style:yt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:ct({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(k(),ye(nt(e.unref(e.comp)))),i(d,{id:e.id},null,8,["id"])],6)):G("",!0)}var or=$e(nr,[["render",ir],["__scopeId","data-v-f4e8794e"]]);Xe.on("setupVue",e=>e.use(ci));const Za=cn(),sr=Symbol("Milestone");let vl;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(vl||(vl={}));function P(e){const t=Se(!1);return Ot(()=>{var o;const l=(o=e==null?void 0:e())!=null?o:{};l.id=Tl("milestone-"),l.type=sr,l[yl]=or,l.earned=t,l.complete=function(){var d;const r=l;if(t.value=!0,(d=r.onComplete)==null||d.call(r),r.display&&u(r.showPopups)===!0){const c=u(r.display),p=Qe(il(c)?c:c.requirement);Za(i(S,null,[i("h3",null,[s("Milestone earned!")]),i("div",null,[i(p,null,null)])]))}},z(l,"visibility"),St(l,"visibility",bt.Visible);const n=l.visibility;if(l.visibility=f(()=>{const r=u(l.display);switch(at.msDisplay){default:case vl.All:return u(n);case vl.Configurable:return u(l.earned)&&!(r!=null&&typeof r=="object"&&"optionsDisplay"in r)?bt.None:u(n);case vl.Incomplete:return u(l.earned)?bt.None:u(n);case vl.None:return bt.None}}),z(l,"style"),z(l,"classes"),z(l,"display"),z(l,"showPopups"),l[bl]=function(){const{visibility:r,display:d,style:c,classes:p,earned:m,id:b}=this;return{visibility:r,display:d,style:u(c),classes:p,earned:m,id:b}},l.shouldEarn){const r=l;qt(()=>{var d,c;if(at.active===de.id&&!r.earned.value&&u(r.visibility)===bt.Visible&&((d=r.shouldEarn)==null?void 0:d.call(r))&&(r.earned.value=!0,(c=r.onComplete)==null||c.call(r),r.display&&u(r.showPopups)===!0)){const p=u(r.display),m=Qe(il(p)?p:p.requirement);Za(i(S,null,[i("h3",null,[s("Milestone earned!")]),i("div",null,[i(m,null,null)])]))}})}return l})}Xe.on("loadSettings",e=>{St(e,"msDisplay",vl.All)});const rr=Object.values(vl).map(e=>({label:wn(e),value:e}));Do(B(()=>i(Oa,{title:"Show Milestones",options:rr,"onUpdate:modelValue":e=>at.msDisplay=e,modelValue:at.msDisplay},null)));const ur={class:"field"},dr=Ae({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,n=f(()=>Qe(u(l.title)||"<span></span>","span")),o=f({get(){return!!l.modelValue},set(r){t("update:modelValue",r)}});return(r,d)=>(k(),I("label",ur,[da(g("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":d[0]||(d[0]=c=>ht(o)?o.value=c:null)},null,512),[[oi,u(o)]]),(k(),ye(nt(u(n))))]))}});var nl=$e(dr,[["__scopeId","data-v-33d57459"]]);const cr=Symbol("Reset");function pr(e){return Ot(()=>{const t=e();return t.id=Tl("reset-"),t.type=cr,t.reset=function(){var n;const l=o=>{if(o&&typeof o=="object")if(fl in o){const r=o;r.value=r[fl]}else!(o instanceof a)&&!ht(o)&&Object.values(o).forEach(r=>l(r))};u(t.thingsToReset).forEach(l),Xe.emit("reset",t),(n=t.onReset)==null||n.call(t)},z(t,"thingsToReset"),t})}const ea={};Xe.on("removeLayer",e=>{var t;(t=ea[e.id])==null||t.call(ea),ea[e.id]=void 0});const mr="plastic",en=10,He=Rt(mr,function(){const e="Plastic",t="#DCD9CD",l=dt(0,"plastic"),[n,o]=Zt(()=>[{title:"Plastic Gain",modifier:Be,base:0}]),r=V(!1),d=B(()=>i(wt,{modelValue:r.value,"onUpdate:modelValue":ke=>r.value=ke},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:n})),c=Se(0),p=f(()=>a.times(c.value,100)),m=Re(()=>({resource:lt.metal,cost(){const ke=new a(this.amount.value);return a.pow(1.2,ke).times(1e7)},display:B(()=>i(S,null,[i("h3",null,[s("Refinery")]),i("br",null,null),s("Refines oil into plastic pellets"),i("br",null,null),s("Consumes 100 oil/s to create 1 plastic/s"),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("-"),L(p.value),s(" oil/sec"),i("br",null,null),s("+"),L(c.value),s(" plastic/sec"),i("br",null,null),i("br",null,null),s("Cost: "),X(u(m.cost))," ",m.resource.displayName])),onPurchase(){c.value=a.add(c.value,1)},style:{width:"300px"}})),{min:b,max:h,add:A,remove:v}=Kt({buyable:m,active:c,style:{minHeight:"20px",width:"40px",color:"var(--feature-foreground)"}}),_=f(()=>a.pow(5,a.add([...Object.values(M),...Object.values(fe)].filter(ke=>ke.bought.value).length,2))),N=O(()=>({resource:U(l),cost:_,display:()=>({title:"Plastic Scissors",description:"Unlock paper upgrades",showCost:!N.bought.value})})),D=O(()=>({resource:U(l),cost:_,display:()=>({title:"Plastic Level",description:"Unlock box upgrades",showCost:!D.bought.value})})),H=O(()=>({resource:U(l),cost:_,display:()=>({title:"Plastic Cane",description:"Unlock cloth upgrades",showCost:!H.bought.value})})),M={paperTools:N,boxTools:D,clothTools:H},E=O(()=>({resource:U(l),cost:_,visibility:()=>y(N.bought.value),display:()=>({title:"Paper Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!E.bought.value})})),T=O(()=>({resource:U(l),cost:_,visibility:()=>y(D.bought.value),display:()=>({title:"Box Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!T.bought.value})})),J=O(()=>({resource:U(l),cost:_,visibility:()=>y(H.bought.value),display:()=>({title:"Cloth Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!J.bought.value})})),fe={paperElf:E,boxElf:T,clothElf:J},Q=Re(()=>({resource:U(l),cost(){const ke=this.amount.value;return a.pow(1.3,ke).times(100)},visibility:()=>y(E.bought.value),display:{title:"Plastic Printing Press",description:"Gain +1% of your paper gain per second",effectDisplay:B(()=>i(S,null,[X(Q.amount.value),s("%")])),showAmount:!1}})),me=Re(()=>({resource:U(l),cost(){const ke=this.amount.value;return a.pow(1.3,ke).times(100)},visibility:()=>y(T.bought.value),display:{title:"Plastic Box Folder",description:"Gain +1% of your box gain per second",effectDisplay:B(()=>i(S,null,[X(me.amount.value),s("%")])),showAmount:!1}})),ne=Re(()=>({resource:U(l),cost(){const ke=this.amount.value;return a.pow(1.3,ke).times(100)},visibility:()=>y(J.bought.value),display:{title:"Plastic Shepherd",description:"All cloth actions are +10% more efficient",effectDisplay:B(()=>i(S,null,[X(a.times(ne.amount.value,10)),s("%")])),showAmount:!1}})),Ge={passivePaper:Q,passiveBoxes:me,clothGains:ne},Be=le(()=>[ce(()=>({addend:c,description:"Oil Refinery",enabled:()=>a.gt(c.value,0)})),w(()=>({multiplier:2,description:"Paper Elf Recruitment",enabled:E.bought})),w(()=>({multiplier:2,description:"Box Elf Recruitment",enabled:T.bought})),w(()=>({multiplier:2,description:"Cloth Elf Recruitment",enabled:J.bought})),w(()=>({multiplier:2,description:"Carry plastic in boxes",enabled:et.row2Upgrades.plasticUpgrade.bought})),w(()=>({multiplier:()=>Ze.oilEffectiveness.value,description:"Effectiveness",enabled:()=>a.lt(Ze.oilEffectiveness.value,1)})),w(()=>({multiplier:qe.boosts.yellow1,description:"Yellow Dye Boost 1",enabled:()=>a.gte(qe.dyes.yellow.amount.value,1)}))]),K=f(()=>Be.apply(0));Xe.on("update",ke=>{a.lt(R.day.value,en)||(l.value=a.times(ke,K.value).add(l.value))});const{total:Ce,trackerDisplay:Le}=rl({resource:l,goal:25e4,name:e,day:en,color:t,textColor:"var(--feature-foreground)",modal:{show:r,display:d}});return{name:e,color:t,plastic:l,totalPlastic:Ce,buildRefinery:m,activeRefinery:c,oilCost:p,upgrades:M,elfUpgrades:fe,buyables:Ge,generalTabCollapsed:o,minWidth:700,display:B(()=>i(S,null,[se(Le),i(_e,null,null),i(Tt,{resource:l,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(K.value,0)?`+${L(K.value)}/s`:void 0},null),i(_e,null,null),i(Ut,null,{default:()=>[se(m),i("div",null,[X(a.floor(c.value)),s("/"),X(a.floor(m.amount.value))]),Ye(b,v,A,h)]}),i(Pl,null,{default:()=>[Vt(N,E,Q),Vt(D,T,me),Vt(H,J,ne)]})]))}}),vr="paper",Ca=5,te=Rt(vr,function(){const e="Paper",t="#E8DCB8",l=dt(0,"paper"),n=dt(f(()=>a.min(a.div(ve.logs.value,1e9),a.div(q.ash.value,Be.value))),"pulp"),o=Fn(()=>({scaling:Ra(1,1.2),baseResource:n,gainResource:U(l),roundUpCost:!0,spend(W,ge){ve.logs.value=a.sub(ve.logs.value,a.times(ge,1e9)),q.ash.value=a.sub(q.ash.value,a.times(ge,Be.value))},gainModifier:ne})),r=Pt(()=>({display:B(()=>{const W=a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value;return i(S,null,[i("span",{style:"font-size: large"},[s("Create "),X(o.currentGain.value),s(" "),l.displayName]),i("br",null,null),i("span",{style:"font-size: large"},[s("Cost: "),Kl(ve.logs,W),s(" "),n.displayName,s(" ("),X(a.times(W,1e9)),s(" "),ve.logs.displayName,s(";")," ",X(a.times(W,Be.value)),s(" "),q.ash.displayName,s(")")])])}),canClick:()=>a.gte(o.actualGain.value,1),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"}));function d(W){const ge=Re(()=>({...W,display:{title:W.name,description:`Print a copy of "${W.name}", which ${W.elfName} will use to improve their skills! Each copy printed will reduce the "${W.buyableName}" price scaling by 0.95x and make ${W.elfName} purchase +10% faster!`,effectDisplay:B(()=>i(S,null,[L(a.pow(.95,ge.amount.value)),s("x price scaling,")," ",L(a.div(ge.amount.value,10).add(1)),s("x auto-purchase speed")])),showAmount:!1},resource:U(l),cost(){let oe=this.amount.value;(W.elfName==="Star"||W.elfName==="Bell")&&(oe=a.pow(oe,2)),a.gte(oe,100)&&(oe=a.pow(oe,2).div(100)),a.gte(oe,1e4)&&(oe=a.pow(oe,2).div(1e4)),oe=a.pow(.95,D.amount.value).times(oe);let We=5;Oe.elfTraining.paperElfTraining.milestones[0].earned.value&&We--;let Je=a.pow(We,oe).times(10);return Oe.elfTraining.paperElfTraining.milestones[0].earned.value&&(Je=a.div(Je,T.value.max(1))),Je},style:"width: 600px"}));return ge}const c=d({name:"Now You're Logging!",elfName:"Holly",buyableName:"Generic Cutters"}),p=d({name:"The Man Who Planted Trees",elfName:"Ivy",buyableName:"Generic Planters"}),m=d({name:"Logjam",elfName:"Hope",buyableName:"Expand Forest"}),b=d({name:"Fahrenheit 451",elfName:"Jack",buyableName:"Heated Cutters"}),h=d({name:"Tillamook Burn Country",elfName:"Mary",buyableName:"Heated Planters"}),A=d({name:"The Garden Tree's Handbook",elfName:"Noel",buyableName:"Fertilized Soil"}),v=d({name:"Firestarter",elfName:"Joy",buyableName:"Small Fire",visibility:()=>y(Me.elves.smallFireElf.bought.value)}),_=d({name:"An Arsonist's Guide to Writer's Homes in New England",elfName:"Faith",buyableName:"Bonfire",visibility:()=>y(Me.elves.bonfireElf.bought.value)}),N=d({name:"Little Fires Everywhere",elfName:"Snowball",buyableName:"Kiln",visibility:()=>y(Me.elves.kilnElf.bought.value)}),D=d({name:"The Book Thief",elfName:"Star",buyableName:"Paper Buyables",visibility:()=>y(Me.elves.paperElf.bought.value)}),H=d({name:"Not a box",elfName:"Bell",buyableName:"Box Buyables",visibility:()=>y(Me.elves.boxElf.bought.value)}),M=d({name:"Fuzzy Bee and Friends",elfName:"Gingersnap",buyableName:"Cloth Buyables",visibility:()=>y(Me.elves.clothElf.bought.value)}),E={cuttersBook:c,plantersBook:p,expandersBook:m,heatedCuttersBook:b,heatedPlantersBook:h,fertilizerBook:A,smallFireBook:v,bonfireBook:_,kilnBook:N,paperBook:D,boxBook:H,clothBook:M},T=f(()=>Object.values(E).reduce((W,ge)=>W.add(ge.amount.value),new a(0))),J=O(()=>({resource:U(l),cost:1e8,visibility:()=>y(He.upgrades.paperTools.bought.value),display:{title:"Shepherding for Dummies",description:"Double effectiveness of all cloth actions"}})),fe=O(()=>({resource:U(l),cost:1e9,visibility:()=>y(He.upgrades.paperTools.bought.value),display:{title:"Guide to drilling",description:"Double drilling power"}})),Q=O(()=>({resource:U(l),cost:1e10,visibility:()=>y(He.upgrades.paperTools.bought.value),display:{title:"Oil and where to find it",description:"Double oil gain"}})),me={clothUpgrade:J,drillingUpgrade:fe,oilUpgrade:Q},ne=le(()=>[w(()=>({multiplier:2,description:"Scholar's shoes",enabled:tt.paperUpgrades.paperUpgrade1.bought})),w(()=>({multiplier:2,description:"Scholar's slacks",enabled:tt.paperUpgrades.paperUpgrade2.bought})),w(()=>({multiplier:2,description:"Scholar's jacket",enabled:tt.paperUpgrades.paperUpgrade3.bought})),w(()=>({multiplier:10,description:"Felt Elbow Pads",enabled:tt.paperUpgrades.paperUpgrade4.bought})),w(()=>({multiplier:qe.boosts.yellow1,description:"Yellow Dye Boost 1",enabled:()=>a.gte(qe.dyes.yellow.amount.value,1)}))]),Ge=le(()=>[w(()=>({multiplier:.1,description:"Star Level 2",enabled:Oe.elfTraining.paperElfTraining.milestones[1].earned}))]),Be=f(()=>Ge.apply(1e6)),[K,Ce]=Zt(()=>[{title:"Paper Gain",modifier:ne,base:1},{title:"Ash Cost",modifier:Ge,base:1e6,unit:" ash/pulp"}]),Le=V(!1),ke=B(()=>i(wt,{modelValue:Le.value,"onUpdate:modelValue":W=>Le.value=W},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:K}));Xe.on("update",W=>{a.lt(R.day.value,Ca)||(l.value=a.times(W,He.buyables.passivePaper.amount.value).times(o.currentGain.value).div(100).add(l.value))});const{total:xe,trackerDisplay:Fe}=rl({resource:l,goal:5e3,name:e,day:Ca,color:t,textColor:"var(--feature-foreground)",modal:{show:Le,display:ke}});return{name:e,day:Ca,color:t,paper:l,totalPaper:xe,paperConversion:o,books:E,upgrades:me,generalTabCollapsed:Ce,minWidth:700,display:B(()=>i(S,null,[se(Fe),i(_e,null,null),i(Tt,{resource:l,color:t,style:"margin-bottom: 0"},null),i(_e,null,null),se(r),i(_e,null,null),Ye(...Object.values(me)),i(_e,null,null),Vt(...Object.values(E))]))}}),fr="oil",ka=9,Ze=Rt(fr,function(){const e="Oil",t="#000000",l="var(--foreground)",n=dt(0,"oil"),o=dt(0,"depth"),r=Se(0),d=f(()=>a.lt(o.value,990)?a.add(10,o.value):a.pow(1.001,a.sub(o.value,990)).mul(1e3));function c(){if(a.lt(o.value,990)){const Ke=a.min(a.affordArithmeticSeries(r.value,10,1,o.value),a.sub(990,o.value)),It=a.sumArithmeticSeries(Ke,10,1,o.value);r.value=a.sub(r.value,It),o.value=a.add(o.value,Ke)}if(a.gte(o.value,990)){const Ke=a.affordGeometricSeries(r.value,1e3,1.001,a.sub(o.value,990)),It=a.sumGeometricSeries(Ke,1e3,1.001,a.sub(o.value,990));r.value=a.sub(r.value,It),o.value=a.add(o.value,Ke)}}const p=Se(0),m=f(()=>a.times(a.pow(p.value,H.value).pow(2),1e14)),b=f(()=>a.times(a.pow(p.value,H.value),1)),h=Re(()=>({resource:lt.metal,cost(){const Ke=new a(this.amount.value);return a.pow(1.3,Ke).times(25e3)},display:B(()=>i(S,null,[i("h3",null,[s("Heavy Drill")]),i("br",null,null),s("A large drill specialized at deep mining."),i("br",null,null),s("Consumes 1e14*(Heavy Drills amount)"),i("sup",null,[s("2")]),s(" coal/sec for (Heavy Drills amount) drill power."),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("-"),Ee(m.value),s(" coal/sec"),i("br",null,null),s("+"),Ee(b.value),s(" drill power"),i("br",null,null),i("br",null,null),s("Cost: "),we(u(h.cost)),s(" "),h.resource.displayName])),onPurchase(){p.value=a.add(p.value,1)},style:{color:l,width:"160px"}})),{min:A,max:v,add:_,remove:N}=Kt({buyable:h,active:p}),D=Se(0),H=f(()=>a.add(D.value,Math.E).ln()),M=Re(()=>({resource:lt.metal,cost(){const Ke=new a(this.amount.value);return a.pow(2,Ke).times(1e5)},display:B(()=>i(S,null,[i("h3",null,[s("Heavy Drill Drill")]),i("br",null,null),s("Attach extra drills to Heavy Drills to make them faster"),i("br",null,null),s("Raise amount of effective Heavy Drills by ^ln(Heavy Drill Drill amount + e)."),i("br",null,null),s("(also affects coal consumption)."),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("^"),Ee(H.value),s(" Heavy Drill amount"),i("br",null,null),i("br",null,null),s("Cost: "),we(u(M.cost)),s(" "),M.resource.displayName])),onPurchase(){D.value=a.add(D.value,1)},style:{color:l,width:"160px"}})),{min:E,max:T,add:J,remove:fe}=Kt({buyable:M,active:D}),Q=Se(0),me=f(()=>a.pow(1/3,Q.value)),ne=f(()=>a.pow(2,Q.value)),Ge=f(()=>a.pow(1.2,Q.value)),Be=Re(()=>({resource:lt.metal,cost(){const Ke=new a(this.amount.value);return a.pow(8,Ke).times(2e5)},display:B(()=>i(S,null,[i("h3",null,[s("Heavy Extractor")]),i("br",null,null),s("Attach extractors to the drill to mine coal and ore, but with a price."),i("br",null,null),s("Divides drill power by 3 to multiply coal gain by 2 and ore gain by 1.2."),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("\xD7"),Ee(me.value),s(" drill power"),i("br",null,null),s("\xD7"),Ee(ne.value),s(" coal/sec"),i("br",null,null),s("\xD7"),Ee(Ge.value),s(" ore/sec"),i("br",null,null),i("br",null,null),s("Cost: "),we(u(Be.cost))," ",Be.resource.displayName])),onPurchase(){Q.value=a.add(Q.value,1)},style:{color:l,width:"160px"}})),{min:K,max:Ce,add:Le,remove:ke}=Kt({buyable:Be,active:Q}),xe=Se(0),Fe=f(()=>a.pow(gt[3].bought.value?4:5,xe.value)),W=f(()=>a.add(xe.value,Va.value).pow(2).mul(p.value).mul(a.add(D.value,1)).mul(Q.value).mul(o.value).div(1e5)),ge=Re(()=>({resource:lt.metal,cost(){const Ke=new a(this.amount.value);let It=a.pow(16,Ke).times(2e6);return gt[4].bought.value&&(It=It.div(a.add(Al.value,1).root(6))),It},display:B(()=>i(S,null,[i("h3",null,[s("Oil Pump")]),i("br",null,null),s("Pump that oil from the ground."),i("br",null,null),s("Gain oil based on the number of Heavy buildings active and well depth, but coal usage is multiplied by "),gt[3].bought.value?4:5,s("\xD7."),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("\xD7"),Ee(Fe.value),s(" coal usage"),i("br",null,null),s("+"),Ee(W.value),s(" oil/sec"),i("br",null,null),i("br",null,null),s("Cost: "),we(u(ge.cost)),s(" "),ge.resource.displayName])),onPurchase(){xe.value=a.add(xe.value,1)},style:{color:l,width:"160px"}})),{max:oe,min:We,add:Je,remove:At}=Kt({buyable:ge,active:xe}),ae=Se(0),ie=f(()=>a.pow(ae.value,2)),Ue=f(()=>a.pow(ae.value,3).mul(1e19)),ze=f(()=>a.add(ae.value,1)),he=Re(()=>({resource:U(n),cost(){const Ke=new a(this.amount.value);return a.pow(2,Ke).times(50)},display:B(()=>i(S,null,[i("h3",null,[s("Oil Burner")]),i("br",null,null),s("Burn oil as fuel."),i("br",null,null),s("(Oil Burner Amount)"),i("sup",null,[s("2")]),s(" unit of oil can give 1e19*(Oil Burner Amount)"),i("sup",null,[s("3")]),s(" units of coal."),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("-"),Ee(ie.value),s(" oil/sec"),i("br",null,null),s("-"),Ee(Ue.value),s(" coal consumption"),gt[2].bought.value?i(S,null,[i("br",null,null),s("\xD7"),Ee(ze.value),s(" to auto smelting multi")]):"",i("br",null,null),i("br",null,null),s("Cost: "),we(u(he.cost)),s(" "),he.resource.displayName])),onPurchase(){ae.value=a.add(ae.value,1)},style:{color:l,width:"160px"}})),{max:pt,min:st,add:Z,remove:Te}=Kt({buyable:he,active:ae}),re=Se(0),Mt=f(()=>a.pow(re.value,2).mul(100)),Ve=f(()=>a.add(re.value,1)),mt=Re(()=>({resource:lt.metal,cost(){const Ke=new a(this.amount.value);let It=a.pow(10,Ke).times(1e7);return gt[4].bought.value&&(It=It.div(a.add(Al.value,1).root(6))),It},display:B(()=>i(S,null,[i("h3",null,[s("Oil Smelter")]),i("br",null,null),s("Use oil as a crucible fuel."),i("br",null,null),s("Burn 100*(Oil Smelter amount)"),i("sup",null,[s("2")]),s(" oil to smelt +100% faster."),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("-"),Ee(Mt.value),s(" oil/sec"),i("br",null,null),s("\xD7"),Ee(Ve.value),s(" smelting speed"),i("br",null,null),i("br",null,null),s("Cost: "),we(u(mt.cost)),s(" "),mt.resource.displayName])),onPurchase(){re.value=a.add(re.value,1)},style:{color:l,width:"160px"}})),{max:Nt,min:$,add:ue,remove:j}=Kt({buyable:mt,active:re}),Ie=[P(()=>({display:{requirement:"5m Well Depth",effectDisplay:"Gain 25% more coal for each metre of well depth (after the 3 elf milestone)."},shouldEarn:()=>a.gte(o.value,5)})),P(()=>({display:{requirement:"10m Well Depth",effectDisplay:"Drill too slow? Unlock some drill upgrades!"},shouldEarn:()=>a.gte(o.value,10),visibility:()=>y(Ie[0].earned.value)})),P(()=>({display:{requirement:"25m Well Depth",effectDisplay:"Gain 5% more ore for each metre of well depth."},shouldEarn:()=>a.gte(o.value,25),visibility:()=>y(Ie[1].earned.value)})),P(()=>({display:{requirement:"60m Well Depth",effectDisplay:"Drill still too slow? Try unlocking another drill!"},shouldEarn:()=>a.gte(o.value,60),visibility:()=>y(Ie[2].earned.value)})),P(()=>({display:{requirement:"150m Well Depth",effectDisplay:"It appears that coal and metal appear a lot more when you go this deep! Unlock an upgrade apiece for coal and metal!"},shouldEarn:()=>a.gte(o.value,150),visibility:()=>y(Ie[3].earned.value)})),P(()=>({display:{requirement:"350m Well Depth",effectDisplay:"There is even more coal and metal than you thought. Why don't you utilize your heavy drill to mine them? Unlock a new drill upgrade!"},shouldEarn:()=>a.gte(o.value,350),visibility:()=>y(Ie[4].earned.value)})),P(()=>({display:{requirement:"1,000m Well Depth",effectDisplay:"You've finally found oil! Maybe it's time to make those oil useful! Unfortunately extracting them would use more coal, and also it's becoming much harder to mine deeper due to the thermal heat and pressure."},shouldEarn:()=>a.gte(o.value,1e3),visibility:()=>y(a.gte(o.value,1e3))})),P(()=>({display:{requirement:"3,000m Well Depth",effectDisplay:"You found a large oil spot! Double oil gain!"},shouldEarn:()=>a.gte(o.value,3e3),visibility:()=>y(a.gte(o.value,2e3))}))],{collapseMilestones:ee,display:it}=Hl(Ie),vt=[P(()=>({display:{requirement:"100 total oil",effectDisplay:"Hmm, these oil pumps are really expensive. Maybe you should find a way to solve this problem... maybe you can use oil as fuel instead of coal?"},shouldEarn:()=>a.gte(Al.value,100)})),P(()=>({display:{requirement:"500 total oil",effectDisplay:"Unlocks oil upgrades! These can be bought with oil."},shouldEarn:()=>a.gte(Al.value,500),visibility:()=>y(vt[0].earned.value)})),P(()=>({display:{requirement:"10,000 total oil",effectDisplay:"Wow, this is really bright when you burn it. Maybe it can be helpful to use them to smelt metal?"},shouldEarn:()=>a.gte(Al.value,1e4),visibility:()=>y(vt[1].earned.value)}))],{collapseMilestones:Ct,display:el}=Hl(vt),Ft=[O(()=>({resource:q.coal,cost:1e18,display:{title:"Coal Drill Synergy",description:"Increase drill power by +4% per coal Mining Drill owned.",effectDisplay:B(()=>i(S,null,[s("x"),Ee(ft[0].value)]))},style:{color:l}})),O(()=>({resource:lt.metal,cost:15e4,display:{title:"Metal Drill Synergy",description:"Increase drill power by +4% per ore Mining Drill owned.",effectDisplay:B(()=>i(S,null,[s("x"),Ee(ft[1].value)]))},style:{color:l}})),O(()=>({resource:q.coal,cost:1e20,display:{title:"Coal Drill Upgrade",description:"Increase drill power by +6% per OoM of coal owned.",effectDisplay:B(()=>i(S,null,[s("x"),Ee(ft[2].value)]))},style:{color:l}})),O(()=>({resource:lt.metal,cost:15e5,display:{title:"Metal Drill Upgrade",description:"Increase drill power by +10% per OoM of metal ingot owned.",effectDisplay:B(()=>i(S,null,[s("x"),Ee(ft[3].value)]))},style:{color:l}})),O(()=>({resource:U(n),cost:100,display:{title:"Drill Oil",description:"Increase previous upgrades' effect by +0.1% per Heavy Drill owned.",effectDisplay:B(()=>i(S,null,[s("+"),Ee(a.mul(ft[4].value,100)),s("%")]))},style:{color:l}}))],ft=[f(()=>a.mul(q.buildDrill.amount.value,a.add(.04,al.value)).add(1)),f(()=>a.mul(lt.oreDrill.amount.value,a.add(.04,al.value)).add(1)),f(()=>a.mul(a.max(q.coal.value,1).log10().floor(),a.add(.06,al.value)).add(1)),f(()=>a.mul(a.max(lt.metal.value,1).log10().floor(),a.add(.1,al.value)).add(1)),f(()=>a.mul(h.amount.value,.001))],gt=[O(()=>({resource:U(n),cost:100,display:{title:"Oil the Oil Pump",description:"Double oil gain."},style:{color:l}})),O(()=>({resource:U(n),cost:500,display:{title:"Oil the Mining Drills",description:"Double ore mining speed and square the coal drill amount in its effect."},style:{color:l}})),O(()=>({resource:U(n),cost:1500,display:{title:"Blaster Burner",description:"The Oil Burner can now increase your metal gain."},style:{color:l}})),O(()=>({resource:U(n),cost:25e3,display:{title:"Oil Integration",description:"Reduce Oil Pump's coal consumption multipler from 5 to 4"},style:{color:l}})),O(()=>({resource:U(n),cost:5e4,display:{title:"Be One with the Oil",description:B(()=>i(S,null,[s("Divide metal ingot prices of oil buildings by "),i("sup",null,[s("6")]),i(pl,null,{default:()=>[s("total oil + 1")]})]))},style:{color:l}}))],Lt=le(()=>[ce(()=>({addend:()=>a.negate(m.value),description:"Heavy Drill",enabled:()=>a.gt(p.value,0)})),w(()=>({multiplier:Fe,description:"Oil Pump",enabled:()=>a.gt(xe.value,0)})),ce(()=>({addend:ha,description:"Oil to Coal Substitution",enabled:()=>a.gt(ha.value,0)}))]),xt=f(()=>Lt.apply(0)),jt=le(()=>[ce(()=>({addend:b,description:"Heavy Drill",enabled:()=>a.gt(p.value,0)})),w(()=>({multiplier:me,description:"Heavy Extractor",enabled:()=>a.gt(Q.value,0)})),w(()=>({multiplier:ft[0],description:"Coal Drill Synergy",enabled:Ft[0].bought})),w(()=>({multiplier:ft[1],description:"Metal Drill Synergy",enabled:Ft[1].bought})),w(()=>({multiplier:ft[2],description:"Coal Drill Upgrade",enabled:Ft[2].bought})),w(()=>({multiplier:ft[3],description:"Metal Drill Upgrade",enabled:Ft[3].bought})),w(()=>({multiplier:2,description:"Guide to drilling",enabled:te.upgrades.drillingUpgrade.bought})),w(()=>({multiplier:()=>ll.value,description:"Effectiveness",enabled:()=>a.lt(ll.value,1)}))]),tl=f(()=>jt.apply(0)),wl=le(()=>[ce(()=>({addend:ft[4],description:"Drill Oil",enabled:Ft[4].bought}))]),al=f(()=>wl.apply(0)),Xl=le(()=>[ce(()=>({addend:W,description:"Oil Pump",enabled:()=>a.gt(xe.value,0)})),w(()=>({multiplier:2,description:"Oil the Oil Pump",enabled:gt[0].bought})),w(()=>({multiplier:2,description:"3000m Well Depth",enabled:Ie[7].earned})),w(()=>({multiplier:2,description:"Oil and where to find it",enabled:te.upgrades.oilUpgrade.bought})),w(()=>({multiplier:()=>ll.value,description:"Effectiveness",enabled:()=>a.lt(ll.value,1)}))]),Ml=f(()=>Xl.apply(0)),Yl=le(()=>[ce(()=>({addend:()=>a.negate(ie.value),description:"Oil Burner",enabled:()=>a.gt(ae.value,0)})),ce(()=>({addend:()=>a.negate(Mt.value),description:"Oil Smelter",enabled:()=>a.gt(re.value,0)})),ce(()=>({addend:()=>a.negate(He.oilCost.value),description:"Oil Refinery",enabled:()=>a.gt(He.activeRefinery.value,0)}))]),F=f(()=>Yl.apply(0)),Qa=le(()=>[ce(()=>({addend:Ue,description:"Oil Burner",enabled:()=>a.gt(ae.value,0)})),w(()=>({multiplier:()=>dl.value,description:"Effectiveness",enabled:()=>a.lt(dl.value,1)}))]),ha=f(()=>Qa.apply(0)),$a=le(()=>[ce(()=>({addend:qe.boosts.red1,description:"Red Dye Boost 1",enabled:()=>a.gte(qe.dyes.red.amount.value,1)}))]),Va=f(()=>$a.apply(0)),[Yn,Zn]=Zt(()=>[{title:"Coal Consumption",modifier:Lt,unit:"/s",base:0},{title:"Drill Power",modifier:jt,base:0},{title:"Upgrade Bonus",modifier:wl,base:0,visible(){return a.gt(al.value,0)}},{title:"Oil Speed",modifier:Xl,unit:"/s",base:0,visible(){return a.gt(Ml.value,0)}},{title:"Oil Consumption",modifier:Yl,unit:"/s",base:0,visible(){return a.lt(F.value,0)}},{title:"Oil to Coal Substitution",modifier:Qa,unit:"/s",base:0,visible(){return a.gt(ha.value,0)}},{title:"Extra Oil Pumps",modifier:$a,base:0,visible(){return a.gt(Va.value,0)}}]),ya=V(!1),ei=B(()=>i(wt,{modelValue:ya.value,"onUpdate:modelValue":Ke=>ya.value=Ke},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:Yn})),ll=V(a.dOne),dl=V(a.dOne);Xe.on("update",Ke=>{if(a.lt(R.day.value,ka))return;const It=a.negate(xt.value);a.gt(It,0)?(ll.value=a.min(a.div(q.coal.value,It),1),q.coal.value=a.sub(q.coal.value,a.mul(It,ll.value).mul(Ke))):ll.value=a.dOne,r.value=a.add(r.value,a.mul(tl.value,Ke)),n.value=a.add(n.value,a.mul(Ml.value,Ke)),c();const ba=a.negate(F.value);a.gt(ba,0)?(dl.value=a.min(a.div(n.value,ba),1),n.value=a.sub(n.value,a.mul(ba,dl.value).mul(Ke)).max(0)):dl.value=a.dOne});const{total:Al,trackerDisplay:ti}=rl({resource:n,goal:25e4,name:e,day:ka,color:t,modal:{show:ya,display:ei}});return{name:e,day:ka,color:t,oil:n,totalOil:Al,depth:o,drillProgress:r,activeHeavy:p,buildHeavy:h,activeHeavy2:D,buildHeavy2:M,activeExtractor:Q,buildExtractor:Be,activePump:xe,buildPump:ge,activeBurner:ae,buildBurner:he,activeSmelter:re,buildSmelter:mt,extractorCoal:ne,extractorOre:Ge,coalEffectiveness:ll,oilEffectiveness:dl,depthMilestones:Ie,collapsedDepthMilestones:ee,row1Upgrades:Ft,row2Upgrades:gt,minWidth:700,oilMilestones:vt,collapsedOilMilestones:Ct,generalTabCollapsed:Zn,display:B(()=>{const Ke=[];return Ie[1].earned.value&&Ke.push(Ft),vt[1].earned.value&&Ke.push(gt),i(S,null,[se(ti),i(_e,null,null),a.lt(ll.value,1)?i("div",null,[s("Coal efficiency: "),Ee(a.mul(ll.value,100)),s("%")]):null,a.lt(dl.value,1)?i("div",null,[s("Oil efficiency: "),Ee(a.mul(dl.value,100)),s("%")]):null,i(Tt,{resource:n,color:t,sticky:!0,productionDisplay:B(()=>i(S,null,[a.lt(o.value,1e3)?"Reach 1000m to start gaining oil":i(S,null,[ia(a.add(Ml.value,F.value))])]))},null),a.eq(Ml.value,0)?i(S,null,[s("(Need at least 1 Oil Pump, 1 Heavy Drill and 1 Heavy Extractor active to gain oil)"),i("br",null,null)]):"",i(Pl,null,{default:()=>[Ie[6].earned.value?i(Ut,null,{default:()=>[se(ge),i("div",null,[we(a.floor(xe.value)),s("/"),we(a.floor(ge.amount.value))]),Ye(We,At,Je,oe)]}):null,vt[0].earned.value?i(Ut,null,{default:()=>[se(he),i("div",null,[we(a.floor(ae.value)),s("/"),we(a.floor(he.amount.value))]),Ye(st,Te,Z,pt)]}):null,vt[2].earned.value?i(Ut,null,{default:()=>[se(mt),i("div",null,[we(a.floor(re.value)),s("/"),we(a.floor(mt.amount.value))]),Ye($,j,ue,Nt)]}):null]}),i("br",null,null),i("div",null,[i("span",null,[s("The well is ")]),i("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[we(o.value)]),s("m deep"),i("br",null,null),s("Next at "),Ee(a.sub(d.value,r.value))," ",s("drill power seconds")]),i("div",null,[i("span",null,[s("Your drill power is ")]),i("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[Ee(tl.value)])]),i(_e,null,null),i(Pl,null,{default:()=>[i(Ut,null,{default:()=>[se(h),i("div",null,[we(a.floor(p.value)),s("/"),we(a.floor(h.amount.value))]),Ye(A,N,_,v)]}),Ie[3].earned.value?i(Ut,null,{default:()=>[se(M),i("div",null,[we(a.floor(D.value)),s("/"),we(a.floor(M.amount.value))]),Ye(E,fe,J,T)]}):null,Ie[5].earned.value?i(Ut,null,{default:()=>[se(Be),i("div",null,[we(a.floor(Q.value)),s("/"),we(a.floor(Be.amount.value))]),Ye(K,ke,Le,Ce)]}):null]}),i(_e,null,null),Bl(...Ke),i(_e,null,null),it(),a.gte(Al.value,50)?el():""])})}}),gr="metal",tn=7,lt=Rt(gr,function(){const e="Metal",t="#888B8D",l=dt(0,"metal ingots",void 0,!0),n=Xa(l),o=dt(0,"ore"),r=Xa(o),d=le(()=>[w(()=>({multiplier:5,description:"Crucible",enabled:Ce.bought})),w(()=>({multiplier:1.5,description:"Industrial Crucible",enabled:()=>a.gte(W.amount.value,1)})),w(()=>({multiplier:2,description:"Industrial Furnace",enabled:ke.bought})),w(()=>({multiplier:()=>a.add(We.value,1),description:"Hotter Forges",enabled:()=>a.gte(oe.amount.value,1)})),w(()=>({multiplier:2,description:"Carry metal in boxes",enabled:et.row2Upgrades.metalUpgrade.bought})),w(()=>({multiplier:qe.boosts.purple2,description:"Purple Dye Boost 2",enabled:()=>a.gte(qe.dyes.purple.amount.value,1)})),w(()=>({multiplier:()=>a.add(tt.cloth.value,1).log10().plus(1),description:"Glistening Paint",enabled:qe.upgrades.redDyeUpg.bought}))]),c=f(()=>d.apply(.1)),p=le(()=>[ce(()=>({addend:()=>a.times(W.amount.value,10),description:"Industrial Crucibles",enabled:()=>a.gte(W.amount.value,1)})),w(()=>({multiplier:2,description:"Efficient Crucibles",enabled:q.efficientSmelther.bought})),w(()=>({multiplier:()=>a.mul(Ze.activeSmelter.value,Ze.oilEffectiveness.value).add(1),description:"Oil Smelter",enabled:()=>a.gt(Ze.activeSmelter.value,0)})),w(()=>({multiplier:qe.boosts.purple2,description:"Purple Dye Boost 2",enabled:()=>a.gte(qe.dyes.purple.amount.value,1)})),w(()=>({multiplier:()=>a.add(He.activeRefinery.value,1).sqrt(),description:"De Louvre",enabled:qe.upgrades.redDyeUpg2.bought}))]),m=f(()=>p.apply(0)),b=le(()=>[w(()=>({multiplier:3,description:"Efficient Crucibles",enabled:q.efficientSmelther.bought})),w(()=>({multiplier:()=>a.add(Ze.activeBurner.value,1).mul(Ze.oilEffectiveness.value),description:"Blaster Burner",enabled:Ze.row2Upgrades[2].bought}))]),h=f(()=>b.apply(1)),A=1e10,v=f(()=>a.min(o.value,a.div(q.coal.value,A)).floor().max(0)),_=Pt(()=>({display:B(()=>{const he=a.gte(v.value,1)?v.value:a.add(v.value,1);return i(S,null,[i("span",{style:"font-size: large"},[s("Smelt "),Ee(a.times(v.value,c.value))," ",l.displayName]),i("br",null,null),i("span",{style:"font-size: large"},[s("Cost: "),we(he),s(" "),o.displayName,s(";")," ",we(a.times(he,A)),s(" "),q.coal.displayName])])}),canClick:()=>a.gte(v.value,1),onClick(){!u(this.canClick)||N(v.value)},style:{width:"600px",minHeight:"unset"}}));function N(he,pt=1){const[st,Z,Te]=[a.times(he,c.value).times(pt),he,a.times(he,A)];l.value=a.add(l.value,st),o.value=a.sub(o.value,Z),q.coal.value=a.sub(q.coal.value,Te)}const D=le(()=>[ce(()=>({addend:()=>Fe.amount.value,description:"Mining Drills",enabled:()=>a.gte(Fe.amount.value,1)})),w(()=>({multiplier:()=>a.mul(Ze.depth.value,.05).add(1),description:"25m Well Depth",enabled:Ze.depthMilestones[2].earned})),w(()=>({multiplier:Ze.extractorOre,description:"Heavy Extractor",enabled:()=>a.gt(Ze.activeExtractor.value,0)})),w(()=>({multiplier:2,description:"Carry ore in boxes",enabled:et.row2Upgrades.oreUpgrade.bought}))]),H=f(()=>D.apply(1)),M=le(()=>[w(()=>({multiplier:2,description:"A Simple Pickaxe",enabled:Be.bought})),w(()=>({multiplier:2,description:"Double Pickaxe",enabled:K.bought})),w(()=>({multiplier:2.5,description:"Mining Drills",enabled:()=>a.gte(Fe.amount.value,1)})),w(()=>({multiplier:2,description:"Efficient Drills",enabled:xe.bought})),w(()=>({multiplier:2,description:"Oil the Mining Drills",enabled:Ze.row2Upgrades[1].bought}))]),E=f(()=>M.apply(a.recip(J))),T=Se(0),J=10,fe=Ht(()=>({width:400,height:25,direction:Pe.Right,fillStyle:{backgroundColor:t},progress:()=>T.value})),Q=le(()=>[ce(()=>({addend:H})),w(()=>({multiplier:E}))]),me=f(()=>Q.apply(0)),ne=le(()=>[ce(()=>({addend:me})),ce(()=>({addend:()=>a.negate(m.value),enabled:ge}))]),Ge=f(()=>ne.apply(0)),Be=O(()=>({resource:U(l),cost:.1,display:{title:"A Simple Pickaxe",description:"Make a simple pickaxe to help mine faster.<br/><br/>Halve the time to mine more ore"}})),K=O(()=>({resource:U(l),cost:.1,display:{title:"Double Pickaxe",description:"This is too slow. What if you swung two pickaxes at once?<br/><br/>Halve the time to mine ore, again"},visibility:()=>y(K.bought.value)})),Ce=O(()=>({resource:U(l),cost:1,display:{title:"Crucible",description:"Smelting this all by hand is rather painful, and a lot of the metal is left in the slag. A small crucible should help a lot!<br/><br/>Increase the metal extracted per ore by 5x"},visibility:()=>y(Ce.bought.value||a.div(r.value,c.value).plus(n.value).gte(1))})),Le=O(()=>({resource:U(l),cost:0,display:{title:"Coal Drilling",description:"These mining drills are pretty powerful, mining more ore than you can actually smelt. Could be worth making some to mine coal instead"},visibility:()=>y(a.gte(Fe.amount.value,1)&&(Le.bought.value||R.days[7].opened.value||a.lt(q.computedCoalGain.value,a.times(H.value,E.value).times(A)))),onPurchase(){R.days[2].recentlyUpdated.value=!0}})),ke=O(()=>({canAfford(){return a.gte(l.value,50)&&a.gte(q.coal.value,1e11)},onPurchase(){l.value=a.sub(l.value,50),q.coal.value=a.sub(q.coal.value,1e11)},display:{title:"Industrial Furnace",description:`Moving smelting out of the open air and into a dedicated furnace should make efficiency even better. Double metal gained per ore
<br/>
<br/>
Cost: 50 ${l.displayName}<br/>${Ee(1e11)} ${q.coal.displayName}`}})),xe=O(()=>({resource:U(l),cost:1e5,display:{title:"Efficient Drills",description:"Use metal and a bunch of R&D to make drilling stuff faster. Double coal and ore mining speed."},visibility:()=>y(Ze.depthMilestones[4].earned.value)})),Fe=Re(()=>({resource:U(l),cost(){return a.pow(1.15,this.amount.value).times(10)},display:{title:"Mining Drill",description:"An automated machine to help you mine more ore, faster",effectDisplay:B(()=>i(S,null,[s("Mine 2.5x faster. Increase ore mining amount by")," ",we(Fe.amount.value),s(" ore per operation")]))},visibility:()=>y(a.gte(Fe.amount.value,1)||a.div(r.value,c.value).plus(n.value).gte(10)),style:{width:"200px"}})),W=Re(()=>({resource:U(l),cost(){return a.pow(1.15,a.times(this.amount.value,10)).times(10)},display:{title:"Industrial Crucible",description:"A giant automated crucible furnace, letting you smelt ore faster",effectDisplay:B(()=>i(S,null,[s("Automatically smelts")," ",we(a.times(W.amount.value,10)),s(" ore per second")]))},visibility:()=>y(a.gte(W.amount.value,1)||a.gte(Fe.amount.value,4)||a.gte(r.value,50)),style:{width:"200px"}})),ge=Se(!0),oe=Re(()=>({resource:q.coal,cost(){return a.pow(10,this.amount.value).times(1e12)},display:{title:"Hotter Forges",description:"More coal makes the fires burn hotter, getting just a little more metal out of each bit of ore",effectDisplay:B(()=>i(S,null,[s("Gain "),we(a.times(We.value,100)),s("% more metal per ore")]))},visibility:()=>y(a.gte(oe.amount.value,1)||ke.bought.value),style:{width:"200px"}})),We=f(()=>a.times(oe.amount.value,.25));Xe.on("update",he=>{T.value=a.times(he,E.value).plus(T.value);const pt=T.value.trunc();T.value=T.value.minus(pt),o.value=a.add(o.value,a.times(pt,H.value)),ge.value&&N(a.min(v.value,a.times(m.value,he)),h.value)});const[Je,At]=Zt(()=>[{title:"Auto Smelt Speed",modifier:p,base:0,unit:"/s",visible(){return a.gt(W.amount.value,0)}},{title:"Auto Smelt Multiplier",modifier:b,base:1,visible(){return a.gt(h.value,1)}},{title:"Metal per Ore",modifier:d,base:.1},{title:"Ore per Mining Operation",modifier:D,base:1},{title:"Mining Speed",modifier:M,base:.1,unit:"/s"}]),ae=V(!1),ie=B(()=>i(wt,{modelValue:ae.value,"onUpdate:modelValue":he=>ae.value=he},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:Je})),{total:Ue,trackerDisplay:ze}=rl({resource:l,goal:25e3,name:e,day:tn,color:t,modal:{show:ae,display:ie}});return{name:e,day:tn,color:t,ore:o,bestOre:r,oreProgress:T,metal:l,bestMetal:n,totalMetal:Ue,simplePickaxe:Be,doublePickaxe:K,crucible:Ce,coalDrill:Le,industrialFurnace:ke,efficientDrill:xe,oreDrill:Fe,industrialCrucible:W,autoSmeltEnabled:ge,hotterForge:oe,generalTabCollapsed:At,minWidth:700,display:B(()=>i(S,null,[se(ze),i(_e,null,null),i(Tt,{resource:l,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:B(()=>i(S,null,[ge.value&&a.gte(W.amount.value,1)?`+${hn([[m.value,"smelting speed"],[me.value,"ore gain"],[a.div(q.computedCoalGain.value,A),"coal gain"]],"/s",a.mul(c.value,h.value))}`:void 0]))},null),i(_e,null,null),se(_),a.gte(W.amount.value,1)?i("div",{style:{width:"150px"}},[i(nl,{title:"Auto Smelt",modelValue:ge.value,"onUpdate:modelValue":he=>ge.value=he},null)]):void 0,i(_e,null,null),i(Tt,{resource:o,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:B(()=>i(S,null,[yn(Ge.value)]))},null),i(_e,null,null),i("div",null,[s("Currently mining "),Ee(H.value),s(" ore every")," ",Ee(a.recip(E.value)),s(" seconds")]),se(fe),i(_e,null,null),Ye(Be,K,Ce,Le,ke,xe),Ye(Fe,W,oe)]))}}),hr="coal",ln=3,q=Rt(hr,function(){const e="Coal",t="#151716",l="#B2BeB5",n="var(--foreground)",o=dt(0,"coal"),r=dt(0,"ash"),d=Se(0),c=f(()=>a.times(d.value,1e3)),p=f(()=>a.times(d.value,.1)),m=f(()=>a.times(d.value,50)),b=Re(()=>({resource:ve.logs,cost(){let F=a.times(T.amount.value,u(T.cost)).plus(this.amount.value);return a.gte(F,100)&&(F=a.pow(F,2).div(100)),a.gte(F,1e4)&&(F=a.pow(F,2).div(1e4)),F=a.pow(.95,te.books.smallFireBook.amount.value).times(F),F.pow(1.5).times(1e4)},display:B(()=>i(S,null,[i("h3",null,[s("Small Fire")]),i("br",null,null),s("Burn 1000 logs for 0.1 coal and 50 ash"),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("-"),L(c.value),s(" logs/sec"),i("br",null,null),s("+"),L(p.value),s(" coal/sec"),i("br",null,null),s("+"),L(m.value),s(" ash/sec"),i("br",null,null),i("br",null,null),s("Cost: "),X(u(b.cost)),s(" "),b.resource.displayName])),onPurchase(){d.value=a.add(d.value,1)},style:{color:n,width:"160px"}})),{min:h,max:A,add:v,remove:_}=Kt({active:d,buyable:b}),N=dt(b.amount,"small fires"),D=Se(0),H=f(()=>a.times(D.value,1e4)),M=f(()=>a.times(D.value,10)),E=f(()=>a.times(D.value,1e3)),T=Re(()=>({resource:N,cost(){return a.pow(.95,te.books.bonfireBook.amount.value).times(10)},display:B(()=>i(S,null,[i("h3",null,[s("Bonfire")]),i("br",null,null),s("Burn 10,000 logs for 10 coal and 1000 ash"),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("-"),L(H.value),s(" logs/sec"),i("br",null,null),s("+"),L(M.value),s(" coal/sec"),i("br",null,null),s("+"),L(E.value),s(" ash/sec"),i("br",null,null),i("br",null,null),s("Cost: "),X(u(T.cost)),s(" "),T.resource.displayName])),onPurchase(F){d.value=a.sub(d.value,F).max(0),D.value=a.add(D.value,1)},style:{color:n,width:"160px"},visibility:()=>y(he.bought.value)})),{min:J,max:fe,add:Q,remove:me}=Kt({buyable:T,active:D}),ne=Se(0),Ge=f(()=>a.times(ne.value,1e6)),Be=f(()=>{let F=a.times(ne.value,1e4);return Oe.elfTraining.kilnTraining.milestones[0].earned.value&&(F=F.times(5)),F}),K=f(()=>{let F=a.times(ne.value,1e4);return Oe.elfTraining.kilnTraining.milestones[0].earned.value&&(F=F.times(5)),F}),Ce=Re(()=>({resource:ve.logs,cost(){let F=this.amount.value;return a.gte(F,100)&&(F=a.pow(F,2).div(100)),a.gte(F,1e4)&&(F=a.pow(F,2).div(1e4)),F=a.pow(.95,te.books.kilnBook.amount.value).times(F),a.pow(1.1,F).times(1e7)},display:B(()=>i(S,null,[i("h3",null,[s("Charcoal Kiln")]),i("br",null,null),s("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("-"),L(Ge.value),s(" logs/sec"),i("br",null,null),s("+"),L(Be.value),s(" coal/sec"),i("br",null,null),s("+"),L(K.value),s(" ash/sec"),i("br",null,null),i("br",null,null),s("Cost: "),X(u(Ce.cost)),s(" "),Ce.resource.displayName])),onPurchase(){ne.value=a.add(ne.value,1)},style:{color:n,width:"160px"},visibility:()=>y(re.bought.value)})),{min:Le,max:ke,add:xe,remove:Fe}=Kt({buyable:Ce,active:ne}),W=Se(0),ge=f(()=>a.times(a.pow(W.value,Ze.row2Upgrades[1].bought.value?2:1),5e7).times(lt.efficientDrill.bought.value?2:1).times(Oe.elfTraining.kilnTraining.milestones[2].earned.value?2:1)),oe=Re(()=>({resource:lt.metal,cost(){let F=this.amount.value;return a.gte(F,100)&&(F=a.pow(F,2).div(100)),a.gte(F,1e4)&&(F=a.pow(F,2).div(1e4)),a.pow(1.15,F).times(10)},display:B(()=>i(S,null,[i("h3",null,[s("Mining Drill")]),i("br",null,null),s("Dig through the ground to find 50,000,000 coal"),i("br",null,null),i("br",null,null),s("Currently:"),i("br",null,null),s("+"),L(ge.value),s(" coal/sec"),i("br",null,null),i("br",null,null),s("Cost: "),X(u(oe.cost)),s(" "),oe.resource.displayName])),onPurchase(){W.value=a.add(W.value,1)},style:{color:n,width:"160px"},visibility:()=>y(lt.coalDrill.bought.value)})),{max:We,min:Je,add:At,remove:ae}=Kt({buyable:oe,active:W}),ie=O(()=>({resource:U(o),cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:n}})),Ue=O(()=>({resource:U(o),cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:n}})),ze=O(()=>({resource:U(r),cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:n}})),he=O(()=>({resource:N,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){N.value=a.add(N.value,this.cost)},style:{color:n}})),pt=[ie,Ue,ze,he],st=O(()=>({resource:U(o),cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:n},visibility:()=>y(he.bought.value)})),Z=O(()=>({resource:U(o),cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:n},visibility:()=>y(he.bought.value)})),Te=O(()=>({canAfford(){return a.gte(ve.logs.value,1e5)&&a.gte(r.value,1e5)},onPurchase(){ve.logs.value=a.sub(ve.logs.value,1e5),r.value=a.sub(r.value,1e5)},display:B(()=>i(S,null,[i("h3",null,[s("Mulched Soil")]),i("br",null,null),s("Double the bonus from Fertilized Soil"),i("br",null,null),i("br",null,null),s("Cost: "),X(1e5),s(" "),ve.logs.displayName,i("br",null,null),X(1e5),s(" "),r.displayName])),style:{color:n},visibility:()=>y(he.bought.value)})),re=O(()=>({resource:ve.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:n},visibility:()=>y(he.bought.value)})),Mt=[st,Z,Te,re],Ve=O(()=>({resource:U(o),cost:1e19,display:{title:"Efficient Crucibles",description:"Double auto smelting speed and triple metal gain from auto smelting"},style:{color:n},visibility:()=>y(Ze.depthMilestones[4].earned.value)})),mt=[Ve],Nt=Re(()=>({resource:U(o),cost(){let F=this.amount.value;return a.gte(F,50)&&(F=a.pow(F,2).div(50)),a.gte(F,200)&&(F=a.pow(F,2).div(200)),a.gte(F,2e6)&&(F=a.pow(F,2).div(2e6)),F=a.pow(.95,te.books.heatedCuttersBook.amount.value).times(F),a.add(F,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:B(()=>i(S,null,[s("Cutters cut down trees "),L(ee.value),s("x faster")]))},style:{color:n},visibility:()=>y(ie.bought.value)})),$=Re(()=>({resource:U(o),cost(){let F=this.amount.value;return a.gte(F,50)&&(F=a.pow(F,2).div(50)),a.gte(F,200)&&(F=a.pow(F,2).div(200)),a.gte(F,2e6)&&(F=a.pow(F,2).div(2e6)),F=a.pow(.95,te.books.heatedPlantersBook.amount.value).times(F),a.add(F,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:B(()=>i(S,null,[s("Planters plant trees "),L(vt.value),s("x faster")]))},style:{color:n},visibility:()=>y(Ue.bought.value)})),ue=Re(()=>({resource:U(r),cost(){let F=this.amount.value;return a.gte(F,50)&&(F=a.pow(F,2).div(50)),a.gte(F,200)&&(F=a.pow(F,2).div(200)),a.gte(F,2e6)&&(F=a.pow(F,2).div(2e6)),F=a.pow(.95,te.books.fertilizerBook.amount.value).times(F),a.add(F,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:B(()=>i(S,null,[s("Trees give "),L(el.value),s("x more logs")]))},style:{color:n},visibility:()=>y(ze.bought.value)})),j=[Nt,$,ue],Ie=le(()=>[ce(()=>({addend(){return a.times(Nt.amount.value,.25)},description:"Heated Cutters",enabled(){return a.gt(Nt.amount.value,0)}})),w(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:st.bought}))]),ee=f(()=>Ie.apply(1)),it=le(()=>[ce(()=>({addend(){return a.times($.amount.value,.25)},description:"Heated Planters",enabled(){return a.gt($.amount.value,0)}})),w(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:Z.bought}))]),vt=f(()=>it.apply(1)),Ct=le(()=>[ce(()=>({addend(){return a.times(ue.amount.value,.25)},description:"Fertilized Soil",enabled(){return a.gt(ue.amount.value,0)}})),w(()=>({multiplier:2,description:"Mulched Soil",enabled:Te.bought}))]),el=f(()=>Ct.apply(1)),Ft=le(()=>[ce(()=>({addend(){return p.value},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),ce(()=>({addend(){return M.value},description:"Bonfires",enabled(){return a.gt(D.value,0)}})),ce(()=>({addend(){return Be.value},description:"Charcoal Kilns",enabled(){return a.gt(ne.value,0)}})),ce(()=>({addend(){return ge.value},description:"Mining Drills",enabled(){return a.gt(W.value,0)}})),w(()=>({multiplier:2,description:"Carry coal in boxes",enabled:et.upgrades.coalUpgrade.bought})),w(()=>({multiplier:()=>a.div(et.buyables.coalBoxesBuyable.amount.value,2).add(1),description:"Carry more coal",enabled:et.upgrades.coalUpgrade.bought})),w(()=>({multiplier:()=>a.div(b.amount.value,1e4).add(1),description:"Small Fires Synergy",enabled:Me.elves.smallFireElf.bought})),w(()=>({multiplier:()=>a.div(T.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Me.elves.bonfireElf.bought})),w(()=>({multiplier:()=>a.div(Ce.amount.value,100).times(qe.boosts.green2.value).add(1),description:"Kiln Synergy",enabled:Me.elves.kilnElf.bought})),w(()=>({multiplier:2,description:"Mining overalls",enabled:tt.metalUpgrades.metalUpgrade2.bought})),w(()=>({multiplier:3,description:"Mining helmet",enabled:tt.metalUpgrades.metalUpgrade3.bought})),w(()=>({multiplier:4,description:"Felt-Gripped Pick",enabled:tt.metalUpgrades.metalUpgrade4.bought})),w(()=>({multiplier:2,description:"12 Elves Trained",enabled:Me.milestones[11].earned})),ra(()=>({exponent:1.25,description:"3 Elves Trained",enabled:Me.milestones[2].earned,supportLowNumbers:!0})),w(()=>({multiplier:()=>a.mul(Ze.depth.value,.25).add(1),description:"5m Well Depth",enabled:Ze.depthMilestones[0].earned})),w(()=>({multiplier:Ze.extractorCoal,description:"Heavy Extractor",enabled:()=>a.gt(Ze.activeExtractor.value,0)}))]),ft=f(()=>Ft.apply(0)),gt=le(()=>[ce(()=>({addend(){return m.value},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),ce(()=>({addend(){return E.value},description:"Bonfires",enabled(){return a.gt(D.value,0)}})),ce(()=>({addend(){return K.value},description:"Charcoal Kilns",enabled(){return a.gt(ne.value,0)}})),w(()=>({multiplier:2,description:"Carry ash in boxes",enabled:et.upgrades.ashUpgrade.bought})),w(()=>({multiplier:()=>a.div(et.buyables.ashBoxesBuyable.amount.value,2).add(1),description:"Carry more ash",enabled:et.upgrades.ashUpgrade.bought})),w(()=>({multiplier:()=>a.div(b.amount.value,1e3).add(1),description:"Small Fires Synergy",enabled:Me.elves.smallFireElf.bought})),w(()=>({multiplier:()=>a.div(T.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Me.elves.bonfireElf.bought})),w(()=>({multiplier:()=>a.div(Ce.amount.value,100).times(qe.boosts.green2.value).add(1),description:"Kiln Synergy",enabled:Me.elves.kilnElf.bought})),w(()=>({multiplier:4,description:"Mining boots",enabled:tt.metalUpgrades.metalUpgrade1.bought})),ra(()=>({exponent:1.1,description:"Snowball Level 2",enabled:Oe.elfTraining.kilnTraining.milestones[1].earned}))]),Lt=f(()=>gt.apply(0)),xt=le(()=>[ce(()=>({addend(){return a.negate(c.value)},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),ce(()=>({addend(){return a.negate(H.value)},description:"Bonfires",enabled(){return a.gt(D.value,0)}})),ce(()=>({addend(){return a.negate(Ge.value)},description:"Charcoal Kilns",enabled(){return a.gt(ne.value,0)}}))]),jt=f(()=>xt.apply(0)),[tl,wl]=Zt(()=>[{title:"Log Consumption",modifier:xt,base:0,visible(){return a.gt(d.value,0)||a.gt(D.value,0)||a.gt(ne.value,0)}},{title:"Coal Gain",modifier:Ft,base:0,visible(){return a.gt(d.value,0)||a.gt(D.value,0)||a.gt(ne.value,0)}},{title:"Ash Gain",modifier:gt,base:0,visible(){return a.gt(d.value,0)||a.gt(D.value,0)||a.gt(ne.value,0)}}]),al=V(!1),Xl=B(()=>i(wt,{modelValue:al.value,"onUpdate:modelValue":F=>al.value=F},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:tl}));Xe.on("update",F=>{a.lt(R.day.value,ln)||a.times(F,jt.value).negate().gt(ve.logs.value)||(ve.logs.value=a.times(F,jt.value).plus(ve.logs.value),o.value=a.times(F,ft.value).plus(o.value),r.value=a.times(F,Lt.value).plus(r.value),d.value=a.max(d.value,0))});const{total:Ml,trackerDisplay:Yl}=rl({resource:o,goal:1e7,name:e,day:ln,color:t,modal:{show:al,display:Xl}});return{name:e,color:t,coal:o,totalCoal:Ml,computedCoalGain:ft,ash:r,activeFires:d,buildFire:b,activeBonfires:D,buildBonfire:T,activeKilns:ne,buildKiln:Ce,activeDrills:W,buildDrill:oe,warmerCutters:ie,warmerPlanters:Ue,basicFertilizer:ze,unlockBonfire:he,dedicatedCutters:st,dedicatedPlanters:Z,betterFertilizer:Te,unlockKiln:re,efficientSmelther:Ve,heatedCutters:Nt,heatedPlanters:$,moreFertilizer:ue,computedHeatedCutterEffect:ee,computedHeatedPlanterEffect:vt,computedFertilizerEffect:el,generalTabCollapsed:wl,minWidth:700,display:B(()=>i(S,null,[se(Yl),i(_e,null,null),i(Tt,{resource:o,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(ft.value,0)?`+${L(ft.value)}/s`:void 0},null),i(_e,null,null),i(Tt,{resource:r,color:l,style:"margin-bottom: 0",effectDisplay:a.gt(Lt.value,0)?`+${L(Lt.value)}/s`:void 0},null),i(_e,null,null),i(Pl,null,{default:()=>[i(Ut,null,{default:()=>[se(b),i("div",null,[X(a.floor(d.value)),s("/"),X(a.floor(b.amount.value))]),Ye(h,_,v,A)]}),he.bought.value?i(S,null,[i(_e,null,null),i(Ut,null,{default:()=>[se(T),i("div",null,[X(D.value),s("/"),X(T.amount.value)]),Ye(J,me,Q,fe)]})]):void 0,re.bought.value?i(S,null,[i(_e,null,null),i(Ut,null,{default:()=>[se(Ce),i("div",null,[X(ne.value),s("/"),X(Ce.amount.value)]),Ye(Le,Fe,xe,ke)]})]):void 0,lt.coalDrill.bought.value?i(S,null,[i(_e,null,null),i(Ut,null,{default:()=>[se(oe),i("div",null,[X(W.value),s("/"),X(oe.amount.value)]),Ye(Je,ae,At,We)]})]):void 0]}),i(_e,null,null),Bl(pt,Mt,mt),Ye(...j)]))}}),yr="workshop",Ul=2,Dt=Rt(yr,function(){const e="Workshop",t="#D66B02",l="#D66B02",n=dt(0,"foundation progress"),o=js(()=>({scaling:Ra(250,1.5),baseResource:ve.logs,gainResource:U(n),roundUpCost:!0,buyMax:!1,spend(ne,Ge){ve.logs.value=a.sub(ve.logs.value,Ge)}})),r=Pt(()=>({display:B(()=>i(S,null,[i("b",{style:"font-size: x-large"},[s("Build part of the foundation")]),i("br",null,null),i("br",null,null),i("span",{style:"font-size: large"},[s("Cost:")," ",Kl(ve.logs,a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value)," ",ve.logs.displayName])])),visibility:()=>y(a.lt(n.value,100)),canClick:()=>a.gte(o.actualGain.value,1)&&a.lt(n.value,100),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"})),d=Dl(()=>({key:"w",description:"Build part of the foundation.",onPress:()=>{r.canClick.value&&r.onClick()}})),c=f(()=>!Me.milestones[6].earned.value),p=P(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>a.gte(n.value,1),showPopups:c})),m=P(()=>({display:{requirement:"10% Foundation Completed",effectDisplay:"Cut an additional tree per second for each 5% of foundation completed"},shouldEarn:()=>a.gte(n.value,10),visibility:()=>y(p.earned.value),showPopups:c})),b=P(()=>({display:{requirement:"20% Foundation Completed",effectDisplay:"Plant an additional tree per second for each 10% of foundation completed"},shouldEarn:()=>a.gte(n.value,20),visibility:()=>y(m.earned.value),showPopups:c})),h=P(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>a.gte(n.value,30),visibility:()=>y(b.earned.value),showPopups:c})),A=P(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>a.gte(n.value,40),visibility:()=>y(h.earned.value),showPopups:c})),v=P(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(n.value,50),visibility:()=>y(A.earned.value),showPopups:c})),_=P(()=>({display:{requirement:"75% Foundation Completed",effectDisplay:"The forest gains an extra tree for every 2% of foundation completed"},shouldEarn:()=>a.gte(n.value,75),visibility:()=>y(v.earned.value),showPopups:c})),N=P(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Log per tree is raised to the 1.2th power"},shouldEarn:()=>a.gte(n.value,100),visibility:()=>y(_.earned.value),showPopups:c})),D=P(()=>({display:{requirement:"120% Foundation Completed",effectDisplay:"The 1% milestone is now +2% and multiplicative"},shouldEarn:()=>a.gte(n.value,120),visibility:()=>y(Oe.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),H=P(()=>({display:{requirement:"140% Foundation Completed",effectDisplay:"Gain +10% metal for every 10% foundation completed"},shouldEarn:()=>a.gte(n.value,140),visibility:()=>y(Oe.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),M=P(()=>({display:{requirement:"160% Foundation Completed",effectDisplay:"Gain +10% oil for every 10% foundation completed"},shouldEarn:()=>a.gte(n.value,160),visibility:()=>y(Oe.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),E=P(()=>({display:{requirement:"180% Foundation Completed",effectDisplay:"Gain +10% plastic for every 10% foundation completed"},shouldEarn:()=>a.gte(n.value,180),visibility:()=>y(Oe.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),T=P(()=>({display:{requirement:"200% Foundation Completed",effectDisplay:"Double paper, boxes, and all cloth actions"},shouldEarn:()=>a.gte(n.value,200),visibility:()=>y(Oe.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),J={logGainMilestone1:p,autoCutMilestone1:m,autoPlantMilestone1:b,autoCutMilestone2:h,autoPlantMilestone2:A,logGainMilestone2:v,morePlantsMilestone1:_,logGainMilestone3:N,extraExpansionMilestone1:D,extraExpansionMilestone2:H,extraExpansionMilestone3:M,extraExpansionMilestone4:E,extraExpansionMilestone5:T},{collapseMilestones:fe,display:Q}=Hl(J),me=Ht(()=>({direction:Pe.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>R.day.value===Ul?a.div(n.value,100):1,display:B(()=>R.day.value===Ul?i(S,null,[X(n.value),s("%")]):"")}));return qt(()=>{R.day.value===Ul&&a.gte(n.value,100)&&R.completeDay()}),{name:e,day:Ul,color:t,foundationProgress:n,foundationConversion:o,milestones:J,collapseMilestones:fe,minWidth:700,buildFoundationHK:d,display:B(()=>i(S,null,[i("div",null,[R.day.value===Ul?"Complete the foundation to complete the day":`${e} Complete!`]),se(me),i(_e,null,null),i("div",null,[i("span",null,[s("The foundation is ")]),i("h2",{style:`color: ${t}; text-shadow: 0 0 10px ${t}`},[X(n.value)]),s("% completed")]),a.lt(n.value,100)?i(_e,null,null):null,se(r),i(_e,null,null),Q()]))}}),br="elves",Rl=4,Me=Rt(br,function(){const e="Elves",t="red",l="#911D21",o=Ht(()=>({direction:Pe.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>R.day.value===Rl?a.div(ie.value,6).times(.8333333333333334).add(a.div(a.add(q.coal.value,1).log10(),a.log10(1e9)).clamp(0,1).div(6)):1,display:B(()=>R.day.value===Rl?a.lt(ie.value,6)?i(S,null,[X(ie.value),s("/6 elves")]):i(S,null,[X(q.coal.value),s("/"),X(1e9),s(" coal")]):"")})),r=pr(()=>({thingsToReset:[ve,Dt,q],onReset(){setTimeout(()=>{Mt.earned.value?(ve.row1Upgrades.forEach(ee=>ee.bought.value=!0),ve.row2Upgrades.forEach(ee=>ee.bought.value=!0)):ze.earned.value&&(ve.row1Upgrades[4].bought.value=!0,ve.row2Upgrades[4].bought.value=!0),Te.earned.value&&(Dt.foundationProgress.value=100),mt.earned.value&&(q.warmerCutters.bought.value=!0,q.warmerPlanters.bought.value=!0,q.basicFertilizer.bought.value=!0,q.unlockBonfire.bought.value=!0,q.dedicatedCutters.bought.value=!0,q.dedicatedPlanters.bought.value=!0,q.betterFertilizer.bought.value=!0,q.unlockKiln.bought.value=!0,q.efficientSmelther.bought.value=!0)})}})),d=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.cuttersBook.amount.value,.1).add(1),description:"Now You're Logging!",enabled:()=>a.gt(te.books.cuttersBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),c=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.plantersBook.amount.value,.1).add(1),description:"The Man Who Planted Trees",enabled:()=>a.gt(te.books.plantersBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),p=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.expandersBook.amount.value,.1).add(1),description:"Logjam",enabled:()=>a.gt(te.books.expandersBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),m=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.heatedCuttersBook.amount.value,.1).add(1),description:"Fahrenheit 451",enabled:()=>a.gt(te.books.heatedCuttersBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),b=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.heatedPlantersBook.amount.value,.1).add(1),description:"Tillamook Burn Country",enabled:()=>a.gt(te.books.heatedPlantersBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),h=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.fertilizerBook.amount.value,.1).add(1),description:"The Garden Tree's Handbook",enabled:()=>a.gt(te.books.fertilizerBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),A=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.smallFireBook.amount.value,.1).add(1),description:"Firestarter",enabled:()=>a.gt(te.books.smallFireBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),v=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.bonfireBook.amount.value,.1).add(1),description:"An Arsonist's Guide to Writer's Homes in New England",enabled:()=>a.gt(te.books.bonfireBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),_=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.kilnBook.amount.value,.1).add(1),description:"Little Fires Everywhere",enabled:()=>a.gt(te.books.kilnBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),N=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.paperBook.amount.value,.1).add(1),description:"The Book Thief",enabled:()=>a.gt(te.books.paperBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),D=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.boxBook.amount.value,.1).add(1),description:"Not a box",enabled:()=>a.gt(te.books.boxBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),H=le(()=>[w(()=>({multiplier:2,description:"6 Elves Trained",enabled:Z.earned})),w(()=>({multiplier:()=>a.times(te.books.clothBook.amount.value,.1).add(1),description:"Fuzzy Bee and Friends",enabled:()=>a.gt(te.books.clothBook.amount.value,0)})),w(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ve.earned}))]),[M,E]=Zt(()=>[{title:"Holly Auto-Buy Frequency",modifier:d,base:10,unit:"/s",visible:ae.cuttersElf.bought},{title:"Ivy Auto-Buy Frequency",modifier:c,base:10,unit:"/s",visible:ae.plantersElf.bought},{title:"Hope Auto-Buy Frequency",modifier:p,base:10,unit:"/s",visible:ae.expandersElf.bought},{title:"Jack Auto-Buy Frequency",modifier:m,base:10,unit:"/s",visible:ae.heatedCuttersElf.bought},{title:"Mary Auto-Buy Frequency",modifier:b,base:10,unit:"/s",visible:ae.heatedPlantersElf.bought},{title:"Noel Auto-Buy Frequency",modifier:h,base:10,unit:"/s",visible:ae.fertilizerElf.bought},{title:"Joy Auto-Buy Frequency",modifier:A,base:10,unit:"/s",visible:ae.smallFireElf.bought},{title:"Faith Auto-Buy Frequency",modifier:v,base:10,unit:"/s",visible:ae.bonfireElf.bought},{title:"Snowball Auto-Buy Frequency",modifier:_,base:10,unit:"/s",visible:ae.kilnElf.bought},{title:"Star Auto-Buy Frequency",modifier:N,base:10,unit:"/s",visible:ae.paperElf.bought},{title:"Bell Auto-Buy Frequency",modifier:D,base:10,unit:"/s",visible:ae.boxElf.bought},{title:"Gingersnap Auto-Buy Frequency",modifier:H,base:10,unit:"/s",visible:ae.clothElf.bought}]),T=V(!1),J=B(()=>i(wt,{modelValue:T.value,"onUpdate:modelValue":ee=>T.value=ee},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:M})),fe=f(()=>{let ee=a.pow(4,ie.value).times(1e6);return a.gte(ie.value,9)&&(ee=a.times(ee,1e15)),ee});function Q(ee){var Lt;const it=Se(0),vt=Se(0),Ct=ee.hasToggle?Se(!1):V(!0),el=f(()=>ee.cooldownModifier.apply(10)),Ft=Et((Lt=ee.canBuy)!=null?Lt:!0);function ft(xt){if(gt.bought.value&&u(Ft)){it.value=a.add(it.value,xt);const jt=a.recip(el.value);vt.value+=xt/jt.toNumber(),(_a(ee.buyable)?ee.buyable:[ee.buyable]).forEach(tl=>{var wl;for(;a.gte(it.value,jt);)if(ee.customCost==null?u(tl.canPurchase):a.gte(tl.resource.value,ee.customCost(tl.amount.value)))tl.amount.value=a.add(tl.amount.value,1),it.value=a.sub(it.value,jt),(wl=ee.onAutoPurchase)==null||wl.call(ee);else{it.value=jt;break}})}}const gt=O(()=>({...ee,buyable:void 0,toggle:Ct,buyProgress:it,update:ft,resource:q.coal,cost:fe,computedAutoBuyCooldown:el,amountOfTimesDone:vt,name:ee.name,display:()=>({title:ee.name,description:B(()=>i(S,null,[ee.description,gt.bought.value?null:i(S,null,[" ",s("Training this elf will require resetting all your progress from days 1-3.")]),gt.bought.value&&ee.hasToggle===!0?i(S,null,[i(nl,{title:ee.toggleDesc,"onUpdate:modelValue":xt=>Ct.value=xt,modelValue:Ct.value},null)]):null])),showCost:!gt.bought.value}),style:"width: 190px",onPurchase(){var xt;(xt=ee.onPurchase)==null||xt.call(ee),r.reset()}}));return gt}const me=Q({name:"Holly",description:"Holly will automatically purchase cutters you can afford, without actually spending any logs.",buyable:ve.row1Buyables[0],cooldownModifier:d}),ne=Q({name:"Ivy",description:"Ivy will automatically purchase planters you can afford, without actually spending any logs.",buyable:ve.row1Buyables[1],cooldownModifier:c}),Ge=Q({name:"Hope",description:"Hope will automatically purchase forest expanders you can afford, without actually spending any logs.",buyable:ve.row1Buyables[2],cooldownModifier:p}),Be=[me,ne,Ge],K=Q({name:"Jack",description:"Jack will automatically purchase heated cutters you can afford, without actually spending any coal.",buyable:q.heatedCutters,cooldownModifier:m}),Ce=Q({name:"Mary",description:"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",buyable:q.heatedPlanters,cooldownModifier:b}),Le=Q({name:"Noel",description:"Noel will automatically purchase fertilized soil you can afford, without actually spending any ash.",buyable:q.moreFertilizer,cooldownModifier:h}),ke=[K,Ce,Le],xe=Q({name:"Joy",description:"Joy will automatically purchase small fires you can afford, without actually spending any logs. You can toggle whether or not to enable the purchased small fires automatically. Small fires will start giving a boost to ash and coal gain.",buyable:q.buildFire,cooldownModifier:A,visibility:()=>y(et.upgrades.logsUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased small fires",onAutoPurchase(){xe.toggle.value&&(q.activeFires.value=a.add(q.activeFires.value,1))},onPurchase(){R.days[4].recentlyUpdated.value=!0}}),Fe=Q({name:"Faith",description:"Faith will automatically purchase bonfires you can afford. You can toggle whether or not to enable the purchased bonfires automatically. Bonfires will start giving a boost to ash and coal gain.",buyable:q.buildBonfire,cooldownModifier:v,visibility:()=>y(et.upgrades.ashUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased bonfires",onAutoPurchase(){const ee=u(this.buyable.cost);q.activeFires.value=a.sub(q.activeFires.value,ee).max(0),q.buildFire.amount.value=a.sub(q.buildFire.amount.value,ee).max(0),Fe.toggle.value&&(q.activeBonfires.value=a.add(q.activeBonfires.value,1))},onPurchase(){R.days[4].recentlyUpdated.value=!0},canBuy:q.unlockBonfire.bought}),W=Q({name:"Snowball",description:"Snowball will automatically purchase kilns you can afford, without actually spending any logs. You can toggle whether or not to enable the purchased kilns automatically. Kilns will start giving a boost to ash and coal gain.",buyable:q.buildKiln,cooldownModifier:_,visibility:()=>y(et.upgrades.coalUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased kilns",onAutoPurchase(){W.toggle.value&&(q.activeKilns.value=a.add(q.activeKilns.value,1))},onPurchase(){R.days[4].recentlyUpdated.value=!0},canBuy:q.unlockKiln.bought}),ge=[xe,Fe,W],oe=Q({name:"Star",description:"Star will automatically purchase all books you can afford, without actually spending any paper.",buyable:Object.values(te.books),cooldownModifier:N,visibility:()=>y(He.elfUpgrades.paperElf.bought.value)}),We=Q({name:"Bell",description:"Bell will automatically purchase all box buyables you can afford, without actually spending any boxes.",buyable:Object.values(et.buyables),cooldownModifier:D,visibility:()=>y(He.elfUpgrades.boxElf.bought.value)}),Je=Q({name:"Gingersnap",description:"Gingersnap will automatically purchase all cloth buyables you can afford, without actually spending any resources.",buyable:[tt.buildPens,tt.betterShears,tt.fasterSpinning],cooldownModifier:H,visibility:()=>y(He.elfUpgrades.clothElf.bought.value)}),At=[oe,We,Je],ae={cuttersElf:me,plantersElf:ne,expandersElf:Ge,heatedCuttersElf:K,heatedPlantersElf:Ce,fertilizerElf:Le,smallFireElf:xe,bonfireElf:Fe,kilnElf:W,paperElf:oe,boxElf:We,clothElf:Je},ie=f(()=>Object.values(ae).filter(ee=>ee.bought.value).length),Ue=P(()=>({display:{requirement:"1 Elf Trained",effectDisplay:"Manual cutting and planting can happen twice as often for each trained elf"},shouldEarn:()=>a.gte(ie.value,1)})),ze=P(()=>({display:{requirement:"2 Elves Trained",effectDisplay:"Research I & II aren't reset after training"},shouldEarn:()=>a.gte(ie.value,2),visibility:()=>y(Ue.earned.value)})),he=P(()=>({display:{requirement:"3 Elves Trained",effectDisplay:"Coal gain is raised to the 1.25"},shouldEarn:()=>a.gte(ie.value,3),visibility:()=>y(ze.earned.value)})),pt=P(()=>({display:{requirement:"4 Elves Trained",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(ie.value,4),visibility:()=>y(he.earned.value)})),st=P(()=>({display:{requirement:"5 Elves Trained",effectDisplay:"Forest is twice as large"},shouldEarn:()=>a.gte(ie.value,5),visibility:()=>y(pt.earned.value)})),Z=P(()=>({display:{requirement:"6 Elves Trained",effectDisplay:"Elves work twice as fast"},shouldEarn:()=>a.gte(ie.value,6),visibility:()=>y(st.earned.value)})),Te=P(()=>({display:{requirement:"7 Elves Trained",effectDisplay:"Workshop Foundation starts at 100% complete after training"},shouldEarn:()=>a.gte(ie.value,7),visibility:()=>y(Z.earned.value&&R.day.value>5)})),re=P(()=>({display:{requirement:"8 Elves Trained",effectDisplay:"Forest is twice as large (again)"},shouldEarn:()=>a.gte(ie.value,8),visibility:()=>y(Te.earned.value)})),Mt=P(()=>({display:{requirement:"9 Elves Trained",effectDisplay:"Trees upgrades aren't reset after training"},shouldEarn:()=>a.gte(ie.value,9),visibility:()=>y(re.earned.value)})),Ve=P(()=>({display:{requirement:"10 Elves Trained",effectDisplay:"Elves work twice as fast (again)"},shouldEarn:()=>a.gte(ie.value,10),visibility:()=>y(R.day.value>=10)})),mt=P(()=>({display:{requirement:"11 Elves Trained",effectDisplay:"Coal upgrades aren't reset after training"},shouldEarn:()=>a.gte(ie.value,11),visibility:()=>y(Ve.earned.value)})),Nt=P(()=>({display:{requirement:"12 Elves Trained",effectDisplay:"Double coal gain"},shouldEarn:()=>a.gte(ie.value,12),visibility:()=>y(mt.earned.value)})),$=[Ue,ze,he,pt,st,Z,Te,re,Mt,Ve,mt,Nt],ue={manualMilestone:Ue,researchMilestone:ze,coalGainMilestone:he,logGainMilestone:pt,forestMilestone:st,elvesMilestone:Z,foundationMilestone:Te,forestMilestone2:re,treeUpgradesMilestone:Mt,elvesMilestone2:Ve,coalUpgradesMilestone:mt,coalGainMilestone2:Nt},{collapseMilestones:j,display:Ie}=Hl(ue);return Xe.on("update",ee=>{a.lt(R.day.value,Rl)||Object.values(ae).forEach(it=>it.update(ee))}),qt(()=>{R.day.value===Rl&&a.gte(ie.value,6)&&a.gte(q.coal.value,1e9)&&R.completeDay()}),{name:e,color:t,elves:ae,totalElves:ie,milestones:$,collapseMilestones:j,generalTabCollapsed:E,minWidth:700,display:B(()=>i(S,null,[i("div",null,[R.day.value===Rl?`Reach ${X(6)} trained elves and ${X(1e9)} ${q.coal.displayName} to complete the day`:`${e} Complete!`," ",s("-")," ",i("button",{class:"button",style:"display: inline-block;",onClick:()=>T.value=!0},[s("Check Modifiers")])]),se(o),se(J),i(_e,null,null),i("div",{style:"width: 600px"},[Bl(Be,ke,ge,At)]),Ie()]))}}),wr="management",Ol=12,Oe=Rt(wr,()=>{const e="Management",t="green",l=Ht(()=>({direction:Pe.Right,width:600,height:25,fillStyle:`backgroundColor: ${t}`,progress:()=>R.day.value===Ol?n.value/(Me.totalElves.value*5):1,display:B(()=>R.day.value===Ol?i(S,null,[X(n.value),s("/"),X(Me.totalElves.value*5)," ",s("elf levels")]):"")})),n=f(()=>{let j=0;for(const Ie of Object.values(At))j+=Ie.level.value;return j}),o=O(()=>({display:{title:"Teach the Elves",description:"The Elves probably need to be taught if they're to do better. Maybe you'll build a school so you can teach them?"},resource:ve.logs,cost:1e21})),r=O(()=>({display:{title:"Add a Classroom?",description:"Yay, you have a school. Too bad it has pretty much nothing in it. Maybe you could add some classrooms to make it less boring and more enticing to the Elves?"},visibility:()=>y(o.bought.value),resource:et.boxes,style:"width: 150px",cost:1e13})),d=le(()=>[w(()=>({multiplier:()=>Mt.value,description:"Classroom Effect",enabled:()=>r.bought.value}))]),c=d.apply(1);function p(j,Ie,...ee){const it=Se(0),vt=f(()=>a.pow(10,Ct.value).mul(1e4)),Ct=f(()=>a.min(a.mul(9,it.value).div(1e4).add(1).log10().floor(),Te.amount.value).toNumber()),el=f(()=>a.sub(it.value,a.pow(10,Ct.value).sub(1).div(9).mul(1e4))),Ft=Ht(()=>({direction:Pe.Right,width:160,height:12,style:()=>({"margin-top":"8px","box-shadow":ie.value[j.name]?"0 0 12px "+(J.value==j.name?"black":"white"):""}),baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",borderStyle:()=>a.gte(Ct.value,Te.amount.value)?"border-color: red":"",progress:()=>a.div(el.value,vt.value),display:B(()=>a.gte(Ct.value,Te.amount.value)?i(S,null,[s("Limit reached")]):i(S,null,[L(el.value),s("/"),L(vt.value),s(" XP")]))})),{collapseMilestones:ft,display:gt}=Hl(Ie),Lt=le(()=>[w(()=>({multiplier:c,description:"Global XP Multiplier"})),w(()=>({multiplier:ae,description:"Focus Multiplier",enabled:()=>Ue.value<=0&&ie.value[j.name]==!0})),...ee]),xt=f(()=>Lt.apply(.1));return Pt(()=>({display:{title:j.name,description:B(()=>i(S,null,[j.name,s(" is currently at level "),X(Ct.value),s(", and achieved a total of "),L(it.value),s(" XP. They buy buyables "),X(j.computedAutoBuyCooldown.value),s(" times per second, gaining")," ",a.gte(Ct.value,Te.amount.value)?0:L(a.mul(xt.value,j.computedAutoBuyCooldown.value))," ",s("XP/sec."),se(Ft)]))},style:()=>({width:"190px",background:J.value==j.name?"var(--foreground)":""}),onClick(){J.value=j.name},canClick(){return J.value!==j.name},name:j.name,state:ft,displayMilestone:gt,level:Ct,exp:it,milestones:Ie,timeForExp:j.computedAutoBuyCooldown,amountOfTimesDone:j.amountOfTimesDone,elfXPGainComputed:xt,elfXPGain:Lt}))}const m=[P(()=>({display:{requirement:"Holly Level 1",effectDisplay:B(()=>i(S,null,[s("Multiply log gain by ("),i(pl,null,{default:()=>[s("Cutter amount")]}),s(")"),i("sup",null,[s("3")]),s(".")]))},shouldEarn:()=>Q.level.value>=1})),P(()=>({display:{requirement:"Holly Level 2",effectDisplay:"Holly now buys max."},visibility:()=>y(m[0].earned.value),shouldEarn:()=>Q.level.value>=2})),P(()=>({display:{requirement:"Holly Level 3",effectDisplay:B(()=>i(S,null,[s("Multiply all cloth actions' effectiveness by ("),i(pl,null,{default:()=>[s("Cutter amount")]}),s(")"),i("sup",null,[s("3")]),s(".")]))},visibility:()=>y(m[1].earned.value),shouldEarn:()=>Q.level.value>=3})),P(()=>({display:{requirement:"Holly Level 4",effectDisplay:"Multiply cutting speed by 1.1 per day completed"},visibility:()=>y(m[2].earned.value&&R.day.value>=13),shouldEarn:()=>Q.level.value>=4})),P(()=>({display:{requirement:"Holly Level 5",effectDisplay:"Raise workshop expansion cost by 0.95"},visibility:()=>y(m[3].earned.value&&R.day.value>=13),shouldEarn:()=>Q.level.value>=5}))],b=[P(()=>({display:{requirement:"Ivy Level 1",effectDisplay:"Planters are now twice as efficent."},shouldEarn:()=>me.level.value>=1})),P(()=>({display:{requirement:"Ivy Level 2",effectDisplay:"Ivy now buys max."},visibility:()=>y(b[0].earned.value),shouldEarn:()=>me.level.value>=2})),P(()=>({display:{requirement:"Ivy Level 3",effectDisplay:B(()=>i(S,null,[s("Planting speed is multiplied by 2"),i("sup",null,[s("(log"),i("sub",null,[s("10")]),s("(logs)"),i("sup",null,[s("0.2")]),s(")")])]))},visibility:()=>y(b[1].earned.value),shouldEarn:()=>me.level.value>=3})),P(()=>({display:{requirement:"Ivy Level 4",effectDisplay:"Divide planter cost by 10"},visibility:()=>y(b[2].earned.value&&R.day.value>=13),shouldEarn:()=>me.level.value>=4})),P(()=>({display:{requirement:"Ivy Level 5",effectDisplay:"Boost planting/cutting speed based on which is falling behind"},visibility:()=>y(b[3].earned.value&&R.day.value>=13),shouldEarn:()=>me.level.value>=5}))],h=[P(()=>({display:{requirement:"Hope Level 1",effectDisplay:"Planting speed boosts forest size"},shouldEarn:()=>ne.level.value>=1})),P(()=>({display:{requirement:"Hope Level 2",effectDisplay:"Hope now buys max."},visibility:()=>y(h[0].earned.value),shouldEarn:()=>ne.level.value>=2})),P(()=>({display:{requirement:"Hope Level 3",effectDisplay:"The workshop can be expanded past 100%, but costs scale faster."},visibility:()=>y(h[1].earned.value),shouldEarn:()=>ne.level.value>=3})),P(()=>({display:{requirement:"Hope Level 4",effectDisplay:"Unlock an elf that autobuys mining drills."},visibility:()=>y(h[2].earned.value&&R.day.value>=13),shouldEarn:()=>ne.level.value>=4})),P(()=>({display:{requirement:"Hope Level 5",effectDisplay:"Unlock an elf that autobuys metal buyables."},visibility:()=>y(h[3].earned.value&&R.day.value>=13),shouldEarn:()=>ne.level.value>=5}))],A=[P(()=>({display:{requirement:"Jack Level 1",effectDisplay:"Heated cutters are less expensive."},shouldEarn:()=>Be.level.value>=1})),P(()=>({display:{requirement:"Jack Level 2",effectDisplay:"Coal gain is raised to the ^1.05"},visibility:()=>y(A[0].earned.value),shouldEarn:()=>Be.level.value>=2})),P(()=>({display:{requirement:"Jack Level 3",effectDisplay:"Jack now buys max."},visibility:()=>y(A[1].earned.value),shouldEarn:()=>Be.level.value>=3})),P(()=>({display:{requirement:"Jack Level 4",effectDisplay:"Oil gain is multiplied based on total elf levels."},visibility:()=>y(A[2].earned.value&&R.day.value>=13),shouldEarn:()=>Be.level.value>=4})),P(()=>({display:{requirement:"Jack Level 5",effectDisplay:"Unlock an elf that autobuys oil buyables."},visibility:()=>y(A[3].earned.value&&R.day.value>=13),shouldEarn:()=>Be.level.value>=5}))],v=[P(()=>({display:{requirement:"Mary Level 1",effectDisplay:"Heated planters are less expensive."},shouldEarn:()=>K.level.value>=1})),P(()=>({display:{requirement:"Mary Level 2",effectDisplay:"Double tree planting speed"},visibility:()=>y(v[0].earned.value),shouldEarn:()=>K.level.value>=2})),P(()=>({display:{requirement:"Mary Level 3",effectDisplay:"Mary now buys max."},visibility:()=>y(v[1].earned.value),shouldEarn:()=>K.level.value>=3})),P(()=>({display:{requirement:"Mary Level 4",effectDisplay:"Metal gain is raised to the 1.1."},visibility:()=>y(v[2].earned.value&&R.day.value>=13),shouldEarn:()=>K.level.value>=4})),P(()=>({display:{requirement:"Mary Level 5",effectDisplay:B(()=>i(S,null,[s("Auto smelting speed is multiplied by "),i(pl,null,{default:()=>[s("total XP/1000")]}),s(".")]))},visibility:()=>y(v[3].earned.value&&R.day.value>=13),shouldEarn:()=>K.level.value>=5}))],_=[P(()=>({display:{requirement:"Noel Level 1",effectDisplay:"Log gain is increased based on total elf level."},shouldEarn:()=>K.level.value>=1})),P(()=>({display:{requirement:"Noel Level 2",effectDisplay:"Fertilized soil is less expensive"},visibility:()=>y(_[0].earned.value),shouldEarn:()=>K.level.value>=2})),P(()=>({display:{requirement:"Noel Level 3",effectDisplay:"Divide the mining drill cost by ln(Total logs + e)"},visibility:()=>y(_[1].earned.value),shouldEarn:()=>K.level.value>=3})),P(()=>({display:{requirement:"Noel Level 4",effectDisplay:B(()=>i(S,null,[s("Reduce oil refinery cost by (Plastic amount)"),i("sup",null,[s("2")])]))},visibility:()=>y(_[2].earned.value&&R.day.value>=13),shouldEarn:()=>K.level.value>=4})),P(()=>({display:{requirement:"Noel Level 5",effectDisplay:"Unlock an elf that autobuys drills and extractors"},visibility:()=>y(_[3].earned.value&&R.day.value>=13),shouldEarn:()=>K.level.value>=5}))],N=[P(()=>({display:{requirement:"Joy Level 1",effectDisplay:"Multiply small fire efficiency by 5."},shouldEarn:()=>ke.level.value>=1})),P(()=>({display:{requirement:"Joy Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>y(N[0].earned.value),shouldEarn:()=>ke.level.value>=2})),P(()=>({display:{requirement:"Joy Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>y(N[1].earned.value),shouldEarn:()=>ke.level.value>=3})),P(()=>({display:{requirement:"Joy Level 4",effectDisplay:"Metal gain is boosted by heavy drills"},visibility:()=>y(N[2].earned.value&&R.day.value>=13),shouldEarn:()=>ke.level.value>=4})),P(()=>({display:{requirement:"Joy Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>y(N[3].earned.value&&R.day.value>=13),shouldEarn:()=>ke.level.value>=5}))],D=[P(()=>({display:{requirement:"Faith Level 1",effectDisplay:"Multiply bonfire efficiency by 5."},shouldEarn:()=>xe.level.value>=1})),P(()=>({display:{requirement:"Faith Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>y(D[0].earned.value),shouldEarn:()=>xe.level.value>=2})),P(()=>({display:{requirement:"Faith Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>y(D[1].earned.value),shouldEarn:()=>xe.level.value>=3})),P(()=>({display:{requirement:"Faith Level 4",effectDisplay:"Oil gain is boosted by heavy drill drills"},visibility:()=>y(D[2].earned.value&&R.day.value>=13),shouldEarn:()=>xe.level.value>=4})),P(()=>({display:{requirement:"Faith Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>y(D[3].earned.value&&R.day.value>=13),shouldEarn:()=>xe.level.value>=5}))],H=[P(()=>({display:{requirement:"Snowball Level 1",effectDisplay:"Multiply kiln efficiency by 5."},shouldEarn:()=>Fe.level.value>=1})),P(()=>({display:{requirement:"Snowball Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>y(H[0].earned.value),shouldEarn:()=>Fe.level.value>=2})),P(()=>({display:{requirement:"Snowball Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>y(H[1].earned.value),shouldEarn:()=>Fe.level.value>=3})),P(()=>({display:{requirement:"Snowball Level 4",effectDisplay:"Plastic gain is boosted by heavy extractors"},visibility:()=>y(H[2].earned.value&&R.day.value>=13),shouldEarn:()=>Fe.level.value>=4})),P(()=>({display:{requirement:"Snowball Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>y(H[3].earned.value&&R.day.value>=13),shouldEarn:()=>Fe.level.value>=5}))],M=[P(()=>({display:{requirement:"Star Level 1",effectDisplay:"Book cost is divided by total books bought."},shouldEarn:()=>ge.level.value>=1})),P(()=>({display:{requirement:"Star Level 2",effectDisplay:"Pulp requires 10x less ash"},visibility:()=>y(M[0].earned.value),shouldEarn:()=>ge.level.value>=2})),P(()=>({display:{requirement:"Star Level 3",effectDisplay:"Book cost scaling 5x -> 4x"},visibility:()=>y(M[1].earned.value),shouldEarn:()=>ge.level.value>=3})),P(()=>({display:{requirement:"Star Level 4",effectDisplay:B(()=>i(S,null,[s("Multiply XP requirements by 0.95"),i("sup",null,[s("(total books)")])]))},visibility:()=>y(M[2].earned.value&&R.day.value>=13),shouldEarn:()=>ge.level.value>=4})),P(()=>({display:{requirement:"Star Level 5",effectDisplay:"Gain 5 free books for all elves that are at level 5 or above."},visibility:()=>y(M[3].earned.value&&R.day.value>=13),shouldEarn:()=>ge.level.value>=5}))],E=[P(()=>({display:{requirement:"Bell Level 1",effectDisplay:B(()=>i(S,null,[s("Every box buyable adds "),i(pl,null,{default:()=>[s("level")]}),s(" levels to same-row box buyables.")]))},shouldEarn:()=>oe.level.value>=1})),P(()=>({display:{requirement:"Bell Level 2",effectDisplay:"Box gain ^1.1"},visibility:()=>y(E[0].earned.value),shouldEarn:()=>oe.level.value>=2})),P(()=>({display:{requirement:"Bell Level 3",effectDisplay:"All box buyables scaling bases -1"},visibility:()=>y(E[1].earned.value),shouldEarn:()=>oe.level.value>=3})),P(()=>({display:{requirement:"Bell Level 4",effectDisplay:"Unlock a second row of box buyables"},visibility:()=>y(E[2].earned.value&&R.day.value>=13),shouldEarn:()=>oe.level.value>=4})),P(()=>({display:{requirement:"Bell Level 5",effectDisplay:"Unlock another row of box upgrades"},visibility:()=>y(E[3].earned.value&&R.day.value>=13),shouldEarn:()=>oe.level.value>=5}))],T=[P(()=>({display:{requirement:"Gingersnap Level 1",effectDisplay:"Multiply all primary dye colors by ln(cloth + e)."},shouldEarn:()=>We.level.value>=1})),P(()=>({display:{requirement:"Gingersnap Level 2",effectDisplay:B(()=>i(S,null,[s("Multiply all cloth actions' effectiveness by log"),i("sub",null,[s("10")]),s("(dye sum + 10)")]))},visibility:()=>y(T[0].earned.value),shouldEarn:()=>We.level.value>=2})),P(()=>({display:{requirement:"Gingersnap Level 3",effectDisplay:"Double all dye colors and cloth actions, but reset all dyes."},visibility:()=>y(T[1].earned.value),shouldEarn:()=>We.level.value>=3,onComplete(){["red","yellow","blue","orange","green","purple"].forEach(j=>{qe.dyes[j].amount.value=0,qe.dyes[j].buyable.amount.value=0})}})),P(()=>({display:{requirement:"Gingersnap Level 4",effectDisplay:B(()=>i(S,null,[s("Multiply ALL dye gain by")," ",i(tr,null,{default:()=>[i("div",null,[i(pl,null,{default:()=>[s("classrooms")]})]),i("div",null,[s("2")])]}),s("+1, but reset all dyes.")]))},visibility:()=>y(T[2].earned.value&&R.day.value>=13),shouldEarn:()=>We.level.value>=4,onComplete(){["red","yellow","blue","orange","green","purple"].forEach(j=>{qe.dyes[j].amount.value=0,qe.dyes[j].buyable.amount.value=0})}})),P(()=>({display:{requirement:"Gingersnap Level 5",effectDisplay:"Well depth divides metal machine costs"},visibility:()=>y(T[3].earned.value&&R.day.value>=13),shouldEarn:()=>We.level.value>=5}))],J=Se("Holly"),fe=B(()=>{const j=Object.values(At).find(Ie=>Ie.name===J.value);return j==null?(console.warn("This should not happen.",J.value),""):i(S,null,[J.value,s("'s milestones: "),j.displayMilestone()])}),Q=p(Me.elves.cuttersElf,m),me=p(Me.elves.plantersElf,b),ne=p(Me.elves.expandersElf,h),Ge=[Q,me,ne],Be=p(Me.elves.heatedCuttersElf,A),K=p(Me.elves.heatedPlantersElf,v),Ce=p(Me.elves.fertilizerElf,_),Le=[Be,K,Ce],ke=p(Me.elves.smallFireElf,N),xe=p(Me.elves.bonfireElf,D),Fe=p(Me.elves.kilnElf,H),W=[ke,xe,Fe],ge=p(Me.elves.paperElf,M),oe=p(Me.elves.boxElf,E),We=p(Me.elves.clothElf,T),Je=[ge,oe,We],At={cutterElfTraining:Q,planterElfTraining:me,expandersElfTraining:ne,heatedCutterElfTraining:Be,heatedPlanterElfTraining:K,fertilizerElfTraining:Ce,smallfireElfTraining:ke,bonfireElfTraining:xe,kilnElfTraining:Fe,paperElfTraining:ge,boxElfTraining:oe,clothElfTraining:We};Xe.on("update",j=>{if(!(R.day.value<Ol)){for(const Ie of Object.values(At)){const ee=Math.floor(Ie.amountOfTimesDone.value);ee>=1&&(Ie.amountOfTimesDone.value-=ee,a.lt(Ie.level.value,Te.amount.value)&&(Ie.exp.value=a.mul(Ie.elfXPGainComputed.value,ee).add(Ie.exp.value)))}Ue.value>0?(Ue.value+=j,ae.value=a.pow(ze.value,1-Math.abs(Math.sin((Ue.value-1)*3))),st(12,3)):Ue.value=Math.min(Ue.value+j,0)}});const ae=Se(1),ie=Se({}),Ue=Se(0),ze=f(()=>10),he=Ht(()=>({direction:Pe.Right,width:566,height:25,style:"border-radius: 4px 4px 0 0",borderStyle:"border-radius: 4px 4px 0 0",fillStyle:`background: ${t}; transition: none`,progress:()=>a.sub(ae.value,1).div(a.sub(ze.value,1)).toNumber(),display:B(()=>i(S,null,[L(ae.value),s("x")]))})),pt=Pt(()=>({display:{title:"Focus",description:B(()=>i(S,null,[Ue.value<=0?i(S,null,[s("Motivate elves to focus, multiplying 3 random elves' XP gain by up to "),L(ze.value),s("x")]):"Click to stop the focus bar",Ue.value<0?i(S,null,[i("br",null,null),s("Reroll cooldown: "),Wl(-Ue.value)]):""]))},style:{width:"300px"},canClick:()=>Ue.value>=0,onClick(){Ue.value==0?Ue.value=1:Ue.value>0&&(Ue.value=-30)}}));function st(j,Ie){var it,vt;let ee=0;for(ie.value={},Ie=Math.min(Ie,j);ee<Ie;){const Ct=(vt=(it=Object.values(At)[Math.floor(Math.random()*j)])==null?void 0:it.name)!=null?vt:"";ie.value[Ct]||(ie.value[Ct]=!0,ee++)}}const Z=f(()=>{const j=a.pow(10,Te.amount.value);return{wood:j.mul(1e21),coal:j.mul(1e32),paper:j.mul(1e19),boxes:j.mul(1e13),metalIngots:j.mul(1e12),cloth:j.mul(1e4),plastic:j.mul(1e6),dye:a.add(Te.amount.value,1).mul(1e4)}}),Te=Re(()=>({display:B(()=>i(S,null,[i("h3",null,[s("Build a School")]),i("div",null,[s("You gotta start somewhere, right? Each school increases the maximum level for elves by 1, up to 5.")]),i("div",null,[s("You have "),X(Te.amount.value),s(" schools, which are currently letting elves learn up to level")," ",X(Te.amount.value),s(".")]),i("div",null,[s("Costs "),L(Z.value.wood),s(" logs, "),L(Z.value.coal)," ",s("coal, "),L(Z.value.paper),s(" paper, "),L(Z.value.boxes)," ",s("boxes, "),L(Z.value.metalIngots),s(" metal ingots,")," ",L(Z.value.cloth),s(" cloth, "),L(Z.value.plastic)," ",s("plastic, and requires "),L(Z.value.dye),s(" of red, yellow, and blue dye")])])),canPurchase(){return Z.value.wood.lte(ve.logs.value)&&Z.value.coal.lte(q.coal.value)&&Z.value.paper.lte(te.paper.value)&&Z.value.boxes.lte(et.boxes.value)&&Z.value.metalIngots.lte(lt.metal.value)&&Z.value.cloth.lte(tt.cloth.value)&&Z.value.plastic.lte(He.plastic.value)&&Z.value.dye.lte(qe.dyes.blue.amount.value)&&Z.value.dye.lte(qe.dyes.red.amount.value)&&Z.value.dye.lte(qe.dyes.yellow.amount.value)},onPurchase(){ve.logs.value=a.sub(ve.logs.value,Z.value.wood),q.coal.value=a.sub(q.coal.value,Z.value.coal),te.paper.value=a.sub(te.paper.value,Z.value.paper),et.boxes.value=a.sub(et.boxes.value,Z.value.boxes),lt.metal.value=a.sub(lt.metal.value,Z.value.metalIngots),tt.cloth.value=a.sub(tt.cloth.value,Z.value.cloth),He.plastic.value=a.sub(He.plastic.value,Z.value.plastic),this.amount.value=a.add(this.amount.value,1)},purchaseLimit:5,visibility:f(()=>y(o.bought.value)),style:"width: 600px"})),re=f(()=>{const j=a.add(Te.amount.value,1).pow(1.5);return{wood:j.mul(1e21),coal:j.mul(1e32),paper:j.mul(1e19),boxes:j.mul(1e13),metalIngots:j.mul(1e12),cloth:j.mul(1e4),plastic:j.mul(1e6),dye:j.mul(1e4)}}),Mt=f(()=>a.add(Ve.amount.value,1).sqrt()),Ve=Re(()=>({display:B(()=>i(S,null,[i("h3",null,[s("Build a Classroom")]),i("div",null,[s("Hopefully it makes the school a bit less boring. Multiplies elves' XP gain by")," ",i(pl,null,{default:()=>[s("Classrooms + 1")]}),s(".")]),i("div",null,[s("You have "),X(Te.amount.value),s(" classrooms, which are currently multiplying elves' XP gain by "),L(Mt.value)]),i("div",null,[s("Costs "),L(re.value.wood),s(" logs,")," ",L(re.value.coal),s(" coal, "),L(re.value.paper)," ",s("paper, "),L(re.value.boxes),s(" boxes,")," ",L(re.value.metalIngots),s(" metal ingots,")," ",L(re.value.cloth),s(" cloth, "),L(re.value.plastic)," ",s("plastic, and requires "),L(re.value.dye),s(" of red, yellow, and blue dye")])])),canPurchase(){return re.value.wood.lte(ve.logs.value)&&re.value.coal.lte(q.coal.value)&&re.value.paper.lte(te.paper.value)&&re.value.boxes.lte(et.boxes.value)&&re.value.metalIngots.lte(lt.metal.value)&&re.value.cloth.lte(tt.cloth.value)&&re.value.plastic.lte(He.plastic.value)&&re.value.dye.lte(qe.dyes.blue.amount.value)&&re.value.dye.lte(qe.dyes.red.amount.value)&&re.value.dye.lte(qe.dyes.yellow.amount.value)},onPurchase(){ve.logs.value=a.sub(ve.logs.value,re.value.wood),q.coal.value=a.sub(q.coal.value,re.value.coal),te.paper.value=a.sub(te.paper.value,re.value.paper),et.boxes.value=a.sub(et.boxes.value,re.value.boxes),lt.metal.value=a.sub(lt.metal.value,re.value.metalIngots),tt.cloth.value=a.sub(tt.cloth.value,re.value.cloth),He.plastic.value=a.sub(He.plastic.value,re.value.plastic),this.amount.value=a.add(this.amount.value,1)},visibility:f(()=>y(r.bought.value)),style:"width: 600px"})),[mt,Nt]=Zt(()=>[{title:"Global XP Gain",modifier:d,unit:" XP"},{title:"Holly XP Gain per Action",modifier:Q.elfXPGain,base:.1,unit:" XP"},{title:"Ivy XP Gain per Action",modifier:me.elfXPGain,base:.1,unit:" XP"},{title:"Hope XP Gain per Action",modifier:ne.elfXPGain,base:.1,unit:" XP"},{title:"Jack XP Gain per Action",modifier:Be.elfXPGain,base:.1,unit:" XP"},{title:"Mary XP Gain per Action",modifier:K.elfXPGain,base:.1,unit:" XP"},{title:"Noel XP Gain per Action",modifier:Ce.elfXPGain,base:.1,unit:" XP"},{title:"Joy XP Gain per Action",modifier:ke.elfXPGain,base:.1,unit:" XP"},{title:"Faith XP Gain per Action",modifier:xe.elfXPGain,base:.1,unit:" XP"},{title:"Snowball XP Gain per Action",modifier:Fe.elfXPGain,base:.1,unit:" XP"},{title:"Star XP Gain per Action",modifier:ge.elfXPGain,base:.1,unit:" XP"},{title:"Bell XP Gain per Action",modifier:oe.elfXPGain,base:.1,unit:" XP"},{title:"Gingersnap XP Gain per Action",modifier:We.elfXPGain,base:.1,unit:" XP"}]),$=V(!1),ue=B(()=>i(wt,{modelValue:$.value,"onUpdate:modelValue":j=>$.value=j},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:mt}));return{name:e,day:Ol,color:t,minWidth:700,elfTraining:At,currentShown:J,generalTabCollapsed:Nt,teaching:o,schools:Te,classrooms:Ve,classroomUpgrade:r,focusMultiplier:ae,focusTargets:ie,focusRolling:Ue,display:B(()=>i(S,null,[R.day.value===Ol?"Get all elves to level 5.":`${e} Complete!`,s(" -"),i("button",{class:"button",style:"display: inline-block;",onClick:()=>$.value=!0},[s("Check Modifiers")]),se(ue),se(l),i("br",null,null),Vt(Te,Ve)," ",Bl([o,r]),a.gt(Te.amount.value,0)?i(S,null,[i("br",null,null),s("Click on an elf to see their milestones."),i("br",null,null),i("br",null,null),se(pt),i("br",null,null),Bl([he],Ge,Le,W,Je),i(_e,null,null),fe()]):""]))}}),Ar="cloth",an=8,tt=Rt(Ar,function(){const e="Cloth",t="white",l=dt(0,"cloth"),n=dt(0,"wool"),o=dt(10,"sheep"),r=Se(0),d=Ht(()=>({direction:Pe.Right,width:100,height:10,style:"margin-top: 8px",borderStyle:"border-color: black",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s; background: black",progress:()=>a.div(r.value,ae.value)})),c=Pt(()=>({display:{title:"Breed sheep",description:B(()=>i(S,null,[s("Breed "),we(a.floor(Je.value)),s(" sheep"),i("br",null,null),se(d)]))},style:{minHeight:"80px"},canClick:()=>a.gte(r.value,ae.value),onClick(){if(a.lt(r.value,ae.value))return;const ue=a.floor(Je.value);o.value=a.add(o.value,ue),r.value=0}})),p=Se(0),m=Ht(()=>({direction:Pe.Right,width:100,height:10,style:"margin-top: 8px",borderStyle:"border-color: black",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s; background: black",progress:()=>a.div(p.value,he.value)})),b=Pt(()=>({display:{title:"Shear sheep",description:B(()=>i(S,null,[s("Shear up to "),we(a.floor(Ue.value)),s(" sheep"),i("br",null,null),se(m)]))},style:{minHeight:"80px"},canClick:()=>a.gte(p.value,he.value),onClick(){if(a.lt(p.value,he.value))return;const ue=a.min(o.value,Ue.value).floor();n.value=a.add(n.value,ue),p.value=0}})),h=Se(0),A=Ht(()=>({direction:Pe.Right,width:100,height:10,style:"margin-top: 8px",borderStyle:"border-color: black",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s; background: black",progress:()=>a.div(h.value,Te.value)})),v=Pt(()=>({display:{title:"Spinning wool",description:B(()=>i(S,null,[s("Spin "),we(a.floor(st.value)),s(" wool"),i("br",null,null),se(A)]))},style:{minHeight:"80px"},canClick:()=>a.gte(h.value,Te.value),onClick(){if(a.lt(h.value,Te.value))return;const ue=a.min(n.value,st.value).floor();l.value=a.add(l.value,ue),n.value=a.sub(n.value,ue),h.value=0}})),_=Dl(()=>({key:"b",description:'Press the "Breed Sheep" button',onPress:()=>{c.canClick.value&&c.onClick()}})),N=Dl(()=>({key:"h",description:'Press the "Shear Sheep" button',onPress:()=>{b.canClick.value&&b.onClick()}})),D=Dl(()=>({key:"s",description:'Press the "Spin Wool" button',onPress:()=>{v.canClick.value&&v.onClick()}})),H=Re(()=>({resource:ve.logs,cost(){let ue=this.amount.value;return a.gte(ue,100)&&(ue=a.pow(ue,2).div(100)),ue=a.pow(.95,te.books.clothBook.amount.value).times(ue),a.pow(1.5,ue).times(1e14)},display:{title:"Build more pens",description:"Breed +1 sheep at once"}})),M=Re(()=>({resource:lt.metal,cost(){let ue=this.amount.value;return a.gte(ue,100)&&(ue=a.pow(ue,2).div(100)),ue=a.pow(.95,te.books.clothBook.amount.value).times(ue),a.pow(1.4,ue).times(1e4)},display:{title:"Make stronger shears",description:"Shear +1 sheep at once"}})),E=Re(()=>({resource:te.paper,cost(){let ue=this.amount.value;return a.gte(ue,100)&&(ue=a.pow(ue,2).div(100)),ue=a.pow(.95,te.books.clothBook.amount.value).times(ue),a.pow(1.3,ue).times(1e6)},display:{title:"Learn how to spin",description:"Spin +1 wool at once"}})),T=O(()=>({resource:U(l),cost:100,display:{title:"Lumberjack Boots",description:"Quadruple log gain"}})),J=O(()=>({resource:U(n),cost:150,visibility:()=>y(T.bought.value),display:{title:"Lumberjack Jeans",description:"Quadruple trees cut"}})),fe=O(()=>({resource:U(o),cost:200,visibility:()=>y(J.bought.value),display:{title:"Lumberjack Plaid",description:"Quadruple trees planted"}})),me={treesUpgrade4:O(()=>({resource:U(l),cost:1e3,visibility:()=>y(He.upgrades.clothTools.bought.value),display:{title:"Felt-Gripped Axe",description:"10x log gain"}})),treesUpgrade3:fe,treesUpgrade2:J,treesUpgrade1:T},ne=O(()=>({resource:U(l),cost:150,display:{title:"Mining boots",description:"Quadruple ash gain"}})),Ge=O(()=>({resource:U(n),cost:225,visibility:()=>y(ne.bought.value),display:{title:"Mining overalls",description:"Double coal gain"}})),Be=O(()=>({resource:U(o),cost:300,visibility:()=>y(Ge.bought.value),display:{title:"Mining helmet",description:"Triple coal gain"}})),Ce={metalUpgrade4:O(()=>({resource:U(l),cost:2e3,visibility:()=>y(He.upgrades.clothTools.bought.value),display:{title:"Felt-Gripped Pick",description:"Quadruple coal gain"}})),metalUpgrade3:Be,metalUpgrade2:Ge,metalUpgrade1:ne},Le=O(()=>({resource:U(l),cost:200,display:{title:"Scholar's shoes",description:"Double paper gain"}})),ke=O(()=>({resource:U(n),cost:200,visibility:()=>y(Le.bought.value),display:{title:"Scholar's slacks",description:"Double paper gain"}})),xe=O(()=>({resource:U(o),cost:400,visibility:()=>y(ke.bought.value),display:{title:"Scholar's jacket",description:"Double paper gain"}})),W={paperUpgrade4:O(()=>({resource:U(l),cost:4e3,visibility:()=>y(He.upgrades.clothTools.bought.value),display:{title:"Felt Elbow Pads",description:"10x paper gain"}})),paperUpgrade3:xe,paperUpgrade2:ke,paperUpgrade1:Le},ge=f(()=>a.add(ve.computedAutoCuttingAmount.value,1).log10().add(1)),oe=f(()=>a.add(qe.dyeSum.value,10).log10()),We=le(()=>[ce(()=>({addend:H.amount,description:"Build more pens"})),w(()=>({multiplier:()=>a.div(He.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(He.buyables.clothGains.amount.value,1)})),w(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:te.upgrades.clothUpgrade.bought})),w(()=>({multiplier:oe,description:"Gingersnap Level 2",enabled:Oe.elfTraining.clothElfTraining.milestones[1].earned})),w(()=>({multiplier:ge,description:"Holly Level 3",enabled:Oe.elfTraining.cutterElfTraining.milestones[2].earned}))]),Je=f(()=>We.apply(1)),At=le(()=>[]),ae=f(()=>At.apply(1)),ie=le(()=>[ce(()=>({addend:M.amount,description:"Make stronger shears"})),w(()=>({multiplier:()=>a.div(He.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(He.buyables.clothGains.amount.value,1)})),w(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:te.upgrades.clothUpgrade.bought})),w(()=>({multiplier:oe,description:"Gingersnap Level 2",enabled:Oe.elfTraining.clothElfTraining.milestones[1].earned})),w(()=>({multiplier:ge,description:"Holly Level 3",enabled:Oe.elfTraining.cutterElfTraining.milestones[2].earned}))]),Ue=f(()=>ie.apply(1)),ze=le(()=>[]),he=f(()=>ze.apply(1)),pt=le(()=>[ce(()=>({addend:E.amount,description:"Learn how to spin"})),w(()=>({multiplier:()=>a.div(He.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(He.buyables.clothGains.amount.value,1)})),w(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:te.upgrades.clothUpgrade.bought})),w(()=>({multiplier:oe,description:"Gingersnap Level 2",enabled:Oe.elfTraining.clothElfTraining.milestones[1].earned})),w(()=>({multiplier:ge,description:"Holly Level 3",enabled:Oe.elfTraining.cutterElfTraining.milestones[2].earned}))]),st=f(()=>pt.apply(1)),Z=le(()=>[]),Te=f(()=>Z.apply(1)),[re,Mt]=Zt(()=>[{title:"Sheep Gain",modifier:We,base:1},{title:"Sheep Breeding Cooldown",modifier:At,base:1,visible:!1,unit:"s"},{title:"Shearing Amount",modifier:ie,base:1},{title:"Shearing Cooldown",modifier:ze,base:1,visible:!1,unit:"s"},{title:"Spinning Amount",modifier:pt,base:1},{title:"Spinning Cooldown",modifier:Z,base:1,visible:!1,unit:"s"}]),Ve=V(!1),mt=B(()=>i(wt,{modelValue:Ve.value,"onUpdate:modelValue":ue=>Ve.value=ue},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:re}));Xe.on("update",ue=>{a.lt(R.day.value,an)||(a.gte(r.value,ae.value)?r.value=ae.value:(r.value=a.add(r.value,ue),c.isHolding.value&&c.onClick()),a.gte(p.value,he.value)?p.value=he.value:(p.value=a.add(p.value,ue),b.isHolding.value&&b.onClick()),a.gte(h.value,Te.value)?h.value=Te.value:(h.value=a.add(h.value,ue),v.isHolding.value&&v.onClick()))});const{total:Nt,trackerDisplay:$}=rl({resource:l,goal:1e3,name:e,day:an,color:t,textColor:"var(--feature-foreground)",modal:{show:Ve,display:mt}});return{name:e,color:t,cloth:l,totalCloth:Nt,wool:n,sheep:o,buildPens:H,betterShears:M,fasterSpinning:E,treesUpgrades:me,metalUpgrades:Ce,paperUpgrades:W,generalTabCollapsed:Mt,breedingProgress:r,shearingProgress:p,spinningProgress:h,breedSheepHK:_,shearSheepHK:N,spinWoolHK:D,minWidth:700,display:B(()=>i(S,null,[se($),i(_e,null,null),i(Tt,{resource:l,style:"margin-bottom: 0"},null),i(Tt,{resource:n,style:"margin-bottom: 0"},null),i(Tt,{resource:o,style:"margin-bottom: 0"},null),Ye(c,b,v),Ye(H,M,E),i(_e,null,null),i(Pl,null,{default:()=>[Vt(...Object.values(me)),Vt(...Object.values(Ce)),Vt(...Object.values(W))]})]))}}),Cr="dyes",kr=11,qe=Rt(Cr,function(){const e="Dyes",t="#D4D4F4";function l(v){const _=dt(0,v.name),N=le(()=>{const M=[ce(()=>({addend:()=>a.add(H.amount.value,1),description:`${v.name} Chambers`}))];return(v.color==="red"||v.color==="yellow")&&M.push(w(()=>({multiplier:o.orange1,description:"Orange Dye Boost 1"}))),(v.color=="yellow"||v.color=="blue")&&M.push(w(()=>({multiplier:o.green1,description:"Green Dye Boost 1"}))),(v.color=="red"||v.color=="blue")&&M.push(w(()=>({multiplier:o.purple1,description:"Purple Dye Boost 1"}))),(v.color=="red"||v.color=="yellow"||v.color=="blue")&&(M.push(w(()=>({multiplier:2,description:"Wetter Dyes",enabled:c.yellowDyeUpg.bought}))),M.push(w(()=>({multiplier:()=>a.add(tt.cloth.value,Math.E).ln(),description:"Gingersnap Level 1",enabled:Oe.elfTraining.clothElfTraining.milestones[0].earned})))),M.push(w(()=>({multiplier:2,description:"Gingersnap Level 3",enabled:Oe.elfTraining.clothElfTraining.milestones[2].earned}))),M}),D=f(()=>N.apply(0)),H=Re(()=>{const M=Et(v.costs);return{...v,style:()=>({backgroundColor:u(H.canPurchase)?t:"#545454",minWidth:"200px"}),display:B(()=>i("span",null,[i("h3",null,[v.name,s(" Chambers")]),i("br",null,null),s("Create "),L(D.value),s(" "),v.name,v.dyesToReset.length>0?", but reset "+v.dyesToReset.map(E=>E.name).join(", "):"",s("."),i("br",null,null),i("br",null,null),i("span",{class:"white-space: pre-wrap"},[s("Currently:")," ",v.listedBoosts.filter(E=>u(E.visible)).map(E=>se(B(()=>i("div",null,[u(E.desc)]))))]),i("br",null,null),i("div",null,[s("Cost:")," ",u(M).map(E=>se(B(()=>{var T,J;return i("div",null,[L(u(a.pow((T=u(H.cost))!=null?T:a.dInf,u((J=E.root)!=null?J:1)).times(u(E.base))))," ",E.res.displayName,i("br",null,null)])})))])])),cost(){let E=H.amount.value;return a.gte(E,25)&&(E=a.pow(E,2).div(20)),a.gte(E,10)&&(E=a.pow(E,2).div(5)),a.div(E,10).plus(1)},canPurchase:f(E=>{var J;if(u(H.visibility)!=bt.Visible)return!1;const T=(J=E!=null?E:u(H.cost))!=null?J:a.dInf;return u(M).every(fe=>{var Q;return a.div(fe.res.value,u(fe.base)).root(u((Q=fe.root)!=null?Q:1)).gte(T)})}),onPurchase(E){var J;const T=(J=E!=null?E:u(H.cost))!=null?J:a.dInf;u(M).forEach(fe=>{var Q;fe.res.value=a.sub(fe.res.value,a.pow(T,u((Q=fe.root)!=null?Q:1)).times(u(fe.base)))}),_.value=a.add(_.value,D.value),H.amount.value=a.add(H.amount.value,1),v.dyesToReset.forEach(fe=>fe.reset())}}});return{name:v.name,amount:_,buyable:H,toGenerate:N,computedToGenerate:D,display:B(()=>i(Tt,{resource:_,color:v.color,style:"margin: 0; width: 200px; width: 180px; padding: 10px;",sticky:!1},null))}}const n={red:l({name:"Red Dye",color:"red",costs:()=>[{base:"2e18",root:5,res:ve.logs},{base:f(()=>c.yellowDyeUpg2.bought.value?"2.5e5":"5e5"),root:2,res:Ze.oil}],listedBoosts:[{visible:!0,desc:f(()=>`+${L(o.red1.value)} effective Oil Pumps (does not impact coal consumption)`)}],dyesToReset:[]}),yellow:l({name:"Yellow Dye",color:"yellow",costs:()=>[{base:"1e18",root:5,res:ve.logs},{base:f(()=>c.yellowDyeUpg2.bought.value?"5e5":"1e6"),root:2,res:Ze.oil}],listedBoosts:[{visible:!0,desc:f(()=>`x${L(o.yellow1.value)} Paper & Plastic gain`)}],dyesToReset:[]}),blue:l({name:"Blue Dye",color:"blue",costs:()=>[{base:"5e17",root:5,res:ve.logs},{base:f(()=>c.yellowDyeUpg2.bought.value?"1e6":"2e6"),root:2,res:Ze.oil}],listedBoosts:[{visible:!0,desc:f(()=>`+${X(o.blue1.value)} forest size (after all other modifiers).`)}],dyesToReset:[]}),orange:l({name:"Orange Dye",color:"orange",costs:()=>[{base:15,root:2,res:n.red.amount},{base:10,root:2,res:n.yellow.amount}],listedBoosts:[{visible:!0,desc:f(()=>`x${L(o.orange1.value)} Red and Yellow Dye gain`)},{visible:!0,desc:f(()=>`/${L(o.orange2.value)} Box buyable costs.`)}],dyesToReset:[{name:"Red Dye",reset(){n.red.amount.value=0,n.red.buyable.amount.value=0}},{name:"Yellow Dye",reset(){n.yellow.amount.value=0,n.yellow.buyable.amount.value=0}}]}),green:l({name:"Green Dye",color:"green",costs:()=>[{base:15,root:2,res:n.yellow.amount},{base:10,root:2,res:n.blue.amount}],listedBoosts:[{visible:!0,desc:f(()=>`x${L(o.green1.value)} Yellow and Blue Dye gain`)},{visible:!0,desc:f(()=>`+${X(a.sub(o.green2.value,1).times(100))}% Kiln synergy effect.`)}],dyesToReset:[{name:"Yellow Dye",reset(){n.yellow.amount.value=0,n.yellow.buyable.amount.value=0}},{name:"Blue Dye",reset(){n.blue.amount.value=0,n.blue.buyable.amount.value=0}}]}),purple:l({name:"Purple Dye",color:"purple",costs:()=>[{base:15,root:2,res:n.blue.amount},{base:10,root:2,res:n.red.amount}],listedBoosts:[{visible:!0,desc:f(()=>`x${L(o.purple1.value)} Red and Blue Dye gain`)},{visible:!0,desc:f(()=>`x${L(o.purple2.value)} Smelting Speed and Ore Purity`)}],dyesToReset:[{name:"Blue Dye",reset(){n.blue.amount.value=0,n.blue.buyable.amount.value=0}},{name:"Red Dye",reset(){n.red.amount.value=0,n.red.buyable.amount.value=0}}]})},o={red1:f(()=>a.pow(a.add(n.red.amount.value,1).log2().plus(1).log2().div(2),c.blueDyeUpg2.bought.value?1.5:1)),yellow1:f(()=>a.add(n.yellow.amount.value,1).log2().plus(1)),blue1:f(()=>a.add(n.blue.amount.value,1).log2().sqrt().times(5e6)),orange1:f(()=>a.pow(2,a.add(n.orange.amount.value,1).log2().sqrt()).pow(c.coalUpg.bought.value?1.2:1)),orange2:f(()=>a.add(n.orange.amount.value,1).log2().plus(1)),green1:f(()=>a.pow(2,a.add(n.green.amount.value,1).log2().sqrt()).pow(c.coalUpg.bought.value?1.2:1)),green2:f(()=>a.add(n.green.amount.value,1).log2().plus(1).pow(c.coalUpg.bought.value?2:1)),purple1:f(()=>a.pow(2,a.add(n.purple.amount.value,1).log2().sqrt()).pow(c.coalUpg.bought.value?1.2:1)),purple2:f(()=>a.add(n.purple.amount.value,1).log2().plus(1))},[r,d]=Zt(()=>[{title:"Red Dye Creation",modifier:n.red.toGenerate,base:0},{title:"Yellow Dye Creation",modifier:n.yellow.toGenerate,base:0},{title:"Blue Dye Creation",modifier:n.blue.toGenerate,base:0},{title:"Orange Dye Creation",modifier:n.orange.toGenerate,base:0},{title:"Green Dye Creation",modifier:n.green.toGenerate,base:0},{title:"Purple Dye Creation",modifier:n.purple.toGenerate,base:0}]),c={blueDyeUpg:O(()=>({visibility:()=>y(a.add(n.orange.amount.value,n.green.amount.value).add(n.purple.amount.value).gte(1)||c.blueDyeUpg.bought.value),display:{title:"Is Blue Dye just Water?",description:B(()=>i(S,null,[s("Multiply Log gain by log"),i("sub",null,[s("10")]),s("(Auto Cutting Amount)+1.")]))},cost:1e3,resource:U(n.blue.amount),onPurchase(){n.blue.amount.value=0,n.blue.buyable.amount.value=0}})),redDyeUpg:O(()=>({visibility:()=>y(a.add(n.orange.amount.value,n.green.amount.value).add(n.purple.amount.value).gte(10)||c.redDyeUpg.bought.value),display:{title:"Glistening Paint",description:B(()=>i(S,null,[s("Multiply Ore Purity by log"),i("sub",null,[s("10")]),s("(Cloth)+1.")]))},cost:1500,resource:U(n.red.amount),onPurchase(){n.red.amount.value=0,n.red.buyable.amount.value=0}})),yellowDyeUpg:O(()=>({visibility:()=>y(a.add(n.orange.amount.value,n.green.amount.value).add(n.purple.amount.value).gte(100)||c.yellowDyeUpg.bought.value),display:{title:"Wetter Dyes",description:"Double Red, Yellow, and Blue Dye gain, but reset their amounts."},cost:2e3,resource:U(n.yellow.amount),onPurchase(){n.red.amount.value=0,n.red.buyable.amount.value=0,n.yellow.amount.value=0,n.yellow.buyable.amount.value=0,n.blue.amount.value=0,n.blue.buyable.amount.value=0}})),yellowDyeUpg2:O(()=>({visibility:()=>y(c.yellowDyeUpg.bought.value),display:{title:"Golden Wash",description:"Halve the Oil cost of Red, Yellow, and Blue Dyes."},cost:5e3,resource:U(n.yellow.amount),onPurchase(){n.yellow.amount.value=0,n.yellow.buyable.amount.value=0}})),redDyeUpg2:O(()=>({visibility:()=>y(c.redDyeUpg.bought.value),display:{title:"De Louvre",description:B(()=>i(S,null,[s("Multiply Smelting Speed by "),i(pl,null,{default:()=>[s("Refineries+1")]}),s(".")]))},cost:6e3,resource:U(n.red.amount),onPurchase(){n.red.amount.value=0,n.red.buyable.amount.value=0}})),blueDyeUpg2:O(()=>({visibility:()=>y(c.blueDyeUpg.bought.value),display:{title:"Hydrophobia",description:"Raise Red Dye's effect ^1.5."},cost:7500,resource:U(n.blue.amount),onPurchase(){n.blue.amount.value=0,n.blue.buyable.amount.value=0}})),coalUpg:O(()=>({visibility:()=>y(c.blueDyeUpg2.bought.value&&c.redDyeUpg2.bought.value&&c.yellowDyeUpg2.bought.value),display:{title:"Denser Spectrum",description:"Orange, Green, and Purple Dyes' first effect is raised ^1.2, and Green Dye's second effect is squared. Buying this resets Red, Yellow, and Blue Dyes."},cost:"5e30",resource:q.coal,onPurchase(){n.red.amount.value=0,n.red.buyable.amount.value=0,n.yellow.amount.value=0,n.yellow.buyable.amount.value=0,n.blue.amount.value=0,n.blue.buyable.amount.value=0}}))},p=V(!1),m=B(()=>i(wt,{modelValue:p.value,"onUpdate:modelValue":v=>p.value=v},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:r})),b=dt(f(()=>Object.values(n).reduce((v,_)=>a.add(v,_.amount.value),0)),"Sum of Dyes"),{total:h,trackerDisplay:A}=rl({resource:b,goal:6e4,name:e,day:kr,color:t,textColor:"var(--feature-foreground)",modal:{show:p,display:m},ignoreTotal:!0});return{name:e,color:t,dyes:n,dyeSum:b,boosts:o,totalDyeSum:h,minWidth:700,generalTabCollapsed:d,upgrades:c,display:B(()=>i(S,null,[se(A),i(_e,null,null),i("div",{style:"width: 620px"},[Ye(n.red.display,n.yellow.display,n.blue.display),Ye(n.red.buyable,n.yellow.buyable,n.blue.buyable),i(_e,null,null),Ye(n.orange.display,n.green.display,n.purple.display),Ye(n.orange.buyable,n.green.buyable,n.purple.buyable)]),i(_e,null,null),i("div",{class:"row",style:"vertical-align: top"},[Vt(c.redDyeUpg,c.redDyeUpg2),Vt(c.yellowDyeUpg,c.yellowDyeUpg2),Vt(c.blueDyeUpg,c.blueDyeUpg2)]),se(c.coalUpg)]))}}),Er="boxes",Ea=6,et=Rt(Er,function(){const e="Boxes",t="#964B00",l=dt(0,"boxes"),n=le(()=>[ra(()=>({exponent:1.1,description:"Bell Level 2",enabled:Oe.elfTraining.boxElfTraining.milestones[1].earned}))]),o=Fn(()=>({scaling:Ra(1e10,1),baseResource:ve.logs,gainResource:U(l),roundUpCost:!0,gainModifier:n})),r=Pt(()=>({display:B(()=>i(S,null,[i("span",{style:"font-size: large"},[s("Create "),X(o.currentGain.value),s(" "),l.displayName]),i("br",null,null),i("span",{style:"font-size: large"},[s("Cost:")," ",Kl(ve.logs,a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value)," ",ve.logs.displayName])])),canClick:()=>a.gte(o.actualGain.value,1),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"})),d=O(()=>({display:{title:"Carry logs in boxes",description:"Double log gain and unlock a new elf for training"},onPurchase(){R.days[3].recentlyUpdated.value=!0},resource:U(l),cost:100})),c=O(()=>({display:{title:"Carry ash in boxes",description:"Double ash gain and unlock a new elf for training"},onPurchase(){R.days[3].recentlyUpdated.value=!0},resource:U(l),cost:1e3})),p=O(()=>({display:{title:"Carry coal in boxes",description:"Double coal gain and unlock a new elf for training"},onPurchase(){R.days[3].recentlyUpdated.value=!0},resource:U(l),cost:4e3})),m={logsUpgrade:d,ashUpgrade:c,coalUpgrade:p},b=O(()=>({resource:U(l),cost:1e8,visibility:()=>y(He.upgrades.boxTools.bought.value),display:{title:"Carry ore in boxes",description:"Double ore per mining op"}})),h=O(()=>({resource:U(l),cost:1e9,visibility:()=>y(He.upgrades.boxTools.bought.value),display:{title:"Carry metal in boxes",description:"Double ore purity"}})),A=O(()=>({resource:U(l),cost:1e10,visibility:()=>y(He.upgrades.boxTools.bought.value),display:{title:"Carry plastic in boxes",description:"Double plastic gain"}})),v={oreUpgrade:b,metalUpgrade:h,plasticUpgrade:A},_=O(()=>({resource:U(l),cost:1e16,visibility:()=>y(Oe.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry cloth in boxes",description:"Double all cloth actions"}})),N=O(()=>({resource:U(l),cost:1e17,visibility:()=>y(Oe.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry dye in boxes",description:"Double all dye gain"}})),D=O(()=>({resource:U(l),cost:1e18,visibility:()=>y(Oe.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry experience in boxes???",description:"Double xp gain"}})),H={clothUpgrade:_,dyeUpgrade:N,xpUpgrade:D},M=Re(()=>({display:{title:"Carry more logs",description:B(()=>i(S,null,[s("Use boxes to carry even more logs, boosting their gain"),i("br",null,null),i("br",null,null),i("div",null,[s("Amount: "),X(M.amount.value),a.gt(M.freeLevels.value,0)?i(S,null,[s(" (+"),X(M.freeLevels.value),s(")")]):null])])),effectDisplay:B(()=>i(S,null,[L(a.div(M.totalAmount.value,2).add(1)),s("x")])),showAmount:!1},resource:U(l),cost(){let K=this.amount.value;K=a.pow(.95,te.books.boxBook.amount.value).times(K);let Ce=3;return Oe.elfTraining.boxElfTraining.milestones[2].earned.value&&Ce--,a.pow(Ce,K).times(100).div(qe.boosts.orange2.value)},visibility:()=>y(d.bought.value),freeLevels:f(()=>Oe.elfTraining.boxElfTraining.milestones[0].earned.value?a.max(E.amount.value,1).sqrt().floor().add(a.max(T.amount.value,1).sqrt().floor()):0),totalAmount:f(()=>a.add(M.amount.value,M.freeLevels.value))})),E=Re(()=>({display:{title:"Carry more ash",description:B(()=>i(S,null,[s("Use boxes to carry even more ash, boosting its gain"),i("br",null,null),i("br",null,null),i("div",null,[s("Amount: "),X(E.amount.value),a.gt(E.freeLevels.value,0)?i(S,null,[s(" (+"),X(E.freeLevels.value),s(")")]):null])])),effectDisplay:B(()=>i(S,null,[L(a.div(E.totalAmount.value,2).add(1)),s("x")])),showAmount:!1},resource:U(l),cost(){let K=this.amount.value;K=a.pow(.95,te.books.boxBook.amount.value).times(K);let Ce=5;return Oe.elfTraining.boxElfTraining.milestones[2].earned.value&&Ce--,a.pow(Ce,K).times(1e3).div(qe.boosts.orange2.value)},visibility:()=>y(c.bought.value),freeLevels:f(()=>Oe.elfTraining.boxElfTraining.milestones[0].earned.value?a.max(M.amount.value,1).sqrt().floor().add(a.max(T.amount.value,1).sqrt().floor()):0),totalAmount:f(()=>a.add(E.amount.value,E.freeLevels.value))})),T=Re(()=>({display:{title:"Carry more coal",description:B(()=>i(S,null,[s("Use boxes to carry even more coal, boosting its gain"),i("br",null,null),i("br",null,null),i("div",null,[s("Amount: "),X(T.amount.value),a.gt(T.freeLevels.value,0)?i(S,null,[s(" (+"),X(T.freeLevels.value),s(")")]):null])])),effectDisplay:B(()=>i(S,null,[L(a.div(T.totalAmount.value,2).add(1)),s("x")])),showAmount:!1},resource:U(l),cost(){let K=this.amount.value;K=a.pow(.95,te.books.boxBook.amount.value).times(K);let Ce=7;return Oe.elfTraining.boxElfTraining.milestones[2].earned.value&&Ce--,a.pow(Ce,K).times(1e3).div(qe.boosts.orange2.value)},visibility:()=>y(p.bought.value),freeLevels:f(()=>Oe.elfTraining.boxElfTraining.milestones[0].earned.value?a.max(M.amount.value,1).sqrt().floor().add(a.max(E.amount.value,1).sqrt().floor()):0),totalAmount:f(()=>a.add(T.amount.value,T.freeLevels.value))})),J={logBoxesBuyable:M,ashBoxesBuyable:E,coalBoxesBuyable:T};Xe.on("update",K=>{a.lt(R.day.value,Ea)||(l.value=a.times(K,He.buyables.passiveBoxes.amount.value).times(o.currentGain.value).div(100).add(l.value))});const[fe,Q]=Zt(()=>[{title:"Boxes Gain",modifier:n,base:1}]),me=V(!1),ne=B(()=>i(wt,{modelValue:me.value,"onUpdate:modelValue":K=>me.value=K},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:fe})),{total:Ge,trackerDisplay:Be}=rl({resource:l,goal:5e4,name:e,day:Ea,color:t,modal:{display:ne,show:me}});return{name:e,day:Ea,color:t,boxes:l,totalBoxes:Ge,boxesConversion:o,upgrades:m,row2Upgrades:v,row3Upgrades:H,buyables:J,minWidth:700,display:B(()=>i(S,null,[se(Be),i(_e,null,null),i(Tt,{resource:l,color:t,style:"margin-bottom: 0"},null),i(_e,null,null),se(r),i(_e,null,null),Bl(Object.values(m),Object.values(v),Object.values(H)),i(_e,null,null),Ye(...Object.values(J))]))}}),_r="trees",nn=1,on=.1,ve=Rt(_r,function(){const e="Trees",t="#4BDC13",l="green",n=dt(0,"logs"),o=dt(0,"saplings"),r=V(0),d=le(()=>[ce(()=>({addend:()=>a.times(Q.amount.value,10),description:"Expand Forest",enabled:E.bought})),ce(()=>({addend:()=>a.div(Dt.foundationProgress.value,2),description:"75% Foundation Completed",enabled:Dt.milestones.morePlantsMilestone1.earned})),w(()=>({multiplier:2,description:"5 Elves Trained",enabled:Me.milestones[4].earned})),w(()=>({multiplier:2,description:"8 Elves Trained",enabled:Me.milestones[7].earned})),w(()=>({multiplier:4,description:"Lumberjack Boots",enabled:tt.treesUpgrades.treesUpgrade1.bought})),ce(()=>({addend:qe.boosts.blue1,description:"Blue Dye Boost 1",enabled:()=>a.gte(qe.dyes.blue.amount.value,1)}))]),c=dt(f(()=>a.sub(d.apply(10),o.value)),"trees"),p=f(()=>d.apply(10)),m=O(()=>({resource:U(n),cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),b=O(()=>({resource:U(n),cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),h=O(()=>({resource:U(n),cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),A=O(()=>({resource:U(n),cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),v=O(()=>({resource:U(n),cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),_=[m,b,h,A,v],N=O(()=>({resource:U(n),cost:50,visibility:()=>y(v.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),D=O(()=>({resource:U(n),cost:50,visibility:()=>y(v.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),H=O(()=>({resource:U(n),cost:150,visibility:()=>y(v.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),M=O(()=>({resource:U(n),cost:150,visibility:()=>y(v.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),E=O(()=>({resource:U(n),cost:300,visibility:()=>y(v.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),T=[N,D,H,M,E],J=Re(()=>({resource:U(n),cost(){let $=this.amount.value;return a.gte($,50)&&($=a.pow($,2).div(50)),a.gte($,200)&&($=a.pow($,2).div(200)),a.gte($,2e6)&&($=a.pow($,2).div(2e6)),$=a.pow(.95,te.books.cuttersBook.amount.value).times($),a.times(100,$).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>y(E.bought.value)})),fe=Re(()=>({resource:U(n),cost(){let $=this.amount.value;return a.gte($,50)&&($=a.pow($,2).div(50)),a.gte($,200)&&($=a.pow($,2).div(200)),a.gte($,2e6)&&($=a.pow($,2).div(2e6)),$=a.pow(.95,te.books.plantersBook.amount.value).times($),a.times(100,$).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>y(E.bought.value)})),Q=Re(()=>({resource:U(n),cost(){let $=this.amount.value;return a.gte($,100)&&($=a.pow($,2).div(100)),a.gte($,1e5)&&($=a.pow($,2).div(1e5)),$=a.pow(.95,te.books.expandersBook.amount.value).times($),a.pow(a.add($,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>y(E.bought.value)})),me=[J,fe,Q],ne=le(()=>[ce(()=>({addend:1,description:"Wooden Fingers",enabled:m.bought})),ce(()=>({addend:Le,description:"Smart Knives",enabled:H.bought}))]),Ge=f(()=>ne.apply(1)),Be=le(()=>[w(()=>({multiplier:.5,description:"Sharper Fingers",enabled:N.bought})),w(()=>({multiplier:()=>a.pow(.5,Me.totalElves.value),description:"1 Elf Trained",enabled:Me.milestones[0].earned}))]),K=f(()=>Be.apply(1)),Ce=le(()=>[ce(()=>({addend:1,description:"Automated Knives",enabled:h.bought})),ce(()=>({addend:J.amount,description:"Generic Cutters",enabled:E.bought})),ce(()=>({addend:()=>a.div(Dt.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:Dt.milestones.autoCutMilestone1.earned})),w(()=>({multiplier:2,description:"30% Foundation Completed",enabled:Dt.milestones.autoCutMilestone2.earned})),w(()=>({multiplier:2,description:"Warmer Cutters",enabled:q.warmerCutters.bought})),w(()=>({multiplier:q.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>a.gt(q.heatedCutters.amount.value,0)})),w(()=>({multiplier:4,description:"Lumberjack Jeans",enabled:tt.treesUpgrades.treesUpgrade2.bought}))]),Le=f(()=>Ce.apply(0)),ke=le(()=>[ce(()=>({addend:1,description:"Leafy Fingers",enabled:b.bought})),ce(()=>({addend:oe,description:"Smart Spades",enabled:M.bought}))]),xe=f(()=>ke.apply(1)),Fe=le(()=>[w(()=>({multiplier:.5,description:"Greener Fingers",enabled:D.bought})),w(()=>({multiplier:()=>a.pow(.5,Me.totalElves.value),description:"1 Elf Trained",enabled:Me.milestones[0].earned}))]),W=f(()=>Fe.apply(1)),ge=le(()=>[ce(()=>({addend:1,description:"Automated Spade",enabled:A.bought})),ce(()=>({addend:()=>a.div(fe.amount.value,2),description:"Generic Planters",enabled:E.bought})),ce(()=>({addend:()=>a.div(Dt.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:Dt.milestones.autoPlantMilestone1.earned})),w(()=>({multiplier:2,description:"40% Foundation Completed",enabled:Dt.milestones.autoPlantMilestone2.earned})),w(()=>({multiplier:2,description:"Warmer Planters",enabled:q.warmerPlanters.bought})),w(()=>({multiplier:q.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>a.gt(q.heatedPlanters.amount.value,0)})),w(()=>({multiplier:4,description:"Lumberjack Plaid",enabled:tt.treesUpgrades.treesUpgrade3.bought})),w(()=>({multiplier:2,description:"Ivy Level 1",enabled:Oe.elfTraining.planterElfTraining.milestones[0].earned}))]),oe=f(()=>ge.apply(0)),We=le(()=>[w(()=>({multiplier:1.25,description:"Research I",enabled:v.bought})),w(()=>({multiplier:1.25,description:"Research II",enabled:E.bought})),w(()=>({multiplier:()=>a.div(Dt.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:Dt.milestones.logGainMilestone1.earned})),w(()=>({multiplier:2,description:"50% Foundation Completed",enabled:Dt.milestones.logGainMilestone2.earned})),w(()=>({multiplier:1.25,description:"Ashy Soil",enabled:q.basicFertilizer.bought})),w(()=>({multiplier:q.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>a.gt(q.moreFertilizer.amount.value,0)})),w(()=>({multiplier:2,description:"4 Elves Trained",enabled:Me.milestones[3].earned})),w(()=>({multiplier:2,description:"Carry logs in boxes",enabled:et.upgrades.logsUpgrade.bought})),w(()=>({multiplier:()=>a.div(et.buyables.logBoxesBuyable.amount.value,2).add(1),description:"Carry more logs",enabled:et.upgrades.logsUpgrade.bought})),w(()=>({multiplier:10,description:"Felt-Gripped Axe",enabled:tt.treesUpgrades.treesUpgrade4.bought})),w(()=>({multiplier:f(()=>a.add(Le.value,1).log10().plus(1)),description:"Is Blue Dye just Water?",enabled:qe.upgrades.blueDyeUpg.bought})),w(()=>({multiplier:f(()=>a.add(Le.value,1).log10().plus(1)),description:"Holly Level 1",enabled:Oe.elfTraining.cutterElfTraining.milestones[0].earned})),ra(()=>({exponent:1.2,description:"100% Foundation Completed",enabled:Dt.milestones.logGainMilestone3.earned}))]),Je=Se(0),At=Ht(()=>({direction:Pe.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(Je.value,K.value)})),ae=Pt(()=>({display:{title:"Cut trees",description:B(()=>i(S,null,[s("Cut down up to "),X(a.floor(Ge.value))," ",s("tree"),a.eq(Ge.value,1)?"":"s",s(" at once!"),i("br",null,null),se(At)]))},style:{minHeight:"80px"},canClick:()=>a.gte(c.value,1)&&a.gte(Je.value,K.value),onClick(){if(a.lt(Je.value,K.value))return;const $=a.floor(a.min(c.value,a.times(Ge.value,a.div(Je.value,K.value).floor())));n.value=a.add(n.value,a.times(We.apply(1),$)),o.value=a.add(o.value,$),Je.value=0}})),ie=Se(0),Ue=Ht(()=>({direction:Pe.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(ie.value,W.value)})),ze=Pt(()=>({display:{title:"Plant trees",description:B(()=>i(S,null,[s("Plant up to "),X(a.floor(xe.value))," ",s("tree"),a.eq(xe.value,1)?"":"s",s(" at once!"),i("br",null,null),se(Ue)]))},style:{minHeight:"80px"},canClick:()=>a.gte(o.value,1)&&a.gte(ie.value,W.value),onClick(){if(a.lt(ie.value,W.value))return;const $=a.floor(a.min(o.value,a.times(xe.value,a.div(ie.value,W.value).floor())));o.value=a.sub(o.value,$),ie.value=0}})),[he,pt]=Zt(()=>[{title:"Logs per Tree",modifier:We,base:1,visible:v.bought},{title:"Manual Cutting Amount",modifier:ne,base:1,visible:m.bought,unit:"/click"},{title:"Manual Cutting Cooldown",modifier:Be,base:1,visible:m.bought,unit:"s"},{title:"Manual Planting Amount",modifier:ke,base:1,visible:b.bought,unit:"/click"},{title:"Manual Planting Cooldown",modifier:Fe,base:1,visible:b.bought,unit:"s"},{title:"Auto Cutting Amount",modifier:Ce,base:0,visible:h.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:ge,base:0,visible:A.bought,unit:"/s"},{title:"Forest Size",modifier:d,base:10,visible:E.bought}]),st=V(!1),Z=B(()=>i(wt,{modelValue:st.value,"onUpdate:modelValue":$=>st.value=$},{header:()=>i("h2",null,[e,s(" Modifiers")]),body:he}));Xe.on("update",$=>{if(a.lt(R.day.value,nn))return;a.gte(Je.value,K.value)?Je.value=K.value:(Je.value=a.add(Je.value,$),ae.isHolding.value&&ae.onClick()),a.gte(ie.value,W.value)?ie.value=W.value:(ie.value=a.add(ie.value,$),ze.isHolding.value&&ze.onClick());const ue=a.min(c.value,a.times(Le.value,$)),j=a.mul(We.apply(1),ue),Ie=a.div(j,$);r.value=a.mul(Ie,on).add(a.mul(r.value,a.dOne.sub(on))),n.value=a.add(n.value,j),o.value=a.add(o.value,ue);const ee=a.min(o.value,a.times(oe.value,$));o.value=a.sub(o.value,ee)});const Te=f(()=>a.sub(Le.value,oe.value)),re=f(()=>a.sub(oe.value,Le.value)),Mt=Dl(()=>({key:"c",description:'Press the "Cut trees" button.',onPress:()=>{ae.canClick.value&&ae.onClick()}})),Ve=Dl(()=>({key:"p",description:'Press the "Plant trees" button.',onPress:()=>{ze.canClick.value&&ze.onClick()}})),{total:mt,trackerDisplay:Nt}=rl({resource:n,goal:1e4,name:e,day:nn,color:l,modal:{show:st,display:Z}});return{name:e,color:t,logs:n,totalLogs:mt,trees:c,saplings:o,cutTree:ae,plantTree:ze,cutTreeHK:Mt,plantTreeHK:Ve,row1Upgrades:_,row2Upgrades:T,row1Buyables:me,manualCutProgress:Je,manualPlantProgress:ie,generalTabCollapsed:pt,computedAutoCuttingAmount:Le,minWidth:700,display:B(()=>i(S,null,[se(Nt),i(_e,null,null),i(Tt,{resource:n,color:t,style:"margin-bottom: 0",productionDisplay:a.gt(Le.value,0)?`+${L(r.value)}/s average<br/>equilibrium: +${bn([[Le.value,"cutting speed"],[oe.value,"planting speed"],[a.mul(p.value,20),"forest cap"]],"/s",We.apply(1))}`:void 0},null),i(Tt,{resource:o,color:l,style:"margin-bottom: 0",productionDisplay:ia(Te.value)},null),i(Tt,{resource:c,color:l,style:"margin-bottom: 0",productionDisplay:ia(re.value)},null),i(_e,null,null),Ye(ae,ze),i("div",null,[s("Tip: You can hold down on actions to perform them automatically")]),i(_e,null,null),Bl(_,T),i(_e,null,null),Ye(...me)]))}});var Un="./assets/tree.35808197.png",Rn="./assets/sws.714ad454.png",On="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAFxGAABcRgEUlENBAAAAG3RFWHRTb2Z0d2FyZQBDZWxzeXMgU3R1ZGlvIFRvb2zBp+F8AAAMuElEQVR42u3dO4zkSAEG4L/Kr5me6dl1QkJAjkDiElJISAiO7CQSyCBHQis08QQrXUJISExKxCNBguQICJCIkBAZOqlmH0LbPW27CKa78XjtabddZVeV/z/ZXe12r11V39TDdllorcEwTHsEgTAMgTAMgTAMgTAMgTAMgTAMgTz5z4Ro/c+01oJVwSwaSBcOQmEWD6QPDiJhFgnkHBxEwiwKyBAcBMIQCIEwBDIcCJEwBEIgDIEQCEMgBMIQCIEwBOIQECJhggfCXoQhEAJhCIRAGAIhEIbxCQiRMARCIMySgXCYxRAIgTAEQiAMgRAIw/gEhEiY4IGwF2EIhEAYAiEQhkAIhGF8AkIkDIEQCLNkIBxmMQRCIAyBEAhDIATCMD4BIRImeCDsRRgCIRCGQAiEIRACYQjEJyBEwhAIgTBLBsJhFkMgBMIQCIEwBEIgDIH4BIRImOCBsBdhCIRAGAIhEIZACIQhEE7UGYZAGMYPIBxmMQRCIAyBEAhDIATCEAgn6gzjEBD2IgyBEAhDIATCEAiBMATCiTrDEAjD+AGEwyyGQAiEIRACYQiEQBgC4USdYRwCwl6EIRACYQiEQBgCIRCGQDhRZxgCYRg/gHCYxRAIgTAEQiAMgRAIQyCcqDME4hAQ9iIMgRAIQyAEwhCIs0CGfgeBMUEDsRGiIRD3DsoxJMRCIARCJK318Nz5ttVTaOVDIERitex9LysngRBJeGXua3k5C4RIwixr38qMQAhk8rL2qdw4xCKS2crah7LjJJ1IZi1v18uOFwoJZPYyz/P820qpLwgkQBwhIHGh3PM8/41S6jMCmaiSbm9fnfXv7+5eLxKJSz+U8jz/m1LqEwKxUEnngqhlB0AAkPtfi7u71wmBzAJkB+BzAL9USv2HQObHUQCo9jB0rTdJl9CLuDikzfN8A+AHSqnfEYiBShqBowJQ7mEcGvXh9zp0JKZw7H/qxwBwf38vDH3n35VS31w8EAM46o37nJR7IM3P16EMRuL80uXAcs/zvM/nxP39fTALILMBmRGHrgFpw1H/d+Lu7nXsK5JmGWutxZhyPwHko/M1DWWOcvUSyO3tq3rjPrfAqlrv0fX5Iz7fgNicV+R5fuxd9+Vz8hxtIJmyfGcBMhJH2VI5fQtL14ZYuu9nXUcyxWR7j6NZjr3Oz2ckkwMxgKOtYsSZSIoeFfykEQxBYrsCp1qFauAYFF+ReAPk9vbVrmVYJQYg0bVhlujTW9zevtq5dG1k6uVZE0BsIrEJZVIgI3HgxLCqfi2jAHBo0LLja4uxQ6g5Ks5XHL4i8QXIA9pXmXTHSoro+PeHv4vxuIw7yRzBRMXNcVHPNA7bQKz8QJoKyMjeQ7c09CYKWfv7LhyHHiOZsqGNrbRQcBCI4UquzTvaeouuIVcTSP1zwuZwykbFhYTDRySTABnRe1QNHBrdV79PZi4cQyttZhxDL8QGhcRZIHscBwBVA0l9Ut61kqX3KCI4knMrbUogtnuNqcF4A2Rk79HsIQ4XCWXHfOTQU0g4mHMqbUk4bKExsjjiIpAOHJ3l4DqMWkP8XCn18x5l9msAP1oiCpNQlgDk5DxjqqVagw3zT0qp77SU0wrAdwF8CuCnBsq9OJS9lBJpmsrdblcB0HEci4uLi8RmA+0LsOu7m5+fC4lVIANxoDEhb4OiXe8tTjScPwP4sVLqn/ty+iqAvwD4F4AbAN8a+v1SygKAllKiLMt6XUAIgTiORZqmMo5jaQPGOVhOfb8JJCED6UTiW6/RUukawKdKqd8KIb4B4PcAHgB8ZT/Puhrw1UWtzMVj29BHHFEUIU1TmWVZr0ULG6tM9Qbf9/uHfMYkEqeAnHo60MTGClNVSh8kWuufvXnz5ocAPsH/V+vSAeVcPG0P+ohCSikA6Kqq9Hq9TufCYaAuNAY+jOUkEAO9x+w4bA853r17V1ZVVWito9rw8axlaSllUVUVhHj8eBw/XuqpqkoLIbBer8+6a8AlHG1AhhxjnufXSqn/eg3EBRx9J5djG1Ge59hsNtXDw4Muy1I0hpHRmeVcRFEEIQS01ojjWMRxLJIkGTRHcw1IY1iKIb1InudfAvi+UuqvwQFxDYephpRlWVkUBfZAjh3CkOFVkiQyyzIRx/GouZmLOBpAxJjjzPP8a0qpfwc1xHJhaGWjUa1Wq+rDhw/Yl//gFbn9PANJkiDLMoQGpOvWl6km7E4DcR3HmMqK47gqimIUjn05I4oiXFxcIEmSoHA8VzdjjvesOxpcXcUyjSNN0w9XV1eXzYI9A0fbLfd638DFXA1MCAEpJW5ubkLuPYwec57nN0qp994B2SM57Ek1+kKglHKzX/LUUkq9Xq9XI76ueUdxs7JmuylSSokXL14QiIVexEUgFYBqzK3pQoiN1loeGrOUUqdpqi8vL1cjcOhnehQA0Pf397PcTp9lGVarVVBA9ntwtd2xbeyY+yBx7l6s29tX5dBb1GswjkunQogqSRJcXV1djG0seZ5XDSD1JdpZgAghsD+/SYHYmBs0cDw5TQIZn+3jfyeOJ34YWt3c3GSmGkoDyZOeZOph1mH+kWXZ5CtYNq4XPbNzo5hrmBUKkK14fOu9kFKiqqoDkCrLMnF5eZmYbCQtPQn2E3U5B5CxE3RbQPp+f489f8VccxGnH7k9I81tgQ6/VnmeJ6YbSEsvUv+eyZBEUWQEx8AyMHkqeiiOsVCWBOSj59SjKNI3NzexhcbRtYnEpEBevnx5vAcrUCDC5jksCUhzK1EhhNBxHIvr62srzz109SJLADICR9eKlDaBw1sgEyApmwUrpUQURTgFZCCOrnPRPgPpuUhhqqcQzwARtpEvEYhoTmDTNBWr1cr4CshzQKbqRQ6Tc9NAniuXATiab+/CM0B6v1JhynmIF1uP9kh9k4djpcRxjPV6bXwN/cSqyyS9iOkJ+gQx1ktM2YuECKTZiIQpGH2AmHpP34lyRBRFWK/XvuKwCsVbIBaRVF0FnSQJdrudsUo4tWZvG8hh84U0TXF5eekyCHHizwQyIRBjy4RnAPloRWaK3qPH8bnYW1iZkAcJxAKS5uvArO0p2+g9nAQyM5I+y7Xe9B4hANG2Ctq1oZVHUE6tVh3LqnbHLoEYRjLZioivOBwCcrKMTB7ngHvKcqXUG+eAGEQyKw6XgcyARA8tn7neg5jn+deVUv8IEYj1XF9fI0kS7SuOGcDoMeUzx94AeZ7/QSn1PSeBuIwkSRJUVYU4jrFarXQoQCxi0SbKY8wxjbgz4hcAvlBK/dE5IC4iOVxrONzGcXju4urqSoeCwzQU2xtd2z6Orsm6E0Bc7kkO+05VVQUp5fERVykl3r9/j1AypGHaeo59IJLBe/cSiIEepf4rAFRVhdAy5c6SlnoR40icAeLDpL0OxqVym7pxTrEDysA7h0cNfZ0H4hOSkDPFDveGkYxaPXsOiXDxJyGREMgZQDrvwzPxbIhwdahAJO4hmWNzuR5IjAJpIhEuj6WJhEB6HOOzd3KP7UWE65NNInECyOgJsMXjPPmow5gbGIUPqzFEMjsSZ4F0HeeigBCKO73IECC2X4pqemHBWyBE4sQwq9fkd+qVMAIhFGeAPNfoGnOC1tcX2AJSliU2mw2klNi//xFCiLPveggCCJFMDuQjJB1/1zZZ1mPnBVMmGCCE4hSQNiTNHqRXL0QghOIbkHM3WuhTDzaQGHnK1HkgQxr6k5MiFFNAxmyn9NFni6IQVVVBCIGHhwcUReHkXdFOAzHRuOtvmGIzH9V7jNpvbLfbHX+/3W6Pd0DvX3/NOcjcQyT2KtMD2W63xycwt9styrJEWZZenftigLSdMMGczmq1OrzzsPd7O7bbLaSUeHh4gNYaZVl6+1CZk0BsN9iTG4QRTHNi3jWXEG09RlEU0FpDa/1kaEUgHuDoi2TJcA6bVGRZhouLi15ANpsNiqKAEAK73e74pKXvK6OLBTIUyVKgSCkhpUSSJCeRFEWB7Xb7pLcI4ZKBcw9MzdHwzkWypOFXkiSIoqjt1QpProW8ffsWQHibVzgDZO5Gdw6SJQGRUj4ZcjX3BwNwXJkKbeOK2TdtcKmhEQjjBBBXGxeBMH3ag1UgLjcsAmH6tAVrQFxvVATC9GkHVoD40KAIhOnTBowDCQ0HgSwXh3EgIeIgkGXCWCSQoVfRiWR5MBYHZAwOIlkWCgIhEIIgEHsFRyhhNH4CsViwRBIWhEmAuNRwpixoYgkThxUgLjSYOQuaWAjE2cbiXPdMLF7jsA7EdsNxtVCJLJw6FKG+rXXpCfWuBgJhpob0EwC/IgwCYWbqgXweChMIwxAIwxAIwxAIwxAIwxAIwxAIwxAIw4Sa/wGDtUAHUuMNRQAAAABJRU5ErkJggg==",qn="./assets/elf.9fbfa563.png",Gn="./assets/paperStacks.4c96ec8c.png",Ln="data:image/png;base64,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",Qn="./assets/metal.7407f5d1.png",$n="./assets/cloth.7bcd7f37.png",Vn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAFxGAABcRgEUlENBAAAAG3RFWHRTb2Z0d2FyZQBDZWxzeXMgU3R1ZGlvIFRvb2zBp+F8AAAE/ElEQVR42u3dW3baMBRAURhzO4x2zO5P25WPPAhIuq99JhAsayNwbHG/rusm6f3ugEiASIBIgEiASIBIgEiASIBIgNQ+mPv9/8Fc13V3ejUeyFsUnwWMRgF5FAYoGgXkWRiQqD2QFThAUUsgq3FAIkAgESCQCJDtQCARIJAIEEAECCQCJArISSQfHRekgIxG4h4yQCBZdAyQADLi+0jlGyw/e+2dAY+7mzdqgr76ek9OQjeENgBSDUl2IO51awjkJJRXTnTWd2T/WxoCJDOSla9r1UQ7faGjMpKWmzZk+riQCUgEjOpIWu9qsmNCfOckZ3nAKxpGZSRjtv2JeCePXj0ywQBkEJZHTnLk6pERBiDDsHx1oqOAZMZREYmdFZ+YYBlXkAowABmAJuqd/LO/WwkHIDqGoxoM30F0DEhFHIBoO5CqMADRFiBwAALIA5MKDkCWTbTIk7Hj41V1HIAknmCnT06HyQxHUiDVd0+EoxeOVEA6PKMASC8caYBkmFjVn7WAoymQrBPr7ZfjTvdBwVEISPVbJcDojQMQwQGI4ABEcAAiMAARMIAAAgwggKg8FEAECSACBBBB0gsIJIAAAogAgUS+gwAiQCARHAmBQAIIIJCoGKCU+2JBAgwgkKgAFiuIQPElXZAUBgKGsiJxq4kgyQgEDFVAEgIEDlVBchwIHAIEDDVBcgQIHAIEDgEChwABRJDsBgKHAIFDgAAiQOAQIIAIEEAECCASIBIgUk4cgAgQQAQHIAKkBhBI1AXHNiCgqAOO7UAgUWUcR4DAooowQoAAo0o4woFAoqwwrCACAxCBURQIHMoMIxQIHLKCAKIGWGxeLVCyAIFD1ZAAIlAyAInG8dXgwgvJWCDfHVRYIDkKJGLCrRhEUABpB2T14EEyG0mr50F2DRokgJQHsn13C0hGImnxyO2RgSoI5N+4dMUNSLblNvlEm3a1rjSQbjiyT6iJV+0ASQYk8yRaOQ5VoACSEMjfY/t1u91+JJknv6/r+ukNoRCQDpd2AckNBRBAUgHJhgWQpDgSvpseBxI9FuVvNekOJNEqEooj4ryXv5u3+8crQOLmQYvnQSasHoCcnxdtth4FpAaQj85T0EWPK9O5BaTPl/WngDzyujPvVQVIkZMXDGT56gELIIC88NonQgFkKBBImgLJdoICkSy5gvXs658Cpdw/CgFZC+TVY+gOpRSQlJsbNwACCSDdgGz5ByEkh4DsmDhZT0AnIJAcBLJyAmUf+AAkKYF0RAIIIJBEApmwbAPSF0nqnz+oMsiAAHJ08CsO7uG7e0ts1NABSaqfga48oAeBbH8GZOWKWB1JKJBOdQEy5fI8IH2/h5RaQcp/MgAEkN3HAYhOfsyyggACSCcglZEAAggggAACCCCAAAIIIDV3cwdEp5AAAgggnYC4zKt2QFYiAUQtgaxA4l4stQbyChK3u2sEkGeRAKIxQL4DxTPpikSS5kdz3sNiVxMB8g4UG8cJkInnEhBABAggAgQQAQIIIIAAAgggkAACCCCAACJAABEggAgQAQKIAAFEgAAiQACBBBBAAAEEEEAAESCACBBABAggRqEeEEgAAQQQQAABBBBAAAFEp4FAAggggAACCCCAAAIJIAIEECXCAQgggEACCCCAAAIIIIAoAggkgAACCCBwAAIIIJAAAggggCgZEEgAgQMQQACBBBBAAAEEDkgK9wfV+oLa+LwMvQAAAABJRU5ErkJggg==",Hn="./assets/plastic.b8ac74ff.png",jn="data:image/png;base64,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",Sr="./assets/elfManagement.436c8744.png";const R=Rt("main",function(){const e=Se(1),t=f(()=>(+new Date(new Date().getFullYear(),11,e.value)-de.time)/1e3),l=V(!1),n=V(-1),o=V(""),r=V();function d(m){const b=Se(!1),h=Se(!1);return Ot(()=>{const A=m(),v=Et(A.shouldNotify),_=Et(()=>u(v)||u(h));return{...A,opened:b,shouldNotify:_,recentlyUpdated:h,[yl]:os,[bl]:function(){const{day:N,layer:D,symbol:H,opened:M,shouldNotify:E,story:T,completedStory:J,recentlyUpdated:fe}=this;return{day:N,symbol:H,layer:D,opened:M,recentlyUpdated:fe,shouldNotify:E,onOpenLore(){var ne,Ge;const Q=R.day.value>N;n.value=Q?N-1:-1;const me=u((Ge=(ne=_t[D!=null?D:"trees"])==null?void 0:ne.name)!=null?Ge:"");o.value=Q?`${me} - Completed!`:me,r.value=Q?`${T}<hr style="
margin: 10px 0;"/>${J}`:T,l.value=!0},onOpenLayer(){if(fe.value=!1,window.matchMedia("(min-width: 1468px)").matches)if(de.tabs.includes(D!=null?D:"trees")){const Q=de.tabs.lastIndexOf(D!=null?D:"trees");de.tabs.splice(Q,1)}else de.tabs.push(D!=null?D:"trees"),R.minimized.value=!0;else de.tabs.splice(1,1/0,D!=null?D:"trees")},onUnlockLayer(){D&&(M.value=!0,setTimeout(()=>{var Q,me;n.value=-1,o.value=u((me=(Q=_t[D!=null?D:"trees"])==null?void 0:Q.name)!=null?me:""),r.value=T,de.devSpeed=null,l.value=!0},1e3))}}}}})}const c=[d(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:Un,story:"Oh no! Santa forgot about Christmas and it's only 25 days away! He's asked for your help due to your history getting large quantities of things in short amounts of time. Unfortunately you're really starting from scratch here - let's start with getting wood, which you'll need for everything from building workshops to wrapping paper to many of the toys themselves!",completedStory:"Santa looks at all the wood you've gathered and tells you you've done well! He says you should take the rest of the day off so you're refreshed for tomorrow's work. Good Job!"})),d(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:Rn,story:"Santa looked over your tree farm and was impressed with how much you could accomplish in just one day. Today's goal is to get a workshop built up for the elves to work in - and apparently, they need quite a lot of space to work!",completedStory:"The workshop complete, Santa once again dismisses you for the day. With a strong foundation, this workshop should suffice for supporting future work toward this impossible mission. Good Job!"})),d(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:On,story:"Santa tells you that unfortunately there are quite a few naughty children out there this year, and he's going to need you to gather as much coal as you can for him to give out.",completedStory:"Santa looks at all the coal you've gathered and tells you you've done well! He says you should take the rest of the day off so you're refreshed for tomorrow's work. Good Job!"})),d(()=>({day:4,shouldNotify:!1,layer:"elves",symbol:qn,story:"Alright, it seems you finally have enough things set up to start bringing in the elves! Unfortunately, it seems they'll need to be retrained on how to help, since they've stopped practicing for 11 months!",completedStory:"The workshop now hums with the bustling elves working on everything. They can take it from here - you deserve a break after such a long day! Good Job!"})),d(()=>({day:5,shouldNotify:!1,layer:"paper",symbol:Gn,story:"With the elves trained, we're almost ready to start working on these presents! Just a couple more pre-reqs first, starting with turning all this wood into wood pulp and finally into paper, which will be required for wrapping paper later on but in the meantime can be used to help write guides which will help these elves continue their education!",completedStory:"You look upon your rivers of book pulp as you hand out stacks of papers to elves to read through. You've continued getting closer and closer to preparing for Christmas, and can go to bed satisfied with your progress. Good Job!"})),d(()=>({day:6,shouldNotify:!1,layer:"boxes",symbol:Ln,story:"You watch all these elves carrying incredibly large loads just in their open elf-sized hands, and realize there's probably a better way. You need to put the toys in boxes anyways, so why don't we get started working on those so the workers can take advantage as well?",completedStory:"Wow, those boxes are really convenient! The workshop feels more and more proper with every day. You tick another requirement on your list and start looking towards tomorrow. Good Job!"})),d(()=>({day:7,shouldNotify:!1,layer:"metal",symbol:Qn,story:"You woke up ready to make some toys, before realizing most toys these days are made out of more than just wood! You're sure you're close to really getting to work, but there's a few more materials you're going to need - like metal! Lots of things need metal!",completedStory:"The sounds of drills and metal clanging join the already loud din as yet another piece of the puzzle fits into place. You're making solid progress, Good Job!"})),d(()=>({day:8,shouldNotify:!1,layer:"cloth",symbol:$n,story:"Another resource you're going to need for gifts is cloth! Fortunately you think this should be pretty easy to prepare using a sheep farm - and as you've already proven with the tree farm, that's something you can handle!",completedStory:"You fall into a pile of wool, sighing contentedly as you look at all the progress you've made today. Good Job!"})),d(()=>({day:9,shouldNotify:!1,layer:"oil",symbol:Vn,story:"Looks like you just need one more thing before the toy factory can start running: plastic! Every toy nowadays is made with plastic! But wait, how are you going to get plastic? What can make plastic? Wait that's right, oil! You figured out you might as well repurpose your coal and ore drills into something that can get you oil, but unfortunately you'll need to mine much deeper that you're currently doing, so let's get to work!",completedStory:"It took a while, but you finally got enough oil for the next step! You deserve a good rest after all this digging work - tomorrow will be a busy day! Good Job!"})),d(()=>({day:10,shouldNotify:!1,layer:"plastic",symbol:Hn,story:"Now that plenty of oil has been prepared, it's time to start refining it into plastic! This should be incredibly useful not only for toys, but making tools and other items!",completedStory:"You've started refining massive amounts of oil into slightly less massive amounts of plastic. You have a slight pang of regret thinking of the environmental impact, but ultimately decide Christmas is worth it. Good Job!"})),d(()=>({day:11,shouldNotify:!1,layer:"dyes",symbol:jn,story:"To make toys, we're going to need some color to make them look nice and enticing! We can't just give kids clear toys after all! To add some color to our toys, we'll need some dyes!",completedStory:"After all that effort, you finally have a rainbow of dyes to choose from! Now the children won't be able to resist the toys you have to offer, once you get them made of course..."})),d(()=>({day:12,shouldNotify:!1,layer:null,symbol:Sr,story:"You watch as the elves work, and you realize that they could probably be trained to help out better. Just then, Santa comes over to check on your progress. You reply that you're doing fine, except that the elves may need a bit of behavior management. Santa offers to help, saying that he doesn't want to leave you to do everything. Unfortunately for you, the behavior problems won't fix themselves, so let's get to work!",completedStory:""})),d(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""}))];function p(){n.value=e.value-1,o.value="Day Complete!",r.value=c[e.value-1].completedStory,l.value=!0,e.value++,R.minimized.value=!1,de.devSpeed=0}return{name:"Calendar",days:c,day:e,timeUntilNewDay:t,loreScene:n,loreTitle:o,loreBody:r,showLoreModal:l,completeDay:p,minWidth:700,display:B(()=>i(S,null,[de.devSpeed===0?i("div",null,[s("Game Paused")]):null,de.devSpeed&&de.devSpeed!==1?i("div",null,[s("Dev Speed: "),L(de.devSpeed),s("x")]):null,de.offlineTime?i("div",null,[s("Offline Time: "),Wl(de.offlineTime)]):null,i(_e,null,null),i("div",{class:"advent"},[c.reduce((m,b)=>(m[m.length-1].length===4&&m.push([]),m[m.length-1].push(b),m),[[]]).map(m=>Ye(...m))])]))}}),Br=e=>[R,ve,Dt,q,Me,te,et,lt,tt,Ze,He,qe],qa=f(()=>!1);function Mr(e,t){var l,n,o,r,d,c;!["0.0","0.1","0.2","0.3","0.4"].includes(e!=null?e:"")||(t.offlineProd=!1,(l=t.layers)==null||delete l.management,(r=(o=(n=t.layers)==null?void 0:n.main)==null?void 0:o.days)!=null&&r[11]&&(t.layers.main.days[11].opened=!1),((c=(d=t.layers)==null?void 0:d.main)==null?void 0:c.day)===12&&(t.layers.main.day,t.devSpeed=0),t.tabs&&(t.tabs=t.tabs.filter(p=>p!=="management")))}var Nr=Object.freeze(Object.defineProperty({__proto__:null,main:R,getInitialLayers:Br,hasWon:qa,fixOldSave:Mr},Symbol.toStringTag,{value:"Module"}));const xr={class:"scene"},Ir=["src"],Dr=["src"],Pr=["src"],Tr=["src"],Fr=["src"],Ur=["src"],Rr=["src"],Or={key:7,class:"scene-bubble",style:{left:"50%",bottom:"38%"}},qr=["src"],Gr=["src"],Lr=["src"],Qr=["src"],$r=Ae({__name:"Scene",props:{day:null},setup(e){return(t,l)=>(k(),I("div",xr,[e.day>=7?(k(),I("img",{key:0,src:u($n),class:"scene-item",style:{left:"4%",bottom:"3%",width:"40px",height:"40px"}},null,8,Ir)):G("",!0),e.day>=0?(k(),I("img",{key:1,src:u(Un),class:"scene-item",style:{left:"10%",bottom:"10%"}},null,8,Dr)):G("",!0),e.day>=1?(k(),I("img",{key:2,src:u(Rn),class:"scene-item",style:{left:"40%",bottom:"12%"}},null,8,Pr)):G("",!0),e.day>=2?(k(),I("img",{key:3,src:u(On),class:"scene-item",style:{left:"65%",bottom:"12%",width:"40px",height:"40px"}},null,8,Tr)):G("",!0),e.day>=6?(k(),I("img",{key:4,src:u(Qn),class:"scene-item",style:{left:"72%",bottom:"8%",width:"40px",height:"40px"}},null,8,Fr)):G("",!0),e.day>=8?(k(),I("img",{key:5,src:u(Vn),class:"scene-item",style:{left:"80%",bottom:"6%"}},null,8,Ur)):G("",!0),e.day>=3?(k(),I("img",{key:6,src:u(qn),class:"scene-item",style:{left:"52%",bottom:"12%"}},null,8,Rr)):G("",!0),e.day>=4?(k(),I("div",Or,[e.day>=4?(k(),I("img",{key:0,src:u(Gn),class:"scene-item"},null,8,qr)):G("",!0),e.day>=5?(k(),I("img",{key:1,src:u(Ln),class:"scene-item"},null,8,Gr)):G("",!0),e.day>=9?(k(),I("img",{key:2,src:u(Hn),class:"scene-item"},null,8,Lr)):G("",!0),e.day>=10?(k(),I("img",{key:3,src:u(jn),class:"scene-item"},null,8,Qr)):G("",!0)])):G("",!0)]))}});var Vr=$e($r,[["__scopeId","data-v-47b4d886"]]);const Hr=Ae({components:{Context:Cn},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:Y(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:Y(Number,String),required:!0},name:{type:Y(String),required:!0},color:Y(String),minimizable:Y(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:l,minimized:n,minWidth:o,tab:r}=Bt(e),d=sa(t),c=f(()=>je.allowGoBack&&l.value>0&&!n.value);function p(){de.tabs.splice(u(e.index),1)}_l(()=>b(n.value,u(o.value))),Xt([n,qo(o)],([h,A])=>b(h,A));function m(h){e.nodes.value=h}function b(h,A){const v=typeof A=="number"||Number.isNaN(parseInt(A))?A+"px":A,_=r.value();_!=null&&(h?(_.style.flexGrow="0",_.style.flexShrink="0",_.style.width="60px",_.style.minWidth=_.style.flexBasis="",_.style.margin="0"):(_.style.flexGrow="",_.style.flexShrink="",_.style.width="",_.style.minWidth=_.style.flexBasis=v,_.style.margin=""))}return{component:d,showGoBack:c,updateNodes:m,unref:u,goBack:p}}});function jr(e,t,l,n,o,r){const d=gl("Context");return k(),I("div",{class:"layer-container",style:yt({"--layer-color":e.unref(e.color)})},[e.showGoBack?(k(),I("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):G("",!0),e.minimized.value?(k(),I("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.minimized.value=!1)},[g("div",null,Ne(e.unref(e.name)),1)])):(k(),I("div",{key:2,class:ct(["layer-tab",{showGoBack:e.showGoBack}])},[i(d,{onUpdateNodes:e.updateNodes},{default:pe(()=>[(k(),ye(nt(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(k(),I("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.minimized.value=!0)}," \u25BC ")):G("",!0)],4)}var Wr=$e(Hr,[["render",jr],["__scopeId","data-v-0158bec3"]]);const Wn=e=>(ol("data-v-4b4bda40"),e=e(),sl(),e),Jr=Wn(()=>g("h2",null,"Changelog",-1)),Kr=Wn(()=>g("details",{open:""},[g("summary",null,[s("v0.0 Initial Commit - "),g("time",null,"2021-09-04")]),s(" This is the first release :D "),g("ul",null,[g("li",{class:"feature"},"Did everything"),g("li",{class:"fix"},"Had some fun"),g("li",{class:"breaking"},"Removed everything"),g("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),zr=Ae({__name:"Changelog",setup(e,{expose:t}){const l=V(!1);return t({open(){l.value=!0}}),(n,o)=>(k(),ye(wt,{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=r=>l.value=r)},{header:pe(()=>[Jr]),body:pe(()=>[Kr]),_:1},8,["modelValue"]))}});var Xr=$e(zr,[["__scopeId","data-v-4b4bda40"]]);const Yr={class:"info-modal-header"},Zr=["src","alt"],eu={class:"info-modal-title"},tu={key:0},lu=s(" - "),au={key:0},nu={key:0},iu=g("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),ou=g("br",null,null,-1),su=g("br",null,null,-1),ru=["href"],uu=g("span",{class:"material-icons info-modal-discord"},"discord",-1),du=g("div",null,[g("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[g("span",{class:"material-icons info-modal-discord"},"discord"),s(" The Paper Pilot Community ")])],-1),cu=g("div",null,[g("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[g("span",{class:"material-icons info-modal-discord"},"discord"),s(" The Modding Tree ")])],-1),pu=g("br",null,null,-1);var mu=Ae({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const l=e,{title:n,logo:o,author:r,discordName:d,discordLink:c,versionNumber:p,versionTitle:m}=je,b=Bt(l),h=V(!1),A=f(()=>Wl(de.timePlayed)),v=f(()=>Qe(B(()=>i(S,null,[In.map(se)]))));t({open(){h.value=!0}});function _(){var N;(N=u(b.changelog))==null||N.open()}return(N,D)=>(k(),ye(wt,{class:"info-modal",modelValue:h.value,"onUpdate:modelValue":D[0]||(D[0]=H=>h.value=H)},{header:pe(()=>[g("div",Yr,[u(o)?(k(),I("img",{key:0,class:"info-modal-logo",src:u(o),alt:u(n)},null,8,Zr)):G("",!0),g("div",eu,[g("h2",null,"- "+Ne(u(n))+" -",1),g("h4",null,[s(" - v"+Ne(u(p)),1),u(m)?(k(),I("span",tu,": "+Ne(u(m)),1)):G("",!0),lu])])])]),body:pe(({shown:H})=>[H?(k(),I("div",au,[u(r)?(k(),I("div",nu,"By "+Ne(u(r)),1)):G("",!0),iu,ou,g("div",{class:"link",onClick:_},"Changelog"),su,g("div",null,[u(c)?(k(),I("a",{key:0,href:u(c),class:"info-modal-discord-link",target:"_blank"},[uu,s(" "+Ne(u(d)),1)],8,ru)):G("",!0)]),du,cu,pu,g("div",null,"Time Played: "+Ne(u(A)),1),(k(),ye(nt(u(v))))])):G("",!0)]),_:1},8,["modelValue"]))}});const Jn=e=>(ol("data-v-0d685451"),e=e(),sl(),e),vu=Jn(()=>g("h2",null,"Options",-1)),fu=Jn(()=>g("hr",null,null,-1));var gu=Ae({__name:"Options",setup(e,{expose:t}){const l=V(!1);t({open(){l.value=!0}});const n=Object.keys(Fl).map(v=>({label:wn(v),value:v})),o=f(()=>Qe(B(()=>i(S,null,[xn.map(se)])))),{showTPS:r,theme:d}=Bt(at),{autosave:c,usingLog:p}=Bt(de),m=f({get(){return de.devSpeed===0},set(v){de.devSpeed=v?0:null}}),b=B(()=>i("span",null,[s("Autosave"),i(ut,{display:"Save-specific"},{default:()=>[s("*")]})])),h=B(()=>i("span",null,[s("Pause game"),i(ut,{display:"Save-specific"},{default:()=>[s("*")]})])),A=B(()=>i("span",null,[s("Use log for progress bar"),i(ut,{display:"Save-specific"},{default:()=>[s("*")]})]));return(v,_)=>(k(),ye(wt,{modelValue:l.value,"onUpdate:modelValue":_[5]||(_[5]=N=>l.value=N)},{header:pe(()=>[vu]),body:pe(()=>[i(Oa,{title:"Theme",options:u(n),modelValue:u(d),"onUpdate:modelValue":_[0]||(_[0]=N=>ht(d)?d.value=N:null)},null,8,["options","modelValue"]),(k(),ye(nt(u(o)))),i(nl,{title:"Show TPS",modelValue:u(r),"onUpdate:modelValue":_[1]||(_[1]=N=>ht(r)?r.value=N:null)},null,8,["modelValue"]),fu,i(nl,{title:u(b),modelValue:u(c),"onUpdate:modelValue":_[2]||(_[2]=N=>ht(c)?c.value=N:null)},null,8,["title","modelValue"]),u(je).enablePausing?(k(),ye(nl,{key:0,title:u(h),modelValue:u(m),"onUpdate:modelValue":_[3]||(_[3]=N=>ht(m)?m.value=N:null)},null,8,["title","modelValue"])):G("",!0),i(nl,{title:u(A),modelValue:u(p),"onUpdate:modelValue":_[4]||(_[4]=N=>ht(p)?p.value=N:null)},null,8,["title","modelValue"])]),_:1},8,["modelValue"]))}});var hu=$e(gu,[["__scopeId","data-v-0d685451"]]);const yu=["onSubmit"],bu={class:"field"},wu={key:0,class:"field-title"},Au=["placeholder"],Cu=Ae({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const l=e,n=hl(Yt(l,"title"),"span"),o=$t(null);ua(()=>{var p;(p=o.value)==null||p.focus()});const r=f({get(){return u(l.modelValue)||""},set(p){t("update:modelValue",p)}});function d(){t("submit")}function c(){l.submitOnBlur!==!1?t("submit"):t("cancel")}return(p,m)=>(k(),I("form",{onSubmit:Ll(d,["prevent"])},[g("div",bu,[u(n)?(k(),I("span",wu,[(k(),ye(nt(u(n))))])):G("",!0),e.textArea?(k(),ye(u(mi),{key:1,modelValue:u(r),"onUpdate:modelValue":m[0]||(m[0]=b=>ht(r)?r.value=b:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:c,ref_key:"field",ref:o},null,8,["modelValue","placeholder","maxHeight"])):da((k(),I("input",{key:2,type:"text","onUpdate:modelValue":m[1]||(m[1]=b=>ht(r)?r.value=b:null),placeholder:e.placeholder,class:ct({fullWidth:!e.title}),onBlur:c,ref_key:"field",ref:o},null,42,Au)),[[si,u(r)]])])],40,yu))}});var Kn=$e(Cu,[["__scopeId","data-v-67b44a54"]]);const ku={key:0},Eu=["onClick","disabled"],_u={key:0},Su=["onClick"],Bu=Ae({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const n=Bt(e),o=V(!1);Xt(o,c=>{t("confirmingChanged",c)});function r(){if(u(n.skipConfirm)){t("click");return}o.value&&t("click"),o.value=!o.value}function d(){o.value=!1}return(c,p)=>(k(),I("span",{class:ct(["container",{confirming:o.value}])},[o.value?(k(),I("span",ku,"Are you sure?")):G("",!0),g("button",{onClick:Ll(r,["stop"]),class:"button danger",disabled:e.disabled},[o.value?(k(),I("span",_u,"Yes")):Qt(c.$slots,"default",{key:1},void 0,!0)],8,Eu),o.value?(k(),I("button",{key:1,class:"button",onClick:Ll(d,["stop"])},"No",8,Su)):G("",!0)],2))}});var Mu=$e(Bu,[["__scopeId","data-v-2f8ef34c"]]);const Nu=["onClick"],xu=Ae({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const l=V(!1),n=V(null);function o(){t("click"),n.value&&clearTimeout(n.value),l.value=!1,_l(()=>{l.value=!0,n.value=setTimeout(()=>l.value=!1,500)})}return(r,d)=>(k(),I("button",{onClick:Ll(o,["stop"]),class:ct(["feedback",{activated:l.value,left:e.left}])},[Qt(r.$slots,"default",{},void 0,!0)],10,Nu))}});var Iu=$e(xu,[["__scopeId","data-v-01a1b95c"]]);const ul=e=>(ol("data-v-5285ac49"),e=e(),sl(),e),Du=ul(()=>g("div",{class:"handle material-icons"},"drag_handle",-1)),Pu={key:0,class:"actions"},Tu=ul(()=>g("span",{class:"material-icons"},"content_paste",-1)),Fu=ul(()=>g("span",{class:"material-icons"},"content_copy",-1)),Uu=ul(()=>g("span",{class:"material-icons"},"edit",-1)),Ru=ul(()=>g("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Ou={key:1,class:"actions"},qu=ul(()=>g("span",{class:"material-icons"},"check",-1)),Gu=ul(()=>g("span",{class:"material-icons"},"close",-1)),Lu={key:2,class:"details"},Qu={class:"save-version"},$u=ul(()=>g("br",null,null,-1)),Vu={key:0},Hu={key:1},ju={key:3,class:"details"},Wu={key:4,class:"details error"},Ju=ul(()=>g("br",null,null,-1)),Ku=Ae({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const l=e,{save:n}=Bt(l),o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),r=V(!1),d=V(!1),c=V("");Xt(r,()=>c.value=n.value.name||"");const p=f(()=>n.value&&n.value.id===de.id),m=f(()=>p.value?de.time:n.value&&n.value.time||0),b=sa(f(()=>{var A,v,_,N;return`Day ${(N=(_=(v=(A=n.value)==null?void 0:A.layers)==null?void 0:v.main)==null?void 0:_.day)!=null?N:1}`}));function h(){t("editName",c.value),r.value=!1}return(A,v)=>(k(),I("div",{class:ct(["save",{active:u(p)}])},[Du,r.value?(k(),I("div",Ou,[g("button",{onClick:h,class:"button"},[i(ut,{display:"Save",direction:u(Pe).Left,class:"info"},{default:pe(()=>[qu]),_:1},8,["direction"])]),g("button",{onClick:v[5]||(v[5]=_=>r.value=!r.value),class:"button"},[i(ut,{display:"Cancel",direction:u(Pe).Left,class:"info"},{default:pe(()=>[Gu]),_:1},8,["direction"])])])):(k(),I("div",Pu,[u(n).error==null&&!d.value?(k(),ye(Iu,{key:0,onClick:v[0]||(v[0]=_=>t("export")),class:"button",left:""},{default:pe(()=>[i(ut,{display:"Export",direction:u(Pe).Left,class:"info"},{default:pe(()=>[Tu]),_:1},8,["direction"])]),_:1})):G("",!0),u(n).error==null&&!d.value?(k(),I("button",{key:1,onClick:v[1]||(v[1]=_=>t("duplicate")),class:"button"},[i(ut,{display:"Duplicate",direction:u(Pe).Left,class:"info"},{default:pe(()=>[Fu]),_:1},8,["direction"])])):G("",!0),u(n).error==null&&!d.value?(k(),I("button",{key:2,onClick:v[2]||(v[2]=_=>r.value=!r.value),class:"button"},[i(ut,{display:"Edit Name",direction:u(Pe).Left,class:"info"},{default:pe(()=>[Uu]),_:1},8,["direction"])])):G("",!0),i(Mu,{disabled:u(p),onClick:v[3]||(v[3]=_=>t("delete")),onConfirmingChanged:v[4]||(v[4]=_=>d.value=_)},{default:pe(()=>[i(ut,{display:"Delete",direction:u(Pe).Left,class:"info"},{default:pe(()=>[Ru]),_:1},8,["direction"])]),_:1},8,["disabled"])])),u(n).error==null&&!r.value?(k(),I("div",Lu,[g("button",{class:"button open",onClick:v[6]||(v[6]=_=>t("open"))},[g("h3",null,Ne(u(n).name),1)]),g("span",Qu,"v"+Ne(u(n).modVersion),1),$u,u(m)?(k(),I("div",Vu,"Last played "+Ne(u(o).format(u(m))),1)):G("",!0),u(b)?(k(),I("div",Hu,[(k(),ye(nt(u(b))))])):G("",!0)])):u(n).error==null&&r.value?(k(),I("div",ju,[i(Kn,{modelValue:c.value,"onUpdate:modelValue":v[7]||(v[7]=_=>c.value=_),class:"editname",onSubmit:h},null,8,["modelValue"])])):(k(),I("div",Wu,[s(" Error: Failed to load save with id "+Ne(u(n).id),1),Ju,s(Ne(u(n).error),1)]))],2))}});var zu=$e(Ku,[["__scopeId","data-v-5285ac49"]]);const Ga=e=>(ol("data-v-3b9991aa"),e=e(),sl(),e),Xu=Ga(()=>g("h2",null,"Saves Manager",-1)),Yu={class:"modal-footer"},Zu={class:"field"},ed=Ga(()=>g("span",{class:"field-title"},"Create Save",-1)),td={class:"field-buttons"},ld={class:"footer"},ad=Ga(()=>g("div",{style:{"flex-grow":"1"}},null,-1)),nd=Ae({__name:"SavesManager",setup(e,{expose:t}){const l=V(!1),n=V(null);t({open(){l.value=!0}});const o=V(!1),r=V(""),d=V(null);Xt(r,M=>{M?_l(()=>{try{if(M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=ml.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M),o.value=!0;return}const E=JSON.parse(M);if(typeof E!="object"){o.value=!0;return}const T=ta();E.id=T,Jt(E),r.value="",o.value=!1,at.saves.push(T)}catch{o.value=!0}}):o.value=!1});let c={},p=V(Object.keys(c).reduce((M,E)=>(M.push({label:E.split("/").slice(-1)[0].slice(0,-4),value:c[E]}),M),[]));const m=pa({});function b(M){if(m[M]==null){let E=localStorage.getItem(M);if(E==null)m[M]={error:"Save doesn't exist in localStorage",id:M};else if(E==="dW5kZWZpbmVk")m[M]={error:"Save is undefined",id:M};else try{if(E[0]!=="{")if(E[0]==="e")E=decodeURIComponent(escape(atob(E)));else if(E[0]==="\u1BE1")E=ml.decompressFromUTF16(E);else return console.warn("Unable to determine preset encoding",E),o.value=!0,m[M]={error:"Unable to determine preset encoding",id:M},m[M];m[M]={...JSON.parse(E),id:M}}catch(T){m[M]={error:T,id:M},console.warn(`SavesManager: Failed to load info about save with id ${M}:
${T}
${E}`)}}return m[M]}Xt(l,M=>{M&&Object.keys(m).forEach(E=>delete m[E])});const h=f(()=>at.saves.reduce((M,E)=>(M[E]=b(E),M),{}));function A(M){let E;switch(de.id===M?E=Bn(de[ot]):E=JSON.stringify(h.value[M]),je.exportEncoding){default:console.warn(`Unknown save encoding: ${je.exportEncoding}. Defaulting to lz`);case"lz":E=ml.compressToUTF16(E);break;case"base64":E=btoa(unescape(encodeURIComponent(E)));break;case"plain":break}const T=document.createElement("textarea");T.value=E,document.body.appendChild(T),T.select(),T.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(T)}function v(M){de.id===M&&Jt();const E={...h.value[M],id:ta()};Jt(E),at.saves.push(E.id)}function _(M){at.saves=at.saves.filter(E=>E!==M),localStorage.removeItem(M),m[M]=void 0}function N(M){h.value[de.id].time=de.time,Jt(),m[de.id]=void 0,El(h.value[M]),m[M]=void 0}function D(M){if(d.value=M,_l(()=>{d.value=null}),M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=ml.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M);return}const E=JSON.parse(M);E.id=ta(),Jt(E),at.saves.push(E.id),N(E.id)}function H(M,E){const T=h.value[M];T&&(T.name=E,de.id===M?(de.name=E,Jt()):(Jt(T),m[M]=void 0))}return(M,E)=>(k(),ye(wt,{modelValue:l.value,"onUpdate:modelValue":E[4]||(E[4]=T=>l.value=T),ref_key:"modal",ref:n},{header:pe(()=>[Xu]),body:pe(({shown:T})=>[T?(k(),ye(u(pi),{key:0,list:u(at).saves,handle:".handle",itemKey:J=>J},{item:pe(({element:J})=>[i(zu,{save:u(h)[J],onOpen:fe=>N(J),onExport:fe=>A(J),onEditName:fe=>H(J,fe),onDuplicate:fe=>v(J),onDelete:fe=>_(J)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):G("",!0)]),footer:pe(()=>[g("div",Yu,[i(Kn,{modelValue:r.value,"onUpdate:modelValue":E[0]||(E[0]=T=>r.value=T),title:"Import Save",placeholder:"Paste your save here!",class:ct({importingFailed:o.value})},null,8,["modelValue","class"]),g("div",Zu,[ed,g("div",td,[g("button",{class:"button",onClick:E[1]||(E[1]=T=>N(u(Il)().id))},"New Game"),Object.keys(u(p)).length>0?(k(),ye(Oa,{key:0,options:u(p),modelValue:d.value,"onUpdate:modelValue":E[2]||(E[2]=T=>D(T)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):G("",!0)])]),g("div",ld,[ad,g("button",{class:"button modal-default-button",onClick:E[3]||(E[3]=T=>l.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var zn=$e(nd,[["__scopeId","data-v-3b9991aa"]]);const Gt=e=>(ol("data-v-8495e562"),e=e(),sl(),e),id=["src","alt"],od={key:1,class:"title"},sd=Gt(()=>g("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),rd={class:"discord"},ud={class:"discord-links"},dd={key:0},cd=["href"],pd=Gt(()=>g("li",null,[g("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),md=Gt(()=>g("li",null,[g("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),vd={href:"https://forums.moddingtree.com/",target:"_blank"},fd=Gt(()=>g("span",{class:"material-icons"},"forum",-1)),gd=Gt(()=>g("span",{class:"material-icons"},"info",-1)),hd=Gt(()=>g("span",{class:"material-icons"},"library_books",-1)),yd=Gt(()=>g("span",{class:"material-icons"},"settings",-1)),bd=Gt(()=>g("span",{class:"material-icons"},"library_books",-1)),wd=Gt(()=>g("span",{class:"material-icons"},"settings",-1)),Ad=Gt(()=>g("span",{class:"material-icons"},"info",-1)),Cd={href:"https://forums.moddingtree.com/",target:"_blank"},kd=Gt(()=>g("span",{class:"material-icons"},"forum",-1)),Ed={class:"discord"},_d={class:"discord-links"},Sd={key:0},Bd=["href"],Md=Gt(()=>g("li",null,[g("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Nd=Gt(()=>g("li",null,[g("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),xd=Ae({__name:"Nav",setup(e){const t=V(null),l=V(null),n=V(null),o=V(null),{useHeader:r,banner:d,title:c,discordName:p,discordLink:m,versionNumber:b}=je;function h(){window.open(m,"mywindow")}return(A,v)=>(k(),I(S,null,[u(r)?(k(),I("div",Sl({key:0,class:"nav"},A.$attrs),[u(d)?(k(),I("img",{key:0,src:u(d),class:"banner",alt:u(c)},null,8,id)):(k(),I("div",od,Ne(u(c)),1)),g("div",{onClick:v[0]||(v[0]=_=>{var N;return(N=o.value)==null?void 0:N.open()}),class:"version-container"},[i(ut,{display:"Changelog",direction:u(Pe).Down,class:"version"},{default:pe(()=>[g("span",null,"v"+Ne(u(b)),1)]),_:1},8,["direction"])]),sd,g("div",rd,[g("span",{onClick:h,class:"material-icons"},"discord"),g("ul",ud,[u(m)?(k(),I("li",dd,[g("a",{href:u(m),target:"_blank"},Ne(u(p)),9,cd)])):G("",!0),pd,md])]),g("div",null,[g("a",vd,[i(ut,{display:"Forums",direction:u(Pe).Down,yoffset:"5px"},{default:pe(()=>[fd]),_:1},8,["direction"])])]),g("div",{onClick:v[1]||(v[1]=_=>{var N;return(N=t.value)==null?void 0:N.open()})},[i(ut,{display:"Info",direction:u(Pe).Down,class:"info"},{default:pe(()=>[gd]),_:1},8,["direction"])]),g("div",{onClick:v[2]||(v[2]=_=>{var N;return(N=l.value)==null?void 0:N.open()})},[i(ut,{display:"Saves",direction:u(Pe).Down,xoffset:"-20px"},{default:pe(()=>[hd]),_:1},8,["direction"])]),g("div",{onClick:v[3]||(v[3]=_=>{var N;return(N=n.value)==null?void 0:N.open()})},[i(ut,{display:"Options",direction:u(Pe).Down,xoffset:"-66px"},{default:pe(()=>[yd]),_:1},8,["direction"])])],16)):(k(),I("div",Sl({key:1,class:"overlay-nav"},A.$attrs),[g("div",{onClick:v[4]||(v[4]=_=>{var N;return(N=o.value)==null?void 0:N.open()}),class:"version-container"},[i(ut,{display:"Changelog",direction:u(Pe).Right,xoffset:"25%",class:"version"},{default:pe(()=>[g("span",null,"v"+Ne(u(b)),1)]),_:1},8,["direction"])]),g("div",{onClick:v[5]||(v[5]=_=>{var N;return(N=l.value)==null?void 0:N.open()})},[i(ut,{display:"Saves",direction:u(Pe).Right},{default:pe(()=>[bd]),_:1},8,["direction"])]),g("div",{onClick:v[6]||(v[6]=_=>{var N;return(N=n.value)==null?void 0:N.open()})},[i(ut,{display:"Options",direction:u(Pe).Right},{default:pe(()=>[wd]),_:1},8,["direction"])]),g("div",{onClick:v[7]||(v[7]=_=>{var N;return(N=t.value)==null?void 0:N.open()})},[i(ut,{display:"Info",direction:u(Pe).Right},{default:pe(()=>[Ad]),_:1},8,["direction"])]),g("div",null,[g("a",Cd,[i(ut,{display:"Forums",direction:u(Pe).Right,xoffset:"7px"},{default:pe(()=>[kd]),_:1},8,["direction"])])]),g("div",Ed,[g("span",{onClick:h,class:"material-icons"},"discord"),g("ul",_d,[u(m)?(k(),I("li",Sd,[g("a",{href:u(m),target:"_blank"},Ne(u(p)),9,Bd)])):G("",!0),Md,Nd])])],16)),i(mu,{ref_key:"info",ref:t,changelog:o.value},null,8,["changelog"]),i(zn,{ref_key:"savesManager",ref:l},null,512),i(hu,{ref_key:"options",ref:n},null,512),i(Xr,{ref_key:"changelog",ref:o},null,512)],64))}});var Xn=$e(xd,[["__scopeId","data-v-8495e562"]]);const La=e=>(ol("data-v-248e2ebb"),e=e(),sl(),e),Id={class:"inner-tab"},Dd={key:1},Pd=La(()=>g("br",null,null,-1)),Td=s(" You can help continue the "),Fd=La(()=>g("i",null,"advent",-1)),Ud=s("ure at: "),Rd=La(()=>g("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[g("span",{class:"material-icons info-modal-discord"},"discord"),s(" The Paper Pilot Community ")],-1)),Od=Ae({__name:"Game",setup(e){const t=Yt(de,"tabs"),l=f(()=>Object.keys(_t)),n=je.useHeader,o=hl(R.loreBody);function r(d){const{display:c,minimized:p,minWidth:m,name:b,color:h,minimizable:A,nodes:v}=d;return{display:c,minimized:p,minWidth:m,name:b,color:h,minimizable:A,nodes:v}}return(d,c)=>(k(),I("div",{class:ct(["tabs-container",{useHeader:u(n)}])},[(k(!0),I(S,null,un(u(t),(p,m)=>{var b,h;return k(),I("div",{key:m,class:ct(["tab",u((b=u(_t)[p])==null?void 0:b.classes)]),ref_for:!0,ref:`tab-${m}`,style:yt(u((h=u(_t)[p])==null?void 0:h.style))},[m===0&&!u(n)?(k(),ye(Xn,{key:0})):G("",!0),g("div",Id,[u(l).includes(p)?(k(),ye(Wr,Sl({key:0},r(u(_t)[p]),{index:m,tab:()=>{var A;return(A=d.$refs[`tab-${m}`])==null?void 0:A[0]}}),null,16,["index","tab"])):(k(),ye(nt(p),{key:1,index:m},null,8,["index"]))])],6)}),128)),i(wt,{modelValue:u(R).showLoreModal.value,"onUpdate:modelValue":c[0]||(c[0]=p=>u(R).showLoreModal.value=p)},{header:pe(()=>[g("h2",null,Ne(u(R).loreTitle.value),1)]),body:pe(()=>[u(o)?(k(),ye(nt(u(o)),{key:0})):G("",!0),u(R).loreScene.value!==-1?(k(),I("div",Dd,[i(Vr,{day:u(R).loreScene.value},null,8,["day"]),Pd,Td,Fd,Ud,Rd])):G("",!0)]),_:1},8,["modelValue"])],2))}});var qd=$e(Od,[["__scopeId","data-v-248e2ebb"]]);const zl=e=>(ol("data-v-4a50ce42"),e=e(),sl(),e),Gd={class:"game-over-modal-header"},Ld=["src","alt"],Qd={class:"game-over-modal-title"},$d=zl(()=>g("h2",null,"Congratulations!",-1)),Vd={key:0},Hd=zl(()=>g("br",null,null,-1)),jd=zl(()=>g("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Wd=zl(()=>g("br",null,null,-1)),Jd=["href"],Kd=zl(()=>g("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),zd=Ae({__name:"GameOverScreen",setup(e){const{title:t,logo:l,discordName:n,discordLink:o,versionNumber:r,versionTitle:d}=je,c=f(()=>Wl(de.timePlayed)),p=f(()=>qa.value&&!de.keepGoing),m=Yt(de,"autosave");function b(){de.keepGoing=!0}function h(){El(Il())}return(A,v)=>(k(),ye(wt,{"model-value":u(p)},{header:pe(()=>[g("div",Gd,[u(l)?(k(),I("img",{key:0,class:"game-over-modal-logo",src:u(l),alt:u(t)},null,8,Ld)):G("",!0),g("div",Qd,[$d,g("h4",null,"You've beaten "+Ne(u(t))+" v"+Ne(u(r))+": "+Ne(u(d)),1)])])]),body:pe(({shown:_})=>[_?(k(),I("div",Vd,[g("div",null,"It took you "+Ne(u(c))+" to beat the game.",1),Hd,jd,Wd,g("div",null,[g("a",{href:u(o),class:"game-over-modal-discord-link"},[Kd,s(" "+Ne(u(n)),1)],8,Jd)]),i(nl,{title:"Autosave",modelValue:u(m),"onUpdate:modelValue":v[0]||(v[0]=N=>ht(m)?m.value=N:null)},null,8,["modelValue"])])):G("",!0)]),footer:pe(()=>[g("div",{class:"game-over-footer"},[g("button",{onClick:b,class:"button"},"Keep Going"),g("button",{onClick:h,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Xd=$e(zd,[["__scopeId","data-v-4a50ce42"]]);const ga=e=>(ol("data-v-3de07c06"),e=e(),sl(),e),Yd=ga(()=>g("div",{class:"nan-modal-header"},[g("h2",null,"NaN value detected!")],-1)),Zd={key:0},ec=ga(()=>g("br",null,null,-1)),tc=["href"],lc=ga(()=>g("span",{class:"material-icons nan-modal-discord"},"discord",-1)),ac=ga(()=>g("br",null,null,-1)),nc={class:"nan-footer"},ic=Ae({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:l}=je,n=Yt(de,"autosave"),o=Yt(rt,"hasNaN"),r=V(null),d=f(()=>{var v;return(v=rt.NaNPath)==null?void 0:v.join(".")}),c=f(()=>{var v;return(v=rt.NaNPath)==null?void 0:v.slice(-1)[0]}),p=f(()=>rt.NaNReceiver&&c.value?rt.NaNReceiver[c.value]:null),m=f({get(){return de.devSpeed===0},set(v){de.devSpeed=v?null:0}});function b(){rt.NaNReceiver&&c.value&&(rt.NaNReceiver[c.value]=new a(0),rt.hasNaN=!1)}function h(){rt.NaNReceiver&&c.value&&(rt.NaNReceiver[c.value]=new a(1),rt.hasNaN=!1)}function A(){rt.NaNReceiver&&c.value&&(rt.NaNReceiver[c.value]=new a(NaN),rt.hasNaN=!1)}return(v,_)=>(k(),I(S,null,[i(wt,Sl({modelValue:u(o),"onUpdate:modelValue":_[4]||(_[4]=N=>ht(o)?o.value=N:null)},v.$attrs),{header:pe(()=>[Yd]),body:pe(()=>[g("div",null,[s(' Attempted to assign "'+Ne(u(d))+'" to NaN',1),u(p)?(k(),I("span",Zd,Ne(" ")+"(previously "+Ne(u(L)(u(p)))+")",1)):G("",!0),s(". Auto-saving has been "+Ne(u(n)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),ec,g("div",null,[g("a",{href:u(l),class:"nan-modal-discord-link"},[lc,s(" "+Ne(u(t)),1)],8,tc)]),ac,i(nl,{title:"Autosave",modelValue:u(n),"onUpdate:modelValue":_[0]||(_[0]=N=>ht(n)?n.value=N:null)},null,8,["modelValue"]),u(je).enablePausing?(k(),ye(nl,{key:0,title:"Pause game",modelValue:u(m),"onUpdate:modelValue":_[1]||(_[1]=N=>ht(m)?m.value=N:null)},null,8,["modelValue"])):G("",!0)]),footer:pe(()=>[g("div",nc,[g("button",{onClick:_[2]||(_[2]=N=>{var D;return(D=r.value)==null?void 0:D.open()}),class:"button"},"Open Saves Manager"),g("button",{onClick:b,class:"button"},"Set to 0"),g("button",{onClick:h,class:"button"},"Set to 1"),u(p)&&u(a).neq(u(p),0)&&u(a).neq(u(p),1)?(k(),I("button",{key:0,onClick:_[3]||(_[3]=N=>o.value=!1),class:"button"}," Set to previous ")):G("",!0),g("button",{onClick:A,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),i(zn,{ref_key:"savesManager",ref:r},null,512)],64))}});var oc=$e(ic,[["__scopeId","data-v-3de07c06"]]);const sc={key:0,class:"tpsDisplay"},rc={key:0,class:"low"},uc=Ae({__name:"TPS",setup(e){const t=f(()=>a.div(rt.lastTenTicks.length,rt.lastTenTicks.reduce((r,d)=>r+d,0))),l=V([]);qt(()=>{l.value.push(Math.round(t.value.toNumber())),l.value.length>10&&(l.value=l.value.slice(1))});const n=f(()=>l.value.reduce((r,d)=>a.max(r,d),0)),o=f(()=>a.sub(t.value,n.value).gt(1));return(r,d)=>u(t).isNan()?G("",!0):(k(),I("div",sc,[s(" TPS: "+Ne(u(X)(u(t)))+" ",1),i(ca,{name:"fade"},{default:pe(()=>[u(o)?(k(),I("span",rc,Ne(u(X)(u(n))),1)):G("",!0)]),_:1})]))}});var dc=$e(uc,[["__scopeId","data-v-46a3ed5b"]]);var cc=Ae({__name:"App",setup(e){const t=je.useHeader,l=f(()=>Fl[at.theme].variables),n=Yt(at,"showTPS"),o=f(()=>Qe(B(()=>i(S,null,[To.map(se)]))));return(r,d)=>(k(),I(S,null,[g("div",{id:"modal-root",style:yt(u(l))},null,4),g("div",{class:ct(["app",{useHeader:u(t)}]),style:yt(u(l))},[u(t)?(k(),ye(Xn,{key:0})):G("",!0),i(qd),u(u(n))?(k(),ye(dc,{key:1})):G("",!0),i(Xd),i(oc),(k(),ye(nt(u(o))))],6)],64))}});var pc=$e(cc,[["__scopeId","data-v-580927bb"]]);function mc(e={}){const{immediate:t=!1,onNeedRefresh:l,onOfflineReady:n,onRegistered:o,onRegisterError:r}=e;let d,c;const p=async(m=!0)=>{m&&(d==null||d.addEventListener("controlling",b=>{b.isUpdate&&window.location.reload()})),c&&c.waiting&&await fi(c.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){d=new vi("./sw.js",{scope:"./",type:"classic"}),d.addEventListener("activated",m=>{m.isUpdate||n==null||n()});{const m=()=>{l==null||l()};d.addEventListener("waiting",m),d.addEventListener("externalwaiting",m)}d.register({immediate:t}).then(m=>{c=m,o==null||o(m)}).catch(m=>{r==null||r(m)})}return p}function vc(e={}){const{immediate:t=!0,onNeedRefresh:l,onOfflineReady:n,onRegistered:o,onRegisterError:r}=e,d=V(!1),c=V(!1);return{updateServiceWorker:mc({immediate:t,onNeedRefresh(){d.value=!0,l==null||l()},onOfflineReady(){c.value=!0,n==null||n()},onRegistered:o,onRegisterError:r}),offlineReady:c,needRefresh:d}}document.title=je.title;window.projInfo=je;if(je.id==="")throw"Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json";requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c
Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await No();const{globalBus:e}=await aa(()=>Promise.resolve().then(function(){return po}),void 0),{startGameLoop:t}=await aa(()=>import("./gameLoop.adaee6f9.js"),["assets/gameLoop.adaee6f9.js","assets/@fontsource.c175eac8.css","assets/vue.92681fcb.js","assets/lz-string.731cedc5.js","assets/@vue.4ce677c2.js","assets/nanoevents.1080beb7.js","assets/is-plain-object.906d88e8.js","assets/vue-next-select.a2bfab1d.js","assets/vue-next-select.9e6f4164.css","assets/vue-toastification.6f567382.js","assets/vue-toastification.4b5f8ac8.css","assets/vuedraggable.7949458c.js","assets/sortablejs.29100d8a.js","assets/vue-textarea-autosize.35804eaf.js","assets/workbox-window.8d14e8b7.js"]),l=window.vue=ri(pc);e.emit("setupVue",l),l.mount("#app"),_l(()=>{const n=cn(),{updateServiceWorker:o}=vc({onNeedRefresh(){n.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){o()}})},onOfflineReady(){n.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(r){r&&setInterval(()=>r.update(),60*60*1e3)}})}),t()});export{a as D,aa as _,rt as a,je as b,Nr as c,Xe as g,Ta as l,de as p,at as s};