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