pages/advent/assets/index.5743c89b.js

19 lines
178 KiB
JavaScript

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