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