pages/advent/assets/index.38969004.js

16 lines
169 KiB
JavaScript

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