Advent-Incremental/assets/index.61135b38.js

19 lines
186 KiB
JavaScript

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