pages/advent/assets/index.17311f0f.js

15 lines
112 KiB
JavaScript

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