Advent-Incremental/assets/index.496081c6.js

19 lines
179 KiB
JavaScript

/* empty css */import"./vue.92681fcb.js";import{Z as N,l as De,aa as Q,t as O,ay as An,ar as Kt,aE as b,a0 as M,aK as wt,a1 as f,O as B,aG as yn,A as je,_ as G,a8 as o,b6 as L,b8 as In,bs as Nl,C as u,aq as Wt,bu as on,bb as En,T as yi,a7 as p,u as Bn,j as bi,bv as rl,q as dn,b1 as bt,G as Be,aC as Sl,w as rt,b2 as at,ao as _i,I as $e,J,$ as P,aH as Mt,aF as At,z as _t,aN as be,al as kn,aL as Rt,H as wi,aJ as Ml,bn as ki,br as Ci,be as Ni}from"./@vue.4ce677c2.js";import{c as Al}from"./nanoevents.1080beb7.js";import{L as Tt}from"./lz-string.731cedc5.js";import{i as Si}from"./is-plain-object.906d88e8.js";import{Y as Mi}from"./vue-next-select.a2bfab1d.js";import{s as Ai,u as Il}from"./vue-toastification.6f567382.js";import{D as Ii}from"./vuedraggable.7949458c.js";import{p as Ei}from"./vue-textarea-autosize.35804eaf.js";import{v as Bi,n as xi}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const Pi=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))l(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&l(r)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerpolicy&&(s.referrerPolicy=a.referrerpolicy),a.crossorigin==="use-credentials"?s.credentials="include":a.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function l(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}};Pi();const Fi="modulepreload",ul={},Ti="./",Cn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(l=>{if(l=`${Ti}${l}`,l in ul)return;ul[l]=!0;const a=l.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${s}`))return;const r=document.createElement("link");if(r.rel=a?"stylesheet":Fi,a||(r.as="script",r.crossOrigin=""),r.href=l,document.head.appendChild(r),a)return new Promise((c,m)=>{r.addEventListener("load",c),r.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>t())},Di="./projInfo-schema.json",$i="Advent Incremental",Ri="An incremental game you play a day at a time, leading up to Christmas!",Oi="advent-incremental",Ui="thepaperpilot and friends",qi="",Vi="",Li="0.3",Gi="Initial Commit",Hi=!0,Qi=!1,zi=2,ji=!0,Ki=null,Wi="",Ji=["main"],Xi=3600,Yi=0,Zi=!0,ea="base64";var re={$schema:Di,title:$i,description:Ri,id:Oi,author:Ui,discordName:qi,discordLink:Vi,versionNumber:Li,versionTitle:Gi,allowGoBack:Hi,defaultShowSmall:Qi,defaultDecimalsShown:zi,useHeader:ji,banner:Ki,logo:Wi,initialTabs:Ji,maxTickLength:Xi,offlineLimit:Yi,enablePausing:Zi,exportEncoding:ea};const Un=17,ta=9e15,na=Math.log10(9e15),la=1/9e15,ia=308,aa=-324,cl=5,sa=function(){const e=[];for(let n=aa+1;n<=ia;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Ht=[2,Math.E,3,4,5,6,7,8,9,10],oa=[[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]],ra=[[-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]],h=function(t){return i.fromValue_noAlloc(t)},H=function(e,t,n){return i.fromComponents(e,t,n)},X=function(t,n,l){return i.fromComponents_noNormalize(t,n,l)},Ft=function(t,n){const l=n+1,a=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,l-a))*Math.pow(10,a-l);return parseFloat(s.toFixed(Math.max(l-a,0)))},qn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},ua=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 n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const l=e*e;let a=e;return n=n+1/(12*a),a=a*l,n=n+1/(360*a),a=a*l,n=n+1/(1260*a),a=a*l,n=n+1/(1680*a),a=a*l,n=n+1/(1188*a),a=a*l,n=n+691/(360360*a),a=a*l,n=n+7/(1092*a),a=a*l,n=n+3617/(122400*a),Math.exp(n)/t},El=.5671432904097838,dl=function(e,t=1e-10){let n,l;if(!Number.isFinite(e)||e===0)return e;if(e===1)return El;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let a=0;a<100;++a){if(l=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(l-n)<t*Math.abs(l))return l;n=l}throw Error(`Iteration failed to converge: ${e.toString()}`)};function ml(e,t=1e-10){let n,l,a,s;if(!Number.isFinite(e.mag)||e===i.dZero)return e;if(e===i.dOne)return h(El);i.abs(e),n=i.ln(e);for(let r=0;r<100;++r){if(l=i.exp(-n),a=n.sub(e.mul(l)),s=n.sub(a.div(n.add(1).sub(n.add(2).mul(a).div(i.mul(2,n).add(2))))),i.abs(s.sub(n)).lt(i.abs(s).mul(t)))return s;n=s}throw Error(`Iteration failed to converge: ${e.toString()}`)}const k=class{constructor(e){this.sign=Number.NaN,this.mag=Number.NaN,this.layer=Number.NaN,e instanceof k||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/sa(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,n){return new k().fromComponents(e,t,n)}static fromComponents_noNormalize(e,t,n){return new k().fromComponents_noNormalize(e,t,n)}static fromMantissaExponent(e,t){return new k().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new k().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new k().fromDecimal(e)}static fromNumber(e){return new k().fromNumber(e)}static fromString(e){return new k().fromString(e)}static fromValue(e){return new k().fromValue(e)}static fromValue_noAlloc(e){return e instanceof k?e:new k(e)}static abs(e){return h(e).abs()}static neg(e){return h(e).neg()}static negate(e){return h(e).neg()}static negated(e){return h(e).neg()}static sign(e){return h(e).sign}static sgn(e){return h(e).sign}static round(e){return h(e).round()}static floor(e){return h(e).floor()}static ceil(e){return h(e).ceil()}static trunc(e){return h(e).trunc()}static add(e,t){return h(e).add(t)}static plus(e,t){return h(e).add(t)}static sub(e,t){return h(e).sub(t)}static subtract(e,t){return h(e).sub(t)}static minus(e,t){return h(e).sub(t)}static mul(e,t){return h(e).mul(t)}static multiply(e,t){return h(e).mul(t)}static times(e,t){return h(e).mul(t)}static div(e,t){return h(e).div(t)}static divide(e,t){return h(e).div(t)}static recip(e){return h(e).recip()}static reciprocal(e){return h(e).recip()}static reciprocate(e){return h(e).reciprocate()}static cmp(e,t){return h(e).cmp(t)}static cmpabs(e,t){return h(e).cmpabs(t)}static compare(e,t){return h(e).cmp(t)}static isNaN(e){return e=h(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=h(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return h(e).eq(t)}static equals(e,t){return h(e).eq(t)}static neq(e,t){return h(e).neq(t)}static notEquals(e,t){return h(e).notEquals(t)}static lt(e,t){return h(e).lt(t)}static lte(e,t){return h(e).lte(t)}static gt(e,t){return h(e).gt(t)}static gte(e,t){return h(e).gte(t)}static max(e,t){return h(e).max(t)}static min(e,t){return h(e).min(t)}static minabs(e,t){return h(e).minabs(t)}static maxabs(e,t){return h(e).maxabs(t)}static clamp(e,t,n){return h(e).clamp(t,n)}static clampMin(e,t){return h(e).clampMin(t)}static clampMax(e,t){return h(e).clampMax(t)}static cmp_tolerance(e,t,n){return h(e).cmp_tolerance(t,n)}static compare_tolerance(e,t,n){return h(e).cmp_tolerance(t,n)}static eq_tolerance(e,t,n){return h(e).eq_tolerance(t,n)}static equals_tolerance(e,t,n){return h(e).eq_tolerance(t,n)}static neq_tolerance(e,t,n){return h(e).neq_tolerance(t,n)}static notEquals_tolerance(e,t,n){return h(e).notEquals_tolerance(t,n)}static lt_tolerance(e,t,n){return h(e).lt_tolerance(t,n)}static lte_tolerance(e,t,n){return h(e).lte_tolerance(t,n)}static gt_tolerance(e,t,n){return h(e).gt_tolerance(t,n)}static gte_tolerance(e,t,n){return h(e).gte_tolerance(t,n)}static pLog10(e){return h(e).pLog10()}static absLog10(e){return h(e).absLog10()}static log10(e){return h(e).log10()}static log(e,t){return h(e).log(t)}static log2(e){return h(e).log2()}static ln(e){return h(e).ln()}static logarithm(e,t){return h(e).logarithm(t)}static pow(e,t){return h(e).pow(t)}static pow10(e){return h(e).pow10()}static root(e,t){return h(e).root(t)}static factorial(e,t){return h(e).factorial()}static gamma(e,t){return h(e).gamma()}static lngamma(e,t){return h(e).lngamma()}static exp(e){return h(e).exp()}static sqr(e){return h(e).sqr()}static sqrt(e){return h(e).sqrt()}static cube(e){return h(e).cube()}static cbrt(e){return h(e).cbrt()}static tetrate(e,t=2,n=X(1,0,1)){return h(e).tetrate(t,n)}static iteratedexp(e,t=2,n=X(1,0,1)){return h(e).iteratedexp(t,n)}static iteratedlog(e,t=10,n=1){return h(e).iteratedlog(t,n)}static layeradd10(e,t){return h(e).layeradd10(t)}static layeradd(e,t,n=10){return h(e).layeradd(t,n)}static slog(e,t=10){return h(e).slog(t)}static lambertw(e){return h(e).lambertw()}static ssqrt(e){return h(e).ssqrt()}static pentate(e,t=2,n=X(1,0,1)){return h(e).pentate(t,n)}static affordGeometricSeries(e,t,n,l){return this.affordGeometricSeries_core(h(e),h(t),h(n),l)}static sumGeometricSeries(e,t,n,l){return this.sumGeometricSeries_core(e,h(t),h(n),l)}static affordArithmeticSeries(e,t,n,l){return this.affordArithmeticSeries_core(h(e),h(t),h(n),h(l))}static sumArithmeticSeries(e,t,n,l){return this.sumArithmeticSeries_core(h(e),h(t),h(n),h(l))}static efficiencyOfPurchase(e,t,n){return this.efficiencyOfPurchase_core(h(e),h(t),h(n))}static randomDecimalForTesting(e){if(Math.random()*20<1)return X(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return X(t,0,1);const n=Math.floor(Math.random()*(e+1));let l=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(l=Math.trunc(l));let a=Math.pow(10,l);return Math.random()>.9&&(a=Math.trunc(a)),H(t,n,a)}static affordGeometricSeries_core(e,t,n,l){const a=t.mul(n.pow(l));return k.floor(e.div(a).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,l){return t.mul(n.pow(l)).mul(k.sub(1,n.pow(e))).div(k.sub(1,n))}static affordArithmeticSeries_core(e,t,n,l){const s=t.add(l.mul(n)).sub(n.div(2)),r=s.pow(2);return s.neg().add(r.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,l){const a=t.add(l.mul(n));return e.div(2).mul(a.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}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<la)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=ta)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<na&&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,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,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 _=parseFloat(t[0]),g=parseFloat(t[1]),w=t[1].split(";");let S=1;if(w.length===2&&(S=parseFloat(w[1]),isFinite(S)||(S=1)),isFinite(_)&&isFinite(g)){const I=k.pentate(_,g,S);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,this}}const n=e.split("^^");if(n.length===2){const _=parseFloat(n[0]),g=parseFloat(n[1]),w=n[1].split(";");let S=1;if(w.length===2&&(S=parseFloat(w[1]),isFinite(S)||(S=1)),isFinite(_)&&isFinite(g)){const I=k.tetrate(_,g,S);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,this}}const l=e.split("^");if(l.length===2){const _=parseFloat(l[0]),g=parseFloat(l[1]);if(isFinite(_)&&isFinite(g)){const w=k.pow(_,g);return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,this}}e=e.trim().toLowerCase();let a,s,r=e.split("pt");if(r.length===2){a=10,s=parseFloat(r[0]),r[1]=r[1].replace("(",""),r[1]=r[1].replace(")","");let _=parseFloat(r[1]);if(isFinite(_)||(_=1),isFinite(a)&&isFinite(s)){const g=k.tetrate(a,s,_);return this.sign=g.sign,this.layer=g.layer,this.mag=g.mag,this}}if(r=e.split("p"),r.length===2){a=10,s=parseFloat(r[0]),r[1]=r[1].replace("(",""),r[1]=r[1].replace(")","");let _=parseFloat(r[1]);if(isFinite(_)||(_=1),isFinite(a)&&isFinite(s)){const g=k.tetrate(a,s,_);return this.sign=g.sign,this.layer=g.layer,this.mag=g.mag,this}}const c=e.split("e"),m=c.length-1;if(m===0){const _=parseFloat(e);if(isFinite(_))return this.fromNumber(_)}else if(m===1){const _=parseFloat(e);if(isFinite(_)&&_!==0)return this.fromNumber(_)}const d=e.split("e^");if(d.length===2){this.sign=1,d[0].charAt(0)=="-"&&(this.sign=-1);let _="";for(let g=0;g<d[1].length;++g){const w=d[1].charCodeAt(g);if(w>=43&&w<=57||w===101)_+=d[1].charAt(g);else return this.layer=parseFloat(_),this.mag=parseFloat(d[1].substr(g+1)),this.normalize(),this}}if(m<1)return this.sign=0,this.layer=0,this.mag=0,this;const y=parseFloat(c[0]);if(y===0)return this.sign=0,this.layer=0,this.mag=0,this;let v=parseFloat(c[c.length-1]);if(m>=2){const _=parseFloat(c[c.length-2]);isFinite(_)&&(v*=Math.sign(_),v+=qn(_))}if(!isFinite(y))this.sign=c[0]==="-"?-1:1,this.layer=m,this.mag=v;else if(m===1)this.sign=Math.sign(y),this.layer=1,this.mag=v+Math.log10(Math.abs(y));else if(this.sign=Math.sign(y),this.layer=m,m===2){const _=k.mul(H(1,2,v),h(y));return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,this}else this.mag=v;return this.normalize(),this}fromValue(e){return e instanceof k||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:Ft(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Ft(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<=cl?(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):Ft(this.m,e)+"e"+Ft(this.e,e):this.layer===1?Ft(this.m,e)+"e"+Ft(this.e,e):this.layer<=cl?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Ft(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Ft(this.mag,e)}abs(){return X(this.sign===0?0:1,this.layer,this.mag)}neg(){return X(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?k.dZero:this.layer===0?H(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?k.dZero:this.layer===0?H(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?k.dZero:this.layer===0?H(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?k.dZero:this.layer===0?H(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=h(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 X(0,0,0);let n,l;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(k.cmpabs(this,t)>0?(n=this,l=t):(n=t,l=this),n.layer===0&&l.layer===0)return h(n.sign*n.mag+l.sign*l.mag);const a=n.layer*Math.sign(n.mag),s=l.layer*Math.sign(l.mag);if(a-s>=2)return n;if(a===0&&s===-1){if(Math.abs(l.mag-Math.log10(n.mag))>Un)return n;{const r=Math.pow(10,Math.log10(n.mag)-l.mag),c=l.sign+n.sign*r;return H(Math.sign(c),1,l.mag+Math.log10(Math.abs(c)))}}if(a===1&&s===0){if(Math.abs(n.mag-Math.log10(l.mag))>Un)return n;{const r=Math.pow(10,n.mag-Math.log10(l.mag)),c=l.sign+n.sign*r;return H(Math.sign(c),1,Math.log10(l.mag)+Math.log10(Math.abs(c)))}}if(Math.abs(n.mag-l.mag)>Un)return n;{const r=Math.pow(10,n.mag-l.mag),c=l.sign+n.sign*r;return H(Math.sign(c),1,l.mag+Math.log10(Math.abs(c)))}}plus(e){return this.add(e)}sub(e){return this.add(h(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=h(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return X(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return X(this.sign*t.sign,0,1);let n,l;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,l=t):(n=t,l=this),n.layer===0&&l.layer===0)return h(n.sign*l.sign*n.mag*l.mag);if(n.layer>=3||n.layer-l.layer>=2)return H(n.sign*l.sign,n.layer,n.mag);if(n.layer===1&&l.layer===0)return H(n.sign*l.sign,1,n.mag+Math.log10(l.mag));if(n.layer===1&&l.layer===1)return H(n.sign*l.sign,1,n.mag+l.mag);if(n.layer===2&&l.layer===1){const a=H(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(H(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)));return H(n.sign*l.sign,a.layer+1,a.sign*a.mag)}if(n.layer===2&&l.layer===2){const a=H(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(H(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)));return H(n.sign*l.sign,a.layer+1,a.sign*a.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=h(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?k.dNaN:this.layer===0?H(this.sign,0,1/this.mag):H(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=h(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=h(e),n=this.mag>0?this.layer:-this.layer,l=t.mag>0?t.layer:-t.layer;return n>l?1:n<l?-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=h(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=h(e);return this.lt(t)?t:this}min(e){const t=h(e);return this.gt(t)?t:this}maxabs(e){const t=h(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=h(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 n=h(e);return this.eq_tolerance(n,t)?0:this.cmp(n)}compare_tolerance(e,t){return this.cmp_tolerance(e,t)}eq_tolerance(e,t){const n=h(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let l=this.mag,a=n.mag;return this.layer>n.layer&&(a=qn(a)),this.layer<n.layer&&(l=qn(l)),Math.abs(l-a)<=t*Math.max(Math.abs(l),Math.abs(a))}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 n=h(e);return!this.eq_tolerance(n,t)&&this.lt(n)}lte_tolerance(e,t){const n=h(e);return this.eq_tolerance(n,t)||this.lt(n)}gt_tolerance(e,t){const n=h(e);return!this.eq_tolerance(n,t)&&this.gt(n)}gte_tolerance(e,t){const n=h(e);return this.eq_tolerance(n,t)||this.gt(n)}pLog10(){return this.lt(k.dZero)?k.dZero:this.log10()}absLog10(){return this.sign===0?k.dNaN:this.layer>0?H(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):H(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?k.dNaN:this.layer>0?H(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):H(this.sign,0,Math.log10(this.mag))}log(e){return e=h(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?k.dNaN:this.layer===0&&e.layer===0?H(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):k.div(this.log10(),e.log10())}log2(){return this.sign<=0?k.dNaN:this.layer===0?H(this.sign,0,Math.log2(this.mag)):this.layer===1?H(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?H(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):H(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?k.dNaN:this.layer===0?H(this.sign,0,Math.log(this.mag)):this.layer===1?H(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?H(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):H(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=h(e),n=this,l=t;if(n.sign===0)return l.eq(0)?X(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(l.sign===0)return X(1,0,1);if(l.sign===1&&l.layer===0&&l.mag===1)return n;const a=n.absLog10().mul(l).pow10();return this.sign===-1?Math.abs(l.toNumber()%2)%2===1?a.neg():Math.abs(l.toNumber()%2)%2===0?a:k.dNaN:a}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return k.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 H(1,0,t);if(e.sign===0)return k.dOne;e=X(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?H(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?H(-e.sign,e.layer+1,-e.mag):k.dOne}pow_base(e){return h(e).pow(this)}root(e){const t=h(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?k.exp(k.mul(this,k.ln(this).sub(1))):k.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(X(1,0,24)))return h(ua(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let l=e,a=12*l,s=1/a,r=t+s;if(r===t||(t=r,l=l*n,a=360*l,s=1/a,r=t-s,r===t))return k.exp(t);t=r,l=l*n,a=1260*l;let c=1/a;return t=t+c,l=l*n,a=1680*l,c=1/a,t=t-c,k.exp(t)}else return this.layer===1?k.exp(k.mul(this,k.ln(this).sub(1))):k.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?k.dOne:this.layer===0&&this.mag<=709.7?h(Math.exp(this.sign*this.mag)):this.layer===0?H(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?H(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):H(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return h(Math.sqrt(this.sign*this.mag));if(this.layer===1)return H(1,2,Math.log10(this.mag)-.3010299956639812);{const e=k.div(X(this.sign,this.layer-1,this.mag),X(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=X(1,0,1)){if(e===1)return k.pow(this,t);if(e===0)return new k(t);if(this.eq(k.dOne))return k.dOne;if(this.eq(-1))return k.pow(this,t);if(e===Number.POSITIVE_INFINITY){const a=this.toNumber();if(a<=1.444667861009766&&a>=.06598803584531254){if(a>1.444667861009099)return new k(Math.E);const s=k.ln(this).neg();return s.lambertw().div(s)}else return a>1.444667861009766?new k(Number.POSITIVE_INFINITY):k.dNaN}if(this.eq(k.dZero)){let a=Math.abs((e+1)%2);return a>1&&(a=2-a),new k(a)}if(e<0)return k.iteratedlog(t,this,-e);t=h(t);const n=e;e=Math.trunc(e);const l=n-e;if(this.gt(k.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let a=0;a<e;++a){const s=t;if(t=this.pow(t),s.eq(t))return t}if(l!=0){const a=this.pow(t);return t.mul(1-l).add(a.mul(l))}return t}l!==0&&(t.eq(k.dOne)?this.gt(10)?t=this.pow(l):(t=h(k.tetrate_critical(this.toNumber(),l)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(l):t=t.layeradd(l,this));for(let a=0;a<e;++a){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return X(t.sign,t.layer+(e-a-1),t.mag);if(a>1e4)return t}return t}iteratedexp(e=2,t=X(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return k.tetrate(e,-t,this);e=h(e);let n=h(this);const l=t;t=Math.trunc(t);const a=l-t;if(n.layer-e.layer>3){const s=Math.min(t,n.layer-e.layer-3);t-=s,n.layer-=s}for(let s=0;s<t;++s){if(n=n.log(e),!isFinite(n.layer)||!isFinite(n.mag))return n.normalize();if(s>1e4)return n}return a>0&&a<1&&(e.eq(10)?n=n.layeradd10(-a):n=n.layeradd(-a,e)),n}slog(e=10){if(e=h(e),e.lte(k.dZero)||e.eq(k.dOne))return k.dNaN;if(e.lt(k.dOne))return this.eq(k.dOne)?k.dZero:this.eq(k.dZero)?k.dNegOne:k.dNaN;if(this.mag<0||this.eq(k.dZero))return k.dNegOne;let t=0,n=h(this);if(n.layer-e.layer>3){const l=n.layer-e.layer-3;t+=l,n.layer-=l}for(let l=0;l<100;++l)if(n.lt(k.dZero))n=k.pow(e,n),t-=1;else{if(n.lte(k.dOne))return h(t+k.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=k.log(n,e)}return h(t)}static slog_critical(e,t){return e>10?t-1:k.critical_section(e,t,ra)}static tetrate_critical(e,t){return k.critical_section(e,t,oa)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let l=0,a=0;for(let c=0;c<Ht.length;++c)if(Ht[c]==e){l=n[c][Math.floor(t)],a=n[c][Math.ceil(t)];break}else if(Ht[c]<e&&Ht[c+1]>e){const m=(e-Ht[c])/(Ht[c+1]-Ht[c]);l=n[c][Math.floor(t)]*(1-m)+n[c+1][Math.floor(t)]*m,a=n[c][Math.ceil(t)]*(1-m)+n[c+1][Math.ceil(t)]*m;break}const s=t-Math.floor(t);return l*(1-s)+a*s}layeradd10(e){e=k.fromValue_noAlloc(e).toNumber();const t=h(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 n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let l=0;l<100;++l){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 l=this.slog(t).toNumber()+e;return l>=0?k.tetrate(t,l):Number.isFinite(l)?l>=-1?k.log(k.tetrate(t,l+1),t):k.log(k.log(k.tetrate(t,l+2),t),t):k.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return h(dl(this.toNumber()));if(this.layer===0)return h(dl(this.sign*this.mag));if(this.layer===1)return ml(this);if(this.layer===2)return ml(this);if(this.layer>=3)return X(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return X(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=X(1,0,1)){t=h(t);const n=e;e=Math.trunc(e);const l=n-e;l!==0&&(t.eq(k.dOne)?(++e,t=new k(l)):this.eq(10)?t=t.layeradd10(l):t=t.layeradd(l,this));for(let a=0;a<e;++a){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(a>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?h(Math.sin(this.sign*this.mag)):X(0,0,0)}cos(){return this.mag<0?k.dOne:this.layer===0?h(Math.cos(this.sign*this.mag)):X(0,0,0)}tan(){return this.mag<0?this:this.layer===0?h(Math.tan(this.sign*this.mag)):X(0,0,0)}asin(){return this.mag<0?this:this.layer===0?h(Math.asin(this.sign*this.mag)):X(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?h(Math.acos(this.toNumber())):this.layer===0?h(Math.acos(this.sign*this.mag)):X(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?h(Math.atan(this.sign*this.mag)):h(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 k.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return k.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?X(Number.NaN,Number.NaN,Number.NaN):k.ln(this.add(1).div(h(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(k.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 i=k;i.dZero=X(0,0,0);i.dOne=X(1,0,1);i.dNegOne=X(-1,0,1);i.dTwo=X(1,0,2);i.dTen=X(1,0,10);i.dNaN=X(Number.NaN,Number.NaN,Number.NaN);i.dInf=X(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);i.dNegInf=X(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);i.dNumberMax=H(1,0,Number.MAX_VALUE);i.dNumberMin=H(1,0,Number.MIN_VALUE);const ca=new i(1);function an(e,t,n=!0){let l=i.log10(e).floor(),a=i.div(e,i.pow(10,l));a.toStringWithDecimalPlaces(t)==="10"&&(a=ca,l=l.add(1));const s=l.gte(1e9)?Ce(l,Math.max(Math.max(t,3),re.defaultDecimalsShown)):l.gte(1e4)?Nn(l,0):l.toStringWithDecimalPlaces(0);return n?a.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function Nn(e,t){if(e==null)return"NaN";if(e=new i(e),e.mag<.001)return 0 .toFixed(t);const l=e.toStringWithDecimalPlaces(t).split(".");return l[0]=l[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),l.length==1?l[0]:l[0]+"."+l[1]}function Bl(e,t){return e==null?"NaN":(e=new i(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),re.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const da=new i("eeee1000"),ma=new i("e100000"),pl=new i("e1000"),xl=new i(1e9),pa=new i(1e6),fa=new i(1e3),ha=new i(.98),ga=new i(.001),Pl=new i(0);function Ce(e,t,n){if(t==null&&(t=re.defaultDecimalsShown),n=n!=null?n:re.defaultShowSmall,e=new i(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Ce(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(da)){const l=e.slog();return l.gte(pa)?"F"+Ce(l.floor()):i.pow(10,l.sub(l.floor())).toStringWithDecimalPlaces(3)+"F"+Nn(l.floor(),0)}else{if(e.gte(ma))return an(e,0,!1);if(e.gte(pl))return an(e,0);if(e.gte(xl))return an(e,t);if(e.gte(fa))return Nn(e,0);if(e.gte(ga)||!n)return Bl(e,t);if(e.eq(Pl))return 0 .toFixed(t)}return e=Fl(e),e.lt(pl)?an(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Ce(e,t)+"\u207B\xB9"}function Ee(e){return e=new i(e),e.sign<0?"-"+Ee(e.neg()):e.gte(xl)||e.lte(ha)&&!e.eq(Pl)?Ce(e):Ce(e,0)}function Gn(e,t){return t==null&&(t=re.defaultDecimalsShown),i.lt(e,0)?"-"+Gn(i.neg(e),t):i.gt(e,2**51)?Ce(i.div(e,31536e3))+"y":(e=new i(e).toNumber(),e<60?Ce(e)+"s":e<3600?Ee(Math.floor(e/60))+"m "+Ce(e%60,t)+"s":e<86400?Ee(Math.floor(e/3600))+"h "+Ee(Math.floor(e/60)%60)+"m "+Ee(e%60)+"s":e<31536e3?Ee(Math.floor(e/84600)%365)+"d "+Ee(Math.floor(e/3600)%24)+"h "+Ee(Math.floor(e/60)%60)+"m":Ee(Math.floor(e/31536e3))+"y "+Ee(Math.floor(e/84600)%365)+"d "+Ee(Math.floor(e/3600)%24)+"h")}function va(e,t,n){e=new i(e);let l=e.toStringWithDecimalPlaces(t);return new i(l).gte(n)&&(l=i.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),l}function ya(e,t){return Ce(e,t,!0)}function Fl(e){let t=i.log10(e).ceil();const n=i.div(e,i.pow(10,t));return t=t.neg(),e=new i(10).pow(t).times(n),e}function ba(e,t){let n=e[0][0],l=e[0][1];for(let a=1;a<e.length;a++)i.lt(e[a][0],n)&&(n=e[a][0],l=e[a][1]);return Ce(n)+t+", limited by "+l}var _a=Object.freeze(Object.defineProperty({__proto__:null,default:i,exponentialFormat:an,commaFormat:Nn,regularFormat:Bl,format:Ce,formatWhole:Ee,formatTime:Gn,toPlaces:va,formatSmall:ya,invertOOM:Fl,formatLimit:ba},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:wa,commaFormat:ka,regularFormat:Ca,format:ne,formatWhole:j,formatTime:xn,toPlaces:Na,formatSmall:Sa,formatLimit:Tl,invertOOM:Ma}=_a;window.Decimal=i;window.exponentialFormat=wa;window.commaFormat=ka;window.regularFormat=Ca;window.format=ne;window.formatWhole=j;window.formatTime=xn;window.toPlaces=Na;window.formatSmall=Sa;window.formatLimit=Tl;window.invertOOM=Ma;function Dl(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Vn(e){return typeof e=="function"}var oe=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(oe||{});const rn=Symbol("DoNotCache");function $(e,t){const n=e[t];Vn(n)&&n.length===0&&!n[rn]?e[t]=N(n.bind(e)):Vn(n)&&(e[t]=n.bind(e),e[t][rn]=!0)}function Qe(e){return Vn(e)&&!e[rn]&&(e=N(e)),e}const Ut=Symbol("Component"),qt=Symbol("GatherProps");let Aa=0;function tn(e="feature-"){return e+Aa++}var Ue=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Ue||{});function x(e){return e[rn]=!0,e}function q(e,t=2){return e?0:t}function ze(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function $l(e,...t){const n=[],l=a=>{Object.keys(a).forEach(s=>{const r=a[s];r&&typeof r=="object"&&(t.includes(r.type)?n.push(r):!(r instanceof i)&&!De(r)&&l(r))})};return l(e),n}const Qt={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 Hn=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Hn||{}),mn={classic:Qt,paper:{...Qt,variables:{...Qt.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:{...Qt,variables:{...Qt.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:{...Qt,variables:{...Qt.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const xe=Al();document.fonts.onloadingdone=()=>xe.emit("fontsLoaded");var Ia=Object.freeze(Object.defineProperty({__proto__:null,globalBus:xe},Symbol.toStringTag,{value:"Module"}));var ue=(e,t)=>{const n=e.__vccOpts||e;for(const[l,a]of t)n[l]=a;return n};const Ea=Q({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var y;const n=O({}),l=new ResizeObserver(c),a=O(null);An(()=>{const v=a.value;v!=null&&l.observe(v)});let s=!0,r=O((y=a.value)==null?void 0:y.getBoundingClientRect());function c(){s&&(s=!1,Kt(()=>{var v;r.value=(v=a.value)==null?void 0:v.getBoundingClientRect(),Object.values(n.value).filter(_=>_).forEach(_=>_.rect=_.element.getBoundingClientRect()),t("updateNodes",n.value),s=!0}))}xe.on("fontsLoaded",c);const m={attributes:!1,childList:!0,subtree:!1};yn(Qn,(v,_)=>{const g=new MutationObserver(()=>d(v));g.observe(_,m),n.value[v]={element:_,observer:g,rect:_.getBoundingClientRect()},c()}),yn(zn,v=>{var _;(_=n.value[v])==null||_.observer.disconnect(),n.value[v]=void 0,c()}),yn(jn,n),yn(Kn,r);function d(v){const _=n.value[v];_!=null&&(_.rect=_.element.getBoundingClientRect(),t("updateNodes",n.value))}return(v,_)=>(b(),M(B,null,[wt(v.$slots,"default",{},void 0,!0),f("div",{ref_key:"resizeListener",ref:a,class:"resize-listener"},null,512)],64))}});var Rl=ue(Ea,[["__scopeId","data-v-2b1dc1bc"]]);const Ba=["onPointerdown"],xa={class:"modal-wrapper"},Pa={class:"modal-container"},Fa={class:"modal-header"},Ta=p(" default header "),Da={class:"modal-body"},$a=p(" default body "),Ra={class:"modal-footer"},Oa=f("div",{class:"modal-default-flex-grow"},null,-1),ct=Q({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const a=je(e),s=N(()=>a.modelValue||c.value);function r(){n("update:modelValue",!1)}const c=O(!1),m=O(null),d=N(()=>{var y,v;return(v=(y=m.value)==null?void 0:y.nodes)!=null?v:null});return t({isOpen:s,nodes:d}),(y,v)=>(b(),G(yi,{to:"#modal-root"},[o(En,{name:"modal",onBeforeEnter:v[0]||(v[0]=_=>c.value=!0),onAfterLeave:v[1]||(v[1]=_=>c.value=!1)},{default:L(()=>[In(f("div",Wt({class:"modal-mask",onPointerdown:on(r,["self"])},y.$attrs),[f("div",xa,[f("div",Pa,[f("div",Fa,[wt(y.$slots,"header",{shown:u(s)},()=>[Ta])]),f("div",Da,[o(Rl,{ref_key:"contextRef",ref:m},{default:L(()=>[wt(y.$slots,"body",{shown:u(s)},()=>[$a])]),_:3},512)]),f("div",Ra,[wt(y.$slots,"footer",{shown:u(s)},()=>[f("div",{class:"modal-default-footer"},[Oa,f("button",{class:"button modal-default-button",onClick:r}," Close ")])])])])])],16,Ba),[[Nl,e.modelValue]])]),_:3})]))}}),Qn=Symbol("RegisterNode"),zn=Symbol("UnregisterNode"),jn=Symbol("Nodes"),Kn=Symbol("Bounds"),Ze=Bn({});window.layers=Ze;const Yt={},gt=[];function It(e,t){return lt(()=>{const n={},l=n.emitter=Al();if(n.on=l.on.bind(l),n.emit=l.emit.bind(l),n.nodes=O({}),n.id=e,gt.push(e),Yt[e]=new Set,n.minimized=_e(!1),Object.assign(n,t.call(n)),gt[gt.length-1]==null||gt[gt.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${gt}
Trying to pop ${n.id}`;return gt.pop(),$(n,"color"),$(n,"display"),$(n,"name"),ze(n,"name",n.id),$(n,"minWidth"),ze(n,"minWidth",600),$(n,"minimizable"),ze(n,"minimizable",!0),n})}function Ol(e,t){if(console.info("Adding layer",e.id),Ze[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Ze[e.id]);return}ze(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Ze[e.id]=e,xe.emit("addLayer",e,t.layers[e.id])}function Ua(e){return Ze[e]}function Ul(e){console.info("Removing layer",e.id),xe.emit("removeLayer",e),Ze[e.id]=void 0}function qa(e){Ul(e),Ol(e,V)}function Va(e){const t=O(!1);return{openModal:()=>t.value=!0,modal:x(()=>o(ct,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>o("h2",null,[u(e.name)]),body:u(e.display)}))}}xe.on("update",function(t){Object.values(Ze).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(Ze).forEach(n=>{n==null||n.emit("update",t)}),Object.values(Ze).forEach(n=>{n==null||n.emit("postUpdate",t)})});var La=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Qn,UnregisterNodeInjectionKey:zn,NodesInjectionKey:jn,BoundsInjectionKey:Kn,layers:Ze,persistentRefs:Yt,addingLayers:gt,createLayer:It,addLayer:Ol,getLayer:Ua,removeLayer:Ul,reloadLayer:qa,setupLayerModal:Va},Symbol.toStringTag,{value:"Module"}));const Wn=Symbol("PersistentState"),$t=Symbol("DefaultValue"),Sn=Symbol("StackTrace"),ql=Symbol("Deleted"),un=Symbol("NonPersistent"),sn=Symbol("SaveDataPath");function Ga(){var e;return((e=new Error().stack)==null?void 0:e.split(`
`).slice(3,5).map(t=>t.trim()).join(`
`))||""}function _e(e){const t=De(e)?e:O(e);t[Wn]=t,t[$t]=De(e)?e.value:e,t[Sn]=Ga(),t[ql]=!1;const n=N({get(){return t.value},set(l){t.value=l}});return n[$t]=t[$t],t[un]=n,t[sn]=void 0,gt.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
Created at:
`+t[Sn]):Yt[gt[gt.length-1]].add(t),t}function Ha(e){return e&&typeof e=="object"&&Wn in e}function W(e){return e[un]}xe.on("addLayer",(e,t)=>{const n=[],l=(a,s=[])=>{let r=!1;return Object.keys(a).forEach(c=>{let m=a[c];if(m&&typeof m=="object")if(ke in m&&(m=m[ke]),Ha(m)){if(r=!0,m[ql]){console.warn("Deleted persistent ref present in returned object. Ignoring...",m,`
Created at:
`+m[Sn]);return}Yt[e.id].delete(m);const d=[e.id,...s,c];m[sn]!=null&&JSON.stringify(d)!==JSON.stringify(m[sn])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${m[sn].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,m),m[sn]=d;const y=s.reduce((_,g)=>(g in _||(_[g]={}),_[g]),t),v=y[c];y[c]=m[Wn],bi(y)?v!=null?y[c]=v:y[c]=m[$t]:v!=null?y[c].value=v:y[c].value=m[$t]}else!(m instanceof i)&&!De(m)&&!n.includes(m)&&(typeof m.type=="symbol"&&n.push(m),l(m,[...s,c])&&(rl(m)&&!rl(a)?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.",ke in a?a[ke]:a,c):r=!0))}),r};l(e[ke]),Yt[e.id].forEach(a=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,a,`
Created at:
`+a[Sn])}),Yt[e.id].clear()});const ke=Symbol("ProxyState"),Xt=Symbol("ProxyPath");function lt(e,t={}){const n=t;let l=!1;function a(){return l||(Object.assign(n,e(n)),l=!0),n}return new Proxy(n,{get(s,r){if(r===ke)return a();const c=a()[r];return c&&typeof c=="object"&&un in c?c[un]:c},set(s,r,c){return a()[r]=c,!0},has(s,r){return r===ke?!0:Reflect.has(a(),r)},ownKeys(){return Reflect.ownKeys(a())},getOwnPropertyDescriptor(s,r){return l||(Object.assign(n,e(n)),l=!0),Object.getOwnPropertyDescriptor(s,r)}})}var Ie=window.state=Bn({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Vl=dn({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{},usingLog:!1});function Ll(e){return JSON.stringify(e,(t,n)=>u(n))}const Gl={get(e,t){var l;if(t===ke||t===Xt)return e[t];const n=e[ke][t];if(t!=="value"&&(Si(n)||Array.isArray(n))){if(n!==((l=e[t])==null?void 0:l[ke])){const a=[...e[Xt],t];e[t]=new Proxy({[ke]:n,[Xt]:a},Gl)}return e[t]}return n},set(e,t,n,l){if(!Ie.hasNaN&&(typeof n=="number"&&isNaN(n)||n instanceof i&&(isNaN(n.sign)||isNaN(n.layer)||isNaN(n.mag)))){const a=e[ke][t];if(!(typeof a=="number"&&isNaN(a)||a instanceof i&&(isNaN(a.sign)||isNaN(a.layer)||isNaN(a.mag))))throw Vl.autosave=!1,Ie.hasNaN=!0,Ie.NaNPath=[...e[Xt],t],Ie.NaNReceiver=l,console.error("Attempted to set NaN value",[...e[Xt],t],e[ke]),"Attempted to set NaN value. See above for details"}return e[ke][t]=n,!0},ownKeys(e){return Reflect.ownKeys(e[ke])},has(e,t){return Reflect.has(e[ke],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[ke],t)}};var V=window.player=new Proxy({[ke]:Vl,[Xt]:["player"]},Gl);function Hl(e={}){return Object.assign({id:`${re.id}-0`,name:"Default Save",tabs:re.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:re.id,modVersion:re.versionNumber,layers:{}},e)}function vt(e){const t=Tt.compressToUTF16(Ll(e!=null?e:V[ke]));return localStorage.setItem((e!=null?e:V[ke]).id,t),t}async function Qa(){ja();try{let e=localStorage.getItem(Ne.active);if(e==null){await zt(Zt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Tt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==re.id){await zt(Zt());return}t.id=Ne.active,await zt(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
`,e),await zt(Zt())}}function Zt(){const e=_n(),t=Hl({id:e});return vt(t),Ne.saves.push(e),t}function _n(){let e,t=0;do e=`${re.id}-${t++}`;while(localStorage.getItem(e));return e}async function zt(e){console.info("Loading save",e);const{layers:t,removeLayer:n,addLayer:l}=await Cn(()=>Promise.resolve().then(function(){return La}),void 0),{fixOldSave:a,getInitialLayers:s}=await Cn(()=>Promise.resolve().then(function(){return Io}),void 0);for(const r in t){const c=t[r];c&&n(c)}s(e).forEach(r=>l(r,e)),e=Hl(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,re.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==re.versionNumber&&a(e.modVersion,e),Object.assign(V,e),Ne.active=V.id,xe.emit("onLoad")}setInterval(()=>{V.autosave&&vt()},1e3);window.onbeforeunload=()=>{V.autosave&&vt()};window.save=vt;const za=window.hardReset=async()=>{await zt(Zt())},cn=dn({active:"",saves:[],showTPS:!0,theme:Hn.Nordic,unthrottled:!1});bt(cn,e=>{const t=Tt.compressToUTF16(JSON.stringify(e));localStorage.setItem(re.id,t)},{deep:!0});var Ne=window.settings=cn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Hn.Nordic};xe.emit("loadSettings",e),Object.assign(cn,e),za()};function ja(){try{let e=localStorage.getItem(re.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Tt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(cn,t)}xe.emit("loadSettings",cn)}catch{}}const Ql=dn([]);function Ka(e){Ql.push(e)}const zl=dn([]);function Wa(e){zl.push(e)}const Ja=dn([]),Xa={class:"table"},jt=Q({__name:"Column",setup(e){const t=N(()=>mn[Ne.theme].mergeAdjacent);return(n,l)=>(b(),M("div",Xa,[f("div",{class:Be(["col",{mergeAdjacent:u(t)}])},[wt(n.$slots,"default")],2)]))}}),Ya={class:"table"},jl=Q({__name:"Row",setup(e){const t=N(()=>mn[Ne.theme].mergeAdjacent);return(n,l)=>(b(),M("div",Ya,[f("div",{class:Be(["row",{mergeAdjacent:u(t)}])},[wt(n.$slots,"default")],2)]))}});function Jn(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!_i(e)}function ie(e,t="span"){return typeof e=="function"?Q({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),Q({template:e})):Q({render:()=>({})}):e}function he(e){if(St(e))return typeof e=="function"?e():ie(e);const t=e[Ut];return o(t,e[qt](),null)}function Fe(...e){let t;return o(jl,null,Jn(t=e.map(he))?t:{default:()=>[t]})}function Kl(...e){let t;return o(jt,null,Jn(t=e.map(he))?t:{default:()=>[t]})}function yt(e){if(St(e))return typeof e=="function"?e():typeof e=="string"?o(B,null,[e]):o(e,null,null);const t=e[Ut];return o(t,e[qt](),null)}function Za(...e){let t;return o(jt,null,Jn(t=e.map(yt))?t:{default:()=>[t]})}function St(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[rn]===!0}function Wl(e,t,n){const l=O(null),a=O(void 0);function s(m){l.value||(l.value=setInterval(c,250)),a.value=m,n&&(n.value=!0)}function r(){l.value&&(clearInterval(l.value),l.value=null),n&&(n.value=!1)}function c(){t&&t.value?t.value():e&&e.value&&e.value(a.value)}return Sl(r),{start:s,stop:r,handleHolding:c}}function es(e,t){const n=N(()=>e.filter(l=>u(l.visibility)===Ue.Visible&&t(l)));return{firstFeature:N(()=>n.value[0]),collapsedContent:x(()=>Kl(...n.value.slice(1))),hasCollapsedContent:N(()=>n.value.length>1)}}function Mn(e,t="div"){const n=rt();return at(()=>{n.value=ie(qe(e),t)}),n}function Ot(e,t="div"){const n=rt(null);return at(()=>{const l=qe(e);n.value=l==null?null:ie(l,t)}),n}function ts(e){return N(()=>qe(e))}function qe(e){return u(u(e))}function R(...e){return e.includes(Object)||e.push(Object),e}const fe=Q({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(b(),M("div",{style:$e({width:e.width,height:e.height})},null,4))}});const ns={},ls={class:"notif"};function is(e,t){return b(),M("div",ls,"!")}var fl=ue(ns,[["render",is],["__scopeId","data-v-66323fd4"]]);const Pn=e=>(Mt("data-v-d953df70"),e=e(),At(),e),as={key:0,class:"day feature dontMerge opened"},ss={class:"date"},os=p("Dec"),rs=Pn(()=>f("br",null,null,-1)),us={class:"date"},cs=p("Dec"),ds=Pn(()=>f("br",null,null,-1)),ms=Pn(()=>f("div",{class:"doors"},null,-1)),ps={class:"date"},fs=p("Dec"),hs=Pn(()=>f("br",null,null,-1)),gs={key:0,class:"material-icons lock"},vs={key:1,class:"timer"},ys=Q({__name:"Day",props:{day:null,symbol:null,opened:null,recentlyUpdated:null,shouldNotify:null},emits:["openLore","openLayer","unlockLayer"],setup(e,{emit:t}){const n=e,l=N(()=>i.gte(z.day.value,n.day)&&new Date().getMonth()===11&&new Date().getDate()>=n.day);function a(){l.value&&t("unlockLayer")}return(s,r)=>e.opened.value?(b(),M("div",as,[o(En,{appear:"",name:"door"},{default:L(()=>[f("div",{class:"doors",onClick:r[0]||(r[0]=c=>t("openLayer"))},[f("div",ss,[os,rs,p(J(e.day),1)]),f("div",us,[cs,ds,p(J(e.day),1)])])]),_:1}),f("div",{class:"icon",style:$e({backgroundImage:`url(${e.symbol})`})},null,4),f("div",{class:"lore",onClick:r[1]||(r[1]=c=>t("openLore"))},"?"),u(e.shouldNotify)?(b(),G(fl,{key:0})):P("",!0)])):(b(),M("div",{key:1,class:Be(["day feature dontMerge",{can:u(l),locked:!u(l),canOpen:u(l)}]),onClick:a},[ms,f("div",ps,[fs,hs,p(J(e.day),1)]),u(l)?P("",!0):(b(),M("div",gs,"lock")),u(z).day.value===e.day&&!u(l)?(b(),M("div",vs,J(u(Gn)(u(z).timeUntilNewDay.value,0)),1)):P("",!0),u(l)?(b(),G(fl,{key:2})):P("",!0)],2))}});var bs=ue(ys,[["__scopeId","data-v-d953df70"]]);const _s=Q({__name:"Collapsible",props:{collapsed:null,display:null,content:null},setup(e){const t=e,n=Mn(_t(t,"display")),l=Mn(_t(t,"content"));return(a,s)=>(b(),G(jt,{class:"collapsible-container"},{default:L(()=>[f("button",{onClick:s[0]||(s[0]=r=>e.collapsed.value=!e.collapsed.value),class:"feature collapsible-toggle"},[(b(),G(be(u(n))))]),e.collapsed.value?P("",!0):(b(),G(be(u(l)),{key:0}))]),_:1}))}});var ws=ue(_s,[["__scopeId","data-v-a72c16aa"]]);const ks={key:0},Cs={key:0,class:"mark star"},Ns=["src"],Ss=Q({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(b(),M("div",ks,[e.mark===!0?(b(),M("div",Cs)):(b(),M("img",{key:1,class:"mark",src:e.mark},null,8,Ns))])):P("",!0)}});var Fn=ue(Ss,[["__scopeId","data-v-2207999f"]]);const Ms=Q({__name:"Node",props:{id:null},setup(e){const n=je(e),l=kn(Qn,()=>{}),a=kn(zn,()=>{}),s=rt(null),r=N(()=>s.value&&s.value.parentElement);return bt([r,n.id],([c,m],[d,y])=>{d&&a(u(y)),c&&l(m,c)}),Sl(()=>a(u(n.id))),(c,m)=>(b(),M("div",{class:"node",ref_key:"node",ref:s},null,512))}});var pn=ue(Ms,[["__scopeId","data-v-a48cb382"]]);const As=Q({props:{progress:{type:R(String,Object,Number),required:!0},width:{type:R(Number),required:!0},height:{type:R(Number),required:!0},direction:{type:R(String),required:!0},display:R(Object,String,Function),visibility:{type:R(Number),required:!0},style:R(Object,String,Array),classes:R(Object),borderStyle:R(Object,String,Array),textStyle:R(Object,String,Array),baseStyle:R(Object,String,Array),fillStyle:R(Object,String,Array),mark:R(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Fn,Node:pn},setup(e){const{progress:t,width:n,height:l,direction:a,display:s}=je(e),r=N(()=>{let d=t.value instanceof i?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),c=N(()=>{const d={width:qe(n)+.5+"px",height:qe(l)+.5+"px"};switch(u(a)){case oe.Up:d.clipPath=`inset(${r.value}% 0% 0% 0%)`,d.width=qe(n)+1+"px";break;case oe.Down:d.clipPath=`inset(0% 0% ${r.value}% 0%)`,d.width=qe(n)+1+"px";break;case oe.Right:d.clipPath=`inset(0% ${r.value}% 0% 0%)`;break;case oe.Left:d.clipPath=`inset(0% 0% 0% ${r.value} + '%)`;break;case oe.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),m=Ot(s);return{normalizedProgress:r,barStyle:c,component:m,unref:u,Visibility:Ue}}});function Is(e,t,n,l,a,s){var m,d,y,v,_,g,w;const r=Rt("MarkNode"),c=Rt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("div",{key:0,style:$e([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:{}]),class:Be({bar:!0,...e.unref(e.classes)})},[f("div",{class:"overlayTextContainer border",style:$e([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(b(),M("span",{key:0,class:"overlayText",style:$e(e.unref(e.textStyle))},[(b(),G(be(e.component)))],4)):P("",!0)],4),f("div",{class:"border",style:$e([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(y=e.unref(e.style))!=null?y:{},(v=e.unref(e.baseStyle))!=null?v:{},(_=e.unref(e.borderStyle))!=null?_:{}])},[f("div",{class:"fill",style:$e([e.barStyle,(g=e.unref(e.style))!=null?g:{},(w=e.unref(e.fillStyle))!=null?w:{}])},null,4)],4),o(r,{mark:e.unref(e.mark)},null,8,["mark"]),o(c,{id:e.id},null,8,["id"])],6)):P("",!0)}var Es=ue(As,[["render",Is],["__scopeId","data-v-02d0d7b2"]]);const Bs=Symbol("Bar");function en(e){return lt(()=>{const t=e();return t.id=tn("bar-"),t.type=Bs,t[Ut]=Es,$(t,"visibility"),ze(t,"visibility",Ue.Visible),$(t,"width"),$(t,"height"),$(t,"direction"),$(t,"style"),$(t,"classes"),$(t,"borderStyle"),$(t,"baseStyle"),$(t,"textStyle"),$(t,"fillStyle"),$(t,"progress"),$(t,"display"),$(t,"mark"),t[qt]=function(){const{progress:n,width:l,height:a,direction:s,display:r,visibility:c,style:m,classes:d,borderStyle:y,textStyle:v,baseStyle:_,fillStyle:g,mark:w,id:S}=this;return{progress:n,width:l,height:a,direction:s,display:r,visibility:c,style:u(m),classes:d,borderStyle:y,textStyle:v,baseStyle:_,fillStyle:g,mark:w,id:S}},t})}var xs=Q({props:{display:{type:R(Object,String,Function),required:!0},visibility:{type:R(Number),required:!0},style:R(Object,String,Array),classes:R(Object),onClick:Function,onHold:Function,canClick:{type:R(Boolean),required:!0},small:Boolean,mark:R(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:pn,MarkNode:Fn},setup(e){const{display:t,onClick:n,onHold:l}=je(e),a=rt("");at(()=>{const c=qe(t);if(c==null){a.value="";return}if(St(c)){a.value=ie(c);return}const m=ie(c.title||"","h3"),d=ie(c.description,"div");a.value=ie(x(()=>o("span",null,[c.title?o("div",null,[o(m,null,null)]):null,o(d,null,null)])))});const{start:s,stop:r}=Wl(n,l,e.isHolding);return{start:s,stop:r,comp:a,Visibility:Ue,unref:u}}});function Ps(e,t,n,l,a,s){var m;const r=Rt("MarkNode"),c=Rt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("button",{key:0,style:$e([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:Be({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)?(b(),G(be(e.unref(e.comp)),{key:0})):P("",!0),o(r,{mark:e.unref(e.mark)},null,8,["mark"]),o(c,{id:e.id},null,8,["id"])],38)):P("",!0)}var Jl=ue(xs,[["render",Ps],["__scopeId","data-v-8cedd7da"]]);const Fs=Symbol("Clickable");function ye(e){return lt(()=>{var n;const t=(n=e==null?void 0:e())!=null?n:{};if(t.id=tn("clickable-"),t.type=Fs,t[Ut]=Jl,t.isHolding=O(!1),$(t,"visibility"),ze(t,"visibility",Ue.Visible),$(t,"canClick"),ze(t,"canClick",!0),$(t,"classes"),$(t,"style"),$(t,"mark"),$(t,"display"),t.onClick){const l=t.onClick.bind(t);t.onClick=function(a){u(t.canClick)&&l(a)}}if(t.onHold){const l=t.onHold.bind(t);t.onHold=function(){u(t.canClick)&&l()}}return t[qt]=function(){const{display:l,visibility:a,style:s,classes:r,onClick:c,onHold:m,isHolding:d,canClick:y,small:v,mark:_,id:g}=this;return{display:l,visibility:a,style:u(s),classes:r,onClick:c,onHold:m,isHolding:d,canClick:y,small:v,mark:_,id:g}},t})}function ut(e,t="points",n=0,l=void 0){const a=De(e)?e:_e(e);if(a.displayName=t,a.precision=n,a.small=l,!De(e)){const s=a[un];s.displayName=t,s.precision=n,s.small=l}return a}function hl(e){const t=_e(e.value);return bt(e,n=>{i.gt(n,t.value)&&(t.value=n)}),t}function Ts(e){const t=_e(e.value);return bt(e,(n,l)=>{i.gt(n,l)&&(t.value=i.add(t.value,i.sub(n,l)))}),t}new i("10^^8");new i("1e100");function fn(e,t){const n=t!=null?t:e.value;return i.eq(e.precision,0)?j(e.small?n:i.floor(n)):ne(n,e.precision,e.small)}const Ds=["x1","y1","x2","y2"],$s=Q({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=je(e),l=N(()=>{const s=n.startNode.value.rect,r=n.boundingRect.value,c=r?{x:s.x+s.width/2-r.x,y:s.y+s.height/2-r.y}:{x:0,y:0};return n.link.value.offsetStart&&(c.x+=n.link.value.offsetStart.x,c.y+=n.link.value.offsetStart.y),c}),a=N(()=>{const s=n.endNode.value.rect,r=n.boundingRect.value,c=r?{x:s.x+s.width/2-r.x,y:s.y+s.height/2-r.y}:{x:0,y:0};return n.link.value.offsetEnd&&(c.x+=n.link.value.offsetEnd.x,c.y+=n.link.value.offsetEnd.y),c});return(s,r)=>(b(),M("line",Wt({"stroke-width":"15px",stroke:"white"},e.link,{x1:u(l).x,y1:u(l).y,x2:u(a).x,y2:u(a).y}),null,16,Ds))}});const Rs=Q({__name:"Links",props:{links:null},setup(e){var m;const n=_t(e,"links"),l=O(null),a=kn(jn,O({})),s=kn(Kn,O(void 0)),r=O((m=l.value)==null?void 0:m.getBoundingClientRect());bt(s,()=>{var d;return r.value=(d=l.value)==null?void 0:d.getBoundingClientRect()}),An(()=>{var d;return r.value=(d=l.value)==null?void 0:d.getBoundingClientRect()});const c=N(()=>{var y,v;const d=a.value;return(v=(y=n.value)==null?void 0:y.filter(_=>{var g,w;return((g=d[_.startNode.id])==null?void 0:g.rect)&&((w=d[_.startNode.id])==null?void 0:w.rect)}))!=null?v:[]});return(d,y)=>(b(),M(B,null,[u(c)?(b(),M("svg",wi(Wt({key:0},d.$attrs)),[(b(!0),M(B,null,Ml(u(c),(v,_)=>(b(),G($s,{key:_,link:v,boundingRect:r.value,startNode:u(a)[v.startNode.id],endNode:u(a)[v.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):P("",!0),f("div",{ref_key:"resizeListener",ref:l,class:"resize-listener"},null,512)],64))}});var Os=ue(Rs,[["__scopeId","data-v-063f6d6b"]]);Q({props:{nodes:{type:R(Array),required:!0},leftSideNodes:R(Array),rightSideNodes:R(Array),branches:R(Array)},components:{Links:Os},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:l}=je(e),a=rt();at(()=>{const c=qe(t);a.value=ie(x(()=>o(B,null,[c.map(m=>o("span",{class:"row tree-row",style:"margin: 50px auto;"},[m.map(yt)]))])))});const s=rt();at(()=>{const c=qe(n);s.value=c?ie(x(()=>o("span",{class:"left-side-nodes small"},[c.map(yt)]))):""});const r=rt();return at(()=>{const c=qe(l);r.value=c?ie(x(()=>o("span",{class:"side-nodes small"},[c.map(yt)]))):""}),{unref:u,nodesComp:a,leftNodesComp:s,rightNodesComp:r}}});Q({props:{display:R(Object,String,Function),visibility:{type:R(Number),required:!0},style:R(String,Object,Array),classes:R(Object),onClick:Function,onHold:Function,color:R(String),glowColor:R(String),canClick:{type:R(Boolean),required:!0},mark:R(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Fn,Node:pn},setup(e){const{onClick:t,onHold:n,display:l}=je(e),a=Ot(l),{start:s,stop:r}=Wl(t,n);return{start:s,stop:r,comp:a,unref:u,Visibility:Ue,isCoercableComponent:St}}});function Tn(e){const t=[],n={};let l=!1;function a(){return l||(t.push(...e()),n.base=t.map(c=>Qe(c.base)),n.baseText=t.map(c=>Qe(c.baseText)),n.visible=t.map(c=>Qe(c.visible)),l=!0),t}const s=_e({});return[x(()=>{const c=a();let m=!0;const d=c.map((y,v)=>{var S,I,se;if(u(n.visible[v])===!1)return null;const _=o("h3",{onClick:()=>s.value[v]=!s.value[v],style:"cursor: pointer"},[o("span",{class:"modifier-toggle"+(u(s.value[v])?" collapsed":"")},[p("\u25BC")]),y.title,y.subtitle?o("span",{class:"subtitle"},[p(" ("),y.subtitle,p(")")]):null]),g=u(s.value[v])?null:o(B,null,[o("div",{class:"modifier-container"},[o("span",{class:"modifier-amount"},[ne((S=u(n.base[v]))!=null?S:1),y.unit]),o("span",{class:"modifier-description"},[yt((I=u(n.baseText[v]))!=null?I:"Base")])]),yt(u(y.modifier.description))]),w=!m;return m=!1,o(B,null,[w?o("br",null,null):null,o("div",null,[_,o("br",null,null),g,o("hr",null,null),p("Total: "),ne(y.modifier.apply((se=u(n.base[v]))!=null?se:1)),y.unit])])});return o(B,null,[d])}),s]}function Xl(e){const t=Object.values(e).reverse(),n=_e(!0),l=N(()=>t.filter(m=>m.earned.value===!1)),{firstFeature:a,collapsedContent:s,hasCollapsedContent:r}=es(t,m=>m.earned.value),c=x(()=>{const m=[...l.value];return a.value&&m.push(a.value),Za(...m,x(()=>In(o(ws,{collapsed:n,content:s,display:n.value?"Show other completed milestones":"Hide other completed milestones"},null),[[Nl,u(r)]])))});return{collapseMilestones:n,display:c}}function hn(e){const t=Ts(e.resource),n=()=>{var c,m;if(z.day.value!==e.day)return 1;let s=i.add(t.value,1),r=e.goal;return((m=(c=e.usingLog)==null?void 0:c.value)!=null?m:V.usingLog)&&(s=s.log10(),r=i.log10(r)),i.div(s,r)},l=en(()=>({direction:oe.Right,width:600,height:25,fillStyle:{backgroundColor:e.color},textStyle:e.textColor?{color:e.textColor}:void 0,progress:n,display:x(()=>z.day.value===e.day?o(B,null,[Ee(t.value),p("/"),Ee(e.goal)]):"")})),a=x(()=>o(B,null,[o("div",null,[z.day.value===e.day?o(B,null,[p("Reach "),Ee(e.goal),p(" total "),e.resource.displayName,p(" to complete the day")]):o(B,null,[e.name,p(" Complete!")]),e.modal?o(B,null,[" ",p("-")," ",o("button",{class:"button",style:"display: inline-block;",onClick:()=>e.modal.show.value=!0},[p("Check Modifiers")])]):void 0]),he(l),e.modal?he(e.modal.display):void 0]));return at(()=>{z.day.value===e.day&&i.gte(t.value,e.goal)&&z.completeDay()}),{total:t,trackerDisplay:a}}const Us=Symbol("Buyable");function He(e){const t=_e(0);return lt(()=>{var s,r,c;const n=e();if(n.canPurchase==null&&(n.resource==null||n.cost==null))throw console.warn("Cannot create buyable without a canPurchase property or a resource and cost property",n),"Cannot create buyable without a canPurchase property or a resource and cost property";n.id=tn("buyable-"),n.type=Us,n[Ut]=Jl,n.amount=t,n.amount[$t]=(s=n.initialValue)!=null?s:0,n.canAfford=N(()=>{const m=n,d=u(m.cost);return m.resource!=null&&d!=null&&i.gte(m.resource.value,d)}),n.canPurchase==null&&(n.canPurchase=N(()=>u(n.visibility)===Ue.Visible&&u(n.canAfford)&&i.lt(n.amount.value,u(n.purchaseLimit)))),n.maxed=N(()=>i.gte(n.amount.value,u(n.purchaseLimit))),$(n,"classes");const l=n.classes;n.classes=N(()=>{const m=u(l)||{};return n.maxed.value&&(m.bought=!0),m}),$(n,"canPurchase"),n.canClick=n.canPurchase,n.onClick=n.purchase=(c=(r=n.onClick)!=null?r:n.purchase)!=null?c:function(){var y;const m=n;if(!u(m.canPurchase))return;const d=u(m.cost);m.cost!=null&&m.resource!=null&&(m.resource.value=i.sub(m.resource.value,d),m.amount.value=i.add(m.amount.value,1)),(y=m.onPurchase)==null||y.call(m,d)},$(n,"display");const a=n.display;return n.display=x(()=>{const m=u(a);if(St(m)){const d=ie(m);return o(d,null,null)}if(m!=null&&n.cost!=null&&n.resource!=null){const d=n,y=ie(m.title||"","h3"),v=ie(m.description||""),_=ie(m.effectDisplay||"");return o("span",null,[m.title?o("div",null,[o(y,null,null)]):null,m.description?o(v,null,null):null,m.showAmount===!1?null:o("div",null,[o("br",null,null),u(d.purchaseLimit)===i.dInf?o(B,null,[p("Amount: "),j(d.amount.value)]):o(B,null,[p("Amount: "),j(d.amount.value),p(" /")," ",j(u(d.purchaseLimit))])]),m.effectDisplay?o("div",null,[o("br",null,null),p("Currently: "),o(_,null,null)]):null,d.cost&&!d.maxed.value?o("div",null,[p("Cost: "),ne(u(d.cost)||0)," ",n.resource.displayName]):null])}return""}),$(n,"visibility"),ze(n,"visibility",Ue.Visible),$(n,"cost"),$(n,"resource"),$(n,"purchaseLimit"),ze(n,"purchaseLimit",i.dInf),$(n,"style"),$(n,"mark"),$(n,"small"),n[qt]=function(){const{display:m,visibility:d,style:y,classes:v,onClick:_,canClick:g,small:w,mark:S,id:I}=this;return{display:m,visibility:d,style:u(y),classes:v,onClick:_,canClick:g,small:w,mark:S,id:I}},n})}const Dn=Bn({}),Xn=Symbol("Hotkey");function Ln(e){return lt(()=>{const t=e();return t.type=Xn,$(t,"enabled"),ze(t,"enabled",!0),$(t,"description"),t})}xe.on("addLayer",e=>{$l(e,Xn).forEach(t=>{Dn[t.key]=t})});xe.on("removeLayer",e=>{$l(e,Xn).forEach(t=>{Dn[t.key]=void 0})});document.onkeydown=function(e){var l;if(((l=e.target)==null?void 0:l.tagName)==="INPUT"||el.value&&!V.keepGoing)return;let t=e.key;e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const n=Dn[t];n&&u(n.enabled)&&(e.preventDefault(),n.onPress())};Wa(x(()=>{const e=Object.values(Dn).filter(t=>u(t==null?void 0:t.enabled));return e.length===0?"":o("div",null,[o("br",null,null),o("h4",null,[p("Hotkeys")]),e.map(t=>o("div",null,[t==null?void 0:t.key,p(": "),t==null?void 0:t.description]))])}));const qs=Q({__name:"Sticky",setup(e){const t=O("0"),n=new ResizeObserver(a),l=rt(null);function a(){let s=l.value;if(s==null)return;let r=0;for(;s.previousSibling;){const c=s.previousSibling;c.dataset&&"vSticky"in c.dataset&&(r+=c.offsetHeight),s=c}t.value=r+"px"}return Kt(a),document.fonts.ready.then(a),An(()=>{var r;const s=(r=l.value)==null?void 0:r.parentElement;s&&n.observe(s)}),(s,r)=>(b(),M("div",{class:"sticky",style:$e({top:t.value}),ref_key:"element",ref:l,"data-v-sticky":""},[wt(s.$slots,"default",{},void 0,!0)],4))}});var Vs=ue(qs,[["__scopeId","data-v-cccac690"]]);const gl=Q({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=N(()=>fn(t.resource));return(l,a)=>(b(),M("h2",{style:$e({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},J(u(n)),5))}});const Ls={class:"main-display"},Gs={key:0},Hs={key:1},Qs=p(", "),zs={key:2},js=f("br",null,null,-1),Ks={class:"main-display"},Ws={key:0},Js={key:1},Xs=p(", "),Ys={key:2},Zs=f("br",null,null,-1),Nt=Q({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null,productionDisplay:null,sticky:{type:Boolean,default:!0}},setup(e){const n=je(e),l=O(null),a=Ot(n.effectDisplay),s=Ot(n.productionDisplay),r=N(()=>i.lt(n.resource.value,"1e1000"));return(c,m)=>{var d,y;return e.sticky?(b(),G(Vs,{key:0},{default:L(()=>{var v,_,g,w;return[f("div",{class:Be(["main-display-container",(v=e.classes)!=null?v:{}]),style:$e([{height:`${((g=(_=l.value)==null?void 0:_.$el.clientHeight)!=null?g:0)+50}px`},(w=e.style)!=null?w:{}])},[f("div",Ls,[u(r)?(b(),M("span",Gs,"You have ")):P("",!0),o(gl,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),p(" "+J(e.resource.displayName),1),u(a)?(b(),M("span",Hs,[Qs,(b(),G(be(u(a)),{ref_key:"effectRef",ref:l},null,512))])):P("",!0),u(s)?(b(),M("span",zs,[js,(b(),G(be(u(s)),{ref_key:"effectRef",ref:l},null,512))])):P("",!0)])],6)]}),_:1})):(b(),M("div",{key:1,class:Be(["main-display-container",(d=e.classes)!=null?d:{}]),style:$e([{height:"50px"},(y=e.style)!=null?y:{}])},[f("div",Ks,[u(r)?(b(),M("span",Ws,"You have ")):P("",!0),o(gl,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),p(" "+J(e.resource.displayName),1),u(a)?(b(),M("span",Js,[Xs,(b(),G(be(u(a)),{ref_key:"effectRef",ref:l},null,512))])):P("",!0),u(s)?(b(),M("span",Ys,[Zs,(b(),G(be(u(s)),{ref_key:"effectRef",ref:l},null,512))])):P("",!0)])],6))}}});var eo=Q({props:{display:{type:R(String,Object,Function),required:!0},visibility:{type:R(Number),required:!0},style:R(String,Object,Array),classes:R(Object),resource:Object,cost:R(String,Object,Number),canPurchase:{type:R(Boolean),required:!0},bought:{type:R(Boolean),required:!0},mark:R(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:pn,MarkNode:Fn},setup(e){const{display:t,cost:n}=je(e),l=rt("");return at(()=>{const a=qe(t);if(a==null){l.value="";return}if(St(a)){l.value=ie(a);return}const s=qe(n),r=ie(a.title||"","h3"),c=ie(a.description,"div"),m=ie(a.effectDisplay||"");l.value=ie(x(()=>{var d;return o("span",null,[a.title?o("div",null,[o(r,null,null)]):null,o(c,null,null),a.effectDisplay?o("div",null,[p("Currently: "),o(m,null,null)]):null,e.resource!=null&&a.showCost!==!1?o(B,null,[o("br",null,null),p("Cost: "),e.resource&&fn(e.resource,s)," ",(d=e.resource)==null?void 0:d.displayName]):null])}))}),{component:l,unref:u,Visibility:Ue}}});const to=["disabled"];function no(e,t,n,l,a,s){var m;const r=Rt("MarkNode"),c=Rt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("button",{key:0,style:$e([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:Be({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)?(b(),G(be(e.unref(e.component)),{key:0})):P("",!0),o(r,{mark:e.unref(e.mark)},null,8,["mark"]),o(c,{id:e.id},null,8,["id"])],14,to)):P("",!0)}var lo=ue(eo,[["render",no],["__scopeId","data-v-7f411ac8"]]);const io=Symbol("Upgrade");function pe(e){const t=_e(!1);return lt(()=>{const n=e();return n.id=tn("upgrade-"),n.type=io,n[Ut]=lo,n.canAfford==null&&(n.resource==null||n.cost==null)&&console.warn("Error: can't create upgrade without a canAfford property or a resource and cost property",n),n.bought=t,n.canAfford==null?n.canAfford=N(()=>{const l=n;return l.resource!=null&&l.cost!=null&&i.gte(l.resource.value,u(l.cost))}):$(n,"canAfford"),n.canPurchase=N(()=>u(n.visibility)===Ue.Visible&&u(n.canAfford)&&!u(n.bought)),n.purchase=function(){var a;const l=n;!u(l.canPurchase)||(l.resource!=null&&l.cost!=null&&(l.resource.value=i.sub(l.resource.value,u(l.cost))),t.value=!0,(a=l.onPurchase)==null||a.call(l))},$(n,"visibility"),ze(n,"visibility",Ue.Visible),$(n,"classes"),$(n,"style"),$(n,"display"),$(n,"mark"),$(n,"cost"),$(n,"resource"),n[qt]=function(){const{display:l,visibility:a,style:s,classes:r,resource:c,cost:m,canPurchase:d,bought:y,mark:v,id:_,purchase:g}=this;return{display:l,visibility:a,style:u(s),classes:r,resource:c,cost:m,canPurchase:d,bought:y,mark:v,id:_,purchase:g}},n})}function le(e){return lt(()=>{const{addend:t,description:n,enabled:l}=e(),a=Qe(t),s=Qe(n),r=l==null?void 0:Qe(l);return{apply:c=>i.add(c,u(a)),revert:c=>i.sub(c,u(a)),enabled:r,description:n==null?void 0:x(()=>o("div",{class:"modifier-container"},[o("span",{class:"modifier-amount"},[i.gte(u(a),0)?"+":"",ne(u(a))]),u(s)?o("span",{class:"modifier-description"},[yt(u(s))]):null]))}})}function F(e){return lt(()=>{const{multiplier:t,description:n,enabled:l}=e(),a=Qe(t),s=Qe(n),r=l==null?void 0:Qe(l);return{apply:c=>i.times(c,u(a)),revert:c=>i.div(c,u(a)),enabled:r,description:n==null?void 0:x(()=>o("div",{class:"modifier-container"},[o("span",{class:"modifier-amount"},[p("x"),ne(u(a))]),u(s)?o("span",{class:"modifier-description"},[yt(u(s))]):null]))}})}function Yl(e){return lt(()=>{const{exponent:t,description:n,enabled:l,supportLowNumbers:a}=e(),s=Qe(t),r=Qe(n),c=l==null?void 0:Qe(l);return{apply:m=>{let d=m;return a&&(d=i.add(d,1)),d=i.pow(d,u(s)),a&&(d=i.sub(d,1)),d},revert:m=>{let d=m;return a&&(d=i.add(d,1)),d=i.root(d,u(s)),a&&(d=i.sub(d,1)),d},enabled:c,description:n==null?void 0:x(()=>o("div",{class:"modifier-container"},[o("span",{class:"modifier-amount"},[p("^"),ne(u(s))]),u(r)?o("span",{class:"modifier-description"},[yt(u(r)),a?" (+1 effective)":null]):null]))}})}function ae(e){return lt(()=>{const t=e();return{apply:n=>t.filter(l=>u(l.enabled)!==!1).reduce((l,a)=>a.apply(l),n),revert:t.every(n=>n.revert!=null)?n=>t.filter(l=>u(l.enabled)!==!1).reduceRight((l,a)=>a.revert(l),n):void 0,enabled:N(()=>t.filter(n=>u(n.enabled)!==!1).length>0),description:x(()=>o(B,null,[t.filter(n=>u(n.enabled)!==!1).map(n=>u(n.description)).filter(n=>n).map(yt)]))}})}function Zl(e){return lt(()=>{const t=e();return t.currentGain==null&&(t.currentGain=N(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=i.floor(n).max(0),u(t.buyMax)||(n=n.min(1)),n})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=N(()=>{let n=t.scaling.currentAt(t);return t.roundUpCost&&(n=i.ceil(n)),n})),t.nextAt==null&&(t.nextAt=N(()=>{let n=t.scaling.nextAt(t);return t.roundUpCost&&(n=i.ceil(n)),n})),t.convert==null&&(t.convert=function(){var a;const n=u(t.currentGain),l=u(t.currentAt);t.gainResource.value=i.add(t.gainResource.value,n),t.spend(n,l),(a=t.onConvert)==null||a.call(t,n)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),$(t,"currentGain"),$(t,"actualGain"),$(t,"currentAt"),$(t,"nextAt"),$(t,"buyMax"),ze(t,"buyMax",!0),$(t,"roundUpCost"),ze(t,"roundUpCost",!0),t})}function Yn(e,t){const n=Qe(e),l=Qe(t);return{currentGain(a){let s=u(a.baseResource.value);if(a.costModifier&&(s=a.costModifier.apply(s)),i.lt(s,u(n)))return 0;const r=i.div(s,u(n)).pow(u(l));return r.isNan()?new i(0):r},currentAt(a){let s=u(a.currentGain);return a.gainModifier&&(s=a.gainModifier.revert(s)),s=i.max(0,s).root(u(l)).times(u(n)),a.costModifier&&(s=a.costModifier.revert(s)),s},nextAt(a){let s=i.add(u(a.currentGain),1).floor();return a.gainModifier&&(s=a.gainModifier.revert(s)),s=i.max(0,s).root(u(l)).times(u(n)).max(u(n)),a.costModifier&&(s=a.costModifier.revert(s)),s}}}function ei(e){return Zl(e)}function ao(e){return Zl(()=>{const t=e();return ze(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=N(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=i.floor(n).max(t.gainResource.value),u(t.buyMax)||(n=n.min(i.add(t.gainResource.value,1))),n})),t.actualGain==null&&(t.actualGain=N(()=>{let n=i.sub(i.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return u(t.buyMax)||(n=n.min(1)),n})),ze(t,"convert",function(){var a;const n=u(t.actualGain),l=u(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(u(t.currentGain)):u(t.currentGain),t.spend(n,l),(a=t.onConvert)==null||a.call(t,n)}),t})}const so="boxes",vl=6,it=It(so,function(){const e="Boxes",t="#964B00",n=ut(0,"boxes"),l=ei(()=>({scaling:Yn(1e10,1),baseResource:ee.logs,gainResource:W(n),roundUpCost:!0})),a=ye(()=>({display:x(()=>o(B,null,[o("span",{style:"font-size: large"},[p("Create "),j(l.currentGain.value),p(" "),n.displayName]),o("br",null,null),o("span",{style:"font-size: large"},[p("Cost:")," ",fn(ee.logs,i.gte(l.actualGain.value,1)?l.currentAt.value:l.nextAt.value)," ",ee.logs.displayName])])),canClick:()=>i.gte(l.actualGain.value,1),onClick(){!u(this.canClick)||l.convert()},style:"width: 600px; min-height: unset"})),s=pe(()=>({display:{title:"Carry logs in boxes",description:"Double log gain and unlock a new elf for training"},onPurchase(){z.days[3].recentlyUpdated.value=!0},resource:W(n),cost:100})),r=pe(()=>({display:{title:"Carry ash in boxes",description:"Double ash gain and unlock a new elf for training"},onPurchase(){z.days[3].recentlyUpdated.value=!0},resource:W(n),cost:1e3})),c=pe(()=>({display:{title:"Carry coal in boxes",description:"Double coal gain and unlock a new elf for training"},onPurchase(){z.days[3].recentlyUpdated.value=!0},resource:W(n),cost:4e3})),m={logsUpgrade:s,ashUpgrade:r,coalUpgrade:c},d=He(()=>({display:{title:"Carry more logs",description:"Use boxes to carry even more logs, boosting their gain",effectDisplay:x(()=>o(B,null,[ne(i.div(d.amount.value,2).add(1)),p("x")]))},resource:W(n),cost(){return i.pow(3,d.amount.value).times(100)},visibility:()=>q(s.bought.value)})),y=He(()=>({display:{title:"Carry more ash",description:"Use boxes to carry even more ash, boosting its gain",effectDisplay:x(()=>o(B,null,[ne(i.div(y.amount.value,2).add(1)),p("x")]))},resource:W(n),cost(){return i.pow(5,y.amount.value).times(1e3)},visibility:()=>q(r.bought.value)})),v=He(()=>({display:{title:"Carry more coal",description:"Use boxes to carry even more coal, boosting its gain",effectDisplay:x(()=>o(B,null,[ne(i.div(v.amount.value,2).add(1)),p("x")]))},resource:W(n),cost(){return i.pow(7,v.amount.value).times(1e3)},visibility:()=>q(c.bought.value)})),_={logBoxesBuyable:d,ashBoxesBuyable:y,coalBoxesBuyable:v},{total:g,trackerDisplay:w}=hn({resource:n,goal:5e4,name:e,day:vl,color:t});return{name:e,day:vl,color:t,boxes:n,totalBoxes:g,boxesConversion:l,upgrades:m,buyables:_,minWidth:700,display:x(()=>o(B,null,[he(w),o(fe,null,null),o(Nt,{resource:n,color:t,style:"margin-bottom: 0"},null),o(fe,null,null),he(a),o(fe,null,null),Fe(...Object.values(m)),Fe(...Object.values(_))]))}});const oo={class:"field"},ro=Q({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,l=N(()=>ie(u(n.title)||"<span></span>","span")),a=N({get(){return!!n.modelValue},set(s){t("update:modelValue",s)}});return(s,r)=>(b(),M("label",oo,[In(f("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":r[0]||(r[0]=c=>De(a)?a.value=c:null)},null,512),[[ki,u(a)]]),(b(),G(be(u(l))))]))}});var Ct=ue(ro,[["__scopeId","data-v-33d57459"]]);const uo={class:"field"},co={key:0,class:"field-title"},Zn=Q({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var r;const n=e,l=Ot(_t(n,"title"),"span"),a=O((r=n.options.find(c=>c.value===n.modelValue))!=null?r:null);bt(_t(n,"modelValue"),c=>{var m;qe(a)!==c&&(a.value=(m=n.options.find(d=>d.value===c))!=null?m:null)});function s(c){t("update:modelValue",c.value)}return(c,m)=>(b(),M("div",uo,[u(l)?(b(),M("span",co,[(b(),G(be(u(l))))])):P("",!0),o(u(Mi),{options:e.options,modelValue:a.value,"onUpdate:modelValue":[m[0]||(m[0]=d=>a.value=d),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var mo=Q({props:{visibility:{type:R(Number),required:!0},display:{type:R(String,Object,Function),required:!0},style:R(String,Object,Array),classes:R(Object),earned:{type:R(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:pn},setup(e){const{display:t}=je(e),n=rt("");return at(()=>{const l=qe(t);if(l==null){n.value="";return}if(St(l)){n.value=ie(l);return}const a=ie(l.requirement,"h3"),s=ie(l.effectDisplay||"","b"),r=ie(l.optionsDisplay||"","span");n.value=ie(x(()=>o("span",null,[o(a,null,null),l.effectDisplay?o("div",null,[o(s,null,null)]):null,l.optionsDisplay?o("div",{class:"equal-spaced"},[o(r,null,null)]):null])))}),{comp:n,unref:u,Visibility:Ue}}});function po(e,t,n,l,a,s){var c;const r=Rt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("div",{key:0,style:$e([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:Be({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(b(),G(be(e.unref(e.comp)))),o(r,{id:e.id},null,8,["id"])],6)):P("",!0)}var fo=ue(mo,[["render",po],["__scopeId","data-v-f4e8794e"]]);xe.on("setupVue",e=>e.use(Ai));const yl=Il(),ho=Symbol("Milestone");let Dt;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(Dt||(Dt={}));function Ge(e){const t=_e(!1);return lt(()=>{var a;const n=(a=e==null?void 0:e())!=null?a:{};n.id=tn("milestone-"),n.type=ho,n[Ut]=fo,n.earned=t,n.complete=function(){var r;const s=n;if(t.value=!0,(r=s.onComplete)==null||r.call(s),s.display&&u(s.showPopups)===!0){const c=u(s.display),m=ie(St(c)?c:c.requirement);yl(o(B,null,[o("h3",null,[p("Milestone earned!")]),o("div",null,[o(m,null,null)])]))}},$(n,"visibility"),ze(n,"visibility",Ue.Visible);const l=n.visibility;if(n.visibility=N(()=>{const s=u(n.display);switch(Ne.msDisplay){default:case Dt.All:return u(l);case Dt.Configurable:return u(n.earned)&&!(s!=null&&typeof s=="object"&&"optionsDisplay"in s)?Ue.None:u(l);case Dt.Incomplete:return u(n.earned)?Ue.None:u(l);case Dt.None:return Ue.None}}),$(n,"style"),$(n,"classes"),$(n,"display"),$(n,"showPopups"),n[qt]=function(){const{visibility:s,display:r,style:c,classes:m,earned:d,id:y}=this;return{visibility:s,display:r,style:u(c),classes:m,earned:d,id:y}},n.shouldEarn){const s=n;at(()=>{var r,c;if(Ne.active===V.id&&!s.earned.value&&u(s.visibility)===Ue.Visible&&((r=s.shouldEarn)==null?void 0:r.call(s))&&(s.earned.value=!0,(c=s.onComplete)==null||c.call(s),s.display&&u(s.showPopups)===!0)){const m=u(s.display),d=ie(St(m)?m:m.requirement);yl(o(B,null,[o("h3",null,[p("Milestone earned!")]),o("div",null,[o(d,null,null)])]))}})}return n})}xe.on("loadSettings",e=>{ze(e,"msDisplay",Dt.All)});const go=Object.values(Dt).map(e=>({label:Dl(e),value:e}));Ka(x(()=>o(Zn,{title:"Show Milestones",options:go,"onUpdate:modelValue":e=>Ne.msDisplay=e,modelValue:Ne.msDisplay},null)));const vo=Symbol("Reset");function yo(e){return lt(()=>{const t=e();return t.id=tn("reset-"),t.type=vo,t.reset=function(){var l;const n=a=>{if(a&&typeof a=="object")if($t in a){const s=a;s.value=s[$t]}else!(a instanceof i)&&!De(a)&&Object.values(a).forEach(s=>n(s))};u(t.thingsToReset).forEach(n),xe.emit("reset",t),(l=t.onReset)==null||l.call(t)},$(t,"thingsToReset"),t})}const bn={};xe.on("removeLayer",e=>{var t;(t=bn[e.id])==null||t.call(bn),bn[e.id]=void 0});const bo="paper",bl=5,de=It(bo,function(){const e="Paper",t="#E8DCB8",n=ut(0,"paper"),l=ut(N(()=>i.min(i.div(ee.logs.value,1e9),i.div(U.ash.value,1e6))),"pulp"),a=ei(()=>({scaling:Yn(1,1.2),baseResource:l,gainResource:W(n),roundUpCost:!0,spend(C,T){ee.logs.value=i.sub(ee.logs.value,i.times(T,1e9)),U.ash.value=i.sub(U.ash.value,i.times(T,1e6))}})),s=ye(()=>({display:x(()=>{const C=i.gte(a.actualGain.value,1)?a.currentAt.value:a.nextAt.value;return o(B,null,[o("span",{style:"font-size: large"},[p("Create "),j(a.currentGain.value),p(" "),n.displayName]),o("br",null,null),o("span",{style:"font-size: large"},[p("Cost: "),fn(ee.logs,C),p(" "),l.displayName,p(" ("),j(i.times(C,1e9)),p(" "),ee.logs.displayName,p(";")," ",j(i.times(C,1e6)),p(" "),U.ash.displayName,p(")")])])}),canClick:()=>i.gte(a.actualGain.value,1),onClick(){!u(this.canClick)||a.convert()},style:"width: 600px; min-height: unset"}));function r(C){const T=He(()=>({...C,display:{title:C.name,description:`Print a copy of "${C.name}", which ${C.elfName} will use to improve their skills! Each copy printed will reduce the "${C.buyableName}" price scaling by 0.95x and make ${C.elfName} purchase +10% faster!`,effectDisplay:x(()=>o(B,null,[ne(i.pow(.95,T.amount.value)),p("x price scaling,")," ",ne(i.div(T.amount.value,10).add(1)),p("x auto-purchase speed")])),showAmount:!1},resource:W(n),cost:()=>i.pow(5,T.amount.value).times(10),style:"width: 600px"}));return T}const c=r({name:"Now You're Logging!",elfName:"Holly",buyableName:"Generic Cutters"}),m=r({name:"The Man Who Planted Trees",elfName:"Ivy",buyableName:"Generic Planters"}),d=r({name:"Logjam",elfName:"Hope",buyableName:"Expand Forest"}),y=r({name:"Fahrenheit 451",elfName:"Jack",buyableName:"Heated Cutters"}),v=r({name:"Tillamook Burn Country",elfName:"Mary",buyableName:"Heated Planters"}),_=r({name:"The Garden Tree's Handbook",elfName:"Noel",buyableName:"Fertilized Soil"}),g=r({name:"Firestarter",elfName:"Joy",buyableName:"Small Fire",visibility:()=>q(Te.elves.smallFireElf.bought.value)}),w=r({name:"An Arsonist's Guide to Writer's Homes in New England",elfName:"Faith",buyableName:"Bonfire",visibility:()=>q(Te.elves.bonfireElf.bought.value)}),S=r({name:"Little Fires Everywhere",elfName:"Snowball",buyableName:"Kiln",visibility:()=>q(Te.elves.kilnElf.bought.value)}),I={cuttersBook:c,plantersBook:m,expandersBook:d,heatedCuttersBook:y,heatedPlantersBook:v,fertilizerBook:_,smallFireBook:g,bonfireBook:w,kilnBook:S},{total:se,trackerDisplay:A}=hn({resource:n,goal:5e3,name:e,day:bl,color:t,textColor:"var(--feature-foreground)"});return{name:e,day:bl,color:t,paper:n,totalPaper:se,paperConversion:a,books:I,minWidth:700,display:x(()=>o(B,null,[he(A),o(fe,null,null),o(Nt,{resource:n,color:t,style:"margin-bottom: 0"},null),o(fe,null,null),he(s),o(fe,null,null),Kl(...Object.values(I))]))}}),_o="workshop",nn=2,tt=It(_o,function(){const e="Workshop",t="#D66B02",n="#D66B02",l=ut(0,"foundation progress"),a=ao(()=>({scaling:Yn(250,1.5),baseResource:ee.logs,gainResource:W(l),roundUpCost:!0,buyMax:!1,spend(T,ge){ee.logs.value=i.sub(ee.logs.value,ge)}})),s=ye(()=>({display:x(()=>o(B,null,[o("b",{style:"font-size: x-large"},[p("Build part of the foundation")]),o("br",null,null),o("br",null,null),o("span",{style:"font-size: large"},[p("Cost:")," ",fn(ee.logs,i.gte(a.actualGain.value,1)?a.currentAt.value:a.nextAt.value)," ",ee.logs.displayName])])),visibility:()=>q(i.lt(l.value,100)),canClick:()=>i.gte(a.actualGain.value,1)&&i.lt(l.value,100),onClick(){!u(this.canClick)||a.convert()},style:"width: 600px; min-height: unset"})),r=Ln(()=>({key:"w",description:"Build part of the foundation.",onPress:()=>{s.canClick.value&&s.onClick()}})),c=N(()=>!Te.milestones[6].earned.value),m=Ge(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>i.gte(l.value,1),showPopups:c})),d=Ge(()=>({display:{requirement:"10% Foundation Completed",effectDisplay:"Cut an additional tree per second for each 5% of foundation completed"},shouldEarn:()=>i.gte(l.value,10),visibility:()=>q(m.earned.value),showPopups:c})),y=Ge(()=>({display:{requirement:"20% Foundation Completed",effectDisplay:"Plant an additional tree per second for each 10% of foundation completed"},shouldEarn:()=>i.gte(l.value,20),visibility:()=>q(d.earned.value),showPopups:c})),v=Ge(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>i.gte(l.value,30),visibility:()=>q(y.earned.value),showPopups:c})),_=Ge(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>i.gte(l.value,40),visibility:()=>q(v.earned.value),showPopups:c})),g=Ge(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>i.gte(l.value,50),visibility:()=>q(_.earned.value),showPopups:c})),w=Ge(()=>({display:{requirement:"75% Foundation Completed",effectDisplay:"The forest gains an extra tree for every 2% of foundation completed"},shouldEarn:()=>i.gte(l.value,75),visibility:()=>q(g.earned.value),showPopups:c})),S=Ge(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Log per tree is raised to the 1.2th power"},shouldEarn:()=>i.gte(l.value,100),visibility:()=>q(w.earned.value),showPopups:c})),I={logGainMilestone1:m,autoCutMilestone1:d,autoPlantMilestone1:y,autoCutMilestone2:v,autoPlantMilestone2:_,logGainMilestone2:g,morePlantsMilestone1:w,logGainMilestone3:S},{collapseMilestones:se,display:A}=Xl(I),C=en(()=>({direction:oe.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>z.day.value===nn?i.div(l.value,100):1,display:x(()=>z.day.value===nn?o(B,null,[j(l.value),p("%")]):"")}));return at(()=>{z.day.value===nn&&i.gte(l.value,100)&&z.completeDay()}),{name:e,day:nn,color:t,foundationProgress:l,foundationConversion:a,milestones:I,collapseMilestones:se,minWidth:700,buildFoundationHK:r,display:x(()=>o(B,null,[o("div",null,[z.day.value===nn?"Complete the foundation to complete the day":`${e} Complete!`]),he(C),o(fe,null,null),o("div",null,[o("span",null,[p("The foundation is ")]),o("h2",{style:`color: ${t}; text-shadow: 0 0 10px ${t}`},[j(l.value)]),p("% completed")]),i.lt(l.value,100)?o(fe,null,null):null,he(s),o(fe,null,null),A()]))}}),wo="elves",ln=4,Te=It(wo,function(){const e="Elves",t="red",n="#911D21",a=en(()=>({direction:oe.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>z.day.value===ln?i.div(te.value,6).times(.8333333333333334).add(i.div(i.add(U.coal.value,1).log10(),i.log10(1e9)).clamp(0,1).div(6)):1,display:x(()=>z.day.value===ln?i.lt(te.value,6)?o(B,null,[j(te.value),p("/6 elves")]):o(B,null,[j(U.coal.value),p("/"),j(1e9),p(" coal")]):"")})),s=yo(()=>({thingsToReset:[ee,tt,U],onReset(){setTimeout(()=>{pt.earned.value?(ee.row1Upgrades.forEach(K=>K.bought.value=!0),ee.row2Upgrades.forEach(K=>K.bought.value=!0)):Xe.earned.value&&(ee.row1Upgrades[4].bought.value=!0,ee.row2Upgrades[4].bought.value=!0),et.earned.value&&(tt.foundationProgress.value=100)})}})),r=ae(()=>[F(()=>({multiplier:2,description:"6 Elves Trained",enabled:Me.earned})),F(()=>({multiplier:()=>i.times(de.books.cuttersBook.amount.value,.1).add(1),description:"Now You're Logging!",enabled:()=>i.gt(de.books.cuttersBook.amount.value,0)}))]),c=ae(()=>[F(()=>({multiplier:2,description:"6 Elves Trained",enabled:Me.earned})),F(()=>({multiplier:()=>i.times(de.books.plantersBook.amount.value,.1).add(1),description:"The Man Who Planted Trees",enabled:()=>i.gt(de.books.plantersBook.amount.value,0)}))]),m=ae(()=>[F(()=>({multiplier:2,description:"6 Elves Trained",enabled:Me.earned})),F(()=>({multiplier:()=>i.times(de.books.expandersBook.amount.value,.1).add(1),description:"Logjam",enabled:()=>i.gt(de.books.expandersBook.amount.value,0)}))]),d=ae(()=>[F(()=>({multiplier:2,description:"6 Elves Trained",enabled:Me.earned})),F(()=>({multiplier:()=>i.times(de.books.heatedCuttersBook.amount.value,.1).add(1),description:"Fahrenheit 451",enabled:()=>i.gt(de.books.heatedCuttersBook.amount.value,0)}))]),y=ae(()=>[F(()=>({multiplier:2,description:"6 Elves Trained",enabled:Me.earned})),F(()=>({multiplier:()=>i.times(de.books.heatedPlantersBook.amount.value,.1).add(1),description:"Tillamook Burn Country",enabled:()=>i.gt(de.books.heatedPlantersBook.amount.value,0)}))]),v=ae(()=>[F(()=>({multiplier:2,description:"6 Elves Trained",enabled:Me.earned})),F(()=>({multiplier:()=>i.times(de.books.fertilizerBook.amount.value,.1).add(1),description:"The Garden Tree's Handbook",enabled:()=>i.gt(de.books.fertilizerBook.amount.value,0)}))]),_=ae(()=>[F(()=>({multiplier:2,description:"6 Elves Trained",enabled:Me.earned})),F(()=>({multiplier:()=>i.times(de.books.smallFireBook.amount.value,.1).add(1),description:"Firestarter",enabled:()=>i.gt(de.books.smallFireBook.amount.value,0)}))]),g=ae(()=>[F(()=>({multiplier:2,description:"6 Elves Trained",enabled:Me.earned})),F(()=>({multiplier:()=>i.times(de.books.bonfireBook.amount.value,.1).add(1),description:"An Arsonist's Guide to Writer's Homes in New England",enabled:()=>i.gt(de.books.bonfireBook.amount.value,0)}))]),w=ae(()=>[F(()=>({multiplier:2,description:"6 Elves Trained",enabled:Me.earned})),F(()=>({multiplier:()=>i.times(de.books.kilnBook.amount.value,.1).add(1),description:"Little Fires Everywhere",enabled:()=>i.gt(de.books.kilnBook.amount.value,0)}))]),[S,I]=Tn(()=>[{title:"Holly Auto-Buy Frequency",modifier:r,base:10,unit:"/s",visible:ce.cuttersElf.bought},{title:"Ivy Auto-Buy Frequency",modifier:c,base:10,unit:"/s",visible:ce.plantersElf.bought},{title:"Hope Auto-Buy Frequency",modifier:m,base:10,unit:"/s",visible:ce.expandersElf.bought},{title:"Jack Auto-Buy Frequency",modifier:d,base:10,unit:"/s",visible:ce.heatedCuttersElf.bought},{title:"Mary Auto-Buy Frequency",modifier:y,base:10,unit:"/s",visible:ce.heatedPlantersElf.bought},{title:"Noel Auto-Buy Frequency",modifier:v,base:10,unit:"/s",visible:ce.fertilizerElf.bought},{title:"Joy Auto-Buy Frequency",modifier:_,base:10,unit:"/s",visible:ce.smallFireElf.bought},{title:"Faith Auto-Buy Frequency",modifier:g,base:10,unit:"/s",visible:ce.bonfireElf.bought},{title:"Snowball Auto-Buy Frequency",modifier:w,base:10,unit:"/s",visible:ce.kilnElf.bought}]),se=O(!1),A=x(()=>o(ct,{modelValue:se.value,"onUpdate:modelValue":K=>se.value=K},{header:()=>o("h2",null,[e,p(" Modifiers")]),body:S}));function C(K){var Gt;const ht=N(()=>i.pow(4,te.value).times(1e6)),Ye=_e(0),Lt=K.hasToggle?_e(!1):O(!0),kt=N(()=>K.cooldownModifier.apply(10)),Bt=Qe((Gt=K.canBuy)!=null?Gt:!0);function xt(ot){var Jt;if(D.bought.value&&u(Bt)){Ye.value=i.add(Ye.value,ot);const Pt=i.recip(kt.value);for(;i.gte(Ye.value,Pt);)if(K.customCost==null?u(K.buyable.canPurchase):i.gte(K.buyable.resource.value,K.customCost(K.buyable.amount.value)))K.buyable.amount.value=i.add(K.buyable.amount.value,1),Ye.value=i.sub(Ye.value,Pt),(Jt=K.onAutoPurchase)==null||Jt.call(K);else{Ye.value=Pt;break}}}const D=pe(()=>({...K,buyable:void 0,toggle:Lt,buyProgress:Ye,update:xt,resource:U.coal,cost:ht,computedAutoBuyCooldown:kt,display:()=>({title:K.name,description:x(()=>o(B,null,[K.description,D.bought.value?null:o(B,null,[" ",p("Training this elf will require resetting all your progress from days 1-3.")]),D.bought.value&&K.hasToggle===!0?o(B,null,[o(Ct,{title:K.toggleDesc,"onUpdate:modelValue":ot=>Lt.value=ot,modelValue:Lt.value},null)]):null])),showCost:!D.bought.value}),style:"width: 190px",onPurchase(){var ot;(ot=K.onPurchase)==null||ot.call(K),s.reset()}}));return D}const T=C({name:"Holly",description:"Holly will automatically purchase cutters you can afford, without actually spending any logs.",buyable:ee.row1Buyables[0],cooldownModifier:r}),ge=C({name:"Ivy",description:"Ivy will automatically purchase planters you can afford, without actually spending any logs.",buyable:ee.row1Buyables[1],cooldownModifier:c}),Se=C({name:"Hope",description:"Hope will automatically purchase forest expanders you can afford, without actually spending any logs.",buyable:ee.row1Buyables[2],cooldownModifier:m}),Ve=[T,ge,Se],Ke=C({name:"Jack",description:"Jack will automatically purchase heated cutters you can afford, without actually spending any coal.",buyable:U.heatedCutters,cooldownModifier:d}),Y=C({name:"Mary",description:"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",buyable:U.heatedPlanters,cooldownModifier:y}),We=C({name:"Noel",description:"Noel will automatically purchase fertilized soil you can afford, without actually spending any ash.",buyable:U.moreFertilizer,cooldownModifier:v}),dt=[Ke,Y,We],Re=C({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:U.buildFire,cooldownModifier:_,visibility:()=>q(it.upgrades.logsUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased small fires",onAutoPurchase(){Re.toggle.value&&this.buyable.canPurchase&&(U.activeFires.value=i.add(U.activeFires.value,1))},onPurchase(){z.days[4].recentlyUpdated.value=!0}}),ve=C({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:U.buildBonfire,cooldownModifier:g,visibility:()=>q(it.upgrades.ashUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased bonfires",onAutoPurchase(){ve.toggle.value&&this.buyable.canPurchase&&(U.activeBonfires.value=i.add(U.activeBonfires.value,1),U.buildFire.amount.value=i.sub(U.buildFire.amount.value,u(this.buyable.cost)),U.activeFires.value=i.sub(U.activeFires.value,u(this.buyable.cost)))},onPurchase(){z.days[4].recentlyUpdated.value=!0},canBuy:U.unlockBonfire.bought}),Je=C({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:U.buildKiln,cooldownModifier:w,visibility:()=>q(it.upgrades.coalUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased kilns",onAutoPurchase(){Je.toggle.value&&this.buyable.canPurchase&&(U.activeKilns.value=i.add(U.activeKilns.value,1))},onPurchase(){z.days[4].recentlyUpdated.value=!0},canBuy:U.unlockKiln.bought}),mt=[Re,ve,Je],ce={cuttersElf:T,plantersElf:ge,expandersElf:Se,heatedCuttersElf:Ke,heatedPlantersElf:Y,fertilizerElf:We,smallFireElf:Re,bonfireElf:ve,kilnElf:Je},te=N(()=>Object.values(ce).filter(K=>K.bought.value).length),Z=Ge(()=>({display:{requirement:"1 Elf Trained",effectDisplay:"Manual cutting and planting can happen twice as often for each trained elf"},shouldEarn:()=>i.gte(te.value,1)})),Xe=Ge(()=>({display:{requirement:"2 Elves Trained",effectDisplay:"Research I & II aren't reset after training"},shouldEarn:()=>i.gte(te.value,2),visibility:()=>q(Z.earned.value)})),we=Ge(()=>({display:{requirement:"3 Elves Trained",effectDisplay:"Coal gain is raised to the 1.25"},shouldEarn:()=>i.gte(te.value,3),visibility:()=>q(Xe.earned.value)})),nt=Ge(()=>({display:{requirement:"4 Elves Trained",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>i.gte(te.value,4),visibility:()=>q(we.earned.value)})),Oe=Ge(()=>({display:{requirement:"5 Elves Trained",effectDisplay:"Forest is twice as large"},shouldEarn:()=>i.gte(te.value,5),visibility:()=>q(nt.earned.value)})),Me=Ge(()=>({display:{requirement:"6 Elves Trained",effectDisplay:"Elves work twice as fast"},shouldEarn:()=>i.gte(te.value,6),visibility:()=>q(Oe.earned.value)})),et=Ge(()=>({display:{requirement:"7 Elves Trained",effectDisplay:"Workshop Foundation starts at 100% complete after training"},shouldEarn:()=>i.gte(te.value,7),visibility:()=>q(Me.earned.value&&z.day.value>5)})),Ae=Ge(()=>({display:{requirement:"8 Elves Trained",effectDisplay:"Forest is twice as large (again)"},shouldEarn:()=>i.gte(te.value,8),visibility:()=>q(et.earned.value)})),pt=Ge(()=>({display:{requirement:"9 Elves Trained",effectDisplay:"Trees upgrades aren't reset after training"},shouldEarn:()=>i.gte(te.value,9),visibility:()=>q(Ae.earned.value)})),me=[Z,Xe,we,nt,Oe,Me,et,Ae,pt],Le={manualMilestone:Z,researchMilestone:Xe,coalGainMilestone:we,logGainMilestone:nt,forestMilestone:Oe,elvesMilestone:Me,foundationMilestone:et,forestMilestone2:Ae,treeUpgradesMilestone:pt},{collapseMilestones:Vt,display:ft}=Xl(Le);return xe.on("update",K=>{i.lt(z.day.value,ln)||Object.values(ce).forEach(ht=>ht.update(K))}),at(()=>{z.day.value===ln&&i.gte(te.value,6)&&i.gte(U.coal.value,1e9)&&z.completeDay()}),{name:e,color:t,elves:ce,totalElves:te,milestones:me,collapseMilestones:Vt,generalTabCollapsed:I,minWidth:700,display:x(()=>o(B,null,[o("div",null,[z.day.value===ln?`Reach ${j(6)} trained elves and ${j(1e9)} ${U.coal.displayName} to complete the day`:`${e} Complete!`," ",p("-")," ",o("button",{class:"button",style:"display: inline-block;",onClick:()=>se.value=!0},[p("Check Modifiers")])]),he(a),he(A),o(fe,null,null),o("div",{style:"width: 600px"},[Fe(...Ve),Fe(...dt),Fe(...mt)]),ft()]))}}),ko="metal",_l=7,wn=It(ko,function(){const e="Metal",t="#888B8D",n=ut(0,"metal ingots",void 0,!0),l=hl(n),a=ut(0,"ore"),s=hl(a),r=ae(()=>[F(()=>({multiplier:5,description:"Crucible",enabled:ve.bought})),F(()=>({multiplier:2,description:"Industrial Furnace",enabled:mt.bought})),F(()=>({multiplier:()=>i.add(we.value,1),description:"Hotter Forges",enabled:()=>i.gte(Xe.amount.value,1)}))]),c=N(()=>r.apply(.1)),m=ae(()=>[le(()=>({addend:()=>i.times(te.amount.value,10),description:"Industrial Crucibles",enabled:()=>i.gte(te.amount.value,1)}))]),d=N(()=>m.apply(0)),y=1e10,v=N(()=>i.min(a.value,i.div(U.coal.value,y)).floor().max(0)),_=ye(()=>({display:x(()=>{const me=i.gte(v.value,1)?v.value:i.add(v.value,1);return o(B,null,[o("span",{style:"font-size: large"},[p("Smelt "),Ce(i.times(v.value,c.value)),p(" "),n.displayName]),o("br",null,null),o("span",{style:"font-size: large"},[p("Cost: "),Ee(me),p(" "),a.displayName,p("; "),Ee(i.times(me,y)),p(" "),U.coal.displayName])])}),canClick:()=>i.gte(v.value,1),onClick(){!u(this.canClick)||g(v.value)},style:{width:"600px",minHeight:"unset"}}));function g(me){let[Le,Vt,ft]=[i.times(me,c.value),me,i.times(me,y)];n.value=i.add(n.value,Le),a.value=i.sub(a.value,Vt),U.coal.value=i.sub(U.coal.value,ft)}const w=ae(()=>[le(()=>({addend:()=>ce.amount.value,description:"Mining Drills",enabled:()=>i.gte(ce.amount.value,1)}))]),S=N(()=>w.apply(1)),I=ae(()=>[F(()=>({multiplier:2,description:"A Simple Pickaxe",enabled:dt.bought})),F(()=>({multiplier:2,description:"Double Pickaxe",enabled:Re.bought})),F(()=>({multiplier:2.5,description:"Mining Drills",enabled:()=>i.gte(ce.amount.value,1)}))]),se=N(()=>I.apply(1)),A=_e(0),C=10,T=en(()=>({width:400,height:25,direction:oe.Right,fillStyle:{backgroundColor:t},progress:()=>i.div(A.value,C)})),ge=ae(()=>[le(()=>({addend:d,enabled:Z})),F(()=>({multiplier:c}))]),Se=N(()=>ge.apply(0)),Ve=ae(()=>[le(()=>({addend:S})),F(()=>({multiplier:se})),F(()=>({multiplier:i.reciprocate(C)}))]),Ke=N(()=>Ve.apply(0)),Y=ae(()=>[le(()=>({addend:Ke})),le(()=>({addend:()=>i.negate(d.value),enabled:Z}))]),We=N(()=>Y.apply(0)),dt=pe(()=>({resource:W(n),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"}})),Re=pe(()=>({resource:W(n),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:()=>q(Re.bought.value)})),ve=pe(()=>({resource:W(n),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:()=>q(ve.bought.value||i.div(s.value,c.value).plus(l.value).gte(1))})),Je=pe(()=>({resource:W(n),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:()=>q(i.gte(ce.amount.value,1)&&(Je.bought.value||i.lt(U.computedCoalGain.value,i.times(S.value,se.value).div(C).times(y)))),onPurchase(){z.days[2].recentlyUpdated.value=!0}})),mt=pe(()=>({canAfford(){return i.gte(n.value,50)&&i.gte(U.coal.value,1e11)},onPurchase(){n.value=i.sub(n.value,50),U.coal.value=i.sub(U.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 ${n.displayName}<br/>${Ce(1e11)} ${U.coal.displayName}`}})),ce=He(()=>({resource:W(n),cost(){return i.pow(1.15,this.amount.value).times(10)},display:{title:"Mining Drill",description:"An automated machine to help you mine more ore, faster",effectDisplay:x(()=>o(B,null,[p("Mine 2.5x faster. Increase ore mining amount by "),Ee(ce.amount.value),p(" ore per operation")]))},visibility:()=>q(i.gte(ce.amount.value,1)||i.div(s.value,c.value).plus(l.value).gte(10)),style:{width:"200px"}})),te=He(()=>({resource:W(n),cost(){return i.pow(1.15,i.times(this.amount.value,10)).times(10)},display:{title:"Industrial Crucible",description:"A giant automated crucible furnace, letting you smelt ore better and faster",effectDisplay:x(()=>o(B,null,[p("Get 50% more metal per ore, and smelt "),Ee(i.times(te.amount.value,10)),p(" ore per second")]))},visibility:()=>q(i.gte(te.amount.value,1)||i.gte(ce.amount.value,4)||i.gte(s.value,50)),style:{width:"200px"}})),Z=_e(!0),Xe=He(()=>({resource:U.coal,cost(){return i.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:x(()=>o(B,null,[p("Gain "),Ee(i.times(we.value,100)),p("% more metal per ore")]))},visibility:()=>q(i.gte(Xe.amount.value,1)||mt.bought.value),style:{width:"200px"}})),we=N(()=>i.times(Xe.amount.value,.25));xe.on("update",me=>{A.value=i.times(me,se.value).plus(A.value);const Le=A.value.div(C).trunc();A.value=A.value.minus(Le.times(C)),a.value=i.add(a.value,i.times(Le,S.value)),Z.value&&i.gte(v.value,i.times(te.amount.value,10).times(me))&&g(i.min(v.value,i.times(te.amount.value,10).times(me)))});const[nt,Oe]=Tn(()=>[{title:"Automatic Smelting",modifier:m,base:0,visible(){return i.gt(te.amount.value,0)}},{title:"Metal per Ore",modifier:r,base:.1},{title:"Ore per Mining Operation",modifier:w,base:1},{title:"Mining Speed",modifier:I,base:1}]),Me=O(!1),et=x(()=>o(ct,{modelValue:Me.value,"onUpdate:modelValue":me=>Me.value=me},{header:()=>o("h2",null,[e,p(" Modifiers")]),body:nt})),{total:Ae,trackerDisplay:pt}=hn({resource:n,goal:5e4,name:e,day:_l,color:t,modal:{show:Me,display:et}});return{name:e,day:_l,color:t,ore:a,bestOre:s,oreProgress:A,metal:n,bestMetal:l,totalMetal:Ae,simplePickaxe:dt,doublePickaxe:Re,crucible:ve,coalDrill:Je,industrialFurnace:mt,oreDrill:ce,industrialCrucible:te,autoSmeltEnabled:Z,hotterForge:Xe,generalTabCollapsed:Oe,minWidth:700,display:x(()=>o(B,null,[he(pt),o(fe,null,null),o(Nt,{resource:n,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:x(()=>o(B,null,[{[-1]:o(B,null,[Ce(Se.value),p("/s")]),0:void 0,1:o(B,null,[p("+"),Ce(Se.value),p("/s")])}[i.compare(Se.value,0)],i.lt(Ke.value,d.value)?o(B,null,[p(" (Limited by "),a.displayName,p(")")]):i.lt(v.value,i.floor(a.value))?o(B,null,[p(" (Limited by "),U.coal.displayName,p(")")]):void 0]))},null),o(fe,null,null),he(_),i.gte(te.amount.value,1)?o("div",{style:{width:"150px"}},[o(Ct,{title:"Auto Smelt",modelValue:Z.value,"onUpdate:modelValue":me=>Z.value=me},null)]):void 0,o(fe,null,null),o(Nt,{resource:a,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:x(()=>o(B,null,[{[-1]:o(B,null,[Ce(We.value),p("/s")]),0:void 0,1:o(B,null,[p("+"),Ce(We.value),p("/s")])}[i.compare(We.value,0)]]))},null),o(fe,null,null),o("div",null,[p("Currently mining "),Ce(S.value),p(" ore every "),Ce(i.div(C,se.value)),p(" seconds")]),he(T),o(fe,null,null),Fe(dt,Re,ve,Je,mt),Fe(ce,te,Xe)]))}}),Co="coal",wl=3,U=It(Co,function(){const e="Coal",t="#151716",n="#B2BeB5",l="var(--foreground)",a=ut(0,"coal"),s=ut(0,"ash"),r=_e(0),c=N(()=>i.times(r.value,1e3)),m=N(()=>i.times(r.value,.1)),d=N(()=>i.times(r.value,50)),y=He(()=>({resource:ee.logs,cost(){let E=i.times(T.amount.value,u(T.cost)).plus(this.amount.value);return i.gte(E,100)&&(E=i.pow(E,2).div(100)),i.gte(E,1e4)&&(E=i.pow(E,2).div(1e4)),E=i.pow(.95,de.books.smallFireBook.amount.value).times(E),E.pow(1.5).times(1e4)},display:x(()=>o(B,null,[o("h3",null,[p("Small Fire")]),o("br",null,null),p("Burn 1000 logs for 0.1 coal and 50 ash"),o("br",null,null),o("br",null,null),p("Currently:"),o("br",null,null),p("-"),ne(c.value),p(" logs/sec"),o("br",null,null),p("+"),ne(m.value),p(" coal/sec"),o("br",null,null),p("+"),ne(d.value),p(" ash/sec"),o("br",null,null),o("br",null,null),p("Cost: "),j(u(y.cost)),p(" "),y.resource.displayName])),onPurchase(){r.value=i.add(r.value,1)},style:{color:l,width:"160px"},visibility:()=>q(Le.bought.value)})),v=ye(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.gt(r.value,0)},onClick(){r.value=0}})),_=ye(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.gt(r.value,0)},onClick(){r.value=i.sub(r.value,1)}})),g=ye(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.lt(r.value,y.amount.value)},onClick(){r.value=i.add(r.value,1)}})),w=ye(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.lt(r.value,y.amount.value)},onClick(){r.value=y.amount.value}})),S=ut(y.amount,"small fires"),I=_e(0),se=N(()=>i.times(I.value,1e4)),A=N(()=>i.times(I.value,10)),C=N(()=>i.times(I.value,1e3)),T=He(()=>({resource:S,cost(){return i.pow(.95,de.books.bonfireBook.amount.value).times(10)},display:x(()=>o(B,null,[o("h3",null,[p("Bonfire")]),o("br",null,null),p("Burn 10,000 logs for 10 coal and 1000 ash"),o("br",null,null),o("br",null,null),p("Currently:"),o("br",null,null),p("-"),ne(se.value),p(" logs/sec"),o("br",null,null),p("+"),ne(A.value),p(" coal/sec"),o("br",null,null),p("+"),ne(C.value),p(" ash/sec"),o("br",null,null),o("br",null,null),p("Cost: "),j(u(T.cost)),p(" "),T.resource.displayName])),onPurchase(E){r.value=i.sub(r.value,E).max(0),I.value=i.add(I.value,1)},style:{color:l,width:"160px"}})),ge=ye(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.gt(I.value,0)},onClick(){I.value=0}})),Se=ye(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.gt(I.value,0)},onClick(){I.value=i.sub(I.value,1)}})),Ve=ye(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.lt(I.value,T.amount.value)},onClick(){I.value=i.add(I.value,1)}})),Ke=ye(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.lt(I.value,T.amount.value)},onClick(){I.value=T.amount.value}})),Y=_e(0),We=N(()=>i.times(Y.value,1e6)),dt=N(()=>i.times(Y.value,1e4)),Re=N(()=>i.times(Y.value,1e4)),ve=He(()=>({resource:ee.logs,cost(){let E=this.amount.value;return i.gte(E,100)&&(E=i.pow(E,2).div(100)),i.gte(E,1e4)&&(E=i.pow(E,2).div(1e4)),E=i.pow(.95,de.books.kilnBook.amount.value).times(E),i.pow(1.1,E).times(1e7)},display:x(()=>o(B,null,[o("h3",null,[p("Charcoal Kiln")]),o("br",null,null),p("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),o("br",null,null),o("br",null,null),p("Currently:"),o("br",null,null),p("-"),ne(We.value),p(" logs/sec"),o("br",null,null),p("+"),ne(dt.value),p(" coal/sec"),o("br",null,null),p("+"),ne(Re.value),p(" ash/sec"),o("br",null,null),o("br",null,null),p("Cost: "),j(u(ve.cost)),p(" "),ve.resource.displayName])),onPurchase(){Y.value=i.add(Y.value,1)},style:{color:l,width:"160px"},visibility:()=>q(Ye.bought.value)})),Je=ye(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.gt(Y.value,0)},onClick(){Y.value=0}})),mt=ye(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.gt(Y.value,0)},onClick(){Y.value=i.sub(Y.value,1)}})),ce=ye(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.lt(Y.value,ve.amount.value)},onClick(){Y.value=i.add(Y.value,1)}})),te=ye(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.lt(Y.value,ve.amount.value)},onClick(){Y.value=ve.amount.value}})),Z=_e(0),Xe=N(()=>i.times(Z.value,5e7)),we=He(()=>({resource:wn.metal,cost(){let E=this.amount.value;return i.gte(E,100)&&(E=i.pow(E,2).div(100)),i.gte(E,1e4)&&(E=i.pow(E,2).div(1e4)),i.pow(1.15,E).times(10)},display:x(()=>o(B,null,[o("h3",null,[p("Mining Drill")]),o("br",null,null),p("Dig through the ground to find 50,000,000 coal"),o("br",null,null),o("br",null,null),p("Currently:"),o("br",null,null),p("+"),ne(Xe.value),p(" coal/sec"),o("br",null,null),o("br",null,null),p("Cost: "),j(u(we.cost)),p(" "),we.resource.displayName])),onPurchase(){Z.value=i.add(Z.value,1)},style:{color:l,width:"160px"},visibility:()=>q(wn.coalDrill.bought.value)})),nt=ye(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.gt(Z.value,0)},onClick(){Z.value=0}})),Oe=ye(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.gt(Z.value,0)},onClick(){Z.value=i.sub(Z.value,1)}})),Me=ye(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.lt(Z.value,we.amount.value)},onClick(){Z.value=i.add(Z.value,1)}})),et=ye(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:l},canClick(){return i.lt(Z.value,we.amount.value)},onClick(){Z.value=we.amount.value}})),Ae=pe(()=>({resource:W(a),cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:l}})),pt=pe(()=>({resource:W(a),cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:l}})),me=pe(()=>({resource:W(s),cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:l}})),Le=pe(()=>({resource:S,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){S.value=i.add(S.value,this.cost)},style:{color:l}})),Vt=[Ae,pt,me,Le],ft=pe(()=>({resource:W(a),cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:l},visibility:()=>q(Le.bought.value)})),K=pe(()=>({resource:W(a),cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:l},visibility:()=>q(Le.bought.value)})),ht=pe(()=>({canAfford(){return i.gte(ee.logs.value,1e5)&&i.gte(s.value,1e5)},onPurchase(){ee.logs.value=i.sub(ee.logs.value,1e5),s.value=i.sub(s.value,1e5)},display:x(()=>o(B,null,[o("h3",null,[p("Mulched Soil")]),o("br",null,null),p("Double the bonus from Fertilized Soil"),o("br",null,null),o("br",null,null),p("Cost: "),j(1e5),p(" "),ee.logs.displayName,o("br",null,null),j(1e5),p(" "),s.displayName])),style:{color:l},visibility:()=>q(Le.bought.value)})),Ye=pe(()=>({resource:ee.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:l},visibility:()=>q(Le.bought.value)})),Lt=[ft,K,ht,Ye],kt=He(()=>({resource:W(a),cost(){let E=this.amount.value;return i.gte(E,50)&&(E=i.pow(E,2).div(50)),i.gte(E,200)&&(E=i.pow(E,2).div(200)),i.gte(E,2e6)&&(E=i.pow(E,2).div(2e6)),E=i.pow(.95,de.books.heatedCuttersBook.amount.value).times(E),i.add(E,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:x(()=>o(B,null,[p("Cutters cut down trees "),ne(ot.value),p("x faster")]))},style:{color:l},visibility:()=>q(Ae.bought.value)})),Bt=He(()=>({resource:W(a),cost(){let E=this.amount.value;return i.gte(E,50)&&(E=i.pow(E,2).div(50)),i.gte(E,200)&&(E=i.pow(E,2).div(200)),i.gte(E,2e6)&&(E=i.pow(E,2).div(2e6)),E=i.pow(.95,de.books.heatedPlantersBook.amount.value).times(E),i.add(E,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:x(()=>o(B,null,[p("Planters plant trees "),ne(Pt.value),p("x faster")]))},style:{color:l},visibility:()=>q(pt.bought.value)})),xt=He(()=>({resource:W(s),cost(){let E=this.amount.value;return i.gte(E,50)&&(E=i.pow(E,2).div(50)),i.gte(E,200)&&(E=i.pow(E,2).div(200)),i.gte(E,2e6)&&(E=i.pow(E,2).div(2e6)),E=i.pow(.95,de.books.fertilizerBook.amount.value).times(E),i.add(E,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:x(()=>o(B,null,[p("Trees give "),ne(ll.value),p("x more logs")]))},style:{color:l},visibility:()=>q(me.bought.value)})),D=[kt,Bt,xt],Gt=ae(()=>[le(()=>({addend(){return i.times(kt.amount.value,.25)},description:"Heated Cutters",enabled(){return i.gt(kt.amount.value,0)}})),F(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:ft.bought}))]),ot=N(()=>Gt.apply(1)),Jt=ae(()=>[le(()=>({addend(){return i.times(Bt.amount.value,.25)},description:"Heated Planters",enabled(){return i.gt(Bt.amount.value,0)}})),F(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:K.bought}))]),Pt=N(()=>Jt.apply(1)),mi=ae(()=>[le(()=>({addend(){return i.times(xt.amount.value,.25)},description:"Fertilized Soil",enabled(){return i.gt(xt.amount.value,0)}})),F(()=>({multiplier:2,description:"Mulched Soil",enabled:ht.bought}))]),ll=N(()=>mi.apply(1)),il=ae(()=>[le(()=>({addend(){return m.value},description:"Small Fires",enabled(){return i.gt(r.value,0)}})),le(()=>({addend(){return A.value},description:"Bonfires",enabled(){return i.gt(I.value,0)}})),le(()=>({addend(){return dt.value},description:"Charcoal Kilns",enabled(){return i.gt(Y.value,0)}})),le(()=>({addend(){return Xe.value},description:"Mining Drills",enabled(){return i.gt(Z.value,0)}})),F(()=>({multiplier:2,description:"Carry coal in boxes",enabled:it.upgrades.coalUpgrade.bought})),F(()=>({multiplier:()=>i.div(it.buyables.coalBoxesBuyable.amount.value,2).add(1),description:"Carry more coal",enabled:it.upgrades.coalUpgrade.bought})),F(()=>({multiplier:()=>i.div(y.amount.value,1e4).add(1),description:"Small Fires Synergy",enabled:Te.elves.smallFireElf.bought})),F(()=>({multiplier:()=>i.div(T.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Te.elves.bonfireElf.bought})),F(()=>({multiplier:()=>i.div(ve.amount.value,100).add(1),description:"Kiln Synergy",enabled:Te.elves.kilnElf.bought})),Yl(()=>({exponent:1.25,description:"3 Elves Trained",enabled:Te.milestones[2].earned,supportLowNumbers:!0}))]),vn=N(()=>il.apply(0)),al=ae(()=>[le(()=>({addend(){return d.value},description:"Small Fires",enabled(){return i.gt(r.value,0)}})),le(()=>({addend(){return C.value},description:"Bonfires",enabled(){return i.gt(I.value,0)}})),le(()=>({addend(){return Re.value},description:"Charcoal Kilns",enabled(){return i.gt(Y.value,0)}})),F(()=>({multiplier:2,description:"Carry ash in boxes",enabled:it.upgrades.ashUpgrade.bought})),F(()=>({multiplier:()=>i.div(it.buyables.ashBoxesBuyable.amount.value,2).add(1),description:"Carry more ash",enabled:it.upgrades.ashUpgrade.bought})),F(()=>({multiplier:()=>i.div(y.amount.value,1e4).add(1),description:"Small Fires Synergy",enabled:Te.elves.smallFireElf.bought})),F(()=>({multiplier:()=>i.div(T.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Te.elves.bonfireElf.bought})),F(()=>({multiplier:()=>i.div(ve.amount.value,100).add(1),description:"Kiln Synergy",enabled:Te.elves.kilnElf.bought}))]),Rn=N(()=>al.apply(0)),sl=ae(()=>[le(()=>({addend(){return i.negate(c.value)},description:"Small Fires",enabled(){return i.gt(r.value,0)}})),le(()=>({addend(){return i.negate(se.value)},description:"Bonfires",enabled(){return i.gt(I.value,0)}})),le(()=>({addend(){return i.negate(We.value)},description:"Charcoal Kilns",enabled(){return i.gt(Y.value,0)}}))]),ol=N(()=>sl.apply(0)),[pi,fi]=Tn(()=>[{title:"Log Consumption",modifier:sl,base:0,visible(){return i.gt(r.value,0)||i.gt(I.value,0)||i.gt(Y.value,0)}},{title:"Coal Gain",modifier:il,base:0,visible(){return i.gt(r.value,0)||i.gt(I.value,0)||i.gt(Y.value,0)}},{title:"Ash Gain",modifier:al,base:0,visible(){return i.gt(r.value,0)||i.gt(I.value,0)||i.gt(Y.value,0)}}]),On=O(!1),hi=x(()=>o(ct,{modelValue:On.value,"onUpdate:modelValue":E=>On.value=E},{header:()=>o("h2",null,[e,p(" Modifiers")]),body:pi}));xe.on("update",E=>{i.lt(z.day.value,wl)||i.times(E,ol.value).negate().gt(ee.logs.value)||(ee.logs.value=i.times(E,ol.value).plus(ee.logs.value),a.value=i.times(E,vn.value).plus(a.value),s.value=i.times(E,Rn.value).plus(s.value))});const{total:gi,trackerDisplay:vi}=hn({resource:a,goal:1e7,name:e,day:wl,color:t,modal:{show:On,display:hi}});return{name:e,color:t,coal:a,totalCoal:gi,computedCoalGain:vn,ash:s,activeFires:r,buildFire:y,activeBonfires:I,buildBonfire:T,activeKilns:Y,buildKiln:ve,activeDrills:Z,buildDrill:we,warmerCutters:Ae,warmerPlanters:pt,basicFertilizer:me,unlockBonfire:Le,dedicatedCutters:ft,dedicatedPlanters:K,betterFertilizer:ht,unlockKiln:Ye,heatedCutters:kt,heatedPlanters:Bt,moreFertilizer:xt,computedHeatedCutterEffect:ot,computedHeatedPlanterEffect:Pt,computedFertilizerEffect:ll,generalTabCollapsed:fi,minWidth:700,display:x(()=>o(B,null,[he(vi),o(fe,null,null),o(Nt,{resource:a,color:t,style:"margin-bottom: 0",effectDisplay:i.gt(vn.value,0)?`+${ne(vn.value)}/s`:void 0},null),o(fe,null,null),o(Nt,{resource:s,color:n,style:"margin-bottom: 0",effectDisplay:i.gt(Rn.value,0)?`+${ne(Rn.value)}/s`:void 0},null),o(fe,null,null),o(jl,null,{default:()=>[o(jt,null,{default:()=>[he(y),o("div",null,[j(i.floor(r.value)),p("/"),j(i.floor(y.amount.value))]),Fe(v,_,g,w)]}),Le.bought.value?o(B,null,[o(fe,null,null),o(jt,null,{default:()=>[he(T),o("div",null,[j(I.value),p("/"),j(T.amount.value)]),Fe(ge,Se,Ve,Ke)]})]):void 0,Ye.bought.value?o(B,null,[o(fe,null,null),o(jt,null,{default:()=>[he(ve),o("div",null,[j(Y.value),p("/"),j(ve.amount.value)]),Fe(Je,mt,ce,te)]})]):void 0,wn.coalDrill.bought.value?o(B,null,[o(fe,null,null),o(jt,null,{default:()=>[he(we),o("div",null,[j(Z.value),p("/"),j(we.amount.value)]),Fe(nt,Oe,Me,et)]})]):void 0]}),o(fe,null,null),Fe(...Vt),Fe(...Lt),Fe(...D)]))}}),No="trees",kl=1,Cl=.1,ee=It(No,function(){const e="Trees",t="#4BDC13",n="green",l=ut(0,"logs"),a=ut(0,"saplings"),s=O(0),r=ae(()=>[le(()=>({addend:()=>i.times(Ve.amount.value,10),description:"Expand Forest",enabled:C.bought})),le(()=>({addend:()=>i.div(tt.foundationProgress.value,2),description:"75% Foundation Completed",enabled:tt.milestones.morePlantsMilestone1.earned})),F(()=>({multiplier:2,description:"5 Elves Trained",enabled:Te.milestones[4].earned})),F(()=>({multiplier:2,description:"8 Elves Trained",enabled:Te.milestones[7].earned}))]),c=ut(N(()=>i.sub(r.apply(10),a.value)),"trees"),m=N(()=>r.apply(10)),d=pe(()=>({resource:W(l),cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),y=pe(()=>({resource:W(l),cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),v=pe(()=>({resource:W(l),cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),_=pe(()=>({resource:W(l),cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),g=pe(()=>({resource:W(l),cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),w=[d,y,v,_,g],S=pe(()=>({resource:W(l),cost:50,visibility:()=>q(g.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),I=pe(()=>({resource:W(l),cost:50,visibility:()=>q(g.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),se=pe(()=>({resource:W(l),cost:150,visibility:()=>q(g.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),A=pe(()=>({resource:W(l),cost:150,visibility:()=>q(g.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),C=pe(()=>({resource:W(l),cost:300,visibility:()=>q(g.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),T=[S,I,se,A,C],ge=He(()=>({resource:W(l),cost(){let D=this.amount.value;return i.gte(D,50)&&(D=i.pow(D,2).div(50)),i.gte(D,200)&&(D=i.pow(D,2).div(200)),i.gte(D,2e6)&&(D=i.pow(D,2).div(2e6)),D=i.pow(.95,de.books.cuttersBook.amount.value).times(D),i.times(100,D).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>q(C.bought.value)})),Se=He(()=>({resource:W(l),cost(){let D=this.amount.value;return i.gte(D,50)&&(D=i.pow(D,2).div(50)),i.gte(D,200)&&(D=i.pow(D,2).div(200)),i.gte(D,2e6)&&(D=i.pow(D,2).div(2e6)),D=i.pow(.95,de.books.plantersBook.amount.value).times(D),i.times(100,D).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>q(C.bought.value)})),Ve=He(()=>({resource:W(l),cost(){let D=this.amount.value;return i.gte(D,100)&&(D=i.pow(D,2).div(100)),i.gte(D,1e5)&&(D=i.pow(D,2).div(1e5)),D=i.pow(.95,de.books.expandersBook.amount.value).times(D),i.pow(i.add(D,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>q(C.bought.value)})),Ke=[ge,Se,Ve],Y=ae(()=>[le(()=>({addend:1,description:"Wooden Fingers",enabled:d.bought})),le(()=>({addend:Je,description:"Smart Knives",enabled:se.bought}))]),We=N(()=>Y.apply(1)),dt=ae(()=>[F(()=>({multiplier:.5,description:"Sharper Fingers",enabled:S.bought})),F(()=>({multiplier:()=>i.pow(.5,Te.totalElves.value),description:"1 Elf Trained",enabled:Te.milestones[0].earned}))]),Re=N(()=>dt.apply(1)),ve=ae(()=>[le(()=>({addend:1,description:"Automated Knives",enabled:v.bought})),le(()=>({addend:ge.amount,description:"Generic Cutters",enabled:C.bought})),le(()=>({addend:()=>i.div(tt.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:tt.milestones.autoCutMilestone1.earned})),F(()=>({multiplier:2,description:"30% Foundation Completed",enabled:tt.milestones.autoCutMilestone2.earned})),F(()=>({multiplier:2,description:"Warmer Cutters",enabled:U.warmerCutters.bought})),F(()=>({multiplier:U.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>i.gt(U.heatedCutters.amount.value,0)}))]),Je=N(()=>ve.apply(0)),mt=ae(()=>[le(()=>({addend:1,description:"Leafy Fingers",enabled:y.bought})),le(()=>({addend:we,description:"Smart Spades",enabled:A.bought}))]),ce=N(()=>mt.apply(1)),te=ae(()=>[F(()=>({multiplier:.5,description:"Greener Fingers",enabled:I.bought})),F(()=>({multiplier:()=>i.pow(.5,Te.totalElves.value),description:"1 Elf Trained",enabled:Te.milestones[0].earned}))]),Z=N(()=>te.apply(1)),Xe=ae(()=>[le(()=>({addend:1,description:"Automated Spade",enabled:_.bought})),le(()=>({addend:()=>i.div(Se.amount.value,2),description:"Generic Planters",enabled:C.bought})),le(()=>({addend:()=>i.div(tt.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:tt.milestones.autoPlantMilestone1.earned})),F(()=>({multiplier:2,description:"40% Foundation Completed",enabled:tt.milestones.autoPlantMilestone2.earned})),F(()=>({multiplier:2,description:"Warmer Planters",enabled:U.warmerPlanters.bought})),F(()=>({multiplier:U.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>i.gt(U.heatedPlanters.amount.value,0)}))]),we=N(()=>Xe.apply(0)),nt=ae(()=>[F(()=>({multiplier:1.25,description:"Research I",enabled:g.bought})),F(()=>({multiplier:1.25,description:"Research II",enabled:C.bought})),F(()=>({multiplier:()=>i.div(tt.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:tt.milestones.logGainMilestone1.earned})),F(()=>({multiplier:2,description:"50% Foundation Completed",enabled:tt.milestones.logGainMilestone2.earned})),F(()=>({multiplier:1.25,description:"Ashy Soil",enabled:U.basicFertilizer.bought})),F(()=>({multiplier:U.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>i.gt(U.moreFertilizer.amount.value,0)})),F(()=>({multiplier:2,description:"4 Elves Trained",enabled:Te.milestones[3].earned})),F(()=>({multiplier:2,description:"Carry logs in boxes",enabled:it.upgrades.logsUpgrade.bought})),F(()=>({multiplier:()=>i.div(it.buyables.logBoxesBuyable.amount.value,2).add(1),description:"Carry more logs",enabled:it.upgrades.logsUpgrade.bought})),Yl(()=>({exponent:1.2,description:"100% Foundation Completed",enabled:tt.milestones.logGainMilestone3.earned}))]),Oe=_e(0),Me=en(()=>({direction:oe.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>i.div(Oe.value,Re.value)})),et=ye(()=>({display:{title:"Cut trees",description:x(()=>o(B,null,[p("Cut down up to "),j(i.floor(We.value))," ",p("tree"),i.eq(We.value,1)?"":"s",p(" at once!"),o("br",null,null),he(Me)]))},style:{minHeight:"80px"},canClick:()=>i.gte(c.value,1)&&i.gte(Oe.value,Re.value),onClick(){if(i.lt(Oe.value,Re.value))return;const D=i.floor(i.min(c.value,i.times(We.value,i.div(Oe.value,Re.value).floor())));l.value=i.add(l.value,i.times(nt.apply(1),D)),a.value=i.add(a.value,D),Oe.value=0}})),Ae=_e(0),pt=en(()=>({direction:oe.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>i.div(Ae.value,Z.value)})),me=ye(()=>({display:{title:"Plant trees",description:x(()=>o(B,null,[p("Plant up to "),j(i.floor(ce.value))," ",p("tree"),i.eq(ce.value,1)?"":"s",p(" at once!"),o("br",null,null),he(pt)]))},style:{minHeight:"80px"},canClick:()=>i.gte(a.value,1)&&i.gte(Ae.value,Z.value),onClick(){if(i.lt(Ae.value,Z.value))return;const D=i.floor(i.min(a.value,i.times(ce.value,i.div(Ae.value,Z.value).floor())));a.value=i.sub(a.value,D),Ae.value=0}})),[Le,Vt]=Tn(()=>[{title:"Logs per Tree",modifier:nt,base:1,visible:g.bought},{title:"Manual Cutting Amount",modifier:Y,base:1,visible:d.bought,unit:"/click"},{title:"Manual Cutting Cooldown",modifier:dt,base:1,visible:d.bought,unit:"s"},{title:"Manual Planting Amount",modifier:mt,base:1,visible:y.bought,unit:"/click"},{title:"Manual Planting Cooldown",modifier:te,base:1,visible:y.bought,unit:"s"},{title:"Auto Cutting Amount",modifier:ve,base:0,visible:v.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:Xe,base:0,visible:_.bought,unit:"/s"},{title:"Forest Size",modifier:r,base:10,visible:C.bought}]),ft=O(!1),K=x(()=>o(ct,{modelValue:ft.value,"onUpdate:modelValue":D=>ft.value=D},{header:()=>o("h2",null,[e,p(" Modifiers")]),body:Le}));xe.on("update",D=>{if(i.lt(z.day.value,kl))return;i.gte(Oe.value,Re.value)?Oe.value=Re.value:(Oe.value=i.add(Oe.value,D),et.isHolding.value&&et.onClick()),i.gte(Ae.value,Z.value)?Ae.value=Z.value:(Ae.value=i.add(Ae.value,D),me.isHolding.value&&me.onClick());const Gt=i.min(c.value,i.times(Je.value,D)),ot=i.mul(nt.apply(1),Gt),Jt=i.div(ot,D);s.value=i.mul(Jt,Cl).add(i.mul(s.value,i.dOne.sub(Cl))),l.value=i.add(l.value,ot),a.value=i.add(a.value,Gt);const Pt=i.min(a.value,i.times(we.value,D));a.value=i.sub(a.value,Pt)});const ht=N(()=>i.sub(Je.value,we.value)),Ye=N(()=>i.sub(we.value,Je.value)),Lt=Ln(()=>({key:"c",description:'Press the "Cut trees" button.',onPress:()=>{et.canClick.value&&et.onClick()}})),kt=Ln(()=>({key:"p",description:'Press the "Plant trees" button.',onPress:()=>{me.canClick.value&&me.onClick()}})),{total:Bt,trackerDisplay:xt}=hn({resource:l,goal:1e4,name:e,day:kl,color:n,modal:{show:ft,display:K}});return{name:e,color:t,logs:l,totalLogs:Bt,trees:c,saplings:a,cutTree:et,plantTree:me,cutTreeHK:Lt,plantTreeHK:kt,row1Upgrades:w,row2Upgrades:T,row1Buyables:Ke,manualCutProgress:Oe,manualPlantProgress:Ae,generalTabCollapsed:Vt,minWidth:700,display:x(()=>o(B,null,[he(xt),o(fe,null,null),o(Nt,{resource:l,color:t,style:"margin-bottom: 0",productionDisplay:i.gt(Je.value,0)?`+${ne(s.value)}/s average<br/>equilibrium: +${Tl([[i.mul(nt.apply(1),Je.value),"cutting speed"],[i.mul(nt.apply(1),we.value),"planting speed"],[i.mul(nt.apply(1),i.mul(m.value,20)),"forest cap"]],"/s")}`:void 0},null),o(Nt,{resource:a,color:n,style:"margin-bottom: 0",productionDisplay:{[-1]:`${j(ht.value)}/s`,0:void 0,1:`+${j(ht.value)}/s`}[i.compare(ht.value,0)]},null),o(Nt,{resource:c,color:n,style:"margin-bottom: 0",productionDisplay:{[-1]:`${j(Ye.value)}/s`,0:void 0,1:`+${j(Ye.value)}/s`}[i.compare(Ye.value,0)]},null),o(fe,null,null),Fe(et,me),o("div",null,[p("Tip: You can hold down on actions to perform them automatically")]),o(fe,null,null),Fe(...w),Fe(...T),Fe(...Ke)]))}});var ti="./assets/tree.35808197.png",ni="./assets/sws.714ad454.png",li="data:image/png;base64,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",ii="./assets/elf.9fbfa563.png",ai="./assets/paperStacks.4c96ec8c.png",si="data:image/png;base64,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",So="./assets/metal.7407f5d1.png";const z=It("main",function(){const e=_e(1),t=N(()=>(+new Date(new Date().getFullYear(),11,e.value)-V.time)/1e3),n=O(!1),l=O(-1),a=O(""),s=O();function r(d){const y=_e(!1),v=_e(!1);return lt(()=>{const _=d(),g=Qe(_.shouldNotify),w=Qe(()=>u(g)||u(v));return{..._,opened:y,shouldNotify:w,recentlyUpdated:v,[Ut]:bs,[qt]:function(){const{day:S,layer:I,symbol:se,opened:A,shouldNotify:C,story:T,completedStory:ge,recentlyUpdated:Se}=this;return{day:S,symbol:se,opened:A,recentlyUpdated:Se,shouldNotify:C,onOpenLore(){var Y,We;const Ve=z.day.value>S;l.value=Ve?S-1:-1;const Ke=u((We=(Y=Ze[I!=null?I:"trees"])==null?void 0:Y.name)!=null?We:"");a.value=Ve?`${Ke} - Completed!`:Ke,s.value=Ve?`${T}<hr style="
margin: 10px 0;"/>${ge}`:T,n.value=!0},onOpenLayer(){if(Se.value=!1,window.matchMedia("(min-width: 1468px)").matches)if(V.tabs.includes(I!=null?I:"trees")){const Ve=V.tabs.lastIndexOf(I!=null?I:"trees");V.tabs.splice(Ve,1)}else V.tabs.push(I!=null?I:"trees"),z.minimized.value=!0;else V.tabs.splice(1,1/0,I!=null?I:"trees")},onUnlockLayer(){A.value=!0,setTimeout(()=>{var Ve,Ke;l.value=-1,a.value=u((Ke=(Ve=Ze[I!=null?I:"trees"])==null?void 0:Ve.name)!=null?Ke:""),s.value=T,V.devSpeed=null,n.value=!0},1e3)}}}}})}const c=[r(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:ti,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!"})),r(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:ni,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!"})),r(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:li,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!"})),r(()=>({day:4,shouldNotify:!1,layer:"elves",symbol:ii,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!"})),r(()=>({day:5,shouldNotify:!1,layer:"paper",symbol:ai,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!"})),r(()=>({day:6,shouldNotify:!1,layer:"boxes",symbol:si,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!"})),r(()=>({day:7,shouldNotify:!1,layer:"metal",symbol:So,story:"",completedStory:""})),r(()=>({day:8,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:9,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:10,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:11,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:12,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""}))];function m(){l.value=e.value-1,a.value="Day Complete!",s.value=c[e.value-1].completedStory,n.value=!0,e.value++,z.minimized.value=!1,V.devSpeed=0}return{name:"Calendar",days:c,day:e,timeUntilNewDay:t,loreScene:l,loreTitle:a,loreBody:s,showLoreModal:n,completeDay:m,minWidth:700,display:x(()=>o(B,null,[V.devSpeed===0?o("div",null,[p("Game Paused")]):null,V.devSpeed&&V.devSpeed!==1?o("div",null,[p("Dev Speed: "),ne(V.devSpeed),p("x")]):null,V.offlineTime?o("div",null,[p("Offline Time: "),xn(V.offlineTime)]):null,o(fe,null,null),o("div",{class:"advent"},[c.reduce((d,y)=>(d[d.length-1].length===4&&d.push([]),d[d.length-1].push(y),d),[[]]).map(d=>Fe(...d))])]))}}),Mo=e=>[z,ee,tt,U,Te,de,it,wn],el=N(()=>!1);function Ao(e,t){t.offlineProd=!1}var Io=Object.freeze(Object.defineProperty({__proto__:null,main:z,getInitialLayers:Mo,hasWon:el,fixOldSave:Ao},Symbol.toStringTag,{value:"Module"}));const Eo={class:"scene"},Bo=["src"],xo=["src"],Po=["src"],Fo=["src"],To={key:4,class:"scene-bubble",style:{left:"50%",bottom:"38%"}},Do=["src"],$o=["src"],Ro=Q({__name:"Scene",props:{day:null},setup(e){return(t,n)=>(b(),M("div",Eo,[e.day>=0?(b(),M("img",{key:0,src:u(ti),class:"scene-item",style:{left:"10%",bottom:"10%"}},null,8,Bo)):P("",!0),e.day>=1?(b(),M("img",{key:1,src:u(ni),class:"scene-item",style:{left:"40%",bottom:"12%"}},null,8,xo)):P("",!0),e.day>=2?(b(),M("img",{key:2,src:u(li),class:"scene-item",style:{left:"65%",bottom:"12%",width:"40px",height:"40px"}},null,8,Po)):P("",!0),e.day>=3?(b(),M("img",{key:3,src:u(ii),class:"scene-item",style:{left:"52%",bottom:"12%"}},null,8,Fo)):P("",!0),e.day>=4?(b(),M("div",To,[e.day>=4?(b(),M("img",{key:0,src:u(ai),class:"scene-item"},null,8,Do)):P("",!0),e.day>=5?(b(),M("img",{key:1,src:u(si),class:"scene-item"},null,8,$o)):P("",!0)])):P("",!0)]))}});var Oo=ue(Ro,[["__scopeId","data-v-36663c1c"]]);const Uo=Q({components:{Context:Rl},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:R(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:R(Number,String),required:!0},name:{type:R(String),required:!0},color:R(String),minimizable:R(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:n,minimized:l,minWidth:a,tab:s}=je(e),r=Mn(t),c=N(()=>re.allowGoBack&&n.value>0&&!l.value);function m(){V.tabs.splice(u(e.index),1)}Kt(()=>y(l.value,u(a.value))),bt([l,ts(a)],([v,_])=>y(v,_));function d(v){e.nodes.value=v}function y(v,_){const g=typeof _=="number"||Number.isNaN(parseInt(_))?_+"px":_,w=s.value();w!=null&&(v?(w.style.flexGrow="0",w.style.flexShrink="0",w.style.width="60px",w.style.minWidth=w.style.flexBasis="",w.style.margin="0"):(w.style.flexGrow="",w.style.flexShrink="",w.style.width="",w.style.minWidth=w.style.flexBasis=g,w.style.margin=""))}return{component:r,showGoBack:c,updateNodes:d,unref:u,goBack:m}}});function qo(e,t,n,l,a,s){const r=Rt("Context");return b(),M("div",{class:"layer-container",style:$e({"--layer-color":e.unref(e.color)})},[e.showGoBack?(b(),M("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):P("",!0),e.minimized.value?(b(),M("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.minimized.value=!1)},[f("div",null,J(e.unref(e.name)),1)])):(b(),M("div",{key:2,class:Be(["layer-tab",{showGoBack:e.showGoBack}])},[o(r,{onUpdateNodes:e.updateNodes},{default:L(()=>[(b(),G(be(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(b(),M("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.minimized.value=!0)}," \u25BC ")):P("",!0)],4)}var Vo=ue(Uo,[["render",qo],["__scopeId","data-v-0158bec3"]]);const oi=e=>(Mt("data-v-4b4bda40"),e=e(),At(),e),Lo=oi(()=>f("h2",null,"Changelog",-1)),Go=oi(()=>f("details",{open:""},[f("summary",null,[p("v0.0 Initial Commit - "),f("time",null,"2021-09-04")]),p(" This is the first release :D "),f("ul",null,[f("li",{class:"feature"},"Did everything"),f("li",{class:"fix"},"Had some fun"),f("li",{class:"breaking"},"Removed everything"),f("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Ho=Q({__name:"Changelog",setup(e,{expose:t}){const n=O(!1);return t({open(){n.value=!0}}),(l,a)=>(b(),G(ct,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=s=>n.value=s)},{header:L(()=>[Lo]),body:L(()=>[Go]),_:1},8,["modelValue"]))}});var Qo=ue(Ho,[["__scopeId","data-v-4b4bda40"]]),zo=Q({props:{element:Object,display:{type:R(Object,String,Function),required:!0},style:R(Object,String,Array),classes:R(Object),direction:R(String),xoffset:R(String),yoffset:R(String),pinned:Object},setup(e){const{element:t,display:n,pinned:l}=je(e),a=O(!1),s=N(()=>(qe(l)||a.value)&&r.value),r=Ot(n),c=rt(ie(x(()=>{const y=qe(t);return y==null?"":yt(y)})));function m(y){const v=l;y.shiftKey&&v&&(v.value=!v.value,y.stopPropagation(),y.preventDefault())}const d=N(()=>qe(l)&&mn[Ne.theme].showPin);return{Direction:oe,isHovered:a,isShown:s,comp:r,elementComp:c,unref:u,togglePinned:m,showPin:d}}});const jo={key:0,class:"material-icons pinned"};function Ko(e,t,n,l,a,s){return b(),M("div",{class:Be(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=r=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=r=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...r)=>e.togglePinned&&e.togglePinned(...r))},[wt(e.$slots,"default",{},void 0,!0),e.elementComp?(b(),G(be(e.elementComp),{key:0})):P("",!0),o(En,{name:"fade"},{default:L(()=>{var r;return[e.isShown?(b(),M("div",{key:0,class:Be(["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:$e([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(r=e.unref(e.style))!=null?r:{}])},[e.showPin?(b(),M("span",jo,"push_pin")):P("",!0),e.comp?(b(),G(be(e.comp),{key:1})):P("",!0)],6)):P("",!0)]}),_:1})],34)}var Pe=ue(zo,[["render",Ko],["__scopeId","data-v-6102fa3a"]]);const Wo={class:"info-modal-header"},Jo=["src","alt"],Xo={class:"info-modal-title"},Yo={key:0},Zo={key:0},er={key:0},tr=f("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),nr=f("br",null,null,-1),lr=f("br",null,null,-1),ir=["href"],ar=f("span",{class:"material-icons info-modal-discord"},"discord",-1),sr=f("div",null,[f("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),p(" The Paper Pilot Community ")])],-1),or=f("div",null,[f("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),p(" The Modding Tree ")])],-1),rr=f("br",null,null,-1);var ur=Q({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:l,logo:a,author:s,discordName:r,discordLink:c,versionNumber:m,versionTitle:d}=re,y=je(n),v=O(!1),_=N(()=>xn(V.timePlayed)),g=N(()=>ie(x(()=>o(B,null,[zl.map(he)]))));t({open(){v.value=!0}});function w(){var S;(S=u(y.changelog))==null||S.open()}return(S,I)=>(b(),G(ct,{modelValue:v.value,"onUpdate:modelValue":I[0]||(I[0]=se=>v.value=se)},{header:L(()=>[f("div",Wo,[u(a)?(b(),M("img",{key:0,class:"info-modal-logo",src:u(a),alt:u(l)},null,8,Jo)):P("",!0),f("div",Xo,[f("h2",null,J(u(l)),1),f("h4",null,[p(" v"+J(u(m)),1),u(d)?(b(),M("span",Yo,": "+J(u(d)),1)):P("",!0)])])])]),body:L(({shown:se})=>[se?(b(),M("div",Zo,[u(s)?(b(),M("div",er,"By "+J(u(s)),1)):P("",!0),tr,nr,f("div",{class:"link",onClick:w},"Changelog"),lr,f("div",null,[u(c)?(b(),M("a",{key:0,href:u(c),class:"info-modal-discord-link",target:"_blank"},[ar,p(" "+J(u(r)),1)],8,ir)):P("",!0)]),sr,or,rr,f("div",null,"Time Played: "+J(u(_)),1),(b(),G(be(u(g))))])):P("",!0)]),_:1},8,["modelValue"]))}});const ri=e=>(Mt("data-v-a03c577c"),e=e(),At(),e),cr=ri(()=>f("div",{class:"header"},[f("h2",null,"Options")],-1)),dr=ri(()=>f("hr",null,null,-1));var mr=Q({__name:"Options",setup(e,{expose:t}){const n=O(!1);t({open(){n.value=!0}});const l=Object.keys(mn).map(g=>({label:Dl(g),value:g})),a=N(()=>ie(x(()=>o(B,null,[Ql.map(he)])))),{showTPS:s,theme:r}=je(Ne),{autosave:c,usingLog:m}=je(V),d=N({get(){return V.devSpeed===0},set(g){V.devSpeed=g?0:null}}),y=x(()=>o("span",null,[p("Autosave"),o(Pe,{display:"Save-specific"},{default:()=>[p("*")]})])),v=x(()=>o("span",null,[p("Pause game"),o(Pe,{display:"Save-specific"},{default:()=>[p("*")]})])),_=x(()=>o("span",null,[p("Use log for progress bar"),o(Pe,{display:"Save-specific"},{default:()=>[p("*")]})]));return(g,w)=>(b(),G(ct,{modelValue:n.value,"onUpdate:modelValue":w[5]||(w[5]=S=>n.value=S)},{header:L(()=>[cr]),body:L(()=>[o(Zn,{title:"Theme",options:u(l),modelValue:u(r),"onUpdate:modelValue":w[0]||(w[0]=S=>De(r)?r.value=S:null)},null,8,["options","modelValue"]),(b(),G(be(u(a)))),o(Ct,{title:"Show TPS",modelValue:u(s),"onUpdate:modelValue":w[1]||(w[1]=S=>De(s)?s.value=S:null)},null,8,["modelValue"]),dr,o(Ct,{title:u(y),modelValue:u(c),"onUpdate:modelValue":w[2]||(w[2]=S=>De(c)?c.value=S:null)},null,8,["title","modelValue"]),u(re).enablePausing?(b(),G(Ct,{key:0,title:u(v),modelValue:u(d),"onUpdate:modelValue":w[3]||(w[3]=S=>De(d)?d.value=S:null)},null,8,["title","modelValue"])):P("",!0),o(Ct,{title:u(_),modelValue:u(m),"onUpdate:modelValue":w[4]||(w[4]=S=>De(m)?m.value=S:null)},null,8,["title","modelValue"])]),_:1},8,["modelValue"]))}});var pr=ue(mr,[["__scopeId","data-v-a03c577c"]]);const fr=["onSubmit"],hr={class:"field"},gr={key:0,class:"field-title"},vr=["placeholder"],yr=Q({__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 n=e,l=Ot(_t(n,"title"),"span"),a=rt(null);An(()=>{var m;(m=a.value)==null||m.focus()});const s=N({get(){return u(n.modelValue)||""},set(m){t("update:modelValue",m)}});function r(){t("submit")}function c(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(m,d)=>(b(),M("form",{onSubmit:on(r,["prevent"])},[f("div",hr,[u(l)?(b(),M("span",gr,[(b(),G(be(u(l))))])):P("",!0),e.textArea?(b(),G(u(Ei),{key:1,modelValue:u(s),"onUpdate:modelValue":d[0]||(d[0]=y=>De(s)?s.value=y:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:c,ref_key:"field",ref:a},null,8,["modelValue","placeholder","maxHeight"])):In((b(),M("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=y=>De(s)?s.value=y:null),placeholder:e.placeholder,class:Be({fullWidth:!e.title}),onBlur:c,ref_key:"field",ref:a},null,42,vr)),[[Ci,u(s)]])])],40,fr))}});var ui=ue(yr,[["__scopeId","data-v-67b44a54"]]);const br={key:0},_r=["onClick","disabled"],wr={key:0},kr=["onClick"],Cr=Q({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const l=je(e),a=O(!1);bt(a,c=>{t("confirmingChanged",c)});function s(){if(u(l.skipConfirm)){t("click");return}a.value&&t("click"),a.value=!a.value}function r(){a.value=!1}return(c,m)=>(b(),M("span",{class:Be(["container",{confirming:a.value}])},[a.value?(b(),M("span",br,"Are you sure?")):P("",!0),f("button",{onClick:on(s,["stop"]),class:"button danger",disabled:e.disabled},[a.value?(b(),M("span",wr,"Yes")):wt(c.$slots,"default",{key:1},void 0,!0)],8,_r),a.value?(b(),M("button",{key:1,class:"button",onClick:on(r,["stop"])},"No",8,kr)):P("",!0)],2))}});var Nr=ue(Cr,[["__scopeId","data-v-2f8ef34c"]]);const Sr=["onClick"],Mr=Q({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=O(!1),l=O(null);function a(){t("click"),l.value&&clearTimeout(l.value),n.value=!1,Kt(()=>{n.value=!0,l.value=setTimeout(()=>n.value=!1,500)})}return(s,r)=>(b(),M("button",{onClick:on(a,["stop"]),class:Be(["feedback",{activated:n.value,left:e.left}])},[wt(s.$slots,"default",{},void 0,!0)],10,Sr))}});var Ar=ue(Mr,[["__scopeId","data-v-01a1b95c"]]);const Et=e=>(Mt("data-v-5285ac49"),e=e(),At(),e),Ir=Et(()=>f("div",{class:"handle material-icons"},"drag_handle",-1)),Er={key:0,class:"actions"},Br=Et(()=>f("span",{class:"material-icons"},"content_paste",-1)),xr=Et(()=>f("span",{class:"material-icons"},"content_copy",-1)),Pr=Et(()=>f("span",{class:"material-icons"},"edit",-1)),Fr=Et(()=>f("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Tr={key:1,class:"actions"},Dr=Et(()=>f("span",{class:"material-icons"},"check",-1)),$r=Et(()=>f("span",{class:"material-icons"},"close",-1)),Rr={key:2,class:"details"},Or={class:"save-version"},Ur=Et(()=>f("br",null,null,-1)),qr={key:0},Vr={key:1},Lr={key:3,class:"details"},Gr={key:4,class:"details error"},Hr=Et(()=>f("br",null,null,-1)),Qr=Q({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:l}=je(n),a=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=O(!1),r=O(!1),c=O("");bt(s,()=>c.value=l.value.name||"");const m=N(()=>l.value&&l.value.id===V.id),d=N(()=>m.value?V.time:l.value&&l.value.time||0),y=Mn(N(()=>{var _,g,w,S;return`Day ${(S=(w=(g=(_=l.value)==null?void 0:_.layers)==null?void 0:g.main)==null?void 0:w.day)!=null?S:1}`}));function v(){t("editName",c.value),s.value=!1}return(_,g)=>(b(),M("div",{class:Be(["save",{active:u(m)}])},[Ir,s.value?(b(),M("div",Tr,[f("button",{onClick:v,class:"button"},[o(Pe,{display:"Save",direction:u(oe).Left,class:"info"},{default:L(()=>[Dr]),_:1},8,["direction"])]),f("button",{onClick:g[5]||(g[5]=w=>s.value=!s.value),class:"button"},[o(Pe,{display:"Cancel",direction:u(oe).Left,class:"info"},{default:L(()=>[$r]),_:1},8,["direction"])])])):(b(),M("div",Er,[u(l).error==null&&!r.value?(b(),G(Ar,{key:0,onClick:g[0]||(g[0]=w=>t("export")),class:"button",left:""},{default:L(()=>[o(Pe,{display:"Export",direction:u(oe).Left,class:"info"},{default:L(()=>[Br]),_:1},8,["direction"])]),_:1})):P("",!0),u(l).error==null&&!r.value?(b(),M("button",{key:1,onClick:g[1]||(g[1]=w=>t("duplicate")),class:"button"},[o(Pe,{display:"Duplicate",direction:u(oe).Left,class:"info"},{default:L(()=>[xr]),_:1},8,["direction"])])):P("",!0),u(l).error==null&&!r.value?(b(),M("button",{key:2,onClick:g[2]||(g[2]=w=>s.value=!s.value),class:"button"},[o(Pe,{display:"Edit Name",direction:u(oe).Left,class:"info"},{default:L(()=>[Pr]),_:1},8,["direction"])])):P("",!0),o(Nr,{disabled:u(m),onClick:g[3]||(g[3]=w=>t("delete")),onConfirmingChanged:g[4]||(g[4]=w=>r.value=w)},{default:L(()=>[o(Pe,{display:"Delete",direction:u(oe).Left,class:"info"},{default:L(()=>[Fr]),_:1},8,["direction"])]),_:1},8,["disabled"])])),u(l).error==null&&!s.value?(b(),M("div",Rr,[f("button",{class:"button open",onClick:g[6]||(g[6]=w=>t("open"))},[f("h3",null,J(u(l).name),1)]),f("span",Or,"v"+J(u(l).modVersion),1),Ur,u(d)?(b(),M("div",qr,"Last played "+J(u(a).format(u(d))),1)):P("",!0),u(y)?(b(),M("div",Vr,[(b(),G(be(u(y))))])):P("",!0)])):u(l).error==null&&s.value?(b(),M("div",Lr,[o(ui,{modelValue:c.value,"onUpdate:modelValue":g[7]||(g[7]=w=>c.value=w),class:"editname",onSubmit:v},null,8,["modelValue"])])):(b(),M("div",Gr,[p(" Error: Failed to load save with id "+J(u(l).id),1),Hr,p(J(u(l).error),1)]))],2))}});var zr=ue(Qr,[["__scopeId","data-v-5285ac49"]]);const tl=e=>(Mt("data-v-3b9991aa"),e=e(),At(),e),jr=tl(()=>f("h2",null,"Saves Manager",-1)),Kr={class:"modal-footer"},Wr={class:"field"},Jr=tl(()=>f("span",{class:"field-title"},"Create Save",-1)),Xr={class:"field-buttons"},Yr={class:"footer"},Zr=tl(()=>f("div",{style:{"flex-grow":"1"}},null,-1)),eu=Q({__name:"SavesManager",setup(e,{expose:t}){const n=O(!1),l=O(null);t({open(){n.value=!0}});const a=O(!1),s=O(""),r=O(null);bt(s,A=>{A?Kt(()=>{try{if(A[0]!=="{")if(A[0]==="e")A=decodeURIComponent(escape(atob(A)));else if(A[0]==="\u1BE1")A=Tt.decompressFromUTF16(A);else{console.warn("Unable to determine preset encoding",A),a.value=!0;return}const C=JSON.parse(A);if(typeof C!="object"){a.value=!0;return}const T=_n();C.id=T,vt(C),s.value="",a.value=!1,Ne.saves.push(T)}catch{a.value=!0}}):a.value=!1});let c={},m=O(Object.keys(c).reduce((A,C)=>(A.push({label:C.split("/").slice(-1)[0].slice(0,-4),value:c[C]}),A),[]));const d=Bn({});function y(A){if(d[A]==null){let C=localStorage.getItem(A);if(C==null)d[A]={error:"Save doesn't exist in localStorage",id:A};else if(C==="dW5kZWZpbmVk")d[A]={error:"Save is undefined",id:A};else try{if(C[0]!=="{")if(C[0]==="e")C=decodeURIComponent(escape(atob(C)));else if(C[0]==="\u1BE1")C=Tt.decompressFromUTF16(C);else return console.warn("Unable to determine preset encoding",C),a.value=!0,d[A]={error:"Unable to determine preset encoding",id:A},d[A];d[A]={...JSON.parse(C),id:A}}catch(T){d[A]={error:T,id:A},console.warn(`SavesManager: Failed to load info about save with id ${A}:
${T}
${C}`)}}return d[A]}bt(n,A=>{A&&Object.keys(d).forEach(C=>delete d[C])});const v=N(()=>Ne.saves.reduce((A,C)=>(A[C]=y(C),A),{}));function _(A){let C;switch(V.id===A?C=Ll(V[ke]):C=JSON.stringify(v.value[A]),re.exportEncoding){default:console.warn(`Unknown save encoding: ${re.exportEncoding}. Defaulting to lz`);case"lz":C=Tt.compressToUTF16(C);break;case"base64":C=btoa(unescape(encodeURIComponent(C)));break;case"plain":break}const T=document.createElement("textarea");T.value=C,document.body.appendChild(T),T.select(),T.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(T)}function g(A){V.id===A&&vt();const C={...v.value[A],id:_n()};vt(C),Ne.saves.push(C.id)}function w(A){Ne.saves=Ne.saves.filter(C=>C!==A),localStorage.removeItem(A),d[A]=void 0}function S(A){v.value[V.id].time=V.time,vt(),d[V.id]=void 0,zt(v.value[A]),d[A]=void 0}function I(A){if(r.value=A,Kt(()=>{r.value=null}),A[0]!=="{")if(A[0]==="e")A=decodeURIComponent(escape(atob(A)));else if(A[0]==="\u1BE1")A=Tt.decompressFromUTF16(A);else{console.warn("Unable to determine preset encoding",A);return}const C=JSON.parse(A);C.id=_n(),vt(C),Ne.saves.push(C.id),S(C.id)}function se(A,C){const T=v.value[A];T&&(T.name=C,V.id===A?(V.name=C,vt()):(vt(T),d[A]=void 0))}return(A,C)=>(b(),G(ct,{modelValue:n.value,"onUpdate:modelValue":C[4]||(C[4]=T=>n.value=T),ref_key:"modal",ref:l},{header:L(()=>[jr]),body:L(({shown:T})=>[T?(b(),G(u(Ii),{key:0,list:u(Ne).saves,handle:".handle",itemKey:ge=>ge},{item:L(({element:ge})=>[o(zr,{save:u(v)[ge],onOpen:Se=>S(ge),onExport:Se=>_(ge),onEditName:Se=>se(ge,Se),onDuplicate:Se=>g(ge),onDelete:Se=>w(ge)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):P("",!0)]),footer:L(()=>[f("div",Kr,[o(ui,{modelValue:s.value,"onUpdate:modelValue":C[0]||(C[0]=T=>s.value=T),title:"Import Save",placeholder:"Paste your save here!",class:Be({importingFailed:a.value})},null,8,["modelValue","class"]),f("div",Wr,[Jr,f("div",Xr,[f("button",{class:"button",onClick:C[1]||(C[1]=T=>S(u(Zt)().id))},"New Game"),Object.keys(u(m)).length>0?(b(),G(Zn,{key:0,options:u(m),modelValue:r.value,"onUpdate:modelValue":C[2]||(C[2]=T=>I(T)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):P("",!0)])]),f("div",Yr,[Zr,f("button",{class:"button modal-default-button",onClick:C[3]||(C[3]=T=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var ci=ue(eu,[["__scopeId","data-v-3b9991aa"]]);const st=e=>(Mt("data-v-4a3f8425"),e=e(),At(),e),tu=["src","alt"],nu={key:1,class:"title"},lu=st(()=>f("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),iu={class:"discord"},au={class:"discord-links"},su={key:0},ou=["href"],ru=st(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),uu=st(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),cu={href:"https://forums.moddingtree.com/",target:"_blank"},du=st(()=>f("span",{class:"material-icons"},"forum",-1)),mu=st(()=>f("span",{class:"material-icons"},"info",-1)),pu=st(()=>f("span",{class:"material-icons"},"library_books",-1)),fu=st(()=>f("span",{class:"material-icons"},"settings",-1)),hu=st(()=>f("span",{class:"material-icons"},"library_books",-1)),gu=st(()=>f("span",{class:"material-icons"},"settings",-1)),vu=st(()=>f("span",{class:"material-icons"},"info",-1)),yu={href:"https://forums.moddingtree.com/",target:"_blank"},bu=st(()=>f("span",{class:"material-icons"},"forum",-1)),_u={class:"discord"},wu={class:"discord-links"},ku={key:0},Cu=["href"],Nu=st(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Su=st(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Mu=Q({__name:"Nav",setup(e){const t=O(null),n=O(null),l=O(null),a=O(null),{useHeader:s,banner:r,title:c,discordName:m,discordLink:d,versionNumber:y}=re;function v(){window.open(d,"mywindow")}return(_,g)=>(b(),M(B,null,[u(s)?(b(),M("div",Wt({key:0,class:"nav"},_.$attrs),[u(r)?(b(),M("img",{key:0,src:u(r),class:"banner",alt:u(c)},null,8,tu)):(b(),M("div",nu,J(u(c)),1)),f("div",{onClick:g[0]||(g[0]=w=>{var S;return(S=a.value)==null?void 0:S.open()}),class:"version-container"},[o(Pe,{display:"Changelog",direction:u(oe).Down,class:"version"},{default:L(()=>[f("span",null,"v"+J(u(y)),1)]),_:1},8,["direction"])]),lu,f("div",iu,[f("span",{onClick:v,class:"material-icons"},"discord"),f("ul",au,[u(d)?(b(),M("li",su,[f("a",{href:u(d),target:"_blank"},J(u(m)),9,ou)])):P("",!0),ru,uu])]),f("div",null,[f("a",cu,[o(Pe,{display:"Forums",direction:u(oe).Down,yoffset:"5px"},{default:L(()=>[du]),_:1},8,["direction"])])]),f("div",{onClick:g[1]||(g[1]=w=>{var S;return(S=t.value)==null?void 0:S.open()})},[o(Pe,{display:"Info",direction:u(oe).Down,class:"info"},{default:L(()=>[mu]),_:1},8,["direction"])]),f("div",{onClick:g[2]||(g[2]=w=>{var S;return(S=n.value)==null?void 0:S.open()})},[o(Pe,{display:"Saves",direction:u(oe).Down,xoffset:"-20px"},{default:L(()=>[pu]),_:1},8,["direction"])]),f("div",{onClick:g[3]||(g[3]=w=>{var S;return(S=l.value)==null?void 0:S.open()})},[o(Pe,{display:"Options",direction:u(oe).Down,xoffset:"-66px"},{default:L(()=>[fu]),_:1},8,["direction"])])],16)):(b(),M("div",Wt({key:1,class:"overlay-nav"},_.$attrs),[f("div",{onClick:g[4]||(g[4]=w=>{var S;return(S=a.value)==null?void 0:S.open()}),class:"version-container"},[o(Pe,{display:"Changelog",direction:u(oe).Right,xoffset:"25%",class:"version"},{default:L(()=>[f("span",null,"v"+J(u(y)),1)]),_:1},8,["direction"])]),f("div",{onClick:g[5]||(g[5]=w=>{var S;return(S=n.value)==null?void 0:S.open()})},[o(Pe,{display:"Saves",direction:u(oe).Right},{default:L(()=>[hu]),_:1},8,["direction"])]),f("div",{onClick:g[6]||(g[6]=w=>{var S;return(S=l.value)==null?void 0:S.open()})},[o(Pe,{display:"Options",direction:u(oe).Right},{default:L(()=>[gu]),_:1},8,["direction"])]),f("div",{onClick:g[7]||(g[7]=w=>{var S;return(S=t.value)==null?void 0:S.open()})},[o(Pe,{display:"Info",direction:u(oe).Right},{default:L(()=>[vu]),_:1},8,["direction"])]),f("div",null,[f("a",yu,[o(Pe,{display:"Forums",direction:u(oe).Right,xoffset:"7px"},{default:L(()=>[bu]),_:1},8,["direction"])])]),f("div",_u,[f("span",{onClick:v,class:"material-icons"},"discord"),f("ul",wu,[u(d)?(b(),M("li",ku,[f("a",{href:u(d),target:"_blank"},J(u(m)),9,Cu)])):P("",!0),Nu,Su])])],16)),o(ur,{ref_key:"info",ref:t,changelog:a.value},null,8,["changelog"]),o(ci,{ref_key:"savesManager",ref:n},null,512),o(pr,{ref_key:"options",ref:l},null,512),o(Qo,{ref_key:"changelog",ref:a},null,512)],64))}});var di=ue(Mu,[["__scopeId","data-v-4a3f8425"]]);const nl=e=>(Mt("data-v-248e2ebb"),e=e(),At(),e),Au={class:"inner-tab"},Iu={key:1},Eu=nl(()=>f("br",null,null,-1)),Bu=p(" You can help continue the "),xu=nl(()=>f("i",null,"advent",-1)),Pu=p("ure at: "),Fu=nl(()=>f("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),p(" The Paper Pilot Community ")],-1)),Tu=Q({__name:"Game",setup(e){const t=_t(V,"tabs"),n=N(()=>Object.keys(Ze)),l=re.useHeader,a=Ot(z.loreBody);function s(r){const{display:c,minimized:m,minWidth:d,name:y,color:v,minimizable:_,nodes:g}=r;return{display:c,minimized:m,minWidth:d,name:y,color:v,minimizable:_,nodes:g}}return(r,c)=>(b(),M("div",{class:Be(["tabs-container",{useHeader:u(l)}])},[(b(!0),M(B,null,Ml(u(t),(m,d)=>{var y,v;return b(),M("div",{key:d,class:Be(["tab",u((y=u(Ze)[m])==null?void 0:y.classes)]),ref_for:!0,ref:`tab-${d}`,style:$e(u((v=u(Ze)[m])==null?void 0:v.style))},[d===0&&!u(l)?(b(),G(di,{key:0})):P("",!0),f("div",Au,[u(n).includes(m)?(b(),G(Vo,Wt({key:0},s(u(Ze)[m]),{index:d,tab:()=>{var _;return(_=r.$refs[`tab-${d}`])==null?void 0:_[0]}}),null,16,["index","tab"])):(b(),G(be(m),{key:1,index:d},null,8,["index"]))])],6)}),128)),o(ct,{modelValue:u(z).showLoreModal.value,"onUpdate:modelValue":c[0]||(c[0]=m=>u(z).showLoreModal.value=m)},{header:L(()=>[f("h2",null,J(u(z).loreTitle.value),1)]),body:L(()=>[u(a)?(b(),G(be(u(a)),{key:0})):P("",!0),u(z).loreScene.value!==-1?(b(),M("div",Iu,[o(Oo,{day:u(z).loreScene.value},null,8,["day"]),Eu,Bu,xu,Pu,Fu])):P("",!0)]),_:1},8,["modelValue"])],2))}});var Du=ue(Tu,[["__scopeId","data-v-248e2ebb"]]);const gn=e=>(Mt("data-v-4a50ce42"),e=e(),At(),e),$u={class:"game-over-modal-header"},Ru=["src","alt"],Ou={class:"game-over-modal-title"},Uu=gn(()=>f("h2",null,"Congratulations!",-1)),qu={key:0},Vu=gn(()=>f("br",null,null,-1)),Lu=gn(()=>f("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Gu=gn(()=>f("br",null,null,-1)),Hu=["href"],Qu=gn(()=>f("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),zu=Q({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:l,discordLink:a,versionNumber:s,versionTitle:r}=re,c=N(()=>xn(V.timePlayed)),m=N(()=>el.value&&!V.keepGoing),d=_t(V,"autosave");function y(){V.keepGoing=!0}function v(){zt(Zt())}return(_,g)=>(b(),G(ct,{"model-value":u(m)},{header:L(()=>[f("div",$u,[u(n)?(b(),M("img",{key:0,class:"game-over-modal-logo",src:u(n),alt:u(t)},null,8,Ru)):P("",!0),f("div",Ou,[Uu,f("h4",null,"You've beaten "+J(u(t))+" v"+J(u(s))+": "+J(u(r)),1)])])]),body:L(({shown:w})=>[w?(b(),M("div",qu,[f("div",null,"It took you "+J(u(c))+" to beat the game.",1),Vu,Lu,Gu,f("div",null,[f("a",{href:u(a),class:"game-over-modal-discord-link"},[Qu,p(" "+J(u(l)),1)],8,Hu)]),o(Ct,{title:"Autosave",modelValue:u(d),"onUpdate:modelValue":g[0]||(g[0]=S=>De(d)?d.value=S:null)},null,8,["modelValue"])])):P("",!0)]),footer:L(()=>[f("div",{class:"game-over-footer"},[f("button",{onClick:y,class:"button"},"Keep Going"),f("button",{onClick:v,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var ju=ue(zu,[["__scopeId","data-v-4a50ce42"]]);const $n=e=>(Mt("data-v-3de07c06"),e=e(),At(),e),Ku=$n(()=>f("div",{class:"nan-modal-header"},[f("h2",null,"NaN value detected!")],-1)),Wu={key:0},Ju=$n(()=>f("br",null,null,-1)),Xu=["href"],Yu=$n(()=>f("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Zu=$n(()=>f("br",null,null,-1)),ec={class:"nan-footer"},tc=Q({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=re,l=_t(V,"autosave"),a=_t(Ie,"hasNaN"),s=O(null),r=N(()=>{var g;return(g=Ie.NaNPath)==null?void 0:g.join(".")}),c=N(()=>{var g;return(g=Ie.NaNPath)==null?void 0:g.slice(-1)[0]}),m=N(()=>Ie.NaNReceiver&&c.value?Ie.NaNReceiver[c.value]:null),d=N({get(){return V.devSpeed===0},set(g){V.devSpeed=g?null:0}});function y(){Ie.NaNReceiver&&c.value&&(Ie.NaNReceiver[c.value]=new i(0),Ie.hasNaN=!1)}function v(){Ie.NaNReceiver&&c.value&&(Ie.NaNReceiver[c.value]=new i(1),Ie.hasNaN=!1)}function _(){Ie.NaNReceiver&&c.value&&(Ie.NaNReceiver[c.value]=new i(NaN),Ie.hasNaN=!1)}return(g,w)=>(b(),M(B,null,[o(ct,Wt({modelValue:u(a),"onUpdate:modelValue":w[4]||(w[4]=S=>De(a)?a.value=S:null)},g.$attrs),{header:L(()=>[Ku]),body:L(()=>[f("div",null,[p(' Attempted to assign "'+J(u(r))+'" to NaN',1),u(m)?(b(),M("span",Wu,J(" ")+"(previously "+J(u(ne)(u(m)))+")",1)):P("",!0),p(". Auto-saving has been "+J(u(l)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Ju,f("div",null,[f("a",{href:u(n),class:"nan-modal-discord-link"},[Yu,p(" "+J(u(t)),1)],8,Xu)]),Zu,o(Ct,{title:"Autosave",modelValue:u(l),"onUpdate:modelValue":w[0]||(w[0]=S=>De(l)?l.value=S:null)},null,8,["modelValue"]),u(re).enablePausing?(b(),G(Ct,{key:0,title:"Pause game",modelValue:u(d),"onUpdate:modelValue":w[1]||(w[1]=S=>De(d)?d.value=S:null)},null,8,["modelValue"])):P("",!0)]),footer:L(()=>[f("div",ec,[f("button",{onClick:w[2]||(w[2]=S=>{var I;return(I=s.value)==null?void 0:I.open()}),class:"button"},"Open Saves Manager"),f("button",{onClick:y,class:"button"},"Set to 0"),f("button",{onClick:v,class:"button"},"Set to 1"),u(m)&&u(i).neq(u(m),0)&&u(i).neq(u(m),1)?(b(),M("button",{key:0,onClick:w[3]||(w[3]=S=>a.value=!1),class:"button"}," Set to previous ")):P("",!0),f("button",{onClick:_,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),o(ci,{ref_key:"savesManager",ref:s},null,512)],64))}});var nc=ue(tc,[["__scopeId","data-v-3de07c06"]]);const lc={key:0,class:"tpsDisplay"},ic={key:0,class:"low"},ac=Q({__name:"TPS",setup(e){const t=N(()=>i.div(Ie.lastTenTicks.length,Ie.lastTenTicks.reduce((s,r)=>s+r,0))),n=O([]);at(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const l=N(()=>n.value.reduce((s,r)=>i.max(s,r),0)),a=N(()=>i.sub(t.value,l.value).gt(1));return(s,r)=>u(t).isNan()?P("",!0):(b(),M("div",lc,[p(" TPS: "+J(u(j)(u(t)))+" ",1),o(En,{name:"fade"},{default:L(()=>[u(a)?(b(),M("span",ic,J(u(j)(u(l))),1)):P("",!0)]),_:1})]))}});var sc=ue(ac,[["__scopeId","data-v-46a3ed5b"]]);var oc=Q({__name:"App",setup(e){const t=re.useHeader,n=N(()=>mn[Ne.theme].variables),l=_t(Ne,"showTPS"),a=N(()=>ie(x(()=>o(B,null,[Ja.map(he)]))));return(s,r)=>(b(),M(B,null,[f("div",{id:"modal-root",style:$e(u(n))},null,4),f("div",{class:Be(["app",{useHeader:u(t)}]),style:$e(u(n))},[u(t)?(b(),G(di,{key:0})):P("",!0),o(Du),u(u(l))?(b(),G(sc,{key:1})):P("",!0),o(ju),o(nc),(b(),G(be(u(a))))],6)],64))}});var rc=ue(oc,[["__scopeId","data-v-7c41425b"]]);function uc(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:l,onRegistered:a,onRegisterError:s}=e;let r,c;const m=async(d=!0)=>{d&&(r==null||r.addEventListener("controlling",y=>{y.isUpdate&&window.location.reload()})),c&&c.waiting&&await xi(c.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){r=new Bi("./sw.js",{scope:"./",type:"classic"}),r.addEventListener("activated",d=>{d.isUpdate||l==null||l()});{const d=()=>{n==null||n()};r.addEventListener("waiting",d),r.addEventListener("externalwaiting",d)}r.register({immediate:t}).then(d=>{c=d,a==null||a(d)}).catch(d=>{s==null||s(d)})}return m}function cc(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:l,onRegistered:a,onRegisterError:s}=e,r=O(!1),c=O(!1);return{updateServiceWorker:uc({immediate:t,onNeedRefresh(){r.value=!0,n==null||n()},onOfflineReady(){c.value=!0,l==null||l()},onRegistered:a,onRegisterError:s}),offlineReady:c,needRefresh:r}}document.title=re.title;window.projInfo=re;if(re.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 Qa();const{globalBus:e}=await Cn(()=>Promise.resolve().then(function(){return Ia}),void 0),{startGameLoop:t}=await Cn(()=>import("./gameLoop.0724b43f.js"),["assets/gameLoop.0724b43f.js","assets/@fontsource.f66d05e7.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"]),n=window.vue=Ni(rc);e.emit("setupVue",n),n.mount("#app"),Kt(()=>{const l=Il(),{updateServiceWorker:a}=cc({onNeedRefresh(){l.info("New content available, click or reload to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){a()}})},onOfflineReady(){l.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(s){s&&setInterval(s.update,60*60*1e3)}})}),t()});export{i as D,Cn as _,Ie as a,re as b,Io as c,xe as g,V as p,Ne as s};