/* empty css */import"./vue.d185782d.js";import{a2 as M,H as a,n as be,u as At,x as O,b3 as Be,ae as D,o as h,a4 as S,a5 as g,r as je,K as te,aG as di,A as Ne,b4 as Pe,ac as d,U,as as Cn,aC as Bt,av as Ze,aJ as Wt,F as le,c as q,w as x,b9 as an,bs as or,au as ze,bu as Pt,T as ln,Y as ar,ab as C,y as un,l as lr,bv as Je,aN as he,a3 as V,aP as re,O as X,M as ee,aK as Ge,aI as We,D as st,bn as ur,br as fi,aM as Ft,ap as en,L as cr,ay as dr,C as Zn,be as fr}from"./@vue.7184beb0.js";import{c as pi}from"./nanoevents.1080beb7.js";import{L as it}from"./lz-string.f2f3b7cf.js";import{_ as z,C as pr}from"./@ivanv.3bc3ebc4.js";import{Y as mr}from"./vue-next-select.f0e584b6.js";import{D as gr}from"./vuedraggable.4713c6fe.js";import{p as hr}from"./vue-textarea-autosize.35804eaf.js";import{s as vr,u as kn}from"./vue-toastification.768059b7.js";import{A as mi,T as br,R as yr,B as _r,u as wr,E as Jn}from"./@pixi.13a16b18.js";import{v as Nr,n as Cr}from"./workbox-window.8d14e8b7.js";import"./earcut.b6f90e68.js";import"./sortablejs.4c7e7419.js";import"./ismobilejs.5c6954b9.js";import"./eventemitter3.dc5195d7.js";import"./url.6dd57c6c.js";import"./querystring.776b9ab3.js";const kr=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerpolicy&&(s.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?s.credentials="include":r.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}};kr();const Sr="modulepreload",Xn={},$r="./",tn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${$r}${i}`,i in Xn)return;Xn[i]=!0;const r=i.endsWith(".css"),s=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${s}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Sr,r||(o.as="script",o.crossOrigin=""),o.href=i,document.head.appendChild(o),r)return new Promise((u,c)=>{o.addEventListener("load",u),o.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Mr="./projInfo-schema.json",Ir="Profectus Demo",Er="A demo project made in Profectus",Tr="profectus-demo",Pr="",Fr="",Vr="",Or="0.0",qr="Initial Commit",Dr=!0,Rr=!1,xr=2,Ar=!0,Br=null,Lr="Logo.png",jr=["main","c"],Ur=3600,zr=1,Hr=!0,Gr="base64";var ie={$schema:Mr,title:Ir,description:Er,id:Tr,author:Pr,discordName:Fr,discordLink:Vr,versionNumber:Or,versionTitle:qr,allowGoBack:Dr,defaultShowSmall:Rr,defaultDecimalsShown:xr,useHeader:Ar,banner:Br,logo:Lr,initialTabs:jr,maxTickLength:Ur,offlineLimit:zr,enablePausing:Hr,exportEncoding:Gr};class Wr{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const i=new Yr(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class Yr{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const mn=17,Kr=9e15,Zr=Math.log10(9e15),Jr=1/9e15,Xr=308,Qr=-324,Qn=5,es=(1<<10)-1,ts=function(){const e=[];for(let n=Qr+1;n<=Xr;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),ut=[2,Math.E,3,4,5,6,7,8,9,10],ns=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.8804192098842727,2],[1,1.1121114330934079,1.231038924931609,1.3583836963111375,1.4960519303993531,1.6463542337511945,1.8121385357018724,1.996971324618307,2.2053895545527546,2.4432574483385254,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.1840100246247336,1.4061375836156955,1.6802272208863964,2.026757028388619,2.4770056063449646,3.080525271755482,3.9191964192627284,5.135152840833187,6.989961179534715,10]],is=[[-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]];let y=function(t){return l.fromValue_noAlloc(t)},B=function(e,t,n){return l.fromComponents(e,t,n)},G=function(t,n,i){return l.fromComponents_noNormalize(t,n,i)};const nt=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(s.toFixed(Math.max(i-r,0)))},gn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},rs=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const i=e*e;let r=e;return n=n+1/(12*r),r=r*i,n=n+1/(360*r),r=r*i,n=n+1/(1260*r),r=r*i,n=n+1/(1680*r),r=r*i,n=n+1/(1188*r),r=r*i,n=n+691/(360360*r),r=r*i,n=n+7/(1092*r),r=r*i,n=n+3617/(122400*r),Math.exp(n)/t},gi=.5671432904097838,ei=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return gi;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let r=0;r<100;++r){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n).5?1:-1;if(Math.random()*20<1)return G(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let r=Math.pow(10,i);return Math.random()>.9&&(r=Math.trunc(r)),B(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return m.floor(e.div(r).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(m.sub(1,n.pow(e))).div(m.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const s=t.add(i.mul(n)).sub(n.div(2)),o=s.pow(2);return s.neg().add(o.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const r=t.add(i.mul(n));return e.div(2).mul(r.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=Kr)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e0;)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){const t=e,n=m.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const T=parseFloat(i[0]),E=parseFloat(i[1]),Y=i[1].split(";");let se=1;if(Y.length===2&&(se=parseFloat(Y[1]),isFinite(se)||(se=1)),isFinite(T)&&isFinite(E)){const P=m.pentate(T,E,se);return this.sign=P.sign,this.layer=P.layer,this.mag=P.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const T=parseFloat(r[0]),E=parseFloat(r[1]),Y=r[1].split(";");let se=1;if(Y.length===2&&(se=parseFloat(Y[1]),isFinite(se)||(se=1)),isFinite(T)&&isFinite(E)){const P=m.tetrate(T,E,se);return this.sign=P.sign,this.layer=P.layer,this.mag=P.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}const s=e.split("^");if(s.length===2){const T=parseFloat(s[0]),E=parseFloat(s[1]);if(isFinite(T)&&isFinite(E)){const Y=m.pow(T,E);return this.sign=Y.sign,this.layer=Y.layer,this.mag=Y.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}e=e.trim().toLowerCase();let o,u,c=e.split("pt");if(c.length===2){o=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let T=parseFloat(c[1]);if(isFinite(T)||(T=1),isFinite(o)&&isFinite(u)){const E=m.tetrate(o,u,T);return this.sign=E.sign,this.layer=E.layer,this.mag=E.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){o=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let T=parseFloat(c[1]);if(isFinite(T)||(T=1),isFinite(o)&&isFinite(u)){const E=m.tetrate(o,u,T);return this.sign=E.sign,this.layer=E.layer,this.mag=E.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}const f=e.split("e"),p=f.length-1;if(p===0){const T=parseFloat(e);if(isFinite(T))return this.fromNumber(T),m.fromStringCache.size>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}else if(p===1){const T=parseFloat(e);if(isFinite(T)&&T!==0)return this.fromNumber(T),m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}const v=e.split("e^");if(v.length===2){this.sign=1,v[0].charAt(0)=="-"&&(this.sign=-1);let T="";for(let E=0;E=43&&Y<=57||Y===101)T+=v[1].charAt(E);else return this.layer=parseFloat(T),this.mag=parseFloat(v[1].substr(E+1)),this.normalize(),m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}if(p<1)return this.sign=0,this.layer=0,this.mag=0,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this;const w=parseFloat(f[0]);if(w===0)return this.sign=0,this.layer=0,this.mag=0,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this;let k=parseFloat(f[f.length-1]);if(p>=2){const T=parseFloat(f[f.length-2]);isFinite(T)&&(k*=Math.sign(T),k+=gn(T))}if(!isFinite(w))this.sign=f[0]==="-"?-1:1,this.layer=p,this.mag=k;else if(p===1)this.sign=Math.sign(w),this.layer=1,this.mag=k+Math.log10(Math.abs(w));else if(this.sign=Math.sign(w),this.layer=p,p===2){const T=m.mul(B(1,2,k),y(w));return this.sign=T.sign,this.layer=T.layer,this.mag=T.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}else this.mag=k;return this.normalize(),m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}fromValue(e){return e instanceof m?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:nt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:nt(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<=Qn?(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):nt(this.m,e)+"e"+nt(this.e,e):this.layer===1?nt(this.m,e)+"e"+nt(this.e,e):this.layer<=Qn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+nt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+nt(this.mag,e)}abs(){return G(this.sign===0?0:1,this.layer,this.mag)}neg(){return G(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?m.dZero:this.layer===0?B(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?m.dZero:this.layer===0?B(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?m.dZero:this.layer===0?B(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?m.dZero:this.layer===0?B(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=y(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 G(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(m.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return m.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),s=i.layer*Math.sign(i.mag);if(r-s>=2)return n;if(r===0&&s===-1){if(Math.abs(i.mag-Math.log10(n.mag))>mn)return n;{const o=Math.pow(10,Math.log10(n.mag)-i.mag),u=i.sign+n.sign*o;return B(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}if(r===1&&s===0){if(Math.abs(n.mag-Math.log10(i.mag))>mn)return n;{const o=Math.pow(10,n.mag-Math.log10(i.mag)),u=i.sign+n.sign*o;return B(Math.sign(u),1,Math.log10(i.mag)+Math.log10(Math.abs(u)))}}if(Math.abs(n.mag-i.mag)>mn)return n;{const o=Math.pow(10,n.mag-i.mag),u=i.sign+n.sign*o;return B(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}plus(e){return this.add(e)}sub(e){return this.add(y(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=y(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return G(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return G(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return m.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return B(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return B(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return B(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=B(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(B(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return B(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=B(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(B(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return B(n.sign*i.sign,r.layer+1,r.sign*r.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=y(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?m.dNaN:this.layer===0?B(this.sign,0,1/this.mag):B(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=y(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?1:nt.mag?1:this.mag0?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=y(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=y(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let i=this.mag,r=n.mag;return this.layer>n.layer&&(r=gn(r)),this.layer0?B(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):B(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?m.dNaN:this.layer>0?B(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):B(this.sign,0,Math.log10(this.mag))}log(e){return e=y(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?m.dNaN:this.layer===0&&e.layer===0?B(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):m.div(this.log10(),e.log10())}log2(){return this.sign<=0?m.dNaN:this.layer===0?B(this.sign,0,Math.log2(this.mag)):this.layer===1?B(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?B(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):B(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?m.dNaN:this.layer===0?B(this.sign,0,Math.log(this.mag)):this.layer===1?B(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?B(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):B(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=y(e),n=this,i=t;if(n.sign===0)return i.eq(0)?G(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return G(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const r=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?r.neg():Math.abs(i.toNumber()%2)%2===0?r:m.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return m.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return B(1,0,t);if(e.sign===0)return m.dOne;e=G(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?B(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?B(-e.sign,e.layer+1,-e.mag):m.dOne}pow_base(e){return y(e).pow(this)}root(e){const t=y(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?m.exp(m.mul(this,m.ln(this).sub(1))):m.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(G(1,0,24)))return m.fromNumber(rs(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let i=e,r=12*i,s=1/r,o=t+s;if(o===t||(t=o,i=i*n,r=360*i,s=1/r,o=t-s,o===t))return m.exp(t);t=o,i=i*n,r=1260*i;let u=1/r;return t=t+u,i=i*n,r=1680*i,u=1/r,t=t-u,m.exp(t)}else return this.layer===1?m.exp(m.mul(this,m.ln(this).sub(1))):m.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?m.dOne:this.layer===0&&this.mag<=709.7?m.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?B(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?B(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):B(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return m.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return B(1,2,Math.log10(this.mag)-.3010299956639812);{const e=m.div(G(this.sign,this.layer-1,this.mag),G(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=G(1,0,1)){if(e===1)return m.pow(this,t);if(e===0)return new m(t);if(this.eq(m.dOne))return m.dOne;if(this.eq(-1))return m.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return m.fromNumber(Math.E);const s=m.ln(this).neg();return s.lambertw().div(s)}else return r>1.444667861009766?m.fromNumber(Number.POSITIVE_INFINITY):m.dNaN}if(this.eq(m.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),m.fromNumber(r)}if(e<0)return m.iteratedlog(t,this,-e);t=y(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(m.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return G(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=G(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return m.tetrate(e,-t,this);e=y(e);let n=m.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const s=Math.min(t,n.layer-e.layer-3);t-=s,n.layer-=s}for(let s=0;s1e4)return n}return r>0&&r<1&&(e.eq(10)?n=n.layeradd10(-r):n=n.layeradd(-r,e)),n}slog(e=10,t=100){let n=.001,i=!1,r=!1,s=this.slog_internal(e).toNumber();for(let o=1;o1&&r!=c&&(i=!0),r=c,i?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),s+=n,n===0)break}return m.fromNumber(s)}slog_internal(e=10){if(e=y(e),e.lte(m.dZero)||e.eq(m.dOne))return m.dNaN;if(e.lt(m.dOne))return this.eq(m.dOne)?m.dZero:this.eq(m.dZero)?m.dNegOne:m.dNaN;if(this.mag<0||this.eq(m.dZero))return m.dNegOne;let t=0,n=m.fromDecimal(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(m.dZero))n=m.pow(e,n),t-=1;else{if(n.lte(m.dOne))return m.fromNumber(t+m.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=m.log(n,e)}return m.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:m.critical_section(e,t,is)}static tetrate_critical(e,t){return m.critical_section(e,t,ns)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let i=0,r=0;for(let o=0;oe){const u=(e-ut[o])/(ut[o+1]-ut[o]);i=n[o][Math.floor(t)]*(1-u)+n[o+1][Math.floor(t)]*u,r=n[o][Math.ceil(t)]*(1-u)+n[o+1][Math.ceil(t)]*u;break}const s=t-Math.floor(t);return i<=0||r<=0?i*(1-s)+r*s:Math.pow(e,Math.log(i)/Math.log(e)*(1-s)+Math.log(r)/Math.log(e)*s)}layeradd10(e){e=m.fromValue_noAlloc(e).toNumber();const t=m.fromDecimal(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let i=0;i<100;++i){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const i=this.slog(t).toNumber()+e;return i>=0?m.tetrate(t,i):Number.isFinite(i)?i>=-1?m.log(m.tetrate(t,i+1),t):m.log(m.log(m.tetrate(t,i+2),t),t):m.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return m.fromNumber(ei(this.toNumber()));if(this.layer===0)return m.fromNumber(ei(this.sign*this.mag));if(this.layer===1)return ti(this);if(this.layer===2)return ti(this);if(this.layer>=3)return G(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return G(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=G(1,0,1)){t=y(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(m.dOne)?(++e,t=m.fromNumber(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r10)return t}return t}sin(){return this.mag<0?this:this.layer===0?m.fromNumber(Math.sin(this.sign*this.mag)):G(0,0,0)}cos(){return this.mag<0?m.dOne:this.layer===0?m.fromNumber(Math.cos(this.sign*this.mag)):G(0,0,0)}tan(){return this.mag<0?this:this.layer===0?m.fromNumber(Math.tan(this.sign*this.mag)):G(0,0,0)}asin(){return this.mag<0?this:this.layer===0?m.fromNumber(Math.asin(this.sign*this.mag)):G(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?m.fromNumber(Math.acos(this.toNumber())):this.layer===0?m.fromNumber(Math.acos(this.sign*this.mag)):G(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?m.fromNumber(Math.atan(this.sign*this.mag)):m.fromNumber(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 m.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return m.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?G(Number.NaN,Number.NaN,Number.NaN):m.ln(this.add(1).div(m.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(m.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let l=m;l.fromStringCache=new Wr(es);l.dZero=G(0,0,0);l.dOne=G(1,0,1);l.dNegOne=G(-1,0,1);l.dTwo=G(1,0,2);l.dTen=G(1,0,10);l.dNaN=G(Number.NaN,Number.NaN,Number.NaN);l.dInf=G(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);l.dNegInf=G(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);l.dNumberMax=B(1,0,Number.MAX_VALUE);l.dNumberMin=B(1,0,Number.MIN_VALUE);y=l.fromValue_noAlloc;B=l.fromComponents;G=l.fromComponents_noNormalize;l.fromMantissaExponent;l.fromMantissaExponent_noNormalize;const ss=new l(1);function $t(e,t,n=!0){let i=l.log10(e).floor(),r=l.div(e,l.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=ss,i=i.add(1));const s=i.gte(1e9)?De(i,Math.max(Math.max(t,3),ie.defaultDecimalsShown)):i.gte(1e4)?nn(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function nn(e,t){if(e==null)return"NaN";if(e=new l(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function hi(e,t){return e==null?"NaN":(e=new l(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ie.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const os=new l("eeee1000"),as=new l("e100000"),ni=new l("e1000"),vi=new l(1e9),ls=new l(1e6),us=new l(1e3),cs=new l(.98),ds=new l(.001),bi=new l(0);function De(e,t,n){if(t==null&&(t=ie.defaultDecimalsShown),n=n!=null?n:ie.defaultShowSmall,e=new l(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+De(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(os)){const i=e.slog();return i.gte(ls)?"F"+De(i.floor()):l.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+nn(i.floor(),0)}else{if(e.gte(as))return $t(e,0,!1);if(e.gte(ni))return $t(e,0);if(e.gte(vi))return $t(e,t);if(e.gte(us))return nn(e,0);if(e.gte(ds)||!n)return hi(e,t);if(e.eq(bi))return 0 .toFixed(t)}return e=_i(e),e.lt(ni)?$t(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):De(e,t)+"\u207B\xB9"}function qe(e){return e=new l(e),e.sign<0?"-"+qe(e.neg()):e.gte(vi)||e.lte(cs)&&!e.eq(bi)?De(e):De(e,0)}function yi(e){return l.lt(e,0)?"-"+yi(l.neg(e)):l.gt(e,2**51)?De(l.div(e,31536e3))+"y":(e=new l(e).toNumber(),e<60?De(e)+"s":e<3600?qe(Math.floor(e/60))+"m "+De(e%60)+"s":e<86400?qe(Math.floor(e/3600))+"h "+qe(Math.floor(e/60)%60)+"m "+qe(e%60)+"s":e<31536e3?qe(Math.floor(e/84600)%365)+"d "+qe(Math.floor(e/3600)%24)+"h "+qe(Math.floor(e/60)%60)+"m":qe(Math.floor(e/31536e3))+"y "+qe(Math.floor(e/84600)%365)+"d "+qe(Math.floor(e/3600)%24)+"h")}function fs(e,t,n){e=new l(e);let i=e.toStringWithDecimalPlaces(t);return new l(i).gte(n)&&(i=l.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function ps(e,t){return De(e,t,!0)}function _i(e){let t=l.log10(e).ceil();const n=l.div(e,l.pow(10,t));return t=t.neg(),e=new l(10).pow(t).times(n),e}var ms=Object.freeze(Object.defineProperty({__proto__:null,default:l,exponentialFormat:$t,commaFormat:nn,regularFormat:hi,format:De,formatWhole:qe,formatTime:yi,toPlaces:fs,formatSmall:ps,invertOOM:_i},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:gs,commaFormat:hs,regularFormat:vs,format:Ce,formatWhole:Se,formatTime:cn,toPlaces:bs,formatSmall:Vt,invertOOM:ys}=ms;window.Decimal=l;window.exponentialFormat=gs;window.commaFormat=hs;window.regularFormat=vs;window.format=Ce;window.formatWhole=Se;window.formatTime=cn;window.toPlaces=bs;window.formatSmall=Vt;window.invertOOM=ys;function wi(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function ft(e){return typeof e=="function"}var Q=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(Q||{});const Ot=Symbol("DoNotCache");function _(e,t){const n=e[t];ft(n)&&n.length===0&&!n[Ot]?e[t]=M(n.bind(e)):ft(n)&&(e[t]=n.bind(e),e[t][Ot]=!0)}function Ue(e){return ft(e)&&!e[Ot]&&(e=M(e)),e}const ge=Symbol("Component"),ye=Symbol("GatherProps");let _s=0;function Me(e="feature-"){return e+_s++}var W=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(W||{});function we(e){const t=a(e);return t!==2&&t!==!1}function Re(e){return a(e)===1}function L(e){return e[Ot]=!0,e}function H(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Ni(e,...t){const n=[],i=r=>{Object.keys(r).forEach(s=>{const o=r[s];o!=null&&typeof o=="object"&&(t.includes(o.type)?n.push(o):!(o instanceof l)&&!be(o)&&i(o))})};return i(e),n}const ct={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 Sn=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Sn||{}),Xe={classic:ct,paper:{...ct,variables:{...ct.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:{...ct,variables:{...ct.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:{...ct,variables:{...ct.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const ve=pi();"fonts"in document&&(document.fonts.onloadingdone=()=>ve.emit("fontsLoaded"));var ws=Object.freeze(Object.defineProperty({__proto__:null,globalBus:ve},Symbol.toStringTag,{value:"Module"}));const Ns=At({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var R=window.player=Ns;function Ci(e){return JSON.stringify(e,(t,n)=>a(n))}function ki(e={}){return Object.assign({id:`${ie.id}-0`,name:"Default Save",tabs:ie.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ie.id,modVersion:ie.versionNumber,layers:{}},e)}function Fe(e){const t=it.compressToUTF16(Ci(e!=null?e:R));return localStorage.setItem((e!=null?e:R).id,t),t}async function Cs(){Ss();try{let e=localStorage.getItem(J.active);if(e==null){await pt(_t());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=it.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ie.id){await pt(_t());return}t.id=J.active,await pt(t)}catch(e){console.error(`Failed to load save. Falling back to new save. `,e),await pt(_t())}}function _t(){const e=Jt(),t=ki({id:e});return Fe(t),J.saves.push(e),t}function Jt(){let e,t=0;do e=`${ie.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const $n=O(!1);async function pt(e){console.info("Loading save",e),$n.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await tn(()=>Promise.resolve().then(function(){return Gs}),void 0),{fixOldSave:r,getInitialLayers:s}=await tn(()=>Promise.resolve().then(function(){return jd}),void 0);for(const o in t){const u=t[o];u&&n(u)}s(e).forEach(o=>i(o,e)),e=ki(e),e.offlineProd&&e.time!=null&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,ie.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ie.versionNumber&&(r(e.modVersion,e),e.modVersion=ie.versionNumber),Object.assign(R,e),J.active=R.id,ve.emit("onLoad")}setInterval(()=>{R.autosave&&Fe()},1e3);window.onbeforeunload=()=>{R.autosave&&Fe()};window.save=Fe;const ks=window.hardReset=async()=>{await pt(_t())};window.deleteLowerSaves=()=>{const e=Object.values(J.saves).indexOf(R.id)+1;Object.values(J.saves).slice(e).forEach(t=>localStorage.removeItem(t)),J.saves=J.saves.slice(0,e)};const qt=At({active:"",saves:[],showTPS:!0,theme:Sn.Nordic,unthrottled:!1,alignUnits:!1});Be(qt,e=>{const t=it.compressToUTF16(JSON.stringify(e));localStorage.setItem(ie.id,t)},{deep:!0});var J=window.settings=qt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Sn.Nordic,alignUnits:!1};ve.emit("loadSettings",e),Object.assign(qt,e),ks()};function Ss(){try{let e=localStorage.getItem(ie.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=it.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(qt,t)}ve.emit("loadSettings",qt)}catch{}}const Si=At([]);function $i(e){Si.push(e)}const Mi=At([]);function $s(e){Mi.push(e)}const Ms=At([]),Is={class:"table"},Xt=D({__name:"Column",setup(e){const t=M(()=>Xe[J.theme].mergeAdjacent);return(n,i)=>(h(),S("div",Is,[g("div",{class:te(["col",{mergeAdjacent:a(t)}])},[je(n.$slots,"default")],2)]))}}),Es={class:"table"},Et=D({__name:"Row",setup(e){const t=M(()=>Xe[J.theme].mergeAdjacent);return(n,i)=>(h(),S("div",Es,[g("div",{class:te(["row",{mergeAdjacent:a(t)}])},[je(n.$slots,"default")],2)]))}});function Ii(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Cn(e)}function j(e,t="span"){return typeof e=="function"?D({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),D({template:e})):D({render:()=>({})}):e}function de(e){if(Ve(e))return typeof e=="function"?e():j(e);const t=e[ge];return d(t,e[ye](),null)}function xe(...e){let t;return d(Et,null,Ii(t=e.map(de))?t:{default:()=>[t]})}function Ts(...e){let t;return d(Xt,null,Ii(t=e.map(de))?t:{default:()=>[t]})}function Ke(e){if(Ve(e))return typeof e=="function"?e():typeof e=="string"?d(U,null,[e]):d(e,null,null);const t=e[ge];return d(t,e[ye](),null)}function ii(e,t){return e.reduce((n,i)=>d(U,null,[n,t,i]))}function Ve(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Ot]===!0}function Mn(e,t){const n=O(null),i=O(void 0);function r(u){n.value||(n.value=setInterval(o,250)),i.value=u}function s(){n.value&&(clearInterval(n.value),n.value=null)}function o(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return di(s),{start:r,stop:s,handleHolding:o}}function Nt(e,t="div"){const n=Ne();return Pe(()=>{n.value=j(ue(e),t)}),n}function Qe(e,t="div"){const n=Ne(null);return Pe(()=>{const i=ue(e);n.value=i==""||i==null?null:j(i,t)}),n}function ue(e){return a(a(e))}function N(...e){return e.includes(Object)||e.push(Object),e}const Ps=D({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var p;const n=O({}),i=new ResizeObserver(u),r=O(null);Bt(()=>{const v=r.value;v!=null&&i.observe(v)});let s=!0,o=O((p=r.value)==null?void 0:p.getBoundingClientRect());function u(){s&&(s=!1,Ze(()=>{var v;o.value=(v=r.value)==null?void 0:v.getBoundingClientRect(),Object.values(n.value).filter(w=>w).forEach(w=>w.rect=w.element.getBoundingClientRect()),t("updateNodes",n.value),s=!0}))}ve.on("fontsLoaded",u);const c={attributes:!1,childList:!0,subtree:!1};Wt(In,(v,w)=>{const k=new MutationObserver(()=>f(v));k.observe(w,c),n.value[v]={element:w,observer:k,rect:w.getBoundingClientRect()},u()}),Wt(En,v=>{var w;(w=n.value[v])==null||w.observer.disconnect(),n.value[v]=void 0,u()}),Wt(Tn,n),Wt(Pn,o);function f(v){const w=n.value[v];w!=null&&(w.rect=w.element.getBoundingClientRect(),t("updateNodes",n.value))}return(v,w)=>(h(),S(U,null,[je(v.$slots,"default",{},void 0,!0),g("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var Ei=z(Ps,[["__scopeId","data-v-2b1dc1bc"]]);const Fs=["onPointerdown"],Vs={class:"modal-wrapper"},Os={class:"modal-container"},qs={class:"modal-header"},Ds=C(" default header "),Rs={class:"modal-body"},xs=C(" default body "),As={class:"modal-footer"},Bs=g("div",{class:"modal-default-flex-grow"},null,-1),at=D({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=le(e),s=M(()=>a(r.modelValue)||u.value);function o(){n("update:modelValue",!1)}const u=O(!1),c=O(null),f=M(()=>{var p,v;return(v=(p=c.value)==null?void 0:p.nodes)!=null?v:null});return t({isOpen:s,nodes:f}),(p,v)=>(h(),q(ar,{to:"#modal-root"},[d(ln,{name:"modal",onBeforeEnter:v[0]||(v[0]=w=>u.value=!0),onAfterLeave:v[1]||(v[1]=w=>u.value=!1)},{default:x(()=>[an(g("div",ze({class:"modal-mask",onPointerdown:Pt(o,["self"])},p.$attrs),[g("div",Vs,[g("div",Os,[g("div",qs,[je(p.$slots,"header",{shown:a(s)},()=>[Ds])]),g("div",Rs,[d(Ei,{ref_key:"contextRef",ref:c},{default:x(()=>[je(p.$slots,"body",{shown:a(s)},()=>[xs])]),_:3},512)]),g("div",As,[je(p.$slots,"footer",{shown:a(s)},()=>[g("div",{class:"modal-default-footer"},[Bs,g("button",{class:"button modal-default-button",onClick:o}," Close ")])])])])])],16,Fs),[[or,e.modelValue]])]),_:3})]))}}),dt=Symbol("ProxyState");function ce(e,t={}){const n=t;let i=!1;function r(){return i||(Object.assign(n,e(n)),i=!0),n}return new Proxy(n,{get(s,o){if(o===dt)return r();const u=r()[o];return u!=null&&typeof u=="object"&&Dt in u?u[Dt]:u},set(s,o,u){return r()[o]=u,!0},has(s,o){return o===dt?!0:Reflect.has(r(),o)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(s,o){return i||(Object.assign(n,e(n)),i=!0),Object.getOwnPropertyDescriptor(s,o)}})}var _e=window.state=un({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const wt=Symbol("PersistentState"),ot=Symbol("DefaultValue"),rn=Symbol("StackTrace"),sn=Symbol("Deleted"),Dt=Symbol("NonPersistent"),mt=Symbol("SaveDataPath");function Ls(){var e,t;return(t=(e=new Error().stack)==null?void 0:e.split(` `).slice(3,5).map(n=>n.trim()).join(` `))!=null?t:""}function ri(e,t){var n;if(l.isNaN(t))throw _e.hasNaN||(R.autosave=!1,_e.hasNaN=!0,_e.NaNPath=e[mt],_e.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[mt])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[wt].value=t}function me(e,t=!0){const n=be(e)?e:O(e);be(e)&&(e=e.value);const i=M({get(){return n.value},set(s){t?ri(r,s):r[wt].value=s}});i[ot]=e;const r={get value(){return n.value},set value(s){t?ri(r,s):r[wt].value=s},__v_isRef:!0,[wt]:n,[ot]:e,[rn]:Ls(),[sn]:!1,[Dt]:i,[mt]:void 0};return Ee.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` Created at: `+r[rn]):gt[Ee[Ee.length-1]].add(r),r}function js(e){return e!=null&&typeof e=="object"&&wt in e}function Mt(e){return e[Dt]}function Us(e){Ee.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):gt[Ee[Ee.length-1]].delete(e),e[sn]=!0}ve.on("addLayer",(e,t)=>{const n=[],i=(r,s=[])=>{let o=!1;return Object.keys(r).forEach(u=>{let c=r[u];if(c!=null&&typeof c=="object")if(dt in c&&(c=c[dt]),js(c)){if(o=!0,c[sn]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` Created at: `+c[rn]);return}gt[e.id].delete(c);const f=[e.id,...s,u];c[mt]!=null&&JSON.stringify(f)!==JSON.stringify(c[mt])&&console.error(`Persistent ref is being saved to \`${f.join(".")}\` when it's already present at \`${c[mt].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[mt]=f;const p=s.reduce((w,k)=>(k in w||(w[k]={}),w[k]),t),v=p[u];p[u]=c[wt],lr(p)?v!=null?p[u]=v:p[u]=c[ot]:v!=null?p[u].value=v:p[u].value=c[ot]}else!(c instanceof l)&&!be(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...s,u])&&(Je(c)&&!Je(r)?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.",dt in r?r[dt]:r,u):o=!0))}),o};i(e[dt]),gt[e.id].forEach(r=>{r[sn]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,` Created at: `+r[rn])}),gt[e.id].clear()});const In=Symbol("RegisterNode"),En=Symbol("UnregisterNode"),Tn=Symbol("Nodes"),Pn=Symbol("Bounds"),$e=un({});window.layers=$e;const gt={},Ee=[];function Lt(e,t){return ce(()=>{const n={},i=n.emitter=pi();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=O({}),n.id=e,Ee.push(e),gt[e]=new Set,n.minimized=me(!1,!1),Object.assign(n,t.call(n)),Ee[Ee.length-1]==null||Ee[Ee.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen Stack: ${Ee} Trying to pop ${n.id}`;Ee.pop(),_(n,"color"),_(n,"display"),_(n,"classes"),_(n,"style"),_(n,"name"),H(n,"name",n.id),_(n,"minWidth"),H(n,"minWidth",600),_(n,"minimizable"),H(n,"minimizable",!0),_(n,"minimizedDisplay");const r=n.style;return n.style=M(()=>{var o,u;let s=a(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(o=a(r))!=null?o:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),n})}function Ti(e,t){if(console.info("Adding layer",e.id),$e[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,$e[e.id]);return}H(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),$e[e.id]=e,ve.emit("addLayer",e,t.layers[e.id])}function zs(e){return $e[e]}function Pi(e){console.info("Removing layer",e.id),ve.emit("removeLayer",e),$e[e.id]=void 0}function Hs(e){Pi(e),Ti(e,R)}function Fi(e){const t=O(!1);return{openModal:()=>t.value=!0,modal:L(()=>d(at,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>d("h2",null,[a(e.name)]),body:a(e.display)}))}}ve.on("update",function(t){Object.values($e).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values($e).forEach(n=>{n==null||n.emit("update",t)}),Object.values($e).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Gs=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:In,UnregisterNodeInjectionKey:En,NodesInjectionKey:Tn,BoundsInjectionKey:Pn,layers:$e,persistentRefs:gt,addingLayers:Ee,createLayer:Lt,addLayer:Ti,getLayer:zs,removeLayer:Pi,reloadLayer:Hs,setupLayerModal:Fi},Symbol.toStringTag,{value:"Module"}));const Ws=D({components:{Context:Ei},props:{index:{type:Number,required:!0},display:{type:N(Object,String,Function),required:!0},minimizedDisplay:N(Object,String,Function),minimized:{type:Object,required:!0},name:{type:N(String),required:!0},color:N(String),minimizable:N(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=le(e),s=Nt(t),o=Qe(r),u=M(()=>ie.allowGoBack&&n.value>0&&!ue(i));function c(){R.tabs.splice(a(e.index),1/0)}function f(p){e.nodes.value=p}return{component:s,minimizedComponent:o,showGoBack:u,updateNodes:f,unref:a,goBack:c}}}),Ys={key:1};function Ks(e,t,n,i,r,s){const o=he("Context");return h(),S("div",{class:"layer-container",style:ee({"--layer-color":e.unref(e.color)})},[e.showGoBack?(h(),S("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...u)=>e.goBack&&e.goBack(...u))},"\u274C")):V("",!0),e.unref(e.minimized)?(h(),S("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=u=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(h(),q(re(e.minimizedComponent),{key:0})):(h(),S("div",Ys,X(e.unref(e.name)),1))])):(h(),S("div",{key:2,class:te(["layer-tab",{showGoBack:e.showGoBack}])},[d(o,{onUpdateNodes:e.updateNodes},{default:x(()=>[(h(),q(re(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(h(),S("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=u=>e.$emit("setMinimized",!0))}," \u25BC ")):V("",!0)],4)}var Zs=z(Ws,[["render",Ks],["__scopeId","data-v-a592996e"]]);const Vi=e=>(Ge("data-v-4b4bda40"),e=e(),We(),e),Js=Vi(()=>g("h2",null,"Changelog",-1)),Xs=Vi(()=>g("details",{open:""},[g("summary",null,[C("v0.0 Initial Commit - "),g("time",null,"2021-09-04")]),C(" This is the first release :D "),g("ul",null,[g("li",{class:"feature"},"Did everything"),g("li",{class:"fix"},"Had some fun"),g("li",{class:"breaking"},"Removed everything"),g("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Qs=D({__name:"Changelog",setup(e,{expose:t}){const n=O(!1);return t({open(){n.value=!0}}),(i,r)=>(h(),q(at,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s)},{header:x(()=>[Js]),body:x(()=>[Xs]),_:1},8,["modelValue"]))}});var eo=z(Qs,[["__scopeId","data-v-4b4bda40"]]),to=D({props:{element:Object,display:{type:N(Object,String,Function),required:!0},style:N(Object,String,Array),classes:N(Object),direction:N(String),xoffset:N(String),yoffset:N(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=le(e),r=O(!1),s=M(()=>(ue(i)||r.value)&&o.value),o=Qe(n),u=Ne(j(L(()=>{const p=ue(t);return p==null?"":Ke(p)})));function c(p){const v=i;p.shiftKey&&v&&(v.value=!v.value,p.stopPropagation(),p.preventDefault())}const f=M(()=>ue(i)&&Xe[J.theme].showPin);return{Direction:Q,isHovered:r,isShown:s,comp:o,elementComp:u,unref:a,togglePinned:c,showPin:f}}});const no={key:0,class:"material-icons pinned"};function io(e,t,n,i,r,s){return h(),S("div",{class:te(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=o=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=o=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...o)=>e.togglePinned&&e.togglePinned(...o))},[je(e.$slots,"default",{},void 0,!0),e.elementComp?(h(),q(re(e.elementComp),{key:0})):V("",!0),d(ln,{name:"fade"},{default:x(()=>{var o;return[e.isShown?(h(),S("div",{key:0,class:te(["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:ee([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(o=e.unref(e.style))!=null?o:{}])},[e.showPin?(h(),S("span",no,"push_pin")):V("",!0),e.comp?(h(),q(re(e.comp),{key:1})):V("",!0)],6)):V("",!0)]}),_:1})],34)}var ae=z(to,[["render",io],["__scopeId","data-v-6102fa3a"]]);const ht=e=>(Ge("data-v-5d3cb6f4"),e=e(),We(),e),ro={class:"info-modal-header"},so=["src","alt"],oo={class:"info-modal-title"},ao={key:0},lo={key:0},uo={key:0},co=ht(()=>g("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),fo=ht(()=>g("br",null,null,-1)),po=ht(()=>g("br",null,null,-1)),mo=["href"],go=ht(()=>g("span",{class:"material-icons info-modal-discord"},"discord",-1)),ho=ht(()=>g("div",null,[g("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[g("span",{class:"material-icons info-modal-discord"},"discord"),C(" The Paper Pilot Community ")])],-1)),vo=ht(()=>g("div",null,[g("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[g("span",{class:"material-icons info-modal-discord"},"discord"),C(" The Modding Tree ")])],-1)),bo=ht(()=>g("br",null,null,-1));var yo=D({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:s,discordName:o,discordLink:u,versionNumber:c,versionTitle:f}=ie,p=le(n),v=O(!1),w=M(()=>cn(R.timePlayed)),k=M(()=>j(L(()=>d(U,null,[Mi.map(de)]))));t({open(){v.value=!0}});function T(){var E;(E=a(p.changelog))==null||E.open()}return(E,Y)=>(h(),q(at,{modelValue:v.value,"onUpdate:modelValue":Y[0]||(Y[0]=se=>v.value=se)},{header:x(()=>[g("div",ro,[a(r)?(h(),S("img",{key:0,class:"info-modal-logo",src:a(r),alt:a(i)},null,8,so)):V("",!0),g("div",oo,[g("h2",null,X(a(i)),1),g("h4",null,[C(" v"+X(a(c)),1),a(f)?(h(),S("span",ao,": "+X(a(f)),1)):V("",!0)])])])]),body:x(({shown:se})=>[se?(h(),S("div",lo,[a(s)?(h(),S("div",uo,"By "+X(a(s)),1)):V("",!0),co,fo,g("div",{class:"link",onClick:T},"Changelog"),po,g("div",null,[a(u)?(h(),S("a",{key:0,href:a(u),class:"info-modal-discord-link",target:"_blank"},[go,C(" "+X(a(o)),1)],8,mo)):V("",!0)]),ho,vo,bo,g("div",null,"Time Played: "+X(a(w)),1),(h(),q(re(a(k))))])):V("",!0)]),_:1},8,["modelValue"]))}});var _o=z(yo,[["__scopeId","data-v-5d3cb6f4"]]);const wo={class:"field"},No={key:0,class:"field-title"},Fn=D({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var o;const n=e,i=Qe(st(n,"title"),"span"),r=O((o=n.options.find(u=>u.value===n.modelValue))!=null?o:null);Be(st(n,"modelValue"),u=>{var c;ue(r)!==u&&(r.value=(c=n.options.find(f=>f.value===u))!=null?c:null)});function s(u){t("update:modelValue",u.value)}return(u,c)=>(h(),S("div",wo,[a(i)?(h(),S("span",No,[(h(),q(re(a(i))))])):V("",!0),d(a(mr),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=f=>r.value=f),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const Co={class:"field"},ko=D({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=M(()=>{var s;return j((s=a(n.title))!=null?s:"","span")}),r=M({get(){return!!n.modelValue},set(s){t("update:modelValue",s)}});return(s,o)=>(h(),S("label",Co,[an(g("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":o[0]||(o[0]=u=>be(r)?r.value=u:null)},null,512),[[ur,a(r)]]),(h(),q(re(a(i))))]))}});var Te=z(ko,[["__scopeId","data-v-11046116"]]);const So=["onClick"],$o=D({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=O(!1),i=O(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,Ze(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(s,o)=>(h(),S("button",{onClick:Pt(r,["stop"]),class:te(["feedback",{activated:n.value,left:e.left}])},[je(s.$slots,"default",{},void 0,!0)],10,So))}});var Oi=z($o,[["__scopeId","data-v-01a1b95c"]]);const Mo={class:"header"},Io=g("h2",null,"Settings",-1),Eo={class:"option-tabs"},To={key:0},Po=C("Manually save"),Fo={key:1};var Vo=D({__name:"Options",setup(e,{expose:t}){const n=O(!1),i=O("behaviour");function r(pe){return pe==i.value}function s(pe){i.value=pe}t({isTab:r,setTab:s,save:Fe,open(){n.value=!0}});const o=Object.keys(Xe).map(pe=>({label:wi(pe),value:pe})),u=M(()=>j(L(()=>d(U,null,[Si.map(de)])))),{showTPS:c,theme:f,unthrottled:p,alignUnits:v}=le(J),{autosave:w,offlineProd:k}=le(R),T=M({get(){return R.devSpeed===0},set(pe){R.devSpeed=pe?0:null}}),E=L(()=>d("span",{class:"option-title"},[C("Unthrottled"),d("desc",null,[C("Allow the game to run as fast as possible. Not battery friendly.")])])),Y=L(()=>d("span",{class:"option-title"},[C("Offline Production"),d(ae,{display:"Save-specific",direction:Q.Right},{default:()=>[C("*")]}),d("desc",null,[C("Simulate production that occurs while the game is closed.")])])),se=L(()=>d("span",{class:"option-title"},[C("Autosave"),d(ae,{display:"Save-specific",direction:Q.Right},{default:()=>[C("*")]}),d("desc",null,[C("Automatically save the game every second or when the game is closed.")])])),P=L(()=>d("span",{class:"option-title"},[C("Pause game"),d(ae,{display:"Save-specific",direction:Q.Right},{default:()=>[C("*")]}),d("desc",null,[C("Stop everything from moving.")])])),F=L(()=>d("span",{class:"option-title"},[C("Theme"),d("desc",null,[C("How the game looks.")])])),K=L(()=>d("span",{class:"option-title"},[C("Show TPS"),d("desc",null,[C("Show TPS meter at the bottom-left corner of the page.")])])),ke=L(()=>d("span",{class:"option-title"},[C("Align modifier units"),d("desc",null,[C("Align numbers to the beginning of the unit in modifier view.")])]));return(pe,A)=>(h(),q(at,{modelValue:n.value,"onUpdate:modelValue":A[10]||(A[10]=oe=>n.value=oe)},{header:x(()=>[g("div",Mo,[Io,g("div",Eo,[g("button",{class:te({selected:r("behaviour")}),onClick:A[0]||(A[0]=oe=>s("behaviour"))},"Behaviour",2),g("button",{class:te({selected:r("appearance")}),onClick:A[1]||(A[1]=oe=>s("appearance"))},"Appearance",2)])])]),body:x(()=>[r("behaviour")?(h(),S("div",To,[d(Te,{title:a(E),modelValue:a(p),"onUpdate:modelValue":A[2]||(A[2]=oe=>be(p)?p.value=oe:null)},null,8,["title","modelValue"]),a(ie).enablePausing?(h(),q(Te,{key:0,title:a(P),modelValue:a(T),"onUpdate:modelValue":A[3]||(A[3]=oe=>be(T)?T.value=oe:null)},null,8,["title","modelValue"])):V("",!0),d(Te,{title:a(Y),modelValue:a(k),"onUpdate:modelValue":A[4]||(A[4]=oe=>be(k)?k.value=oe:null)},null,8,["title","modelValue"]),d(Te,{title:a(se),modelValue:a(w),"onUpdate:modelValue":A[5]||(A[5]=oe=>be(w)?w.value=oe:null)},null,8,["title","modelValue"]),a(w)?V("",!0):(h(),q(Oi,{key:1,class:"button save-button",onClick:A[6]||(A[6]=oe=>a(Fe)())},{default:x(()=>[Po]),_:1}))])):V("",!0),r("appearance")?(h(),S("div",Fo,[d(Fn,{title:a(F),options:a(o),modelValue:a(f),"onUpdate:modelValue":A[7]||(A[7]=oe=>be(f)?f.value=oe:null)},null,8,["title","options","modelValue"]),(h(),q(re(a(u)))),d(Te,{title:a(K),modelValue:a(c),"onUpdate:modelValue":A[8]||(A[8]=oe=>be(c)?c.value=oe:null)},null,8,["title","modelValue"]),d(Te,{title:a(ke),modelValue:a(v),"onUpdate:modelValue":A[9]||(A[9]=oe=>be(v)?v.value=oe:null)},null,8,["title","modelValue"])])):V("",!0)]),_:1},8,["modelValue"]))}});const Oo=["onSubmit"],qo={class:"field"},Do={key:0,class:"field-title"},Ro=["placeholder"],xo=D({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,i=Qe(st(n,"title"),"span"),r=Ne(null);Bt(()=>{var c;(c=r.value)==null||c.focus()});const s=M({get(){var c;return(c=a(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function o(){t("submit")}function u(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,f)=>(h(),S("form",{onSubmit:Pt(o,["prevent"])},[g("div",qo,[a(i)?(h(),S("span",Do,[(h(),q(re(a(i))))])):V("",!0),e.textArea?(h(),q(a(hr),{key:1,modelValue:a(s),"onUpdate:modelValue":f[0]||(f[0]=p=>be(s)?s.value=p:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:u,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):an((h(),S("input",{key:2,type:"text","onUpdate:modelValue":f[1]||(f[1]=p=>be(s)?s.value=p:null),placeholder:e.placeholder,class:te({fullWidth:!e.title}),onBlur:u,ref_key:"field",ref:r},null,42,Ro)),[[fi,a(s)]])])],40,Oo))}});var Vn=z(xo,[["__scopeId","data-v-90bd4994"]]);const Ao={key:0},Bo=["onClick","disabled"],Lo={key:0},jo=["onClick"],Uo=D({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=le(e),r=O(!1);Be(r,u=>{t("confirmingChanged",u)});function s(){if(a(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function o(){r.value=!1}return(u,c)=>(h(),S("span",{class:te(["container",{confirming:r.value}])},[r.value?(h(),S("span",Ao,"Are you sure?")):V("",!0),g("button",{onClick:Pt(s,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(h(),S("span",Lo,"Yes")):je(u.$slots,"default",{key:1},void 0,!0)],8,Bo),r.value?(h(),S("button",{key:1,class:"button",onClick:Pt(o,["stop"])},"No",8,jo)):V("",!0)],2))}});var zo=z(Uo,[["__scopeId","data-v-2f8ef34c"]]);const et=e=>(Ge("data-v-c3447434"),e=e(),We(),e),Ho=et(()=>g("div",{class:"handle material-icons"},"drag_handle",-1)),Go={key:0,class:"actions"},Wo=et(()=>g("span",{class:"material-icons"},"content_paste",-1)),Yo=et(()=>g("span",{class:"material-icons"},"content_copy",-1)),Ko=et(()=>g("span",{class:"material-icons"},"edit",-1)),Zo=et(()=>g("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Jo={key:1,class:"actions"},Xo=et(()=>g("span",{class:"material-icons"},"check",-1)),Qo=et(()=>g("span",{class:"material-icons"},"close",-1)),ea={key:2,class:"details"},ta={class:"save-version"},na=et(()=>g("br",null,null,-1)),ia={key:0},ra={key:3,class:"details"},sa={key:4,class:"details error"},oa=et(()=>g("br",null,null,-1)),aa=D({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=le(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=O(!1),o=O(!1),u=O("");Be(s,()=>{var v;return u.value=(v=i.value.name)!=null?v:""});const c=M(()=>i.value!=null&&i.value.id===R.id),f=M(()=>{var v;return c.value?R.time:(v=i.value!=null&&i.value.time)!=null?v:0});function p(){t("editName",u.value),s.value=!1}return(v,w)=>(h(),S("div",{class:te(["save",{active:a(c)}])},[Ho,s.value?(h(),S("div",Jo,[g("button",{onClick:p,class:"button"},[d(ae,{display:"Save",direction:a(Q).Left,class:"info"},{default:x(()=>[Xo]),_:1},8,["direction"])]),g("button",{onClick:w[5]||(w[5]=k=>s.value=!s.value),class:"button"},[d(ae,{display:"Cancel",direction:a(Q).Left,class:"info"},{default:x(()=>[Qo]),_:1},8,["direction"])])])):(h(),S("div",Go,[a(i).error==null&&!o.value?(h(),q(Oi,{key:0,onClick:w[0]||(w[0]=k=>t("export")),class:"button",left:""},{default:x(()=>[d(ae,{display:"Export",direction:a(Q).Left,class:"info"},{default:x(()=>[Wo]),_:1},8,["direction"])]),_:1})):V("",!0),a(i).error==null&&!o.value?(h(),S("button",{key:1,onClick:w[1]||(w[1]=k=>t("duplicate")),class:"button"},[d(ae,{display:"Duplicate",direction:a(Q).Left,class:"info"},{default:x(()=>[Yo]),_:1},8,["direction"])])):V("",!0),a(i).error==null&&!o.value?(h(),S("button",{key:2,onClick:w[2]||(w[2]=k=>s.value=!s.value),class:"button"},[d(ae,{display:"Edit Name",direction:a(Q).Left,class:"info"},{default:x(()=>[Ko]),_:1},8,["direction"])])):V("",!0),d(zo,{disabled:a(c),onClick:w[3]||(w[3]=k=>t("delete")),onConfirmingChanged:w[4]||(w[4]=k=>o.value=k)},{default:x(()=>[d(ae,{display:"Delete",direction:a(Q).Left,class:"info"},{default:x(()=>[Zo]),_:1},8,["direction"])]),_:1},8,["disabled"])])),a(i).error==null&&!s.value?(h(),S("div",ea,[g("button",{class:"button open",onClick:w[6]||(w[6]=k=>t("open"))},[g("h3",null,X(a(i).name),1)]),g("span",ta,"v"+X(a(i).modVersion),1),na,a(f)?(h(),S("div",ia,"Last played "+X(a(r).format(a(f))),1)):V("",!0)])):a(i).error==null&&s.value?(h(),S("div",ra,[d(Vn,{modelValue:u.value,"onUpdate:modelValue":w[7]||(w[7]=k=>u.value=k),class:"editname",onSubmit:p},null,8,["modelValue"])])):(h(),S("div",sa,[C(" Error: Failed to load save with id "+X(a(i).id),1),oa,C(X(a(i).error),1)]))],2))}});var la=z(aa,[["__scopeId","data-v-c3447434"]]);const On=e=>(Ge("data-v-5b5b1604"),e=e(),We(),e),ua=On(()=>g("h2",null,"Saves Manager",-1)),ca={class:"modal-footer"},da={class:"field"},fa=On(()=>g("span",{class:"field-title"},"Create Save",-1)),pa={class:"field-buttons"},ma={class:"footer"},ga=On(()=>g("div",{style:{"flex-grow":"1"}},null,-1)),ha=D({__name:"SavesManager",setup(e,{expose:t}){const n=O(!1),i=O(null);t({open(){n.value=!0}});const r=O(!1),s=O(""),o=O(null);Be(s,P=>{P?Ze(()=>{try{if(P[0]!=="{")if(P[0]==="e")P=decodeURIComponent(escape(atob(P)));else if(P[0]==="\u1BE1")P=it.decompressFromUTF16(P);else{console.warn("Unable to determine preset encoding",P),r.value=!0;return}const F=JSON.parse(P);if(typeof F!="object"){r.value=!0;return}const K=Jt();F.id=K,Fe(F),s.value="",r.value=!1,J.saves.push(K)}catch{r.value=!0}}):r.value=!1});let u={},c=O(Object.keys(u).reduce((P,F)=>(P.push({label:F.split("/").slice(-1)[0].slice(0,-4),value:u[F]}),P),[]));const f=un({});function p(P){if(f[P]==null){let F=localStorage.getItem(P);if(F==null)f[P]={error:"Save doesn't exist in localStorage",id:P};else if(F==="dW5kZWZpbmVk")f[P]={error:"Save is undefined",id:P};else try{if(F[0]!=="{")if(F[0]==="e")F=decodeURIComponent(escape(atob(F)));else if(F[0]==="\u1BE1")F=it.decompressFromUTF16(F);else return console.warn("Unable to determine preset encoding",F),r.value=!0,f[P]={error:"Unable to determine preset encoding",id:P},f[P];f[P]={...JSON.parse(F),id:P}}catch(K){f[P]={error:K,id:P},console.warn(`SavesManager: Failed to load info about save with id ${P}: ${K} ${F}`)}}return f[P]}Be(n,P=>{P&&Object.keys(f).forEach(F=>delete f[F])});const v=M(()=>J.saves.reduce((P,F)=>(P[F]=p(F),P),{}));function w(P){let F;switch(R.id===P?F=Ci(R):F=JSON.stringify(v.value[P]),ie.exportEncoding){default:console.warn(`Unknown save encoding: ${ie.exportEncoding}. Defaulting to lz`);case"lz":F=it.compressToUTF16(F);break;case"base64":F=btoa(unescape(encodeURIComponent(F)));break;case"plain":break}const K=document.createElement("textarea");K.value=F,document.body.appendChild(K),K.select(),K.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(K)}function k(P){R.id===P&&Fe();const F={...v.value[P],id:Jt()};Fe(F),J.saves.push(F.id)}function T(P){J.saves=J.saves.filter(F=>F!==P),localStorage.removeItem(P),f[P]=void 0}function E(P){v.value[R.id].time=R.time,Fe(),f[R.id]=void 0,pt(v.value[P]),f[P]=void 0}function Y(P){if(o.value=P,Ze(()=>{o.value=null}),P[0]!=="{")if(P[0]==="e")P=decodeURIComponent(escape(atob(P)));else if(P[0]==="\u1BE1")P=it.decompressFromUTF16(P);else{console.warn("Unable to determine preset encoding",P);return}const F=JSON.parse(P);F.id=Jt(),Fe(F),J.saves.push(F.id),E(F.id)}function se(P,F){const K=v.value[P];K!=null&&(K.name=F,R.id===P?(R.name=F,Fe()):(Fe(K),f[P]=void 0))}return(P,F)=>(h(),q(at,{modelValue:n.value,"onUpdate:modelValue":F[4]||(F[4]=K=>n.value=K),ref_key:"modal",ref:i},{header:x(()=>[ua]),body:x(({shown:K})=>[K?(h(),q(a(gr),{key:0,list:a(J).saves,handle:".handle",itemKey:ke=>ke},{item:x(({element:ke})=>[d(la,{save:a(v)[ke],onOpen:pe=>E(ke),onExport:pe=>w(ke),onEditName:pe=>se(ke,pe),onDuplicate:pe=>k(ke),onDelete:pe=>T(ke)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):V("",!0)]),footer:x(()=>[g("div",ca,[d(Vn,{modelValue:s.value,"onUpdate:modelValue":F[0]||(F[0]=K=>s.value=K),title:"Import Save",placeholder:"Paste your save here!",class:te({importingFailed:r.value})},null,8,["modelValue","class"]),g("div",da,[fa,g("div",pa,[g("button",{class:"button",onClick:F[1]||(F[1]=K=>E(a(_t)().id))},"New Game"),Object.keys(a(c)).length>0?(h(),q(Fn,{key:0,options:a(c),modelValue:o.value,"onUpdate:modelValue":F[2]||(F[2]=K=>Y(K)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):V("",!0)])]),g("div",ma,[ga,g("button",{class:"button modal-default-button",onClick:F[3]||(F[3]=K=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var qi=z(ha,[["__scopeId","data-v-5b5b1604"]]);const Oe=e=>(Ge("data-v-b0896196"),e=e(),We(),e),va=["src","alt"],ba={key:1,class:"title"},ya=Oe(()=>g("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),_a={class:"discord"},wa={class:"discord-links"},Na={key:0},Ca=["href"],ka=Oe(()=>g("li",null,[g("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Sa=Oe(()=>g("li",null,[g("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),$a={href:"https://forums.moddingtree.com/",target:"_blank"},Ma=Oe(()=>g("span",{class:"material-icons"},"forum",-1)),Ia=Oe(()=>g("span",{class:"material-icons"},"info",-1)),Ea=Oe(()=>g("span",{class:"material-icons"},"library_books",-1)),Ta=Oe(()=>g("span",{class:"material-icons"},"settings",-1)),Pa=Oe(()=>g("span",{class:"material-icons"},"library_books",-1)),Fa=Oe(()=>g("span",{class:"material-icons"},"settings",-1)),Va=Oe(()=>g("span",{class:"material-icons"},"info",-1)),Oa={href:"https://forums.moddingtree.com/",target:"_blank"},qa=Oe(()=>g("span",{class:"material-icons"},"forum",-1)),Da={class:"discord"},Ra={class:"discord-links"},xa={key:0},Aa=["href"],Ba=Oe(()=>g("li",null,[g("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),La=Oe(()=>g("li",null,[g("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),ja=D({__name:"Nav",setup(e){const t=O(null),n=O(null),i=O(null),r=O(null),{useHeader:s,banner:o,title:u,discordName:c,discordLink:f,versionNumber:p}=ie;function v(){window.open(f,"mywindow")}return(w,k)=>(h(),S(U,null,[a(s)?(h(),S("div",ze({key:0,class:"nav"},w.$attrs),[a(o)?(h(),S("img",{key:0,src:a(o),class:"banner",alt:a(u)},null,8,va)):(h(),S("div",ba,X(a(u)),1)),g("div",{onClick:k[0]||(k[0]=T=>{var E;return(E=r.value)==null?void 0:E.open()}),class:"version-container"},[d(ae,{display:"Changelog",direction:a(Q).Down,class:"version"},{default:x(()=>[g("span",null,"v"+X(a(p)),1)]),_:1},8,["direction"])]),ya,g("div",_a,[g("span",{onClick:v,class:"material-icons"},"discord"),g("ul",wa,[a(f)?(h(),S("li",Na,[g("a",{href:a(f),target:"_blank"},X(a(c)),9,Ca)])):V("",!0),ka,Sa])]),g("div",null,[g("a",$a,[d(ae,{display:"Forums",direction:a(Q).Down,yoffset:"5px"},{default:x(()=>[Ma]),_:1},8,["direction"])])]),g("div",{onClick:k[1]||(k[1]=T=>{var E;return(E=t.value)==null?void 0:E.open()})},[d(ae,{display:"Info",direction:a(Q).Down,class:"info"},{default:x(()=>[Ia]),_:1},8,["direction"])]),g("div",{onClick:k[2]||(k[2]=T=>{var E;return(E=n.value)==null?void 0:E.open()})},[d(ae,{display:"Saves",direction:a(Q).Down,xoffset:"-20px"},{default:x(()=>[Ea]),_:1},8,["direction"])]),g("div",{onClick:k[3]||(k[3]=T=>{var E;return(E=i.value)==null?void 0:E.open()})},[d(ae,{display:"Settings",direction:a(Q).Down,xoffset:"-66px"},{default:x(()=>[Ta]),_:1},8,["direction"])])],16)):(h(),S("div",ze({key:1,class:"overlay-nav"},w.$attrs),[g("div",{onClick:k[4]||(k[4]=T=>{var E;return(E=r.value)==null?void 0:E.open()}),class:"version-container"},[d(ae,{display:"Changelog",direction:a(Q).Right,xoffset:"25%",class:"version"},{default:x(()=>[g("span",null,"v"+X(a(p)),1)]),_:1},8,["direction"])]),g("div",{onClick:k[5]||(k[5]=T=>{var E;return(E=n.value)==null?void 0:E.open()})},[d(ae,{display:"Saves",direction:a(Q).Right},{default:x(()=>[Pa]),_:1},8,["direction"])]),g("div",{onClick:k[6]||(k[6]=T=>{var E;return(E=i.value)==null?void 0:E.open()})},[d(ae,{display:"Settings",direction:a(Q).Right},{default:x(()=>[Fa]),_:1},8,["direction"])]),g("div",{onClick:k[7]||(k[7]=T=>{var E;return(E=t.value)==null?void 0:E.open()})},[d(ae,{display:"Info",direction:a(Q).Right},{default:x(()=>[Va]),_:1},8,["direction"])]),g("div",null,[g("a",Oa,[d(ae,{display:"Forums",direction:a(Q).Right,xoffset:"7px"},{default:x(()=>[qa]),_:1},8,["direction"])])]),g("div",Da,[g("span",{onClick:v,class:"material-icons"},"discord"),g("ul",Ra,[a(f)?(h(),S("li",xa,[g("a",{href:a(f),target:"_blank"},X(a(c)),9,Aa)])):V("",!0),Ba,La])])],16)),d(_o,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),d(qi,{ref_key:"savesManager",ref:n},null,512),d(Vo,{ref_key:"options",ref:i},null,512),d(eo,{ref_key:"changelog",ref:r},null,512)],64))}});var Di=z(ja,[["__scopeId","data-v-b0896196"]]);const Ua={class:"inner-tab"},za=D({__name:"Game",setup(e){const t=st(R,"tabs"),n=M(()=>Object.keys($e)),i=ie.useHeader;function r(s){const{display:o,minimized:u,name:c,color:f,minimizable:p,nodes:v,minimizedDisplay:w}=s;return{display:o,minimized:u,name:c,color:f,minimizable:p,nodes:v,minimizedDisplay:w}}return(s,o)=>(h(),S("div",{class:te(["tabs-container",{useHeader:a(i)}])},[(h(!0),S(U,null,Ft(a(t),(u,c)=>{var f,p;return h(),S("div",{key:c,class:te(["tab",a((f=a($e)[u])==null?void 0:f.classes)]),style:ee(a((p=a($e)[u])==null?void 0:p.style))},[c===0&&!a(i)?(h(),q(Di,{key:0})):V("",!0),g("div",Ua,[a(n).includes(u)?(h(),q(Zs,ze({key:0},r(a($e)[u]),{index:c,onSetMinimized:v=>a($e)[u].minimized.value=v}),null,16,["index","onSetMinimized"])):(h(),q(re(u),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Ha=z(za,[["__scopeId","data-v-3e0f1aab"]]);const Ga={},Wa=e=>(Ge("data-v-89b4b00a"),e=e(),We(),e),Ya=Wa(()=>g("svg",{id:"eaRe02fYmMp1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 228 521","shape-rendering":"geometricPrecision","text-rendering":"geometricPrecision"},[g("g",{id:"P"},[g("path",{d:"m 101,512.877 c -17.547386,-5.3519 -50.794681,-10.26296 -80,0 10.737201,-217.43031 5.7244,-300.999 0,-464.9995 0,0 46.6144,-37.1164 80,-42.00002 33.386,-4.883633 86.025,10.45942 120,50.00002 5,30 -4.353,106.6565 -44,156.0005 -34.149,42.5 -130,38.48 -130,92.999 0,102 54,208 54,208 z",style:{display:"inline",fill:"none",stroke:"rgb(163, 190, 140)","stroke-width":"10","stroke-linecap":"round","stroke-miterlimit":"16"},id:"trunk",class:"svg-elem-1"}),g("path",{d:"M 221,55.8775 C 209.023,126.453 185.39,166.835 158.997,191.5 93.783098,252.444 11.718998,217.436 46.999998,304.877",style:{display:"inline",fill:"none",stroke:"rgb(163, 190, 140)","stroke-width":"5","stroke-linecap":"round","stroke-miterlimit":"16"},id:"vine2",class:"svg-elem-2"}),g("path",{d:"m 194.5,188 c -11.225,4.447 -19.066,5.134 -35.503,3.5",style:{display:"inline",fill:"none",stroke:"rgb(163, 190, 140)","stroke-width":"5","stroke-linecap":"round","stroke-miterlimit":"16"},id:"short_vine4",class:"svg-elem-3"}),g("path",{d:"M 73.499996,246.5 C 111.145,245.626 127.011,238.775 156.5,228",style:{display:"inline",fill:"none",stroke:"rgb(163, 190, 140)","stroke-width":"5","stroke-linecap":"round","stroke-miterlimit":"16"},id:"short_vine3",class:"svg-elem-4"}),g("path",{d:"M 221,55.8775 C 169.5,17.8262 86.0943,44.9468 47,107 c -4.743,7.528 -7.1041,15.373 -8.326,24 -3.5282,24.91 2.4426,56.34 -12.0011,105.5",style:{display:"inline",fill:"none",stroke:"rgb(163, 190, 140)","stroke-width":"5","stroke-linecap":"round","stroke-miterlimit":"16"},id:"vine1",class:"svg-elem-5"}),g("path",{d:"M 21,47.8775 38.674,131",style:{display:"inline",fill:"none",stroke:"rgb(163, 190, 140)","stroke-width":"5","stroke-linecap":"round","stroke-miterlimit":"16"},id:"short_vine2",class:"svg-elem-6"}),g("path",{d:"m 3,326.5 c 13.1783,22.208 16.4863,42.834 21.6997,81",style:{display:"inline",fill:"none",stroke:"rgb(163, 190, 140)","stroke-width":"5","stroke-linecap":"round","stroke-miterlimit":"16"},id:"short_vine1",class:"svg-elem-7"})])],-1));function Ka(e,t){return h(),q(ln,{appear:""},{default:x(()=>[Ya]),_:1})}var Za=z(Ga,[["render",Ka],["__scopeId","data-v-89b4b00a"]]);const Ie=D({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(h(),S("div",{style:ee({width:e.width,height:e.height})},null,4))}});function Rt(e,t="points",n=0,i=void 0){const r=be(e)?e:me(e);if(r.displayName=t,r.precision=n,r.small=i,!be(e)){const s=r[Dt];s.displayName=t,s.precision=n,s.small=i}return r}function Ri(e){const t=me(e.value);return Be(e,n=>{$n.value||l.gt(n,t.value)&&(t.value=n)}),t}function Ja(e){const t=me(e.value);return Be(e,(n,i)=>{$n.value||l.gt(n,i)&&(t.value=l.add(t.value,l.sub(n,i)))}),t}const Xa=new l("10^^8"),Qa=new l("1e100");function el(e,t){const n=O(0),i=O(0),r=O(0);return ve.on("update",o=>{if(i.value=0,l.lte(e.value,Qa)){r.value=e.value;return}let u=e.value,c=r.value;if(r.value=u,l.gt(u,c))if(l.gte(u,Xa))u=l.slog(u,1e10),c=l.slog(c,1e10),n.value=u.sub(c).div(o),i.value=-1;else for(;l.div(u,c).log(10).div(o).gte("100")&&i.value<=5&&l.gt(c,0);)u=l.log10(u),c=l.log10(c),n.value=u.sub(c).div(o),i.value++}),M(()=>i.value===0?t?Ce(t.value,e.precision,e.small)+" "+e.displayName+"/s":"":Ce(n.value)+" OOM"+(i.value<0?"^OOM":"^"+i.value)+"s/sec")}function He(e,t){const n=t!=null?t:e.value;return l.eq(e.precision,0)?Se(e.small?n:l.floor(n)):Ce(n,e.precision,e.small)}const tl={key:0},nl={key:0,class:"mark star"},il=["src"],rl=D({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(h(),S("div",tl,[e.mark===!0?(h(),S("div",nl)):(h(),S("img",{key:1,class:"mark",src:e.mark},null,8,il))])):V("",!0)}});var Ct=z(rl,[["__scopeId","data-v-2207999f"]]);const sl=D({__name:"Node",props:{id:null},setup(e){const n=le(e),i=en(In,()=>{}),r=en(En,()=>{}),s=Ne(null),o=M(()=>s.value&&s.value.parentElement);return Be([o,n.id],([u,c],[f,p])=>{f&&r(a(p)),u&&i(c,u)}),di(()=>r(a(n.id))),(u,c)=>(h(),S("div",{class:"node",ref_key:"node",ref:s},null,512))}});var tt=z(sl,[["__scopeId","data-v-a48cb382"]]);const ol=D({props:{visibility:{type:N(Number,Boolean),required:!0},display:N(Object,String,Function),earned:{type:N(Boolean),required:!0},image:N(String),style:N(String,Object,Array),classes:N(Object),mark:N(Boolean,String),id:{type:String,required:!0}},components:{Node:tt,MarkNode:Ct},setup(e){const{display:t}=le(e);return{component:Qe(t),unref:a,Visibility:W,isVisible:we,isHidden:Re}}});function al(e,t,n,i,r,s){var c;const o=he("MarkNode"),u=he("Node");return e.isVisible(e.visibility)?(h(),S("div",{key:0,style:ee([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:te({feature:!0,achievement:!0,locked:!e.unref(e.earned),bought:e.unref(e.earned),...e.unref(e.classes)})},[e.component?(h(),q(re(e.component),{key:0})):V("",!0),d(o,{mark:e.unref(e.mark)},null,8,["mark"]),d(u,{id:e.id},null,8,["id"])],6)):V("",!0)}var ll=z(ol,[["render",al],["__scopeId","data-v-4ebd15db"]]);ve.on("setupVue",e=>e.use(vr));function qn(e="white",t="8px"){return{transform:"scale(1.05, 1.05)",borderColor:"rgba(0, 0, 0, 0.125)",boxShadow:`-4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0 0 ${t} ${e}`,zIndex:1}}function ul(){return qn("red","20px")}const cl=kn(),dl=Symbol("Achievement");function hn(e){const t=me(!1,!1);return ce(()=>{var i;const n=(i=e==null?void 0:e())!=null?i:{};if(n.id=Me("achievement-"),n.type=dl,n[ge]=ll,n.earned=t,n.complete=function(){t.value=!0},_(n,"visibility"),H(n,"visibility",W.Visible),_(n,"display"),_(n,"mark"),_(n,"image"),_(n,"style"),_(n,"classes"),n[ye]=function(){const{visibility:r,display:s,earned:o,image:u,style:c,classes:f,mark:p,id:v}=this;return{visibility:r,display:s,earned:o,image:u,style:a(c),classes:f,mark:p,id:v}},n.shouldEarn){const r=n;Pe(()=>{var s,o;if(J.active===R.id&&!r.earned.value&&we(r.visibility)&&((s=r.shouldEarn)==null?void 0:s.call(r))&&(r.earned.value=!0,(o=r.onComplete)==null||o.call(r),r.display!=null)){const u=j(a(r.display));cl.info(d("div",null,[d("h3",null,[C("Achievement earned!")]),d("div",null,[d(u,null,null)])]))}})}return n})}const fl=D({props:{visibility:{type:N(Number,Boolean),required:!0},onClick:Function,onHold:Function,display:{type:N(Object,String,Function),required:!0},title:N(Object,String,Function),style:N(String,Object,Array),canClick:{type:N(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:tt},setup(e){const{onClick:t,onHold:n,title:i,display:r}=le(e),{start:s,stop:o}=Mn(t,n),u=Qe(i),c=Nt(r);return{start:s,stop:o,titleComponent:u,component:c,Visibility:W,unref:a,isVisible:we,isHidden:Re}}}),pl={key:0};function ml(e,t,n,i,r,s){var u;const o=he("Node");return e.isVisible(e.visibility)?(h(),S("button",{key:0,class:te({feature:!0,tile:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick)}),style:ee([{visibility:e.isHidden(e.visibility)?"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))},[e.title?(h(),S("div",pl,[(h(),q(re(e.titleComponent)))])):V("",!0),(h(),q(re(e.component),{style:{"white-space":"pre-line"}})),d(o,{id:e.id},null,8,["id"])],38)):V("",!0)}var gl=z(fl,[["render",ml],["__scopeId","data-v-59906ec6"]]);const hl=D({props:{visibility:{type:N(Number,Boolean),required:!0},rows:{type:N(Number),required:!0},cols:{type:N(Number),required:!0},cells:{type:N(Object),required:!0}},components:{GridCell:gl},setup(){const e=M(()=>Xe[J.theme].mergeAdjacent);function t(n){const{visibility:i,onClick:r,onHold:s,display:o,title:u,style:c,canClick:f,id:p}=n;return{visibility:i,onClick:r,onHold:s,display:o,title:u,style:c,canClick:f,id:p}}return{unref:a,gatherCellProps:t,Visibility:W,mergeAdjacent:e,isVisible:we,isHidden:Re}}});function vl(e,t,n,i,r,s){const o=he("GridCell");return e.isVisible(e.visibility)?(h(),S("div",{key:0,style:ee({visibility:e.isHidden(e.visibility)?"hidden":void 0}),class:"table-grid"},[(h(!0),S(U,null,Ft(e.unref(e.rows),u=>(h(),S("div",{class:te(["row-grid",{mergeAdjacent:e.mergeAdjacent}]),key:u},[(h(!0),S(U,null,Ft(e.unref(e.cols),c=>(h(),q(o,ze({key:c},e.gatherCellProps(e.unref(e.cells)[u*100+c])),null,16))),128))],2))),128))],4)):V("",!0)}var bl=z(hl,[["render",vl]]);function yl(e){return new Proxy({},_l(e))}function _l(e){const t=M(()=>{const n=[];for(let i=1;i<=a(e.rows);i++)for(let r=1;r<=a(e.cols);r++)n.push((i*100+r).toString());return n});return{get(n,i){if(i==="isProxy")return!0;if(typeof i=="symbol")return e[i];if(!!t.value.includes(i.toString()))return n[i]==null&&(n[i]=new Proxy(e,wl(i.toString()))),n[i]},set(n,i,r){return console.warn("Cannot set grid cells",n,i,r),!1},ownKeys(){return t.value},has(n,i){return t.value.includes(i.toString())},getOwnPropertyDescriptor(n,i){if(t.value.includes(i.toString()))return{configurable:!0,enumerable:!0,writable:!1}}}}function wl(e){const t=["id","visibility","canClick","startState","state","style","classes","title","display","onClick","onHold"],n={};return{get(i,r,s){if(r==="isProxy")return!0;let o=i[r];return ft(o)?()=>o.call(s,e,i.getState(e)):o!=null||typeof r=="symbol"?o:(r=r.slice(0,1).toUpperCase()+r.slice(1),r==="startState"?o.call(s,e):(o=i[`get${r}`],ft(o)?(r in n||(n[r]=M(()=>o.call(s,e,i.getState(e)))),n[r].value):o!=null?a(o):(o=i[`on${r}`],ft(o)?()=>o.call(s,e,i.getState(e)):o!=null?o:i[r])))},set(i,r,s,o){return r=`set${r.slice(0,1).toUpperCase()+r.slice(1)}`,r in i&&ft(i[r])&&i[r].length<3?(i[r].call(o,e,s),!0):(console.warn(`No setter for "${r}".`,i),!1)},ownKeys(){return t},has(i,r){return t.includes(r.toString())},getOwnPropertyDescriptor(i,r){if(t.includes(r.toString()))return{configurable:!0,enumerable:!0,writable:!1}}}}function Nl(e){const t=me({},!1);return ce(()=>{const n=e();if(n.id=Me("grid-"),n[ge]=bl,n.cellState=t,n.getID=function(i){return n.id+"-"+i},n.getState=function(i){return this.cellState.value[i]!=null?t.value[i]:this.cells[i].startState},n.setState=function(i,r){t.value[i]=r},n.cells=yl(n),_(n,"visibility"),H(n,"visibility",W.Visible),_(n,"rows"),_(n,"cols"),_(n,"getVisibility"),H(n,"getVisibility",W.Visible),_(n,"getCanClick"),H(n,"getCanClick",!0),_(n,"getStartState"),_(n,"getStyle"),_(n,"getClasses"),_(n,"getTitle"),_(n,"getDisplay"),n.onClick){const i=n.onClick.bind(n);n.onClick=function(r,s,o){a(n.cells[r].canClick)&&i(r,s,o)}}if(n.onHold){const i=n.onHold.bind(n);n.onHold=function(r,s){a(n.cells[r].canClick)&&i(r,s)}}return n[ye]=function(){const{visibility:i,rows:r,cols:s,cells:o,id:u}=this;return{visibility:i,rows:r,cols:s,cells:o,id:u}},n})}const Cl=["x1","y1","x2","y2"],kl=D({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=le(e),i=M(()=>{const s=n.startNode.value.rect,o=n.boundingRect.value,u=o?{x:s.x+s.width/2-o.x,y:s.y+s.height/2-o.y}:{x:0,y:0};return n.link.value.offsetStart&&(u.x+=n.link.value.offsetStart.x,u.y+=n.link.value.offsetStart.y),u}),r=M(()=>{const s=n.endNode.value.rect,o=n.boundingRect.value,u=o?{x:s.x+s.width/2-o.x,y:s.y+s.height/2-o.y}:{x:0,y:0};return n.link.value.offsetEnd&&(u.x+=n.link.value.offsetEnd.x,u.y+=n.link.value.offsetEnd.y),u});return(s,o)=>(h(),S("line",ze({"stroke-width":"15px",stroke:"white"},e.link,{x1:a(i).x,y1:a(i).y,x2:a(r).x,y2:a(r).y}),null,16,Cl))}});const Sl=D({__name:"Links",props:{links:null},setup(e){var c;const n=st(e,"links"),i=O(null),r=en(Tn,O({})),s=en(Pn,O(void 0)),o=O((c=i.value)==null?void 0:c.getBoundingClientRect());Be(s,()=>{var f;return o.value=(f=i.value)==null?void 0:f.getBoundingClientRect()}),Bt(()=>{var f;return o.value=(f=i.value)==null?void 0:f.getBoundingClientRect()});const u=M(()=>{var p,v;const f=r.value;return(v=(p=n.value)==null?void 0:p.filter(w=>{var k,T;return((k=f[w.startNode.id])==null?void 0:k.rect)&&((T=f[w.startNode.id])==null?void 0:T.rect)}))!=null?v:[]});return(f,p)=>(h(),S(U,null,[a(u)?(h(),S("svg",cr(ze({key:0},f.$attrs)),[(h(!0),S(U,null,Ft(a(u),(v,w)=>(h(),q(kl,{key:w,link:v,boundingRect:o.value,startNode:a(r)[v.startNode.id],endNode:a(r)[v.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):V("",!0),g("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var xi=z(Sl,[["__scopeId","data-v-c139d80e"]]),$l=D({props:{nodes:{type:N(Array),required:!0},leftSideNodes:N(Array),rightSideNodes:N(Array),branches:N(Array)},components:{Links:xi},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=le(e),r=Ne();Pe(()=>{const u=ue(t);r.value=j(L(()=>d(U,null,[u.map(c=>d("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(Ke)]))])))});const s=Ne();Pe(()=>{const u=ue(n);s.value=u?j(L(()=>d("span",{class:"left-side-nodes small"},[u.map(Ke)]))):""});const o=Ne();return Pe(()=>{const u=ue(i);o.value=u?j(L(()=>d("span",{class:"side-nodes small"},[u.map(Ke)]))):""}),{unref:a,nodesComp:r,leftNodesComp:s,rightNodesComp:o}}});function Ml(e,t,n,i,r,s){const o=he("Links");return h(),S(U,null,[(h(),q(re(e.nodesComp))),e.leftNodesComp?(h(),q(re(e.leftNodesComp),{key:0})):V("",!0),e.rightNodesComp?(h(),q(re(e.rightNodesComp),{key:1})):V("",!0),e.branches?(h(),q(o,{key:2,links:e.unref(e.branches)},null,8,["links"])):V("",!0)],64)}var Il=z($l,[["render",Ml],["__scopeId","data-v-39ca96d0"]]);const El=D({props:{display:N(Object,String,Function),visibility:{type:N(Number,Boolean),required:!0},style:N(String,Object,Array),classes:N(Object),onClick:Function,onHold:Function,color:N(String),glowColor:N(String),canClick:{type:N(Boolean),required:!0},mark:N(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Ct,Node:tt},setup(e){const{onClick:t,onHold:n,display:i}=le(e),r=Qe(i),{start:s,stop:o}=Mn(t,n);return{start:s,stop:o,comp:r,unref:a,Visibility:W,isCoercableComponent:Ve,isVisible:we,isHidden:Re}}});function Tl(e,t,n,i,r,s){var c;const o=he("MarkNode"),u=he("Node");return e.isVisible(e.visibility)?(h(),S("div",{key:0,style:ee({visibility:e.isHidden(e.visibility)?"hidden":void 0}),class:te({treeNode:!0,can:e.unref(e.canClick),...e.unref(e.classes)}),onClick:t[0]||(t[0]=(...f)=>e.onClick&&e.onClick(...f)),onMousedown:t[1]||(t[1]=(...f)=>e.start&&e.start(...f)),onMouseleave:t[2]||(t[2]=(...f)=>e.stop&&e.stop(...f)),onMouseup:t[3]||(t[3]=(...f)=>e.stop&&e.stop(...f)),onTouchstartPassive:t[4]||(t[4]=(...f)=>e.start&&e.start(...f)),onTouchendPassive:t[5]||(t[5]=(...f)=>e.stop&&e.stop(...f)),onTouchcancelPassive:t[6]||(t[6]=(...f)=>e.stop&&e.stop(...f))},[g("div",{style:ee([{backgroundColor:e.unref(e.color),boxShadow:`-4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0 0 20px ${e.unref(e.glowColor)}`},(c=e.unref(e.style))!=null?c:[]])},[(h(),q(re(e.unref(e.comp))))],4),d(o,{mark:e.unref(e.mark)},null,8,["mark"]),d(u,{id:e.id},null,8,["id"])],38)):V("",!0)}var Pl=z(El,[["render",Tl],["__scopeId","data-v-4520cd79"]]);const Fl=Symbol("TreeNode"),Vl=Symbol("Tree");function Tt(e){return ce(()=>{var n;const t=(n=e==null?void 0:e())!=null?n:{};if(t.id=Me("treeNode-"),t.type=Fl,t[ge]=Pl,_(t,"visibility"),H(t,"visibility",W.Visible),_(t,"canClick"),H(t,"canClick",!0),_(t,"color"),_(t,"display"),_(t,"glowColor"),_(t,"classes"),_(t,"style"),_(t,"mark"),t.onClick){const i=t.onClick.bind(t);t.onClick=function(r){a(t.canClick)!==!1&&i(r)}}if(t.onHold){const i=t.onHold.bind(t);t.onHold=function(){a(t.canClick)!==!1&&i()}}return t[ye]=function(){const{display:i,visibility:r,style:s,classes:o,onClick:u,onHold:c,color:f,glowColor:p,canClick:v,mark:w,id:k}=this;return{display:i,visibility:r,style:s,classes:o,onClick:u,onHold:c,color:f,glowColor:p,canClick:v,mark:w,id:k}},t})}function Ai(e){return ce(()=>{const t=e();return t.id=Me("tree-"),t.type=Vl,t[ge]=Il,t.isResetting=O(!1),t.resettingNode=Ne(null),t.reset=function(n){var r,s;const i=t;i.isResetting.value=!0,i.resettingNode.value=n,(r=i.resetPropagation)==null||r.call(i,i,n),(s=i.onReset)==null||s.call(i,n),i.isResetting.value=!1,i.resettingNode.value=null},t.links=M(()=>{var i;return(i=a(t.branches))!=null?i:[]}),_(t,"visibility"),H(t,"visibility",W.Visible),_(t,"nodes"),_(t,"leftSideNodes"),_(t,"rightSideNodes"),_(t,"branches"),t[ye]=function(){const{nodes:n,leftSideNodes:i,rightSideNodes:r,branches:s}=this;return{nodes:n,leftSideNodes:i,rightSideNodes:r,branches:s}},t})}const Ol=function(e,t){const n=[t];let i=[t];if(e.branches!=null){const r=a(e.branches);for(;i.length>0;){const s=[];i.forEach(o=>{r.filter(u=>u.startNode===o||u.endNode===o).map(u=>u.startNode===o?u.endNode:u.startNode).filter(u=>!n.includes(u)).forEach(u=>{var c;s.includes(u)||(s.push(u),(c=u.reset)==null||c.reset())})}),i=s,n.push(...i)}}};function Bi(e,t=null,n=0){const i=Ue(n);return M(()=>t==null||l.gte(e.value,a(i))?He(e)+" "+e.displayName:`Reach ${l.eq(t.precision,0)?Se(a(i)):Ce(a(i),t.precision)} ${t.displayName} to unlock (You have ${l.eq(t.precision,0)?Se(t.value):Ce(t.value,t.precision)})`)}var ql=D({props:{display:{type:N(Object,String,Function),required:!0},visibility:{type:N(Number,Boolean),required:!0},style:N(Object,String,Array),classes:N(Object),onClick:Function,onHold:Function,canClick:{type:N(Boolean),required:!0},small:Boolean,mark:N(Boolean,String),id:{type:String,required:!0}},components:{Node:tt,MarkNode:Ct},setup(e){const{display:t,onClick:n,onHold:i}=le(e),r=Ne("");Pe(()=>{var p;const u=ue(t);if(u==null){r.value="";return}if(Ve(u)){r.value=j(u);return}const c=j((p=u.title)!=null?p:"","h3"),f=j(u.description,"div");r.value=j(L(()=>d("span",null,[u.title!=null?d("div",null,[d(c,null,null)]):null,d(f,null,null)])))});const{start:s,stop:o}=Mn(n,i);return{start:s,stop:o,comp:r,Visibility:W,isVisible:we,isHidden:Re,unref:a}}});function Dl(e,t,n,i,r,s){var c;const o=he("MarkNode"),u=he("Node");return e.isVisible(e.visibility)?(h(),S("button",{key:0,style:ee([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...f)=>e.onClick&&e.onClick(...f)),onMousedown:t[1]||(t[1]=(...f)=>e.start&&e.start(...f)),onMouseleave:t[2]||(t[2]=(...f)=>e.stop&&e.stop(...f)),onMouseup:t[3]||(t[3]=(...f)=>e.stop&&e.stop(...f)),onTouchstartPassive:t[4]||(t[4]=(...f)=>e.start&&e.start(...f)),onTouchendPassive:t[5]||(t[5]=(...f)=>e.stop&&e.stop(...f)),onTouchcancelPassive:t[6]||(t[6]=(...f)=>e.stop&&e.stop(...f)),class:te({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)?(h(),q(re(e.unref(e.comp)),{key:0})):V("",!0),d(o,{mark:e.unref(e.mark)},null,8,["mark"]),d(u,{id:e.id},null,8,["id"])],38)):V("",!0)}var Li=z(ql,[["render",Dl],["__scopeId","data-v-211328c0"]]);const Rl=Symbol("Clickable");function xt(e){return ce(()=>{var n;const t=(n=e==null?void 0:e())!=null?n:{};if(t.id=Me("clickable-"),t.type=Rl,t[ge]=Li,_(t,"visibility"),H(t,"visibility",W.Visible),_(t,"canClick"),H(t,"canClick",!0),_(t,"classes"),_(t,"style"),_(t,"mark"),_(t,"display"),t.onClick){const i=t.onClick.bind(t);t.onClick=function(r){a(t.canClick)!==!1&&i(r)}}if(t.onHold){const i=t.onHold.bind(t);t.onHold=function(){a(t.canClick)!==!1&&i()}}return t[ye]=function(){const{display:i,visibility:r,style:s,classes:o,onClick:u,onHold:c,canClick:f,small:p,mark:v,id:w}=this;return{display:i,visibility:r,style:a(s),classes:o,onClick:u,onHold:c,canClick:f,small:p,mark:v,id:w}},t})}const ji=l.ln(10);function It(e){return e}function xl(e,t){if(I(t))return t.invert(l.neg(e));throw new Error("Could not invert due to no input being a variable")}function Al(e,t){if(I(t))return $.neg(t.getIntegralFormula(e));throw new Error("Could not integrate due to no input being a variable")}function Bl(e){return $.neg(e)}function Ll(e,t,n){if(I(t))return t.invert(l.sub(e,fe(n)));if(I(n))return n.invert(l.sub(e,fe(t)));throw new Error("Could not invert due to no input being a variable")}function jl(e,t,n){var i,r;if(I(t)){const s=t.getIntegralFormula(e);return $.times(n,(i=t.innermostVariable)!=null?i:0).add(s)}else if(I(n)){const s=n.getIntegralFormula(e);return $.times(t,(r=n.innermostVariable)!=null?r:0).add(s)}throw new Error("Could not integrate due to no input being a variable")}function Ul(e,t,n){if(I(t)){const i=t.getIntegralFormula(e);return $.add(i,n)}else if(I(n)){const i=n.getIntegralFormula(e);return $.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function zl(e,t,n){if(I(t))return t.invert(l.add(e,fe(n)));if(I(n))return n.invert(l.sub(fe(t),e));throw new Error("Could not invert due to no input being a variable")}function Hl(e,t,n){var i,r;if(I(t)){const s=t.getIntegralFormula(e);return $.sub(s,$.times(n,(i=t.innermostVariable)!=null?i:0))}else if(I(n)){const s=n.getIntegralFormula(e);return $.times(t,(r=n.innermostVariable)!=null?r:0).sub(s)}throw new Error("Could not integrate due to no input being a variable")}function Gl(e,t,n){if(I(t)){const i=t.getIntegralFormula(e);return $.sub(i,n)}else if(I(n)){const i=n.getIntegralFormula(e);return $.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Wl(e,t,n){if(I(t))return t.invert(l.div(e,fe(n)));if(I(n))return n.invert(l.div(e,fe(t)));throw new Error("Could not invert due to no input being a variable")}function Yl(e,t,n){if(I(t)){const i=t.getIntegralFormula(e);return $.times(i,n)}else if(I(n)){const i=n.getIntegralFormula(e);return $.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Kl(e,t,n){if(I(t))return $.div(e,n);if(I(n))return $.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Zl(e,t,n){if(I(t))return t.invert(l.mul(e,fe(n)));if(I(n))return n.invert(l.div(fe(t),e));throw new Error("Could not invert due to no input being a variable")}function Jl(e,t,n){if(I(t)){const i=t.getIntegralFormula(e);return $.div(i,n)}else if(I(n)){const i=n.getIntegralFormula(e);return $.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Xl(e,t,n){if(I(t))return $.mul(e,n);if(I(n))return $.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Ql(e,t){if(I(t))return t.invert(l.recip(e));throw new Error("Could not invert due to no input being a variable")}function eu(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function tu(e,t){if(I(t))return t.invert(l.pow10(e));throw new Error("Could not invert due to no input being a variable")}function nu(e){return l.ln(e).sub(1).times(e).div(ji)}function iu(e,t){if(I(t)){const n=ji.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function ru(e,t){if(I(t))return new $({inputs:[t.getIntegralFormula(e)],evaluate:nu,invert:iu});throw new Error("Could not integrate due to no input being a variable")}function su(e,t,n){if(I(t))return t.invert(l.pow(fe(n),e));if(I(n))return n.invert(l.root(fe(t),e));throw new Error("Could not invert due to no input being a variable")}function ou(e,t){return l.ln(e).sub(1).times(e).div(l.ln(t))}function au(e,t,n){if(I(t)){const i=l.ln(fe(n)).times(e);return t.invert(i.div(i.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function lu(e,t,n){if(I(t))return new $({inputs:[t.getIntegralFormula(e),n],evaluate:ou,invert:au});throw new Error("Could not integrate due to no input being a variable")}function uu(e,t){if(I(t))return t.invert(l.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function cu(e){return l.ln(e).sub(1).times(e).div(l.ln(2))}function du(e,t){if(I(t)){const n=l.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function fu(e,t){if(I(t))return new $({inputs:[t.getIntegralFormula(e)],evaluate:cu,invert:du});throw new Error("Could not integrate due to no input being a variable")}function pu(e,t){if(I(t))return t.invert(l.exp(e));throw new Error("Could not invert due to no input being a variable")}function mu(e){return l.ln(e).sub(1).times(e)}function gu(e,t){if(I(t))return t.invert(l.div(e,l.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function hu(e,t){if(I(t))return new $({inputs:[t.getIntegralFormula(e)],evaluate:mu,invert:gu});throw new Error("Could not integrate due to no input being a variable")}function vu(e,t,n){if(I(t))return t.invert(l.root(e,fe(n)));if(I(n))return n.invert(l.ln(e).div(l.ln(fe(t))));throw new Error("Could not invert due to no input being a variable")}function bu(e,t,n){if(I(t)){const i=t.getIntegralFormula(e),r=$.add(n,1);return $.pow(i,r).div(r)}else if(I(n)){const i=n.getIntegralFormula(e);return $.pow(t,i).div($.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function yu(e,t){if(I(t))return t.invert(l.root(e,10));throw new Error("Could not invert due to no input being a variable")}function _u(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.pow10(n).div($.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function wu(e,t,n){if(I(t))return t.invert(l.ln(e).div(fe(n)));if(I(n))return n.invert(l.root(fe(t),e));throw new Error("Could not invert due to no input being a variable")}function Nu(e,t,n){if(I(t)){const i=t.getIntegralFormula(e);return $.pow(n,i).div($.ln(n))}else if(I(n)){const i=n.getIntegralFormula(e),r=$.add(t,1);return $.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function Cu(e,t,n){if(I(t))return t.invert(l.root(e,l.recip(fe(n))));if(I(n))return n.invert(l.ln(fe(t)).div(l.ln(e)));throw new Error("Could not invert due to no input being a variable")}function ku(e,t,n){if(I(t)){const i=t.getIntegralFormula(e);return $.pow(i,$.recip(n).add(1)).times(n).div($.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function Su(e,t){if(I(t))return t.invert(l.ln(e));throw new Error("Could not invert due to no input being a variable")}function $u(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function Mu(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){const i=l.minabs(t,1e308).toNumber();return l.tetrate(e,i,n)}function Iu(e,t,n,i){if(I(t))return t.invert(l.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function Eu(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){const i=l.minabs(t,1e308).toNumber();return l.iteratedexp(e,i,new l(n))}function Tu(e,t,n,i){if(I(t))return t.invert(l.iteratedlog(e,Math.E,l.minabs(1e308,fe(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Pu(e,t=10,n=2){const i=l.minabs(n,1e308).toNumber();return l.iteratedlog(e,t,i)}function Fu(e,t=10){const n=l.minabs(t,1e308).toNumber();return l.slog(e,n)}function Vu(e,t,n){if(I(t))return t.invert(l.tetrate(e,l.minabs(1e308,fe(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Ou(e,t,n){const i=l.minabs(t,1e308).toNumber();return l.layeradd(e,i,n)}function qu(e,t,n,i){if(I(t))return t.invert(l.layeradd(e,l.minabs(1e308,fe(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Du(e,t){if(I(t))return t.invert(l.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Ru(e,t){if(I(t))return t.invert(l.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function xu(e,t,n){const i=l.minabs(t,1e308).toNumber();return l.pentate(e,i,n)}function Au(e,t){if(I(t))return t.invert(l.asin(e));throw new Error("Could not invert due to no input being a variable")}function Bu(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Lu(e,t){if(I(t))return t.invert(l.acos(e));throw new Error("Could not invert due to no input being a variable")}function ju(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function Uu(e,t){if(I(t))return t.invert(l.atan(e));throw new Error("Could not invert due to no input being a variable")}function zu(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Hu(e,t){if(I(t))return t.invert(l.sin(e));throw new Error("Could not invert due to no input being a variable")}function Gu(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.asin(n).times(n).add($.sqrt($.sub(1,$.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Wu(e,t){if(I(t))return t.invert(l.cos(e));throw new Error("Could not invert due to no input being a variable")}function Yu(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.acos(n).times(n).sub($.sqrt($.sub(1,$.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Ku(e,t){if(I(t))return t.invert(l.tan(e));throw new Error("Could not invert due to no input being a variable")}function Zu(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.atan(n).times(n).sub($.ln($.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Ju(e,t){if(I(t))return t.invert(l.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Xu(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Qu(e,t){if(I(t))return t.invert(l.acosh(e));throw new Error("Could not invert due to no input being a variable")}function ec(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function tc(e,t){if(I(t))return t.invert(l.atanh(e));throw new Error("Could not invert due to no input being a variable")}function nc(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function ic(e,t){if(I(t))return t.invert(l.sinh(e));throw new Error("Could not invert due to no input being a variable")}function rc(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.asinh(n).times(n).sub($.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function sc(e,t){if(I(t))return t.invert(l.cosh(e));throw new Error("Could not invert due to no input being a variable")}function oc(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.acosh(n).times(n).sub($.add(n,1).sqrt().times($.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function ac(e,t){if(I(t))return t.invert(l.tanh(e));throw new Error("Could not invert due to no input being a variable")}function lc(e,t){if(I(t)){const n=t.getIntegralFormula(e);return $.atanh(n).times(n).add($.sub(1,$.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function kt(e){return(t,n)=>new $({inputs:[t,n],evaluate:e,invert:It})}function I(e){return e instanceof $&&e.hasVariable()}function fe(e,t){return e instanceof $?e.evaluate(t):a(e)}function uc(){return $.pow(this,2).div(2)}function cc(){return this}const b=class{constructor(e){this.negate=this.neg,this.negated=this.neg,this.sgn=this.sign,this.plus=this.add,this.subtract=this.sub,this.minus=this.sub,this.multiply=this.mul,this.times=this.mul,this.divide=this.div,this.divideBy=this.div,this.dividedBy=this.div,this.reciprocal=this.recip,this.reciprocate=this.recip,this.logarithm=this.log;let t;"variable"in e?t=this.setupVariable(e):"evaluate"in e?t=this.setupFormula(e):t=this.setupConstant(e),this.inputs=t.inputs,this.internalVariables=t.internalVariables,this.innermostVariable=t.innermostVariable,this.internalEvaluate=t.internalEvaluate,this.internalInvert=t.internalInvert,this.internalIntegrate=t.internalIntegrate,this.internalIntegrateInner=t.internalIntegrateInner,this.applySubstitution=t.applySubstitution}setupVariable({variable:e}){return{inputs:[e],internalVariables:1,innermostVariable:e,internalIntegrate:uc,internalIntegrateInner:cc,applySubstitution:It}}setupConstant({inputs:e}){if(e.length!==1)throw new Error("Evaluate function is required if inputs is not length 1");return{inputs:e,internalVariables:0}}setupFormula(e){const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:s,applySubstitution:o}=e,u=t.reduce((p,v)=>p+(v instanceof b?v.internalVariables:0),0),c=t.find(p=>p instanceof b&&p.hasVariable()),f=u===1?c==null?void 0:c.innermostVariable:void 0;return{inputs:t,internalEvaluate:n,internalInvert:i,internalIntegrate:r,internalIntegrateInner:s,applySubstitution:o,innermostVariable:f,internalVariables:u}}calculateConstantOfIntegration(){const e=this.getIntegralFormula().evaluate(1),t=l.add(this.evaluate(0),this.evaluate(1)).div(2);return l.sub(t,e)}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,i;return(i=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(r=>fe(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:fe(this.inputs[0])}invert(e){if(this.internalInvert&&this.hasVariable())return this.internalInvert.call(this,e,...this.inputs);if(this.inputs.length===1&&this.hasVariable())return e;throw new Error("Cannot invert non-invertible formula")}evaluateIntegral(e){if(!this.isIntegrable())throw new Error("Cannot evaluate integral of formula without integral");return this.getIntegralFormula().evaluate(e)}invertIntegral(e){if(!this.isIntegrable()||!this.getIntegralFormula().isInvertible())throw new Error("Cannot invert integral of formula without invertible integral");return this.getIntegralFormula().invert(e)}getIntegralFormula(e){if(this.integralFormula!=null&&e==null)return this.integralFormula;if(e==null){if(this.applySubstitution==null){if(e=[],this.internalIntegrate==null)throw new Error("Cannot integrate formula with non-integrable operation");let t=this.internalIntegrate.call(this,e,...this.inputs);e.forEach(n=>t=n(t)),this.integralFormula=t}else if(this.internalIntegrate)this.integralFormula=this.internalIntegrate.call(this,void 0,...this.inputs);else if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())this.integralFormula=this;else throw new Error("Cannot integrate formula without variable");return this.integralFormula}else{if(this.applySubstitution==null)throw new Error("Cannot have two complex operations in an integrable formula");if(e.push(t=>this.applySubstitution.call(this,t,...this.inputs)),this.internalIntegrateInner)return this.internalIntegrateInner.call(this,e,...this.inputs);if(this.internalIntegrate)return this.internalIntegrate.call(this,e,...this.inputs);if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())return this;throw new Error("Cannot integrate formula without variable")}}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof b&&e.inputs[n]instanceof b?t.equals(e.inputs[n]):!(t instanceof b)&&!(e.inputs[n]instanceof b)&&l.eq(a(t),a(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new b({inputs:[e]})}static variable(e){return new b({variable:e})}static step(e,t,n){const i=O(0),r=n(b.variable(i)),s=Ue(t);function o(c){return l.lt(c,a(s))?c:(i.value=l.sub(c,a(s)),l.add(r.evaluate(),a(s)))}function u(c,f){if(I(f))return l.gt(c,a(s))&&(c=l.add(r.invert(l.sub(c,a(s))),a(s))),f.invert(c);throw new Error("Could not invert due to no input being a variable")}return new b({inputs:[e],evaluate:o,invert:r.isInvertible()&&r.hasVariable()?u:void 0})}static if(e,t,n){const i=O(0),r=n(b.variable(i)),s=Ue(t);function o(c){return a(s)?(i.value=c,r.evaluate()):c}function u(c,f){if(!I(f))throw new Error("Could not invert due to no input being a variable");return a(s)?f.invert(r.invert(c)):f.invert(c)}return new b({inputs:[e],evaluate:o,invert:r.isInvertible()&&r.hasVariable()?u:void 0})}static conditional(e,t,n){return b.if(e,t,n)}static abs(e){return new b({inputs:[e],evaluate:l.abs})}static neg(e){return new b({inputs:[e],evaluate:l.neg,invert:xl,applySubstitution:Bl,integrate:Al})}static sign(e){return new b({inputs:[e],evaluate:l.sign})}static round(e){return new b({inputs:[e],evaluate:l.round})}static floor(e){return new b({inputs:[e],evaluate:l.floor})}static ceil(e){return new b({inputs:[e],evaluate:l.ceil})}static trunc(e){return new b({inputs:[e],evaluate:l.trunc})}static add(e,t){return new b({inputs:[e,t],evaluate:l.add,invert:Ll,integrate:jl,integrateInner:Ul,applySubstitution:It})}static sub(e,t){return new b({inputs:[e,t],evaluate:l.sub,invert:zl,integrate:Hl,integrateInner:Gl,applySubstitution:It})}static mul(e,t){return new b({inputs:[e,t],evaluate:l.mul,invert:Wl,integrate:Yl,applySubstitution:Kl})}static div(e,t){return new b({inputs:[e,t],evaluate:l.div,invert:Zl,integrate:Jl,applySubstitution:Xl})}static recip(e){return new b({inputs:[e],evaluate:l.recip,invert:Ql,integrate:eu})}static clamp(e,t,n){return new b({inputs:[e,t,n],evaluate:l.clamp,invert:It})}static pLog10(e){return new b({inputs:[e],evaluate:l.pLog10})}static absLog10(e){return new b({inputs:[e],evaluate:l.absLog10})}static log10(e){return new b({inputs:[e],evaluate:l.log10,invert:tu,integrate:ru})}static log(e,t){return new b({inputs:[e,t],evaluate:l.log,invert:su,integrate:lu})}static log2(e){return new b({inputs:[e],evaluate:l.log2,invert:uu,integrate:fu})}static ln(e){return new b({inputs:[e],evaluate:l.ln,invert:pu,integrate:hu})}static pow(e,t){return new b({inputs:[e,t],evaluate:l.pow,invert:vu,integrate:bu})}static pow10(e){return new b({inputs:[e],evaluate:l.pow10,invert:yu,integrate:_u})}static pow_base(e,t){return new b({inputs:[e,t],evaluate:l.pow_base,invert:wu,integrate:Nu})}static root(e,t){return new b({inputs:[e,t],evaluate:l.root,invert:Cu,integrate:ku})}static factorial(e){return new b({inputs:[e],evaluate:l.factorial})}static gamma(e){return new b({inputs:[e],evaluate:l.gamma})}static lngamma(e){return new b({inputs:[e],evaluate:l.lngamma})}static exp(e){return new b({inputs:[e],evaluate:l.exp,invert:Su,integrate:$u})}static sqr(e){return b.pow(e,2)}static sqrt(e){return b.root(e,2)}static cube(e){return b.pow(e,3)}static cbrt(e){return b.root(e,3)}static tetrate(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new b({inputs:[e,t,n],evaluate:Mu,invert:Iu})}static iteratedexp(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new b({inputs:[e,t,n],evaluate:Eu,invert:Tu})}static iteratedlog(e,t=10,n=1){return new b({inputs:[e,t,n],evaluate:Pu})}static slog(e,t=10){return new b({inputs:[e,t],evaluate:Fu,invert:Vu})}static layeradd10(e,t){return new b({inputs:[e,t],evaluate:l.layeradd10})}static layeradd(e,t,n=10){return new b({inputs:[e,t,n],evaluate:Ou,invert:qu})}static lambertw(e){return new b({inputs:[e],evaluate:l.lambertw,invert:Du})}static ssqrt(e){return new b({inputs:[e],evaluate:l.ssqrt,invert:Ru})}static pentate(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new b({inputs:[e,t,n],evaluate:xu})}static sin(e){return new b({inputs:[e],evaluate:l.sin,invert:Hu,integrate:Bu})}static cos(e){return new b({inputs:[e],evaluate:l.cos,invert:Wu,integrate:ju})}static tan(e){return new b({inputs:[e],evaluate:l.tan,invert:Ku,integrate:zu})}static asin(e){return new b({inputs:[e],evaluate:l.asin,invert:Au,integrate:Gu})}static acos(e){return new b({inputs:[e],evaluate:l.acos,invert:Lu,integrate:Yu})}static atan(e){return new b({inputs:[e],evaluate:l.atan,invert:Uu,integrate:Zu})}static sinh(e){return new b({inputs:[e],evaluate:l.sinh,invert:ic,integrate:Xu})}static cosh(e){return new b({inputs:[e],evaluate:l.cosh,invert:sc,integrate:ec})}static tanh(e){return new b({inputs:[e],evaluate:l.tanh,invert:ac,integrate:nc})}static asinh(e){return new b({inputs:[e],evaluate:l.asinh,invert:Ju,integrate:rc})}static acosh(e){return new b({inputs:[e],evaluate:l.acosh,invert:Qu,integrate:oc})}static atanh(e){return new b({inputs:[e],evaluate:l.atanh,invert:tc,integrate:lc})}step(e,t){return b.step(this,e,t)}if(e,t){return b.if(this,e,t)}conditional(e,t){return b.if(this,e,t)}abs(){return b.abs(this)}neg(){return b.neg(this)}sign(){return b.sign(this)}round(){return b.round(this)}floor(){return b.floor(this)}ceil(){return b.ceil(this)}trunc(){return b.trunc(this)}add(e){return b.add(this,e)}sub(e){return b.sub(this,e)}mul(e){return b.mul(this,e)}div(e){return b.div(this,e)}recip(){return b.recip(this)}max(e){return b.max(this,e)}min(e){return b.min(this,e)}maxabs(e){return b.maxabs(this,e)}minabs(e){return b.minabs(this,e)}clamp(e,t){return b.clamp(this,e,t)}clampMin(e){return b.clampMin(this,e)}clampMax(e){return b.clampMax(this,e)}pLog10(){return b.pLog10(this)}absLog10(){return b.absLog10(this)}log10(){return b.log10(this)}log(e){return b.log(this,e)}log2(){return b.log2(this)}ln(){return b.ln(this)}pow(e){return b.pow(this,e)}pow10(){return b.pow10(this)}pow_base(e){return b.pow_base(this,e)}root(e){return b.root(this,e)}factorial(){return b.factorial(this)}gamma(){return b.gamma(this)}lngamma(){return b.lngamma(this)}exp(){return b.exp(this)}sqr(){return b.pow(this,2)}sqrt(){return b.root(this,2)}cube(){return b.pow(this,3)}cbrt(){return b.root(this,3)}tetrate(e=2,t=l.fromComponents_noNormalize(1,0,1)){return b.tetrate(this,e,t)}iteratedexp(e=2,t=l.fromComponents_noNormalize(1,0,1)){return b.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return b.iteratedlog(this,e,t)}slog(e=10){return b.slog(this,e)}layeradd10(e){return b.layeradd10(this,e)}layeradd(e,t){return b.layeradd(this,e,t)}lambertw(){return b.lambertw(this)}ssqrt(){return b.ssqrt(this)}pentate(e=2,t=l.fromComponents_noNormalize(1,0,1)){return b.pentate(this,e,t)}sin(){return b.sin(this)}cos(){return b.cos(this)}tan(){return b.tan(this)}asin(){return b.asin(this)}acos(){return b.acos(this)}atan(){return b.atan(this)}sinh(){return b.sinh(this)}cosh(){return b.cosh(this)}tanh(){return b.tanh(this)}asinh(){return b.asinh(this)}acosh(){return b.acosh(this)}atanh(){return b.atanh(this)}};let $=b;$.negate=b.neg;$.negated=b.neg;$.sgn=b.sign;$.plus=b.add;$.subtract=b.sub;$.minus=b.sub;$.multiply=b.mul;$.times=b.mul;$.divide=b.div;$.divideBy=b.div;$.dividedBy=b.div;$.reciprocal=b.recip;$.reciprocate=b.recip;$.max=kt(l.max);$.min=kt(l.min);$.minabs=kt(l.minabs);$.maxabs=kt(l.maxabs);$.clampMin=kt(l.clampMin);$.clampMax=kt(l.clampMax);$.logarithm=b.log;function dc(e,t,n=!0,i){const r=Ue(n);return M(()=>{var o,u;let s;if(a(r)){if(!e.isIntegrable()||!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");s=l.floor(e.invertIntegral(l.add(t.value,e.evaluateIntegral()))).sub((o=a(e.innermostVariable))!=null?o:0),i==null&&(i=10)}else{if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula");s=l.floor(e.invert(t.value)),i==null&&(i=0)}if(i>0){s=s.sub(i).clampMin(0);let c=Qt(e,s,!0,0);for(;;){const f=e.evaluate(s.add((u=a(e.innermostVariable))!=null?u:0));if(l.add(c,f).lt(t.value))s=s.add(1),c=l.add(c,f);else break}}return s})}function Qt(e,t,n=!0,i){var s,o,u;let r=l.add(t,(s=a(e.innermostVariable))!=null?s:0);if(n){const c=r;r=r.sub(i!=null?i:10).clampMin((o=a(e.innermostVariable))!=null?o:0);let f=l.sub(e.evaluateIntegral(r),e.evaluateIntegral());if(c.gt(1e308))return f.add(l.sub(c,r).times(e.evaluate(r)));for(let p=r.toNumber();p{const t=e();_(t,"showNextAt"),H(t,"showNextAt",!0),H(t,"minimumGain",1),t.resetDescription==null?t.resetDescription=M(()=>l.lt(t.conversion.gainResource.value,1e3)?"Reset for ":""):_(t,"resetDescription"),t.display==null&&(t.display=L(()=>d("span",null,[a(t.resetDescription),d("b",null,[He(t.conversion.gainResource,l.max(a(t.conversion.actualGain),a(t.minimumGain)))])," ",t.conversion.gainResource.displayName,a(t.showNextAt)!=null?d("div",null,[d("br",null,null),a(t.conversion.buyMax)?"Next:":"Req:"," ",He(t.conversion.baseResource,a(t.conversion.buyMax)||l.floor(a(t.conversion.actualGain)).neq(1)?a(t.conversion.nextAt):a(t.conversion.currentAt))," ",t.conversion.baseResource.displayName]):null]))),t.canClick==null&&(t.canClick=M(()=>l.gte(a(t.conversion.actualGain),a(t.minimumGain))));const n=t.onClick;return t.onClick=function(i){a(t.canClick)!==!1&&(t.conversion.convert(),t.tree.reset(t.treeNode),t.resetTime&&(t.resetTime.value=t.resetTime[ot]),n==null||n(i))},t})}function zi(e){return Tt(()=>{const t=e();return _(t,"display"),H(t,"display",t.layerID),_(t,"append"),{...t,display:t.display,onClick:a(t.append)?function(){if(R.tabs.includes(t.layerID)){const n=R.tabs.lastIndexOf(t.layerID);R.tabs.splice(n,1)}else R.tabs.push(t.layerID)}:function(){R.tabs.splice(1,1,t.layerID)}}})}function fc(e,t){return new $({inputs:[t],evaluate:n=>e.apply(n),invert:"revert"in e&&e.revert!=null?(n,i)=>{if(i instanceof $&&i.hasVariable())return i.invert(e.revert(n));throw new Error("Could not invert due to no input being a variable")}:void 0})}function Hi(e){return ce(()=>{const t=e();return t.formula=t.formula($.variable(t.baseResource)),t.currentGain==null&&(t.currentGain=M(()=>{let n=t.formula.evaluate(t.baseResource.value);return n=l.floor(n).max(0),a(t.buyMax)===!1&&(n=n.min(1)),n})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=M(()=>t.formula.invert(l.floor(a(t.currentGain))))),t.nextAt==null&&(t.nextAt=M(()=>t.formula.invert(l.floor(a(t.currentGain)).add(1)))),t.convert==null&&(t.convert=function(){var i;const n=a(t.currentGain);t.gainResource.value=l.add(t.gainResource.value,n),t.spend(n),(i=t.onConvert)==null||i.call(t,n)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),_(t,"currentGain"),_(t,"actualGain"),_(t,"currentAt"),_(t,"nextAt"),_(t,"buyMax"),H(t,"buyMax",!0),t})}function pc(e){return Hi(e)}function mc(e){return Hi(()=>{const t=e();return H(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=M(()=>{let n=t.formula.evaluate(t.baseResource.value);return n=l.floor(n).max(t.gainResource.value),a(t.buyMax)===!1&&(n=n.min(l.add(t.gainResource.value,1))),n})),t.actualGain==null&&(t.actualGain=M(()=>{let n=l.sub(t.formula.evaluate(t.baseResource.value),t.gainResource.value).max(0);return a(t.buyMax)===!1&&(n=n.min(1)),n})),H(t,"convert",function(){var i;const n=a(t.actualGain);t.gainResource.value=a(t.currentGain),t.spend(n),(i=t.onConvert)==null||i.call(t,n)}),t})}const gc=D({props:{visibility:{type:N(Number,Boolean),required:!0},display:{type:N(Object,String,Function),required:!0},title:{type:N(Object,String,Function),required:!0},color:N(String),collapsed:{type:Object,required:!0},style:N(Object,String,Array),titleStyle:N(Object,String,Array),bodyStyle:N(Object,String,Array),classes:N(Object),id:{type:String,required:!0}},components:{Node:tt,CollapseTransition:pr},setup(e){const{title:t,display:n}=le(e),i=Nt(t),r=Nt(n),s=M(()=>Xe[J.theme].mergeAdjacent);return{titleComponent:i,bodyComponent:r,stacked:s,unref:a,Visibility:W,isVisible:we,isHidden:Re}}}),hc=e=>(Ge("data-v-0f2462b8"),e=e(),We(),e),vc=hc(()=>g("span",{class:"toggle"},"\u25BC",-1));function bc(e,t,n,i,r,s){var c;const o=he("CollapseTransition"),u=he("Node");return e.isVisible(e.visibility)?(h(),S("div",{key:0,class:te(["infobox",{collapsed:e.unref(e.collapsed),stacked:e.stacked,...e.unref(e.classes)}]),style:ee([{borderColor:e.unref(e.color),visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}])},[g("button",{class:"title",style:ee([{backgroundColor:e.unref(e.color)},e.unref(e.titleStyle)||[]]),onClick:t[0]||(t[0]=f=>e.collapsed.value=!e.unref(e.collapsed))},[vc,(h(),q(re(e.titleComponent)))],4),d(o,null,{default:x(()=>[e.unref(e.collapsed)?V("",!0):(h(),S("div",{key:0,class:"body",style:ee({backgroundColor:e.unref(e.color)})},[(h(),q(re(e.bodyComponent),{style:ee(e.unref(e.bodyStyle))},null,8,["style"]))],4))]),_:1}),d(u,{id:e.id},null,8,["id"])],6)):V("",!0)}var yc=z(gc,[["render",bc],["__scopeId","data-v-0f2462b8"]]);const _c=Symbol("Infobox");function Gi(e){const t=me(!1,!1);return ce(()=>{const n=e();return n.id=Me("infobox-"),n.type=_c,n[ge]=yc,n.collapsed=t,_(n,"visibility"),H(n,"visibility",W.Visible),_(n,"color"),_(n,"style"),_(n,"titleStyle"),_(n,"bodyStyle"),_(n,"classes"),_(n,"title"),_(n,"display"),n[ye]=function(){const{visibility:i,display:r,title:s,color:o,collapsed:u,style:c,titleStyle:f,bodyStyle:p,classes:v,id:w}=this;return{visibility:i,display:r,title:s,color:o,collapsed:u,style:a(c),titleStyle:f,bodyStyle:p,classes:v,id:w}},n})}mi.registerPlugin(br);yr.registerPlugin("batch",_r);var wc=D({props:{style:N(String,Object,Array),classes:N(Object),onInit:{type:Function,required:!0},id:{type:String,required:!0},onContainerResized:Function,onHotReload:Function},setup(e){const t=Ne(null),n=new ResizeObserver(s),i=Ne(null);Bt(()=>{var u,c;const o=i.value;o!=null&&(n.observe(o),t.value=new mi({resizeTo:o,backgroundAlpha:0}),(u=i.value)==null||u.appendChild(t.value.view),(c=e.onInit)==null||c.call(e,t.value)),s(),e.onHotReload&&Ze(e.onHotReload)}),dr(()=>{var o;(o=t.value)==null||o.destroy()});let r=!0;function s(){r&&(r=!1,Ze(()=>{var o;i.value!=null&&((o=e.onContainerResized)==null||o.call(e,i.value.getBoundingClientRect())),r=!0}))}return ve.on("fontsLoaded",s),{unref:a,resizeListener:i}}});function Nc(e,t,n,i,r,s){return h(),S("div",{ref:"resizeListener",class:te(["resize-listener",e.unref(e.classes)]),style:ee(e.unref(e.style))},null,6)}var Cc=z(wc,[["render",Nc],["__scopeId","data-v-48dd302a"]]);const kc=Symbol("Particles");function Sc(e){return ce(()=>{var r,s;const t=(r=e==null?void 0:e())!=null?r:{};t.id=Me("particles-"),t.type=kc,t[ge]=Cc,t.app=Ne(null),t.addEmitter=o=>{const u=t;return u.app.value?Promise.resolve(new Jn(u.app.value.stage,o)):new Promise(c=>{n.push({resolve:c,config:o})})};let n=[];function i(o){const u=t;u.app.value=o,n.forEach(({resolve:c,config:f})=>c(new Jn(o.stage,f))),n=[]}return t.onContainerResized=(s=t.onContainerResized)==null?void 0:s.bind(t),t[ye]=function(){const{id:o,style:u,classes:c,onContainerResized:f,onHotReload:p}=this;return{id:o,style:a(u),classes:c,onContainerResized:f,onHotReload:p,onInit:i}},t})}window.upgradeConfig=wr;const $c=Symbol("Reset");function Wi(e){return ce(()=>{const t=e();return t.id=Me("reset-"),t.type=$c,t.reset=function(){var i;const n=r=>{if(r!=null&&typeof r=="object")if(ot in r){const s=r;s.value=s[ot]}else!(r instanceof l)&&!be(r)&&Object.values(r).forEach(s=>n(s))};a(t.thingsToReset).forEach(n),ve.emit("reset",t),(i=t.onReset)==null||i.call(t)},_(t,"thingsToReset"),t})}const Yt={};ve.on("removeLayer",e=>{var t;(t=Yt[e.id])==null||t.call(Yt),Yt[e.id]=void 0});const Mc=D({__name:"Sticky",setup(e){const t=O("0"),n=new ResizeObserver(r),i=Ne(null);function r(){let s=i.value;if(s==null)return;let o=0;for(;s.previousSibling;){const u=s.previousSibling;u.dataset&&"vSticky"in u.dataset&&(o+=u.offsetHeight),s=u}t.value=o+"px"}return Ze(r),document.fonts.ready.then(r),Bt(()=>{var o;const s=(o=i.value)==null?void 0:o.parentElement;s&&n.observe(s)}),(s,o)=>(h(),S("div",{class:"sticky",style:ee({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[je(s.$slots,"default",{},void 0,!0)],4))}});var on=z(Mc,[["__scopeId","data-v-cccac690"]]);const Yi=D({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=M(()=>He(t.resource));return(i,r)=>(h(),S("h2",{style:ee({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},X(a(n)),5))}});const Ic={class:"main-display"},Ec={key:0},Tc={key:1},Pc=C(", "),Ki=D({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null},setup(e){const n=le(e),i=O(null),r=Qe(n.effectDisplay),s=M(()=>l.lt(n.resource.value,"1e1000"));return(o,u)=>(h(),q(on,null,{default:x(()=>{var c,f,p,v;return[g("div",{class:te(["main-display-container",(c=e.classes)!=null?c:{}]),style:ee([{height:`${((p=(f=i.value)==null?void 0:f.$el.clientHeight)!=null?p:0)+50}px`},(v=e.style)!=null?v:{}])},[g("div",Ic,[a(s)?(h(),S("span",Ec,"You have ")):V("",!0),d(Yi,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),C(" "+X(e.resource.displayName),1),a(r)?(h(),S("span",Tc,[Pc,(h(),q(re(a(r)),{ref_key:"effectRef",ref:i},null,512))])):V("",!0)])],6)]}),_:1}))}});function wn(e,t){return _(t,"display"),_(t,"classes"),_(t,"style"),_(t,"direction"),H(t,"direction",Q.Up),_(t,"xoffset"),_(t,"yoffset"),t.pinnable&&(t.pinned=me(!1,!1)),Ze(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,Us(t.pinned)):e.pinned=t.pinned);const n=e[ge];e[ge]=ae;const i=e[ye].bind(e);e[ye]=function(){const{display:s,classes:o,style:u,direction:c,xoffset:f,yoffset:p,pinned:v}=this;return{element:{[ge]:n,[ye]:i},display:s,classes:o,style:a(u),direction:c,xoffset:f,yoffset:p,pinned:v}}.bind(t)}),t}const Fc={class:"field"},Vc={key:0,class:"field-title"},Oc=["min","max"],qc=D({__name:"Slider",props:{title:null,modelValue:null,min:null,max:null},emits:["update:modelValue"],setup(e,{emit:t}){const i=le(e),r=M({get(){var s;return String((s=a(i.modelValue))!=null?s:0)},set(s){t("update:modelValue",Number(s))}});return(s,o)=>(h(),S("div",Fc,[e.title?(h(),S("span",Vc,X(e.title),1)):V("",!0),d(ae,{display:`${a(r)}`,class:te({fullWidth:!e.title}),direction:a(Q).Down},{default:x(()=>[an(g("input",{type:"range","onUpdate:modelValue":o[0]||(o[0]=u=>be(r)?r.value=u:null),min:e.min,max:e.max},null,8,Oc),[[fi,a(r)]])]),_:1},8,["display","class","direction"])]))}});var Dc=z(qc,[["__scopeId","data-v-267283ff"]]);const Rc=D({__name:"VerticalRule",props:{height:null},setup(e){return(t,n)=>(h(),S("div",{class:"vr",style:ee({height:e.height})},null,4))}});var xc=z(Rc,[["__scopeId","data-v-5e0a978a"]]);const Ac=D({props:{progress:{type:N(String,Object,Number),required:!0},width:{type:N(Number),required:!0},height:{type:N(Number),required:!0},direction:{type:N(String),required:!0},display:N(Object,String,Function),visibility:{type:N(Number,Boolean),required:!0},style:N(Object,String,Array),classes:N(Object),borderStyle:N(Object,String,Array),textStyle:N(Object,String,Array),baseStyle:N(Object,String,Array),fillStyle:N(Object,String,Array),mark:N(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Ct,Node:tt},setup(e){const{progress:t,width:n,height:i,direction:r,display:s}=le(e),o=M(()=>{let f=t.value instanceof l?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(f,0),1))*100}),u=M(()=>{const f={width:ue(n)+.5+"px",height:ue(i)+.5+"px"};switch(a(r)){case Q.Up:f.clipPath=`inset(${o.value}% 0% 0% 0%)`,f.width=ue(n)+1+"px";break;case Q.Down:f.clipPath=`inset(0% 0% ${o.value}% 0%)`,f.width=ue(n)+1+"px";break;case Q.Right:f.clipPath=`inset(0% ${o.value}% 0% 0%)`;break;case Q.Left:f.clipPath=`inset(0% 0% 0% ${o.value} + '%)`;break;case Q.Default:f.clipPath="inset(0% 50% 0% 0%)";break}return f}),c=Qe(s);return{normalizedProgress:o,barStyle:u,component:c,unref:a,Visibility:W,isVisible:we,isHidden:Re}}});function Bc(e,t,n,i,r,s){var c,f,p,v,w,k,T;const o=he("MarkNode"),u=he("Node");return e.isVisible(e.visibility)?(h(),S("div",{key:0,style:ee([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:te({bar:!0,...e.unref(e.classes)})},[g("div",{class:"overlayTextContainer border",style:ee([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(f=e.unref(e.borderStyle))!=null?f:{}])},[e.component?(h(),S("span",{key:0,class:"overlayText",style:ee(e.unref(e.textStyle))},[(h(),q(re(e.component)))],4)):V("",!0)],4),g("div",{class:"border",style:ee([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(p=e.unref(e.style))!=null?p:{},(v=e.unref(e.baseStyle))!=null?v:{},(w=e.unref(e.borderStyle))!=null?w:{}])},[g("div",{class:"fill",style:ee([e.barStyle,(k=e.unref(e.style))!=null?k:{},(T=e.unref(e.fillStyle))!=null?T:{}])},null,4)],4),d(o,{mark:e.unref(e.mark)},null,8,["mark"]),d(u,{id:e.id},null,8,["id"])],6)):V("",!0)}var Lc=z(Ac,[["render",Bc],["__scopeId","data-v-515dc183"]]);const jc=Symbol("Bar");function vn(e){return ce(()=>{const t=e();return t.id=Me("bar-"),t.type=jc,t[ge]=Lc,_(t,"visibility"),H(t,"visibility",W.Visible),_(t,"width"),_(t,"height"),_(t,"direction"),_(t,"style"),_(t,"classes"),_(t,"borderStyle"),_(t,"baseStyle"),_(t,"textStyle"),_(t,"fillStyle"),_(t,"progress"),_(t,"display"),_(t,"mark"),t[ye]=function(){const{progress:n,width:i,height:r,direction:s,display:o,visibility:u,style:c,classes:f,borderStyle:p,textStyle:v,baseStyle:w,fillStyle:k,mark:T,id:E}=this;return{progress:n,width:i,height:r,direction:s,display:o,visibility:u,style:a(c),classes:f,borderStyle:p,textStyle:v,baseStyle:w,fillStyle:k,mark:T,id:E}},t})}var Uc=D({props:{active:{type:N(Boolean),required:!0},maxed:{type:N(Boolean),required:!0},canComplete:{type:N(Boolean),required:!0},display:N(String,Object,Function),visibility:{type:N(Number,Boolean),required:!0},style:N(String,Object,Array),classes:N(Object),completed:{type:N(Boolean),required:!0},canStart:{type:N(Boolean),required:!0},mark:N(Boolean,String),id:{type:String,required:!0},toggle:{type:Function,required:!0}},components:{MarkNode:Ct,Node:tt},setup(e){const{active:t,maxed:n,canComplete:i,display:r}=le(e),s=M(()=>t.value?i.value?"Finish":"Exit Early":n.value?"Completed":"Start"),o=Ne(""),u=M(()=>{const c=ue(t),f=ue(i);return c?f?ul():qn():{}});return Pe(()=>{const c=ue(r);if(c==null){o.value="";return}if(Ve(c)){o.value=j(c);return}const f=j(c.title||"","h3"),p=j(c.description,"div"),v=j(c.goal||""),w=j(c.reward||""),k=j(c.effectDisplay||"");o.value=j(L(()=>d("span",null,[c.title!=null?d("div",null,[d(f,null,null)]):null,d(p,null,null),c.goal!=null?d("div",null,[d("br",null,null),C("Goal: "),d(v,null,null)]):null,c.reward!=null?d("div",null,[d("br",null,null),C("Reward: "),d(w,null,null)]):null,c.effectDisplay!=null?d("div",null,[C("Currently: "),d(k,null,null)]):null])))}),{buttonText:s,notifyStyle:u,comp:o,Visibility:W,isVisible:we,isHidden:Re,unref:a}}});const zc=["disabled"];function Hc(e,t,n,i,r,s){var c;const o=he("MarkNode"),u=he("Node");return e.isVisible(e.visibility)?(h(),S("div",{key:0,style:ee([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.notifyStyle,(c=e.unref(e.style))!=null?c:{}]),class:te({feature:!0,challenge:!0,done:e.unref(e.completed),canStart:e.unref(e.canStart)&&!e.unref(e.maxed),maxed:e.unref(e.maxed),...e.unref(e.classes)})},[g("button",{class:"toggleChallenge",onClick:t[0]||(t[0]=(...f)=>e.toggle&&e.toggle(...f)),disabled:!e.unref(e.canStart)||e.unref(e.maxed)},X(e.buttonText),9,zc),e.unref(e.comp)?(h(),q(re(e.unref(e.comp)),{key:0})):V("",!0),d(o,{mark:e.unref(e.mark)},null,8,["mark"]),d(u,{id:e.id},null,8,["id"])],6)):V("",!0)}var Gc=z(Uc,[["render",Hc],["__scopeId","data-v-44673563"]]);function yt(e){return ce(()=>{const t=e();return t.partialDisplay=n=>d("span",{style:a(t.requirementMet)?"":"color: var(--danger)"},[He(t.resource,t.cost instanceof $?Qt(t.cost,n!=null?n:1,a(t.spendResources)):a(t.cost))," ",t.resource.displayName]),t.display=n=>d("div",null,[a(t.requiresPay)?"Costs: ":"Requires: ",He(t.resource,t.cost instanceof $?Qt(t.cost,n!=null?n:1,a(t.spendResources)):a(t.cost))," ",t.resource.displayName]),_(t,"visibility"),H(t,"visibility",W.Visible),_(t,"cost"),_(t,"requiresPay"),H(t,"requiresPay",!0),_(t,"spendResources"),H(t,"spendResources",!0),H(t,"pay",function(n){const i=t.cost instanceof $?Qt(t.cost,n!=null?n:1,a(t.spendResources)):a(t.cost);t.resource.value=l.sub(t.resource.value,i).max(0)}),t.canMaximize=t.cost instanceof $&&t.cost.isInvertible(),t.canMaximize?t.requirementMet=dc(t.cost,t.resource,a(t.spendResources)):t.requirementMet=M(()=>t.cost instanceof $?l.gte(t.resource.value,t.cost.evaluate()):l.gte(t.resource.value,a(t.cost))),t})}function Zi(e){return ce(()=>({requirementMet:M(()=>we(e.visibility)),visibility:W.None,requiresPay:!1}))}function Dn(e){if(Je(e))return e.every(Dn);const t=a(e.requirementMet);return typeof t=="boolean"?t:l.gt(t,0)}function Rn(e){if(Je(e))return e.map(Rn).reduce(l.min);const t=a(e.requirementMet);return typeof t=="boolean"?t?l.dInf:0:l.gt(t,1)&&a(e.canMaximize)!==!0?1:t}function Ji(e,t=1){var n,i;if(Je(e)&&(e=e.filter(r=>we(r.visibility)),e.length===1&&(e=e[0])),Je(e)){e=e.filter(o=>"partialDisplay"in o);const r=e.filter(o=>a(o.requiresPay)),s=e.filter(o=>!a(o.requiresPay));return d(U,null,[r.length>0?d("div",null,[C("Costs:")," ",ii(r.map(o=>o.partialDisplay(t)),d(U,null,[C(", ")]))]):null,s.length>0?d("div",null,[C("Requires:")," ",ii(s.map(o=>o.partialDisplay(t)),d(U,null,[C(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:d(U,null,null)}function Xi(e,t=1){var n;Je(e)?e.filter(i=>a(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):a(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}const Wc=Symbol("ChallengeType");function Yc(e){const t=me(0),n=me(!1,!1);return ce(()=>{const i=e();i.id=Me("challenge-"),i.type=Wc,i[ge]=Gc,i.completions=t,i.active=n,i.completed=M(()=>l.gt(i.completions.value,0)),i.maxed=M(()=>l.gte(i.completions.value,a(i.completionLimit))),i.toggle=function(){var o,u,c,f,p;const s=i;if(s.active.value){if(l.gt(a(s.canComplete),0)&&!s.maxed.value){const v=a(s.canComplete);s.completions.value=l.min(l.add(s.completions.value,v),a(s.completionLimit)),(o=s.onComplete)==null||o.call(s)}s.active.value=!1,(u=s.onExit)==null||u.call(s),(c=s.reset)==null||c.reset()}else a(s.canStart)&&we(s.visibility)&&!s.maxed.value&&((f=s.reset)==null||f.reset(),s.active.value=!0,(p=s.onEnter)==null||p.call(s))},i.canComplete=M(()=>l.max(Rn(i.requirements),a(i.maximize)?l.dInf:1)),i.complete=function(s){var c,f,p;const o=i,u=a(o.canComplete);o.active.value&&l.gt(u,0)&&!o.maxed.value&&(o.completions.value=l.min(l.add(o.completions.value,u),a(o.completionLimit)),(c=o.onComplete)==null||c.call(o),s!==!0&&(o.active.value=!1,(f=o.onExit)==null||f.call(o),(p=o.reset)==null||p.reset()))},_(i,"visibility"),H(i,"visibility",W.Visible);const r=i.visibility;return i.visibility=M(()=>J.hideChallenges===!0&&a(i.maxed)?W.None:a(r)),i.mark==null&&(i.mark=M(()=>l.gt(a(i.completionLimit),1)&&!!a(i.maxed))),_(i,"canStart"),H(i,"canStart",!0),_(i,"maximize"),_(i,"completionLimit"),H(i,"completionLimit",1),_(i,"mark"),_(i,"classes"),_(i,"style"),_(i,"display"),i.reset!=null&&ve.on("reset",s=>{s===i.reset&&i.active.value&&i.toggle()}),i[ye]=function(){const{active:s,maxed:o,canComplete:u,display:c,visibility:f,style:p,classes:v,completed:w,canStart:k,mark:T,id:E,toggle:Y}=this;return{active:s,maxed:o,canComplete:u,display:c,visibility:f,style:a(p),classes:v,completed:w,canStart:k,mark:T,id:E,toggle:Y}},i})}ve.on("loadSettings",e=>{H(e,"hideChallenges",!1)});$i(L(()=>d(Te,{title:L(()=>d("span",{class:"option-title"},[C("Hide maxed challenges"),d("desc",null,[C("Hide challenges that have been fully completed.")])])),"onUpdate:modelValue":e=>J.hideChallenges=e,modelValue:J.hideChallenges},null)));const Qi=e=>(Ge("data-v-5e2d38ce"),e=e(),We(),e),Kc=Qi(()=>g("div",{class:"key"},"Ctrl",-1)),Zc=C("+"),Jc=Qi(()=>g("div",{class:"key"},"Shift",-1)),Xc=C("+"),Qc={class:"key"},ed=D({__name:"Hotkey",props:{hotkey:null},setup(e){const t=e;let n="",i=!1,r=!1,s=!1;return Pe(()=>{n=t.hotkey.key,i=n.startsWith("ctrl+"),i&&(n=n.slice(5)),r=n.startsWith("shift+"),r&&(n=n.slice(6)),s=n.length==1&&n.toLowerCase()!=n.toUpperCase(),s&&(n=n.toUpperCase())}),(o,u)=>(h(),S(U,null,[a(i)?(h(),S(U,{key:0},[Kc,Zc],64)):V("",!0),a(r)?(h(),S(U,{key:1},[Jc,Xc],64)):V("",!0),g("div",Qc,X(a(n)),1)],64))}});var td=z(ed,[["__scopeId","data-v-5e2d38ce"]]);const dn=un({}),xn=Symbol("Hotkey"),si=[")","!","@","#","$","%","^","&","*","("];function oi(e){return ce(()=>{const t=e();return t.type=xn,_(t,"enabled"),H(t,"enabled",!0),_(t,"description"),t})}ve.on("addLayer",e=>{Ni(e,xn).forEach(t=>{dn[t.key]=t})});ve.on("removeLayer",e=>{Ni(e,xn).forEach(t=>{dn[t.key]=void 0})});document.onkeydown=function(e){var i;if(((i=e.target)==null?void 0:i.tagName)==="INPUT"||An.value&&!R.keepGoing)return;let t=e.key;si.includes(t)?t="shift+"+si.indexOf(t):e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const n=dn[t];n&&a(n.enabled)&&(e.preventDefault(),n.onPress())};$s(L(()=>{const e=Object.values(dn).filter(t=>a(t==null?void 0:t.enabled));return e.length===0?"":d("div",null,[d("br",null,null),d("h4",null,[C("Hotkeys")]),d("div",{style:"column-count: 2"},[e.map(t=>d("div",null,[d(td,{hotkey:t},null),C(" "),t==null?void 0:t.description]))])])}));const nd=Symbol("Links");function id(e){return ce(()=>{const t=e();return t.type=nd,t[ge]=xi,_(t,"links"),t[ye]=function(){const{links:n}=this;return{links:n}},t})}var rd=D({props:{visibility:{type:N(Number,Boolean),required:!0},display:{type:N(String,Object,Function),required:!0},style:N(String,Object,Array),classes:N(Object),earned:{type:N(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:tt},setup(e){const{display:t}=le(e),n=Ne("");return Pe(()=>{const i=ue(t);if(i==null){n.value="";return}if(Ve(i)){n.value=j(i);return}const r=j(i.requirement,"h3"),s=j(i.effectDisplay||"","b"),o=j(i.optionsDisplay||"","span");n.value=j(L(()=>d("span",null,[d(r,null,null),i.effectDisplay!=null?d("div",null,[d(s,null,null)]):null,i.optionsDisplay!=null?d("div",{class:"equal-spaced"},[d(o,null,null)]):null])))}),{comp:n,unref:a,Visibility:W,isVisible:we,isHidden:Re}}});function sd(e,t,n,i,r,s){var u;const o=he("Node");return e.isVisible(e.visibility)?(h(),S("div",{key:0,style:ee([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(u=e.unref(e.style))!=null?u:{}]),class:te({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(h(),q(re(e.unref(e.comp)))),d(o,{id:e.id},null,8,["id"])],6)):V("",!0)}var od=z(rd,[["render",sd],["__scopeId","data-v-43065fa5"]]);const ai=kn(),ad=Symbol("Milestone");let rt;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(rt||(rt={}));function li(e){const t=me(!1,!1);return ce(()=>{var r;const n=(r=e==null?void 0:e())!=null?r:{};n.id=Me("milestone-"),n.type=ad,n[ge]=od,n.earned=t,n.complete=function(){var o;const s=n;if(t.value=!0,(o=s.onComplete)==null||o.call(s),s.display!=null&&a(s.showPopups)===!0){const u=a(s.display),c=j(Ve(u)?u:u.requirement);ai(d(U,null,[d("h3",null,[C("Milestone earned!")]),d("div",null,[d(c,null,null)])]))}},_(n,"visibility"),H(n,"visibility",W.Visible);const i=n.visibility;if(n.visibility=M(()=>{const s=a(n.display);switch(J.msDisplay){default:case rt.All:return a(i);case rt.Configurable:return a(n.earned)&&!(s!=null&&typeof s=="object"&&"optionsDisplay"in s)?W.None:a(i);case rt.Incomplete:return a(n.earned)?W.None:a(i);case rt.None:return W.None}}),_(n,"style"),_(n,"classes"),_(n,"display"),_(n,"showPopups"),n[ye]=function(){const{visibility:s,display:o,style:u,classes:c,earned:f,id:p}=this;return{visibility:s,display:o,style:a(u),classes:c,earned:f,id:p}},n.shouldEarn){const s=n;Pe(()=>{var o,u;if(J.active===R.id&&!s.earned.value&&we(s.visibility)&&((o=s.shouldEarn)==null?void 0:o.call(s))&&(s.earned.value=!0,(u=s.onComplete)==null||u.call(s),s.display!=null&&a(s.showPopups)===!0)){const c=a(s.display),f=j(Ve(c)?c:c.requirement);ai(d(U,null,[d("h3",null,[C("Milestone earned!")]),d("div",null,[d(f,null,null)])]))}})}return n})}ve.on("loadSettings",e=>{H(e,"msDisplay",rt.All)});const ld=Object.values(rt).map(e=>({label:wi(e),value:e}));$i(L(()=>d(Fn,{title:L(()=>d("span",{class:"option-title"},[C("Show milestones"),d("desc",null,[C("Select which milestones to display based on criterias.")])])),options:ld,"onUpdate:modelValue":e=>J.msDisplay=e,modelValue:J.msDisplay},null)));const ud=Symbol("Repeatable");function cd(e){const t=me(0);return ce(()=>{var c;const n=e();n.id=Me("repeatable-"),n.type=ud,n[ge]=Li,n.amount=t,n.amount[ot]=(c=n.initialAmount)!=null?c:0;const i={requirementMet:M(()=>l.sub(a(n.limit),n.amount.value)),requiresPay:!1,visibility:W.None},r=Zi(n);Je(n.requirements)?(n.requirements.unshift(r),n.requirements.push(i)):n.requirements=[r,n.requirements,i],n.maxed=M(()=>l.gte(n.amount.value,a(n.limit))),_(n,"classes");const s=n.classes;n.classes=M(()=>{const f=a(s)||{};return n.maxed.value&&(f.bought=!0),f}),n.amountToIncrease=M(()=>a(n.maximize)?Rn(n.requirements):1),n.canClick=M(()=>Dn(n.requirements));const o=n.onClick;n.onClick=function(f){const p=n;!a(p.canClick)||(Xi(n.requirements,a(n.amountToIncrease)),p.amount.value=l.add(p.amount.value,1),o==null||o(f))},_(n,"display");const u=n.display;return n.display=L(()=>{var p,v,w;const f=a(u);if(Ve(f)){const k=j(f);return d(k,null,null)}if(f!=null){const k=n,T=j((p=f.title)!=null?p:"","h3"),E=j((v=f.description)!=null?v:""),Y=j((w=f.effectDisplay)!=null?w:"");return d("span",null,[f.title==null?null:d("div",null,[d(T,null,null)]),f.description==null?null:d(E,null,null),f.showAmount===!1?null:d("div",null,[d("br",null,null),a(k.limit)===l.dInf?d(U,null,[C("Amount: "),Se(k.amount.value)]):d(U,null,[C("Amount: "),Se(k.amount.value),C(" /")," ",Se(a(k.limit))])]),f.effectDisplay==null?null:d("div",null,[d("br",null,null),C("Currently: "),d(Y,null,null)]),k.maxed.value?null:d("div",null,[d("br",null,null),Ji(k.requirements,a(n.amountToIncrease))])])}return""}),_(n,"visibility"),H(n,"visibility",W.Visible),_(n,"limit"),H(n,"limit",l.dInf),_(n,"style"),_(n,"mark"),_(n,"small"),_(n,"maximize"),n[ye]=function(){const{display:f,visibility:p,style:v,classes:w,onClick:k,canClick:T,small:E,mark:Y,id:se}=this;return{display:f,visibility:p,style:a(v),classes:w,onClick:k,canClick:T,small:E,mark:Y,id:se}},n})}const dd=D({__name:"Tab",props:{display:null},setup(e){const t=e,{display:n}=le(t),i=Nt(n);return(r,s)=>(h(),q(re(a(i))))}}),fd=Symbol("Tab");function Kt(e){return ce(()=>{const t=e();return t.id=Me("tab-"),t.type=fd,t[ge]=dd,t[ye]=function(){const{display:n}=this;return{display:n}},t})}const pd=D({props:{visibility:{type:N(Number,Boolean),required:!0},display:{type:N(Object,String,Function),required:!0},style:N(String,Object,Array),classes:N(Object),glowColor:N(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=le(e),s=Nt(n),o=M(()=>{const c=ue(i);return c==null||c===""?{}:a(r)?qn(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:s,glowColorStyle:o,unref:a,Visibility:W,isVisible:we,isHidden:Re}}});function md(e,t,n,i,r,s){var o;return e.isVisible(e.visibility)?(h(),S("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:te(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:ee([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(o=e.unref(e.style))!=null?o:{}])},[(h(),q(re(e.component)))],6)):V("",!0)}var er=z(pd,[["render",md],["__scopeId","data-v-21427abb"]]);const gd=D({props:{visibility:{type:N(Number,Boolean),required:!0},activeTab:{type:N(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:N(Object),required:!0},style:N(String,Object,Array),classes:N(Object),buttonContainerStyle:N(String,Object,Array),buttonContainerClasses:N(Object)},components:{Sticky:on,TabButton:er},setup(e){const{activeTab:t}=le(e),n=M(()=>Xe[J.theme].floatingTabs),i=Ne("");Pe(()=>{const u=ue(t);if(u==null){i.value="";return}if(Ve(u)){i.value=j(u);return}i.value=j(a(u.display))});const r=M(()=>{const u=ue(t);return Ve(u)||!u?void 0:a(u.classes)}),s=M(()=>{const u=ue(t);return Ve(u)||!u?void 0:a(u.style)});function o(u){const{display:c,style:f,classes:p,glowColor:v,visibility:w}=u;return{display:c,style:a(f),classes:p,glowColor:v,visibility:w}}return{floating:n,tabClasses:r,tabStyle:s,Visibility:W,component:i,gatherButtonProps:o,unref:a,isVisible:we,isHidden:Re}}});function hd(e,t,n,i,r,s){var c,f;const o=he("TabButton"),u=he("Sticky");return e.isVisible(e.visibility)?(h(),S("div",{key:0,class:te(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:ee([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(f=e.tabStyle)!=null?f:[]])},[d(u,{class:te(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:ee(e.unref(e.buttonContainerStyle))},{default:x(()=>[g("div",{class:te(["tab-buttons",{floating:e.floating}])},[(h(!0),S(U,null,Ft(e.unref(e.tabs),(p,v)=>(h(),q(o,ze({onSelectTab:w=>e.selected.value=v,floating:e.floating,key:v,active:e.unref(p.tab)===e.unref(e.activeTab)},e.gatherButtonProps(p)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(h(),q(re(e.unref(e.component)),{key:0})):V("",!0)],6)):V("",!0)}var vd=z(gd,[["render",hd],["__scopeId","data-v-58dbf83a"]]);const bd=Symbol("TabButton"),yd=Symbol("TabFamily");function ui(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),new Error("Cannot create tab family with 0 tabs");const n=me(Object.keys(e)[0],!1);return ce(()=>{var s;const i=(s=t==null?void 0:t())!=null?s:{};i.id=Me("tabFamily-"),i.type=yd,i[ge]=vd,i.tabs=Object.keys(e).reduce((o,u)=>{const c=e[u]();return c.type=bd,c[ge]=er,_(c,"visibility"),H(c,"visibility",W.Visible),_(c,"tab"),_(c,"display"),_(c,"classes"),_(c,"style"),_(c,"glowColor"),o[u]=c,o},{}),i.selected=n,i.activeTab=M(()=>{const o=a(r.tabs);if(n.value in o&&we(o[n.value].visibility))return a(o[n.value].tab);const u=Object.values(o).find(c=>we(c.visibility));return u?a(u.tab):null}),_(i,"visibility"),H(i,"visibility",W.Visible),_(i,"classes"),_(i,"style"),_(i,"buttonContainerClasses"),_(i,"buttonContainerStyle"),i[ye]=function(){const{visibility:o,activeTab:u,selected:c,tabs:f,style:p,classes:v,buttonContainerClasses:w,buttonContainerStyle:k}=this;return{visibility:o,activeTab:u,selected:c,tabs:f,style:a(p),classes:v,buttonContainerClasses:w,buttonContainerStyle:k}};const r=i;return r})}var _d=D({props:{display:{type:N(String,Object,Function),required:!0},visibility:{type:N(Number,Boolean),required:!0},style:N(String,Object,Array),classes:N(Object),requirements:{type:Object,required:!0},canPurchase:{type:N(Boolean),required:!0},bought:{type:N(Boolean),required:!0},mark:N(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:tt,MarkNode:Ct},setup(e){const{display:t,requirements:n,bought:i}=le(e),r=Ne("");return Pe(()=>{const s=ue(t);if(s==null){r.value="";return}if(Ve(s)){r.value=j(s);return}const o=j(s.title||"","h3"),u=j(s.description,"div"),c=j(s.effectDisplay||"");r.value=j(L(()=>d("span",null,[s.title!=null?d("div",null,[d(o,null,null)]):null,d(u,null,null),s.effectDisplay!=null?d("div",null,[C("Currently: "),d(c,null,null)]):null,i.value?null:d(U,null,[d("br",null,null),Ji(n.value)])])))}),{component:r,unref:a,Visibility:W,isVisible:we,isHidden:Re}}});const wd=["disabled"];function Nd(e,t,n,i,r,s){var c;const o=he("MarkNode"),u=he("Node");return e.isVisible(e.visibility)?(h(),S("button",{key:0,style:ee([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...f)=>e.purchase&&e.purchase(...f)),class:te({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)?(h(),q(re(e.unref(e.component)),{key:0})):V("",!0),d(o,{mark:e.unref(e.mark)},null,8,["mark"]),d(u,{id:e.id},null,8,["id"])],14,wd)):V("",!0)}var Cd=z(_d,[["render",Nd],["__scopeId","data-v-9be6bac0"]]);const kd=Symbol("Upgrade");function Zt(e){const t=me(!1,!1);return ce(()=>{const n=e();n.id=Me("upgrade-"),n.type=kd,n[ge]=Cd,n.bought=t,n.canPurchase=M(()=>Dn(n.requirements)),n.purchase=function(){var s;const r=n;!a(r.canPurchase)||(Xi(n.requirements),t.value=!0,(s=r.onPurchase)==null||s.call(r))};const i=Zi(n);return Je(n.requirements)?n.requirements.unshift(i):n.requirements=[i,n.requirements],_(n,"visibility"),H(n,"visibility",W.Visible),_(n,"classes"),_(n,"style"),_(n,"display"),_(n,"mark"),n[ye]=function(){const{display:r,visibility:s,style:o,classes:u,requirements:c,canPurchase:f,bought:p,mark:v,id:w,purchase:k}=this;return{display:r,visibility:s,style:a(o),classes:u,requirements:c,canPurchase:f,bought:p,mark:v,id:w,purchase:k}},n})}function Sd(e){return ce(()=>{const{addend:t,description:n,enabled:i,smallerIsBetter:r}=e(),s=Ue(t),o=Ue(n),u=i==null?void 0:Ue(i);return{apply:c=>l.add(c,a(s)),revert:c=>l.sub(c,a(s)),enabled:u,description:n==null?void 0:L(()=>d("div",{class:"modifier-container"},[a(o)!=null?d("span",{class:"modifier-description"},[Ke(a(o))]):null,d("span",{class:"modifier-amount",style:(r===!0?l.gt(a(s),0):l.lt(a(s),0))?"color: var(--danger)":""},[l.gte(a(s),0)?"+":"",Vt(a(s))])]))}})}function $d(e){return ce(()=>{const{exponent:t,description:n,enabled:i,supportLowNumbers:r,smallerIsBetter:s}=e(),o=Ue(t),u=Ue(n),c=i==null?void 0:Ue(i);return{apply:f=>{let p=f;return r&&(p=l.add(p,1)),p=l.pow(p,a(o)),r&&(p=l.sub(p,1)),p},revert:f=>{let p=f;return r&&(p=l.add(p,1)),p=l.root(p,a(o)),r&&(p=l.sub(p,1)),p},enabled:c,description:n==null?void 0:L(()=>d("div",{class:"modifier-container"},[a(u)!=null?d("span",{class:"modifier-description"},[Ke(a(u)),r?" (+1 effective)":null]):null,d("span",{class:"modifier-amount",style:(s===!0?l.gt(a(o),1):l.lt(a(o),1))?"color: var(--danger)":""},[C("^"),Vt(a(o))])]))}})}function Md(e){return ce(()=>{const t=e();return{apply:n=>t.filter(i=>a(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),revert:t.every(n=>n.revert!=null)?n=>t.filter(i=>a(i.enabled)!==!1).reduceRight((i,r)=>r.revert(i),n):void 0,enabled:M(()=>t.filter(n=>a(n.enabled)!==!1).length>0),description:L(()=>d(U,null,[t.filter(n=>a(n.enabled)!==!1).map(n=>a(n.description)).filter(n=>n).map(Ke)]))}})}function Id({title:e,subtitle:t,modifier:n,base:i,unit:r,baseText:s,smallerIsBetter:o}){const u=n.apply(i!=null?i:1);return d("div",{style:{"--unit":J.alignUnits&&r!=null?"'"+r+"'":""}},[d("h3",null,[e,t==null?null:d("span",{class:"subtitle"},[C(" ("),t,C(")")])]),d("br",null,null),d("div",{class:"modifier-container"},[d("span",{class:"modifier-description"},[Ke(s!=null?s:"Base")]),d("span",{class:"modifier-amount"},[Vt(i!=null?i:1),r])]),Ke(a(n.description)),d("hr",null,null),d("div",{class:"modifier-container"},[d("span",{class:"modifier-description"},[C("Total")]),d("span",{class:"modifier-amount",style:(o===!0?l.gt(u,i!=null?i:1):l.lt(u,i!=null?i:1))?"color: var(--danger)":""},[Vt(u),r])])])}function Ed(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Cn(e)}const bn="c",Ae=Lt(bn,()=>{const e="#4BDC13",t="Candies",n=Rt(0,"lollipops"),i=Ri(n),r=me(!1),s=me("pointy"),o=me(10),u=me(new l(10)),c=M(()=>l.pow(n.value,.2)),f=M(()=>l.times(n.value,10)),p=Gi(()=>({title:"Lore",titleStyle:{color:"#FE0000"},display:"DEEP LORE!",bodyStyle:{backgroundColor:"#0000EE"},color:"rgb(75, 220, 19)"})),v=li(()=>({shouldEarn(){return l.gte(i.value,3)},display:{requirement:"3 Lollipops",effectDisplay:"Unlock the next milestone"}})),w=li(()=>({visibility:v.earned,shouldEarn(){return l.gte(i.value,4)},display:{requirement:"4 Lollipops",effectDisplay:"You can toggle beep and boop (which do nothing)",optionsDisplay:L(()=>d(U,null,[d(Te,{title:"beep","onUpdate:modelValue":Z=>r.value=Z,modelValue:r.value},null),d(Te,{title:"boop","onUpdate:modelValue":Z=>Le.boop.value=Z,modelValue:Le.boop.value},null)]))},style(){return a(this.earned)?{backgroundColor:"#1111DD"}:{}}})),k=[v,w],T=Yc(()=>({title:"Fun",requirements:yt(()=>({resource:ne.points,cost:20,spendResources:!1})),completionLimit:3,display(){return{description:`Makes the game 0% harder
${Se(this.completions.value)}/${this.completionLimit} completions`,goal:"Have 20 points I guess",reward:"Says hi",effectDisplay:Ce(E.value)+"x"}},visibility:()=>l.gt(i.value,0),onComplete(){console.log("hiii")},onEnter(){ne.points.value=0,ne.best.value=ne.points.value,ne.total.value=ne.points.value,console.log("So challenging")},onExit(){console.log("Sweet freedom!")},style:{height:"200px"}})),E=M(()=>l.add(n.value,1).tetrate(.02)),Y=Zt(()=>({display:{title:"Generator of Genericness",description:"Gain 1 point every second"},requirements:yt(()=>({cost:1,resource:Mt(n)}))})),se=Zt(()=>({display:()=>({description:"Point generation is faster based on your unspent Lollipops",effectDisplay:`${Ce(P.value)}x`}),requirements:yt(()=>({cost:1,resource:Mt(n)})),visibility:Y.bought})),P=M(()=>{let Z=l.add(n.value,1).pow(.5);return Z.gte("1e20000000")&&(Z=Z.sqrt().times("1e10000000")),Z}),F=Zt(()=>({visibility:se.bought,requirements:yt(()=>({cost:7,resource:ne.points,requiresPay:!1})),onPurchase(){ne.points.value=l.add(ne.points.value,7)},display:"Only buyable with less than 7 points, and gives you 7 more. Unlocks a secret subtab.",style(){return a(this.bought)?{backgroundColor:"#1111dd"}:a(this.canPurchase)?{}:{backgroundColor:"#dd1111"}}})),K=Zt(()=>({requirements:yt(()=>({resource:Rt(A.amount,"Exhancers",0),cost:3})),display:{title:"This upgrade doesn't exist",description:"Or does it?"}})),ke=[Y,se,F],pe=yt(()=>({resource:Mt(n),cost(){let Z=new l(A.amount.value);return Z.gte(25)&&(Z=Z.pow(2).div(25)),l.pow(2,Z.pow(1.5)).floor()},pay(Z){const Ye=a(this.cost);u.value=l.add(u.value,Ye!=null?Ye:0),this.resource.value=l.sub(this.resource.value,Ye).max(0)}})),A=cd(()=>({requirements:pe,display(){return{title:"Exhancers",description:`Adds ${Ce(oe.value)} things and multiplies stuff by ${Ce(pn.value)}.`}},style:{height:"222px"},purchaseLimit:4})),oe=M(()=>l.gte(A.amount.value,0)?l.pow(25,l.pow(A.amount.value,1.1)):l.pow(1/25,l.times(A.amount.value,-1).pow(1.1))),pn=M(()=>l.gte(A.amount.value,0)?l.pow(25,l.pow(A.amount.value,1.1)):l.pow(1/25,l.times(A.amount.value,-1).pow(1.1))),vt=me(!1),bt=O(!1),Ut=xt(()=>({small:!0,display:"Respec Thingies",onClick(){if(vt.value&&!bt.value){bt.value=!0;return}n.value=l.add(n.value,u.value),A.amount.value=0,ne.tree.reset(lt)}})),Bn=xt(()=>({small:!0,display:"Sell One",onClick(){if(l.lte(A.amount.value,0))return;A.amount.value=l.sub(A.amount.value,1);const Z=pe.cost.value;n.value=l.add(n.value,Z),u.value=l.sub(u.value,Z)}})),tr=L(()=>d(Xt,null,{default:()=>[d(Et,null,{default:()=>[d(Te,{title:"Confirm","onUpdate:modelValue":Z=>vt.value=Z,modelValue:vt.value},null),xe(Ut)]}),xe(A),xe(Bn),d(at,{modelValue:bt.value,"onUpdate:modelValue":Z=>bt.value=Z},{header:()=>d("h2",null,[C("Confirm Respec")]),body:()=>d(U,null,[C("Are you sure? Respeccing these doesn't accomplish much")]),footer:()=>d("div",{class:"modal-default-footer"},[d("div",{class:"modal-default-flex-grow"},null),d("button",{class:"button modal-default-button",onClick:()=>bt.value=!1},[C("Cancel")]),d("button",{class:"button modal-default-button danger",onClick:()=>{Ut.onClick(),bt.value=!1}},[C("Respec")])])})]})),Ln=vn(()=>({fillStyle:{backgroundColor:"#FFFFFF"},baseStyle:{backgroundColor:"#696969"},textStyle:{color:"#04e050"},direction:Q.Right,width:300,height:30,progress(){return l.add(ne.points.value,1).log(10).div(10).toNumber()},display(){return Ce(ne.points.value)+" / 1e10 points"}})),jn=vn(()=>({fillStyle:{backgroundColor:"#4BEC13"},baseStyle:{backgroundColor:"#000000"},textStyle:{textShadow:"0px 0px 2px #000000"},borderStyle:{borderWidth:"7px"},direction:Q.Up,width:50,height:200,progress(){return l.div(ne.points.value,100)},display(){return Se(l.div(ne.points.value,1).min(100))+"%"}})),zt=vn(()=>({fillStyle:{backgroundColor:"#FE0102"},baseStyle:{backgroundColor:"#222222"},textStyle:{textShadow:"0px 0px 2px #000000"},direction:Q.Up,width:100,height:30,progress(){return l.div(n.value,50)}})),Un=Md(()=>[$d(()=>({exponent:2,description:"Because I felt like it"})),Sd(()=>({addend:1,description:"Nice modifier"}))]),zn=pc(()=>({formula:Z=>fc(Un,Z.div(10).sqrt().step(1e100,Ye=>Ye.sqrt())),baseResource:ne.points,gainResource:Mt(n),roundUpCost:!0})),Hn=Wi(()=>({thingsToReset:()=>[Ae]})),nr=[oi(()=>({key:"c",description:"reset for lollipops or whatever",onPress(){St.canClick.value&&St.onClick()}})),oi(()=>({key:"ctrl+c",description:"respec things",onPress(){Ut.onClick()}}))],lt=zi(()=>({layerID:bn,color:e,reset:Hn,mark:"https://unsoftcapped2.github.io/The-Modding-Tree-2/discord.png",tooltip(){let Z=He(n);return l.gt(A.amount.value,0)&&(Z+=`



${Se(A.amount.value)} Exhancers
`),Z},style:{color:"#3325CC",textDecoration:"underline"}})),ir=wn(lt,{display:Bi(n),pinnable:!0}),St=Ui(()=>({conversion:zn,tree:ne.tree,treeNode:lt,style:{color:"#AA66AA"},resetDescription:"Melt your points into "})),rr=wn(St,{display:L(()=>Id({title:"Modifiers",modifier:Un})),pinnable:!0,direction:Q.Down,style:"width: 400px; text-align: left"}),Ht=Tt(()=>({display:"TH",color:"#6d3678",canClick(){return l.gte(ne.points.value,10)},tooltip:"Thanos your points",onClick(){ne.points.value=l.div(ne.points.value,2),console.log("Thanos'd")},glowColor(){return l.eq(A.amount.value,1)?"orange":""}})),Gt=Tt(()=>({display:"h",color(){return Xe[J.theme].variables["--locked"]},tooltip:{display:M(()=>`Restore your points to ${Ce(o.value)}`),right:!0},canClick(){return l.lt(ne.points.value,o.value)},onClick(){ne.points.value=o.value}})),Gn=Tt(()=>({visibility:W.Hidden})),Wn=Ai(()=>({nodes(){return[[Le.treeNode,lt],[Ht,Gn,Gt]]},branches(){return[{startNode:Le.treeNode,endNode:lt,"stroke-width":"25px",stroke:"green",style:{filter:"blur(5px)"}},{startNode:lt,endNode:Ht},{startNode:Ht,endNode:Gt}]}})),sr=id(()=>({links:[{startNode:Gt,endNode:zt,"stroke-width":"5px",stroke:"red",offsetEnd:{x:-50+100*zt.progress.value.toNumber(),y:0}}]})),Yn=ui({first:()=>({tab:L(()=>d(U,null,[xe(...ke),xe(K),d("div",null,[C("confirmed")])])),display:"first"}),second:()=>({tab:Le.display,display:"second"})},()=>({style:{width:"660px",backgroundColor:"brown","--background":"brown",border:"solid white",marginLeft:"auto",marginRight:"auto"}})),Kn=ui({mainTab:()=>({tab:Kt(()=>({display:L(()=>{let Z;return d(U,null,[d(Ki,{resource:n,color:e,effectDisplay:`which are boosting waffles by ${Ce(c.value)} and increasing the Ice Cream cap by ${Ce(f.value)}`},null),d(on,null,Ed(Z=de(St))?Z:{default:()=>[Z]}),d(Yi,{resource:n,color:e},null),d(Ie,{height:"5px"},null),d("button",{onClick:()=>console.log("yeet")},[C("'HI'")]),d("div",null,[C("Name your points!")]),d(Vn,{modelValue:s.value,"onUpdate:modelValue":Ye=>s.value=Ye},null),d(on,{style:"color: red; font-size: 32px; font-family: Comic Sans MS;"},{default:()=>[C("I have "),He(ne.points),C(" "),s.value,C(" points!")]}),d("hr",null,null),Ts(...k),d(Ie,null,null),xe(...ke),xe(K),xe(T)])})})),display:"main tab",glowColor(){return Y.canPurchase.value||se.canPurchase.value||F.canPurchase.value||l.gt(T.canComplete.value,0)?"blue":""},style:{color:"orange"}}),thingies:()=>({tab:Kt(()=>({style(){return{backgroundColor:"#222222","--background":"#222222"}},display:L(()=>d(U,null,[de(tr),d(Ie,null,null),d(Et,{style:"width: 600px; height: 350px; background-color: green; border-style: solid;"},{default:()=>[d(Te,{"onUpdate:modelValue":Z=>r.value=Z,modelValue:r.value},null),d(Ie,{width:"30px",height:"10px"},null),d("div",null,[d("span",null,[C("Beep")])]),d(Ie,null,null),d(xc,{height:"200px"},null)]}),d(Ie,null,null),d("img",{src:"https://unsoftcapped2.github.io/The-Modding-Tree-2/discord.png"},null)]))})),glowColor:"white",display:"thingies",style:{borderColor:"orange"}}),jail:()=>({tab:Kt(()=>({display:L(()=>d(U,null,[de(p),de(Ln),d(Ie,null,null),d(Et,null,{default:()=>[d(Xt,{style:"background-color: #555555; padding: 15px"},{default:()=>[d("div",{style:"color: teal"},[C("Sugar level:")]),d(Ie,null,null),de(jn)]}),d(Ie,null,null),d(Xt,null,{default:()=>[d("div",null,[C("idk")]),d(Ie,{width:"0",height:"50px"},null),de(zt)]})]}),d(Ie,null,null),d("div",null,[C(`It's jail because "bars"! So funny! Ha ha!`)]),de(Wn)]))})),display:"jail"}),illuminati:()=>({tab:Kt(()=>({display:L(()=>d("div",null,[d("h1",null,[C(" C O N F I R M E D ")]),d(Ie,null,null),de(Yn),d("div",null,[C("Adjust how many points H gives you!")]),d(Dc,{"onUpdate:modelValue":Z=>o.value=Z,modelValue:o.value,min:1,max:30},null)])),style:{backgroundColor:"#3325CC"}})),visibility:F.bought,display:"illuminati"})});return{id:bn,color:e,name:t,points:n,best:i,beep:r,thingy:s,otherThingy:o,spentOnBuyables:u,waffleBoost:c,icecreamCap:f,coolInfo:p,lollipopMilestones:k,funChallenge:T,funEffect:E,generatorUpgrade:Y,lollipopMultiplierUpgrade:se,lollipopMultiplierEffect:P,unlockIlluminatiUpgrade:F,quasiUpgrade:K,exhancers:A,respecBuyables:Ut,illuminatiTabs:Yn,sellExhancer:Bn,bars:{tallBoi:jn,longBoi:Ln,flatBoi:zt},tree:Wn,g:Ht,h:Gt,spook:Gn,conversion:zn,reset:Hn,hotkeys:nr,treeNode:lt,resetButton:St,confirmRespec:vt,minWidth:800,tabs:Kn,display:L(()=>d(U,null,[de(Kn),de(sr)])),treeNodeTooltip:ir,resetButtonTooltip:rr}}),Td={min:.5,max:1},Pd=[{s:0,cp:.329,e:.548},{s:.548,cp:.767,e:.876},{s:.876,cp:.985,e:1}],Fd=.001,Vd=.1,Od=100,qd=!0,Dd={x:0,y:0},Rd=!1,xd=[{type:"alpha",config:{alpha:{list:[{time:0,value:.74},{time:1,value:0}]}}},{type:"moveSpeed",config:{speed:{list:[{time:0,value:300},{time:1,value:0}]},minMult:1}},{type:"scale",config:{scale:{list:[{time:0,value:1},{time:1,value:.25}]},minMult:1}},{type:"color",config:{color:{list:[{time:0,value:"#ffdfa0"},{time:1,value:"#100f0c"}]}}},{type:"rotation",config:{accel:0,minSpeed:0,maxSpeed:200,minStart:0,maxStart:360}},{type:"textureRandom",config:{textures:["/particle.png"]}},{type:"spawnShape",config:{type:"rect",data:{x:0,y:0,w:0,h:0}}}];var Ad={lifetime:Td,ease:Pd,frequency:Fd,emitterLifetime:Vd,maxParticles:Od,addAtBack:qd,pos:Dd,emit:Rd,behaviors:xd};const yn="f",Le=Lt(yn,()=>{const e="#FE0102",t="Farms",n=Rt(0,"farm points"),i=me(!1),r=Gi(()=>({title:"Lore",titleStyle:{color:"#FE0000"},display:"DEEP LORE!",bodyStyle:{backgroundColor:"#0000EE"}})),s=me("Start"),o=xt(()=>({display(){return{title:"Clicky clicky!",description:"Current state:
"+s.value}},initialState:"Start",canClick(){return s.value!=="Borkened..."},onClick(E){var Y,se,P,F,K,ke,pe,A;switch(s.value){case"Start":s.value="A new state!";break;case"A new state!":s.value="Keep going!";break;case"Keep going!":s.value="Maybe that's a bit too far...";break;case"Maybe that's a bit too far...":const oe=E==null?void 0:"touches"in E?E.touches[0]:E,pn=Object.assign({},Ad,{pos:{x:((Y=oe==null?void 0:oe.clientX)!=null?Y:0)-((F=(P=(se=k.boundingRect)==null?void 0:se.value)==null?void 0:P.left)!=null?F:0),y:((K=oe==null?void 0:oe.clientY)!=null?K:0)-((A=(pe=(ke=k.boundingRect)==null?void 0:ke.value)==null?void 0:pe.top)!=null?A:0)}});k.addEmitter(pn).then(vt=>vt.playOnceAndDestroy()),s.value="Borkened...";break;default:s.value="Start";break}},onHold(){console.log("Clickkkkk...")},style(){switch(s.value){case"Start":return{"background-color":"green"};case"A new state!":return{"background-color":"yellow"};case"Keep going!":return{"background-color":"orange"};case"Maybe that's a bit too far...":return{"background-color":"red"};default:return{}}}})),u=xt(()=>({onClick(){s.value=="Borkened..."&&(s.value="Start")},display(){return s.value=="Borkened..."?"Fix the clickable!":"Does nothing"},small:!0})),c=Wi(()=>({thingsToReset:()=>[Le]})),f=mc(()=>({formula:E=>E.div(10).sqrt().times(Ae.otherThingy),baseResource:ne.points,gainResource:Mt(n)})),p=zi(()=>({layerID:yn,color:e,reset:c,tooltip(){return p.canClick.value?`${He(n)} ${n.displayName}`:`This weird farmer dinosaur will only see you if you have at least 10 points. You only have ${He(ne.points)}`},canClick(){return l.gte(ne.points.value,10)}})),v=wn(p,{display:Bi(n),pinnable:!0}),w=Ui(()=>({conversion:f,tree:ne.tree,treeNode:p,display:L(()=>w.conversion.buyMax?d("span",null,[C("Hi! I'm a "),d("u",null,[C("weird dinosaur")]),C(" and I'll give you")," ",d("b",null,[Se(w.conversion.currentGain.value)]),C(" Farm Points in exchange for all of your points and lollipops! (You'll get another one at")," ",Se(w.conversion.nextAt.value),C(" points)")]):d("span",null,[C("Hi! I'm a "),d("u",null,[C("weird dinosaur")]),C(" and I'll give you a Farm Point in exchange for all of your points and lollipops! (At least")," ",Se(w.conversion.nextAt.value),C(" points)")]))})),k=Sc(()=>({boundingRect:O(null),onContainerResized(E){this.boundingRect.value=E},style:"z-index: 2"})),T=L(()=>d(U,null,[de(r),d(Ki,{resource:n,color:e},null),de(w),d("div",null,[C("You have "),Se(f.baseResource.value),C(" points")]),d("div",null,[d("br",null,null),d("img",{src:"https://images.beano.com/store/24ab3094eb95e5373bca1ccd6f330d4406db8d1f517fc4170b32e146f80d?auto=compress%2Cformat&dpr=1&w=390"},null),d("div",null,[C("Bork Bork!")])]),d(Ie,null,null),xe(u),xe(o),de(k)]));return{id:yn,color:e,name:t,points:n,boop:i,coolInfo:r,clickable:o,clickableState:s,reset:c,conversion:f,treeNode:p,resetButton:w,minWidth:650,display:T,tooltip:v}});function _n(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Cn(e)}const ci="a",Nn=Lt(ci,()=>{const e="yellow",t="Achievements",n=Rt(0,"achievement power"),i=Tt(()=>({display:"A",color:e,tooltip:{display:"Achievements",right:!0},onClick(){ne.showAchievements()}})),r=hn(()=>({image:"https://unsoftcapped2.github.io/The-Modding-Tree-2/discord.png",display:"Get me!",tooltip:M(()=>r.earned.value?"You did it!":"How did this happen?"),shouldEarn:()=>!0})),s=hn(()=>({display:"Impossible!",tooltip:M(()=>s.earned.value?"HOW????":"Mwahahaha!"),style:{color:"#04e050"}})),o=hn(()=>({display:"EIEIO",tooltip:`Get a farm point. Reward: The dinosaur is now your friend (you can max Farm Points).`,shouldEarn:function(){return l.gte(Le.points.value,1)},onComplete(){console.log("Bork bork bork!")}})),u=[r,s,o],c=Nl(()=>({rows:2,cols:2,getStartState(p){return p},getStyle(p,v){return{backgroundColor:`#${Number(v)*1234%999999}`}},getTitle(p){let v="";return p==="101"?v="top":p==="102"?v="bottom":p==="201"?v="left":p==="202"&&(v="right"),L(()=>d(ae,ze({display:JSON.stringify(this.cells[p].style)},{[v]:!0}),{default:()=>[d("h3",null,[C("Gridable #"),p])]}))},getDisplay(p,v){return String(v)},getCanClick(){return l.eq(ne.points.value,10)},onClick(p,v){this.cells[p].state=Number(v)+1}})),f=L(()=>{let p,v,w;return d(U,null,[d(Et,null,{default:()=>[d(ae,{display:r.tooltip,bottom:!0},_n(p=de(r))?p:{default:()=>[p]}),d(ae,{display:s.tooltip,bottom:!0},_n(v=de(s))?v:{default:()=>[v]}),d(ae,{display:o.tooltip,bottom:!0},_n(w=de(o))?w:{default:()=>[w]})]}),xe(c)])});return{id:ci,color:e,name:t,points:n,achievements:u,grid:c,treeNode:i,display:f}}),ne=Lt("main",function(){const e=Rt(10),t=Ri(e),n=Ja(e),i=M(()=>{if(!Ae.generatorUpgrade.bought.value)return new l(0);let c=new l(3.19);return Ae.lollipopMultiplierUpgrade.bought.value&&(c=c.times(Ae.lollipopMultiplierEffect.value)),c});ve.on("update",c=>{e.value=l.add(e.value,l.times(i.value,c))});const r=el(e,i),{openModal:s,modal:o}=Fi(Nn),u=Ai(()=>({nodes:[[Ae.treeNode],[Le.treeNode,Ae.spook]],leftSideNodes:[Nn.treeNode,Ae.h],branches:[{startNode:Le.treeNode,endNode:Ae.treeNode,stroke:"blue","stroke-width":"25px",style:{filter:"blur(5px)"}}],onReset(){e.value=Zn(this.resettingNode.value)===Zn(Ae.treeNode)?0:10,t.value=e.value,n.value=e.value},resetPropagation:Ol}));return{name:"Tree",display:L(()=>d(U,null,[R.devSpeed===0?d("div",null,[C("Game Paused")]):null,R.devSpeed!=null&&R.devSpeed!=0&&R.devSpeed!==1?d("div",null,[C("Dev Speed: "),Ce(R.devSpeed),C("x")]):null,R.offlineTime!=null&&R.offlineTime!=0?d("div",null,[C("Offline Time: "),cn(R.offlineTime)]):null,d("div",null,[l.lt(e.value,"1e1000")?d("span",null,[C("You have ")]):null,d("h2",null,[Ce(e.value)]),l.lt(e.value,"1e1e6")?d("span",null,[C(" points")]):null]),l.gt(i.value,0)?d("div",null,[C("("),r.value,C(")")]):null,d(Ie,null,null),d("button",{onClick:s},[C("open achievements")]),de(o),de(u),d(Za,{height:"200px",style:"margin: 10px auto; display: block"},null)])),points:e,best:t,total:n,oomps:r,tree:u,showAchievements:s}}),Bd=e=>[ne,Le,Ae,Nn],An=M(()=>l.gt(ne.points.value,25));function Ld(e,t){}var jd=Object.freeze(Object.defineProperty({__proto__:null,main:ne,getInitialLayers:Bd,hasWon:An,fixOldSave:Ld},Symbol.toStringTag,{value:"Module"}));const jt=e=>(Ge("data-v-4a50ce42"),e=e(),We(),e),Ud={class:"game-over-modal-header"},zd=["src","alt"],Hd={class:"game-over-modal-title"},Gd=jt(()=>g("h2",null,"Congratulations!",-1)),Wd={key:0},Yd=jt(()=>g("br",null,null,-1)),Kd=jt(()=>g("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Zd=jt(()=>g("br",null,null,-1)),Jd=["href"],Xd=jt(()=>g("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Qd=D({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:s,versionTitle:o}=ie,u=M(()=>cn(R.timePlayed)),c=M(()=>An.value&&!R.keepGoing),f=st(R,"autosave");function p(){R.keepGoing=!0}function v(){pt(_t())}return(w,k)=>(h(),q(at,{"model-value":a(c)},{header:x(()=>[g("div",Ud,[a(n)?(h(),S("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,zd)):V("",!0),g("div",Hd,[Gd,g("h4",null,"You've beaten "+X(a(t))+" v"+X(a(s))+": "+X(a(o)),1)])])]),body:x(({shown:T})=>[T?(h(),S("div",Wd,[g("div",null,"It took you "+X(a(u))+" to beat the game.",1),Yd,Kd,Zd,g("div",null,[g("a",{href:a(r),class:"game-over-modal-discord-link"},[Xd,C(" "+X(a(i)),1)],8,Jd)]),d(Te,{title:"Autosave",modelValue:a(f),"onUpdate:modelValue":k[0]||(k[0]=E=>be(f)?f.value=E:null)},null,8,["modelValue"])])):V("",!0)]),footer:x(()=>[g("div",{class:"game-over-footer"},[g("button",{onClick:p,class:"button"},"Keep Going"),g("button",{onClick:v,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var ef=z(Qd,[["__scopeId","data-v-4a50ce42"]]);const fn=e=>(Ge("data-v-336bf74f"),e=e(),We(),e),tf=fn(()=>g("div",{class:"nan-modal-header"},[g("h2",null,"NaN value detected!")],-1)),nf={key:0},rf=fn(()=>g("br",null,null,-1)),sf=["href"],of=fn(()=>g("span",{class:"material-icons nan-modal-discord"},"discord",-1)),af=fn(()=>g("br",null,null,-1)),lf={class:"nan-footer"},uf=D({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ie,i=O(!0),r=O(!0),s=st(_e,"hasNaN"),o=O(null);Be(s,w=>{w?(i.value=R.autosave,r.value=R.devSpeed===0):(R.autosave=i.value,R.devSpeed=r.value?0:null)});const u=M(()=>{var w;return(w=_e.NaNPath)==null?void 0:w.join(".")}),c=M(()=>_e.NaNPersistent!=null?_e.NaNPersistent.value:null);function f(){_e.NaNPersistent!=null&&(_e.NaNPersistent.value=new l(0),_e.hasNaN=!1)}function p(){_e.NaNPersistent&&(_e.NaNPersistent.value=new l(1),_e.hasNaN=!1)}function v(){_e.NaNPersistent&&(_e.NaNPersistent.value=new l(NaN),_e.hasNaN=!1)}return(w,k)=>(h(),S(U,null,[d(at,ze({modelValue:a(s),"onUpdate:modelValue":k[4]||(k[4]=T=>be(s)?s.value=T:null)},w.$attrs),{header:x(()=>[tf]),body:x(()=>[g("div",null,[C(' Attempted to assign "'+X(a(u))+'" to NaN',1),a(c)?(h(),S("span",nf,X(" ")+"(previously "+X(a(Ce)(a(c)))+")",1)):V("",!0),C(". Auto-saving has been "+X(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),rf,g("div",null,[g("a",{href:a(n)||"https://discord.gg/WzejVAx",class:"nan-modal-discord-link"},[of,C(" "+X(a(t)||"The Paper Pilot Community"),1)],8,sf)]),af,d(Te,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":k[0]||(k[0]=T=>i.value=T)},null,8,["modelValue"]),a(ie).enablePausing?(h(),q(Te,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":k[1]||(k[1]=T=>r.value=T)},null,8,["modelValue"])):V("",!0)]),footer:x(()=>[g("div",lf,[g("button",{onClick:k[2]||(k[2]=T=>{var E;return(E=o.value)==null?void 0:E.open()}),class:"button"},"Open Saves Manager"),g("button",{onClick:f,class:"button"},"Set to 0"),g("button",{onClick:p,class:"button"},"Set to 1"),a(c)&&a(l).neq(a(c),0)&&a(l).neq(a(c),1)?(h(),S("button",{key:0,onClick:k[3]||(k[3]=T=>s.value=!1),class:"button"}," Set to previous ")):V("",!0),g("button",{onClick:v,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),d(qi,{ref_key:"savesManager",ref:o},null,512)],64))}});var cf=z(uf,[["__scopeId","data-v-336bf74f"]]);const df={key:0,class:"tpsDisplay"},ff={key:0,class:"low"},pf=D({__name:"TPS",setup(e){const t=M(()=>l.div(_e.lastTenTicks.length,_e.lastTenTicks.reduce((s,o)=>s+o,0))),n=O([]);Pe(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=M(()=>n.value.reduce((s,o)=>l.max(s,o),0)),r=M(()=>l.sub(t.value,i.value).gt(1));return(s,o)=>a(t).isNan()?V("",!0):(h(),S("div",df,[C(" TPS: "+X(a(Se)(a(t)))+" ",1),d(ln,{name:"fade"},{default:x(()=>[a(r)?(h(),S("span",ff,X(a(Se)(a(i))),1)):V("",!0)]),_:1})]))}});var mf=z(pf,[["__scopeId","data-v-46a3ed5b"]]);var gf=D({__name:"App",setup(e){const t=ie.useHeader,n=M(()=>Xe[J.theme].variables),i=st(J,"showTPS"),r=M(()=>j(L(()=>d(U,null,[Ms.map(de)]))));return(s,o)=>(h(),S(U,null,[g("div",{id:"modal-root",style:ee(a(n))},null,4),g("div",{class:te(["app",{useHeader:a(t)}]),style:ee(a(n))},[a(t)?(h(),q(Di,{key:0})):V("",!0),d(Ha),a(a(i))?(h(),q(mf,{key:1})):V("",!0),d(ef),d(cf),(h(),q(re(a(r))))],6)],64))}});var hf=z(gf,[["__scopeId","data-v-41d15e5e"]]);function vf(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisterError:s}=e;let o,u;const c=async(f=!0)=>{f&&(o==null||o.addEventListener("controlling",p=>{p.isUpdate&&window.location.reload()})),u&&u.waiting&&await Cr(u.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){o=new Nr("./sw.js",{scope:"./",type:"classic"}),o.addEventListener("activated",f=>{f.isUpdate||i==null||i()});{const f=()=>{n==null||n()};o.addEventListener("waiting",f),o.addEventListener("externalwaiting",f)}o.register({immediate:t}).then(f=>{u=f,r==null||r(f)}).catch(f=>{s==null||s(f)})}return c}function bf(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisterError:s}=e,o=O(!1),u=O(!1);return{updateServiceWorker:vf({immediate:t,onNeedRefresh(){o.value=!0,n==null||n()},onOfflineReady(){u.value=!0,i==null||i()},onRegistered:r,onRegisterError:s}),offlineReady:u,needRefresh:o}}document.title=ie.title;window.projInfo=ie;if(ie.id==="")throw new Error("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 Cs();const{globalBus:e}=await tn(()=>Promise.resolve().then(function(){return ws}),void 0),{startGameLoop:t}=await tn(()=>import("./gameLoop.98fb07e1.js"),["assets/gameLoop.98fb07e1.js","assets/@fontsource.f66d05e7.css","assets/vue.d185782d.js","assets/earcut.b6f90e68.js","assets/@vue.7184beb0.js","assets/nanoevents.1080beb7.js","assets/lz-string.f2f3b7cf.js","assets/@ivanv.3bc3ebc4.js","assets/vue-next-select.f0e584b6.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.4713c6fe.js","assets/sortablejs.4c7e7419.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-toastification.768059b7.js","assets/vue-toastification.4b5f8ac8.css","assets/@pixi.13a16b18.js","assets/ismobilejs.5c6954b9.js","assets/eventemitter3.dc5195d7.js","assets/url.6dd57c6c.js","assets/querystring.776b9ab3.js","assets/workbox-window.8d14e8b7.js"]),n=window.vue=fr(hf);e.emit("setupVue",n),n.mount("#app"),Ze(()=>{const i=kn(),{updateServiceWorker:r}=bf({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{l as D,tn as _,_e as a,ie as b,jd as c,ve as g,$n as l,R as p,J as s};