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