mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-24 01:11:49 +00:00
15 lines
137 KiB
JavaScript
15 lines
137 KiB
JavaScript
/* empty css */import"./vue.92681fcb.js";import{Z as S,u as Sn,q as Ht,C as a,b1 as qe,aa as O,aE as _,a0 as M,a1 as m,aK as Ge,G as se,t as T,aC as Kn,w as xe,b2 as Ie,a8 as c,O as R,ao as Bi,I as ae,ay as cn,ar as bt,aG as Yt,A as de,_ as L,b6 as F,b8 as Mn,bs as Di,aq as _t,bu as Lt,bb as dn,T as Oi,a7 as y,j as Ri,l as ue,bv as Un,J as q,$ as E,aH as Xe,aF as Ze,al as sn,aL as dt,aN as ge,z as Je,H as Vi,aJ as Jn,bn as qi,br as Li,be as Ui}from"./@vue.4ce677c2.js";import{i as Gi}from"./is-plain-object.906d88e8.js";import{c as Xn}from"./nanoevents.1080beb7.js";import{L as ut}from"./lz-string.731cedc5.js";import{Y as Hi}from"./vue-next-select.a2bfab1d.js";import{s as ji,u as Zn}from"./vue-toastification.6f567382.js";import{D as zi}from"./vuedraggable.7949458c.js";import{p as Wi}from"./vue-textarea-autosize.35804eaf.js";import{v as Qi,n as Ki}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const Ji=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerpolicy&&(r.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?r.credentials="include":s.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}};Ji();const Xi="modulepreload",Gn={},Zi="./",rn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${Zi}${i}`,i in Gn)return;Gn[i]=!0;const s=i.endsWith(".css"),r=s?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${r}`))return;const o=document.createElement("link");if(o.rel=s?"stylesheet":Xi,s||(o.as="script",o.crossOrigin=""),o.href=i,document.head.appendChild(o),s)return new Promise((u,f)=>{o.addEventListener("load",u),o.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Yi="./projInfo-schema.json",es="Advent Incremental",ts="An incremental game you play a day at a time, leading up to Christmas!",ns="advent-incremental",is="thepaperpilot",ss="",rs="",as="0.2",ls="Initial Commit",os=!0,us=!1,cs=2,ds=!0,fs=null,ms="",hs=["main"],ps=3600,gs=0,vs=!0,ys="base64";var z={$schema:Yi,title:es,description:ts,id:ns,author:is,discordName:ss,discordLink:rs,versionNumber:as,versionTitle:ls,allowGoBack:os,defaultShowSmall:us,defaultDecimalsShown:cs,useHeader:ds,banner:fs,logo:ms,initialTabs:hs,maxTickLength:ps,offlineLimit:gs,enablePausing:vs,exportEncoding:ys};const wn=17,bs=9e15,_s=Math.log10(9e15),ws=1/9e15,Ns=308,ks=-324,Hn=5,Cs=function(){const e=[];for(let n=ks+1;n<=Ns;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),pt=[2,Math.E,3,4,5,6,7,8,9,10],Ss=[[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]],Ms=[[-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 l.fromValue_noAlloc(t)},B=function(e,t,n){return l.fromComponents(e,t,n)},V=function(t,n,i){return l.fromComponents_noNormalize(t,n,i)},at=function(t,n){const i=n+1,s=Math.ceil(Math.log10(Math.abs(t))),r=Math.round(t*Math.pow(10,i-s))*Math.pow(10,s-i);return parseFloat(r.toFixed(Math.max(i-s,0)))},Nn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Is=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 i=e*e;let s=e;return n=n+1/(12*s),s=s*i,n=n+1/(360*s),s=s*i,n=n+1/(1260*s),s=s*i,n=n+1/(1680*s),s=s*i,n=n+1/(1188*s),s=s*i,n=n+691/(360360*s),s=s*i,n=n+7/(1092*s),s=s*i,n=n+3617/(122400*s),Math.exp(n)/t},Yn=.5671432904097838,jn=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Yn;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let s=0;s<100;++s){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n)<t*Math.abs(i))return i;n=i}throw Error(`Iteration failed to converge: ${e.toString()}`)};function zn(e,t=1e-10){let n,i,s,r;if(!Number.isFinite(e.mag)||e===l.dZero)return e;if(e===l.dOne)return h(Yn);l.abs(e),n=l.ln(e);for(let o=0;o<100;++o){if(i=l.exp(-n),s=n.sub(e.mul(i)),r=n.sub(s.div(n.add(1).sub(n.add(2).mul(s).div(l.mul(2,n).add(2))))),l.abs(r.sub(n)).lt(l.abs(r).mul(t)))return r;n=r}throw Error(`Iteration failed to converge: ${e.toString()}`)}const w=class{constructor(e){this.sign=Number.NaN,this.mag=Number.NaN,this.layer=Number.NaN,e instanceof w||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/Cs(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 w().fromComponents(e,t,n)}static fromComponents_noNormalize(e,t,n){return new w().fromComponents_noNormalize(e,t,n)}static fromMantissaExponent(e,t){return new w().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new w().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new w().fromDecimal(e)}static fromNumber(e){return new w().fromNumber(e)}static fromString(e){return new w().fromString(e)}static fromValue(e){return new w().fromValue(e)}static fromValue_noAlloc(e){return e instanceof w?e:new w(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=V(1,0,1)){return h(e).tetrate(t,n)}static iteratedexp(e,t=2,n=V(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=V(1,0,1)){return h(e).pentate(t,n)}static affordGeometricSeries(e,t,n,i){return this.affordGeometricSeries_core(h(e),h(t),h(n),i)}static sumGeometricSeries(e,t,n,i){return this.sumGeometricSeries_core(e,h(t),h(n),i)}static affordArithmeticSeries(e,t,n,i){return this.affordArithmeticSeries_core(h(e),h(t),h(n),h(i))}static sumArithmeticSeries(e,t,n,i){return this.sumArithmeticSeries_core(h(e),h(t),h(n),h(i))}static efficiencyOfPurchase(e,t,n){return this.efficiencyOfPurchase_core(h(e),h(t),h(n))}static randomDecimalForTesting(e){if(Math.random()*20<1)return V(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return V(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let s=Math.pow(10,i);return Math.random()>.9&&(s=Math.trunc(s)),B(t,n,s)}static affordGeometricSeries_core(e,t,n,i){const s=t.mul(n.pow(i));return w.floor(e.div(s).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(w.sub(1,n.pow(e))).div(w.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const r=t.add(i.mul(n)).sub(n.div(2)),o=r.pow(2);return r.neg().add(o.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const s=t.add(i.mul(n));return e.div(2).mul(s.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<ws)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=bs)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<_s&&this.layer>0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){e=e.replace(",","");const t=e.split("^^^");if(t.length===2){const b=parseFloat(t[0]),g=parseFloat(t[1]),N=t[1].split(";");let k=1;if(N.length===2&&(k=parseFloat(N[1]),isFinite(k)||(k=1)),isFinite(b)&&isFinite(g)){const x=w.pentate(b,g,k);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,this}}const n=e.split("^^");if(n.length===2){const b=parseFloat(n[0]),g=parseFloat(n[1]),N=n[1].split(";");let k=1;if(N.length===2&&(k=parseFloat(N[1]),isFinite(k)||(k=1)),isFinite(b)&&isFinite(g)){const x=w.tetrate(b,g,k);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,this}}const i=e.split("^");if(i.length===2){const b=parseFloat(i[0]),g=parseFloat(i[1]);if(isFinite(b)&&isFinite(g)){const N=w.pow(b,g);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,this}}e=e.trim().toLowerCase();let s,r,o=e.split("pt");if(o.length===2){s=10,r=parseFloat(o[0]),o[1]=o[1].replace("(",""),o[1]=o[1].replace(")","");let b=parseFloat(o[1]);if(isFinite(b)||(b=1),isFinite(s)&&isFinite(r)){const g=w.tetrate(s,r,b);return this.sign=g.sign,this.layer=g.layer,this.mag=g.mag,this}}if(o=e.split("p"),o.length===2){s=10,r=parseFloat(o[0]),o[1]=o[1].replace("(",""),o[1]=o[1].replace(")","");let b=parseFloat(o[1]);if(isFinite(b)||(b=1),isFinite(s)&&isFinite(r)){const g=w.tetrate(s,r,b);return this.sign=g.sign,this.layer=g.layer,this.mag=g.mag,this}}const u=e.split("e"),f=u.length-1;if(f===0){const b=parseFloat(e);if(isFinite(b))return this.fromNumber(b)}else if(f===1){const b=parseFloat(e);if(isFinite(b)&&b!==0)return this.fromNumber(b)}const d=e.split("e^");if(d.length===2){this.sign=1,d[0].charAt(0)=="-"&&(this.sign=-1);let b="";for(let g=0;g<d[1].length;++g){const N=d[1].charCodeAt(g);if(N>=43&&N<=57||N===101)b+=d[1].charAt(g);else return this.layer=parseFloat(b),this.mag=parseFloat(d[1].substr(g+1)),this.normalize(),this}}if(f<1)return this.sign=0,this.layer=0,this.mag=0,this;const p=parseFloat(u[0]);if(p===0)return this.sign=0,this.layer=0,this.mag=0,this;let v=parseFloat(u[u.length-1]);if(f>=2){const b=parseFloat(u[u.length-2]);isFinite(b)&&(v*=Math.sign(b),v+=Nn(b))}if(!isFinite(p))this.sign=u[0]==="-"?-1:1,this.layer=f,this.mag=v;else if(f===1)this.sign=Math.sign(p),this.layer=1,this.mag=v+Math.log10(Math.abs(p));else if(this.sign=Math.sign(p),this.layer=f,f===2){const b=w.mul(B(1,2,v),h(p));return this.sign=b.sign,this.layer=b.layer,this.mag=b.mag,this}else this.mag=v;return this.normalize(),this}fromValue(e){return e instanceof w||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:at(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:at(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<=Hn?(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):at(this.m,e)+"e"+at(this.e,e):this.layer===1?at(this.m,e)+"e"+at(this.e,e):this.layer<=Hn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+at(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+at(this.mag,e)}abs(){return V(this.sign===0?0:1,this.layer,this.mag)}neg(){return V(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?w.dZero:this.layer===0?B(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?w.dZero:this.layer===0?B(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?w.dZero:this.layer===0?B(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?w.dZero:this.layer===0?B(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 V(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(w.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return h(n.sign*n.mag+i.sign*i.mag);const s=n.layer*Math.sign(n.mag),r=i.layer*Math.sign(i.mag);if(s-r>=2)return n;if(s===0&&r===-1){if(Math.abs(i.mag-Math.log10(n.mag))>wn)return n;{const o=Math.pow(10,Math.log10(n.mag)-i.mag),u=i.sign+n.sign*o;return B(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}if(s===1&&r===0){if(Math.abs(n.mag-Math.log10(i.mag))>wn)return n;{const o=Math.pow(10,n.mag-Math.log10(i.mag)),u=i.sign+n.sign*o;return B(Math.sign(u),1,Math.log10(i.mag)+Math.log10(Math.abs(u)))}}if(Math.abs(n.mag-i.mag)>wn)return n;{const o=Math.pow(10,n.mag-i.mag),u=i.sign+n.sign*o;return B(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}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 V(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return V(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return h(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return B(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return B(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return B(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const s=B(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(B(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return B(n.sign*i.sign,s.layer+1,s.sign*s.mag)}if(n.layer===2&&i.layer===2){const s=B(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(B(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return B(n.sign*i.sign,s.layer+1,s.sign*s.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?w.dNaN:this.layer===0?B(this.sign,0,1/this.mag):B(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,i=t.mag>0?t.layer:-t.layer;return n>i?1:n<i?-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 i=this.mag,s=n.mag;return this.layer>n.layer&&(s=Nn(s)),this.layer<n.layer&&(i=Nn(i)),Math.abs(i-s)<=t*Math.max(Math.abs(i),Math.abs(s))}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(w.dZero)?w.dZero:this.log10()}absLog10(){return this.sign===0?w.dNaN:this.layer>0?B(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):B(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?w.dNaN:this.layer>0?B(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):B(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?w.dNaN:this.layer===0&&e.layer===0?B(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):w.div(this.log10(),e.log10())}log2(){return this.sign<=0?w.dNaN:this.layer===0?B(this.sign,0,Math.log2(this.mag)):this.layer===1?B(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?B(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):B(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?w.dNaN:this.layer===0?B(this.sign,0,Math.log(this.mag)):this.layer===1?B(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?B(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):B(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,i=t;if(n.sign===0)return i.eq(0)?V(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return V(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const s=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?s.neg():Math.abs(i.toNumber()%2)%2===0?s:w.dNaN:s}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return w.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 B(1,0,t);if(e.sign===0)return w.dOne;e=V(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?B(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?B(-e.sign,e.layer+1,-e.mag):w.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?w.exp(w.mul(this,w.ln(this).sub(1))):w.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(V(1,0,24)))return h(Is(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 i=e,s=12*i,r=1/s,o=t+r;if(o===t||(t=o,i=i*n,s=360*i,r=1/s,o=t-r,o===t))return w.exp(t);t=o,i=i*n,s=1260*i;let u=1/s;return t=t+u,i=i*n,s=1680*i,u=1/s,t=t-u,w.exp(t)}else return this.layer===1?w.exp(w.mul(this,w.ln(this).sub(1))):w.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?w.dOne:this.layer===0&&this.mag<=709.7?h(Math.exp(this.sign*this.mag)):this.layer===0?B(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?B(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):B(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 B(1,2,Math.log10(this.mag)-.3010299956639812);{const e=w.div(V(this.sign,this.layer-1,this.mag),V(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=V(1,0,1)){if(e===1)return w.pow(this,t);if(e===0)return new w(t);if(this.eq(w.dOne))return w.dOne;if(this.eq(-1))return w.pow(this,t);if(e===Number.POSITIVE_INFINITY){const s=this.toNumber();if(s<=1.444667861009766&&s>=.06598803584531254){if(s>1.444667861009099)return new w(Math.E);const r=w.ln(this).neg();return r.lambertw().div(r)}else return s>1.444667861009766?new w(Number.POSITIVE_INFINITY):w.dNaN}if(this.eq(w.dZero)){let s=Math.abs((e+1)%2);return s>1&&(s=2-s),new w(s)}if(e<0)return w.iteratedlog(t,this,-e);t=h(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(w.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let s=0;s<e;++s){const r=t;if(t=this.pow(t),r.eq(t))return t}if(i!=0){const s=this.pow(t);return t.mul(1-i).add(s.mul(i))}return t}i!==0&&(t.eq(w.dOne)?this.gt(10)?t=this.pow(i):(t=h(w.tetrate_critical(this.toNumber(),i)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let s=0;s<e;++s){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return V(t.sign,t.layer+(e-s-1),t.mag);if(s>1e4)return t}return t}iteratedexp(e=2,t=V(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return w.tetrate(e,-t,this);e=h(e);let n=h(this);const i=t;t=Math.trunc(t);const s=i-t;if(n.layer-e.layer>3){const r=Math.min(t,n.layer-e.layer-3);t-=r,n.layer-=r}for(let r=0;r<t;++r){if(n=n.log(e),!isFinite(n.layer)||!isFinite(n.mag))return n.normalize();if(r>1e4)return n}return s>0&&s<1&&(e.eq(10)?n=n.layeradd10(-s):n=n.layeradd(-s,e)),n}slog(e=10){if(e=h(e),e.lte(w.dZero)||e.eq(w.dOne))return w.dNaN;if(e.lt(w.dOne))return this.eq(w.dOne)?w.dZero:this.eq(w.dZero)?w.dNegOne:w.dNaN;if(this.mag<0||this.eq(w.dZero))return w.dNegOne;let t=0,n=h(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(w.dZero))n=w.pow(e,n),t-=1;else{if(n.lte(w.dOne))return h(t+w.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=w.log(n,e)}return h(t)}static slog_critical(e,t){return e>10?t-1:w.critical_section(e,t,Ms)}static tetrate_critical(e,t){return w.critical_section(e,t,Ss)}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 i=0,s=0;for(let u=0;u<pt.length;++u)if(pt[u]==e){i=n[u][Math.floor(t)],s=n[u][Math.ceil(t)];break}else if(pt[u]<e&&pt[u+1]>e){const f=(e-pt[u])/(pt[u+1]-pt[u]);i=n[u][Math.floor(t)]*(1-f)+n[u+1][Math.floor(t)]*f,s=n[u][Math.ceil(t)]*(1-f)+n[u+1][Math.ceil(t)]*f;break}const r=t-Math.floor(t);return i*(1-r)+s*r}layeradd10(e){e=w.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 i=0;i<100;++i){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 i=this.slog(t).toNumber()+e;return i>=0?w.tetrate(t,i):Number.isFinite(i)?i>=-1?w.log(w.tetrate(t,i+1),t):w.log(w.log(w.tetrate(t,i+2),t),t):w.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return h(jn(this.toNumber()));if(this.layer===0)return h(jn(this.sign*this.mag));if(this.layer===1)return zn(this);if(this.layer===2)return zn(this);if(this.layer>=3)return V(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return V(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=V(1,0,1)){t=h(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(w.dOne)?(++e,t=new w(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let s=0;s<e;++s){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(s>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?h(Math.sin(this.sign*this.mag)):V(0,0,0)}cos(){return this.mag<0?w.dOne:this.layer===0?h(Math.cos(this.sign*this.mag)):V(0,0,0)}tan(){return this.mag<0?this:this.layer===0?h(Math.tan(this.sign*this.mag)):V(0,0,0)}asin(){return this.mag<0?this:this.layer===0?h(Math.asin(this.sign*this.mag)):V(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)):V(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 w.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return w.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?V(Number.NaN,Number.NaN,Number.NaN):w.ln(this.add(1).div(h(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(w.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 l=w;l.dZero=V(0,0,0);l.dOne=V(1,0,1);l.dNegOne=V(-1,0,1);l.dTwo=V(1,0,2);l.dTen=V(1,0,10);l.dNaN=V(Number.NaN,Number.NaN,Number.NaN);l.dInf=V(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);l.dNegInf=V(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);l.dNumberMax=B(1,0,Number.MAX_VALUE);l.dNumberMin=B(1,0,Number.MIN_VALUE);const As=new l(1);function Ot(e,t,n=!0){let i=l.log10(e).floor(),s=l.div(e,l.pow(10,i));s.toStringWithDecimalPlaces(t)==="10"&&(s=As,i=i.add(1));const r=i.gte(1e9)?Te(i,Math.max(Math.max(t,3),z.defaultDecimalsShown)):i.gte(1e4)?an(i,0):i.toStringWithDecimalPlaces(0);return n?s.toStringWithDecimalPlaces(t)+"e"+r:"e"+r}function an(e,t){if(e==null)return"NaN";if(e=new l(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function ei(e,t){return e==null?"NaN":(e=new l(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),z.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Ps=new l("eeee1000"),$s=new l("e100000"),Wn=new l("e1000"),ti=new l(1e9),Es=new l(1e6),xs=new l(1e3),Ts=new l(.98),Fs=new l(.001),ni=new l(0);function Te(e,t,n){if(t==null&&(t=z.defaultDecimalsShown),n=n!=null?n:z.defaultShowSmall,e=new l(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Te(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Ps)){const i=e.slog();return i.gte(Es)?"F"+Te(i.floor()):l.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+an(i.floor(),0)}else{if(e.gte($s))return Ot(e,0,!1);if(e.gte(Wn))return Ot(e,0);if(e.gte(ti))return Ot(e,t);if(e.gte(xs))return an(e,0);if(e.gte(Fs)||!n)return ei(e,t);if(e.eq(ni))return 0 .toFixed(t)}return e=si(e),e.lt(Wn)?Ot(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Te(e,t)+"\u207B\xB9"}function $e(e){return e=new l(e),e.sign<0?"-"+$e(e.neg()):e.gte(ti)||e.lte(Ts)&&!e.eq(ni)?Te(e):Te(e,0)}function ii(e){return l.lt(e,0)?"-"+ii(l.neg(e)):l.gt(e,2**51)?Te(l.div(e,31536e3))+"y":(e=new l(e).toNumber(),e<60?Te(e)+"s":e<3600?$e(Math.floor(e/60))+"m "+Te(e%60)+"s":e<86400?$e(Math.floor(e/3600))+"h "+$e(Math.floor(e/60)%60)+"m "+$e(e%60)+"s":e<31536e3?$e(Math.floor(e/84600)%365)+"d "+$e(Math.floor(e/3600)%24)+"h "+$e(Math.floor(e/60)%60)+"m":$e(Math.floor(e/31536e3))+"y "+$e(Math.floor(e/84600)%365)+"d "+$e(Math.floor(e/3600)%24)+"h")}function Bs(e,t,n){e=new l(e);let i=e.toStringWithDecimalPlaces(t);return new l(i).gte(n)&&(i=l.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function Ds(e,t){return Te(e,t,!0)}function si(e){let t=l.log10(e).ceil();const n=l.div(e,l.pow(10,t));return t=t.neg(),e=new l(10).pow(t).times(n),e}var Os=Object.freeze(Object.defineProperty({__proto__:null,default:l,exponentialFormat:Ot,commaFormat:an,regularFormat:ei,format:Te,formatWhole:$e,formatTime:ii,toPlaces:Bs,formatSmall:Ds,invertOOM:si},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:Rs,commaFormat:Vs,regularFormat:qs,format:Y,formatWhole:H,formatTime:fn,toPlaces:Ls,formatSmall:Us,invertOOM:Gs}=Os;window.Decimal=l;window.exponentialFormat=Rs;window.commaFormat=Vs;window.regularFormat=qs;window.format=Y;window.formatWhole=H;window.formatTime=fn;window.toPlaces=Ls;window.formatSmall=Us;window.invertOOM=Gs;function ri(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function kn(e){return typeof e=="function"}var W=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(W||{});const Ut=Symbol("DoNotCache");function $(e,t){const n=e[t];kn(n)&&n.length===0&&!n[Ut]?e[t]=S(n.bind(e)):kn(n)&&(e[t]=n.bind(e),e[t][Ut]=!0)}function _e(e){return kn(e)&&!e[Ut]&&(e=S(e)),e}const ft=Symbol("Component"),mt=Symbol("GatherProps");let Hs=0;function jt(e="feature-"){return e+Hs++}var ce=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(ce||{});function D(e){return e[Ut]=!0,e}function ee(e,t=2){return e?0:t}function pe(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}const gt={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 In=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(In||{}),zt={classic:gt,paper:{...gt,variables:{...gt.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:{...gt,variables:{...gt.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:{...gt,variables:{...gt.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const ne=Symbol("ProxyState"),Ct=Symbol("ProxyPath");function Fe(e,t={}){const n=t;let i=!1;function s(){return i||(Object.assign(n,e(n)),i=!0),n}return new Proxy(n,{get(r,o){return o===ne?s():s()[o]},set(r,o,u){return s()[o]=u,!0},has(r,o){return o===ne?!0:Reflect.has(s(),o)},ownKeys(){return Reflect.ownKeys(s())},getOwnPropertyDescriptor(r,o){return i||(Object.assign(n,e(n)),i=!0),Object.getOwnPropertyDescriptor(r,o)}})}var J=window.state=Sn({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const ai=Ht({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});function li(e){return JSON.stringify(e,(t,n)=>a(n))}const oi={get(e,t){var i;if(t===ne||t===Ct)return e[t];const n=e[ne][t];if(t!=="value"&&(Gi(n)||Array.isArray(n))){if(n!==((i=e[t])==null?void 0:i[ne])){const s=[...e[Ct],t];e[t]=new Proxy({[ne]:n,[Ct]:s},oi)}return e[t]}return n},set(e,t,n,i){if(!J.hasNaN&&(typeof n=="number"&&isNaN(n)||n instanceof l&&(isNaN(n.sign)||isNaN(n.layer)||isNaN(n.mag)))){const s=e[ne][t];if(!(typeof s=="number"&&isNaN(s)||s instanceof l&&(isNaN(s.sign)||isNaN(s.layer)||isNaN(s.mag))))throw ai.autosave=!1,J.hasNaN=!0,J.NaNPath=[...e[Ct],t],J.NaNReceiver=i,console.error("Attempted to set NaN value",[...e[Ct],t],e[ne]),"Attempted to set NaN value. See above for details"}return e[ne][t]=n,!0},ownKeys(e){return Reflect.ownKeys(e[ne])},has(e,t){return Reflect.has(e[ne],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[ne],t)}};var A=window.player=new Proxy({[ne]:ai,[Ct]:["player"]},oi);const ve=Xn();let St=null,Rt=null;function ln(){const e=Date.now();let t=(e-A.time)/1e3;A.time=e;const n=t;if(J.lastTenTicks.push(n),J.lastTenTicks.length>10&&(J.lastTenTicks=J.lastTenTicks.slice(1)),!((Rt==null?void 0:Rt.value)&&!A.keepGoing)&&!J.hasNaN&&(t=Math.max(t,0),A.devSpeed!==0)){if(A.offlineTime!=null){if(l.gt(A.offlineTime,z.offlineLimit*3600)&&(A.offlineTime=z.offlineLimit*3600),l.gt(A.offlineTime,0)&&A.devSpeed!==0){const i=Math.max(A.offlineTime/10,t);A.offlineTime=A.offlineTime-i,t+=i}else A.devSpeed===0&&(A.offlineTime+=t);(!A.offlineProd||l.lt(A.offlineTime,0))&&(A.offlineTime=null)}t=Math.min(t,z.maxTickLength),A.devSpeed!=null&&(t*=A.devSpeed),Number.isFinite(t)||(t=1e308),!l.eq(t,0)&&(A.timePlayed+=t,Number.isFinite(A.timePlayed)||(A.timePlayed=1e308),ve.emit("update",t,n),te.unthrottled?(requestAnimationFrame(ln),St!=null&&(clearInterval(St),St=null)):St==null&&(St=setInterval(ln,50)))}}async function js(){Rt=(await rn(()=>Promise.resolve().then(function(){return ki}),void 0)).hasWon,qe(Rt,e=>{e&&ve.emit("gameWon")}),te.unthrottled?requestAnimationFrame(ln):St=setInterval(ln,50)}document.fonts.onloadingdone=()=>ve.emit("fontsLoaded");var zs=Object.freeze(Object.defineProperty({__proto__:null,globalBus:ve,startGameLoop:js},Symbol.toStringTag,{value:"Module"}));function ui(e={}){return Object.assign({id:`${z.id}-0`,name:"Default Save",tabs:z.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:z.id,modVersion:z.versionNumber,layers:{}},e)}function Oe(e){const t=ut.compressToUTF16(li(e!=null?e:A[ne]));return localStorage.setItem((e!=null?e:A[ne]).id,t),t}async function Ws(){Ks();try{let e=localStorage.getItem(te.active);if(e==null){await vt(Mt());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!==z.id){await vt(Mt());return}t.id=te.active,await vt(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
|
|
`,e),await vt(Mt())}}function Mt(){const e=tn(),t=ui({id:e});return Oe(t),te.saves.push(e),t}function tn(){let e,t=0;do e=`${z.id}-${t++}`;while(localStorage.getItem(e));return e}async function vt(e){console.info("Loading save",e);const{layers:t,removeLayer:n,addLayer:i}=await rn(()=>Promise.resolve().then(function(){return vr}),void 0),{fixOldSave:s,getInitialLayers:r}=await rn(()=>Promise.resolve().then(function(){return ki}),void 0);for(const o in t){const u=t[o];u&&n(u)}r(e).forEach(o=>i(o,e)),e=ui(e),e.offlineProd&&e.time&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=(Date.now()-e.time)/1e3),e.time=Date.now(),e.modVersion!==z.versionNumber&&s(e.modVersion,e),Object.assign(A,e),te.active=A.id,ve.emit("onLoad")}setInterval(()=>{A.autosave&&Oe()},1e3);window.onbeforeunload=()=>{A.autosave&&Oe()};window.save=Oe;const Qs=window.hardReset=async()=>{await vt(Mt())},Gt=Ht({active:"",saves:[],showTPS:!0,theme:In.Nordic,unthrottled:!1});qe(Gt,e=>{const t=ut.compressToUTF16(JSON.stringify(e));localStorage.setItem(z.id,t)},{deep:!0});var te=window.settings=Gt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:In.Nordic};ve.emit("loadSettings",e),Object.assign(Gt,e),Qs()};function Ks(){try{let e=localStorage.getItem(z.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(Gt,t)}ve.emit("loadSettings",Gt)}catch{}}const ci=Ht([]);function Js(e){ci.push(e)}const Xs=Ht([]),Zs=Ht([]),Ys={class:"table"},nn=O({__name:"Column",setup(e){const t=S(()=>zt[te.theme].mergeAdjacent);return(n,i)=>(_(),M("div",Ys,[m("div",{class:se(["col",{mergeAdjacent:a(t)}])},[Ge(n.$slots,"default")],2)]))}}),er={class:"table"},di=O({__name:"Row",setup(e){const t=S(()=>zt[te.theme].mergeAdjacent);return(n,i)=>(_(),M("div",er,[m("div",{class:se(["row",{mergeAdjacent:a(t)}])},[Ge(n.$slots,"default")],2)]))}});function fi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Bi(e)}function j(e,t="span"){return typeof e=="function"?O({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),O({template:e})):O({render:()=>({})}):e}function me(e){if(ht(e))return typeof e=="function"?e():j(e);const t=e[ft];return c(t,e[mt](),null)}function Ve(...e){let t;return c(di,null,fi(t=e.map(me))?t:{default:()=>[t]})}function tr(...e){let t;return c(nn,null,fi(t=e.map(me))?t:{default:()=>[t]})}function He(e){if(ht(e))return typeof e=="function"?e():typeof e=="string"?c(R,null,[e]):c(e,null,null);const t=e[ft];return c(t,e[mt](),null)}function ht(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Ut]===!0}function mi(e,t,n){const i=T(null),s=T(void 0);function r(f){i.value||(i.value=setInterval(u,250)),s.value=f,n&&(n.value=!0)}function o(){i.value&&(clearInterval(i.value),i.value=null),n&&(n.value=!1)}function u(){t&&t.value?t.value():e&&e.value&&e.value(s.value)}return Kn(o),{start:r,stop:o,handleHolding:u}}function hi(e,t="div"){const n=xe();return Ie(()=>{n.value=j(le(e),t)}),n}function At(e,t="div"){const n=xe(null);return Ie(()=>{const i=le(e);n.value=i==null?null:j(i,t)}),n}function nr(e){return S(()=>le(e))}function le(e){return a(a(e))}function P(...e){return e.includes(Object)||e.push(Object),e}const Ee=O({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(_(),M("div",{style:ae({width:e.width,height:e.height})},null,4))}});var Q=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n};const ir=O({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var p;const n=T({}),i=new ResizeObserver(u),s=T(null);cn(()=>{const v=s.value;v!=null&&i.observe(v)});let r=!0,o=T((p=s.value)==null?void 0:p.getBoundingClientRect());function u(){r&&(r=!1,bt(()=>{var v;o.value=(v=s.value)==null?void 0:v.getBoundingClientRect(),Object.values(n.value).filter(b=>b).forEach(b=>b.rect=b.element.getBoundingClientRect()),t("updateNodes",n.value),r=!0}))}ve.on("fontsLoaded",u);const f={attributes:!1,childList:!0,subtree:!1};Yt(An,(v,b)=>{const g=new MutationObserver(()=>d(v));g.observe(b,f),n.value[v]={element:b,observer:g,rect:b.getBoundingClientRect()},u()}),Yt(Pn,v=>{var b;(b=n.value[v])==null||b.observer.disconnect(),n.value[v]=void 0,u()}),Yt($n,n),Yt(En,o);function d(v){const b=n.value[v];b!=null&&(b.rect=b.element.getBoundingClientRect(),t("updateNodes",n.value))}return(v,b)=>(_(),M(R,null,[Ge(v.$slots,"default",{},void 0,!0),m("div",{ref_key:"resizeListener",ref:s,class:"resize-listener"},null,512)],64))}});var pi=Q(ir,[["__scopeId","data-v-2b1dc1bc"]]);const sr=["onPointerdown"],rr={class:"modal-wrapper"},ar={class:"modal-container"},lr={class:"modal-header"},or=y(" default header "),ur={class:"modal-body"},cr=y(" default body "),dr={class:"modal-footer"},fr=m("div",{class:"modal-default-flex-grow"},null,-1),je=O({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const s=de(e),r=S(()=>s.modelValue||u.value);function o(){n("update:modelValue",!1)}const u=T(!1),f=T(null),d=S(()=>{var p,v;return(v=(p=f.value)==null?void 0:p.nodes)!=null?v:null});return t({isOpen:r,nodes:d}),(p,v)=>(_(),L(Oi,{to:"#modal-root"},[c(dn,{name:"modal",onBeforeEnter:v[0]||(v[0]=b=>u.value=!0),onAfterLeave:v[1]||(v[1]=b=>u.value=!1)},{default:F(()=>[Mn(m("div",_t({class:"modal-mask",onPointerdown:Lt(o,["self"])},p.$attrs),[m("div",rr,[m("div",ar,[m("div",lr,[Ge(p.$slots,"header",{shown:a(r)},()=>[or])]),m("div",ur,[c(pi,{ref_key:"contextRef",ref:f},{default:F(()=>[Ge(p.$slots,"body",{shown:a(r)},()=>[cr])]),_:3},512)]),m("div",dr,[Ge(p.$slots,"footer",{shown:a(r)},()=>[m("div",{class:"modal-default-footer"},[fr,m("button",{class:"button modal-default-button",onClick:o}," Close ")])])])])])],16,sr),[[Di,e.modelValue]])]),_:3})]))}}),Cn=Symbol("PersistentState"),on=Symbol("DefaultValue"),un=Symbol("StackTrace"),gi=Symbol("Deleted");function mr(){var e;return((e=new Error().stack)==null?void 0:e.split(`
|
|
`).slice(3,5).map(t=>t.trim()).join(`
|
|
`))||""}function Se(e){const t=ue(e)?e:T(e);return t[Cn]=t,t[on]=ue(e)?e.value:e,t[un]=mr(),t[gi]=!1,Re.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
|
|
Created at:
|
|
`+t[un]):It[Re[Re.length-1]].add(t),t}ve.on("addLayer",(e,t)=>{const n=[],i=(s,r=[])=>{let o=!1;return Object.keys(s).forEach(u=>{const f=s[u];if(f&&typeof f=="object")if(Cn in f){if(o=!0,f[gi]){console.warn("Deleted persistent ref present in returned object. Ignoring...",f,`
|
|
Created at:
|
|
`+f[un]);return}It[e.id].delete(ne in f?f[ne]:f);const d=r.reduce((v,b)=>(b in v||(v[b]={}),v[b]),t),p=d[u];d[u]=f[Cn],Ri(d)?p!=null?d[u]=p:d[u]=f[on]:p!=null?d[u].value=p:d[u].value=f[on]}else!(f instanceof l)&&!ue(f)&&!n.includes(f)&&(typeof f.type=="symbol"&&n.push(f),i(f,[...r,u])&&(Un(f)&&!Un(s)?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.",ne in s?s[ne]:s,u):o=!0))}),o};i(e),It[e.id].forEach(s=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,s,`
|
|
Created at:
|
|
`+s[un])}),It[e.id].clear()});const An=Symbol("RegisterNode"),Pn=Symbol("UnregisterNode"),$n=Symbol("Nodes"),En=Symbol("Bounds"),he=Sn({});window.layers=he;const It={},Re=[];function Wt(e,t){return Fe(()=>{const n={},i=n.emitter=Xn();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=T({}),n.id=e,Re.push(e),It[e]=new Set,n.minimized=Se(!1),Object.assign(n,t.call(n)),Re[Re.length-1]==null||Re[Re.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
|
|
Stack: ${Re}
|
|
Trying to pop ${n.id}`;return Re.pop(),$(n,"color"),$(n,"display"),$(n,"name"),pe(n,"name",n.id),$(n,"minWidth"),pe(n,"minWidth",600),$(n,"minimizable"),pe(n,"minimizable",!0),n})}function vi(e,t){if(console.info("Adding layer",e.id),he[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,he[e.id]);return}pe(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),he[e.id]=e,ve.emit("addLayer",e,t.layers[e.id])}function hr(e){return he[e]}function yi(e){console.info("Removing layer",e.id),ve.emit("removeLayer",e),he[e.id]=void 0}function pr(e){yi(e),vi(e,A)}function gr(e){const t=T(!1);return{openModal:()=>t.value=!0,modal:D(()=>c(je,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>c("h2",null,[a(e.name)]),body:a(e.display)}))}}ve.on("update",function(t){Object.values(he).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(he).forEach(n=>{n==null||n.emit("update",t)}),Object.values(he).forEach(n=>{n==null||n.emit("postUpdate",t)})});var vr=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:An,UnregisterNodeInjectionKey:Pn,NodesInjectionKey:$n,BoundsInjectionKey:En,layers:he,persistentRefs:It,addingLayers:Re,createLayer:Wt,addLayer:vi,getLayer:hr,removeLayer:yi,reloadLayer:pr,setupLayerModal:gr},Symbol.toStringTag,{value:"Module"}));const yr={},br={class:"notif"};function _r(e,t){return _(),M("div",br,"!")}var Qn=Q(yr,[["render",_r],["__scopeId","data-v-66323fd4"]]);const mn=e=>(Xe("data-v-949cc93c"),e=e(),Ze(),e),wr={key:0,class:"day feature dontMerge opened"},Nr={class:"date"},kr=y("Dec"),Cr=mn(()=>m("br",null,null,-1)),Sr={class:"date"},Mr=y("Dec"),Ir=mn(()=>m("br",null,null,-1)),Ar=mn(()=>m("div",{class:"doors"},null,-1)),Pr={class:"date"},$r=y("Dec"),Er=mn(()=>m("br",null,null,-1)),xr={key:0,class:"material-icons lock"},Tr=O({__name:"Day",props:{day:null,symbol:null,opened:null,shouldNotify:null},emits:["openLore","openLayer","unlockLayer"],setup(e,{emit:t}){const n=e,i=S(()=>l.gte(U.day.value,n.day)&&new Date().getMonth()===11&&new Date().getDate()>=n.day);function s(){i.value&&t("unlockLayer")}return(r,o)=>e.opened.value?(_(),M("div",wr,[c(dn,{appear:"",name:"door"},{default:F(()=>[m("div",{class:"doors",onClick:o[0]||(o[0]=u=>t("openLayer"))},[m("div",Nr,[kr,Cr,y(q(e.day),1)]),m("div",Sr,[Mr,Ir,y(q(e.day),1)])])]),_:1}),m("div",{class:"icon",style:ae({backgroundImage:`url(${e.symbol})`})},null,4),m("div",{class:"lore",onClick:o[1]||(o[1]=u=>t("openLore"))},"?"),a(e.shouldNotify)?(_(),L(Qn,{key:0})):E("",!0)])):(_(),M("div",{key:1,class:se(["day feature dontMerge",{can:a(i),locked:!a(i),canOpen:a(i)}]),onClick:s},[Ar,m("div",Pr,[$r,Er,y(q(e.day),1)]),a(i)?E("",!0):(_(),M("div",xr,"lock")),a(i)?(_(),L(Qn,{key:1})):E("",!0)],2))}});var Fr=Q(Tr,[["__scopeId","data-v-949cc93c"]]);const Br={key:0},Dr={key:0,class:"mark star"},Or=["src"],Rr=O({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(_(),M("div",Br,[e.mark===!0?(_(),M("div",Dr)):(_(),M("img",{key:1,class:"mark",src:e.mark},null,8,Or))])):E("",!0)}});var hn=Q(Rr,[["__scopeId","data-v-2207999f"]]);const Vr=O({__name:"Node",props:{id:null},setup(e){const n=de(e),i=sn(An,()=>{}),s=sn(Pn,()=>{}),r=xe(null),o=S(()=>r.value&&r.value.parentElement);return qe([o,n.id],([u,f],[d,p])=>{d&&s(a(p)),u&&i(f,u)}),Kn(()=>s(a(n.id))),(u,f)=>(_(),M("div",{class:"node",ref_key:"node",ref:r},null,512))}});var Qt=Q(Vr,[["__scopeId","data-v-a48cb382"]]),qr=O({props:{display:{type:P(Object,String,Function),required:!0},visibility:{type:P(Number),required:!0},style:P(Object,String,Array),classes:P(Object),onClick:Function,onHold:Function,canClick:{type:P(Boolean),required:!0},small:Boolean,mark:P(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:Qt,MarkNode:hn},setup(e){const{display:t,onClick:n,onHold:i}=de(e),s=xe("");Ie(()=>{const u=le(t);if(u==null){s.value="";return}if(ht(u)){s.value=j(u);return}const f=j(u.title||"","h3"),d=j(u.description,"div");s.value=j(D(()=>c("span",null,[u.title?c("div",null,[c(f,null,null)]):null,c(d,null,null)])))});const{start:r,stop:o}=mi(n,i,e.isHolding);return{start:r,stop:o,comp:s,Visibility:ce,unref:a}}});function Lr(e,t,n,i,s,r){var f;const o=dt("MarkNode"),u=dt("Node");return e.unref(e.visibility)!==e.Visibility.None?(_(),M("button",{key:0,style:ae([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(f=e.unref(e.style))!=null?f:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:se({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)?(_(),L(ge(e.unref(e.comp)),{key:0})):E("",!0),c(o,{mark:e.unref(e.mark)},null,8,["mark"]),c(u,{id:e.id},null,8,["id"])],38)):E("",!0)}var bi=Q(qr,[["render",Lr],["__scopeId","data-v-8cedd7da"]]);const Ur=Symbol("Clickable");function be(e){return Fe(()=>{var n;const t=(n=e==null?void 0:e())!=null?n:{};if(t.id=jt("clickable-"),t.type=Ur,t[ft]=bi,t.isHolding=T(!1),$(t,"visibility"),pe(t,"visibility",ce.Visible),$(t,"canClick"),pe(t,"canClick",!0),$(t,"classes"),$(t,"style"),$(t,"mark"),$(t,"display"),t.onClick){const i=t.onClick.bind(t);t.onClick=function(s){a(t.canClick)&&i(s)}}if(t.onHold){const i=t.onHold.bind(t);t.onHold=function(){a(t.canClick)&&i()}}return t[mt]=function(){const{display:i,visibility:s,style:r,classes:o,onClick:u,onHold:f,isHolding:d,canClick:p,small:v,mark:b,id:g}=this;return{display:i,visibility:s,style:a(r),classes:o,onClick:u,onHold:f,isHolding:d,canClick:p,small:v,mark:b,id:g}},t})}function yt(e,t="points",n=0,i=void 0){const s=ue(e)?e:Se(e);return s.displayName=t,s.precision=n,s.small=i,s}function _i(e){const t=Se(e.value);return qe(e,(n,i)=>{l.gt(n,i)&&(t.value=l.add(t.value,l.sub(n,i)))}),t}new l("10^^8");new l("1e100");function xn(e,t){const n=t!=null?t:e.value;return l.eq(e.precision,0)?H(e.small?n:l.floor(n)):Y(n,e.precision,e.small)}const Gr=["x1","y1","x2","y2"],Hr=O({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=de(e),i=S(()=>{const r=n.startNode.value.rect,o=n.boundingRect.value,u=o?{x:r.x+r.width/2-o.x,y:r.y+r.height/2-o.y}:{x:0,y:0};return n.link.value.offsetStart&&(u.x+=n.link.value.offsetStart.x,u.y+=n.link.value.offsetStart.y),u}),s=S(()=>{const r=n.endNode.value.rect,o=n.boundingRect.value,u=o?{x:r.x+r.width/2-o.x,y:r.y+r.height/2-o.y}:{x:0,y:0};return n.link.value.offsetEnd&&(u.x+=n.link.value.offsetEnd.x,u.y+=n.link.value.offsetEnd.y),u});return(r,o)=>(_(),M("line",_t({"stroke-width":"15px",stroke:"white"},e.link,{x1:a(i).x,y1:a(i).y,x2:a(s).x,y2:a(s).y}),null,16,Gr))}});const jr=O({__name:"Links",props:{links:null},setup(e){var f;const n=Je(e,"links"),i=T(null),s=sn($n,T({})),r=sn(En,T(void 0)),o=T((f=i.value)==null?void 0:f.getBoundingClientRect());qe(r,()=>{var d;return o.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),cn(()=>{var d;return o.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const u=S(()=>{var p,v;const d=s.value;return(v=(p=n.value)==null?void 0:p.filter(b=>{var g,N;return((g=d[b.startNode.id])==null?void 0:g.rect)&&((N=d[b.startNode.id])==null?void 0:N.rect)}))!=null?v:[]});return(d,p)=>(_(),M(R,null,[a(u)?(_(),M("svg",Vi(_t({key:0},d.$attrs)),[(_(!0),M(R,null,Jn(a(u),(v,b)=>(_(),L(Hr,{key:b,link:v,boundingRect:o.value,startNode:a(s)[v.startNode.id],endNode:a(s)[v.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):E("",!0),m("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var zr=Q(jr,[["__scopeId","data-v-063f6d6b"]]);O({props:{nodes:{type:P(Array),required:!0},leftSideNodes:P(Array),rightSideNodes:P(Array),branches:P(Array)},components:{Links:zr},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=de(e),s=xe();Ie(()=>{const u=le(t);s.value=j(D(()=>c(R,null,[u.map(f=>c("span",{class:"row tree-row",style:"margin: 50px auto;"},[f.map(He)]))])))});const r=xe();Ie(()=>{const u=le(n);r.value=u?j(D(()=>c("span",{class:"left-side-nodes small"},[u.map(He)]))):""});const o=xe();return Ie(()=>{const u=le(i);o.value=u?j(D(()=>c("span",{class:"side-nodes small"},[u.map(He)]))):""}),{unref:a,nodesComp:s,leftNodesComp:r,rightNodesComp:o}}});O({props:{display:P(Object,String,Function),visibility:{type:P(Number),required:!0},style:P(String,Object,Array),classes:P(Object),onClick:Function,onHold:Function,color:P(String),glowColor:P(String),canClick:{type:P(Boolean),required:!0},mark:P(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:hn,Node:Qt},setup(e){const{onClick:t,onHold:n,display:i}=de(e),s=At(i),{start:r,stop:o}=mi(t,n);return{start:r,stop:o,comp:s,unref:a,Visibility:ce,isCoercableComponent:ht}}});function wi(e){const t=[],n={};let i=!1;function s(){return i||(t.push(...e()),n.base=t.map(u=>_e(u.base)),n.baseText=t.map(u=>_e(u.baseText)),n.visible=t.map(u=>_e(u.visible)),i=!0),t}const r=Se({});return[D(()=>{const u=s();let f=!0;const d=u.map((p,v)=>{var k,x,ye;if(a(n.visible[v])===!1)return null;const b=c("h3",{onClick:()=>r.value[v]=!r.value[v],style:"cursor: pointer"},[c("span",{class:"modifier-toggle"+(a(r.value[v])?" collapsed":"")},[y("\u25BC")]),p.title,p.subtitle?c("span",{class:"subtitle"},[y(" ("),p.subtitle,y(")")]):null]),g=a(r.value[v])?null:c(R,null,[c("div",{class:"modifier-container"},[c("span",{class:"modifier-amount"},[Y((k=a(n.base[v]))!=null?k:1),p.unit]),c("span",{class:"modifier-description"},[He((x=a(n.baseText[v]))!=null?x:"Base")])]),He(a(p.modifier.description))]),N=!f;return f=!1,c(R,null,[N?c("br",null,null):null,c("div",null,[b,c("br",null,null),g,c("hr",null,null),y("Total: "),Y(p.modifier.apply((ye=a(n.base[v]))!=null?ye:1)),p.unit])])});return c(R,null,[d])}),r]}const Wr=O({props:{progress:{type:P(String,Object,Number),required:!0},width:{type:P(Number),required:!0},height:{type:P(Number),required:!0},direction:{type:P(String),required:!0},display:P(Object,String,Function),visibility:{type:P(Number),required:!0},style:P(Object,String,Array),classes:P(Object),borderStyle:P(Object,String,Array),textStyle:P(Object,String,Array),baseStyle:P(Object,String,Array),fillStyle:P(Object,String,Array),mark:P(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:hn,Node:Qt},setup(e){const{progress:t,width:n,height:i,direction:s,display:r}=de(e),o=S(()=>{let d=t.value instanceof l?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),u=S(()=>{const d={width:le(n)+.5+"px",height:le(i)+.5+"px"};switch(a(s)){case W.Up:d.clipPath=`inset(${o.value}% 0% 0% 0%)`,d.width=le(n)+1+"px";break;case W.Down:d.clipPath=`inset(0% 0% ${o.value}% 0%)`,d.width=le(n)+1+"px";break;case W.Right:d.clipPath=`inset(0% ${o.value}% 0% 0%)`;break;case W.Left:d.clipPath=`inset(0% 0% 0% ${o.value} + '%)`;break;case W.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),f=At(r);return{normalizedProgress:o,barStyle:u,component:f,unref:a,Visibility:ce}}});function Qr(e,t,n,i,s,r){var f,d,p,v,b,g,N;const o=dt("MarkNode"),u=dt("Node");return e.unref(e.visibility)!==e.Visibility.None?(_(),M("div",{key:0,style:ae([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(f=e.unref(e.style))!=null?f:{}]),class:se({bar:!0,...e.unref(e.classes)})},[m("div",{class:"overlayTextContainer border",style:ae([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(_(),M("span",{key:0,class:"overlayText",style:ae(e.unref(e.textStyle))},[(_(),L(ge(e.component)))],4)):E("",!0)],4),m("div",{class:"border",style:ae([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(p=e.unref(e.style))!=null?p:{},(v=e.unref(e.baseStyle))!=null?v:{},(b=e.unref(e.borderStyle))!=null?b:{}])},[m("div",{class:"fill",style:ae([e.barStyle,(g=e.unref(e.style))!=null?g:{},(N=e.unref(e.fillStyle))!=null?N:{}])},null,4)],4),c(o,{mark:e.unref(e.mark)},null,8,["mark"]),c(u,{id:e.id},null,8,["id"])],6)):E("",!0)}var Kr=Q(Wr,[["render",Qr],["__scopeId","data-v-02d0d7b2"]]);const Jr=Symbol("Bar");function Vt(e){return Fe(()=>{const t=e();return t.id=jt("bar-"),t.type=Jr,t[ft]=Kr,$(t,"visibility"),pe(t,"visibility",ce.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[mt]=function(){const{progress:n,width:i,height:s,direction:r,display:o,visibility:u,style:f,classes:d,borderStyle:p,textStyle:v,baseStyle:b,fillStyle:g,mark:N,id:k}=this;return{progress:n,width:i,height:s,direction:r,display:o,visibility:u,style:a(f),classes:d,borderStyle:p,textStyle:v,baseStyle:b,fillStyle:g,mark:N,id:k}},t})}const Xr=Symbol("Buyable");function Ke(e){const t=Se(0);return Fe(()=>{var r,o,u;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=jt("buyable-"),n.type=Xr,n[ft]=bi,n.amount=t,n.amount[on]=(r=n.initialValue)!=null?r:0,n.canAfford=S(()=>{const f=n,d=a(f.cost);return f.resource!=null&&d!=null&&l.gte(f.resource.value,d)}),n.canPurchase==null&&(n.canPurchase=S(()=>a(n.visibility)===ce.Visible&&a(n.canAfford)&&l.lt(n.amount.value,a(n.purchaseLimit)))),n.maxed=S(()=>l.gte(n.amount.value,a(n.purchaseLimit))),$(n,"classes");const i=n.classes;n.classes=S(()=>{const f=a(i)||{};return n.maxed.value&&(f.bought=!0),f}),$(n,"canPurchase"),n.canClick=n.canPurchase,n.onClick=n.purchase=(u=(o=n.onClick)!=null?o:n.purchase)!=null?u:function(){var p;const f=n;if(!a(f.canPurchase))return;const d=a(f.cost);f.cost!=null&&f.resource!=null&&(f.resource.value=l.sub(f.resource.value,d),f.amount.value=l.add(f.amount.value,1)),(p=f.onPurchase)==null||p.call(f,d)},$(n,"display");const s=n.display;return n.display=D(()=>{const f=a(s);if(ht(f)){const d=j(f);return c(d,null,null)}if(f!=null&&n.cost!=null&&n.resource!=null){const d=n,p=j(f.title||"","h3"),v=j(f.description||""),b=j(f.effectDisplay||"");return c("span",null,[f.title?c("div",null,[c(p,null,null)]):null,f.description?c(v,null,null):null,f.showAmount===!1?null:c("div",null,[c("br",null,null),a(d.purchaseLimit)===l.dInf?c(R,null,[y("Amount: "),H(d.amount.value)]):c(R,null,[y("Amount: "),H(d.amount.value),y(" /")," ",H(a(d.purchaseLimit))])]),f.effectDisplay?c("div",null,[c("br",null,null),y("Currently: "),c(b,null,null)]):null,d.cost&&!d.maxed.value?c("div",null,[c("br",null,null),y("Cost: "),Y(a(d.cost)||0)," ",n.resource.displayName]):null])}return""}),$(n,"visibility"),pe(n,"visibility",ce.Visible),$(n,"cost"),$(n,"resource"),$(n,"purchaseLimit"),pe(n,"purchaseLimit",l.dInf),$(n,"style"),$(n,"mark"),$(n,"small"),n[mt]=function(){const{display:f,visibility:d,style:p,classes:v,onClick:b,canClick:g,small:N,mark:k,id:x}=this;return{display:f,visibility:d,style:a(p),classes:v,onClick:b,canClick:g,small:N,mark:k,id:x}},n})}const Zr=O({__name:"Sticky",setup(e){const t=T("0"),n=new ResizeObserver(s),i=xe(null);function s(){let r=i.value;if(r==null)return;let o=0;for(;r.previousSibling;){const u=r.previousSibling;u.dataset&&"vSticky"in u.dataset&&(o+=u.offsetHeight),r=u}t.value=o+"px"}return bt(s),document.fonts.ready.then(s),cn(()=>{var o;const r=(o=i.value)==null?void 0:o.parentElement;r&&n.observe(r)}),(r,o)=>(_(),M("div",{class:"sticky",style:ae({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Ge(r.$slots,"default",{},void 0,!0)],4))}});var Yr=Q(Zr,[["__scopeId","data-v-cccac690"]]);const ea=O({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=S(()=>xn(t.resource));return(i,s)=>(_(),M("h2",{style:ae({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},q(a(n)),5))}});const ta={class:"main-display"},na={key:0},ia={key:1},sa=y(", "),qt=O({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null},setup(e){const n=de(e),i=T(null),s=At(n.effectDisplay),r=S(()=>l.lt(n.resource.value,"1e1000"));return(o,u)=>(_(),L(Yr,null,{default:F(()=>{var f,d,p,v;return[m("div",{class:se(["main-display-container",(f=e.classes)!=null?f:{}]),style:ae([{height:`${((p=(d=i.value)==null?void 0:d.$el.clientHeight)!=null?p:0)+50}px`},(v=e.style)!=null?v:{}])},[m("div",ta,[a(r)?(_(),M("span",na,"You have ")):E("",!0),c(ea,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),y(" "+q(e.resource.displayName),1),a(s)?(_(),M("span",ia,[sa,(_(),L(ge(a(s)),{ref_key:"effectRef",ref:i},null,512))])):E("",!0)])],6)]}),_:1}))}});var ra=O({props:{display:{type:P(String,Object,Function),required:!0},visibility:{type:P(Number),required:!0},style:P(String,Object,Array),classes:P(Object),resource:Object,cost:P(String,Object,Number),canPurchase:{type:P(Boolean),required:!0},bought:{type:P(Boolean),required:!0},mark:P(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Qt,MarkNode:hn},setup(e){const{display:t,cost:n}=de(e),i=xe("");return Ie(()=>{const s=le(t);if(s==null){i.value="";return}if(ht(s)){i.value=j(s);return}const r=le(n),o=j(s.title||"","h3"),u=j(s.description,"div"),f=j(s.effectDisplay||"");i.value=j(D(()=>{var d;return c("span",null,[s.title?c("div",null,[c(o,null,null)]):null,c(u,null,null),s.effectDisplay?c("div",null,[y("Currently: "),c(f,null,null)]):null,e.resource!=null?c(R,null,[c("br",null,null),y("Cost: "),e.resource&&xn(e.resource,r)," ",(d=e.resource)==null?void 0:d.displayName]):null])}))}),{component:i,unref:a,Visibility:ce}}});const aa=["disabled"];function la(e,t,n,i,s,r){var f;const o=dt("MarkNode"),u=dt("Node");return e.unref(e.visibility)!==e.Visibility.None?(_(),M("button",{key:0,style:ae([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(f=e.unref(e.style))!=null?f:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:se({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)?(_(),L(ge(e.unref(e.component)),{key:0})):E("",!0),c(o,{mark:e.unref(e.mark)},null,8,["mark"]),c(u,{id:e.id},null,8,["id"])],14,aa)):E("",!0)}var oa=Q(ra,[["render",la],["__scopeId","data-v-7742f590"]]);const ua=Symbol("Upgrade");function re(e){const t=Se(!1);return Fe(()=>{const n=e();return n.id=jt("upgrade-"),n.type=ua,n[ft]=oa,n.canAfford==null&&(n.resource==null||n.cost==null)&&console.warn("Error: can't create upgrade without a canAfford property or a resource and cost property",n),n.bought=t,n.canAfford==null?n.canAfford=S(()=>{const i=n;return i.resource!=null&&i.cost!=null&&l.gte(i.resource.value,a(i.cost))}):$(n,"canAfford"),n.canPurchase=S(()=>a(n.visibility)===ce.Visible&&a(n.canAfford)&&!a(n.bought)),n.purchase=function(){var s;const i=n;!a(i.canPurchase)||(i.resource!=null&&i.cost!=null&&(i.resource.value=l.sub(i.resource.value,a(i.cost))),t.value=!0,(s=i.onPurchase)==null||s.call(i))},$(n,"visibility"),pe(n,"visibility",ce.Visible),$(n,"classes"),$(n,"style"),$(n,"display"),$(n,"mark"),$(n,"cost"),$(n,"resource"),n[mt]=function(){const{display:i,visibility:s,style:r,classes:o,resource:u,cost:f,canPurchase:d,bought:p,mark:v,id:b,purchase:g}=this;return{display:i,visibility:s,style:a(r),classes:o,resource:u,cost:f,canPurchase:d,bought:p,mark:v,id:b,purchase:g}},n})}function X(e){return Fe(()=>{const{addend:t,description:n,enabled:i}=e(),s=_e(t),r=_e(n),o=i==null?void 0:_e(i);return{apply:u=>l.add(u,a(s)),revert:u=>l.sub(u,a(s)),enabled:o,description:n==null?void 0:D(()=>c("div",{class:"modifier-container"},[c("span",{class:"modifier-amount"},[l.gte(a(s),0)?"+":"",Y(a(s))]),a(r)?c("span",{class:"modifier-description"},[He(a(r))]):null]))}})}function oe(e){return Fe(()=>{const{multiplier:t,description:n,enabled:i}=e(),s=_e(t),r=_e(n),o=i==null?void 0:_e(i);return{apply:u=>l.times(u,a(s)),revert:u=>l.div(u,a(s)),enabled:o,description:n==null?void 0:D(()=>c("div",{class:"modifier-container"},[c("span",{class:"modifier-amount"},[y("x"),Y(a(s))]),a(r)?c("span",{class:"modifier-description"},[He(a(r))]):null]))}})}function ca(e){return Fe(()=>{const{exponent:t,description:n,enabled:i,supportLowNumbers:s}=e(),r=_e(t),o=_e(n),u=i==null?void 0:_e(i);return{apply:f=>{let d=f;return s&&(d=l.add(d,1)),d=l.pow(d,a(r)),s&&(d=l.sub(d,1)),d},revert:f=>{let d=f;return s&&(d=l.add(d,1)),d=l.root(d,a(r)),s&&(d=l.sub(d,1)),d},enabled:u,description:n==null?void 0:D(()=>c("div",{class:"modifier-container"},[c("span",{class:"modifier-amount"},[y("^"),Y(a(r))]),a(o)?c("span",{class:"modifier-description"},[He(a(o)),s?" (+1 effective)":null]):null]))}})}function Ce(e){return Fe(()=>{const t=e();return{apply:n=>t.filter(i=>a(i.enabled)!==!1).reduce((i,s)=>s.apply(i),n),revert:t.every(n=>n.revert!=null)?n=>t.filter(i=>a(i.enabled)!==!1).reduceRight((i,s)=>s.revert(i),n):void 0,enabled:S(()=>t.filter(n=>a(n.enabled)!==!1).length>0),description:D(()=>c(R,null,[t.filter(n=>a(n.enabled)!==!1).map(n=>a(n.description)).filter(n=>n).map(He)]))}})}const da="coal",en=3,Ue=Wt(da,function(){const e="Coal",t="#151716",n="#B2BeB5",i="var(--foreground)",s=yt(0,"coal"),r=_i(s),o=yt(0,"ash"),u=1e6,f=Vt(()=>({direction:W.Right,width:600,height:25,fillStyle:`backgroundColor: ${t}`,progress:()=>l.log10(r.value).div(Math.log10(u)),display:D(()=>c(R,null,[H(r.value),y("/"),H(u)]))})),d=Se(0),p=S(()=>l.times(d.value,1e3)),v=S(()=>l.times(d.value,.1)),b=S(()=>l.times(d.value,50)),g=Ke(()=>({resource:fe.logs,cost(){return l.times(Pe.amount.value,10).plus(this.amount.value).pow(1.5).times(1e4)},display:D(()=>c(R,null,[c("h3",null,[y("Small Fire")]),c("br",null,null),y("Burn 1000 logs for 0.1 coal and 50 ash"),c("br",null,null),c("br",null,null),y("Currently:"),c("br",null,null),y("-"),Y(p.value),y(" logs/sec"),c("br",null,null),y("+"),Y(v.value),y(" coal/sec"),c("br",null,null),y("+"),Y(b.value),y(" ash/sec"),c("br",null,null),c("br",null,null),y("Cost: "),H(a(g.cost)),y(" "),g.resource.displayName])),onPurchase(){d.value=l.add(d.value,1)},style:{color:i,width:"160px"}})),N=be(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.gt(d.value,0)},onClick(){d.value=0}})),k=be(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.gt(d.value,0)},onClick(){d.value=l.sub(d.value,1)}})),x=be(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.lt(d.value,g.amount.value)},onClick(){d.value=l.add(d.value,1)}})),ye=be(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.lt(d.value,g.amount.value)},onClick(){d.value=g.amount.value}})),I=yt(g.amount,"small fires"),C=Se(0),G=S(()=>l.times(C.value,1e4)),we=S(()=>l.times(C.value,10)),Be=S(()=>l.times(C.value,1e3)),Pe=Ke(()=>({resource:I,cost:10,display:D(()=>c(R,null,[c("h3",null,[y("Bonfire")]),c("br",null,null),y("Burn 10,000 logs for 10 coal and 1000 ash"),c("br",null,null),c("br",null,null),y("Currently:"),c("br",null,null),y("-"),Y(G.value),y(" logs/sec"),c("br",null,null),y("+"),Y(we.value),y(" coal/sec"),c("br",null,null),y("+"),Y(Be.value),y(" ash/sec"),c("br",null,null),c("br",null,null),y("Cost: "),H(a(Pe.cost)),y(" "),Pe.resource.displayName])),onPurchase(Le){d.value=l.sub(d.value,Le).max(0),C.value=l.add(C.value,1)},style:{color:i,width:"160px"}})),Jt=be(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.gt(C.value,0)},onClick(){C.value=0}})),gn=be(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.gt(C.value,0)},onClick(){C.value=l.sub(C.value,1)}})),Xt=be(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.lt(C.value,Pe.amount.value)},onClick(){C.value=l.add(C.value,1)}})),Pt=be(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.lt(C.value,Pe.amount.value)},onClick(){C.value=Pe.amount.value}})),K=Se(0),ze=S(()=>l.times(K.value,1e6)),$t=S(()=>l.times(K.value,1e4)),We=S(()=>l.times(K.value,1e4)),De=Ke(()=>({resource:fe.logs,cost(){return l.pow(1.1,this.amount.value).times(1e7)},display:D(()=>c(R,null,[c("h3",null,[y("Charcoal Kiln")]),c("br",null,null),y("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),c("br",null,null),c("br",null,null),y("Currently:"),c("br",null,null),y("-"),Y(ze.value),y(" logs/sec"),c("br",null,null),y("+"),Y($t.value),y(" coal/sec"),c("br",null,null),y("+"),Y(We.value),y(" ash/sec"),c("br",null,null),c("br",null,null),y("Cost: "),H(a(De.cost)),y(" "),De.resource.displayName])),onPurchase(Le){d.value=l.sub(d.value,Le).max(0),K.value=l.add(K.value,1)},style:{color:i,width:"160px"}})),Et=be(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.gt(K.value,0)},onClick(){K.value=0}})),vn=be(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.gt(K.value,0)},onClick(){K.value=l.sub(K.value,1)}})),et=be(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.lt(K.value,De.amount.value)},onClick(){K.value=l.add(K.value,1)}})),Zt=be(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return l.lt(K.value,De.amount.value)},onClick(){K.value=De.amount.value}})),tt=re(()=>({resource:s,cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:i}})),nt=re(()=>({resource:s,cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:i}})),Ne=re(()=>({resource:o,cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:i}})),Qe=re(()=>({resource:I,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){I.value=l.add(I.value,this.cost)},style:{color:i}})),wt=[tt,nt,Ne,Qe],ke=re(()=>({resource:s,cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:i},visibility:()=>ee(Qe.bought.value)})),xt=re(()=>({resource:s,cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:i},visibility:()=>ee(Qe.bought.value)})),it=re(()=>({canAfford(){return l.gte(fe.logs.value,1e5)&&l.gte(o.value,1e5)},onPurchase(){fe.logs.value=l.sub(fe.logs.value,1e5),o.value=l.sub(o.value,1e5)},display:D(()=>c(R,null,[c("h3",null,[y("Mulched Soil")]),c("br",null,null),y("Double the bonus from Fertilized Soil"),c("br",null,null),c("br",null,null),y("Cost: "),H(1e5),y(" "),fe.logs.displayName,c("br",null,null),H(1e5),y(" "),o.displayName])),style:{color:i},visibility:()=>ee(Qe.bought.value)})),Tt=re(()=>({resource:fe.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:i},visibility:()=>ee(Qe.bought.value)})),yn=[ke,xt,it,Tt],st=Ke(()=>({resource:s,cost(){return l.add(this.amount.value,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:D(()=>c(R,null,[y("Cutters cut down trees "),Y(Bt.value),y("x faster")]))},style:{color:i},visibility:()=>ee(tt.bought.value)})),Nt=Ke(()=>({resource:s,cost(){return l.add(this.amount.value,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:D(()=>c(R,null,[y("Planters plant trees "),Y(Dn.value),y("x faster")]))},style:{color:i},visibility:()=>ee(nt.bought.value)})),rt=Ke(()=>({resource:o,cost(){return l.add(this.amount.value,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:D(()=>c(R,null,[y("Trees give "),Y(On.value),y("x more logs")]))},style:{color:i},visibility:()=>ee(Ne.bought.value)})),Ft=[st,Nt,rt],Z=Ce(()=>[X(()=>({addend(){return l.times(st.amount.value,.25)},description:"Heated Cutters",enabled(){return l.gt(st.amount.value,0)}})),oe(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:ke.bought}))]),Bt=S(()=>Z.apply(1)),bn=Ce(()=>[X(()=>({addend(){return l.times(Nt.amount.value,.25)},description:"Heated Planters",enabled(){return l.gt(Nt.amount.value,0)}})),oe(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:xt.bought}))]),Dn=S(()=>bn.apply(1)),Pi=Ce(()=>[X(()=>({addend(){return l.times(rt.amount.value,.25)},description:"Fertilized Soil",enabled(){return l.gt(rt.amount.value,0)}})),oe(()=>({multiplier:2,description:"Mulched Soil",enabled:it.bought}))]),On=S(()=>Pi.apply(1)),Rn=Ce(()=>[X(()=>({addend(){return v.value},description:"Small Fires",enabled(){return l.gt(d.value,0)}})),X(()=>({addend(){return we.value},description:"Bonfires",enabled(){return l.gt(C.value,0)}})),X(()=>({addend(){return $t.value},description:"Charcoal Kilns",enabled(){return l.gt(K.value,0)}}))]),$i=S(()=>Rn.apply(0)),Vn=Ce(()=>[X(()=>({addend(){return b.value},description:"Small Fires",enabled(){return l.gt(d.value,0)}})),X(()=>({addend(){return Be.value},description:"Bonfires",enabled(){return l.gt(C.value,0)}})),X(()=>({addend(){return We.value},description:"Charcoal Kilns",enabled(){return l.gt(K.value,0)}}))]),Ei=S(()=>Vn.apply(0)),qn=Ce(()=>[X(()=>({addend(){return l.negate(p.value)},description:"Small Fires",enabled(){return l.gt(d.value,0)}})),X(()=>({addend(){return l.negate(G.value)},description:"Bonfires",enabled(){return l.gt(C.value,0)}})),X(()=>({addend(){return l.negate(ze.value)},description:"Charcoal Kilns",enabled(){return l.gt(K.value,0)}}))]),Ln=S(()=>qn.apply(0)),[xi,Ti]=wi(()=>[{title:"Log Consumption",modifier:qn,base:0,visible(){return l.gt(d.value,0)||l.gt(C.value,0)||l.gt(K.value,0)}},{title:"Coal Gain",modifier:Rn,base:0,visible(){return l.gt(d.value,0)||l.gt(C.value,0)||l.gt(K.value,0)}},{title:"Ash Gain",modifier:Vn,base:0,visible(){return l.gt(d.value,0)||l.gt(C.value,0)||l.gt(K.value,0)}}]),_n=T(!1),Fi=D(()=>c(je,{modelValue:_n.value,"onUpdate:modelValue":Le=>_n.value=Le},{header:()=>c("h2",null,[e,y(" Modifiers")]),body:xi}));return ve.on("update",Le=>{l.lt(U.day.value,en)||l.times(Le,Ln.value).negate().gt(fe.logs.value)||(fe.logs.value=l.times(Le,Ln.value).plus(fe.logs.value),s.value=l.times(Le,$i.value).plus(s.value),o.value=l.times(Le,Ei.value).plus(o.value))}),Ie(()=>{U.day.value===en&&l.gte(r.value,u)&&(U.loreTitle.value="Day complete!",U.loreBody.value="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!",U.day.value=en+1,U.minimized.value=!1)}),{name:e,color:t,coal:s,totalCoal:r,ash:o,activeFires:d,buildFire:g,activeBonfires:C,buildBonfire:Pe,activeKilns:K,buildKiln:De,warmerCutters:tt,warmerPlanters:nt,basicFertilizer:Ne,unlockBonfire:Qe,dedicatedCutters:ke,dedicatedPlanters:xt,betterFertilizer:it,unlockKiln:Tt,heatedCutters:st,heatedPlanters:Nt,moreFertilizer:rt,computedHeatedCutterEffect:Bt,computedHeatedPlanterEffect:Dn,computedFertilizerEffect:On,generalTabCollapsed:Ti,minWidth:700,display:D(()=>c(R,null,[c("div",null,[U.day.value===en?`Reach ${H(u)} ${s.displayName} to complete the day`:"Day Complete!"," ",y("-")," ",c("button",{class:"button",style:"display: inline-block;",onClick:()=>_n.value=!0},[y("Check Modifiers")])]),me(f),me(Fi),c(Ee,null,null),c(qt,{resource:s,color:t,style:"margin-bottom: 0",effectDisplay:void 0},null),c(Ee,null,null),c(qt,{resource:o,color:n,style:"margin-bottom: 0",effectDisplay:void 0},null),c(Ee,null,null),c(di,null,{default:()=>[c(nn,null,{default:()=>[me(g),c("div",null,[H(d.value),y("/"),H(g.amount.value)]),Ve(N,k,x,ye)]}),Qe.bought.value?c(R,null,[c(Ee,null,null),c(nn,null,{default:()=>[me(Pe),c("div",null,[H(C.value),y("/"),H(Pe.amount.value)]),Ve(Jt,gn,Xt,Pt)]})]):void 0,Tt.bought.value?c(R,null,[c(Ee,null,null),c(nn,null,{default:()=>[me(De),c("div",null,[H(K.value),y("/"),H(De.amount.value)]),Ve(Et,vn,et,Zt)]})]):void 0]}),c(Ee,null,null),Ve(...wt),Ve(...yn),Ve(...Ft)]))}});function fa(e){return Fe(()=>{const t=e();return t.currentGain==null&&(t.currentGain=S(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=l.floor(n).max(0),a(t.buyMax)||(n=n.min(1)),n})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=S(()=>{let n=t.scaling.currentAt(t);return t.roundUpCost&&(n=l.ceil(n)),n})),t.nextAt==null&&(t.nextAt=S(()=>{let n=t.scaling.nextAt(t);return t.roundUpCost&&(n=l.ceil(n)),n})),t.convert==null&&(t.convert=function(){var s;const n=a(t.currentGain),i=a(t.currentAt);t.gainResource.value=l.add(t.gainResource.value,n),t.spend(n,i),(s=t.onConvert)==null||s.call(t,n)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),$(t,"currentGain"),$(t,"actualGain"),$(t,"currentAt"),$(t,"nextAt"),$(t,"buyMax"),pe(t,"buyMax",!0),$(t,"roundUpCost"),pe(t,"roundUpCost",!0),t})}function ma(e,t){const n=_e(e),i=_e(t);return{currentGain(s){let r=a(s.baseResource.value);if(s.costModifier&&(r=s.costModifier.apply(r)),l.lt(r,a(n)))return 0;const o=l.div(r,a(n)).pow(a(i));return o.isNan()?new l(0):o},currentAt(s){let r=a(s.currentGain);return s.gainModifier&&(r=s.gainModifier.revert(r)),r=l.max(0,r).root(a(i)).times(a(n)),s.costModifier&&(r=s.costModifier.revert(r)),r},nextAt(s){let r=l.add(a(s.currentGain),1).floor();return s.gainModifier&&(r=s.gainModifier.revert(r)),r=l.max(0,r).root(a(i)).times(a(n)).max(a(n)),s.costModifier&&(r=s.costModifier.revert(r)),r}}}function ha(e){return fa(()=>{const t=e();return pe(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=S(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=l.floor(n).max(t.gainResource.value),a(t.buyMax)||(n=n.min(l.add(t.gainResource.value,1))),n})),t.actualGain==null&&(t.actualGain=S(()=>{let n=l.sub(l.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return a(t.buyMax)||(n=n.min(1)),n})),pe(t,"convert",function(){var s;const n=a(t.actualGain),i=a(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(a(t.currentGain)):a(t.currentGain),t.spend(n,i),(s=t.onConvert)==null||s.call(t,n)}),t})}const pa={class:"field"},ga={key:0,class:"field-title"},Tn=O({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var o;const n=e,i=At(Je(n,"title"),"span"),s=T((o=n.options.find(u=>u.value===n.modelValue))!=null?o:null);qe(Je(n,"modelValue"),u=>{var f;le(s)!==u&&(s.value=(f=n.options.find(d=>d.value===u))!=null?f:null)});function r(u){t("update:modelValue",u.value)}return(u,f)=>(_(),M("div",pa,[a(i)?(_(),M("span",ga,[(_(),L(ge(a(i))))])):E("",!0),c(a(Hi),{options:e.options,modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=d=>s.value=d),r],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var va=O({props:{visibility:{type:P(Number),required:!0},display:{type:P(String,Object,Function),required:!0},style:P(String,Object,Array),classes:P(Object),earned:{type:P(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:Qt},setup(e){const{display:t}=de(e),n=xe("");return Ie(()=>{const i=le(t);if(i==null){n.value="";return}if(ht(i)){n.value=j(i);return}const s=j(i.requirement,"h3"),r=j(i.effectDisplay||"","b"),o=j(i.optionsDisplay||"","span");n.value=j(D(()=>c("span",null,[c(s,null,null),i.effectDisplay?c("div",null,[c(r,null,null)]):null,i.optionsDisplay?c("div",{class:"equal-spaced"},[c(o,null,null)]):null])))}),{comp:n,unref:a,Visibility:ce}}});function ya(e,t,n,i,s,r){var u;const o=dt("Node");return e.unref(e.visibility)!==e.Visibility.None?(_(),M("div",{key:0,style:ae([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(u=e.unref(e.style))!=null?u:{}]),class:se({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(_(),L(ge(e.unref(e.comp)))),c(o,{id:e.id},null,8,["id"])],6)):E("",!0)}var ba=Q(va,[["render",ya],["__scopeId","data-v-f4e8794e"]]);ve.on("setupVue",e=>e.use(ji));const _a=Zn(),wa=Symbol("Milestone");let ct;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(ct||(ct={}));function lt(e){const t=Se(!1);return Fe(()=>{var s;const n=(s=e==null?void 0:e())!=null?s:{};n.id=jt("milestone-"),n.type=wa,n[ft]=ba,n.earned=t,n.complete=function(){t.value=!0},$(n,"visibility"),pe(n,"visibility",ce.Visible);const i=n.visibility;if(n.visibility=S(()=>{const r=a(n.display);switch(te.msDisplay){default:case ct.All:return a(i);case ct.Configurable:return a(n.earned)&&!(r!=null&&typeof r=="object"&&"optionsDisplay"in r)?ce.None:a(i);case ct.Incomplete:return a(n.earned)?ce.None:a(i);case ct.None:return ce.None}}),$(n,"style"),$(n,"classes"),$(n,"display"),n[mt]=function(){const{visibility:r,display:o,style:u,classes:f,earned:d,id:p}=this;return{visibility:r,display:o,style:a(u),classes:f,earned:d,id:p}},n.shouldEarn){const r=n;Ie(()=>{var o,u;if(te.active===A.id&&!r.earned.value&&a(r.visibility)===ce.Visible&&((o=r.shouldEarn)==null?void 0:o.call(r))&&(r.earned.value=!0,(u=r.onComplete)==null||u.call(r),r.display)){const f=a(r.display),d=j(ht(f)?f:f.requirement);_a(c(R,null,[c("h3",null,[y("Milestone earned!")]),c("div",null,[c(d,null,null)])]))}})}return n})}ve.on("loadSettings",e=>{pe(e,"msDisplay",ct.All)});const Na=Object.values(ct).map(e=>({label:ri(e),value:e}));Js(D(()=>c(Tn,{title:"Show Milestones",options:Na,"onUpdate:modelValue":e=>te.msDisplay=e,modelValue:te.msDisplay},null)));const ka="workshop",kt=2,Me=Wt(ka,function(){const e="Workshop",t="#D66B02",n="#D66B02",i=yt(0,"foundation progress"),s=ha(()=>({scaling:ma(250,1.5),baseResource:fe.logs,gainResource:i,roundUpCost:!0,buyMax:!1,spend(x,ye){fe.logs.value=l.sub(fe.logs.value,ye)}})),r=be(()=>({display:D(()=>c(R,null,[c("b",{style:"font-size: x-large"},[y("Build part of the foundation")]),c("br",null,null),c("br",null,null),c("span",{style:"font-size: large"},[y("Cost:")," ",xn(fe.logs,l.gte(s.actualGain.value,1)?s.currentAt.value:s.nextAt.value)," ",fe.logs.displayName])])),visibility:()=>ee(U.day.value===kt),canClick:()=>l.gte(s.actualGain.value,1),onClick(){!a(this.canClick)||s.convert()},style:"width: 600px; min-height: unset"})),o=lt(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>l.gte(i.value,1)})),u=lt(()=>({display:{requirement:"10% Foundation Completed",effectDisplay:"Cut an additional tree per second for each 5% of foundation completed"},shouldEarn:()=>l.gte(i.value,10),visibility:()=>ee(o.earned.value)})),f=lt(()=>({display:{requirement:"20% Foundation Completed",effectDisplay:"Plant an additional tree per second for each 10% of foundation completed"},shouldEarn:()=>l.gte(i.value,20),visibility:()=>ee(u.earned.value)})),d=lt(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>l.gte(i.value,30),visibility:()=>ee(f.earned.value)})),p=lt(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>l.gte(i.value,40),visibility:()=>ee(d.earned.value)})),v=lt(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>l.gte(i.value,50),visibility:()=>ee(p.earned.value)})),b=lt(()=>({display:{requirement:"75% Foundation Completed",effectDisplay:"The forest gains an extra tree for every 2% of foundation completed"},shouldEarn:()=>l.gte(i.value,75),visibility:()=>ee(v.earned.value)})),g=lt(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Trees' log gain is now raised to the 1.1th power"},shouldEarn:()=>l.gte(i.value,100),visibility:()=>ee(b.earned.value)})),N={logGainMilestone1:o,autoCutMilestone1:u,autoPlantMilestone1:f,autoCutMilestone2:d,autoPlantMilestone2:p,logGainMilestone2:v,morePlantsMilestone1:b,logGainMilestone3:g},k=Vt(()=>({direction:W.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>l.div(i.value,100),display:D(()=>U.day.value===kt?c(R,null,[H(i.value),y("%")]):"")}));return Ie(()=>{U.day.value===kt&&l.gte(i.value,100)&&(U.loreTitle.value="Day complete!",U.loreBody.value="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!",U.day.value=kt+1,U.minimized.value=!1)}),{name:e,day:kt,color:t,foundationProgress:i,foundationConversion:s,milestones:N,minWidth:700,display:D(()=>c(R,null,[c("div",null,[U.day.value===kt?"Complete the foundation to complete the day":"Day Complete!"]),me(k),c(Ee,null,null),me(r),c(Ee,null,null),tr(...Object.values(N))]))}}),Ca="trees",Dt=1,fe=Wt(Ca,function(){const e="Trees",t="#4BDC13",n="green",i=yt(0,"logs"),s=_i(i),r=yt(0,"saplings"),o=1e4,u=Ce(()=>[X(()=>({addend:()=>l.times(Pe.amount.value,10),description:"Expand Forest",enabled:C.bought})),X(()=>({addend:()=>l.div(Me.foundationProgress.value,2),description:"75% Foundation Completed",enabled:Me.milestones.morePlantsMilestone1.earned}))]),f=yt(S(()=>l.sub(u.apply(10),r.value)),"trees"),d=re(()=>({resource:i,cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),p=re(()=>({resource:i,cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),v=re(()=>({resource:i,cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),b=re(()=>({resource:i,cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),g=re(()=>({resource:i,cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),N=[d,p,v,b,g],k=re(()=>({resource:i,cost:50,visibility:()=>ee(g.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),x=re(()=>({resource:i,cost:50,visibility:()=>ee(g.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),ye=re(()=>({resource:i,cost:150,visibility:()=>ee(g.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),I=re(()=>({resource:i,cost:150,visibility:()=>ee(g.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),C=re(()=>({resource:i,cost:300,visibility:()=>ee(g.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),G=[k,x,ye,I,C],we=Ke(()=>({resource:i,cost(){let Z=this.amount.value;return l.gte(Z,50)&&(Z=l.pow(Z,2).div(50)),l.times(100,Z).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>ee(C.bought.value)})),Be=Ke(()=>({resource:i,cost(){let Z=this.amount.value;return l.gte(Z,50)&&(Z=l.pow(Z,2).div(50)),l.times(100,Z).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>ee(C.bought.value)})),Pe=Ke(()=>({resource:i,cost(){return l.pow(l.add(this.amount.value,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>ee(C.bought.value)})),Jt=[we,Be,Pe],gn=Vt(()=>({direction:W.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>l.log10(s.value).div(Math.log10(o)),display:D(()=>U.day.value===Dt?c(R,null,[H(s.value),y("/"),H(o)]):"")})),Xt=Ce(()=>[X(()=>({addend:1,description:"Wooden Fingers",enabled:d.bought})),X(()=>({addend:We,description:"Smart Knives",enabled:ye.bought}))]),Pt=S(()=>Xt.apply(1)),K=Ce(()=>[oe(()=>({multiplier:.5,description:"Sharper Fingers",enabled:k.bought}))]),ze=S(()=>K.apply(1)),$t=Ce(()=>[X(()=>({addend:1,description:"Automated Knives",enabled:v.bought})),X(()=>({addend:we.amount,description:"Generic Cutters",enabled:C.bought})),X(()=>({addend:()=>l.div(Me.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:Me.milestones.autoCutMilestone1.earned})),oe(()=>({multiplier:2,description:"30% Foundation Completed",enabled:Me.milestones.autoCutMilestone2.earned})),oe(()=>({multiplier:2,description:"Warmer Cutters",enabled:Ue.warmerCutters.bought})),oe(()=>({multiplier:Ue.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>l.gt(Ue.heatedCutters.amount.value,0)}))]),We=S(()=>$t.apply(0)),De=Ce(()=>[X(()=>({addend:1,description:"Leafy Fingers",enabled:p.bought})),X(()=>({addend:tt,description:"Smart Spades",enabled:I.bought}))]),Et=S(()=>De.apply(1)),vn=Ce(()=>[oe(()=>({multiplier:.5,description:"Greener Fingers",enabled:x.bought}))]),et=S(()=>vn.apply(1)),Zt=Ce(()=>[X(()=>({addend:1,description:"Automated Spade",enabled:b.bought})),X(()=>({addend:()=>l.div(Be.amount.value,2),description:"Generic Planters",enabled:C.bought})),X(()=>({addend:()=>l.div(Me.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:Me.milestones.autoPlantMilestone1.earned})),oe(()=>({multiplier:2,description:"40% Foundation Completed",enabled:Me.milestones.autoPlantMilestone2.earned})),oe(()=>({multiplier:2,description:"Warmer Planters",enabled:Ue.warmerPlanters.bought})),oe(()=>({multiplier:Ue.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>l.gt(Ue.heatedPlanters.amount.value,0)}))]),tt=S(()=>Zt.apply(0)),nt=Ce(()=>[oe(()=>({multiplier:1.25,description:"Research I",enabled:g.bought})),oe(()=>({multiplier:1.25,description:"Research II",enabled:C.bought})),oe(()=>({multiplier:()=>l.div(Me.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:Me.milestones.logGainMilestone1.earned})),oe(()=>({multiplier:2,description:"50% Foundation Completed",enabled:Me.milestones.logGainMilestone2.earned})),oe(()=>({multiplier:1.25,description:"Ashy Soil",enabled:Ue.basicFertilizer.bought})),oe(()=>({multiplier:Ue.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>l.gt(Ue.moreFertilizer.amount.value,0)})),ca(()=>({exponent:1.1,description:"100% Foundation Completed",enabled:Me.milestones.logGainMilestone3.earned}))]),Ne=Se(0),Qe=Vt(()=>({direction:W.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>l.div(Ne.value,ze.value)})),wt=be(()=>({display:{title:"Cut trees",description:D(()=>c(R,null,[y("Cut down up to "),H(l.floor(Pt.value))," ",y("tree"),l.eq(Pt.value,1)?"":"s",y(" at once!"),c("br",null,null),me(Qe)]))},style:{minHeight:"80px"},canClick:()=>l.gte(f.value,1)&&l.gte(Ne.value,ze.value),onClick(){if(l.lt(Ne.value,ze.value))return;const Z=l.floor(l.min(f.value,l.times(Pt.value,l.div(Ne.value,ze.value).floor())));i.value=l.add(i.value,nt.apply(Z)),r.value=l.add(r.value,Z),Ne.value=0}})),ke=Se(0),xt=Vt(()=>({direction:W.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>l.div(ke.value,et.value)})),it=be(()=>({display:{title:"Plant trees",description:D(()=>c(R,null,[y("Plant up to "),H(l.floor(Et.value))," ",y("tree"),l.eq(Et.value,1)?"":"s",y(" at once!"),c("br",null,null),me(xt)]))},style:{minHeight:"80px"},canClick:()=>l.gte(r.value,1)&&l.gte(ke.value,et.value),onClick(){if(l.lt(ke.value,et.value))return;const Z=l.floor(l.min(r.value,l.times(Et.value,l.div(ke.value,et.value).floor())));r.value=l.sub(r.value,Z),ke.value=0}})),[Tt,yn]=wi(()=>[{title:"Logs per Tree",modifier:nt,base:1,visible:g.bought},{title:"Manual Cutting Amount",modifier:Xt,base:1,visible:d.bought,unit:"/click"},{title:"Manual Planting Amount",modifier:De,base:1,visible:p.bought,unit:"/click"},{title:"Auto Cutting Amount",modifier:$t,base:0,visible:v.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:Zt,base:0,visible:b.bought,unit:"/s"},{title:"Forest Size",modifier:u,base:10,visible:C.bought}]),st=T(!1),Nt=D(()=>c(je,{modelValue:st.value,"onUpdate:modelValue":Z=>st.value=Z},{header:()=>c("h2",null,[e,y(" Modifiers")]),body:Tt}));ve.on("update",Z=>{if(l.lt(U.day.value,Dt))return;l.gte(Ne.value,ze.value)?Ne.value=ze.value:(Ne.value=l.add(Ne.value,Z),wt.isHolding.value&&wt.onClick()),l.gte(ke.value,et.value)?ke.value=et.value:(ke.value=l.add(ke.value,Z),it.isHolding.value&&it.onClick());const Bt=l.min(f.value,l.times(We.value,Z));i.value=l.add(i.value,nt.apply(Bt)),r.value=l.add(r.value,Bt);const bn=l.min(r.value,l.times(tt.value,Z));r.value=l.sub(r.value,bn)}),Ie(()=>{U.day.value===Dt&&l.gte(s.value,o)&&(U.loreTitle.value="Day complete!",U.loreBody.value="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!",U.day.value=Dt+1,U.minimized.value=!1)});const rt=S(()=>l.sub(We.value,tt.value)),Ft=S(()=>l.sub(tt.value,We.value));return{name:e,color:t,logs:i,totalLogs:s,trees:f,saplings:r,cutTree:wt,plantTree:it,row1Upgrades:N,row2Upgrades:G,row1Buyables:Jt,manualCutProgress:Ne,manualPlantProgress:ke,generalTabCollapsed:yn,minWidth:700,display:D(()=>c(R,null,[c("div",null,[U.day.value===Dt?`Reach ${H(1e4)} ${i.displayName} to complete the day`:"Day Complete!"," ",y("-")," ",c("button",{class:"button",style:"display: inline-block;",onClick:()=>st.value=!0},[y("Check Modifiers")])]),me(gn),me(Nt),c(Ee,null,null),c(qt,{resource:i,color:t,style:"margin-bottom: 0",effectDisplay:l.gt(We.value,0)?`+${Y(nt.apply(We.value))}/s`:void 0},null),c(qt,{resource:r,color:n,style:"margin-bottom: 0",effectDisplay:{[-1]:`${H(rt.value)}/s`,0:void 0,1:`+${H(rt.value)}/s`}[l.compare(rt.value,0)]},null),c(qt,{resource:f,color:n,style:"margin-bottom: 0",effectDisplay:{[-1]:`${H(Ft.value)}/s`,0:void 0,1:`+${H(Ft.value)}/s`}[l.compare(Ft.value,0)]},null),c(Ee,null,null),Ve(wt,it),c("div",null,[y("Tip: You can hold down on actions to perform them automatically")]),c(Ee,null,null),Ve(...N),Ve(...G),Ve(...Jt)]))}});var Sa="./assets/tree.35808197.png",Ma="./assets/sws.714ad454.png",Ia="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAFxGAABcRgEUlENBAAAAG3RFWHRTb2Z0d2FyZQBDZWxzeXMgU3R1ZGlvIFRvb2zBp+F8AAAMuElEQVR42u3dO4zkSAEG4L/Kr5me6dl1QkJAjkDiElJISAiO7CQSyCBHQis08QQrXUJISExKxCNBguQICJCIkBAZOqlmH0LbPW27CKa78XjtabddZVeV/z/ZXe12r11V39TDdllorcEwTHsEgTAMgTAMgTAMgTAMgTAMgTAMgTz5z4Ro/c+01oJVwSwaSBcOQmEWD6QPDiJhFgnkHBxEwiwKyBAcBMIQCIEwBDIcCJEwBEIgDIEQCEMgBMIQCIEwBOIQECJhggfCXoQhEAJhCIRAGAIhEIbxCQiRMARCIMySgXCYxRAIgTAEQiAMgRAIw/gEhEiY4IGwF2EIhEAYAiEQhkAIhGF8AkIkDIEQCLNkIBxmMQRCIAyBEAhDIATCMD4BIRImeCDsRRgCIRCGQAiEIRACYQjEJyBEwhAIgTBLBsJhFkMgBMIQCIEwBEIgDIH4BIRImOCBsBdhCIRAGAIhEIZACIQhEE7UGYZAGMYPIBxmMQRCIAyBEAhDIATCEAgn6gzjEBD2IgyBEAhDIATCEAiBMATCiTrDEAjD+AGEwyyGQAiEIRACYQiEQBgC4USdYRwCwl6EIRACYQiEQBgCIRCGQDhRZxgCYRg/gHCYxRAIgTAEQiAMgRAIQyCcqDME4hAQ9iIMgRAIQyAEwhCIs0CGfgeBMUEDsRGiIRD3DsoxJMRCIARCJK318Nz5ttVTaOVDIERitex9LysngRBJeGXua3k5C4RIwixr38qMQAhk8rL2qdw4xCKS2crah7LjJJ1IZi1v18uOFwoJZPYyz/P820qpLwgkQBwhIHGh3PM8/41S6jMCmaiSbm9fnfXv7+5eLxKJSz+U8jz/m1LqEwKxUEnngqhlB0AAkPtfi7u71wmBzAJkB+BzAL9USv2HQObHUQCo9jB0rTdJl9CLuDikzfN8A+AHSqnfEYiBShqBowJQ7mEcGvXh9zp0JKZw7H/qxwBwf38vDH3n35VS31w8EAM46o37nJR7IM3P16EMRuL80uXAcs/zvM/nxP39fTALILMBmRGHrgFpw1H/d+Lu7nXsK5JmGWutxZhyPwHko/M1DWWOcvUSyO3tq3rjPrfAqlrv0fX5Iz7fgNicV+R5fuxd9+Vz8hxtIJmyfGcBMhJH2VI5fQtL14ZYuu9nXUcyxWR7j6NZjr3Oz2ckkwMxgKOtYsSZSIoeFfykEQxBYrsCp1qFauAYFF+ReAPk9vbVrmVYJQYg0bVhlujTW9zevtq5dG1k6uVZE0BsIrEJZVIgI3HgxLCqfi2jAHBo0LLja4uxQ6g5Ks5XHL4i8QXIA9pXmXTHSoro+PeHv4vxuIw7yRzBRMXNcVHPNA7bQKz8QJoKyMjeQ7c09CYKWfv7LhyHHiOZsqGNrbRQcBCI4UquzTvaeouuIVcTSP1zwuZwykbFhYTDRySTABnRe1QNHBrdV79PZi4cQyttZhxDL8QGhcRZIHscBwBVA0l9Ut61kqX3KCI4knMrbUogtnuNqcF4A2Rk79HsIQ4XCWXHfOTQU0g4mHMqbUk4bKExsjjiIpAOHJ3l4DqMWkP8XCn18x5l9msAP1oiCpNQlgDk5DxjqqVagw3zT0qp77SU0wrAdwF8CuCnBsq9OJS9lBJpmsrdblcB0HEci4uLi8RmA+0LsOu7m5+fC4lVIANxoDEhb4OiXe8tTjScPwP4sVLqn/ty+iqAvwD4F4AbAN8a+v1SygKAllKiLMt6XUAIgTiORZqmMo5jaQPGOVhOfb8JJCED6UTiW6/RUukawKdKqd8KIb4B4PcAHgB8ZT/Puhrw1UWtzMVj29BHHFEUIU1TmWVZr0ULG6tM9Qbf9/uHfMYkEqeAnHo60MTGClNVSh8kWuufvXnz5ocAPsH/V+vSAeVcPG0P+ohCSikA6Kqq9Hq9TufCYaAuNAY+jOUkEAO9x+w4bA853r17V1ZVVWito9rw8axlaSllUVUVhHj8eBw/XuqpqkoLIbBer8+6a8AlHG1AhhxjnufXSqn/eg3EBRx9J5djG1Ge59hsNtXDw4Muy1I0hpHRmeVcRFEEIQS01ojjWMRxLJIkGTRHcw1IY1iKIb1InudfAvi+UuqvwQFxDYephpRlWVkUBfZAjh3CkOFVkiQyyzIRx/GouZmLOBpAxJjjzPP8a0qpfwc1xHJhaGWjUa1Wq+rDhw/Yl//gFbn9PANJkiDLMoQGpOvWl6km7E4DcR3HmMqK47gqimIUjn05I4oiXFxcIEmSoHA8VzdjjvesOxpcXcUyjSNN0w9XV1eXzYI9A0fbLfd638DFXA1MCAEpJW5ubkLuPYwec57nN0qp994B2SM57Ek1+kKglHKzX/LUUkq9Xq9XI76ueUdxs7JmuylSSokXL14QiIVexEUgFYBqzK3pQoiN1loeGrOUUqdpqi8vL1cjcOhnehQA0Pf397PcTp9lGVarVVBA9ntwtd2xbeyY+yBx7l6s29tX5dBb1GswjkunQogqSRJcXV1djG0seZ5XDSD1JdpZgAghsD+/SYHYmBs0cDw5TQIZn+3jfyeOJ34YWt3c3GSmGkoDyZOeZOph1mH+kWXZ5CtYNq4XPbNzo5hrmBUKkK14fOu9kFKiqqoDkCrLMnF5eZmYbCQtPQn2E3U5B5CxE3RbQPp+f489f8VccxGnH7k9I81tgQ6/VnmeJ6YbSEsvUv+eyZBEUWQEx8AyMHkqeiiOsVCWBOSj59SjKNI3NzexhcbRtYnEpEBevnx5vAcrUCDC5jksCUhzK1EhhNBxHIvr62srzz109SJLADICR9eKlDaBw1sgEyApmwUrpUQURTgFZCCOrnPRPgPpuUhhqqcQzwARtpEvEYhoTmDTNBWr1cr4CshzQKbqRQ6Tc9NAniuXATiab+/CM0B6v1JhynmIF1uP9kh9k4djpcRxjPV6bXwN/cSqyyS9iOkJ+gQx1ktM2YuECKTZiIQpGH2AmHpP34lyRBRFWK/XvuKwCsVbIBaRVF0FnSQJdrudsUo4tWZvG8hh84U0TXF5eekyCHHizwQyIRBjy4RnAPloRWaK3qPH8bnYW1iZkAcJxAKS5uvArO0p2+g9nAQyM5I+y7Xe9B4hANG2Ctq1oZVHUE6tVh3LqnbHLoEYRjLZioivOBwCcrKMTB7ngHvKcqXUG+eAGEQyKw6XgcyARA8tn7neg5jn+deVUv8IEYj1XF9fI0kS7SuOGcDoMeUzx94AeZ7/QSn1PSeBuIwkSRJUVYU4jrFarXQoQCxi0SbKY8wxjbgz4hcAvlBK/dE5IC4iOVxrONzGcXju4urqSoeCwzQU2xtd2z6Orsm6E0Bc7kkO+05VVQUp5fERVykl3r9/j1AypGHaeo59IJLBe/cSiIEepf4rAFRVhdAy5c6SlnoR40icAeLDpL0OxqVym7pxTrEDysA7h0cNfZ0H4hOSkDPFDveGkYxaPXsOiXDxJyGREMgZQDrvwzPxbIhwdahAJO4hmWNzuR5IjAJpIhEuj6WJhEB6HOOzd3KP7UWE65NNInECyOgJsMXjPPmow5gbGIUPqzFEMjsSZ4F0HeeigBCKO73IECC2X4pqemHBWyBE4sQwq9fkd+qVMAIhFGeAPNfoGnOC1tcX2AJSliU2mw2klNi//xFCiLPveggCCJFMDuQjJB1/1zZZ1mPnBVMmGCCE4hSQNiTNHqRXL0QghOIbkHM3WuhTDzaQGHnK1HkgQxr6k5MiFFNAxmyn9NFni6IQVVVBCIGHhwcUReHkXdFOAzHRuOtvmGIzH9V7jNpvbLfbHX+/3W6Pd0DvX3/NOcjcQyT2KtMD2W63xycwt9styrJEWZZenftigLSdMMGczmq1OrzzsPd7O7bbLaSUeHh4gNYaZVl6+1CZk0BsN9iTG4QRTHNi3jWXEG09RlEU0FpDa/1kaEUgHuDoi2TJcA6bVGRZhouLi15ANpsNiqKAEAK73e74pKXvK6OLBTIUyVKgSCkhpUSSJCeRFEWB7Xb7pLcI4ZKBcw9MzdHwzkWypOFXkiSIoqjt1QpProW8ffsWQHibVzgDZO5Gdw6SJQGRUj4ZcjX3BwNwXJkKbeOK2TdtcKmhEQjjBBBXGxeBMH3ag1UgLjcsAmH6tAVrQFxvVATC9GkHVoD40KAIhOnTBowDCQ0HgSwXh3EgIeIgkGXCWCSQoVfRiWR5MBYHZAwOIlkWCgIhEIIgEHsFRyhhNH4CsViwRBIWhEmAuNRwpixoYgkThxUgLjSYOQuaWAjE2cbiXPdMLF7jsA7EdsNxtVCJLJw6FKG+rXXpCfWuBgJhpob0EwC/IgwCYWbqgXweChMIwxAIwxAIwxAIwxAIwxAIwxAIwxAIw4Sa/wGDtUAHUuMNRQAAAABJRU5ErkJggg==";const U=Wt("main",function(){const e=Se(1),t=T(""),n=T("");function i(r){const o=Se(!1);return Fe(()=>{const u=r(),f=_e(u.shouldNotify);return{...u,opened:o,shouldNotify:f,[ft]:Fr,[mt]:function(){const{day:d,layer:p,symbol:v,opened:b,shouldNotify:g,story:N}=this;return{day:d,symbol:v,opened:b,shouldNotify:g,onOpenLore(){var k,x;t.value=a((x=(k=he[p!=null?p:"trees"])==null?void 0:k.name)!=null?x:""),n.value=N},onOpenLayer(){if(A.tabs.includes(p!=null?p:"trees")){const k=A.tabs.lastIndexOf(p!=null?p:"trees");A.tabs.splice(k,1)}else A.tabs.push(p!=null?p:"trees"),U.minimized.value=!0},onUnlockLayer(){b.value=!0,setTimeout(()=>{var k,x;t.value=a((x=(k=he[p!=null?p:"trees"])==null?void 0:k.name)!=null?x:""),n.value=N},1e3)}}}}})}const s=[i(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:Sa,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!"})),i(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:Ma,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!"})),i(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:Ia,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 coal as you can for him to give out."})),i(()=>({day:4,shouldNotify:!1,layer:null,symbol:"",story:"With this unbelievably large workshop complete, it's time to get the elves to work! But it appears they've forgotten how to make toys over the last 11 months - guess it's time to setup training sessions!"})),i(()=>({day:5,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:6,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:7,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:8,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:9,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:10,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:11,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:12,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:""})),i(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:""}))];return{name:"Calendar",days:s,day:e,loreTitle:t,loreBody:n,minWidth:710,display:D(()=>c(R,null,[A.devSpeed===0?c("div",null,[y("Game Paused")]):null,A.devSpeed&&A.devSpeed!==1?c("div",null,[y("Dev Speed: "),Y(A.devSpeed),y("x")]):null,A.offlineTime?c("div",null,[y("Offline Time: "),fn(A.offlineTime)]):null,c(Ee,null,null),c("div",{class:"advent"},[s.reduce((r,o)=>(r[r.length-1].length===4&&r.push([]),r[r.length-1].push(o),r),[[]]).map(r=>Ve(...r))])]))}}),Aa=e=>[U,fe,Me,Ue],Ni=S(()=>!1);function Pa(e,t){}var ki=Object.freeze(Object.defineProperty({__proto__:null,main:U,getInitialLayers:Aa,hasWon:Ni,fixOldSave:Pa},Symbol.toStringTag,{value:"Module"}));const $a=O({components:{Context:pi},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:P(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:P(Number,String),required:!0},name:{type:P(String),required:!0},color:P(String),minimizable:P(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:n,minimized:i,minWidth:s,tab:r}=de(e),o=hi(t),u=S(()=>z.allowGoBack&&n.value>0&&!i.value);function f(){A.tabs.splice(a(e.index),1)}bt(()=>p(i.value,a(s.value))),qe([i,nr(s)],([v,b])=>p(v,b));function d(v){e.nodes.value=v}function p(v,b){const g=typeof b=="number"||Number.isNaN(parseInt(b))?b+"px":b,N=r.value();N!=null&&(v?(N.style.flexGrow="0",N.style.flexShrink="0",N.style.width="60px",N.style.minWidth=N.style.flexBasis="",N.style.margin="0"):(N.style.flexGrow="",N.style.flexShrink="",N.style.width="",N.style.minWidth=N.style.flexBasis=g,N.style.margin=""))}return{component:o,showGoBack:u,updateNodes:d,unref:a,goBack:f}}});function Ea(e,t,n,i,s,r){const o=dt("Context");return _(),M("div",{class:"layer-container",style:ae({"--layer-color":e.unref(e.color)})},[e.showGoBack?(_(),M("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...u)=>e.goBack&&e.goBack(...u))},"\u274C")):E("",!0),e.minimized.value?(_(),M("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=u=>e.minimized.value=!1)},[m("div",null,q(e.unref(e.name)),1)])):(_(),M("div",{key:2,class:se(["layer-tab",{showGoBack:e.showGoBack}])},[c(o,{onUpdateNodes:e.updateNodes},{default:F(()=>[(_(),L(ge(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(_(),M("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=u=>e.minimized.value=!0)}," \u25BC ")):E("",!0)],4)}var xa=Q($a,[["render",Ea],["__scopeId","data-v-0158bec3"]]);const Ci=e=>(Xe("data-v-4b4bda40"),e=e(),Ze(),e),Ta=Ci(()=>m("h2",null,"Changelog",-1)),Fa=Ci(()=>m("details",{open:""},[m("summary",null,[y("v0.0 Initial Commit - "),m("time",null,"2021-09-04")]),y(" This is the first release :D "),m("ul",null,[m("li",{class:"feature"},"Did everything"),m("li",{class:"fix"},"Had some fun"),m("li",{class:"breaking"},"Removed everything"),m("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Ba=O({__name:"Changelog",setup(e,{expose:t}){const n=T(!1);return t({open(){n.value=!0}}),(i,s)=>(_(),L(je,{modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=r=>n.value=r)},{header:F(()=>[Ta]),body:F(()=>[Fa]),_:1},8,["modelValue"]))}});var Da=Q(Ba,[["__scopeId","data-v-4b4bda40"]]),Oa=O({props:{element:Object,display:{type:P(Object,String,Function),required:!0},style:P(Object,String,Array),classes:P(Object),direction:P(String),xoffset:P(String),yoffset:P(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=de(e),s=T(!1),r=S(()=>(le(i)||s.value)&&o.value),o=At(n),u=xe(j(D(()=>{const p=le(t);return p==null?"":He(p)})));function f(p){const v=i;p.shiftKey&&v&&(v.value=!v.value,p.stopPropagation(),p.preventDefault())}const d=S(()=>le(i)&&zt[te.theme].showPin);return{Direction:W,isHovered:s,isShown:r,comp:o,elementComp:u,unref:a,togglePinned:f,showPin:d}}});const Ra={key:0,class:"material-icons pinned"};function Va(e,t,n,i,s,r){return _(),M("div",{class:se(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=o=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=o=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...o)=>e.togglePinned&&e.togglePinned(...o))},[Ge(e.$slots,"default",{},void 0,!0),e.elementComp?(_(),L(ge(e.elementComp),{key:0})):E("",!0),c(dn,{name:"fade"},{default:F(()=>{var o;return[e.isShown?(_(),M("div",{key:0,class:se(["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:ae([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(o=e.unref(e.style))!=null?o:{}])},[e.showPin?(_(),M("span",Ra,"push_pin")):E("",!0),e.comp?(_(),L(ge(e.comp),{key:1})):E("",!0)],6)):E("",!0)]}),_:1})],34)}var ie=Q(Oa,[["render",Va],["__scopeId","data-v-6102fa3a"]]);const qa={class:"info-modal-header"},La=["src","alt"],Ua={class:"info-modal-title"},Ga={key:0},Ha={key:0},ja={key:0},za=m("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),Wa=m("br",null,null,-1),Qa=m("br",null,null,-1),Ka=["href"],Ja=m("span",{class:"material-icons info-modal-discord"},"discord",-1),Xa=m("div",null,[m("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link"},[m("span",{class:"material-icons info-modal-discord"},"discord"),y(" The Paper Pilot Community ")])],-1),Za=m("div",null,[m("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link"},[m("span",{class:"material-icons info-modal-discord"},"discord"),y(" The Modding Tree ")])],-1),Ya=m("br",null,null,-1);var el=O({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:s,author:r,discordName:o,discordLink:u,versionNumber:f,versionTitle:d}=z,p=de(n),v=T(!1),b=S(()=>fn(A.timePlayed)),g=S(()=>j(D(()=>c(R,null,[Xs.map(me)]))));t({open(){v.value=!0}});function N(){var k;(k=a(p.changelog))==null||k.open()}return(k,x)=>(_(),L(je,{modelValue:v.value,"onUpdate:modelValue":x[0]||(x[0]=ye=>v.value=ye)},{header:F(()=>[m("div",qa,[a(s)?(_(),M("img",{key:0,class:"info-modal-logo",src:a(s),alt:a(i)},null,8,La)):E("",!0),m("div",Ua,[m("h2",null,q(a(i)),1),m("h4",null,[y(" v"+q(a(f)),1),a(d)?(_(),M("span",Ga,": "+q(a(d)),1)):E("",!0)])])])]),body:F(({shown:ye})=>[ye?(_(),M("div",Ha,[a(r)?(_(),M("div",ja,"By "+q(a(r)),1)):E("",!0),za,Wa,m("div",{class:"link",onClick:N},"Changelog"),Qa,m("div",null,[a(u)?(_(),M("a",{key:0,href:a(u),class:"info-modal-discord-link"},[Ja,y(" "+q(a(o)),1)],8,Ka)):E("",!0)]),Xa,Za,Ya,m("div",null,"Time Played: "+q(a(b)),1),(_(),L(ge(a(g))))])):E("",!0)]),_:1},8,["modelValue"]))}});const tl={class:"field"},nl=O({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=S(()=>j(a(n.title)||"<span></span>","span")),s=S({get(){return!!n.modelValue},set(r){t("update:modelValue",r)}});return(r,o)=>(_(),M("label",tl,[Mn(m("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":o[0]||(o[0]=u=>ue(s)?s.value=u:null)},null,512),[[qi,a(s)]]),(_(),L(ge(a(i))))]))}});var ot=Q(nl,[["__scopeId","data-v-2b109500"]]);const Si=e=>(Xe("data-v-bc13791c"),e=e(),Ze(),e),il=Si(()=>m("div",{class:"header"},[m("h2",null,"Options")],-1)),sl=Si(()=>m("hr",null,null,-1));var rl=O({__name:"Options",setup(e,{expose:t}){const n=T(!1);t({open(){n.value=!0}});const i=Object.keys(zt).map(N=>({label:ri(N),value:N})),s=S(()=>j(D(()=>c(R,null,[ci.map(me)])))),{showTPS:r,theme:o,unthrottled:u}=de(te),{autosave:f,offlineProd:d}=de(A),p=S({get(){return A.devSpeed===0},set(N){A.devSpeed=N?0:null}}),v=D(()=>c("span",null,[y("Offline Production"),c(ie,{display:"Save-specific"},{default:()=>[y("*")]})])),b=D(()=>c("span",null,[y("Autosave"),c(ie,{display:"Save-specific"},{default:()=>[y("*")]})])),g=D(()=>c("span",null,[y("Pause game"),c(ie,{display:"Save-specific"},{default:()=>[y("*")]})]));return(N,k)=>(_(),L(je,{modelValue:n.value,"onUpdate:modelValue":k[6]||(k[6]=x=>n.value=x)},{header:F(()=>[il]),body:F(()=>[c(Tn,{title:"Theme",options:a(i),modelValue:a(o),"onUpdate:modelValue":k[0]||(k[0]=x=>ue(o)?o.value=x:null)},null,8,["options","modelValue"]),(_(),L(ge(a(s)))),c(ot,{title:"Show TPS",modelValue:a(r),"onUpdate:modelValue":k[1]||(k[1]=x=>ue(r)?r.value=x:null)},null,8,["modelValue"]),sl,c(ot,{title:"Unthrottled",modelValue:a(u),"onUpdate:modelValue":k[2]||(k[2]=x=>ue(u)?u.value=x:null)},null,8,["modelValue"]),c(ot,{title:a(v),modelValue:a(d),"onUpdate:modelValue":k[3]||(k[3]=x=>ue(d)?d.value=x:null)},null,8,["title","modelValue"]),c(ot,{title:a(b),modelValue:a(f),"onUpdate:modelValue":k[4]||(k[4]=x=>ue(f)?f.value=x:null)},null,8,["title","modelValue"]),a(z).enablePausing?(_(),L(ot,{key:0,title:a(g),modelValue:a(p),"onUpdate:modelValue":k[5]||(k[5]=x=>ue(p)?p.value=x:null)},null,8,["title","modelValue"])):E("",!0)]),_:1},8,["modelValue"]))}});var al=Q(rl,[["__scopeId","data-v-bc13791c"]]);const ll=["onSubmit"],ol={class:"field"},ul={key:0,class:"field-title"},cl=["placeholder"],dl=O({__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,i=At(Je(n,"title"),"span"),s=xe(null);cn(()=>{var f;(f=s.value)==null||f.focus()});const r=S({get(){return a(n.modelValue)||""},set(f){t("update:modelValue",f)}});function o(){t("submit")}function u(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(f,d)=>(_(),M("form",{onSubmit:Lt(o,["prevent"])},[m("div",ol,[a(i)?(_(),M("span",ul,[(_(),L(ge(a(i))))])):E("",!0),e.textArea?(_(),L(a(Wi),{key:1,modelValue:a(r),"onUpdate:modelValue":d[0]||(d[0]=p=>ue(r)?r.value=p:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:u,ref_key:"field",ref:s},null,8,["modelValue","placeholder","maxHeight"])):Mn((_(),M("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=p=>ue(r)?r.value=p:null),placeholder:e.placeholder,class:se({fullWidth:!e.title}),onBlur:u,ref_key:"field",ref:s},null,42,cl)),[[Li,a(r)]])])],40,ll))}});var Mi=Q(dl,[["__scopeId","data-v-67b44a54"]]);const fl={key:0},ml=["onClick","disabled"],hl={key:0},pl=["onClick"],gl=O({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=de(e),s=T(!1);qe(s,u=>{t("confirmingChanged",u)});function r(){if(a(i.skipConfirm)){t("click");return}s.value&&t("click"),s.value=!s.value}function o(){s.value=!1}return(u,f)=>(_(),M("span",{class:se(["container",{confirming:s.value}])},[s.value?(_(),M("span",fl,"Are you sure?")):E("",!0),m("button",{onClick:Lt(r,["stop"]),class:"button danger",disabled:e.disabled},[s.value?(_(),M("span",hl,"Yes")):Ge(u.$slots,"default",{key:1},void 0,!0)],8,ml),s.value?(_(),M("button",{key:1,class:"button",onClick:Lt(o,["stop"])},"No",8,pl)):E("",!0)],2))}});var vl=Q(gl,[["__scopeId","data-v-2f8ef34c"]]);const yl=["onClick"],bl=O({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=T(!1),i=T(null);function s(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,bt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(r,o)=>(_(),M("button",{onClick:Lt(s,["stop"]),class:se(["feedback",{activated:n.value,left:e.left}])},[Ge(r.$slots,"default",{},void 0,!0)],10,yl))}});var _l=Q(bl,[["__scopeId","data-v-01a1b95c"]]);const Ye=e=>(Xe("data-v-5285ac49"),e=e(),Ze(),e),wl=Ye(()=>m("div",{class:"handle material-icons"},"drag_handle",-1)),Nl={key:0,class:"actions"},kl=Ye(()=>m("span",{class:"material-icons"},"content_paste",-1)),Cl=Ye(()=>m("span",{class:"material-icons"},"content_copy",-1)),Sl=Ye(()=>m("span",{class:"material-icons"},"edit",-1)),Ml=Ye(()=>m("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Il={key:1,class:"actions"},Al=Ye(()=>m("span",{class:"material-icons"},"check",-1)),Pl=Ye(()=>m("span",{class:"material-icons"},"close",-1)),$l={key:2,class:"details"},El={class:"save-version"},xl=Ye(()=>m("br",null,null,-1)),Tl={key:0},Fl={key:1},Bl={key:3,class:"details"},Dl={key:4,class:"details error"},Ol=Ye(()=>m("br",null,null,-1)),Rl=O({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=de(n),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),r=T(!1),o=T(!1),u=T("");qe(r,()=>u.value=i.value.name||"");const f=S(()=>i.value&&i.value.id===A.id),d=S(()=>f.value?A.time:i.value&&i.value.time||0),p=hi(S(()=>{var b,g,N,k;return`Day ${(k=(N=(g=(b=i.value)==null?void 0:b.layers)==null?void 0:g.main)==null?void 0:N.day)!=null?k:1}`}));function v(){t("editName",u.value),r.value=!1}return(b,g)=>(_(),M("div",{class:se(["save",{active:a(f)}])},[wl,r.value?(_(),M("div",Il,[m("button",{onClick:v,class:"button"},[c(ie,{display:"Save",direction:a(W).Left,class:"info"},{default:F(()=>[Al]),_:1},8,["direction"])]),m("button",{onClick:g[5]||(g[5]=N=>r.value=!r.value),class:"button"},[c(ie,{display:"Cancel",direction:a(W).Left,class:"info"},{default:F(()=>[Pl]),_:1},8,["direction"])])])):(_(),M("div",Nl,[a(i).error==null&&!o.value?(_(),L(_l,{key:0,onClick:g[0]||(g[0]=N=>t("export")),class:"button",left:""},{default:F(()=>[c(ie,{display:"Export",direction:a(W).Left,class:"info"},{default:F(()=>[kl]),_:1},8,["direction"])]),_:1})):E("",!0),a(i).error==null&&!o.value?(_(),M("button",{key:1,onClick:g[1]||(g[1]=N=>t("duplicate")),class:"button"},[c(ie,{display:"Duplicate",direction:a(W).Left,class:"info"},{default:F(()=>[Cl]),_:1},8,["direction"])])):E("",!0),a(i).error==null&&!o.value?(_(),M("button",{key:2,onClick:g[2]||(g[2]=N=>r.value=!r.value),class:"button"},[c(ie,{display:"Edit Name",direction:a(W).Left,class:"info"},{default:F(()=>[Sl]),_:1},8,["direction"])])):E("",!0),c(vl,{disabled:a(f),onClick:g[3]||(g[3]=N=>t("delete")),onConfirmingChanged:g[4]||(g[4]=N=>o.value=N)},{default:F(()=>[c(ie,{display:"Delete",direction:a(W).Left,class:"info"},{default:F(()=>[Ml]),_:1},8,["direction"])]),_:1},8,["disabled"])])),a(i).error==null&&!r.value?(_(),M("div",$l,[m("button",{class:"button open",onClick:g[6]||(g[6]=N=>t("open"))},[m("h3",null,q(a(i).name),1)]),m("span",El,"v"+q(a(i).modVersion),1),xl,a(d)?(_(),M("div",Tl,"Last played "+q(a(s).format(a(d))),1)):E("",!0),a(p)?(_(),M("div",Fl,[(_(),L(ge(a(p))))])):E("",!0)])):a(i).error==null&&r.value?(_(),M("div",Bl,[c(Mi,{modelValue:u.value,"onUpdate:modelValue":g[7]||(g[7]=N=>u.value=N),class:"editname",onSubmit:v},null,8,["modelValue"])])):(_(),M("div",Dl,[y(" Error: Failed to load save with id "+q(a(i).id),1),Ol,y(q(a(i).error),1)]))],2))}});var Vl=Q(Rl,[["__scopeId","data-v-5285ac49"]]);const Fn=e=>(Xe("data-v-3b9991aa"),e=e(),Ze(),e),ql=Fn(()=>m("h2",null,"Saves Manager",-1)),Ll={class:"modal-footer"},Ul={class:"field"},Gl=Fn(()=>m("span",{class:"field-title"},"Create Save",-1)),Hl={class:"field-buttons"},jl={class:"footer"},zl=Fn(()=>m("div",{style:{"flex-grow":"1"}},null,-1)),Wl=O({__name:"SavesManager",setup(e,{expose:t}){const n=T(!1),i=T(null);t({open(){n.value=!0}});const s=T(!1),r=T(""),o=T(null);qe(r,I=>{I?bt(()=>{try{if(I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=ut.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I),s.value=!0;return}const C=JSON.parse(I);if(typeof C!="object"){s.value=!0;return}const G=tn();C.id=G,Oe(C),r.value="",s.value=!1,te.saves.push(G)}catch{s.value=!0}}):s.value=!1});let u={},f=T(Object.keys(u).reduce((I,C)=>(I.push({label:C.split("/").slice(-1)[0].slice(0,-4),value:u[C]}),I),[]));const d=Sn({});function p(I){if(d[I]==null){let C=localStorage.getItem(I);if(C==null)d[I]={error:"Save doesn't exist in localStorage",id:I};else if(C==="dW5kZWZpbmVk")d[I]={error:"Save is undefined",id:I};else try{if(C[0]!=="{")if(C[0]==="e")C=decodeURIComponent(escape(atob(C)));else if(C[0]==="\u1BE1")C=ut.decompressFromUTF16(C);else return console.warn("Unable to determine preset encoding",C),s.value=!0,d[I]={error:"Unable to determine preset encoding",id:I},d[I];d[I]={...JSON.parse(C),id:I}}catch(G){d[I]={error:G,id:I},console.warn(`SavesManager: Failed to load info about save with id ${I}:
|
|
${G}
|
|
${C}`)}}return d[I]}qe(n,I=>{I&&Object.keys(d).forEach(C=>delete d[C])});const v=S(()=>te.saves.reduce((I,C)=>(I[C]=p(C),I),{}));function b(I){let C;switch(A.id===I?C=li(A[ne]):C=JSON.stringify(v.value[I]),z.exportEncoding){default:console.warn(`Unknown save encoding: ${z.exportEncoding}. Defaulting to lz`);case"lz":C=ut.compressToUTF16(C);break;case"base64":C=btoa(unescape(encodeURIComponent(C)));break;case"plain":break}const G=document.createElement("textarea");G.value=C,document.body.appendChild(G),G.select(),G.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(G)}function g(I){A.id===I&&Oe();const C={...v.value[I],id:tn()};Oe(C),te.saves.push(C.id)}function N(I){te.saves=te.saves.filter(C=>C!==I),localStorage.removeItem(I),d[I]=void 0}function k(I){v.value[A.id].time=A.time,Oe(),d[A.id]=void 0,vt(v.value[I]),d[I]=void 0}function x(I){if(o.value=I,bt(()=>{o.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=ut.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const C=JSON.parse(I);C.id=tn(),Oe(C),te.saves.push(C.id),k(C.id)}function ye(I,C){const G=v.value[I];G&&(G.name=C,A.id===I?(A.name=C,Oe()):(Oe(G),d[I]=void 0))}return(I,C)=>(_(),L(je,{modelValue:n.value,"onUpdate:modelValue":C[4]||(C[4]=G=>n.value=G),ref_key:"modal",ref:i},{header:F(()=>[ql]),body:F(({shown:G})=>[G?(_(),L(a(zi),{key:0,list:a(te).saves,handle:".handle",itemKey:we=>we},{item:F(({element:we})=>[c(Vl,{save:a(v)[we],onOpen:Be=>k(we),onExport:Be=>b(we),onEditName:Be=>ye(we,Be),onDuplicate:Be=>g(we),onDelete:Be=>N(we)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):E("",!0)]),footer:F(()=>[m("div",Ll,[c(Mi,{modelValue:r.value,"onUpdate:modelValue":C[0]||(C[0]=G=>r.value=G),title:"Import Save",placeholder:"Paste your save here!",class:se({importingFailed:s.value})},null,8,["modelValue","class"]),m("div",Ul,[Gl,m("div",Hl,[m("button",{class:"button",onClick:C[1]||(C[1]=G=>k(a(Mt)().id))},"New Game"),Object.keys(a(f)).length>0?(_(),L(Tn,{key:0,options:a(f),modelValue:o.value,"onUpdate:modelValue":C[2]||(C[2]=G=>x(G)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):E("",!0)])]),m("div",jl,[zl,m("button",{class:"button modal-default-button",onClick:C[3]||(C[3]=G=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Ii=Q(Wl,[["__scopeId","data-v-3b9991aa"]]);const Ae=e=>(Xe("data-v-4a3f8425"),e=e(),Ze(),e),Ql=["src","alt"],Kl={key:1,class:"title"},Jl=Ae(()=>m("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Xl={class:"discord"},Zl={class:"discord-links"},Yl={key:0},eo=["href"],to=Ae(()=>m("li",null,[m("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),no=Ae(()=>m("li",null,[m("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),io={href:"https://forums.moddingtree.com/",target:"_blank"},so=Ae(()=>m("span",{class:"material-icons"},"forum",-1)),ro=Ae(()=>m("span",{class:"material-icons"},"info",-1)),ao=Ae(()=>m("span",{class:"material-icons"},"library_books",-1)),lo=Ae(()=>m("span",{class:"material-icons"},"settings",-1)),oo=Ae(()=>m("span",{class:"material-icons"},"library_books",-1)),uo=Ae(()=>m("span",{class:"material-icons"},"settings",-1)),co=Ae(()=>m("span",{class:"material-icons"},"info",-1)),fo={href:"https://forums.moddingtree.com/",target:"_blank"},mo=Ae(()=>m("span",{class:"material-icons"},"forum",-1)),ho={class:"discord"},po={class:"discord-links"},go={key:0},vo=["href"],yo=Ae(()=>m("li",null,[m("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),bo=Ae(()=>m("li",null,[m("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),_o=O({__name:"Nav",setup(e){const t=T(null),n=T(null),i=T(null),s=T(null),{useHeader:r,banner:o,title:u,discordName:f,discordLink:d,versionNumber:p}=z;function v(){window.open(d,"mywindow")}return(b,g)=>(_(),M(R,null,[a(r)?(_(),M("div",_t({key:0,class:"nav"},b.$attrs),[a(o)?(_(),M("img",{key:0,src:a(o),class:"banner",alt:a(u)},null,8,Ql)):(_(),M("div",Kl,q(a(u)),1)),m("div",{onClick:g[0]||(g[0]=N=>{var k;return(k=s.value)==null?void 0:k.open()}),class:"version-container"},[c(ie,{display:"Changelog",direction:a(W).Down,class:"version"},{default:F(()=>[m("span",null,"v"+q(a(p)),1)]),_:1},8,["direction"])]),Jl,m("div",Xl,[m("span",{onClick:v,class:"material-icons"},"discord"),m("ul",Zl,[a(d)?(_(),M("li",Yl,[m("a",{href:a(d),target:"_blank"},q(a(f)),9,eo)])):E("",!0),to,no])]),m("div",null,[m("a",io,[c(ie,{display:"Forums",direction:a(W).Down,yoffset:"5px"},{default:F(()=>[so]),_:1},8,["direction"])])]),m("div",{onClick:g[1]||(g[1]=N=>{var k;return(k=t.value)==null?void 0:k.open()})},[c(ie,{display:"Info",direction:a(W).Down,class:"info"},{default:F(()=>[ro]),_:1},8,["direction"])]),m("div",{onClick:g[2]||(g[2]=N=>{var k;return(k=n.value)==null?void 0:k.open()})},[c(ie,{display:"Saves",direction:a(W).Down,xoffset:"-20px"},{default:F(()=>[ao]),_:1},8,["direction"])]),m("div",{onClick:g[3]||(g[3]=N=>{var k;return(k=i.value)==null?void 0:k.open()})},[c(ie,{display:"Options",direction:a(W).Down,xoffset:"-66px"},{default:F(()=>[lo]),_:1},8,["direction"])])],16)):(_(),M("div",_t({key:1,class:"overlay-nav"},b.$attrs),[m("div",{onClick:g[4]||(g[4]=N=>{var k;return(k=s.value)==null?void 0:k.open()}),class:"version-container"},[c(ie,{display:"Changelog",direction:a(W).Right,xoffset:"25%",class:"version"},{default:F(()=>[m("span",null,"v"+q(a(p)),1)]),_:1},8,["direction"])]),m("div",{onClick:g[5]||(g[5]=N=>{var k;return(k=n.value)==null?void 0:k.open()})},[c(ie,{display:"Saves",direction:a(W).Right},{default:F(()=>[oo]),_:1},8,["direction"])]),m("div",{onClick:g[6]||(g[6]=N=>{var k;return(k=i.value)==null?void 0:k.open()})},[c(ie,{display:"Options",direction:a(W).Right},{default:F(()=>[uo]),_:1},8,["direction"])]),m("div",{onClick:g[7]||(g[7]=N=>{var k;return(k=t.value)==null?void 0:k.open()})},[c(ie,{display:"Info",direction:a(W).Right},{default:F(()=>[co]),_:1},8,["direction"])]),m("div",null,[m("a",fo,[c(ie,{display:"Forums",direction:a(W).Right,xoffset:"7px"},{default:F(()=>[mo]),_:1},8,["direction"])])]),m("div",ho,[m("span",{onClick:v,class:"material-icons"},"discord"),m("ul",po,[a(d)?(_(),M("li",go,[m("a",{href:a(d),target:"_blank"},q(a(f)),9,vo)])):E("",!0),yo,bo])])],16)),c(el,{ref_key:"info",ref:t,changelog:s.value},null,8,["changelog"]),c(Ii,{ref_key:"savesManager",ref:n},null,512),c(al,{ref_key:"options",ref:i},null,512),c(Da,{ref_key:"changelog",ref:s},null,512)],64))}});var Ai=Q(_o,[["__scopeId","data-v-4a3f8425"]]);const Bn=e=>(Xe("data-v-62ae8bac"),e=e(),Ze(),e),wo={class:"inner-tab"},No={key:0},ko=Bn(()=>m("br",null,null,-1)),Co=y(" You can help continue the "),So=Bn(()=>m("i",null,"advent",-1)),Mo=y("ure at: "),Io=Bn(()=>m("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link"},[m("span",{class:"material-icons info-modal-discord"},"discord"),y(" The Paper Pilot Community ")],-1)),Ao=[ko,Co,So,Mo,Io],Po=O({__name:"Game",setup(e){const t=Je(A,"tabs"),n=S(()=>Object.keys(he)),i=z.useHeader;function s(r){const{display:o,minimized:u,minWidth:f,name:d,color:p,minimizable:v,nodes:b}=r;return{display:o,minimized:u,minWidth:f,name:d,color:p,minimizable:v,nodes:b}}return(r,o)=>(_(),M("div",{class:se(["tabs-container",{useHeader:a(i)}])},[(_(!0),M(R,null,Jn(a(t),(u,f)=>{var d,p;return _(),M("div",{key:f,class:se(["tab",a((d=a(he)[u])==null?void 0:d.classes)]),ref_for:!0,ref:`tab-${f}`,style:ae(a((p=a(he)[u])==null?void 0:p.style))},[f===0&&!a(i)?(_(),L(Ai,{key:0})):E("",!0),m("div",wo,[a(n).includes(u)?(_(),L(xa,_t({key:0},s(a(he)[u]),{index:f,tab:()=>{var v;return(v=r.$refs[`tab-${f}`])==null?void 0:v[0]}}),null,16,["index","tab"])):(_(),L(ge(u),{key:1,index:f},null,8,["index"]))])],6)}),128)),c(je,{"model-value":a(U).loreBody.value!=="","onUpdate:modelValue":o[0]||(o[0]=()=>a(U).loreBody.value="")},{header:F(()=>[m("h2",null,q(a(U).loreTitle.value),1)]),body:F(()=>[y(q(a(U).loreBody.value)+" ",1),a(U).days[a(U).day.value-1].opened.value?E("",!0):(_(),M("div",No,Ao))]),_:1},8,["model-value"])],2))}});var $o=Q(Po,[["__scopeId","data-v-62ae8bac"]]);const Kt=e=>(Xe("data-v-4a50ce42"),e=e(),Ze(),e),Eo={class:"game-over-modal-header"},xo=["src","alt"],To={class:"game-over-modal-title"},Fo=Kt(()=>m("h2",null,"Congratulations!",-1)),Bo={key:0},Do=Kt(()=>m("br",null,null,-1)),Oo=Kt(()=>m("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Ro=Kt(()=>m("br",null,null,-1)),Vo=["href"],qo=Kt(()=>m("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Lo=O({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:s,versionNumber:r,versionTitle:o}=z,u=S(()=>fn(A.timePlayed)),f=S(()=>Ni.value&&!A.keepGoing),d=Je(A,"autosave");function p(){A.keepGoing=!0}function v(){vt(Mt())}return(b,g)=>(_(),L(je,{"model-value":a(f)},{header:F(()=>[m("div",Eo,[a(n)?(_(),M("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,xo)):E("",!0),m("div",To,[Fo,m("h4",null,"You've beaten "+q(a(t))+" v"+q(a(r))+": "+q(a(o)),1)])])]),body:F(({shown:N})=>[N?(_(),M("div",Bo,[m("div",null,"It took you "+q(a(u))+" to beat the game.",1),Do,Oo,Ro,m("div",null,[m("a",{href:a(s),class:"game-over-modal-discord-link"},[qo,y(" "+q(a(i)),1)],8,Vo)]),c(ot,{title:"Autosave",modelValue:a(d),"onUpdate:modelValue":g[0]||(g[0]=k=>ue(d)?d.value=k:null)},null,8,["modelValue"])])):E("",!0)]),footer:F(()=>[m("div",{class:"game-over-footer"},[m("button",{onClick:p,class:"button"},"Keep Going"),m("button",{onClick:v,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Uo=Q(Lo,[["__scopeId","data-v-4a50ce42"]]);const pn=e=>(Xe("data-v-3de07c06"),e=e(),Ze(),e),Go=pn(()=>m("div",{class:"nan-modal-header"},[m("h2",null,"NaN value detected!")],-1)),Ho={key:0},jo=pn(()=>m("br",null,null,-1)),zo=["href"],Wo=pn(()=>m("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Qo=pn(()=>m("br",null,null,-1)),Ko={class:"nan-footer"},Jo=O({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=z,i=Je(A,"autosave"),s=Je(J,"hasNaN"),r=T(null),o=S(()=>{var g;return(g=J.NaNPath)==null?void 0:g.join(".")}),u=S(()=>{var g;return(g=J.NaNPath)==null?void 0:g.slice(-1)[0]}),f=S(()=>J.NaNReceiver&&u.value?J.NaNReceiver[u.value]:null),d=S({get(){return A.devSpeed===0},set(g){A.devSpeed=g?null:0}});function p(){J.NaNReceiver&&u.value&&(J.NaNReceiver[u.value]=new l(0),J.hasNaN=!1)}function v(){J.NaNReceiver&&u.value&&(J.NaNReceiver[u.value]=new l(1),J.hasNaN=!1)}function b(){J.NaNReceiver&&u.value&&(J.NaNReceiver[u.value]=new l(NaN),J.hasNaN=!1)}return(g,N)=>(_(),M(R,null,[c(je,_t({modelValue:a(s),"onUpdate:modelValue":N[4]||(N[4]=k=>ue(s)?s.value=k:null)},g.$attrs),{header:F(()=>[Go]),body:F(()=>[m("div",null,[y(' Attempted to assign "'+q(a(o))+'" to NaN',1),a(f)?(_(),M("span",Ho,q(" ")+"(previously "+q(a(Y)(a(f)))+")",1)):E("",!0),y(". Auto-saving has been "+q(a(i)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),jo,m("div",null,[m("a",{href:a(n),class:"nan-modal-discord-link"},[Wo,y(" "+q(a(t)),1)],8,zo)]),Qo,c(ot,{title:"Autosave",modelValue:a(i),"onUpdate:modelValue":N[0]||(N[0]=k=>ue(i)?i.value=k:null)},null,8,["modelValue"]),a(z).enablePausing?(_(),L(ot,{key:0,title:"Pause game",modelValue:a(d),"onUpdate:modelValue":N[1]||(N[1]=k=>ue(d)?d.value=k:null)},null,8,["modelValue"])):E("",!0)]),footer:F(()=>[m("div",Ko,[m("button",{onClick:N[2]||(N[2]=k=>{var x;return(x=r.value)==null?void 0:x.open()}),class:"button"},"Open Saves Manager"),m("button",{onClick:p,class:"button"},"Set to 0"),m("button",{onClick:v,class:"button"},"Set to 1"),a(f)&&a(l).neq(a(f),0)&&a(l).neq(a(f),1)?(_(),M("button",{key:0,onClick:N[3]||(N[3]=k=>s.value=!1),class:"button"}," Set to previous ")):E("",!0),m("button",{onClick:b,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),c(Ii,{ref_key:"savesManager",ref:r},null,512)],64))}});var Xo=Q(Jo,[["__scopeId","data-v-3de07c06"]]);const Zo={key:0,class:"tpsDisplay"},Yo={key:0,class:"low"},eu=O({__name:"TPS",setup(e){const t=S(()=>l.div(J.lastTenTicks.length,J.lastTenTicks.reduce((r,o)=>r+o,0))),n=T([]);Ie(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=S(()=>n.value.reduce((r,o)=>l.max(r,o),0)),s=S(()=>l.sub(t.value,i.value).gt(1));return(r,o)=>a(t).isNan()?E("",!0):(_(),M("div",Zo,[y(" TPS: "+q(a(H)(a(t)))+" ",1),c(dn,{name:"fade"},{default:F(()=>[a(s)?(_(),M("span",Yo,q(a(H)(a(i))),1)):E("",!0)]),_:1})]))}});var tu=Q(eu,[["__scopeId","data-v-46a3ed5b"]]);var nu=O({__name:"App",setup(e){const t=z.useHeader,n=S(()=>zt[te.theme].variables),i=Je(te,"showTPS"),s=S(()=>j(D(()=>c(R,null,[Zs.map(me)]))));return(r,o)=>(_(),M(R,null,[m("div",{id:"modal-root",style:ae(a(n))},null,4),m("div",{class:se(["app",{useHeader:a(t)}]),style:ae(a(n))},[a(t)?(_(),L(Ai,{key:0})):E("",!0),c($o),a(a(i))?(_(),L(tu,{key:1})):E("",!0),c(Uo),c(Xo),(_(),L(ge(a(s))))],6)],64))}});var iu=Q(nu,[["__scopeId","data-v-7c41425b"]]);function su(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:s,onRegisterError:r}=e;let o,u;const f=async(d=!0)=>{d&&(o==null||o.addEventListener("controlling",p=>{p.isUpdate&&window.location.reload()})),u&&u.waiting&&await Ki(u.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){o=new Qi("./sw.js",{scope:"./",type:"classic"}),o.addEventListener("activated",d=>{d.isUpdate||i==null||i()});{const d=()=>{n==null||n()};o.addEventListener("waiting",d),o.addEventListener("externalwaiting",d)}o.register({immediate:t}).then(d=>{u=d,s==null||s(d)}).catch(d=>{r==null||r(d)})}return f}function ru(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:s,onRegisterError:r}=e,o=T(!1),u=T(!1);return{updateServiceWorker:su({immediate:t,onNeedRefresh(){o.value=!0,n==null||n()},onOfflineReady(){u.value=!0,i==null||i()},onRegistered:s,onRegisterError:r}),offlineReady:u,needRefresh:o}}document.title=z.title;window.projInfo=z;if(z.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 Ws();const{globalBus:e,startGameLoop:t}=await rn(()=>Promise.resolve().then(function(){return zs}),void 0),n=window.vue=Ui(iu);e.emit("setupVue",n),n.mount("#app"),bt(()=>{const i=Zn(),{updateServiceWorker:s}=ru({onNeedRefresh(){i.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(){s()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(r){r&&setInterval(r.update,60*60*1e3)}})}),t()});
|