From aaff3fed2e976bb952193ccdb76cd1118a386f79 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 8 May 2023 04:20:36 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20thepaper?= =?UTF-8?q?pilot/Planar-Pioneers@545b1c94d1ad09a5c195244b9748e26d5a345887?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...meLoop.d7a7e16a.js => gameLoop.07b8c003.js} | 2 +- assets/index.6448276a.js | 18 ------------------ .../{index.43bdca03.css => index.6d27cf3a.css} | 2 +- assets/index.be8580f0.js | 18 ++++++++++++++++++ index.html | 4 ++-- sw.js | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-) rename assets/{gameLoop.d7a7e16a.js => gameLoop.07b8c003.js} (89%) delete mode 100644 assets/index.6448276a.js rename assets/{index.43bdca03.css => index.6d27cf3a.css} (90%) create mode 100644 assets/index.be8580f0.js diff --git a/assets/gameLoop.d7a7e16a.js b/assets/gameLoop.07b8c003.js similarity index 89% rename from assets/gameLoop.d7a7e16a.js rename to assets/gameLoop.07b8c003.js index dcb3ca7..a7df877 100644 --- a/assets/gameLoop.d7a7e16a.js +++ b/assets/gameLoop.07b8c003.js @@ -1 +1 @@ -import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.6448276a.js";import"./vue.c16a309b.js";import{b2 as c}from"./@vue.6b211d3c.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.dccec454.js";import"./vue-next-select.ded54c4a.js";import"./vuedraggable.1879de79.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.8ce6f9b1.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.9c2dad53.js";import"./unique-names-generator.5494b30b.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function M(){f=(await d(()=>import("./index.6448276a.js").then(function(t){return t.c}),["assets/index.6448276a.js","assets/index.43bdca03.css","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css","assets/unique-names-generator.5494b30b.js"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{M as startGameLoop}; +import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.be8580f0.js";import"./vue.c16a309b.js";import{b2 as c}from"./@vue.6b211d3c.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.dccec454.js";import"./vue-next-select.ded54c4a.js";import"./vuedraggable.1879de79.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.8ce6f9b1.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.9c2dad53.js";import"./unique-names-generator.5494b30b.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function M(){f=(await d(()=>import("./index.be8580f0.js").then(function(t){return t.c}),["assets/index.be8580f0.js","assets/index.6d27cf3a.css","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css","assets/unique-names-generator.5494b30b.js"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{M as startGameLoop}; diff --git a/assets/index.6448276a.js b/assets/index.6448276a.js deleted file mode 100644 index e190e03..0000000 --- a/assets/index.6448276a.js +++ /dev/null @@ -1,18 +0,0 @@ -/* empty css */import"./vue.c16a309b.js";import{_ as S,C as s,l as De,q as fn,t as B,b2 as nt,ab as X,aF as I,a1 as T,a2 as k,aL as Tt,G as be,aD as nr,w as it,b3 as pt,a9 as g,O as ae,ap as Rr,az as ai,as as Dt,aH as Hn,A as Ee,$ as ne,b7 as H,b9 as Ii,ar as Pt,bv as wn,a8 as O,bt as qr,bc as _n,T as Vr,u as xi,j as Lr,bw as Mt,aM as St,a0 as j,aO as Le,J as re,I as Ue,aI as pn,aG as gn,z as Kt,bo as Br,bs as jr,aK as Nn,bd as Li,am as Kn,H as zr,bx as Ur,bf as Gr}from"./@vue.6b211d3c.js";import{c as ir}from"./nanoevents.1080beb7.js";import{L as Ht}from"./lz-string.dccec454.js";import{Y as Wr}from"./vue-next-select.ded54c4a.js";import{D as Hr}from"./vuedraggable.1879de79.js";import{p as Zr}from"./vue-textarea-autosize.35804eaf.js";import{P as Yr}from"./vue-panzoom.8ce6f9b1.js";import{s as Jr,u as si}from"./vue-toastification.9c2dad53.js";import{n as Kr,t as Xr,l as Qr}from"./unique-names-generator.5494b30b.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";const ea=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}};ea();const ta="modulepreload",Bi={},na="./",Vn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${na}${i}`,i in Bi)return;Bi[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const l=document.createElement("link");if(l.rel=r?"stylesheet":ta,r||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),r)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},ia="./projInfo-schema.json",ra="Planar Pioneers",aa="A game about controlling and exploiting planes!",sa="planar-pioneers",oa="thepaperpilot",la="",ua="",ca="0.0",da="Initial Commit",fa=!1,pa=!1,ga=2,ma=!0,va=null,ha="",ba=["main"],ya=3600,wa=0,_a=!0,Na="base64";var ge={$schema:ia,title:ra,description:aa,id:sa,author:oa,discordName:la,discordLink:ua,versionNumber:ca,versionTitle:da,allowGoBack:fa,defaultShowSmall:pa,defaultDecimalsShown:ga,useHeader:ma,banner:va,logo:ha,initialTabs:ba,maxTickLength:ya,offlineLimit:wa,enablePausing:_a,exportEncoding:Na};class Ca{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const i=new ka(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class ka{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const vi=17,Ma=9e15,Sa=Math.log10(9e15),Ia=1/9e15,xa=308,$a=-324,ji=5,Ea=(1<<10)-1,Ta=function(){const e=[];for(let n=$a+1;n<=xa;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),rn=[2,Math.E,3,4,5,6,7,8,9,10],Da=[[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]],Pa=[[-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 M=function(t){return o.fromValue_noAlloc(t)},Z=function(e,t,n){return o.fromComponents(e,t,n)},ee=function(t,n,i){return o.fromComponents_noNormalize(t,n,i)};const Ut=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),a=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(a.toFixed(Math.max(i-r,0)))},hi=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Fa=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const i=e*e;let r=e;return n=n+1/(12*r),r=r*i,n=n+1/(360*r),r=r*i,n=n+1/(1260*r),r=r*i,n=n+1/(1680*r),r=r*i,n=n+1/(1188*r),r=r*i,n=n+691/(360360*r),r=r*i,n=n+7/(1092*r),r=r*i,n=n+3617/(122400*r),Math.exp(n)/t},rr=.5671432904097838,zi=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return rr;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let r=0;r<100;++r){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n).5?1:-1;if(Math.random()*20<1)return ee(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let r=Math.pow(10,i);return Math.random()>.9&&(r=Math.trunc(r)),Z(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return y.floor(e.div(r).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(y.sub(1,n.pow(e))).div(y.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const a=t.add(i.mul(n)).sub(n.div(2)),l=a.pow(2);return a.neg().add(l.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const r=t.add(i.mul(n));return e.div(2).mul(r.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag=Ma)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){const t=e,n=y.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const _=parseFloat(i[0]),N=parseFloat(i[1]),E=i[1].split(";");let R=1;if(E.length===2&&(R=parseFloat(E[1]),isFinite(R)||(R=1)),isFinite(_)&&isFinite(N)){const $=y.pentate(_,N,R);return this.sign=$.sign,this.layer=$.layer,this.mag=$.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const _=parseFloat(r[0]),N=parseFloat(r[1]),E=r[1].split(";");let R=1;if(E.length===2&&(R=parseFloat(E[1]),isFinite(R)||(R=1)),isFinite(_)&&isFinite(N)){const $=y.tetrate(_,N,R);return this.sign=$.sign,this.layer=$.layer,this.mag=$.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const _=parseFloat(a[0]),N=parseFloat(a[1]);if(isFinite(_)&&isFinite(N)){const E=y.pow(_,N);return this.sign=E.sign,this.layer=E.layer,this.mag=E.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}e=e.trim().toLowerCase();let l,u,c=e.split("pt");if(c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let _=parseFloat(c[1]);if(isFinite(_)||(_=1),isFinite(l)&&isFinite(u)){const N=y.tetrate(l,u,_);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let _=parseFloat(c[1]);if(isFinite(_)||(_=1),isFinite(l)&&isFinite(u)){const N=y.tetrate(l,u,_);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}const f=e.split("e"),b=f.length-1;if(b===0){const _=parseFloat(e);if(isFinite(_))return this.fromNumber(_),y.fromStringCache.size>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}else if(b===1){const _=parseFloat(e);if(isFinite(_)&&_!==0)return this.fromNumber(_),y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}const p=e.split("e^");if(p.length===2){this.sign=1,p[0].charAt(0)=="-"&&(this.sign=-1);let _="";for(let N=0;N=43&&E<=57||E===101)_+=p[1].charAt(N);else return this.layer=parseFloat(_),this.mag=parseFloat(p[1].substr(N+1)),this.normalize(),y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}if(b<1)return this.sign=0,this.layer=0,this.mag=0,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this;const w=parseFloat(f[0]);if(w===0)return this.sign=0,this.layer=0,this.mag=0,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this;let C=parseFloat(f[f.length-1]);if(b>=2){const _=parseFloat(f[f.length-2]);isFinite(_)&&(C*=Math.sign(_),C+=hi(_))}if(!isFinite(w))this.sign=f[0]==="-"?-1:1,this.layer=b,this.mag=C;else if(b===1)this.sign=Math.sign(w),this.layer=1,this.mag=C+Math.log10(Math.abs(w));else if(this.sign=Math.sign(w),this.layer=b,b===2){const _=y.mul(Z(1,2,C),M(w));return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}else this.mag=C;return this.normalize(),y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}fromValue(e){return e instanceof y?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:Ut(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Ut(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<=ji?(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):Ut(this.m,e)+"e"+Ut(this.e,e):this.layer===1?Ut(this.m,e)+"e"+Ut(this.e,e):this.layer<=ji?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Ut(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Ut(this.mag,e)}abs(){return ee(this.sign===0?0:1,this.layer,this.mag)}neg(){return ee(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?y.dZero:this.layer===0?Z(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?y.dZero:this.layer===0?Z(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?y.dZero:this.layer===0?Z(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?y.dZero:this.layer===0?Z(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=M(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 ee(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(y.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return y.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),a=i.layer*Math.sign(i.mag);if(r-a>=2)return n;if(r===0&&a===-1){if(Math.abs(i.mag-Math.log10(n.mag))>vi)return n;{const l=Math.pow(10,Math.log10(n.mag)-i.mag),u=i.sign+n.sign*l;return Z(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}if(r===1&&a===0){if(Math.abs(n.mag-Math.log10(i.mag))>vi)return n;{const l=Math.pow(10,n.mag-Math.log10(i.mag)),u=i.sign+n.sign*l;return Z(Math.sign(u),1,Math.log10(i.mag)+Math.log10(Math.abs(u)))}}if(Math.abs(n.mag-i.mag)>vi)return n;{const l=Math.pow(10,n.mag-i.mag),u=i.sign+n.sign*l;return Z(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}plus(e){return this.add(e)}sub(e){return this.add(M(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=M(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return ee(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return ee(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return y.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return Z(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return Z(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return Z(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=Z(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Z(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Z(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=Z(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Z(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Z(n.sign*i.sign,r.layer+1,r.sign*r.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=M(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?y.dNaN:this.layer===0?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=M(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?1:nt.mag?1:this.mag0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const n=M(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=M(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let i=this.mag,r=n.mag;return this.layer>n.layer&&(r=hi(r)),this.layer0?Z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Z(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?y.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=M(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?y.dNaN:this.layer===0&&e.layer===0?Z(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):y.div(this.log10(),e.log10())}log2(){return this.sign<=0?y.dNaN:this.layer===0?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?y.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=M(e),n=this,i=t;if(n.sign===0)return i.eq(0)?ee(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return ee(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const r=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?r.neg():Math.abs(i.toNumber()%2)%2===0?r:y.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return y.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return Z(1,0,t);if(e.sign===0)return y.dOne;e=ee(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):y.dOne}pow_base(e){return M(e).pow(this)}root(e){const t=M(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?y.exp(y.mul(this,y.ln(this).sub(1))):y.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(ee(1,0,24)))return y.fromNumber(Fa(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let i=e,r=12*i,a=1/r,l=t+a;if(l===t||(t=l,i=i*n,r=360*i,a=1/r,l=t-a,l===t))return y.exp(t);t=l,i=i*n,r=1260*i;let u=1/r;return t=t+u,i=i*n,r=1680*i,u=1/r,t=t-u,y.exp(t)}else return this.layer===1?y.exp(y.mul(this,y.ln(this).sub(1))):y.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?y.dOne:this.layer===0&&this.mag<=709.7?y.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 y.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Z(1,2,Math.log10(this.mag)-.3010299956639812);{const e=y.div(ee(this.sign,this.layer-1,this.mag),ee(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=ee(1,0,1)){if(e===1)return y.pow(this,t);if(e===0)return new y(t);if(this.eq(y.dOne))return y.dOne;if(this.eq(-1))return y.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return y.fromNumber(Math.E);const a=y.ln(this).neg();return a.lambertw().div(a)}else return r>1.444667861009766?y.fromNumber(Number.POSITIVE_INFINITY):y.dNaN}if(this.eq(y.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),y.fromNumber(r)}if(e<0)return y.iteratedlog(t,this,-e);t=M(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(y.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return ee(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=ee(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return y.tetrate(e,-t,this);e=M(e);let n=y.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const a=Math.min(t,n.layer-e.layer-3);t-=a,n.layer-=a}for(let a=0;a1e4)return n}return r>0&&r<1&&(e.eq(10)?n=n.layeradd10(-r):n=n.layeradd(-r,e)),n}slog(e=10,t=100){let n=.001,i=!1,r=!1,a=this.slog_internal(e).toNumber();for(let l=1;l1&&r!=c&&(i=!0),r=c,i?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),a+=n,n===0)break}return y.fromNumber(a)}slog_internal(e=10){if(e=M(e),e.lte(y.dZero)||e.eq(y.dOne))return y.dNaN;if(e.lt(y.dOne))return this.eq(y.dOne)?y.dZero:this.eq(y.dZero)?y.dNegOne:y.dNaN;if(this.mag<0||this.eq(y.dZero))return y.dNegOne;let t=0,n=y.fromDecimal(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(y.dZero))n=y.pow(e,n),t-=1;else{if(n.lte(y.dOne))return y.fromNumber(t+y.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=y.log(n,e)}return y.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:y.critical_section(e,t,Pa)}static tetrate_critical(e,t){return y.critical_section(e,t,Da)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let i=0,r=0;for(let l=0;le){const u=(e-rn[l])/(rn[l+1]-rn[l]);i=n[l][Math.floor(t)]*(1-u)+n[l+1][Math.floor(t)]*u,r=n[l][Math.ceil(t)]*(1-u)+n[l+1][Math.ceil(t)]*u;break}const a=t-Math.floor(t);return i<=0||r<=0?i*(1-a)+r*a:Math.pow(e,Math.log(i)/Math.log(e)*(1-a)+Math.log(r)/Math.log(e)*a)}layeradd10(e){e=y.fromValue_noAlloc(e).toNumber();const t=y.fromDecimal(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let i=0;i<100;++i){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const i=this.slog(t).toNumber()+e;return i>=0?y.tetrate(t,i):Number.isFinite(i)?i>=-1?y.log(y.tetrate(t,i+1),t):y.log(y.log(y.tetrate(t,i+2),t),t):y.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return y.fromNumber(zi(this.toNumber()));if(this.layer===0)return y.fromNumber(zi(this.sign*this.mag));if(this.layer===1)return Ui(this);if(this.layer===2)return Ui(this);if(this.layer>=3)return ee(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return ee(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=ee(1,0,1)){t=M(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(y.dOne)?(++e,t=y.fromNumber(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r10)return t}return t}sin(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.sin(this.sign*this.mag)):ee(0,0,0)}cos(){return this.mag<0?y.dOne:this.layer===0?y.fromNumber(Math.cos(this.sign*this.mag)):ee(0,0,0)}tan(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.tan(this.sign*this.mag)):ee(0,0,0)}asin(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.asin(this.sign*this.mag)):ee(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?y.fromNumber(Math.acos(this.toNumber())):this.layer===0?y.fromNumber(Math.acos(this.sign*this.mag)):ee(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.atan(this.sign*this.mag)):y.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 y.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return y.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?ee(Number.NaN,Number.NaN,Number.NaN):y.ln(this.add(1).div(y.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(y.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let o=y;o.fromStringCache=new Ca(Ea);o.dZero=ee(0,0,0);o.dOne=ee(1,0,1);o.dNegOne=ee(-1,0,1);o.dTwo=ee(1,0,2);o.dTen=ee(1,0,10);o.dNaN=ee(Number.NaN,Number.NaN,Number.NaN);o.dInf=ee(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=ee(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=Z(1,0,Number.MAX_VALUE);o.dNumberMin=Z(1,0,Number.MIN_VALUE);M=o.fromValue_noAlloc;Z=o.fromComponents;ee=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const Aa=new o(1);function Fn(e,t,n=!0){let i=o.log10(e).floor(),r=o.div(e,o.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=Aa,i=i.add(1));const a=i.gte(1e9)?we(i,Math.max(Math.max(t,3),ge.defaultDecimalsShown)):i.gte(1e4)?Xn(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function Xn(e,t){if(e==null)return"NaN";if(e=new o(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function ar(e,t){return e==null?"NaN":(e=new o(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ge.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Oa=new o("eeee1000"),Ra=new o("e100000"),Gi=new o("e1000"),sr=new o(1e9),qa=new o(1e6),Va=new o(1e3),La=new o(.98),Ba=new o(.001),or=new o(0);function we(e,t,n){if(t==null&&(t=ge.defaultDecimalsShown),n=n!=null?n:ge.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+we(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Oa)){const i=e.slog();return i.gte(qa)?"F"+we(i.floor()):o.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+Xn(i.floor(),0)}else{if(e.gte(Ra))return Fn(e,0,!1);if(e.gte(Gi))return Fn(e,0);if(e.gte(sr))return Fn(e,t);if(e.gte(Va))return Xn(e,0);if(e.gte(Ba)||!n)return ar(e,t);if(e.eq(or))return 0 .toFixed(t)}return e=ur(e),e.lt(Gi)?Fn(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):we(e,t)+"\u207B\xB9"}function ft(e){return e=new o(e),e.sign<0?"-"+ft(e.neg()):e.gte(sr)||e.lte(La)&&!e.eq(or)?we(e):we(e,0)}function lr(e){return o.lt(e,0)?"-"+lr(o.neg(e)):o.gt(e,2**51)?we(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?we(e)+"s":e<3600?ft(Math.floor(e/60))+"m "+we(e%60)+"s":e<86400?ft(Math.floor(e/3600))+"h "+ft(Math.floor(e/60)%60)+"m "+ft(e%60)+"s":e<31536e3?ft(Math.floor(e/84600)%365)+"d "+ft(Math.floor(e/3600)%24)+"h "+ft(Math.floor(e/60)%60)+"m":ft(Math.floor(e/31536e3))+"y "+ft(Math.floor(e/84600)%365)+"d "+ft(Math.floor(e/3600)%24)+"h")}function ja(e,t,n){e=new o(e);let i=e.toStringWithDecimalPlaces(t);return new o(i).gte(n)&&(i=o.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function za(e,t){return we(e,t,!0)}function ur(e){let t=o.log10(e).ceil();const n=o.div(e,o.pow(10,t));return t=t.neg(),e=new o(10).pow(t).times(n),e}var Ua=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:Fn,commaFormat:Xn,regularFormat:ar,format:we,formatWhole:ft,formatTime:lr,toPlaces:ja,formatSmall:za,invertOOM:ur},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:Ga,commaFormat:Wa,regularFormat:Ha,format:cn,formatWhole:je,formatTime:oi,toPlaces:Za,formatSmall:Zt,invertOOM:Ya}=Ua;window.Decimal=o;window.exponentialFormat=Ga;window.commaFormat=Wa;window.regularFormat=Ha;window.format=cn;window.formatWhole=je;window.formatTime=oi;window.toPlaces=Za;window.formatSmall=Zt;window.invertOOM=Ya;function ze(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Qn(e){return typeof e=="function"}var Y=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(Y||{});const Ln=Symbol("DoNotCache");function P(e,t){const n=e[t];Qn(n)&&n.length===0&&!n[Ln]?e[t]=S(n.bind(e)):Qn(n)&&(e[t]=n.bind(e),e[t][Ln]=!0)}function _e(e){return Qn(e)&&!e[Ln]&&(e=S(e)),e}const gt=Symbol("Component"),rt=Symbol("GatherProps");let Ja=0;function kn(e="feature-"){return e+Ja++}var ke=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(ke||{});function at(e){const t=s(e);return t!==2&&t!==!1}function Mn(e){return s(e)===1}function te(e){return e[Ln]=!0,e}function se(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function ki(e,...t){const n=[],i=r=>{Object.keys(r).forEach(a=>{const l=r[a];l!=null&&typeof l=="object"&&(t.includes(l.type)?n.push(l):!(l instanceof o)&&!De(l)&&i(l))})};return i(e),n}const an={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 $i=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))($i||{}),bt={classic:an,paper:{...an,variables:{...an.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:{...an,variables:{...an.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:{...an,variables:{...an.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Ge=ir();"fonts"in document&&(document.fonts.onloadingdone=()=>Ge.emit("fontsLoaded"));var Ka=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Ge},Symbol.toStringTag,{value:"Module"}));const Xa=fn({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var K=window.player=Xa;function cr(e){return JSON.stringify(e,(t,n)=>s(n))}function dr(e={}){return Object.assign({id:`${ge.id}-0`,name:"Default Save",tabs:ge.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ge.id,modVersion:ge.versionNumber,layers:{}},e)}function Qe(e){const t=Ht.compressToUTF16(cr(e!=null?e:K));return localStorage.setItem((e!=null?e:K).id,t),t}async function Qa(){ns();try{let e=localStorage.getItem(oe.active);if(e==null){await sn(yn());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Ht.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ge.id){await sn(yn());return}t.id=oe.active,await sn(t)}catch(e){console.error(`Failed to load save. Falling back to new save. -`,e),await sn(yn())}}function yn(){const e=Jn(),t=dr({id:e});return Qe(t),oe.saves.push(e),t}function Jn(){let e,t=0;do e=`${ge.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const es=B(!1);async function sn(e){console.info("Loading save",e),es.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await Vn(()=>Promise.resolve().then(function(){return Cs}),void 0),{fixOldSave:r,getInitialLayers:a}=await Vn(()=>Promise.resolve().then(function(){return yd}),void 0);for(const l in t){const u=t[l];u&&n(u)}a(e).forEach(l=>i(l,e)),e=dr(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,ge.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ge.versionNumber&&(r(e.modVersion,e),e.modVersion=ge.versionNumber),Object.assign(K,e),oe.active=K.id,Ge.emit("onLoad")}setInterval(()=>{K.autosave&&Qe()},1e3);window.onbeforeunload=()=>{K.autosave&&Qe()};window.save=Qe;const ts=window.hardReset=async()=>{await sn(yn())};window.deleteLowerSaves=()=>{const e=Object.values(oe.saves).indexOf(K.id)+1;Object.values(oe.saves).slice(e).forEach(t=>localStorage.removeItem(t)),oe.saves=oe.saves.slice(0,e)};const Bn=fn({active:"",saves:[],showTPS:!0,theme:$i.Nordic,unthrottled:!1,alignUnits:!1});nt(Bn,e=>{const t=Ht.compressToUTF16(JSON.stringify(e));localStorage.setItem(ge.id,t)},{deep:!0});var oe=window.settings=Bn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:$i.Nordic,alignUnits:!1};Ge.emit("loadSettings",e),Object.assign(Bn,e),ts()};function ns(){try{let e=localStorage.getItem(ge.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Ht.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Bn,t)}Ge.emit("loadSettings",Bn)}catch{}}const fr=fn([]);function is(e){fr.push(e)}const rs=fn([]),as=fn([]),ss={class:"table"},os=X({__name:"Row",setup(e){const t=S(()=>bt[oe.theme].mergeAdjacent);return(n,i)=>(I(),T("div",ss,[k("div",{class:be(["row",{mergeAdjacent:s(t)}])},[Tt(n.$slots,"default")],2)]))}});function ls(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Rr(e)}function le(e,t="span"){return typeof e=="function"?X({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),X({template:e})):X({render:()=>({})}):e}function Je(e){if(yt(e))return typeof e=="function"?e():le(e);const t=e[gt];return g(t,e[rt](),null)}function Wi(...e){let t;return g(os,null,ls(t=e.map(Je))?t:{default:()=>[t]})}function mt(e){if(yt(e))return typeof e=="function"?e():typeof e=="string"?g(ae,null,[e]):g(e,null,null);const t=e[gt];return g(t,e[rt](),null)}function Hi(e,t){return e.reduce((n,i)=>g(ae,null,[n,t,i]))}function yt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Ln]===!0}function pr(e,t){const n=B(null),i=B(void 0);function r(u){n.value||(n.value=setInterval(l,250)),i.value=u}function a(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return nr(a),{start:r,stop:a,handleHolding:l}}function gr(e,t="div"){const n=it();return pt(()=>{n.value=le(Ae(e),t)}),n}function jn(e,t="div"){const n=it(null);return pt(()=>{const i=Ae(e);n.value=i==""||i==null?null:le(i,t)}),n}function Ae(e){return s(s(e))}function L(...e){return e.includes(Object)||e.push(Object),e}function us(e){const t=B(!1),n=e[rt].bind(e);return e[rt]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var me=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const cs=X({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var b;const n=B({}),i=new ResizeObserver(u),r=B(null);ai(()=>{const p=r.value;p!=null&&i.observe(p)});let a=!0,l=B((b=r.value)==null?void 0:b.getBoundingClientRect());function u(){a&&(a=!1,Dt(()=>{var p;l.value=(p=r.value)==null?void 0:p.getBoundingClientRect(),Object.values(n.value).filter(w=>w).forEach(w=>w.rect=w.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}Ge.on("fontsLoaded",u);const c={attributes:!1,childList:!0,subtree:!1};Hn(Ei,(p,w)=>{const C=new MutationObserver(()=>f(p));C.observe(w,c),n.value[p]={element:w,observer:C,rect:w.getBoundingClientRect()},u()}),Hn(Ti,p=>{var w;(w=n.value[p])==null||w.observer.disconnect(),n.value[p]=void 0,u()}),Hn(Di,n),Hn(Pi,l);function f(p){const w=n.value[p];w!=null&&(w.rect=w.element.getBoundingClientRect(),t("updateNodes",n.value))}return(p,w)=>(I(),T(ae,null,[Tt(p.$slots,"default",{},void 0,!0),k("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var mr=me(cs,[["__scopeId","data-v-2b1dc1bc"]]);const ds=["onPointerdown"],fs={class:"modal-wrapper"},ps={class:"modal-container"},gs={class:"modal-header"},ms={class:"modal-body"},vs={class:"modal-footer"},hs=k("div",{class:"modal-default-flex-grow"},null,-1),Ft=X({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=Ee(e),a=S(()=>s(r.modelValue)||u.value);function l(){n("update:modelValue",!1)}const u=B(!1),c=B(null),f=S(()=>{var b,p;return(p=(b=c.value)==null?void 0:b.nodes)!=null?p:null});return t({isOpen:a,nodes:f}),(b,p)=>(I(),ne(Vr,{to:"#modal-root"},[g(_n,{name:"modal",onBeforeEnter:p[0]||(p[0]=w=>u.value=!0),onAfterLeave:p[1]||(p[1]=w=>u.value=!1)},{default:H(()=>[Ii(k("div",Pt({class:"modal-mask",onPointerdown:wn(l,["self"])},b.$attrs),[k("div",fs,[k("div",ps,[k("div",gs,[Tt(b.$slots,"header",{shown:s(a)},()=>[O(" default header ")])]),k("div",ms,[g(mr,{ref_key:"contextRef",ref:c},{default:H(()=>[Tt(b.$slots,"body",{shown:s(a)},()=>[O(" default body ")])]),_:3},512)]),k("div",vs,[Tt(b.$slots,"footer",{shown:s(a)},()=>[k("div",{class:"modal-default-footer"},[hs,k("button",{class:"button modal-default-button",onClick:l}," Close ")])])])])])],16,ds),[[qr,e.modelValue]])]),_:3})]))}}),Wt=Symbol("ProxyState");function We(e,t={}){const n=t;let i=!1;function r(){return i||(Object.assign(n,e.call(n,n)),i=!0),n}return new Proxy(n,{get(a,l){if(l===Wt)return r();const u=r()[l];return u!=null&&typeof u=="object"&&kt in u?u[kt]:u},set(a,l,u){return r()[l]=u,!0},has(a,l){return l===Wt?!0:Reflect.has(r(),l)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(a,l){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(a,l)}})}var Fe=window.state=xi({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Yt=Symbol("PersistentState"),Cn=Symbol("DefaultValue"),ei=Symbol("StackTrace"),ti=Symbol("Deleted"),kt=Symbol("NonPersistent"),on=Symbol("SaveDataPath"),Mi=Symbol("SkipPersistence");function bs(){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 Zi(e,t){var n;if(o.isNaN(t))throw Fe.hasNaN||(K.autosave=!1,Fe.hasNaN=!0,Fe.NaNPath=e[on],Fe.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[on])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[Yt].value=t}function tt(e,t=!0){const n=De(e)?e:B(e);De(e)&&(e=e.value);const i=S({get(){return n.value},set(a){t?Zi(r,a):r[Yt].value=a}});i[Cn]=e;const r={get value(){return n.value},set value(a){t?Zi(r,a):r[Yt].value=a},__v_isRef:!0,[Yt]:n,[Cn]:e,[ei]:bs(),[ti]:!1,[kt]:i,[on]:void 0};return Ye.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` -Created at: -`+r[ei]):dn[Ye[Ye.length-1]].add(r),r}function ys(e){return e!=null&&typeof e=="object"&&Yt in e}function Zn(e){return!(Wt in e)&&kt in e?e[kt]:new Proxy(e,{get(t,n){if(n!==Yt)return n===Mi?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===Yt?!1:n==Mi?!0:Reflect.has(t,n)}})}function vr(e){Ye.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):dn[Ye[Ye.length-1]].delete(e),e[ti]=!0}Ge.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let l=!1;return Object.keys(r).forEach(u=>{let c=r[u];if(c!=null&&typeof c=="object"){if(c[Mi]===!0)return;if(Wt in c&&(c=c[Wt]),ys(c)){if(l=!0,c[ti]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` -Created at: -`+c[ei]);return}dn[e.id].delete(c);const f=[e.id,...a,u];c[on]!=null&&JSON.stringify(f)!==JSON.stringify(c[on])&&console.error(`Persistent ref is being saved to \`${f.join(".")}\` when it's already present at \`${c[on].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[on]=f;const b=a.reduce((w,C)=>(C in w||(w[C]={}),w[C]),t),p=b[u];b[u]=c[Yt],Lr(b)?p!=null?b[u]=p:b[u]=c[Cn]:p!=null?b[u].value=p:b[u].value=c[Cn]}else!(c instanceof o)&&!De(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,u])&&(Mt(c)&&!Mt(r)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",Wt in r?r[Wt]:r,u):l=!0))}}),l};i(e[Wt]),dn[e.id].forEach(r=>{r[ti]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,` -Created at: -`+r[ei])}),dn[e.id].clear()});const Ei=Symbol("RegisterNode"),Ti=Symbol("UnregisterNode"),Di=Symbol("Nodes"),Pi=Symbol("Bounds"),Ce=xi({});window.layers=Ce;const dn={},Ye=[];function Fi(e,t){return We(()=>{const n={},i=n.emitter=ir();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=B({}),n.id=e,Ye.push(e),dn[e]=new Set,n.minimized=tt(!1,!1),Object.assign(n,t.call(n,n)),Ye[Ye.length-1]==null||Ye[Ye.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen -Stack: ${Ye} -Trying to pop ${n.id}`;Ye.pop(),P(n,"color"),P(n,"display"),P(n,"classes"),P(n,"style"),P(n,"name"),se(n,"name",n.id),P(n,"minWidth"),se(n,"minWidth",600),P(n,"minimizable"),se(n,"minimizable",!0),P(n,"minimizedDisplay");const r=n.style;return n.style=S(()=>{var l,u;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(l=s(r))!=null?l:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Ai(e,t){if(console.info("Adding layer",e.id),Ce[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Ce[e.id]);return}se(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Ce[e.id]=e,Ge.emit("addLayer",e,t.layers[e.id])}function ws(e){return Ce[e]}function hr(e){console.info("Removing layer",e.id),Ge.emit("removeLayer",e),Ce[e.id]=void 0}function _s(e){hr(e),Ai(e,K)}function Ns(e){const t=B(!1);return{openModal:()=>t.value=!0,modal:te(()=>g(Ft,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>g("h2",null,[s(e.name)]),body:s(e.display)}))}}Ge.on("update",function(t){Object.values(Ce).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(Ce).forEach(n=>{n==null||n.emit("update",t)}),Object.values(Ce).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Cs=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Ei,UnregisterNodeInjectionKey:Ti,NodesInjectionKey:Di,BoundsInjectionKey:Pi,layers:Ce,persistentRefs:dn,addingLayers:Ye,createLayer:Fi,addLayer:Ai,getLayer:ws,removeLayer:hr,reloadLayer:_s,setupLayerModal:Ns},Symbol.toStringTag,{value:"Module"}));const ks=X({components:{Context:mr},props:{index:{type:Number,required:!0},display:{type:L(Object,String,Function),required:!0},minimizedDisplay:L(Object,String,Function),minimized:{type:Object,required:!0},name:{type:L(String),required:!0},color:L(String),minimizable:L(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=Ee(e),a=gr(t),l=jn(r),u=S(()=>ge.allowGoBack&&n.value>0&&!Ae(i));function c(){K.tabs.splice(s(e.index),1/0)}function f(b){e.nodes.value=b}return{component:a,minimizedComponent:l,showGoBack:u,updateNodes:f,unref:s,goBack:c}}}),Ms={key:1};function Ss(e,t,n,i,r,a){const l=St("Context");return I(),T("div",{class:"layer-container",style:Ue({"--layer-color":e.unref(e.color)})},[e.showGoBack?(I(),T("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...u)=>e.goBack&&e.goBack(...u))},"\u274C")):j("",!0),e.unref(e.minimized)?(I(),T("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=u=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(I(),ne(Le(e.minimizedComponent),{key:0})):(I(),T("div",Ms,re(e.unref(e.name)),1))])):(I(),T("div",{key:2,class:be(["layer-tab",{showGoBack:e.showGoBack}])},[g(l,{onUpdateNodes:e.updateNodes},{default:H(()=>[(I(),ne(Le(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(I(),T("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=u=>e.$emit("setMinimized",!0))}," \u25BC ")):j("",!0)],4)}var Is=me(ks,[["render",Ss],["__scopeId","data-v-72dd78b1"]]);const br=e=>(pn("data-v-4b4bda40"),e=e(),gn(),e),xs=br(()=>k("h2",null,"Changelog",-1)),$s=br(()=>k("details",{open:""},[k("summary",null,[O("v0.0 Initial Commit - "),k("time",null,"2021-09-04")]),O(" This is the first release :D "),k("ul",null,[k("li",{class:"feature"},"Did everything"),k("li",{class:"fix"},"Had some fun"),k("li",{class:"breaking"},"Removed everything"),k("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Es=X({__name:"Changelog",setup(e,{expose:t}){const n=B(!1);return t({open(){n.value=!0}}),(i,r)=>(I(),ne(Ft,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:H(()=>[xs]),body:H(()=>[$s]),_:1},8,["modelValue"]))}});var Ts=me(Es,[["__scopeId","data-v-4b4bda40"]]),Ds=X({props:{element:Object,display:{type:L(Object,String,Function),required:!0},style:L(Object,String,Array),classes:L(Object),direction:L(String),xoffset:L(String),yoffset:L(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=Ee(e),r=B(!1),a=S(()=>(Ae(i)||r.value)&&l.value),l=jn(n),u=it(le(te(()=>{const b=Ae(t);return b==null?"":mt(b)})));function c(b){const p=i;b.shiftKey&&p&&(p.value=!p.value,b.stopPropagation(),b.preventDefault())}const f=S(()=>Ae(i)&&bt[oe.theme].showPin);return{Direction:Y,isHovered:r,isShown:a,comp:l,elementComp:u,unref:s,togglePinned:c,showPin:f}}});const Ps={key:0,class:"material-icons pinned"};function Fs(e,t,n,i,r,a){return I(),T("div",{class:be(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=l=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=l=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...l)=>e.togglePinned&&e.togglePinned(...l))},[Tt(e.$slots,"default",{},void 0,!0),e.elementComp?(I(),ne(Le(e.elementComp),{key:0})):j("",!0),g(_n,{name:"fade"},{default:H(()=>{var l;return[e.isShown?(I(),T("div",{key:0,class:be(["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:Ue([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(l=e.unref(e.style))!=null?l:{}])},[e.showPin?(I(),T("span",Ps,"push_pin")):j("",!0),e.comp?(I(),ne(Le(e.comp),{key:1})):j("",!0)],6)):j("",!0)]}),_:1})],34)}var xe=me(Ds,[["render",Fs],["__scopeId","data-v-6102fa3a"]]);const mn=e=>(pn("data-v-4f97aa40"),e=e(),gn(),e),As={class:"info-modal-header"},Os=["src","alt"],Rs={class:"info-modal-title"},qs={key:0},Vs={key:0},Ls={key:0},Bs=mn(()=>k("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),js=mn(()=>k("br",null,null,-1)),zs=mn(()=>k("br",null,null,-1)),Us=["href"],Gs=mn(()=>k("span",{class:"material-icons info-modal-discord"},"discord",-1)),Ws=mn(()=>k("div",null,[k("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[k("span",{class:"material-icons info-modal-discord"},"discord"),O(" The Paper Pilot Community ")])],-1)),Hs=mn(()=>k("div",null,[k("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[k("span",{class:"material-icons info-modal-discord"},"discord"),O(" The Modding Tree ")])],-1)),Zs=mn(()=>k("br",null,null,-1));var Ys=X({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:a,discordName:l,discordLink:u,versionNumber:c,versionTitle:f}=ge,b=Ee(n),p=B(!1),w=S(()=>oi(K.timePlayed)),C=S(()=>le(te(()=>g(ae,null,[rs.map(Je)]))));t({open(){p.value=!0}});function _(){var N;(N=s(b.changelog))==null||N.open()}return(N,E)=>(I(),ne(Ft,{modelValue:p.value,"onUpdate:modelValue":E[0]||(E[0]=R=>p.value=R)},{header:H(()=>[k("div",As,[s(r)?(I(),T("img",{key:0,class:"info-modal-logo",src:s(r),alt:s(i)},null,8,Os)):j("",!0),k("div",Rs,[k("h2",null,re(s(i)),1),k("h4",null,[O(" v"+re(s(c)),1),s(f)?(I(),T("span",qs,": "+re(s(f)),1)):j("",!0)])])])]),body:H(({shown:R})=>[R?(I(),T("div",Vs,[s(a)?(I(),T("div",Ls,"By "+re(s(a)),1)):j("",!0),Bs,js,k("div",{class:"link",onClick:_},"Changelog"),zs,k("div",null,[s(u)?(I(),T("a",{key:0,href:s(u),class:"info-modal-discord-link",target:"_blank"},[Gs,O(" "+re(s(l)),1)],8,Us)):j("",!0)]),Ws,Hs,Zs,k("div",null,"Time Played: "+re(s(w)),1),(I(),ne(Le(s(C))))])):j("",!0)]),_:1},8,["modelValue"]))}});var Js=me(Ys,[["__scopeId","data-v-4f97aa40"]]);const Ks={class:"field"},Xs={key:0,class:"field-title"},Oi=X({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var l;const n=e,i=jn(Kt(n,"title"),"span"),r=B((l=n.options.find(u=>u.value===n.modelValue))!=null?l:null);nt(Kt(n,"modelValue"),u=>{var c;Ae(r)!==u&&(r.value=(c=n.options.find(f=>f.value===u))!=null?c:null)});function a(u){t("update:modelValue",u.value)}return(u,c)=>(I(),T("div",Ks,[s(i)?(I(),T("span",Xs,[(I(),ne(Le(s(i))))])):j("",!0),g(s(Wr),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=f=>r.value=f),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const Qs={class:"field"},eo=X({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=S(()=>{var a;return le((a=s(n.title))!=null?a:"","span")}),r=S({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,l)=>(I(),T("label",Qs,[Ii(k("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":l[0]||(l[0]=u=>De(r)?r.value=u:null)},null,512),[[Br,s(r)]]),(I(),ne(Le(s(i))))]))}});var Et=me(eo,[["__scopeId","data-v-11046116"]]);const to=["onClick"],no=X({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=B(!1),i=B(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,Dt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(a,l)=>(I(),T("button",{onClick:wn(r,["stop"]),class:be(["feedback",{activated:n.value,left:e.left}])},[Tt(a.$slots,"default",{},void 0,!0)],10,to))}});var yr=me(no,[["__scopeId","data-v-01a1b95c"]]);const io={class:"header"},ro=k("h2",null,"Settings",-1),ao={class:"option-tabs"},so={key:0},oo={key:1};var lo=X({__name:"Options",setup(e,{expose:t}){const n=B(!1),i=B("behaviour");function r(ie){return ie==i.value}function a(ie){i.value=ie}t({isTab:r,setTab:a,save:Qe,open(){n.value=!0}});const l=Object.keys(bt).map(ie=>({label:ze(ie),value:ie})),u=S(()=>le(te(()=>g(ae,null,[fr.map(Je)])))),{showTPS:c,theme:f,unthrottled:b,alignUnits:p}=Ee(oe),{autosave:w,offlineProd:C}=Ee(K),_=S({get(){return K.devSpeed===0},set(ie){K.devSpeed=ie?0:null}}),N=te(()=>g("span",{class:"option-title"},[O("Unthrottled"),g("desc",null,[O("Allow the game to run as fast as possible. Not battery friendly.")])])),E=te(()=>g("span",{class:"option-title"},[O("Offline Production"),g(xe,{display:"Save-specific",direction:Y.Right},{default:()=>[O("*")]}),g("desc",null,[O("Simulate production that occurs while the game is closed.")])])),R=te(()=>g("span",{class:"option-title"},[O("Autosave"),g(xe,{display:"Save-specific",direction:Y.Right},{default:()=>[O("*")]}),g("desc",null,[O("Automatically save the game every second or when the game is closed.")])])),$=te(()=>g("span",{class:"option-title"},[O("Pause game"),g(xe,{display:"Save-specific",direction:Y.Right},{default:()=>[O("*")]}),g("desc",null,[O("Stop everything from moving.")])])),D=te(()=>g("span",{class:"option-title"},[O("Theme"),g("desc",null,[O("How the game looks.")])])),U=te(()=>g("span",{class:"option-title"},[O("Show TPS"),g("desc",null,[O("Show TPS meter at the bottom-left corner of the page.")])])),he=te(()=>g("span",{class:"option-title"},[O("Align modifier units"),g("desc",null,[O("Align numbers to the beginning of the unit in modifier view.")])]));return(ie,J)=>(I(),ne(Ft,{modelValue:n.value,"onUpdate:modelValue":J[10]||(J[10]=Q=>n.value=Q)},{header:H(()=>[k("div",io,[ro,k("div",ao,[k("button",{class:be({selected:r("behaviour")}),onClick:J[0]||(J[0]=Q=>a("behaviour"))},"Behaviour",2),k("button",{class:be({selected:r("appearance")}),onClick:J[1]||(J[1]=Q=>a("appearance"))},"Appearance",2)])])]),body:H(()=>[r("behaviour")?(I(),T("div",so,[g(Et,{title:s(N),modelValue:s(b),"onUpdate:modelValue":J[2]||(J[2]=Q=>De(b)?b.value=Q:null)},null,8,["title","modelValue"]),s(ge).enablePausing?(I(),ne(Et,{key:0,title:s($),modelValue:s(_),"onUpdate:modelValue":J[3]||(J[3]=Q=>De(_)?_.value=Q:null)},null,8,["title","modelValue"])):j("",!0),g(Et,{title:s(E),modelValue:s(C),"onUpdate:modelValue":J[4]||(J[4]=Q=>De(C)?C.value=Q:null)},null,8,["title","modelValue"]),g(Et,{title:s(R),modelValue:s(w),"onUpdate:modelValue":J[5]||(J[5]=Q=>De(w)?w.value=Q:null)},null,8,["title","modelValue"]),s(w)?j("",!0):(I(),ne(yr,{key:1,class:"button save-button",onClick:J[6]||(J[6]=Q=>s(Qe)())},{default:H(()=>[O("Manually save")]),_:1}))])):j("",!0),r("appearance")?(I(),T("div",oo,[g(Oi,{title:s(D),options:s(l),modelValue:s(f),"onUpdate:modelValue":J[7]||(J[7]=Q=>De(f)?f.value=Q:null)},null,8,["title","options","modelValue"]),(I(),ne(Le(s(u)))),g(Et,{title:s(U),modelValue:s(c),"onUpdate:modelValue":J[8]||(J[8]=Q=>De(c)?c.value=Q:null)},null,8,["title","modelValue"]),g(Et,{title:s(he),modelValue:s(p),"onUpdate:modelValue":J[9]||(J[9]=Q=>De(p)?p.value=Q:null)},null,8,["title","modelValue"])])):j("",!0)]),_:1},8,["modelValue"]))}});const uo=["onSubmit"],co={class:"field"},fo={key:0,class:"field-title"},po=["placeholder"],go=X({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,i=jn(Kt(n,"title"),"span"),r=it(null);ai(()=>{var c;(c=r.value)==null||c.focus()});const a=S({get(){var c;return(c=s(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function l(){t("submit")}function u(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,f)=>(I(),T("form",{onSubmit:wn(l,["prevent"])},[k("div",co,[s(i)?(I(),T("span",fo,[(I(),ne(Le(s(i))))])):j("",!0),e.textArea?(I(),ne(s(Zr),{key:1,modelValue:s(a),"onUpdate:modelValue":f[0]||(f[0]=b=>De(a)?a.value=b:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:u,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):Ii((I(),T("input",{key:2,type:"text","onUpdate:modelValue":f[1]||(f[1]=b=>De(a)?a.value=b:null),placeholder:e.placeholder,class:be({fullWidth:!e.title}),onBlur:u,ref_key:"field",ref:r},null,42,po)),[[jr,s(a)]])])],40,uo))}});var wr=me(go,[["__scopeId","data-v-90bd4994"]]);const mo={key:0},vo=["onClick","disabled"],ho={key:0},bo=["onClick"],yo=X({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=Ee(e),r=B(!1);nt(r,u=>{t("confirmingChanged",u)});function a(){if(s(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function l(){r.value=!1}return(u,c)=>(I(),T("span",{class:be(["container",{confirming:r.value}])},[r.value?(I(),T("span",mo,"Are you sure?")):j("",!0),k("button",{onClick:wn(a,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(I(),T("span",ho,"Yes")):Tt(u.$slots,"default",{key:1},void 0,!0)],8,vo),r.value?(I(),T("button",{key:1,class:"button",onClick:wn(l,["stop"])},"No",8,bo)):j("",!0)],2))}});var wo=me(yo,[["__scopeId","data-v-2f8ef34c"]]);const At=e=>(pn("data-v-32313015"),e=e(),gn(),e),_o=At(()=>k("div",{class:"handle material-icons"},"drag_handle",-1)),No={key:0,class:"actions"},Co=At(()=>k("span",{class:"material-icons"},"content_paste",-1)),ko=At(()=>k("span",{class:"material-icons"},"content_copy",-1)),Mo=At(()=>k("span",{class:"material-icons"},"edit",-1)),So=At(()=>k("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Io={key:1,class:"actions"},xo=At(()=>k("span",{class:"material-icons"},"check",-1)),$o=At(()=>k("span",{class:"material-icons"},"close",-1)),Eo={key:2,class:"details"},To={class:"save-version"},Do=At(()=>k("br",null,null,-1)),Po={key:0},Fo={key:3,class:"details"},Ao={key:4,class:"details error"},Oo=At(()=>k("br",null,null,-1)),Ro=X({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=Ee(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=B(!1),l=B(!1),u=B("");nt(a,()=>{var p;return u.value=(p=i.value.name)!=null?p:""});const c=S(()=>i.value!=null&&i.value.id===K.id),f=S(()=>{var p;return c.value?K.time:(p=i.value!=null&&i.value.time)!=null?p:0});function b(){t("editName",u.value),a.value=!1}return(p,w)=>(I(),T("div",{class:be(["save",{active:s(c)}])},[_o,a.value?(I(),T("div",Io,[k("button",{onClick:b,class:"button"},[g(xe,{display:"Save",direction:s(Y).Left,class:"info"},{default:H(()=>[xo]),_:1},8,["direction"])]),k("button",{onClick:w[5]||(w[5]=C=>a.value=!a.value),class:"button"},[g(xe,{display:"Cancel",direction:s(Y).Left,class:"info"},{default:H(()=>[$o]),_:1},8,["direction"])])])):(I(),T("div",No,[s(i).error==null&&!l.value?(I(),ne(yr,{key:0,onClick:w[0]||(w[0]=C=>t("export")),class:"button",left:""},{default:H(()=>[g(xe,{display:"Export",direction:s(Y).Left,class:"info"},{default:H(()=>[Co]),_:1},8,["direction"])]),_:1})):j("",!0),s(i).error==null&&!l.value?(I(),T("button",{key:1,onClick:w[1]||(w[1]=C=>t("duplicate")),class:"button"},[g(xe,{display:"Duplicate",direction:s(Y).Left,class:"info"},{default:H(()=>[ko]),_:1},8,["direction"])])):j("",!0),s(i).error==null&&!l.value?(I(),T("button",{key:2,onClick:w[2]||(w[2]=C=>a.value=!a.value),class:"button"},[g(xe,{display:"Edit Name",direction:s(Y).Left,class:"info"},{default:H(()=>[Mo]),_:1},8,["direction"])])):j("",!0),g(wo,{disabled:s(c),onClick:w[3]||(w[3]=C=>t("delete")),onConfirmingChanged:w[4]||(w[4]=C=>l.value=C)},{default:H(()=>[g(xe,{display:"Delete",direction:s(Y).Left,class:"info"},{default:H(()=>[So]),_:1},8,["direction"])]),_:1},8,["disabled"])])),s(i).error==null&&!a.value?(I(),T("div",Eo,[k("button",{class:"button open",onClick:w[6]||(w[6]=C=>t("open"))},[k("h3",null,re(s(i).name),1)]),k("span",To,"v"+re(s(i).modVersion),1),Do,s(f)?(I(),T("div",Po,"Last played "+re(s(r).format(s(f))),1)):j("",!0)])):s(i).error==null&&a.value?(I(),T("div",Fo,[g(wr,{modelValue:u.value,"onUpdate:modelValue":w[7]||(w[7]=C=>u.value=C),class:"editname",onSubmit:b},null,8,["modelValue"])])):(I(),T("div",Ao,[O(" Error: Failed to load save with id "+re(s(i).id),1),Oo,O(re(s(i).error),1)]))],2))}});var qo=me(Ro,[["__scopeId","data-v-32313015"]]);const Ri=e=>(pn("data-v-2a4275be"),e=e(),gn(),e),Vo=Ri(()=>k("h2",null,"Saves Manager",-1)),Lo={class:"modal-footer"},Bo={class:"field"},jo=Ri(()=>k("span",{class:"field-title"},"Create Save",-1)),zo={class:"field-buttons"},Uo={class:"footer"},Go=Ri(()=>k("div",{style:{"flex-grow":"1"}},null,-1)),Wo=X({__name:"SavesManager",setup(e,{expose:t}){const n=B(!1),i=B(null);t({open(){n.value=!0}});const r=B(!1),a=B(""),l=B(null);nt(a,$=>{$?Dt(()=>{try{if($[0]!=="{")if($[0]==="e")$=decodeURIComponent(escape(atob($)));else if($[0]==="\u1BE1")$=Ht.decompressFromUTF16($);else{console.warn("Unable to determine preset encoding",$),r.value=!0;return}const D=JSON.parse($);if(typeof D!="object"){r.value=!0;return}const U=Jn();D.id=U,Qe(D),a.value="",r.value=!1,oe.saves.push(U)}catch{r.value=!0}}):r.value=!1});let u={},c=B(Object.keys(u).reduce(($,D)=>($.push({label:D.split("/").slice(-1)[0].slice(0,-4),value:u[D]}),$),[]));const f=xi({});function b($){if(f[$]==null){let D=localStorage.getItem($);if(D==null)f[$]={error:"Save doesn't exist in localStorage",id:$};else if(D==="dW5kZWZpbmVk")f[$]={error:"Save is undefined",id:$};else try{if(D[0]!=="{")if(D[0]==="e")D=decodeURIComponent(escape(atob(D)));else if(D[0]==="\u1BE1")D=Ht.decompressFromUTF16(D);else return console.warn("Unable to determine preset encoding",D),r.value=!0,f[$]={error:"Unable to determine preset encoding",id:$},f[$];f[$]={...JSON.parse(D),id:$}}catch(U){f[$]={error:U,id:$},console.warn(`SavesManager: Failed to load info about save with id ${$}: -${U} -${D}`)}}return f[$]}nt(n,$=>{$&&Object.keys(f).forEach(D=>delete f[D])});const p=S(()=>oe.saves.reduce(($,D)=>($[D]=b(D),$),{}));function w($){let D;switch(K.id===$?D=cr(K):D=JSON.stringify(p.value[$]),ge.exportEncoding){default:console.warn(`Unknown save encoding: ${ge.exportEncoding}. Defaulting to lz`);case"lz":D=Ht.compressToUTF16(D);break;case"base64":D=btoa(unescape(encodeURIComponent(D)));break;case"plain":break}const U=document.createElement("textarea");U.value=D,document.body.appendChild(U),U.select(),U.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(U)}function C($){K.id===$&&Qe();const D={...p.value[$],id:Jn()};Qe(D),oe.saves.push(D.id)}function _($){oe.saves=oe.saves.filter(D=>D!==$),localStorage.removeItem($),f[$]=void 0}function N($){p.value[K.id].time=K.time,Qe(),f[K.id]=void 0,sn(p.value[$]),f[$]=void 0}function E($){if(l.value=$,Dt(()=>{l.value=null}),$[0]!=="{")if($[0]==="e")$=decodeURIComponent(escape(atob($)));else if($[0]==="\u1BE1")$=Ht.decompressFromUTF16($);else{console.warn("Unable to determine preset encoding",$);return}const D=JSON.parse($);D.id=Jn(),Qe(D),oe.saves.push(D.id),N(D.id)}function R($,D){const U=p.value[$];U!=null&&(U.name=D,K.id===$?(K.name=D,Qe()):(Qe(U),f[$]=void 0))}return($,D)=>(I(),ne(Ft,{modelValue:n.value,"onUpdate:modelValue":D[4]||(D[4]=U=>n.value=U),ref_key:"modal",ref:i},{header:H(()=>[Vo]),body:H(({shown:U})=>[U?(I(),ne(s(Hr),{key:0,list:s(oe).saves,handle:".handle",itemKey:he=>he},{item:H(({element:he})=>[g(qo,{save:s(p)[he],onOpen:ie=>N(he),onExport:ie=>w(he),onEditName:ie=>R(he,ie),onDuplicate:ie=>C(he),onDelete:ie=>_(he)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):j("",!0)]),footer:H(()=>[k("div",Lo,[g(wr,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=U=>a.value=U),title:"Import Save",placeholder:"Paste your save here!",class:be({importingFailed:r.value})},null,8,["modelValue","class"]),k("div",Bo,[jo,k("div",zo,[k("button",{class:"button",onClick:D[1]||(D[1]=U=>N(s(yn)().id))},"New Game"),Object.keys(s(c)).length>0?(I(),ne(Oi,{key:0,options:s(c),modelValue:l.value,"onUpdate:modelValue":D[2]||(D[2]=U=>E(U)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):j("",!0)])]),k("div",Uo,[Go,k("button",{class:"button modal-default-button",onClick:D[3]||(D[3]=U=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var _r=me(Wo,[["__scopeId","data-v-2a4275be"]]);const st=e=>(pn("data-v-318a1c31"),e=e(),gn(),e),Ho=["src","alt"],Zo={key:1,class:"title"},Yo=st(()=>k("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Jo={class:"discord"},Ko={class:"discord-links"},Xo={key:0},Qo=["href"],el=st(()=>k("li",null,[k("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),tl=st(()=>k("li",null,[k("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),nl={href:"https://forums.moddingtree.com/",target:"_blank"},il=st(()=>k("span",{class:"material-icons"},"forum",-1)),rl=st(()=>k("span",{class:"material-icons"},"info",-1)),al=st(()=>k("span",{class:"material-icons"},"library_books",-1)),sl=st(()=>k("span",{class:"material-icons"},"settings",-1)),ol=st(()=>k("span",{class:"material-icons"},"library_books",-1)),ll=st(()=>k("span",{class:"material-icons"},"settings",-1)),ul=st(()=>k("span",{class:"material-icons"},"info",-1)),cl={href:"https://forums.moddingtree.com/",target:"_blank"},dl=st(()=>k("span",{class:"material-icons"},"forum",-1)),fl={class:"discord"},pl={class:"discord-links"},gl={key:0},ml=["href"],vl=st(()=>k("li",null,[k("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),hl=st(()=>k("li",null,[k("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),bl=X({__name:"Nav",setup(e){const t=B(null),n=B(null),i=B(null),r=B(null),{useHeader:a,banner:l,title:u,discordName:c,discordLink:f,versionNumber:b}=ge;function p(){window.open(f,"mywindow")}return(w,C)=>(I(),T(ae,null,[s(a)?(I(),T("div",Pt({key:0,class:"nav"},w.$attrs),[s(l)?(I(),T("img",{key:0,src:s(l),class:"banner",alt:s(u)},null,8,Ho)):(I(),T("div",Zo,re(s(u)),1)),k("div",{onClick:C[0]||(C[0]=_=>{var N;return(N=r.value)==null?void 0:N.open()}),class:"version-container"},[g(xe,{display:"Changelog",direction:s(Y).Down,class:"version"},{default:H(()=>[k("span",null,"v"+re(s(b)),1)]),_:1},8,["direction"])]),Yo,k("div",Jo,[k("span",{onClick:p,class:"material-icons"},"discord"),k("ul",Ko,[s(f)?(I(),T("li",Xo,[k("a",{href:s(f),target:"_blank"},re(s(c)),9,Qo)])):j("",!0),el,tl])]),k("div",null,[k("a",nl,[g(xe,{display:"Forums",direction:s(Y).Down,yoffset:"5px"},{default:H(()=>[il]),_:1},8,["direction"])])]),k("div",{onClick:C[1]||(C[1]=_=>{var N;return(N=t.value)==null?void 0:N.open()})},[g(xe,{display:"Info",direction:s(Y).Down,class:"info"},{default:H(()=>[rl]),_:1},8,["direction"])]),k("div",{onClick:C[2]||(C[2]=_=>{var N;return(N=n.value)==null?void 0:N.open()})},[g(xe,{display:"Saves",direction:s(Y).Down,xoffset:"-20px"},{default:H(()=>[al]),_:1},8,["direction"])]),k("div",{onClick:C[3]||(C[3]=_=>{var N;return(N=i.value)==null?void 0:N.open()})},[g(xe,{display:"Settings",direction:s(Y).Down,xoffset:"-66px"},{default:H(()=>[sl]),_:1},8,["direction"])])],16)):(I(),T("div",Pt({key:1,class:"overlay-nav"},w.$attrs),[k("div",{onClick:C[4]||(C[4]=_=>{var N;return(N=r.value)==null?void 0:N.open()}),class:"version-container"},[g(xe,{display:"Changelog",direction:s(Y).Right,xoffset:"25%",class:"version"},{default:H(()=>[k("span",null,"v"+re(s(b)),1)]),_:1},8,["direction"])]),k("div",{onClick:C[5]||(C[5]=_=>{var N;return(N=n.value)==null?void 0:N.open()})},[g(xe,{display:"Saves",direction:s(Y).Right},{default:H(()=>[ol]),_:1},8,["direction"])]),k("div",{onClick:C[6]||(C[6]=_=>{var N;return(N=i.value)==null?void 0:N.open()})},[g(xe,{display:"Settings",direction:s(Y).Right},{default:H(()=>[ll]),_:1},8,["direction"])]),k("div",{onClick:C[7]||(C[7]=_=>{var N;return(N=t.value)==null?void 0:N.open()})},[g(xe,{display:"Info",direction:s(Y).Right},{default:H(()=>[ul]),_:1},8,["direction"])]),k("div",null,[k("a",cl,[g(xe,{display:"Forums",direction:s(Y).Right,xoffset:"7px"},{default:H(()=>[dl]),_:1},8,["direction"])])]),k("div",fl,[k("span",{onClick:p,class:"material-icons"},"discord"),k("ul",pl,[s(f)?(I(),T("li",gl,[k("a",{href:s(f),target:"_blank"},re(s(c)),9,ml)])):j("",!0),vl,hl])])],16)),g(Js,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),g(_r,{ref_key:"savesManager",ref:n},null,512),g(lo,{ref_key:"options",ref:i},null,512),g(Ts,{ref_key:"changelog",ref:r},null,512)],64))}});var Nr=me(bl,[["__scopeId","data-v-318a1c31"]]);const yl={class:"inner-tab"},wl=X({__name:"Game",setup(e){const t=Kt(K,"tabs"),n=S(()=>Object.keys(Ce)),i=ge.useHeader;function r(a){const{display:l,minimized:u,name:c,color:f,minimizable:b,nodes:p,minimizedDisplay:w}=a;return{display:l,minimized:u,name:c,color:f,minimizable:b,nodes:p,minimizedDisplay:w}}return(a,l)=>(I(),T("div",{class:be(["tabs-container",{useHeader:s(i)}])},[(I(!0),T(ae,null,Nn(s(t),(u,c)=>{var f,b;return I(),T("div",{key:c,class:be(["tab",s((f=s(Ce)[u])==null?void 0:f.classes)]),style:Ue(s((b=s(Ce)[u])==null?void 0:b.style))},[c===0&&!s(i)?(I(),ne(Nr,{key:0})):j("",!0),k("div",yl,[s(n).includes(u)?(I(),ne(Is,Pt({key:0},r(s(Ce)[u]),{index:c,onSetMinimized:p=>s(Ce)[u].minimized.value=p}),null,16,["index","onSetMinimized"])):(I(),ne(Le(u),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var _l=me(wl,[["__scopeId","data-v-dcd207b4"]]);const Nl=X({__name:"Sticky",setup(e){const t=B("0"),n=new ResizeObserver(r),i=it(null);function r(){let a=i.value;if(a==null)return;let l=0;for(;a.previousSibling;){const u=a.previousSibling;u.dataset&&"vSticky"in u.dataset&&(l+=u.offsetHeight),a=u}t.value=l+"px"}return Dt(r),document.fonts.ready.then(r),ai(()=>{var l;const a=(l=i.value)==null?void 0:l.parentElement;a&&n.observe(a)}),(a,l)=>(I(),T("div",{class:"sticky",style:Ue({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Tt(a.$slots,"default",{},void 0,!0)],4))}});var ni=me(Nl,[["__scopeId","data-v-cccac690"]]);const Cl=["x1","y1","x2","y2"],kl=X({__name:"BoardLink",props:{link:null},setup(e){const n=Ee(e),i=S(()=>{const a=n.link.value.startNode.position;return n.link.value.offsetStart&&(a.x+=s(n.link.value.offsetStart).x,a.y+=s(n.link.value.offsetStart).y),a}),r=S(()=>{const a=n.link.value.endNode.position;return n.link.value.offsetEnd&&(a.x+=s(n.link.value.offsetEnd).x,a.y+=s(n.link.value.offsetEnd).y),a});return(a,l)=>(I(),T("line",Pt({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Cl))}});var Ml=me(kl,[["__scopeId","data-v-57c4970a"]]);const Sl={key:0},Il=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],xl=["fill","stroke-width","stroke"],$l=["fill"],El=X({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=Ee(e),r=S(()=>pe(i.nodeType.value.size,s(i.node))),a=S(()=>{var b;return(b=pe(i.nodeType.value.outlineColor,s(i.node)))!=null?b:bt[oe.theme].variables["--outline"]}),l=S(()=>{var b;return(b=pe(i.nodeType.value.titleColor,s(i.node)))!=null?b:bt[oe.theme].variables["--foreground"]}),u=S(()=>pe(i.nodeType.value.actionDistance,s(i.node)));function c(b,p){t("clickAction",p.id),b.preventDefault(),b.stopPropagation()}function f(b,p){var w;((w=s(i.selectedAction))==null?void 0:w.id)===p.id&&(b.preventDefault(),b.stopPropagation())}return(b,p)=>(I(),ne(_n,{name:"actions",appear:""},{default:H(()=>[e.isSelected&&e.actions?(I(),T("g",Sl,[(I(!0),T(ae,null,Nn(e.actions,(w,C)=>{var _,N;return I(),T("g",{key:w.id,class:be(["action",{selected:((_=e.selectedAction)==null?void 0:_.id)===w.id}]),transform:`translate( - ${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-C)*s(u))}, - ${(s(r)+30)*Math.cos(((e.actions.length-1)/2-C)*s(u))} - )`,onMousedown:E=>c(E,w),onTouchstart:E=>c(E,w),onMouseup:E=>f(E,w),onTouchend:wn(E=>f(E,w),["stop"])},[k("circle",{fill:s(pe)(w.fillColor,e.node),r:"20","stroke-width":((N=e.selectedAction)==null?void 0:N.id)===w.id?4:0,stroke:s(a)},null,8,xl),k("text",{fill:s(l),class:"material-icons"},re(s(pe)(w.icon,e.node)),9,$l)],42,Il)}),128))])):j("",!0)]),_:1}))}});var Tl=me(El,[["__scopeId","data-v-9efb2a56"]]);const Dl=["transform"],Pl={key:0},Fl=["r","fill","stroke"],Al=["r","fill","stroke"],Ol=["r","fill"],Rl=["r","stroke-dasharray","stroke-dashoffset","stroke"],ql={key:1,transform:"rotate(45, 0, 0)"},Vl=["width","height","transform","fill","stroke"],Ll=["width","height","transform","fill","stroke"],Bl=["width","height","transform","fill"],jl=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],zl=["fill","y"],Ul=["fill"],Gl={key:0},Wl=["fill","y"],Hl=["fill","y"],Zl=X({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},selectedNode:null,selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=Ee(n),a=S(()=>s(r.selectedNode)===s(r.node)),l=S(()=>pe(r.nodeType.value.draggable,s(r.node)));nt(l,W=>{const ye=s(r.node);s(r.dragging)===ye&&!W&&t("endDragging",ye)});const u=S(()=>{var ye;const W=s(r.node);return(ye=pe(r.nodeType.value.actions,W))==null?void 0:ye.filter(ce=>at(pe(ce.visibility,W)))}),c=S(()=>{var ye;const W=s(r.node);if(pe(r.nodeType.value.draggable,W)&&((ye=s(r.dragging))==null?void 0:ye.id)===W.id&&s(r.dragged)!=null){const{x:ce,y:fe}=s(r.dragged);return{x:W.position.x+Math.round(ce/25)*25,y:W.position.y+Math.round(fe/25)*25}}return W.position}),f=S(()=>pe(r.nodeType.value.shape,s(r.node))),b=S(()=>pe(r.nodeType.value.title,s(r.node))),p=S(()=>pe(r.nodeType.value.subtitle,s(r.node))),w=S(()=>{var W;return(W=a.value?s(r.selectedAction)&&pe(s(r.selectedAction).tooltip,s(r.node)):null)!=null?W:pe(r.nodeType.value.label,s(r.node))}),C=S(()=>{var W,ye;return pe((ye=(W=s(r.selectedAction))==null?void 0:W.confirmationLabel)!=null?ye:{text:"Tap again to confirm"},s(r.node))}),_=S(()=>pe(r.nodeType.value.size,s(r.node))),N=S(()=>{var W;return(W=pe(r.nodeType.value.progress,s(r.node)))!=null?W:0}),E=S(()=>bt[oe.theme].variables["--background"]),R=S(()=>{var W;return(W=pe(r.nodeType.value.outlineColor,s(r.node)))!=null?W:bt[oe.theme].variables["--outline"]}),$=S(()=>{var W;return(W=pe(r.nodeType.value.fillColor,s(r.node)))!=null?W:bt[oe.theme].variables["--raised-background"]}),D=S(()=>pe(r.nodeType.value.progressColor,s(r.node))),U=S(()=>{var W;return(W=pe(r.nodeType.value.titleColor,s(r.node)))!=null?W:bt[oe.theme].variables["--foreground"]}),he=S(()=>pe(r.nodeType.value.progressDisplay,s(r.node))),ie=S(()=>r.dragging.value!=null&&s(r.hasDragged)&&pe(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),J=S(()=>pe(r.nodeType.value.style,s(r.node))),Q=S(()=>pe(r.nodeType.value.classes,s(r.node)));function z(W){t("mouseDown",W,r.node.value,l.value)}function de(W){var ye,ce,fe;(ye=r.hasDragged)!=null&&ye.value||(t("endDragging",r.node.value),(fe=(ce=r.nodeType.value).onClick)==null||fe.call(ce,r.node.value),W.stopPropagation())}return(W,ye)=>{var ce,fe,Te;return I(),T("g",{class:be(["boardnode",{[e.node.type]:!0,isSelected:s(a),isDraggable:s(l),...s(Q)}]),style:Ue([{opacity:((ce=e.dragging)==null?void 0:ce.id)===e.node.id&&e.hasDragged?.5:1},(fe=s(J))!=null?fe:[]]),transform:`translate(${s(c).x},${s(c).y})${s(a)?" scale(1.2)":""}`},[g(Tl,{actions:(Te=s(u))!=null?Te:[],"is-selected":s(a),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ye[0]||(ye[0]=He=>t("clickAction",He))},null,8,["actions","is-selected","node","node-type","selected-action"]),k("g",{class:"node-container",onMousedown:z,onTouchstartPassive:z,onMouseup:de,onTouchendPassive:de},[s(f)===s(Ve).Circle?(I(),T("g",Pl,[s(ie)?(I(),T("circle",{key:0,class:"receiver",r:s(_)+8,fill:s(E),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Fl)):j("",!0),k("circle",{class:"body",r:s(_),fill:s($),stroke:s(R),"stroke-width":4},null,8,Al),s(he)===s(ln).Fill?(I(),T("circle",{key:1,class:"progress progressFill",r:Math.max(s(_)*s(N)-2,0),fill:s(D)},null,8,Ol)):(I(),T("circle",{key:2,r:s(_)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(_)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(_)+4.5)*2*Math.PI-s(N)*(s(_)+4.5)*2*Math.PI,stroke:s(D)},null,8,Rl))])):s(f)===s(Ve).Diamond?(I(),T("g",ql,[s(ie)?(I(),T("rect",{key:0,class:"receiver",width:s(_)*s(i)+16,height:s(_)*s(i)+16,transform:`translate(${-(s(_)*s(i)+16)/2}, ${-(s(_)*s(i)+16)/2})`,fill:s(E),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Vl)):j("",!0),k("rect",{class:"body",width:s(_)*s(i),height:s(_)*s(i),transform:`translate(${-s(_)*s(i)/2}, ${-s(_)*s(i)/2})`,fill:s($),stroke:s(R),"stroke-width":4},null,8,Ll),s(he)===s(ln).Fill?(I(),T("rect",{key:1,class:"progress progressFill",width:Math.max(s(_)*s(i)*s(N)-2,0),height:Math.max(s(_)*s(i)*s(N)-2,0),transform:`translate(${-Math.max(s(_)*s(i)*s(N)-2,0)/2}, ${-Math.max(s(_)*s(i)*s(N)-2,0)/2})`,fill:s(D)},null,8,Bl)):(I(),T("rect",{key:2,class:"progress progressDiamond",width:s(_)*s(i)+9,height:s(_)*s(i)+9,transform:`translate(${-(s(_)*s(i)+9)/2}, ${-(s(_)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(_)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(_)*s(i)+9)*4-s(N)*(s(_)*s(i)+9)*4,stroke:s(D)},null,8,jl))])):j("",!0),k("text",{fill:s(U),class:"node-title",y:s(p)?10:0},re(s(b)),9,zl),s(p)?(I(),T("text",{key:2,fill:s(U),class:"node-subtitle",y:"-15"},re(s(p)),9,Ul)):j("",!0)],32),g(_n,{name:"fade",appear:""},{default:H(()=>{var He;return[s(w)?(I(),T("g",Gl,[k("text",{fill:(He=s(w).color)!=null?He:s(U),class:be(["node-title",{pulsing:s(w).pulsing}]),y:-s(_)-20},re(s(w).text),11,Wl)])):j("",!0)]}),_:1}),g(_n,{name:"fade",appear:""},{default:H(()=>{var He;return[s(a)&&e.selectedAction?(I(),T("text",{key:0,fill:(He=s(C).color)!=null?He:s(U),class:be(["node-title",{pulsing:s(C).pulsing}]),y:s(_)+75},re(s(C).text),11,Hl)):j("",!0)]}),_:1})],14,Dl)}}});var Yl=me(Zl,[["__scopeId","data-v-4654be02"]]);const Jl={class:"stage",width:"100%",height:"100%"},Kl={class:"g1"},Xl=X({__name:"Board",props:{nodes:null,types:null,state:null,visibility:null,width:null,height:null,style:null,classes:null,links:null,selectedAction:null,selectedNode:null,draggingNode:null,receivingNode:null,mousePosition:null,setReceivingNode:{type:Function},setDraggingNode:{type:Function}},setup(e){const n=Ee(e),i=B({x:0,y:0}),r=B({x:0,y:0}),a=B(!1),l=B(null),u=S(()=>{const C=n.nodes.value.slice();if(n.draggingNode.value){const _=C.splice(C.indexOf(n.draggingNode.value),1)[0];C.push(_)}return C});pt(()=>{const C=n.draggingNode.value;if(C==null)return null;const _={x:C.position.x+r.value.x,y:C.position.y+r.value.y};let N=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((E,R)=>{if(R.id===C.id)return E;const $=n.types.value[R.type];if(!pe($.canAccept,R,C))return E;const U=Math.pow(_.x-R.position.x,2)+Math.pow(_.y-R.position.y,2);let he=pe($.size,R);return U>N||U>he*he?E:(N=U,R)},null))});function c(C){C.setTransformOrigin(null),C.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function f(C,_=null,N=!1){if(n.draggingNode.value==null){C.preventDefault(),C.stopPropagation();let E,R;if("touches"in C)if(C.touches.length===1)E=C.touches[0].clientX,R=C.touches[0].clientY;else return;else E=C.clientX,R=C.clientY;i.value={x:E,y:R},r.value={x:0,y:0},a.value=!1,N&&n.setDraggingNode.value(_)}_!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function b(C){const{x:_,y:N,scale:E}=l.value.panZoomInstance.getTransform();let R,$;if("touches"in C)if(C.touches.length===1)R=C.touches[0].clientX,$=C.touches[0].clientY;else{p(n.draggingNode.value),n.mousePosition.value=null;return}else R=C.clientX,$=C.clientY;n.mousePosition.value={x:(R-_)/E,y:($-N)/E},r.value={x:r.value.x+(R-i.value.x)/E,y:r.value.y+($-i.value.y)/E},i.value={x:R,y:$},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(C.preventDefault(),C.stopPropagation())}function p(C,_=!1){var N,E;if(n.draggingNode.value!=null&&n.draggingNode.value===C){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(r.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(r.value.y/25)*25);const R=n.nodes.value;R.push(R.splice(R.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((E=(N=n.types.value[n.receivingNode.value.type]).onDrop)==null||E.call(N,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!_&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function w(C,_){n.state.value.selectedAction===_?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:_}}return(C,_)=>{const N=St("panZoom");return s(at)(e.visibility)?(I(),ne(N,{key:0,style:Ue([{width:e.width,height:e.height},e.style]),class:be(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:l,onInit:c,onMousemove:b,onTouchmove:b,onMousedown:_[0]||(_[0]=E=>f(E)),onTouchstart:_[1]||(_[1]=E=>f(E)),onMouseup:_[2]||(_[2]=()=>p(s(e.draggingNode))),onTouchendPassive:_[3]||(_[3]=()=>p(s(e.draggingNode))),onMouseleave:_[4]||(_[4]=()=>p(s(e.draggingNode),!0))},{default:H(()=>[(I(),T("svg",Jl,[k("g",Kl,[g(Li,{name:"link",appear:""},{default:H(()=>[(I(!0),T(ae,null,Nn(s(e.links)||[],E=>(I(),T("g",{key:`${E.startNode.id}-${E.endNode.id}`},[g(Ml,{link:E},null,8,["link"])]))),128))]),_:1}),g(Li,{name:"grow",duration:500,appear:""},{default:H(()=>[(I(!0),T(ae,null,Nn(s(u),E=>{var R;return I(),T("g",{key:E.id,style:{"transition-duration":"0s"}},[g(Yl,{node:E,nodeType:e.types[E.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===E?r.value:void 0,hasDragged:a.value,receivingNode:((R=s(e.receivingNode))==null?void 0:R.id)===E.id,selectedNode:s(e.selectedNode),selectedAction:s(e.selectedAction),onMouseDown:f,onEndDragging:p,onClickAction:$=>w(E,$)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):j("",!0)}}});Ge.on("setupVue",e=>Yr.install(e));const Cr=Symbol("Board");var ln=(e=>(e.Outline="Outline",e.Fill="Fill",e))(ln||{}),Ve=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Ve||{});function Ql(e){const t=tt({nodes:[],selectedNode:null,selectedAction:null},!1);return We(n=>{const i=e.call(n,n);i.id=kn("board-"),i.type=Cr,i[gt]=Xl,i.state?(vr(t),P(i,"state")):(t[Cn]={nodes:i.startNodes().map((u,c)=>(u.id=c,u)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=S(()=>s(l.state).nodes),i.selectedNode=S({get(){return l.nodes.value.find(u=>u.id===s(l.state).selectedNode)||null},set(u){var c,f;De(l.state)?l.state.value={...l.state.value,selectedNode:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedNode=(f=u==null?void 0:u.id)!=null?f:null}}),i.selectedAction=S({get(){const u=l.selectedNode.value;if(u==null)return null;const c=l.types[u.type];return c.actions==null?null:c.actions.find(f=>f.id===s(l.state).selectedAction)||null},set(u){var c,f;De(l.state)?l.state.value={...l.state.value,selectedAction:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedAction=(f=u==null?void 0:u.id)!=null?f:null}}),i.mousePosition=B(null),i.links?P(i,"links"):i.links=S(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?pe(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=B(null),i.receivingNode=B(null),P(i,"visibility"),se(i,"visibility",ke.Visible),P(i,"width"),se(i,"width","100%"),P(i,"height"),se(i,"height","100%"),P(i,"classes"),P(i,"style");for(const u in i.types){const c=i.types[u];if(P(c,"title"),P(c,"subtitle"),P(c,"label"),P(c,"size"),se(c,"size",50),P(c,"style"),P(c,"classes"),P(c,"draggable"),se(c,"draggable",!1),P(c,"shape"),se(c,"shape","Circle"),P(c,"canAccept"),se(c,"canAccept",!1),P(c,"progress"),P(c,"progressDisplay"),se(c,"progressDisplay","Fill"),P(c,"progressColor"),se(c,"progressColor","none"),P(c,"fillColor"),P(c,"outlineColor"),P(c,"titleColor"),P(c,"actionDistance"),se(c,"actionDistance",Math.PI/6),c.nodes=S(()=>s(l.state).nodes.filter(f=>f.type===u)),se(c,"onClick",function(f){s(l.state).selectedNode=f.id}),c.actions)for(const f of c.actions)P(f,"visibility"),se(f,"visibility",ke.Visible),P(f,"icon"),P(f,"fillColor"),P(f,"tooltip"),P(f,"confirmationLabel"),se(f,"confirmationLabel",{text:"Tap again to confirm"}),P(f,"links")}function r(u){i.draggingNode.value=u}function a(u){i.receivingNode.value=u}i.placeInAvailableSpace=function(u,c=100,f=Y.Right){const b=l.nodes.value.slice().filter(p=>p===u||(f===Y.Down||f===Y.Up)&&Math.abs(p.position.x-u.position.x)>c||(f===Y.Left||f===Y.Right)&&Math.abs(p.position.y-u.position.y)>c?!1:!(f===Y.Right&&p.position.xu.position.x+c||f===Y.Up&&p.position.y>u.position.y+c||f===Y.Down&&p.position.yp.position.x-w.position.x:f===Y.Left?(p,w)=>w.position.x-p.position.x:f===Y.Up?(p,w)=>w.position.y-p.position.y:(p,w)=>p.position.y-w.position.y);for(let p=0;p0&&C>c)break}},i[rt]=function(){const{nodes:u,types:c,state:f,visibility:b,width:p,height:w,style:C,classes:_,links:N,selectedAction:E,selectedNode:R,mousePosition:$,draggingNode:D,receivingNode:U}=this;return{nodes:u,types:c,state:f,visibility:b,width:p,height:w,style:s(C),classes:_,links:N,selectedAction:E,selectedNode:R,mousePosition:$,draggingNode:D,receivingNode:U,setDraggingNode:r,setReceivingNode:a}};const l=i;return l})}function pe(e,t,...n){return Qn(e)?e(t,...n):s(e)}function qn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const An={};Ge.on("addLayer",e=>{const t=ki(e,Cr);An[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(a=>{var l;return(l=r.update)==null?void 0:l.call(r,a,n)}))})})});Ge.on("removeLayer",e=>{var t;(t=An[e.id])==null||t.call(An),An[e.id]=void 0});function Si(e,t="points",n=0,i=void 0){const r=De(e)?e:tt(e);if(r.displayName=t,r.precision=n,r.small=i,!De(e)){const a=r[kt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function ii(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?je(e.small?n:o.floor(n)):cn(n,e.precision,e.small)}Ge.on("setupVue",e=>e.use(Jr));function eu(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}}const tu=X({props:{visibility:{type:L(Number,Boolean),required:!0},display:{type:L(Object,String,Function),required:!0},style:L(String,Object,Array),classes:L(Object),glowColor:L(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=Ee(e),a=gr(n),l=S(()=>{const c=Ae(i);return c==null||c===""?{}:s(r)?eu(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:a,glowColorStyle:l,unref:s,Visibility:ke,isVisible:at,isHidden:Mn}}});function nu(e,t,n,i,r,a){var l;return e.isVisible(e.visibility)?(I(),T("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:be(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Ue([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(I(),ne(Le(e.component)))],6)):j("",!0)}var kr=me(tu,[["render",nu],["__scopeId","data-v-21427abb"]]);const iu=X({props:{visibility:{type:L(Number,Boolean),required:!0},activeTab:{type:L(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:L(Object),required:!0},style:L(String,Object,Array),classes:L(Object),buttonContainerStyle:L(String,Object,Array),buttonContainerClasses:L(Object)},components:{Sticky:ni,TabButton:kr},setup(e){const{activeTab:t}=Ee(e),n=S(()=>bt[oe.theme].floatingTabs),i=it("");pt(()=>{const u=Ae(t);if(u==null){i.value="";return}if(yt(u)){i.value=le(u);return}i.value=le(s(u.display))});const r=S(()=>{const u=Ae(t);return yt(u)||!u?void 0:s(u.classes)}),a=S(()=>{const u=Ae(t);return yt(u)||!u?void 0:s(u.style)});function l(u){const{display:c,style:f,classes:b,glowColor:p,visibility:w}=u;return{display:c,style:s(f),classes:b,glowColor:p,visibility:w}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:ke,component:i,gatherButtonProps:l,unref:s,isVisible:at,isHidden:Mn}}});function ru(e,t,n,i,r,a){var c,f;const l=St("TabButton"),u=St("Sticky");return e.isVisible(e.visibility)?(I(),T("div",{key:0,class:be(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Ue([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(f=e.tabStyle)!=null?f:[]])},[g(u,{class:be(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Ue(e.unref(e.buttonContainerStyle))},{default:H(()=>[k("div",{class:be(["tab-buttons",{floating:e.floating}])},[(I(!0),T(ae,null,Nn(e.unref(e.tabs),(b,p)=>(I(),ne(l,Pt({onSelectTab:w=>e.selected.value=p,floating:e.floating,key:p,active:e.unref(b.tab)===e.unref(e.activeTab)},e.gatherButtonProps(b)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(I(),ne(Le(e.unref(e.component)),{key:0})):j("",!0)],6)):j("",!0)}var au=me(iu,[["render",ru],["__scopeId","data-v-58dbf83a"]]);const su=Symbol("TabButton"),ou=Symbol("TabFamily");function lu(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),new Error("Cannot create tab family with 0 tabs");const n=tt(Object.keys(e)[0],!1);return We(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=kn("tabFamily-"),r.type=ou,r[gt]=au,r.tabs=Object.keys(e).reduce((u,c)=>{const f=e[c]();return f.type=su,f[gt]=kr,P(f,"visibility"),se(f,"visibility",ke.Visible),P(f,"tab"),P(f,"display"),P(f,"classes"),P(f,"style"),P(f,"glowColor"),u[c]=f,u},{}),r.selected=n,r.activeTab=S(()=>{const u=s(a.tabs);if(n.value in u&&at(u[n.value].visibility))return s(u[n.value].tab);const c=Object.values(u).find(f=>at(f.visibility));return c?s(c.tab):null}),P(r,"visibility"),se(r,"visibility",ke.Visible),P(r,"classes"),P(r,"style"),P(r,"buttonContainerClasses"),P(r,"buttonContainerStyle"),r[rt]=function(){const{visibility:u,activeTab:c,selected:f,tabs:b,style:p,classes:w,buttonContainerClasses:C,buttonContainerStyle:_}=this;return{visibility:u,activeTab:c,selected:f,tabs:b,style:s(p),classes:w,buttonContainerClasses:C,buttonContainerStyle:_}};const a=r;return a})}const Mr=o.ln(10);function On(e){return e}function uu(e,t){if(F(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function cu(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return m.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function du(e){return m.neg(e)}function fu(e,t,n){if(F(t))return t.invert(o.sub(e,Ne(n)));if(F(n))return n.invert(o.sub(e,Ne(t)));throw new Error("Could not invert due to no input being a variable")}function pu(e,t,n){var i,r;if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.times(n,(i=t.innermostVariable)!=null?i:0).add(a)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function gu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.add(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function mu(e,t,n){if(F(t))return t.invert(o.add(e,Ne(n)));if(F(n))return n.invert(o.sub(Ne(t),e));throw new Error("Could not invert due to no input being a variable")}function vu(e,t,n){var i,r;if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.sub(a,m.times(n,(i=t.innermostVariable)!=null?i:0))}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function hu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.sub(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function bu(e,t,n){if(F(t))return t.invert(o.div(e,Ne(n)));if(F(n))return n.invert(o.div(e,Ne(t)));throw new Error("Could not invert due to no input being a variable")}function yu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.times(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function wu(e,t,n){if(F(t))return m.div(e,n);if(F(n))return m.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function _u(e,t,n){if(F(t))return t.invert(o.mul(e,Ne(n)));if(F(n))return n.invert(o.div(Ne(t),e));throw new Error("Could not invert due to no input being a variable")}function Nu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.div(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Cu(e,t,n){if(F(t))return m.mul(e,n);if(F(n))return m.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function ku(e,t){if(F(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function Mu(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function Su(e,t){if(F(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function Iu(e){return o.ln(e).sub(1).times(e).div(Mr)}function xu(e,t){if(F(t)){const n=Mr.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function $u(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Iu,invert:xu})}throw new Error("Could not integrate due to no input being a variable")}function Eu(e,t,n){if(F(t))return t.invert(o.pow(Ne(n),e));if(F(n))return n.invert(o.root(Ne(t),e));throw new Error("Could not invert due to no input being a variable")}function Tu(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function Du(e,t,n){if(F(t)){const i=o.ln(Ne(n)).times(e);return t.invert(i.div(i.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function Pu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e),n],evaluate:Tu,invert:Du})}throw new Error("Could not integrate due to no input being a variable")}function Fu(e,t){if(F(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function Au(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function Ou(e,t){if(F(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function Ru(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Au,invert:Ou})}throw new Error("Could not integrate due to no input being a variable")}function qu(e,t){if(F(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function Vu(e){return o.ln(e).sub(1).times(e)}function Lu(e,t){if(F(t))return t.invert(o.div(e,o.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function Bu(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Vu,invert:Lu})}throw new Error("Could not integrate due to no input being a variable")}function ju(e,t,n){if(F(t))return t.invert(o.root(e,Ne(n)));if(F(n))return n.invert(o.ln(e).div(o.ln(Ne(t))));throw new Error("Could not invert due to no input being a variable")}function zu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=m.add(n,1);return m.pow(i,r).div(r)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.pow(t,i).div(m.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function Uu(e,t){if(F(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function Gu(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.pow10(n).div(m.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function Wu(e,t,n){if(F(t))return t.invert(o.ln(e).div(Ne(n)));if(F(n))return n.invert(o.root(Ne(t),e));throw new Error("Could not invert due to no input being a variable")}function Hu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(n,i).div(m.ln(n))}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=m.add(t,1);return m.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function Zu(e,t,n){if(F(t))return t.invert(o.root(e,o.recip(Ne(n))));if(F(n))return n.invert(o.ln(Ne(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function Yu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(i,m.recip(n).add(1)).times(n).div(m.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function Ju(e,t){if(F(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function Ku(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function Xu(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function Qu(e,t,n,i){if(F(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function ec(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,i,new o(n))}function tc(e,t,n,i){if(F(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,Ne(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function nc(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function ic(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function rc(e,t,n){if(F(t))return t.invert(o.tetrate(e,o.minabs(1e308,Ne(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function ac(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function sc(e,t,n,i){if(F(t))return t.invert(o.layeradd(e,o.minabs(1e308,Ne(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function oc(e,t){if(F(t))return t.invert(o.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function lc(e,t){if(F(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function uc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function cc(e,t){if(F(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function dc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function fc(e,t){if(F(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function pc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function gc(e,t){if(F(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function mc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function vc(e,t){if(F(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function hc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asin(n).times(n).add(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function bc(e,t){if(F(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function yc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acos(n).times(n).sub(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function wc(e,t){if(F(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function _c(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atan(n).times(n).sub(m.ln(m.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Nc(e,t){if(F(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Cc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function kc(e,t){if(F(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function Mc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function Sc(e,t){if(F(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function Ic(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function xc(e,t){if(F(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function $c(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asinh(n).times(n).sub(m.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function Ec(e,t){if(F(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function Tc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acosh(n).times(n).sub(m.add(n,1).sqrt().times(m.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function Dc(e,t){if(F(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function Pc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atanh(n).times(n).add(m.sub(1,m.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function Sn(e){return(t,n)=>new m({inputs:[t,n],evaluate:e,invert:On})}function F(e){return e instanceof Me&&e.hasVariable()}function Ne(e,t){return e instanceof Me?e.evaluate(t):s(e)}function Fc(){return m.pow(this,2).div(2)}function Ac(){return this}const $e=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"&&kt in n?n[kt]:n)),"variable"in e?(typeof e.variable=="object"&&kt in e.variable&&(e.variable=e.variable[kt]),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:Fc,internalIntegrateInner:Ac,applySubstitution:On}}setupConstant({inputs:e}){if(e.length!==1)throw new Error("Evaluate function is required if inputs is not length 1");return{inputs:e,internalVariables:0}}setupFormula(e){var w,C;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:l}=e,u=t.reduce((_,N)=>_+(N instanceof $e?N.internalVariables:0),0),c=t.find(_=>_ instanceof $e&&_.hasVariable()),f=u===1?c==null?void 0:c.innermostVariable:void 0,b=(w=c==null?void 0:c.isInvertible())!=null?w:!1,p=(C=c==null?void 0:c.isIntegrable())!=null?C:!1;return{inputs:t,internalEvaluate:n,internalInvert:b?i:void 0,internalIntegrate:p?r:void 0,internalIntegrateInner:a,applySubstitution:l,innermostVariable:f,internalVariables:u}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,i;return(i=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(r=>Ne(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:Ne(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof $e&&e.inputs[n]instanceof $e?t.equals(e.inputs[n]):!(t instanceof $e)&&!(e.inputs[n]instanceof $e)&&o.eq(s(t),s(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new m({inputs:[e]})}static variable(e){return new m({variable:e})}static step(e,t,n){const i=B(0),r=n(m.variable(i)),a=_e(t);function l(c){return o.lt(c,s(a))?c:(i.value=o.sub(c,s(a)),o.add(r.evaluate(),s(a)))}function u(c,f){if(F(f)&&r.isInvertible())return o.gt(c,s(a))&&(c=o.add(r.invert(o.sub(c,s(a))),s(a))),f.invert(c);throw new Error("Could not invert due to no input being a variable")}return new m({inputs:[e],evaluate:l,invert:r.isInvertible()&&r.hasVariable()?u:void 0})}static if(e,t,n,i){const r=B(0),a=m.variable(r),l=n(a),u=i==null?void 0:i(a),c=_e(t);function f(p){return s(c)?(r.value=p,l.evaluate()):u?(r.value=p,u.evaluate()):p}function b(p,w){if(!F(w)||!l.isInvertible()||u!=null&&!u.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?w.invert(l.invert(p)):u?w.invert(u.invert(p)):w.invert(p)}return new m({inputs:[e],evaluate:f,invert:l.isInvertible()&&l.hasVariable()?b:void 0})}static conditional(e,t,n,i){return m.if(e,t,n,i)}static abs(e){return new m({inputs:[e],evaluate:o.abs})}static neg(e){return new m({inputs:[e],evaluate:o.neg,invert:uu,applySubstitution:du,integrate:cu})}static sign(e){return new m({inputs:[e],evaluate:o.sign})}static round(e){return new m({inputs:[e],evaluate:o.round})}static floor(e){return new m({inputs:[e],evaluate:o.floor})}static ceil(e){return new m({inputs:[e],evaluate:o.ceil})}static trunc(e){return new m({inputs:[e],evaluate:o.trunc})}static add(e,t){return new m({inputs:[e,t],evaluate:o.add,invert:fu,integrate:pu,integrateInner:gu,applySubstitution:On})}static sub(e,t){return new m({inputs:[e,t],evaluate:o.sub,invert:mu,integrate:vu,integrateInner:hu,applySubstitution:On})}static mul(e,t){return new m({inputs:[e,t],evaluate:o.mul,invert:bu,integrate:yu,applySubstitution:wu})}static div(e,t){return new m({inputs:[e,t],evaluate:o.div,invert:_u,integrate:Nu,applySubstitution:Cu})}static recip(e){return new m({inputs:[e],evaluate:o.recip,invert:ku,integrate:Mu})}static clamp(e,t,n){return new m({inputs:[e,t,n],evaluate:o.clamp,invert:On})}static pLog10(e){return new m({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new m({inputs:[e],evaluate:o.absLog10})}static log10(e){return new m({inputs:[e],evaluate:o.log10,invert:Su,integrate:$u})}static log(e,t){return new m({inputs:[e,t],evaluate:o.log,invert:Eu,integrate:Pu})}static log2(e){return new m({inputs:[e],evaluate:o.log2,invert:Fu,integrate:Ru})}static ln(e){return new m({inputs:[e],evaluate:o.ln,invert:qu,integrate:Bu})}static pow(e,t){return new m({inputs:[e,t],evaluate:o.pow,invert:ju,integrate:zu})}static pow10(e){return new m({inputs:[e],evaluate:o.pow10,invert:Uu,integrate:Gu})}static pow_base(e,t){return new m({inputs:[e,t],evaluate:o.pow_base,invert:Wu,integrate:Hu})}static root(e,t){return new m({inputs:[e,t],evaluate:o.root,invert:Zu,integrate:Yu})}static factorial(e){return new m({inputs:[e],evaluate:o.factorial})}static gamma(e){return new m({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new m({inputs:[e],evaluate:o.lngamma})}static exp(e){return new m({inputs:[e],evaluate:o.exp,invert:Ju,integrate:Ku})}static sqr(e){return m.pow(e,2)}static sqrt(e){return m.root(e,2)}static cube(e){return m.pow(e,3)}static cbrt(e){return m.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:Xu,invert:Qu})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:ec,invert:tc})}static iteratedlog(e,t=10,n=1){return new m({inputs:[e,t,n],evaluate:nc})}static slog(e,t=10){return new m({inputs:[e,t],evaluate:ic,invert:rc})}static layeradd10(e,t){return new m({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new m({inputs:[e,t,n],evaluate:ac,invert:sc})}static lambertw(e){return new m({inputs:[e],evaluate:o.lambertw,invert:oc})}static ssqrt(e){return new m({inputs:[e],evaluate:o.ssqrt,invert:lc})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:uc})}static sin(e){return new m({inputs:[e],evaluate:o.sin,invert:vc,integrate:dc})}static cos(e){return new m({inputs:[e],evaluate:o.cos,invert:bc,integrate:pc})}static tan(e){return new m({inputs:[e],evaluate:o.tan,invert:wc,integrate:mc})}static asin(e){return new m({inputs:[e],evaluate:o.asin,invert:cc,integrate:hc})}static acos(e){return new m({inputs:[e],evaluate:o.acos,invert:fc,integrate:yc})}static atan(e){return new m({inputs:[e],evaluate:o.atan,invert:gc,integrate:_c})}static sinh(e){return new m({inputs:[e],evaluate:o.sinh,invert:xc,integrate:Cc})}static cosh(e){return new m({inputs:[e],evaluate:o.cosh,invert:Ec,integrate:Mc})}static tanh(e){return new m({inputs:[e],evaluate:o.tanh,invert:Dc,integrate:Ic})}static asinh(e){return new m({inputs:[e],evaluate:o.asinh,invert:Nc,integrate:$c})}static acosh(e){return new m({inputs:[e],evaluate:o.acosh,invert:kc,integrate:Tc})}static atanh(e){return new m({inputs:[e],evaluate:o.atanh,invert:Sc,integrate:Pc})}step(e,t){return m.step(this,e,t)}if(e,t){return m.if(this,e,t)}conditional(e,t){return m.if(this,e,t)}abs(){return m.abs(this)}neg(){return m.neg(this)}sign(){return m.sign(this)}round(){return m.round(this)}floor(){return m.floor(this)}ceil(){return m.ceil(this)}trunc(){return m.trunc(this)}add(e){return m.add(this,e)}sub(e){return m.sub(this,e)}mul(e){return m.mul(this,e)}div(e){return m.div(this,e)}recip(){return m.recip(this)}max(e){return m.max(this,e)}min(e){return m.min(this,e)}maxabs(e){return m.maxabs(this,e)}minabs(e){return m.minabs(this,e)}clamp(e,t){return m.clamp(this,e,t)}clampMin(e){return m.clampMin(this,e)}clampMax(e){return m.clampMax(this,e)}pLog10(){return m.pLog10(this)}absLog10(){return m.absLog10(this)}log10(){return m.log10(this)}log(e){return m.log(this,e)}log2(){return m.log2(this)}ln(){return m.ln(this)}pow(e){return m.pow(this,e)}pow10(){return m.pow10(this)}pow_base(e){return m.pow_base(this,e)}root(e){return m.root(this,e)}factorial(){return m.factorial(this)}gamma(){return m.gamma(this)}lngamma(){return m.lngamma(this)}exp(){return m.exp(this)}sqr(){return m.pow(this,2)}sqrt(){return m.root(this,2)}cube(){return m.pow(this,3)}cbrt(){return m.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return m.iteratedlog(this,e,t)}slog(e=10){return m.slog(this,e)}layeradd10(e){return m.layeradd10(this,e)}layeradd(e,t){return m.layeradd(this,e,t)}lambertw(){return m.lambertw(this)}ssqrt(){return m.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.pentate(this,e,t)}sin(){return m.sin(this)}cos(){return m.cos(this)}tan(){return m.tan(this)}asin(){return m.asin(this)}acos(){return m.acos(this)}atan(){return m.atan(this)}sinh(){return m.sinh(this)}cosh(){return m.cosh(this)}tanh(){return m.tanh(this)}asinh(){return m.asinh(this)}acosh(){return m.acosh(this)}atanh(){return m.atanh(this)}};let Me=$e;Me.negate=$e.neg;Me.negated=$e.neg;Me.sgn=$e.sign;Me.plus=$e.add;Me.subtract=$e.sub;Me.minus=$e.sub;Me.multiply=$e.mul;Me.times=$e.mul;Me.divide=$e.div;Me.divideBy=$e.div;Me.dividedBy=$e.div;Me.reciprocal=$e.recip;Me.reciprocate=$e.recip;Me.max=Sn(o.max);Me.min=Sn(o.min);Me.minabs=Sn(o.minabs);Me.maxabs=Sn(o.maxabs);Me.clampMin=Sn(o.clampMin);Me.clampMax=Sn(o.clampMax);Me.logarithm=$e.log;class m extends Me{invert(t){if(this.internalInvert&&this.hasVariable())return this.internalInvert.call(this,t,...this.inputs);if(this.inputs.length===1&&this.hasVariable())return t;throw new Error("Cannot invert non-invertible formula")}evaluateIntegral(t){if(!this.isIntegrable())throw new Error("Cannot evaluate integral of formula without integral");return this.getIntegralFormula().evaluate(t)}invertIntegral(t){if(!this.isIntegrable()||!this.getIntegralFormula().isInvertible())throw new Error("Cannot invert integral of formula without invertible integral");return this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.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)throw new Error("Cannot integrate formula with non-integrable operation");let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(i=>n=i(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 throw new Error("Cannot integrate formula without variable");return this.integralFormula}else{if(this.applySubstitution==null)throw new Error("Cannot have two complex operations in an integrable formula");if(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner)return this.internalIntegrateInner.call(this,t,...this.inputs);if(this.internalIntegrate)return this.internalIntegrate.call(this,t,...this.inputs);if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())return this;throw new Error("Cannot integrate formula without variable")}}}function Oc(e,t,n=!0,i){const r=_e(n);return S(()=>{var l,u;let a;if(s(r)){if(!e.isIntegrable()||!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");a=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((l=s(e.innermostVariable))!=null?l:0),i==null&&(i=10)}else{if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula");a=o.floor(e.invert(t.value)),i==null&&(i=0)}if(i>0&&o.lt(Jt(e,a,!0,0),1e308)){a=a.sub(i).clampMin(0);let c=Jt(e,a,!0,0);for(;;){const f=e.evaluate(a.add((u=s(e.innermostVariable))!=null?u:0));if(o.add(c,f).lte(t.value))a=a.add(1),c=o.add(c,f);else break}}return a})}function Jt(e,t,n=!0,i){var c;const r=(c=s(e.innermostVariable))!=null?c:0;let a=o.add(t,r);const l=a;i!=null||(i=n?10:0),a=a.sub(i).clampMin(r);let u=0;if(n){if(o.gt(t,i)){if(!e.isIntegrable())throw new Error("Cannot calculate cost with spending resources of non-integrable formula");u=o.sub(e.evaluateIntegral(a),e.evaluateIntegral())}if(l.gt(1e308))return o.add(u,o.sub(l,a).times(e.evaluate(a)));for(let f=a.toNumber();f{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=_e(n),u=_e(i),c=r==null?void 0:_e(r);return{apply:f=>o.add(f,s(l)),invert:f=>o.sub(f,s(l)),getFormula:f=>m.add(f,l),enabled:c,description:i==null?void 0:te(()=>g("div",{class:"modifier-container"},[s(u)!=null?g("span",{class:"modifier-description"},[mt(s(u))]):null,g("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),0):o.lt(s(l),0))?"color: var(--danger)":""},[o.gte(s(l),0)?"+":"",Zt(s(l))])]))}})}function Re(e){return We(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=_e(n),u=_e(i),c=r==null?void 0:_e(r);return{apply:f=>o.times(f,s(l)),invert:f=>o.div(f,s(l)),getFormula:f=>m.times(f,l),enabled:c,description:i==null?void 0:te(()=>g("div",{class:"modifier-container"},[s(u)!=null?g("span",{class:"modifier-description"},[mt(s(u))]):null,g("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[O("\xD7"),Zt(s(l))])]))}})}function Yi(e){return We(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:l}=e.call(t,t),u=_e(n),c=_e(i),f=r==null?void 0:_e(r);return{apply:b=>{let p=b;return a&&(p=o.add(p,1)),p=o.pow(p,s(u)),a&&(p=o.sub(p,1)),p},invert:b=>{let p=b;return a&&(p=o.add(p,1)),p=o.root(p,s(u)),a&&(p=o.sub(p,1)),p},getFormula:b=>a?m.add(b,1).pow(u).sub(1):m.pow(b,u),enabled:f,description:i==null?void 0:te(()=>g("div",{class:"modifier-container"},[s(c)!=null?g("span",{class:"modifier-description"},[mt(s(c)),a?" (+1 effective)":null]):null,g("span",{class:"modifier-amount",style:(l===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[O("^"),Zt(s(u))])]))}})}function Nt(e){return We(()=>{const t=e();return{apply:n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?S(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?te(()=>g(ae,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(mt)])):void 0}})}const Rc={key:0},qc={key:0,class:"mark star"},Vc=["src"],Lc=X({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(I(),T("div",Rc,[e.mark===!0?(I(),T("div",qc)):(I(),T("img",{key:1,class:"mark",src:e.mark},null,8,Vc))])):j("",!0)}});var li=me(Lc,[["__scopeId","data-v-2207999f"]]);const Bc=X({__name:"Node",props:{id:null},setup(e){const n=Ee(e),i=Kn(Ei,()=>{}),r=Kn(Ti,()=>{}),a=it(null),l=S(()=>a.value&&a.value.parentElement);return nt([l,n.id],([u,c],[f,b])=>{f&&r(s(b)),u&&i(c,u)}),nr(()=>r(s(n.id))),(u,c)=>(I(),T("div",{class:"node",ref_key:"node",ref:a},null,512))}});var ui=me(Bc,[["__scopeId","data-v-a48cb382"]]),jc=X({props:{display:{type:L(Object,String,Function),required:!0},visibility:{type:L(Number,Boolean),required:!0},style:L(Object,String,Array),classes:L(Object),onClick:Function,onHold:Function,canClick:{type:L(Boolean),required:!0},small:Boolean,mark:L(Boolean,String),id:{type:String,required:!0}},components:{Node:ui,MarkNode:li},setup(e){const{display:t,onClick:n,onHold:i}=Ee(e),r=it("");pt(()=>{var b;const u=Ae(t);if(u==null){r.value="";return}if(yt(u)){r.value=le(u);return}const c=le((b=u.title)!=null?b:"","h3"),f=le(u.description,"div");r.value=le(te(()=>g("span",null,[u.title!=null?g("div",null,[g(c,null,null)]):null,g(f,null,null)])))});const{start:a,stop:l}=pr(n,i);return{start:a,stop:l,comp:r,Visibility:ke,isVisible:at,isHidden:Mn,unref:s}}});function zc(e,t,n,i,r,a){var c;const l=St("MarkNode"),u=St("Node");return e.isVisible(e.visibility)?(I(),T("button",{key:0,style:Ue([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...f)=>e.onClick&&e.onClick(...f)),onMousedown:t[1]||(t[1]=(...f)=>e.start&&e.start(...f)),onMouseleave:t[2]||(t[2]=(...f)=>e.stop&&e.stop(...f)),onMouseup:t[3]||(t[3]=(...f)=>e.stop&&e.stop(...f)),onTouchstartPassive:t[4]||(t[4]=(...f)=>e.start&&e.start(...f)),onTouchendPassive:t[5]||(t[5]=(...f)=>e.stop&&e.stop(...f)),onTouchcancelPassive:t[6]||(t[6]=(...f)=>e.stop&&e.stop(...f)),class:be({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)?(I(),ne(Le(e.unref(e.comp)),{key:0})):j("",!0),g(l,{mark:e.unref(e.mark)},null,8,["mark"]),g(u,{id:e.id},null,8,["id"])],38)):j("",!0)}var Sr=me(jc,[["render",zc],["__scopeId","data-v-211328c0"]]);const Uc=Symbol("Clickable");function Gc(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return We(i=>{var l,u,c;const r=(l=e==null?void 0:e.call(i,i))!=null?l:{};r.id=kn("clickable-"),r.type=Uc,r[gt]=Sr;for(const f of t)(u=f.preConstruct)==null||u.call(f,r);if(Object.assign(r,n),P(r,"visibility"),se(r,"visibility",ke.Visible),P(r,"canClick"),se(r,"canClick",!0),P(r,"classes"),P(r,"style"),P(r,"mark"),P(r,"display"),r.onClick){const f=r.onClick.bind(r);r.onClick=function(b){s(r.canClick)!==!1&&f(b)}}if(r.onHold){const f=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&f()}}for(const f of t)(c=f.postConstruct)==null||c.call(f,r);const a=t.reduce((f,b)=>{var p;return Object.assign(f,(p=b.getGatheredProps)==null?void 0:p.call(b,r))},{});return r[rt]=function(){const{display:f,visibility:b,style:p,classes:w,onClick:C,onHold:_,canClick:N,small:E,mark:R,id:$}=this;return{display:f,visibility:b,style:s(p),classes:w,onClick:C,onHold:_,canClick:N,small:E,mark:R,id:$,...a}},r})}const Wc=["x1","y1","x2","y2"],Hc=X({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Ee(e),i=S(()=>{const a=n.startNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetStart&&(u.x+=n.link.value.offsetStart.x,u.y+=n.link.value.offsetStart.y),u}),r=S(()=>{const a=n.endNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetEnd&&(u.x+=n.link.value.offsetEnd.x,u.y+=n.link.value.offsetEnd.y),u});return(a,l)=>(I(),T("line",Pt({"stroke-width":"15px",stroke:"white"},e.link,{x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Wc))}});const Zc=X({__name:"Links",props:{links:null},setup(e){var c;const n=Kt(e,"links"),i=B(null),r=Kn(Di,B({})),a=Kn(Pi,B(void 0)),l=B((c=i.value)==null?void 0:c.getBoundingClientRect());nt(a,()=>{var f;return l.value=(f=i.value)==null?void 0:f.getBoundingClientRect()}),ai(()=>{var f;return l.value=(f=i.value)==null?void 0:f.getBoundingClientRect()});const u=S(()=>{var b,p;const f=r.value;return(p=(b=n.value)==null?void 0:b.filter(w=>{var C,_;return((C=f[w.startNode.id])==null?void 0:C.rect)&&((_=f[w.startNode.id])==null?void 0:_.rect)}))!=null?p:[]});return(f,b)=>(I(),T(ae,null,[s(u)?(I(),T("svg",zr(Pt({key:0},f.$attrs)),[(I(!0),T(ae,null,Nn(s(u),(p,w)=>(I(),ne(Hc,{key:w,link:p,boundingRect:l.value,startNode:s(r)[p.startNode.id],endNode:s(r)[p.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):j("",!0),k("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Yc=me(Zc,[["__scopeId","data-v-063f6d6b"]]);X({props:{nodes:{type:L(Array),required:!0},leftSideNodes:L(Array),rightSideNodes:L(Array),branches:L(Array)},components:{Links:Yc},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Ee(e),r=it();pt(()=>{const u=Ae(t);r.value=le(te(()=>g(ae,null,[u.map(c=>g("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(mt)]))])))});const a=it();pt(()=>{const u=Ae(n);a.value=u?le(te(()=>g("span",{class:"left-side-nodes small"},[u.map(mt)]))):""});const l=it();return pt(()=>{const u=Ae(i);l.value=u?le(te(()=>g("span",{class:"side-nodes small"},[u.map(mt)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:l}}});X({props:{display:L(Object,String,Function),visibility:{type:L(Number,Boolean),required:!0},style:L(String,Object,Array),classes:L(Object),onClick:Function,onHold:Function,color:L(String),glowColor:L(String),canClick:{type:L(Boolean),required:!0},mark:L(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:li,Node:ui},setup(e){const{onClick:t,onHold:n,display:i}=Ee(e),r=jn(i),{start:a,stop:l}=pr(t,n);return{start:a,stop:l,comp:r,unref:s,Visibility:ke,isCoercableComponent:yt,isVisible:at,isHidden:Mn}}});function Rn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(u=>_e(u.base)),n.baseText=t.map(u=>_e(u.baseText)),n.visible=t.map(u=>_e(u.visible)),n.title=t.map(u=>_e(u.title)),n.subtitle=t.map(u=>_e(u.subtitle)),i=!0),t}const a=tt({},!1);return[te(()=>{const u=r();let c=!0;const f=u.map((b,p)=>{var R,$,D;if(s(n.visible[p])===!1)return null;const w=g("h3",{onClick:()=>a.value[p]=!a.value[p],style:"cursor: pointer"},[g("span",{class:"modifier-toggle"+(s(a.value[p])?" collapsed":"")},[O("\u25BC")]),s(n.title[p]),s(n.subtitle[p])!=null?g("span",{class:"subtitle"},[O(" ("),s(n.subtitle[p]),O(")")]):null]),C=s(a.value[p])?null:g(ae,null,[g("div",{class:"modifier-container"},[g("span",{class:"modifier-description"},[mt((R=s(n.baseText[p]))!=null?R:"Base")]),g("span",{class:"modifier-amount"},[cn(($=s(n.base[p]))!=null?$:1),b.unit])]),b.modifier.description==null?null:mt(s(b.modifier.description))]),_=!c;c=!1;const N=(D=s(n.base[p]))!=null?D:1,E=b.modifier.apply(N);return g(ae,null,[_?g("br",null,null):null,g("div",{style:{"--unit":oe.alignUnits&&b.unit!=null?"'"+b.unit+"'":""}},[w,g("br",null,null),C,g("hr",null,null),g("div",{class:"modifier-container"},[g("span",{class:"modifier-description"},[O("Total")]),g("span",{class:"modifier-amount",style:(b.smallerIsBetter===!0?o.gt(E,N!=null?N:1):o.lt(E,N!=null?N:1))?"color: var(--danger)":""},[Zt(E),b.unit])])])])});return g(ae,null,[f])}),a]}function Ji(e,t,n){const i=_e(t),r=_e(n);return S(()=>{const a=s(i),l=s(r);return o.gte(e.value,l)?"Now":o.lte(a,0)?"Never":oi(o.sub(l,e.value).div(a))})}function hn(e,t,n=1){const i=_e(t),r=_e(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return te(()=>{var a;if(s(i)){const l=Zt(e.evaluate()),u=Zt(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return g(ae,null,[g("b",null,[g("i",null,[l,O(" \u2192 "),u])])])}return g(ae,null,[Zt(e.evaluate())])})}const Jc=X({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(I(),T("div",{style:Ue({width:e.width,height:e.height})},null,4))}});function bi(e){return We(t=>{const n=e.call(t,t);if(n.partialDisplay=i=>g("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[ii(n.resource,n.cost instanceof m?Jt(n.cost,i!=null?i:1,s(n.spendResources)):s(n.cost))," ",n.resource.displayName]),n.display=i=>g("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",ii(n.resource,n.cost instanceof m?Jt(n.cost,i!=null?i:1,s(n.spendResources)):s(n.cost))," ",n.resource.displayName]),P(n,"visibility"),se(n,"visibility",ke.Visible),P(n,"cost"),P(n,"requiresPay"),se(n,"requiresPay",!0),P(n,"spendResources"),se(n,"spendResources",!0),se(n,"pay",function(i){const r=n.cost instanceof m?Jt(n.cost,i!=null?i:1,s(n.spendResources)):s(n.cost);n.resource.value=o.sub(n.resource.value,r).max(0)}),n.canMaximize=S(()=>n.cost instanceof m&&n.cost.isInvertible()&&(s(n.spendResources)===!1||n.cost.isIntegrable())),n.cost instanceof m&&n.cost.isInvertible()){const i=Oc(n.cost,n.resource,s(n.spendResources));n.requirementMet=S(()=>s(n.canMaximize)?i.value:n.cost instanceof m?o.gte(n.resource.value,n.cost.evaluate()):o.gte(n.resource.value,s(n.cost)))}else n.requirementMet=S(()=>n.cost instanceof m?o.gte(n.resource.value,n.cost.evaluate()):o.gte(n.resource.value,s(n.cost)));return n})}function qi(e){return We(()=>({requirementMet:S(()=>at(e.visibility)),visibility:ke.None,requiresPay:!1}))}function Kc(e,t){return We(()=>({requirementMet:_e(e),partialDisplay:t==null?void 0:te(()=>mt(t)),display:t==null?void 0:te(()=>g(ae,null,[O("Req: "),mt(t)])),visibility:t==null?ke.None:ke.Visible,requiresPay:!1}))}function ci(e){if(Mt(e))return e.every(ci);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function Ir(e){if(Mt(e))return e.map(Ir).reduce(o.min);const t=s(e.requirementMet);return typeof t=="boolean"?t?o.dInf:0:o.gt(t,1)&&s(e.canMaximize)!==!0?1:t}function di(e,t=1){var n,i;if(Mt(e)&&(e=e.filter(r=>at(r.visibility)),e.length===1&&(e=e[0])),Mt(e)){e=e.filter(l=>"partialDisplay"in l);const r=e.filter(l=>s(l.requiresPay)),a=e.filter(l=>!s(l.requiresPay));return g(ae,null,[r.length>0?g("div",null,[O("Costs:")," ",Hi(r.map(l=>l.partialDisplay(t)),g(ae,null,[O(", ")]))]):null,a.length>0?g("div",null,[O("Requires:")," ",Hi(a.map(l=>l.partialDisplay(t)),g(ae,null,[O(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:g(ae,null,null)}function xr(e,t=1){var n;Mt(e)?e.filter(i=>s(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):s(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var Xc=X({props:{visibility:{type:L(Number,Boolean),required:!0},display:L(Object,String,Function),earned:{type:L(Boolean),required:!0},requirements:L(Object,Array),image:L(String),style:L(String,Object,Array),classes:L(Object),mark:L(Boolean,String),small:L(Boolean),id:{type:String,required:!0}},components:{Node:ui,MarkNode:li},setup(e){const{display:t,requirements:n,earned:i}=Ee(e),r=it("");return pt(()=>{const a=Ae(t);if(a==null){r.value="";return}if(yt(a)){r.value=le(a);return}const l=le(a.requirement?a.requirement:te(()=>{var f;return di((f=Ae(n))!=null?f:[])}),"h3"),u=le(a.effectDisplay||"","b"),c=Ae(i)?le(a.optionsDisplay||"","span"):"";r.value=le(te(()=>g("span",null,[g(l,null,null),a.effectDisplay!=null?g("div",null,[g(u,null,null)]):null,a.optionsDisplay!=null?g("div",{class:"equal-spaced"},[g(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:ke,isVisible:at,isHidden:Mn}}});function Qc(e,t,n,i,r,a){var c;const l=St("MarkNode"),u=St("Node");return e.isVisible(e.visibility)?(I(),T("div",{key:0,style:Ue([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:be({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?(I(),ne(Le(e.comp),{key:0})):j("",!0),g(l,{mark:e.unref(e.mark)},null,8,["mark"]),g(u,{id:e.id},null,8,["id"])],6)):j("",!0)}var ed=me(Xc,[["render",Qc],["__scopeId","data-v-5673325a"]]);const td=si(),nd=Symbol("Achievement");let bn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function id(e,...t){const n=tt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return We(r=>{var c,f,b;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=kn("achievement-"),a.type=nd,a[gt]=ed;for(const p of t)(f=p.preConstruct)==null||f.call(p,a);a.earned=n,a.complete=function(){var w,C;n.value=!0;const p=a;if((w=p.onComplete)==null||w.call(p),p.display!=null&&s(p.showPopups)===!0){const _=s(p.display);let N;yt(_)?N=le(_):_.requirement!=null?N=le(_.requirement):N=di((C=p.requirements)!=null?C:[]),td.info(g("div",null,[g("h3",null,[O("Achievement earned!")]),g("div",null,[g(N,null,null)])]))}},Object.assign(a,i),P(a,"visibility"),se(a,"visibility",ke.Visible);const l=a.visibility;a.visibility=Ur(()=>{const p=s(a.display);switch(oe.msDisplay){default:case bn.All:return s(l);case bn.Configurable:return s(a.earned)&&!(p!=null&&typeof p=="object"&&"optionsDisplay"in p)?ke.None:s(l);case bn.Incomplete:return s(a.earned)?ke.None:s(l);case bn.None:return ke.None}}),P(a,"display"),P(a,"mark"),P(a,"small"),P(a,"image"),P(a,"style"),P(a,"classes"),P(a,"showPopups"),se(a,"showPopups",!0);for(const p of t)(b=p.postConstruct)==null||b.call(p,a);const u=t.reduce((p,w)=>{var C;return Object.assign(p,(C=w.getGatheredProps)==null?void 0:C.call(w,a))},{});if(a[rt]=function(){const{visibility:p,display:w,requirements:C,earned:_,image:N,style:E,classes:R,mark:$,small:D,id:U}=this;return{visibility:p,display:w,requirements:C,earned:_,image:N,style:s(E),classes:R,mark:$,small:D,id:U,...u}},a.requirements){const p=a,w=[qi(p),Kc(()=>!p.earned.value),...Mt(a.requirements)?a.requirements:[a.requirements]];pt(()=>{oe.active===K.id&&ci(w)&&p.complete()})}return a})}Ge.on("loadSettings",e=>{se(e,"msDisplay",bn.All)});const rd=Object.values(bn).map(e=>({label:ze(e),value:e}));is(te(()=>g(Oi,{title:te(()=>g("span",{class:"option-title"},[O("Show achievements"),g("desc",null,[O("Select which achievements to display based on criterias.")])])),options:rd,"onUpdate:modelValue":e=>oe.msDisplay=e,modelValue:oe.msDisplay},null)));const $r=Symbol("Repeatable");function ad(e,...t){const n=tt(0),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return We(r=>{var w,C,_;const a=e.call(r,r);a.id=kn("repeatable-"),a.type=$r,a[gt]=Sr;for(const N of t)(w=N.preConstruct)==null||w.call(N,a);a.amount=n,a.amount[Cn]=(C=a.initialAmount)!=null?C:0,Object.assign(a,i);const l={requirementMet:S(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:ke.None},u=qi(a);Mt(a.requirements)?(a.requirements.unshift(u),a.requirements.push(l)):a.requirements=[u,a.requirements,l],a.maxed=S(()=>o.gte(a.amount.value,s(a.limit))),P(a,"classes");const c=a.classes;a.classes=S(()=>{const N=s(c)||{};return a.maxed.value&&(N.bought=!0),N}),a.amountToIncrease=S(()=>s(a.maximize)?Ir(a.requirements):1),a.canClick=S(()=>ci(a.requirements));const f=a.onClick;a.onClick=function(N){const E=a;!s(E.canClick)||(xr(a.requirements,s(a.amountToIncrease)),E.amount.value=o.add(E.amount.value,1),f==null||f(N))},P(a,"display");const b=a.display;a.display=te(()=>{var E,R,$;const N=s(b);if(yt(N)){const D=le(N);return g(D,null,null)}if(N!=null){const D=a,U=le((E=N.title)!=null?E:"","h3"),he=le((R=N.description)!=null?R:""),ie=le(($=N.effectDisplay)!=null?$:"");return g("span",null,[N.title==null?null:g("div",null,[g(U,null,null)]),N.description==null?null:g(he,null,null),N.showAmount===!1?null:g("div",null,[g("br",null,null),g(ae,null,[O("Amount: "),je(D.amount.value)]),o.isFinite(s(D.limit))?g(ae,null,[O(" / "),je(s(D.limit))]):void 0]),N.effectDisplay==null?null:g("div",null,[g("br",null,null),O("Currently: "),g(ie,null,null)]),D.maxed.value?null:g("div",null,[g("br",null,null),di(D.requirements,s(a.amountToIncrease))])])}return""}),P(a,"visibility"),se(a,"visibility",ke.Visible),P(a,"limit"),se(a,"limit",o.dInf),P(a,"style"),P(a,"mark"),P(a,"small"),P(a,"maximize");for(const N of t)(_=N.postConstruct)==null||_.call(N,a);const p=t.reduce((N,E)=>{var R;return Object.assign(N,(R=E.getGatheredProps)==null?void 0:R.call(E,a))},{});return a[rt]=function(){const{display:N,visibility:E,style:R,classes:$,onClick:D,canClick:U,small:he,mark:ie,id:J}=this;return{display:N,visibility:E,style:s(R),classes:$,onClick:D,canClick:U,small:he,mark:ie,id:J,...p}},a})}function Ki(e,t){return P(t,"display"),P(t,"classes"),P(t,"style"),P(t,"direction"),se(t,"direction",Y.Up),P(t,"xoffset"),P(t,"yoffset"),t.pinnable&&(t.pinned=tt(!1,!1)),Dt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,vr(t.pinned)):e.pinned=t.pinned);const n=e[gt];e[gt]=xe;const i=e[rt].bind(e);e[rt]=function(){const{display:a,classes:l,style:u,direction:c,xoffset:f,yoffset:b,pinned:p}=this;return{element:{[gt]:n,[rt]:i},display:a,classes:l,style:s(u),direction:c,xoffset:f,yoffset:b,pinned:p}}.bind(t)}),t}var sd=X({props:{display:{type:L(String,Object,Function),required:!0},visibility:{type:L(Number,Boolean),required:!0},style:L(String,Object,Array),classes:L(Object),requirements:{type:Object,required:!0},canPurchase:{type:L(Boolean),required:!0},bought:{type:L(Boolean),required:!0},mark:L(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:ui,MarkNode:li},setup(e){const{display:t,requirements:n,bought:i}=Ee(e),r=it("");return pt(()=>{const a=Ae(t);if(a==null){r.value="";return}if(yt(a)){r.value=le(a);return}const l=le(a.title||"","h3"),u=le(a.description,"div"),c=le(a.effectDisplay||"");r.value=le(te(()=>g("span",null,[a.title!=null?g("div",null,[g(l,null,null)]):null,g(u,null,null),a.effectDisplay!=null?g("div",null,[O("Currently: "),g(c,null,null)]):null,i.value?null:g(ae,null,[g("br",null,null),di(n.value)])])))}),{component:r,unref:s,Visibility:ke,isVisible:at,isHidden:Mn}}});const od=["disabled"];function ld(e,t,n,i,r,a){var c;const l=St("MarkNode"),u=St("Node");return e.isVisible(e.visibility)?(I(),T("button",{key:0,style:Ue([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...f)=>e.purchase&&e.purchase(...f)),class:be({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)?(I(),ne(Le(e.unref(e.component)),{key:0})):j("",!0),g(l,{mark:e.unref(e.mark)},null,8,["mark"]),g(u,{id:e.id},null,8,["id"])],14,od)):j("",!0)}var ud=me(sd,[["render",ld],["__scopeId","data-v-9be6bac0"]]);const Er=Symbol("Upgrade");function cd(e,...t){const n=tt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return We(r=>{var c,f;const a=e.call(r,r);a.id=kn("upgrade-"),a.type=Er,a[gt]=ud;for(const b of t)(c=b.preConstruct)==null||c.call(b,a);a.bought=n,Object.assign(a,i),a.canPurchase=S(()=>!n.value&&ci(a.requirements)),a.purchase=function(){var p;const b=a;!s(b.canPurchase)||(xr(a.requirements),n.value=!0,(p=b.onPurchase)==null||p.call(b))};const l=qi(a);Mt(a.requirements)?a.requirements.unshift(l):a.requirements=[l,a.requirements],P(a,"visibility"),se(a,"visibility",ke.Visible),P(a,"classes"),P(a,"style"),P(a,"display"),P(a,"mark");for(const b of t)(f=b.postConstruct)==null||f.call(b,a);const u=t.reduce((b,p)=>{var w;return Object.assign(b,(w=p.getGatheredProps)==null?void 0:w.call(p,a))},{});return a[rt]=function(){const{display:b,visibility:p,style:w,classes:C,requirements:_,canPurchase:N,bought:E,mark:R,id:$,purchase:D}=this;return{display:b,visibility:p,style:s(w),classes:C,requirements:_,canPurchase:N,bought:E,mark:R,id:$,purchase:D,...u}},a})}function dd(e,t,n,i){return function(){e>>>=0,t>>>=0,n>>>=0,i>>>=0;let r=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,i=i+1|0,r=r+i|0,n=n+r|0,(r>>>0)/4294967296}}const fd={1:["b","c","d","f","g","h","i","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"],2:["a","e","o","u"],3:["br","cr","dr","fr","gr","pr","str","tr","bl","cl","fl","gl","pl","sl","sc","sk","sm","sn","sp","st","sw","ch","sh","th","wh"],4:["ae","ai","ao","au","a","ay","ea","ei","eo","eu","e","ey","ua","ue","ui","uo","u","uy","ia","ie","iu","io","iy","oa","oe","ou","oi","o","oy"],5:["turn","ter","nus","rus","tania","hiri","hines","gawa","nides","carro","rilia","stea","lia","lea","ria","nov","phus","mia","nerth","wei","ruta","tov","zuno","vis","lara","nia","liv","tera","gantu","yama","tune","ter","nus","cury","bos","pra","thea","nope","tis","clite"],6:["una","ion","iea","iri","illes","ides","agua","olla","inda","eshan","oria","ilia","erth","arth","orth","oth","illon","ichi","ov","arvis","ara","ars","yke","yria","onoe","ippe","osie","one","ore","ade","adus","urn","ypso","ora","iuq","orix","apus","ion","eon","eron","ao","omia"]},Xi=[[1,2,5],[2,3,6],[3,4,5],[4,3,6],[3,4,2,5],[2,1,3,6],[3,4,2,5],[4,3,1,6],[3,4,1,4,5],[4,1,4,3,6]];function yi(e){const t=Xi[Math.floor(e()*Xi.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}function md(e,...t){return We(n=>{var r,a;const i=e.call(n,n);for(const l of t)(r=l.preConstruct)==null||r.call(l,i);i.formula=i.formula(m.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=S(()=>{let l=o.floor(i.formula.evaluate(i.baseResource.value)).max(0);return s(i.buyMax)===!1&&(l=l.min(1)),l})),i.actualGain==null&&(i.actualGain=i.currentGain),i.currentAt==null&&(i.currentAt=S(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=S(()=>i.formula.invert(o.floor(s(i.currentGain)).add(1)))),i.convert==null&&(i.convert=function(){var u;const l=s(i.currentGain);i.gainResource.value=o.add(i.gainResource.value,l),i.spend(l),(u=i.onConvert)==null||u.call(i,l)}),i.spend==null&&(i.spend=function(){i.baseResource.value=0}),P(i,"currentGain"),P(i,"actualGain"),P(i,"currentAt"),P(i,"nextAt"),P(i,"buyMax"),se(i,"buyMax",!0);for(const l of t)(a=l.postConstruct)==null||a.call(l,i);return i})}function vd(e){return md(e)}const Qi=si();function Tr(e,t,n,i){return Fi(e,function(){const r=dd(0,n>>0,n>>32,1);for(let q=0;q<12;q++)r();const a=yi(r),l=wi([.64,.75,.55],r),u=wi([.18,.2,.25],r),c=Si(0,yi(r)),f=tt(0),b=Gt.indexOf(t);let p=r();const w=i.reduce((q,V)=>(q[V.type]=V.data,q),{});"increaseDiff"in w&&(p=p/2+.5),"decreaseDiff"in w&&(p=p/2),"relic"in w&&(p=1);const C=p+b+1,_="increaseRewards"in w?C+1:C;let N="relic"in w?b+2:Math.ceil(r()*(b+2));"increaseLength"in w&&N++;const E=[],R=Nt(()=>[...E,Re(()=>({multiplier:()=>ue.isEmpowered("silver")?4:2,description:()=>(ue.isEmpowered("silver")?"Empowered ":"")+ue.tools.silver.name,enabled:()=>ue.toolNodes.value.silver!=null})),Re(()=>({multiplier:()=>(ue.isEmpowered("diamond")?2:1)*ce.filter(q=>q.bought.value).length/10,description:()=>(ue.isEmpowered("diamond")?"Empowered ":"")+ue.tools.diamond.name,enabled:()=>ue.toolNodes.value.diamond!=null})),Re(()=>({multiplier:()=>o.div(f.value,6e3).times(ue.isEmpowered("emerald")?2:1),description:()=>(ue.isEmpowered("emerald")?"Empowered ":"")+ue.tools.emerald.name,enabled:()=>ue.toolNodes.value.emerald!=null}))]),$=S(()=>R.apply(0)),D=[],U={};function he({feature:q,canClick:V,modifier:Ie,cost:wt,previewModifier:vt,showETA:qe,previewCost:Rt}){V=_e(V),qe=_e(qe);const xt=us(q);D.push({shouldShowPreview:S(()=>s(V)&&xt.value),modifier:Nt(()=>{const $t=E.slice();return $t.splice($t.indexOf(Ie),1,vt),$t}),cost:Rt!=null?Rt:wt}),E.push(Ie);const qt=Ji(c,$,()=>Ne(wt)),Be=Ki(q,{display:qe==null?qt:()=>s(qe)?qt.value:"",direction:Y.Down});return{isHovering:xt,eta:qt,tooltip:Be}}const ie=[],J=B(0);let Q=m.variable(J).times(0);const z={};let de=!0;const W=S(()=>o.add(C,r()-.5).pow_base(2).times(10).times(Q.evaluate())),ye=[];for(let q=0;q({addend:Oe,description:Lt,enabled:ut.bought})),zt=un(()=>({addend:Oe}));break}case"mult":{const Oe=r()*5+1;Bt=`Multiply previous ${c.displayName} gain by x${we(Oe)}.`,Q=Q.add(o.sub(Oe,1).times(z[nn-1])),jt=Re(()=>({multiplier:Oe,description:Lt,enabled:ut.bought})),zt=Re(()=>({multiplier:Oe}));break}case"pow":{const Oe=r()/5+1.1;Bt=`Raise previous ${c.displayName} gain to the ^${we(Oe)}`,Q=Q.add(o.pow(z[nn-1],Oe)).sub(z[nn-1]),jt=Yi(()=>({exponent:Oe,description:Lt,enabled:ut.bought})),zt=Yi(()=>({exponent:Oe}))}}z[J.value]=Q.evaluate(),J.value++;const Pn=de,ut=cd(()=>({requirements:bi(()=>({resource:Zn(c),cost:tn})),display:{title:Lt,description:Bt},visibility:Pn}));he({feature:ut,canClick:()=>ut.canPurchase.value,modifier:jt,cost:tn,showETA:()=>!ut.bought.value,previewModifier:zt}),Qt.push(ut)}ie.push(Qt);break;case"repeatables":const ot=[];for(let Vt=0;Vt<3;Vt++){const mi=Yn({add:1.5,mult:3},r),tn=J.value,Lt=W.value,Bt=Ni(r);let jt="",zt,nn,Pn,ut;const Oe=m.variable(S(()=>ct.amount.value)).times(2);switch(mi){case"add":{const dt=o.add(Lt,10).times(r()+.5);jt=`Gain ${we(dt)} ${c.displayName}/s`,ut=Oe.add(1).times(Lt),Q=Q.add(S(()=>o.sub(J.value,tn).add(1).times(5).times(dt))),zt=S(()=>we(o.times(dt,ct.amount.value))+"/s"),nn=un(()=>({addend:()=>o.times(dt,ct.amount.value),description:Bt,enabled:()=>o.gt(ct.amount.value,0)})),Pn=un(()=>({addend:()=>o.add(ct.amount.value,1).times(dt)}));break}case"mult":{const dt=r()*.75+1.25;jt=`Multiply previous ${c.displayName} gain by x${we(dt)}.`,ut=Oe.pow_base(dt).times(Lt),Q=Q.add(S(()=>o.sub(J.value,tn).add(1).times(5).pow_base(dt).sub(1).times(z[tn-1]))),zt=S(()=>"x"+we(o.pow(dt,ct.amount.value))),nn=Re(()=>({multiplier:()=>o.pow(dt,ct.amount.value),description:Bt,enabled:()=>o.gt(ct.amount.value,0)})),Pn=Re(()=>({multiplier:()=>o.add(ct.amount.value,1).pow_base(dt)}));break}}z[J.value]=Q.evaluate(),J.value++;const Or=de,ct=ad(()=>({requirements:bi(()=>({resource:Zn(c),cost:ut})),display:()=>({title:Bt,description:jt,effectDisplay:s(zt)}),visibility:Or}));he({feature:ct,canClick:()=>s(ct.canClick),modifier:nn,cost:ut,previewModifier:Pn}),ot.push(ct)}ie.push(ot);break;case"conversion":const Se=Si(0,yi(r)),lt=wi([.64,.75,.55],r),en=W.value,Wn=r()/2+.25,v=r()/2+.25,d=J.value;Q=Q.add(S(()=>o.sub(J.value,d).add(1).pow_base(5).pow(v).times(z[d-1])));const h=vd(()=>({baseResource:Zn(c),gainResource:Se,formula:Vt=>Vt.div(en).pow(Wn),spend(){c.value=0}}));z[J.value]=Q.evaluate(),J.value+=2;const x=de,A=Ni(r),G=m.variable(Se).pow(v).add(1),ve=Re(()=>({multiplier:()=>G.evaluate(),description:A,enabled:()=>o.gt(Se.value,0)})),_t=Re(()=>({multiplier:()=>G.evaluate(o.add(Se.value,h.actualGain.value))})),Xe=Gc(()=>({display:{title:A,description:te(()=>g("span",null,[O("Reset "),c.displayName,O(" for")," ",ii(Se,o.clampMin(h.actualGain.value,1))," ",Se.displayName,g("br",null,null),g("div",null,[O("Next:")," ",ii(c,o.lt(h.actualGain.value,1)?h.currentAt.value:h.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(h.actualGain.value,1),prestigeResource:Se,onClick:h.convert,visibility:x})),{isHovering:Dn}=he({feature:Xe,canClick:()=>s(Xe.canClick),modifier:ve,cost:en,previewCost:c,previewModifier:_t}),Vi=S(()=>Dn.value&&Xe.canClick.value);ie.push([Xe]);const Pr=hn(m.variable(Se),Vi,h.actualGain),Fr=hn(G,Vi,h.actualGain);U[q*2]=te(()=>g(ae,null,[at(Xe.visibility)?g("div",{style:"margin: 10px"},[O("You have")," ",g("h2",{style:{color:lt,textShadow:`0px 0px 10px ${lt}`}},[Pr()])," ",Se.displayName,O(","),g("br",null,null),O("providing a "),Fr(),O("x multiplier to previous")," ",c.displayName,O(" gain")]):null,Wi(Xe)]));break}const wt={cache:"increaseCaches"in w?10:1,generation:"increaseGens"in w?10:1,resourceMulti:"increaseResourceMults"in w?10:1,energyMulti:"increaseEnergyMults"in w?2.5:.25,influences:Object.keys(ue.influenceNodes.value).length+ye.length===Object.keys(Ct).length?0:"increaseInfluences"in w?20:2,relic:0};let vt=Yn(wt,r);q===N-1&&"relic"in w&&(vt="relic");let qe="",Rt,xt,qt,Be,$t,Xt;switch(vt){case"cache":Be=_i(r,i),qe=`Gain ${we(_)}x your current ${Be}.`,xt=()=>{var Se,lt,en;return ue.grantResource(Be,o.times((en=(lt=(Se=ue.resourceNodes.value[Be])==null?void 0:Se.state)==null?void 0:lt.amount)!=null?en:0,_))};break;case"generation":Be=_i(r,i);const Qt=o.div(_,120).times(et[Be]);qe=`Gain ${we(Qt)} ${Be}/s while plane is active.`,Rt=Se=>ue.grantResource(Be,o.times(Se,Qt)),qt=S(()=>ue.resourceNodes.value[Be]);break;case"resourceMulti":$t=Be=_i(r,i),Xt=o.div(_,17).pow_base(2),qe=`Gain ${we(Xt)}x ${Be} while plane is active.`;break;case"energyMulti":$t="energy",Xt=o.div(_,17),qe=`Gain ${we(Xt)}x energy while plane is active.`;break;case"influences":const ot=Object.keys(Ct)[Math.floor(r()*Object.keys(Ct).length)];ye.push(ot),qe=`Gain a new portal influence (${Ct[ot].display})`,xt=()=>{if(ot in ue.influenceNodes.value){Qi.warning(`Error: ignoring duplicate portal influence (${Ct[ot].display})`);return}const Se={id:qn(ue.board),position:{...ue.board.types.portal.nodes.value.find(lt=>lt.state.id===e).position},type:"influence",state:{type:ot,data:Ct[ot].initialData}};ue.board.placeInAvailableSpace(Se),ue.board.nodes.value.push(Se)};break;case"relic":qe=`Gain the ${t}-tier planar relic (${ri[t]})`,xt=()=>{if(`${t}Relic`in ue.toolNodes.value)Qi.warning(`Error: ignoring duplicate relic (${ri[t]})`);else{const Se={id:qn(ue.board),position:{...ue.board.types.portal.nodes.value.find(lt=>lt.state.id===e).position},type:"passive",state:`${t}Relic`};ue.board.placeInAvailableSpace(Se),ue.board.nodes.value.push(Se)}}}const gi=de,En=W.value,ht=id(()=>({requirements:bi(()=>({resource:Zn(c),cost:En})),visibility:gi,display:{requirement:`${we(En)} ${c.displayName}`,effectDisplay:qe},style:"width: 100%",classes:{final:q===N-1},update:Rt,onComplete:xt,link:qt,effectedResource:$t,resourceMulti:Xt})),Tn=Ji(c,$,En);Ki(ht,{display:()=>ht.earned.value?"":Tn.value,direction:Y.Down}),ie.push([ht]),de=ht.earned}const ce=ki(ie,Er);ki(ie,$r);const fe=Nt(()=>[Re(()=>({multiplier:()=>{var q,V,Ie;return o.add((Ie=(V=(q=ue.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:V.level)!=null?Ie:0,1)},description:"Booster",enabled:()=>{var q,V,Ie;return(Ie=(V=(q=ue.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:V.portals.includes(e))!=null?Ie:!1}}))]),Te=S(()=>fe.apply(1)),[He,Ke]=Rn(()=>[{title:`${ze(c.displayName)} Gain`,modifier:R,base:0,unit:"/s"},{title:`${ze(c.displayName)} Time Speed`,modifier:fe,base:1,visible:()=>o.gt(Te.value,1)}]),In=B(!1),vn=te(()=>g(Ft,{modelValue:In.value,"onUpdate:modelValue":q=>In.value=q},{header:()=>g("h2",null,[O("Modifiers")]),body:()=>Je(He)}));this.on("preUpdate",q=>{if(!ue.activePortals.value.some(Ie=>Ie.state.id===e))return;const V=o.times(Te.value,q);f.value=o.add(f.value,V),c.value=o.times($.value,V).add(c.value),It.value.forEach(Ie=>{var wt;(wt=Ie.update)==null||wt.call(Ie,V)})});const xn=S(()=>{const q=D.find(V=>V.shouldShowPreview.value);return q?o.neg(Ne(q.cost)):0}),Ot=S(()=>{const q=D.find(V=>V.shouldShowPreview.value);return q?o.sub(q.modifier.apply(0),$.value):0}),Un=hn(m.variable(0).add(c),()=>o.neq(xn.value,0),xn),$n=hn(m.variable(0).add($),()=>o.neq(Ot.value,0),Ot),Gn=S(()=>{const q=[];return It.value.forEach(V=>{V.link&&q.push(V.link)}),q}),Ze=S(()=>{const q={};return It.value.forEach(V=>{V.effectedResource!=null&&V.resourceMulti!=null&&(q[V.effectedResource]!=null?q[V.effectedResource]=o.times(q[V.effectedResource],V.resourceMulti):q[V.effectedResource]=V.resourceMulti)}),q}),It=S(()=>{const q=[];for(let V=1;Vo.lt(It.value.length,N)&&ie.some(q=>q.some(V=>"earned"in V&&s(V.earned)||"bought"in V&&s(V.bought)?!1:("canClick"in V&&s(V.canClick)||"canPurchase"in V&&s(V.canPurchase),!0))));return{tier:tt(t),seed:tt(n),influences:tt(i),name:a,color:l,resource:c,background:u,style:{background:u,"--background":u},features:ie,resourceTabCollapsed:Ke,links:Gn,resourceMultis:Ze,earnedTreasures:It,showNotif:pi,timeActive:f,display:te(()=>g(ae,null,[g(ni,{class:"nav-container",style:"z-index: 5"},{default:()=>[g("span",{class:"nav-segment"},[g("h2",null,[a])]),g("span",{class:"nav-segment"},[g("h3",null,[t,O("-tier")])]),i.length===0?null:g("span",{class:"nav-segment"},[g(xe,{display:i.map(q=>{const V=Ct[q.type].description;return typeof V=="function"?V(q):V}).join("
"),direction:Y.Down,style:"width: 300px"},{default:()=>[g("h3",null,[i.length,O(" influences")])]})]),g("span",{class:"nav-segment"},[g("button",{class:"button",style:"display: inline",onClick:()=>In.value=!0},[O("modifiers")])])]}),g(ni,{class:"nav-container"},{default:()=>[g("span",{class:"nav-segment"},[g("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[Je(Un)])," ",c.displayName]),g("span",{class:"nav-segment"},[O("("),g("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[o.gt($.value,0)?"+":"",Je($n)]),O("/s)")])]}),g(Jc,{height:"60px"},null),ie.map((q,V)=>V in U?Je(U[V]):Wi(...q)),Je(vn)])),minimizedDisplay:te(()=>g("div",null,[g("span",null,[a]),g("span",{style:"font-size: large; vertical-align: sub;"},[" ",It.value.length,O("/"),N,O(" treasures")])]))}})}function _i(e,t){t=t.filter(u=>u.type==="increaseResources"||u.type==="decreaseResources");const n=Object.keys(et).reduce((u,c)=>{let f=et[c];return t.filter(b=>b.data===c).forEach(b=>{b.type==="increaseResources"?f*=1e3:f/=1e3}),u+f},0),i=Object.keys(et),r=Math.floor(e()*n);let a=0,l;for(let u=0;uu+c),i=Object.keys(e);let r=0,a=null;const l=t()*n;for(let u=0;ue?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples mine ore drops":"Doubles mine ore drops"},stone:{description:e=>e?"Quadruples energy gain":"Doubles energy gain"},copper:{description:e=>e?"Material level is 20% stronger":"Material level is 10% stronger"},silver:{description:e=>e?"Doubles each plane's resource gain":"Quadruples each plane's resource gain"},diamond:{description:e=>e?"+20% plane's resource gain per upgrade bought":"+10% plane's resource gain per upgrade bought"},emerald:{description:e=>e?"+2% plane's resource gain per minute active":"+1% plane's resource gain per minute active"},unobtainium:{description:e=>e?"+2 max connections per machine":"+1 max connections per machine"},dirtRelic:{description:e=>e?"Upgrades apply thrice":"Upgrades apply twice"},sandRelic:{description:e=>e?"Treasure's 2 tiers stronger":"Treasure's 1 tier stronger"},gravelRelic:{description:e=>e?"+2% plane's resource gain per repeatable purchase":"+1% plane's resource gain per repeatable purchase"},woodRelic:{description:e=>e?"(Relics)^2 boost mine speed":"Relics boost mine speed"},stoneRelic:{description:e=>e?"2 free levels for repeatables":"1 free level for repeatables"},coalRelic:{description:e=>e?"(Treasures)^2 boost planar speed":"Treasures boost planar speed"},copperRelic:{description:e=>e?"Power 2 machines free":"Power 1 machine free"},ironRelic:{description:e=>e?"Conversions give triple output":"Conversions give double output"},silverRelic:{description:e=>e?"(Power machines)^2 boost ore dropped":"Power machines boost ore dropped"},goldRelic:{description:e=>e?"Each treasure quadruples XP gain":"Each treasure doubles XP gain"},emeraldRelic:{description:e=>e?"Creating portals costs a third the energy":"Creating portals costs half the energy"},platinumRelic:{description:e=>e?"Triple dimensions' tick rate":"Double dimensions' tick rate"},diamondRelic:{description:e=>e?"Repeatables/dimensions buy max at once":"Repeatables buy max at once"},beryliumRelic:{description:e=>e?"(Max tier plane finished)^2 boosts quarry speed":"Max tier plane finished boosts quarry speed"},unobtainiumRelic:{description:e=>e?"ln(energy) boosts planar speed":"log(energy) boosts planar speed"},ultimatumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},Ct={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+diff",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-diff",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},Ci=m.variable(0).add(8).times(2).pow10(),ue=Fi("main",function(){const e=Si(0,"energy"),t=m.variable(0).add(1),n=S(()=>z.types.resource.nodes.value.reduce((v,d)=>(v[d.state.type]=d,v),{})),i=S(()=>({...z.types.passive.nodes.value.reduce((v,d)=>(v[d.state]=d,v),{}),sand:z.types.dowsing.nodes.value[0],wood:z.types.quarry.nodes.value[0],coal:z.types.empowerer.nodes.value[0],iron:z.types.portalGenerator.nodes.value[0],gold:z.types.booster.nodes.value[0]})),r=S(()=>({...z.types.influence.nodes.value.reduce((v,d)=>(v[d.state.type]=d,v),{})}));function a(v){return Te.value!=null&&de(Te.value)&&Te.value.state.tools.includes(v)}const l=S(()=>Gt.reduce((v,d)=>{var G,ve,_t;const h=(_t=(ve=(G=n.value[d])==null?void 0:G.state)==null?void 0:ve.amount)!=null?_t:0;let x=o.floor(t.invertIntegral(h)).sub(10).clampMin(0),A=Jt(t,x,!0,0);for(;;){const Xe=t.evaluate(x);if(o.add(A,Xe).lte(h))x=x.add(1),A=o.add(A,Xe);else break}return v[d]=x,v},{}));function u(v){var G,ve,_t;const d=(_t=(ve=(G=n.value[v])==null?void 0:G.state)==null?void 0:ve.amount)!=null?_t:0,h=l.value[v],x=Jt(t,h,!0),A=Jt(t,o.add(h,1),!0);return o.sub(d,x).max(0).div(o.sub(A,x)).toNumber()}const c=fn({}),f=fn({});Dt(()=>{Gt.forEach(v=>{nt(()=>l.value[v],(d,h)=>{o.gt(d,h)&&oe.active===K.id&&er.info(g("div",null,[g("h3",null,[o.eq(d,1)?`${ze(v)} discovered`:`${ze(v)} is now Level ${je(d)}`,O("!")]),g("div",null,[O("Energy gain is now 1.01x higher.")])]))})})});const b=S(()=>In.filter(v=>{var d,h;return(h=(d=v.value)==null?void 0:d.state)==null?void 0:h.powered}).length+z.types.portal.nodes.value.filter(v=>v.state.powered).length),p=S(()=>o.eq(b.value,0)?10:o.add(b.value,1).pow_base(100).div(10).times(.99)),w=S(()=>fe.value==null?0:fe.value.state.resources.reduce((d,h)=>o.div(100,vt[h].computedModifier.value).add(d),o.dZero)),C={id:"deselect",icon:"close",tooltip:v=>({text:"tools"in v.state?"Disconnect tools":"Disconnect resources"}),onClick(v){var d;Array.isArray((d=v.state)==null?void 0:d.data)?v.state={...v.state,data:[]}:"resources"in v.state?v.state={...v.state,resources:[]}:"tools"in v.state&&(v.state={...v.state,tools:[]}),z.selectedAction.value=null,z.selectedNode.value=null},visibility:v=>{var d;return Array.isArray((d=v.state)==null?void 0:d.data)?v.state.data.length>0:"resources"in v.state?v.state.resources.length>0:"tools"in v.state?v.state.tools.length>0:!1}},_={id:"toggle",icon:"bolt",tooltip:v=>({text:v.state.powered?"Turn Off":`Turn On - Always runs for ${je(p.value)} energy/s`}),onClick(v){v.state={...v.state,powered:!v.state.powered},z.selectedAction.value=null},fillColor:v=>v.state.powered?"var(--accent1)":"var(--locked)"};function N(v,d=1/0){const h=v(m.variable(0));return{id:"moreConnections",icon:"hub",formula:h,tooltip(x){return{text:`Increase Connections - ${je(h.evaluate(x.state.maxConnections))} energy`}},confirmationLabel:x=>o.gte(e.value,h.evaluate(x.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(x){const A=h.evaluate(x.state.maxConnections);o.gte(e.value,A)&&(e.value=o.sub(e.value,A)),x.state={...x.state,maxConnections:o.add(x.state.maxConnections,1)},z.selectedAction.value=null},visibility:x=>o.add(x.state.maxConnections,Ze.value).lt(d)}}function E(v,d){var h,x;if(((h=z.draggingNode.value)==null?void 0:h.type)==="resource"){const A=((x=z.draggingNode.value)==null?void 0:x.state).type,{maxConnections:G,resources:ve}=v.state;return ve.includes(A)?{text:"Disconnect",color:"var(--accent2)"}:o.add(G,Ze.value).lte(ve.length)?{text:"Max connections",color:"var(--danger)"}:{text:d(A),color:"var(--accent2)"}}return null}function R(v,d){var h,x;if(((h=z.draggingNode.value)==null?void 0:h.type)==="passive"){const A=(x=z.draggingNode.value)==null?void 0:x.state,{maxConnections:G,tools:ve}=v.state;return ve.includes(A)?{text:"Disconnect",color:"var(--accent2)"}:o.add(G,Ze.value).lte(ve.length)?{text:"Max connections",color:"var(--danger)"}:{text:d(A),color:"var(--accent2)"}}return null}function $(v,d){var h,x;if(((h=z.draggingNode.value)==null?void 0:h.type)==="portal"){const A=((x=z.draggingNode.value)==null?void 0:x.state).id,{maxConnections:G,portals:ve}=v.state;return ve.includes(A)?{text:"Disconnect",color:"var(--accent2)"}:o.add(G,Ze.value).lte(ve.length)?{text:"Max connections",color:"var(--danger)"}:{text:d(A),color:"var(--accent2)"}}return null}function D(v,d){if(d.type!=="resource")return!1;const h=d.state.type,{maxConnections:x,resources:A}=v.state;return A.includes(h)?!0:!o.add(x,Ze.value).lte(A.length)}function U(v,d){if(d.type!=="resource")return;const h=d.state.type,x=v.state.resources;x.includes(h)?v.state={...v.state,resources:x.filter(A=>A!==h)}:v.state={...v.state,resources:[...x,h]},z.selectedNode.value=v}function he(v,d){if(d.type!=="passive")return!1;const h=d.state,{maxConnections:x,tools:A}=v.state;return A.includes(h)?!0:!o.add(x,Ze.value).lte(A.length)}function ie(v,d){if(d.type!=="passive")return;const h=d.state,x=v.state.tools;x.includes(h)?v.state={...v.state,tools:x.filter(A=>A!==h)}:v.state={...v.state,tools:[...x,h]},z.selectedNode.value=v}function J(v,d){if(d.type!=="portal")return!1;const h=d.state.id,{maxConnections:x,portals:A}=v.state;return A.includes(h)?!0:!o.add(x,Ze.value).lte(A.length)}function Q(v,d){if(d.type!=="portal")return;const h=d.state.id,{portals:x}=v.state;x.includes(h)?v.state={...v.state,tools:x.filter(A=>A!==h)}:v.state={...v.state,tools:[...x,h]},z.selectedNode.value=v}const z=Ql(v=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:{mine:{shape:Ve.Diamond,size:50,title:"\u{1FAA8}",label:d=>d===v.selectedNode.value?{text:"Mining"}:Object.keys(n.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[_],progress:d=>de(d)?new o(d.state.progress).toNumber():0,progressDisplay:ln.Outline,progressColor:"var(--accent2)",classes:d=>({running:de(d)}),draggable:!0},brokenFactory:{shape:Ve.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>d===v.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(d){o.gte(e.value,100)&&(d.type="factory",e.value=o.sub(e.value,100))},confirmationLabel:()=>o.gte(e.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},factory:{shape:Ve.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>{var h,x;if(d===v.selectedNode.value)return{text:d.state==null?"Forge - Drag a resource to me!":`Forging ${Pe[d.state].name}`};if(((h=v.draggingNode.value)==null?void 0:h.type)==="resource"){const A=((x=v.draggingNode.value)==null?void 0:x.state).type,G=d.state===A?"Disconnect":Pe[A].name,ve=d.state===A||o.gte(e.value,Pe[A].cost)&&i.value[A]==null?"var(--accent2)":"var(--danger)";return{text:G,color:ve}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(d){d.state=void 0,v.selectedAction.value=null,v.selectedNode.value=null},visibility:d=>d.state!=null},{id:"craft",icon:"done",tooltip:d=>({text:`Forge ${Pe[d.state].name} - ${je(Pe[d.state].cost)} energy`}),onClick(d){const h=Pe[d.state];if(o.gte(e.value,h.cost)&&i.value[d.state]==null){e.value=o.sub(e.value,h.cost);const x={id:qn(v),position:{...d.position},type:h.type,state:"state"in h?h.state:void 0};v.placeInAvailableSpace(x),v.nodes.value.push(x),v.selectedAction.value=null,v.selectedNode.value=null,d.state=void 0}},fillColor:d=>o.gte(e.value,Pe[d.state].cost)&&i.value[d.state]==null?"var(--accent2)":"var(--danger)",visibility:d=>d.state!=null,confirmationLabel:d=>o.gte(e.value,Pe[d.state].cost)?i.value[d.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:d=>d.state==null||i.value[d.state]!=null?0:o.div(e.value,Pe[d.state].cost).clampMax(1).toNumber(),progressDisplay:ln.Fill,progressColor:d=>d.state!=null&&o.gte(e.value,Pe[d.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(d,h){return h.type==="resource"},onDrop(d,h){const x=h.state.type;d.state===x?d.state=void 0:d.state=x,v.selectedNode.value=d},draggable:!0},resource:{shape:Ve.Circle,size:50,title:d=>ze(d.state.type),subtitle:d=>je(d.state.amount),progress:d=>u(d.state.type),onClick(){},progressDisplay:ln.Outline,progressColor:"var(--accent3)",classes:d=>{var h;return{"affected-node":ce.value!=null&&de(ce.value)&&ce.value.state.resources.includes(d.state.type)||o.neq((h=Ot.value[d.state.type])!=null?h:1,1)}},draggable:!0},passive:{shape:Ve.Circle,size:50,title:d=>Pe[d.state].name,label:d=>d===v.selectedNode.value?{text:tr[d.state].description(a(d.state))}:null,outlineColor:"var(--bought)",classes:d=>({"affected-node":a(d.state)}),draggable:!0},dowsing:{shape:Ve.Diamond,size:50,title:"\u{1F962}",label:d=>d===v.selectedNode.value?{text:d.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${d.state.resources.length}/${o.add(d.state.maxConnections,Ze.value)})`}:E(d,h=>`Double ${h} odds`),actionDistance:Math.PI/4,actions:[C,N(d=>d.add(2).pow_base(100),16),_],classes:d=>({running:de(d)}),canAccept:D,onDrop:U,draggable:!0},quarry:{shape:Ve.Diamond,size:50,title:"\u26CF\uFE0F",label:d=>d===v.selectedNode.value?{text:d.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${d.state.resources.length}/${o.add(d.state.maxConnections,Ze.value)})`}:E(d,h=>`Gather ${cn(o.div(vt[h].computedModifier.value,100))} ${h}/s`),actionDistance:Math.PI/4,actions:[C,N(d=>d.add(2).pow_base(1e4),16),_],progress:d=>de(d)?o.eq(w.value,0)?0:new o(d.state.progress).div(w.value).toNumber():0,progressDisplay:ln.Outline,progressColor:"var(--accent2)",canAccept:D,onDrop:U,classes:d=>({running:de(d)}),draggable:!0},empowerer:{shape:Ve.Diamond,size:50,title:"\u{1F50C}",label:d=>d===v.selectedNode.value?{text:d.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${d.state.tools.length}/${o.add(d.state.maxConnections,Ze.value)})`}:R(d,h=>h.includes("Relic")?`Double ${ri[h.slice(0,-5)]}'s effect`:`Double ${Pe[h].name}'s effect`),actionDistance:Math.PI/4,actions:[C,N(d=>d.add(3).pow_base(1e3),16),_],canAccept:he,onDrop:ie,classes:d=>({running:de(d)}),draggable:!0},portalGenerator:{shape:Ve.Diamond,size:50,title:"\u26E9\uFE0F",label:d=>{if(d===v.selectedNode.value)return{text:d.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${d.state.tier}-tier portal`};const h=v.draggingNode.value;if((h==null?void 0:h.type)==="resource"){const x=h.state.type;return{text:d.state.tier===x?"Disconnect":`${ze(x)}-tier Portal`,color:"var(--accent2)"}}else if((h==null?void 0:h.type)==="influence"){const x=h.state.type,{influences:A}=d.state;return A.includes(x)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(d){d.state={...d.state,tier:void 0,influences:[]},v.selectedAction.value=null,v.selectedNode.value=null},visibility:d=>{const{tier:h,influences:x}=d.state;return h!=null||x.length>0}},{id:"makePortal",icon:"done",tooltip:d=>({text:`Spawn ${d.state.tier}-tier portal`}),onClick(d){let h=0;for(;`portal-${h}`in Ce;)h++;const{tier:x,influences:A}=d.state;Ai(Tr(`portal-${h}`,x,Math.floor(Math.random()*4294967296),A.map(ve=>r.value[ve].state)),K);const G={id:qn(v),position:{...d.position},type:"portal",state:{id:`portal-${h}`,powered:!1}};v.placeInAvailableSpace(G),v.nodes.value.push(G),v.selectedAction.value=null,v.selectedNode.value=null,d.state={tier:void 0,influences:[]}},visibility:d=>d.state.tier!=null}],canAccept(d,h){return h.type==="resource"||h.type==="influence"},onDrop(d,h){if(h.type==="resource"){const x=h.state.type,A=d.state.tier;d.state={...d.state,tier:x===A?void 0:x}}else if(h.type==="influence"){const x=h.state.type,A=d.state.influences;A.includes(x)?d.state={...d.state,influences:A.filter(G=>G!==x)}:d.state={...d.state,influences:[...A,x]}}v.selectedNode.value=d},draggable:!0},portal:{shape:Ve.Diamond,size:50,title:"\u{1F300}",label:d=>d===v.selectedNode.value?{text:`Portal to ${Ce[d.state.id].name}`,color:Ce[d.state.id].color}:null,actionDistance:Math.PI/4,actions:[_],classes:d=>({running:de(d),showNotif:Ce[d.state.id].showNotif.value}),outlineColor:d=>Ce[d.state.id].background,draggable:!0},influence:{shape:d=>d.state.type==="increaseResources"||d.state.type==="decreaseResources"?Ve.Diamond:Ve.Circle,size:50,title:d=>Ct[d.state.type].display,label:d=>{if(d===v.selectedNode.value){const x=d.state,A=Ct[x.type].description;return{text:typeof A=="function"?A(x):A}}const h=v.draggingNode.value;if((h==null?void 0:h.type)==="resource"){const x=h.state.type,{type:A,data:G}=d.state;let ve;if(Array.isArray(G)&&G.includes(x))ve="Disconnect";else if(A==="increaseResources")ve=`Increase ${ze(x)} odds`;else if(A==="decreaseResources")ve=`Decrease ${ze(x)} odds`;else return null;return{text:ve,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[C],canAccept:(d,h)=>h.type!=="resource"?!1:Array.isArray(d.state.data),onDrop:(d,h)=>{if(h.type!=="resource")return;const x=h.state.type,A=d.state.data;A!=null&&(A.includes(x)?d.state={...d.state,data:A.filter(G=>G!==x)}:d.state={...d.state,data:[...A,x]},v.selectedNode.value=d)},outlineColor:"var(--danger)",draggable:!0},booster:{shape:Ve.Diamond,size:50,title:"\u231B",label:d=>d===v.selectedNode.value?{text:d.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${je(o.add(1,d.state.level))}x (${d.state.tools.length}/${o.add(d.state.maxConnections,Ze.value)})`}:$(d,h=>`Boost ${Ce[h].name}'s speed`),actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect portals"},onClick(d){d.state={...d.state,portals:[]},v.selectedAction.value=null,v.selectedNode.value=null},visibility:d=>{var h,x;return(x=(h=d.state)==null?void 0:h.portals.length)!=null?x:0>0}},N(d=>d.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(d){return{text:`Increase boost - ${je(Ci.evaluate(d.state.level))} energy`}},confirmationLabel(d){return o.gte(e.value,Ci.evaluate(d.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(d){const h=Ci.evaluate(d.state.level);o.gte(e.value,h)&&(e.value=o.sub(e.value,h)),d.state={...d.state,level:o.add(d.state.level,1)},v.selectedAction.value=null}},_],canAccept:J,onDrop:Q,classes:d=>({running:de(d)}),draggable:!0}},style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const d=[];if(d.push(...Object.keys(c).map(h=>({startNode:W.value,endNode:n.value[h],stroke:"var(--accent3)",strokeWidth:5}))),ye.value!=null&&ye.value.state!=null&&d.push({startNode:ye.value,endNode:n.value[ye.value.state],stroke:"var(--foreground)",strokeWidth:4}),ce.value!=null&&ce.value.state.resources.forEach(h=>{d.push({startNode:ce.value,endNode:n.value[h],stroke:de(ce.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),fe.value!=null&&fe.value.state.resources.forEach(h=>{d.push({startNode:fe.value,endNode:n.value[h],stroke:"var(--foreground)",strokeWidth:4})}),d.push(...Object.keys(f).map(h=>({startNode:fe.value,endNode:n.value[h],stroke:"var(--accent3)",strokeWidth:5}))),Te.value!=null&&Te.value.state.tools.forEach(h=>{d.push({startNode:Te.value,endNode:i.value[h],stroke:de(Te.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),He.value!=null){const h=He.value.state;h.tier!=null&&d.push({startNode:He.value,endNode:n.value[h.tier],stroke:"var(--foreground)",strokeWidth:4}),h.influences.forEach(x=>{d.push({startNode:He.value,endNode:r.value[x],stroke:"var(--foreground)",strokeWidth:4})}),v.types.portal.nodes.value.forEach(x=>{const A=Ce[x.state.id];return A.links.value.forEach(G=>{G.value!=null&&d.push({startNode:x,endNode:G.value,stroke:de(x)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(A.resourceMultis.value).forEach(G=>{G!=="energy"&&G in n.value&&d.push({startNode:x,endNode:n.value[G],stroke:de(x)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),d})}return Ke.value!=null&&Ke.value.state.portals.forEach(h=>{d.push({startNode:Ke.value,endNode:v.types.portal.nodes.value.find(x=>x.state.id===h),stroke:de(Ke.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Object.values(r.value).forEach(h=>{const x=h.state;(x.type==="increaseResources"||x.type==="decreaseResources")&&x.data.forEach(A=>{d.push({startNode:h,endNode:n.value[A],stroke:"var(--foreground)",strokeWidth:4})})}),d}}));function de(v){return v===z.selectedNode.value||v.state.powered}const W=S(()=>z.types.mine.nodes.value[0]),ye=S(()=>z.types.factory.nodes.value[0]),ce=S(()=>i.value.sand),fe=S(()=>i.value.wood),Te=S(()=>i.value.coal),He=S(()=>i.value.iron),Ke=S(()=>i.value.gold),In=[W,ce,fe,Te,Ke];function vn(v,d){let h=n.value[v];if(d=o.times(d,qe[v].computedModifier.value),h==null)h={id:qn(z),position:{...W.value.position},type:"resource",state:{type:v,amount:d}},z.placeInAvailableSpace(h),z.nodes.value.push(h);else{const x=h.state;h.state={...x,amount:o.add(x.amount,d)}}}const xn=S(()=>Object.keys(et).reduce((v,d)=>v+new o(vt[d].computedModifier.value).toNumber(),0)),Ot=S(()=>{const v={};return z.types.portal.nodes.value.forEach(d=>{if(!de(d))return;const x=Ce[d.state.id].resourceMultis.value;Object.keys(x).forEach(A=>{v[A]!=null?v[A]=o.times(v[A],x[A]):v[A]=x[A]})}),v}),Un=Nt(()=>[...Gt.map(v=>Re(()=>({description:()=>`${ze(v)} (Lv. ${je(l.value[v])}) (${cn(wt.value)}x per level)`,multiplier:()=>o.pow(wt.value,l.value[v]),enabled:()=>{var d,h;return v in n.value&&o.gt((h=(d=n.value[v].state)==null?void 0:d.amount)!=null?h:0,0)}}))),Re(()=>({multiplier:()=>a("stone")?4:2,description:()=>(a("stone")?"Empowered ":"")+Pe.stone.name,enabled:()=>i.value.stone!=null})),Re(()=>({multiplier:()=>{var v;return(v=Ot.value.energy)!=null?v:1},description:"Planar Treasures",enabled:()=>{var v;return o.neq((v=Ot.value.energy)!=null?v:1,1)}})),un(()=>({addend:()=>o.pow(100,b.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(b.value,0)}))]),$n=S(()=>Un.apply(1)),Gn=Nt(()=>[un(()=>({addend:()=>a("unobtainium")?2:1,description:()=>(a("unobtainium")?"Empowered ":"")+Pe.unobtainium.name,enabled:()=>i.value.unobtainium!=null}))]),Ze=S(()=>Gn.apply(0)),It=Nt(()=>[Re(()=>({multiplier:()=>a("dirt")?4:2,description:()=>(a("dirt")?"Empowered ":"")+Pe.dirt.name,enabled:()=>i.value.dirt!=null}))]),pi=S(()=>It.apply(1)),q=Nt(()=>[Re(()=>({multiplier:()=>a("gravel")?4:2,description:()=>(a("gravel")?"Empowered ":"")+Pe.gravel.name,enabled:()=>i.value.gravel!=null}))]),V=S(()=>q.apply(1)),Ie=Nt(()=>[un(()=>({addend:()=>a("copper")?.002:.001,description:()=>(a("copper")?"Empowered ":"")+Pe.copper.name,enabled:()=>i.value.copper!=null}))]),wt=S(()=>Ie.apply(1.01)),vt=Object.keys(et).reduce((v,d)=>{const h=Nt(()=>[Re(()=>({multiplier:2,description:"Dowsing",enabled:()=>ce.value!=null&&de(ce.value)&&ce.value.state.resources.includes(d)}))]),x=S(()=>h.apply(et[d])),A={title:`${ze(d)} Drop Rate`,modifier:h,base:et[d]};return v[d]={modifier:h,computedModifier:x,section:A},v},{}),qe=Object.keys(et).reduce((v,d)=>{const h=Nt(()=>[Re(()=>({multiplier:()=>{var G;return(G=Ot.value[d])!=null?G:1},description:"Planar Treasures",enabled:()=>{var G;return o.neq((G=Ot.value[d])!=null?G:1,1)}}))]),x=S(()=>h.apply(1)),A={title:`${ze(d)} Gain`,modifier:h};return v[d]={modifier:h,computedModifier:x,section:A},v},{}),[Rt,xt]=Rn(()=>[{title:"Energy Gain",modifier:Un,base:1,unit:"/s"},{title:"Bonus Connections",modifier:Gn,base:0}]),[qt,Be]=Rn(()=>[{title:"Mining Speed",modifier:It,base:1,unit:"/s",visible:()=>i.value.dirt!=null},{title:"Ore Dropped",modifier:q,base:1,visible:()=>i.value.gravel!=null},{title:"Material Level Effect",modifier:Ie,base:1.01,visible:()=>i.value.copper!=null}]),[$t,Xt]=Rn(()=>Object.values(vt).map(v=>v.section)),[gi,En]=Rn(()=>Object.values(qe).map(v=>v.section)),ht=lu({general:()=>({display:"General",glowColor(){return ht.activeTab.value===this.tab?"white":""},tab:Rt,energyTabCollapsed:xt}),mining:()=>({display:"Mine",glowColor(){return ht.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(i.value).length>0,tab:qt,miningTabCollapsed:Be}),resources:()=>({display:"Mine Rates",glowColor(){return ht.activeTab.value===this.tab?"white":""},visibility:()=>ce.value!=null,tab:$t,resourcesCollapsed:Xt}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return ht.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(qe).some(v=>o.neq(v.computedModifier.value,1)),tab:gi,resourceGainCollapsed:En})}),Tn=B(!1),Qt=te(()=>g(Ft,{modelValue:Tn.value,"onUpdate:modelValue":v=>Tn.value=v},{header:()=>g("h2",null,[O("Modifiers")]),body:()=>Je(ht)}));this.on("preUpdate",v=>{if(Object.keys(c).forEach(d=>{c[d]-=v,c[d]<=0&&delete c[d]}),Object.keys(f).forEach(d=>{f[d]-=v,f[d]<=0&&delete f[d]}),de(W.value)){const d=o.add(W.value.state.progress,o.times(pi.value,v)),h=d.floor();W.value.state={...W.value.state,progress:o.sub(d,h)};const x=h.div(xn.value).floor();x.gt(0)&&Gt.forEach(G=>{vn(G,o.times(new o(vt[G].computedModifier.value).toNumber(),x).times(V.value)),c[G]=.3});const A=o.sub(h,x).toNumber();for(let G=0;G0){let x=o.add(d,v);const A=o.div(d,w.value).floor();x=o.sub(x,o.times(A,w.value)),fe.value.state={...fe.value.state,progress:x},o.gt(A,0)&&h.forEach(G=>{vn(G,A),f[G]=.3})}}e.value=o.add(e.value,o.times($n.value,v)),o.lt(e.value,0)&&(e.value=0,W.value.state={...W.value.state,powered:!1},er.warning(g("div",null,[g("h3",null,[O("Ran out of energy!")]),g("div",null,[O("All machines have been turned off.")])])))});const ot=S(()=>{var v,d;return z.selectedAction.value===z.types.brokenFactory.actions[0]?-100:z.selectedAction.value===z.types.factory.actions[1]?o.neg(Pe[z.selectedNode.value.state].cost):((v=z.selectedAction.value)==null?void 0:v.id)==="moreConnections"?o.neg(z.selectedAction.value.formula.evaluate(((d=z.selectedNode.value)==null?void 0:d.state).maxConnections)):0}),Se=hn(m.variable(0).add(e),()=>o.neq(ot.value,0),ot),lt=S(()=>{var v;return z.selectedAction.value===_?((v=z.selectedNode.value)==null?void 0:v.state).powered?o.eq(b.value,1)?10:o.pow(100,b.value).div(10).times(.99):o.neg(p.value):0}),en=hn(m.variable(0).add($n),()=>o.neq(lt.value,0),lt),Wn=S(()=>z.types.portal.nodes.value.filter(v=>de(v)));return nt(Wn,v=>{Dt(()=>{K.tabs=["main",...v.map(d=>d.state.id)]})}),nt(Ze,(v,d)=>{if(o.lt(v,d)){if(ce.value){const h=ce.value.state.maxConnections;o.lt(ce.value.state.resources.length,o.add(h,v))&&(ce.value.state={...ce.value.state,resources:ce.value.state.resources.slice(0,o.add(h,v).toNumber())})}if(fe.value){const h=fe.value.state.maxConnections;o.lt(fe.value.state.resources.length,o.add(h,v))&&(fe.value.state={...fe.value.state,resources:fe.value.state.resources.slice(0,o.add(h,v).toNumber())})}if(Te.value){const h=Te.value.state.maxConnections;o.lt(Te.value.state.tools.length,o.add(h,v))&&(Te.value.state={...Te.value.state,resources:Te.value.state.tools.slice(0,o.add(h,v).toNumber())})}if(Ke.value){const h=Ke.value.state.maxConnections;o.lt(Ke.value.state.portals.length,o.add(h,v))&&(Ke.value.state={...Ke.value.state,resources:Ke.value.state.portals.slice(0,o.add(h,v).toNumber())})}}}),{name:"World",board:z,energy:e,modifierTabs:ht,mineLootTable:et,tools:Pe,passives:tr,resourceNodes:n,toolNodes:i,influenceNodes:r,grantResource:vn,activePortals:Wn,isEmpowered:a,display:te(()=>g(ae,null,[g(ni,{class:"nav-container"},{default:()=>[g("span",{class:"nav-segment"},[g("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[Je(Se)])," ",O("energy")]),g("span",{class:"nav-segment"},[O("("),g("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt($n.value,0)?"+":"",Je(en)]),O("/s)")]),o.gt(b.value,0)?g("span",{class:"nav-segment"},[g("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[je(b.value)])," ",O("machines powered")]):null,g("span",{class:"nav-segment"},[g("button",{class:"button",style:"display: inline",onClick:()=>Tn.value=!0},[O("modifiers")])]),K.devSpeed===0?g("span",{class:"nav-segment"},[O("Game Paused")]):K.devSpeed!=null&&K.devSpeed!==1?g("span",{class:"nav-segment"},[O("Dev Speed: "),cn(K.devSpeed),O("x")]):null]}),Je(z),Je(Qt)]))}}),hd=e=>{var i,r,a,l,u;const t=[ue];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const c=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(Tr(`portal-${n}`,(a=c.tier)!=null?a:"dirt",(l=c.seed)!=null?l:Math.floor(Math.random()*4294967296),(u=c.influences)!=null?u:[])),n++}return t},Dr=S(()=>!1);function bd(e,t){}var yd=Object.freeze(Object.defineProperty({__proto__:null,mineLootTable:et,resourceNames:Gt,relics:ri,influences:Ct,main:ue,getInitialLayers:hd,hasWon:Dr,fixOldSave:bd},Symbol.toStringTag,{value:"Module"}));const zn=e=>(pn("data-v-4a50ce42"),e=e(),gn(),e),wd={class:"game-over-modal-header"},_d=["src","alt"],Nd={class:"game-over-modal-title"},Cd=zn(()=>k("h2",null,"Congratulations!",-1)),kd={key:0},Md=zn(()=>k("br",null,null,-1)),Sd=zn(()=>k("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Id=zn(()=>k("br",null,null,-1)),xd=["href"],$d=zn(()=>k("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Ed=X({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:l}=ge,u=S(()=>oi(K.timePlayed)),c=S(()=>Dr.value&&!K.keepGoing),f=Kt(K,"autosave");function b(){K.keepGoing=!0}function p(){sn(yn())}return(w,C)=>(I(),ne(Ft,{"model-value":s(c)},{header:H(()=>[k("div",wd,[s(n)?(I(),T("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,_d)):j("",!0),k("div",Nd,[Cd,k("h4",null,"You've beaten "+re(s(t))+" v"+re(s(a))+": "+re(s(l)),1)])])]),body:H(({shown:_})=>[_?(I(),T("div",kd,[k("div",null,"It took you "+re(s(u))+" to beat the game.",1),Md,Sd,Id,k("div",null,[k("a",{href:s(r),class:"game-over-modal-discord-link"},[$d,O(" "+re(s(i)),1)],8,xd)]),g(Et,{title:"Autosave",modelValue:s(f),"onUpdate:modelValue":C[0]||(C[0]=N=>De(f)?f.value=N:null)},null,8,["modelValue"])])):j("",!0)]),footer:H(()=>[k("div",{class:"game-over-footer"},[k("button",{onClick:b,class:"button"},"Keep Going"),k("button",{onClick:p,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Td=me(Ed,[["__scopeId","data-v-4a50ce42"]]);const fi=e=>(pn("data-v-2776d67d"),e=e(),gn(),e),Dd=fi(()=>k("div",{class:"nan-modal-header"},[k("h2",null,"NaN value detected!")],-1)),Pd={key:0},Fd=fi(()=>k("br",null,null,-1)),Ad=["href"],Od=fi(()=>k("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Rd=fi(()=>k("br",null,null,-1)),qd={class:"nan-footer"},Vd=X({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ge,i=B(!0),r=B(!0),a=Kt(Fe,"hasNaN"),l=B(null);nt(a,w=>{w?(i.value=K.autosave,r.value=K.devSpeed===0):(K.autosave=i.value,K.devSpeed=r.value?0:null)});const u=S(()=>{var w;return(w=Fe.NaNPath)==null?void 0:w.join(".")}),c=S(()=>Fe.NaNPersistent!=null?Fe.NaNPersistent.value:null);function f(){Fe.NaNPersistent!=null&&(Fe.NaNPersistent.value=new o(0),Fe.hasNaN=!1)}function b(){Fe.NaNPersistent&&(Fe.NaNPersistent.value=new o(1),Fe.hasNaN=!1)}function p(){Fe.NaNPersistent&&(Fe.NaNPersistent.value=new o(NaN),Fe.hasNaN=!1)}return(w,C)=>(I(),T(ae,null,[g(Ft,Pt({modelValue:s(a),"onUpdate:modelValue":C[4]||(C[4]=_=>De(a)?a.value=_:null)},w.$attrs),{header:H(()=>[Dd]),body:H(()=>[k("div",null,[O(' Attempted to assign "'+re(s(u))+'" to NaN',1),s(c)?(I(),T("span",Pd,re(" ")+"(previously "+re(s(cn)(s(c)))+")",1)):j("",!0),O(". Auto-saving has been "+re(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Fd,k("div",null,[k("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Od,O(" "+re(s(t)||"The Paper Pilot Community"),1)],8,Ad)]),Rd,g(Et,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":C[0]||(C[0]=_=>i.value=_)},null,8,["modelValue"]),s(ge).enablePausing?(I(),ne(Et,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":C[1]||(C[1]=_=>r.value=_)},null,8,["modelValue"])):j("",!0)]),footer:H(()=>[k("div",qd,[k("button",{onClick:C[2]||(C[2]=_=>{var N;return(N=l.value)==null?void 0:N.open()}),class:"button"},"Open Saves Manager"),k("button",{onClick:f,class:"button"},"Set to 0"),k("button",{onClick:b,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(I(),T("button",{key:0,onClick:C[3]||(C[3]=_=>a.value=!1),class:"button"}," Set to previous ")):j("",!0),k("button",{onClick:p,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),g(_r,{ref_key:"savesManager",ref:l},null,512)],64))}});var Ld=me(Vd,[["__scopeId","data-v-2776d67d"]]);const Bd={key:0,class:"tpsDisplay"},jd={key:0,class:"low"},zd=X({__name:"TPS",setup(e){const t=S(()=>o.div(Fe.lastTenTicks.length,Fe.lastTenTicks.reduce((a,l)=>a+l,0))),n=B([]);pt(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=S(()=>n.value.reduce((a,l)=>o.max(a,l),0)),r=S(()=>o.sub(t.value,i.value).gt(1));return(a,l)=>s(t).isNan()?j("",!0):(I(),T("div",Bd,[O(" TPS: "+re(s(je)(s(t)))+" ",1),g(_n,{name:"fade"},{default:H(()=>[s(r)?(I(),T("span",jd,re(s(je)(s(i))),1)):j("",!0)]),_:1})]))}});var Ud=me(zd,[["__scopeId","data-v-46a3ed5b"]]);var Gd=X({__name:"App",setup(e){const t=ge.useHeader,n=S(()=>bt[oe.theme].variables),i=Kt(oe,"showTPS"),r=S(()=>le(te(()=>g(ae,null,[as.map(Je)]))));return(a,l)=>(I(),T(ae,null,[k("div",{id:"modal-root",style:Ue(s(n))},null,4),k("div",{class:be(["app",{useHeader:s(t)}]),style:Ue(s(n))},[s(t)?(I(),ne(Nr,{key:0})):j("",!0),g(_l),s(s(i))?(I(),ne(Ud,{key:1})):j("",!0),g(Td),g(Ld),(I(),ne(Le(s(r))))],6)],64))}});var Wd=me(Gd,[["__scopeId","data-v-41d15e5e"]]);function Hd(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e;let u,c,f,b;const p=async(C=!0)=>{await f,C&&(u==null||u.addEventListener("controlling",_=>{_.isUpdate&&window.location.reload()})),await(b==null?void 0:b())};async function w(){if("serviceWorker"in navigator){const{Workbox:C,messageSW:_}=await Vn(()=>import("./workbox-window.4a8794bb.js"),[]);b=async()=>{c&&c.waiting&&await _(c.waiting,{type:"SKIP_WAITING"})},u=new C("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",N=>{N.isUpdate||i==null||i()});{const N=()=>{n==null||n()};u.addEventListener("waiting",N),u.addEventListener("externalwaiting",N)}u.register({immediate:t}).then(N=>{c=N,a?a("./sw.js",N):r==null||r(N)}).catch(N=>{l==null||l(N)})}}return f=w(),p}function Zd(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e,u=B(!1),c=B(!1);return{updateServiceWorker:Hd({immediate:t,onNeedRefresh(){u.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:a,onRegisterError:l}),offlineReady:c,needRefresh:u}}document.title=ge.title;window.projInfo=ge;if(ge.id==="")throw new Error("Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json");requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c -Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await Qa();const{globalBus:e}=await Vn(()=>Promise.resolve().then(function(){return Ka}),void 0),{startGameLoop:t}=await Vn(()=>import("./gameLoop.d7a7e16a.js"),["assets/gameLoop.d7a7e16a.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css","assets/unique-names-generator.5494b30b.js"]),n=window.vue=Gr(Wd);e.emit("setupVue",n),n.mount("#app"),Dt(()=>{const i=si(),{updateServiceWorker:r}=Zd({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Vn as _,Fe as a,ge as b,yd as c,Ge as g,es as l,K as p,oe as s}; diff --git a/assets/index.43bdca03.css b/assets/index.6d27cf3a.css similarity index 90% rename from assets/index.43bdca03.css rename to assets/index.6d27cf3a.css index fd91e14..4661c5c 100644 --- a/assets/index.43bdca03.css +++ b/assets/index.6d27cf3a.css @@ -1 +1 @@ -.table{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;max-width:100%;margin:0 auto}.table+.table{margin-top:10px}.row{display:flex;flex-flow:row wrap;justify-content:center;align-items:stretch;max-width:100%;margin:0 10px}.row>:not(.feature){margin:0;display:flex}.col{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;height:100%;margin:10px 0}.row.mergeAdjacent>.feature:not(.dontMerge),.row.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin-left:0;margin-right:0;border-radius:0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child,.row.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:var(--border-radius) 0 0 var(--border-radius)}.row.mergeAdjacent>.feature:not(.dontMerge):last-child,.row.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0 var(--border-radius) var(--border-radius) 0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child:last-child,.row.mergeAdjacent>.tooltip-container:first-child:last-child>.feature:not(.dontMerge){border-radius:var(--border-radius)}.row-grid.mergeAdjacent>.feature:not(.dontMerge),.row-grid.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin:0;border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):last-child,.row-grid.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):first-child,.row-grid.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):first-child{border-radius:0 0 0 var(--border-radius)}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):last-child{border-radius:0 var(--border-radius) 0 0}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):first-child{border-radius:var(--border-radius) 0 0 0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) 0}.col.mergeAdjacent .feature:not(.dontMerge){margin-top:0;margin-bottom:0;border-radius:0}.col.mergeAdjacent .feature:not(.dontMerge):first-child{border-radius:var(--border-radius) var(--border-radius) 0 0}.col.mergeAdjacent .feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) var(--border-radius)}.col.mergeAdjacent .feature:not(.dontMerge):first-child:last-child{border-radius:var(--border-radius)}.resize-listener[data-v-2b1dc1bc]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}.modal-mask{position:fixed;z-index:9998;top:0;left:0;bottom:0;right:0;background-color:#00000080;transition:opacity .3s ease}.modal-wrapper{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.modal-container{width:640px;max-width:95vw;max-height:95vh;background-color:var(--background);padding:20px;border-radius:5px;transition:all .3s ease;text-align:left;border:var(--modal-border);box-sizing:border-box;display:flex;flex-direction:column}.modal-header{width:100%}.modal-body{margin:20px 0;width:100%;overflow-y:auto;overflow-x:hidden}.modal-footer{width:100%}.modal-default-footer{display:flex}.modal-default-flex-grow{flex-grow:1}.modal-enter-from,.modal-leave-active{opacity:0}.modal-enter-from .modal-container,.modal-leave-active .modal-container{-webkit-transform:scale(1.1);transform:scale(1.1)}.layer-container[data-v-72dd78b1]{min-width:100%;min-height:100%;margin:0;flex-grow:1;display:flex;isolation:isolate}.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:20px;padding-bottom:20px;min-height:100%;flex-grow:1;text-align:center;position:relative}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:50px}.layer-tab.minimized[data-v-72dd78b1]{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;padding:55px 0 0;margin:0;cursor:pointer;font-size:40px;color:var(--foreground);border:none;background-color:transparent}.layer-tab.minimized>*[data-v-72dd78b1]{margin:0;writing-mode:vertical-rl;text-align:left;padding-left:10px;width:50px}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){margin:-50px -10px;padding:50px 10px}.modal-body .layer-tab[data-v-72dd78b1]{padding-bottom:0}.modal-body .layer-tab[data-v-72dd78b1]:not(.hasSubtabs){padding-top:0}.minimize[data-v-72dd78b1]{position:sticky;top:6px;right:9px;z-index:7;line-height:30px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:40px;cursor:pointer;margin-top:-44px;margin-right:-30px}.minimized+.minimize[data-v-72dd78b1]{transform:rotate(-90deg);top:10px;right:18px;pointer-events:none}.goBack[data-v-72dd78b1]{position:sticky;top:10px;left:10px;line-height:30px;margin-top:-50px;margin-left:-35px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:30px;cursor:pointer;z-index:7}.goBack[data-v-72dd78b1]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}.layer-tab.minimized>*>.desc{color:var(--accent1);font-size:30px}details[data-v-4b4bda40]{margin:10px 0;padding-left:18px}summary[data-v-4b4bda40]{cursor:pointer;margin-bottom:10px;margin-left:-18px}ul[data-v-4b4bda40]{margin:var(--feature-margin) 0;background:var(--raised-background);border:2px solid rgba(0,0,0,.125);padding:5px 5px 5px 15px;list-style:inside}li[data-v-4b4bda40]{margin:8px 0}li[data-v-4b4bda40]:before{padding:2px 8px;margin-right:8px;border-radius:var(--border-radius)}.feature[data-v-4b4bda40]:before{content:"Feature";background:var(--accent1)}.fix[data-v-4b4bda40]:before{content:"Fix";background:var(--accent2)}.balancing[data-v-4b4bda40]:before{content:"Balancing";background:var(--accent3)}.breaking[data-v-4b4bda40]:before{content:"Breaking";background:var(--danger)}.tooltip-container[data-v-6102fa3a]{position:relative;--xoffset: 0px;--yoffset: 0px;text-shadow:none!important}.tooltip[data-v-6102fa3a],.tooltip[data-v-6102fa3a]:after{pointer-events:none;position:absolute}.tooltip[data-v-6102fa3a]{text-align:center;width:150px;font-size:14px;line-height:1.2;bottom:calc(100% + var(--yoffset));left:calc(50% + var(--xoffset));margin-bottom:5px;transform:translate(-50%);padding:7px;border-radius:3px;background-color:var(--tooltip-background);color:var(--points);z-index:100!important;word-break:break-word}.tooltip[data-v-6102fa3a] hr{margin:var(--feature-margin) 0}.shown[data-v-6102fa3a]{z-index:10}.fade-enter-from[data-v-6102fa3a],.fade-leave-to[data-v-6102fa3a]{opacity:0}.tooltip[data-v-6102fa3a]:after{content:" ";position:absolute;top:100%;bottom:100%;left:calc(50% - var(--xoffset));width:0;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--tooltip-background) transparent transparent transparent}.tooltip.left[data-v-6102fa3a],.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top){bottom:calc(50% + var(--yoffset));left:unset;right:calc(100% + var(--xoffset));margin-bottom:unset;margin-right:5px;transform:translateY(50%)}.tooltip.left[data-v-6102fa3a]:after,.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top):after{top:calc(50% + var(--yoffset));bottom:unset;left:100%;right:100%;margin-left:unset;margin-top:-5px;border-color:transparent transparent transparent var(--tooltip-background)}.tooltip.right[data-v-6102fa3a]{bottom:calc(50% + var(--yoffset));left:calc(100% + var(--xoffset));margin-bottom:unset;margin-left:5px;transform:translateY(50%)}.tooltip.right[data-v-6102fa3a]:after{top:calc(50% + var(--yoffset));left:0;right:100%;margin-left:-10px;margin-top:-5px;border-color:transparent var(--tooltip-background) transparent transparent}.tooltip.bottom[data-v-6102fa3a]{top:calc(100% + var(--yoffset));bottom:unset;left:calc(50% + var(--xoffset));margin-bottom:unset;margin-top:5px;transform:translate(-50%)}.tooltip.bottom[data-v-6102fa3a]:after{top:0;margin-top:-10px;border-color:transparent transparent var(--tooltip-background) transparent}.pinned[data-v-6102fa3a]{position:absolute;right:-5px;top:-5px;transform:rotate(45deg)}.info-modal-header[data-v-4f97aa40]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.info-modal-header *[data-v-4f97aa40]{margin:0}.info-modal-logo[data-v-4f97aa40]{height:4em;width:4em}.info-modal-title[data-v-4f97aa40]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.info-modal-discord-link[data-v-4f97aa40]{display:flex;align-items:center}.info-modal-discord[data-v-4f97aa40]{margin:0 4px 0 0}.field{display:flex;position:relative;min-height:2em;margin:10px 0;user-select:none;justify-content:space-between;align-items:center}.field>*{margin:0}.vue-select{width:50%;border-radius:var(--border-radius)}.field-buttons .vue-select{width:unset}.vue-select,.vue-dropdown{border-color:var(--outline)}.vue-dropdown{background:var(--raised-background)}.vue-dropdown-item{color:var(--foreground)}.vue-dropdown-item,.vue-dropdown-item *{transition-duration:0s}.vue-dropdown-item.highlighted{background-color:var(--highlighted)}.vue-dropdown-item.selected,.vue-dropdown-item.highlighted.selected{background-color:var(--bought)}.vue-input input{font-size:inherit}.vue-input input::placeholder{color:var(--link)}.field[data-v-11046116]{cursor:pointer}input[data-v-11046116]{appearance:none;pointer-events:none}span[data-v-11046116]{width:100%;padding-right:41px;position:relative}input+span[data-v-11046116]:before{content:"";position:absolute;top:calc(50% - 7px);right:0px;border-radius:7px;width:36px;height:14px;background-color:var(--outline);opacity:.38;vertical-align:top;transition:background-color .2s,opacity .2s}input+span[data-v-11046116]:after{content:"";position:absolute;top:calc(50% - 10px);right:16px;border-radius:50%;width:20px;height:20px;background-color:var(--locked);box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;transition:background-color .2s,transform .2s}input:checked+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked+span[data-v-11046116]:after{background-color:var(--link);transform:translate(16px)}input:active+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked:active+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:disabled+span[data-v-11046116]{color:#000;opacity:.38;cursor:default}input:disabled+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:checked:disabled+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}.feedback[data-v-01a1b95c]{position:relative}.feedback[data-v-01a1b95c]:after{position:absolute;left:calc(100% + 5px);top:50%;transform:translateY(-50%);content:"\2714";opacity:0;pointer-events:none;box-shadow:inset 0 0 0 35px #6f94b600;text-shadow:none}.feedback.left[data-v-01a1b95c]:after{left:unset;right:calc(100% + 5px)}.feedback.activated[data-v-01a1b95c]:after{animation:feedback-01a1b95c .5s ease-out forwards}@keyframes feedback-01a1b95c{0%{opacity:1;transform:scale3d(.4,.4,1),translateY(-50%)}80%{opacity:.1}to{opacity:0;transform:scale3d(1.2,1.2,1),translateY(-50%)}}.option-tabs{border-bottom:2px solid var(--outline);margin-top:10px;margin-bottom:-10px}.option-tabs button{background-color:transparent;color:var(--foreground);margin-bottom:-2px;font-size:14px;cursor:pointer;padding:5px 20px;border:none;border-bottom:2px solid var(--foreground)}.option-tabs button:not(.selected){border-bottom-color:transparent}.option-title .tooltip-container{display:inline;margin-left:5px}.option-title desc{display:block;opacity:.6;font-size:small;width:300px;margin-left:0}.save-button{text-align:right}form[data-v-90bd4994]{margin:0;width:100%}.field>*[data-v-90bd4994]{margin:0}input[data-v-90bd4994]{width:50%;outline:none;border:solid 1px var(--outline);background-color:unset;border-radius:var(--border-radius)}.fullWidth[data-v-90bd4994]{width:100%}.container[data-v-2f8ef34c]{display:flex;align-items:center;background:var(--raised-background);box-shadow:var(--raised-background) 0 2px 3px 5px}.container.confirming button[data-v-2f8ef34c]{font-size:1em}.container>*[data-v-2f8ef34c]{margin:0 4px}.danger,.button.danger{position:relative;border:solid 2px var(--danger);border-right-width:16px}.danger:after{position:absolute;content:"!";color:#fff;right:-13px}.save[data-v-32313015]{position:relative;border:solid 4px var(--outline);padding:4px;background:var(--raised-background);margin:var(--feature-margin);display:flex;align-items:center;min-height:30px}.save.active[data-v-32313015]{border-color:var(--bought)}.open[data-v-32313015]{display:inline;margin:0;padding-left:0}.handle[data-v-32313015]{flex-grow:0;margin-right:8px;margin-left:0;cursor:pointer}.details[data-v-32313015]{margin:0 80px 0 0;flex-grow:1}.error[data-v-32313015]{font-size:.8em;color:var(--danger)}.save-version[data-v-32313015]{margin-left:4px;font-size:.7em;opacity:.7}.actions[data-v-32313015]{position:absolute;top:0;bottom:0;right:4px;display:flex;padding:4px;z-index:1}.editname[data-v-32313015]{margin:0}.save button{transition-duration:0s}.save .actions button{display:flex;font-size:1.2em}.save .actions button .material-icons{font-size:unset}.save .button.danger{display:flex;align-items:center;padding:4px}.save .field,.field form[data-v-2a4275be],.field .field-title[data-v-2a4275be],.field .field-buttons[data-v-2a4275be]{margin:0}.field-buttons[data-v-2a4275be]{display:flex}.field-buttons .field[data-v-2a4275be]{margin:0 0 0 8px}.modal-footer[data-v-2a4275be]{margin-top:-20px}.footer[data-v-2a4275be]{display:flex;margin-top:20px}.importingFailed input{color:red}.field-buttons .v-select{width:220px}.presets .vue-select[aria-expanded=true] vue-dropdown{visibility:hidden}.nav[data-v-318a1c31]{background-color:var(--raised-background);display:flex;left:0;right:0;top:0;height:46px;width:100%;border-bottom:4px solid var(--outline)}.nav>*[data-v-318a1c31]{height:46px;width:46px;display:flex;cursor:pointer;flex-shrink:0}.nav>.banner[data-v-318a1c31]{height:100%;width:unset}.overlay-nav[data-v-318a1c31]{position:fixed;top:10px;left:10px;display:flex;flex-direction:column;z-index:2}.overlay-nav>*[data-v-318a1c31]{height:50px;width:50px;display:flex;cursor:pointer;margin:0;align-items:center;justify-content:center}.title[data-v-318a1c31]{font-size:36px;text-align:left;margin-left:12px;cursor:unset}.nav>.title[data-v-318a1c31]{width:unset;flex-shrink:1;overflow:hidden;white-space:nowrap}.nav .saves[data-v-318a1c31],.nav .info[data-v-318a1c31]{display:flex}.tooltip-container[data-v-318a1c31]{width:100%;height:100%;display:flex}.overlay-nav .discord[data-v-318a1c31]{position:relative}.discord img[data-v-318a1c31]{width:100%;height:100%}.discord-links[data-v-318a1c31]{position:fixed;top:45px;padding:20px;right:-280px;width:200px;transition:right .25s ease;background:var(--raised-background);z-index:10}.overlay-nav .discord-links[data-v-318a1c31]{position:absolute;left:-280px;right:unset;transition:left .25s ease}.overlay-nav .discord:hover .discord-links[data-v-318a1c31]{left:-10px}.discord-links li[data-v-318a1c31]{margin-bottom:4px}.discord-links li[data-v-318a1c31]:first-child{font-size:1.2em}*:not(.overlay-nav) .discord:hover .discord-links[data-v-318a1c31]{right:0}.material-icons[data-v-318a1c31]{font-size:36px}.material-icons[data-v-318a1c31]:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--foreground)}.nav .version-container[data-v-318a1c31]{display:flex;height:25px;margin-bottom:0;margin-left:10px}.overlay-nav .version-container[data-v-318a1c31]{width:unset;height:25px}.version[data-v-318a1c31]{color:var(--points)}.version:hover span[data-v-318a1c31]{text-shadow:5px 0 10px var(--points),-3px 0 12px var(--points)}.nav>div>a[data-v-318a1c31],.overlay-nav>div>a[data-v-318a1c31]{color:var(--foreground);text-shadow:none}.tabs-container[data-v-dcd207b4]{width:100vw;flex-grow:1;overflow-x:auto;overflow-y:hidden;display:flex}.tabs-container[data-v-dcd207b4]:not(.useHeader){width:calc(100vw - 50px);margin-left:50px}.tab[data-v-dcd207b4]{position:relative;height:100%;flex-grow:1;transition-duration:0s;overflow-y:auto;overflow-x:hidden}.inner-tab[data-v-dcd207b4]{padding:50px 10px;min-height:calc(100% - 100px);display:flex;flex-direction:column;margin:0;flex-grow:1}.tab+.tab>.inner-tab[data-v-dcd207b4]{border-left:solid 4px var(--outline)}.tab hr{height:4px;border:none;background:var(--outline);margin:var(--feature-margin) 0}.tab .modal-body hr{margin:7px 0}.sticky[data-v-cccac690]{position:sticky;background:var(--background);width:calc(100% - 2px);z-index:3}.link[data-v-57c4970a]{transition-duration:0s}.link.pulsing[data-v-57c4970a]{animation:pulsing-57c4970a 2s ease-in infinite}@keyframes pulsing-57c4970a{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.action:not(.boardnode):hover circle[data-v-9efb2a56],.action:not(.boardnode).selected circle[data-v-9efb2a56]{r:25}.action:not(.boardnode):hover text[data-v-9efb2a56],.action:not(.boardnode).selected text[data-v-9efb2a56]{font-size:187.5%}.action:not(.boardnode) text[data-v-9efb2a56]{text-anchor:middle;dominant-baseline:central}.actions-enter-from .action,.actions-leave-to .action{transform:translate(0)}.boardnode[data-v-4654be02]{cursor:pointer;transition-duration:0s}.boardnode:hover .body[data-v-4654be02]{fill:var(--highlighted)}.boardnode.running .body[data-v-4654be02]{fill:var(--accent1)!important}.boardnode:not(.isDraggable) .body[data-v-4654be02]{fill:var(--locked)}.node-title[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:200%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.node-subtitle[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:150%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.progress[data-v-4654be02]{transition-duration:.05s}.progressRing[data-v-4654be02]{transform:rotate(-90deg)}.fade-enter-from[data-v-4654be02],.fade-leave-to[data-v-4654be02]{opacity:0}.pulsing[data-v-4654be02]{animation:pulsing-4654be02 2s ease-in infinite}@keyframes pulsing-4654be02{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.grow-enter-from .node-container,.grow-leave-to .node-container{transform:scale(0)}.vue-pan-zoom-scene{width:100%;height:100%;cursor:grab}.vue-pan-zoom-scene:active{cursor:grabbing}.g1{transition-duration:0s}.link-enter-from,.link-leave-to{opacity:0}.tabButton[data-v-21427abb]{background-color:transparent;color:var(--foreground);font-size:20px;cursor:pointer;padding:5px 20px;margin:5px;border-radius:5px;border:2px solid;flex-shrink:0;border-color:var(--layer-color)}.tabButton[data-v-21427abb]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}:not(.floating)>.tabButton[data-v-21427abb]{height:50px;margin:0;border-left:none;border-right:none;border-top:none;border-bottom-width:4px;border-radius:0;transform:unset}:not(.floating) .tabButton[data-v-21427abb]:not(.active){border-bottom-color:transparent}.tabButton>*[data-v-21427abb]{pointer-events:none}.tab-family-container[data-v-58dbf83a]{margin:calc(50px + var(--feature-margin)) 20px var(--feature-margin) 20px;position:relative;border:solid 4px;border-color:var(--outline)}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child{margin:-4px -11px var(--feature-margin) -11px}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child:nth-last-child(3){border-bottom-style:none;border-left-style:none;border-right-style:none;height:calc(100% + 50px)}.modal-body>.tab-family-container[data-v-58dbf83a]:first-child{margin:calc(10px + var(--feature-margin)) 10px 0 10px;border:none}.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:20px}.modal-body>.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:50px}.tab-family-container[data-v-f18896fc][data-v-58dbf83a]>:last-child{margin-bottom:20px}.tab-buttons-container[data-v-58dbf83a]{z-index:4}.tab-buttons-container[data-v-58dbf83a]:not(.floating){border-bottom:solid 4px;border-color:inherit}:not(.layer-tab):not(.modal-body)>.tab-family-container>.tab-buttons-container[data-v-58dbf83a]:not(.floating){width:calc(100% + 6px);margin-left:-3px}.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{text-align:left;margin-bottom:-4px}.tab-buttons-container.floating .tab-buttons[data-v-58dbf83a]{justify-content:center;margin-top:-25px}.tab-buttons[data-v-58dbf83a]{margin-bottom:24px;display:flex;flex-flow:wrap;z-index:4}.layer-tab>.tab-family-container:first-child:nth-last-child(3)>.tab-buttons-container>.tab-buttons[data-v-58dbf83a]{padding-right:60px}.tab-buttons[data-v-58dbf83a]:not(.floating){text-align:left;border-bottom:inherit;border-width:4px;box-sizing:border-box;height:50px}.modal-body .tab-buttons[data-v-58dbf83a]{width:100%;margin-left:0;margin-right:0;padding-left:0}.showGoBack>.tab-family-container:first-child>.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{padding-left:70px}:not(.showGoBack)>.tab-family-container>.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{padding-left:0}.minimizable>.tab-buttons-container[data-v-58dbf83a]:not(.floating):first-child{padding-right:50px}.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{margin-top:-50px}.tab-buttons-container+*[data-v-58dbf83a]{margin-top:20px}.modifier-container{display:flex;padding:1px 8px}.modifier-container:nth-child(2n){background:var(--raised-background)}.modifier-amount{flex-shrink:0;text-align:right}:not(:first-of-type,:last-of-type)>.modifier-amount:after{content:var(--unit);opacity:0}.modifier-description{flex-grow:1}.collapsible-container[data-v-a72c16aa]{width:calc(100% - 10px)}.collapsible-toggle[data-v-a72c16aa]{max-width:unset;width:calc(100% + 0px);margin:0 0 0 -5px;background:var(--raised-background);padding:var(--feature-margin);color:var(--foreground);cursor:pointer;transition-duration:0s}.collapsible-toggle[data-v-a72c16aa]:last-child{margin-left:unset}[data-v-a72c16aa] .collapsible-toggle+.table{max-width:unset;width:calc(100% + 10px);margin-left:-5px}[data-v-a72c16aa] .col{margin-top:0;margin-bottom:0;width:100%}.mergeAdjacent .collapsible-toggle[data-v-a72c16aa]{border:0;border-top-left-radius:0!important;border-top-right-radius:0!important}[data-v-a72c16aa] .mergeAdjacent .feature:not(.dontMerge):first-child{border-top-left-radius:0!important;border-top-right-radius:0!important}.feature:not(li),.feature:not(li) button{position:relative;padding:5px;border-radius:var(--border-radius);border:2px solid rgba(0,0,0,.125);margin:var(--feature-margin);box-sizing:border-box;color:var(--feature-foreground);z-index:0;transition:all .5s,z-index 0s .5s}.can,.can button{background-color:var(--layer-color);cursor:pointer}.can:hover,.can:hover button{transform:scale(1.15);box-shadow:0 0 20px var(--points);z-index:1;transition:all .5s,z-index 0s}.locked,.locked button{background-color:var(--locked);cursor:not-allowed}.bought,.bought button{background-color:var(--bought);cursor:default}.mark[data-v-2207999f]{position:absolute;left:-25px;top:-10px;width:30px;height:30px;z-index:1;pointer-events:none;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid transparent;border-left:.3em solid transparent;font-size:10px}.star[data-v-2207999f]{left:-10px;width:0;height:0;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid #ffcc00;border-left:.3em solid transparent;font-size:10px;pointer-events:none}.star[data-v-2207999f]:before,.star[data-v-2207999f]:after{content:"";width:0;height:0;position:absolute;top:.6em;left:-1em;border-right:1em solid transparent;border-bottom:.7em solid #ffcc00;border-left:1em solid transparent;transform:rotate(-35deg)}.star[data-v-2207999f]:after{transform:rotate(35deg)}.node[data-v-a48cb382]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.clickable[data-v-211328c0]{min-height:120px;width:120px;font-size:10px}.clickable.small[data-v-211328c0]{min-height:unset}.clickable>*[data-v-211328c0]{pointer-events:none}.resize-listener[data-v-063f6d6b]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}svg[data-v-063f6d6b]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:-10;pointer-events:none}.left-side-nodes[data-v-39ca96d0]{position:absolute;left:15px;top:65px}.side-nodes[data-v-39ca96d0]{position:absolute;right:15px;top:65px}.left-side-nodes[data-v-39ca96d0] .treeNode,.side-nodes[data-v-39ca96d0] .treeNode{margin:20px auto}.small[data-v-39ca96d0] .treeNode{height:60px;width:60px}.small[data-v-39ca96d0] .treeNode>*:first-child{font-size:30px}.treeNode[data-v-727230a6]{height:100px;width:100px;border-radius:50%;padding:0;margin:0 10px}.treeNode>*[data-v-727230a6]:first-child{width:100%;height:100%;border:2px solid rgba(0,0,0,.125);border-radius:inherit;font-size:40px;color:#00000080;text-shadow:2px 2px 4px rgba(0,0,0,.25);box-shadow:-4px -4px 4px #00000040 inset,0 0 20px var(--background);display:flex}.treeNode>*:first-child>*[data-v-727230a6]{pointer-events:none}.modifier-toggle{padding-right:10px;transform:translateY(-1px);display:inline-block}.modifier-toggle.collapsed{transform:translate(-5px,-5px) rotate(-90deg)}.nav-container{margin-top:-50px;text-align:left;border-bottom:solid 1px var(--outline);margin-left:-10px;margin-right:-10px;padding:10px;width:100%}.nav-segment:not(:last-child){border-right:solid 1px var(--outline);padding-right:10px;margin-right:10px}.nav-segment .tooltip-container{display:inline}.affected-node{filter:drop-shadow(0px 0px 20px var(--accent1))}.achievement.final{border-color:var(--accent3)}.showNotif .body{filter:drop-shadow(0px 0px 20px var(--foreground))}.achievement[data-v-5673325a]{height:90px;width:90px;font-size:10px;color:#fff;text-shadow:0 0 2px #000000}.achievement[data-v-5673325a]:not(.small){height:unset;width:calc(100% - 10px);min-width:120px;padding-left:5px;padding-right:5px;background-color:var(--locked);border-width:4px;border-radius:5px;color:#00000080;font-size:unset;text-shadow:unset}.achievement.done[data-v-5673325a]{background-color:var(--bought);cursor:default}.achievement[data-v-5673325a] .equal-spaced{display:flex;justify-content:center}.achievement[data-v-5673325a] .equal-spaced>*{margin:auto}.upgrade[data-v-9be6bac0]{min-height:120px;width:120px;font-size:10px}.upgrade>*[data-v-9be6bac0]{pointer-events:none}.game-over-modal-header[data-v-4a50ce42]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.game-over-modal-header *[data-v-4a50ce42]{margin:0}.game-over-modal-logo[data-v-4a50ce42]{height:4em;width:4em}.game-over-modal-title[data-v-4a50ce42]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.game-over-footer[data-v-4a50ce42]{display:flex;justify-content:flex-end}.game-over-footer button[data-v-4a50ce42]{margin:0 10px}.game-over-modal-discord-link[data-v-4a50ce42]{display:flex;align-items:center}.game-over-modal-discord[data-v-4a50ce42]{margin:0 4px 0 0}.nan-modal-header[data-v-2776d67d]{padding:10px 0;margin-left:10px}.nan-footer[data-v-2776d67d]{display:flex;justify-content:flex-end}.nan-footer button[data-v-2776d67d]{margin:0 10px}.nan-modal-discord-link[data-v-2776d67d]{display:flex;align-items:center}.nan-modal-discord[data-v-2776d67d]{margin:0 4px 0 0}.tpsDisplay[data-v-46a3ed5b]{position:absolute;left:10px;bottom:10px;z-index:100}.low[data-v-46a3ed5b]{color:var(--danger)}.fade-leave-to[data-v-46a3ed5b]{opacity:0}:root{color-scheme:dark}*{transition-duration:.5s;font-family:Roboto Mono,monospace;font-weight:700;margin:auto;text-size-adjust:none}*:focus{outline:none}body{overflow:hidden;transition:none;text-align:center}html,body,#app{min-height:100%;height:100%}h1,h2,h3,b,input{display:inline}button{color:#000}a,.button,.link{display:block;color:var(--link);background:none;border:none;cursor:pointer;text-decoration:none}a:hover,.button:hover,.link:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--link)}.button:disabled{opacity:.5;cursor:not-allowed}.button:disabled:hover{text-shadow:none}ul{list-style-type:none}.Vue-Toastification__toast{margin:unset}.app[data-v-41d15e5e]{background-color:var(--background);color:var(--foreground);display:flex;flex-flow:column;min-height:100%;height:100%}#modal-root[data-v-41d15e5e]{position:absolute;min-height:100%;height:100%;color:var(--foreground)} +.table{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;max-width:100%;margin:0 auto}.table+.table{margin-top:10px}.row{display:flex;flex-flow:row wrap;justify-content:center;align-items:stretch;max-width:100%;margin:0 10px}.row>:not(.feature){margin:0;display:flex}.col{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;height:100%;margin:10px 0}.row.mergeAdjacent>.feature:not(.dontMerge),.row.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin-left:0;margin-right:0;border-radius:0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child,.row.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:var(--border-radius) 0 0 var(--border-radius)}.row.mergeAdjacent>.feature:not(.dontMerge):last-child,.row.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0 var(--border-radius) var(--border-radius) 0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child:last-child,.row.mergeAdjacent>.tooltip-container:first-child:last-child>.feature:not(.dontMerge){border-radius:var(--border-radius)}.row-grid.mergeAdjacent>.feature:not(.dontMerge),.row-grid.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin:0;border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):last-child,.row-grid.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):first-child,.row-grid.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):first-child{border-radius:0 0 0 var(--border-radius)}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):last-child{border-radius:0 var(--border-radius) 0 0}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):first-child{border-radius:var(--border-radius) 0 0 0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) 0}.col.mergeAdjacent .feature:not(.dontMerge){margin-top:0;margin-bottom:0;border-radius:0}.col.mergeAdjacent .feature:not(.dontMerge):first-child{border-radius:var(--border-radius) var(--border-radius) 0 0}.col.mergeAdjacent .feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) var(--border-radius)}.col.mergeAdjacent .feature:not(.dontMerge):first-child:last-child{border-radius:var(--border-radius)}.resize-listener[data-v-2b1dc1bc]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}.modal-mask{position:fixed;z-index:9998;top:0;left:0;bottom:0;right:0;background-color:#00000080;transition:opacity .3s ease}.modal-wrapper{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.modal-container{width:640px;max-width:95vw;max-height:95vh;background-color:var(--background);padding:20px;border-radius:5px;transition:all .3s ease;text-align:left;border:var(--modal-border);box-sizing:border-box;display:flex;flex-direction:column}.modal-header{width:100%}.modal-body{margin:20px 0;width:100%;overflow-y:auto;overflow-x:hidden}.modal-footer{width:100%}.modal-default-footer{display:flex}.modal-default-flex-grow{flex-grow:1}.modal-enter-from,.modal-leave-active{opacity:0}.modal-enter-from .modal-container,.modal-leave-active .modal-container{-webkit-transform:scale(1.1);transform:scale(1.1)}.layer-container[data-v-72dd78b1]{min-width:100%;min-height:100%;margin:0;flex-grow:1;display:flex;isolation:isolate}.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:20px;padding-bottom:20px;min-height:100%;flex-grow:1;text-align:center;position:relative}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:50px}.layer-tab.minimized[data-v-72dd78b1]{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;padding:55px 0 0;margin:0;cursor:pointer;font-size:40px;color:var(--foreground);border:none;background-color:transparent}.layer-tab.minimized>*[data-v-72dd78b1]{margin:0;writing-mode:vertical-rl;text-align:left;padding-left:10px;width:50px}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){margin:-50px -10px;padding:50px 10px}.modal-body .layer-tab[data-v-72dd78b1]{padding-bottom:0}.modal-body .layer-tab[data-v-72dd78b1]:not(.hasSubtabs){padding-top:0}.minimize[data-v-72dd78b1]{position:sticky;top:6px;right:9px;z-index:7;line-height:30px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:40px;cursor:pointer;margin-top:-44px;margin-right:-30px}.minimized+.minimize[data-v-72dd78b1]{transform:rotate(-90deg);top:10px;right:18px;pointer-events:none}.goBack[data-v-72dd78b1]{position:sticky;top:10px;left:10px;line-height:30px;margin-top:-50px;margin-left:-35px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:30px;cursor:pointer;z-index:7}.goBack[data-v-72dd78b1]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}.layer-tab.minimized>*>.desc{color:var(--accent1);font-size:30px}details[data-v-4b4bda40]{margin:10px 0;padding-left:18px}summary[data-v-4b4bda40]{cursor:pointer;margin-bottom:10px;margin-left:-18px}ul[data-v-4b4bda40]{margin:var(--feature-margin) 0;background:var(--raised-background);border:2px solid rgba(0,0,0,.125);padding:5px 5px 5px 15px;list-style:inside}li[data-v-4b4bda40]{margin:8px 0}li[data-v-4b4bda40]:before{padding:2px 8px;margin-right:8px;border-radius:var(--border-radius)}.feature[data-v-4b4bda40]:before{content:"Feature";background:var(--accent1)}.fix[data-v-4b4bda40]:before{content:"Fix";background:var(--accent2)}.balancing[data-v-4b4bda40]:before{content:"Balancing";background:var(--accent3)}.breaking[data-v-4b4bda40]:before{content:"Breaking";background:var(--danger)}.tooltip-container[data-v-6102fa3a]{position:relative;--xoffset: 0px;--yoffset: 0px;text-shadow:none!important}.tooltip[data-v-6102fa3a],.tooltip[data-v-6102fa3a]:after{pointer-events:none;position:absolute}.tooltip[data-v-6102fa3a]{text-align:center;width:150px;font-size:14px;line-height:1.2;bottom:calc(100% + var(--yoffset));left:calc(50% + var(--xoffset));margin-bottom:5px;transform:translate(-50%);padding:7px;border-radius:3px;background-color:var(--tooltip-background);color:var(--points);z-index:100!important;word-break:break-word}.tooltip[data-v-6102fa3a] hr{margin:var(--feature-margin) 0}.shown[data-v-6102fa3a]{z-index:10}.fade-enter-from[data-v-6102fa3a],.fade-leave-to[data-v-6102fa3a]{opacity:0}.tooltip[data-v-6102fa3a]:after{content:" ";position:absolute;top:100%;bottom:100%;left:calc(50% - var(--xoffset));width:0;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--tooltip-background) transparent transparent transparent}.tooltip.left[data-v-6102fa3a],.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top){bottom:calc(50% + var(--yoffset));left:unset;right:calc(100% + var(--xoffset));margin-bottom:unset;margin-right:5px;transform:translateY(50%)}.tooltip.left[data-v-6102fa3a]:after,.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top):after{top:calc(50% + var(--yoffset));bottom:unset;left:100%;right:100%;margin-left:unset;margin-top:-5px;border-color:transparent transparent transparent var(--tooltip-background)}.tooltip.right[data-v-6102fa3a]{bottom:calc(50% + var(--yoffset));left:calc(100% + var(--xoffset));margin-bottom:unset;margin-left:5px;transform:translateY(50%)}.tooltip.right[data-v-6102fa3a]:after{top:calc(50% + var(--yoffset));left:0;right:100%;margin-left:-10px;margin-top:-5px;border-color:transparent var(--tooltip-background) transparent transparent}.tooltip.bottom[data-v-6102fa3a]{top:calc(100% + var(--yoffset));bottom:unset;left:calc(50% + var(--xoffset));margin-bottom:unset;margin-top:5px;transform:translate(-50%)}.tooltip.bottom[data-v-6102fa3a]:after{top:0;margin-top:-10px;border-color:transparent transparent var(--tooltip-background) transparent}.pinned[data-v-6102fa3a]{position:absolute;right:-5px;top:-5px;transform:rotate(45deg)}.info-modal-header[data-v-4f97aa40]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.info-modal-header *[data-v-4f97aa40]{margin:0}.info-modal-logo[data-v-4f97aa40]{height:4em;width:4em}.info-modal-title[data-v-4f97aa40]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.info-modal-discord-link[data-v-4f97aa40]{display:flex;align-items:center}.info-modal-discord[data-v-4f97aa40]{margin:0 4px 0 0}.field{display:flex;position:relative;min-height:2em;margin:10px 0;user-select:none;justify-content:space-between;align-items:center}.field>*{margin:0}.vue-select{width:50%;border-radius:var(--border-radius)}.field-buttons .vue-select{width:unset}.vue-select,.vue-dropdown{border-color:var(--outline)}.vue-dropdown{background:var(--raised-background)}.vue-dropdown-item{color:var(--foreground)}.vue-dropdown-item,.vue-dropdown-item *{transition-duration:0s}.vue-dropdown-item.highlighted{background-color:var(--highlighted)}.vue-dropdown-item.selected,.vue-dropdown-item.highlighted.selected{background-color:var(--bought)}.vue-input input{font-size:inherit}.vue-input input::placeholder{color:var(--link)}.field[data-v-11046116]{cursor:pointer}input[data-v-11046116]{appearance:none;pointer-events:none}span[data-v-11046116]{width:100%;padding-right:41px;position:relative}input+span[data-v-11046116]:before{content:"";position:absolute;top:calc(50% - 7px);right:0px;border-radius:7px;width:36px;height:14px;background-color:var(--outline);opacity:.38;vertical-align:top;transition:background-color .2s,opacity .2s}input+span[data-v-11046116]:after{content:"";position:absolute;top:calc(50% - 10px);right:16px;border-radius:50%;width:20px;height:20px;background-color:var(--locked);box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;transition:background-color .2s,transform .2s}input:checked+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked+span[data-v-11046116]:after{background-color:var(--link);transform:translate(16px)}input:active+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked:active+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:disabled+span[data-v-11046116]{color:#000;opacity:.38;cursor:default}input:disabled+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:checked:disabled+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}.feedback[data-v-01a1b95c]{position:relative}.feedback[data-v-01a1b95c]:after{position:absolute;left:calc(100% + 5px);top:50%;transform:translateY(-50%);content:"\2714";opacity:0;pointer-events:none;box-shadow:inset 0 0 0 35px #6f94b600;text-shadow:none}.feedback.left[data-v-01a1b95c]:after{left:unset;right:calc(100% + 5px)}.feedback.activated[data-v-01a1b95c]:after{animation:feedback-01a1b95c .5s ease-out forwards}@keyframes feedback-01a1b95c{0%{opacity:1;transform:scale3d(.4,.4,1),translateY(-50%)}80%{opacity:.1}to{opacity:0;transform:scale3d(1.2,1.2,1),translateY(-50%)}}.option-tabs{border-bottom:2px solid var(--outline);margin-top:10px;margin-bottom:-10px}.option-tabs button{background-color:transparent;color:var(--foreground);margin-bottom:-2px;font-size:14px;cursor:pointer;padding:5px 20px;border:none;border-bottom:2px solid var(--foreground)}.option-tabs button:not(.selected){border-bottom-color:transparent}.option-title .tooltip-container{display:inline;margin-left:5px}.option-title desc{display:block;opacity:.6;font-size:small;width:300px;margin-left:0}.save-button{text-align:right}form[data-v-90bd4994]{margin:0;width:100%}.field>*[data-v-90bd4994]{margin:0}input[data-v-90bd4994]{width:50%;outline:none;border:solid 1px var(--outline);background-color:unset;border-radius:var(--border-radius)}.fullWidth[data-v-90bd4994]{width:100%}.container[data-v-2f8ef34c]{display:flex;align-items:center;background:var(--raised-background);box-shadow:var(--raised-background) 0 2px 3px 5px}.container.confirming button[data-v-2f8ef34c]{font-size:1em}.container>*[data-v-2f8ef34c]{margin:0 4px}.danger,.button.danger{position:relative;border:solid 2px var(--danger);border-right-width:16px}.danger:after{position:absolute;content:"!";color:#fff;right:-13px}.save[data-v-32313015]{position:relative;border:solid 4px var(--outline);padding:4px;background:var(--raised-background);margin:var(--feature-margin);display:flex;align-items:center;min-height:30px}.save.active[data-v-32313015]{border-color:var(--bought)}.open[data-v-32313015]{display:inline;margin:0;padding-left:0}.handle[data-v-32313015]{flex-grow:0;margin-right:8px;margin-left:0;cursor:pointer}.details[data-v-32313015]{margin:0 80px 0 0;flex-grow:1}.error[data-v-32313015]{font-size:.8em;color:var(--danger)}.save-version[data-v-32313015]{margin-left:4px;font-size:.7em;opacity:.7}.actions[data-v-32313015]{position:absolute;top:0;bottom:0;right:4px;display:flex;padding:4px;z-index:1}.editname[data-v-32313015]{margin:0}.save button{transition-duration:0s}.save .actions button{display:flex;font-size:1.2em}.save .actions button .material-icons{font-size:unset}.save .button.danger{display:flex;align-items:center;padding:4px}.save .field,.field form[data-v-2a4275be],.field .field-title[data-v-2a4275be],.field .field-buttons[data-v-2a4275be]{margin:0}.field-buttons[data-v-2a4275be]{display:flex}.field-buttons .field[data-v-2a4275be]{margin:0 0 0 8px}.modal-footer[data-v-2a4275be]{margin-top:-20px}.footer[data-v-2a4275be]{display:flex;margin-top:20px}.importingFailed input{color:red}.field-buttons .v-select{width:220px}.presets .vue-select[aria-expanded=true] vue-dropdown{visibility:hidden}.nav[data-v-318a1c31]{background-color:var(--raised-background);display:flex;left:0;right:0;top:0;height:46px;width:100%;border-bottom:4px solid var(--outline)}.nav>*[data-v-318a1c31]{height:46px;width:46px;display:flex;cursor:pointer;flex-shrink:0}.nav>.banner[data-v-318a1c31]{height:100%;width:unset}.overlay-nav[data-v-318a1c31]{position:fixed;top:10px;left:10px;display:flex;flex-direction:column;z-index:2}.overlay-nav>*[data-v-318a1c31]{height:50px;width:50px;display:flex;cursor:pointer;margin:0;align-items:center;justify-content:center}.title[data-v-318a1c31]{font-size:36px;text-align:left;margin-left:12px;cursor:unset}.nav>.title[data-v-318a1c31]{width:unset;flex-shrink:1;overflow:hidden;white-space:nowrap}.nav .saves[data-v-318a1c31],.nav .info[data-v-318a1c31]{display:flex}.tooltip-container[data-v-318a1c31]{width:100%;height:100%;display:flex}.overlay-nav .discord[data-v-318a1c31]{position:relative}.discord img[data-v-318a1c31]{width:100%;height:100%}.discord-links[data-v-318a1c31]{position:fixed;top:45px;padding:20px;right:-280px;width:200px;transition:right .25s ease;background:var(--raised-background);z-index:10}.overlay-nav .discord-links[data-v-318a1c31]{position:absolute;left:-280px;right:unset;transition:left .25s ease}.overlay-nav .discord:hover .discord-links[data-v-318a1c31]{left:-10px}.discord-links li[data-v-318a1c31]{margin-bottom:4px}.discord-links li[data-v-318a1c31]:first-child{font-size:1.2em}*:not(.overlay-nav) .discord:hover .discord-links[data-v-318a1c31]{right:0}.material-icons[data-v-318a1c31]{font-size:36px}.material-icons[data-v-318a1c31]:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--foreground)}.nav .version-container[data-v-318a1c31]{display:flex;height:25px;margin-bottom:0;margin-left:10px}.overlay-nav .version-container[data-v-318a1c31]{width:unset;height:25px}.version[data-v-318a1c31]{color:var(--points)}.version:hover span[data-v-318a1c31]{text-shadow:5px 0 10px var(--points),-3px 0 12px var(--points)}.nav>div>a[data-v-318a1c31],.overlay-nav>div>a[data-v-318a1c31]{color:var(--foreground);text-shadow:none}.tabs-container[data-v-dcd207b4]{width:100vw;flex-grow:1;overflow-x:auto;overflow-y:hidden;display:flex}.tabs-container[data-v-dcd207b4]:not(.useHeader){width:calc(100vw - 50px);margin-left:50px}.tab[data-v-dcd207b4]{position:relative;height:100%;flex-grow:1;transition-duration:0s;overflow-y:auto;overflow-x:hidden}.inner-tab[data-v-dcd207b4]{padding:50px 10px;min-height:calc(100% - 100px);display:flex;flex-direction:column;margin:0;flex-grow:1}.tab+.tab>.inner-tab[data-v-dcd207b4]{border-left:solid 4px var(--outline)}.tab hr{height:4px;border:none;background:var(--outline);margin:var(--feature-margin) 0}.tab .modal-body hr{margin:7px 0}.sticky[data-v-cccac690]{position:sticky;background:var(--background);width:calc(100% - 2px);z-index:3}.link[data-v-57c4970a]{transition-duration:0s}.link.pulsing[data-v-57c4970a]{animation:pulsing-57c4970a 2s ease-in infinite}@keyframes pulsing-57c4970a{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.action:not(.boardnode):hover circle[data-v-9efb2a56],.action:not(.boardnode).selected circle[data-v-9efb2a56]{r:25}.action:not(.boardnode):hover text[data-v-9efb2a56],.action:not(.boardnode).selected text[data-v-9efb2a56]{font-size:187.5%}.action:not(.boardnode) text[data-v-9efb2a56]{text-anchor:middle;dominant-baseline:central}.actions-enter-from .action,.actions-leave-to .action{transform:translate(0)}.boardnode[data-v-4654be02]{cursor:pointer;transition-duration:0s}.boardnode:hover .body[data-v-4654be02]{fill:var(--highlighted)}.boardnode.running .body[data-v-4654be02]{fill:var(--accent1)!important}.boardnode:not(.isDraggable) .body[data-v-4654be02]{fill:var(--locked)}.node-title[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:200%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.node-subtitle[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:150%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.progress[data-v-4654be02]{transition-duration:.05s}.progressRing[data-v-4654be02]{transform:rotate(-90deg)}.fade-enter-from[data-v-4654be02],.fade-leave-to[data-v-4654be02]{opacity:0}.pulsing[data-v-4654be02]{animation:pulsing-4654be02 2s ease-in infinite}@keyframes pulsing-4654be02{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.grow-enter-from .node-container,.grow-leave-to .node-container{transform:scale(0)}.vue-pan-zoom-scene{width:100%;height:100%;cursor:grab}.vue-pan-zoom-scene:active{cursor:grabbing}.g1{transition-duration:0s}.link-enter-from,.link-leave-to{opacity:0}.tabButton[data-v-21427abb]{background-color:transparent;color:var(--foreground);font-size:20px;cursor:pointer;padding:5px 20px;margin:5px;border-radius:5px;border:2px solid;flex-shrink:0;border-color:var(--layer-color)}.tabButton[data-v-21427abb]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}:not(.floating)>.tabButton[data-v-21427abb]{height:50px;margin:0;border-left:none;border-right:none;border-top:none;border-bottom-width:4px;border-radius:0;transform:unset}:not(.floating) .tabButton[data-v-21427abb]:not(.active){border-bottom-color:transparent}.tabButton>*[data-v-21427abb]{pointer-events:none}.tab-family-container[data-v-58dbf83a]{margin:calc(50px + var(--feature-margin)) 20px var(--feature-margin) 20px;position:relative;border:solid 4px;border-color:var(--outline)}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child{margin:-4px -11px var(--feature-margin) -11px}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child:nth-last-child(3){border-bottom-style:none;border-left-style:none;border-right-style:none;height:calc(100% + 50px)}.modal-body>.tab-family-container[data-v-58dbf83a]:first-child{margin:calc(10px + var(--feature-margin)) 10px 0 10px;border:none}.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:20px}.modal-body>.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:50px}.tab-family-container[data-v-f18896fc][data-v-58dbf83a]>:last-child{margin-bottom:20px}.tab-buttons-container[data-v-58dbf83a]{z-index:4}.tab-buttons-container[data-v-58dbf83a]:not(.floating){border-bottom:solid 4px;border-color:inherit}:not(.layer-tab):not(.modal-body)>.tab-family-container>.tab-buttons-container[data-v-58dbf83a]:not(.floating){width:calc(100% + 6px);margin-left:-3px}.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{text-align:left;margin-bottom:-4px}.tab-buttons-container.floating .tab-buttons[data-v-58dbf83a]{justify-content:center;margin-top:-25px}.tab-buttons[data-v-58dbf83a]{margin-bottom:24px;display:flex;flex-flow:wrap;z-index:4}.layer-tab>.tab-family-container:first-child:nth-last-child(3)>.tab-buttons-container>.tab-buttons[data-v-58dbf83a]{padding-right:60px}.tab-buttons[data-v-58dbf83a]:not(.floating){text-align:left;border-bottom:inherit;border-width:4px;box-sizing:border-box;height:50px}.modal-body .tab-buttons[data-v-58dbf83a]{width:100%;margin-left:0;margin-right:0;padding-left:0}.showGoBack>.tab-family-container:first-child>.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{padding-left:70px}:not(.showGoBack)>.tab-family-container>.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{padding-left:0}.minimizable>.tab-buttons-container[data-v-58dbf83a]:not(.floating):first-child{padding-right:50px}.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{margin-top:-50px}.tab-buttons-container+*[data-v-58dbf83a]{margin-top:20px}.modifier-container{display:flex;padding:1px 8px}.modifier-container:nth-child(2n){background:var(--raised-background)}.modifier-amount{flex-shrink:0;text-align:right}:not(:first-of-type,:last-of-type)>.modifier-amount:after{content:var(--unit);opacity:0}.modifier-description{flex-grow:1}.collapsible-container[data-v-a72c16aa]{width:calc(100% - 10px)}.collapsible-toggle[data-v-a72c16aa]{max-width:unset;width:calc(100% + 0px);margin:0 0 0 -5px;background:var(--raised-background);padding:var(--feature-margin);color:var(--foreground);cursor:pointer;transition-duration:0s}.collapsible-toggle[data-v-a72c16aa]:last-child{margin-left:unset}[data-v-a72c16aa] .collapsible-toggle+.table{max-width:unset;width:calc(100% + 10px);margin-left:-5px}[data-v-a72c16aa] .col{margin-top:0;margin-bottom:0;width:100%}.mergeAdjacent .collapsible-toggle[data-v-a72c16aa]{border:0;border-top-left-radius:0!important;border-top-right-radius:0!important}[data-v-a72c16aa] .mergeAdjacent .feature:not(.dontMerge):first-child{border-top-left-radius:0!important;border-top-right-radius:0!important}.feature:not(li),.feature:not(li) button{position:relative;padding:5px;border-radius:var(--border-radius);border:2px solid rgba(0,0,0,.125);margin:var(--feature-margin);box-sizing:border-box;color:var(--feature-foreground);z-index:0;transition:all .5s,z-index 0s .5s}.can,.can button{background-color:var(--layer-color);cursor:pointer}.can:hover,.can:hover button{transform:scale(1.15);box-shadow:0 0 20px var(--points);z-index:1;transition:all .5s,z-index 0s}.locked,.locked button{background-color:var(--locked);cursor:not-allowed}.bought,.bought button{background-color:var(--bought);cursor:default}.mark[data-v-2207999f]{position:absolute;left:-25px;top:-10px;width:30px;height:30px;z-index:1;pointer-events:none;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid transparent;border-left:.3em solid transparent;font-size:10px}.star[data-v-2207999f]{left:-10px;width:0;height:0;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid #ffcc00;border-left:.3em solid transparent;font-size:10px;pointer-events:none}.star[data-v-2207999f]:before,.star[data-v-2207999f]:after{content:"";width:0;height:0;position:absolute;top:.6em;left:-1em;border-right:1em solid transparent;border-bottom:.7em solid #ffcc00;border-left:1em solid transparent;transform:rotate(-35deg)}.star[data-v-2207999f]:after{transform:rotate(35deg)}.node[data-v-a48cb382]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.clickable[data-v-211328c0]{min-height:120px;width:120px;font-size:10px}.clickable.small[data-v-211328c0]{min-height:unset}.clickable>*[data-v-211328c0]{pointer-events:none}.resize-listener[data-v-063f6d6b]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}svg[data-v-063f6d6b]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:-10;pointer-events:none}.left-side-nodes[data-v-39ca96d0]{position:absolute;left:15px;top:65px}.side-nodes[data-v-39ca96d0]{position:absolute;right:15px;top:65px}.left-side-nodes[data-v-39ca96d0] .treeNode,.side-nodes[data-v-39ca96d0] .treeNode{margin:20px auto}.small[data-v-39ca96d0] .treeNode{height:60px;width:60px}.small[data-v-39ca96d0] .treeNode>*:first-child{font-size:30px}.treeNode[data-v-727230a6]{height:100px;width:100px;border-radius:50%;padding:0;margin:0 10px}.treeNode>*[data-v-727230a6]:first-child{width:100%;height:100%;border:2px solid rgba(0,0,0,.125);border-radius:inherit;font-size:40px;color:#00000080;text-shadow:2px 2px 4px rgba(0,0,0,.25);box-shadow:-4px -4px 4px #00000040 inset,0 0 20px var(--background);display:flex}.treeNode>*:first-child>*[data-v-727230a6]{pointer-events:none}.modifier-toggle{padding-right:10px;transform:translateY(-1px);display:inline-block}.modifier-toggle.collapsed{transform:translate(-5px,-5px) rotate(-90deg)}.nav-container{margin-top:-50px;text-align:left;border-bottom:solid 1px var(--outline);margin-left:-10px;margin-right:-10px;padding:10px;width:100%}.nav-segment:not(:last-child){border-right:solid 1px var(--outline);padding-right:10px;margin-right:10px}.nav-segment .tooltip-container{display:inline}.affected-node{filter:drop-shadow(0px 0px 20px var(--accent1))}.achievement.final{border-color:var(--accent3)}.showNotif .body{filter:drop-shadow(0px 0px 20px var(--foreground))}.achievement[data-v-5673325a]{height:90px;width:90px;font-size:10px;color:#fff;text-shadow:0 0 2px #000000}.achievement[data-v-5673325a]:not(.small){height:unset;width:calc(100% - 10px);min-width:120px;padding-left:5px;padding-right:5px;background-color:var(--locked);border-width:4px;border-radius:5px;color:#00000080;font-size:unset;text-shadow:unset}.achievement.done[data-v-5673325a]{background-color:var(--bought);cursor:default}.achievement[data-v-5673325a] .equal-spaced{display:flex;justify-content:center}.achievement[data-v-5673325a] .equal-spaced>*{margin:auto}.bar[data-v-6bd06b56]{position:relative;display:table}.overlayTextContainer[data-v-6bd06b56]{position:absolute;border-radius:10px;vertical-align:middle;display:flex;justify-content:center;z-index:3}.overlayText[data-v-6bd06b56]{z-index:6}.border[data-v-6bd06b56]{border:2px solid;border-radius:10px;border-color:var(--foreground);overflow:hidden;mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);margin:0}.fill[data-v-6bd06b56]{position:absolute;background-color:var(--foreground);overflow:hidden;margin-left:-.5px;transition-duration:.2s;z-index:2;transition-duration:.05s}.upgrade[data-v-9be6bac0]{min-height:120px;width:120px;font-size:10px}.upgrade>*[data-v-9be6bac0]{pointer-events:none}.game-over-modal-header[data-v-4a50ce42]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.game-over-modal-header *[data-v-4a50ce42]{margin:0}.game-over-modal-logo[data-v-4a50ce42]{height:4em;width:4em}.game-over-modal-title[data-v-4a50ce42]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.game-over-footer[data-v-4a50ce42]{display:flex;justify-content:flex-end}.game-over-footer button[data-v-4a50ce42]{margin:0 10px}.game-over-modal-discord-link[data-v-4a50ce42]{display:flex;align-items:center}.game-over-modal-discord[data-v-4a50ce42]{margin:0 4px 0 0}.nan-modal-header[data-v-2776d67d]{padding:10px 0;margin-left:10px}.nan-footer[data-v-2776d67d]{display:flex;justify-content:flex-end}.nan-footer button[data-v-2776d67d]{margin:0 10px}.nan-modal-discord-link[data-v-2776d67d]{display:flex;align-items:center}.nan-modal-discord[data-v-2776d67d]{margin:0 4px 0 0}.tpsDisplay[data-v-46a3ed5b]{position:absolute;left:10px;bottom:10px;z-index:100}.low[data-v-46a3ed5b]{color:var(--danger)}.fade-leave-to[data-v-46a3ed5b]{opacity:0}:root{color-scheme:dark}*{transition-duration:.5s;font-family:Roboto Mono,monospace;font-weight:700;margin:auto;text-size-adjust:none}*:focus{outline:none}body{overflow:hidden;transition:none;text-align:center}html,body,#app{min-height:100%;height:100%}h1,h2,h3,b,input{display:inline}button{color:#000}a,.button,.link{display:block;color:var(--link);background:none;border:none;cursor:pointer;text-decoration:none}a:hover,.button:hover,.link:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--link)}.button:disabled{opacity:.5;cursor:not-allowed}.button:disabled:hover{text-shadow:none}ul{list-style-type:none}.Vue-Toastification__toast{margin:unset}.app[data-v-41d15e5e]{background-color:var(--background);color:var(--foreground);display:flex;flex-flow:column;min-height:100%;height:100%}#modal-root[data-v-41d15e5e]{position:absolute;min-height:100%;height:100%;color:var(--foreground)} diff --git a/assets/index.be8580f0.js b/assets/index.be8580f0.js new file mode 100644 index 0000000..986c8d0 --- /dev/null +++ b/assets/index.be8580f0.js @@ -0,0 +1,18 @@ +/* empty css */import"./vue.c16a309b.js";import{_ as S,C as s,l as Fe,q as pn,t as j,b2 as ut,ab as K,aF as I,a1 as T,a2 as k,aL as Rt,G as ye,aD as ar,w as ct,b3 as ht,a9 as g,O as ae,ap as Lr,az as di,as as Lt,aH as Xn,A as $e,$ as te,b7 as Z,b9 as Pi,ar as Bt,bv as kn,a8 as F,bt as Br,bc as Sn,T as jr,u as Ti,j as zr,bw as Dt,aM as yt,a0 as L,aO as Be,J as se,I as Ae,aI as gn,aG as mn,z as en,bo as Ur,bs as Gr,aK as Mn,bd as Ui,am as ii,H as Wr,bx as Hr,bf as Zr}from"./@vue.6b211d3c.js";import{c as sr}from"./nanoevents.1080beb7.js";import{L as Jt}from"./lz-string.dccec454.js";import{Y as Yr}from"./vue-next-select.ded54c4a.js";import{D as Xr}from"./vuedraggable.1879de79.js";import{p as Jr}from"./vue-textarea-autosize.35804eaf.js";import{P as Kr}from"./vue-panzoom.8ce6f9b1.js";import{s as Qr,u as fi}from"./vue-toastification.9c2dad53.js";import{n as ea,t as ta,l as na}from"./unique-names-generator.5494b30b.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";const ia=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}};ia();const ra="modulepreload",Gi={},aa="./",Bn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${aa}${i}`,i in Gi)return;Gi[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const l=document.createElement("link");if(l.rel=r?"stylesheet":ra,r||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),r)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},sa="./projInfo-schema.json",oa="Planar Pioneers",la="A game about controlling and exploiting planes!",ua="planar-pioneers",ca="thepaperpilot",da="",fa="",pa="0.0",ga="Initial Commit",ma=!1,va=!1,ha=2,ba=!0,ya=null,wa="",_a=["main"],Na=3600,Ca=0,ka=!0,Sa="base64";var me={$schema:sa,title:oa,description:la,id:ua,author:ca,discordName:da,discordLink:fa,versionNumber:pa,versionTitle:ga,allowGoBack:ma,defaultShowSmall:va,defaultDecimalsShown:ha,useHeader:ba,banner:ya,logo:wa,initialTabs:_a,maxTickLength:Na,offlineLimit:Ca,enablePausing:ka,exportEncoding:Sa};class Ma{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const i=new Ia(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class Ia{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Ni=17,$a=9e15,xa=Math.log10(9e15),Ea=1/9e15,Pa=308,Ta=-324,Wi=5,Da=(1<<10)-1,Fa=function(){const e=[];for(let n=Ta+1;n<=Pa;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),an=[2,Math.E,3,4,5,6,7,8,9,10],Aa=[[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]],Oa=[[-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 M=function(t){return o.fromValue_noAlloc(t)},X=function(e,t,n){return o.fromComponents(e,t,n)},ie=function(t,n,i){return o.fromComponents_noNormalize(t,n,i)};const Zt=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),a=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(a.toFixed(Math.max(i-r,0)))},Ci=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},qa=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const i=e*e;let r=e;return n=n+1/(12*r),r=r*i,n=n+1/(360*r),r=r*i,n=n+1/(1260*r),r=r*i,n=n+1/(1680*r),r=r*i,n=n+1/(1188*r),r=r*i,n=n+691/(360360*r),r=r*i,n=n+7/(1092*r),r=r*i,n=n+3617/(122400*r),Math.exp(n)/t},or=.5671432904097838,Hi=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return or;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let r=0;r<100;++r){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n).5?1:-1;if(Math.random()*20<1)return ie(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let r=Math.pow(10,i);return Math.random()>.9&&(r=Math.trunc(r)),X(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return _.floor(e.div(r).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(_.sub(1,n.pow(e))).div(_.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const a=t.add(i.mul(n)).sub(n.div(2)),l=a.pow(2);return a.neg().add(l.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const r=t.add(i.mul(n));return e.div(2).mul(r.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag=$a)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){const t=e,n=_.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const w=parseFloat(i[0]),N=parseFloat(i[1]),P=i[1].split(";");let q=1;if(P.length===2&&(q=parseFloat(P[1]),isFinite(q)||(q=1)),isFinite(w)&&isFinite(N)){const x=_.pentate(w,N,q);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const w=parseFloat(r[0]),N=parseFloat(r[1]),P=r[1].split(";");let q=1;if(P.length===2&&(q=parseFloat(P[1]),isFinite(q)||(q=1)),isFinite(w)&&isFinite(N)){const x=_.tetrate(w,N,q);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const w=parseFloat(a[0]),N=parseFloat(a[1]);if(isFinite(w)&&isFinite(N)){const P=_.pow(w,N);return this.sign=P.sign,this.layer=P.layer,this.mag=P.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}e=e.trim().toLowerCase();let l,u,c=e.split("pt");if(c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let w=parseFloat(c[1]);if(isFinite(w)||(w=1),isFinite(l)&&isFinite(u)){const N=_.tetrate(l,u,w);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let w=parseFloat(c[1]);if(isFinite(w)||(w=1),isFinite(l)&&isFinite(u)){const N=_.tetrate(l,u,w);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}const f=e.split("e"),h=f.length-1;if(h===0){const w=parseFloat(e);if(isFinite(w))return this.fromNumber(w),_.fromStringCache.size>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}else if(h===1){const w=parseFloat(e);if(isFinite(w)&&w!==0)return this.fromNumber(w),_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}const p=e.split("e^");if(p.length===2){this.sign=1,p[0].charAt(0)=="-"&&(this.sign=-1);let w="";for(let N=0;N=43&&P<=57||P===101)w+=p[1].charAt(N);else return this.layer=parseFloat(w),this.mag=parseFloat(p[1].substr(N+1)),this.normalize(),_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}if(h<1)return this.sign=0,this.layer=0,this.mag=0,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this;const y=parseFloat(f[0]);if(y===0)return this.sign=0,this.layer=0,this.mag=0,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this;let C=parseFloat(f[f.length-1]);if(h>=2){const w=parseFloat(f[f.length-2]);isFinite(w)&&(C*=Math.sign(w),C+=Ci(w))}if(!isFinite(y))this.sign=f[0]==="-"?-1:1,this.layer=h,this.mag=C;else if(h===1)this.sign=Math.sign(y),this.layer=1,this.mag=C+Math.log10(Math.abs(y));else if(this.sign=Math.sign(y),this.layer=h,h===2){const w=_.mul(X(1,2,C),M(y));return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}else this.mag=C;return this.normalize(),_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}fromValue(e){return e instanceof _?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:Zt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Zt(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<=Wi?(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):Zt(this.m,e)+"e"+Zt(this.e,e):this.layer===1?Zt(this.m,e)+"e"+Zt(this.e,e):this.layer<=Wi?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Zt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Zt(this.mag,e)}abs(){return ie(this.sign===0?0:1,this.layer,this.mag)}neg(){return ie(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?_.dZero:this.layer===0?X(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?_.dZero:this.layer===0?X(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?_.dZero:this.layer===0?X(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?_.dZero:this.layer===0?X(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=M(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 ie(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(_.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return _.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),a=i.layer*Math.sign(i.mag);if(r-a>=2)return n;if(r===0&&a===-1){if(Math.abs(i.mag-Math.log10(n.mag))>Ni)return n;{const l=Math.pow(10,Math.log10(n.mag)-i.mag),u=i.sign+n.sign*l;return X(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}if(r===1&&a===0){if(Math.abs(n.mag-Math.log10(i.mag))>Ni)return n;{const l=Math.pow(10,n.mag-Math.log10(i.mag)),u=i.sign+n.sign*l;return X(Math.sign(u),1,Math.log10(i.mag)+Math.log10(Math.abs(u)))}}if(Math.abs(n.mag-i.mag)>Ni)return n;{const l=Math.pow(10,n.mag-i.mag),u=i.sign+n.sign*l;return X(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}plus(e){return this.add(e)}sub(e){return this.add(M(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=M(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return ie(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return ie(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return _.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return X(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return X(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return X(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=X(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(X(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return X(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=X(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(X(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return X(n.sign*i.sign,r.layer+1,r.sign*r.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=M(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?_.dNaN:this.layer===0?X(this.sign,0,1/this.mag):X(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=M(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?1:nt.mag?1:this.mag0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const n=M(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=M(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let i=this.mag,r=n.mag;return this.layer>n.layer&&(r=Ci(r)),this.layer0?X(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):X(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?_.dNaN:this.layer>0?X(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):X(this.sign,0,Math.log10(this.mag))}log(e){return e=M(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?_.dNaN:this.layer===0&&e.layer===0?X(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):_.div(this.log10(),e.log10())}log2(){return this.sign<=0?_.dNaN:this.layer===0?X(this.sign,0,Math.log2(this.mag)):this.layer===1?X(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?X(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):X(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?_.dNaN:this.layer===0?X(this.sign,0,Math.log(this.mag)):this.layer===1?X(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?X(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):X(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=M(e),n=this,i=t;if(n.sign===0)return i.eq(0)?ie(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return ie(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const r=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?r.neg():Math.abs(i.toNumber()%2)%2===0?r:_.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return _.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return X(1,0,t);if(e.sign===0)return _.dOne;e=ie(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?X(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?X(-e.sign,e.layer+1,-e.mag):_.dOne}pow_base(e){return M(e).pow(this)}root(e){const t=M(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(ie(1,0,24)))return _.fromNumber(qa(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let i=e,r=12*i,a=1/r,l=t+a;if(l===t||(t=l,i=i*n,r=360*i,a=1/r,l=t-a,l===t))return _.exp(t);t=l,i=i*n,r=1260*i;let u=1/r;return t=t+u,i=i*n,r=1680*i,u=1/r,t=t-u,_.exp(t)}else return this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?_.dOne:this.layer===0&&this.mag<=709.7?_.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?X(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?X(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):X(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return _.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return X(1,2,Math.log10(this.mag)-.3010299956639812);{const e=_.div(ie(this.sign,this.layer-1,this.mag),ie(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=ie(1,0,1)){if(e===1)return _.pow(this,t);if(e===0)return new _(t);if(this.eq(_.dOne))return _.dOne;if(this.eq(-1))return _.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return _.fromNumber(Math.E);const a=_.ln(this).neg();return a.lambertw().div(a)}else return r>1.444667861009766?_.fromNumber(Number.POSITIVE_INFINITY):_.dNaN}if(this.eq(_.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),_.fromNumber(r)}if(e<0)return _.iteratedlog(t,this,-e);t=M(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(_.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return ie(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=ie(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return _.tetrate(e,-t,this);e=M(e);let n=_.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const a=Math.min(t,n.layer-e.layer-3);t-=a,n.layer-=a}for(let a=0;a1e4)return n}return r>0&&r<1&&(e.eq(10)?n=n.layeradd10(-r):n=n.layeradd(-r,e)),n}slog(e=10,t=100){let n=.001,i=!1,r=!1,a=this.slog_internal(e).toNumber();for(let l=1;l1&&r!=c&&(i=!0),r=c,i?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),a+=n,n===0)break}return _.fromNumber(a)}slog_internal(e=10){if(e=M(e),e.lte(_.dZero)||e.eq(_.dOne))return _.dNaN;if(e.lt(_.dOne))return this.eq(_.dOne)?_.dZero:this.eq(_.dZero)?_.dNegOne:_.dNaN;if(this.mag<0||this.eq(_.dZero))return _.dNegOne;let t=0,n=_.fromDecimal(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(_.dZero))n=_.pow(e,n),t-=1;else{if(n.lte(_.dOne))return _.fromNumber(t+_.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=_.log(n,e)}return _.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:_.critical_section(e,t,Oa)}static tetrate_critical(e,t){return _.critical_section(e,t,Aa)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let i=0,r=0;for(let l=0;le){const u=(e-an[l])/(an[l+1]-an[l]);i=n[l][Math.floor(t)]*(1-u)+n[l+1][Math.floor(t)]*u,r=n[l][Math.ceil(t)]*(1-u)+n[l+1][Math.ceil(t)]*u;break}const a=t-Math.floor(t);return i<=0||r<=0?i*(1-a)+r*a:Math.pow(e,Math.log(i)/Math.log(e)*(1-a)+Math.log(r)/Math.log(e)*a)}layeradd10(e){e=_.fromValue_noAlloc(e).toNumber();const t=_.fromDecimal(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let i=0;i<100;++i){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const i=this.slog(t).toNumber()+e;return i>=0?_.tetrate(t,i):Number.isFinite(i)?i>=-1?_.log(_.tetrate(t,i+1),t):_.log(_.log(_.tetrate(t,i+2),t),t):_.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return _.fromNumber(Hi(this.toNumber()));if(this.layer===0)return _.fromNumber(Hi(this.sign*this.mag));if(this.layer===1)return Zi(this);if(this.layer===2)return Zi(this);if(this.layer>=3)return ie(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return ie(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=ie(1,0,1)){t=M(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(_.dOne)?(++e,t=_.fromNumber(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r10)return t}return t}sin(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.sin(this.sign*this.mag)):ie(0,0,0)}cos(){return this.mag<0?_.dOne:this.layer===0?_.fromNumber(Math.cos(this.sign*this.mag)):ie(0,0,0)}tan(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.tan(this.sign*this.mag)):ie(0,0,0)}asin(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.asin(this.sign*this.mag)):ie(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?_.fromNumber(Math.acos(this.toNumber())):this.layer===0?_.fromNumber(Math.acos(this.sign*this.mag)):ie(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.atan(this.sign*this.mag)):_.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 _.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return _.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?ie(Number.NaN,Number.NaN,Number.NaN):_.ln(this.add(1).div(_.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(_.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let o=_;o.fromStringCache=new Ma(Da);o.dZero=ie(0,0,0);o.dOne=ie(1,0,1);o.dNegOne=ie(-1,0,1);o.dTwo=ie(1,0,2);o.dTen=ie(1,0,10);o.dNaN=ie(Number.NaN,Number.NaN,Number.NaN);o.dInf=ie(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=ie(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=X(1,0,Number.MAX_VALUE);o.dNumberMin=X(1,0,Number.MIN_VALUE);M=o.fromValue_noAlloc;X=o.fromComponents;ie=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const Ra=new o(1);function On(e,t,n=!0){let i=o.log10(e).floor(),r=o.div(e,o.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=Ra,i=i.add(1));const a=i.gte(1e9)?be(i,Math.max(Math.max(t,3),me.defaultDecimalsShown)):i.gte(1e4)?ri(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function ri(e,t){if(e==null)return"NaN";if(e=new o(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function lr(e,t){return e==null?"NaN":(e=new o(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),me.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Va=new o("eeee1000"),La=new o("e100000"),Yi=new o("e1000"),ur=new o(1e9),Ba=new o(1e6),ja=new o(1e3),za=new o(.98),Ua=new o(.001),cr=new o(0);function be(e,t,n){if(t==null&&(t=me.defaultDecimalsShown),n=n!=null?n:me.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+be(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Va)){const i=e.slog();return i.gte(Ba)?"F"+be(i.floor()):o.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+ri(i.floor(),0)}else{if(e.gte(La))return On(e,0,!1);if(e.gte(Yi))return On(e,0);if(e.gte(ur))return On(e,t);if(e.gte(ja))return ri(e,0);if(e.gte(Ua)||!n)return lr(e,t);if(e.eq(cr))return 0 .toFixed(t)}return e=fr(e),e.lt(Yi)?On(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):be(e,t)+"\u207B\xB9"}function at(e){return e=new o(e),e.sign<0?"-"+at(e.neg()):e.gte(ur)||e.lte(za)&&!e.eq(cr)?be(e):be(e,0)}function dr(e){return o.lt(e,0)?"-"+dr(o.neg(e)):o.gt(e,2**51)?be(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?be(e)+"s":e<3600?at(Math.floor(e/60))+"m "+be(e%60)+"s":e<86400?at(Math.floor(e/3600))+"h "+at(Math.floor(e/60)%60)+"m "+at(e%60)+"s":e<31536e3?at(Math.floor(e/84600)%365)+"d "+at(Math.floor(e/3600)%24)+"h "+at(Math.floor(e/60)%60)+"m":at(Math.floor(e/31536e3))+"y "+at(Math.floor(e/84600)%365)+"d "+at(Math.floor(e/3600)%24)+"h")}function Ga(e,t,n){e=new o(e);let i=e.toStringWithDecimalPlaces(t);return new o(i).gte(n)&&(i=o.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function Wa(e,t){return be(e,t,!0)}function fr(e){let t=o.log10(e).ceil();const n=o.div(e,o.pow(10,t));return t=t.neg(),e=new o(10).pow(t).times(n),e}var Ha=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:On,commaFormat:ri,regularFormat:lr,format:be,formatWhole:at,formatTime:dr,toPlaces:Ga,formatSmall:Wa,invertOOM:fr},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:Za,commaFormat:Ya,regularFormat:Xa,format:dn,formatWhole:Ze,formatTime:pi,toPlaces:Ja,formatSmall:Kt,invertOOM:Ka}=Ha;window.Decimal=o;window.exponentialFormat=Za;window.commaFormat=Ya;window.regularFormat=Xa;window.format=dn;window.formatWhole=Ze;window.formatTime=pi;window.toPlaces=Ja;window.formatSmall=Kt;window.invertOOM=Ka;function Ye(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function ai(e){return typeof e=="function"}var W=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(W||{});const jn=Symbol("DoNotCache");function E(e,t){const n=e[t];ai(n)&&n.length===0&&!n[jn]?e[t]=S(n.bind(e)):ai(n)&&(e[t]=n.bind(e),e[t][jn]=!0)}function we(e){return ai(e)&&!e[jn]&&(e=S(e)),e}const dt=Symbol("Component"),nt=Symbol("GatherProps");let Qa=0;function vn(e="feature-"){return e+Qa++}var Ne=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Ne||{});function Le(e){const t=s(e);return t!==2&&t!==!1}function hn(e){return s(e)===1}function ee(e){return e[jn]=!0,e}function re(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function xi(e,...t){const n=[],i=r=>{Object.keys(r).forEach(a=>{const l=r[a];l!=null&&typeof l=="object"&&(t.includes(l.type)?n.push(l):!(l instanceof o)&&!Fe(l)&&i(l))})};return i(e),n}const sn={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 Di=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Di||{}),Ct={classic:sn,paper:{...sn,variables:{...sn.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:{...sn,variables:{...sn.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:{...sn,variables:{...sn.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Xe=sr();"fonts"in document&&(document.fonts.onloadingdone=()=>Xe.emit("fontsLoaded"));var es=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Xe},Symbol.toStringTag,{value:"Module"}));const ts=pn({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Q=window.player=ts;function pr(e){return JSON.stringify(e,(t,n)=>s(n))}function gr(e={}){return Object.assign({id:`${me.id}-0`,name:"Default Save",tabs:me.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:me.id,modVersion:me.versionNumber,layers:{}},e)}function st(e){const t=Jt.compressToUTF16(pr(e!=null?e:Q));return localStorage.setItem((e!=null?e:Q).id,t),t}async function ns(){as();try{let e=localStorage.getItem(le.active);if(e==null){await on(Cn());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Jt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==me.id){await on(Cn());return}t.id=le.active,await on(t)}catch(e){console.error(`Failed to load save. Falling back to new save. +`,e),await on(Cn())}}function Cn(){const e=ti(),t=gr({id:e});return st(t),le.saves.push(e),t}function ti(){let e,t=0;do e=`${me.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const is=j(!1);async function on(e){console.info("Loading save",e),is.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await Bn(()=>Promise.resolve().then(function(){return Ms}),void 0),{fixOldSave:r,getInitialLayers:a}=await Bn(()=>Promise.resolve().then(function(){return Md}),void 0);for(const l in t){const u=t[l];u&&n(u)}a(e).forEach(l=>i(l,e)),e=gr(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,me.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==me.versionNumber&&(r(e.modVersion,e),e.modVersion=me.versionNumber),Object.assign(Q,e),le.active=Q.id,Xe.emit("onLoad")}setInterval(()=>{Q.autosave&&st()},1e3);window.onbeforeunload=()=>{Q.autosave&&st()};window.save=st;const rs=window.hardReset=async()=>{await on(Cn())};window.deleteLowerSaves=()=>{const e=Object.values(le.saves).indexOf(Q.id)+1;Object.values(le.saves).slice(e).forEach(t=>localStorage.removeItem(t)),le.saves=le.saves.slice(0,e)};const zn=pn({active:"",saves:[],showTPS:!0,theme:Di.Nordic,unthrottled:!1,alignUnits:!1});ut(zn,e=>{const t=Jt.compressToUTF16(JSON.stringify(e));localStorage.setItem(me.id,t)},{deep:!0});var le=window.settings=zn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Di.Nordic,alignUnits:!1};Xe.emit("loadSettings",e),Object.assign(zn,e),rs()};function as(){try{let e=localStorage.getItem(me.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Jt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(zn,t)}Xe.emit("loadSettings",zn)}catch{}}const mr=pn([]);function ss(e){mr.push(e)}const os=pn([]),ls=pn([]),us={class:"table"},cs=K({__name:"Row",setup(e){const t=S(()=>Ct[le.theme].mergeAdjacent);return(n,i)=>(I(),T("div",us,[k("div",{class:ye(["row",{mergeAdjacent:s(t)}])},[Rt(n.$slots,"default")],2)]))}});function ds(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Lr(e)}function ue(e,t="span"){return typeof e=="function"?K({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),K({template:e})):K({render:()=>({})}):e}function tt(e){if(kt(e))return typeof e=="function"?e():ue(e);const t=e[dt];return g(t,e[nt](),null)}function ki(...e){let t;return g(cs,null,ds(t=e.map(tt))?t:{default:()=>[t]})}function bt(e){if(kt(e))return typeof e=="function"?e():typeof e=="string"?g(ae,null,[e]):g(e,null,null);const t=e[dt];return g(t,e[nt](),null)}function Xi(e,t){return e.reduce((n,i)=>g(ae,null,[n,t,i]))}function kt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[jn]===!0}function vr(e,t){const n=j(null),i=j(void 0);function r(u){n.value||(n.value=setInterval(l,250)),i.value=u}function a(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return ar(a),{start:r,stop:a,handleHolding:l}}function hr(e,t="div"){const n=ct();return ht(()=>{n.value=ue(Se(e),t)}),n}function $n(e,t="div"){const n=ct(null);return ht(()=>{const i=Se(e);n.value=i==""||i==null?null:ue(i,t)}),n}function Se(e){return s(s(e))}function R(...e){return e.includes(Object)||e.push(Object),e}function fs(e){const t=j(!1),n=e[nt].bind(e);return e[nt]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var fe=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const ps=K({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var h;const n=j({}),i=new ResizeObserver(u),r=j(null);di(()=>{const p=r.value;p!=null&&i.observe(p)});let a=!0,l=j((h=r.value)==null?void 0:h.getBoundingClientRect());function u(){a&&(a=!1,Lt(()=>{var p;l.value=(p=r.value)==null?void 0:p.getBoundingClientRect(),Object.values(n.value).filter(y=>y).forEach(y=>y.rect=y.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}Xe.on("fontsLoaded",u);const c={attributes:!1,childList:!0,subtree:!1};Xn(Fi,(p,y)=>{const C=new MutationObserver(()=>f(p));C.observe(y,c),n.value[p]={element:y,observer:C,rect:y.getBoundingClientRect()},u()}),Xn(Ai,p=>{var y;(y=n.value[p])==null||y.observer.disconnect(),n.value[p]=void 0,u()}),Xn(Oi,n),Xn(qi,l);function f(p){const y=n.value[p];y!=null&&(y.rect=y.element.getBoundingClientRect(),t("updateNodes",n.value))}return(p,y)=>(I(),T(ae,null,[Rt(p.$slots,"default",{},void 0,!0),k("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var br=fe(ps,[["__scopeId","data-v-2b1dc1bc"]]);const gs=["onPointerdown"],ms={class:"modal-wrapper"},vs={class:"modal-container"},hs={class:"modal-header"},bs={class:"modal-body"},ys={class:"modal-footer"},ws=k("div",{class:"modal-default-flex-grow"},null,-1),jt=K({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=$e(e),a=S(()=>s(r.modelValue)||u.value);function l(){n("update:modelValue",!1)}const u=j(!1),c=j(null),f=S(()=>{var h,p;return(p=(h=c.value)==null?void 0:h.nodes)!=null?p:null});return t({isOpen:a,nodes:f}),(h,p)=>(I(),te(jr,{to:"#modal-root"},[g(Sn,{name:"modal",onBeforeEnter:p[0]||(p[0]=y=>u.value=!0),onAfterLeave:p[1]||(p[1]=y=>u.value=!1)},{default:Z(()=>[Pi(k("div",Bt({class:"modal-mask",onPointerdown:kn(l,["self"])},h.$attrs),[k("div",ms,[k("div",vs,[k("div",hs,[Rt(h.$slots,"header",{shown:s(a)},()=>[F(" default header ")])]),k("div",bs,[g(br,{ref_key:"contextRef",ref:c},{default:Z(()=>[Rt(h.$slots,"body",{shown:s(a)},()=>[F(" default body ")])]),_:3},512)]),k("div",ys,[Rt(h.$slots,"footer",{shown:s(a)},()=>[k("div",{class:"modal-default-footer"},[ws,k("button",{class:"button modal-default-button",onClick:l}," Close ")])])])])])],16,gs),[[Br,e.modelValue]])]),_:3})]))}}),Xt=Symbol("ProxyState");function Ue(e,t={}){const n=t;let i=!1;function r(){return i||(Object.assign(n,e.call(n,n)),i=!0),n}return new Proxy(n,{get(a,l){if(l===Xt)return r();const u=r()[l];return u!=null&&typeof u=="object"&&Tt in u?u[Tt]:u},set(a,l,u){return r()[l]=u,!0},has(a,l){return l===Xt?!0:Reflect.has(r(),l)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(a,l){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(a,l)}})}var qe=window.state=Ti({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Qt=Symbol("PersistentState"),In=Symbol("DefaultValue"),si=Symbol("StackTrace"),oi=Symbol("Deleted"),Tt=Symbol("NonPersistent"),ln=Symbol("SaveDataPath"),Ei=Symbol("SkipPersistence");function _s(){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 Ji(e,t){var n;if(o.isNaN(t))throw qe.hasNaN||(Q.autosave=!1,qe.hasNaN=!0,qe.NaNPath=e[ln],qe.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[ln])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[Qt].value=t}function lt(e,t=!0){const n=Fe(e)?e:j(e);Fe(e)&&(e=e.value);const i=S({get(){return n.value},set(a){t?Ji(r,a):r[Qt].value=a}});i[In]=e;const r={get value(){return n.value},set value(a){t?Ji(r,a):r[Qt].value=a},__v_isRef:!0,[Qt]:n,[In]:e,[si]:_s(),[oi]:!1,[Tt]:i,[ln]:void 0};return et.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` +Created at: +`+r[si]):fn[et[et.length-1]].add(r),r}function Ns(e){return e!=null&&typeof e=="object"&&Qt in e}function Jn(e){return!(Xt in e)&&Tt in e?e[Tt]:new Proxy(e,{get(t,n){if(n!==Qt)return n===Ei?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===Qt?!1:n==Ei?!0:Reflect.has(t,n)}})}function yr(e){et.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):fn[et[et.length-1]].delete(e),e[oi]=!0}Xe.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let l=!1;return Object.keys(r).forEach(u=>{let c=r[u];if(c!=null&&typeof c=="object"){if(c[Ei]===!0)return;if(Xt in c&&(c=c[Xt]),Ns(c)){if(l=!0,c[oi]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` +Created at: +`+c[si]);return}fn[e.id].delete(c);const f=[e.id,...a,u];c[ln]!=null&&JSON.stringify(f)!==JSON.stringify(c[ln])&&console.error(`Persistent ref is being saved to \`${f.join(".")}\` when it's already present at \`${c[ln].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[ln]=f;const h=a.reduce((y,C)=>(C in y||(y[C]={}),y[C]),t),p=h[u];h[u]=c[Qt],zr(h)?p!=null?h[u]=p:h[u]=c[In]:p!=null?h[u].value=p:h[u].value=c[In]}else!(c instanceof o)&&!Fe(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,u])&&(Dt(c)&&!Dt(r)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",Xt in r?r[Xt]:r,u):l=!0))}}),l};i(e[Xt]),fn[e.id].forEach(r=>{r[oi]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,` +Created at: +`+r[si])}),fn[e.id].clear()});const Fi=Symbol("RegisterNode"),Ai=Symbol("UnregisterNode"),Oi=Symbol("Nodes"),qi=Symbol("Bounds"),ke=Ti({});window.layers=ke;const fn={},et=[];function Ri(e,t){return Ue(()=>{const n={},i=n.emitter=sr();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=j({}),n.id=e,et.push(e),fn[e]=new Set,n.minimized=lt(!1,!1),Object.assign(n,t.call(n,n)),et[et.length-1]==null||et[et.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen +Stack: ${et} +Trying to pop ${n.id}`;et.pop(),E(n,"color"),E(n,"display"),E(n,"classes"),E(n,"style"),E(n,"name"),re(n,"name",n.id),E(n,"minWidth"),re(n,"minWidth",600),E(n,"minimizable"),re(n,"minimizable",!0),E(n,"minimizedDisplay");const r=n.style;return n.style=S(()=>{var l,u;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(l=s(r))!=null?l:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Vi(e,t){if(console.info("Adding layer",e.id),ke[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ke[e.id]);return}re(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ke[e.id]=e,Xe.emit("addLayer",e,t.layers[e.id])}function Cs(e){return ke[e]}function wr(e){console.info("Removing layer",e.id),Xe.emit("removeLayer",e),ke[e.id]=void 0}function ks(e){wr(e),Vi(e,Q)}function Ss(e){const t=j(!1);return{openModal:()=>t.value=!0,modal:ee(()=>g(jt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>g("h2",null,[s(e.name)]),body:s(e.display)}))}}Xe.on("update",function(t){Object.values(ke).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ke).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ke).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Ms=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Fi,UnregisterNodeInjectionKey:Ai,NodesInjectionKey:Oi,BoundsInjectionKey:qi,layers:ke,persistentRefs:fn,addingLayers:et,createLayer:Ri,addLayer:Vi,getLayer:Cs,removeLayer:wr,reloadLayer:ks,setupLayerModal:Ss},Symbol.toStringTag,{value:"Module"}));const Is=K({components:{Context:br},props:{index:{type:Number,required:!0},display:{type:R(Object,String,Function),required:!0},minimizedDisplay:R(Object,String,Function),minimized:{type:Object,required:!0},name:{type:R(String),required:!0},color:R(String),minimizable:R(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=$e(e),a=hr(t),l=$n(r),u=S(()=>me.allowGoBack&&n.value>0&&!Se(i));function c(){Q.tabs.splice(s(e.index),1/0)}function f(h){e.nodes.value=h}return{component:a,minimizedComponent:l,showGoBack:u,updateNodes:f,unref:s,goBack:c}}}),$s={key:1};function xs(e,t,n,i,r,a){const l=yt("Context");return I(),T("div",{class:"layer-container",style:Ae({"--layer-color":e.unref(e.color)})},[e.showGoBack?(I(),T("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...u)=>e.goBack&&e.goBack(...u))},"\u274C")):L("",!0),e.unref(e.minimized)?(I(),T("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=u=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(I(),te(Be(e.minimizedComponent),{key:0})):(I(),T("div",$s,se(e.unref(e.name)),1))])):(I(),T("div",{key:2,class:ye(["layer-tab",{showGoBack:e.showGoBack}])},[g(l,{onUpdateNodes:e.updateNodes},{default:Z(()=>[(I(),te(Be(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(I(),T("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=u=>e.$emit("setMinimized",!0))}," \u25BC ")):L("",!0)],4)}var Es=fe(Is,[["render",xs],["__scopeId","data-v-72dd78b1"]]);const _r=e=>(gn("data-v-4b4bda40"),e=e(),mn(),e),Ps=_r(()=>k("h2",null,"Changelog",-1)),Ts=_r(()=>k("details",{open:""},[k("summary",null,[F("v0.0 Initial Commit - "),k("time",null,"2021-09-04")]),F(" This is the first release :D "),k("ul",null,[k("li",{class:"feature"},"Did everything"),k("li",{class:"fix"},"Had some fun"),k("li",{class:"breaking"},"Removed everything"),k("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Ds=K({__name:"Changelog",setup(e,{expose:t}){const n=j(!1);return t({open(){n.value=!0}}),(i,r)=>(I(),te(jt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:Z(()=>[Ps]),body:Z(()=>[Ts]),_:1},8,["modelValue"]))}});var Fs=fe(Ds,[["__scopeId","data-v-4b4bda40"]]),As=K({props:{element:Object,display:{type:R(Object,String,Function),required:!0},style:R(Object,String,Array),classes:R(Object),direction:R(String),xoffset:R(String),yoffset:R(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=$e(e),r=j(!1),a=S(()=>(Se(i)||r.value)&&l.value),l=$n(n),u=ct(ue(ee(()=>{const h=Se(t);return h==null?"":bt(h)})));function c(h){const p=i;h.shiftKey&&p&&(p.value=!p.value,h.stopPropagation(),h.preventDefault())}const f=S(()=>Se(i)&&Ct[le.theme].showPin);return{Direction:W,isHovered:r,isShown:a,comp:l,elementComp:u,unref:s,togglePinned:c,showPin:f}}});const Os={key:0,class:"material-icons pinned"};function qs(e,t,n,i,r,a){return I(),T("div",{class:ye(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=l=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=l=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...l)=>e.togglePinned&&e.togglePinned(...l))},[Rt(e.$slots,"default",{},void 0,!0),e.elementComp?(I(),te(Be(e.elementComp),{key:0})):L("",!0),g(Sn,{name:"fade"},{default:Z(()=>{var l;return[e.isShown?(I(),T("div",{key:0,class:ye(["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:Ae([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(l=e.unref(e.style))!=null?l:{}])},[e.showPin?(I(),T("span",Os,"push_pin")):L("",!0),e.comp?(I(),te(Be(e.comp),{key:1})):L("",!0)],6)):L("",!0)]}),_:1})],34)}var Pe=fe(As,[["render",qs],["__scopeId","data-v-6102fa3a"]]);const bn=e=>(gn("data-v-4f97aa40"),e=e(),mn(),e),Rs={class:"info-modal-header"},Vs=["src","alt"],Ls={class:"info-modal-title"},Bs={key:0},js={key:0},zs={key:0},Us=bn(()=>k("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),Gs=bn(()=>k("br",null,null,-1)),Ws=bn(()=>k("br",null,null,-1)),Hs=["href"],Zs=bn(()=>k("span",{class:"material-icons info-modal-discord"},"discord",-1)),Ys=bn(()=>k("div",null,[k("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[k("span",{class:"material-icons info-modal-discord"},"discord"),F(" The Paper Pilot Community ")])],-1)),Xs=bn(()=>k("div",null,[k("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[k("span",{class:"material-icons info-modal-discord"},"discord"),F(" The Modding Tree ")])],-1)),Js=bn(()=>k("br",null,null,-1));var Ks=K({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:a,discordName:l,discordLink:u,versionNumber:c,versionTitle:f}=me,h=$e(n),p=j(!1),y=S(()=>pi(Q.timePlayed)),C=S(()=>ue(ee(()=>g(ae,null,[os.map(tt)]))));t({open(){p.value=!0}});function w(){var N;(N=s(h.changelog))==null||N.open()}return(N,P)=>(I(),te(jt,{modelValue:p.value,"onUpdate:modelValue":P[0]||(P[0]=q=>p.value=q)},{header:Z(()=>[k("div",Rs,[s(r)?(I(),T("img",{key:0,class:"info-modal-logo",src:s(r),alt:s(i)},null,8,Vs)):L("",!0),k("div",Ls,[k("h2",null,se(s(i)),1),k("h4",null,[F(" v"+se(s(c)),1),s(f)?(I(),T("span",Bs,": "+se(s(f)),1)):L("",!0)])])])]),body:Z(({shown:q})=>[q?(I(),T("div",js,[s(a)?(I(),T("div",zs,"By "+se(s(a)),1)):L("",!0),Us,Gs,k("div",{class:"link",onClick:w},"Changelog"),Ws,k("div",null,[s(u)?(I(),T("a",{key:0,href:s(u),class:"info-modal-discord-link",target:"_blank"},[Zs,F(" "+se(s(l)),1)],8,Hs)):L("",!0)]),Ys,Xs,Js,k("div",null,"Time Played: "+se(s(y)),1),(I(),te(Be(s(C))))])):L("",!0)]),_:1},8,["modelValue"]))}});var Qs=fe(Ks,[["__scopeId","data-v-4f97aa40"]]);const eo={class:"field"},to={key:0,class:"field-title"},Li=K({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var l;const n=e,i=$n(en(n,"title"),"span"),r=j((l=n.options.find(u=>u.value===n.modelValue))!=null?l:null);ut(en(n,"modelValue"),u=>{var c;Se(r)!==u&&(r.value=(c=n.options.find(f=>f.value===u))!=null?c:null)});function a(u){t("update:modelValue",u.value)}return(u,c)=>(I(),T("div",eo,[s(i)?(I(),T("span",to,[(I(),te(Be(s(i))))])):L("",!0),g(s(Yr),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=f=>r.value=f),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const no={class:"field"},io=K({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=S(()=>{var a;return ue((a=s(n.title))!=null?a:"","span")}),r=S({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,l)=>(I(),T("label",no,[Pi(k("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":l[0]||(l[0]=u=>Fe(r)?r.value=u:null)},null,512),[[Ur,s(r)]]),(I(),te(Be(s(i))))]))}});var qt=fe(io,[["__scopeId","data-v-11046116"]]);const ro=["onClick"],ao=K({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=j(!1),i=j(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,Lt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(a,l)=>(I(),T("button",{onClick:kn(r,["stop"]),class:ye(["feedback",{activated:n.value,left:e.left}])},[Rt(a.$slots,"default",{},void 0,!0)],10,ro))}});var Nr=fe(ao,[["__scopeId","data-v-01a1b95c"]]);const so={class:"header"},oo=k("h2",null,"Settings",-1),lo={class:"option-tabs"},uo={key:0},co={key:1};var fo=K({__name:"Options",setup(e,{expose:t}){const n=j(!1),i=j("behaviour");function r(ne){return ne==i.value}function a(ne){i.value=ne}t({isTab:r,setTab:a,save:st,open(){n.value=!0}});const l=Object.keys(Ct).map(ne=>({label:Ye(ne),value:ne})),u=S(()=>ue(ee(()=>g(ae,null,[mr.map(tt)])))),{showTPS:c,theme:f,unthrottled:h,alignUnits:p}=$e(le),{autosave:y,offlineProd:C}=$e(Q),w=S({get(){return Q.devSpeed===0},set(ne){Q.devSpeed=ne?0:null}}),N=ee(()=>g("span",{class:"option-title"},[F("Unthrottled"),g("desc",null,[F("Allow the game to run as fast as possible. Not battery friendly.")])])),P=ee(()=>g("span",{class:"option-title"},[F("Offline Production"),g(Pe,{display:"Save-specific",direction:W.Right},{default:()=>[F("*")]}),g("desc",null,[F("Simulate production that occurs while the game is closed.")])])),q=ee(()=>g("span",{class:"option-title"},[F("Autosave"),g(Pe,{display:"Save-specific",direction:W.Right},{default:()=>[F("*")]}),g("desc",null,[F("Automatically save the game every second or when the game is closed.")])])),x=ee(()=>g("span",{class:"option-title"},[F("Pause game"),g(Pe,{display:"Save-specific",direction:W.Right},{default:()=>[F("*")]}),g("desc",null,[F("Stop everything from moving.")])])),D=ee(()=>g("span",{class:"option-title"},[F("Theme"),g("desc",null,[F("How the game looks.")])])),U=ee(()=>g("span",{class:"option-title"},[F("Show TPS"),g("desc",null,[F("Show TPS meter at the bottom-left corner of the page.")])])),ve=ee(()=>g("span",{class:"option-title"},[F("Align modifier units"),g("desc",null,[F("Align numbers to the beginning of the unit in modifier view.")])]));return(ne,Y)=>(I(),te(jt,{modelValue:n.value,"onUpdate:modelValue":Y[10]||(Y[10]=J=>n.value=J)},{header:Z(()=>[k("div",so,[oo,k("div",lo,[k("button",{class:ye({selected:r("behaviour")}),onClick:Y[0]||(Y[0]=J=>a("behaviour"))},"Behaviour",2),k("button",{class:ye({selected:r("appearance")}),onClick:Y[1]||(Y[1]=J=>a("appearance"))},"Appearance",2)])])]),body:Z(()=>[r("behaviour")?(I(),T("div",uo,[g(qt,{title:s(N),modelValue:s(h),"onUpdate:modelValue":Y[2]||(Y[2]=J=>Fe(h)?h.value=J:null)},null,8,["title","modelValue"]),s(me).enablePausing?(I(),te(qt,{key:0,title:s(x),modelValue:s(w),"onUpdate:modelValue":Y[3]||(Y[3]=J=>Fe(w)?w.value=J:null)},null,8,["title","modelValue"])):L("",!0),g(qt,{title:s(P),modelValue:s(C),"onUpdate:modelValue":Y[4]||(Y[4]=J=>Fe(C)?C.value=J:null)},null,8,["title","modelValue"]),g(qt,{title:s(q),modelValue:s(y),"onUpdate:modelValue":Y[5]||(Y[5]=J=>Fe(y)?y.value=J:null)},null,8,["title","modelValue"]),s(y)?L("",!0):(I(),te(Nr,{key:1,class:"button save-button",onClick:Y[6]||(Y[6]=J=>s(st)())},{default:Z(()=>[F("Manually save")]),_:1}))])):L("",!0),r("appearance")?(I(),T("div",co,[g(Li,{title:s(D),options:s(l),modelValue:s(f),"onUpdate:modelValue":Y[7]||(Y[7]=J=>Fe(f)?f.value=J:null)},null,8,["title","options","modelValue"]),(I(),te(Be(s(u)))),g(qt,{title:s(U),modelValue:s(c),"onUpdate:modelValue":Y[8]||(Y[8]=J=>Fe(c)?c.value=J:null)},null,8,["title","modelValue"]),g(qt,{title:s(ve),modelValue:s(p),"onUpdate:modelValue":Y[9]||(Y[9]=J=>Fe(p)?p.value=J:null)},null,8,["title","modelValue"])])):L("",!0)]),_:1},8,["modelValue"]))}});const po=["onSubmit"],go={class:"field"},mo={key:0,class:"field-title"},vo=["placeholder"],ho=K({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,i=$n(en(n,"title"),"span"),r=ct(null);di(()=>{var c;(c=r.value)==null||c.focus()});const a=S({get(){var c;return(c=s(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function l(){t("submit")}function u(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,f)=>(I(),T("form",{onSubmit:kn(l,["prevent"])},[k("div",go,[s(i)?(I(),T("span",mo,[(I(),te(Be(s(i))))])):L("",!0),e.textArea?(I(),te(s(Jr),{key:1,modelValue:s(a),"onUpdate:modelValue":f[0]||(f[0]=h=>Fe(a)?a.value=h:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:u,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):Pi((I(),T("input",{key:2,type:"text","onUpdate:modelValue":f[1]||(f[1]=h=>Fe(a)?a.value=h:null),placeholder:e.placeholder,class:ye({fullWidth:!e.title}),onBlur:u,ref_key:"field",ref:r},null,42,vo)),[[Gr,s(a)]])])],40,po))}});var Cr=fe(ho,[["__scopeId","data-v-90bd4994"]]);const bo={key:0},yo=["onClick","disabled"],wo={key:0},_o=["onClick"],No=K({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=$e(e),r=j(!1);ut(r,u=>{t("confirmingChanged",u)});function a(){if(s(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function l(){r.value=!1}return(u,c)=>(I(),T("span",{class:ye(["container",{confirming:r.value}])},[r.value?(I(),T("span",bo,"Are you sure?")):L("",!0),k("button",{onClick:kn(a,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(I(),T("span",wo,"Yes")):Rt(u.$slots,"default",{key:1},void 0,!0)],8,yo),r.value?(I(),T("button",{key:1,class:"button",onClick:kn(l,["stop"])},"No",8,_o)):L("",!0)],2))}});var Co=fe(No,[["__scopeId","data-v-2f8ef34c"]]);const zt=e=>(gn("data-v-32313015"),e=e(),mn(),e),ko=zt(()=>k("div",{class:"handle material-icons"},"drag_handle",-1)),So={key:0,class:"actions"},Mo=zt(()=>k("span",{class:"material-icons"},"content_paste",-1)),Io=zt(()=>k("span",{class:"material-icons"},"content_copy",-1)),$o=zt(()=>k("span",{class:"material-icons"},"edit",-1)),xo=zt(()=>k("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Eo={key:1,class:"actions"},Po=zt(()=>k("span",{class:"material-icons"},"check",-1)),To=zt(()=>k("span",{class:"material-icons"},"close",-1)),Do={key:2,class:"details"},Fo={class:"save-version"},Ao=zt(()=>k("br",null,null,-1)),Oo={key:0},qo={key:3,class:"details"},Ro={key:4,class:"details error"},Vo=zt(()=>k("br",null,null,-1)),Lo=K({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=$e(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=j(!1),l=j(!1),u=j("");ut(a,()=>{var p;return u.value=(p=i.value.name)!=null?p:""});const c=S(()=>i.value!=null&&i.value.id===Q.id),f=S(()=>{var p;return c.value?Q.time:(p=i.value!=null&&i.value.time)!=null?p:0});function h(){t("editName",u.value),a.value=!1}return(p,y)=>(I(),T("div",{class:ye(["save",{active:s(c)}])},[ko,a.value?(I(),T("div",Eo,[k("button",{onClick:h,class:"button"},[g(Pe,{display:"Save",direction:s(W).Left,class:"info"},{default:Z(()=>[Po]),_:1},8,["direction"])]),k("button",{onClick:y[5]||(y[5]=C=>a.value=!a.value),class:"button"},[g(Pe,{display:"Cancel",direction:s(W).Left,class:"info"},{default:Z(()=>[To]),_:1},8,["direction"])])])):(I(),T("div",So,[s(i).error==null&&!l.value?(I(),te(Nr,{key:0,onClick:y[0]||(y[0]=C=>t("export")),class:"button",left:""},{default:Z(()=>[g(Pe,{display:"Export",direction:s(W).Left,class:"info"},{default:Z(()=>[Mo]),_:1},8,["direction"])]),_:1})):L("",!0),s(i).error==null&&!l.value?(I(),T("button",{key:1,onClick:y[1]||(y[1]=C=>t("duplicate")),class:"button"},[g(Pe,{display:"Duplicate",direction:s(W).Left,class:"info"},{default:Z(()=>[Io]),_:1},8,["direction"])])):L("",!0),s(i).error==null&&!l.value?(I(),T("button",{key:2,onClick:y[2]||(y[2]=C=>a.value=!a.value),class:"button"},[g(Pe,{display:"Edit Name",direction:s(W).Left,class:"info"},{default:Z(()=>[$o]),_:1},8,["direction"])])):L("",!0),g(Co,{disabled:s(c),onClick:y[3]||(y[3]=C=>t("delete")),onConfirmingChanged:y[4]||(y[4]=C=>l.value=C)},{default:Z(()=>[g(Pe,{display:"Delete",direction:s(W).Left,class:"info"},{default:Z(()=>[xo]),_:1},8,["direction"])]),_:1},8,["disabled"])])),s(i).error==null&&!a.value?(I(),T("div",Do,[k("button",{class:"button open",onClick:y[6]||(y[6]=C=>t("open"))},[k("h3",null,se(s(i).name),1)]),k("span",Fo,"v"+se(s(i).modVersion),1),Ao,s(f)?(I(),T("div",Oo,"Last played "+se(s(r).format(s(f))),1)):L("",!0)])):s(i).error==null&&a.value?(I(),T("div",qo,[g(Cr,{modelValue:u.value,"onUpdate:modelValue":y[7]||(y[7]=C=>u.value=C),class:"editname",onSubmit:h},null,8,["modelValue"])])):(I(),T("div",Ro,[F(" Error: Failed to load save with id "+se(s(i).id),1),Vo,F(se(s(i).error),1)]))],2))}});var Bo=fe(Lo,[["__scopeId","data-v-32313015"]]);const Bi=e=>(gn("data-v-2a4275be"),e=e(),mn(),e),jo=Bi(()=>k("h2",null,"Saves Manager",-1)),zo={class:"modal-footer"},Uo={class:"field"},Go=Bi(()=>k("span",{class:"field-title"},"Create Save",-1)),Wo={class:"field-buttons"},Ho={class:"footer"},Zo=Bi(()=>k("div",{style:{"flex-grow":"1"}},null,-1)),Yo=K({__name:"SavesManager",setup(e,{expose:t}){const n=j(!1),i=j(null);t({open(){n.value=!0}});const r=j(!1),a=j(""),l=j(null);ut(a,x=>{x?Lt(()=>{try{if(x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=Jt.decompressFromUTF16(x);else{console.warn("Unable to determine preset encoding",x),r.value=!0;return}const D=JSON.parse(x);if(typeof D!="object"){r.value=!0;return}const U=ti();D.id=U,st(D),a.value="",r.value=!1,le.saves.push(U)}catch{r.value=!0}}):r.value=!1});let u={},c=j(Object.keys(u).reduce((x,D)=>(x.push({label:D.split("/").slice(-1)[0].slice(0,-4),value:u[D]}),x),[]));const f=Ti({});function h(x){if(f[x]==null){let D=localStorage.getItem(x);if(D==null)f[x]={error:"Save doesn't exist in localStorage",id:x};else if(D==="dW5kZWZpbmVk")f[x]={error:"Save is undefined",id:x};else try{if(D[0]!=="{")if(D[0]==="e")D=decodeURIComponent(escape(atob(D)));else if(D[0]==="\u1BE1")D=Jt.decompressFromUTF16(D);else return console.warn("Unable to determine preset encoding",D),r.value=!0,f[x]={error:"Unable to determine preset encoding",id:x},f[x];f[x]={...JSON.parse(D),id:x}}catch(U){f[x]={error:U,id:x},console.warn(`SavesManager: Failed to load info about save with id ${x}: +${U} +${D}`)}}return f[x]}ut(n,x=>{x&&Object.keys(f).forEach(D=>delete f[D])});const p=S(()=>le.saves.reduce((x,D)=>(x[D]=h(D),x),{}));function y(x){let D;switch(Q.id===x?D=pr(Q):D=JSON.stringify(p.value[x]),me.exportEncoding){default:console.warn(`Unknown save encoding: ${me.exportEncoding}. Defaulting to lz`);case"lz":D=Jt.compressToUTF16(D);break;case"base64":D=btoa(unescape(encodeURIComponent(D)));break;case"plain":break}const U=document.createElement("textarea");U.value=D,document.body.appendChild(U),U.select(),U.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(U)}function C(x){Q.id===x&&st();const D={...p.value[x],id:ti()};st(D),le.saves.push(D.id)}function w(x){le.saves=le.saves.filter(D=>D!==x),localStorage.removeItem(x),f[x]=void 0}function N(x){p.value[Q.id].time=Q.time,st(),f[Q.id]=void 0,on(p.value[x]),f[x]=void 0}function P(x){if(l.value=x,Lt(()=>{l.value=null}),x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=Jt.decompressFromUTF16(x);else{console.warn("Unable to determine preset encoding",x);return}const D=JSON.parse(x);D.id=ti(),st(D),le.saves.push(D.id),N(D.id)}function q(x,D){const U=p.value[x];U!=null&&(U.name=D,Q.id===x?(Q.name=D,st()):(st(U),f[x]=void 0))}return(x,D)=>(I(),te(jt,{modelValue:n.value,"onUpdate:modelValue":D[4]||(D[4]=U=>n.value=U),ref_key:"modal",ref:i},{header:Z(()=>[jo]),body:Z(({shown:U})=>[U?(I(),te(s(Xr),{key:0,list:s(le).saves,handle:".handle",itemKey:ve=>ve},{item:Z(({element:ve})=>[g(Bo,{save:s(p)[ve],onOpen:ne=>N(ve),onExport:ne=>y(ve),onEditName:ne=>q(ve,ne),onDuplicate:ne=>C(ve),onDelete:ne=>w(ve)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):L("",!0)]),footer:Z(()=>[k("div",zo,[g(Cr,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=U=>a.value=U),title:"Import Save",placeholder:"Paste your save here!",class:ye({importingFailed:r.value})},null,8,["modelValue","class"]),k("div",Uo,[Go,k("div",Wo,[k("button",{class:"button",onClick:D[1]||(D[1]=U=>N(s(Cn)().id))},"New Game"),Object.keys(s(c)).length>0?(I(),te(Li,{key:0,options:s(c),modelValue:l.value,"onUpdate:modelValue":D[2]||(D[2]=U=>P(U)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):L("",!0)])]),k("div",Ho,[Zo,k("button",{class:"button modal-default-button",onClick:D[3]||(D[3]=U=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var kr=fe(Yo,[["__scopeId","data-v-2a4275be"]]);const ft=e=>(gn("data-v-318a1c31"),e=e(),mn(),e),Xo=["src","alt"],Jo={key:1,class:"title"},Ko=ft(()=>k("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Qo={class:"discord"},el={class:"discord-links"},tl={key:0},nl=["href"],il=ft(()=>k("li",null,[k("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),rl=ft(()=>k("li",null,[k("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),al={href:"https://forums.moddingtree.com/",target:"_blank"},sl=ft(()=>k("span",{class:"material-icons"},"forum",-1)),ol=ft(()=>k("span",{class:"material-icons"},"info",-1)),ll=ft(()=>k("span",{class:"material-icons"},"library_books",-1)),ul=ft(()=>k("span",{class:"material-icons"},"settings",-1)),cl=ft(()=>k("span",{class:"material-icons"},"library_books",-1)),dl=ft(()=>k("span",{class:"material-icons"},"settings",-1)),fl=ft(()=>k("span",{class:"material-icons"},"info",-1)),pl={href:"https://forums.moddingtree.com/",target:"_blank"},gl=ft(()=>k("span",{class:"material-icons"},"forum",-1)),ml={class:"discord"},vl={class:"discord-links"},hl={key:0},bl=["href"],yl=ft(()=>k("li",null,[k("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),wl=ft(()=>k("li",null,[k("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),_l=K({__name:"Nav",setup(e){const t=j(null),n=j(null),i=j(null),r=j(null),{useHeader:a,banner:l,title:u,discordName:c,discordLink:f,versionNumber:h}=me;function p(){window.open(f,"mywindow")}return(y,C)=>(I(),T(ae,null,[s(a)?(I(),T("div",Bt({key:0,class:"nav"},y.$attrs),[s(l)?(I(),T("img",{key:0,src:s(l),class:"banner",alt:s(u)},null,8,Xo)):(I(),T("div",Jo,se(s(u)),1)),k("div",{onClick:C[0]||(C[0]=w=>{var N;return(N=r.value)==null?void 0:N.open()}),class:"version-container"},[g(Pe,{display:"Changelog",direction:s(W).Down,class:"version"},{default:Z(()=>[k("span",null,"v"+se(s(h)),1)]),_:1},8,["direction"])]),Ko,k("div",Qo,[k("span",{onClick:p,class:"material-icons"},"discord"),k("ul",el,[s(f)?(I(),T("li",tl,[k("a",{href:s(f),target:"_blank"},se(s(c)),9,nl)])):L("",!0),il,rl])]),k("div",null,[k("a",al,[g(Pe,{display:"Forums",direction:s(W).Down,yoffset:"5px"},{default:Z(()=>[sl]),_:1},8,["direction"])])]),k("div",{onClick:C[1]||(C[1]=w=>{var N;return(N=t.value)==null?void 0:N.open()})},[g(Pe,{display:"Info",direction:s(W).Down,class:"info"},{default:Z(()=>[ol]),_:1},8,["direction"])]),k("div",{onClick:C[2]||(C[2]=w=>{var N;return(N=n.value)==null?void 0:N.open()})},[g(Pe,{display:"Saves",direction:s(W).Down,xoffset:"-20px"},{default:Z(()=>[ll]),_:1},8,["direction"])]),k("div",{onClick:C[3]||(C[3]=w=>{var N;return(N=i.value)==null?void 0:N.open()})},[g(Pe,{display:"Settings",direction:s(W).Down,xoffset:"-66px"},{default:Z(()=>[ul]),_:1},8,["direction"])])],16)):(I(),T("div",Bt({key:1,class:"overlay-nav"},y.$attrs),[k("div",{onClick:C[4]||(C[4]=w=>{var N;return(N=r.value)==null?void 0:N.open()}),class:"version-container"},[g(Pe,{display:"Changelog",direction:s(W).Right,xoffset:"25%",class:"version"},{default:Z(()=>[k("span",null,"v"+se(s(h)),1)]),_:1},8,["direction"])]),k("div",{onClick:C[5]||(C[5]=w=>{var N;return(N=n.value)==null?void 0:N.open()})},[g(Pe,{display:"Saves",direction:s(W).Right},{default:Z(()=>[cl]),_:1},8,["direction"])]),k("div",{onClick:C[6]||(C[6]=w=>{var N;return(N=i.value)==null?void 0:N.open()})},[g(Pe,{display:"Settings",direction:s(W).Right},{default:Z(()=>[dl]),_:1},8,["direction"])]),k("div",{onClick:C[7]||(C[7]=w=>{var N;return(N=t.value)==null?void 0:N.open()})},[g(Pe,{display:"Info",direction:s(W).Right},{default:Z(()=>[fl]),_:1},8,["direction"])]),k("div",null,[k("a",pl,[g(Pe,{display:"Forums",direction:s(W).Right,xoffset:"7px"},{default:Z(()=>[gl]),_:1},8,["direction"])])]),k("div",ml,[k("span",{onClick:p,class:"material-icons"},"discord"),k("ul",vl,[s(f)?(I(),T("li",hl,[k("a",{href:s(f),target:"_blank"},se(s(c)),9,bl)])):L("",!0),yl,wl])])],16)),g(Qs,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),g(kr,{ref_key:"savesManager",ref:n},null,512),g(fo,{ref_key:"options",ref:i},null,512),g(Fs,{ref_key:"changelog",ref:r},null,512)],64))}});var Sr=fe(_l,[["__scopeId","data-v-318a1c31"]]);const Nl={class:"inner-tab"},Cl=K({__name:"Game",setup(e){const t=en(Q,"tabs"),n=S(()=>Object.keys(ke)),i=me.useHeader;function r(a){const{display:l,minimized:u,name:c,color:f,minimizable:h,nodes:p,minimizedDisplay:y}=a;return{display:l,minimized:u,name:c,color:f,minimizable:h,nodes:p,minimizedDisplay:y}}return(a,l)=>(I(),T("div",{class:ye(["tabs-container",{useHeader:s(i)}])},[(I(!0),T(ae,null,Mn(s(t),(u,c)=>{var f,h;return I(),T("div",{key:c,class:ye(["tab",s((f=s(ke)[u])==null?void 0:f.classes)]),style:Ae(s((h=s(ke)[u])==null?void 0:h.style))},[c===0&&!s(i)?(I(),te(Sr,{key:0})):L("",!0),k("div",Nl,[s(n).includes(u)?(I(),te(Es,Bt({key:0},r(s(ke)[u]),{index:c,onSetMinimized:p=>s(ke)[u].minimized.value=p}),null,16,["index","onSetMinimized"])):(I(),te(Be(u),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var kl=fe(Cl,[["__scopeId","data-v-dcd207b4"]]);const Sl=K({__name:"Sticky",setup(e){const t=j("0"),n=new ResizeObserver(r),i=ct(null);function r(){let a=i.value;if(a==null)return;let l=0;for(;a.previousSibling;){const u=a.previousSibling;u.dataset&&"vSticky"in u.dataset&&(l+=u.offsetHeight),a=u}t.value=l+"px"}return Lt(r),document.fonts.ready.then(r),di(()=>{var l;const a=(l=i.value)==null?void 0:l.parentElement;a&&n.observe(a)}),(a,l)=>(I(),T("div",{class:"sticky",style:Ae({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Rt(a.$slots,"default",{},void 0,!0)],4))}});var li=fe(Sl,[["__scopeId","data-v-cccac690"]]);const Ml=["x1","y1","x2","y2"],Il=K({__name:"BoardLink",props:{link:null},setup(e){const n=$e(e),i=S(()=>{const a=n.link.value.startNode.position;return n.link.value.offsetStart&&(a.x+=s(n.link.value.offsetStart).x,a.y+=s(n.link.value.offsetStart).y),a}),r=S(()=>{const a=n.link.value.endNode.position;return n.link.value.offsetEnd&&(a.x+=s(n.link.value.offsetEnd).x,a.y+=s(n.link.value.offsetEnd).y),a});return(a,l)=>(I(),T("line",Bt({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Ml))}});var $l=fe(Il,[["__scopeId","data-v-57c4970a"]]);const xl={key:0},El=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],Pl=["fill","stroke-width","stroke"],Tl=["fill"],Dl=K({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=$e(e),r=S(()=>ge(i.nodeType.value.size,s(i.node))),a=S(()=>{var h;return(h=ge(i.nodeType.value.outlineColor,s(i.node)))!=null?h:Ct[le.theme].variables["--outline"]}),l=S(()=>{var h;return(h=ge(i.nodeType.value.titleColor,s(i.node)))!=null?h:Ct[le.theme].variables["--foreground"]}),u=S(()=>ge(i.nodeType.value.actionDistance,s(i.node)));function c(h,p){t("clickAction",p.id),h.preventDefault(),h.stopPropagation()}function f(h,p){var y;((y=s(i.selectedAction))==null?void 0:y.id)===p.id&&(h.preventDefault(),h.stopPropagation())}return(h,p)=>(I(),te(Sn,{name:"actions",appear:""},{default:Z(()=>[e.isSelected&&e.actions?(I(),T("g",xl,[(I(!0),T(ae,null,Mn(e.actions,(y,C)=>{var w,N;return I(),T("g",{key:y.id,class:ye(["action",{selected:((w=e.selectedAction)==null?void 0:w.id)===y.id}]),transform:`translate( + ${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-C)*s(u))}, + ${(s(r)+30)*Math.cos(((e.actions.length-1)/2-C)*s(u))} + )`,onMousedown:P=>c(P,y),onTouchstart:P=>c(P,y),onMouseup:P=>f(P,y),onTouchend:kn(P=>f(P,y),["stop"])},[k("circle",{fill:s(ge)(y.fillColor,e.node),r:"20","stroke-width":((N=e.selectedAction)==null?void 0:N.id)===y.id?4:0,stroke:s(a)},null,8,Pl),k("text",{fill:s(l),class:"material-icons"},se(s(ge)(y.icon,e.node)),9,Tl)],42,El)}),128))])):L("",!0)]),_:1}))}});var Fl=fe(Dl,[["__scopeId","data-v-9efb2a56"]]);const Al=["transform"],Ol={key:0},ql=["r","fill","stroke"],Rl=["r","fill","stroke"],Vl=["r","fill"],Ll=["r","stroke-dasharray","stroke-dashoffset","stroke"],Bl={key:1,transform:"rotate(45, 0, 0)"},jl=["width","height","transform","fill","stroke"],zl=["width","height","transform","fill","stroke"],Ul=["width","height","transform","fill"],Gl=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],Wl=["fill","y"],Hl=["fill"],Zl={key:0},Yl=["fill","y"],Xl=["fill","y"],Jl=K({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},selectedNode:null,selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=$e(n),a=S(()=>s(r.selectedNode)===s(r.node)),l=S(()=>ge(r.nodeType.value.draggable,s(r.node)));ut(l,H=>{const _e=s(r.node);s(r.dragging)===_e&&!H&&t("endDragging",_e)});const u=S(()=>{var _e;const H=s(r.node);return(_e=ge(r.nodeType.value.actions,H))==null?void 0:_e.filter(de=>Le(ge(de.visibility,H)))}),c=S(()=>{var _e;const H=s(r.node);if(ge(r.nodeType.value.draggable,H)&&((_e=s(r.dragging))==null?void 0:_e.id)===H.id&&s(r.dragged)!=null){const{x:de,y:pe}=s(r.dragged);return{x:H.position.x+Math.round(de/25)*25,y:H.position.y+Math.round(pe/25)*25}}return H.position}),f=S(()=>ge(r.nodeType.value.shape,s(r.node))),h=S(()=>ge(r.nodeType.value.title,s(r.node))),p=S(()=>ge(r.nodeType.value.subtitle,s(r.node))),y=S(()=>{var H;return(H=a.value?s(r.selectedAction)&&ge(s(r.selectedAction).tooltip,s(r.node)):null)!=null?H:ge(r.nodeType.value.label,s(r.node))}),C=S(()=>{var H,_e;return ge((_e=(H=s(r.selectedAction))==null?void 0:H.confirmationLabel)!=null?_e:{text:"Tap again to confirm"},s(r.node))}),w=S(()=>ge(r.nodeType.value.size,s(r.node))),N=S(()=>{var H;return(H=ge(r.nodeType.value.progress,s(r.node)))!=null?H:0}),P=S(()=>Ct[le.theme].variables["--background"]),q=S(()=>{var H;return(H=ge(r.nodeType.value.outlineColor,s(r.node)))!=null?H:Ct[le.theme].variables["--outline"]}),x=S(()=>{var H;return(H=ge(r.nodeType.value.fillColor,s(r.node)))!=null?H:Ct[le.theme].variables["--raised-background"]}),D=S(()=>ge(r.nodeType.value.progressColor,s(r.node))),U=S(()=>{var H;return(H=ge(r.nodeType.value.titleColor,s(r.node)))!=null?H:Ct[le.theme].variables["--foreground"]}),ve=S(()=>ge(r.nodeType.value.progressDisplay,s(r.node))),ne=S(()=>r.dragging.value!=null&&s(r.hasDragged)&&ge(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),Y=S(()=>ge(r.nodeType.value.style,s(r.node))),J=S(()=>ge(r.nodeType.value.classes,s(r.node)));function z(H){t("mouseDown",H,r.node.value,l.value)}function ce(H){var _e,de,pe;(_e=r.hasDragged)!=null&&_e.value||(t("endDragging",r.node.value),(pe=(de=r.nodeType.value).onClick)==null||pe.call(de,r.node.value),H.stopPropagation())}return(H,_e)=>{var de,pe,xe;return I(),T("g",{class:ye(["boardnode",{[e.node.type]:!0,isSelected:s(a),isDraggable:s(l),...s(J)}]),style:Ae([{opacity:((de=e.dragging)==null?void 0:de.id)===e.node.id&&e.hasDragged?.5:1},(pe=s(Y))!=null?pe:[]]),transform:`translate(${s(c).x},${s(c).y})${s(a)?" scale(1.2)":""}`},[g(Fl,{actions:(xe=s(u))!=null?xe:[],"is-selected":s(a),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:_e[0]||(_e[0]=Je=>t("clickAction",Je))},null,8,["actions","is-selected","node","node-type","selected-action"]),k("g",{class:"node-container",onMousedown:z,onTouchstartPassive:z,onMouseup:ce,onTouchendPassive:ce},[s(f)===s(ze).Circle?(I(),T("g",Ol,[s(ne)?(I(),T("circle",{key:0,class:"receiver",r:s(w)+8,fill:s(P),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,ql)):L("",!0),k("circle",{class:"body",r:s(w),fill:s(x),stroke:s(q),"stroke-width":4},null,8,Rl),s(ve)===s(un).Fill?(I(),T("circle",{key:1,class:"progress progressFill",r:Math.max(s(w)*s(N)-2,0),fill:s(D)},null,8,Vl)):(I(),T("circle",{key:2,r:s(w)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(w)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(w)+4.5)*2*Math.PI-s(N)*(s(w)+4.5)*2*Math.PI,stroke:s(D)},null,8,Ll))])):s(f)===s(ze).Diamond?(I(),T("g",Bl,[s(ne)?(I(),T("rect",{key:0,class:"receiver",width:s(w)*s(i)+16,height:s(w)*s(i)+16,transform:`translate(${-(s(w)*s(i)+16)/2}, ${-(s(w)*s(i)+16)/2})`,fill:s(P),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,jl)):L("",!0),k("rect",{class:"body",width:s(w)*s(i),height:s(w)*s(i),transform:`translate(${-s(w)*s(i)/2}, ${-s(w)*s(i)/2})`,fill:s(x),stroke:s(q),"stroke-width":4},null,8,zl),s(ve)===s(un).Fill?(I(),T("rect",{key:1,class:"progress progressFill",width:Math.max(s(w)*s(i)*s(N)-2,0),height:Math.max(s(w)*s(i)*s(N)-2,0),transform:`translate(${-Math.max(s(w)*s(i)*s(N)-2,0)/2}, ${-Math.max(s(w)*s(i)*s(N)-2,0)/2})`,fill:s(D)},null,8,Ul)):(I(),T("rect",{key:2,class:"progress progressDiamond",width:s(w)*s(i)+9,height:s(w)*s(i)+9,transform:`translate(${-(s(w)*s(i)+9)/2}, ${-(s(w)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(w)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(w)*s(i)+9)*4-s(N)*(s(w)*s(i)+9)*4,stroke:s(D)},null,8,Gl))])):L("",!0),k("text",{fill:s(U),class:"node-title",y:s(p)?10:0},se(s(h)),9,Wl),s(p)?(I(),T("text",{key:2,fill:s(U),class:"node-subtitle",y:"-15"},se(s(p)),9,Hl)):L("",!0)],32),g(Sn,{name:"fade",appear:""},{default:Z(()=>{var Je;return[s(y)?(I(),T("g",Zl,[k("text",{fill:(Je=s(y).color)!=null?Je:s(U),class:ye(["node-title",{pulsing:s(y).pulsing}]),y:-s(w)-20},se(s(y).text),11,Yl)])):L("",!0)]}),_:1}),g(Sn,{name:"fade",appear:""},{default:Z(()=>{var Je;return[s(a)&&e.selectedAction?(I(),T("text",{key:0,fill:(Je=s(C).color)!=null?Je:s(U),class:ye(["node-title",{pulsing:s(C).pulsing}]),y:s(w)+75},se(s(C).text),11,Xl)):L("",!0)]}),_:1})],14,Al)}}});var Kl=fe(Jl,[["__scopeId","data-v-4654be02"]]);const Ql={class:"stage",width:"100%",height:"100%"},eu={class:"g1"},tu=K({__name:"Board",props:{nodes:null,types:null,state:null,visibility:null,width:null,height:null,style:null,classes:null,links:null,selectedAction:null,selectedNode:null,draggingNode:null,receivingNode:null,mousePosition:null,setReceivingNode:{type:Function},setDraggingNode:{type:Function}},setup(e){const n=$e(e),i=j({x:0,y:0}),r=j({x:0,y:0}),a=j(!1),l=j(null),u=S(()=>{const C=n.nodes.value.slice();if(n.draggingNode.value){const w=C.splice(C.indexOf(n.draggingNode.value),1)[0];C.push(w)}return C});ht(()=>{const C=n.draggingNode.value;if(C==null)return null;const w={x:C.position.x+r.value.x,y:C.position.y+r.value.y};let N=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((P,q)=>{if(q.id===C.id)return P;const x=n.types.value[q.type];if(!ge(x.canAccept,q,C))return P;const U=Math.pow(w.x-q.position.x,2)+Math.pow(w.y-q.position.y,2);let ve=ge(x.size,q);return U>N||U>ve*ve?P:(N=U,q)},null))});function c(C){C.setTransformOrigin(null),C.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function f(C,w=null,N=!1){if(n.draggingNode.value==null){C.preventDefault(),C.stopPropagation();let P,q;if("touches"in C)if(C.touches.length===1)P=C.touches[0].clientX,q=C.touches[0].clientY;else return;else P=C.clientX,q=C.clientY;i.value={x:P,y:q},r.value={x:0,y:0},a.value=!1,N&&n.setDraggingNode.value(w)}w!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(C){const{x:w,y:N,scale:P}=l.value.panZoomInstance.getTransform();let q,x;if("touches"in C)if(C.touches.length===1)q=C.touches[0].clientX,x=C.touches[0].clientY;else{p(n.draggingNode.value),n.mousePosition.value=null;return}else q=C.clientX,x=C.clientY;n.mousePosition.value={x:(q-w)/P,y:(x-N)/P},r.value={x:r.value.x+(q-i.value.x)/P,y:r.value.y+(x-i.value.y)/P},i.value={x:q,y:x},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(C.preventDefault(),C.stopPropagation())}function p(C,w=!1){var N,P;if(n.draggingNode.value!=null&&n.draggingNode.value===C){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(r.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(r.value.y/25)*25);const q=n.nodes.value;q.push(q.splice(q.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((P=(N=n.types.value[n.receivingNode.value.type]).onDrop)==null||P.call(N,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!w&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function y(C,w){n.state.value.selectedAction===w?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:w}}return(C,w)=>{const N=yt("panZoom");return s(Le)(e.visibility)?(I(),te(N,{key:0,style:Ae([{width:e.width,height:e.height},e.style]),class:ye(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:l,onInit:c,onMousemove:h,onTouchmove:h,onMousedown:w[0]||(w[0]=P=>f(P)),onTouchstart:w[1]||(w[1]=P=>f(P)),onMouseup:w[2]||(w[2]=()=>p(s(e.draggingNode))),onTouchendPassive:w[3]||(w[3]=()=>p(s(e.draggingNode))),onMouseleave:w[4]||(w[4]=()=>p(s(e.draggingNode),!0))},{default:Z(()=>[(I(),T("svg",Ql,[k("g",eu,[g(Ui,{name:"link",appear:""},{default:Z(()=>[(I(!0),T(ae,null,Mn(s(e.links)||[],P=>(I(),T("g",{key:`${P.startNode.id}-${P.endNode.id}`},[g($l,{link:P},null,8,["link"])]))),128))]),_:1}),g(Ui,{name:"grow",duration:500,appear:""},{default:Z(()=>[(I(!0),T(ae,null,Mn(s(u),P=>{var q;return I(),T("g",{key:P.id,style:{"transition-duration":"0s"}},[g(Kl,{node:P,nodeType:e.types[P.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===P?r.value:void 0,hasDragged:a.value,receivingNode:((q=s(e.receivingNode))==null?void 0:q.id)===P.id,selectedNode:s(e.selectedNode),selectedAction:s(e.selectedAction),onMouseDown:f,onEndDragging:p,onClickAction:x=>y(P,x)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):L("",!0)}}});Xe.on("setupVue",e=>Kr.install(e));const Mr=Symbol("Board");var un=(e=>(e.Outline="Outline",e.Fill="Fill",e))(un||{}),ze=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(ze||{});function nu(e){const t=lt({nodes:[],selectedNode:null,selectedAction:null},!1);return Ue(n=>{const i=e.call(n,n);i.id=vn("board-"),i.type=Mr,i[dt]=tu,i.state?(yr(t),E(i,"state")):(t[In]={nodes:i.startNodes().map((u,c)=>(u.id=c,u)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=S(()=>s(l.state).nodes),i.selectedNode=S({get(){return l.nodes.value.find(u=>u.id===s(l.state).selectedNode)||null},set(u){var c,f;Fe(l.state)?l.state.value={...l.state.value,selectedNode:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedNode=(f=u==null?void 0:u.id)!=null?f:null}}),i.selectedAction=S({get(){const u=l.selectedNode.value;if(u==null)return null;const c=l.types[u.type];return c.actions==null?null:c.actions.find(f=>f.id===s(l.state).selectedAction)||null},set(u){var c,f;Fe(l.state)?l.state.value={...l.state.value,selectedAction:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedAction=(f=u==null?void 0:u.id)!=null?f:null}}),i.mousePosition=j(null),i.links?E(i,"links"):i.links=S(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?ge(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=j(null),i.receivingNode=j(null),E(i,"visibility"),re(i,"visibility",Ne.Visible),E(i,"width"),re(i,"width","100%"),E(i,"height"),re(i,"height","100%"),E(i,"classes"),E(i,"style");for(const u in i.types){const c=i.types[u];if(E(c,"title"),E(c,"subtitle"),E(c,"label"),E(c,"size"),re(c,"size",50),E(c,"style"),E(c,"classes"),E(c,"draggable"),re(c,"draggable",!1),E(c,"shape"),re(c,"shape","Circle"),E(c,"canAccept"),re(c,"canAccept",!1),E(c,"progress"),E(c,"progressDisplay"),re(c,"progressDisplay","Fill"),E(c,"progressColor"),re(c,"progressColor","none"),E(c,"fillColor"),E(c,"outlineColor"),E(c,"titleColor"),E(c,"actionDistance"),re(c,"actionDistance",Math.PI/6),c.nodes=S(()=>s(l.state).nodes.filter(f=>f.type===u)),re(c,"onClick",function(f){s(l.state).selectedNode=f.id}),c.actions)for(const f of c.actions)E(f,"visibility"),re(f,"visibility",Ne.Visible),E(f,"icon"),E(f,"fillColor"),E(f,"tooltip"),E(f,"confirmationLabel"),re(f,"confirmationLabel",{text:"Tap again to confirm"}),E(f,"links")}function r(u){i.draggingNode.value=u}function a(u){i.receivingNode.value=u}i.placeInAvailableSpace=function(u,c=100,f=W.Right){const h=l.nodes.value.slice().filter(p=>p===u||(f===W.Down||f===W.Up)&&Math.abs(p.position.x-u.position.x)>c||(f===W.Left||f===W.Right)&&Math.abs(p.position.y-u.position.y)>c?!1:!(f===W.Right&&p.position.xu.position.x+c||f===W.Up&&p.position.y>u.position.y+c||f===W.Down&&p.position.yp.position.x-y.position.x:f===W.Left?(p,y)=>y.position.x-p.position.x:f===W.Up?(p,y)=>y.position.y-p.position.y:(p,y)=>p.position.y-y.position.y);for(let p=0;p0&&C>c)break}},i[nt]=function(){const{nodes:u,types:c,state:f,visibility:h,width:p,height:y,style:C,classes:w,links:N,selectedAction:P,selectedNode:q,mousePosition:x,draggingNode:D,receivingNode:U}=this;return{nodes:u,types:c,state:f,visibility:h,width:p,height:y,style:s(C),classes:w,links:N,selectedAction:P,selectedNode:q,mousePosition:x,draggingNode:D,receivingNode:U,setDraggingNode:r,setReceivingNode:a}};const l=i;return l})}function ge(e,t,...n){return ai(e)?e(t,...n):s(e)}function Ln(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const qn={};Xe.on("addLayer",e=>{const t=xi(e,Mr);qn[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(a=>{var l;return(l=r.update)==null?void 0:l.call(r,a,n)}))})})});Xe.on("removeLayer",e=>{var t;(t=qn[e.id])==null||t.call(qn),qn[e.id]=void 0});function ni(e,t="points",n=0,i=void 0){const r=Fe(e)?e:lt(e);if(r.displayName=t,r.precision=n,r.small=i,!Fe(e)){const a=r[Tt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function ui(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?Ze(e.small?n:o.floor(n)):dn(n,e.precision,e.small)}Xe.on("setupVue",e=>e.use(Qr));function iu(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}}const ru=K({props:{visibility:{type:R(Number,Boolean),required:!0},display:{type:R(Object,String,Function),required:!0},style:R(String,Object,Array),classes:R(Object),glowColor:R(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=$e(e),a=hr(n),l=S(()=>{const c=Se(i);return c==null||c===""?{}:s(r)?iu(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:a,glowColorStyle:l,unref:s,Visibility:Ne,isVisible:Le,isHidden:hn}}});function au(e,t,n,i,r,a){var l;return e.isVisible(e.visibility)?(I(),T("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:ye(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Ae([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(I(),te(Be(e.component)))],6)):L("",!0)}var Ir=fe(ru,[["render",au],["__scopeId","data-v-21427abb"]]);const su=K({props:{visibility:{type:R(Number,Boolean),required:!0},activeTab:{type:R(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:R(Object),required:!0},style:R(String,Object,Array),classes:R(Object),buttonContainerStyle:R(String,Object,Array),buttonContainerClasses:R(Object)},components:{Sticky:li,TabButton:Ir},setup(e){const{activeTab:t}=$e(e),n=S(()=>Ct[le.theme].floatingTabs),i=ct("");ht(()=>{const u=Se(t);if(u==null){i.value="";return}if(kt(u)){i.value=ue(u);return}i.value=ue(s(u.display))});const r=S(()=>{const u=Se(t);return kt(u)||!u?void 0:s(u.classes)}),a=S(()=>{const u=Se(t);return kt(u)||!u?void 0:s(u.style)});function l(u){const{display:c,style:f,classes:h,glowColor:p,visibility:y}=u;return{display:c,style:s(f),classes:h,glowColor:p,visibility:y}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:Ne,component:i,gatherButtonProps:l,unref:s,isVisible:Le,isHidden:hn}}});function ou(e,t,n,i,r,a){var c,f;const l=yt("TabButton"),u=yt("Sticky");return e.isVisible(e.visibility)?(I(),T("div",{key:0,class:ye(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Ae([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(f=e.tabStyle)!=null?f:[]])},[g(u,{class:ye(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Ae(e.unref(e.buttonContainerStyle))},{default:Z(()=>[k("div",{class:ye(["tab-buttons",{floating:e.floating}])},[(I(!0),T(ae,null,Mn(e.unref(e.tabs),(h,p)=>(I(),te(l,Bt({onSelectTab:y=>e.selected.value=p,floating:e.floating,key:p,active:e.unref(h.tab)===e.unref(e.activeTab)},e.gatherButtonProps(h)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(I(),te(Be(e.unref(e.component)),{key:0})):L("",!0)],6)):L("",!0)}var lu=fe(su,[["render",ou],["__scopeId","data-v-58dbf83a"]]);const uu=Symbol("TabButton"),cu=Symbol("TabFamily");function du(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),new Error("Cannot create tab family with 0 tabs");const n=lt(Object.keys(e)[0],!1);return Ue(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=vn("tabFamily-"),r.type=cu,r[dt]=lu,r.tabs=Object.keys(e).reduce((u,c)=>{const f=e[c]();return f.type=uu,f[dt]=Ir,E(f,"visibility"),re(f,"visibility",Ne.Visible),E(f,"tab"),E(f,"display"),E(f,"classes"),E(f,"style"),E(f,"glowColor"),u[c]=f,u},{}),r.selected=n,r.activeTab=S(()=>{const u=s(a.tabs);if(n.value in u&&Le(u[n.value].visibility))return s(u[n.value].tab);const c=Object.values(u).find(f=>Le(f.visibility));return c?s(c.tab):null}),E(r,"visibility"),re(r,"visibility",Ne.Visible),E(r,"classes"),E(r,"style"),E(r,"buttonContainerClasses"),E(r,"buttonContainerStyle"),r[nt]=function(){const{visibility:u,activeTab:c,selected:f,tabs:h,style:p,classes:y,buttonContainerClasses:C,buttonContainerStyle:w}=this;return{visibility:u,activeTab:c,selected:f,tabs:h,style:s(p),classes:y,buttonContainerClasses:C,buttonContainerStyle:w}};const a=r;return a})}const $r=o.ln(10);function Rn(e){return e}function fu(e,t){if(A(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function pu(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return m.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function gu(e){return m.neg(e)}function mu(e,t,n){if(A(t))return t.invert(o.sub(e,Ce(n)));if(A(n))return n.invert(o.sub(e,Ce(t)));throw new Error("Could not invert due to no input being a variable")}function vu(e,t,n){var i,r;if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.times(n,(i=t.innermostVariable)!=null?i:0).add(a)}else if(A(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function hu(e,t,n){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.add(i,n)}else if(A(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function bu(e,t,n){if(A(t))return t.invert(o.add(e,Ce(n)));if(A(n))return n.invert(o.sub(Ce(t),e));throw new Error("Could not invert due to no input being a variable")}function yu(e,t,n){var i,r;if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.sub(a,m.times(n,(i=t.innermostVariable)!=null?i:0))}else if(A(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function wu(e,t,n){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.sub(i,n)}else if(A(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function _u(e,t,n){if(A(t))return t.invert(o.div(e,Ce(n)));if(A(n))return n.invert(o.div(e,Ce(t)));throw new Error("Could not invert due to no input being a variable")}function Nu(e,t,n){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.times(i,n)}else if(A(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Cu(e,t,n){if(A(t))return m.div(e,n);if(A(n))return m.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function ku(e,t,n){if(A(t))return t.invert(o.mul(e,Ce(n)));if(A(n))return n.invert(o.div(Ce(t),e));throw new Error("Could not invert due to no input being a variable")}function Su(e,t,n){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.div(i,n)}else if(A(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Mu(e,t,n){if(A(t))return m.mul(e,n);if(A(n))return m.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Iu(e,t){if(A(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function $u(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function xu(e,t){if(A(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function Eu(e){return o.ln(e).sub(1).times(e).div($r)}function Pu(e,t){if(A(t)){const n=$r.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function Tu(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Eu,invert:Pu})}throw new Error("Could not integrate due to no input being a variable")}function Du(e,t,n){if(A(t))return t.invert(o.pow(Ce(n),e));if(A(n))return n.invert(o.root(Ce(t),e));throw new Error("Could not invert due to no input being a variable")}function Fu(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function Au(e,t,n){if(A(t)){const i=o.ln(Ce(n)).times(e);return t.invert(i.div(i.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function Ou(e,t,n){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e),n],evaluate:Fu,invert:Au})}throw new Error("Could not integrate due to no input being a variable")}function qu(e,t){if(A(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function Ru(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function Vu(e,t){if(A(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function Lu(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Ru,invert:Vu})}throw new Error("Could not integrate due to no input being a variable")}function Bu(e,t){if(A(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function ju(e){return o.ln(e).sub(1).times(e)}function zu(e,t){if(A(t))return t.invert(o.div(e,o.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function Uu(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:ju,invert:zu})}throw new Error("Could not integrate due to no input being a variable")}function Gu(e,t,n){if(A(t))return t.invert(o.root(e,Ce(n)));if(A(n))return n.invert(o.ln(e).div(o.ln(Ce(t))));throw new Error("Could not invert due to no input being a variable")}function Wu(e,t,n){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=m.add(n,1);return m.pow(i,r).div(r)}else if(A(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.pow(t,i).div(m.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function Hu(e,t){if(A(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function Zu(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.pow10(n).div(m.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function Yu(e,t,n){if(A(t))return t.invert(o.ln(e).div(Ce(n)));if(A(n))return n.invert(o.root(Ce(t),e));throw new Error("Could not invert due to no input being a variable")}function Xu(e,t,n){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(n,i).div(m.ln(n))}else if(A(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=m.add(t,1);return m.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function Ju(e,t,n){if(A(t))return t.invert(o.root(e,o.recip(Ce(n))));if(A(n))return n.invert(o.ln(Ce(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function Ku(e,t,n){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(i,m.recip(n).add(1)).times(n).div(m.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function Qu(e,t){if(A(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function ec(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function tc(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function nc(e,t,n,i){if(A(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function ic(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,i,new o(n))}function rc(e,t,n,i){if(A(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,Ce(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function ac(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function sc(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function oc(e,t,n){if(A(t))return t.invert(o.tetrate(e,o.minabs(1e308,Ce(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function lc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function uc(e,t,n,i){if(A(t))return t.invert(o.layeradd(e,o.minabs(1e308,Ce(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function cc(e,t){if(A(t))return t.invert(o.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function dc(e,t){if(A(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function fc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function pc(e,t){if(A(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function gc(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function mc(e,t){if(A(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function vc(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function hc(e,t){if(A(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function bc(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function yc(e,t){if(A(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function wc(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asin(n).times(n).add(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function _c(e,t){if(A(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function Nc(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acos(n).times(n).sub(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Cc(e,t){if(A(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function kc(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atan(n).times(n).sub(m.ln(m.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Sc(e,t){if(A(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Mc(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Ic(e,t){if(A(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function $c(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function xc(e,t){if(A(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function Ec(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function Pc(e,t){if(A(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function Tc(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asinh(n).times(n).sub(m.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function Dc(e,t){if(A(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function Fc(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acosh(n).times(n).sub(m.add(n,1).sqrt().times(m.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function Ac(e,t){if(A(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function Oc(e,t){if(A(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atanh(n).times(n).add(m.sub(1,m.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function xn(e){return(t,n)=>new m({inputs:[t,n],evaluate:e,invert:Rn})}function A(e){return e instanceof Me&&e.hasVariable()}function Ce(e,t){return e instanceof Me?e.evaluate(t):s(e)}function qc(){return m.pow(this,2).div(2)}function Rc(){return this}const Te=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"&&Tt in n?n[Tt]:n)),"variable"in e?(typeof e.variable=="object"&&Tt in e.variable&&(e.variable=e.variable[Tt]),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:qc,internalIntegrateInner:Rc,applySubstitution:Rn}}setupConstant({inputs:e}){if(e.length!==1)throw new Error("Evaluate function is required if inputs is not length 1");return{inputs:e,internalVariables:0}}setupFormula(e){var y,C;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:l}=e,u=t.reduce((w,N)=>w+(N instanceof Te?N.internalVariables:0),0),c=t.find(w=>w instanceof Te&&w.hasVariable()),f=u===1?c==null?void 0:c.innermostVariable:void 0,h=(y=c==null?void 0:c.isInvertible())!=null?y:!1,p=(C=c==null?void 0:c.isIntegrable())!=null?C:!1;return{inputs:t,internalEvaluate:n,internalInvert:h?i:void 0,internalIntegrate:p?r:void 0,internalIntegrateInner:a,applySubstitution:l,innermostVariable:f,internalVariables:u}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,i;return(i=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(r=>Ce(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:Ce(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof Te&&e.inputs[n]instanceof Te?t.equals(e.inputs[n]):!(t instanceof Te)&&!(e.inputs[n]instanceof Te)&&o.eq(s(t),s(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new m({inputs:[e]})}static variable(e){return new m({variable:e})}static step(e,t,n){const i=j(0),r=n(m.variable(i)),a=we(t);function l(c){return o.lt(c,s(a))?c:(i.value=o.sub(c,s(a)),o.add(r.evaluate(),s(a)))}function u(c,f){if(A(f)&&r.isInvertible())return o.gt(c,s(a))&&(c=o.add(r.invert(o.sub(c,s(a))),s(a))),f.invert(c);throw new Error("Could not invert due to no input being a variable")}return new m({inputs:[e],evaluate:l,invert:r.isInvertible()&&r.hasVariable()?u:void 0})}static if(e,t,n,i){const r=j(0),a=m.variable(r),l=n(a),u=i==null?void 0:i(a),c=we(t);function f(p){return s(c)?(r.value=p,l.evaluate()):u?(r.value=p,u.evaluate()):p}function h(p,y){if(!A(y)||!l.isInvertible()||u!=null&&!u.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?y.invert(l.invert(p)):u?y.invert(u.invert(p)):y.invert(p)}return new m({inputs:[e],evaluate:f,invert:l.isInvertible()&&l.hasVariable()?h:void 0})}static conditional(e,t,n,i){return m.if(e,t,n,i)}static abs(e){return new m({inputs:[e],evaluate:o.abs})}static neg(e){return new m({inputs:[e],evaluate:o.neg,invert:fu,applySubstitution:gu,integrate:pu})}static sign(e){return new m({inputs:[e],evaluate:o.sign})}static round(e){return new m({inputs:[e],evaluate:o.round})}static floor(e){return new m({inputs:[e],evaluate:o.floor})}static ceil(e){return new m({inputs:[e],evaluate:o.ceil})}static trunc(e){return new m({inputs:[e],evaluate:o.trunc})}static add(e,t){return new m({inputs:[e,t],evaluate:o.add,invert:mu,integrate:vu,integrateInner:hu,applySubstitution:Rn})}static sub(e,t){return new m({inputs:[e,t],evaluate:o.sub,invert:bu,integrate:yu,integrateInner:wu,applySubstitution:Rn})}static mul(e,t){return new m({inputs:[e,t],evaluate:o.mul,invert:_u,integrate:Nu,applySubstitution:Cu})}static div(e,t){return new m({inputs:[e,t],evaluate:o.div,invert:ku,integrate:Su,applySubstitution:Mu})}static recip(e){return new m({inputs:[e],evaluate:o.recip,invert:Iu,integrate:$u})}static clamp(e,t,n){return new m({inputs:[e,t,n],evaluate:o.clamp,invert:Rn})}static pLog10(e){return new m({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new m({inputs:[e],evaluate:o.absLog10})}static log10(e){return new m({inputs:[e],evaluate:o.log10,invert:xu,integrate:Tu})}static log(e,t){return new m({inputs:[e,t],evaluate:o.log,invert:Du,integrate:Ou})}static log2(e){return new m({inputs:[e],evaluate:o.log2,invert:qu,integrate:Lu})}static ln(e){return new m({inputs:[e],evaluate:o.ln,invert:Bu,integrate:Uu})}static pow(e,t){return new m({inputs:[e,t],evaluate:o.pow,invert:Gu,integrate:Wu})}static pow10(e){return new m({inputs:[e],evaluate:o.pow10,invert:Hu,integrate:Zu})}static pow_base(e,t){return new m({inputs:[e,t],evaluate:o.pow_base,invert:Yu,integrate:Xu})}static root(e,t){return new m({inputs:[e,t],evaluate:o.root,invert:Ju,integrate:Ku})}static factorial(e){return new m({inputs:[e],evaluate:o.factorial})}static gamma(e){return new m({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new m({inputs:[e],evaluate:o.lngamma})}static exp(e){return new m({inputs:[e],evaluate:o.exp,invert:Qu,integrate:ec})}static sqr(e){return m.pow(e,2)}static sqrt(e){return m.root(e,2)}static cube(e){return m.pow(e,3)}static cbrt(e){return m.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:tc,invert:nc})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:ic,invert:rc})}static iteratedlog(e,t=10,n=1){return new m({inputs:[e,t,n],evaluate:ac})}static slog(e,t=10){return new m({inputs:[e,t],evaluate:sc,invert:oc})}static layeradd10(e,t){return new m({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new m({inputs:[e,t,n],evaluate:lc,invert:uc})}static lambertw(e){return new m({inputs:[e],evaluate:o.lambertw,invert:cc})}static ssqrt(e){return new m({inputs:[e],evaluate:o.ssqrt,invert:dc})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:fc})}static sin(e){return new m({inputs:[e],evaluate:o.sin,invert:yc,integrate:gc})}static cos(e){return new m({inputs:[e],evaluate:o.cos,invert:_c,integrate:vc})}static tan(e){return new m({inputs:[e],evaluate:o.tan,invert:Cc,integrate:bc})}static asin(e){return new m({inputs:[e],evaluate:o.asin,invert:pc,integrate:wc})}static acos(e){return new m({inputs:[e],evaluate:o.acos,invert:mc,integrate:Nc})}static atan(e){return new m({inputs:[e],evaluate:o.atan,invert:hc,integrate:kc})}static sinh(e){return new m({inputs:[e],evaluate:o.sinh,invert:Pc,integrate:Mc})}static cosh(e){return new m({inputs:[e],evaluate:o.cosh,invert:Dc,integrate:$c})}static tanh(e){return new m({inputs:[e],evaluate:o.tanh,invert:Ac,integrate:Ec})}static asinh(e){return new m({inputs:[e],evaluate:o.asinh,invert:Sc,integrate:Tc})}static acosh(e){return new m({inputs:[e],evaluate:o.acosh,invert:Ic,integrate:Fc})}static atanh(e){return new m({inputs:[e],evaluate:o.atanh,invert:xc,integrate:Oc})}step(e,t){return m.step(this,e,t)}if(e,t){return m.if(this,e,t)}conditional(e,t){return m.if(this,e,t)}abs(){return m.abs(this)}neg(){return m.neg(this)}sign(){return m.sign(this)}round(){return m.round(this)}floor(){return m.floor(this)}ceil(){return m.ceil(this)}trunc(){return m.trunc(this)}add(e){return m.add(this,e)}sub(e){return m.sub(this,e)}mul(e){return m.mul(this,e)}div(e){return m.div(this,e)}recip(){return m.recip(this)}max(e){return m.max(this,e)}min(e){return m.min(this,e)}maxabs(e){return m.maxabs(this,e)}minabs(e){return m.minabs(this,e)}clamp(e,t){return m.clamp(this,e,t)}clampMin(e){return m.clampMin(this,e)}clampMax(e){return m.clampMax(this,e)}pLog10(){return m.pLog10(this)}absLog10(){return m.absLog10(this)}log10(){return m.log10(this)}log(e){return m.log(this,e)}log2(){return m.log2(this)}ln(){return m.ln(this)}pow(e){return m.pow(this,e)}pow10(){return m.pow10(this)}pow_base(e){return m.pow_base(this,e)}root(e){return m.root(this,e)}factorial(){return m.factorial(this)}gamma(){return m.gamma(this)}lngamma(){return m.lngamma(this)}exp(){return m.exp(this)}sqr(){return m.pow(this,2)}sqrt(){return m.root(this,2)}cube(){return m.pow(this,3)}cbrt(){return m.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return m.iteratedlog(this,e,t)}slog(e=10){return m.slog(this,e)}layeradd10(e){return m.layeradd10(this,e)}layeradd(e,t){return m.layeradd(this,e,t)}lambertw(){return m.lambertw(this)}ssqrt(){return m.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.pentate(this,e,t)}sin(){return m.sin(this)}cos(){return m.cos(this)}tan(){return m.tan(this)}asin(){return m.asin(this)}acos(){return m.acos(this)}atan(){return m.atan(this)}sinh(){return m.sinh(this)}cosh(){return m.cosh(this)}tanh(){return m.tanh(this)}asinh(){return m.asinh(this)}acosh(){return m.acosh(this)}atanh(){return m.atanh(this)}};let Me=Te;Me.negate=Te.neg;Me.negated=Te.neg;Me.sgn=Te.sign;Me.plus=Te.add;Me.subtract=Te.sub;Me.minus=Te.sub;Me.multiply=Te.mul;Me.times=Te.mul;Me.divide=Te.div;Me.divideBy=Te.div;Me.dividedBy=Te.div;Me.reciprocal=Te.recip;Me.reciprocate=Te.recip;Me.max=xn(o.max);Me.min=xn(o.min);Me.minabs=xn(o.minabs);Me.maxabs=xn(o.maxabs);Me.clampMin=xn(o.clampMin);Me.clampMax=xn(o.clampMax);Me.logarithm=Te.log;class m extends Me{invert(t){if(this.internalInvert&&this.hasVariable())return this.internalInvert.call(this,t,...this.inputs);if(this.inputs.length===1&&this.hasVariable())return t;throw new Error("Cannot invert non-invertible formula")}evaluateIntegral(t){if(!this.isIntegrable())throw new Error("Cannot evaluate integral of formula without integral");return this.getIntegralFormula().evaluate(t)}invertIntegral(t){if(!this.isIntegrable()||!this.getIntegralFormula().isInvertible())throw new Error("Cannot invert integral of formula without invertible integral");return this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.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)throw new Error("Cannot integrate formula with non-integrable operation");let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(i=>n=i(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 throw new Error("Cannot integrate formula without variable");return this.integralFormula}else{if(this.applySubstitution==null)throw new Error("Cannot have two complex operations in an integrable formula");if(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner)return this.internalIntegrateInner.call(this,t,...this.inputs);if(this.internalIntegrate)return this.internalIntegrate.call(this,t,...this.inputs);if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())return this;throw new Error("Cannot integrate formula without variable")}}}function xr(e,t,n=!0,i,r=o.dInf){const a=we(n),l=we(i),u=we(r);return S(()=>{var y,C,w,N;const c=s(u);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const f=s(a),h=(y=s(l))!=null?y:f?10:0;let p=0;if(o.gt(c,h)){if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum");if(f){if(!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");p=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((C=s(e.innermostVariable))!=null?C:0)}else p=o.floor(e.invert(t.value))}if(p=o.clampMax(p,c),h>0){p=o.sub(p,h).clampMin(0);let P;for(f?P=Vt(e,p,!0,0):P=e.evaluate(o.add((w=s(e.innermostVariable))!=null?w:0,p));o.lt(p,c)&&o.lt(p,Number.MAX_SAFE_INTEGER);){const q=e.evaluate(p.add((N=s(e.innermostVariable))!=null?N:0));if(o.add(P,q).lte(t.value))p=p.add(1),P=o.add(P,q);else break}}return p})}function Vt(e,t,n=!0,i){var c;if(o.eq(t,1))return e.evaluate();const r=(c=s(e.innermostVariable))!=null?c:0;let a=o.add(t,r);const l=a;i!=null||(i=n?10:0),a=a.sub(i).clampMin(r);let u=0;if(o.gt(t,i)){if(!e.isInvertible())throw new Error("Cannot calculate cost with indirect sum of non-invertible formula");if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with cumulative cost of non-integrable formula");if(u=o.sub(e.evaluateIntegral(a),e.evaluateIntegral()),l.gt(1e308))return o.add(u,o.sub(l,a).times(e.evaluate(a)))}else if(u=e.evaluate(a),a=a.add(1),l.gt(1e308))return o.sub(l,a).add(1).times(u)}for(let f=a.toNumber();f{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=we(n),u=we(i),c=r==null?void 0:we(r);return{apply:f=>o.add(f,s(l)),invert:f=>o.sub(f,s(l)),getFormula:f=>m.add(f,l),enabled:c,description:i==null?void 0:ee(()=>g("div",{class:"modifier-container"},[s(u)!=null?g("span",{class:"modifier-description"},[bt(s(u))]):null,g("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),0):o.lt(s(l),0))?"color: var(--danger)":""},[o.gte(s(l),0)?"+":"",Kt(s(l))])]))}})}function Ve(e){return Ue(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=we(n),u=we(i),c=r==null?void 0:we(r);return{apply:f=>o.times(f,s(l)),invert:f=>o.div(f,s(l)),getFormula:f=>m.times(f,l),enabled:c,description:i==null?void 0:ee(()=>g("div",{class:"modifier-container"},[s(u)!=null?g("span",{class:"modifier-description"},[bt(s(u))]):null,g("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[F("\xD7"),Kt(s(l))])]))}})}function Ki(e){return Ue(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:l}=e.call(t,t),u=we(n),c=we(i),f=r==null?void 0:we(r);return{apply:h=>{let p=h;return a&&(p=o.add(p,1)),p=o.pow(p,s(u)),a&&(p=o.sub(p,1)),p},invert:h=>{let p=h;return a&&(p=o.add(p,1)),p=o.root(p,s(u)),a&&(p=o.sub(p,1)),p},getFormula:h=>a?m.add(h,1).pow(u).sub(1):m.pow(h,u),enabled:f,description:i==null?void 0:ee(()=>g("div",{class:"modifier-container"},[s(c)!=null?g("span",{class:"modifier-description"},[bt(s(c)),a?" (+1 effective)":null]):null,g("span",{class:"modifier-amount",style:(l===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[F("^"),Kt(s(u))])]))}})}function Et(e){return Ue(()=>{const t=e();return{apply:n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?S(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?ee(()=>g(ae,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(bt)])):void 0}})}const Vc={key:0},Lc={key:0,class:"mark star"},Bc=["src"],jc=K({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(I(),T("div",Vc,[e.mark===!0?(I(),T("div",Lc)):(I(),T("img",{key:1,class:"mark",src:e.mark},null,8,Bc))])):L("",!0)}});var Un=fe(jc,[["__scopeId","data-v-2207999f"]]);const zc=K({__name:"Node",props:{id:null},setup(e){const n=$e(e),i=ii(Fi,()=>{}),r=ii(Ai,()=>{}),a=ct(null),l=S(()=>a.value&&a.value.parentElement);return ut([l,n.id],([u,c],[f,h])=>{f&&r(s(h)),u&&i(c,u)}),ar(()=>r(s(n.id))),(u,c)=>(I(),T("div",{class:"node",ref_key:"node",ref:a},null,512))}});var Gn=fe(zc,[["__scopeId","data-v-a48cb382"]]),Uc=K({props:{display:{type:R(Object,String,Function),required:!0},visibility:{type:R(Number,Boolean),required:!0},style:R(Object,String,Array),classes:R(Object),onClick:Function,onHold:Function,canClick:{type:R(Boolean),required:!0},small:Boolean,mark:R(Boolean,String),id:{type:String,required:!0}},components:{Node:Gn,MarkNode:Un},setup(e){const{display:t,onClick:n,onHold:i}=$e(e),r=ct("");ht(()=>{var h;const u=Se(t);if(u==null){r.value="";return}if(kt(u)){r.value=ue(u);return}const c=ue((h=u.title)!=null?h:"","h3"),f=ue(u.description,"div");r.value=ue(ee(()=>g("span",null,[u.title!=null?g("div",null,[g(c,null,null)]):null,g(f,null,null)])))});const{start:a,stop:l}=vr(n,i);return{start:a,stop:l,comp:r,Visibility:Ne,isVisible:Le,isHidden:hn,unref:s}}});function Gc(e,t,n,i,r,a){var c;const l=yt("MarkNode"),u=yt("Node");return e.isVisible(e.visibility)?(I(),T("button",{key:0,style:Ae([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...f)=>e.onClick&&e.onClick(...f)),onMousedown:t[1]||(t[1]=(...f)=>e.start&&e.start(...f)),onMouseleave:t[2]||(t[2]=(...f)=>e.stop&&e.stop(...f)),onMouseup:t[3]||(t[3]=(...f)=>e.stop&&e.stop(...f)),onTouchstartPassive:t[4]||(t[4]=(...f)=>e.start&&e.start(...f)),onTouchendPassive:t[5]||(t[5]=(...f)=>e.stop&&e.stop(...f)),onTouchcancelPassive:t[6]||(t[6]=(...f)=>e.stop&&e.stop(...f)),class:ye({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)?(I(),te(Be(e.unref(e.comp)),{key:0})):L("",!0),g(l,{mark:e.unref(e.mark)},null,8,["mark"]),g(u,{id:e.id},null,8,["id"])],38)):L("",!0)}var Er=fe(Uc,[["render",Gc],["__scopeId","data-v-211328c0"]]);const Wc=Symbol("Clickable");function Hc(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return Ue(i=>{var l,u,c;const r=(l=e==null?void 0:e.call(i,i))!=null?l:{};r.id=vn("clickable-"),r.type=Wc,r[dt]=Er;for(const f of t)(u=f.preConstruct)==null||u.call(f,r);if(Object.assign(r,n),E(r,"visibility"),re(r,"visibility",Ne.Visible),E(r,"canClick"),re(r,"canClick",!0),E(r,"classes"),E(r,"style"),E(r,"mark"),E(r,"display"),r.onClick){const f=r.onClick.bind(r);r.onClick=function(h){s(r.canClick)!==!1&&f(h)}}if(r.onHold){const f=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&f()}}for(const f of t)(c=f.postConstruct)==null||c.call(f,r);const a=t.reduce((f,h)=>{var p;return Object.assign(f,(p=h.getGatheredProps)==null?void 0:p.call(h,r))},{});return r[nt]=function(){const{display:f,visibility:h,style:p,classes:y,onClick:C,onHold:w,canClick:N,small:P,mark:q,id:x}=this;return{display:f,visibility:h,style:s(p),classes:y,onClick:C,onHold:w,canClick:N,small:P,mark:q,id:x,...a}},r})}const Zc=["x1","y1","x2","y2"],Yc=K({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=$e(e),i=S(()=>{const a=n.startNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetStart&&(u.x+=n.link.value.offsetStart.x,u.y+=n.link.value.offsetStart.y),u}),r=S(()=>{const a=n.endNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetEnd&&(u.x+=n.link.value.offsetEnd.x,u.y+=n.link.value.offsetEnd.y),u});return(a,l)=>(I(),T("line",Bt({"stroke-width":"15px",stroke:"white"},e.link,{x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Zc))}});const Xc=K({__name:"Links",props:{links:null},setup(e){var c;const n=en(e,"links"),i=j(null),r=ii(Oi,j({})),a=ii(qi,j(void 0)),l=j((c=i.value)==null?void 0:c.getBoundingClientRect());ut(a,()=>{var f;return l.value=(f=i.value)==null?void 0:f.getBoundingClientRect()}),di(()=>{var f;return l.value=(f=i.value)==null?void 0:f.getBoundingClientRect()});const u=S(()=>{var h,p;const f=r.value;return(p=(h=n.value)==null?void 0:h.filter(y=>{var C,w;return((C=f[y.startNode.id])==null?void 0:C.rect)&&((w=f[y.startNode.id])==null?void 0:w.rect)}))!=null?p:[]});return(f,h)=>(I(),T(ae,null,[s(u)?(I(),T("svg",Wr(Bt({key:0},f.$attrs)),[(I(!0),T(ae,null,Mn(s(u),(p,y)=>(I(),te(Yc,{key:y,link:p,boundingRect:l.value,startNode:s(r)[p.startNode.id],endNode:s(r)[p.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):L("",!0),k("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Jc=fe(Xc,[["__scopeId","data-v-063f6d6b"]]);K({props:{nodes:{type:R(Array),required:!0},leftSideNodes:R(Array),rightSideNodes:R(Array),branches:R(Array)},components:{Links:Jc},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=$e(e),r=ct();ht(()=>{const u=Se(t);r.value=ue(ee(()=>g(ae,null,[u.map(c=>g("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(bt)]))])))});const a=ct();ht(()=>{const u=Se(n);a.value=u?ue(ee(()=>g("span",{class:"left-side-nodes small"},[u.map(bt)]))):""});const l=ct();return ht(()=>{const u=Se(i);l.value=u?ue(ee(()=>g("span",{class:"side-nodes small"},[u.map(bt)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:l}}});K({props:{display:R(Object,String,Function),visibility:{type:R(Number,Boolean),required:!0},style:R(String,Object,Array),classes:R(Object),onClick:Function,onHold:Function,color:R(String),glowColor:R(String),canClick:{type:R(Boolean),required:!0},mark:R(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Un,Node:Gn},setup(e){const{onClick:t,onHold:n,display:i}=$e(e),r=$n(i),{start:a,stop:l}=vr(t,n);return{start:a,stop:l,comp:r,unref:s,Visibility:Ne,isCoercableComponent:kt,isVisible:Le,isHidden:hn}}});function Vn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(u=>we(u.base)),n.baseText=t.map(u=>we(u.baseText)),n.visible=t.map(u=>we(u.visible)),n.title=t.map(u=>we(u.title)),n.subtitle=t.map(u=>we(u.subtitle)),i=!0),t}const a=lt({},!1);return[ee(()=>{const u=r();let c=!0;const f=u.map((h,p)=>{var q,x,D;if(s(n.visible[p])===!1)return null;const y=g("h3",{onClick:()=>a.value[p]=!a.value[p],style:"cursor: pointer"},[g("span",{class:"modifier-toggle"+(s(a.value[p])?" collapsed":"")},[F("\u25BC")]),s(n.title[p]),s(n.subtitle[p])!=null?g("span",{class:"subtitle"},[F(" ("),s(n.subtitle[p]),F(")")]):null]),C=s(a.value[p])?null:g(ae,null,[g("div",{class:"modifier-container"},[g("span",{class:"modifier-description"},[bt((q=s(n.baseText[p]))!=null?q:"Base")]),g("span",{class:"modifier-amount"},[dn((x=s(n.base[p]))!=null?x:1),h.unit])]),h.modifier.description==null?null:bt(s(h.modifier.description))]),w=!c;c=!1;const N=(D=s(n.base[p]))!=null?D:1,P=h.modifier.apply(N);return g(ae,null,[w?g("br",null,null):null,g("div",{style:{"--unit":le.alignUnits&&h.unit!=null?"'"+h.unit+"'":""}},[y,g("br",null,null),C,g("hr",null,null),g("div",{class:"modifier-container"},[g("span",{class:"modifier-description"},[F("Total")]),g("span",{class:"modifier-amount",style:(h.smallerIsBetter===!0?o.gt(P,N!=null?N:1):o.lt(P,N!=null?N:1))?"color: var(--danger)":""},[Kt(P),h.unit])])])])});return g(ae,null,[f])}),a]}function Qi(e,t,n){const i=we(t),r=we(n);return S(()=>{const a=s(i),l=s(r);return o.gte(e.value,l)?"Now":o.lte(a,0)?"Never":pi(o.sub(l,e.value).div(a))})}function _n(e,t,n=1){const i=we(t),r=we(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return ee(()=>{var a;if(s(i)){const l=Kt(e.evaluate()),u=Kt(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return g(ae,null,[g("b",null,[g("i",null,[l,F(" \u2192 "),u])])])}return g(ae,null,[Kt(e.evaluate())])})}const Kc=K({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(I(),T("div",{style:Ae({width:e.width,height:e.height})},null,4))}});function Si(e){return Ue(t=>{var i;const n=e.call(t,t);return n.partialDisplay=r=>g("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[ui(n.resource,n.cost instanceof m?Vt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=r=>g("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",ui(n.resource,n.cost instanceof m?Vt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),E(n,"visibility"),re(n,"visibility",Ne.Visible),E(n,"cost"),E(n,"requiresPay"),re(n,"requiresPay",!0),E(n,"cumulativeCost"),re(n,"cumulativeCost",!0),E(n,"maxBulkAmount"),re(n,"maxBulkAmount",1),E(n,"directSum"),re(n,"pay",function(r){const a=n.cost instanceof m?Vt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost);n.resource.value=o.sub(n.resource.value,a).max(0)}),n.canMaximize=S(()=>{var u;if(!(n.cost instanceof m))return!1;const r=s(n.maxBulkAmount);if(o.lte(r,1))return!1;const a=s(n.cumulativeCost),l=(u=s(n.directSum))!=null?u:a?10:0;return o.lte(r,l)?!0:!(!n.cost.isInvertible()||a===!0&&!n.cost.isIntegrable())}),n.cost instanceof m?n.requirementMet=xr(n.cost,n.resource,(i=n.cumulativeCost)!=null?i:!0,n.directSum,n.maxBulkAmount):n.requirementMet=S(()=>o.gte(n.resource.value,s(n.cost))),n})}function ji(e){return Ue(()=>({requirementMet:S(()=>Le(e.visibility)),visibility:Ne.None,requiresPay:!1}))}function Qc(e,t){return Ue(()=>({requirementMet:we(e),partialDisplay:t==null?void 0:ee(()=>bt(t)),display:t==null?void 0:ee(()=>g(ae,null,[F("Req: "),bt(t)])),visibility:t==null?Ne.None:Ne.Visible,requiresPay:!1}))}function gi(e){if(Dt(e))return e.every(gi);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function Pr(e){if(Dt(e))return e.map(Pr).reduce(o.min);const t=s(e.requirementMet);return typeof t=="boolean"?t?o.dInf:0:o.gt(t,1)&&s(e.canMaximize)!==!0?1:t}function mi(e,t=1){var n,i;if(Dt(e)&&(e=e.filter(r=>Le(r.visibility)),e.length===1&&(e=e[0])),Dt(e)){e=e.filter(l=>"partialDisplay"in l);const r=e.filter(l=>s(l.requiresPay)),a=e.filter(l=>!s(l.requiresPay));return g(ae,null,[r.length>0?g("div",null,[F("Costs:")," ",Xi(r.map(l=>l.partialDisplay(t)),g(ae,null,[F(", ")]))]):null,a.length>0?g("div",null,[F("Requires:")," ",Xi(a.map(l=>l.partialDisplay(t)),g(ae,null,[F(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:g(ae,null,null)}function Tr(e,t=1){var n;Dt(e)?e.filter(i=>s(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):s(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var ed=K({props:{visibility:{type:R(Number,Boolean),required:!0},display:R(Object,String,Function),earned:{type:R(Boolean),required:!0},requirements:R(Object,Array),image:R(String),style:R(String,Object,Array),classes:R(Object),mark:R(Boolean,String),small:R(Boolean),id:{type:String,required:!0}},components:{Node:Gn,MarkNode:Un},setup(e){const{display:t,requirements:n,earned:i}=$e(e),r=ct("");return ht(()=>{const a=Se(t);if(a==null){r.value="";return}if(kt(a)){r.value=ue(a);return}const l=ue(a.requirement?a.requirement:ee(()=>{var f;return mi((f=Se(n))!=null?f:[])}),"h3"),u=ue(a.effectDisplay||"","b"),c=Se(i)?ue(a.optionsDisplay||"","span"):"";r.value=ue(ee(()=>g("span",null,[g(l,null,null),a.effectDisplay!=null?g("div",null,[g(u,null,null)]):null,a.optionsDisplay!=null?g("div",{class:"equal-spaced"},[g(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:Ne,isVisible:Le,isHidden:hn}}});function td(e,t,n,i,r,a){var c;const l=yt("MarkNode"),u=yt("Node");return e.isVisible(e.visibility)?(I(),T("div",{key:0,style:Ae([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:ye({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?(I(),te(Be(e.comp),{key:0})):L("",!0),g(l,{mark:e.unref(e.mark)},null,8,["mark"]),g(u,{id:e.id},null,8,["id"])],6)):L("",!0)}var nd=fe(ed,[["render",td],["__scopeId","data-v-5673325a"]]);const id=fi(),rd=Symbol("Achievement");let Nn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function ad(e,...t){const n=lt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Ue(r=>{var c,f,h;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=vn("achievement-"),a.type=rd,a[dt]=nd;for(const p of t)(f=p.preConstruct)==null||f.call(p,a);a.earned=n,a.complete=function(){var y,C;n.value=!0;const p=a;if((y=p.onComplete)==null||y.call(p),p.display!=null&&s(p.showPopups)===!0){const w=s(p.display);let N;kt(w)?N=ue(w):w.requirement!=null?N=ue(w.requirement):N=mi((C=p.requirements)!=null?C:[]),id.info(g("div",null,[g("h3",null,[F("Achievement earned!")]),g("div",null,[g(N,null,null)])]))}},Object.assign(a,i),E(a,"visibility"),re(a,"visibility",Ne.Visible);const l=a.visibility;a.visibility=Hr(()=>{const p=s(a.display);switch(le.msDisplay){default:case Nn.All:return s(l);case Nn.Configurable:return s(a.earned)&&!(p!=null&&typeof p=="object"&&"optionsDisplay"in p)?Ne.None:s(l);case Nn.Incomplete:return s(a.earned)?Ne.None:s(l);case Nn.None:return Ne.None}}),E(a,"display"),E(a,"mark"),E(a,"small"),E(a,"image"),E(a,"style"),E(a,"classes"),E(a,"showPopups"),re(a,"showPopups",!0);for(const p of t)(h=p.postConstruct)==null||h.call(p,a);const u=t.reduce((p,y)=>{var C;return Object.assign(p,(C=y.getGatheredProps)==null?void 0:C.call(y,a))},{});if(a[nt]=function(){const{visibility:p,display:y,requirements:C,earned:w,image:N,style:P,classes:q,mark:x,small:D,id:U}=this;return{visibility:p,display:y,requirements:C,earned:w,image:N,style:s(P),classes:q,mark:x,small:D,id:U,...u}},a.requirements){const p=a,y=[ji(p),Qc(()=>!p.earned.value),...Dt(a.requirements)?a.requirements:[a.requirements]];ht(()=>{le.active===Q.id&&gi(y)&&p.complete()})}return a})}Xe.on("loadSettings",e=>{re(e,"msDisplay",Nn.All)});const sd=Object.values(Nn).map(e=>({label:Ye(e),value:e}));ss(ee(()=>g(Li,{title:ee(()=>g("span",{class:"option-title"},[F("Show achievements"),g("desc",null,[F("Select which achievements to display based on criterias.")])])),options:sd,"onUpdate:modelValue":e=>le.msDisplay=e,modelValue:le.msDisplay},null)));const od=K({props:{progress:{type:R(String,Object,Number),required:!0},width:{type:R(Number),required:!0},height:{type:R(Number),required:!0},direction:{type:R(String),required:!0},display:R(Object,String,Function),visibility:{type:R(Number,Boolean),required:!0},style:R(Object,String,Array),classes:R(Object),borderStyle:R(Object,String,Array),textStyle:R(Object,String,Array),baseStyle:R(Object,String,Array),fillStyle:R(Object,String,Array),mark:R(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Un,Node:Gn},setup(e){const{progress:t,width:n,height:i,direction:r,display:a}=$e(e),l=S(()=>{let f=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(f,0),1))*100}),u=S(()=>{const f={width:Se(n)+.5+"px",height:Se(i)+.5+"px"};switch(s(r)){case W.Up:f.clipPath=`inset(${l.value}% 0% 0% 0%)`,f.width=Se(n)+1+"px";break;case W.Down:f.clipPath=`inset(0% 0% ${l.value}% 0%)`,f.width=Se(n)+1+"px";break;case W.Right:f.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case W.Left:f.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case W.Default:f.clipPath="inset(0% 50% 0% 0%)";break}return f}),c=$n(a);return{normalizedProgress:l,barStyle:u,component:c,unref:s,Visibility:Ne,isVisible:Le,isHidden:hn}}});function ld(e,t,n,i,r,a){var c,f,h,p,y,C,w;const l=yt("MarkNode"),u=yt("Node");return e.isVisible(e.visibility)?(I(),T("div",{key:0,style:Ae([{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:ye({bar:!0,...e.unref(e.classes)})},[k("div",{class:"overlayTextContainer border",style:Ae([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(f=e.unref(e.borderStyle))!=null?f:{}])},[e.component?(I(),T("span",{key:0,class:"overlayText",style:Ae(e.unref(e.textStyle))},[(I(),te(Be(e.component)))],4)):L("",!0)],4),k("div",{class:"border",style:Ae([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(h=e.unref(e.style))!=null?h:{},(p=e.unref(e.baseStyle))!=null?p:{},(y=e.unref(e.borderStyle))!=null?y:{}])},[k("div",{class:"fill",style:Ae([e.barStyle,(C=e.unref(e.style))!=null?C:{},(w=e.unref(e.fillStyle))!=null?w:{}])},null,4)],4),g(l,{mark:e.unref(e.mark)},null,8,["mark"]),g(u,{id:e.id},null,8,["id"])],6)):L("",!0)}var ud=fe(od,[["render",ld],["__scopeId","data-v-6bd06b56"]]);const cd=Symbol("Bar");function dd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return Ue(i=>{var l,u;const r=e.call(i,i);r.id=vn("bar-"),r.type=cd,r[dt]=ud;for(const c of t)(l=c.preConstruct)==null||l.call(c,r);Object.assign(r,n),E(r,"visibility"),re(r,"visibility",Ne.Visible),E(r,"width"),E(r,"height"),E(r,"direction"),E(r,"style"),E(r,"classes"),E(r,"borderStyle"),E(r,"baseStyle"),E(r,"textStyle"),E(r,"fillStyle"),E(r,"progress"),E(r,"display"),E(r,"mark");for(const c of t)(u=c.postConstruct)==null||u.call(c,r);const a=t.reduce((c,f)=>{var h;return Object.assign(c,(h=f.getGatheredProps)==null?void 0:h.call(f,r))},{});return r[nt]=function(){const{progress:c,width:f,height:h,direction:p,display:y,visibility:C,style:w,classes:N,borderStyle:P,textStyle:q,baseStyle:x,fillStyle:D,mark:U,id:ve}=this;return{progress:c,width:f,height:h,direction:p,display:y,visibility:C,style:s(w),classes:N,borderStyle:P,textStyle:q,baseStyle:x,fillStyle:D,mark:U,id:ve,...a}},r})}function fd(e,...t){return Ue(n=>{var r,a;const i=e.call(n,n);for(const l of t)(r=l.preConstruct)==null||r.call(l,i);i.formula=i.formula(m.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=S(()=>{let l=o.floor(i.formula.evaluate(i.baseResource.value)).max(0);return s(i.buyMax)===!1&&(l=l.min(1)),l})),i.actualGain==null&&(i.actualGain=i.currentGain),i.currentAt==null&&(i.currentAt=S(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=S(()=>i.formula.invert(o.floor(s(i.currentGain)).add(1)))),i.convert==null&&(i.convert=function(){var u;const l=s(i.currentGain);i.gainResource.value=o.add(i.gainResource.value,l),i.spend(l),(u=i.onConvert)==null||u.call(i,l)}),i.spend==null&&(i.spend=function(){i.baseResource.value=0}),E(i,"currentGain"),E(i,"actualGain"),E(i,"currentAt"),E(i,"nextAt"),E(i,"buyMax"),re(i,"buyMax",!0);for(const l of t)(a=l.postConstruct)==null||a.call(l,i);return i})}function pd(e){return fd(e)}const Dr=Symbol("Repeatable");function gd(e,...t){const n=lt(0),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Ue(r=>{var y,C,w;const a=e.call(r,r);a.id=vn("repeatable-"),a.type=Dr,a[dt]=Er;for(const N of t)(y=N.preConstruct)==null||y.call(N,a);a.amount=n,a.amount[In]=(C=a.initialAmount)!=null?C:0,Object.assign(a,i);const l={requirementMet:S(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:Ne.None},u=ji(a);Dt(a.requirements)?(a.requirements.unshift(u),a.requirements.push(l)):a.requirements=[u,a.requirements,l],a.maxed=S(()=>o.gte(a.amount.value,s(a.limit))),E(a,"classes");const c=a.classes;a.classes=S(()=>{const N=s(c)||{};return a.maxed.value&&(N.bought=!0),N}),a.amountToIncrease=S(()=>o.clampMin(Pr(a.requirements),1)),a.canClick=S(()=>gi(a.requirements));const f=a.onClick;a.onClick=function(N){const P=a;!s(P.canClick)||(Tr(a.requirements,s(a.amountToIncrease)),P.amount.value=o.add(P.amount.value,1),f==null||f(N))},E(a,"display");const h=a.display;a.display=ee(()=>{var P,q,x;const N=s(h);if(kt(N)){const D=ue(N);return g(D,null,null)}if(N!=null){const D=a,U=ue((P=N.title)!=null?P:"","h3"),ve=ue((q=N.description)!=null?q:""),ne=ue((x=N.effectDisplay)!=null?x:"");return g("span",null,[N.title==null?null:g("div",null,[g(U,null,null)]),N.description==null?null:g(ve,null,null),N.showAmount===!1?null:g("div",null,[g("br",null,null),g(ae,null,[F("Amount: "),Ze(D.amount.value)]),o.isFinite(s(D.limit))?g(ae,null,[F(" / "),Ze(s(D.limit))]):void 0]),N.effectDisplay==null?null:g("div",null,[g("br",null,null),F("Currently: "),g(ne,null,null)]),D.maxed.value?null:g("div",null,[g("br",null,null),mi(D.requirements,s(a.amountToIncrease))])])}return""}),E(a,"visibility"),re(a,"visibility",Ne.Visible),E(a,"limit"),re(a,"limit",o.dInf),E(a,"style"),E(a,"mark"),E(a,"small");for(const N of t)(w=N.postConstruct)==null||w.call(N,a);const p=t.reduce((N,P)=>{var q;return Object.assign(N,(q=P.getGatheredProps)==null?void 0:q.call(P,a))},{});return a[nt]=function(){const{display:N,visibility:P,style:q,classes:x,onClick:D,canClick:U,small:ve,mark:ne,id:Y}=this;return{display:N,visibility:P,style:s(q),classes:x,onClick:D,canClick:U,small:ve,mark:ne,id:Y,...p}},a})}function er(e,t){return E(t,"display"),E(t,"classes"),E(t,"style"),E(t,"direction"),re(t,"direction",W.Up),E(t,"xoffset"),E(t,"yoffset"),t.pinnable&&(t.pinned=lt(!1,!1)),Lt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,yr(t.pinned)):e.pinned=t.pinned);const n=e[dt];e[dt]=Pe;const i=e[nt].bind(e);e[nt]=function(){const{display:a,classes:l,style:u,direction:c,xoffset:f,yoffset:h,pinned:p}=this;return{element:{[dt]:n,[nt]:i},display:a,classes:l,style:s(u),direction:c,xoffset:f,yoffset:h,pinned:p}}.bind(t)}),t}var md=K({props:{display:{type:R(String,Object,Function),required:!0},visibility:{type:R(Number,Boolean),required:!0},style:R(String,Object,Array),classes:R(Object),requirements:{type:Object,required:!0},canPurchase:{type:R(Boolean),required:!0},bought:{type:R(Boolean),required:!0},mark:R(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Gn,MarkNode:Un},setup(e){const{display:t,requirements:n,bought:i}=$e(e),r=ct("");return ht(()=>{const a=Se(t);if(a==null){r.value="";return}if(kt(a)){r.value=ue(a);return}const l=ue(a.title||"","h3"),u=ue(a.description,"div"),c=ue(a.effectDisplay||"");r.value=ue(ee(()=>g("span",null,[a.title!=null?g("div",null,[g(l,null,null)]):null,g(u,null,null),a.effectDisplay!=null?g("div",null,[F("Currently: "),g(c,null,null)]):null,i.value?null:g(ae,null,[g("br",null,null),mi(n.value)])])))}),{component:r,unref:s,Visibility:Ne,isVisible:Le,isHidden:hn}}});const vd=["disabled"];function hd(e,t,n,i,r,a){var c;const l=yt("MarkNode"),u=yt("Node");return e.isVisible(e.visibility)?(I(),T("button",{key:0,style:Ae([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...f)=>e.purchase&&e.purchase(...f)),class:ye({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)?(I(),te(Be(e.unref(e.component)),{key:0})):L("",!0),g(l,{mark:e.unref(e.mark)},null,8,["mark"]),g(u,{id:e.id},null,8,["id"])],14,vd)):L("",!0)}var bd=fe(md,[["render",hd],["__scopeId","data-v-9be6bac0"]]);const Fr=Symbol("Upgrade");function yd(e,...t){const n=lt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Ue(r=>{var c,f;const a=e.call(r,r);a.id=vn("upgrade-"),a.type=Fr,a[dt]=bd;for(const h of t)(c=h.preConstruct)==null||c.call(h,a);a.bought=n,Object.assign(a,i),a.canPurchase=S(()=>!n.value&&gi(a.requirements)),a.purchase=function(){var p;const h=a;!s(h.canPurchase)||(Tr(a.requirements),n.value=!0,(p=h.onPurchase)==null||p.call(h))};const l=ji(a);Dt(a.requirements)?a.requirements.unshift(l):a.requirements=[l,a.requirements],E(a,"visibility"),re(a,"visibility",Ne.Visible),E(a,"classes"),E(a,"style"),E(a,"display"),E(a,"mark");for(const h of t)(f=h.postConstruct)==null||f.call(h,a);const u=t.reduce((h,p)=>{var y;return Object.assign(h,(y=p.getGatheredProps)==null?void 0:y.call(p,a))},{});return a[nt]=function(){const{display:h,visibility:p,style:y,classes:C,requirements:w,canPurchase:N,bought:P,mark:q,id:x,purchase:D}=this;return{display:h,visibility:p,style:s(y),classes:C,requirements:w,canPurchase:N,bought:P,mark:q,id:x,purchase:D,...u}},a})}function wd(e,t,n,i){return function(){e>>>=0,t>>>=0,n>>>=0,i>>>=0;let r=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,i=i+1|0,r=r+i|0,n=n+r|0,(r>>>0)/4294967296}}const _d={1:["b","c","d","f","g","h","i","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"],2:["a","e","o","u"],3:["br","cr","dr","fr","gr","pr","str","tr","bl","cl","fl","gl","pl","sl","sc","sk","sm","sn","sp","st","sw","ch","sh","th","wh"],4:["ae","ai","ao","au","a","ay","ea","ei","eo","eu","e","ey","ua","ue","ui","uo","u","uy","ia","ie","iu","io","iy","oa","oe","ou","oi","o","oy"],5:["turn","ter","nus","rus","tania","hiri","hines","gawa","nides","carro","rilia","stea","lia","lea","ria","nov","phus","mia","nerth","wei","ruta","tov","zuno","vis","lara","nia","liv","tera","gantu","yama","tune","ter","nus","cury","bos","pra","thea","nope","tis","clite"],6:["una","ion","iea","iri","illes","ides","agua","olla","inda","eshan","oria","ilia","erth","arth","orth","oth","illon","ichi","ov","arvis","ara","ars","yke","yria","onoe","ippe","osie","one","ore","ade","adus","urn","ypso","ora","iuq","orix","apus","ion","eon","eron","ao","omia"]},tr=[[1,2,5],[2,3,6],[3,4,5],[4,3,6],[3,4,2,5],[2,1,3,6],[3,4,2,5],[4,3,1,6],[3,4,1,4,5],[4,1,4,3,6]];function Mi(e){const t=tr[Math.floor(e()*tr.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}const nr=fi();function Ar(e,t,n,i){return Ri(e,function(){const r=wd(0,n>>0,n>>32,1);for(let V=0;V<12;V++)r();const a=Mi(r),l=Kn([.64,.75,.55],r),u=Kn([.18,.2,.25],r),c=ni(0,Mi(r)),f=lt(0),h=Yt.indexOf(t);let p=r();const y=i.reduce((V,B)=>(V[B.type]=B.data,V),{});"increaseDiff"in y&&(p=p/2+.5),"decreaseDiff"in y&&(p=p/2),"relic"in y&&(p=1);const C=p+h+1,w="increaseRewards"in y?C+1:C;let N="relic"in y?h+2:Math.ceil(r()*(h+2));"increaseLength"in y&&N++;const P=[],q=Et(()=>[...P,Ve(()=>({multiplier:()=>oe.isEmpowered("silver")?4:2,description:()=>(oe.isEmpowered("silver")?"Empowered ":"")+oe.tools.silver.name,enabled:()=>oe.toolNodes.value.silver!=null})),Ve(()=>({multiplier:()=>(oe.isEmpowered("diamond")?2:1)*de.filter(V=>V.bought.value).length/10,description:()=>(oe.isEmpowered("diamond")?"Empowered ":"")+oe.tools.diamond.name,enabled:()=>oe.toolNodes.value.diamond!=null})),Ve(()=>({multiplier:()=>o.div(f.value,6e3).times(oe.isEmpowered("emerald")?2:1),description:()=>(oe.isEmpowered("emerald")?"Empowered ":"")+oe.tools.emerald.name,enabled:()=>oe.toolNodes.value.emerald!=null}))]),x=S(()=>q.apply(0)),D=[],U={};function ve({feature:V,canClick:B,modifier:Ee,cost:St,previewModifier:wt,showETA:je,previewCost:Gt}){B=we(B),je=we(je);const At=fs(V);D.push({shouldShowPreview:S(()=>s(B)&&At.value),modifier:Et(()=>{const Ot=P.slice();return Ot.splice(Ot.indexOf(Ee),1,wt),Ot}),cost:Gt!=null?Gt:St}),P.push(Ee);const Wt=Qi(c,x,()=>Ce(St)),Ge=er(V,{display:je==null?Wt:()=>s(je)?Wt.value:"",direction:W.Down});return{isHovering:At,eta:Wt,tooltip:Ge}}const ne=[],Y=j(0);let J=m.variable(Y).times(0);const z={};let ce=!0;const H=S(()=>o.add(C,r()-.5).pow_base(2).times(10).times(J.evaluate())),_e=[];for(let V=0;V({addend:De,description:$t,enabled:He.bought})),mt=cn(()=>({addend:De}));break}case"mult":{const De=r()*5+1;xt=`Multiply previous ${c.displayName} gain by x${be(De)}.`,J=J.add(o.sub(De,1).times(z[vt-1])),Nt=Ve(()=>({multiplier:De,description:$t,enabled:He.bought})),mt=Ve(()=>({multiplier:De}));break}case"pow":{const De=r()/5+1.1;xt=`Raise previous ${c.displayName} gain to the ^${be(De)}`,J=J.add(o.pow(z[vt-1],De)).sub(z[vt-1]),Nt=Ki(()=>({exponent:De,description:$t,enabled:He.bought})),mt=Ki(()=>({exponent:De}))}}z[Y.value]=J.evaluate(),Y.value++;const Ht=ce,He=yd(()=>({requirements:Si(()=>({resource:Jn(c),cost:It})),display:{title:$t,description:xt},visibility:Ht}));ve({feature:He,canClick:()=>He.canPurchase.value,modifier:Nt,cost:It,showETA:()=>!He.bought.value,previewModifier:mt}),nn.push(He)}ne.push(nn);break;case"repeatables":const pt=[];for(let We=0;We<3;We++){const wn=Qn({add:1.5,mult:3},r),It=Y.value,$t=H.value,xt=ei(r);let Nt="",mt,vt,Ht,He;const De=m.variable(S(()=>Qe.amount.value)).times(2);switch(wn){case"add":{const Re=o.add($t,10).times(r()+.5);Nt=`Gain ${be(Re)} ${c.displayName}/s`,He=De.add(1).times($t),J=J.add(S(()=>o.sub(Y.value,It).add(1).times(5).times(Re))),mt=S(()=>be(o.times(Re,Qe.amount.value))+"/s"),vt=cn(()=>({addend:()=>o.times(Re,Qe.amount.value),description:xt,enabled:()=>o.gt(Qe.amount.value,0)})),Ht=cn(()=>({addend:()=>o.add(Qe.amount.value,1).times(Re)}));break}case"mult":{const Re=r()*.75+1.25;Nt=`Multiply previous ${c.displayName} gain by x${be(Re)}.`,He=De.pow_base(Re).times($t),J=J.add(S(()=>o.sub(Y.value,It).add(1).times(5).pow_base(Re).sub(1).times(z[It-1]))),mt=S(()=>"x"+be(o.pow(Re,Qe.amount.value))),vt=Ve(()=>({multiplier:()=>o.pow(Re,Qe.amount.value),description:xt,enabled:()=>o.gt(Qe.amount.value,0)})),Ht=Ve(()=>({multiplier:()=>o.add(Qe.amount.value,1).pow_base(Re)}));break}}z[Y.value]=J.evaluate(),Y.value++;const wi=ce,Qe=gd(()=>({requirements:Si(()=>({resource:Jn(c),cost:He})),display:()=>({title:xt,description:Nt,effectDisplay:s(mt)}),visibility:wi}));ve({feature:Qe,canClick:()=>s(Qe.canClick),modifier:vt,cost:He,previewModifier:Ht}),pt.push(Qe)}ne.push(pt);break;case"conversion":const Ie=ni(0,Mi(r)),gt=Kn([.64,.75,.55],r),rn=H.value,Yn=r()/2+.25,v=r()/2+.25,d=Y.value;J=J.add(S(()=>o.sub(Y.value,d).add(1).pow_base(5).pow(v).times(z[d-1])));const b=pd(()=>({baseResource:Jn(c),gainResource:Ie,formula:We=>We.div(rn).pow(Yn),spend(){c.value=0}}));z[Y.value]=J.evaluate(),Y.value+=2;const $=ce,O=ei(r),G=m.variable(Ie).pow(v).add(1),he=Ve(()=>({multiplier:()=>G.evaluate(),description:O,enabled:()=>o.gt(Ie.value,0)})),Mt=Ve(()=>({multiplier:()=>G.evaluate(o.add(Ie.value,b.actualGain.value))})),rt=Hc(()=>({display:{title:O,description:ee(()=>g("span",null,[F("Reset "),c.displayName,F(" for")," ",ui(Ie,o.clampMin(b.actualGain.value,1))," ",Ie.displayName,g("br",null,null),g("div",null,[F("Next:")," ",ui(c,o.lt(b.actualGain.value,1)?b.currentAt.value:b.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(b.actualGain.value,1),prestigeResource:Ie,onClick:b.convert,visibility:$})),{isHovering:An}=ve({feature:rt,canClick:()=>s(rt.canClick),modifier:he,cost:rn,previewCost:c,previewModifier:Mt}),zi=S(()=>An.value&&rt.canClick.value);ne.push([rt]);const qr=_n(m.variable(Ie),zi,b.actualGain),Rr=_n(G,zi,b.actualGain);U[V*2]=ee(()=>g(ae,null,[Le(rt.visibility)?g("div",{style:"margin: 10px"},[F("You have")," ",g("h2",{style:{color:gt,textShadow:`0px 0px 10px ${gt}`}},[qr()])," ",Ie.displayName,F(","),g("br",null,null),F("providing a "),Rr(),F("x multiplier to previous")," ",c.displayName,F(" gain")]):null,ki(rt)]));break;case"xp":{const We=ni(0),yi=ce,wn=Y.value,It=ei(r),$t=o.add(C,r()-.5).pow_base(2).times(10),xt=r()/4+1.125,Nt=r()/2+1.25,mt=m.variable(0).pow(xt).times($t),vt=xr(mt,We,!0,10,o.dInf),Ht=S(()=>Vt(mt,vt.value,!0,10)),He=S(()=>Vt(mt,o.add(vt.value,1),!0,10)),De=S(()=>o.pow(Nt,vt.value)),wi=Ve(()=>({multiplier:De,description:It,enabled:()=>Le(Re.visibility)}));J=J.add(S(()=>o.sub(Y.value,wn).add(1).sqrt().times(3).pow(Nt).times(z[wn-1]))),z[Y.value]=J.evaluate(),Y.value+=2;const Qe=Kn([.18,.2,.25],r),Re=dd(()=>({direction:W.Right,width:300,height:20,progress:()=>o.sub(We.value,Ht.value).div(o.sub(He.value,Ht.value)).toNumber(),visibility:yi,xp:We,display:ee(()=>g("span",null,[be(We.value),F("/"),be(He.value)])),fillStyle:`background-color: ${Qe}`}));this.on("preUpdate",Vr=>{if(oe.activePortals.value.some(_i=>_i.state.id===e)&&Le(Re.visibility)){const _i=o.times(xe.value,Vr);We.value=o.add(_i,We.value)}}),P.push(wi),ne.push([Re]),U[V*2]=ee(()=>g(ae,null,[Le(Re.visibility)?g("div",{style:"margin: 10px"},[F("You have "),g("h3",null,[It]),F(" Lv. "),at(vt.value),F(","),g("br",null,null),F("providing a "),be(De.value),F("x multiplier to previous")," ",c.displayName,F(" gain"),g("br",null,null)]):null,ki(Re)]));break}}const St={cache:"increaseCaches"in y?10:1,generation:"increaseGens"in y?10:1,resourceMulti:"increaseResourceMults"in y?10:1,energyMulti:"increaseEnergyMults"in y?2.5:.25,influences:Object.keys(oe.influenceNodes.value).length+_e.length===Object.keys(Pt).length?0:"increaseInfluences"in y?20:2,relic:0};let wt=Qn(St,r);V===N-1&&"relic"in y&&(wt="relic");let je="",Gt,At,Wt,Ge,Ot,tn;switch(wt){case"cache":Ge=Ii(r,i),je=`Gain ${be(w)}x your current ${Ge}.`,At=()=>{var Ie,gt,rn;return oe.grantResource(Ge,o.times((rn=(gt=(Ie=oe.resourceNodes.value[Ge])==null?void 0:Ie.state)==null?void 0:gt.amount)!=null?rn:0,w))};break;case"generation":Ge=Ii(r,i);const nn=o.div(w,120).times(ot[Ge]);je=`Gain ${be(nn)} ${Ge}/s while plane is active.`,Gt=Ie=>oe.grantResource(Ge,o.times(Ie,nn)),Wt=S(()=>oe.resourceNodes.value[Ge]);break;case"resourceMulti":Ot=Ge=Ii(r,i),tn=o.div(w,17).pow_base(2),je=`Gain ${be(tn)}x ${Ge} while plane is active.`;break;case"energyMulti":Ot="energy",tn=o.div(w,17).add(1),je=`Gain ${be(tn)}x energy while plane is active.`;break;case"influences":const pt=Object.keys(Pt)[Math.floor(r()*Object.keys(Pt).length)];_e.push(pt),je=`Gain a new portal influence (${Pt[pt].display})`,At=()=>{if(pt in oe.influenceNodes.value){nr.warning(`Error: ignoring duplicate portal influence (${Pt[pt].display})`);return}const Ie={id:Ln(oe.board),position:{...oe.board.types.portal.nodes.value.find(gt=>gt.state.id===e).position},type:"influence",state:{type:pt,data:Pt[pt].initialData}};oe.board.placeInAvailableSpace(Ie),oe.board.nodes.value.push(Ie)};break;case"relic":je=`Gain the ${t}-tier planar relic (${ci[t]})`,At=()=>{if(`${t}Relic`in oe.toolNodes.value)nr.warning(`Error: ignoring duplicate relic (${ci[t]})`);else{const Ie={id:Ln(oe.board),position:{...oe.board.types.portal.nodes.value.find(gt=>gt.state.id===e).position},type:"passive",state:`${t}Relic`};oe.board.placeInAvailableSpace(Ie),oe.board.nodes.value.push(Ie)}}}const bi=ce,Dn=H.value,_t=ad(()=>({requirements:Si(()=>({resource:Jn(c),cost:Dn})),visibility:bi,display:{requirement:`${be(Dn)} ${c.displayName}`,effectDisplay:je},style:"width: 100%",classes:{final:V===N-1},update:Gt,onComplete:At,link:Wt,effectedResource:Ot,resourceMulti:tn})),Fn=Qi(c,x,Dn);er(_t,{display:()=>_t.earned.value?"":Fn.value,direction:W.Down}),ne.push([_t]),ce=_t.earned}const de=xi(ne,Fr);xi(ne,Dr);const pe=Et(()=>[Ve(()=>({multiplier:()=>{var V,B,Ee;return o.add((Ee=(B=(V=oe.board.types.booster.nodes.value[0])==null?void 0:V.state)==null?void 0:B.level)!=null?Ee:0,1)},description:"Booster",enabled:()=>{var V,B,Ee;return(Ee=(B=(V=oe.board.types.booster.nodes.value[0])==null?void 0:V.state)==null?void 0:B.portals.includes(e))!=null?Ee:!1}}))]),xe=S(()=>pe.apply(1)),[Je,it]=Vn(()=>[{title:`${Ye(c.displayName)} Gain`,modifier:q,base:0,unit:"/s"},{title:`${Ye(c.displayName)} Time Speed`,modifier:pe,base:1,visible:()=>o.gt(xe.value,1)}]),En=j(!1),yn=ee(()=>g(jt,{modelValue:En.value,"onUpdate:modelValue":V=>En.value=V},{header:()=>g("h2",null,[F("Modifiers")]),body:()=>tt(Je)}));this.on("preUpdate",V=>{if(!oe.activePortals.value.some(Ee=>Ee.state.id===e))return;const B=o.times(xe.value,V);f.value=o.add(f.value,B),c.value=o.times(x.value,B).add(c.value),Ft.value.forEach(Ee=>{var St;(St=Ee.update)==null||St.call(Ee,B)})});const Pn=S(()=>{const V=D.find(B=>B.shouldShowPreview.value);return V?o.neg(Ce(V.cost)):0}),Ut=S(()=>{const V=D.find(B=>B.shouldShowPreview.value);return V?o.sub(V.modifier.apply(0),x.value):0}),Hn=_n(m.variable(0).add(c),()=>o.neq(Pn.value,0),Pn),Tn=_n(m.variable(0).add(x),()=>o.neq(Ut.value,0),Ut),Zn=S(()=>{const V=[];return Ft.value.forEach(B=>{B.link&&V.push(B.link)}),V}),Ke=S(()=>{const V={};return Ft.value.forEach(B=>{B.effectedResource!=null&&B.resourceMulti!=null&&(V[B.effectedResource]!=null?V[B.effectedResource]=o.times(V[B.effectedResource],B.resourceMulti):V[B.effectedResource]=B.resourceMulti)}),V}),Ft=S(()=>{const V=[];for(let B=1;Bo.lt(Ft.value.length,N)&&ne.some(V=>V.some(B=>"earned"in B&&s(B.earned)||"bought"in B&&s(B.bought)?!1:("canClick"in B&&s(B.canClick)||"canPurchase"in B&&s(B.canPurchase),!0))));return{tier:lt(t),seed:lt(n),influences:lt(i),name:a,color:l,resource:c,background:u,style:{background:u,"--background":u},features:ne,resourceTabCollapsed:it,links:Zn,resourceMultis:Ke,earnedTreasures:Ft,showNotif:hi,timeActive:f,display:ee(()=>g(ae,null,[g(li,{class:"nav-container",style:"z-index: 5"},{default:()=>[g("span",{class:"nav-segment"},[g("h2",null,[a])]),g("span",{class:"nav-segment"},[g("h3",null,[t,F("-tier")])]),i.length===0?null:g("span",{class:"nav-segment"},[g(Pe,{display:i.map(V=>{const B=Pt[V.type].description;return typeof B=="function"?B(V):B}).join("
"),direction:W.Down,style:"width: 300px"},{default:()=>[g("h3",null,[i.length,F(" influences")])]})]),g("span",{class:"nav-segment"},[g("button",{class:"button",style:"display: inline",onClick:()=>En.value=!0},[F("modifiers")])])]}),g(li,{class:"nav-container"},{default:()=>[g("span",{class:"nav-segment"},[g("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[tt(Hn)])," ",c.displayName]),g("span",{class:"nav-segment"},[F("("),g("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[o.gt(x.value,0)?"+":"",tt(Tn)]),F("/s)")])]}),g(Kc,{height:"60px"},null),ne.map((V,B)=>B in U?tt(U[B]):ki(...V)),tt(yn)])),minimizedDisplay:ee(()=>g("div",null,[g("span",null,[a]),g("span",{style:"font-size: large; vertical-align: sub;"},[" ",Ft.value.length,F("/"),N,F(" treasures")])]))}})}function Ii(e,t){t=t.filter(u=>u.type==="increaseResources"||u.type==="decreaseResources");const n=Object.keys(ot).reduce((u,c)=>{let f=ot[c];return t.filter(h=>h.data===c).forEach(h=>{h.type==="increaseResources"?f*=1e3:f/=1e3}),u+f},0),i=Object.keys(ot),r=Math.floor(e()*n);let a=0,l;for(let u=0;uu+c),i=Object.keys(e);let r=0,a=null;const l=t()*n;for(let u=0;ue?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples mine ore drops":"Doubles mine ore drops"},stone:{description:e=>e?"Quadruples energy gain":"Doubles energy gain"},copper:{description:e=>e?"Material level is 20% stronger":"Material level is 10% stronger"},silver:{description:e=>e?"Doubles each plane's resource gain":"Quadruples each plane's resource gain"},diamond:{description:e=>e?"+20% plane's resource gain per upgrade bought":"+10% plane's resource gain per upgrade bought"},emerald:{description:e=>e?"+2% plane's resource gain per minute active":"+1% plane's resource gain per minute active"},unobtainium:{description:e=>e?"+2 max connections per machine":"+1 max connections per machine"},dirtRelic:{description:e=>e?"Upgrades apply thrice":"Upgrades apply twice"},sandRelic:{description:e=>e?"Treasure's 2 tiers stronger":"Treasure's 1 tier stronger"},gravelRelic:{description:e=>e?"+2% plane's resource gain per repeatable purchase":"+1% plane's resource gain per repeatable purchase"},woodRelic:{description:e=>e?"(Relics)^2 boost mine speed":"Relics boost mine speed"},stoneRelic:{description:e=>e?"2 free levels for repeatables":"1 free level for repeatables"},coalRelic:{description:e=>e?"(Treasures)^2 boost planar speed":"Treasures boost planar speed"},copperRelic:{description:e=>e?"Power 2 machines free":"Power 1 machine free"},ironRelic:{description:e=>e?"Conversions give triple output":"Conversions give double output"},silverRelic:{description:e=>e?"(Power machines)^2 boost ore dropped":"Power machines boost ore dropped"},goldRelic:{description:e=>e?"Each treasure quadruples XP gain":"Each treasure doubles XP gain"},emeraldRelic:{description:e=>e?"Creating portals costs a third the energy":"Creating portals costs half the energy"},platinumRelic:{description:e=>e?"Triple dimensions' tick rate":"Double dimensions' tick rate"},diamondRelic:{description:e=>e?"Repeatables/dimensions buy max at once":"Repeatables buy max at once"},beryliumRelic:{description:e=>e?"(Max tier plane finished)^2 boosts quarry speed":"Max tier plane finished boosts quarry speed"},unobtainiumRelic:{description:e=>e?"ln(energy) boosts planar speed":"log(energy) boosts planar speed"},ultimatumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},Pt={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+diff",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-diff",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},$i=m.variable(0).add(8).times(2).pow10(),oe=Ri("main",function(){const e=ni(0,"energy"),t=m.variable(0).add(1),n=S(()=>z.types.resource.nodes.value.reduce((v,d)=>(v[d.state.type]=d,v),{})),i=S(()=>({...z.types.passive.nodes.value.reduce((v,d)=>(v[d.state]=d,v),{}),sand:z.types.dowsing.nodes.value[0],wood:z.types.quarry.nodes.value[0],coal:z.types.empowerer.nodes.value[0],iron:z.types.portalGenerator.nodes.value[0],gold:z.types.booster.nodes.value[0]})),r=S(()=>({...z.types.influence.nodes.value.reduce((v,d)=>(v[d.state.type]=d,v),{})}));function a(v){return xe.value!=null&&ce(xe.value)&&xe.value.state.tools.includes(v)}const l=S(()=>Yt.reduce((v,d)=>{var G,he,Mt;const b=(Mt=(he=(G=n.value[d])==null?void 0:G.state)==null?void 0:he.amount)!=null?Mt:0;let $=o.floor(t.invertIntegral(b)).sub(10).clampMin(0),O=Vt(t,$,!0,0);for(;;){const rt=t.evaluate($);if(o.add(O,rt).lte(b))$=$.add(1),O=o.add(O,rt);else break}return v[d]=$,v},{}));function u(v){var G,he,Mt;const d=(Mt=(he=(G=n.value[v])==null?void 0:G.state)==null?void 0:he.amount)!=null?Mt:0,b=l.value[v],$=Vt(t,b,!0),O=Vt(t,o.add(b,1),!0);return o.sub(d,$).max(0).div(o.sub(O,$)).toNumber()}const c=pn({}),f=pn({});Lt(()=>{Yt.forEach(v=>{ut(()=>l.value[v],(d,b)=>{o.gt(d,b)&&le.active===Q.id&&o.lte(d,100)&&ir.info(g("div",null,[g("h3",null,[o.eq(d,1)?`${Ye(v)} discovered`:`${Ye(v)} is now Level ${Ze(d)}`,F("!")]),g("div",null,[F("Energy gain is now 1.01x higher.")])]))})})});const h=S(()=>En.filter(v=>{var d,b;return(b=(d=v.value)==null?void 0:d.state)==null?void 0:b.powered}).length+z.types.portal.nodes.value.filter(v=>v.state.powered).length),p=S(()=>o.eq(h.value,0)?10:o.add(h.value,1).pow_base(100).div(10).times(.99)),y=S(()=>pe.value==null?0:pe.value.state.resources.reduce((d,b)=>o.div(100,wt[b].computedModifier.value).add(d),o.dZero)),C={id:"deselect",icon:"close",tooltip:v=>({text:"tools"in v.state?"Disconnect tools":"Disconnect resources"}),onClick(v){var d;Array.isArray((d=v.state)==null?void 0:d.data)?v.state={...v.state,data:[]}:"resources"in v.state?v.state={...v.state,resources:[]}:"tools"in v.state&&(v.state={...v.state,tools:[]}),z.selectedAction.value=null,z.selectedNode.value=null},visibility:v=>{var d;return Array.isArray((d=v.state)==null?void 0:d.data)?v.state.data.length>0:"resources"in v.state?v.state.resources.length>0:"tools"in v.state?v.state.tools.length>0:!1}},w={id:"toggle",icon:"bolt",tooltip:v=>({text:v.state.powered?"Turn Off":`Turn On - Always runs for ${Ze(p.value)} energy/s`}),onClick(v){v.state={...v.state,powered:!v.state.powered},z.selectedAction.value=null},fillColor:v=>v.state.powered?"var(--accent1)":"var(--locked)"};function N(v,d=1/0){const b=v(m.variable(0));return{id:"moreConnections",icon:"hub",formula:b,tooltip($){return{text:`Increase Connections - ${Ze(b.evaluate($.state.maxConnections))} energy`}},confirmationLabel:$=>o.gte(e.value,b.evaluate($.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick($){const O=b.evaluate($.state.maxConnections);o.gte(e.value,O)&&(e.value=o.sub(e.value,O)),$.state={...$.state,maxConnections:o.add($.state.maxConnections,1)},z.selectedAction.value=null},visibility:$=>o.add($.state.maxConnections,Ke.value).lt(d)}}function P(v,d){var b,$;if(((b=z.draggingNode.value)==null?void 0:b.type)==="resource"){const O=(($=z.draggingNode.value)==null?void 0:$.state).type,{maxConnections:G,resources:he}=v.state;return he.includes(O)?{text:"Disconnect",color:"var(--accent2)"}:o.add(G,Ke.value).lte(he.length)?{text:"Max connections",color:"var(--danger)"}:{text:d(O),color:"var(--accent2)"}}return null}function q(v,d){var b,$;if(((b=z.draggingNode.value)==null?void 0:b.type)==="passive"){const O=($=z.draggingNode.value)==null?void 0:$.state,{maxConnections:G,tools:he}=v.state;return he.includes(O)?{text:"Disconnect",color:"var(--accent2)"}:o.add(G,Ke.value).lte(he.length)?{text:"Max connections",color:"var(--danger)"}:{text:d(O),color:"var(--accent2)"}}return null}function x(v,d){var b,$;if(((b=z.draggingNode.value)==null?void 0:b.type)==="portal"){const O=(($=z.draggingNode.value)==null?void 0:$.state).id,{maxConnections:G,portals:he}=v.state;return he.includes(O)?{text:"Disconnect",color:"var(--accent2)"}:o.add(G,Ke.value).lte(he.length)?{text:"Max connections",color:"var(--danger)"}:{text:d(O),color:"var(--accent2)"}}return null}function D(v,d){if(d.type!=="resource")return!1;const b=d.state.type,{maxConnections:$,resources:O}=v.state;return O.includes(b)?!0:!o.add($,Ke.value).lte(O.length)}function U(v,d){if(d.type!=="resource")return;const b=d.state.type,$=v.state.resources;$.includes(b)?v.state={...v.state,resources:$.filter(O=>O!==b)}:v.state={...v.state,resources:[...$,b]},z.selectedNode.value=v}function ve(v,d){if(d.type!=="passive")return!1;const b=d.state,{maxConnections:$,tools:O}=v.state;return O.includes(b)?!0:!o.add($,Ke.value).lte(O.length)}function ne(v,d){if(d.type!=="passive")return;const b=d.state,$=v.state.tools;$.includes(b)?v.state={...v.state,tools:$.filter(O=>O!==b)}:v.state={...v.state,tools:[...$,b]},z.selectedNode.value=v}function Y(v,d){if(d.type!=="portal")return!1;const b=d.state.id,{maxConnections:$,portals:O}=v.state;return O.includes(b)?!0:!o.add($,Ke.value).lte(O.length)}function J(v,d){if(d.type!=="portal")return;const b=d.state.id,{portals:$}=v.state;$.includes(b)?v.state={...v.state,tools:$.filter(O=>O!==b)}:v.state={...v.state,tools:[...$,b]},z.selectedNode.value=v}const z=nu(v=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:{mine:{shape:ze.Diamond,size:50,title:"\u{1FAA8}",label:d=>d===v.selectedNode.value?{text:"Mining"}:Object.keys(n.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[w],progress:d=>ce(d)?new o(d.state.progress).toNumber():0,progressDisplay:un.Outline,progressColor:"var(--accent2)",classes:d=>({running:ce(d)}),draggable:!0},brokenFactory:{shape:ze.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>d===v.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(d){o.gte(e.value,100)&&(d.type="factory",e.value=o.sub(e.value,100))},confirmationLabel:()=>o.gte(e.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},factory:{shape:ze.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>{var b,$;if(d===v.selectedNode.value)return{text:d.state==null?"Forge - Drag a resource to me!":`Forging ${Oe[d.state].name}`};if(((b=v.draggingNode.value)==null?void 0:b.type)==="resource"){const O=(($=v.draggingNode.value)==null?void 0:$.state).type,G=d.state===O?"Disconnect":Oe[O].name,he=d.state===O||o.gte(e.value,Oe[O].cost)&&i.value[O]==null?"var(--accent2)":"var(--danger)";return{text:G,color:he}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(d){d.state=void 0,v.selectedAction.value=null,v.selectedNode.value=null},visibility:d=>d.state!=null},{id:"craft",icon:"done",tooltip:d=>({text:`Forge ${Oe[d.state].name} - ${Ze(Oe[d.state].cost)} energy`}),onClick(d){const b=Oe[d.state];if(o.gte(e.value,b.cost)&&i.value[d.state]==null){e.value=o.sub(e.value,b.cost);const $={id:Ln(v),position:{...d.position},type:b.type,state:"state"in b?b.state:void 0};v.placeInAvailableSpace($),v.nodes.value.push($),v.selectedAction.value=null,v.selectedNode.value=null,d.state=void 0}},fillColor:d=>o.gte(e.value,Oe[d.state].cost)&&i.value[d.state]==null?"var(--accent2)":"var(--danger)",visibility:d=>d.state!=null,confirmationLabel:d=>o.gte(e.value,Oe[d.state].cost)?i.value[d.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:d=>d.state==null||i.value[d.state]!=null?0:o.div(e.value,Oe[d.state].cost).clampMax(1).toNumber(),progressDisplay:un.Fill,progressColor:d=>d.state!=null&&o.gte(e.value,Oe[d.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(d,b){return b.type==="resource"},onDrop(d,b){const $=b.state.type;d.state===$?d.state=void 0:d.state=$,v.selectedNode.value=d},draggable:!0},resource:{shape:ze.Circle,size:50,title:d=>Ye(d.state.type),subtitle:d=>Ze(d.state.amount),progress:d=>u(d.state.type),onClick(){},progressDisplay:un.Outline,progressColor:"var(--accent3)",classes:d=>{var b;return{"affected-node":de.value!=null&&ce(de.value)&&de.value.state.resources.includes(d.state.type)||o.neq((b=Ut.value[d.state.type])!=null?b:1,1)}},draggable:!0},passive:{shape:ze.Circle,size:50,title:d=>Oe[d.state].name,label:d=>d===v.selectedNode.value?{text:rr[d.state].description(a(d.state))}:null,outlineColor:"var(--bought)",classes:d=>({"affected-node":a(d.state)}),draggable:!0},dowsing:{shape:ze.Diamond,size:50,title:"\u{1F962}",label:d=>d===v.selectedNode.value?{text:d.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${d.state.resources.length}/${o.add(d.state.maxConnections,Ke.value)})`}:P(d,b=>`Double ${b} odds`),actionDistance:Math.PI/4,actions:[C,N(d=>d.add(2).pow_base(100),16),w],classes:d=>({running:ce(d)}),canAccept:D,onDrop:U,draggable:!0},quarry:{shape:ze.Diamond,size:50,title:"\u26CF\uFE0F",label:d=>d===v.selectedNode.value?{text:d.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${d.state.resources.length}/${o.add(d.state.maxConnections,Ke.value)})`}:P(d,b=>`Gather ${dn(o.div(wt[b].computedModifier.value,100))} ${b}/s`),actionDistance:Math.PI/4,actions:[C,N(d=>d.add(2).pow_base(1e4),16),w],progress:d=>ce(d)?o.eq(y.value,0)?0:new o(d.state.progress).div(y.value).toNumber():0,progressDisplay:un.Outline,progressColor:"var(--accent2)",canAccept:D,onDrop:U,classes:d=>({running:ce(d)}),draggable:!0},empowerer:{shape:ze.Diamond,size:50,title:"\u{1F50C}",label:d=>d===v.selectedNode.value?{text:d.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${d.state.tools.length}/${o.add(d.state.maxConnections,Ke.value)})`}:q(d,b=>b.includes("Relic")?`Double ${ci[b.slice(0,-5)]}'s effect`:`Double ${Oe[b].name}'s effect`),actionDistance:Math.PI/4,actions:[C,N(d=>d.add(3).pow_base(1e3),16),w],canAccept:ve,onDrop:ne,classes:d=>({running:ce(d)}),draggable:!0},portalGenerator:{shape:ze.Diamond,size:50,title:"\u26E9\uFE0F",label:d=>{if(d===v.selectedNode.value)return{text:d.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${d.state.tier}-tier portal`};const b=v.draggingNode.value;if((b==null?void 0:b.type)==="resource"){const $=b.state.type;return{text:d.state.tier===$?"Disconnect":`${Ye($)}-tier Portal`,color:"var(--accent2)"}}else if((b==null?void 0:b.type)==="influence"){const $=b.state.type,{influences:O}=d.state;return O.includes($)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(d){d.state={...d.state,tier:void 0,influences:[]},v.selectedAction.value=null,v.selectedNode.value=null},visibility:d=>{const{tier:b,influences:$}=d.state;return b!=null||$.length>0}},{id:"makePortal",icon:"done",tooltip:d=>({text:`Spawn ${d.state.tier}-tier portal`}),onClick(d){let b=0;for(;`portal-${b}`in ke;)b++;const{tier:$,influences:O}=d.state;Vi(Ar(`portal-${b}`,$,Math.floor(Math.random()*4294967296),O.map(he=>r.value[he].state)),Q);const G={id:Ln(v),position:{...d.position},type:"portal",state:{id:`portal-${b}`,powered:!1}};v.placeInAvailableSpace(G),v.nodes.value.push(G),v.selectedAction.value=null,v.selectedNode.value=null,d.state={tier:void 0,influences:[]}},visibility:d=>d.state.tier!=null}],canAccept(d,b){return b.type==="resource"||b.type==="influence"},onDrop(d,b){if(b.type==="resource"){const $=b.state.type,O=d.state.tier;d.state={...d.state,tier:$===O?void 0:$}}else if(b.type==="influence"){const $=b.state.type,O=d.state.influences;O.includes($)?d.state={...d.state,influences:O.filter(G=>G!==$)}:d.state={...d.state,influences:[...O,$]}}v.selectedNode.value=d},draggable:!0},portal:{shape:ze.Diamond,size:50,title:"\u{1F300}",label:d=>d===v.selectedNode.value?{text:`Portal to ${ke[d.state.id].name}`,color:ke[d.state.id].color}:null,actionDistance:Math.PI/4,actions:[w],classes:d=>({running:ce(d),showNotif:ke[d.state.id].showNotif.value}),outlineColor:d=>ke[d.state.id].background,draggable:!0},influence:{shape:d=>d.state.type==="increaseResources"||d.state.type==="decreaseResources"?ze.Diamond:ze.Circle,size:50,title:d=>Pt[d.state.type].display,label:d=>{if(d===v.selectedNode.value){const $=d.state,O=Pt[$.type].description;return{text:typeof O=="function"?O($):O}}const b=v.draggingNode.value;if((b==null?void 0:b.type)==="resource"){const $=b.state.type,{type:O,data:G}=d.state;let he;if(Array.isArray(G)&&G.includes($))he="Disconnect";else if(O==="increaseResources")he=`Increase ${Ye($)} odds`;else if(O==="decreaseResources")he=`Decrease ${Ye($)} odds`;else return null;return{text:he,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[C],canAccept:(d,b)=>b.type!=="resource"?!1:Array.isArray(d.state.data),onDrop:(d,b)=>{if(b.type!=="resource")return;const $=b.state.type,O=d.state.data;O!=null&&(O.includes($)?d.state={...d.state,data:O.filter(G=>G!==$)}:d.state={...d.state,data:[...O,$]},v.selectedNode.value=d)},outlineColor:"var(--danger)",draggable:!0},booster:{shape:ze.Diamond,size:50,title:"\u231B",label:d=>d===v.selectedNode.value?{text:d.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ze(o.add(1,d.state.level))}x (${d.state.tools.length}/${o.add(d.state.maxConnections,Ke.value)})`}:x(d,b=>`Boost ${ke[b].name}'s speed`),actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect portals"},onClick(d){d.state={...d.state,portals:[]},v.selectedAction.value=null,v.selectedNode.value=null},visibility:d=>{var b,$;return($=(b=d.state)==null?void 0:b.portals.length)!=null?$:0>0}},N(d=>d.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(d){return{text:`Increase boost - ${Ze($i.evaluate(d.state.level))} energy`}},confirmationLabel(d){return o.gte(e.value,$i.evaluate(d.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(d){const b=$i.evaluate(d.state.level);o.gte(e.value,b)&&(e.value=o.sub(e.value,b)),d.state={...d.state,level:o.add(d.state.level,1)},v.selectedAction.value=null}},w],canAccept:Y,onDrop:J,classes:d=>({running:ce(d)}),draggable:!0}},style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const d=[];if(d.push(...Object.keys(c).map(b=>({startNode:H.value,endNode:n.value[b],stroke:"var(--accent3)",strokeWidth:5}))),_e.value!=null&&_e.value.state!=null&&d.push({startNode:_e.value,endNode:n.value[_e.value.state],stroke:"var(--foreground)",strokeWidth:4}),de.value!=null&&de.value.state.resources.forEach(b=>{d.push({startNode:de.value,endNode:n.value[b],stroke:ce(de.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),pe.value!=null&&pe.value.state.resources.forEach(b=>{d.push({startNode:pe.value,endNode:n.value[b],stroke:"var(--foreground)",strokeWidth:4})}),d.push(...Object.keys(f).map(b=>({startNode:pe.value,endNode:n.value[b],stroke:"var(--accent3)",strokeWidth:5}))),xe.value!=null&&xe.value.state.tools.forEach(b=>{d.push({startNode:xe.value,endNode:i.value[b],stroke:ce(xe.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Je.value!=null){const b=Je.value.state;b.tier!=null&&d.push({startNode:Je.value,endNode:n.value[b.tier],stroke:"var(--foreground)",strokeWidth:4}),b.influences.forEach($=>{d.push({startNode:Je.value,endNode:r.value[$],stroke:"var(--foreground)",strokeWidth:4})}),v.types.portal.nodes.value.forEach($=>{const O=ke[$.state.id];return O.links.value.forEach(G=>{G.value!=null&&d.push({startNode:$,endNode:G.value,stroke:ce($)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(O.resourceMultis.value).forEach(G=>{G!=="energy"&&G in n.value&&d.push({startNode:$,endNode:n.value[G],stroke:ce($)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),d})}return it.value!=null&&it.value.state.portals.forEach(b=>{d.push({startNode:it.value,endNode:v.types.portal.nodes.value.find($=>$.state.id===b),stroke:ce(it.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Object.values(r.value).forEach(b=>{const $=b.state;($.type==="increaseResources"||$.type==="decreaseResources")&&$.data.forEach(O=>{d.push({startNode:b,endNode:n.value[O],stroke:"var(--foreground)",strokeWidth:4})})}),d}}));function ce(v){return v===z.selectedNode.value||v.state.powered}const H=S(()=>z.types.mine.nodes.value[0]),_e=S(()=>z.types.factory.nodes.value[0]),de=S(()=>i.value.sand),pe=S(()=>i.value.wood),xe=S(()=>i.value.coal),Je=S(()=>i.value.iron),it=S(()=>i.value.gold),En=[H,de,pe,xe,it];function yn(v,d){let b=n.value[v];if(d=o.times(d,je[v].computedModifier.value),b==null)b={id:Ln(z),position:{...H.value.position},type:"resource",state:{type:v,amount:d}},z.placeInAvailableSpace(b),z.nodes.value.push(b);else{const $=b.state;b.state={...$,amount:o.add($.amount,d)}}}const Pn=S(()=>Object.keys(ot).reduce((v,d)=>v+new o(wt[d].computedModifier.value).toNumber(),0)),Ut=S(()=>{const v={};return z.types.portal.nodes.value.forEach(d=>{if(!ce(d))return;const $=ke[d.state.id].resourceMultis.value;Object.keys($).forEach(O=>{v[O]!=null?v[O]=o.times(v[O],$[O]):v[O]=$[O]})}),v}),Hn=Et(()=>[...Yt.map(v=>Ve(()=>({description:()=>`${Ye(v)} (Lv. ${Ze(l.value[v])}) (${dn(St.value)}x per level)`,multiplier:()=>o.pow(St.value,l.value[v]),enabled:()=>{var d,b;return v in n.value&&o.gt((b=(d=n.value[v].state)==null?void 0:d.amount)!=null?b:0,0)}}))),Ve(()=>({multiplier:()=>a("stone")?4:2,description:()=>(a("stone")?"Empowered ":"")+Oe.stone.name,enabled:()=>i.value.stone!=null})),Ve(()=>({multiplier:()=>{var v;return(v=Ut.value.energy)!=null?v:1},description:"Planar Treasures",enabled:()=>{var v;return o.neq((v=Ut.value.energy)!=null?v:1,1)}})),cn(()=>({addend:()=>o.pow(100,h.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(h.value,0)}))]),Tn=S(()=>Hn.apply(1)),Zn=Et(()=>[cn(()=>({addend:()=>a("unobtainium")?2:1,description:()=>(a("unobtainium")?"Empowered ":"")+Oe.unobtainium.name,enabled:()=>i.value.unobtainium!=null}))]),Ke=S(()=>Zn.apply(0)),Ft=Et(()=>[Ve(()=>({multiplier:()=>a("dirt")?4:2,description:()=>(a("dirt")?"Empowered ":"")+Oe.dirt.name,enabled:()=>i.value.dirt!=null}))]),hi=S(()=>Ft.apply(1)),V=Et(()=>[Ve(()=>({multiplier:()=>a("gravel")?4:2,description:()=>(a("gravel")?"Empowered ":"")+Oe.gravel.name,enabled:()=>i.value.gravel!=null}))]),B=S(()=>V.apply(1)),Ee=Et(()=>[cn(()=>({addend:()=>a("copper")?.002:.001,description:()=>(a("copper")?"Empowered ":"")+Oe.copper.name,enabled:()=>i.value.copper!=null}))]),St=S(()=>Ee.apply(1.01)),wt=Object.keys(ot).reduce((v,d)=>{const b=Et(()=>[Ve(()=>({multiplier:2,description:"Dowsing",enabled:()=>de.value!=null&&ce(de.value)&&de.value.state.resources.includes(d)}))]),$=S(()=>b.apply(ot[d])),O={title:`${Ye(d)} Drop Rate`,modifier:b,base:ot[d]};return v[d]={modifier:b,computedModifier:$,section:O},v},{}),je=Object.keys(ot).reduce((v,d)=>{const b=Et(()=>[Ve(()=>({multiplier:()=>{var G;return(G=Ut.value[d])!=null?G:1},description:"Planar Treasures",enabled:()=>{var G;return o.neq((G=Ut.value[d])!=null?G:1,1)}}))]),$=S(()=>b.apply(1)),O={title:`${Ye(d)} Gain`,modifier:b};return v[d]={modifier:b,computedModifier:$,section:O},v},{}),[Gt,At]=Vn(()=>[{title:"Energy Gain",modifier:Hn,base:1,unit:"/s"},{title:"Bonus Connections",modifier:Zn,base:0}]),[Wt,Ge]=Vn(()=>[{title:"Mining Speed",modifier:Ft,base:1,unit:"/s",visible:()=>i.value.dirt!=null},{title:"Ore Dropped",modifier:V,base:1,visible:()=>i.value.gravel!=null},{title:"Material Level Effect",modifier:Ee,base:1.01,visible:()=>i.value.copper!=null}]),[Ot,tn]=Vn(()=>Object.values(wt).map(v=>v.section)),[bi,Dn]=Vn(()=>Object.values(je).map(v=>v.section)),_t=du({general:()=>({display:"General",glowColor(){return _t.activeTab.value===this.tab?"white":""},tab:Gt,energyTabCollapsed:At}),mining:()=>({display:"Mine",glowColor(){return _t.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(i.value).length>0,tab:Wt,miningTabCollapsed:Ge}),resources:()=>({display:"Mine Rates",glowColor(){return _t.activeTab.value===this.tab?"white":""},visibility:()=>de.value!=null,tab:Ot,resourcesCollapsed:tn}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return _t.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(je).some(v=>o.neq(v.computedModifier.value,1)),tab:bi,resourceGainCollapsed:Dn})}),Fn=j(!1),nn=ee(()=>g(jt,{modelValue:Fn.value,"onUpdate:modelValue":v=>Fn.value=v},{header:()=>g("h2",null,[F("Modifiers")]),body:()=>tt(_t)}));this.on("preUpdate",v=>{if(Object.keys(c).forEach(d=>{c[d]-=v,c[d]<=0&&delete c[d]}),Object.keys(f).forEach(d=>{f[d]-=v,f[d]<=0&&delete f[d]}),ce(H.value)){const d=o.add(H.value.state.progress,o.times(hi.value,v)),b=d.floor();H.value.state={...H.value.state,progress:o.sub(d,b)};const $=b.div(Pn.value).floor();$.gt(0)&&Yt.forEach(G=>{yn(G,o.times(new o(wt[G].computedModifier.value).toNumber(),$).times(B.value)),c[G]=.3});const O=o.sub(b,$).toNumber();for(let G=0;G0){let $=o.add(d,v);const O=o.div(d,y.value).floor();$=o.sub($,o.times(O,y.value)),pe.value.state={...pe.value.state,progress:$},o.gt(O,0)&&b.forEach(G=>{yn(G,O),f[G]=.3})}}e.value=o.add(e.value,o.times(Tn.value,v)),o.lt(e.value,0)&&(e.value=0,H.value.state={...H.value.state,powered:!1},ir.warning(g("div",null,[g("h3",null,[F("Ran out of energy!")]),g("div",null,[F("All machines have been turned off.")])])))});const pt=S(()=>{var v,d;return z.selectedAction.value===z.types.brokenFactory.actions[0]?-100:z.selectedAction.value===z.types.factory.actions[1]?o.neg(Oe[z.selectedNode.value.state].cost):((v=z.selectedAction.value)==null?void 0:v.id)==="moreConnections"?o.neg(z.selectedAction.value.formula.evaluate(((d=z.selectedNode.value)==null?void 0:d.state).maxConnections)):0}),Ie=_n(m.variable(0).add(e),()=>o.neq(pt.value,0),pt),gt=S(()=>{var v;return z.selectedAction.value===w?((v=z.selectedNode.value)==null?void 0:v.state).powered?o.eq(h.value,1)?10:o.pow(100,h.value).div(10).times(.99):o.neg(p.value):0}),rn=_n(m.variable(0).add(Tn),()=>o.neq(gt.value,0),gt),Yn=S(()=>z.types.portal.nodes.value.filter(v=>ce(v)));return ut(Yn,v=>{Lt(()=>{Q.tabs=["main",...v.map(d=>d.state.id)]})}),ut(Ke,(v,d)=>{if(o.lt(v,d)){if(de.value){const b=de.value.state.maxConnections;o.lt(de.value.state.resources.length,o.add(b,v))&&(de.value.state={...de.value.state,resources:de.value.state.resources.slice(0,o.add(b,v).toNumber())})}if(pe.value){const b=pe.value.state.maxConnections;o.lt(pe.value.state.resources.length,o.add(b,v))&&(pe.value.state={...pe.value.state,resources:pe.value.state.resources.slice(0,o.add(b,v).toNumber())})}if(xe.value){const b=xe.value.state.maxConnections;o.lt(xe.value.state.tools.length,o.add(b,v))&&(xe.value.state={...xe.value.state,resources:xe.value.state.tools.slice(0,o.add(b,v).toNumber())})}if(it.value){const b=it.value.state.maxConnections;o.lt(it.value.state.portals.length,o.add(b,v))&&(it.value.state={...it.value.state,resources:it.value.state.portals.slice(0,o.add(b,v).toNumber())})}}}),{name:"World",board:z,energy:e,modifierTabs:_t,mineLootTable:ot,tools:Oe,passives:rr,resourceNodes:n,toolNodes:i,influenceNodes:r,grantResource:yn,activePortals:Yn,isEmpowered:a,display:ee(()=>g(ae,null,[g(li,{class:"nav-container"},{default:()=>[g("span",{class:"nav-segment"},[g("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[tt(Ie)])," ",F("energy")]),g("span",{class:"nav-segment"},[F("("),g("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(Tn.value,0)?"+":"",tt(rn)]),F("/s)")]),o.gt(h.value,0)?g("span",{class:"nav-segment"},[g("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[Ze(h.value)])," ",F("machines powered")]):null,g("span",{class:"nav-segment"},[g("button",{class:"button",style:"display: inline",onClick:()=>Fn.value=!0},[F("modifiers")])]),Q.devSpeed===0?g("span",{class:"nav-segment"},[F("Game Paused")]):Q.devSpeed!=null&&Q.devSpeed!==1?g("span",{class:"nav-segment"},[F("Dev Speed: "),dn(Q.devSpeed),F("x")]):null]}),tt(z),tt(nn)]))}}),kd=e=>{var i,r,a,l,u;const t=[oe];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const c=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(Ar(`portal-${n}`,(a=c.tier)!=null?a:"dirt",(l=c.seed)!=null?l:Math.floor(Math.random()*4294967296),(u=c.influences)!=null?u:[])),n++}return t},Or=S(()=>!1);function Sd(e,t){}var Md=Object.freeze(Object.defineProperty({__proto__:null,mineLootTable:ot,resourceNames:Yt,relics:ci,influences:Pt,main:oe,getInitialLayers:kd,hasWon:Or,fixOldSave:Sd},Symbol.toStringTag,{value:"Module"}));const Wn=e=>(gn("data-v-4a50ce42"),e=e(),mn(),e),Id={class:"game-over-modal-header"},$d=["src","alt"],xd={class:"game-over-modal-title"},Ed=Wn(()=>k("h2",null,"Congratulations!",-1)),Pd={key:0},Td=Wn(()=>k("br",null,null,-1)),Dd=Wn(()=>k("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Fd=Wn(()=>k("br",null,null,-1)),Ad=["href"],Od=Wn(()=>k("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),qd=K({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:l}=me,u=S(()=>pi(Q.timePlayed)),c=S(()=>Or.value&&!Q.keepGoing),f=en(Q,"autosave");function h(){Q.keepGoing=!0}function p(){on(Cn())}return(y,C)=>(I(),te(jt,{"model-value":s(c)},{header:Z(()=>[k("div",Id,[s(n)?(I(),T("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,$d)):L("",!0),k("div",xd,[Ed,k("h4",null,"You've beaten "+se(s(t))+" v"+se(s(a))+": "+se(s(l)),1)])])]),body:Z(({shown:w})=>[w?(I(),T("div",Pd,[k("div",null,"It took you "+se(s(u))+" to beat the game.",1),Td,Dd,Fd,k("div",null,[k("a",{href:s(r),class:"game-over-modal-discord-link"},[Od,F(" "+se(s(i)),1)],8,Ad)]),g(qt,{title:"Autosave",modelValue:s(f),"onUpdate:modelValue":C[0]||(C[0]=N=>Fe(f)?f.value=N:null)},null,8,["modelValue"])])):L("",!0)]),footer:Z(()=>[k("div",{class:"game-over-footer"},[k("button",{onClick:h,class:"button"},"Keep Going"),k("button",{onClick:p,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Rd=fe(qd,[["__scopeId","data-v-4a50ce42"]]);const vi=e=>(gn("data-v-2776d67d"),e=e(),mn(),e),Vd=vi(()=>k("div",{class:"nan-modal-header"},[k("h2",null,"NaN value detected!")],-1)),Ld={key:0},Bd=vi(()=>k("br",null,null,-1)),jd=["href"],zd=vi(()=>k("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Ud=vi(()=>k("br",null,null,-1)),Gd={class:"nan-footer"},Wd=K({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=me,i=j(!0),r=j(!0),a=en(qe,"hasNaN"),l=j(null);ut(a,y=>{y?(i.value=Q.autosave,r.value=Q.devSpeed===0):(Q.autosave=i.value,Q.devSpeed=r.value?0:null)});const u=S(()=>{var y;return(y=qe.NaNPath)==null?void 0:y.join(".")}),c=S(()=>qe.NaNPersistent!=null?qe.NaNPersistent.value:null);function f(){qe.NaNPersistent!=null&&(qe.NaNPersistent.value=new o(0),qe.hasNaN=!1)}function h(){qe.NaNPersistent&&(qe.NaNPersistent.value=new o(1),qe.hasNaN=!1)}function p(){qe.NaNPersistent&&(qe.NaNPersistent.value=new o(NaN),qe.hasNaN=!1)}return(y,C)=>(I(),T(ae,null,[g(jt,Bt({modelValue:s(a),"onUpdate:modelValue":C[4]||(C[4]=w=>Fe(a)?a.value=w:null)},y.$attrs),{header:Z(()=>[Vd]),body:Z(()=>[k("div",null,[F(' Attempted to assign "'+se(s(u))+'" to NaN',1),s(c)?(I(),T("span",Ld,se(" ")+"(previously "+se(s(dn)(s(c)))+")",1)):L("",!0),F(". Auto-saving has been "+se(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Bd,k("div",null,[k("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[zd,F(" "+se(s(t)||"The Paper Pilot Community"),1)],8,jd)]),Ud,g(qt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":C[0]||(C[0]=w=>i.value=w)},null,8,["modelValue"]),s(me).enablePausing?(I(),te(qt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":C[1]||(C[1]=w=>r.value=w)},null,8,["modelValue"])):L("",!0)]),footer:Z(()=>[k("div",Gd,[k("button",{onClick:C[2]||(C[2]=w=>{var N;return(N=l.value)==null?void 0:N.open()}),class:"button"},"Open Saves Manager"),k("button",{onClick:f,class:"button"},"Set to 0"),k("button",{onClick:h,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(I(),T("button",{key:0,onClick:C[3]||(C[3]=w=>a.value=!1),class:"button"}," Set to previous ")):L("",!0),k("button",{onClick:p,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),g(kr,{ref_key:"savesManager",ref:l},null,512)],64))}});var Hd=fe(Wd,[["__scopeId","data-v-2776d67d"]]);const Zd={key:0,class:"tpsDisplay"},Yd={key:0,class:"low"},Xd=K({__name:"TPS",setup(e){const t=S(()=>o.div(qe.lastTenTicks.length,qe.lastTenTicks.reduce((a,l)=>a+l,0))),n=j([]);ht(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=S(()=>n.value.reduce((a,l)=>o.max(a,l),0)),r=S(()=>o.sub(t.value,i.value).gt(1));return(a,l)=>s(t).isNan()?L("",!0):(I(),T("div",Zd,[F(" TPS: "+se(s(Ze)(s(t)))+" ",1),g(Sn,{name:"fade"},{default:Z(()=>[s(r)?(I(),T("span",Yd,se(s(Ze)(s(i))),1)):L("",!0)]),_:1})]))}});var Jd=fe(Xd,[["__scopeId","data-v-46a3ed5b"]]);var Kd=K({__name:"App",setup(e){const t=me.useHeader,n=S(()=>Ct[le.theme].variables),i=en(le,"showTPS"),r=S(()=>ue(ee(()=>g(ae,null,[ls.map(tt)]))));return(a,l)=>(I(),T(ae,null,[k("div",{id:"modal-root",style:Ae(s(n))},null,4),k("div",{class:ye(["app",{useHeader:s(t)}]),style:Ae(s(n))},[s(t)?(I(),te(Sr,{key:0})):L("",!0),g(kl),s(s(i))?(I(),te(Jd,{key:1})):L("",!0),g(Rd),g(Hd),(I(),te(Be(s(r))))],6)],64))}});var Qd=fe(Kd,[["__scopeId","data-v-41d15e5e"]]);function ef(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e;let u,c,f,h;const p=async(C=!0)=>{await f,C&&(u==null||u.addEventListener("controlling",w=>{w.isUpdate&&window.location.reload()})),await(h==null?void 0:h())};async function y(){if("serviceWorker"in navigator){const{Workbox:C,messageSW:w}=await Bn(()=>import("./workbox-window.4a8794bb.js"),[]);h=async()=>{c&&c.waiting&&await w(c.waiting,{type:"SKIP_WAITING"})},u=new C("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",N=>{N.isUpdate||i==null||i()});{const N=()=>{n==null||n()};u.addEventListener("waiting",N),u.addEventListener("externalwaiting",N)}u.register({immediate:t}).then(N=>{c=N,a?a("./sw.js",N):r==null||r(N)}).catch(N=>{l==null||l(N)})}}return f=y(),p}function tf(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e,u=j(!1),c=j(!1);return{updateServiceWorker:ef({immediate:t,onNeedRefresh(){u.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:a,onRegisterError:l}),offlineReady:c,needRefresh:u}}document.title=me.title;window.projInfo=me;if(me.id==="")throw new Error("Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json");requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c +Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await ns();const{globalBus:e}=await Bn(()=>Promise.resolve().then(function(){return es}),void 0),{startGameLoop:t}=await Bn(()=>import("./gameLoop.07b8c003.js"),["assets/gameLoop.07b8c003.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css","assets/unique-names-generator.5494b30b.js"]),n=window.vue=Zr(Qd);e.emit("setupVue",n),n.mount("#app"),Lt(()=>{const i=fi(),{updateServiceWorker:r}=tf({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Bn as _,qe as a,me as b,Md as c,Xe as g,is as l,Q as p,le as s}; diff --git a/index.html b/index.html index 10fe577..f5abf94 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ Profectus - + @@ -32,7 +32,7 @@ - + diff --git a/sw.js b/sw.js index a1c929c..4b29a46 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),u={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map((e=>u[e]||o(e)))).then((e=>(l(...e),a)))}}define(["./workbox-7369c0e1"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"assets/@fontsource.f66d05e7.css",revision:null},{url:"assets/@vue.6b211d3c.js",revision:null},{url:"assets/amator.1e5a40c8.js",revision:null},{url:"assets/bezier-easing.a990b400.js",revision:null},{url:"assets/gameLoop.d7a7e16a.js",revision:null},{url:"assets/index.43bdca03.css",revision:null},{url:"assets/index.6448276a.js",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/unique-names-generator.5494b30b.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.ded54c4a.js",revision:null},{url:"assets/vue-panzoom.8ce6f9b1.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.9c2dad53.js",revision:null},{url:"assets/vue.c16a309b.js",revision:null},{url:"assets/vuedraggable.1879de79.js",revision:null},{url:"assets/wheel.f2ae740f.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"adc94646f0115ae48363189f58bae536"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"robots.txt",revision:"5e0bd1c281a62a380d7a948085bfe2d1"},{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"manifest.webmanifest",revision:"e1e419fec40e2d042566c11fe4bce322"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),u={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map((e=>u[e]||o(e)))).then((e=>(l(...e),a)))}}define(["./workbox-7369c0e1"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"assets/@fontsource.f66d05e7.css",revision:null},{url:"assets/@vue.6b211d3c.js",revision:null},{url:"assets/amator.1e5a40c8.js",revision:null},{url:"assets/bezier-easing.a990b400.js",revision:null},{url:"assets/gameLoop.07b8c003.js",revision:null},{url:"assets/index.6d27cf3a.css",revision:null},{url:"assets/index.be8580f0.js",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/unique-names-generator.5494b30b.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.ded54c4a.js",revision:null},{url:"assets/vue-panzoom.8ce6f9b1.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.9c2dad53.js",revision:null},{url:"assets/vue.c16a309b.js",revision:null},{url:"assets/vuedraggable.1879de79.js",revision:null},{url:"assets/wheel.f2ae740f.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"d80aecca04fc6d1858cec59879802599"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"robots.txt",revision:"5e0bd1c281a62a380d7a948085bfe2d1"},{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"manifest.webmanifest",revision:"e1e419fec40e2d042566c11fe4bce322"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));