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