TMT-Demo/assets/index.224b6502.js

20 lines
192 KiB
JavaScript

/* empty css */import"./vue.72cfed44.js";import{u as $t,H as l,af as A,x as V,o as b,a5 as S,r as Ye,bv as Rt,K as re,aw as tt,a3 as P,aD as Mt,a6 as v,O as G,U,aN as We,a4 as F,M as ee,ac as M,ad as m,w as x,aL as ze,aJ as Ge,n as ye,y as fn,b4 as je,aH as hr,A as ke,b5 as De,at as br,aK as Xt,F as ue,c as D,ba as mn,av as Ue,bt as ci,T as Mn,Y as di,l as fi,bw as Je,aC as mi,aO as ve,aQ as ie,D as nt,bo as pi,bs as yr,aq as ln,bx as gi,L as vi,az as hi,C as ir,bf as bi}from"./@vue.6a1d7e86.js";import{L as et}from"./lz-string.dccec454.js";import{_ as K,C as yi}from"./@ivanv.c33db252.js";import{c as _r}from"./nanoevents.1080beb7.js";import{Y as _i}from"./vue-next-select.3d5e8343.js";import{D as Ci}from"./vuedraggable.a52097e2.js";import{p as wi}from"./vue-textarea-autosize.35804eaf.js";import{s as ki,u as Cr}from"./vue-toastification.42f47de1.js";import{A as wr,T as Ni,R as Si,B as Ii,u as $i,E as sr}from"./@pixi.94823b24.js";import"./earcut.b6f90e68.js";import"./sortablejs.740e9352.js";import"./ismobilejs.5c6954b9.js";import"./eventemitter3.dc5195d7.js";import"./url.68c785f7.js";import"./querystring.d4befb87.js";const Mi=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}};Mi();const Ti="modulepreload",or={},Pi="./",At=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${Pi}${r}`,r in or)return;or[r]=!0;const i=r.endsWith(".css"),s=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${s}`))return;const o=document.createElement("link");if(o.rel=i?"stylesheet":Ti,i||(o.as="script",o.crossOrigin=""),o.href=r,document.head.appendChild(o),i)return new Promise((a,c)=>{o.addEventListener("load",a),o.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},Oi="./projInfo-schema.json",Fi="Profectus Demo",Ei="A demo project made in Profectus",qi="profectus-demo",Vi="",Di="",Ri="",Ai="0.0",Bi="Initial Commit",Li=!0,xi=!1,ji=2,Ui=!0,zi=null,Gi="Logo.png",Hi=["main","c"],Wi=3600,Ki=1,Yi=!0,Ji="base64";var te={$schema:Oi,title:Fi,description:Ei,id:qi,author:Vi,discordName:Di,discordLink:Ri,versionNumber:Ai,versionTitle:Bi,allowGoBack:Li,defaultShowSmall:xi,defaultDecimalsShown:ji,useHeader:Ui,banner:zi,logo:Gi,initialTabs:Hi,maxTickLength:Wi,offlineLimit:Ki,enablePausing:Yi,exportEncoding:Ji};const Zi=$t({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var R=window.player=Zi;function Tn(e){return JSON.stringify(e,(t,n)=>l(n))}const Xi=["onClick"],Qi=A({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=V(!1),r=V(null);function i(){t("click"),r.value&&clearTimeout(r.value),n.value=!1,tt(()=>{n.value=!0,r.value=setTimeout(()=>n.value=!1,500)})}return(s,o)=>(b(),S("button",{onClick:Rt(i,["stop"]),class:re(["feedback",{activated:n.value,left:e.left}])},[Ye(s.$slots,"default",{},void 0,!0)],10,Xi))}});var Pn=K(Qi,[["__scopeId","data-v-01a1b95c"]]);const pn=e=>(ze("data-v-ac351c02"),e=e(),Ge(),e),es={class:"error"},ts={class:"error-title"},ns={class:"error-details",style:{"margin-top":"-10px"}},rs={key:0},is={class:"instructions"},ss=["href"],os=pn(()=>v("span",{class:"material-icons",style:{"font-size":"16px"}},"content_paste",-1)),as=pn(()=>v("span",{style:{"margin-left":"8px","font-size":"medium"}},"Copy Save",-1)),ls=pn(()=>v("br",null,null,-1)),us={key:0,style:{"margin-top":"20px"}},cs=pn(()=>v("h3",null,"Other errors",-1)),ds=[cs],fs={class:"error-details"},ms={key:0,style:{"margin-top":"10px"}},ps={key:1,style:{"margin-top":"10px"}},gs=A({__name:"Error",props:{errors:null},setup(e){const t=e,n=P(()=>t.errors[0]),r=P(()=>t.errors.map(o=>o.stack==null?[]:o.stack.split(`
`))),i=P(()=>t.errors.map(o=>o.cause==null?[]:(typeof o.cause=="string"?o.cause:JSON.stringify(o.cause)).split(`
`)));function s(){let o=Tn(R);switch(te.exportEncoding){default:console.warn(`Unknown save encoding: ${te.exportEncoding}. Defaulting to lz`);case"lz":o=et.compressToUTF16(o);break;case"base64":o=btoa(unescape(encodeURIComponent(o)));break;case"plain":break}console.log(o);const a=document.createElement("textarea");a.value=o,document.body.appendChild(a),a.select(),a.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(a)}return Mt(()=>{R.autosave=!1,R.devSpeed=0}),(o,a)=>(b(),S("div",es,[v("h1",ts,G(l(n).name)+": "+G(l(n).message),1),v("div",ns,[l(n).cause?(b(),S("div",rs,[(b(!0),S(U,null,We(l(i)[0],c=>(b(),S("div",{key:c},G(c),1))),128))])):F("",!0),l(n).stack?(b(),S("div",{key:1,style:ee(l(n).cause?"margin-top: 10px":"")},[(b(!0),S(U,null,We(l(r)[0],c=>(b(),S("div",{key:c},G(c),1))),128))],4)):F("",!0)]),v("div",is,[M(" Check the console for more details, and consider sharing it with the developers on "),v("a",{href:l(te).discordLink||"https://discord.gg/yJ4fjnjU54",class:"discord-link"},"discord",8,ss),M("! "),m(Pn,{onClick:s,class:"button",style:{display:"inline-flex"}},{default:x(()=>[os,as]),_:1}),ls,e.errors.length>1?(b(),S("div",us,ds)):F("",!0),(b(!0),S(U,null,We(e.errors.slice(1),(c,d)=>(b(),S("div",{key:d,style:{"margin-top":"20px"}},[v("details",fs,[v("summary",null,G(c.name)+": "+G(c.message),1),c.cause?(b(),S("div",ms,[(b(!0),S(U,null,We(l(i)[d+1],g=>(b(),S("div",{key:g},G(g),1))),128))])):F("",!0),c.stack?(b(),S("div",ps,[(b(!0),S(U,null,We(l(r)[d+1],g=>(b(),S("div",{key:g},G(g),1))),128))])):F("",!0)])]))),128))])]))}});var kr=K(gs,[["__scopeId","data-v-ac351c02"]]);class vs{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 r=new hs(t,n);for(this.first===void 0?(this.first=r,this.last=r):(r.next=this.first,this.first.prev=r,this.first=r),this.map.set(t,r);this.map.size>this.maxSize;){const i=this.last;this.map.delete(i.key),this.last=i.prev,this.last.next=void 0}}}class hs{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const _n=17,bs=9e15,ys=Math.log10(9e15),_s=1/9e15,Cs=308,ws=-324,ar=5,ks=(1<<10)-1,Ns=function(){const e=[];for(let n=ws+1;n<=Cs;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),mt=[2,Math.E,3,4,5,6,7,8,9,10],Ss=[[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 C=function(t){return u.fromValue_noAlloc(t)},z=function(e,t,n){return u.fromComponents(e,t,n)},Y=function(t,n,r){return u.fromComponents_noNormalize(t,n,r)};const st=function(t,n){const r=n+1,i=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,r-i))*Math.pow(10,i-r);return parseFloat(s.toFixed(Math.max(r-i,0)))},Cn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},$s=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 r=e*e;let i=e;return n=n+1/(12*i),i=i*r,n=n+1/(360*i),i=i*r,n=n+1/(1260*i),i=i*r,n=n+1/(1680*i),i=i*r,n=n+1/(1188*i),i=i*r,n=n+691/(360360*i),i=i*r,n=n+7/(1092*i),i=i*r,n=n+3617/(122400*i),Math.exp(n)/t},Nr=.5671432904097838,lr=function(e,t=1e-10){let n,r;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Nr;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let i=0;i<100;++i){if(r=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(r-n)<t*Math.abs(r))return r;n=r}throw Error(`Iteration failed to converge: ${e.toString()}`)};function ur(e,t=1e-10){let n,r,i,s;if(!Number.isFinite(e.mag)||e.eq(u.dZero))return e;if(e.eq(u.dOne))return u.fromNumber(Nr);n=u.ln(e);for(let o=0;o<100;++o){if(r=n.neg().exp(),i=n.sub(e.mul(r)),s=n.sub(i.div(n.add(1).sub(n.add(2).mul(i).div(u.mul(2,n).add(2))))),u.abs(s.sub(n)).lt(u.abs(s).mul(t)))return s;n=s}throw Error(`Iteration failed to converge: ${e.toString()}`)}const h=class{constructor(e){this.sign=0,this.mag=0,this.layer=0,e instanceof h?this.fromDecimal(e):typeof e=="number"?this.fromNumber(e):typeof e=="string"&&this.fromString(e)}get m(){if(this.sign===0)return 0;if(this.layer===0){const e=Math.floor(Math.log10(this.mag));let t;return this.mag===5e-324?t=5:t=this.mag/Ns(e),this.sign*t}else if(this.layer===1){const e=this.mag-Math.floor(this.mag);return this.sign*Math.pow(10,e)}else return this.sign}set m(e){this.layer<=2?this.fromMantissaExponent(e,this.e):(this.sign=Math.sign(e),this.sign===0&&(this.layer=0,this.exponent=0))}get e(){return this.sign===0?0:this.layer===0?Math.floor(Math.log10(this.mag)):this.layer===1?Math.floor(this.mag):this.layer===2?Math.floor(Math.sign(this.mag)*Math.pow(10,Math.abs(this.mag))):this.mag*Number.POSITIVE_INFINITY}set e(e){this.fromMantissaExponent(this.m,e)}get s(){return this.sign}set s(e){e===0?(this.sign=0,this.layer=0,this.mag=0):this.sign=e}get mantissa(){return this.m}set mantissa(e){this.m=e}get exponent(){return this.e}set exponent(e){this.e=e}static fromComponents(e,t,n){return new h().fromComponents(e,t,n)}static fromComponents_noNormalize(e,t,n){return new h().fromComponents_noNormalize(e,t,n)}static fromMantissaExponent(e,t){return new h().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new h().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new h().fromDecimal(e)}static fromNumber(e){return new h().fromNumber(e)}static fromString(e){return new h().fromString(e)}static fromValue(e){return new h().fromValue(e)}static fromValue_noAlloc(e){if(e instanceof h)return e;if(typeof e=="string"){const t=h.fromStringCache.get(e);return t!==void 0?t:h.fromString(e)}else return typeof e=="number"?h.fromNumber(e):h.dZero}static abs(e){return C(e).abs()}static neg(e){return C(e).neg()}static negate(e){return C(e).neg()}static negated(e){return C(e).neg()}static sign(e){return C(e).sign}static sgn(e){return C(e).sign}static round(e){return C(e).round()}static floor(e){return C(e).floor()}static ceil(e){return C(e).ceil()}static trunc(e){return C(e).trunc()}static add(e,t){return C(e).add(t)}static plus(e,t){return C(e).add(t)}static sub(e,t){return C(e).sub(t)}static subtract(e,t){return C(e).sub(t)}static minus(e,t){return C(e).sub(t)}static mul(e,t){return C(e).mul(t)}static multiply(e,t){return C(e).mul(t)}static times(e,t){return C(e).mul(t)}static div(e,t){return C(e).div(t)}static divide(e,t){return C(e).div(t)}static recip(e){return C(e).recip()}static reciprocal(e){return C(e).recip()}static reciprocate(e){return C(e).reciprocate()}static cmp(e,t){return C(e).cmp(t)}static cmpabs(e,t){return C(e).cmpabs(t)}static compare(e,t){return C(e).cmp(t)}static isNaN(e){return e=C(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=C(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return C(e).eq(t)}static equals(e,t){return C(e).eq(t)}static neq(e,t){return C(e).neq(t)}static notEquals(e,t){return C(e).notEquals(t)}static lt(e,t){return C(e).lt(t)}static lte(e,t){return C(e).lte(t)}static gt(e,t){return C(e).gt(t)}static gte(e,t){return C(e).gte(t)}static max(e,t){return C(e).max(t)}static min(e,t){return C(e).min(t)}static minabs(e,t){return C(e).minabs(t)}static maxabs(e,t){return C(e).maxabs(t)}static clamp(e,t,n){return C(e).clamp(t,n)}static clampMin(e,t){return C(e).clampMin(t)}static clampMax(e,t){return C(e).clampMax(t)}static cmp_tolerance(e,t,n){return C(e).cmp_tolerance(t,n)}static compare_tolerance(e,t,n){return C(e).cmp_tolerance(t,n)}static eq_tolerance(e,t,n){return C(e).eq_tolerance(t,n)}static equals_tolerance(e,t,n){return C(e).eq_tolerance(t,n)}static neq_tolerance(e,t,n){return C(e).neq_tolerance(t,n)}static notEquals_tolerance(e,t,n){return C(e).notEquals_tolerance(t,n)}static lt_tolerance(e,t,n){return C(e).lt_tolerance(t,n)}static lte_tolerance(e,t,n){return C(e).lte_tolerance(t,n)}static gt_tolerance(e,t,n){return C(e).gt_tolerance(t,n)}static gte_tolerance(e,t,n){return C(e).gte_tolerance(t,n)}static pLog10(e){return C(e).pLog10()}static absLog10(e){return C(e).absLog10()}static log10(e){return C(e).log10()}static log(e,t){return C(e).log(t)}static log2(e){return C(e).log2()}static ln(e){return C(e).ln()}static logarithm(e,t){return C(e).logarithm(t)}static pow(e,t){return C(e).pow(t)}static pow10(e){return C(e).pow10()}static pow_base(e,t){return C(e).pow_base(t)}static root(e,t){return C(e).root(t)}static factorial(e,t){return C(e).factorial()}static gamma(e,t){return C(e).gamma()}static lngamma(e,t){return C(e).lngamma()}static exp(e){return C(e).exp()}static sqr(e){return C(e).sqr()}static sqrt(e){return C(e).sqrt()}static cube(e){return C(e).cube()}static cbrt(e){return C(e).cbrt()}static tetrate(e,t=2,n=Y(1,0,1)){return C(e).tetrate(t,n)}static iteratedexp(e,t=2,n=Y(1,0,1)){return C(e).iteratedexp(t,n)}static iteratedlog(e,t=10,n=1){return C(e).iteratedlog(t,n)}static layeradd10(e,t){return C(e).layeradd10(t)}static layeradd(e,t,n=10){return C(e).layeradd(t,n)}static slog(e,t=10){return C(e).slog(t)}static lambertw(e){return C(e).lambertw()}static ssqrt(e){return C(e).ssqrt()}static pentate(e,t=2,n=Y(1,0,1)){return C(e).pentate(t,n)}static sin(e){return C(e).sin()}static cos(e){return C(e).cos()}static tan(e){return C(e).tan()}static asin(e){return C(e).asin()}static acos(e){return C(e).acos()}static atan(e){return C(e).atan()}static sinh(e){return C(e).sinh()}static cosh(e){return C(e).cosh()}static tanh(e){return C(e).tanh()}static asinh(e){return C(e).asinh()}static acosh(e){return C(e).acosh()}static atanh(e){return C(e).atanh()}static affordGeometricSeries(e,t,n,r){return this.affordGeometricSeries_core(C(e),C(t),C(n),r)}static sumGeometricSeries(e,t,n,r){return this.sumGeometricSeries_core(e,C(t),C(n),r)}static affordArithmeticSeries(e,t,n,r){return this.affordArithmeticSeries_core(C(e),C(t),C(n),C(r))}static sumArithmeticSeries(e,t,n,r){return this.sumArithmeticSeries_core(C(e),C(t),C(n),C(r))}static efficiencyOfPurchase(e,t,n){return this.efficiencyOfPurchase_core(C(e),C(t),C(n))}static randomDecimalForTesting(e){if(Math.random()*20<1)return Y(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return Y(t,0,1);const n=Math.floor(Math.random()*(e+1));let r=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(r=Math.trunc(r));let i=Math.pow(10,r);return Math.random()>.9&&(i=Math.trunc(i)),z(t,n,i)}static affordGeometricSeries_core(e,t,n,r){const i=t.mul(n.pow(r));return h.floor(e.div(i).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,r){return t.mul(n.pow(r)).mul(h.sub(1,n.pow(e))).div(h.sub(1,n))}static affordArithmeticSeries_core(e,t,n,r){const s=t.add(r.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,r){const i=t.add(r.mul(n));return e.div(2).mul(i.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag<_s)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=bs)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<ys&&this.layer>0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){const t=e,n=h.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const r=e.split("^^^");if(r.length===2){const N=parseFloat(r[0]),_=parseFloat(r[1]),E=r[1].split(";");let q=1;if(E.length===2&&(q=parseFloat(E[1]),isFinite(q)||(q=1)),isFinite(N)&&isFinite(_)){const I=h.pentate(N,_,q);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}const i=e.split("^^");if(i.length===2){const N=parseFloat(i[0]),_=parseFloat(i[1]),E=i[1].split(";");let q=1;if(E.length===2&&(q=parseFloat(E[1]),isFinite(q)||(q=1)),isFinite(N)&&isFinite(_)){const I=h.tetrate(N,_,q);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}const s=e.split("^");if(s.length===2){const N=parseFloat(s[0]),_=parseFloat(s[1]);if(isFinite(N)&&isFinite(_)){const E=h.pow(N,_);return this.sign=E.sign,this.layer=E.layer,this.mag=E.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}e=e.trim().toLowerCase();let o,a,c=e.split("pt");if(c.length===2){o=10,a=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let N=parseFloat(c[1]);if(isFinite(N)||(N=1),isFinite(o)&&isFinite(a)){const _=h.tetrate(o,a,N);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){o=10,a=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let N=parseFloat(c[1]);if(isFinite(N)||(N=1),isFinite(o)&&isFinite(a)){const _=h.tetrate(o,a,N);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}const d=e.split("e"),g=d.length-1;if(g===0){const N=parseFloat(e);if(isFinite(N))return this.fromNumber(N),h.fromStringCache.size>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}else if(g===1){const N=parseFloat(e);if(isFinite(N)&&N!==0)return this.fromNumber(N),h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}const p=e.split("e^");if(p.length===2){this.sign=1,p[0].charAt(0)=="-"&&(this.sign=-1);let N="";for(let _=0;_<p[1].length;++_){const E=p[1].charCodeAt(_);if(E>=43&&E<=57||E===101)N+=p[1].charAt(_);else return this.layer=parseFloat(N),this.mag=parseFloat(p[1].substr(_+1)),this.normalize(),h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}if(g<1)return this.sign=0,this.layer=0,this.mag=0,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this;const y=parseFloat(d[0]);if(y===0)return this.sign=0,this.layer=0,this.mag=0,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this;let w=parseFloat(d[d.length-1]);if(g>=2){const N=parseFloat(d[d.length-2]);isFinite(N)&&(w*=Math.sign(N),w+=Cn(N))}if(!isFinite(y))this.sign=d[0]==="-"?-1:1,this.layer=g,this.mag=w;else if(g===1)this.sign=Math.sign(y),this.layer=1,this.mag=w+Math.log10(Math.abs(y));else if(this.sign=Math.sign(y),this.layer=g,g===2){const N=h.mul(z(1,2,w),C(y));return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}else this.mag=w;return this.normalize(),h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}fromValue(e){return e instanceof h?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:st(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:st(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<=ar?(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):st(this.m,e)+"e"+st(this.e,e):this.layer===1?st(this.m,e)+"e"+st(this.e,e):this.layer<=ar?(this.sign===-1?"-":"")+"e".repeat(this.layer)+st(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+st(this.mag,e)}abs(){return Y(this.sign===0?0:1,this.layer,this.mag)}neg(){return Y(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?h.dZero:this.layer===0?z(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?h.dZero:this.layer===0?z(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?h.dZero:this.layer===0?z(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?h.dZero:this.layer===0?z(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=C(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 Y(0,0,0);let n,r;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(h.cmpabs(this,t)>0?(n=this,r=t):(n=t,r=this),n.layer===0&&r.layer===0)return h.fromNumber(n.sign*n.mag+r.sign*r.mag);const i=n.layer*Math.sign(n.mag),s=r.layer*Math.sign(r.mag);if(i-s>=2)return n;if(i===0&&s===-1){if(Math.abs(r.mag-Math.log10(n.mag))>_n)return n;{const o=Math.pow(10,Math.log10(n.mag)-r.mag),a=r.sign+n.sign*o;return z(Math.sign(a),1,r.mag+Math.log10(Math.abs(a)))}}if(i===1&&s===0){if(Math.abs(n.mag-Math.log10(r.mag))>_n)return n;{const o=Math.pow(10,n.mag-Math.log10(r.mag)),a=r.sign+n.sign*o;return z(Math.sign(a),1,Math.log10(r.mag)+Math.log10(Math.abs(a)))}}if(Math.abs(n.mag-r.mag)>_n)return n;{const o=Math.pow(10,n.mag-r.mag),a=r.sign+n.sign*o;return z(Math.sign(a),1,r.mag+Math.log10(Math.abs(a)))}}plus(e){return this.add(e)}sub(e){return this.add(C(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=C(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return Y(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return Y(this.sign*t.sign,0,1);let n,r;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,r=t):(n=t,r=this),n.layer===0&&r.layer===0)return h.fromNumber(n.sign*r.sign*n.mag*r.mag);if(n.layer>=3||n.layer-r.layer>=2)return z(n.sign*r.sign,n.layer,n.mag);if(n.layer===1&&r.layer===0)return z(n.sign*r.sign,1,n.mag+Math.log10(r.mag));if(n.layer===1&&r.layer===1)return z(n.sign*r.sign,1,n.mag+r.mag);if(n.layer===2&&r.layer===1){const i=z(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(z(Math.sign(r.mag),r.layer-1,Math.abs(r.mag)));return z(n.sign*r.sign,i.layer+1,i.sign*i.mag)}if(n.layer===2&&r.layer===2){const i=z(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(z(Math.sign(r.mag),r.layer-1,Math.abs(r.mag)));return z(n.sign*r.sign,i.layer+1,i.sign*i.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=C(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?h.dNaN:this.layer===0?z(this.sign,0,1/this.mag):z(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=C(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=C(e),n=this.mag>0?this.layer:-this.layer,r=t.mag>0?t.layer:-t.layer;return n>r?1:n<r?-1:this.mag>t.mag?1:this.mag<t.mag?-1:0}compare(e){return this.cmp(e)}isNan(){return isNaN(this.sign)||isNaN(this.layer)||isNaN(this.mag)}isFinite(){return isFinite(this.sign)&&isFinite(this.layer)&&isFinite(this.mag)}eq(e){const t=C(e);return this.sign===t.sign&&this.layer===t.layer&&this.mag===t.mag}equals(e){return this.eq(e)}neq(e){return!this.eq(e)}notEquals(e){return this.neq(e)}lt(e){return this.cmp(e)===-1}lte(e){return!this.gt(e)}gt(e){return this.cmp(e)===1}gte(e){return!this.lt(e)}max(e){const t=C(e);return this.lt(t)?t:this}min(e){const t=C(e);return this.gt(t)?t:this}maxabs(e){const t=C(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=C(e);return this.cmpabs(t)>0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const n=C(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=C(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let r=this.mag,i=n.mag;return this.layer>n.layer&&(i=Cn(i)),this.layer<n.layer&&(r=Cn(r)),Math.abs(r-i)<=t*Math.max(Math.abs(r),Math.abs(i))}equals_tolerance(e,t){return this.eq_tolerance(e,t)}neq_tolerance(e,t){return!this.eq_tolerance(e,t)}notEquals_tolerance(e,t){return this.neq_tolerance(e,t)}lt_tolerance(e,t){const n=C(e);return!this.eq_tolerance(n,t)&&this.lt(n)}lte_tolerance(e,t){const n=C(e);return this.eq_tolerance(n,t)||this.lt(n)}gt_tolerance(e,t){const n=C(e);return!this.eq_tolerance(n,t)&&this.gt(n)}gte_tolerance(e,t){const n=C(e);return this.eq_tolerance(n,t)||this.gt(n)}pLog10(){return this.lt(h.dZero)?h.dZero:this.log10()}absLog10(){return this.sign===0?h.dNaN:this.layer>0?z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):z(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?h.dNaN:this.layer>0?z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):z(this.sign,0,Math.log10(this.mag))}log(e){return e=C(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?h.dNaN:this.layer===0&&e.layer===0?z(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):h.div(this.log10(),e.log10())}log2(){return this.sign<=0?h.dNaN:this.layer===0?z(this.sign,0,Math.log2(this.mag)):this.layer===1?z(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?z(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?h.dNaN:this.layer===0?z(this.sign,0,Math.log(this.mag)):this.layer===1?z(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?z(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=C(e),n=this,r=t;if(n.sign===0)return r.eq(0)?Y(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(r.sign===0)return Y(1,0,1);if(r.sign===1&&r.layer===0&&r.mag===1)return n;const i=n.absLog10().mul(r).pow10();return this.sign===-1?Math.abs(r.toNumber()%2)%2===1?i.neg():Math.abs(r.toNumber()%2)%2===0?i:h.dNaN:i}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return h.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 z(1,0,t);if(e.sign===0)return h.dOne;e=Y(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?z(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?z(-e.sign,e.layer+1,-e.mag):h.dOne}pow_base(e){return C(e).pow(this)}root(e){const t=C(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?h.exp(h.mul(this,h.ln(this).sub(1))):h.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(Y(1,0,24)))return h.fromNumber($s(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 r=e,i=12*r,s=1/i,o=t+s;if(o===t||(t=o,r=r*n,i=360*r,s=1/i,o=t-s,o===t))return h.exp(t);t=o,r=r*n,i=1260*r;let a=1/i;return t=t+a,r=r*n,i=1680*r,a=1/i,t=t-a,h.exp(t)}else return this.layer===1?h.exp(h.mul(this,h.ln(this).sub(1))):h.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?h.dOne:this.layer===0&&this.mag<=709.7?h.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?z(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?z(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):z(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return h.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return z(1,2,Math.log10(this.mag)-.3010299956639812);{const e=h.div(Y(this.sign,this.layer-1,this.mag),Y(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=Y(1,0,1)){if(e===1)return h.pow(this,t);if(e===0)return new h(t);if(this.eq(h.dOne))return h.dOne;if(this.eq(-1))return h.pow(this,t);if(e===Number.POSITIVE_INFINITY){const i=this.toNumber();if(i<=1.444667861009766&&i>=.06598803584531254){if(i>1.444667861009099)return h.fromNumber(Math.E);const s=h.ln(this).neg();return s.lambertw().div(s)}else return i>1.444667861009766?h.fromNumber(Number.POSITIVE_INFINITY):h.dNaN}if(this.eq(h.dZero)){let i=Math.abs((e+1)%2);return i>1&&(i=2-i),h.fromNumber(i)}if(e<0)return h.iteratedlog(t,this,-e);t=C(t);const n=e;e=Math.trunc(e);const r=n-e;if(this.gt(h.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let i=0;i<e;++i){const s=t;if(t=this.pow(t),s.eq(t))return t}if(r!=0){const i=this.pow(t);return t.mul(1-r).add(i.mul(r))}return t}r!==0&&(t.eq(h.dOne)?this.gt(10)?t=this.pow(r):(t=h.fromNumber(h.tetrate_critical(this.toNumber(),r)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(r):t=t.layeradd(r,this));for(let i=0;i<e;++i){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return Y(t.sign,t.layer+(e-i-1),t.mag);if(i>1e4)return t}return t}iteratedexp(e=2,t=Y(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return h.tetrate(e,-t,this);e=C(e);let n=h.fromDecimal(this);const r=t;t=Math.trunc(t);const i=r-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;s<t;++s){if(n=n.log(e),!isFinite(n.layer)||!isFinite(n.mag))return n.normalize();if(s>1e4)return n}return i>0&&i<1&&(e.eq(10)?n=n.layeradd10(-i):n=n.layeradd(-i,e)),n}slog(e=10,t=100){let n=.001,r=!1,i=!1,s=this.slog_internal(e).toNumber();for(let o=1;o<t;++o){const c=new h(e).tetrate(s).gt(this);if(o>1&&i!=c&&(r=!0),i=c,r?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),s+=n,n===0)break}return h.fromNumber(s)}slog_internal(e=10){if(e=C(e),e.lte(h.dZero)||e.eq(h.dOne))return h.dNaN;if(e.lt(h.dOne))return this.eq(h.dOne)?h.dZero:this.eq(h.dZero)?h.dNegOne:h.dNaN;if(this.mag<0||this.eq(h.dZero))return h.dNegOne;let t=0,n=h.fromDecimal(this);if(n.layer-e.layer>3){const r=n.layer-e.layer-3;t+=r,n.layer-=r}for(let r=0;r<100;++r)if(n.lt(h.dZero))n=h.pow(e,n),t-=1;else{if(n.lte(h.dOne))return h.fromNumber(t+h.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=h.log(n,e)}return h.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:h.critical_section(e,t,Is)}static tetrate_critical(e,t){return h.critical_section(e,t,Ss)}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 r=0,i=0;for(let o=0;o<mt.length;++o)if(mt[o]==e){r=n[o][Math.floor(t)],i=n[o][Math.ceil(t)];break}else if(mt[o]<e&&mt[o+1]>e){const a=(e-mt[o])/(mt[o+1]-mt[o]);r=n[o][Math.floor(t)]*(1-a)+n[o+1][Math.floor(t)]*a,i=n[o][Math.ceil(t)]*(1-a)+n[o+1][Math.ceil(t)]*a;break}const s=t-Math.floor(t);return r<=0||i<=0?r*(1-s)+i*s:Math.pow(e,Math.log(r)/Math.log(e)*(1-s)+Math.log(i)/Math.log(e)*s)}layeradd10(e){e=h.fromValue_noAlloc(e).toNumber();const t=h.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 r=0;r<100;++r){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 r=this.slog(t).toNumber()+e;return r>=0?h.tetrate(t,r):Number.isFinite(r)?r>=-1?h.log(h.tetrate(t,r+1),t):h.log(h.log(h.tetrate(t,r+2),t),t):h.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return h.fromNumber(lr(this.toNumber()));if(this.layer===0)return h.fromNumber(lr(this.sign*this.mag));if(this.layer===1)return ur(this);if(this.layer===2)return ur(this);if(this.layer>=3)return Y(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return Y(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=Y(1,0,1)){t=C(t);const n=e;e=Math.trunc(e);const r=n-e;r!==0&&(t.eq(h.dOne)?(++e,t=h.fromNumber(r)):this.eq(10)?t=t.layeradd10(r):t=t.layeradd(r,this));for(let i=0;i<e;++i){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(i>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?h.fromNumber(Math.sin(this.sign*this.mag)):Y(0,0,0)}cos(){return this.mag<0?h.dOne:this.layer===0?h.fromNumber(Math.cos(this.sign*this.mag)):Y(0,0,0)}tan(){return this.mag<0?this:this.layer===0?h.fromNumber(Math.tan(this.sign*this.mag)):Y(0,0,0)}asin(){return this.mag<0?this:this.layer===0?h.fromNumber(Math.asin(this.sign*this.mag)):Y(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?h.fromNumber(Math.acos(this.toNumber())):this.layer===0?h.fromNumber(Math.acos(this.sign*this.mag)):Y(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?h.fromNumber(Math.atan(this.sign*this.mag)):h.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 h.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return h.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?Y(Number.NaN,Number.NaN,Number.NaN):h.ln(this.add(1).div(h.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(h.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 u=h;u.fromStringCache=new vs(ks);u.dZero=Y(0,0,0);u.dOne=Y(1,0,1);u.dNegOne=Y(-1,0,1);u.dTwo=Y(1,0,2);u.dTen=Y(1,0,10);u.dNaN=Y(Number.NaN,Number.NaN,Number.NaN);u.dInf=Y(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);u.dNegInf=Y(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);u.dNumberMax=z(1,0,Number.MAX_VALUE);u.dNumberMin=z(1,0,Number.MIN_VALUE);C=u.fromValue_noAlloc;z=u.fromComponents;Y=u.fromComponents_noNormalize;u.fromMantissaExponent;u.fromMantissaExponent_noNormalize;const Ms=new u(1);function Et(e,t,n=!0){let r=u.log10(e).floor(),i=u.div(e,u.pow(10,r));i.toStringWithDecimalPlaces(t)==="10"&&(i=Ms,r=r.add(1));const s=r.gte(1e9)?Re(r,Math.max(Math.max(t,3),te.defaultDecimalsShown)):r.gte(1e4)?un(r,0):r.toStringWithDecimalPlaces(0);return n?i.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function un(e,t){if(e==null)return"NaN";if(e=new u(e),e.mag<.001)return 0 .toFixed(t);const r=e.toStringWithDecimalPlaces(t).split(".");return r[0]=r[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),r.length==1?r[0]:r[0]+"."+r[1]}function Sr(e,t){return e==null?"NaN":(e=new u(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),te.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Ts=new u("eeee1000"),Ps=new u("e100000"),cr=new u("e1000"),Ir=new u(1e9),Os=new u(1e6),Fs=new u(1e3),Es=new u(.98),qs=new u(.001),$r=new u(0);function Re(e,t,n){if(t==null&&(t=te.defaultDecimalsShown),n=n!=null?n:te.defaultShowSmall,e=new u(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Re(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Ts)){const r=e.slog();return r.gte(Os)?"F"+Re(r.floor()):u.pow(10,r.sub(r.floor())).toStringWithDecimalPlaces(3)+"F"+un(r.floor(),0)}else{if(e.gte(Ps))return Et(e,0,!1);if(e.gte(cr))return Et(e,0);if(e.gte(Ir))return Et(e,t);if(e.gte(Fs))return un(e,0);if(e.gte(qs)||!n)return Sr(e,t);if(e.eq($r))return 0 .toFixed(t)}return e=Tr(e),e.lt(cr)?Et(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Re(e,t)+"\u207B\xB9"}function qe(e){return e=new u(e),e.sign<0?"-"+qe(e.neg()):e.gte(Ir)||e.lte(Es)&&!e.eq($r)?Re(e):Re(e,0)}function Mr(e){return u.lt(e,0)?"-"+Mr(u.neg(e)):u.gt(e,2**51)?Re(u.div(e,31536e3))+"y":(e=new u(e).toNumber(),e<60?Re(e)+"s":e<3600?qe(Math.floor(e/60))+"m "+Re(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 Vs(e,t,n){e=new u(e);let r=e.toStringWithDecimalPlaces(t);return new u(r).gte(n)&&(r=u.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),r}function Ds(e,t){return Re(e,t,!0)}function Tr(e){let t=u.log10(e).ceil();const n=u.div(e,u.pow(10,t));return t=t.neg(),e=new u(10).pow(t).times(n),e}var Rs=Object.freeze(Object.defineProperty({__proto__:null,default:u,exponentialFormat:Et,commaFormat:un,regularFormat:Sr,format:Re,formatWhole:qe,formatTime:Mr,toPlaces:Vs,formatSmall:Ds,invertOOM:Tr},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:As,commaFormat:Bs,regularFormat:Ls,format:Ne,formatWhole:Te,formatTime:gn,toPlaces:xs,formatSmall:Bt,invertOOM:js}=Rs;window.Decimal=u;window.exponentialFormat=As;window.commaFormat=Bs;window.regularFormat=Ls;window.format=Ne;window.formatWhole=Te;window.formatTime=gn;window.toPlaces=xs;window.formatSmall=Bt;window.invertOOM=js;function On(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Us(e){return(e[0]+e.slice(1).replace(/[A-Z]/g,t=>`-${t}`)).toLowerCase()}function gt(e){return typeof e=="function"}var J=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(J||{});const Lt=Symbol("DoNotCache");function k(e,t){const n=e[t];gt(n)&&n.length===0&&!n[Lt]?e[t]=P(n.bind(e)):gt(n)&&(e[t]=n.bind(e),e[t][Lt]=!0)}function Fe(e){return gt(e)&&!e[Lt]&&(e=P(e)),e}const Ce=Symbol("Component"),we=Symbol("GatherProps");let zs=0;function Pe(e="feature-"){return e+zs++}var Z=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Z||{});function Se(e){const t=l(e);return t!==2&&t!==!1}function He(e){return l(e)===1}function L(e){return e[Lt]=!0,e}function W(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Pr(e,...t){const n=[],r=i=>{Object.keys(i).forEach(s=>{const o=i[s];o!=null&&typeof o=="object"&&(t.includes(o.type)?n.push(o):!(o instanceof u)&&!ye(o)&&r(o))})};return r(e),n}var fe=window.state=fn({lastTenTicks:[],hasNaN:!1,NaNPath:[],errors:$t([])});const pt={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 Fn=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Fn||{}),rt={classic:pt,paper:{...pt,variables:{...pt.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:{...pt,variables:{...pt.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:{...pt,variables:{...pt.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const he=_r();"fonts"in document&&(document.fonts.onloadingdone=()=>he.emit("fontsLoaded"));var Gs=Object.freeze(Object.defineProperty({__proto__:null,globalBus:he},Symbol.toStringTag,{value:"Module"}));function Or(e={}){return Object.assign({id:`${te.id}-0`,name:"Default Save",tabs:te.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:te.id,modVersion:te.versionNumber,layers:{}},e)}function Oe(e){const t=et.compressToUTF16(Tn(e!=null?e:R));return localStorage.setItem((e!=null?e:R).id,t),t}async function Hs(){Ks();try{let e=localStorage.getItem(Q.active);if(e==null){await vt(kt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=et.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==te.id){await vt(kt());return}t.id=Q.active,await vt(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
`,e),await vt(kt())}}function kt(){const e=nn(),t=Or({id:e});return Oe(t),Q.saves.push(e),t}function nn(){let e,t=0;do e=`${te.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const En=V(!1);async function vt(e){console.info("Loading save",e),En.value=!0;const{layers:t,removeLayer:n,addLayer:r}=await At(()=>Promise.resolve().then(function(){return ja}),void 0),{fixOldSave:i,getInitialLayers:s}=await At(()=>Promise.resolve().then(function(){return Xd}),void 0);for(const o in t){const a=t[o];a&&n(a)}s(e).forEach(o=>r(o,e)),e=Or(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,te.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==te.versionNumber&&(i(e.modVersion,e),e.modVersion=te.versionNumber),Object.assign(R,e),Q.active=R.id,he.emit("onLoad")}setInterval(()=>{R.autosave&&Oe()},1e3);window.onbeforeunload=()=>{R.autosave&&Oe()};window.save=Oe;const Ws=window.hardReset=async()=>{await vt(kt())};window.deleteLowerSaves=()=>{const e=Object.values(Q.saves).indexOf(R.id)+1;Object.values(Q.saves).slice(e).forEach(t=>localStorage.removeItem(t)),Q.saves=Q.saves.slice(0,e)};const xt=$t({active:"",saves:[],showTPS:!0,theme:Fn.Nordic,unthrottled:!1,alignUnits:!1});je(xt,e=>{const t=et.compressToUTF16(JSON.stringify(e));localStorage.setItem(te.id,t)},{deep:!0});var Q=window.settings=xt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Fn.Nordic,alignUnits:!1};he.emit("loadSettings",e),Object.assign(xt,e),Ws()};function Ks(){try{let e=localStorage.getItem(te.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=et.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(xt,t)}he.emit("loadSettings",xt)}catch{}}const Fr=$t([]);function Er(e){Fr.push(e)}const qr=$t([]);function Ys(e){qr.push(e)}const Js=$t([]),Zs={class:"table"},rn=A({__name:"Column",setup(e){const t=P(()=>rt[Q.theme].mergeAdjacent);return(n,r)=>(b(),S("div",Zs,[v("div",{class:re(["col",{mergeAdjacent:l(t)}])},[Ye(n.$slots,"default")],2)]))}}),Xs={class:"table"},sn=A({__name:"Row",setup(e){const t=P(()=>rt[Q.theme].mergeAdjacent);return(n,r)=>(b(),S("div",Xs,[v("div",{class:re(["row",{mergeAdjacent:l(t)}])},[Ye(n.$slots,"default")],2)]))}});function Vr(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!br(e)}function H(e,t="span"){return typeof e=="function"?A({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),A({template:e})):A({render:()=>({})}):e}function be(e){if(Ae(e))return typeof e=="function"?e():H(e);const t=e[Ce];return m(t,e[we](),null)}function Ve(...e){let t;return m(sn,null,Vr(t=e.map(be))?t:{default:()=>[t]})}function Qs(...e){let t;return m(rn,null,Vr(t=e.map(be))?t:{default:()=>[t]})}function xe(e){if(Ae(e))return typeof e=="function"?e():typeof e=="string"?m(U,null,[e]):m(e,null,null);const t=e[Ce];return m(t,e[we](),null)}function dr(e,t){return e.reduce((n,r)=>m(U,null,[n,t,r]))}function Ae(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Lt]===!0}function qn(e,t){const n=V(null),r=V(void 0);function i(a){n.value||(n.value=setInterval(o,250)),r.value=a}function s(){n.value&&(clearInterval(n.value),n.value=null)}function o(){t&&t.value?t.value():e&&e.value&&e.value(r.value)}return hr(s),{start:i,stop:s,handleHolding:o}}function It(e,t="div"){const n=ke();return De(()=>{n.value=H(ae(e),t)}),n}function ut(e,t="div"){const n=ke(null);return De(()=>{const r=ae(e);n.value=r==""||r==null?null:H(r,t)}),n}function ae(e){return l(l(e))}function $(...e){return e.includes(Object)||e.push(Object),e}function eo(e){return Object.keys(e).reduce((t,n)=>(t[Us(n)]=e[n],t),{})}const to=A({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var g;const n=V({}),r=new ResizeObserver(a),i=V(null);Mt(()=>{const p=i.value;p!=null&&r.observe(p)});let s=!0,o=V((g=i.value)==null?void 0:g.getBoundingClientRect());function a(){s&&(s=!1,tt(()=>{var p;o.value=(p=i.value)==null?void 0:p.getBoundingClientRect(),Object.values(n.value).filter(y=>y).forEach(y=>y.rect=y.element.getBoundingClientRect()),t("updateNodes",n.value),s=!0}))}he.on("fontsLoaded",a);const c={attributes:!1,childList:!0,subtree:!1};Xt(Vn,(p,y)=>{const w=new MutationObserver(()=>d(p));w.observe(y,c),n.value[p]={element:y,observer:w,rect:y.getBoundingClientRect()},a()}),Xt(Dn,p=>{var y;(y=n.value[p])==null||y.observer.disconnect(),n.value[p]=void 0,a()}),Xt(Rn,n),Xt(An,o);function d(p){const y=n.value[p];y!=null&&(y.rect=y.element.getBoundingClientRect(),t("updateNodes",n.value))}return(p,y)=>(b(),S(U,null,[Ye(p.$slots,"default",{},void 0,!0),v("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Dr=K(to,[["__scopeId","data-v-2b1dc1bc"]]);const no=["onPointerdown"],ro={class:"modal-wrapper"},io={class:"modal-container"},so={class:"modal-header"},oo={class:"modal-body"},ao={class:"modal-footer"},lo=v("div",{class:"modal-default-flex-grow"},null,-1),ct=A({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=ue(e),s=P(()=>l(i.modelValue)||a.value);function o(){n("update:modelValue",!1)}const a=V(!1),c=V(null),d=P(()=>{var g,p;return(p=(g=c.value)==null?void 0:g.nodes)!=null?p:null});return t({isOpen:s,nodes:d}),(g,p)=>(b(),D(di,{to:"#modal-root"},[m(Mn,{name:"modal",onBeforeEnter:p[0]||(p[0]=y=>a.value=!0),onAfterLeave:p[1]||(p[1]=y=>a.value=!1)},{default:x(()=>[mn(v("div",Ue({class:"modal-mask",onPointerdown:Rt(o,["self"])},g.$attrs),[v("div",ro,[v("div",io,[v("div",so,[Ye(g.$slots,"header",{shown:l(s)},()=>[M(" default header ")])]),v("div",oo,[m(Dr,{ref_key:"contextRef",ref:c},{default:x(()=>[Ye(g.$slots,"body",{shown:l(s)},()=>[M(" default body ")])]),_:3},512)]),v("div",ao,[Ye(g.$slots,"footer",{shown:l(s)},()=>[v("div",{class:"modal-default-footer"},[lo,v("button",{class:"button modal-default-button",onClick:o}," Close ")])])])])])],16,no),[[ci,e.modelValue]])]),_:3})]))}}),ot=Symbol("ProxyState");function ce(e,t={}){const n=t;let r=!1,i=!1;function s(){return r||(i&&console.error("Cyclical dependency detected. Cannot evaluate lazy proxy."),i=!0,Object.assign(n,e.call(n,n)),r=!0),n}return new Proxy(n,{get(o,a){if(a===ot)return s();const c=s()[a];return c!=null&&typeof c=="object"&&Ke in c?c[Ke]:c},set(o,a,c){return s()[a]=c,!0},has(o,a){return a===ot?!0:Reflect.has(s(),a)},ownKeys(){return Reflect.ownKeys(s())},getOwnPropertyDescriptor(o,a){return r||(Object.assign(n,e.call(n,n)),r=!0),Object.getOwnPropertyDescriptor(o,a)}})}const Rr=u.ln(10);function on(e){return e}function Ft(e,...t){const n=t.find(r=>T(r));return n==null?(console.error("Could not invert due to no input being a variable"),0):n.invert(e)}function uo(e,t){return T(t)?t.invert(u.neg(e)):(console.error("Could not invert due to no input being a variable"),0)}function co(e,t){return T(t)?t.isIntegrable()?f.neg(t.getIntegralFormula(e)):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function fo(e){return f.neg(e)}function mo(e,t,n){return T(t)?t.invert(u.sub(e,pe(n))):T(n)?n.invert(u.sub(e,pe(t))):(console.error("Could not invert due to no input being a variable"),0)}function po(e,t,n){var r,i;if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const s=t.getIntegralFormula(e);return f.times(n,(r=t.innermostVariable)!=null?r:0).add(s)}else if(T(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const s=n.getIntegralFormula(e);return f.times(t,(i=n.innermostVariable)!=null?i:0).add(s)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function go(e,t,n){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.add(r,n)}else if(T(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.add(r,t)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function vo(e,t,n){return T(t)?t.invert(u.add(e,pe(n))):T(n)?n.invert(u.sub(pe(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function ho(e,t,n){var r,i;if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const s=t.getIntegralFormula(e);return f.sub(s,f.times(n,(r=t.innermostVariable)!=null?r:0))}else if(T(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const s=n.getIntegralFormula(e);return f.times(t,(i=n.innermostVariable)!=null?i:0).sub(s)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function bo(e,t,n){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.sub(r,n)}else if(T(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.sub(r,t)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function yo(e,t,n){return T(t)?t.invert(u.div(e,pe(n))):T(n)?n.invert(u.div(e,pe(t))):(console.error("Could not invert due to no input being a variable"),0)}function _o(e,t,n){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.times(r,n)}else if(T(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.times(r,t)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Co(e,t,n){return T(t)?f.div(e,n):T(n)?f.div(e,t):(console.error("Could not apply substitution due to no input being a variable"),f.constant(0))}function wo(e,t,n){return T(t)?t.invert(u.mul(e,pe(n))):T(n)?n.invert(u.div(pe(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function ko(e,t,n){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.div(r,n)}else if(T(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.div(t,r)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function No(e,t,n){return T(t)?f.mul(e,n):T(n)?f.mul(e,t):(console.error("Could not apply substitution due to no input being a variable"),f.constant(0))}function So(e,t){return T(t)?t.invert(u.recip(e)):(console.error("Could not invert due to no input being a variable"),0)}function Io(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.ln(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function $o(e,t){return T(t)?t.invert(u.pow10(e)):(console.error("Could not invert due to no input being a variable"),0)}function Mo(e){return u.ln(e).sub(1).times(e).div(Rr)}function To(e,t){if(T(t)){const n=Rr.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function Po(e,t){return T(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e)],evaluate:Mo,invert:To}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function Oo(e,t,n){return T(t)?t.invert(u.pow(pe(n),e)):T(n)?n.invert(u.root(pe(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function Fo(e,t){return u.ln(e).sub(1).times(e).div(u.ln(t))}function Eo(e,t,n){if(T(t)){const r=u.ln(pe(n)).times(e);return t.invert(r.div(r.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function qo(e,t,n){return T(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e),n],evaluate:Fo,invert:Eo}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function Vo(e,t){return T(t)?t.invert(u.pow(2,e)):(console.error("Could not invert due to no input being a variable"),0)}function Do(e){return u.ln(e).sub(1).times(e).div(u.ln(2))}function Ro(e,t){if(T(t)){const n=u.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function Ao(e,t){return T(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e)],evaluate:Do,invert:Ro}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function Bo(e,t){return T(t)?t.invert(u.exp(e)):(console.error("Could not invert due to no input being a variable"),0)}function Lo(e){return u.ln(e).sub(1).times(e)}function xo(e,t){return T(t)?t.invert(u.div(e,u.div(e,Math.E).lambertw())):(console.error("Could not invert due to no input being a variable"),0)}function jo(e,t){return T(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e)],evaluate:Lo,invert:xo}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function Uo(e,t,n){return T(t)?t.invert(u.root(e,pe(n))):T(n)?n.invert(u.ln(e).div(u.ln(pe(t)))):(console.error("Could not invert due to no input being a variable"),0)}function zo(e,t,n){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e),i=f.add(n,1);return f.pow(r,i).div(i)}else if(T(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.pow(t,r).div(f.ln(t))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Go(e,t){return T(t)?t.invert(u.root(e,10)):(console.error("Could not invert due to no input being a variable"),0)}function Ho(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.pow10(n).div(f.ln(10))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Wo(e,t,n){return T(t)?t.invert(u.ln(e).div(u.ln(pe(n)))):T(n)?n.invert(u.root(pe(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function Ko(e,t,n){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.pow(n,r).div(f.ln(n))}else if(T(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e),i=f.add(t,1);return f.pow(r,i).div(i)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Yo(e,t,n){return T(t)?t.invert(u.root(e,u.recip(pe(n)))):T(n)?n.invert(u.ln(pe(t)).div(u.ln(e))):(console.error("Could not invert due to no input being a variable"),0)}function Jo(e,t,n){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.pow(r,f.recip(n).add(1)).times(n).div(f.add(n,1))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Zo(e,t){return T(t)?t.invert(u.ln(e)):(console.error("Could not invert due to no input being a variable"),0)}function Xo(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.exp(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Qo(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){const r=u.minabs(t,1e308).toNumber();return u.tetrate(e,r,n)}function ea(e,t,n,r){return T(t)?t.invert(u.ssqrt(e)):(console.error("Could not invert due to no input being a variable"),0)}function ta(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){const r=u.minabs(t,1e308).toNumber();return u.iteratedexp(e,r,new u(n))}function na(e,t,n,r){return T(t)?t.invert(u.iteratedlog(e,Math.E,u.minabs(1e308,pe(n)).toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function ra(e,t=10,n=2){const r=u.minabs(n,1e308).toNumber();return u.iteratedlog(e,t,r)}function ia(e,t=10){const n=u.minabs(t,1e308).toNumber();return u.slog(e,n)}function sa(e,t,n){return T(t)?t.invert(u.tetrate(e,u.minabs(1e308,pe(n)).toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function oa(e,t,n){const r=u.minabs(t,1e308).toNumber();return u.layeradd(e,r,n)}function aa(e,t,n,r){return T(t)?t.invert(u.layeradd(e,u.minabs(1e308,pe(n)).negate().toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function la(e,t){return T(t)?t.invert(u.pow(Math.E,e).times(e)):(console.error("Could not invert due to no input being a variable"),0)}function ua(e,t){return T(t)?t.invert(u.tetrate(e,2)):(console.error("Could not invert due to no input being a variable"),0)}function ca(e,t,n){const r=u.minabs(t,1e308).toNumber();return u.pentate(e,r,n)}function da(e,t){return T(t)?t.invert(u.asin(e)):(console.error("Could not invert due to no input being a variable"),0)}function fa(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cos(n).neg()}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function ma(e,t){return T(t)?t.invert(u.acos(e)):(console.error("Could not invert due to no input being a variable"),0)}function pa(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.sin(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function ga(e,t){return T(t)?t.invert(u.atan(e)):(console.error("Could not invert due to no input being a variable"),0)}function va(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cos(n).ln().neg()}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function ha(e,t){return T(t)?t.invert(u.sin(e)):(console.error("Could not invert due to no input being a variable"),0)}function ba(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.asin(n).times(n).add(f.sqrt(f.sub(1,f.pow(n,2))))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function ya(e,t){return T(t)?t.invert(u.cos(e)):(console.error("Could not invert due to no input being a variable"),0)}function _a(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.acos(n).times(n).sub(f.sqrt(f.sub(1,f.pow(n,2))))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Ca(e,t){return T(t)?t.invert(u.tan(e)):(console.error("Could not invert due to no input being a variable"),0)}function wa(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.atan(n).times(n).sub(f.ln(f.pow(n,2).add(1)).div(2))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function ka(e,t){return T(t)?t.invert(u.asinh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Na(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cosh(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Sa(e,t){return T(t)?t.invert(u.acosh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ia(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.sinh(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function $a(e,t){return T(t)?t.invert(u.atanh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ma(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cosh(n).ln()}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Ta(e,t){return T(t)?t.invert(u.sinh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Pa(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.asinh(n).times(n).sub(f.pow(n,2).add(1).sqrt())}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Oa(e,t){return T(t)?t.invert(u.cosh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Fa(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.acosh(n).times(n).sub(f.add(n,1).sqrt().times(f.sub(n,1).sqrt()))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Ea(e,t){return T(t)?t.invert(u.tanh(e)):(console.error("Could not invert due to no input being a variable"),0)}function qa(e,t){if(T(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.atanh(n).times(n).add(f.sub(1,f.pow(n,2)).ln().div(2))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Tt(e){return(t,n)=>new f({inputs:[t,n],evaluate:e,invert:on})}function T(e){return e instanceof de&&e.hasVariable()}function pe(e,t){return e instanceof de?e.evaluate(t):l(e)}function Va(){return f.pow(this,2).div(2)}function Da(){return this}const ge=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;"inputs"in e&&(e.inputs=e.inputs.map(n=>typeof n=="object"&&Ke in n?n[Ke]:n)),"variable"in e?(typeof e.variable=="object"&&Ke in e.variable&&(e.variable=e.variable[Ke]),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:Va,internalIntegrateInner:Da,applySubstitution:on}}setupConstant({inputs:e}){return e.length!==1&&console.error("Evaluate function is required if inputs is not length 1"),{inputs:e,internalVariables:0}}setupFormula(e){var y,w;const{inputs:t,evaluate:n,invert:r,integrate:i,integrateInner:s,applySubstitution:o}=e,a=t.reduce((N,_)=>N+(_ instanceof ge?_.internalVariables:0),0),c=t.find(N=>N instanceof ge&&N.hasVariable()),d=a===1?c==null?void 0:c.innermostVariable:void 0,g=(y=c==null?void 0:c.isInvertible())!=null?y:!1,p=(w=c==null?void 0:c.isIntegrable())!=null?w:!1;return{inputs:t,internalEvaluate:n,internalInvert:g?r:void 0,internalIntegrate:p?i:void 0,internalIntegrateInner:s,applySubstitution:o,innermostVariable:d,internalVariables:a}}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,r;return(r=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(i=>pe(i,e))))!=null?n:this.hasVariable()?e:null)!=null?r:pe(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof ge&&e.inputs[n]instanceof ge?t.equals(e.inputs[n]):!(t instanceof ge)&&!(e.inputs[n]instanceof ge)&&u.eq(l(t),l(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new f({inputs:[e]})}static variable(e){return new f({variable:e})}static step(e,t,n){const r=n(f.variable(0)),i=Fe(t);function s(a){return u.lt(a,l(i))?a:u.add(r.evaluate(u.sub(a,l(i))),l(i))}function o(a,c){return T(c)&&r.isInvertible()?(u.gt(a,l(i))&&(a=u.add(r.invert(u.sub(a,l(i))),l(i))),c.invert(a)):(console.error("Could not invert due to no input being a variable"),0)}return new f({inputs:[e],evaluate:s,invert:r.isInvertible()&&r.hasVariable()?o:void 0})}static if(e,t,n,r){const i=V(0),s=f.variable(i),o=n(s),a=r==null?void 0:r(s),c=Fe(t);function d(p){return l(c)?(i.value=p,o.evaluate()):a?(i.value=p,a.evaluate()):p}function g(p,y){return!T(y)||!o.isInvertible()||a!=null&&!a.isInvertible()?(console.error("Could not invert due to no input being a variable"),0):l(c)?y.invert(o.invert(p)):a?y.invert(a.invert(p)):y.invert(p)}return new f({inputs:[e],evaluate:d,invert:o.isInvertible()&&o.hasVariable()?g:void 0})}static conditional(e,t,n,r){return f.if(e,t,n,r)}static abs(e){return new f({inputs:[e],evaluate:u.abs})}static neg(e){return new f({inputs:[e],evaluate:u.neg,invert:uo,applySubstitution:fo,integrate:co})}static sign(e){return new f({inputs:[e],evaluate:u.sign})}static round(e){return new f({inputs:[e],evaluate:u.round,invert:Ft})}static floor(e){return new f({inputs:[e],evaluate:u.floor,invert:Ft})}static ceil(e){return new f({inputs:[e],evaluate:u.ceil,invert:Ft})}static trunc(e){return new f({inputs:[e],evaluate:u.trunc,invert:Ft})}static add(e,t){return new f({inputs:[e,t],evaluate:u.add,invert:mo,integrate:po,integrateInner:go,applySubstitution:on})}static sub(e,t){return new f({inputs:[e,t],evaluate:u.sub,invert:vo,integrate:ho,integrateInner:bo,applySubstitution:on})}static mul(e,t){return new f({inputs:[e,t],evaluate:u.mul,invert:yo,integrate:_o,applySubstitution:Co})}static div(e,t){return new f({inputs:[e,t],evaluate:u.div,invert:wo,integrate:ko,applySubstitution:No})}static recip(e){return new f({inputs:[e],evaluate:u.recip,invert:So,integrate:Io})}static clamp(e,t,n){return new f({inputs:[e,t,n],evaluate:u.clamp,invert:Ft})}static pLog10(e){return new f({inputs:[e],evaluate:u.pLog10})}static absLog10(e){return new f({inputs:[e],evaluate:u.absLog10})}static log10(e){return new f({inputs:[e],evaluate:u.log10,invert:$o,integrate:Po})}static log(e,t){return new f({inputs:[e,t],evaluate:u.log,invert:Oo,integrate:qo})}static log2(e){return new f({inputs:[e],evaluate:u.log2,invert:Vo,integrate:Ao})}static ln(e){return new f({inputs:[e],evaluate:u.ln,invert:Bo,integrate:jo})}static pow(e,t){return new f({inputs:[e,t],evaluate:u.pow,invert:Uo,integrate:zo})}static pow10(e){return new f({inputs:[e],evaluate:u.pow10,invert:Go,integrate:Ho})}static pow_base(e,t){return new f({inputs:[e,t],evaluate:u.pow_base,invert:Wo,integrate:Ko})}static root(e,t){return new f({inputs:[e,t],evaluate:u.root,invert:Yo,integrate:Jo})}static factorial(e){return new f({inputs:[e],evaluate:u.factorial})}static gamma(e){return new f({inputs:[e],evaluate:u.gamma})}static lngamma(e){return new f({inputs:[e],evaluate:u.lngamma})}static exp(e){return new f({inputs:[e],evaluate:u.exp,invert:Zo,integrate:Xo})}static sqr(e){return f.pow(e,2)}static sqrt(e){return f.root(e,2)}static cube(e){return f.pow(e,3)}static cbrt(e){return f.root(e,3)}static tetrate(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:Qo,invert:ea})}static iteratedexp(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:ta,invert:na})}static iteratedlog(e,t=10,n=1){return new f({inputs:[e,t,n],evaluate:ra})}static slog(e,t=10){return new f({inputs:[e,t],evaluate:ia,invert:sa})}static layeradd10(e,t){return new f({inputs:[e,t],evaluate:u.layeradd10})}static layeradd(e,t,n=10){return new f({inputs:[e,t,n],evaluate:oa,invert:aa})}static lambertw(e){return new f({inputs:[e],evaluate:u.lambertw,invert:la})}static ssqrt(e){return new f({inputs:[e],evaluate:u.ssqrt,invert:ua})}static pentate(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:ca})}static sin(e){return new f({inputs:[e],evaluate:u.sin,invert:ha,integrate:fa})}static cos(e){return new f({inputs:[e],evaluate:u.cos,invert:ya,integrate:pa})}static tan(e){return new f({inputs:[e],evaluate:u.tan,invert:Ca,integrate:va})}static asin(e){return new f({inputs:[e],evaluate:u.asin,invert:da,integrate:ba})}static acos(e){return new f({inputs:[e],evaluate:u.acos,invert:ma,integrate:_a})}static atan(e){return new f({inputs:[e],evaluate:u.atan,invert:ga,integrate:wa})}static sinh(e){return new f({inputs:[e],evaluate:u.sinh,invert:Ta,integrate:Na})}static cosh(e){return new f({inputs:[e],evaluate:u.cosh,invert:Oa,integrate:Ia})}static tanh(e){return new f({inputs:[e],evaluate:u.tanh,invert:Ea,integrate:Ma})}static asinh(e){return new f({inputs:[e],evaluate:u.asinh,invert:ka,integrate:Pa})}static acosh(e){return new f({inputs:[e],evaluate:u.acosh,invert:Sa,integrate:Fa})}static atanh(e){return new f({inputs:[e],evaluate:u.atanh,invert:$a,integrate:qa})}step(e,t){return f.step(this,e,t)}if(e,t){return f.if(this,e,t)}conditional(e,t){return f.if(this,e,t)}abs(){return f.abs(this)}neg(){return f.neg(this)}sign(){return f.sign(this)}round(){return f.round(this)}floor(){return f.floor(this)}ceil(){return f.ceil(this)}trunc(){return f.trunc(this)}add(e){return f.add(this,e)}sub(e){return f.sub(this,e)}mul(e){return f.mul(this,e)}div(e){return f.div(this,e)}recip(){return f.recip(this)}max(e){return f.max(this,e)}min(e){return f.min(this,e)}maxabs(e){return f.maxabs(this,e)}minabs(e){return f.minabs(this,e)}clamp(e,t){return f.clamp(this,e,t)}clampMin(e){return f.clampMin(this,e)}clampMax(e){return f.clampMax(this,e)}pLog10(){return f.pLog10(this)}absLog10(){return f.absLog10(this)}log10(){return f.log10(this)}log(e){return f.log(this,e)}log2(){return f.log2(this)}ln(){return f.ln(this)}pow(e){return f.pow(this,e)}pow10(){return f.pow10(this)}pow_base(e){return f.pow_base(this,e)}root(e){return f.root(this,e)}factorial(){return f.factorial(this)}gamma(){return f.gamma(this)}lngamma(){return f.lngamma(this)}exp(){return f.exp(this)}sqr(){return f.pow(this,2)}sqrt(){return f.root(this,2)}cube(){return f.pow(this,3)}cbrt(){return f.root(this,3)}tetrate(e=2,t=u.fromComponents_noNormalize(1,0,1)){return f.tetrate(this,e,t)}iteratedexp(e=2,t=u.fromComponents_noNormalize(1,0,1)){return f.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return f.iteratedlog(this,e,t)}slog(e=10){return f.slog(this,e)}layeradd10(e){return f.layeradd10(this,e)}layeradd(e,t){return f.layeradd(this,e,t)}lambertw(){return f.lambertw(this)}ssqrt(){return f.ssqrt(this)}pentate(e=2,t=u.fromComponents_noNormalize(1,0,1)){return f.pentate(this,e,t)}sin(){return f.sin(this)}cos(){return f.cos(this)}tan(){return f.tan(this)}asin(){return f.asin(this)}acos(){return f.acos(this)}atan(){return f.atan(this)}sinh(){return f.sinh(this)}cosh(){return f.cosh(this)}tanh(){return f.tanh(this)}asinh(){return f.asinh(this)}acosh(){return f.acosh(this)}atanh(){return f.atanh(this)}};let de=ge;de.negate=ge.neg;de.negated=ge.neg;de.sgn=ge.sign;de.plus=ge.add;de.subtract=ge.sub;de.minus=ge.sub;de.multiply=ge.mul;de.times=ge.mul;de.divide=ge.div;de.divideBy=ge.div;de.dividedBy=ge.div;de.reciprocal=ge.recip;de.reciprocate=ge.recip;de.max=Tt(u.max);de.min=Tt(u.min);de.minabs=Tt(u.minabs);de.maxabs=Tt(u.maxabs);de.clampMin=Tt(u.clampMin);de.clampMax=Tt(u.clampMax);de.logarithm=ge.log;class f extends de{invert(t){return this.internalInvert&&this.hasVariable()?this.internalInvert.call(this,t,...this.inputs):this.inputs.length===1&&this.hasVariable()?t:(console.error("Cannot invert non-invertible formula"),0)}evaluateIntegral(t){return this.isIntegrable()?this.getIntegralFormula().evaluate(t):(console.error("Cannot evaluate integral of formula without integral"),0)}invertIntegral(t){return!this.isIntegrable()||!this.getIntegralFormula().isInvertible()?(console.error("Cannot invert integral of formula without invertible integral"),0):this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=u.add(this.evaluate(0),this.evaluate(1)).div(2);return u.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)return console.error("Cannot integrate formula with non-integrable operation"),f.constant(0);let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(r=>n=r(n)),this.integralFormula=n}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 return console.error("Cannot integrate formula without variable"),f.constant(0);return this.integralFormula}else return this.applySubstitution==null?(console.error("Cannot have two complex operations in an integrable formula"),f.constant(0)):(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner?this.internalIntegrateInner.call(this,t,...this.inputs):this.internalIntegrate?this.internalIntegrate.call(this,t,...this.inputs):this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable()?this:(console.error("Cannot integrate formula without variable"),f.constant(0)))}}function Ra(e,t,n=!0,r,i=u.dInf){const s=Fe(n),o=Fe(r),a=Fe(i);return P(()=>{var y,w,N,_;const c=l(a);if(u.eq(c,1))return u.gte(t.value,e.evaluate())?u.dOne:u.dZero;const d=l(s),g=(y=l(o))!=null?y:d?10:0;let p=0;if(u.gt(c,g)){if(!e.isInvertible())return console.error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum"),0;if(d){if(!e.isIntegralInvertible())return console.error("Cannot calculate max affordable of formula with non-invertible integral"),0;p=u.floor(e.invertIntegral(u.add(t.value,e.evaluateIntegral()))).sub((w=l(e.innermostVariable))!=null?w:0)}else p=u.floor(e.invert(t.value))}if(p=u.clampMax(p,c),g>0){const E=p;p=u.sub(p,g).clampMin(0);let q;for(d?q=an(e,p,!0,0):q=e.evaluate(u.add((N=l(e.innermostVariable))!=null?N:0,p));u.lt(p,c)&&u.lt(p,Number.MAX_SAFE_INTEGER)&&u.add(E,1).gte(p);){const I=e.evaluate(p.add((_=l(e.innermostVariable))!=null?_:0));if(u.add(q,I).lte(t.value))p=p.add(1),q=u.add(q,I);else break}}return p})}function an(e,t,n=!0,r){var c;if(u.eq(t,1))return e.evaluate();const i=(c=l(e.innermostVariable))!=null?c:0;let s=u.add(t,i);const o=s;r!=null||(r=n?10:0),s=s.sub(r).clampMin(i);let a=0;if(u.gt(t,r)){if(!e.isInvertible())return console.error("Cannot calculate cost with indirect sum of non-invertible formula"),0;if(n){if(!e.isIntegrable())return console.error("Cannot calculate cost with cumulative cost of non-integrable formula"),0;if(a=u.sub(e.evaluateIntegral(s),e.evaluateIntegral()),o.gt(1e308))return u.add(a,u.sub(o,s).times(e.evaluate(s)))}else if(a=e.evaluate(s),s=s.add(1),o.gt(1e308))return u.sub(o,s).add(1).times(a)}for(let d=s.toNumber();d<o.toNumber();d++)a=u.add(a,e.evaluate(d));return a}const at=Symbol("PersistentState"),lt=Symbol("DefaultValue"),cn=Symbol("StackTrace"),Sn=Symbol("Deleted"),Ke=Symbol("NonPersistent"),ht=Symbol("SaveDataPath"),jt=Symbol("SkipPersistence");function Aa(){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 fr(e,t){var n;u.isNaN(t)&&(fe.hasNaN||(R.autosave=!1,fe.hasNaN=!0,fe.NaNPath=e[ht],fe.NaNPersistent=e),console.error(`Attempted to save NaN value to ${(n=e[ht])==null?void 0:n.join(".")}`)),e[at].value=t}function _e(e,t=!0){const n=ye(e)?e:V(e);ye(e)&&(e=e.value);const r=P({get(){return n.value},set(s){t?fr(i,s):i[at].value=s}});r[lt]=e;const i={get value(){return n.value},set value(s){t?fr(i,s):i[at].value=s},__v_isRef:!0,[at]:n,[lt]:e,[cn]:Aa(),[Sn]:!1,[Ke]:r,[ht]:void 0};return Le.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",i,`
Created at:
`+i[cn]):Nt[Le[Le.length-1]].add(i),i}function Ba(e){return e!=null&&typeof e=="object"&&at in e}function qt(e){return!(ot in e)&&Ke in e?e[Ke]:new Proxy(e,{get(t,n){if(n!==at)return n===jt?!0:t[n]},set(t,n,r){return t[n]=r,!0},has(t,n){return n===at?!1:n==jt?!0:Reflect.has(t,n)}})}he.on("addLayer",(e,t)=>{const n=[],r=(i,s=[])=>{let o=!1;return Object.keys(i).forEach(a=>{let c=i[a];if(c!=null&&typeof c=="object"){if(c[jt]===!0)return;if(ot in c&&(c=c[ot]),Ba(c)){if(o=!0,c[Sn]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
Created at:
`+c[cn]);return}Nt[e.id].delete(c);const d=[e.id,...s,a];c[ht]!=null&&JSON.stringify(d)!==JSON.stringify(c[ht])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[ht].join(".")}\`.`,"This can cause unexpected behavior when loading saves between updates."),c[ht]=d;const g=s.reduce((y,w)=>(w in y||(y[w]={}),y[w]),t),p=g[a];g[a]=c[at],fi(g)?p!=null?g[a]=p:g[a]=c[lt]:p!=null?g[a].value=p:g[a].value=c[lt]}else!(c instanceof u)&&!(c instanceof f)&&!ye(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),r(c,[...s,a])&&(Je(c)&&!Je(i)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",ot in i?i[ot]:i,a):o=!0))}}),o};r(e[ot]),Nt[e.id].forEach(i=>{i[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.
Created at:
`+i[cn])}),Nt[e.id].clear()});const Vn=Symbol("RegisterNode"),Dn=Symbol("UnregisterNode"),Rn=Symbol("Nodes"),An=Symbol("Bounds"),Ie=fn({});window.layers=Ie;const Nt={},Le=[];function Gt(e,t){return ce(()=>{const n={},r=n.emitter=_r();if(n.on=r.on.bind(r),n.emit=r.emit.bind(r),n.nodes=V({}),n.id=e,Le.push(e),Nt[e]=new Set,n.minimized=_e(!1,!1),Object.assign(n,t.call(n,n)),Le[Le.length-1]==null||Le[Le.length-1]!==e)throw new Error(`Adding layers stack in invalid state. This should not happen
Stack: ${Le}
Trying to pop ${n.id}`);Le.pop(),k(n,"color"),k(n,"display"),k(n,"classes"),k(n,"style"),k(n,"name"),W(n,"name",n.id),k(n,"minWidth"),W(n,"minWidth",600),k(n,"minimizable"),W(n,"minimizable",!0),k(n,"minimizedDisplay");const i=n.style;return n.style=P(()=>{var o,a;let s=l(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(o=l(i))!=null?o:"",(a=n.minimized)!=null&&a.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),n})}function Ar(e,t){if(console.info("Adding layer",e.id),Ie[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Ie[e.id]);return}W(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Ie[e.id]=e,he.emit("addLayer",e,t.layers[e.id])}function La(e){return Ie[e]}function Br(e){console.info("Removing layer",e.id),he.emit("removeLayer",e),Ie[e.id]=void 0}function xa(e){Br(e),Ar(e,R)}function Lr(e){const t=V(!1);return{openModal:()=>t.value=!0,modal:L(()=>m(ct,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>m("h2",null,[l(e.name)]),body:l(e.display)}))}}he.on("update",function(t){Object.values(Ie).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(Ie).forEach(n=>{n==null||n.emit("update",t)}),Object.values(Ie).forEach(n=>{n==null||n.emit("postUpdate",t)})});var ja=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Vn,UnregisterNodeInjectionKey:Dn,NodesInjectionKey:Rn,BoundsInjectionKey:An,layers:Ie,persistentRefs:Nt,addingLayers:Le,createLayer:Gt,addLayer:Ar,getLayer:La,removeLayer:Br,reloadLayer:xa,setupLayerModal:Lr},Symbol.toStringTag,{value:"Module"}));const Ua=A({components:{Context:Dr,ErrorVue:kr},props:{index:{type:Number,required:!0},display:{type:$(Object,String,Function),required:!0},minimizedDisplay:$(Object,String,Function),minimized:{type:Object,required:!0},name:{type:$(String),required:!0},color:$(String),minimizable:$(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:r,minimizedDisplay:i}=ue(e),s=It(t),o=ut(i),a=P(()=>te.allowGoBack&&n.value>0&&!ae(r));function c(){R.tabs.splice(l(e.index),1/0)}function d(p){e.nodes.value=p}const g=V([]);return mi((p,y,w)=>(console.warn(`Error caught in "${e.name}" layer`,p,y,w),g.value.push(p instanceof Error?p:new Error(JSON.stringify(p))),!1)),{component:s,minimizedComponent:o,showGoBack:a,updateNodes:d,unref:l,goBack:c,errors:g}}}),za={key:1};function Ga(e,t,n,r,i,s){const o=ve("ErrorVue"),a=ve("Context");return e.errors.length>0?(b(),D(o,{key:0,errors:e.errors},null,8,["errors"])):(b(),S("div",Ue({key:1,class:"layer-container",style:{"--layer-color":e.unref(e.color)}},e.$attrs),[e.showGoBack?(b(),S("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):F("",!0),e.unref(e.minimized)?(b(),S("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(b(),D(ie(e.minimizedComponent),{key:0})):(b(),S("div",za,G(e.unref(e.name)),1))])):(b(),S("div",{key:2,class:re(["layer-tab",{showGoBack:e.showGoBack}])},[m(a,{onUpdateNodes:e.updateNodes},{default:x(()=>[(b(),D(ie(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(b(),S("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.$emit("setMinimized",!0))}," \u25BC ")):F("",!0)],16))}var Ha=K(Ua,[["render",Ga],["__scopeId","data-v-a9f5b1da"]]);const xr=e=>(ze("data-v-4b4bda40"),e=e(),Ge(),e),Wa=xr(()=>v("h2",null,"Changelog",-1)),Ka=xr(()=>v("details",{open:""},[v("summary",null,[M("v0.0 Initial Commit - "),v("time",null,"2021-09-04")]),M(" This is the first release :D "),v("ul",null,[v("li",{class:"feature"},"Did everything"),v("li",{class:"fix"},"Had some fun"),v("li",{class:"breaking"},"Removed everything"),v("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Ya=A({__name:"Changelog",setup(e,{expose:t}){const n=V(!1);return t({open(){n.value=!0}}),(r,i)=>(b(),D(ct,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s)},{header:x(()=>[Wa]),body:x(()=>[Ka]),_:1},8,["modelValue"]))}});var Ja=K(Ya,[["__scopeId","data-v-4b4bda40"]]),Za=A({props:{element:Object,display:{type:$(Object,String,Function),required:!0},style:$(Object,String,Array),classes:$(Object),direction:$(String),xoffset:$(String),yoffset:$(String),pinned:Object},setup(e){const{element:t,display:n,pinned:r}=ue(e),i=V(!1),s=P(()=>(ae(r)||i.value)&&o.value),o=ut(n),a=ke(H(L(()=>{const g=ae(t);return g==null?"":xe(g)})));function c(g){const p=r;g.shiftKey&&p&&(p.value=!p.value,g.stopPropagation(),g.preventDefault())}const d=P(()=>ae(r)&&rt[Q.theme].showPin);return{Direction:J,isHovered:i,isShown:s,comp:o,elementComp:a,unref:l,togglePinned:c,showPin:d}}});const Xa={key:0,class:"material-icons pinned"};function Qa(e,t,n,r,i,s){return b(),S("div",{class:re(["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))},[Ye(e.$slots,"default",{},void 0,!0),e.elementComp?(b(),D(ie(e.elementComp),{key:0})):F("",!0),m(Mn,{name:"fade"},{default:x(()=>{var o;return[e.isShown?(b(),S("div",{key:0,class:re(["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?(b(),S("span",Xa,"push_pin")):F("",!0),e.comp?(b(),D(ie(e.comp),{key:1})):F("",!0)],6)):F("",!0)]}),_:1})],34)}var me=K(Za,[["render",Qa],["__scopeId","data-v-6102fa3a"]]);const bt=e=>(ze("data-v-10effbe8"),e=e(),Ge(),e),el={class:"info-modal-header"},tl=["src","alt"],nl={class:"info-modal-title"},rl={key:0},il={key:0},sl={key:0},ol=bt(()=>v("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),al=bt(()=>v("br",null,null,-1)),ll=bt(()=>v("br",null,null,-1)),ul=["href"],cl=bt(()=>v("span",{class:"material-icons info-modal-discord"},"discord",-1)),dl=bt(()=>v("div",null,[v("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[v("span",{class:"material-icons info-modal-discord"},"discord"),M(" Profectus & Friends ")])],-1)),fl=bt(()=>v("div",null,[v("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[v("span",{class:"material-icons info-modal-discord"},"discord"),M(" The Modding Tree ")])],-1)),ml=bt(()=>v("br",null,null,-1));var pl=A({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:r,logo:i,author:s,discordName:o,discordLink:a,versionNumber:c,versionTitle:d}=te,g=ue(n),p=V(!1),y=P(()=>gn(R.timePlayed)),w=P(()=>H(L(()=>m(U,null,[qr.map(be)]))));t({open(){p.value=!0}});function N(){var _;(_=l(g.changelog))==null||_.open()}return(_,E)=>(b(),D(ct,{modelValue:p.value,"onUpdate:modelValue":E[0]||(E[0]=q=>p.value=q)},{header:x(()=>[v("div",el,[l(i)?(b(),S("img",{key:0,class:"info-modal-logo",src:l(i),alt:l(r)},null,8,tl)):F("",!0),v("div",nl,[v("h2",null,G(l(r)),1),v("h4",null,[M(" v"+G(l(c)),1),l(d)?(b(),S("span",rl,": "+G(l(d)),1)):F("",!0)])])])]),body:x(({shown:q})=>[q?(b(),S("div",il,[l(s)?(b(),S("div",sl,"By "+G(l(s)),1)):F("",!0),ol,al,v("div",{class:"link",onClick:N},"Changelog"),ll,v("div",null,[l(a)?(b(),S("a",{key:0,href:l(a),class:"info-modal-discord-link",target:"_blank"},[cl,M(" "+G(l(o)),1)],8,ul)):F("",!0)]),dl,fl,ml,v("div",null,"Time Played: "+G(l(y)),1),(b(),D(ie(l(w))))])):F("",!0)]),_:1},8,["modelValue"]))}});var gl=K(pl,[["__scopeId","data-v-10effbe8"]]);const vl={class:"field"},hl={key:0,class:"field-title"},Bn=A({__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,r=ut(nt(n,"title"),"span"),i=V((o=n.options.find(a=>a.value===n.modelValue))!=null?o:null);je(nt(n,"modelValue"),a=>{var c;ae(i)!==a&&(i.value=(c=n.options.find(d=>d.value===a))!=null?c:null)});function s(a){t("update:modelValue",a.value)}return(a,c)=>(b(),S("div",vl,[l(r)?(b(),S("span",hl,[(b(),D(ie(l(r))))])):F("",!0),m(l(_i),{options:e.options,modelValue:i.value,"onUpdate:modelValue":[c[0]||(c[0]=d=>i.value=d),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const bl={class:"field"},yl=A({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=P(()=>{var s;return H((s=l(n.title))!=null?s:"<span></span>","span")}),i=P({get(){return!!n.modelValue},set(s){t("update:modelValue",s)}});return(s,o)=>(b(),S("label",bl,[mn(v("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":o[0]||(o[0]=a=>ye(i)?i.value=a:null)},null,512),[[pi,l(i)]]),(b(),D(ie(l(r))))]))}});var Me=K(yl,[["__scopeId","data-v-11046116"]]);const _l={class:"header"},Cl=v("h2",null,"Settings",-1),wl={class:"option-tabs"},kl={key:0},Nl={key:1};var Sl=A({__name:"Options",setup(e,{expose:t}){const n=V(!1),r=V("behaviour");function i(se){return se==r.value}function s(se){r.value=se}t({isTab:i,setTab:s,save:Oe,open(){n.value=!0}});const o=Object.keys(rt).map(se=>({label:On(se),value:se})),a=P(()=>H(L(()=>m(U,null,[Fr.map(be)])))),{showTPS:c,theme:d,unthrottled:g,alignUnits:p}=ue(Q),{autosave:y,offlineProd:w}=ue(R),N=P({get(){return R.devSpeed===0},set(se){R.devSpeed=se?0:null}}),_=L(()=>m("span",{class:"option-title"},[M("Unthrottled"),m("desc",null,[M("Allow the game to run as fast as possible. Not battery friendly.")])])),E=L(()=>m("span",{class:"option-title"},[M("Offline Production"),m(me,{display:"Save-specific",direction:J.Right},{default:()=>[M("*")]}),m("desc",null,[M("Simulate production that occurs while the game is closed.")])])),q=L(()=>m("span",{class:"option-title"},[M("Autosave"),m(me,{display:"Save-specific",direction:J.Right},{default:()=>[M("*")]}),m("desc",null,[M("Automatically save the game every second or when the game is closed.")])])),I=L(()=>m("span",{class:"option-title"},[M("Pause game"),m(me,{display:"Save-specific",direction:J.Right},{default:()=>[M("*")]}),m("desc",null,[M("Stop everything from moving.")])])),O=L(()=>m("span",{class:"option-title"},[M("Theme"),m("desc",null,[M("How the game looks.")])])),j=L(()=>m("span",{class:"option-title"},[M("Show TPS"),m("desc",null,[M("Show TPS meter at the bottom-left corner of the page.")])])),le=L(()=>m("span",{class:"option-title"},[M("Align modifier units"),m("desc",null,[M("Align numbers to the beginning of the unit in modifier view.")])]));return(se,B)=>(b(),D(ct,{modelValue:n.value,"onUpdate:modelValue":B[10]||(B[10]=oe=>n.value=oe)},{header:x(()=>[v("div",_l,[Cl,v("div",wl,[v("button",{class:re({selected:i("behaviour")}),onClick:B[0]||(B[0]=oe=>s("behaviour"))},"Behaviour",2),v("button",{class:re({selected:i("appearance")}),onClick:B[1]||(B[1]=oe=>s("appearance"))},"Appearance",2)])])]),body:x(()=>[i("behaviour")?(b(),S("div",kl,[m(Me,{title:l(_),modelValue:l(g),"onUpdate:modelValue":B[2]||(B[2]=oe=>ye(g)?g.value=oe:null)},null,8,["title","modelValue"]),l(te).enablePausing?(b(),D(Me,{key:0,title:l(I),modelValue:l(N),"onUpdate:modelValue":B[3]||(B[3]=oe=>ye(N)?N.value=oe:null)},null,8,["title","modelValue"])):F("",!0),m(Me,{title:l(E),modelValue:l(w),"onUpdate:modelValue":B[4]||(B[4]=oe=>ye(w)?w.value=oe:null)},null,8,["title","modelValue"]),m(Me,{title:l(q),modelValue:l(y),"onUpdate:modelValue":B[5]||(B[5]=oe=>ye(y)?y.value=oe:null)},null,8,["title","modelValue"]),l(y)?F("",!0):(b(),D(Pn,{key:1,class:"button save-button",onClick:B[6]||(B[6]=oe=>l(Oe)())},{default:x(()=>[M("Manually save")]),_:1}))])):F("",!0),i("appearance")?(b(),S("div",Nl,[m(Bn,{title:l(O),options:l(o),modelValue:l(d),"onUpdate:modelValue":B[7]||(B[7]=oe=>ye(d)?d.value=oe:null)},null,8,["title","options","modelValue"]),(b(),D(ie(l(a)))),m(Me,{title:l(j),modelValue:l(c),"onUpdate:modelValue":B[8]||(B[8]=oe=>ye(c)?c.value=oe:null)},null,8,["title","modelValue"]),m(Me,{title:l(le),modelValue:l(p),"onUpdate:modelValue":B[9]||(B[9]=oe=>ye(p)?p.value=oe:null)},null,8,["title","modelValue"])])):F("",!0)]),_:1},8,["modelValue"]))}});const Il=["onSubmit"],$l={class:"field"},Ml={key:0,class:"field-title"},Tl=["placeholder"],Pl=A({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,r=ut(nt(n,"title"),"span"),i=ke(null);Mt(()=>{var c;(c=i.value)==null||c.focus()});const s=P({get(){var c;return(c=l(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function o(){t("submit")}function a(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,d)=>(b(),S("form",{onSubmit:Rt(o,["prevent"])},[v("div",$l,[l(r)?(b(),S("span",Ml,[(b(),D(ie(l(r))))])):F("",!0),e.textArea?(b(),D(l(wi),{key:1,modelValue:l(s),"onUpdate:modelValue":d[0]||(d[0]=g=>ye(s)?s.value=g:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:a,ref_key:"field",ref:i},null,8,["modelValue","placeholder","maxHeight"])):mn((b(),S("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=g=>ye(s)?s.value=g:null),placeholder:e.placeholder,class:re({fullWidth:!e.title}),onBlur:a,ref_key:"field",ref:i},null,42,Tl)),[[yr,l(s)]])])],40,Il))}});var Ln=K(Pl,[["__scopeId","data-v-90bd4994"]]);const Ol={key:0},Fl=["onClick","disabled"],El={key:0},ql=["onClick"],Vl=A({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const r=ue(e),i=V(!1);je(i,a=>{t("confirmingChanged",a)});function s(){if(l(r.skipConfirm)){t("click");return}i.value&&t("click"),i.value=!i.value}function o(){i.value=!1}return(a,c)=>(b(),S("span",{class:re(["container",{confirming:i.value}])},[i.value?(b(),S("span",Ol,"Are you sure?")):F("",!0),v("button",{onClick:Rt(s,["stop"]),class:"button danger",disabled:e.disabled},[i.value?(b(),S("span",El,"Yes")):Ye(a.$slots,"default",{key:1},void 0,!0)],8,Fl),i.value?(b(),S("button",{key:1,class:"button",onClick:Rt(o,["stop"])},"No",8,ql)):F("",!0)],2))}});var Dl=K(Vl,[["__scopeId","data-v-2f8ef34c"]]);const it=e=>(ze("data-v-32313015"),e=e(),Ge(),e),Rl=it(()=>v("div",{class:"handle material-icons"},"drag_handle",-1)),Al={key:0,class:"actions"},Bl=it(()=>v("span",{class:"material-icons"},"content_paste",-1)),Ll=it(()=>v("span",{class:"material-icons"},"content_copy",-1)),xl=it(()=>v("span",{class:"material-icons"},"edit",-1)),jl=it(()=>v("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Ul={key:1,class:"actions"},zl=it(()=>v("span",{class:"material-icons"},"check",-1)),Gl=it(()=>v("span",{class:"material-icons"},"close",-1)),Hl={key:2,class:"details"},Wl={class:"save-version"},Kl=it(()=>v("br",null,null,-1)),Yl={key:0},Jl={key:3,class:"details"},Zl={key:4,class:"details error"},Xl=it(()=>v("br",null,null,-1)),Ql=A({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:r}=ue(n),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=V(!1),o=V(!1),a=V("");je(s,()=>{var p;return a.value=(p=r.value.name)!=null?p:""});const c=P(()=>r.value!=null&&r.value.id===R.id),d=P(()=>{var p;return c.value?R.time:(p=r.value!=null&&r.value.time)!=null?p:0});function g(){t("editName",a.value),s.value=!1}return(p,y)=>(b(),S("div",{class:re(["save",{active:l(c)}])},[Rl,s.value?(b(),S("div",Ul,[v("button",{onClick:g,class:"button"},[m(me,{display:"Save",direction:l(J).Left,class:"info"},{default:x(()=>[zl]),_:1},8,["direction"])]),v("button",{onClick:y[5]||(y[5]=w=>s.value=!s.value),class:"button"},[m(me,{display:"Cancel",direction:l(J).Left,class:"info"},{default:x(()=>[Gl]),_:1},8,["direction"])])])):(b(),S("div",Al,[l(r).error==null&&!o.value?(b(),D(Pn,{key:0,onClick:y[0]||(y[0]=w=>t("export")),class:"button",left:""},{default:x(()=>[m(me,{display:"Export",direction:l(J).Left,class:"info"},{default:x(()=>[Bl]),_:1},8,["direction"])]),_:1})):F("",!0),l(r).error==null&&!o.value?(b(),S("button",{key:1,onClick:y[1]||(y[1]=w=>t("duplicate")),class:"button"},[m(me,{display:"Duplicate",direction:l(J).Left,class:"info"},{default:x(()=>[Ll]),_:1},8,["direction"])])):F("",!0),l(r).error==null&&!o.value?(b(),S("button",{key:2,onClick:y[2]||(y[2]=w=>s.value=!s.value),class:"button"},[m(me,{display:"Edit Name",direction:l(J).Left,class:"info"},{default:x(()=>[xl]),_:1},8,["direction"])])):F("",!0),m(Dl,{disabled:l(c),onClick:y[3]||(y[3]=w=>t("delete")),onConfirmingChanged:y[4]||(y[4]=w=>o.value=w)},{default:x(()=>[m(me,{display:"Delete",direction:l(J).Left,class:"info"},{default:x(()=>[jl]),_:1},8,["direction"])]),_:1},8,["disabled"])])),l(r).error==null&&!s.value?(b(),S("div",Hl,[v("button",{class:"button open",onClick:y[6]||(y[6]=w=>t("open"))},[v("h3",null,G(l(r).name),1)]),v("span",Wl,"v"+G(l(r).modVersion),1),Kl,l(d)?(b(),S("div",Yl,"Last played "+G(l(i).format(l(d))),1)):F("",!0)])):l(r).error==null&&s.value?(b(),S("div",Jl,[m(Ln,{modelValue:a.value,"onUpdate:modelValue":y[7]||(y[7]=w=>a.value=w),class:"editname",onSubmit:g},null,8,["modelValue"])])):(b(),S("div",Zl,[M(" Error: Failed to load save with id "+G(l(r).id),1),Xl,M(G(l(r).error),1)]))],2))}});var eu=K(Ql,[["__scopeId","data-v-32313015"]]);const xn=e=>(ze("data-v-2a4275be"),e=e(),Ge(),e),tu=xn(()=>v("h2",null,"Saves Manager",-1)),nu={class:"modal-footer"},ru={class:"field"},iu=xn(()=>v("span",{class:"field-title"},"Create Save",-1)),su={class:"field-buttons"},ou={class:"footer"},au=xn(()=>v("div",{style:{"flex-grow":"1"}},null,-1)),lu=A({__name:"SavesManager",setup(e,{expose:t}){const n=V(!1),r=V(null);t({open(){n.value=!0}});const i=V(!1),s=V(""),o=V(null);je(s,I=>{I?tt(()=>{try{if(I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=et.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I),i.value=!0;return}const O=JSON.parse(I);if(typeof O!="object"){i.value=!0;return}const j=nn();O.id=j,Oe(O),s.value="",i.value=!1,Q.saves.push(j)}catch{i.value=!0}}):i.value=!1});let a={},c=V(Object.keys(a).reduce((I,O)=>(I.push({label:O.split("/").slice(-1)[0].slice(0,-4),value:a[O]}),I),[]));const d=fn({});function g(I){if(d[I]==null){let O=localStorage.getItem(I);if(O==null)d[I]={error:"Save doesn't exist in localStorage",id:I};else if(O==="dW5kZWZpbmVk")d[I]={error:"Save is undefined",id:I};else try{if(O[0]!=="{")if(O[0]==="e")O=decodeURIComponent(escape(atob(O)));else if(O[0]==="\u1BE1")O=et.decompressFromUTF16(O);else return console.warn("Unable to determine preset encoding",O),i.value=!0,d[I]={error:"Unable to determine preset encoding",id:I},d[I];d[I]={...JSON.parse(O),id:I}}catch(j){d[I]={error:j,id:I},console.warn(`SavesManager: Failed to load info about save with id ${I}:
${j}
${O}`)}}return d[I]}je(n,I=>{I&&Object.keys(d).forEach(O=>delete d[O])});const p=P(()=>Q.saves.reduce((I,O)=>(I[O]=g(O),I),{}));function y(I){let O;switch(R.id===I?O=Tn(R):O=JSON.stringify(p.value[I]),te.exportEncoding){default:console.warn(`Unknown save encoding: ${te.exportEncoding}. Defaulting to lz`);case"lz":O=et.compressToUTF16(O);break;case"base64":O=btoa(unescape(encodeURIComponent(O)));break;case"plain":break}const j=document.createElement("textarea");j.value=O,document.body.appendChild(j),j.select(),j.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(j)}function w(I){R.id===I&&Oe();const O={...p.value[I],id:nn()};Oe(O),Q.saves.push(O.id)}function N(I){Q.saves=Q.saves.filter(O=>O!==I),localStorage.removeItem(I),d[I]=void 0}function _(I){p.value[R.id].time=R.time,Oe(),d[R.id]=void 0,vt(p.value[I]),d[I]=void 0}function E(I){if(o.value=I,tt(()=>{o.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=et.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const O=JSON.parse(I);O.id=nn(),Oe(O),Q.saves.push(O.id),_(O.id)}function q(I,O){const j=p.value[I];j!=null&&(j.name=O,R.id===I?(R.name=O,Oe()):(Oe(j),d[I]=void 0))}return(I,O)=>(b(),D(ct,{modelValue:n.value,"onUpdate:modelValue":O[4]||(O[4]=j=>n.value=j),ref_key:"modal",ref:r},{header:x(()=>[tu]),body:x(({shown:j})=>[j?(b(),D(l(Ci),{key:0,list:l(Q).saves,handle:".handle",itemKey:le=>le},{item:x(({element:le})=>[m(eu,{save:l(p)[le],onOpen:se=>_(le),onExport:se=>y(le),onEditName:se=>q(le,se),onDuplicate:se=>w(le),onDelete:se=>N(le)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):F("",!0)]),footer:x(()=>[v("div",nu,[m(Ln,{modelValue:s.value,"onUpdate:modelValue":O[0]||(O[0]=j=>s.value=j),title:"Import Save",placeholder:"Paste your save here!",class:re({importingFailed:i.value})},null,8,["modelValue","class"]),v("div",ru,[iu,v("div",su,[v("button",{class:"button",onClick:O[1]||(O[1]=j=>_(l(kt)().id))},"New Game"),Object.keys(l(c)).length>0?(b(),D(Bn,{key:0,options:l(c),modelValue:o.value,"onUpdate:modelValue":O[2]||(O[2]=j=>E(j)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):F("",!0)])]),v("div",ou,[au,v("button",{class:"button modal-default-button",onClick:O[3]||(O[3]=j=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var jr=K(lu,[["__scopeId","data-v-2a4275be"]]);const Ee=e=>(ze("data-v-47c54e31"),e=e(),Ge(),e),uu=["src","alt"],cu={key:1,class:"title"},du=Ee(()=>v("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),fu={class:"discord"},mu={class:"discord-links"},pu={key:0},gu=["href"],vu=Ee(()=>v("li",null,[v("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"Profectus & Friends")],-1)),hu=Ee(()=>v("li",null,[v("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),bu={href:"https://forums.moddingtree.com/",target:"_blank"},yu=Ee(()=>v("span",{class:"material-icons"},"forum",-1)),_u=Ee(()=>v("span",{class:"material-icons"},"info",-1)),Cu=Ee(()=>v("span",{class:"material-icons"},"library_books",-1)),wu=Ee(()=>v("span",{class:"material-icons"},"settings",-1)),ku=Ee(()=>v("span",{class:"material-icons"},"library_books",-1)),Nu=Ee(()=>v("span",{class:"material-icons"},"settings",-1)),Su=Ee(()=>v("span",{class:"material-icons"},"info",-1)),Iu={href:"https://forums.moddingtree.com/",target:"_blank"},$u=Ee(()=>v("span",{class:"material-icons"},"forum",-1)),Mu={class:"discord"},Tu={class:"discord-links"},Pu={key:0},Ou=["href"],Fu=Ee(()=>v("li",null,[v("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"Profectus & Friends")],-1)),Eu=Ee(()=>v("li",null,[v("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),qu=A({__name:"Nav",setup(e){const t=V(null),n=V(null),r=V(null),i=V(null),{useHeader:s,banner:o,title:a,discordName:c,discordLink:d,versionNumber:g}=te;function p(){window.open(d,"mywindow")}return(y,w)=>(b(),S(U,null,[l(s)?(b(),S("div",Ue({key:0,class:"nav"},y.$attrs),[l(o)?(b(),S("img",{key:0,src:l(o),class:"banner",alt:l(a)},null,8,uu)):(b(),S("div",cu,G(l(a)),1)),v("div",{onClick:w[0]||(w[0]=N=>{var _;return(_=i.value)==null?void 0:_.open()}),class:"version-container"},[m(me,{display:"Changelog",direction:l(J).Down,class:"version"},{default:x(()=>[v("span",null,"v"+G(l(g)),1)]),_:1},8,["direction"])]),du,v("div",fu,[v("span",{onClick:p,class:"material-icons"},"discord"),v("ul",mu,[l(d)?(b(),S("li",pu,[v("a",{href:l(d),target:"_blank"},G(l(c)),9,gu)])):F("",!0),vu,hu])]),v("div",null,[v("a",bu,[m(me,{display:"Forums",direction:l(J).Down,yoffset:"5px"},{default:x(()=>[yu]),_:1},8,["direction"])])]),v("div",{onClick:w[1]||(w[1]=N=>{var _;return(_=t.value)==null?void 0:_.open()})},[m(me,{display:"Info",direction:l(J).Down,class:"info"},{default:x(()=>[_u]),_:1},8,["direction"])]),v("div",{onClick:w[2]||(w[2]=N=>{var _;return(_=n.value)==null?void 0:_.open()})},[m(me,{display:"Saves",direction:l(J).Down,xoffset:"-20px"},{default:x(()=>[Cu]),_:1},8,["direction"])]),v("div",{onClick:w[3]||(w[3]=N=>{var _;return(_=r.value)==null?void 0:_.open()})},[m(me,{display:"Settings",direction:l(J).Down,xoffset:"-66px"},{default:x(()=>[wu]),_:1},8,["direction"])])],16)):(b(),S("div",Ue({key:1,class:"overlay-nav"},y.$attrs),[v("div",{onClick:w[4]||(w[4]=N=>{var _;return(_=i.value)==null?void 0:_.open()}),class:"version-container"},[m(me,{display:"Changelog",direction:l(J).Right,xoffset:"25%",class:"version"},{default:x(()=>[v("span",null,"v"+G(l(g)),1)]),_:1},8,["direction"])]),v("div",{onClick:w[5]||(w[5]=N=>{var _;return(_=n.value)==null?void 0:_.open()})},[m(me,{display:"Saves",direction:l(J).Right},{default:x(()=>[ku]),_:1},8,["direction"])]),v("div",{onClick:w[6]||(w[6]=N=>{var _;return(_=r.value)==null?void 0:_.open()})},[m(me,{display:"Settings",direction:l(J).Right},{default:x(()=>[Nu]),_:1},8,["direction"])]),v("div",{onClick:w[7]||(w[7]=N=>{var _;return(_=t.value)==null?void 0:_.open()})},[m(me,{display:"Info",direction:l(J).Right},{default:x(()=>[Su]),_:1},8,["direction"])]),v("div",null,[v("a",Iu,[m(me,{display:"Forums",direction:l(J).Right,xoffset:"7px"},{default:x(()=>[$u]),_:1},8,["direction"])])]),v("div",Mu,[v("span",{onClick:p,class:"material-icons"},"discord"),v("ul",Tu,[l(d)?(b(),S("li",Pu,[v("a",{href:l(d),target:"_blank"},G(l(c)),9,Ou)])):F("",!0),Fu,Eu])])],16)),m(gl,{ref_key:"info",ref:t,changelog:i.value},null,8,["changelog"]),m(jr,{ref_key:"savesManager",ref:n},null,512),m(Sl,{ref_key:"options",ref:r},null,512),m(Ja,{ref_key:"changelog",ref:i},null,512)],64))}});var Ur=K(qu,[["__scopeId","data-v-47c54e31"]]);const Vu={class:"inner-tab"},Du=A({__name:"Game",setup(e){const t=nt(R,"tabs"),n=P(()=>Object.keys(Ie)),r=te.useHeader;function i(s){const{display:o,minimized:a,name:c,color:d,minimizable:g,nodes:p,minimizedDisplay:y}=s;return{display:o,minimized:a,name:c,color:d,minimizable:g,nodes:p,minimizedDisplay:y}}return(s,o)=>(b(),S("div",{class:re(["tabs-container",{useHeader:l(r)}])},[(b(!0),S(U,null,We(l(t),(a,c)=>{var d,g;return b(),S("div",{key:c,class:re(["tab",l((d=l(Ie)[a])==null?void 0:d.classes)]),style:ee(l((g=l(Ie)[a])==null?void 0:g.style))},[c===0&&!l(r)?(b(),D(Ur,{key:0})):F("",!0),v("div",Vu,[l(n).includes(a)?(b(),D(Ha,Ue({key:0},i(l(Ie)[a]),{index:c,onSetMinimized:p=>l(Ie)[a].minimized.value=p}),null,16,["index","onSetMinimized"])):(b(),D(ie(a),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Ru=K(Du,[["__scopeId","data-v-dcd207b4"]]);const Au={},Bu=e=>(ze("data-v-89b4b00a"),e=e(),Ge(),e),Lu=Bu(()=>v("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"},[v("g",{id:"P"},[v("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"}),v("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"}),v("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"}),v("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"}),v("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"}),v("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"}),v("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 xu(e,t){return b(),D(Mn,{appear:""},{default:x(()=>[Lu]),_:1})}var ju=K(Au,[["render",xu],["__scopeId","data-v-89b4b00a"]]);const $e=A({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(b(),S("div",{style:ee({width:e.width,height:e.height})},null,4))}});function Ut(e,t="points",n=0,r=void 0){const i=ye(e)?e:_e(e);if(i.displayName=t,i.precision=n,i.small=r,!ye(e)){const s=i[Ke];s.displayName=t,s.precision=n,s.small=r}return i}function zr(e){const t=_e(e.value);return je(e,n=>{En.value||u.gt(n,t.value)&&(t.value=n)}),t}function Uu(e){const t=_e(e.value);return je(e,(n,r)=>{En.value||u.gt(n,r)&&(t.value=u.add(t.value,u.sub(n,r)))}),t}const zu=new u("10^^8"),Gu=new u("1e100");function Hu(e,t){const n=V(0),r=V(0),i=V(0);return he.on("update",o=>{if(r.value=0,u.lte(e.value,Gu)){i.value=e.value;return}let a=e.value,c=i.value;if(i.value=a,u.gt(a,c))if(u.gte(a,zu))a=u.slog(a,1e10),c=u.slog(c,1e10),n.value=a.sub(c).div(o),r.value=-1;else for(;u.div(a,c).log(10).div(o).gte("100")&&r.value<=5&&u.gt(c,0);)a=u.log10(a),c=u.log10(c),n.value=a.sub(c).div(o),r.value++}),P(()=>r.value===0?t?Ne(t.value,e.precision,e.small)+" "+e.displayName+"/s":"":Ne(n.value)+" OOM"+(r.value<0?"^OOM":"^"+r.value)+"s/sec")}function Ze(e,t){const n=t!=null?t:e.value;return u.eq(e.precision,0)?Te(e.small?n:u.floor(n)):Ne(n,e.precision,e.small)}const Wu={key:0},Ku={key:0,class:"mark star"},Yu=["src"],Ju=A({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(b(),S("div",Wu,[e.mark===!0?(b(),S("div",Ku)):(b(),S("img",{key:1,class:"mark",src:e.mark},null,8,Yu))])):F("",!0)}});var Pt=K(Ju,[["__scopeId","data-v-2207999f"]]);const Zu=A({__name:"Node",props:{id:null},setup(e){const n=ue(e),r=ln(Vn,()=>{}),i=ln(Dn,()=>{}),s=ke(null),o=P(()=>s.value&&s.value.parentElement);return je([o,n.id],([a,c],[d,g])=>{d&&i(l(g)),a&&r(c,a)}),hr(()=>i(l(n.id))),(a,c)=>(b(),S("div",{class:"node",ref_key:"node",ref:s},null,512))}});var dt=K(Zu,[["__scopeId","data-v-a48cb382"]]);function Ct(e){return ce(t=>{var r;const n=e.call(t,t);return n.partialDisplay=i=>m("span",{style:l(n.requirementMet)?"":"color: var(--danger)"},[Ze(n.resource,n.cost instanceof f?an(n.cost,i!=null?i:1,l(n.cumulativeCost),l(n.directSum)):l(n.cost))," ",n.resource.displayName]),n.display=i=>m("div",null,[l(n.requiresPay)?"Costs: ":"Requires: ",Ze(n.resource,n.cost instanceof f?an(n.cost,i!=null?i:1,l(n.cumulativeCost),l(n.directSum)):l(n.cost))," ",n.resource.displayName]),k(n,"visibility"),W(n,"visibility",Z.Visible),k(n,"cost"),k(n,"requiresPay"),W(n,"requiresPay",!0),k(n,"cumulativeCost"),W(n,"cumulativeCost",!0),k(n,"maxBulkAmount"),W(n,"maxBulkAmount",1),k(n,"directSum"),W(n,"pay",function(i){const s=n.cost instanceof f?an(n.cost,i!=null?i:1,l(n.cumulativeCost),l(n.directSum)):l(n.cost);n.resource.value=u.sub(n.resource.value,s).max(0)}),n.canMaximize=P(()=>{var a;if(!(n.cost instanceof f))return!1;const i=l(n.maxBulkAmount);if(u.lte(i,1))return!1;const s=l(n.cumulativeCost),o=(a=l(n.directSum))!=null?a:s?10:0;return u.lte(i,o)?!0:!(!n.cost.isInvertible()||s===!0&&!n.cost.isIntegrable())}),n.cost instanceof f?n.requirementMet=Ra(n.cost,n.resource,(r=n.cumulativeCost)!=null?r:!0,n.directSum,n.maxBulkAmount):n.requirementMet=P(()=>u.gte(n.resource.value,l(n.cost))?1:0),n})}function jn(e){return ce(()=>({requirementMet:P(()=>Se(e.visibility)),visibility:Z.None,requiresPay:!1}))}function In(e,t){return ce(()=>({requirementMet:Fe(e),partialDisplay:t==null?void 0:L(()=>xe(t)),display:t==null?void 0:L(()=>m(U,null,[M("Req: "),xe(t)])),visibility:t==null?Z.None:Z.Visible,requiresPay:!1}))}function vn(e){if(Je(e))return e.every(vn);const t=l(e.requirementMet);return typeof t=="boolean"?t:u.gt(t,0)}function Un(e){if(Je(e))return e.map(Un).reduce(u.min);const t=l(e.requirementMet);return typeof t=="boolean"?t?u.dInf:0:u.gt(t,1)&&l(e.canMaximize)!==!0?1:t}function Ht(e,t=1){var n,r;if(Je(e)&&(e=e.filter(i=>Se(i.visibility)),e.length===1&&(e=e[0])),Je(e)){e=e.filter(o=>"partialDisplay"in o);const i=e.filter(o=>l(o.requiresPay)),s=e.filter(o=>!l(o.requiresPay));return m(U,null,[i.length>0?m("div",null,[M("Costs:")," ",dr(i.map(o=>o.partialDisplay(t)),m(U,null,[M(", ")]))]):null,s.length>0?m("div",null,[M("Requires:")," ",dr(s.map(o=>o.partialDisplay(t)),m(U,null,[M(", ")]))]):null])}return(r=(n=e.display)==null?void 0:n.call(e))!=null?r:m(U,null,null)}function Gr(e,t=1){var n;Je(e)?e.filter(r=>l(r.requiresPay)).forEach(r=>{var i;return(i=r.pay)==null?void 0:i.call(r,t)}):l(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var Xu=A({props:{visibility:{type:$(Number,Boolean),required:!0},display:$(Object,String,Function),earned:{type:$(Boolean),required:!0},requirements:$(Object,Array),image:$(String),style:$(String,Object,Array),classes:$(Object),mark:$(Boolean,String),small:$(Boolean),id:{type:String,required:!0}},components:{Node:dt,MarkNode:Pt},setup(e){const{display:t,requirements:n,earned:r}=ue(e),i=ke("");return De(()=>{const s=ae(t);if(s==null){i.value="";return}if(Ae(s)){i.value=H(s);return}const o=H(s.requirement?s.requirement:L(()=>{var d;return Ht((d=ae(n))!=null?d:[])}),"h3"),a=H(s.effectDisplay||"","b"),c=ae(r)?H(s.optionsDisplay||"","span"):"";i.value=H(L(()=>m("span",null,[m(o,null,null),s.effectDisplay!=null?m("div",null,[m(a,null,null)]):null,s.optionsDisplay!=null?m("div",{class:"equal-spaced"},[m(c,null,null)]):null])))}),{comp:i,unref:l,Visibility:Z,isVisible:Se,isHidden:He}}});function Qu(e,t,n,r,i,s){var c;const o=ve("MarkNode"),a=ve("Node");return e.isVisible(e.visibility)?(b(),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:re({feature:!0,achievement:!0,locked:!e.unref(e.earned),done:e.unref(e.earned),small:e.unref(e.small),...e.unref(e.classes)})},[e.comp?(b(),D(ie(e.comp),{key:0})):F("",!0),m(o,{mark:e.unref(e.mark)},null,8,["mark"]),m(a,{id:e.id},null,8,["id"])],6)):F("",!0)}var ec=K(Xu,[["render",Qu],["__scopeId","data-v-5673325a"]]);he.on("setupVue",e=>e.use(ki));function zn(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 tc(){return zn("red","20px")}const nc=Cr(),rc=Symbol("Achievement");let wt=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function Vt(e,...t){const n=_e(!1,!1),r=t.reduce((i,s)=>{var o;return Object.assign(i,(o=s.getPersistentData)==null?void 0:o.call(s))},{});return ce(i=>{var c,d,g;const s=(c=e==null?void 0:e.call(i,i))!=null?c:{};s.id=Pe("achievement-"),s.type=rc,s[Ce]=ec;for(const p of t)(d=p.preConstruct)==null||d.call(p,s);s.earned=n,s.complete=function(){var y,w;if(n.value)return;n.value=!0;const p=s;if((y=p.onComplete)==null||y.call(p),p.display!=null&&l(p.showPopups)===!0){const N=l(p.display);let _;Ae(N)?_=H(N):N.requirement!=null?_=H(N.requirement):_=Ht((w=p.requirements)!=null?w:[]),nc.info(m("div",null,[m("h3",null,[M("Achievement earned!")]),m("div",null,[m(_,null,null)])]))}},Object.assign(s,r),k(s,"visibility"),W(s,"visibility",Z.Visible);const o=s.visibility;s.visibility=gi(()=>{const p=l(s.display);switch(Q.msDisplay){default:case wt.All:return l(o);case wt.Configurable:return l(s.earned)&&!(p!=null&&typeof p=="object"&&"optionsDisplay"in p)?Z.None:l(o);case wt.Incomplete:return l(s.earned)?Z.None:l(o);case wt.None:return Z.None}}),k(s,"display"),k(s,"mark"),k(s,"small"),k(s,"image"),k(s,"style"),k(s,"classes"),k(s,"showPopups"),W(s,"showPopups",!0);for(const p of t)(g=p.postConstruct)==null||g.call(p,s);const a=t.reduce((p,y)=>{var w;return Object.assign(p,(w=y.getGatheredProps)==null?void 0:w.call(y,s))},{});if(s[we]=function(){const{visibility:p,display:y,requirements:w,earned:N,image:_,style:E,classes:q,mark:I,small:O,id:j}=this;return{visibility:p,display:y,requirements:w,earned:N,image:_,style:l(E),classes:q,mark:I,small:O,id:j,...a}},s.requirements){const p=s,y=[jn(p),In(()=>!p.earned.value),...Je(s.requirements)?s.requirements:[s.requirements]];De(()=>{Q.active===R.id&&vn(y)&&p.complete()})}return s})}he.on("loadSettings",e=>{W(e,"msDisplay",wt.All)});const ic=Object.values(wt).map(e=>({label:On(e),value:e}));Er(L(()=>m(Bn,{title:L(()=>m("span",{class:"option-title"},[M("Show achievements"),m("desc",null,[M("Select which achievements to display based on criterias.")])])),options:ic,"onUpdate:modelValue":e=>Q.msDisplay=e,modelValue:Q.msDisplay},null)));const sc=A({props:{visibility:{type:$(Number,Boolean),required:!0},onClick:Function,onHold:Function,display:{type:$(Object,String,Function),required:!0},title:$(Object,String,Function),style:$(String,Object,Array),canClick:{type:$(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:dt},setup(e){const{onClick:t,onHold:n,title:r,display:i}=ue(e),{start:s,stop:o}=qn(t,n),a=ut(r),c=It(i);return{start:s,stop:o,titleComponent:a,component:c,Visibility:Z,unref:l,isVisible:Se,isHidden:He}}}),oc={key:0};function ac(e,t,n,r,i,s){var a;const o=ve("Node");return e.isVisible(e.visibility)?(b(),S("button",{key:0,class:re({feature:!0,tile:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick)}),style:ee([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(a=e.unref(e.style))!=null?a:{}]),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?(b(),S("div",oc,[(b(),D(ie(e.titleComponent)))])):F("",!0),(b(),D(ie(e.component),{style:{"white-space":"pre-line"}})),m(o,{id:e.id},null,8,["id"])],38)):F("",!0)}var lc=K(sc,[["render",ac],["__scopeId","data-v-59906ec6"]]);const uc=A({props:{visibility:{type:$(Number,Boolean),required:!0},rows:{type:$(Number),required:!0},cols:{type:$(Number),required:!0},cells:{type:$(Object),required:!0}},components:{GridCell:lc},setup(){const e=P(()=>rt[Q.theme].mergeAdjacent);function t(n){const{visibility:r,onClick:i,onHold:s,display:o,title:a,style:c,canClick:d,id:g}=n;return{visibility:r,onClick:i,onHold:s,display:o,title:a,style:c,canClick:d,id:g}}return{unref:l,gatherCellProps:t,Visibility:Z,mergeAdjacent:e,isVisible:Se,isHidden:He}}});function cc(e,t,n,r,i,s){const o=ve("GridCell");return e.isVisible(e.visibility)?(b(),S("div",{key:0,style:ee({visibility:e.isHidden(e.visibility)?"hidden":void 0}),class:"table-grid"},[(b(!0),S(U,null,We(e.unref(e.rows),a=>(b(),S("div",{class:re(["row-grid",{mergeAdjacent:e.mergeAdjacent}]),key:a},[(b(!0),S(U,null,We(e.unref(e.cols),c=>(b(),D(o,Ue({key:c},e.gatherCellProps(e.unref(e.cells)[a*100+c])),null,16))),128))],2))),128))],4)):F("",!0)}var dc=K(uc,[["render",cc]]);function fc(e){return new Proxy({},mc(e))}function mc(e){const t=P(()=>{const n=[];for(let r=1;r<=l(e.rows);r++)for(let i=1;i<=l(e.cols);i++)n.push((r*100+i).toString());return n});return{get(n,r){if(r==="isProxy")return!0;if(typeof r=="symbol")return e[r];if(!!t.value.includes(r.toString()))return n[r]==null&&(n[r]=new Proxy(e,pc(r.toString()))),n[r]},set(n,r,i){return console.warn("Cannot set grid cells",n,r,i),!1},ownKeys(){return t.value},has(n,r){return t.value.includes(r.toString())},getOwnPropertyDescriptor(n,r){if(t.value.includes(r.toString()))return{configurable:!0,enumerable:!0,writable:!1}}}}function pc(e){const t=["id","visibility","canClick","startState","state","style","classes","title","display","onClick","onHold"],n={};return{get(r,i,s){if(i==="isProxy")return!0;let o=r[i];return gt(o)?()=>o.call(s,e,r.getState(e)):o!=null||typeof i=="symbol"?o:(i=i.slice(0,1).toUpperCase()+i.slice(1),i==="startState"?o.call(s,e):(o=r[`get${i}`],gt(o)?(i in n||(n[i]=P(()=>o.call(s,e,r.getState(e)))),n[i].value):o!=null?l(o):(o=r[`on${i}`],gt(o)?()=>o.call(s,e,r.getState(e)):o!=null?o:r[i])))},set(r,i,s,o){return i=`set${i.slice(0,1).toUpperCase()+i.slice(1)}`,i in r&&gt(r[i])&&r[i].length<3?(r[i].call(o,e,s),!0):(console.warn(`No setter for "${i}".`,r),!1)},ownKeys(){return t},has(r,i){return t.includes(i.toString())},getOwnPropertyDescriptor(r,i){if(t.includes(i.toString()))return{configurable:!0,enumerable:!0,writable:!1}}}}function gc(e){const t=_e({},!1);return ce(n=>{const r=e.call(n,n);if(r.id=Pe("grid-"),r[Ce]=dc,r.cellState=t,r.getID=function(i){return r.id+"-"+i},r.getState=function(i){return this.cellState.value[i]!=null?t.value[i]:this.cells[i].startState},r.setState=function(i,s){t.value[i]=s},r.cells=fc(r),k(r,"visibility"),W(r,"visibility",Z.Visible),k(r,"rows"),k(r,"cols"),k(r,"getVisibility"),W(r,"getVisibility",Z.Visible),k(r,"getCanClick"),W(r,"getCanClick",!0),k(r,"getStartState"),k(r,"getStyle"),k(r,"getClasses"),k(r,"getTitle"),k(r,"getDisplay"),r.onClick){const i=r.onClick.bind(r);r.onClick=function(s,o,a){l(r.cells[s].canClick)&&i(s,o,a)}}if(r.onHold){const i=r.onHold.bind(r);r.onHold=function(s,o){l(r.cells[s].canClick)&&i(s,o)}}return r[we]=function(){const{visibility:i,rows:s,cols:o,cells:a,id:c}=this;return{visibility:i,rows:s,cols:o,cells:a,id:c}},r})}function St(e,t){return k(t,"display"),k(t,"classes"),k(t,"style"),k(t,"direction"),W(t,"direction",J.Up),k(t,"xoffset"),k(t,"yoffset"),t.pinnable&&(t.pinned=_e(!1,!1)),tt(()=>{const n=e[Ce];e[Ce]=me;const r=e[we].bind(e);e[we]=function(){const{display:s,classes:o,style:a,direction:c,xoffset:d,yoffset:g,pinned:p}=this;return{element:{[Ce]:n,[we]:r},display:s,classes:o,style:l(a),direction:c,xoffset:d,yoffset:g,pinned:p}}.bind(t)}),t}const vc=["x1","y1","x2","y2"],hc=A({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const t=e,n=ue(t),r=P(()=>{const o=n.startNode.value.rect,a=n.boundingRect.value,c=a?{x:o.x+o.width/2-a.x,y:o.y+o.height/2-a.y}:{x:0,y:0};return n.link.value.offsetStart&&(c.x+=n.link.value.offsetStart.x,c.y+=n.link.value.offsetStart.y),c}),i=P(()=>{const o=n.endNode.value.rect,a=n.boundingRect.value,c=a?{x:o.x+o.width/2-a.x,y:o.y+o.height/2-a.y}:{x:0,y:0};return n.link.value.offsetEnd&&(c.x+=n.link.value.offsetEnd.x,c.y+=n.link.value.offsetEnd.y),c}),s=P(()=>eo(t.link));return(o,a)=>(b(),S("line",Ue({"stroke-width":"15px",stroke:"white"},l(s),{x1:l(r).x,y1:l(r).y,x2:l(i).x,y2:l(i).y}),null,16,vc))}});const bc=A({__name:"Links",props:{links:null},setup(e){var c;const n=nt(e,"links"),r=V(null),i=ln(Rn,V({})),s=ln(An,V(void 0)),o=V((c=r.value)==null?void 0:c.getBoundingClientRect());je(s,()=>{var d;return o.value=(d=r.value)==null?void 0:d.getBoundingClientRect()}),Mt(()=>{var d;return o.value=(d=r.value)==null?void 0:d.getBoundingClientRect()});const a=P(()=>{var g,p;const d=i.value;return(p=(g=n.value)==null?void 0:g.filter(y=>{var w,N;return((w=d[y.startNode.id])==null?void 0:w.rect)&&((N=d[y.startNode.id])==null?void 0:N.rect)}))!=null?p:[]});return(d,g)=>(b(),S(U,null,[l(a)?(b(),S("svg",vi(Ue({key:0},d.$attrs)),[(b(!0),S(U,null,We(l(a),(p,y)=>(b(),D(hc,{key:y,link:p,boundingRect:o.value,startNode:l(i)[p.startNode.id],endNode:l(i)[p.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):F("",!0),v("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var Hr=K(bc,[["__scopeId","data-v-c139d80e"]]),yc=A({props:{nodes:{type:$(Array),required:!0},leftSideNodes:$(Array),rightSideNodes:$(Array),branches:$(Array)},components:{Links:Hr},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:r}=ue(e),i=ke();De(()=>{const a=ae(t);i.value=H(L(()=>m(U,null,[a.map(c=>m("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(xe)]))])))});const s=ke();De(()=>{const a=ae(n);s.value=a?H(L(()=>m("span",{class:"left-side-nodes small"},[a.map(xe)]))):""});const o=ke();return De(()=>{const a=ae(r);o.value=a?H(L(()=>m("span",{class:"side-nodes small"},[a.map(xe)]))):""}),{unref:l,nodesComp:i,leftNodesComp:s,rightNodesComp:o}}});function _c(e,t,n,r,i,s){const o=ve("Links");return b(),S(U,null,[(b(),D(ie(e.nodesComp))),e.leftNodesComp?(b(),D(ie(e.leftNodesComp),{key:0})):F("",!0),e.rightNodesComp?(b(),D(ie(e.rightNodesComp),{key:1})):F("",!0),e.branches?(b(),D(o,{key:2,links:e.unref(e.branches)},null,8,["links"])):F("",!0)],64)}var Cc=K(yc,[["render",_c],["__scopeId","data-v-39ca96d0"]]);const wc=A({props:{display:$(Object,String,Function),visibility:{type:$(Number,Boolean),required:!0},style:$(String,Object,Array),classes:$(Object),onClick:Function,onHold:Function,color:$(String),glowColor:$(String),canClick:{type:$(Boolean),required:!0},mark:$(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Pt,Node:dt},setup(e){const{onClick:t,onHold:n,display:r}=ue(e),i=ut(r),{start:s,stop:o}=qn(t,n);return{start:s,stop:o,comp:i,unref:l,Visibility:Z,isCoercableComponent:Ae,isVisible:Se,isHidden:He}}});function kc(e,t,n,r,i,s){var c;const o=ve("MarkNode"),a=ve("Node");return e.isVisible(e.visibility)?(b(),S("div",{key:0,style:ee({visibility:e.isHidden(e.visibility)?"hidden":void 0}),class:re({treeNode:!0,can:e.unref(e.canClick),...e.unref(e.classes)}),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d))},[v("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:[]])},[(b(),D(ie(e.unref(e.comp))))],4),m(o,{mark:e.unref(e.mark)},null,8,["mark"]),m(a,{id:e.id},null,8,["id"])],38)):F("",!0)}var Nc=K(wc,[["render",kc],["__scopeId","data-v-727230a6"]]);const Sc=Symbol("TreeNode"),Ic=Symbol("Tree");function Dt(e,...t){const n=t.reduce((r,i)=>{var s;return Object.assign(r,(s=i.getPersistentData)==null?void 0:s.call(i))},{});return ce(r=>{var o,a,c;const i=(o=e==null?void 0:e.call(r,r))!=null?o:{};i.id=Pe("treeNode-"),i.type=Sc,i[Ce]=Nc;for(const d of t)(a=d.preConstruct)==null||a.call(d,i);Object.assign(n),k(i,"visibility"),W(i,"visibility",Z.Visible),k(i,"canClick"),W(i,"canClick",!0),k(i,"color"),k(i,"display"),k(i,"glowColor"),k(i,"classes"),k(i,"style"),k(i,"mark");for(const d of t)(c=d.postConstruct)==null||c.call(d,i);if(i.onClick){const d=i.onClick.bind(i);i.onClick=function(g){l(i.canClick)!==!1&&d(g)}}if(i.onHold){const d=i.onHold.bind(i);i.onHold=function(){l(i.canClick)!==!1&&d()}}const s=t.reduce((d,g)=>{var p;return Object.assign(d,(p=g.getGatheredProps)==null?void 0:p.call(g,i))},{});return i[we]=function(){const{display:d,visibility:g,style:p,classes:y,onClick:w,onHold:N,color:_,glowColor:E,canClick:q,mark:I,id:O}=this;return{display:d,visibility:g,style:p,classes:y,onClick:w,onHold:N,color:_,glowColor:E,canClick:q,mark:I,id:O,...s}},i})}function Wr(e){return ce(t=>{const n=e.call(t,t);return n.id=Pe("tree-"),n.type=Ic,n[Ce]=Cc,n.isResetting=V(!1),n.resettingNode=ke(null),n.reset=function(r){var s,o;const i=n;i.isResetting.value=!0,i.resettingNode.value=r,(s=i.resetPropagation)==null||s.call(i,i,r),(o=i.onReset)==null||o.call(i,r),i.isResetting.value=!1,i.resettingNode.value=null},n.links=P(()=>{var i;return(i=l(n.branches))!=null?i:[]}),k(n,"visibility"),W(n,"visibility",Z.Visible),k(n,"nodes"),k(n,"leftSideNodes"),k(n,"rightSideNodes"),k(n,"branches"),n[we]=function(){const{nodes:r,leftSideNodes:i,rightSideNodes:s,branches:o}=this;return{nodes:r,leftSideNodes:i,rightSideNodes:s,branches:o}},n})}const $c=function(e,t){var s;const n=l(e.branches);if(n==null)return;const r=[];let i=[t];for(;i.length!=0;){const o=[];for(const a of i)for(const c of n.filter(d=>d.startNode===a))[...r,...i].includes(c.endNode)||(o.push(c.endNode),(s=c.endNode.reset)==null||s.reset());r.push(...i),i=o}};function Kr(e,t=null,n=0){const r=Fe(n);return P(()=>t==null||u.gte(e.value,l(r))?Ze(e)+" "+e.displayName:`Reach ${u.eq(t.precision,0)?Te(l(r)):Ne(l(r),t.precision)} ${t.displayName} to unlock (You have ${u.eq(t.precision,0)?Te(t.value):Ne(t.value,t.precision)})`)}const mr="a",$n=Gt(mr,()=>{const e="yellow",t="Achievements",n=Ut(0,"achievement power"),r=Dt(()=>({display:"A",color:e,tooltip:{display:"Achievements",right:!0},onClick(){ne.showAchievements()}})),i=Vt(()=>({image:"https://unsoftcapped2.github.io/The-Modding-Tree-2/discord.png",display:"Get me!",requirements:[],small:!0}));St(i,{display(){return i.earned.value?"You did it!":"How did this happen?"},direction:J.Down});const s=Vt(()=>({display:"Impossible!",style:{color:"#04e050"}}));St(s,{display(){return s.earned.value?"HOW????":"Mwahahaha!"},direction:J.Down});const o=Vt(()=>({display:"EIEIO",requirements:[],onComplete(){console.log("Bork bork bork!")},small:!0}));St(o,{display:`Get a farm point.
Reward: The dinosaur is now your friend (you can max Farm Points).`,direction:J.Down});const a=[i,s,o],c=gc(()=>({rows:2,cols:2,getStartState(g){return g},getStyle(g,p){return{backgroundColor:`#${Number(p)*1234%999999}`}},getTitle(g){let p="";return g==="101"?p="top":g==="102"?p="bottom":g==="201"?p="left":g==="202"&&(p="right"),L(()=>m(me,Ue({display:JSON.stringify(this.cells[g].style)},{[p]:!0}),{default:()=>[m("h3",null,[M("Gridable #"),g])]}))},getDisplay(g,p){return String(p)},getCanClick(){return u.eq(ne.points.value,10)},onClick(g,p){this.cells[g].state=Number(p)+1}})),d=L(()=>m(U,null,[Ve(...a),Ve(c)]));return{id:mr,color:e,name:t,points:n,achievements:a,grid:c,treeNode:r,display:d}});const Mc={class:"field"},Tc={key:0,class:"field-title"},Pc=["min","max"],Oc=A({__name:"Slider",props:{title:null,modelValue:null,min:null,max:null},emits:["update:modelValue"],setup(e,{emit:t}){const r=ue(e),i=P({get(){var s;return String((s=l(r.modelValue))!=null?s:0)},set(s){t("update:modelValue",Number(s))}});return(s,o)=>(b(),S("div",Mc,[e.title?(b(),S("span",Tc,G(e.title),1)):F("",!0),m(me,{display:`${l(i)}`,class:re({fullWidth:!e.title}),direction:l(J).Down},{default:x(()=>[mn(v("input",{type:"range","onUpdate:modelValue":o[0]||(o[0]=a=>ye(i)?i.value=a:null),min:e.min,max:e.max},null,8,Pc),[[yr,l(i)]])]),_:1},8,["display","class","direction"])]))}});var Fc=K(Oc,[["__scopeId","data-v-267283ff"]]);const Ec=A({__name:"Sticky",setup(e){const t=V("0"),n=new ResizeObserver(i),r=ke(null);function i(){let s=r.value;if(s==null)return;let o=0;for(;s.previousSibling;){const a=s.previousSibling;a.dataset&&"vSticky"in a.dataset&&(o+=a.offsetHeight),s=a}t.value=o+"px"}return tt(i),document.fonts.ready.then(i),Mt(()=>{var o;const s=(o=r.value)==null?void 0:o.parentElement;s&&n.observe(s)}),(s,o)=>(b(),S("div",{class:"sticky",style:ee({top:t.value}),ref_key:"element",ref:r,"data-v-sticky":""},[Ye(s.$slots,"default",{},void 0,!0)],4))}});var dn=K(Ec,[["__scopeId","data-v-cccac690"]]);const qc=A({__name:"VerticalRule",props:{height:null},setup(e){return(t,n)=>(b(),S("div",{class:"vr",style:ee({height:e.height})},null,4))}});var Vc=K(qc,[["__scopeId","data-v-5e0a978a"]]);var Dc=A({props:{display:{type:$(Object,String,Function),required:!0},visibility:{type:$(Number,Boolean),required:!0},style:$(Object,String,Array),classes:$(Object),onClick:Function,onHold:Function,canClick:{type:$(Boolean),required:!0},small:Boolean,mark:$(Boolean,String),id:{type:String,required:!0}},components:{Node:dt,MarkNode:Pt},setup(e){const{display:t,onClick:n,onHold:r}=ue(e),i=ke("");De(()=>{var g;const a=ae(t);if(a==null){i.value="";return}if(Ae(a)){i.value=H(a);return}const c=H((g=a.title)!=null?g:"","h3"),d=H(a.description,"div");i.value=H(L(()=>m("span",null,[a.title!=null?m("div",null,[m(c,null,null)]):null,m(d,null,null)])))});const{start:s,stop:o}=qn(n,r);return{start:s,stop:o,comp:i,Visibility:Z,isVisible:Se,isHidden:He,unref:l}}});function Rc(e,t,n,r,i,s){var c;const o=ve("MarkNode"),a=ve("Node");return e.isVisible(e.visibility)?(b(),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]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:re({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)?(b(),D(ie(e.unref(e.comp)),{key:0})):F("",!0),m(o,{mark:e.unref(e.mark)},null,8,["mark"]),m(a,{id:e.id},null,8,["id"])],38)):F("",!0)}var Yr=K(Dc,[["render",Rc],["__scopeId","data-v-211328c0"]]);const Ac=Symbol("Clickable");function zt(e,...t){const n=t.reduce((r,i)=>{var s;return Object.assign(r,(s=i.getPersistentData)==null?void 0:s.call(i))},{});return ce(r=>{var o,a,c;const i=(o=e==null?void 0:e.call(r,r))!=null?o:{};i.id=Pe("clickable-"),i.type=Ac,i[Ce]=Yr;for(const d of t)(a=d.preConstruct)==null||a.call(d,i);if(Object.assign(i,n),k(i,"visibility"),W(i,"visibility",Z.Visible),k(i,"canClick"),W(i,"canClick",!0),k(i,"classes"),k(i,"style"),k(i,"mark"),k(i,"display"),i.onClick){const d=i.onClick.bind(i);i.onClick=function(g){l(i.canClick)!==!1&&d(g)}}if(i.onHold){const d=i.onHold.bind(i);i.onHold=function(){l(i.canClick)!==!1&&d()}}for(const d of t)(c=d.postConstruct)==null||c.call(d,i);const s=t.reduce((d,g)=>{var p;return Object.assign(d,(p=g.getGatheredProps)==null?void 0:p.call(g,i))},{});return i[we]=function(){const{display:d,visibility:g,style:p,classes:y,onClick:w,onHold:N,canClick:_,small:E,mark:q,id:I}=this;return{display:d,visibility:g,style:l(p),classes:y,onClick:w,onHold:N,canClick:_,small:E,mark:q,id:I,...s}},i})}function Jr(e){return zt(t=>{const n=e.call(t,t);k(n,"showNextAt"),W(n,"showNextAt",!0),W(n,"minimumGain",1),n.resetDescription==null?n.resetDescription=P(()=>u.lt(n.conversion.gainResource.value,1e3)?"Reset for ":""):k(n,"resetDescription"),n.display==null&&(n.display=L(()=>m("span",null,[l(n.resetDescription),m("b",null,[Ze(n.conversion.gainResource,u.max(l(n.conversion.actualGain),l(n.minimumGain)))])," ",n.conversion.gainResource.displayName,l(n.showNextAt)!=null?m("div",null,[m("br",null,null),l(n.conversion.buyMax)?"Next:":"Req:"," ",Ze(n.conversion.baseResource,!l(n.conversion.buyMax)&&u.gte(l(n.conversion.actualGain),1)?l(n.conversion.currentAt):l(n.conversion.nextAt))," ",n.conversion.baseResource.displayName]):null]))),n.canClick==null&&(n.canClick=P(()=>u.gte(l(n.conversion.actualGain),l(n.minimumGain))));const r=n.onClick;return n.onClick=function(i){l(n.canClick)!==!1&&(n.conversion.convert(),n.tree.reset(n.treeNode),n.resetTime&&(n.resetTime.value=n.resetTime[lt]),r==null||r(i))},n})}function Zr(e){return Dt(t=>{const n=e.call(t,t);return W(n,"display",On(n.layerID)),k(n,"append"),{...n,onClick:l(n.append)?function(){if(R.tabs.includes(n.layerID)){const r=R.tabs.lastIndexOf(n.layerID);R.tabs.splice(r,1)}else R.tabs.push(n.layerID)}:function(){R.tabs.splice(1,1,n.layerID)}}})}const Bc=A({props:{progress:{type:$(String,Object,Number),required:!0},width:{type:$(Number),required:!0},height:{type:$(Number),required:!0},direction:{type:$(String),required:!0},display:$(Object,String,Function),visibility:{type:$(Number,Boolean),required:!0},style:$(Object,String,Array),classes:$(Object),borderStyle:$(Object,String,Array),textStyle:$(Object,String,Array),baseStyle:$(Object,String,Array),fillStyle:$(Object,String,Array),mark:$(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Pt,Node:dt},setup(e){const{progress:t,width:n,height:r,direction:i,display:s}=ue(e),o=P(()=>{let d=t.value instanceof u?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),a=P(()=>{const d={width:ae(n)+.5+"px",height:ae(r)+.5+"px"};switch(l(i)){case J.Up:d.clipPath=`inset(${o.value}% 0% 0% 0%)`,d.width=ae(n)+1+"px";break;case J.Down:d.clipPath=`inset(0% 0% ${o.value}% 0%)`,d.width=ae(n)+1+"px";break;case J.Right:d.clipPath=`inset(0% ${o.value}% 0% 0%)`;break;case J.Left:d.clipPath=`inset(0% 0% 0% ${o.value}%)`;break;case J.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),c=ut(s);return{normalizedProgress:o,barStyle:a,component:c,unref:l,Visibility:Z,isVisible:Se,isHidden:He}}});function Lc(e,t,n,r,i,s){var c,d,g,p,y,w,N;const o=ve("MarkNode"),a=ve("Node");return e.isVisible(e.visibility)?(b(),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:re({bar:!0,...e.unref(e.classes)})},[v("div",{class:"overlayTextContainer border",style:ee([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(b(),S("span",{key:0,class:"overlayText",style:ee(e.unref(e.textStyle))},[(b(),D(ie(e.component)))],4)):F("",!0)],4),v("div",{class:"border",style:ee([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(g=e.unref(e.style))!=null?g:{},(p=e.unref(e.baseStyle))!=null?p:{},(y=e.unref(e.borderStyle))!=null?y:{}])},[v("div",{class:"fill",style:ee([e.barStyle,(w=e.unref(e.style))!=null?w:{},(N=e.unref(e.fillStyle))!=null?N:{}])},null,4)],4),m(o,{mark:e.unref(e.mark)},null,8,["mark"]),m(a,{id:e.id},null,8,["id"])],6)):F("",!0)}var xc=K(Bc,[["render",Lc],["__scopeId","data-v-10cb85f8"]]);const jc=Symbol("Bar");function wn(e,...t){const n=t.reduce((r,i)=>{var s;return Object.assign(r,(s=i.getPersistentData)==null?void 0:s.call(i))},{});return ce(r=>{var o,a;const i=e.call(r,r);i.id=Pe("bar-"),i.type=jc,i[Ce]=xc;for(const c of t)(o=c.preConstruct)==null||o.call(c,i);Object.assign(i,n),k(i,"visibility"),W(i,"visibility",Z.Visible),k(i,"width"),k(i,"height"),k(i,"direction"),k(i,"style"),k(i,"classes"),k(i,"borderStyle"),k(i,"baseStyle"),k(i,"textStyle"),k(i,"fillStyle"),k(i,"progress"),k(i,"display"),k(i,"mark");for(const c of t)(a=c.postConstruct)==null||a.call(c,i);const s=t.reduce((c,d)=>{var g;return Object.assign(c,(g=d.getGatheredProps)==null?void 0:g.call(d,i))},{});return i[we]=function(){const{progress:c,width:d,height:g,direction:p,display:y,visibility:w,style:N,classes:_,borderStyle:E,textStyle:q,baseStyle:I,fillStyle:O,mark:j,id:le}=this;return{progress:c,width:d,height:g,direction:p,display:y,visibility:w,style:l(N),classes:_,borderStyle:E,textStyle:q,baseStyle:I,fillStyle:O,mark:j,id:le,...s}},i})}var Uc=A({props:{active:{type:$(Boolean),required:!0},maxed:{type:$(Boolean),required:!0},canComplete:{type:$(Boolean),required:!0},display:$(String,Object,Function),requirements:$(Object,Array),visibility:{type:$(Number,Boolean),required:!0},style:$(String,Object,Array),classes:$(Object),completed:{type:$(Boolean),required:!0},canStart:{type:$(Boolean),required:!0},mark:$(Boolean,String),id:{type:String,required:!0},toggle:{type:Function,required:!0}},components:{MarkNode:Pt,Node:dt},setup(e){const{active:t,maxed:n,canComplete:r,display:i,requirements:s}=ue(e),o=P(()=>t.value?r.value?"Finish":"Exit Early":n.value?"Completed":"Start"),a=ke(""),c=P(()=>{const d=ae(t),g=ae(r);return d?g?tc():zn():{}});return De(()=>{const d=ae(i);if(d==null){a.value="";return}if(Ae(d)){a.value=H(d);return}const g=H(d.title||"","h3"),p=H(d.description,"div"),y=H(d.goal!=null?d.goal:L(()=>{var _;return Ht((_=ae(s))!=null?_:[])}),"h3"),w=H(d.reward||""),N=H(d.effectDisplay||"");a.value=H(L(()=>m("span",null,[d.title!=null?m("div",null,[m(g,null,null)]):null,m(p,null,null),m("div",null,[m("br",null,null),M("Goal: "),m(y,null,null)]),d.reward!=null?m("div",null,[m("br",null,null),M("Reward: "),m(w,null,null)]):null,d.effectDisplay!=null?m("div",null,[M("Currently: "),m(N,null,null)]):null])))}),{buttonText:o,notifyStyle:c,comp:a,Visibility:Z,isVisible:Se,isHidden:He,unref:l}}});const zc=["disabled"];function Gc(e,t,n,r,i,s){var c;const o=ve("MarkNode"),a=ve("Node");return e.isVisible(e.visibility)?(b(),S("div",{key:0,style:ee([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.notifyStyle,(c=e.unref(e.style))!=null?c:{}]),class:re({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)})},[v("button",{class:"toggleChallenge",onClick:t[0]||(t[0]=(...d)=>e.toggle&&e.toggle(...d)),disabled:!e.unref(e.canStart)||e.unref(e.maxed)},G(e.buttonText),9,zc),e.unref(e.comp)?(b(),D(ie(e.unref(e.comp)),{key:0})):F("",!0),m(o,{mark:e.unref(e.mark)},null,8,["mark"]),m(a,{id:e.id},null,8,["id"])],6)):F("",!0)}var Hc=K(Uc,[["render",Gc],["__scopeId","data-v-2b675972"]]);const Wc=Symbol("Challenge");function Kc(e,...t){const n=_e(0),r=_e(!1,!1),i=t.reduce((s,o)=>{var a;return Object.assign(s,(a=o.getPersistentData)==null?void 0:a.call(o))},{});return ce(s=>{var d,g;const o=e.call(s,s);o.id=Pe("challenge-"),o.type=Wc,o[Ce]=Hc;for(const p of t)(d=p.preConstruct)==null||d.call(p,o);o.completions=n,o.active=r,Object.assign(o,i),o.completed=P(()=>u.gt(o.completions.value,0)),o.maxed=P(()=>u.gte(o.completions.value,l(o.completionLimit))),o.toggle=function(){var y,w,N,_,E;const p=o;if(p.active.value){if(u.gt(l(p.canComplete),0)&&!p.maxed.value){const q=l(p.canComplete);p.completions.value=u.min(u.add(p.completions.value,q),l(p.completionLimit)),(y=p.onComplete)==null||y.call(p)}p.active.value=!1,(w=p.onExit)==null||w.call(p),(N=p.reset)==null||N.reset()}else l(p.canStart)&&Se(p.visibility)&&!p.maxed.value&&((_=p.reset)==null||_.reset(),p.active.value=!0,(E=p.onEnter)==null||E.call(p))},o.canComplete=P(()=>Un(o.requirements)),o.complete=function(p){var N,_,E;const y=o,w=l(y.canComplete);y.active.value&&u.gt(w,0)&&!y.maxed.value&&(y.completions.value=u.min(u.add(y.completions.value,w),l(y.completionLimit)),(N=y.onComplete)==null||N.call(y),p!==!0&&(y.active.value=!1,(_=y.onExit)==null||_.call(y),(E=y.reset)==null||E.reset()))},k(o,"visibility"),W(o,"visibility",Z.Visible);const a=o.visibility;o.visibility=P(()=>Q.hideChallenges===!0&&l(o.maxed)?Z.None:l(a)),o.mark==null&&(o.mark=P(()=>u.gt(l(o.completionLimit),1)&&!!l(o.maxed))),k(o,"canStart"),W(o,"canStart",!0),k(o,"completionLimit"),W(o,"completionLimit",1),k(o,"mark"),k(o,"classes"),k(o,"style"),k(o,"display"),o.reset!=null&&he.on("reset",p=>{p===o.reset&&o.active.value&&o.toggle()});for(const p of t)(g=p.postConstruct)==null||g.call(p,o);const c=t.reduce((p,y)=>{var w;return Object.assign(p,(w=y.getGatheredProps)==null?void 0:w.call(y,o))},{});return o[we]=function(){const{active:p,maxed:y,canComplete:w,display:N,visibility:_,style:E,classes:q,completed:I,canStart:O,mark:j,id:le,toggle:se,requirements:B}=this;return{active:p,maxed:y,canComplete:w,display:N,visibility:_,style:l(E),classes:q,completed:I,canStart:O,mark:j,id:le,toggle:se,requirements:B,...c}},o})}he.on("loadSettings",e=>{W(e,"hideChallenges",!1)});Er(L(()=>m(Me,{title:L(()=>m("span",{class:"option-title"},[M("Hide maxed challenges"),m("desc",null,[M("Hide challenges that have been fully completed.")])])),"onUpdate:modelValue":e=>Q.hideChallenges=e,modelValue:Q.hideChallenges},null)));function Xr(e,...t){return ce(n=>{var i,s;const r=e.call(n,n);for(const o of t)(i=o.preConstruct)==null||i.call(o,r);r.formula=r.formula(f.variable(r.baseResource)),r.currentGain==null&&(r.currentGain=P(()=>{let o=u.floor(r.formula.evaluate(r.baseResource.value)).max(0);return l(r.buyMax)===!1&&(o=o.min(1)),o})),r.actualGain==null&&(r.actualGain=r.currentGain),r.currentAt==null&&(r.currentAt=P(()=>r.formula.invert(u.floor(l(r.currentGain))))),r.nextAt==null&&(r.nextAt=P(()=>r.formula.invert(u.floor(l(r.currentGain)).add(1)))),r.convert==null&&(r.convert=function(){var a;const o=l(r.currentGain);r.gainResource.value=u.add(r.gainResource.value,o),r.spend(o),(a=r.onConvert)==null||a.call(r,o)}),r.spend==null&&(r.spend=function(){r.baseResource.value=0}),k(r,"currentGain"),k(r,"actualGain"),k(r,"currentAt"),k(r,"nextAt"),k(r,"buyMax"),W(r,"buyMax",!0);for(const o of t)(s=o.postConstruct)==null||s.call(o,r);return r})}function Yc(e){return Xr(e)}function Jc(e){return Xr(t=>{const n=e.call(t,t);return W(n,"buyMax",!1),n.currentGain==null&&(n.currentGain=P(()=>{let r=u.floor(n.formula.evaluate(n.baseResource.value)).max(n.gainResource.value);return l(n.buyMax)===!1&&(r=r.min(u.add(n.gainResource.value,1))),r})),n.actualGain==null&&(n.actualGain=P(()=>{let r=u.sub(n.formula.evaluate(n.baseResource.value),n.gainResource.value).floor().max(0);return l(n.buyMax)===!1&&(r=r.min(1)),r})),W(n,"convert",function(){var i;const r=l(n.actualGain);n.gainResource.value=l(n.currentGain),n.spend(r),(i=n.onConvert)==null||i.call(n,r)}),n})}const Qr=e=>(ze("data-v-5e2d38ce"),e=e(),Ge(),e),Zc=Qr(()=>v("div",{class:"key"},"Ctrl",-1)),Xc=Qr(()=>v("div",{class:"key"},"Shift",-1)),Qc={class:"key"},ed=A({__name:"Hotkey",props:{hotkey:null},setup(e){const t=e;let n="",r=!1,i=!1,s=!1;return De(()=>{n=t.hotkey.key,r=n.startsWith("ctrl+"),r&&(n=n.slice(5)),i=n.startsWith("shift+"),i&&(n=n.slice(6)),s=n.length==1&&n.toLowerCase()!=n.toUpperCase(),s&&(n=n.toUpperCase())}),(o,a)=>(b(),S(U,null,[l(r)?(b(),S(U,{key:0},[Zc,M("+")],64)):F("",!0),l(i)?(b(),S(U,{key:1},[Xc,M("+")],64)):F("",!0),v("div",Qc,G(l(n)),1)],64))}});var td=K(ed,[["__scopeId","data-v-5e2d38ce"]]);const hn=fn({}),Gn=Symbol("Hotkey"),pr=[")","!","@","#","$","%","^","&","*","("];function gr(e){return ce(t=>{const n=e.call(t,t);return n.type=Gn,k(n,"enabled"),W(n,"enabled",!0),k(n,"description"),n})}he.on("addLayer",e=>{Pr(e,Gn).forEach(t=>{hn[t.key]=t})});he.on("removeLayer",e=>{Pr(e,Gn).forEach(t=>{hn[t.key]=void 0})});document.onkeydown=function(e){var r;if(((r=e.target)==null?void 0:r.tagName)==="INPUT"||Hn.value&&!R.keepGoing)return;let t=e.key;pr.includes(t)?t="shift+"+pr.indexOf(t):e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const n=hn[t];n&&l(n.enabled)&&(e.preventDefault(),n.onPress())};Ys(L(()=>{const e=Object.values(hn).filter(t=>l(t==null?void 0:t.enabled));return e.length===0?"":m("div",null,[m("br",null,null),m("h4",null,[M("Hotkeys")]),m("div",{style:"column-count: 2"},[e.map(t=>m("div",null,[m(td,{hotkey:t},null),M(" "),t==null?void 0:t.description]))])])}));const nd=A({props:{visibility:{type:$(Number,Boolean),required:!0},display:{type:$(Object,String,Function),required:!0},title:{type:$(Object,String,Function),required:!0},color:$(String),collapsed:{type:Object,required:!0},style:$(Object,String,Array),titleStyle:$(Object,String,Array),bodyStyle:$(Object,String,Array),classes:$(Object),id:{type:String,required:!0}},components:{Node:dt,CollapseTransition:yi},setup(e){const{title:t,display:n}=ue(e),r=It(t),i=It(n),s=P(()=>rt[Q.theme].mergeAdjacent);return{titleComponent:r,bodyComponent:i,stacked:s,unref:l,Visibility:Z,isVisible:Se,isHidden:He}}}),rd=e=>(ze("data-v-0f2462b8"),e=e(),Ge(),e),id=rd(()=>v("span",{class:"toggle"},"\u25BC",-1));function sd(e,t,n,r,i,s){var c;const o=ve("CollapseTransition"),a=ve("Node");return e.isVisible(e.visibility)?(b(),S("div",{key:0,class:re(["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:{}])},[v("button",{class:"title",style:ee([{backgroundColor:e.unref(e.color)},e.unref(e.titleStyle)||[]]),onClick:t[0]||(t[0]=d=>e.collapsed.value=!e.unref(e.collapsed))},[id,(b(),D(ie(e.titleComponent)))],4),m(o,null,{default:x(()=>[e.unref(e.collapsed)?F("",!0):(b(),S("div",{key:0,class:"body",style:ee({backgroundColor:e.unref(e.color)})},[(b(),D(ie(e.bodyComponent),{style:ee(e.unref(e.bodyStyle))},null,8,["style"]))],4))]),_:1}),m(a,{id:e.id},null,8,["id"])],6)):F("",!0)}var od=K(nd,[["render",sd],["__scopeId","data-v-0f2462b8"]]);const ad=Symbol("Infobox");function ei(e){const t=_e(!1,!1);return ce(n=>{const r=e.call(n,n);return r.id=Pe("infobox-"),r.type=ad,r[Ce]=od,r.collapsed=t,k(r,"visibility"),W(r,"visibility",Z.Visible),k(r,"color"),k(r,"style"),k(r,"titleStyle"),k(r,"bodyStyle"),k(r,"classes"),k(r,"title"),k(r,"display"),r[we]=function(){const{visibility:i,display:s,title:o,color:a,collapsed:c,style:d,titleStyle:g,bodyStyle:p,classes:y,id:w}=this;return{visibility:i,display:s,title:o,color:a,collapsed:c,style:l(d),titleStyle:g,bodyStyle:p,classes:y,id:w}},r})}const ld=Symbol("Links");function ud(e){return ce(t=>{const n=e.call(t,t);return n.type=ld,n[Ce]=Hr,k(n,"links"),n[we]=function(){const{links:r}=this;return{links:r}},n})}const cd=Symbol("Repeatable");function dd(e,...t){const n=_e(0),r=t.reduce((i,s)=>{var o;return Object.assign(i,(o=s.getPersistentData)==null?void 0:o.call(s))},{});return ce(i=>{var y,w,N;const s=e.call(i,i);s.id=Pe("repeatable-"),s.type=cd,s[Ce]=Yr;for(const _ of t)(y=_.preConstruct)==null||y.call(_,s);s.amount=n,s.amount[lt]=(w=s.initialAmount)!=null?w:0,Object.assign(s,r);const o={requirementMet:P(()=>u.sub(l(s.limit),s.amount.value)),requiresPay:!1,visibility:Z.None,canMaximize:!0},a=jn(s);Je(s.requirements)?(s.requirements.unshift(a),s.requirements.push(o)):s.requirements=[a,s.requirements,o],s.maxed=P(()=>u.gte(s.amount.value,l(s.limit))),k(s,"classes");const c=s.classes;s.classes=P(()=>{const _=l(c)||{};return s.maxed.value&&(_.bought=!0),_}),s.amountToIncrease=P(()=>u.clampMin(Un(s.requirements),1)),s.canClick=P(()=>vn(s.requirements));const d=s.onClick;s.onClick=function(_){var I;const E=s;if(!l(E.canClick))return;const q=(I=l(s.amountToIncrease))!=null?I:1;Gr(s.requirements,q),E.amount.value=u.add(E.amount.value,q),d==null||d(_)},k(s,"display");const g=s.display;s.display=L(()=>{var E,q,I;const _=l(g);if(Ae(_)){const O=H(_);return m(O,null,null)}if(_!=null){const O=s,j=H((E=_.title)!=null?E:"","h3"),le=H((q=_.description)!=null?q:""),se=H((I=_.effectDisplay)!=null?I:"");return m("span",null,[_.title==null?null:m("div",null,[m(j,null,null)]),_.description==null?null:m(le,null,null),_.showAmount===!1?null:m("div",null,[m("br",null,null),m(U,null,[M("Amount: "),Te(O.amount.value)]),u.isFinite(l(O.limit))?m(U,null,[M(" / "),Te(l(O.limit))]):void 0]),_.effectDisplay==null?null:m("div",null,[m("br",null,null),M("Currently: "),m(se,null,null)]),O.maxed.value?null:m("div",null,[m("br",null,null),Ht(O.requirements,l(s.amountToIncrease))])])}return""}),k(s,"visibility"),W(s,"visibility",Z.Visible),k(s,"limit"),W(s,"limit",u.dInf),k(s,"style"),k(s,"mark"),k(s,"small");for(const _ of t)(N=_.postConstruct)==null||N.call(_,s);const p=t.reduce((_,E)=>{var q;return Object.assign(_,(q=E.getGatheredProps)==null?void 0:q.call(E,s))},{});return s[we]=function(){const{display:_,visibility:E,style:q,classes:I,onClick:O,canClick:j,small:le,mark:se,id:B}=this;return{display:_,visibility:E,style:l(q),classes:I,onClick:O,canClick:j,small:le,mark:se,id:B,...p}},s})}const fd=Symbol("Reset");function ti(e){return ce(t=>{const n=e.call(t,t);return n.id=Pe("reset-"),n.type=fd,n.reset=function(){var i;const r=s=>{if(s!=null&&typeof s=="object"&&!(s instanceof u)&&!(s instanceof f)){if(jt in s&&s[jt]===!0)return;if(lt in s){const o=s;o.value=o[lt]}else!(s instanceof u)&&!ye(s)&&Object.values(s).forEach(o=>r(o))}};l(n.thingsToReset).forEach(r),he.emit("reset",n),(i=n.onReset)==null||i.call(n)},k(n,"thingsToReset"),n})}const Qt={};he.on("removeLayer",e=>{var t;(t=Qt[e.id])==null||t.call(Qt),Qt[e.id]=void 0});const ni=A({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=P(()=>Ze(t.resource));return(r,i)=>(b(),S("h2",{style:ee({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},G(l(n)),5))}});const md={class:"main-display"},pd={key:0},gd={key:1},ri=A({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null},setup(e){const n=ue(e),r=V(null),i=ut(n.effectDisplay),s=P(()=>u.lt(n.resource.value,"1e1000"));return(o,a)=>(b(),D(dn,null,{default:x(()=>{var c,d,g,p;return[v("div",{class:re(["main-display-container",(c=e.classes)!=null?c:{}]),style:ee([{height:`${((g=(d=r.value)==null?void 0:d.$el.clientHeight)!=null?g:0)+50}px`},(p=e.style)!=null?p:{}])},[v("div",md,[l(s)?(b(),S("span",pd,"You have ")):F("",!0),m(ni,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),M(" "+G(e.resource.displayName),1),l(i)?(b(),S("span",gd,[M(", "),(b(),D(ie(l(i)),{ref_key:"effectRef",ref:r},null,512))])):F("",!0)])],6)]}),_:1}))}}),vd=A({__name:"Tab",props:{display:null},setup(e){const t=e,{display:n}=ue(t),r=It(n);return(i,s)=>(b(),D(ie(l(r))))}}),hd=Symbol("Tab");function en(e){return ce(t=>{const n=e.call(t,t);return n.id=Pe("tab-"),n.type=hd,n[Ce]=vd,n[we]=function(){const{display:r}=this;return{display:r}},n})}const bd=A({props:{visibility:{type:$(Number,Boolean),required:!0},display:{type:$(Object,String,Function),required:!0},style:$(String,Object,Array),classes:$(Object),glowColor:$(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:r,floating:i}=ue(e),s=It(n),o=P(()=>{const c=ae(r);return c==null||c===""?{}:l(i)?zn(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function a(){t("selectTab")}return{selectTab:a,component:s,glowColorStyle:o,unref:l,Visibility:Z,isVisible:Se,isHidden:He}}});function yd(e,t,n,r,i,s){var o;return e.isVisible(e.visibility)?(b(),S("button",{key:0,onClick:t[0]||(t[0]=(...a)=>e.selectTab&&e.selectTab(...a)),class:re(["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:{}])},[(b(),D(ie(e.component)))],6)):F("",!0)}var ii=K(bd,[["render",yd],["__scopeId","data-v-21427abb"]]);const _d=A({props:{visibility:{type:$(Number,Boolean),required:!0},activeTab:{type:$(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:$(Object),required:!0},style:$(String,Object,Array),classes:$(Object),buttonContainerStyle:$(String,Object,Array),buttonContainerClasses:$(Object)},components:{Sticky:dn,TabButton:ii},setup(e){const{activeTab:t}=ue(e),n=P(()=>rt[Q.theme].floatingTabs),r=ke("");De(()=>{const a=ae(t);if(a==null){r.value="";return}if(Ae(a)){r.value=H(a);return}r.value=H(l(a.display))});const i=P(()=>{const a=ae(t);return Ae(a)||!a?void 0:l(a.classes)}),s=P(()=>{const a=ae(t);return Ae(a)||!a?void 0:l(a.style)});function o(a){const{display:c,style:d,classes:g,glowColor:p,visibility:y}=a;return{display:c,style:l(d),classes:g,glowColor:p,visibility:y}}return{floating:n,tabClasses:i,tabStyle:s,Visibility:Z,component:r,gatherButtonProps:o,unref:l,isVisible:Se,isHidden:He}}});function Cd(e,t,n,r,i,s){var c,d;const o=ve("TabButton"),a=ve("Sticky");return e.isVisible(e.visibility)?(b(),S("div",{key:0,class:re(["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:[],(d=e.tabStyle)!=null?d:[]])},[m(a,{class:re(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:ee(e.unref(e.buttonContainerStyle))},{default:x(()=>[v("div",{class:re(["tab-buttons",{floating:e.floating}])},[(b(!0),S(U,null,We(e.unref(e.tabs),(g,p)=>(b(),D(o,Ue({onSelectTab:y=>e.selected.value=p,floating:e.floating,key:p,active:e.unref(g.tab)===e.unref(e.activeTab)},e.gatherButtonProps(g)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(b(),D(ie(e.unref(e.component)),{key:0})):F("",!0)],6)):F("",!0)}var wd=K(_d,[["render",Cd],["__scopeId","data-v-58dbf83a"]]);const kd=Symbol("TabButton"),Nd=Symbol("TabFamily");function vr(e,t){Object.keys(e).length===0&&console.error("Cannot create tab family with 0 tabs");const n=_e(Object.keys(e)[0],!1);return ce(r=>{var o;const i=(o=t==null?void 0:t.call(r,r))!=null?o:{};i.id=Pe("tabFamily-"),i.type=Nd,i[Ce]=wd,i.tabs=Object.keys(e).reduce((a,c)=>{const d=e[c]();return d.type=kd,d[Ce]=ii,k(d,"visibility"),W(d,"visibility",Z.Visible),k(d,"tab"),k(d,"display"),k(d,"classes"),k(d,"style"),k(d,"glowColor"),a[c]=d,a},{}),i.selected=n,i.activeTab=P(()=>{const a=l(s.tabs);if(n.value in a&&Se(a[n.value].visibility))return l(a[n.value].tab);const c=Object.values(a).find(d=>Se(d.visibility));return c?l(c.tab):null}),k(i,"visibility"),W(i,"visibility",Z.Visible),k(i,"classes"),k(i,"style"),k(i,"buttonContainerClasses"),k(i,"buttonContainerStyle"),i[we]=function(){const{visibility:a,activeTab:c,selected:d,tabs:g,style:p,classes:y,buttonContainerClasses:w,buttonContainerStyle:N}=this;return{visibility:a,activeTab:c,selected:d,tabs:g,style:l(p),classes:y,buttonContainerClasses:w,buttonContainerStyle:N}};const s=i;return s})}var Sd=A({props:{display:{type:$(String,Object,Function),required:!0},visibility:{type:$(Number,Boolean),required:!0},style:$(String,Object,Array),classes:$(Object),requirements:{type:Object,required:!0},canPurchase:{type:$(Boolean),required:!0},bought:{type:$(Boolean),required:!0},mark:$(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:dt,MarkNode:Pt},setup(e){const{display:t,requirements:n,bought:r}=ue(e),i=ke("");return De(()=>{const s=ae(t);if(s==null){i.value="";return}if(Ae(s)){i.value=H(s);return}const o=H(s.title||"","h3"),a=H(s.description,"div"),c=H(s.effectDisplay||"");i.value=H(L(()=>m("span",null,[s.title!=null?m("div",null,[m(o,null,null)]):null,m(a,null,null),s.effectDisplay!=null?m("div",null,[M("Currently: "),m(c,null,null)]):null,r.value?null:m(U,null,[m("br",null,null),Ht(n.value)])])))}),{component:i,unref:l,Visibility:Z,isVisible:Se,isHidden:He}}});const Id=["disabled"];function $d(e,t,n,r,i,s){var c;const o=ve("MarkNode"),a=ve("Node");return e.isVisible(e.visibility)?(b(),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]=(...d)=>e.purchase&&e.purchase(...d)),class:re({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)?(b(),D(ie(e.unref(e.component)),{key:0})):F("",!0),m(o,{mark:e.unref(e.mark)},null,8,["mark"]),m(a,{id:e.id},null,8,["id"])],14,Id)):F("",!0)}var Md=K(Sd,[["render",$d],["__scopeId","data-v-9be6bac0"]]);const Td=Symbol("Upgrade");function tn(e,...t){const n=_e(!1,!1),r=t.reduce((i,s)=>{var o;return Object.assign(i,(o=s.getPersistentData)==null?void 0:o.call(s))},{});return ce(i=>{var c,d;const s=e.call(i,i);s.id=Pe("upgrade-"),s.type=Td,s[Ce]=Md;for(const g of t)(c=g.preConstruct)==null||c.call(g,s);s.bought=n,Object.assign(s,r),s.canPurchase=P(()=>!n.value&&vn(s.requirements)),s.purchase=function(){var p;const g=s;!l(g.canPurchase)||(Gr(s.requirements),n.value=!0,(p=g.onPurchase)==null||p.call(g))};const o=jn(s);Je(s.requirements)?s.requirements.unshift(o):s.requirements=[o,s.requirements],k(s,"visibility"),W(s,"visibility",Z.Visible),k(s,"classes"),k(s,"style"),k(s,"display"),k(s,"mark");for(const g of t)(d=g.postConstruct)==null||d.call(g,s);const a=t.reduce((g,p)=>{var y;return Object.assign(g,(y=p.getGatheredProps)==null?void 0:y.call(p,s))},{});return s[we]=function(){const{display:g,visibility:p,style:y,classes:w,requirements:N,canPurchase:_,bought:E,mark:q,id:I,purchase:O}=this;return{display:g,visibility:p,style:l(y),classes:w,requirements:N,canPurchase:_,bought:E,mark:q,id:I,purchase:O,...a}},s})}function Pd(e){return ce(t=>{const{addend:n,description:r,enabled:i,smallerIsBetter:s}=e.call(t,t),o=Fe(n),a=Fe(r),c=i==null?void 0:Fe(i);return{apply:d=>u.add(d,l(o)),invert:d=>u.sub(d,l(o)),getFormula:d=>f.add(d,o),enabled:c,description:r==null?void 0:L(()=>m("div",{class:"modifier-container"},[l(a)!=null?m("span",{class:"modifier-description"},[xe(l(a))]):null,m("span",{class:"modifier-amount",style:(s===!0?u.gt(l(o),0):u.lt(l(o),0))?"color: var(--danger)":""},[u.gte(l(o),0)?"+":"",Bt(l(o))])]))}})}function Od(e){return ce(t=>{const{exponent:n,description:r,enabled:i,supportLowNumbers:s,smallerIsBetter:o}=e.call(t,t),a=Fe(n),c=Fe(r),d=i==null?void 0:Fe(i);return{apply:g=>{let p=g;return s&&(p=u.add(p,1)),p=u.pow(p,l(a)),s&&(p=u.sub(p,1)),p},invert:g=>{let p=g;return s&&(p=u.add(p,1)),p=u.root(p,l(a)),s&&(p=u.sub(p,1)),p},getFormula:g=>s?f.add(g,1).pow(a).sub(1):f.pow(g,a),enabled:d,description:r==null?void 0:L(()=>m("div",{class:"modifier-container"},[l(c)!=null?m("span",{class:"modifier-description"},[xe(l(c)),s?" (+1 effective)":null]):null,m("span",{class:"modifier-amount",style:(o===!0?u.gt(l(a),1):u.lt(l(a),1))?"color: var(--danger)":""},[M("^"),Bt(l(a))])]))}})}function Fd(e){return ce(()=>{const t=e();return{apply:n=>t.filter(r=>l(r.enabled)!==!1).reduce((r,i)=>i.apply(r),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(r=>l(r.enabled)!==!1).reduceRight((r,i)=>i.invert(r),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.reduce((r,i)=>{var s;return f.if(r,(s=i.enabled)!=null?s:!0,o=>i.getFormula(o),o=>o)},n):void 0,enabled:t.some(n=>n.enabled!=null)?P(()=>t.filter(n=>l(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?L(()=>m(U,null,[t.filter(n=>l(n.enabled)!==!1).map(n=>l(n.description)).filter(n=>n).map(xe)])):void 0}})}function Ed({title:e,subtitle:t,modifier:n,base:r,unit:i,baseText:s,smallerIsBetter:o}){const a=n.apply(r!=null?r:1);return m("div",{style:{"--unit":Q.alignUnits&&i!=null?"'"+i+"'":""}},[m("h3",null,[e,t==null?null:m("span",{class:"subtitle"},[M(" ("),t,M(")")])]),m("br",null,null),m("div",{class:"modifier-container"},[m("span",{class:"modifier-description"},[xe(s!=null?s:"Base")]),m("span",{class:"modifier-amount"},[Bt(r!=null?r:1),i])]),xe(l(n.description)),m("hr",null,null),m("div",{class:"modifier-container"},[m("span",{class:"modifier-description"},[M("Total")]),m("span",{class:"modifier-amount",style:(o===!0?u.gt(a,r!=null?r:1):u.lt(a,r!=null?r:1))?"color: var(--danger)":""},[Bt(a),i])])])}wr.registerPlugin(Ni);Si.registerPlugin("batch",Ii);var qd=A({props:{style:$(String,Object,Array),classes:$(Object),onInit:{type:Function,required:!0},id:{type:String,required:!0},onContainerResized:Function,onHotReload:Function},setup(e){const t=ke(null),n=new ResizeObserver(s),r=ke(null);Mt(()=>{var a,c;const o=r.value;o!=null&&(n.observe(o),t.value=new wr({resizeTo:o,backgroundAlpha:0}),(a=r.value)==null||a.appendChild(t.value.view),(c=e.onInit)==null||c.call(e,t.value)),s(),e.onHotReload&&tt(e.onHotReload)}),hi(()=>{var o;(o=t.value)==null||o.destroy()});let i=!0;function s(){i&&(i=!1,tt(()=>{var o;r.value!=null&&((o=e.onContainerResized)==null||o.call(e,r.value.getBoundingClientRect())),i=!0}))}return he.on("fontsLoaded",s),{unref:l,resizeListener:r}}});function Vd(e,t,n,r,i,s){return b(),S("div",{ref:"resizeListener",class:re(["resize-listener",e.unref(e.classes)]),style:ee(e.unref(e.style))},null,6)}var Dd=K(qd,[["render",Vd],["__scopeId","data-v-2cea0e1c"]]);const Rd=Symbol("Particles");function Ad(e){return ce(t=>{var s,o;const n=(s=e==null?void 0:e.call(t,t))!=null?s:{};n.id=Pe("particles-"),n.type=Rd,n[Ce]=Dd,n.app=ke(null),n.addEmitter=a=>{const c=n;return c.app.value?Promise.resolve(new sr(c.app.value.stage,a)):new Promise(d=>{r.push({resolve:d,config:a})})};let r=[];function i(a){const c=n;c.app.value=a,r.forEach(({resolve:d,config:g})=>d(new sr(a.stage,g))),r=[]}return n.onContainerResized=(o=n.onContainerResized)==null?void 0:o.bind(n),n[we]=function(){const{id:a,style:c,classes:d,onContainerResized:g,onHotReload:p}=this;return{id:a,style:l(c),classes:d,onContainerResized:g,onHotReload:p,onInit:i}},n})}window.upgradeConfig=$i;const Bd={min:.5,max:1},Ld=[{s:0,cp:.329,e:.548},{s:.548,cp:.767,e:.876},{s:.876,cp:.985,e:1}],xd=.001,jd=.1,Ud=100,zd=!0,Gd={x:0,y:0},Hd=!1,Wd=[{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 Kd={lifetime:Bd,ease:Ld,frequency:xd,emitterLifetime:jd,maxParticles:Ud,addAtBack:zd,pos:Gd,emit:Hd,behaviors:Wd};const kn="f",Qe=Gt(kn,()=>{const e="#FE0102",t="Farms",n=Ut(0,"farm points"),r=_e(!1),i=ei(()=>({title:"Lore",titleStyle:{color:"#FE0000"},display:"DEEP LORE!",bodyStyle:{backgroundColor:"#0000EE"}})),s=_e("Start"),o=zt(()=>({display(){return{title:"Clicky clicky!",description:"Current state:<br>"+s.value}},initialState:"Start",canClick(){return s.value!=="Borkened..."},onClick(_){var E,q,I,O,j,le,se,B;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=_==null?void 0:"touches"in _?_.touches[0]:_,yn=Object.assign({},Kd,{pos:{x:((E=oe==null?void 0:oe.clientX)!=null?E:0)-((O=(I=(q=w.boundingRect)==null?void 0:q.value)==null?void 0:I.left)!=null?O:0),y:((j=oe==null?void 0:oe.clientY)!=null?j:0)-((B=(se=(le=w.boundingRect)==null?void 0:le.value)==null?void 0:se.top)!=null?B:0)}});w.addEmitter(yn).then(yt=>yt.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{}}}})),a=zt(()=>({onClick(){s.value=="Borkened..."&&(s.value="Start")},display(){return s.value=="Borkened..."?"Fix the clickable!":"Does nothing"},small:!0})),c=ti(()=>({thingsToReset:()=>[Qe]})),d=Jc(()=>({formula:_=>_.div(10).sqrt().times(Be.otherThingy),baseResource:ne.points,gainResource:qt(n)})),g=Zr(()=>({layerID:kn,color:e,reset:c,tooltip(){return g.canClick.value?`${Ze(n)} ${n.displayName}`:`This weird farmer dinosaur will only see you if you have at least 10 points. You only have ${Ze(ne.points)}`},canClick(){return u.gte(ne.points.value,10)}})),p=St(g,{display:Kr(n),pinnable:!0}),y=Jr(()=>({conversion:d,tree:ne.tree,treeNode:g,display:L(()=>y.conversion.buyMax?m("span",null,[M("Hi! I'm a "),m("u",null,[M("weird dinosaur")]),M(" and I'll give you")," ",m("b",null,[Te(y.conversion.currentGain.value)]),M(" Farm Points in exchange for all of your points and lollipops! (You'll get another one at")," ",Te(y.conversion.nextAt.value),M(" points)")]):m("span",null,[M("Hi! I'm a "),m("u",null,[M("weird dinosaur")]),M(" and I'll give you a Farm Point in exchange for all of your points and lollipops! (At least")," ",Te(y.conversion.nextAt.value),M(" points)")]))})),w=Ad(()=>({boundingRect:V(null),onContainerResized(_){this.boundingRect.value=_},style:"z-index: 2"})),N=L(()=>m(U,null,[be(i),m(ri,{resource:n,color:e},null),be(y),m("div",null,[M("You have "),Te(d.baseResource.value),M(" points")]),m("div",null,[m("br",null,null),m("img",{src:"https://images.beano.com/store/24ab3094eb95e5373bca1ccd6f330d4406db8d1f517fc4170b32e146f80d?auto=compress%2Cformat&dpr=1&w=390"},null),m("div",null,[M("Bork Bork!")])]),m($e,null,null),Ve(a),Ve(o),be(w)]));return{id:kn,color:e,name:t,points:n,boop:r,coolInfo:i,clickable:o,clickableState:s,reset:c,conversion:d,treeNode:g,resetButton:y,minWidth:650,display:N,tooltip:p}});function Yd(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!br(e)}const Nn="c",Be=Gt(Nn,()=>{const e="#4BDC13",t="Candies",n=Ut(0,"lollipops"),r=zr(n),i=_e(!1),s=_e("pointy"),o=_e(10),a=_e(new u(10)),c=P(()=>u.pow(n.value,.2)),d=P(()=>u.times(n.value,10)),g=ei(()=>({title:"Lore",titleStyle:{color:"#FE0000"},display:"DEEP LORE!",bodyStyle:{backgroundColor:"#0000EE"},color:"rgb(75, 220, 19)"})),p=Vt(()=>({requirements:In(()=>u.gte(r.value,3)),display:{requirement:"3 Lollipops",effectDisplay:"Unlock the next milestone"}})),y=Vt(()=>({visibility:p.earned,requirements:In(()=>u.gte(r.value,4)),display:{requirement:"4 Lollipops",effectDisplay:"You can toggle beep and boop (which do nothing)",optionsDisplay:L(()=>m(U,null,[m(Me,{title:"beep","onUpdate:modelValue":X=>i.value=X,modelValue:i.value},null),m(Me,{title:"boop","onUpdate:modelValue":X=>Qe.boop.value=X,modelValue:Qe.boop.value},null)]))},style(){return l(this.earned)?{backgroundColor:"#1111DD"}:{}}})),w=[p,y],N=Kc(()=>({title:"Fun",requirements:Ct(()=>({resource:ne.points,cost:20,spendResources:!1})),completionLimit:3,display(){return{description:`Makes the game 0% harder<br>${Te(this.completions.value)}/${this.completionLimit} completions`,goal:"Have 20 points I guess",reward:"Says hi",effectDisplay:Ne(_.value)+"x"}},visibility:()=>u.gt(r.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"}})),_=P(()=>u.add(n.value,1).tetrate(.02)),E=tn(()=>({display:{title:"Generator of Genericness",description:"Gain 1 point every second"},requirements:Ct(()=>({cost:1,resource:qt(n)}))})),q=tn(()=>({display:()=>({description:"Point generation is faster based on your unspent Lollipops",effectDisplay:`${Ne(I.value)}x`}),requirements:Ct(()=>({cost:1,resource:qt(n)})),visibility:E.bought})),I=P(()=>{let X=u.add(n.value,1).pow(.5);return X.gte("1e20000000")&&(X=X.sqrt().times("1e10000000")),X}),O=tn(()=>({visibility:q.bought,requirements:Ct(()=>({cost:7,resource:ne.points,requiresPay:!1})),onPurchase(){ne.points.value=u.add(ne.points.value,7)},display:"Only buyable with less than 7 points, and gives you 7 more. Unlocks a secret subtab.",style(){return l(this.bought)?{backgroundColor:"#1111dd"}:l(this.canPurchase)?{}:{backgroundColor:"#dd1111"}}})),j=tn(()=>({requirements:Ct(()=>({resource:Ut(B.amount,"Exhancers",0),cost:3})),display:{title:"This upgrade doesn't exist",description:"Or does it?"}})),le=[E,q,O],se=Ct(()=>({resource:qt(n),cost(){let X=new u(B.amount.value);return X.gte(25)&&(X=X.pow(2).div(25)),u.pow(2,X.pow(1.5)).floor()},pay(X){const Xe=l(this.cost);a.value=u.add(a.value,Xe!=null?Xe:0),this.resource.value=u.sub(this.resource.value,Xe).max(0)}})),B=dd(()=>({requirements:se,display(){return{title:"Exhancers",description:`Adds ${Ne(oe.value)} things and multiplies stuff by ${Ne(yn.value)}.`}},style:{height:"222px"},purchaseLimit:4})),oe=P(()=>u.gte(B.amount.value,0)?u.pow(25,u.pow(B.amount.value,1.1)):u.pow(1/25,u.times(B.amount.value,-1).pow(1.1))),yn=P(()=>u.gte(B.amount.value,0)?u.pow(25,u.pow(B.amount.value,1.1)):u.pow(1/25,u.times(B.amount.value,-1).pow(1.1))),yt=_e(!1),_t=V(!1),Kt=zt(()=>({small:!0,display:"Respec Thingies",onClick(){if(yt.value&&!_t.value){_t.value=!0;return}n.value=u.add(n.value,a.value),B.amount.value=0,ne.tree.reset(ft)}})),Kn=zt(()=>({small:!0,display:"Sell One",onClick(){if(u.lte(B.amount.value,0))return;B.amount.value=u.sub(B.amount.value,1);const X=se.cost.value;n.value=u.add(n.value,X),a.value=u.sub(a.value,X)}})),si=L(()=>m(rn,null,{default:()=>[m(sn,null,{default:()=>[m(Me,{title:"Confirm","onUpdate:modelValue":X=>yt.value=X,modelValue:yt.value},null),Ve(Kt)]}),Ve(B),Ve(Kn),m(ct,{modelValue:_t.value,"onUpdate:modelValue":X=>_t.value=X},{header:()=>m("h2",null,[M("Confirm Respec")]),body:()=>m(U,null,[M("Are you sure? Respeccing these doesn't accomplish much")]),footer:()=>m("div",{class:"modal-default-footer"},[m("div",{class:"modal-default-flex-grow"},null),m("button",{class:"button modal-default-button",onClick:()=>_t.value=!1},[M("Cancel")]),m("button",{class:"button modal-default-button danger",onClick:()=>{Kt.onClick(),_t.value=!1}},[M("Respec")])])})]})),Yn=wn(()=>({fillStyle:{backgroundColor:"#FFFFFF"},baseStyle:{backgroundColor:"#696969"},textStyle:{color:"#04e050"},direction:J.Right,width:300,height:30,progress(){return u.add(ne.points.value,1).log(10).div(10).toNumber()},display(){return Ne(ne.points.value)+" / 1e10 points"}})),Jn=wn(()=>({fillStyle:{backgroundColor:"#4BEC13"},baseStyle:{backgroundColor:"#000000"},textStyle:{textShadow:"0px 0px 2px #000000"},borderStyle:{borderWidth:"7px"},direction:J.Up,width:50,height:200,progress(){return u.div(ne.points.value,100)},display(){return Te(u.div(ne.points.value,1).min(100))+"%"}})),Yt=wn(()=>({fillStyle:{backgroundColor:"#FE0102"},baseStyle:{backgroundColor:"#222222"},textStyle:{textShadow:"0px 0px 2px #000000"},direction:J.Up,width:100,height:30,progress(){return u.div(n.value,50)}})),Zn=Fd(()=>[Od(()=>({exponent:2,description:"Because I felt like it"})),Pd(()=>({addend:1,description:"Nice modifier"}))]),Xn=Yc(()=>({formula:X=>Zn.getFormula(X.div(10).sqrt().step(1e100,Xe=>Xe.sqrt())),baseResource:ne.points,gainResource:qt(n),roundUpCost:!0})),Qn=ti(()=>({thingsToReset:()=>[Be]})),oi=[gr(()=>({key:"c",description:"reset for lollipops or whatever",onPress(){Ot.canClick.value&&Ot.onClick()}})),gr(()=>({key:"ctrl+c",description:"respec things",onPress(){Kt.onClick()}}))],ft=Zr(()=>({layerID:Nn,color:e,reset:Qn,mark:"https://unsoftcapped2.github.io/The-Modding-Tree-2/discord.png",tooltip(){let X=Ze(n);return u.gt(B.amount.value,0)&&(X+=`<br><i><br><br><br>${Te(B.amount.value)} Exhancers</i>`),X},style:{color:"#3325CC",textDecoration:"underline"}})),ai=St(ft,{display:Kr(n),pinnable:!0}),Ot=Jr(()=>({conversion:Xn,tree:ne.tree,treeNode:ft,style:{color:"#AA66AA"},resetDescription:"Melt your points into "})),li=St(Ot,{display:L(()=>Ed({title:"Modifiers",modifier:Zn})),pinnable:!0,direction:J.Down,style:"width: 400px; text-align: left"}),Jt=Dt(()=>({display:"TH",color:"#6d3678",canClick(){return u.gte(ne.points.value,10)},tooltip:"Thanos your points",onClick(){ne.points.value=u.div(ne.points.value,2),console.log("Thanos'd")},glowColor(){return u.eq(B.amount.value,1)?"orange":""}})),Zt=Dt(()=>({display:"h",color(){return rt[Q.theme].variables["--locked"]},tooltip:{display:P(()=>`Restore your points to ${Ne(o.value)}`),right:!0},canClick(){return u.lt(ne.points.value,o.value)},onClick(){ne.points.value=o.value}})),er=Dt(()=>({visibility:Z.Hidden})),tr=Wr(()=>({nodes(){return[[Qe.treeNode,ft],[Jt,er,Zt]]},branches(){return[{startNode:Qe.treeNode,endNode:ft,"stroke-width":"25px",stroke:"green",style:{filter:"blur(5px)"}},{startNode:ft,endNode:Jt},{startNode:Jt,endNode:Zt}]}})),ui=ud(()=>({links:[{startNode:Zt,endNode:Yt,"stroke-width":"5px",stroke:"red",offsetEnd:{x:-50+100*Yt.progress.value.toNumber(),y:0}}]})),nr=vr({first:()=>({tab:L(()=>m(U,null,[Ve(...le),Ve(j),m("div",null,[M("confirmed")])])),display:"first"}),second:()=>({tab:Qe.display,display:"second"})},()=>({style:{width:"660px",backgroundColor:"brown","--background":"brown",border:"solid white",marginLeft:"auto",marginRight:"auto"}})),rr=vr({mainTab:()=>({tab:en(()=>({display:L(()=>{let X;return m(U,null,[m(ri,{resource:n,color:e,effectDisplay:`which are boosting waffles by ${Ne(c.value)} and increasing the Ice Cream cap by ${Ne(d.value)}`},null),m(dn,null,Yd(X=be(Ot))?X:{default:()=>[X]}),m(ni,{resource:n,color:e},null),m($e,{height:"5px"},null),m("button",{onClick:()=>console.log("yeet")},[M("'HI'")]),m("div",null,[M("Name your points!")]),m(Ln,{modelValue:s.value,"onUpdate:modelValue":Xe=>s.value=Xe},null),m(dn,{style:"color: red; font-size: 32px; font-family: Comic Sans MS;"},{default:()=>[M("I have "),Ze(ne.points),M(" "),s.value,M(" points!")]}),m("hr",null,null),Qs(...w),m($e,null,null),Ve(...le),Ve(j),Ve(N)])})})),display:"main tab",glowColor(){return E.canPurchase.value||q.canPurchase.value||O.canPurchase.value||u.gt(N.canComplete.value,0)?"blue":""},style:{color:"orange"}}),thingies:()=>({tab:en(()=>({style(){return{backgroundColor:"#222222","--background":"#222222"}},display:L(()=>m(U,null,[be(si),m($e,null,null),m(sn,{style:"width: 600px; height: 350px; background-color: green; border-style: solid;"},{default:()=>[m(Me,{"onUpdate:modelValue":X=>i.value=X,modelValue:i.value},null),m($e,{width:"30px",height:"10px"},null),m("div",null,[m("span",null,[M("Beep")])]),m($e,null,null),m(Vc,{height:"200px"},null)]}),m($e,null,null),m("img",{src:"https://unsoftcapped2.github.io/The-Modding-Tree-2/discord.png"},null)]))})),glowColor:"white",display:"thingies",style:{borderColor:"orange"}}),jail:()=>({tab:en(()=>({display:L(()=>m(U,null,[be(g),be(Yn),m($e,null,null),m(sn,null,{default:()=>[m(rn,{style:"background-color: #555555; padding: 15px"},{default:()=>[m("div",{style:"color: teal"},[M("Sugar level:")]),m($e,null,null),be(Jn)]}),m($e,null,null),m(rn,null,{default:()=>[m("div",null,[M("idk")]),m($e,{width:"0",height:"50px"},null),be(Yt)]})]}),m($e,null,null),m("div",null,[M(`It's jail because "bars"! So funny! Ha ha!`)]),be(tr)]))})),display:"jail"}),illuminati:()=>({tab:en(()=>({display:L(()=>m("div",null,[m("h1",null,[M(" C O N F I R M E D ")]),m($e,null,null),be(nr),m("div",null,[M("Adjust how many points H gives you!")]),m(Fc,{"onUpdate:modelValue":X=>o.value=X,modelValue:o.value,min:1,max:30},null)])),style:{backgroundColor:"#3325CC"}})),visibility:O.bought,display:"illuminati"})});return{id:Nn,color:e,name:t,points:n,best:r,beep:i,thingy:s,otherThingy:o,spentOnBuyables:a,waffleBoost:c,icecreamCap:d,coolInfo:g,lollipopMilestones:w,funChallenge:N,funEffect:_,generatorUpgrade:E,lollipopMultiplierUpgrade:q,lollipopMultiplierEffect:I,unlockIlluminatiUpgrade:O,quasiUpgrade:j,exhancers:B,respecBuyables:Kt,illuminatiTabs:nr,sellExhancer:Kn,bars:{tallBoi:Jn,longBoi:Yn,flatBoi:Yt},tree:tr,g:Jt,h:Zt,spook:er,conversion:Xn,reset:Qn,hotkeys:oi,treeNode:ft,resetButton:Ot,confirmRespec:yt,minWidth:800,tabs:rr,display:L(()=>m(U,null,[be(rr),be(ui)])),treeNodeTooltip:ai,resetButtonTooltip:li}}),ne=Gt("main",function(){const e=Ut(10),t=zr(e),n=Uu(e),r=P(()=>{if(!Be.generatorUpgrade.bought.value)return new u(0);let c=new u(3.19);return Be.lollipopMultiplierUpgrade.bought.value&&(c=c.times(Be.lollipopMultiplierEffect.value)),c});he.on("update",c=>{e.value=u.add(e.value,u.times(r.value,c))});const i=Hu(e,r),{openModal:s,modal:o}=Lr($n),a=Wr(()=>({nodes:[[Be.treeNode],[Qe.treeNode,Be.spook]],leftSideNodes:[$n.treeNode,Be.h],branches:[{startNode:Qe.treeNode,endNode:Be.treeNode,stroke:"blue","stroke-width":"25px",style:{filter:"blur(5px)"}}],onReset(){e.value=ir(this.resettingNode.value)===ir(Be.treeNode)?0:10,t.value=e.value,n.value=e.value},resetPropagation:$c}));return{name:"Tree",display:L(()=>m(U,null,[R.devSpeed===0?m("div",null,[M("Game Paused")]):null,R.devSpeed!=null&&R.devSpeed!=0&&R.devSpeed!==1?m("div",null,[M("Dev Speed: "),Ne(R.devSpeed),M("x")]):null,R.offlineTime!=null&&R.offlineTime!=0?m("div",null,[M("Offline Time: "),gn(R.offlineTime)]):null,m("div",null,[u.lt(e.value,"1e1000")?m("span",null,[M("You have ")]):null,m("h2",null,[Ne(e.value)]),u.lt(e.value,"1e1e6")?m("span",null,[M(" points")]):null]),u.gt(r.value,0)?m("div",null,[M("("),i.value,M(")")]):null,m($e,null,null),m("button",{onClick:s},[M("open achievements")]),be(o),be(a),m(ju,{height:"200px",style:"margin: 10px auto; display: block"},null)])),points:e,best:t,total:n,oomps:i,tree:a,showAchievements:s}}),Jd=e=>[ne,Qe,Be,$n],Hn=P(()=>u.gt(ne.points.value,25));function Zd(e,t){}var Xd=Object.freeze(Object.defineProperty({__proto__:null,main:ne,getInitialLayers:Jd,hasWon:Hn,fixOldSave:Zd},Symbol.toStringTag,{value:"Module"}));const Wt=e=>(ze("data-v-4a50ce42"),e=e(),Ge(),e),Qd={class:"game-over-modal-header"},ef=["src","alt"],tf={class:"game-over-modal-title"},nf=Wt(()=>v("h2",null,"Congratulations!",-1)),rf={key:0},sf=Wt(()=>v("br",null,null,-1)),of=Wt(()=>v("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),af=Wt(()=>v("br",null,null,-1)),lf=["href"],uf=Wt(()=>v("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),cf=A({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:r,discordLink:i,versionNumber:s,versionTitle:o}=te,a=P(()=>gn(R.timePlayed)),c=P(()=>Hn.value&&!R.keepGoing),d=nt(R,"autosave");function g(){R.keepGoing=!0}function p(){vt(kt())}return(y,w)=>(b(),D(ct,{"model-value":l(c)},{header:x(()=>[v("div",Qd,[l(n)?(b(),S("img",{key:0,class:"game-over-modal-logo",src:l(n),alt:l(t)},null,8,ef)):F("",!0),v("div",tf,[nf,v("h4",null,"You've beaten "+G(l(t))+" v"+G(l(s))+": "+G(l(o)),1)])])]),body:x(({shown:N})=>[N?(b(),S("div",rf,[v("div",null,"It took you "+G(l(a))+" to beat the game.",1),sf,of,af,v("div",null,[v("a",{href:l(i),class:"game-over-modal-discord-link"},[uf,M(" "+G(l(r)),1)],8,lf)]),m(Me,{title:"Autosave",modelValue:l(d),"onUpdate:modelValue":w[0]||(w[0]=_=>ye(d)?d.value=_:null)},null,8,["modelValue"])])):F("",!0)]),footer:x(()=>[v("div",{class:"game-over-footer"},[v("button",{onClick:g,class:"button"},"Keep Going"),v("button",{onClick:p,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var df=K(cf,[["__scopeId","data-v-4a50ce42"]]);const bn=e=>(ze("data-v-d3bb0716"),e=e(),Ge(),e),ff=bn(()=>v("div",{class:"nan-modal-header"},[v("h2",null,"NaN value detected!")],-1)),mf={key:0},pf=bn(()=>v("br",null,null,-1)),gf=["href"],vf=bn(()=>v("span",{class:"material-icons nan-modal-discord"},"discord",-1)),hf=bn(()=>v("br",null,null,-1)),bf={class:"nan-footer"},yf=A({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=te,r=V(!0),i=V(!0),s=nt(fe,"hasNaN"),o=V(null);je(s,y=>{y?(r.value=R.autosave,i.value=R.devSpeed===0):(R.autosave=r.value,R.devSpeed=i.value?0:null)});const a=P(()=>{var y;return(y=fe.NaNPath)==null?void 0:y.join(".")}),c=P(()=>fe.NaNPersistent!=null?fe.NaNPersistent.value:null);function d(){fe.NaNPersistent!=null&&(fe.NaNPersistent.value=new u(0),fe.hasNaN=!1)}function g(){fe.NaNPersistent&&(fe.NaNPersistent.value=new u(1),fe.hasNaN=!1)}function p(){fe.NaNPersistent&&(fe.NaNPersistent.value=new u(NaN),fe.hasNaN=!1)}return(y,w)=>(b(),S(U,null,[m(ct,Ue({modelValue:l(s),"onUpdate:modelValue":w[4]||(w[4]=N=>ye(s)?s.value=N:null)},y.$attrs),{header:x(()=>[ff]),body:x(()=>[v("div",null,[M(' Attempted to assign "'+G(l(a))+'" to NaN',1),l(c)?(b(),S("span",mf,G(" ")+"(previously "+G(l(Ne)(l(c)))+")",1)):F("",!0),M(". Auto-saving has been "+G(r.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),pf,v("div",null,[v("a",{href:l(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[vf,M(" "+G(l(t)||"Profectus & Friends"),1)],8,gf)]),hf,m(Me,{title:"Autosave",modelValue:r.value,"onUpdate:modelValue":w[0]||(w[0]=N=>r.value=N)},null,8,["modelValue"]),l(te).enablePausing?(b(),D(Me,{key:0,title:"Pause game",modelValue:i.value,"onUpdate:modelValue":w[1]||(w[1]=N=>i.value=N)},null,8,["modelValue"])):F("",!0)]),footer:x(()=>[v("div",bf,[v("button",{onClick:w[2]||(w[2]=N=>{var _;return(_=o.value)==null?void 0:_.open()}),class:"button"},"Open Saves Manager"),v("button",{onClick:d,class:"button"},"Set to 0"),v("button",{onClick:g,class:"button"},"Set to 1"),l(c)&&l(u).neq(l(c),0)&&l(u).neq(l(c),1)?(b(),S("button",{key:0,onClick:w[3]||(w[3]=N=>s.value=!1),class:"button"}," Set to previous ")):F("",!0),v("button",{onClick:p,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),m(jr,{ref_key:"savesManager",ref:o},null,512)],64))}});var _f=K(yf,[["__scopeId","data-v-d3bb0716"]]);const Cf={key:0,class:"tpsDisplay"},wf=A({__name:"TPS",setup(e){const t=P(()=>u.div(fe.lastTenTicks.length,fe.lastTenTicks.reduce((n,r)=>n+r,0)));return(n,r)=>l(t).isNan()?F("",!0):(b(),S("div",Cf,"TPS: "+G(l(Te)(l(t))),1))}});var kf=K(wf,[["__scopeId","data-v-89b89152"]]);var Nf=A({__name:"App",setup(e){const t=te.useHeader,n=P(()=>rt[Q.theme].variables),r=nt(Q,"showTPS"),i=nt(fe,"errors"),s=P(()=>H(L(()=>m(U,null,[Js.map(be)]))));return(o,a)=>l(i).length>0?(b(),S("div",{key:0,class:"error-container",style:ee(l(n))},[m(kr,{errors:l(i)},null,8,["errors"])],4)):(b(),S(U,{key:1},[v("div",{id:"modal-root",style:ee(l(n))},null,4),v("div",{class:re(["app",{useHeader:l(t)}]),style:ee(l(n))},[l(t)?(b(),D(Ur,{key:0})):F("",!0),m(Ru),l(l(r))?(b(),D(kf,{key:1})):F("",!0),m(df),m(_f),(b(),D(ie(l(s))))],6)],64))}});var Sf=K(Nf,[["__scopeId","data-v-bf4e22ac"]]);function If(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:s,onRegisterError:o}=e;let a,c,d,g;const p=async(w=!0)=>{await d,w&&(a==null||a.addEventListener("controlling",N=>{N.isUpdate&&window.location.reload()})),await(g==null?void 0:g())};async function y(){if("serviceWorker"in navigator){const{Workbox:w,messageSW:N}=await At(()=>import("./workbox-window.4a8794bb.js"),[]);g=async()=>{c&&c.waiting&&await N(c.waiting,{type:"SKIP_WAITING"})},a=new w("./sw.js",{scope:"./",type:"classic"}),a.addEventListener("activated",_=>{_.isUpdate||r==null||r()});{const _=()=>{n==null||n()};a.addEventListener("waiting",_),a.addEventListener("externalwaiting",_)}a.register({immediate:t}).then(_=>{c=_,s?s("./sw.js",_):i==null||i(_)}).catch(_=>{o==null||o(_)})}}return d=y(),p}function $f(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:s,onRegisterError:o}=e,a=V(!1),c=V(!1);return{updateServiceWorker:If({immediate:t,onNeedRefresh(){a.value=!0,n==null||n()},onOfflineReady(){c.value=!0,r==null||r()},onRegistered:i,onRegisteredSW:s,onRegisterError:o}),offlineReady:c,needRefresh:a}}const Wn=console.error;console.error=function(...e){Wn(...e)};window.onerror=function(e,t,n,r,i){return fe.errors.push(i instanceof Error?i:new Error(JSON.stringify(i))),Wn(i),!0};window.onunhandledrejection=function(e){fe.errors.push(e.reason instanceof Error?e.reason:new Error(JSON.stringify(e.reason))),Wn(e.reason)};document.title=te.title;window.projInfo=te;te.id===""&&console.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 Hs();const{globalBus:e}=await At(()=>Promise.resolve().then(function(){return Gs}),void 0),{startGameLoop:t}=await At(()=>import("./gameLoop.c6fcb607.js"),["assets/gameLoop.c6fcb607.js","assets/@fontsource.f66d05e7.css","assets/vue.72cfed44.js","assets/earcut.b6f90e68.js","assets/@vue.6a1d7e86.js","assets/lz-string.dccec454.js","assets/@ivanv.c33db252.js","assets/nanoevents.1080beb7.js","assets/vue-next-select.3d5e8343.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.a52097e2.js","assets/sortablejs.740e9352.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-toastification.42f47de1.js","assets/vue-toastification.4b5f8ac8.css","assets/@pixi.94823b24.js","assets/ismobilejs.5c6954b9.js","assets/eventemitter3.dc5195d7.js","assets/url.68c785f7.js","assets/querystring.d4befb87.js"]),n=window.vue=bi(Sf);n.config.errorHandler=function(r,i,s){console.error(r,s,i)},e.emit("setupVue",n),n.mount("#app"),tt(()=>{const r=Cr(),{updateServiceWorker:i}=$f({onNeedRefresh(){r.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(){i()}})},onOfflineReady(){r.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{u as D,At as _,fe as a,te as b,Xd as c,he as g,En as l,R as p,Q as s};