diff --git a/assets/gameLoop.4edcfc7f.js b/assets/gameLoop.d76271d7.js similarity index 92% rename from assets/gameLoop.4edcfc7f.js rename to assets/gameLoop.d76271d7.js index 310f1c1..e605608 100644 --- a/assets/gameLoop.4edcfc7f.js +++ b/assets/gameLoop.d76271d7.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.14372fb8.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";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 A(){f=(await d(()=>import("./index.14372fb8.js").then(function(t){return t.c}),["assets/index.14372fb8.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"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A 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.83d67942.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";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 A(){f=(await d(()=>import("./index.83d67942.js").then(function(t){return t.c}),["assets/index.83d67942.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"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; diff --git a/assets/index.14372fb8.js b/assets/index.83d67942.js similarity index 91% rename from assets/index.14372fb8.js rename to assets/index.83d67942.js index 62334db..9cfe102 100644 --- a/assets/index.14372fb8.js +++ b/assets/index.83d67942.js @@ -14,5 +14,5 @@ ${L} ${P}`)}}return d[S]}dt(n,S=>{S&&Object.keys(d).forEach(P=>delete d[P])});const f=N(()=>re.saves.reduce((S,P)=>(S[P]=m(P),S),{}));function h(S){let P;switch(Q.id===S?P=kr(Q):P=JSON.stringify(f.value[S]),fe.exportEncoding){default:console.warn(`Unknown save encoding: ${fe.exportEncoding}. Defaulting to lz`);case"lz":P=Kt.compressToUTF16(P);break;case"base64":P=btoa(unescape(encodeURIComponent(P)));break;case"plain":break}const L=document.createElement("textarea");L.value=P,document.body.appendChild(L),L.select(),L.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(L)}function w(S){Q.id===S&&ut();const P={...f.value[S],id:ni()};ut(P),re.saves.push(P.id)}function v(S){re.saves=re.saves.filter(P=>P!==S),localStorage.removeItem(S),d[S]=void 0}function b(S){f.value[Q.id].time=Q.time,ut(),d[Q.id]=void 0,fn(f.value[S]),d[S]=void 0}function I(S){if(l.value=S,jt(()=>{l.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Kt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const P=JSON.parse(S);P.id=ni(),ut(P),re.saves.push(P.id),b(P.id)}function A(S,P){const L=f.value[S];L!=null&&(L.name=P,Q.id===S?(Q.name=P,ut()):(ut(L),d[S]=void 0))}return(S,P)=>(M(),ee(Ut,{modelValue:n.value,"onUpdate:modelValue":P[4]||(P[4]=L=>n.value=L),ref_key:"modal",ref:i},{header:H(()=>[cl]),body:H(({shown:L})=>[L?(M(),ee(s(wa),{key:0,list:s(re).saves,handle:".handle",itemKey:le=>le},{item:H(({element:le})=>[p(ul,{save:s(f)[le],onOpen:Z=>b(le),onExport:Z=>h(le),onEditName:Z=>A(le,Z),onDuplicate:Z=>w(le),onDelete:Z=>v(le)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:H(()=>[_("div",dl,[p(Ar,{modelValue:a.value,"onUpdate:modelValue":P[0]||(P[0]=L=>a.value=L),title:"Import Save",placeholder:"Paste your save here!",class:pe({importingFailed:r.value})},null,8,["modelValue","class"]),_("div",fl,[pl,_("div",gl,[_("button",{class:"button",onClick:P[1]||(P[1]=L=>b(s(In)().id))},"New Game"),Object.keys(s(c)).length>0?(M(),ee(Ui,{key:0,options:s(c),modelValue:l.value,"onUpdate:modelValue":P[2]||(P[2]=L=>I(L)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),_("div",ml,[vl,_("button",{class:"button modal-default-button",onClick:P[3]||(P[3]=L=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Or=ce(hl,[["__scopeId","data-v-2a4275be"]]);const vt=e=>(bn("data-v-318a1c31"),e=e(),yn(),e),bl=["src","alt"],yl={key:1,class:"title"},wl=vt(()=>_("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),_l={class:"discord"},Nl={class:"discord-links"},Cl={key:0},kl=["href"],Ml=vt(()=>_("li",null,[_("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Sl=vt(()=>_("li",null,[_("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Il={href:"https://forums.moddingtree.com/",target:"_blank"},$l=vt(()=>_("span",{class:"material-icons"},"forum",-1)),xl=vt(()=>_("span",{class:"material-icons"},"info",-1)),El=vt(()=>_("span",{class:"material-icons"},"library_books",-1)),Pl=vt(()=>_("span",{class:"material-icons"},"settings",-1)),Tl=vt(()=>_("span",{class:"material-icons"},"library_books",-1)),Dl=vt(()=>_("span",{class:"material-icons"},"settings",-1)),Fl=vt(()=>_("span",{class:"material-icons"},"info",-1)),Al={href:"https://forums.moddingtree.com/",target:"_blank"},Ol=vt(()=>_("span",{class:"material-icons"},"forum",-1)),Rl={class:"discord"},ql={class:"discord-links"},Vl={key:0},Bl=["href"],Ll=vt(()=>_("li",null,[_("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),jl=vt(()=>_("li",null,[_("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),zl=J({__name:"Nav",setup(e){const t=V(null),n=V(null),i=V(null),r=V(null),{useHeader:a,banner:l,title:u,discordName:c,discordLink:d,versionNumber:m}=fe;function f(){window.open(d,"mywindow")}return(h,w)=>(M(),E(ne,null,[s(a)?(M(),E("div",zt({key:0,class:"nav"},h.$attrs),[s(l)?(M(),E("img",{key:0,src:s(l),class:"banner",alt:s(u)},null,8,bl)):(M(),E("div",yl,ae(s(u)),1)),_("div",{onClick:w[0]||(w[0]=v=>{var b;return(b=r.value)==null?void 0:b.open()}),class:"version-container"},[p(Pe,{display:"Changelog",direction:s(G).Down,class:"version"},{default:H(()=>[_("span",null,"v"+ae(s(m)),1)]),_:1},8,["direction"])]),wl,_("div",_l,[_("span",{onClick:f,class:"material-icons"},"discord"),_("ul",Nl,[s(d)?(M(),E("li",Cl,[_("a",{href:s(d),target:"_blank"},ae(s(c)),9,kl)])):B("",!0),Ml,Sl])]),_("div",null,[_("a",Il,[p(Pe,{display:"Forums",direction:s(G).Down,yoffset:"5px"},{default:H(()=>[$l]),_:1},8,["direction"])])]),_("div",{onClick:w[1]||(w[1]=v=>{var b;return(b=t.value)==null?void 0:b.open()})},[p(Pe,{display:"Info",direction:s(G).Down,class:"info"},{default:H(()=>[xl]),_:1},8,["direction"])]),_("div",{onClick:w[2]||(w[2]=v=>{var b;return(b=n.value)==null?void 0:b.open()})},[p(Pe,{display:"Saves",direction:s(G).Down,xoffset:"-20px"},{default:H(()=>[El]),_:1},8,["direction"])]),_("div",{onClick:w[3]||(w[3]=v=>{var b;return(b=i.value)==null?void 0:b.open()})},[p(Pe,{display:"Settings",direction:s(G).Down,xoffset:"-66px"},{default:H(()=>[Pl]),_:1},8,["direction"])])],16)):(M(),E("div",zt({key:1,class:"overlay-nav"},h.$attrs),[_("div",{onClick:w[4]||(w[4]=v=>{var b;return(b=r.value)==null?void 0:b.open()}),class:"version-container"},[p(Pe,{display:"Changelog",direction:s(G).Right,xoffset:"25%",class:"version"},{default:H(()=>[_("span",null,"v"+ae(s(m)),1)]),_:1},8,["direction"])]),_("div",{onClick:w[5]||(w[5]=v=>{var b;return(b=n.value)==null?void 0:b.open()})},[p(Pe,{display:"Saves",direction:s(G).Right},{default:H(()=>[Tl]),_:1},8,["direction"])]),_("div",{onClick:w[6]||(w[6]=v=>{var b;return(b=i.value)==null?void 0:b.open()})},[p(Pe,{display:"Settings",direction:s(G).Right},{default:H(()=>[Dl]),_:1},8,["direction"])]),_("div",{onClick:w[7]||(w[7]=v=>{var b;return(b=t.value)==null?void 0:b.open()})},[p(Pe,{display:"Info",direction:s(G).Right},{default:H(()=>[Fl]),_:1},8,["direction"])]),_("div",null,[_("a",Al,[p(Pe,{display:"Forums",direction:s(G).Right,xoffset:"7px"},{default:H(()=>[Ol]),_:1},8,["direction"])])]),_("div",Rl,[_("span",{onClick:f,class:"material-icons"},"discord"),_("ul",ql,[s(d)?(M(),E("li",Vl,[_("a",{href:s(d),target:"_blank"},ae(s(c)),9,Bl)])):B("",!0),Ll,jl])])],16)),p(No,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),p(Or,{ref_key:"savesManager",ref:n},null,512),p(Fo,{ref_key:"options",ref:i},null,512),p(no,{ref_key:"changelog",ref:r},null,512)],64))}});var Rr=ce(zl,[["__scopeId","data-v-318a1c31"]]);const Ul={class:"inner-tab"},Gl=J({__name:"Game",setup(e){const t=tn(Q,"tabs"),n=N(()=>Object.keys(we)),i=fe.useHeader;function r(a){const{display:l,minimized:u,name:c,color:d,minimizable:m,nodes:f,minimizedDisplay:h}=a;return{display:l,minimized:u,name:c,color:d,minimizable:m,nodes:f,minimizedDisplay:h}}return(a,l)=>(M(),E("div",{class:pe(["tabs-container",{useHeader:s(i)}])},[(M(!0),E(ne,null,En(s(t),(u,c)=>{var d,m;return M(),E("div",{key:c,class:pe(["tab",s((d=s(we)[u])==null?void 0:d.classes)]),style:Re(s((m=s(we)[u])==null?void 0:m.style))},[c===0&&!s(i)?(M(),ee(Rr,{key:0})):B("",!0),_("div",Ul,[s(n).includes(u)?(M(),ee(Ks,zt({key:0},r(s(we)[u]),{index:c,onSetMinimized:f=>s(we)[u].minimized.value=f}),null,16,["index","onSetMinimized"])):(M(),ee(Ue(u),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Wl=ce(Gl,[["__scopeId","data-v-dcd207b4"]]);const Hl=J({__name:"Sticky",setup(e){const t=V("0"),n=new ResizeObserver(r),i=ft(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 jt(r),document.fonts.ready.then(r),ci(()=>{var l;const a=(l=i.value)==null?void 0:l.parentElement;a&&n.observe(a)}),(a,l)=>(M(),E("div",{class:"sticky",style:Re({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Et(a.$slots,"default",{},void 0,!0)],4))}});var li=ce(Hl,[["__scopeId","data-v-cccac690"]]);const Zl=["x1","y1","x2","y2"],Yl=J({__name:"BoardLink",props:{link:null},setup(e){const n=$e(e),i=N(()=>{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=N(()=>{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)=>(M(),E("line",zt({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,Zl))}});var Xl=ce(Yl,[["__scopeId","data-v-57c4970a"]]);const Jl={key:0},Kl=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],Ql=["fill","stroke-width","stroke"],eu=["fill"],tu=J({__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=N(()=>de(i.nodeType.value.size,s(i.node))),a=N(()=>{var m;return(m=de(i.nodeType.value.outlineColor,s(i.node)))!=null?m:wt[re.theme].variables["--outline"]}),l=N(()=>{var m;return(m=de(i.nodeType.value.titleColor,s(i.node)))!=null?m:wt[re.theme].variables["--foreground"]}),u=N(()=>de(i.nodeType.value.actionDistance,s(i.node)));function c(m,f){t("clickAction",f.id),m.preventDefault(),m.stopPropagation()}function d(m,f){var h;((h=s(i.selectedAction))==null?void 0:h.id)===f.id&&(m.preventDefault(),m.stopPropagation())}return(m,f)=>(M(),ee(xn,{name:"actions",appear:""},{default:H(()=>[e.isSelected&&e.actions?(M(),E("g",Jl,[(M(!0),E(ne,null,En(e.actions,(h,w)=>{var v,b;return M(),E("g",{key:h.id,class:pe(["action",{selected:((v=e.selectedAction)==null?void 0:v.id)===h.id}]),transform:`translate( ${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-w)*s(u))}, ${(s(r)+30)*Math.cos(((e.actions.length-1)/2-w)*s(u))} - )`,onMousedown:I=>c(I,h),onTouchstart:I=>c(I,h),onMouseup:I=>d(I,h),onTouchend:$n(I=>d(I,h),["stop"])},[_("circle",{fill:s(de)(h.fillColor,e.node),r:"20","stroke-width":((b=e.selectedAction)==null?void 0:b.id)===h.id?4:0,stroke:s(a)},null,8,Ql),_("text",{fill:s(l),class:"material-icons"},ae(s(de)(h.icon,e.node)),9,eu)],42,Kl)}),128))])):B("",!0)]),_:1}))}});var nu=ce(tu,[["__scopeId","data-v-9efb2a56"]]);const iu=["transform"],ru={key:0},au=["r","fill","stroke"],su=["r","fill","stroke"],ou=["r","fill"],lu=["r","stroke-dasharray","stroke-dashoffset","stroke"],uu={key:1,transform:"rotate(45, 0, 0)"},cu=["width","height","transform","fill","stroke"],du=["width","height","transform","fill","stroke"],fu=["width","height","transform","fill"],pu=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],gu=["fill","y"],mu=["fill"],vu={key:0},hu=["fill","y"],bu=["fill","y"],yu=J({__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=N(()=>s(r.selectedNode)===s(r.node)),l=N(()=>de(r.nodeType.value.draggable,s(r.node)));dt(l,Y=>{const Me=s(r.node);s(r.dragging)===Me&&!Y&&t("endDragging",Me)});const u=N(()=>{var Me;const Y=s(r.node);return(Me=de(r.nodeType.value.actions,Y))==null?void 0:Me.filter(Xe=>Le(de(Xe.visibility,Y)))}),c=N(()=>{var Me;const Y=s(r.node);if(de(r.nodeType.value.draggable,Y)&&((Me=s(r.dragging))==null?void 0:Me.id)===Y.id&&s(r.dragged)!=null){const{x:Xe,y:st}=s(r.dragged);return{x:Y.position.x+Math.round(Xe/25)*25,y:Y.position.y+Math.round(st/25)*25}}return Y.position}),d=N(()=>de(r.nodeType.value.shape,s(r.node))),m=N(()=>de(r.nodeType.value.title,s(r.node))),f=N(()=>de(r.nodeType.value.subtitle,s(r.node))),h=N(()=>{var Y;return(Y=a.value?s(r.selectedAction)&&de(s(r.selectedAction).tooltip,s(r.node)):null)!=null?Y:de(r.nodeType.value.label,s(r.node))}),w=N(()=>{var Y,Me;return de((Me=(Y=s(r.selectedAction))==null?void 0:Y.confirmationLabel)!=null?Me:{text:"Tap again to confirm"},s(r.node))}),v=N(()=>de(r.nodeType.value.size,s(r.node))),b=N(()=>{var Y;return(Y=de(r.nodeType.value.progress,s(r.node)))!=null?Y:0}),I=N(()=>wt[re.theme].variables["--background"]),A=N(()=>{var Y;return(Y=de(r.nodeType.value.outlineColor,s(r.node)))!=null?Y:wt[re.theme].variables["--outline"]}),S=N(()=>{var Y;return(Y=de(r.nodeType.value.fillColor,s(r.node)))!=null?Y:wt[re.theme].variables["--raised-background"]}),P=N(()=>de(r.nodeType.value.progressColor,s(r.node))),L=N(()=>{var Y;return(Y=de(r.nodeType.value.titleColor,s(r.node)))!=null?Y:wt[re.theme].variables["--foreground"]}),le=N(()=>de(r.nodeType.value.progressDisplay,s(r.node))),Z=N(()=>r.dragging.value!=null&&s(r.hasDragged)&&de(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),z=N(()=>de(r.nodeType.value.style,s(r.node))),U=N(()=>de(r.nodeType.value.classes,s(r.node)));function qe(Y){t("mouseDown",Y,r.node.value,l.value)}function et(Y){var Me,Xe,st;(Me=r.hasDragged)!=null&&Me.value||(t("endDragging",r.node.value),(st=(Xe=r.nodeType.value).onClick)==null||st.call(Xe,r.node.value),Y.stopPropagation())}return(Y,Me)=>{var Xe,st,ht;return M(),E("g",{class:pe(["boardnode",{[e.node.type]:!0,isSelected:s(a),isDraggable:s(l),...s(U)}]),style:Re([{opacity:((Xe=e.dragging)==null?void 0:Xe.id)===e.node.id&&e.hasDragged?.5:1},(st=s(z))!=null?st:[]]),transform:`translate(${s(c).x},${s(c).y})${s(a)?" scale(1.2)":""}`},[p(nu,{actions:(ht=s(u))!=null?ht:[],"is-selected":s(a),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:Me[0]||(Me[0]=bt=>t("clickAction",bt))},null,8,["actions","is-selected","node","node-type","selected-action"]),_("g",{class:"node-container",onMousedown:qe,onTouchstartPassive:qe,onMouseup:et,onTouchendPassive:et},[s(d)===s(Ge).Circle?(M(),E("g",ru,[s(Z)?(M(),E("circle",{key:0,class:"receiver",r:s(v)+8,fill:s(I),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,au)):B("",!0),_("circle",{class:"body",r:s(v),fill:s(S),stroke:s(A),"stroke-width":4},null,8,su),s(le)===s(hn).Fill?(M(),E("circle",{key:1,class:"progress progressFill",r:Math.max(s(v)*s(b)-2,0),fill:s(P)},null,8,ou)):(M(),E("circle",{key:2,r:s(v)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(v)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(v)+4.5)*2*Math.PI-s(b)*(s(v)+4.5)*2*Math.PI,stroke:s(P)},null,8,lu))])):s(d)===s(Ge).Diamond?(M(),E("g",uu,[s(Z)?(M(),E("rect",{key:0,class:"receiver",width:s(v)*s(i)+16,height:s(v)*s(i)+16,transform:`translate(${-(s(v)*s(i)+16)/2}, ${-(s(v)*s(i)+16)/2})`,fill:s(I),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,cu)):B("",!0),_("rect",{class:"body",width:s(v)*s(i),height:s(v)*s(i),transform:`translate(${-s(v)*s(i)/2}, ${-s(v)*s(i)/2})`,fill:s(S),stroke:s(A),"stroke-width":4},null,8,du),s(le)===s(hn).Fill?(M(),E("rect",{key:1,class:"progress progressFill",width:Math.max(s(v)*s(i)*s(b)-2,0),height:Math.max(s(v)*s(i)*s(b)-2,0),transform:`translate(${-Math.max(s(v)*s(i)*s(b)-2,0)/2}, ${-Math.max(s(v)*s(i)*s(b)-2,0)/2})`,fill:s(P)},null,8,fu)):(M(),E("rect",{key:2,class:"progress progressDiamond",width:s(v)*s(i)+9,height:s(v)*s(i)+9,transform:`translate(${-(s(v)*s(i)+9)/2}, ${-(s(v)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(v)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(v)*s(i)+9)*4-s(b)*(s(v)*s(i)+9)*4,stroke:s(P)},null,8,pu))])):B("",!0),_("text",{fill:s(L),class:"node-title",y:s(f)?10:0},ae(s(m)),9,gu),s(f)?(M(),E("text",{key:2,fill:s(L),class:"node-subtitle",y:"-15"},ae(s(f)),9,mu)):B("",!0)],32),p(xn,{name:"fade",appear:""},{default:H(()=>{var bt;return[s(h)?(M(),E("g",vu,[_("text",{fill:(bt=s(h).color)!=null?bt:s(L),class:pe(["node-title",{pulsing:s(h).pulsing}]),y:-s(v)-20},ae(s(h).text),11,hu)])):B("",!0)]}),_:1}),p(xn,{name:"fade",appear:""},{default:H(()=>{var bt;return[s(a)&&e.selectedAction?(M(),E("text",{key:0,fill:(bt=s(w).color)!=null?bt:s(L),class:pe(["node-title",{pulsing:s(w).pulsing}]),y:s(v)+75},ae(s(w).text),11,bu)):B("",!0)]}),_:1})],14,iu)}}});var wu=ce(yu,[["__scopeId","data-v-4654be02"]]);const _u={class:"stage",width:"100%",height:"100%"},Nu={class:"g1"},Cu=J({__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=V({x:0,y:0}),r=V({x:0,y:0}),a=V(!1),l=V(null),u=N(()=>{const w=n.nodes.value.slice();if(n.draggingNode.value){const v=w.splice(w.indexOf(n.draggingNode.value),1)[0];w.push(v)}return w});_t(()=>{const w=n.draggingNode.value;if(w==null)return null;const v={x:w.position.x+r.value.x,y:w.position.y+r.value.y};let b=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((I,A)=>{if(A.id===w.id)return I;const S=n.types.value[A.type];if(!de(S.canAccept,A,w))return I;const L=Math.pow(v.x-A.position.x,2)+Math.pow(v.y-A.position.y,2);let le=de(S.size,A);return L>b||L>le*le?I:(b=L,A)},null))});function c(w){w.setTransformOrigin(null),w.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function d(w,v=null,b=!1){if(n.draggingNode.value==null){w.preventDefault(),w.stopPropagation();let I,A;if("touches"in w)if(w.touches.length===1)I=w.touches[0].clientX,A=w.touches[0].clientY;else return;else I=w.clientX,A=w.clientY;i.value={x:I,y:A},r.value={x:0,y:0},a.value=!1,b&&n.setDraggingNode.value(v)}v!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function m(w){const{x:v,y:b,scale:I}=l.value.panZoomInstance.getTransform();let A,S;if("touches"in w)if(w.touches.length===1)A=w.touches[0].clientX,S=w.touches[0].clientY;else{f(n.draggingNode.value),n.mousePosition.value=null;return}else A=w.clientX,S=w.clientY;n.mousePosition.value={x:(A-v)/I,y:(S-b)/I},r.value={x:r.value.x+(A-i.value.x)/I,y:r.value.y+(S-i.value.y)/I},i.value={x:A,y:S},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(w.preventDefault(),w.stopPropagation())}function f(w,v=!1){var b,I;if(n.draggingNode.value!=null&&n.draggingNode.value===w){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 A=n.nodes.value;A.push(A.splice(A.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((I=(b=n.types.value[n.receivingNode.value.type]).onDrop)==null||I.call(b,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!v&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(w,v){n.state.value.selectedAction===v?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:v}}return(w,v)=>{const b=Ct("panZoom");return s(Le)(e.visibility)?(M(),ee(b,{key:0,style:Re([{width:e.width,height:e.height},e.style]),class:pe(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:l,onInit:c,onMousemove:m,onTouchmove:m,onMousedown:v[0]||(v[0]=I=>d(I)),onTouchstart:v[1]||(v[1]=I=>d(I)),onMouseup:v[2]||(v[2]=()=>f(s(e.draggingNode))),onTouchendPassive:v[3]||(v[3]=()=>f(s(e.draggingNode))),onMouseleave:v[4]||(v[4]=()=>f(s(e.draggingNode),!0))},{default:H(()=>[(M(),E("svg",_u,[_("g",Nu,[p(tr,{name:"link",appear:""},{default:H(()=>[(M(!0),E(ne,null,En(s(e.links)||[],I=>(M(),E("g",{key:`${I.startNode.id}-${I.endNode.id}`},[p(Xl,{link:I},null,8,["link"])]))),128))]),_:1}),p(tr,{name:"grow",duration:500,appear:""},{default:H(()=>[(M(!0),E(ne,null,En(s(u),I=>{var A;return M(),E("g",{key:I.id,style:{"transition-duration":"0s"}},[p(wu,{node:I,nodeType:e.types[I.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===I?r.value:void 0,hasDragged:a.value,receivingNode:((A=s(e.receivingNode))==null?void 0:A.id)===I.id,selectedNode:s(e.selectedNode),selectedAction:s(e.selectedAction),onMouseDown:d,onEndDragging:f,onClickAction:S=>h(I,S)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):B("",!0)}}});We.on("setupVue",e=>Na.install(e));const qr=Symbol("Board");var hn=(e=>(e.Outline="Outline",e.Fill="Fill",e))(hn||{}),Ge=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Ge||{});function ku(e){const t=ct({nodes:[],selectedNode:null,selectedAction:null},!1);return He(n=>{const i=e.call(n,n);i.id=rn("board-"),i.type=qr,i[mt]=Cu,i.state?(Pr(t),$(i,"state")):(t[nn]={nodes:i.startNodes().map((u,c)=>(u.id=c,u)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=N(()=>s(l.state).nodes),i.selectedNode=N({get(){return l.nodes.value.find(u=>u.id===s(l.state).selectedNode)||null},set(u){var c,d;De(l.state)?l.state.value={...l.state.value,selectedNode:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedNode=(d=u==null?void 0:u.id)!=null?d:null}}),i.selectedAction=N({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(d=>d.id===s(l.state).selectedAction)||null},set(u){var c,d;De(l.state)?l.state.value={...l.state.value,selectedAction:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedAction=(d=u==null?void 0:u.id)!=null?d:null}}),i.mousePosition=V(null),i.links?$(i,"links"):i.links=N(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?de(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=V(null),i.receivingNode=V(null),$(i,"visibility"),ie(i,"visibility",he.Visible),$(i,"width"),ie(i,"width","100%"),$(i,"height"),ie(i,"height","100%"),$(i,"classes"),$(i,"style");for(const u in i.types){const c=i.types[u];if($(c,"title"),$(c,"subtitle"),$(c,"label"),$(c,"size"),ie(c,"size",50),$(c,"style"),$(c,"classes"),$(c,"draggable"),ie(c,"draggable",!1),$(c,"shape"),ie(c,"shape","Circle"),$(c,"canAccept"),ie(c,"canAccept",!1),$(c,"progress"),$(c,"progressDisplay"),ie(c,"progressDisplay","Fill"),$(c,"progressColor"),ie(c,"progressColor","none"),$(c,"fillColor"),$(c,"outlineColor"),$(c,"titleColor"),$(c,"actionDistance"),ie(c,"actionDistance",Math.PI/6),c.nodes=N(()=>s(l.state).nodes.filter(d=>d.type===u)),ie(c,"onClick",function(d){s(l.state).selectedNode=d.id}),c.actions)for(const d of c.actions)$(d,"visibility"),ie(d,"visibility",he.Visible),$(d,"icon"),$(d,"fillColor"),$(d,"tooltip"),$(d,"confirmationLabel"),ie(d,"confirmationLabel",{text:"Tap again to confirm"}),$(d,"links")}function r(u){i.draggingNode.value=u}function a(u){i.receivingNode.value=u}i.placeInAvailableSpace=function(u,c=100,d=G.Right){const m=l.nodes.value.slice().filter(f=>f===u||(d===G.Down||d===G.Up)&&Math.abs(f.position.x-u.position.x)>c||(d===G.Left||d===G.Right)&&Math.abs(f.position.y-u.position.y)>c?!1:!(d===G.Right&&f.position.xu.position.x+c||d===G.Up&&f.position.y>u.position.y+c||d===G.Down&&f.position.yf.position.x-h.position.x:d===G.Left?(f,h)=>h.position.x-f.position.x:d===G.Up?(f,h)=>h.position.y-f.position.y:(f,h)=>f.position.y-h.position.y);for(let f=0;f0&&w>c)break}},i[at]=function(){const{nodes:u,types:c,state:d,visibility:m,width:f,height:h,style:w,classes:v,links:b,selectedAction:I,selectedNode:A,mousePosition:S,draggingNode:P,receivingNode:L}=this;return{nodes:u,types:c,state:d,visibility:m,width:f,height:h,style:s(w),classes:v,links:b,selectedAction:I,selectedNode:A,mousePosition:S,draggingNode:P,receivingNode:L,setDraggingNode:r,setReceivingNode:a}};const l=i;return l})}function de(e,t,...n){return zn(e)?e(t,...n):s(e)}function Wn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const qn={};We.on("addLayer",e=>{const t=ai(e,qr);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)}))})})});We.on("removeLayer",e=>{var t;(t=qn[e.id])==null||t.call(qn),qn[e.id]=void 0});function Mn(e,t="points",n=0,i=void 0){const r=De(e)?e:ct(e);if(r.displayName=t,r.precision=n,r.small=i,!De(e)){const a=r[xt];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)?gt(e.small?n:o.floor(n)):me(n,e.precision,e.small)}We.on("setupVue",e=>e.use(Ca));function Mu(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 Su=J({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=xr(n),l=N(()=>{const c=Ce(i);return c==null||c===""?{}:s(r)?Mu(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:a,glowColorStyle:l,unref:s,Visibility:he,isVisible:Le,isHidden:wn}}});function Iu(e,t,n,i,r,a){var l;return e.isVisible(e.visibility)?(M(),E("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:pe(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(M(),ee(Ue(e.component)))],6)):B("",!0)}var Vr=ce(Su,[["render",Iu],["__scopeId","data-v-21427abb"]]);const $u=J({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:Vr},setup(e){const{activeTab:t}=$e(e),n=N(()=>wt[re.theme].floatingTabs),i=ft("");_t(()=>{const u=Ce(t);if(u==null){i.value="";return}if(St(u)){i.value=se(u);return}i.value=se(s(u.display))});const r=N(()=>{const u=Ce(t);return St(u)||!u?void 0:s(u.classes)}),a=N(()=>{const u=Ce(t);return St(u)||!u?void 0:s(u.style)});function l(u){const{display:c,style:d,classes:m,glowColor:f,visibility:h}=u;return{display:c,style:s(d),classes:m,glowColor:f,visibility:h}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:he,component:i,gatherButtonProps:l,unref:s,isVisible:Le,isHidden:wn}}});function xu(e,t,n,i,r,a){var c,d;const l=Ct("TabButton"),u=Ct("Sticky");return e.isVisible(e.visibility)?(M(),E("div",{key:0,class:pe(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[p(u,{class:pe(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Re(e.unref(e.buttonContainerStyle))},{default:H(()=>[_("div",{class:pe(["tab-buttons",{floating:e.floating}])},[(M(!0),E(ne,null,En(e.unref(e.tabs),(m,f)=>(M(),ee(l,zt({onSelectTab:h=>e.selected.value=f,floating:e.floating,key:f,active:e.unref(m.tab)===e.unref(e.activeTab)},e.gatherButtonProps(m)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(M(),ee(Ue(e.unref(e.component)),{key:0})):B("",!0)],6)):B("",!0)}var Eu=ce($u,[["render",xu],["__scopeId","data-v-58dbf83a"]]);const Pu=Symbol("TabButton"),Tu=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=ct(Object.keys(e)[0],!1);return He(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=rn("tabFamily-"),r.type=Tu,r[mt]=Eu,r.tabs=Object.keys(e).reduce((u,c)=>{const d=e[c]();return d.type=Pu,d[mt]=Vr,$(d,"visibility"),ie(d,"visibility",he.Visible),$(d,"tab"),$(d,"display"),$(d,"classes"),$(d,"style"),$(d,"glowColor"),u[c]=d,u},{}),r.selected=n,r.activeTab=N(()=>{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(d=>Le(d.visibility));return c?s(c.tab):null}),$(r,"visibility"),ie(r,"visibility",he.Visible),$(r,"classes"),$(r,"style"),$(r,"buttonContainerClasses"),$(r,"buttonContainerStyle"),r[at]=function(){const{visibility:u,activeTab:c,selected:d,tabs:m,style:f,classes:h,buttonContainerClasses:w,buttonContainerStyle:v}=this;return{visibility:u,activeTab:c,selected:d,tabs:m,style:s(f),classes:h,buttonContainerClasses:w,buttonContainerStyle:v}};const a=r;return a})}const Br=o.ln(10);function Vn(e){return e}function Fu(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 Au(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return g.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function Ou(e){return g.neg(e)}function Ru(e,t,n){if(F(t))return t.invert(o.sub(e,be(n)));if(F(n))return n.invert(o.sub(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function qu(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 g.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 g.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function Vu(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 g.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 g.add(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.add(e,be(n)));if(F(n))return n.invert(o.sub(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Lu(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 g.sub(a,g.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 g.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function ju(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 g.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 g.sub(i,t)}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.div(e,be(n)));if(F(n))return n.invert(o.div(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function Uu(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 g.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 g.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Gu(e,t,n){if(F(t))return g.div(e,n);if(F(n))return g.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Wu(e,t,n){if(F(t))return t.invert(o.mul(e,be(n)));if(F(n))return n.invert(o.div(be(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 g.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 g.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Zu(e,t,n){if(F(t))return g.mul(e,n);if(F(n))return g.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Yu(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 Xu(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 g.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function Ju(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 Ku(e){return o.ln(e).sub(1).times(e).div(Br)}function Qu(e,t){if(F(t)){const n=Br.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 ec(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:Ku,invert:Qu})}throw new Error("Could not integrate due to no input being a variable")}function tc(e,t,n){if(F(t))return t.invert(o.pow(be(n),e));if(F(n))return n.invert(o.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function nc(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function ic(e,t,n){if(F(t)){const i=o.ln(be(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 rc(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e),n],evaluate:nc,invert:ic})}throw new Error("Could not integrate due to no input being a variable")}function ac(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 sc(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function oc(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 lc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:sc,invert:oc})}throw new Error("Could not integrate due to no input being a variable")}function uc(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 cc(e){return o.ln(e).sub(1).times(e)}function dc(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 fc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:cc,invert:dc})}throw new Error("Could not integrate due to no input being a variable")}function pc(e,t,n){if(F(t))return t.invert(o.root(e,be(n)));if(F(n))return n.invert(o.ln(e).div(o.ln(be(t))));throw new Error("Could not invert due to no input being a variable")}function gc(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=g.add(n,1);return g.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 g.pow(t,i).div(g.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function mc(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 vc(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 g.pow10(n).div(g.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function hc(e,t,n){if(F(t))return t.invert(o.ln(e).div(be(n)));if(F(n))return n.invert(o.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function bc(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 g.pow(n,i).div(g.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=g.add(t,1);return g.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function yc(e,t,n){if(F(t))return t.invert(o.root(e,o.recip(be(n))));if(F(n))return n.invert(o.ln(be(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function wc(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 g.pow(i,g.recip(n).add(1)).times(n).div(g.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function _c(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 Nc(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 g.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function Cc(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function kc(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 Mc(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 Sc(e,t,n,i){if(F(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Ic(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function $c(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function xc(e,t,n){if(F(t))return t.invert(o.tetrate(e,o.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Ec(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function Pc(e,t,n,i){if(F(t))return t.invert(o.layeradd(e,o.minabs(1e308,be(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Tc(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 Dc(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 Fc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function Ac(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 Oc(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 g.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Rc(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 qc(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 g.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function Vc(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 Bc(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 g.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Lc(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 jc(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 g.asin(n).times(n).add(g.sqrt(g.sub(1,g.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function zc(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 Uc(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 g.acos(n).times(n).sub(g.sqrt(g.sub(1,g.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Gc(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 Wc(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 g.atan(n).times(n).sub(g.ln(g.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Hc(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 Zc(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 g.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Yc(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 Xc(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 g.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function Jc(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 Kc(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 g.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function Qc(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 ed(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 g.asinh(n).times(n).sub(g.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function td(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 nd(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 g.acosh(n).times(n).sub(g.add(n,1).sqrt().times(g.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function id(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 rd(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 g.atanh(n).times(n).add(g.sub(1,g.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function Tn(e){return(t,n)=>new g({inputs:[t,n],evaluate:e,invert:Vn})}function F(e){return e instanceof ke&&e.hasVariable()}function be(e,t){return e instanceof ke?e.evaluate(t):s(e)}function ad(){return g.pow(this,2).div(2)}function sd(){return this}const Fe=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"&&xt in n?n[xt]:n)),"variable"in e?(typeof e.variable=="object"&&xt in e.variable&&(e.variable=e.variable[xt]),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:ad,internalIntegrateInner:sd,applySubstitution:Vn}}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 h,w;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:l}=e,u=t.reduce((v,b)=>v+(b instanceof Fe?b.internalVariables:0),0),c=t.find(v=>v instanceof Fe&&v.hasVariable()),d=u===1?c==null?void 0:c.innermostVariable:void 0,m=(h=c==null?void 0:c.isInvertible())!=null?h:!1,f=(w=c==null?void 0:c.isIntegrable())!=null?w:!1;return{inputs:t,internalEvaluate:n,internalInvert:m?i:void 0,internalIntegrate:f?r:void 0,internalIntegrateInner:a,applySubstitution:l,innermostVariable:d,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=>be(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:be(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof Fe&&e.inputs[n]instanceof Fe?t.equals(e.inputs[n]):!(t instanceof Fe)&&!(e.inputs[n]instanceof Fe)&&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 g({inputs:[e]})}static variable(e){return new g({variable:e})}static step(e,t,n){const i=V(0),r=n(g.variable(i)),a=ve(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,d){if(F(d)&&r.isInvertible())return o.gt(c,s(a))&&(c=o.add(r.invert(o.sub(c,s(a))),s(a))),d.invert(c);throw new Error("Could not invert due to no input being a variable")}return new g({inputs:[e],evaluate:l,invert:r.isInvertible()&&r.hasVariable()?u:void 0})}static if(e,t,n,i){const r=V(0),a=g.variable(r),l=n(a),u=i==null?void 0:i(a),c=ve(t);function d(f){return s(c)?(r.value=f,l.evaluate()):u?(r.value=f,u.evaluate()):f}function m(f,h){if(!F(h)||!l.isInvertible()||u!=null&&!u.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?h.invert(l.invert(f)):u?h.invert(u.invert(f)):h.invert(f)}return new g({inputs:[e],evaluate:d,invert:l.isInvertible()&&l.hasVariable()?m:void 0})}static conditional(e,t,n,i){return g.if(e,t,n,i)}static abs(e){return new g({inputs:[e],evaluate:o.abs})}static neg(e){return new g({inputs:[e],evaluate:o.neg,invert:Fu,applySubstitution:Ou,integrate:Au})}static sign(e){return new g({inputs:[e],evaluate:o.sign})}static round(e){return new g({inputs:[e],evaluate:o.round})}static floor(e){return new g({inputs:[e],evaluate:o.floor})}static ceil(e){return new g({inputs:[e],evaluate:o.ceil})}static trunc(e){return new g({inputs:[e],evaluate:o.trunc})}static add(e,t){return new g({inputs:[e,t],evaluate:o.add,invert:Ru,integrate:qu,integrateInner:Vu,applySubstitution:Vn})}static sub(e,t){return new g({inputs:[e,t],evaluate:o.sub,invert:Bu,integrate:Lu,integrateInner:ju,applySubstitution:Vn})}static mul(e,t){return new g({inputs:[e,t],evaluate:o.mul,invert:zu,integrate:Uu,applySubstitution:Gu})}static div(e,t){return new g({inputs:[e,t],evaluate:o.div,invert:Wu,integrate:Hu,applySubstitution:Zu})}static recip(e){return new g({inputs:[e],evaluate:o.recip,invert:Yu,integrate:Xu})}static clamp(e,t,n){return new g({inputs:[e,t,n],evaluate:o.clamp,invert:Vn})}static pLog10(e){return new g({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new g({inputs:[e],evaluate:o.absLog10})}static log10(e){return new g({inputs:[e],evaluate:o.log10,invert:Ju,integrate:ec})}static log(e,t){return new g({inputs:[e,t],evaluate:o.log,invert:tc,integrate:rc})}static log2(e){return new g({inputs:[e],evaluate:o.log2,invert:ac,integrate:lc})}static ln(e){return new g({inputs:[e],evaluate:o.ln,invert:uc,integrate:fc})}static pow(e,t){return new g({inputs:[e,t],evaluate:o.pow,invert:pc,integrate:gc})}static pow10(e){return new g({inputs:[e],evaluate:o.pow10,invert:mc,integrate:vc})}static pow_base(e,t){return new g({inputs:[e,t],evaluate:o.pow_base,invert:hc,integrate:bc})}static root(e,t){return new g({inputs:[e,t],evaluate:o.root,invert:yc,integrate:wc})}static factorial(e){return new g({inputs:[e],evaluate:o.factorial})}static gamma(e){return new g({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new g({inputs:[e],evaluate:o.lngamma})}static exp(e){return new g({inputs:[e],evaluate:o.exp,invert:_c,integrate:Nc})}static sqr(e){return g.pow(e,2)}static sqrt(e){return g.root(e,2)}static cube(e){return g.pow(e,3)}static cbrt(e){return g.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Cc,invert:kc})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Mc,invert:Sc})}static iteratedlog(e,t=10,n=1){return new g({inputs:[e,t,n],evaluate:Ic})}static slog(e,t=10){return new g({inputs:[e,t],evaluate:$c,invert:xc})}static layeradd10(e,t){return new g({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new g({inputs:[e,t,n],evaluate:Ec,invert:Pc})}static lambertw(e){return new g({inputs:[e],evaluate:o.lambertw,invert:Tc})}static ssqrt(e){return new g({inputs:[e],evaluate:o.ssqrt,invert:Dc})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Fc})}static sin(e){return new g({inputs:[e],evaluate:o.sin,invert:Lc,integrate:Oc})}static cos(e){return new g({inputs:[e],evaluate:o.cos,invert:zc,integrate:qc})}static tan(e){return new g({inputs:[e],evaluate:o.tan,invert:Gc,integrate:Bc})}static asin(e){return new g({inputs:[e],evaluate:o.asin,invert:Ac,integrate:jc})}static acos(e){return new g({inputs:[e],evaluate:o.acos,invert:Rc,integrate:Uc})}static atan(e){return new g({inputs:[e],evaluate:o.atan,invert:Vc,integrate:Wc})}static sinh(e){return new g({inputs:[e],evaluate:o.sinh,invert:Qc,integrate:Zc})}static cosh(e){return new g({inputs:[e],evaluate:o.cosh,invert:td,integrate:Xc})}static tanh(e){return new g({inputs:[e],evaluate:o.tanh,invert:id,integrate:Kc})}static asinh(e){return new g({inputs:[e],evaluate:o.asinh,invert:Hc,integrate:ed})}static acosh(e){return new g({inputs:[e],evaluate:o.acosh,invert:Yc,integrate:nd})}static atanh(e){return new g({inputs:[e],evaluate:o.atanh,invert:Jc,integrate:rd})}step(e,t){return g.step(this,e,t)}if(e,t){return g.if(this,e,t)}conditional(e,t){return g.if(this,e,t)}abs(){return g.abs(this)}neg(){return g.neg(this)}sign(){return g.sign(this)}round(){return g.round(this)}floor(){return g.floor(this)}ceil(){return g.ceil(this)}trunc(){return g.trunc(this)}add(e){return g.add(this,e)}sub(e){return g.sub(this,e)}mul(e){return g.mul(this,e)}div(e){return g.div(this,e)}recip(){return g.recip(this)}max(e){return g.max(this,e)}min(e){return g.min(this,e)}maxabs(e){return g.maxabs(this,e)}minabs(e){return g.minabs(this,e)}clamp(e,t){return g.clamp(this,e,t)}clampMin(e){return g.clampMin(this,e)}clampMax(e){return g.clampMax(this,e)}pLog10(){return g.pLog10(this)}absLog10(){return g.absLog10(this)}log10(){return g.log10(this)}log(e){return g.log(this,e)}log2(){return g.log2(this)}ln(){return g.ln(this)}pow(e){return g.pow(this,e)}pow10(){return g.pow10(this)}pow_base(e){return g.pow_base(this,e)}root(e){return g.root(this,e)}factorial(){return g.factorial(this)}gamma(){return g.gamma(this)}lngamma(){return g.lngamma(this)}exp(){return g.exp(this)}sqr(){return g.pow(this,2)}sqrt(){return g.root(this,2)}cube(){return g.pow(this,3)}cbrt(){return g.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return g.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return g.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return g.iteratedlog(this,e,t)}slog(e=10){return g.slog(this,e)}layeradd10(e){return g.layeradd10(this,e)}layeradd(e,t){return g.layeradd(this,e,t)}lambertw(){return g.lambertw(this)}ssqrt(){return g.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return g.pentate(this,e,t)}sin(){return g.sin(this)}cos(){return g.cos(this)}tan(){return g.tan(this)}asin(){return g.asin(this)}acos(){return g.acos(this)}atan(){return g.atan(this)}sinh(){return g.sinh(this)}cosh(){return g.cosh(this)}tanh(){return g.tanh(this)}asinh(){return g.asinh(this)}acosh(){return g.acosh(this)}atanh(){return g.atanh(this)}};let ke=Fe;ke.negate=Fe.neg;ke.negated=Fe.neg;ke.sgn=Fe.sign;ke.plus=Fe.add;ke.subtract=Fe.sub;ke.minus=Fe.sub;ke.multiply=Fe.mul;ke.times=Fe.mul;ke.divide=Fe.div;ke.divideBy=Fe.div;ke.dividedBy=Fe.div;ke.reciprocal=Fe.recip;ke.reciprocate=Fe.recip;ke.max=Tn(o.max);ke.min=Tn(o.min);ke.minabs=Tn(o.minabs);ke.maxabs=Tn(o.maxabs);ke.clampMin=Tn(o.clampMin);ke.clampMax=Tn(o.clampMax);ke.logarithm=Fe.log;class g extends ke{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 Lr(e,t,n=!0,i,r=o.dInf){const a=ve(n),l=ve(i),u=ve(r);return N(()=>{var h,w,v,b;const c=s(u);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const d=s(a),m=(h=s(l))!=null?h:d?10:0;let f=0;if(o.gt(c,m)){if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum");if(d){if(!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");f=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((w=s(e.innermostVariable))!=null?w:0)}else f=o.floor(e.invert(t.value))}if(f=o.clampMax(f,c),m>0){f=o.sub(f,m).clampMin(0);let I;for(d?I=Lt(e,f,!0,0):I=e.evaluate(o.add((v=s(e.innermostVariable))!=null?v:0,f));o.lt(f,c)&&o.lt(f,Number.MAX_SAFE_INTEGER);){const A=e.evaluate(f.add((b=s(e.innermostVariable))!=null?b:0));if(o.add(I,A).lte(t.value))f=f.add(1),I=o.add(I,A);else break}}return f})}function Lt(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 d=a.toNumber();d{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.add(d,s(l)),invert:d=>o.sub(d,s(l)),getFormula:d=>g.add(d,l),enabled:c,description:i==null?void 0:K(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[Nt(s(u))]):null,p("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)?"+":"",Qt(s(l))])]))}})}function Oe(e){return He(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.times(d,s(l)),invert:d=>o.div(d,s(l)),getFormula:d=>g.times(d,l),enabled:c,description:i==null?void 0:K(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[Nt(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[x("\xD7"),Qt(s(l))])]))}})}function Ii(e){return He(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:l}=e.call(t,t),u=ve(n),c=ve(i),d=r==null?void 0:ve(r);return{apply:m=>{let f=m;return a&&(f=o.add(f,1)),f=o.pow(f,s(u)),a&&(f=o.sub(f,1)),f},invert:m=>{let f=m;return a&&(f=o.add(f,1)),f=o.root(f,s(u)),a&&(f=o.sub(f,1)),f},getFormula:m=>a?g.add(m,1).pow(u).sub(1):g.pow(m,u),enabled:d,description:i==null?void 0:K(()=>p("div",{class:"modifier-container"},[s(c)!=null?p("span",{class:"modifier-description"},[Nt(s(c)),a?" (+1 effective)":null]):null,p("span",{class:"modifier-amount",style:(l===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[x("^"),Qt(s(u))])]))}})}function $t(e){return He(()=>{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)?N(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?K(()=>p(ne,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(Nt)])):void 0}})}const Ln=g.variable(0).add(1),pi={id:"deselect",icon:"close",tooltip:e=>({text:"tools"in e.state?"Disconnect tools":"Disconnect resources"}),onClick(e){var t;Array.isArray((t=e.state)==null?void 0:t.data)?e.state={...e.state,data:[]}:"resources"in e.state?e.state={...e.state,resources:[]}:"tools"in e.state&&(e.state={...e.state,tools:[]}),C.board.selectedAction.value=null,C.board.selectedNode.value=null},visibility:e=>{var t;return Array.isArray((t=e.state)==null?void 0:t.data)?e.state.data.length>0:"resources"in e.state?e.state.resources.length>0:"tools"in e.state?e.state.tools.length>0:!1}},an={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${gt(C.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},C.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function Hn(e,t=1/0){const n=e(g.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(i){return{text:`Increase Connections - ${gt(n.evaluate(i.state.maxConnections))} energy`}},confirmationLabel:i=>o.gte(C.energy.value,n.evaluate(i.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(i){const r=n.evaluate(i.state.maxConnections);o.gte(C.energy.value,r)&&(C.energy.value=o.sub(C.energy.value,r)),i.state={...i.state,maxConnections:o.add(i.state.maxConnections,1)},C.board.selectedAction.value=null},visibility:i=>o.add(i.state.maxConnections,C.computedBonusConnectionsModifier.value).lt(t)}}function jr(e,t){var n,i;if(((n=C.board.draggingNode.value)==null?void 0:n.type)==="resource"){const r=((i=C.board.draggingNode.value)==null?void 0:i.state).type,{maxConnections:a,resources:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,C.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function od(e,t){var n,i;if(((n=C.board.draggingNode.value)==null?void 0:n.type)==="passive"){const r=(i=C.board.draggingNode.value)==null?void 0:i.state,{maxConnections:a,tools:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,C.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function zr(e,t){var n,i;if(((n=C.board.draggingNode.value)==null?void 0:n.type)==="portal"){const r=((i=C.board.draggingNode.value)==null?void 0:i.state).id,{maxConnections:a,portals:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,C.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Ur(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:i,resources:r}=e.state;return r.includes(n)?!0:!o.add(i,C.computedBonusConnectionsModifier.value).lte(r.length)}function Gr(e,t){if(t.type!=="resource")return;const n=t.state.type,i=e.state.resources;i.includes(n)?e.state={...e.state,resources:i.filter(r=>r!==n)}:e.state={...e.state,resources:[...i,n]},C.board.selectedNode.value=e}function ld(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:i,tools:r}=e.state;return r.includes(n)?!0:!o.add(i,C.computedBonusConnectionsModifier.value).lte(r.length)}function ud(e,t){if(t.type!=="passive")return;const n=t.state,i=e.state.tools;i.includes(n)?e.state={...e.state,tools:i.filter(r=>r!==n)}:e.state={...e.state,tools:[...i,n]},C.board.selectedNode.value=e}function Wr(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:i,portals:r}=e.state;return r.includes(n)?!0:!o.add(i,C.computedBonusConnectionsModifier.value).lte(r.length)}function Hr(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:i}=e.state;i.includes(n)?e.state={...e.state,portals:i.filter(r=>r!==n)}:e.state={...e.state,portals:[...i,n]},C.board.selectedNode.value=e}function Ne(e){return e===C.board.selectedNode.value||e.state.powered}function lt(e){return C.empowerer.value!=null&&Ne(C.empowerer.value)&&C.empowerer.value.state.tools.includes(e)}function cd(e){var a,l,u;const t=(u=(l=(a=C.resourceNodes.value[e])==null?void 0:a.state)==null?void 0:l.amount)!=null?u:0,n=C.resourceLevels.value[e],i=Lt(Ln,n,!0),r=Lt(Ln,o.add(n,1),!0);return o.sub(t,i).max(0).div(o.sub(r,i)).toNumber()}function Fn(e,t,n){if(t.value){const i=t.value.state,r=i[n],a=i.maxConnections;o.lt(r.length,o.add(a,e))&&(t.value.state={...t.value.state,[n]:r.slice(0,o.add(a,e).toNumber())})}}const dd={key:0},fd={key:0,class:"mark star"},pd=["src"],gd=J({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(M(),E("div",dd,[e.mark===!0?(M(),E("div",fd)):(M(),E("img",{key:1,class:"mark",src:e.mark},null,8,pd))])):B("",!0)}});var Zn=ce(gd,[["__scopeId","data-v-2207999f"]]);const md=J({__name:"Node",props:{id:null},setup(e){const n=$e(e),i=ii(qi,()=>{}),r=ii(Vi,()=>{}),a=ft(null),l=N(()=>a.value&&a.value.parentElement);return dt([l,n.id],([u,c],[d,m])=>{d&&r(s(m)),u&&i(c,u)}),vr(()=>r(s(n.id))),(u,c)=>(M(),E("div",{class:"node",ref_key:"node",ref:a},null,512))}});var Yn=ce(md,[["__scopeId","data-v-a48cb382"]]),vd=J({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:Yn,MarkNode:Zn},setup(e){const{display:t,onClick:n,onHold:i}=$e(e),r=ft("");_t(()=>{var m;const u=Ce(t);if(u==null){r.value="";return}if(St(u)){r.value=se(u);return}const c=se((m=u.title)!=null?m:"","h3"),d=se(u.description,"div");r.value=se(K(()=>p("span",null,[u.title!=null?p("div",null,[p(c,null,null)]):null,p(d,null,null)])))});const{start:a,stop:l}=$r(n,i);return{start:a,stop:l,comp:r,Visibility:he,isVisible:Le,isHidden:wn,unref:s}}});function hd(e,t,n,i,r,a){var c;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(M(),E("button",{key:0,style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:pe({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)?(M(),ee(Ue(e.unref(e.comp)),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],38)):B("",!0)}var Zr=ce(vd,[["render",hd],["__scopeId","data-v-211328c0"]]);const bd=Symbol("Clickable");function yd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return He(i=>{var l,u,c;const r=(l=e==null?void 0:e.call(i,i))!=null?l:{};r.id=rn("clickable-"),r.type=bd,r[mt]=Zr;for(const d of t)(u=d.preConstruct)==null||u.call(d,r);if(Object.assign(r,n),$(r,"visibility"),ie(r,"visibility",he.Visible),$(r,"canClick"),ie(r,"canClick",!0),$(r,"classes"),$(r,"style"),$(r,"mark"),$(r,"display"),r.onClick){const d=r.onClick.bind(r);r.onClick=function(m){s(r.canClick)!==!1&&d(m)}}if(r.onHold){const d=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&d()}}for(const d of t)(c=d.postConstruct)==null||c.call(d,r);const a=t.reduce((d,m)=>{var f;return Object.assign(d,(f=m.getGatheredProps)==null?void 0:f.call(m,r))},{});return r[at]=function(){const{display:d,visibility:m,style:f,classes:h,onClick:w,onHold:v,canClick:b,small:I,mark:A,id:S}=this;return{display:d,visibility:m,style:s(f),classes:h,onClick:w,onHold:v,canClick:b,small:I,mark:A,id:S,...a}},r})}const wd=["x1","y1","x2","y2"],_d=J({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=$e(e),i=N(()=>{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=N(()=>{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)=>(M(),E("line",zt({"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,wd))}});const Nd=J({__name:"Links",props:{links:null},setup(e){var c;const n=tn(e,"links"),i=V(null),r=ii(Bi,V({})),a=ii(Li,V(void 0)),l=V((c=i.value)==null?void 0:c.getBoundingClientRect());dt(a,()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),ci(()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const u=N(()=>{var m,f;const d=r.value;return(f=(m=n.value)==null?void 0:m.filter(h=>{var w,v;return((w=d[h.startNode.id])==null?void 0:w.rect)&&((v=d[h.startNode.id])==null?void 0:v.rect)}))!=null?f:[]});return(d,m)=>(M(),E(ne,null,[s(u)?(M(),E("svg",va(zt({key:0},d.$attrs)),[(M(!0),E(ne,null,En(s(u),(f,h)=>(M(),ee(_d,{key:h,link:f,boundingRect:l.value,startNode:s(r)[f.startNode.id],endNode:s(r)[f.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):B("",!0),_("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Cd=ce(Nd,[["__scopeId","data-v-063f6d6b"]]);J({props:{nodes:{type:R(Array),required:!0},leftSideNodes:R(Array),rightSideNodes:R(Array),branches:R(Array)},components:{Links:Cd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=$e(e),r=ft();_t(()=>{const u=Ce(t);r.value=se(K(()=>p(ne,null,[u.map(c=>p("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(Nt)]))])))});const a=ft();_t(()=>{const u=Ce(n);a.value=u?se(K(()=>p("span",{class:"left-side-nodes small"},[u.map(Nt)]))):""});const l=ft();return _t(()=>{const u=Ce(i);l.value=u?se(K(()=>p("span",{class:"side-nodes small"},[u.map(Nt)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:l}}});J({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:Zn,Node:Yn},setup(e){const{onClick:t,onHold:n,display:i}=$e(e),r=Pn(i),{start:a,stop:l}=$r(t,n);return{start:a,stop:l,comp:r,unref:s,Visibility:he,isCoercableComponent:St,isVisible:Le,isHidden:wn}}});function Bn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(u=>ve(u.base)),n.baseText=t.map(u=>ve(u.baseText)),n.visible=t.map(u=>ve(u.visible)),n.title=t.map(u=>ve(u.title)),n.subtitle=t.map(u=>ve(u.subtitle)),i=!0),t}const a=ct({},!1);return[K(()=>{const u=r();let c=!0;const d=u.map((m,f)=>{var A,S,P;if(s(n.visible[f])===!1)return null;const h=p("h3",{onClick:()=>a.value[f]=!a.value[f],style:"cursor: pointer"},[p("span",{class:"modifier-toggle"+(s(a.value[f])?" collapsed":"")},[x("\u25BC")]),s(n.title[f]),s(n.subtitle[f])!=null?p("span",{class:"subtitle"},[x(" ("),s(n.subtitle[f]),x(")")]):null]),w=s(a.value[f])?null:p(ne,null,[p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[Nt((A=s(n.baseText[f]))!=null?A:"Base")]),p("span",{class:"modifier-amount"},[me((S=s(n.base[f]))!=null?S:1),m.unit])]),m.modifier.description==null?null:Nt(s(m.modifier.description))]),v=!c;c=!1;const b=(P=s(n.base[f]))!=null?P:1,I=m.modifier.apply(b);return p(ne,null,[v?p("br",null,null):null,p("div",{style:{"--unit":re.alignUnits&&m.unit!=null?"'"+m.unit+"'":""}},[h,p("br",null,null),w,p("hr",null,null),p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[x("Total")]),p("span",{class:"modifier-amount",style:(m.smallerIsBetter===!0?o.gt(I,b!=null?b:1):o.lt(I,b!=null?b:1))?"color: var(--danger)":""},[Qt(I),m.unit])])])])});return p(ne,null,[d])}),a]}function $i(e,t,n){const i=ve(t),r=ve(n);return N(()=>{const a=s(i),l=s(r);return o.gte(e.value,l)?"Now":o.lte(a,0)?"Never":fi(o.sub(l,e.value).div(a))})}function dn(e,t,n=1){const i=ve(t),r=ve(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return K(()=>{var a;if(s(i)){const l=Qt(e.evaluate()),u=Qt(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return p(ne,null,[p("b",null,[p("i",null,[l,x(" \u2192 "),u])])])}return p(ne,null,[Qt(e.evaluate())])})}const Mt={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},cn=Object.keys(Mt),Te={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"Artificial Intelligence",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"Machine Learning",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},Fi={dirt:"Replicator",sand:"Metal Detector",gravel:"Neural Networks",wood:"Mining Laser",stone:"BOGO Coupon",coal:"Planar Intelligence",copper:"Efficient Code",iron:"Trade Agreements",silver:"Machine Synergizer",gold:"XP Market",emerald:"Efficient Portals",platinum:"Time Dilation",diamond:"Paypal",berylium:"Tiered Mining",unobtainium:"Overclocked Portals",ultimatum:"Rebates"},kd={dirt:{description:e=>e?"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?"ln(energy) boosts planar speed":"log(energy) boosts planar speed"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},Vt={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}},xi=g.variable(0).add(8).times(2).pow10();const Md=J({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(M(),E("div",{style:Re({width:e.width,height:e.height})},null,4))}});function An(e){return He(t=>{var i;const n=e.call(t,t);return n.partialDisplay=r=>p("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[ui(n.resource,n.cost instanceof g?Lt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=r=>p("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",ui(n.resource,n.cost instanceof g?Lt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),$(n,"visibility"),ie(n,"visibility",he.Visible),$(n,"cost"),$(n,"requiresPay"),ie(n,"requiresPay",!0),$(n,"cumulativeCost"),ie(n,"cumulativeCost",!0),$(n,"maxBulkAmount"),ie(n,"maxBulkAmount",1),$(n,"directSum"),ie(n,"pay",function(r){const a=n.cost instanceof g?Lt(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=N(()=>{var u;if(!(n.cost instanceof g))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 g?n.requirementMet=Lr(n.cost,n.resource,(i=n.cumulativeCost)!=null?i:!0,n.directSum,n.maxBulkAmount):n.requirementMet=N(()=>o.gte(n.resource.value,s(n.cost))),n})}function Wi(e){return He(()=>({requirementMet:N(()=>Le(e.visibility)),visibility:he.None,requiresPay:!1}))}function Sd(e,t){return He(()=>({requirementMet:ve(e),partialDisplay:t==null?void 0:K(()=>Nt(t)),display:t==null?void 0:K(()=>p(ne,null,[x("Req: "),Nt(t)])),visibility:t==null?he.None:he.Visible,requiresPay:!1}))}function gi(e){if(Pt(e))return e.every(gi);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function Yr(e){if(Pt(e))return e.map(Yr).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(Pt(e)&&(e=e.filter(r=>Le(r.visibility)),e.length===1&&(e=e[0])),Pt(e)){e=e.filter(l=>"partialDisplay"in l);const r=e.filter(l=>s(l.requiresPay)),a=e.filter(l=>!s(l.requiresPay));return p(ne,null,[r.length>0?p("div",null,[x("Costs:")," ",or(r.map(l=>l.partialDisplay(t)),p(ne,null,[x(", ")]))]):null,a.length>0?p("div",null,[x("Requires:")," ",or(a.map(l=>l.partialDisplay(t)),p(ne,null,[x(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:p(ne,null,null)}function Xr(e,t=1){var n;Pt(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 Id=J({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:Yn,MarkNode:Zn},setup(e){const{display:t,requirements:n,earned:i}=$e(e),r=ft("");return _t(()=>{const a=Ce(t);if(a==null){r.value="";return}if(St(a)){r.value=se(a);return}const l=se(a.requirement?a.requirement:K(()=>{var d;return mi((d=Ce(n))!=null?d:[])}),"h3"),u=se(a.effectDisplay||"","b"),c=Ce(i)?se(a.optionsDisplay||"","span"):"";r.value=se(K(()=>p("span",null,[p(l,null,null),a.effectDisplay!=null?p("div",null,[p(u,null,null)]):null,a.optionsDisplay!=null?p("div",{class:"equal-spaced"},[p(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:he,isVisible:Le,isHidden:wn}}});function $d(e,t,n,i,r,a){var c;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(M(),E("div",{key:0,style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:pe({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?(M(),ee(Ue(e.comp),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):B("",!0)}var xd=ce(Id,[["render",$d],["__scopeId","data-v-5673325a"]]);const Ed=di(),Pd=Symbol("Achievement");let Sn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function Td(e,...t){const n=ct(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return He(r=>{var c,d,m;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=rn("achievement-"),a.type=Pd,a[mt]=xd;for(const f of t)(d=f.preConstruct)==null||d.call(f,a);a.earned=n,a.complete=function(){var h,w;n.value=!0;const f=a;if((h=f.onComplete)==null||h.call(f),f.display!=null&&s(f.showPopups)===!0){const v=s(f.display);let b;St(v)?b=se(v):v.requirement!=null?b=se(v.requirement):b=mi((w=f.requirements)!=null?w:[]),Ed.info(p("div",null,[p("h3",null,[x("Achievement earned!")]),p("div",null,[p(b,null,null)])]))}},Object.assign(a,i),$(a,"visibility"),ie(a,"visibility",he.Visible);const l=a.visibility;a.visibility=ha(()=>{const f=s(a.display);switch(re.msDisplay){default:case Sn.All:return s(l);case Sn.Configurable:return s(a.earned)&&!(f!=null&&typeof f=="object"&&"optionsDisplay"in f)?he.None:s(l);case Sn.Incomplete:return s(a.earned)?he.None:s(l);case Sn.None:return he.None}}),$(a,"display"),$(a,"mark"),$(a,"small"),$(a,"image"),$(a,"style"),$(a,"classes"),$(a,"showPopups"),ie(a,"showPopups",!0);for(const f of t)(m=f.postConstruct)==null||m.call(f,a);const u=t.reduce((f,h)=>{var w;return Object.assign(f,(w=h.getGatheredProps)==null?void 0:w.call(h,a))},{});if(a[at]=function(){const{visibility:f,display:h,requirements:w,earned:v,image:b,style:I,classes:A,mark:S,small:P,id:L}=this;return{visibility:f,display:h,requirements:w,earned:v,image:b,style:s(I),classes:A,mark:S,small:P,id:L,...u}},a.requirements){const f=a,h=[Wi(f),Sd(()=>!f.earned.value),...Pt(a.requirements)?a.requirements:[a.requirements]];_t(()=>{re.active===Q.id&&gi(h)&&f.complete()})}return a})}We.on("loadSettings",e=>{ie(e,"msDisplay",Sn.All)});const Dd=Object.values(Sn).map(e=>({label:Ke(e),value:e}));Is(K(()=>p(Ui,{title:K(()=>p("span",{class:"option-title"},[x("Show achievements"),p("desc",null,[x("Select which achievements to display based on criterias.")])])),options:Dd,"onUpdate:modelValue":e=>re.msDisplay=e,modelValue:re.msDisplay},null)));const Fd=J({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:Zn,Node:Yn},setup(e){const{progress:t,width:n,height:i,direction:r,display:a}=$e(e),l=N(()=>{let d=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),u=N(()=>{const d={width:Ce(n)+.5+"px",height:Ce(i)+.5+"px"};switch(s(r)){case G.Up:d.clipPath=`inset(${l.value}% 0% 0% 0%)`,d.width=Ce(n)+1+"px";break;case G.Down:d.clipPath=`inset(0% 0% ${l.value}% 0%)`,d.width=Ce(n)+1+"px";break;case G.Right:d.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case G.Left:d.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case G.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),c=Pn(a);return{normalizedProgress:l,barStyle:u,component:c,unref:s,Visibility:he,isVisible:Le,isHidden:wn}}});function Ad(e,t,n,i,r,a){var c,d,m,f,h,w,v;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(M(),E("div",{key:0,style:Re([{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:pe({bar:!0,...e.unref(e.classes)})},[_("div",{class:"overlayTextContainer border",style:Re([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(M(),E("span",{key:0,class:"overlayText",style:Re(e.unref(e.textStyle))},[(M(),ee(Ue(e.component)))],4)):B("",!0)],4),_("div",{class:"border",style:Re([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(m=e.unref(e.style))!=null?m:{},(f=e.unref(e.baseStyle))!=null?f:{},(h=e.unref(e.borderStyle))!=null?h:{}])},[_("div",{class:"fill",style:Re([e.barStyle,(w=e.unref(e.style))!=null?w:{},(v=e.unref(e.fillStyle))!=null?v:{}])},null,4)],4),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):B("",!0)}var Od=ce(Fd,[["render",Ad],["__scopeId","data-v-6bd06b56"]]);const Rd=Symbol("Bar");function qd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return He(i=>{var l,u;const r=e.call(i,i);r.id=rn("bar-"),r.type=Rd,r[mt]=Od;for(const c of t)(l=c.preConstruct)==null||l.call(c,r);Object.assign(r,n),$(r,"visibility"),ie(r,"visibility",he.Visible),$(r,"width"),$(r,"height"),$(r,"direction"),$(r,"style"),$(r,"classes"),$(r,"borderStyle"),$(r,"baseStyle"),$(r,"textStyle"),$(r,"fillStyle"),$(r,"progress"),$(r,"display"),$(r,"mark");for(const c of t)(u=c.postConstruct)==null||u.call(c,r);const a=t.reduce((c,d)=>{var m;return Object.assign(c,(m=d.getGatheredProps)==null?void 0:m.call(d,r))},{});return r[at]=function(){const{progress:c,width:d,height:m,direction:f,display:h,visibility:w,style:v,classes:b,borderStyle:I,textStyle:A,baseStyle:S,fillStyle:P,mark:L,id:le}=this;return{progress:c,width:d,height:m,direction:f,display:h,visibility:w,style:s(v),classes:b,borderStyle:I,textStyle:A,baseStyle:S,fillStyle:P,mark:L,id:le,...a}},r})}function Vd(e,...t){return He(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(g.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=N(()=>{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=N(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=N(()=>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}),$(i,"currentGain"),$(i,"actualGain"),$(i,"currentAt"),$(i,"nextAt"),$(i,"buyMax"),ie(i,"buyMax",!0);for(const l of t)(a=l.postConstruct)==null||a.call(l,i);return i})}function Bd(e){return Vd(e)}const Jr=Symbol("Repeatable");function cr(e,...t){const n=ct(0),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return He(r=>{var h,w,v;const a=e.call(r,r);a.id=rn("repeatable-"),a.type=Jr,a[mt]=Zr;for(const b of t)(h=b.preConstruct)==null||h.call(b,a);a.amount=n,a.amount[nn]=(w=a.initialAmount)!=null?w:0,Object.assign(a,i);const l={requirementMet:N(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:he.None},u=Wi(a);Pt(a.requirements)?(a.requirements.unshift(u),a.requirements.push(l)):a.requirements=[u,a.requirements,l],a.maxed=N(()=>o.gte(a.amount.value,s(a.limit))),$(a,"classes");const c=a.classes;a.classes=N(()=>{const b=s(c)||{};return a.maxed.value&&(b.bought=!0),b}),a.amountToIncrease=N(()=>o.clampMin(Yr(a.requirements),1)),a.canClick=N(()=>gi(a.requirements));const d=a.onClick;a.onClick=function(b){const I=a;!s(I.canClick)||(Xr(a.requirements,s(a.amountToIncrease)),I.amount.value=o.add(I.amount.value,1),d==null||d(b))},$(a,"display");const m=a.display;a.display=K(()=>{var I,A,S;const b=s(m);if(St(b)){const P=se(b);return p(P,null,null)}if(b!=null){const P=a,L=se((I=b.title)!=null?I:"","h3"),le=se((A=b.description)!=null?A:""),Z=se((S=b.effectDisplay)!=null?S:"");return p("span",null,[b.title==null?null:p("div",null,[p(L,null,null)]),b.description==null?null:p(le,null,null),b.showAmount===!1?null:p("div",null,[p("br",null,null),p(ne,null,[x("Amount: "),gt(P.amount.value)]),o.isFinite(s(P.limit))?p(ne,null,[x(" / "),gt(s(P.limit))]):void 0]),b.effectDisplay==null?null:p("div",null,[p("br",null,null),x("Currently: "),p(Z,null,null)]),P.maxed.value?null:p("div",null,[p("br",null,null),mi(P.requirements,s(a.amountToIncrease))])])}return""}),$(a,"visibility"),ie(a,"visibility",he.Visible),$(a,"limit"),ie(a,"limit",o.dInf),$(a,"style"),$(a,"mark"),$(a,"small");for(const b of t)(v=b.postConstruct)==null||v.call(b,a);const f=t.reduce((b,I)=>{var A;return Object.assign(b,(A=I.getGatheredProps)==null?void 0:A.call(I,a))},{});return a[at]=function(){const{display:b,visibility:I,style:A,classes:S,onClick:P,canClick:L,small:le,mark:Z,id:z}=this;return{display:b,visibility:I,style:s(A),classes:S,onClick:P,canClick:L,small:le,mark:Z,id:z,...f}},a})}const Ld=Symbol("Reset");function jd(e){return He(t=>{const n=e.call(t,t);return n.id=rn("reset-"),n.type=Ld,n.reset=function(){var r;const i=a=>{if(a!=null&&typeof a=="object")if(nn in a){const l=a;l.value=l[nn]}else!(a instanceof o)&&!De(a)&&Object.values(a).forEach(l=>i(l))};s(n.thingsToReset).forEach(i),We.emit("reset",n),(r=n.onReset)==null||r.call(n)},$(n,"thingsToReset"),n})}const ei={};We.on("removeLayer",e=>{var t;(t=ei[e.id])==null||t.call(ei),ei[e.id]=void 0});function Ei(e,t){return $(t,"display"),$(t,"classes"),$(t,"style"),$(t,"direction"),ie(t,"direction",G.Up),$(t,"xoffset"),$(t,"yoffset"),t.pinnable&&(t.pinned=ct(!1,!1)),jt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,Pr(t.pinned)):e.pinned=t.pinned);const n=e[mt];e[mt]=Pe;const i=e[at].bind(e);e[at]=function(){const{display:a,classes:l,style:u,direction:c,xoffset:d,yoffset:m,pinned:f}=this;return{element:{[mt]:n,[at]:i},display:a,classes:l,style:s(u),direction:c,xoffset:d,yoffset:m,pinned:f}}.bind(t)}),t}var zd=J({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:Yn,MarkNode:Zn},setup(e){const{display:t,requirements:n,bought:i}=$e(e),r=ft("");return _t(()=>{const a=Ce(t);if(a==null){r.value="";return}if(St(a)){r.value=se(a);return}const l=se(a.title||"","h3"),u=se(a.description,"div"),c=se(a.effectDisplay||"");r.value=se(K(()=>p("span",null,[a.title!=null?p("div",null,[p(l,null,null)]):null,p(u,null,null),a.effectDisplay!=null?p("div",null,[x("Currently: "),p(c,null,null)]):null,i.value?null:p(ne,null,[p("br",null,null),mi(n.value)])])))}),{component:r,unref:s,Visibility:he,isVisible:Le,isHidden:wn}}});const Ud=["disabled"];function Gd(e,t,n,i,r,a){var c;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(M(),E("button",{key:0,style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:pe({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)?(M(),ee(Ue(e.unref(e.component)),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],14,Ud)):B("",!0)}var Wd=ce(zd,[["render",Gd],["__scopeId","data-v-9be6bac0"]]);const Hi=Symbol("Upgrade");function dr(e,...t){const n=ct(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return He(r=>{var c,d;const a=e.call(r,r);a.id=rn("upgrade-"),a.type=Hi,a[mt]=Wd;for(const m of t)(c=m.preConstruct)==null||c.call(m,a);a.bought=n,Object.assign(a,i),a.canPurchase=N(()=>!n.value&&gi(a.requirements)),a.purchase=function(){var f;const m=a;!s(m.canPurchase)||(Xr(a.requirements),n.value=!0,(f=m.onPurchase)==null||f.call(m))};const l=Wi(a);Pt(a.requirements)?a.requirements.unshift(l):a.requirements=[l,a.requirements],$(a,"visibility"),ie(a,"visibility",he.Visible),$(a,"classes"),$(a,"style"),$(a,"display"),$(a,"mark");for(const m of t)(d=m.postConstruct)==null||d.call(m,a);const u=t.reduce((m,f)=>{var h;return Object.assign(m,(h=f.getGatheredProps)==null?void 0:h.call(f,a))},{});return a[at]=function(){const{display:m,visibility:f,style:h,classes:w,requirements:v,canPurchase:b,bought:I,mark:A,id:S,purchase:P}=this;return{display:m,visibility:f,style:s(h),classes:w,requirements:v,canPurchase:b,bought:I,mark:A,id:S,purchase:P,...u}},a})}function Hd(e,t,n=[]){n=n.length===0?ai(e,Hi):n;const i=zn(t)?N(t):t;e.on("update",()=>{s(i)&&n.forEach(r=>r.purchase())})}function Zd(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 Yd={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"]},fr=[[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 Pi(e){const t=fr[Math.floor(e()*fr.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 gr=di();function Kr(e,t,n,i){return ji(e,function(){const r=Zd(0,n>>0,n>>32,1);for(let q=0;q<12;q++)r();const a=Pi(r),l=On([.64,.75,.55],r),u=On([.18,.2,.25],r),c=Mn(0,Pi(r)),d=ct(0),m=cn.indexOf(t);let f=r();const h=i.reduce((q,j)=>(q[j.type]=j.data,q),{});"increaseDiff"in h&&(f=f/2+.5),"decreaseDiff"in h&&(f=f/2),"relic"in h&&(f=1);const w=f+m+1,v="increaseRewards"in h?w+1:w;let b="relic"in h?m+2:Math.ceil(r()*(m+2));"increaseLength"in h&&b++;const I=[],A=$t(()=>[...I,Oe(()=>({multiplier:()=>C.isEmpowered("silver")?4:2,description:()=>(C.isEmpowered("silver")?"Empowered ":"")+Te.silver.name,enabled:()=>C.toolNodes.value.silver!=null})),Oe(()=>({multiplier:()=>(C.isEmpowered("diamond")?2:1)*Xe.filter(q=>q.bought.value).length/10,description:()=>(C.isEmpowered("diamond")?"Empowered ":"")+Te.diamond.name,enabled:()=>C.toolNodes.value.diamond!=null})),Oe(()=>({multiplier:()=>o.div(d.value,6e3).times(C.isEmpowered("emerald")?2:1),description:()=>(C.isEmpowered("emerald")?"Empowered ":"")+Te.emerald.name,enabled:()=>C.toolNodes.value.emerald!=null}))]),S=N(()=>A.apply(0)),P=[],L={};function le({feature:q,canClick:j,modifier:xe,cost:Tt,previewModifier:on,showETA:tt,previewCost:Dt}){j=ve(j),tt=ve(tt);const T=lr(q);P.push({shouldShowPreview:N(()=>s(j)&&T.value),modifier:$t(()=>{const W=I.slice();return W.splice(W.indexOf(xe),1,on),W}),cost:Dt!=null?Dt:Tt}),I.push(xe);const D=$i(c,S,()=>be(Tt)),O=Ei(q,{display:tt==null?D:()=>s(tt)?D.value:"",direction:G.Down});return{isHovering:T,eta:D,tooltip:O}}const Z=[],z=V(0);let U=g.variable(z).times(0);const qe={};let et=!0;const Y=N(()=>o.add(w,r()-.5).pow_base(2).times(10).times(U.evaluate())),Me=[];for(let q=0;q=b-1?0:1};switch(ti(j,r)){case"upgrades":const Ft=[];for(let Se=0;Se<4;Se++){const ot=ti({add:1,mult:q===0&&Se===0?0:1,pow:q===0?0:.5},r),Ze=Y.value,Je=kn(r);let it="",Ee,ye;const Ie=z.value;switch(ot){case"add":{const ue=o.add(Ze,10).pow(r()/4+.875);it=`Gain ${me(ue)} ${c.displayName}/s`,U=U.add(ue),Ee=gn(()=>({addend:ue,description:Je,enabled:Ve.bought})),ye=gn(()=>({addend:ue}));break}case"mult":{const ue=r()*5+1;it=`Multiply previous ${c.displayName} gain by x${me(ue)}.`,U=U.add(o.sub(ue,1).times(qe[Ie-1])),Ee=Oe(()=>({multiplier:ue,description:Je,enabled:Ve.bought})),ye=Oe(()=>({multiplier:ue}));break}case"pow":{const ue=r()/10+1.05;it=`Raise previous ${c.displayName} gain to the ^${me(ue)}`,U=U.add(o.pow(qe[Ie-1],ue)).sub(qe[Ie-1]),Ee=Ii(()=>({exponent:ue,description:Je,enabled:Ve.bought})),ye=Ii(()=>({exponent:ue}))}}qe[z.value]=U.evaluate(),z.value++;const je=et,Ve=dr(()=>({requirements:An(()=>({resource:Cn(c),cost:Ze})),display:{title:Je,description:it},visibility:je}));le({feature:Ve,canClick:()=>Ve.canPurchase.value,modifier:Ee,cost:Ze,showETA:()=>!Ve.bought.value,previewModifier:ye}),Ft.push(Ve)}Z.push(Ft);break;case"repeatables":const At=[];for(let Se=0;Se<3;Se++){const ot=ti({add:1.5,mult:3},r),Ze=z.value,Je=Y.value,it=kn(r);let Ee="",ye,Ie,je,Ve;const ue=g.variable(N(()=>ze.amount.value)).times(2);switch(ot){case"add":{const _e=o.add(Je,10).times(r()+.5);Ee=`Gain ${me(_e)} ${c.displayName}/s`,Ve=ue.add(1).times(Je),U=U.add(N(()=>o.sub(z.value,Ze).add(1).times(5).times(_e))),ye=N(()=>me(o.times(_e,ze.amount.value))+"/s"),Ie=gn(()=>({addend:()=>o.times(_e,ze.amount.value),description:it,enabled:()=>o.gt(ze.amount.value,0)})),je=gn(()=>({addend:()=>o.add(ze.amount.value,1).times(_e)}));break}case"mult":{const _e=r()*.75+1.25;Ee=`Multiply previous ${c.displayName} gain by x${me(_e)}.`,Ve=ue.pow_base(_e).times(Je),U=U.add(N(()=>o.sub(z.value,Ze).add(1).times(5).pow_base(_e).sub(1).times(qe[Ze-1]))),ye=N(()=>"x"+me(o.pow(_e,ze.amount.value))),Ie=Oe(()=>({multiplier:()=>o.pow(_e,ze.amount.value),description:it,enabled:()=>o.gt(ze.amount.value,0)})),je=Oe(()=>({multiplier:()=>o.add(ze.amount.value,1).pow_base(_e)}));break}}qe[z.value]=U.evaluate(),z.value++;const qt=et,ze=cr(()=>({requirements:An(()=>({resource:Cn(c),cost:Ve})),display:()=>({title:it,description:Ee,effectDisplay:s(ye)}),visibility:qt}));le({feature:ze,canClick:()=>s(ze.canClick),modifier:Ie,cost:Ve,previewModifier:je}),At.push(ze)}Z.push(At);break;case"conversion":const Ae=Mn(0,Pi(r)),Ot=On([.64,.75,.55],r),Dn=Y.value,Qr=r()/2+.25,Yi=r()/2+.25,Xi=z.value;U=U.add(N(()=>o.sub(z.value,Xi).add(1).pow_base(5).pow(Yi).times(qe[Xi-1])));const Rt=Bd(()=>({baseResource:Cn(c),gainResource:Ae,formula:Se=>Se.div(Dn).pow(Qr),spend(){c.value=0}}));qe[z.value]=U.evaluate(),z.value+=2;const ea=et,Ji=kn(r),Ni=g.variable(Ae).pow(Yi).add(1),ta=Oe(()=>({multiplier:()=>Ni.evaluate(),description:Ji,enabled:()=>o.gt(Ae.value,0)})),na=Oe(()=>({multiplier:()=>Ni.evaluate(o.add(Ae.value,Rt.actualGain.value))})),Nn=yd(()=>({display:{title:Ji,description:K(()=>p("span",null,[x("Reset "),c.displayName,x(" for")," ",ui(Ae,o.clampMin(Rt.actualGain.value,1))," ",Ae.displayName,p("br",null,null),p("div",null,[x("Next:")," ",ui(c,o.lt(Rt.actualGain.value,1)?Rt.currentAt.value:Rt.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(Rt.actualGain.value,1),prestigeResource:Ae,onClick:Rt.convert,visibility:ea})),{isHovering:ia}=le({feature:Nn,canClick:()=>s(Nn.canClick),modifier:ta,cost:Dn,previewCost:c,previewModifier:na}),Ki=N(()=>ia.value&&Nn.canClick.value);Z.push([Nn]);const ra=dn(g.variable(Ae),Ki,Rt.actualGain),aa=dn(Ni,Ki,Rt.actualGain);L[q*2]=K(()=>p(ne,null,[Le(Nn.visibility)?p("div",{style:"margin: 10px"},[x("You have")," ",p("h2",{style:{color:Ot,textShadow:`0px 0px 10px ${Ot}`}},[ra()])," ",Ae.displayName,x(","),p("br",null,null),x("providing a "),aa(),x("x multiplier to previous")," ",c.displayName,x(" gain")]):null,Si(Nn)]));break;case"xp":{const Se=Mn(0),nt=et,ot=z.value,Ze=kn(r),Je=o.add(w,r()-.5).pow_base(2).times(10),it=r()/4+1.125,Ee=r()/2+1.25,ye=g.variable(0).pow(it).times(Je),Ie=Lr(ye,Se,!0,10,o.dInf),je=N(()=>Lt(ye,Ie.value,!0,10)),Ve=N(()=>Lt(ye,o.add(Ie.value,1),!0,10)),ue=N(()=>o.pow(Ee,Ie.value)),qt=Oe(()=>({multiplier:ue,description:Ze,enabled:()=>Le(_e.visibility)}));U=U.add(N(()=>o.sub(z.value,ot).add(1).sqrt().times(3).pow(Ee).times(qe[ot-1]))),qe[z.value]=U.evaluate(),z.value+=2;const ze=On([.18,.2,.25],r),_e=qd(()=>({direction:G.Right,width:300,height:20,progress:()=>o.sub(Se.value,je.value).div(o.sub(Ve.value,je.value)).toNumber(),visibility:nt,xp:Se,display:K(()=>p("span",null,[me(Se.value),x("/"),me(Ve.value)])),fillStyle:`background-color: ${ze}`}));this.on("preUpdate",Ci=>{if(kt.value.lengthyt.state.id===e)&&Le(_e.visibility)){const yt=o.times(ht.value,Ci);Se.value=o.add(yt,Se.value)}}),I.push(qt),Z.push([_e]),L[q*2]=K(()=>p(ne,null,[Le(_e.visibility)?p("div",{style:"margin: 10px"},[x("You have "),p("h3",null,[Ze]),x(" Lv. "),gt(Ie.value),x(","),p("br",null,null),x("providing a "),me(ue.value),x("x multiplier to previous")," ",c.displayName,x(" gain"),p("br",null,null)]):null,Si(_e)]));break}case"dimensions":{const Se=kn(r),nt=Mn(0,Se+" energy"),ot=On([.64,.75,.55],r),Ze=z.value;U=U.add(N(()=>o.sub(z.value,Ze).add(1).pow_base(32).add(1).log2().add(1).times(qe[Ze-1])));const Je=N(()=>o.add(nt.value,1).log2().add(1)),it=Oe(()=>({multiplier:Je,description:Se,enabled:()=>o.gt(nt.value,0)}));I.push(it);const Ee=et,ye=[];for(let Ie=0;Ie<4;Ie++){const je=o.add(w,r()-.5).pow_base(2).times(10).recip(),Ve=Y.value,ue=g.variable(N(()=>yt.amount.value)),qt=ue.pow_base(o.pow10(Ie+1)).times(Ve),ze=["First","Second","Third","Fourth"][Ie]+" "+Se+" Dimension",_e=Mn(0,ze),Ci=ue.sub(1).pow_base(2).times(je).times(N(()=>o.add(yt.amount.value,_e.value))),yt=cr(()=>({display:{title:ze,description:K(()=>p("div",null,[p("div",null,[x("Amount:")," ",me(o.add(_e.value,yt.amount.value))," ",x("["),gt(yt.amount.value),x("]")])])),effectDisplay:K(()=>p("span",null,[la()," ",Ie===0?nt.displayName:ye[ye.length-1].display.title,x("/s")])),showAmount:!1},style:{width:"400px"},effect:Ci,dimensions:_e,energy:Ie===0?nt:void 0,requirements:An(()=>({resource:Cn(c),cost:qt})),visibility:Ee}));ye.push(yt);const sa=lr(yt),Qi=N(()=>s(yt.canClick)&&sa.value),oa=new g({inputs:[ue],evaluate(er){return o.sub(er,1).pow_base(2).times(je).times(o.add(er,_e.value))}}),la=dn(oa,Qi);P.push({shouldShowPreview:Qi,cost:qt});const ua=$i(c,S,()=>be(qt));Ei(yt,{display:ua,direction:G.Down}),qe[z.value]=U.evaluate(),z.value++}this.on("preUpdate",Ie=>{if(kt.value.lengthje.state.id===e)&&Le(Ee)){const je=o.times(ht.value,Ie),Ve=ye[0].effect.evaluate();nt.value=o.times(Ve,je).add(nt.value);for(let ue=1;ue<4;ue++){const qt=ye[ue].effect.evaluate();ye[ue-1].dimensions.value=o.times(qt,je).add(ye[ue-1].dimensions.value)}}}),Z.push(ye),L[q*2]=K(()=>p(ne,null,[Le(Ee)?p("div",{style:"margin: 10px"},[x("You have")," ",p("h2",{style:{color:ot,textShadow:`0px 0px 10px ${ot}`}},[me(nt.value)])," ",nt.displayName,x(","),p("br",null,null),x("providing a "),me(Je.value),x("x multiplier to previous")," ",c.displayName,x(" gain")]):null,Fs(...ye)]));break}case"prestige":{const Se=kn(r),nt=et,ot=r()/2+1.25,Ze=Y.value;U=U.pow(ot);const Je=Ii(()=>({exponent:ot,description:Se,enabled:Ee.bought}));qe[z.value]=U.evaluate(),z.value++;const it=jd(()=>({thingsToReset:Z.filter((Ie,je)=>je%2===0),onReset(){c.value=0}})),Ee=dr(()=>({display:{title:Se,description:`Reset all previous ${a} content to raise all previous ${c.displayName} gain to the ^${me(ot)}`},style:{width:"200px",minHeight:"100px"},onPurchase:it.reset,visibility:nt,requirements:An(()=>({resource:Cn(c),cost:Ze}))})),ye=Oe(()=>({multiplier:0}));le({feature:Ee,canClick:()=>s(Ee.canPurchase),modifier:Je,cost:Ze,previewCost:c,previewModifier:ye,showETA:()=>!s(Ee.bought)}),Z.push([Ee]);break}}const Tt={cache:"increaseCaches"in h?10:1,generation:"increaseGens"in h?10:1,resourceMulti:"increaseResourceMults"in h?10:1,energyMulti:"increaseEnergyMults"in h?2.5:.25,influences:Object.keys(C.influenceNodes.value).length+Me.length===Object.keys(Vt).length?0:"increaseInfluences"in h?20:2,relic:0};let on=ti(Tt,r);q===b-1&&"relic"in h&&(on="relic");let tt="",Dt,T,D,O,W,oe;switch(on){case"cache":O=Ti(r,i),tt=`Gain ${me(v)}x your current ${O}.`,T=()=>{var Ae,Ot,Dn;return C.grantResource(O,o.times((Dn=(Ot=(Ae=C.resourceNodes.value[O])==null?void 0:Ae.state)==null?void 0:Ot.amount)!=null?Dn:0,v))};break;case"generation":O=Ti(r,i);const Ft=o.div(v,120).times(Mt[O]);tt=`Gain ${me(Ft)} ${O}/s while plane is active.`,Dt=Ae=>C.grantResource(O,o.times(Ae,Ft)),D=N(()=>C.resourceNodes.value[O]);break;case"resourceMulti":W=O=Ti(r,i),oe=o.div(v,17).pow_base(2),tt=`Gain ${me(oe)}x ${O} while plane is active.`;break;case"energyMulti":W="energy",oe=o.div(v,17).add(1),tt=`Gain ${me(oe)}x energy while plane is active.`;break;case"influences":const At=Object.keys(Vt)[Math.floor(r()*Object.keys(Vt).length)];Me.push(At),tt=`Gain a new portal influence (${Vt[At].display})`,T=()=>{if(At in C.influenceNodes.value){gr.warning(`Error: ignoring duplicate portal influence (${Vt[At].display})`);return}const Ae={id:Wn(C.board),position:{...C.board.types.portal.nodes.value.find(Ot=>Ot.state.id===e).position},type:"influence",state:{type:At,data:Vt[At].initialData}};C.board.placeInAvailableSpace(Ae),C.board.nodes.value.push(Ae)};break;case"relic":tt=t==="ultimatum"?"Win the game!":`Gain the ${t}-tier planar relic (${Fi[t]})`,T=()=>{if(t==="ultimatum"){Zi.value=!0;return}if(`${t}Relic`in C.toolNodes.value)gr.warning(`Error: ignoring duplicate relic (${Fi[t]})`);else{const Ae={id:Wn(C.board),position:{...C.board.types.portal.nodes.value.find(Ot=>Ot.state.id===e).position},type:"passive",state:`${t}Relic`};C.board.placeInAvailableSpace(Ae),C.board.nodes.value.push(Ae)}}}const ge=et,Zt=Y.value,It=Td(()=>({requirements:An(()=>({resource:Cn(c),cost:Zt})),visibility:ge,display:{requirement:`${me(Zt)} ${c.displayName}`,effectDisplay:tt},style:"width: 100%",classes:{final:q===b-1},update:Dt,onComplete:T,link:D,effectedResource:W,resourceMulti:oe})),Yt=$i(c,S,Zt);Ei(It,{display:()=>It.earned.value?"":Yt.value,direction:G.Down}),Z.push([It]),et=It.earned}const Xe=ai(Z,Hi);ai(Z,Jr);const st=$t(()=>[Oe(()=>({multiplier:()=>{var q,j,xe;return o.add((xe=(j=(q=C.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:j.level)!=null?xe:0,1)},description:"Booster",enabled:()=>{var q,j,xe;return(xe=(j=(q=C.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:j.portals.includes(e))!=null?xe:!1}}))]),ht=N(()=>st.apply(1)),[bt,Wt]=Bn(()=>[{title:`${Ke(c.displayName)} Gain`,modifier:A,base:0,unit:"/s"},{title:`${Ke(c.displayName)} Time Speed`,modifier:st,base:1,visible:()=>o.gt(ht.value,1)}]),sn=V(!1),hi=K(()=>p(Ut,{modelValue:sn.value,"onUpdate:modelValue":q=>sn.value=q},{header:()=>p("h2",null,[x("Modifiers")]),body:()=>Qe(bt)}));this.on("preUpdate",q=>{if(!C.activePortals.value.some(xe=>xe.state.id===e))return;const j=o.times(ht.value,q);d.value=o.add(d.value,j),kt.value.length{var Tt;(Tt=xe.update)==null||Tt.call(xe,j)})}),Hd(this,()=>C.upgrader.value!=null&&Ne(C.upgrader.value),Xe);const Jn=N(()=>{const q=P.find(j=>j.shouldShowPreview.value);return q?o.neg(be(q.cost)):0}),Kn=N(()=>{const q=P.find(j=>j.shouldShowPreview.value);return q&&q.modifier?o.sub(q.modifier.apply(0),S.value):0}),bi=dn(g.variable(0).add(c),()=>o.neq(Jn.value,0),Jn),yi=dn(g.variable(0).add(S),()=>o.neq(Kn.value,0),Kn),wi=N(()=>{const q=[];return kt.value.forEach(j=>{j.link&&q.push(j.link)}),q}),_i=N(()=>{const q={};return kt.value.forEach(j=>{j.effectedResource!=null&&j.resourceMulti!=null&&(q[j.effectedResource]!=null?q[j.effectedResource]=o.times(q[j.effectedResource],j.resourceMulti):q[j.effectedResource]=j.resourceMulti)}),q}),kt=N(()=>{const q=[];for(let j=1;jo.lt(kt.value.length,b)&&Z.some(q=>q.some(j=>"earned"in j&&s(j.earned)||"bought"in j&&s(j.bought)?!1:("canClick"in j&&s(j.canClick)||"canPurchase"in j&&s(j.canPurchase),!0))));return{tier:ct(t),seed:ct(n),influences:ct(i),name:a,color:l,resource:c,background:u,style:{background:u,"--background":u},features:Z,resourceTabCollapsed:Wt,links:wi,resourceMultis:_i,earnedTreasures:kt,showNotif:Ht,timeActive:d,display:K(()=>p(ne,null,[p(li,{class:"nav-container",style:"z-index: 5"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",null,[a])]),p("span",{class:"nav-segment"},[p("h3",null,[t,x("-tier")])]),i.length===0?null:p("span",{class:"nav-segment"},[p(Pe,{display:i.map(q=>{const j=Vt[q.type].description;return typeof j=="function"?j(q):j}).join("
"),direction:G.Down,style:"width: 300px"},{default:()=>[p("h3",null,[i.length,x(" influences")])]})]),p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>sn.value=!0},[x("modifiers")])])]}),p(li,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[Qe(bi)])," ",c.displayName]),p("span",{class:"nav-segment"},[x("("),p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[o.gt(S.value,0)?"+":"",Qe(yi)]),x("/s)")]),o.neq(ht.value,1)?p("span",{class:"nav-segment"},[x("Speed: "),me(ht.value),x("x")]):null]}),p(Md,{height:"60px"},null),Z.map((q,j)=>j in L?Qe(L[j]):Si(...q)),Qe(hi)])),minimizedDisplay:K(()=>p("div",null,[p("span",null,[a]),p("span",{style:"font-size: large; vertical-align: sub;"},[" ",kt.value.length,x("/"),b,x(" treasures")])]))}})}function Ti(e,t){t=t.filter(u=>u.type==="increaseResources"||u.type==="decreaseResources");const n=Object.keys(Mt).reduce((u,c)=>{let d=Mt[c];return t.filter(m=>m.data===c).forEach(m=>{m.type==="increaseResources"?d*=1e3:d/=1e3}),u+d},0),i=Object.keys(Mt),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===C.board.selectedNode.value?{text:"Mining"}:Object.keys(C.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[an],progress:e=>Ne(e)?new o(e.state.progress).toNumber():0,progressDisplay:hn.Outline,progressColor:"var(--accent2)",classes:e=>({running:Ne(e)}),draggable:!0},ef={shape:Ge.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===C.board.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(e){o.gte(C.energy.value,100)&&(e.type="factory",C.energy.value=o.sub(C.energy.value,100))},confirmationLabel:()=>o.gte(C.energy.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},tf={shape:Ge.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===C.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${Te[e.state].name}`};if(((t=C.board.draggingNode.value)==null?void 0:t.type)==="resource"){const i=((n=C.board.draggingNode.value)==null?void 0:n.state).type,r=e.state===i?"Disconnect":Te[i].name,a=e.state===i||o.gte(C.energy.value,Te[i].cost)&&C.toolNodes.value[i]==null?"var(--accent2)":"var(--danger)";return{text:r,color:a}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,C.board.selectedAction.value=null,C.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${Te[e.state].name} - ${Ye(Te[e.state].cost)} energy`}),onClick(e){const t=Te[e.state];if(o.gte(C.energy.value,t.cost)&&C.toolNodes.value[e.state]==null){C.energy.value=o.sub(C.energy.value,t.cost);const n={id:Wn(C.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};C.board.placeInAvailableSpace(n),C.board.nodes.value.push(n),C.board.selectedAction.value=null,C.board.selectedNode.value=null,e.state=void 0}},fillColor:e=>o.gte(C.energy.value,Te[e.state].cost)&&C.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(C.energy.value,Te[e.state].cost)?C.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:e=>e.state==null||C.toolNodes.value[e.state]!=null?0:o.div(C.energy.value,Te[e.state].cost).clampMax(1).toNumber(),progressDisplay:hn.Fill,progressColor:e=>e.state!=null&&o.gte(C.energy.value,Te[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){return t.type==="resource"},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,C.board.selectedNode.value=e},draggable:!0},nf={shape:Ge.Circle,size:50,title:e=>Ke(e.state.type),subtitle:e=>Ye(e.state.amount),progress:e=>cd(e.state.type),onClick(){},progressDisplay:hn.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":C.dowsing.value!=null&&Ne(C.dowsing.value)&&C.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=C.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0},rf={shape:Ge.Circle,size:50,title:e=>Te[e.state].name,label:e=>e===C.board.selectedNode.value?{text:kd[e.state].description(lt(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":lt(e.state)}),draggable:!0},af={shape:Ge.Diamond,size:50,title:"\u{1F962}",label:e=>e===C.board.selectedNode.value?{text:e.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${e.state.resources.length}/${o.add(e.state.maxConnections,C.computedBonusConnectionsModifier.value)})`}:jr(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[pi,Hn(e=>e.add(2).pow_base(100),16),an],classes:e=>({running:Ne(e)}),canAccept:Ur,onDrop:Gr,draggable:!0},sf={shape:Ge.Diamond,size:50,title:"\u26CF\uFE0F",label:e=>e===C.board.selectedNode.value?{text:e.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${e.state.resources.length}/${o.add(e.state.maxConnections,C.computedBonusConnectionsModifier.value)})`}:jr(e,t=>`Gather ${pt(o.div(C.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[pi,Hn(e=>e.add(2).pow_base(1e4),16),an],progress:e=>Ne(e)?o.eq(C.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(C.quarryProgressRequired.value).toNumber():0,progressDisplay:hn.Outline,progressColor:"var(--accent2)",canAccept:Ur,onDrop:Gr,classes:e=>({running:Ne(e)}),draggable:!0},of={shape:Ge.Diamond,size:50,title:"\u{1F50C}",label:e=>e===C.board.selectedNode.value?{text:e.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${e.state.tools.length}/${o.add(e.state.maxConnections,C.computedBonusConnectionsModifier.value)})`}:od(e,t=>t.includes("Relic")?`Double ${Fi[t.slice(0,-5)]}'s effect`:`Double ${Te[t].name}'s effect`),actionDistance:Math.PI/4,actions:[pi,Hn(e=>e.add(3).pow_base(1e3),16),an],canAccept:ld,onDrop:ud,classes:e=>({running:Ne(e)}),draggable:!0},lf={shape:Ge.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===C.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=C.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${Ke(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type,{influences:i}=e.state;return i.includes(n)?{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(e){e.state={...e.state,tier:void 0,influences:[]},C.board.selectedAction.value=null,C.board.selectedNode.value=null},visibility:e=>{const{tier:t,influences:n}=e.state;return t!=null||n.length>0}},{id:"makePortal",icon:"done",tooltip:e=>({text:`Spawn ${e.state.tier}-tier portal`}),onClick(e){let t=0;for(;`portal-${t}`in we;)t++;const{tier:n,influences:i}=e.state;zi(Kr(`portal-${t}`,n,Math.floor(Math.random()*4294967296),i.map(a=>C.influenceNodes.value[a].state)),Q);const r={id:Wn(C.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};C.board.placeInAvailableSpace(r),C.board.nodes.value.push(r),C.board.selectedAction.value=null,C.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null}],canAccept(e,t){return t.type==="resource"||t.type==="influence"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,i=e.state.tier;e.state={...e.state,tier:n===i?void 0:n}}else if(t.type==="influence"){const n=t.state.type,i=e.state.influences;i.includes(n)?e.state={...e.state,influences:i.filter(r=>r!==n)}:e.state={...e.state,influences:[...i,n]}}C.board.selectedNode.value=e},draggable:!0},uf={shape:Ge.Diamond,size:50,title:"\u{1F300}",label:e=>e===C.board.selectedNode.value?{text:`Portal to ${we[e.state.id].name}`,color:we[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[an],classes:e=>({running:Ne(e),showNotif:we[e.state.id].showNotif.value,"affected-node":C.booster.value!=null&&Ne(C.booster.value)&&C.booster.value.state.portals.includes(e.state.id)}),outlineColor:e=>we[e.state.id].background,draggable:!0},cf={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?Ge.Diamond:Ge.Circle,size:50,title:e=>Vt[e.state.type].display,label:e=>{if(e===C.board.selectedNode.value){const n=e.state,i=Vt[n.type].description;return{text:typeof i=="function"?i(n):i}}const t=C.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:i,data:r}=e.state;let a;if(Array.isArray(r)&&r.includes(n))a="Disconnect";else if(i==="increaseResources")a=`Increase ${Ke(n)} odds`;else if(i==="decreaseResources")a=`Decrease ${Ke(n)} odds`;else return null;return{text:a,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[pi],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,i=e.state.data;i!=null&&(i.includes(n)?e.state={...e.state,data:i.filter(r=>r!==n)}:e.state={...e.state,data:[...i,n]},C.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},df={shape:Ge.Diamond,size:50,title:"\u231B",label:e=>e===C.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ye(o.add(1,e.state.level))}x (${e.state.portals.length}/${o.add(e.state.maxConnections,C.computedBonusConnectionsModifier.value)})`}:zr(e,t=>`Boost ${we[t].name}'s speed`),actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect portals"},onClick(e){e.state={...e.state,portals:[]},C.board.selectedAction.value=null,C.board.selectedNode.value=null},visibility:e=>{var t,n;return(n=(t=e.state)==null?void 0:t.portals.length)!=null?n:0>0}},Hn(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${Ye(xi.evaluate(e.state.level))} energy`}},confirmationLabel(e){return o.gte(C.energy.value,xi.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=xi.evaluate(e.state.level);o.gte(C.energy.value,t)&&(C.energy.value=o.sub(C.energy.value,t)),e.state={...e.state,level:o.add(e.state.level,1)},C.board.selectedAction.value=null}},an],canAccept:Wr,onDrop:Hr,classes:e=>({running:Ne(e)}),draggable:!0},ff={shape:Ge.Diamond,size:50,title:"\u231B",label:e=>e===C.board.selectedNode.value?{text:e.state.portals.length===0?"Upgrader - Drag a portal to me!":`Auto-Upgrading (${e.state.portals.length}/${o.add(e.state.maxConnections,C.computedBonusConnectionsModifier.value)})`}:zr(e,t=>`Auto-buy ${we[t].name}'s upgrades`),actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect portals"},onClick(e){e.state={...e.state,portals:[]},C.board.selectedAction.value=null,C.board.selectedNode.value=null},visibility:e=>{var t,n;return(n=(t=e.state)==null?void 0:t.portals.length)!=null?n:0>0}},Hn(e=>e.add(4).pow_base(1e6)),an],canAccept:Wr,onDrop:Hr,classes:e=>({running:Ne(e)}),draggable:!0},mr=di(),pf={mine:Qd,brokenFactory:ef,factory:tf,resource:nf,passive:rf,dowsing:af,quarry:sf,empowerer:of,portalGenerator:lf,portal:uf,influence:cf,booster:df,upgrader:ff},C=ji("main",function(){const e=Mn(0,"energy"),t=N(()=>m.types.resource.nodes.value.reduce((T,D)=>(T[D.state.type]=D,T),{})),n=N(()=>({...m.types.passive.nodes.value.reduce((T,D)=>(T[D.state]=D,T),{}),sand:m.types.dowsing.nodes.value[0],wood:m.types.quarry.nodes.value[0],coal:m.types.empowerer.nodes.value[0],iron:m.types.portalGenerator.nodes.value[0],gold:m.types.booster.nodes.value[0],platinum:m.types.upgrader.nodes.value[0]})),i=N(()=>({...m.types.influence.nodes.value.reduce((T,D)=>(T[D.state.type]=D,T),{})})),r=N(()=>cn.reduce((T,D)=>{var ge,Zt,It;const O=(It=(Zt=(ge=t.value[D])==null?void 0:ge.state)==null?void 0:Zt.amount)!=null?It:0;let W=o.floor(Ln.invertIntegral(O)).sub(10).clampMin(0),oe=Lt(Ln,W,!0,0);for(;;){const Yt=Ln.evaluate(W);if(o.add(oe,Yt).lte(O))W=W.add(1),oe=o.add(oe,Yt);else break}return T[D]=W,T},{})),a=vn({}),l=vn({});jt(()=>{cn.forEach(T=>{dt(()=>r.value[T],(D,O)=>{o.gt(D,O)&&re.active===Q.id&&o.lte(D,100)&&mr.info(p("div",null,[p("h3",null,[o.eq(D,1)?`${Ke(T)} discovered`:`${Ke(T)} is now Level ${gt(D)}`,x("!")]),p("div",null,[x("Energy gain is now 1.01x higher.")])]))})})});const u=N(()=>P.filter(T=>{var D,O;return(O=(D=T.value)==null?void 0:D.state)==null?void 0:O.powered}).length+m.types.portal.nodes.value.filter(T=>T.state.powered).length),c=N(()=>o.eq(u.value,0)?10:o.add(u.value,1).pow_base(100).div(10).times(.99)),d=N(()=>v.value==null?0:v.value.state.resources.reduce((D,O)=>o.div(100,Wt[O].computedModifier.value).add(D),o.dZero)),m=ku(T=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:pf,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const D=[];if(D.push(...Object.keys(a).map(O=>({startNode:f.value,endNode:t.value[O],stroke:"var(--accent3)",strokeWidth:5}))),h.value!=null&&h.value.state!=null&&D.push({startNode:h.value,endNode:t.value[h.value.state],stroke:"var(--foreground)",strokeWidth:4}),w.value!=null&&w.value.state.resources.forEach(O=>{D.push({startNode:w.value,endNode:t.value[O],stroke:Ne(w.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),v.value!=null&&v.value.state.resources.forEach(O=>{D.push({startNode:v.value,endNode:t.value[O],stroke:"var(--foreground)",strokeWidth:4})}),D.push(...Object.keys(l).map(O=>({startNode:v.value,endNode:t.value[O],stroke:"var(--accent3)",strokeWidth:5}))),b.value!=null&&b.value.state.tools.forEach(O=>{D.push({startNode:b.value,endNode:n.value[O],stroke:Ne(b.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),I.value!=null){const O=I.value.state;O.tier!=null&&D.push({startNode:I.value,endNode:t.value[O.tier],stroke:"var(--foreground)",strokeWidth:4}),O.influences.forEach(W=>{D.push({startNode:I.value,endNode:i.value[W],stroke:"var(--foreground)",strokeWidth:4})}),T.types.portal.nodes.value.forEach(W=>{const oe=we[W.state.id];return oe.links.value.forEach(ge=>{ge.value!=null&&D.push({startNode:W,endNode:ge.value,stroke:Ne(W)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(oe.resourceMultis.value).forEach(ge=>{ge!=="energy"&&ge in t.value&&D.push({startNode:W,endNode:t.value[ge],stroke:Ne(W)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),D})}return A.value!=null&&A.value.state.portals.forEach(O=>{D.push({startNode:A.value,endNode:T.types.portal.nodes.value.find(W=>W.state.id===O),stroke:Ne(A.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),S.value!=null&&S.value.state.portals.forEach(O=>{D.push({startNode:S.value,endNode:T.types.portal.nodes.value.find(W=>W.state.id===O),stroke:"var(--foreground)",strokeWidth:4})}),Object.values(i.value).forEach(O=>{const W=O.state;(W.type==="increaseResources"||W.type==="decreaseResources")&&W.data.forEach(oe=>{D.push({startNode:O,endNode:t.value[oe],stroke:"var(--foreground)",strokeWidth:4})})}),D}})),f=N(()=>m.types.mine.nodes.value[0]),h=N(()=>m.types.factory.nodes.value[0]),w=N(()=>n.value.sand),v=N(()=>n.value.wood),b=N(()=>n.value.coal),I=N(()=>n.value.iron),A=N(()=>n.value.gold),S=N(()=>n.value.platinum),P=[f,w,v,b,A,S];function L(T,D){let O=t.value[T];if(D=o.times(D,sn[T].computedModifier.value),O==null)O={id:Wn(m),position:{...f.value.position},type:"resource",state:{type:T,amount:D}},m.placeInAvailableSpace(O),m.nodes.value.push(O);else{const W=O.state;O.state={...W,amount:o.add(W.amount,D)}}}const le=N(()=>Object.keys(Mt).reduce((T,D)=>T+new o(Wt[D].computedModifier.value).toNumber(),0)),Z=N(()=>{const T={};return m.types.portal.nodes.value.forEach(D=>{if(!Ne(D))return;const W=we[D.state.id].resourceMultis.value;Object.keys(W).forEach(oe=>{T[oe]!=null?T[oe]=o.times(T[oe],W[oe]):T[oe]=W[oe]})}),T}),z=$t(()=>[...cn.map(T=>Oe(()=>({description:()=>`${Ke(T)} (Lv. ${gt(r.value[T])}) (${me(bt.value)}x per level)`,multiplier:()=>o.pow(bt.value,r.value[T]),enabled:()=>{var D,O;return T in t.value&&o.gt((O=(D=t.value[T].state)==null?void 0:D.amount)!=null?O:0,0)}}))),Oe(()=>({multiplier:()=>lt("stone")?4:2,description:()=>(lt("stone")?"Empowered ":"")+Te.stone.name,enabled:()=>n.value.stone!=null})),Oe(()=>({multiplier:()=>{var T;return(T=Z.value.energy)!=null?T:1},description:"Planar Treasures",enabled:()=>{var T;return o.neq((T=Z.value.energy)!=null?T:1,1)}})),gn(()=>({addend:()=>o.pow(100,u.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(u.value,0)}))]),U=N(()=>z.apply(1)),qe=$t(()=>[gn(()=>({addend:()=>lt("unobtainium")?2:1,description:()=>(lt("unobtainium")?"Empowered ":"")+Te.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),et=N(()=>qe.apply(0)),Y=$t(()=>[Oe(()=>({multiplier:()=>lt("dirt")?4:2,description:()=>(lt("dirt")?"Empowered ":"")+Te.dirt.name,enabled:()=>n.value.dirt!=null}))]),Me=N(()=>Y.apply(1)),Xe=$t(()=>[Oe(()=>({multiplier:()=>lt("gravel")?4:2,description:()=>(lt("gravel")?"Empowered ":"")+Te.gravel.name,enabled:()=>n.value.gravel!=null}))]),st=N(()=>Xe.apply(1)),ht=$t(()=>[gn(()=>({addend:()=>lt("copper")?.002:.001,description:()=>(lt("copper")?"Empowered ":"")+Te.copper.name,enabled:()=>n.value.copper!=null}))]),bt=N(()=>ht.apply(1.01)),Wt=Object.keys(Mt).reduce((T,D)=>{const O=$t(()=>[Oe(()=>({multiplier:2,description:"Dowsing",enabled:()=>w.value!=null&&Ne(w.value)&&w.value.state.resources.includes(D)}))]),W=N(()=>O.apply(Mt[D])),oe={title:`${Ke(D)} Drop Rate`,modifier:O,base:Mt[D]};return T[D]={modifier:O,computedModifier:W,section:oe},T},{}),sn=Object.keys(Mt).reduce((T,D)=>{const O=$t(()=>[Oe(()=>({multiplier:()=>{var ge;return(ge=Z.value[D])!=null?ge:1},description:"Planar Treasures",enabled:()=>{var ge;return o.neq((ge=Z.value[D])!=null?ge:1,1)}}))]),W=N(()=>O.apply(1)),oe={title:`${Ke(D)} Gain`,modifier:O};return T[D]={modifier:O,computedModifier:W,section:oe},T},{}),[hi,Jn]=Bn(()=>[{title:"Energy Gain",modifier:z,base:1,unit:"/s"},{title:"Bonus Connections",modifier:qe,base:0}]),[Kn,bi]=Bn(()=>[{title:"Mining Speed",modifier:Y,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:Xe,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:ht,base:1.01,visible:()=>n.value.copper!=null}]),[yi,wi]=Bn(()=>Object.values(Wt).map(T=>T.section)),[_i,kt]=Bn(()=>Object.values(sn).map(T=>T.section)),Ht=Du({general:()=>({display:"General",glowColor(){return Ht.activeTab.value===this.tab?"white":""},tab:hi,energyTabCollapsed:Jn}),mining:()=>({display:"Mine",glowColor(){return Ht.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(n.value).length>0,tab:Kn,miningTabCollapsed:bi}),resources:()=>({display:"Mine Rates",glowColor(){return Ht.activeTab.value===this.tab?"white":""},visibility:()=>w.value!=null,tab:yi,resourcesCollapsed:wi}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return Ht.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(sn).some(T=>o.neq(T.computedModifier.value,1)),tab:_i,resourceGainCollapsed:kt})}),q=V(!1),j=K(()=>p(Ut,{modelValue:q.value,"onUpdate:modelValue":T=>q.value=T},{header:()=>p("h2",null,[x("Modifiers")]),body:()=>Qe(Ht)}));this.on("preUpdate",T=>{if(Object.keys(a).forEach(D=>{a[D]-=T,a[D]<=0&&delete a[D]}),Object.keys(l).forEach(D=>{l[D]-=T,l[D]<=0&&delete l[D]}),Ne(f.value)){const D=o.add(f.value.state.progress,o.times(Me.value,T)),O=D.floor();f.value.state={...f.value.state,progress:o.sub(D,O)};const W=O.div(le.value).floor();W.gt(0)&&cn.forEach(ge=>{L(ge,o.times(new o(Wt[ge].computedModifier.value).toNumber(),W).times(st.value)),a[ge]=.3});const oe=o.sub(O,W).toNumber();for(let ge=0;ge0){let W=o.add(D,T);const oe=o.div(D,d.value).floor();W=o.sub(W,o.times(oe,d.value)),v.value.state={...v.value.state,progress:W},o.gt(oe,0)&&O.forEach(ge=>{L(ge,oe),l[ge]=.3})}}e.value=o.add(e.value,o.times(U.value,T)),o.lt(e.value,0)&&(e.value=0,f.value.state={...f.value.state,powered:!1},mr.warning(p("div",null,[p("h3",null,[x("Ran out of energy!")]),p("div",null,[x("All machines have been turned off.")])])))});const xe=N(()=>{var T,D;return m.selectedAction.value===m.types.brokenFactory.actions[0]?-100:m.selectedAction.value===m.types.factory.actions[1]?o.neg(Te[m.selectedNode.value.state].cost):((T=m.selectedAction.value)==null?void 0:T.id)==="moreConnections"?o.neg(m.selectedAction.value.formula.evaluate(((D=m.selectedNode.value)==null?void 0:D.state).maxConnections)):0}),Tt=dn(g.variable(0).add(e),()=>o.neq(xe.value,0),xe),on=N(()=>{var T;return m.selectedAction.value===an?((T=m.selectedNode.value)==null?void 0:T.state).powered?o.eq(u.value,1)?10:o.pow(100,u.value).div(10).times(.99):o.neg(c.value):0}),tt=dn(g.variable(0).add(U),()=>o.neq(on.value,0),on),Dt=N(()=>m.types.portal.nodes.value.filter(T=>Ne(T)));return dt(Dt,T=>{jt(()=>{Q.tabs=["main",...T.map(D=>D.state.id)]})}),dt(et,(T,D)=>{o.lt(T,D)&&(Fn(T,w,"resources"),Fn(T,v,"resources"),Fn(T,b,"tools"),Fn(T,A,"portals"),Fn(T,S,"portals"))}),{name:"World",board:m,energy:e,modifierTabs:Ht,resourceNodes:t,toolNodes:n,influenceNodes:i,grantResource:L,activePortals:Dt,isEmpowered:lt,nextPowerCost:c,computedBonusConnectionsModifier:et,quarryProgressRequired:d,dropRates:Wt,dowsing:w,empowerer:b,booster:A,upgrader:S,resourceLevels:r,planarMultis:Z,display:K(()=>p(ne,null,[p(li,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[Qe(Tt)])," ",x("energy")]),p("span",{class:"nav-segment"},[x("("),p("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(U.value,0)?"+":"",Qe(tt)]),x("/s)")]),o.gt(u.value,0)?p("span",{class:"nav-segment"},[p("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[gt(u.value)])," ",x("machines powered")]):null,p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>q.value=!0},[x("modifiers")])]),Q.devSpeed===0?p("span",{class:"nav-segment"},[x("Game Paused")]):Q.devSpeed!=null&&Q.devSpeed!==1?p("span",{class:"nav-segment"},[x("Dev Speed: "),me(Q.devSpeed),x("x")]):null]}),Qe(m),Qe(j)]))}}),gf=e=>{var i,r,a,l,u;const t=[C];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(Kr(`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},Zi=V(!1);function mf(e,t){}var vf=Object.freeze(Object.defineProperty({__proto__:null,main:C,getInitialLayers:gf,hasWon:Zi,fixOldSave:mf},Symbol.toStringTag,{value:"Module"}));const Xn=e=>(bn("data-v-4a50ce42"),e=e(),yn(),e),hf={class:"game-over-modal-header"},bf=["src","alt"],yf={class:"game-over-modal-title"},wf=Xn(()=>_("h2",null,"Congratulations!",-1)),_f={key:0},Nf=Xn(()=>_("br",null,null,-1)),Cf=Xn(()=>_("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),kf=Xn(()=>_("br",null,null,-1)),Mf=["href"],Sf=Xn(()=>_("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),If=J({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:l}=fe,u=N(()=>fi(Q.timePlayed)),c=N(()=>Zi.value&&!Q.keepGoing),d=tn(Q,"autosave");function m(){Q.keepGoing=!0}function f(){fn(In())}return(h,w)=>(M(),ee(Ut,{"model-value":s(c)},{header:H(()=>[_("div",hf,[s(n)?(M(),E("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,bf)):B("",!0),_("div",yf,[wf,_("h4",null,"You've beaten "+ae(s(t))+" v"+ae(s(a))+": "+ae(s(l)),1)])])]),body:H(({shown:v})=>[v?(M(),E("div",_f,[_("div",null,"It took you "+ae(s(u))+" to beat the game.",1),Nf,Cf,kf,_("div",null,[_("a",{href:s(r),class:"game-over-modal-discord-link"},[Sf,x(" "+ae(s(i)),1)],8,Mf)]),p(Bt,{title:"Autosave",modelValue:s(d),"onUpdate:modelValue":w[0]||(w[0]=b=>De(d)?d.value=b:null)},null,8,["modelValue"])])):B("",!0)]),footer:H(()=>[_("div",{class:"game-over-footer"},[_("button",{onClick:m,class:"button"},"Keep Going"),_("button",{onClick:f,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var $f=ce(If,[["__scopeId","data-v-4a50ce42"]]);const vi=e=>(bn("data-v-2776d67d"),e=e(),yn(),e),xf=vi(()=>_("div",{class:"nan-modal-header"},[_("h2",null,"NaN value detected!")],-1)),Ef={key:0},Pf=vi(()=>_("br",null,null,-1)),Tf=["href"],Df=vi(()=>_("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Ff=vi(()=>_("br",null,null,-1)),Af={class:"nan-footer"},Of=J({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=fe,i=V(!0),r=V(!0),a=tn(Be,"hasNaN"),l=V(null);dt(a,h=>{h?(i.value=Q.autosave,r.value=Q.devSpeed===0):(Q.autosave=i.value,Q.devSpeed=r.value?0:null)});const u=N(()=>{var h;return(h=Be.NaNPath)==null?void 0:h.join(".")}),c=N(()=>Be.NaNPersistent!=null?Be.NaNPersistent.value:null);function d(){Be.NaNPersistent!=null&&(Be.NaNPersistent.value=new o(0),Be.hasNaN=!1)}function m(){Be.NaNPersistent&&(Be.NaNPersistent.value=new o(1),Be.hasNaN=!1)}function f(){Be.NaNPersistent&&(Be.NaNPersistent.value=new o(NaN),Be.hasNaN=!1)}return(h,w)=>(M(),E(ne,null,[p(Ut,zt({modelValue:s(a),"onUpdate:modelValue":w[4]||(w[4]=v=>De(a)?a.value=v:null)},h.$attrs),{header:H(()=>[xf]),body:H(()=>[_("div",null,[x(' Attempted to assign "'+ae(s(u))+'" to NaN',1),s(c)?(M(),E("span",Ef,ae(" ")+"(previously "+ae(s(me)(s(c)))+")",1)):B("",!0),x(". Auto-saving has been "+ae(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Pf,_("div",null,[_("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Df,x(" "+ae(s(t)||"The Paper Pilot Community"),1)],8,Tf)]),Ff,p(Bt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":w[0]||(w[0]=v=>i.value=v)},null,8,["modelValue"]),s(fe).enablePausing?(M(),ee(Bt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":w[1]||(w[1]=v=>r.value=v)},null,8,["modelValue"])):B("",!0)]),footer:H(()=>[_("div",Af,[_("button",{onClick:w[2]||(w[2]=v=>{var b;return(b=l.value)==null?void 0:b.open()}),class:"button"},"Open Saves Manager"),_("button",{onClick:d,class:"button"},"Set to 0"),_("button",{onClick:m,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(M(),E("button",{key:0,onClick:w[3]||(w[3]=v=>a.value=!1),class:"button"}," Set to previous ")):B("",!0),_("button",{onClick:f,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),p(Or,{ref_key:"savesManager",ref:l},null,512)],64))}});var Rf=ce(Of,[["__scopeId","data-v-2776d67d"]]);const qf={key:0,class:"tpsDisplay"},Vf={key:0,class:"low"},Bf=J({__name:"TPS",setup(e){const t=N(()=>o.div(Be.lastTenTicks.length,Be.lastTenTicks.reduce((a,l)=>a+l,0))),n=V([]);_t(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=N(()=>n.value.reduce((a,l)=>o.max(a,l),0)),r=N(()=>o.sub(t.value,i.value).gt(1));return(a,l)=>s(t).isNan()?B("",!0):(M(),E("div",qf,[x(" TPS: "+ae(s(gt)(s(t)))+" ",1),p(xn,{name:"fade"},{default:H(()=>[s(r)?(M(),E("span",Vf,ae(s(gt)(s(i))),1)):B("",!0)]),_:1})]))}});var Lf=ce(Bf,[["__scopeId","data-v-46a3ed5b"]]);var jf=J({__name:"App",setup(e){const t=fe.useHeader,n=N(()=>wt[re.theme].variables),i=tn(re,"showTPS"),r=N(()=>se(K(()=>p(ne,null,[xs.map(Qe)]))));return(a,l)=>(M(),E(ne,null,[_("div",{id:"modal-root",style:Re(s(n))},null,4),_("div",{class:pe(["app",{useHeader:s(t)}]),style:Re(s(n))},[s(t)?(M(),ee(Rr,{key:0})):B("",!0),p(Wl),s(s(i))?(M(),ee(Lf,{key:1})):B("",!0),p($f),p(Rf),(M(),ee(Ue(s(r))))],6)],64))}});var zf=ce(jf,[["__scopeId","data-v-41d15e5e"]]);function Uf(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e;let u,c,d,m;const f=async(w=!0)=>{await d,w&&(u==null||u.addEventListener("controlling",v=>{v.isUpdate&&window.location.reload()})),await(m==null?void 0:m())};async function h(){if("serviceWorker"in navigator){const{Workbox:w,messageSW:v}=await jn(()=>import("./workbox-window.4a8794bb.js"),[]);m=async()=>{c&&c.waiting&&await v(c.waiting,{type:"SKIP_WAITING"})},u=new w("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",b=>{b.isUpdate||i==null||i()});{const b=()=>{n==null||n()};u.addEventListener("waiting",b),u.addEventListener("externalwaiting",b)}u.register({immediate:t}).then(b=>{c=b,a?a("./sw.js",b):r==null||r(b)}).catch(b=>{l==null||l(b)})}}return d=h(),f}function Gf(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e,u=V(!1),c=V(!1);return{updateServiceWorker:Uf({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=fe.title;window.projInfo=fe;if(fe.id==="")throw new Error("Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json");requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c -Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await Cs();const{globalBus:e}=await jn(()=>Promise.resolve().then(function(){return _s}),void 0),{startGameLoop:t}=await jn(()=>import("./gameLoop.4edcfc7f.js"),["assets/gameLoop.4edcfc7f.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"]),n=window.vue=ba(zf);e.emit("setupVue",n),n.mount("#app"),jt(()=>{const i=di(),{updateServiceWorker:r}=Gf({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,jn as _,Be as a,fe as b,vf as c,We as g,ks as l,Q as p,re as s}; + )`,onMousedown:I=>c(I,h),onTouchstart:I=>c(I,h),onMouseup:I=>d(I,h),onTouchend:$n(I=>d(I,h),["stop"])},[_("circle",{fill:s(de)(h.fillColor,e.node),r:"20","stroke-width":((b=e.selectedAction)==null?void 0:b.id)===h.id?4:0,stroke:s(a)},null,8,Ql),_("text",{fill:s(l),class:"material-icons"},ae(s(de)(h.icon,e.node)),9,eu)],42,Kl)}),128))])):B("",!0)]),_:1}))}});var nu=ce(tu,[["__scopeId","data-v-9efb2a56"]]);const iu=["transform"],ru={key:0},au=["r","fill","stroke"],su=["r","fill","stroke"],ou=["r","fill"],lu=["r","stroke-dasharray","stroke-dashoffset","stroke"],uu={key:1,transform:"rotate(45, 0, 0)"},cu=["width","height","transform","fill","stroke"],du=["width","height","transform","fill","stroke"],fu=["width","height","transform","fill"],pu=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],gu=["fill","y"],mu=["fill"],vu={key:0},hu=["fill","y"],bu=["fill","y"],yu=J({__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=N(()=>s(r.selectedNode)===s(r.node)),l=N(()=>de(r.nodeType.value.draggable,s(r.node)));dt(l,Y=>{const Me=s(r.node);s(r.dragging)===Me&&!Y&&t("endDragging",Me)});const u=N(()=>{var Me;const Y=s(r.node);return(Me=de(r.nodeType.value.actions,Y))==null?void 0:Me.filter(Xe=>Le(de(Xe.visibility,Y)))}),c=N(()=>{var Me;const Y=s(r.node);if(de(r.nodeType.value.draggable,Y)&&((Me=s(r.dragging))==null?void 0:Me.id)===Y.id&&s(r.dragged)!=null){const{x:Xe,y:st}=s(r.dragged);return{x:Y.position.x+Math.round(Xe/25)*25,y:Y.position.y+Math.round(st/25)*25}}return Y.position}),d=N(()=>de(r.nodeType.value.shape,s(r.node))),m=N(()=>de(r.nodeType.value.title,s(r.node))),f=N(()=>de(r.nodeType.value.subtitle,s(r.node))),h=N(()=>{var Y;return(Y=a.value?s(r.selectedAction)&&de(s(r.selectedAction).tooltip,s(r.node)):null)!=null?Y:de(r.nodeType.value.label,s(r.node))}),w=N(()=>{var Y,Me;return de((Me=(Y=s(r.selectedAction))==null?void 0:Y.confirmationLabel)!=null?Me:{text:"Tap again to confirm"},s(r.node))}),v=N(()=>de(r.nodeType.value.size,s(r.node))),b=N(()=>{var Y;return(Y=de(r.nodeType.value.progress,s(r.node)))!=null?Y:0}),I=N(()=>wt[re.theme].variables["--background"]),A=N(()=>{var Y;return(Y=de(r.nodeType.value.outlineColor,s(r.node)))!=null?Y:wt[re.theme].variables["--outline"]}),S=N(()=>{var Y;return(Y=de(r.nodeType.value.fillColor,s(r.node)))!=null?Y:wt[re.theme].variables["--raised-background"]}),P=N(()=>de(r.nodeType.value.progressColor,s(r.node))),L=N(()=>{var Y;return(Y=de(r.nodeType.value.titleColor,s(r.node)))!=null?Y:wt[re.theme].variables["--foreground"]}),le=N(()=>de(r.nodeType.value.progressDisplay,s(r.node))),Z=N(()=>r.dragging.value!=null&&s(r.hasDragged)&&de(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),z=N(()=>de(r.nodeType.value.style,s(r.node))),U=N(()=>de(r.nodeType.value.classes,s(r.node)));function qe(Y){t("mouseDown",Y,r.node.value,l.value)}function et(Y){var Me,Xe,st;(Me=r.hasDragged)!=null&&Me.value||(t("endDragging",r.node.value),(st=(Xe=r.nodeType.value).onClick)==null||st.call(Xe,r.node.value),Y.stopPropagation())}return(Y,Me)=>{var Xe,st,ht;return M(),E("g",{class:pe(["boardnode",{[e.node.type]:!0,isSelected:s(a),isDraggable:s(l),...s(U)}]),style:Re([{opacity:((Xe=e.dragging)==null?void 0:Xe.id)===e.node.id&&e.hasDragged?.5:1},(st=s(z))!=null?st:[]]),transform:`translate(${s(c).x},${s(c).y})${s(a)?" scale(1.2)":""}`},[p(nu,{actions:(ht=s(u))!=null?ht:[],"is-selected":s(a),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:Me[0]||(Me[0]=bt=>t("clickAction",bt))},null,8,["actions","is-selected","node","node-type","selected-action"]),_("g",{class:"node-container",onMousedown:qe,onTouchstartPassive:qe,onMouseup:et,onTouchendPassive:et},[s(d)===s(Ge).Circle?(M(),E("g",ru,[s(Z)?(M(),E("circle",{key:0,class:"receiver",r:s(v)+8,fill:s(I),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,au)):B("",!0),_("circle",{class:"body",r:s(v),fill:s(S),stroke:s(A),"stroke-width":4},null,8,su),s(le)===s(hn).Fill?(M(),E("circle",{key:1,class:"progress progressFill",r:Math.max(s(v)*s(b)-2,0),fill:s(P)},null,8,ou)):(M(),E("circle",{key:2,r:s(v)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(v)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(v)+4.5)*2*Math.PI-s(b)*(s(v)+4.5)*2*Math.PI,stroke:s(P)},null,8,lu))])):s(d)===s(Ge).Diamond?(M(),E("g",uu,[s(Z)?(M(),E("rect",{key:0,class:"receiver",width:s(v)*s(i)+16,height:s(v)*s(i)+16,transform:`translate(${-(s(v)*s(i)+16)/2}, ${-(s(v)*s(i)+16)/2})`,fill:s(I),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,cu)):B("",!0),_("rect",{class:"body",width:s(v)*s(i),height:s(v)*s(i),transform:`translate(${-s(v)*s(i)/2}, ${-s(v)*s(i)/2})`,fill:s(S),stroke:s(A),"stroke-width":4},null,8,du),s(le)===s(hn).Fill?(M(),E("rect",{key:1,class:"progress progressFill",width:Math.max(s(v)*s(i)*s(b)-2,0),height:Math.max(s(v)*s(i)*s(b)-2,0),transform:`translate(${-Math.max(s(v)*s(i)*s(b)-2,0)/2}, ${-Math.max(s(v)*s(i)*s(b)-2,0)/2})`,fill:s(P)},null,8,fu)):(M(),E("rect",{key:2,class:"progress progressDiamond",width:s(v)*s(i)+9,height:s(v)*s(i)+9,transform:`translate(${-(s(v)*s(i)+9)/2}, ${-(s(v)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(v)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(v)*s(i)+9)*4-s(b)*(s(v)*s(i)+9)*4,stroke:s(P)},null,8,pu))])):B("",!0),_("text",{fill:s(L),class:"node-title",y:s(f)?10:0},ae(s(m)),9,gu),s(f)?(M(),E("text",{key:2,fill:s(L),class:"node-subtitle",y:"-15"},ae(s(f)),9,mu)):B("",!0)],32),p(xn,{name:"fade",appear:""},{default:H(()=>{var bt;return[s(h)?(M(),E("g",vu,[_("text",{fill:(bt=s(h).color)!=null?bt:s(L),class:pe(["node-title",{pulsing:s(h).pulsing}]),y:-s(v)-20},ae(s(h).text),11,hu)])):B("",!0)]}),_:1}),p(xn,{name:"fade",appear:""},{default:H(()=>{var bt;return[s(a)&&e.selectedAction?(M(),E("text",{key:0,fill:(bt=s(w).color)!=null?bt:s(L),class:pe(["node-title",{pulsing:s(w).pulsing}]),y:s(v)+75},ae(s(w).text),11,bu)):B("",!0)]}),_:1})],14,iu)}}});var wu=ce(yu,[["__scopeId","data-v-4654be02"]]);const _u={class:"stage",width:"100%",height:"100%"},Nu={class:"g1"},Cu=J({__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=V({x:0,y:0}),r=V({x:0,y:0}),a=V(!1),l=V(null),u=N(()=>{const w=n.nodes.value.slice();if(n.draggingNode.value){const v=w.splice(w.indexOf(n.draggingNode.value),1)[0];w.push(v)}return w});_t(()=>{const w=n.draggingNode.value;if(w==null)return null;const v={x:w.position.x+r.value.x,y:w.position.y+r.value.y};let b=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((I,A)=>{if(A.id===w.id)return I;const S=n.types.value[A.type];if(!de(S.canAccept,A,w))return I;const L=Math.pow(v.x-A.position.x,2)+Math.pow(v.y-A.position.y,2);let le=de(S.size,A);return L>b||L>le*le?I:(b=L,A)},null))});function c(w){w.setTransformOrigin(null),w.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function d(w,v=null,b=!1){if(n.draggingNode.value==null){w.preventDefault(),w.stopPropagation();let I,A;if("touches"in w)if(w.touches.length===1)I=w.touches[0].clientX,A=w.touches[0].clientY;else return;else I=w.clientX,A=w.clientY;i.value={x:I,y:A},r.value={x:0,y:0},a.value=!1,b&&n.setDraggingNode.value(v)}v!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function m(w){const{x:v,y:b,scale:I}=l.value.panZoomInstance.getTransform();let A,S;if("touches"in w)if(w.touches.length===1)A=w.touches[0].clientX,S=w.touches[0].clientY;else{f(n.draggingNode.value),n.mousePosition.value=null;return}else A=w.clientX,S=w.clientY;n.mousePosition.value={x:(A-v)/I,y:(S-b)/I},r.value={x:r.value.x+(A-i.value.x)/I,y:r.value.y+(S-i.value.y)/I},i.value={x:A,y:S},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(w.preventDefault(),w.stopPropagation())}function f(w,v=!1){var b,I;if(n.draggingNode.value!=null&&n.draggingNode.value===w){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 A=n.nodes.value;A.push(A.splice(A.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((I=(b=n.types.value[n.receivingNode.value.type]).onDrop)==null||I.call(b,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!v&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(w,v){n.state.value.selectedAction===v?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:v}}return(w,v)=>{const b=Ct("panZoom");return s(Le)(e.visibility)?(M(),ee(b,{key:0,style:Re([{width:e.width,height:e.height},e.style]),class:pe(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:l,onInit:c,onMousemove:m,onTouchmove:m,onMousedown:v[0]||(v[0]=I=>d(I)),onTouchstart:v[1]||(v[1]=I=>d(I)),onMouseup:v[2]||(v[2]=()=>f(s(e.draggingNode))),onTouchendPassive:v[3]||(v[3]=()=>f(s(e.draggingNode))),onMouseleave:v[4]||(v[4]=()=>f(s(e.draggingNode),!0))},{default:H(()=>[(M(),E("svg",_u,[_("g",Nu,[p(tr,{name:"link",appear:""},{default:H(()=>[(M(!0),E(ne,null,En(s(e.links)||[],I=>(M(),E("g",{key:`${I.startNode.id}-${I.endNode.id}`},[p(Xl,{link:I},null,8,["link"])]))),128))]),_:1}),p(tr,{name:"grow",duration:500,appear:""},{default:H(()=>[(M(!0),E(ne,null,En(s(u),I=>{var A;return M(),E("g",{key:I.id,style:{"transition-duration":"0s"}},[p(wu,{node:I,nodeType:e.types[I.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===I?r.value:void 0,hasDragged:a.value,receivingNode:((A=s(e.receivingNode))==null?void 0:A.id)===I.id,selectedNode:s(e.selectedNode),selectedAction:s(e.selectedAction),onMouseDown:d,onEndDragging:f,onClickAction:S=>h(I,S)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):B("",!0)}}});We.on("setupVue",e=>Na.install(e));const qr=Symbol("Board");var hn=(e=>(e.Outline="Outline",e.Fill="Fill",e))(hn||{}),Ge=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Ge||{});function ku(e){const t=ct({nodes:[],selectedNode:null,selectedAction:null},!1);return He(n=>{const i=e.call(n,n);i.id=rn("board-"),i.type=qr,i[mt]=Cu,i.state?(Pr(t),$(i,"state")):(t[nn]={nodes:i.startNodes().map((u,c)=>(u.id=c,u)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=N(()=>s(l.state).nodes),i.selectedNode=N({get(){return l.nodes.value.find(u=>u.id===s(l.state).selectedNode)||null},set(u){var c,d;De(l.state)?l.state.value={...l.state.value,selectedNode:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedNode=(d=u==null?void 0:u.id)!=null?d:null}}),i.selectedAction=N({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(d=>d.id===s(l.state).selectedAction)||null},set(u){var c,d;De(l.state)?l.state.value={...l.state.value,selectedAction:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedAction=(d=u==null?void 0:u.id)!=null?d:null}}),i.mousePosition=V(null),i.links?$(i,"links"):i.links=N(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?de(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=V(null),i.receivingNode=V(null),$(i,"visibility"),ie(i,"visibility",he.Visible),$(i,"width"),ie(i,"width","100%"),$(i,"height"),ie(i,"height","100%"),$(i,"classes"),$(i,"style");for(const u in i.types){const c=i.types[u];if($(c,"title"),$(c,"subtitle"),$(c,"label"),$(c,"size"),ie(c,"size",50),$(c,"style"),$(c,"classes"),$(c,"draggable"),ie(c,"draggable",!1),$(c,"shape"),ie(c,"shape","Circle"),$(c,"canAccept"),ie(c,"canAccept",!1),$(c,"progress"),$(c,"progressDisplay"),ie(c,"progressDisplay","Fill"),$(c,"progressColor"),ie(c,"progressColor","none"),$(c,"fillColor"),$(c,"outlineColor"),$(c,"titleColor"),$(c,"actionDistance"),ie(c,"actionDistance",Math.PI/6),c.nodes=N(()=>s(l.state).nodes.filter(d=>d.type===u)),ie(c,"onClick",function(d){s(l.state).selectedNode=d.id}),c.actions)for(const d of c.actions)$(d,"visibility"),ie(d,"visibility",he.Visible),$(d,"icon"),$(d,"fillColor"),$(d,"tooltip"),$(d,"confirmationLabel"),ie(d,"confirmationLabel",{text:"Tap again to confirm"}),$(d,"links")}function r(u){i.draggingNode.value=u}function a(u){i.receivingNode.value=u}i.placeInAvailableSpace=function(u,c=100,d=G.Right){const m=l.nodes.value.slice().filter(f=>f===u||(d===G.Down||d===G.Up)&&Math.abs(f.position.x-u.position.x)>c||(d===G.Left||d===G.Right)&&Math.abs(f.position.y-u.position.y)>c?!1:!(d===G.Right&&f.position.xu.position.x+c||d===G.Up&&f.position.y>u.position.y+c||d===G.Down&&f.position.yf.position.x-h.position.x:d===G.Left?(f,h)=>h.position.x-f.position.x:d===G.Up?(f,h)=>h.position.y-f.position.y:(f,h)=>f.position.y-h.position.y);for(let f=0;f0&&w>c)break}},i[at]=function(){const{nodes:u,types:c,state:d,visibility:m,width:f,height:h,style:w,classes:v,links:b,selectedAction:I,selectedNode:A,mousePosition:S,draggingNode:P,receivingNode:L}=this;return{nodes:u,types:c,state:d,visibility:m,width:f,height:h,style:s(w),classes:v,links:b,selectedAction:I,selectedNode:A,mousePosition:S,draggingNode:P,receivingNode:L,setDraggingNode:r,setReceivingNode:a}};const l=i;return l})}function de(e,t,...n){return zn(e)?e(t,...n):s(e)}function Wn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const qn={};We.on("addLayer",e=>{const t=ai(e,qr);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)}))})})});We.on("removeLayer",e=>{var t;(t=qn[e.id])==null||t.call(qn),qn[e.id]=void 0});function Mn(e,t="points",n=0,i=void 0){const r=De(e)?e:ct(e);if(r.displayName=t,r.precision=n,r.small=i,!De(e)){const a=r[xt];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)?gt(e.small?n:o.floor(n)):me(n,e.precision,e.small)}We.on("setupVue",e=>e.use(Ca));function Mu(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 Su=J({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=xr(n),l=N(()=>{const c=Ce(i);return c==null||c===""?{}:s(r)?Mu(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:a,glowColorStyle:l,unref:s,Visibility:he,isVisible:Le,isHidden:wn}}});function Iu(e,t,n,i,r,a){var l;return e.isVisible(e.visibility)?(M(),E("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:pe(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(M(),ee(Ue(e.component)))],6)):B("",!0)}var Vr=ce(Su,[["render",Iu],["__scopeId","data-v-21427abb"]]);const $u=J({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:Vr},setup(e){const{activeTab:t}=$e(e),n=N(()=>wt[re.theme].floatingTabs),i=ft("");_t(()=>{const u=Ce(t);if(u==null){i.value="";return}if(St(u)){i.value=se(u);return}i.value=se(s(u.display))});const r=N(()=>{const u=Ce(t);return St(u)||!u?void 0:s(u.classes)}),a=N(()=>{const u=Ce(t);return St(u)||!u?void 0:s(u.style)});function l(u){const{display:c,style:d,classes:m,glowColor:f,visibility:h}=u;return{display:c,style:s(d),classes:m,glowColor:f,visibility:h}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:he,component:i,gatherButtonProps:l,unref:s,isVisible:Le,isHidden:wn}}});function xu(e,t,n,i,r,a){var c,d;const l=Ct("TabButton"),u=Ct("Sticky");return e.isVisible(e.visibility)?(M(),E("div",{key:0,class:pe(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[p(u,{class:pe(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Re(e.unref(e.buttonContainerStyle))},{default:H(()=>[_("div",{class:pe(["tab-buttons",{floating:e.floating}])},[(M(!0),E(ne,null,En(e.unref(e.tabs),(m,f)=>(M(),ee(l,zt({onSelectTab:h=>e.selected.value=f,floating:e.floating,key:f,active:e.unref(m.tab)===e.unref(e.activeTab)},e.gatherButtonProps(m)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(M(),ee(Ue(e.unref(e.component)),{key:0})):B("",!0)],6)):B("",!0)}var Eu=ce($u,[["render",xu],["__scopeId","data-v-58dbf83a"]]);const Pu=Symbol("TabButton"),Tu=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=ct(Object.keys(e)[0],!1);return He(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=rn("tabFamily-"),r.type=Tu,r[mt]=Eu,r.tabs=Object.keys(e).reduce((u,c)=>{const d=e[c]();return d.type=Pu,d[mt]=Vr,$(d,"visibility"),ie(d,"visibility",he.Visible),$(d,"tab"),$(d,"display"),$(d,"classes"),$(d,"style"),$(d,"glowColor"),u[c]=d,u},{}),r.selected=n,r.activeTab=N(()=>{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(d=>Le(d.visibility));return c?s(c.tab):null}),$(r,"visibility"),ie(r,"visibility",he.Visible),$(r,"classes"),$(r,"style"),$(r,"buttonContainerClasses"),$(r,"buttonContainerStyle"),r[at]=function(){const{visibility:u,activeTab:c,selected:d,tabs:m,style:f,classes:h,buttonContainerClasses:w,buttonContainerStyle:v}=this;return{visibility:u,activeTab:c,selected:d,tabs:m,style:s(f),classes:h,buttonContainerClasses:w,buttonContainerStyle:v}};const a=r;return a})}const Br=o.ln(10);function Vn(e){return e}function Fu(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 Au(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return g.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function Ou(e){return g.neg(e)}function Ru(e,t,n){if(F(t))return t.invert(o.sub(e,be(n)));if(F(n))return n.invert(o.sub(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function qu(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 g.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 g.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function Vu(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 g.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 g.add(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.add(e,be(n)));if(F(n))return n.invert(o.sub(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Lu(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 g.sub(a,g.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 g.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function ju(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 g.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 g.sub(i,t)}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.div(e,be(n)));if(F(n))return n.invert(o.div(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function Uu(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 g.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 g.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Gu(e,t,n){if(F(t))return g.div(e,n);if(F(n))return g.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Wu(e,t,n){if(F(t))return t.invert(o.mul(e,be(n)));if(F(n))return n.invert(o.div(be(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 g.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 g.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Zu(e,t,n){if(F(t))return g.mul(e,n);if(F(n))return g.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Yu(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 Xu(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 g.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function Ju(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 Ku(e){return o.ln(e).sub(1).times(e).div(Br)}function Qu(e,t){if(F(t)){const n=Br.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 ec(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:Ku,invert:Qu})}throw new Error("Could not integrate due to no input being a variable")}function tc(e,t,n){if(F(t))return t.invert(o.pow(be(n),e));if(F(n))return n.invert(o.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function nc(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function ic(e,t,n){if(F(t)){const i=o.ln(be(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 rc(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e),n],evaluate:nc,invert:ic})}throw new Error("Could not integrate due to no input being a variable")}function ac(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 sc(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function oc(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 lc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:sc,invert:oc})}throw new Error("Could not integrate due to no input being a variable")}function uc(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 cc(e){return o.ln(e).sub(1).times(e)}function dc(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 fc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:cc,invert:dc})}throw new Error("Could not integrate due to no input being a variable")}function pc(e,t,n){if(F(t))return t.invert(o.root(e,be(n)));if(F(n))return n.invert(o.ln(e).div(o.ln(be(t))));throw new Error("Could not invert due to no input being a variable")}function gc(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=g.add(n,1);return g.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 g.pow(t,i).div(g.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function mc(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 vc(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 g.pow10(n).div(g.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function hc(e,t,n){if(F(t))return t.invert(o.ln(e).div(be(n)));if(F(n))return n.invert(o.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function bc(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 g.pow(n,i).div(g.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=g.add(t,1);return g.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function yc(e,t,n){if(F(t))return t.invert(o.root(e,o.recip(be(n))));if(F(n))return n.invert(o.ln(be(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function wc(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 g.pow(i,g.recip(n).add(1)).times(n).div(g.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function _c(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 Nc(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 g.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function Cc(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function kc(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 Mc(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 Sc(e,t,n,i){if(F(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Ic(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function $c(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function xc(e,t,n){if(F(t))return t.invert(o.tetrate(e,o.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Ec(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function Pc(e,t,n,i){if(F(t))return t.invert(o.layeradd(e,o.minabs(1e308,be(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Tc(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 Dc(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 Fc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function Ac(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 Oc(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 g.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Rc(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 qc(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 g.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function Vc(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 Bc(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 g.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Lc(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 jc(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 g.asin(n).times(n).add(g.sqrt(g.sub(1,g.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function zc(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 Uc(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 g.acos(n).times(n).sub(g.sqrt(g.sub(1,g.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Gc(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 Wc(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 g.atan(n).times(n).sub(g.ln(g.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Hc(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 Zc(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 g.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Yc(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 Xc(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 g.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function Jc(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 Kc(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 g.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function Qc(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 ed(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 g.asinh(n).times(n).sub(g.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function td(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 nd(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 g.acosh(n).times(n).sub(g.add(n,1).sqrt().times(g.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function id(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 rd(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 g.atanh(n).times(n).add(g.sub(1,g.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function Tn(e){return(t,n)=>new g({inputs:[t,n],evaluate:e,invert:Vn})}function F(e){return e instanceof ke&&e.hasVariable()}function be(e,t){return e instanceof ke?e.evaluate(t):s(e)}function ad(){return g.pow(this,2).div(2)}function sd(){return this}const Fe=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"&&xt in n?n[xt]:n)),"variable"in e?(typeof e.variable=="object"&&xt in e.variable&&(e.variable=e.variable[xt]),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:ad,internalIntegrateInner:sd,applySubstitution:Vn}}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 h,w;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:l}=e,u=t.reduce((v,b)=>v+(b instanceof Fe?b.internalVariables:0),0),c=t.find(v=>v instanceof Fe&&v.hasVariable()),d=u===1?c==null?void 0:c.innermostVariable:void 0,m=(h=c==null?void 0:c.isInvertible())!=null?h:!1,f=(w=c==null?void 0:c.isIntegrable())!=null?w:!1;return{inputs:t,internalEvaluate:n,internalInvert:m?i:void 0,internalIntegrate:f?r:void 0,internalIntegrateInner:a,applySubstitution:l,innermostVariable:d,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=>be(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:be(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof Fe&&e.inputs[n]instanceof Fe?t.equals(e.inputs[n]):!(t instanceof Fe)&&!(e.inputs[n]instanceof Fe)&&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 g({inputs:[e]})}static variable(e){return new g({variable:e})}static step(e,t,n){const i=V(0),r=n(g.variable(i)),a=ve(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,d){if(F(d)&&r.isInvertible())return o.gt(c,s(a))&&(c=o.add(r.invert(o.sub(c,s(a))),s(a))),d.invert(c);throw new Error("Could not invert due to no input being a variable")}return new g({inputs:[e],evaluate:l,invert:r.isInvertible()&&r.hasVariable()?u:void 0})}static if(e,t,n,i){const r=V(0),a=g.variable(r),l=n(a),u=i==null?void 0:i(a),c=ve(t);function d(f){return s(c)?(r.value=f,l.evaluate()):u?(r.value=f,u.evaluate()):f}function m(f,h){if(!F(h)||!l.isInvertible()||u!=null&&!u.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?h.invert(l.invert(f)):u?h.invert(u.invert(f)):h.invert(f)}return new g({inputs:[e],evaluate:d,invert:l.isInvertible()&&l.hasVariable()?m:void 0})}static conditional(e,t,n,i){return g.if(e,t,n,i)}static abs(e){return new g({inputs:[e],evaluate:o.abs})}static neg(e){return new g({inputs:[e],evaluate:o.neg,invert:Fu,applySubstitution:Ou,integrate:Au})}static sign(e){return new g({inputs:[e],evaluate:o.sign})}static round(e){return new g({inputs:[e],evaluate:o.round})}static floor(e){return new g({inputs:[e],evaluate:o.floor})}static ceil(e){return new g({inputs:[e],evaluate:o.ceil})}static trunc(e){return new g({inputs:[e],evaluate:o.trunc})}static add(e,t){return new g({inputs:[e,t],evaluate:o.add,invert:Ru,integrate:qu,integrateInner:Vu,applySubstitution:Vn})}static sub(e,t){return new g({inputs:[e,t],evaluate:o.sub,invert:Bu,integrate:Lu,integrateInner:ju,applySubstitution:Vn})}static mul(e,t){return new g({inputs:[e,t],evaluate:o.mul,invert:zu,integrate:Uu,applySubstitution:Gu})}static div(e,t){return new g({inputs:[e,t],evaluate:o.div,invert:Wu,integrate:Hu,applySubstitution:Zu})}static recip(e){return new g({inputs:[e],evaluate:o.recip,invert:Yu,integrate:Xu})}static clamp(e,t,n){return new g({inputs:[e,t,n],evaluate:o.clamp,invert:Vn})}static pLog10(e){return new g({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new g({inputs:[e],evaluate:o.absLog10})}static log10(e){return new g({inputs:[e],evaluate:o.log10,invert:Ju,integrate:ec})}static log(e,t){return new g({inputs:[e,t],evaluate:o.log,invert:tc,integrate:rc})}static log2(e){return new g({inputs:[e],evaluate:o.log2,invert:ac,integrate:lc})}static ln(e){return new g({inputs:[e],evaluate:o.ln,invert:uc,integrate:fc})}static pow(e,t){return new g({inputs:[e,t],evaluate:o.pow,invert:pc,integrate:gc})}static pow10(e){return new g({inputs:[e],evaluate:o.pow10,invert:mc,integrate:vc})}static pow_base(e,t){return new g({inputs:[e,t],evaluate:o.pow_base,invert:hc,integrate:bc})}static root(e,t){return new g({inputs:[e,t],evaluate:o.root,invert:yc,integrate:wc})}static factorial(e){return new g({inputs:[e],evaluate:o.factorial})}static gamma(e){return new g({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new g({inputs:[e],evaluate:o.lngamma})}static exp(e){return new g({inputs:[e],evaluate:o.exp,invert:_c,integrate:Nc})}static sqr(e){return g.pow(e,2)}static sqrt(e){return g.root(e,2)}static cube(e){return g.pow(e,3)}static cbrt(e){return g.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Cc,invert:kc})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Mc,invert:Sc})}static iteratedlog(e,t=10,n=1){return new g({inputs:[e,t,n],evaluate:Ic})}static slog(e,t=10){return new g({inputs:[e,t],evaluate:$c,invert:xc})}static layeradd10(e,t){return new g({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new g({inputs:[e,t,n],evaluate:Ec,invert:Pc})}static lambertw(e){return new g({inputs:[e],evaluate:o.lambertw,invert:Tc})}static ssqrt(e){return new g({inputs:[e],evaluate:o.ssqrt,invert:Dc})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Fc})}static sin(e){return new g({inputs:[e],evaluate:o.sin,invert:Lc,integrate:Oc})}static cos(e){return new g({inputs:[e],evaluate:o.cos,invert:zc,integrate:qc})}static tan(e){return new g({inputs:[e],evaluate:o.tan,invert:Gc,integrate:Bc})}static asin(e){return new g({inputs:[e],evaluate:o.asin,invert:Ac,integrate:jc})}static acos(e){return new g({inputs:[e],evaluate:o.acos,invert:Rc,integrate:Uc})}static atan(e){return new g({inputs:[e],evaluate:o.atan,invert:Vc,integrate:Wc})}static sinh(e){return new g({inputs:[e],evaluate:o.sinh,invert:Qc,integrate:Zc})}static cosh(e){return new g({inputs:[e],evaluate:o.cosh,invert:td,integrate:Xc})}static tanh(e){return new g({inputs:[e],evaluate:o.tanh,invert:id,integrate:Kc})}static asinh(e){return new g({inputs:[e],evaluate:o.asinh,invert:Hc,integrate:ed})}static acosh(e){return new g({inputs:[e],evaluate:o.acosh,invert:Yc,integrate:nd})}static atanh(e){return new g({inputs:[e],evaluate:o.atanh,invert:Jc,integrate:rd})}step(e,t){return g.step(this,e,t)}if(e,t){return g.if(this,e,t)}conditional(e,t){return g.if(this,e,t)}abs(){return g.abs(this)}neg(){return g.neg(this)}sign(){return g.sign(this)}round(){return g.round(this)}floor(){return g.floor(this)}ceil(){return g.ceil(this)}trunc(){return g.trunc(this)}add(e){return g.add(this,e)}sub(e){return g.sub(this,e)}mul(e){return g.mul(this,e)}div(e){return g.div(this,e)}recip(){return g.recip(this)}max(e){return g.max(this,e)}min(e){return g.min(this,e)}maxabs(e){return g.maxabs(this,e)}minabs(e){return g.minabs(this,e)}clamp(e,t){return g.clamp(this,e,t)}clampMin(e){return g.clampMin(this,e)}clampMax(e){return g.clampMax(this,e)}pLog10(){return g.pLog10(this)}absLog10(){return g.absLog10(this)}log10(){return g.log10(this)}log(e){return g.log(this,e)}log2(){return g.log2(this)}ln(){return g.ln(this)}pow(e){return g.pow(this,e)}pow10(){return g.pow10(this)}pow_base(e){return g.pow_base(this,e)}root(e){return g.root(this,e)}factorial(){return g.factorial(this)}gamma(){return g.gamma(this)}lngamma(){return g.lngamma(this)}exp(){return g.exp(this)}sqr(){return g.pow(this,2)}sqrt(){return g.root(this,2)}cube(){return g.pow(this,3)}cbrt(){return g.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return g.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return g.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return g.iteratedlog(this,e,t)}slog(e=10){return g.slog(this,e)}layeradd10(e){return g.layeradd10(this,e)}layeradd(e,t){return g.layeradd(this,e,t)}lambertw(){return g.lambertw(this)}ssqrt(){return g.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return g.pentate(this,e,t)}sin(){return g.sin(this)}cos(){return g.cos(this)}tan(){return g.tan(this)}asin(){return g.asin(this)}acos(){return g.acos(this)}atan(){return g.atan(this)}sinh(){return g.sinh(this)}cosh(){return g.cosh(this)}tanh(){return g.tanh(this)}asinh(){return g.asinh(this)}acosh(){return g.acosh(this)}atanh(){return g.atanh(this)}};let ke=Fe;ke.negate=Fe.neg;ke.negated=Fe.neg;ke.sgn=Fe.sign;ke.plus=Fe.add;ke.subtract=Fe.sub;ke.minus=Fe.sub;ke.multiply=Fe.mul;ke.times=Fe.mul;ke.divide=Fe.div;ke.divideBy=Fe.div;ke.dividedBy=Fe.div;ke.reciprocal=Fe.recip;ke.reciprocate=Fe.recip;ke.max=Tn(o.max);ke.min=Tn(o.min);ke.minabs=Tn(o.minabs);ke.maxabs=Tn(o.maxabs);ke.clampMin=Tn(o.clampMin);ke.clampMax=Tn(o.clampMax);ke.logarithm=Fe.log;class g extends ke{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 Lr(e,t,n=!0,i,r=o.dInf){const a=ve(n),l=ve(i),u=ve(r);return N(()=>{var h,w,v,b;const c=s(u);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const d=s(a),m=(h=s(l))!=null?h:d?10:0;let f=0;if(o.gt(c,m)){if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum");if(d){if(!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");f=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((w=s(e.innermostVariable))!=null?w:0)}else f=o.floor(e.invert(t.value))}if(f=o.clampMax(f,c),m>0){f=o.sub(f,m).clampMin(0);let I;for(d?I=Lt(e,f,!0,0):I=e.evaluate(o.add((v=s(e.innermostVariable))!=null?v:0,f));o.lt(f,c)&&o.lt(f,Number.MAX_SAFE_INTEGER);){const A=e.evaluate(f.add((b=s(e.innermostVariable))!=null?b:0));if(o.add(I,A).lte(t.value))f=f.add(1),I=o.add(I,A);else break}}return f})}function Lt(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 d=a.toNumber();d{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.add(d,s(l)),invert:d=>o.sub(d,s(l)),getFormula:d=>g.add(d,l),enabled:c,description:i==null?void 0:K(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[Nt(s(u))]):null,p("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)?"+":"",Qt(s(l))])]))}})}function Oe(e){return He(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.times(d,s(l)),invert:d=>o.div(d,s(l)),getFormula:d=>g.times(d,l),enabled:c,description:i==null?void 0:K(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[Nt(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[x("\xD7"),Qt(s(l))])]))}})}function Ii(e){return He(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:l}=e.call(t,t),u=ve(n),c=ve(i),d=r==null?void 0:ve(r);return{apply:m=>{let f=m;return a&&(f=o.add(f,1)),f=o.pow(f,s(u)),a&&(f=o.sub(f,1)),f},invert:m=>{let f=m;return a&&(f=o.add(f,1)),f=o.root(f,s(u)),a&&(f=o.sub(f,1)),f},getFormula:m=>a?g.add(m,1).pow(u).sub(1):g.pow(m,u),enabled:d,description:i==null?void 0:K(()=>p("div",{class:"modifier-container"},[s(c)!=null?p("span",{class:"modifier-description"},[Nt(s(c)),a?" (+1 effective)":null]):null,p("span",{class:"modifier-amount",style:(l===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[x("^"),Qt(s(u))])]))}})}function $t(e){return He(()=>{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)?N(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?K(()=>p(ne,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(Nt)])):void 0}})}const Ln=g.variable(0).add(1),pi={id:"deselect",icon:"close",tooltip:e=>({text:"tools"in e.state?"Disconnect tools":"Disconnect resources"}),onClick(e){var t;Array.isArray((t=e.state)==null?void 0:t.data)?e.state={...e.state,data:[]}:"resources"in e.state?e.state={...e.state,resources:[]}:"tools"in e.state&&(e.state={...e.state,tools:[]}),C.board.selectedAction.value=null,C.board.selectedNode.value=null},visibility:e=>{var t;return Array.isArray((t=e.state)==null?void 0:t.data)?e.state.data.length>0:"resources"in e.state?e.state.resources.length>0:"tools"in e.state?e.state.tools.length>0:!1}},an={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${gt(C.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},C.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function Hn(e,t=1/0){const n=e(g.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(i){return{text:`Increase Connections - ${gt(n.evaluate(i.state.maxConnections))} energy`}},confirmationLabel:i=>o.gte(C.energy.value,n.evaluate(i.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(i){const r=n.evaluate(i.state.maxConnections);o.gte(C.energy.value,r)&&(C.energy.value=o.sub(C.energy.value,r)),i.state={...i.state,maxConnections:o.add(i.state.maxConnections,1)},C.board.selectedAction.value=null},visibility:i=>o.add(i.state.maxConnections,C.computedBonusConnectionsModifier.value).lt(t)}}function jr(e,t){var n,i;if(((n=C.board.draggingNode.value)==null?void 0:n.type)==="resource"){const r=((i=C.board.draggingNode.value)==null?void 0:i.state).type,{maxConnections:a,resources:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,C.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function od(e,t){var n,i;if(((n=C.board.draggingNode.value)==null?void 0:n.type)==="passive"){const r=(i=C.board.draggingNode.value)==null?void 0:i.state,{maxConnections:a,tools:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,C.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function zr(e,t){var n,i;if(((n=C.board.draggingNode.value)==null?void 0:n.type)==="portal"){const r=((i=C.board.draggingNode.value)==null?void 0:i.state).id,{maxConnections:a,portals:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,C.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Ur(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:i,resources:r}=e.state;return r.includes(n)?!0:!o.add(i,C.computedBonusConnectionsModifier.value).lte(r.length)}function Gr(e,t){if(t.type!=="resource")return;const n=t.state.type,i=e.state.resources;i.includes(n)?e.state={...e.state,resources:i.filter(r=>r!==n)}:e.state={...e.state,resources:[...i,n]},C.board.selectedNode.value=e}function ld(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:i,tools:r}=e.state;return r.includes(n)?!0:!o.add(i,C.computedBonusConnectionsModifier.value).lte(r.length)}function ud(e,t){if(t.type!=="passive")return;const n=t.state,i=e.state.tools;i.includes(n)?e.state={...e.state,tools:i.filter(r=>r!==n)}:e.state={...e.state,tools:[...i,n]},C.board.selectedNode.value=e}function Wr(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:i,portals:r}=e.state;return r.includes(n)?!0:!o.add(i,C.computedBonusConnectionsModifier.value).lte(r.length)}function Hr(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:i}=e.state;i.includes(n)?e.state={...e.state,portals:i.filter(r=>r!==n)}:e.state={...e.state,portals:[...i,n]},C.board.selectedNode.value=e}function Ne(e){return e===C.board.selectedNode.value||e.state.powered}function lt(e){return C.empowerer.value!=null&&Ne(C.empowerer.value)&&C.empowerer.value.state.tools.includes(e)}function cd(e){var a,l,u;const t=(u=(l=(a=C.resourceNodes.value[e])==null?void 0:a.state)==null?void 0:l.amount)!=null?u:0,n=C.resourceLevels.value[e],i=Lt(Ln,n,!0),r=Lt(Ln,o.add(n,1),!0);return o.sub(t,i).max(0).div(o.sub(r,i)).toNumber()}function Fn(e,t,n){if(t.value){const i=t.value.state,r=i[n],a=i.maxConnections;o.lt(r.length,o.add(a,e))&&(t.value.state={...t.value.state,[n]:r.slice(0,o.add(a,e).toNumber())})}}const dd={key:0},fd={key:0,class:"mark star"},pd=["src"],gd=J({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(M(),E("div",dd,[e.mark===!0?(M(),E("div",fd)):(M(),E("img",{key:1,class:"mark",src:e.mark},null,8,pd))])):B("",!0)}});var Zn=ce(gd,[["__scopeId","data-v-2207999f"]]);const md=J({__name:"Node",props:{id:null},setup(e){const n=$e(e),i=ii(qi,()=>{}),r=ii(Vi,()=>{}),a=ft(null),l=N(()=>a.value&&a.value.parentElement);return dt([l,n.id],([u,c],[d,m])=>{d&&r(s(m)),u&&i(c,u)}),vr(()=>r(s(n.id))),(u,c)=>(M(),E("div",{class:"node",ref_key:"node",ref:a},null,512))}});var Yn=ce(md,[["__scopeId","data-v-a48cb382"]]),vd=J({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:Yn,MarkNode:Zn},setup(e){const{display:t,onClick:n,onHold:i}=$e(e),r=ft("");_t(()=>{var m;const u=Ce(t);if(u==null){r.value="";return}if(St(u)){r.value=se(u);return}const c=se((m=u.title)!=null?m:"","h3"),d=se(u.description,"div");r.value=se(K(()=>p("span",null,[u.title!=null?p("div",null,[p(c,null,null)]):null,p(d,null,null)])))});const{start:a,stop:l}=$r(n,i);return{start:a,stop:l,comp:r,Visibility:he,isVisible:Le,isHidden:wn,unref:s}}});function hd(e,t,n,i,r,a){var c;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(M(),E("button",{key:0,style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:pe({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)?(M(),ee(Ue(e.unref(e.comp)),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],38)):B("",!0)}var Zr=ce(vd,[["render",hd],["__scopeId","data-v-211328c0"]]);const bd=Symbol("Clickable");function yd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return He(i=>{var l,u,c;const r=(l=e==null?void 0:e.call(i,i))!=null?l:{};r.id=rn("clickable-"),r.type=bd,r[mt]=Zr;for(const d of t)(u=d.preConstruct)==null||u.call(d,r);if(Object.assign(r,n),$(r,"visibility"),ie(r,"visibility",he.Visible),$(r,"canClick"),ie(r,"canClick",!0),$(r,"classes"),$(r,"style"),$(r,"mark"),$(r,"display"),r.onClick){const d=r.onClick.bind(r);r.onClick=function(m){s(r.canClick)!==!1&&d(m)}}if(r.onHold){const d=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&d()}}for(const d of t)(c=d.postConstruct)==null||c.call(d,r);const a=t.reduce((d,m)=>{var f;return Object.assign(d,(f=m.getGatheredProps)==null?void 0:f.call(m,r))},{});return r[at]=function(){const{display:d,visibility:m,style:f,classes:h,onClick:w,onHold:v,canClick:b,small:I,mark:A,id:S}=this;return{display:d,visibility:m,style:s(f),classes:h,onClick:w,onHold:v,canClick:b,small:I,mark:A,id:S,...a}},r})}const wd=["x1","y1","x2","y2"],_d=J({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=$e(e),i=N(()=>{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=N(()=>{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)=>(M(),E("line",zt({"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,wd))}});const Nd=J({__name:"Links",props:{links:null},setup(e){var c;const n=tn(e,"links"),i=V(null),r=ii(Bi,V({})),a=ii(Li,V(void 0)),l=V((c=i.value)==null?void 0:c.getBoundingClientRect());dt(a,()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),ci(()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const u=N(()=>{var m,f;const d=r.value;return(f=(m=n.value)==null?void 0:m.filter(h=>{var w,v;return((w=d[h.startNode.id])==null?void 0:w.rect)&&((v=d[h.startNode.id])==null?void 0:v.rect)}))!=null?f:[]});return(d,m)=>(M(),E(ne,null,[s(u)?(M(),E("svg",va(zt({key:0},d.$attrs)),[(M(!0),E(ne,null,En(s(u),(f,h)=>(M(),ee(_d,{key:h,link:f,boundingRect:l.value,startNode:s(r)[f.startNode.id],endNode:s(r)[f.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):B("",!0),_("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Cd=ce(Nd,[["__scopeId","data-v-063f6d6b"]]);J({props:{nodes:{type:R(Array),required:!0},leftSideNodes:R(Array),rightSideNodes:R(Array),branches:R(Array)},components:{Links:Cd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=$e(e),r=ft();_t(()=>{const u=Ce(t);r.value=se(K(()=>p(ne,null,[u.map(c=>p("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(Nt)]))])))});const a=ft();_t(()=>{const u=Ce(n);a.value=u?se(K(()=>p("span",{class:"left-side-nodes small"},[u.map(Nt)]))):""});const l=ft();return _t(()=>{const u=Ce(i);l.value=u?se(K(()=>p("span",{class:"side-nodes small"},[u.map(Nt)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:l}}});J({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:Zn,Node:Yn},setup(e){const{onClick:t,onHold:n,display:i}=$e(e),r=Pn(i),{start:a,stop:l}=$r(t,n);return{start:a,stop:l,comp:r,unref:s,Visibility:he,isCoercableComponent:St,isVisible:Le,isHidden:wn}}});function Bn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(u=>ve(u.base)),n.baseText=t.map(u=>ve(u.baseText)),n.visible=t.map(u=>ve(u.visible)),n.title=t.map(u=>ve(u.title)),n.subtitle=t.map(u=>ve(u.subtitle)),i=!0),t}const a=ct({},!1);return[K(()=>{const u=r();let c=!0;const d=u.map((m,f)=>{var A,S,P;if(s(n.visible[f])===!1)return null;const h=p("h3",{onClick:()=>a.value[f]=!a.value[f],style:"cursor: pointer"},[p("span",{class:"modifier-toggle"+(s(a.value[f])?" collapsed":"")},[x("\u25BC")]),s(n.title[f]),s(n.subtitle[f])!=null?p("span",{class:"subtitle"},[x(" ("),s(n.subtitle[f]),x(")")]):null]),w=s(a.value[f])?null:p(ne,null,[p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[Nt((A=s(n.baseText[f]))!=null?A:"Base")]),p("span",{class:"modifier-amount"},[me((S=s(n.base[f]))!=null?S:1),m.unit])]),m.modifier.description==null?null:Nt(s(m.modifier.description))]),v=!c;c=!1;const b=(P=s(n.base[f]))!=null?P:1,I=m.modifier.apply(b);return p(ne,null,[v?p("br",null,null):null,p("div",{style:{"--unit":re.alignUnits&&m.unit!=null?"'"+m.unit+"'":""}},[h,p("br",null,null),w,p("hr",null,null),p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[x("Total")]),p("span",{class:"modifier-amount",style:(m.smallerIsBetter===!0?o.gt(I,b!=null?b:1):o.lt(I,b!=null?b:1))?"color: var(--danger)":""},[Qt(I),m.unit])])])])});return p(ne,null,[d])}),a]}function $i(e,t,n){const i=ve(t),r=ve(n);return N(()=>{const a=s(i),l=s(r);return o.gte(e.value,l)?"Now":o.lte(a,0)?"Never":fi(o.sub(l,e.value).div(a))})}function dn(e,t,n=1){const i=ve(t),r=ve(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return K(()=>{var a;if(s(i)){const l=Qt(e.evaluate()),u=Qt(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return p(ne,null,[p("b",null,[p("i",null,[l,x(" \u2192 "),u])])])}return p(ne,null,[Qt(e.evaluate())])})}const Mt={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},cn=Object.keys(Mt),Te={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"Artificial Intelligence",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"Machine Learning",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},Fi={dirt:"Replicator",sand:"Metal Detector",gravel:"Neural Networks",wood:"Mining Laser",stone:"BOGO Coupon",coal:"Planar Intelligence",copper:"Efficient Code",iron:"Trade Agreements",silver:"Machine Synergizer",gold:"XP Market",emerald:"Efficient Portals",platinum:"Time Dilation",diamond:"Paypal",berylium:"Tiered Mining",unobtainium:"Overclocked Portals",ultimatum:"Rebates"},kd={dirt:{description:e=>e?"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?"ln(energy) boosts planar speed":"log(energy) boosts planar speed"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},Vt={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}},xi=g.variable(0).add(8).times(2).pow10();const Md=J({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(M(),E("div",{style:Re({width:e.width,height:e.height})},null,4))}});function An(e){return He(t=>{var i;const n=e.call(t,t);return n.partialDisplay=r=>p("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[ui(n.resource,n.cost instanceof g?Lt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=r=>p("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",ui(n.resource,n.cost instanceof g?Lt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),$(n,"visibility"),ie(n,"visibility",he.Visible),$(n,"cost"),$(n,"requiresPay"),ie(n,"requiresPay",!0),$(n,"cumulativeCost"),ie(n,"cumulativeCost",!0),$(n,"maxBulkAmount"),ie(n,"maxBulkAmount",1),$(n,"directSum"),ie(n,"pay",function(r){const a=n.cost instanceof g?Lt(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=N(()=>{var u;if(!(n.cost instanceof g))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 g?n.requirementMet=Lr(n.cost,n.resource,(i=n.cumulativeCost)!=null?i:!0,n.directSum,n.maxBulkAmount):n.requirementMet=N(()=>o.gte(n.resource.value,s(n.cost))),n})}function Wi(e){return He(()=>({requirementMet:N(()=>Le(e.visibility)),visibility:he.None,requiresPay:!1}))}function Sd(e,t){return He(()=>({requirementMet:ve(e),partialDisplay:t==null?void 0:K(()=>Nt(t)),display:t==null?void 0:K(()=>p(ne,null,[x("Req: "),Nt(t)])),visibility:t==null?he.None:he.Visible,requiresPay:!1}))}function gi(e){if(Pt(e))return e.every(gi);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function Yr(e){if(Pt(e))return e.map(Yr).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(Pt(e)&&(e=e.filter(r=>Le(r.visibility)),e.length===1&&(e=e[0])),Pt(e)){e=e.filter(l=>"partialDisplay"in l);const r=e.filter(l=>s(l.requiresPay)),a=e.filter(l=>!s(l.requiresPay));return p(ne,null,[r.length>0?p("div",null,[x("Costs:")," ",or(r.map(l=>l.partialDisplay(t)),p(ne,null,[x(", ")]))]):null,a.length>0?p("div",null,[x("Requires:")," ",or(a.map(l=>l.partialDisplay(t)),p(ne,null,[x(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:p(ne,null,null)}function Xr(e,t=1){var n;Pt(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 Id=J({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:Yn,MarkNode:Zn},setup(e){const{display:t,requirements:n,earned:i}=$e(e),r=ft("");return _t(()=>{const a=Ce(t);if(a==null){r.value="";return}if(St(a)){r.value=se(a);return}const l=se(a.requirement?a.requirement:K(()=>{var d;return mi((d=Ce(n))!=null?d:[])}),"h3"),u=se(a.effectDisplay||"","b"),c=Ce(i)?se(a.optionsDisplay||"","span"):"";r.value=se(K(()=>p("span",null,[p(l,null,null),a.effectDisplay!=null?p("div",null,[p(u,null,null)]):null,a.optionsDisplay!=null?p("div",{class:"equal-spaced"},[p(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:he,isVisible:Le,isHidden:wn}}});function $d(e,t,n,i,r,a){var c;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(M(),E("div",{key:0,style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:pe({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?(M(),ee(Ue(e.comp),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):B("",!0)}var xd=ce(Id,[["render",$d],["__scopeId","data-v-5673325a"]]);const Ed=di(),Pd=Symbol("Achievement");let Sn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function Td(e,...t){const n=ct(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return He(r=>{var c,d,m;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=rn("achievement-"),a.type=Pd,a[mt]=xd;for(const f of t)(d=f.preConstruct)==null||d.call(f,a);a.earned=n,a.complete=function(){var h,w;n.value=!0;const f=a;if((h=f.onComplete)==null||h.call(f),f.display!=null&&s(f.showPopups)===!0){const v=s(f.display);let b;St(v)?b=se(v):v.requirement!=null?b=se(v.requirement):b=mi((w=f.requirements)!=null?w:[]),Ed.info(p("div",null,[p("h3",null,[x("Achievement earned!")]),p("div",null,[p(b,null,null)])]))}},Object.assign(a,i),$(a,"visibility"),ie(a,"visibility",he.Visible);const l=a.visibility;a.visibility=ha(()=>{const f=s(a.display);switch(re.msDisplay){default:case Sn.All:return s(l);case Sn.Configurable:return s(a.earned)&&!(f!=null&&typeof f=="object"&&"optionsDisplay"in f)?he.None:s(l);case Sn.Incomplete:return s(a.earned)?he.None:s(l);case Sn.None:return he.None}}),$(a,"display"),$(a,"mark"),$(a,"small"),$(a,"image"),$(a,"style"),$(a,"classes"),$(a,"showPopups"),ie(a,"showPopups",!0);for(const f of t)(m=f.postConstruct)==null||m.call(f,a);const u=t.reduce((f,h)=>{var w;return Object.assign(f,(w=h.getGatheredProps)==null?void 0:w.call(h,a))},{});if(a[at]=function(){const{visibility:f,display:h,requirements:w,earned:v,image:b,style:I,classes:A,mark:S,small:P,id:L}=this;return{visibility:f,display:h,requirements:w,earned:v,image:b,style:s(I),classes:A,mark:S,small:P,id:L,...u}},a.requirements){const f=a,h=[Wi(f),Sd(()=>!f.earned.value),...Pt(a.requirements)?a.requirements:[a.requirements]];_t(()=>{re.active===Q.id&&gi(h)&&f.complete()})}return a})}We.on("loadSettings",e=>{ie(e,"msDisplay",Sn.All)});const Dd=Object.values(Sn).map(e=>({label:Ke(e),value:e}));Is(K(()=>p(Ui,{title:K(()=>p("span",{class:"option-title"},[x("Show achievements"),p("desc",null,[x("Select which achievements to display based on criterias.")])])),options:Dd,"onUpdate:modelValue":e=>re.msDisplay=e,modelValue:re.msDisplay},null)));const Fd=J({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:Zn,Node:Yn},setup(e){const{progress:t,width:n,height:i,direction:r,display:a}=$e(e),l=N(()=>{let d=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),u=N(()=>{const d={width:Ce(n)+.5+"px",height:Ce(i)+.5+"px"};switch(s(r)){case G.Up:d.clipPath=`inset(${l.value}% 0% 0% 0%)`,d.width=Ce(n)+1+"px";break;case G.Down:d.clipPath=`inset(0% 0% ${l.value}% 0%)`,d.width=Ce(n)+1+"px";break;case G.Right:d.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case G.Left:d.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case G.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),c=Pn(a);return{normalizedProgress:l,barStyle:u,component:c,unref:s,Visibility:he,isVisible:Le,isHidden:wn}}});function Ad(e,t,n,i,r,a){var c,d,m,f,h,w,v;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(M(),E("div",{key:0,style:Re([{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:pe({bar:!0,...e.unref(e.classes)})},[_("div",{class:"overlayTextContainer border",style:Re([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(M(),E("span",{key:0,class:"overlayText",style:Re(e.unref(e.textStyle))},[(M(),ee(Ue(e.component)))],4)):B("",!0)],4),_("div",{class:"border",style:Re([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(m=e.unref(e.style))!=null?m:{},(f=e.unref(e.baseStyle))!=null?f:{},(h=e.unref(e.borderStyle))!=null?h:{}])},[_("div",{class:"fill",style:Re([e.barStyle,(w=e.unref(e.style))!=null?w:{},(v=e.unref(e.fillStyle))!=null?v:{}])},null,4)],4),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):B("",!0)}var Od=ce(Fd,[["render",Ad],["__scopeId","data-v-6bd06b56"]]);const Rd=Symbol("Bar");function qd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return He(i=>{var l,u;const r=e.call(i,i);r.id=rn("bar-"),r.type=Rd,r[mt]=Od;for(const c of t)(l=c.preConstruct)==null||l.call(c,r);Object.assign(r,n),$(r,"visibility"),ie(r,"visibility",he.Visible),$(r,"width"),$(r,"height"),$(r,"direction"),$(r,"style"),$(r,"classes"),$(r,"borderStyle"),$(r,"baseStyle"),$(r,"textStyle"),$(r,"fillStyle"),$(r,"progress"),$(r,"display"),$(r,"mark");for(const c of t)(u=c.postConstruct)==null||u.call(c,r);const a=t.reduce((c,d)=>{var m;return Object.assign(c,(m=d.getGatheredProps)==null?void 0:m.call(d,r))},{});return r[at]=function(){const{progress:c,width:d,height:m,direction:f,display:h,visibility:w,style:v,classes:b,borderStyle:I,textStyle:A,baseStyle:S,fillStyle:P,mark:L,id:le}=this;return{progress:c,width:d,height:m,direction:f,display:h,visibility:w,style:s(v),classes:b,borderStyle:I,textStyle:A,baseStyle:S,fillStyle:P,mark:L,id:le,...a}},r})}function Vd(e,...t){return He(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(g.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=N(()=>{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=N(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=N(()=>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}),$(i,"currentGain"),$(i,"actualGain"),$(i,"currentAt"),$(i,"nextAt"),$(i,"buyMax"),ie(i,"buyMax",!0);for(const l of t)(a=l.postConstruct)==null||a.call(l,i);return i})}function Bd(e){return Vd(e)}const Jr=Symbol("Repeatable");function cr(e,...t){const n=ct(0),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return He(r=>{var h,w,v;const a=e.call(r,r);a.id=rn("repeatable-"),a.type=Jr,a[mt]=Zr;for(const b of t)(h=b.preConstruct)==null||h.call(b,a);a.amount=n,a.amount[nn]=(w=a.initialAmount)!=null?w:0,Object.assign(a,i);const l={requirementMet:N(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:he.None},u=Wi(a);Pt(a.requirements)?(a.requirements.unshift(u),a.requirements.push(l)):a.requirements=[u,a.requirements,l],a.maxed=N(()=>o.gte(a.amount.value,s(a.limit))),$(a,"classes");const c=a.classes;a.classes=N(()=>{const b=s(c)||{};return a.maxed.value&&(b.bought=!0),b}),a.amountToIncrease=N(()=>o.clampMin(Yr(a.requirements),1)),a.canClick=N(()=>gi(a.requirements));const d=a.onClick;a.onClick=function(b){const I=a;!s(I.canClick)||(Xr(a.requirements,s(a.amountToIncrease)),I.amount.value=o.add(I.amount.value,1),d==null||d(b))},$(a,"display");const m=a.display;a.display=K(()=>{var I,A,S;const b=s(m);if(St(b)){const P=se(b);return p(P,null,null)}if(b!=null){const P=a,L=se((I=b.title)!=null?I:"","h3"),le=se((A=b.description)!=null?A:""),Z=se((S=b.effectDisplay)!=null?S:"");return p("span",null,[b.title==null?null:p("div",null,[p(L,null,null)]),b.description==null?null:p(le,null,null),b.showAmount===!1?null:p("div",null,[p("br",null,null),p(ne,null,[x("Amount: "),gt(P.amount.value)]),o.isFinite(s(P.limit))?p(ne,null,[x(" / "),gt(s(P.limit))]):void 0]),b.effectDisplay==null?null:p("div",null,[p("br",null,null),x("Currently: "),p(Z,null,null)]),P.maxed.value?null:p("div",null,[p("br",null,null),mi(P.requirements,s(a.amountToIncrease))])])}return""}),$(a,"visibility"),ie(a,"visibility",he.Visible),$(a,"limit"),ie(a,"limit",o.dInf),$(a,"style"),$(a,"mark"),$(a,"small");for(const b of t)(v=b.postConstruct)==null||v.call(b,a);const f=t.reduce((b,I)=>{var A;return Object.assign(b,(A=I.getGatheredProps)==null?void 0:A.call(I,a))},{});return a[at]=function(){const{display:b,visibility:I,style:A,classes:S,onClick:P,canClick:L,small:le,mark:Z,id:z}=this;return{display:b,visibility:I,style:s(A),classes:S,onClick:P,canClick:L,small:le,mark:Z,id:z,...f}},a})}const Ld=Symbol("Reset");function jd(e){return He(t=>{const n=e.call(t,t);return n.id=rn("reset-"),n.type=Ld,n.reset=function(){var r;const i=a=>{if(a!=null&&typeof a=="object")if(nn in a){const l=a;l.value=l[nn]}else!(a instanceof o)&&!De(a)&&Object.values(a).forEach(l=>i(l))};s(n.thingsToReset).forEach(i),We.emit("reset",n),(r=n.onReset)==null||r.call(n)},$(n,"thingsToReset"),n})}const ei={};We.on("removeLayer",e=>{var t;(t=ei[e.id])==null||t.call(ei),ei[e.id]=void 0});function Ei(e,t){return $(t,"display"),$(t,"classes"),$(t,"style"),$(t,"direction"),ie(t,"direction",G.Up),$(t,"xoffset"),$(t,"yoffset"),t.pinnable&&(t.pinned=ct(!1,!1)),jt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,Pr(t.pinned)):e.pinned=t.pinned);const n=e[mt];e[mt]=Pe;const i=e[at].bind(e);e[at]=function(){const{display:a,classes:l,style:u,direction:c,xoffset:d,yoffset:m,pinned:f}=this;return{element:{[mt]:n,[at]:i},display:a,classes:l,style:s(u),direction:c,xoffset:d,yoffset:m,pinned:f}}.bind(t)}),t}var zd=J({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:Yn,MarkNode:Zn},setup(e){const{display:t,requirements:n,bought:i}=$e(e),r=ft("");return _t(()=>{const a=Ce(t);if(a==null){r.value="";return}if(St(a)){r.value=se(a);return}const l=se(a.title||"","h3"),u=se(a.description,"div"),c=se(a.effectDisplay||"");r.value=se(K(()=>p("span",null,[a.title!=null?p("div",null,[p(l,null,null)]):null,p(u,null,null),a.effectDisplay!=null?p("div",null,[x("Currently: "),p(c,null,null)]):null,i.value?null:p(ne,null,[p("br",null,null),mi(n.value)])])))}),{component:r,unref:s,Visibility:he,isVisible:Le,isHidden:wn}}});const Ud=["disabled"];function Gd(e,t,n,i,r,a){var c;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(M(),E("button",{key:0,style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:pe({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)?(M(),ee(Ue(e.unref(e.component)),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],14,Ud)):B("",!0)}var Wd=ce(zd,[["render",Gd],["__scopeId","data-v-9be6bac0"]]);const Hi=Symbol("Upgrade");function dr(e,...t){const n=ct(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return He(r=>{var c,d;const a=e.call(r,r);a.id=rn("upgrade-"),a.type=Hi,a[mt]=Wd;for(const m of t)(c=m.preConstruct)==null||c.call(m,a);a.bought=n,Object.assign(a,i),a.canPurchase=N(()=>!n.value&&gi(a.requirements)),a.purchase=function(){var f;const m=a;!s(m.canPurchase)||(Xr(a.requirements),n.value=!0,(f=m.onPurchase)==null||f.call(m))};const l=Wi(a);Pt(a.requirements)?a.requirements.unshift(l):a.requirements=[l,a.requirements],$(a,"visibility"),ie(a,"visibility",he.Visible),$(a,"classes"),$(a,"style"),$(a,"display"),$(a,"mark");for(const m of t)(d=m.postConstruct)==null||d.call(m,a);const u=t.reduce((m,f)=>{var h;return Object.assign(m,(h=f.getGatheredProps)==null?void 0:h.call(f,a))},{});return a[at]=function(){const{display:m,visibility:f,style:h,classes:w,requirements:v,canPurchase:b,bought:I,mark:A,id:S,purchase:P}=this;return{display:m,visibility:f,style:s(h),classes:w,requirements:v,canPurchase:b,bought:I,mark:A,id:S,purchase:P,...u}},a})}function Hd(e,t,n=[]){n=n.length===0?ai(e,Hi):n;const i=zn(t)?N(t):t;e.on("update",()=>{s(i)&&n.forEach(r=>r.purchase())})}function Zd(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 Yd={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"]},fr=[[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 Pi(e){const t=fr[Math.floor(e()*fr.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 gr=di();function Kr(e,t,n,i){return ji(e,function(){const r=Zd(0,n>>0,n>>32,1);for(let q=0;q<12;q++)r();const a=Pi(r),l=On([.64,.75,.55],r),u=On([.18,.2,.25],r),c=Mn(0,Pi(r)),d=ct(0),m=cn.indexOf(t);let f=r();const h=i.reduce((q,j)=>(q[j.type]=j.data,q),{});"increaseDiff"in h&&(f=f/2+.5),"decreaseDiff"in h&&(f=f/2),"relic"in h&&(f=1);const w=f+m+1,v="increaseRewards"in h?w+1:w;let b="relic"in h?m+2:Math.ceil(r()*(m+2));"increaseLength"in h&&b++;const I=[],A=$t(()=>[...I,Oe(()=>({multiplier:()=>C.isEmpowered("silver")?4:2,description:()=>(C.isEmpowered("silver")?"Empowered ":"")+Te.silver.name,enabled:()=>C.toolNodes.value.silver!=null})),Oe(()=>({multiplier:()=>(C.isEmpowered("diamond")?2:1)*Xe.filter(q=>q.bought.value).length/10,description:()=>(C.isEmpowered("diamond")?"Empowered ":"")+Te.diamond.name,enabled:()=>C.toolNodes.value.diamond!=null})),Oe(()=>({multiplier:()=>o.div(d.value,6e3).times(C.isEmpowered("emerald")?2:1),description:()=>(C.isEmpowered("emerald")?"Empowered ":"")+Te.emerald.name,enabled:()=>C.toolNodes.value.emerald!=null}))]),S=N(()=>A.apply(0)),P=[],L={};function le({feature:q,canClick:j,modifier:xe,cost:Tt,previewModifier:on,showETA:tt,previewCost:Dt}){j=ve(j),tt=ve(tt);const T=lr(q);P.push({shouldShowPreview:N(()=>s(j)&&T.value),modifier:$t(()=>{const W=I.slice();return W.splice(W.indexOf(xe),1,on),W}),cost:Dt!=null?Dt:Tt}),I.push(xe);const D=$i(c,S,()=>be(Tt)),O=Ei(q,{display:tt==null?D:()=>s(tt)?D.value:"",direction:G.Down});return{isHovering:T,eta:D,tooltip:O}}const Z=[],z=V(0);let U=g.variable(z).times(0);const qe={};let et=!0;const Y=N(()=>o.add(w,r()-.5).pow_base(2).times(10).times(U.evaluate())),Me=[];for(let q=0;q=b-1?0:1};switch(ti(j,r)){case"upgrades":const Ft=[];for(let Se=0;Se<4;Se++){const ot=ti({add:1,mult:q===0&&Se===0?0:1,pow:q===0?0:.5},r),Ze=Y.value,Je=kn(r);let it="",Ee,ye;const Ie=z.value;switch(ot){case"add":{const ue=o.add(Ze,10).pow(r()/4+.875);it=`Gain ${me(ue)} ${c.displayName}/s`,U=U.add(ue),Ee=gn(()=>({addend:ue,description:Je,enabled:Ve.bought})),ye=gn(()=>({addend:ue}));break}case"mult":{const ue=r()*5+1;it=`Multiply previous ${c.displayName} gain by x${me(ue)}.`,U=U.add(o.sub(ue,1).times(qe[Ie-1])),Ee=Oe(()=>({multiplier:ue,description:Je,enabled:Ve.bought})),ye=Oe(()=>({multiplier:ue}));break}case"pow":{const ue=r()/10+1.05;it=`Raise previous ${c.displayName} gain to the ^${me(ue)}`,U=U.add(o.pow(qe[Ie-1],ue)).sub(qe[Ie-1]),Ee=Ii(()=>({exponent:ue,description:Je,enabled:Ve.bought})),ye=Ii(()=>({exponent:ue}))}}qe[z.value]=U.evaluate(),z.value++;const je=et,Ve=dr(()=>({requirements:An(()=>({resource:Cn(c),cost:Ze})),display:{title:Je,description:it},visibility:je}));le({feature:Ve,canClick:()=>Ve.canPurchase.value,modifier:Ee,cost:Ze,showETA:()=>!Ve.bought.value,previewModifier:ye}),Ft.push(Ve)}Z.push(Ft);break;case"repeatables":const At=[];for(let Se=0;Se<3;Se++){const ot=ti({add:1.5,mult:3},r),Ze=z.value,Je=Y.value,it=kn(r);let Ee="",ye,Ie,je,Ve;const ue=g.variable(N(()=>ze.amount.value)).times(2);switch(ot){case"add":{const _e=o.add(Je,10).times(r()+.5);Ee=`Gain ${me(_e)} ${c.displayName}/s`,Ve=ue.add(1).times(Je),U=U.add(N(()=>o.sub(z.value,Ze).add(1).times(5).times(_e))),ye=N(()=>me(o.times(_e,ze.amount.value))+"/s"),Ie=gn(()=>({addend:()=>o.times(_e,ze.amount.value),description:it,enabled:()=>o.gt(ze.amount.value,0)})),je=gn(()=>({addend:()=>o.add(ze.amount.value,1).times(_e)}));break}case"mult":{const _e=r()*.75+1.25;Ee=`Multiply previous ${c.displayName} gain by x${me(_e)}.`,Ve=ue.pow_base(_e).times(Je),U=U.add(N(()=>o.sub(z.value,Ze).add(1).times(5).pow_base(_e).sub(1).times(qe[Ze-1]))),ye=N(()=>"x"+me(o.pow(_e,ze.amount.value))),Ie=Oe(()=>({multiplier:()=>o.pow(_e,ze.amount.value),description:it,enabled:()=>o.gt(ze.amount.value,0)})),je=Oe(()=>({multiplier:()=>o.add(ze.amount.value,1).pow_base(_e)}));break}}qe[z.value]=U.evaluate(),z.value++;const qt=et,ze=cr(()=>({requirements:An(()=>({resource:Cn(c),cost:Ve})),display:()=>({title:it,description:Ee,effectDisplay:s(ye)}),visibility:qt}));le({feature:ze,canClick:()=>s(ze.canClick),modifier:Ie,cost:Ve,previewModifier:je}),At.push(ze)}Z.push(At);break;case"conversion":const Ae=Mn(0,Pi(r)),Ot=On([.64,.75,.55],r),Dn=Y.value,Qr=r()/2+.25,Yi=r()/2+.25,Xi=z.value;U=U.add(N(()=>o.sub(z.value,Xi).add(1).pow_base(5).pow(Yi).times(qe[Xi-1])));const Rt=Bd(()=>({baseResource:Cn(c),gainResource:Ae,formula:Se=>Se.div(Dn).pow(Qr),spend(){c.value=0}}));qe[z.value]=U.evaluate(),z.value+=2;const ea=et,Ji=kn(r),Ni=g.variable(Ae).pow(Yi).add(1),ta=Oe(()=>({multiplier:()=>Ni.evaluate(),description:Ji,enabled:()=>o.gt(Ae.value,0)})),na=Oe(()=>({multiplier:()=>Ni.evaluate(o.add(Ae.value,Rt.actualGain.value))})),Nn=yd(()=>({display:{title:Ji,description:K(()=>p("span",null,[x("Reset "),c.displayName,x(" for")," ",ui(Ae,o.clampMin(Rt.actualGain.value,1))," ",Ae.displayName,p("br",null,null),p("div",null,[x("Next:")," ",ui(c,o.lt(Rt.actualGain.value,1)?Rt.currentAt.value:Rt.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(Rt.actualGain.value,1),prestigeResource:Ae,onClick:Rt.convert,visibility:ea})),{isHovering:ia}=le({feature:Nn,canClick:()=>s(Nn.canClick),modifier:ta,cost:Dn,previewCost:c,previewModifier:na}),Ki=N(()=>ia.value&&Nn.canClick.value);Z.push([Nn]);const ra=dn(g.variable(Ae),Ki,Rt.actualGain),aa=dn(Ni,Ki,Rt.actualGain);L[q*2]=K(()=>p(ne,null,[Le(Nn.visibility)?p("div",{style:"margin: 10px"},[x("You have")," ",p("h2",{style:{color:Ot,textShadow:`0px 0px 10px ${Ot}`}},[ra()])," ",Ae.displayName,x(","),p("br",null,null),x("providing a "),aa(),x("x multiplier to previous")," ",c.displayName,x(" gain")]):null,Si(Nn)]));break;case"xp":{const Se=Mn(0),nt=et,ot=z.value,Ze=kn(r),Je=o.add(w,r()-.5).pow_base(2).times(10),it=r()/4+1.125,Ee=r()/2+1.25,ye=g.variable(0).pow(it).times(Je),Ie=Lr(ye,Se,!0,10,o.dInf),je=N(()=>Lt(ye,Ie.value,!0,10)),Ve=N(()=>Lt(ye,o.add(Ie.value,1),!0,10)),ue=N(()=>o.pow(Ee,Ie.value)),qt=Oe(()=>({multiplier:ue,description:Ze,enabled:()=>Le(_e.visibility)}));U=U.add(N(()=>o.sub(z.value,ot).add(1).sqrt().times(3).pow(Ee).times(qe[ot-1]))),qe[z.value]=U.evaluate(),z.value+=2;const ze=On([.18,.2,.25],r),_e=qd(()=>({direction:G.Right,width:300,height:20,progress:()=>o.sub(Se.value,je.value).div(o.sub(Ve.value,je.value)).toNumber(),visibility:nt,xp:Se,display:K(()=>p("span",null,[me(Se.value),x("/"),me(Ve.value)])),fillStyle:`background-color: ${ze}`}));this.on("preUpdate",Ci=>{if(kt.value.lengthyt.state.id===e)&&Le(_e.visibility)){const yt=o.times(ht.value,Ci);Se.value=o.add(yt,Se.value)}}),I.push(qt),Z.push([_e]),L[q*2]=K(()=>p(ne,null,[Le(_e.visibility)?p("div",{style:"margin: 10px"},[x("You have "),p("h3",null,[Ze]),x(" Lv. "),gt(Ie.value),x(","),p("br",null,null),x("providing a "),me(ue.value),x("x multiplier to previous")," ",c.displayName,x(" gain"),p("br",null,null)]):null,Si(_e)]));break}case"dimensions":{const Se=kn(r),nt=Mn(0,Se+" energy"),ot=On([.64,.75,.55],r),Ze=z.value;U=U.add(N(()=>o.sub(z.value,Ze).add(1).pow_base(32).add(1).log2().add(1).times(qe[Ze-1])));const Je=N(()=>o.add(nt.value,1).log2().add(1)),it=Oe(()=>({multiplier:Je,description:Se,enabled:()=>o.gt(nt.value,0)}));I.push(it);const Ee=et,ye=[];for(let Ie=0;Ie<4;Ie++){const je=o.add(w,r()-.5).pow_base(2).times(10).recip(),Ve=Y.value,ue=g.variable(N(()=>yt.amount.value)),qt=ue.pow_base(o.pow10(Ie+1)).times(Ve),ze=["First","Second","Third","Fourth"][Ie]+" "+Se+" Dimension",_e=Mn(0,ze),Ci=ue.sub(1).pow_base(2).times(je).times(N(()=>o.add(yt.amount.value,_e.value))),yt=cr(()=>({display:{title:ze,description:K(()=>p("div",null,[p("div",null,[x("Amount:")," ",me(o.add(_e.value,yt.amount.value))," ",x("["),gt(yt.amount.value),x("]")])])),effectDisplay:K(()=>p("span",null,[la()," ",Ie===0?nt.displayName:ye[ye.length-1].display.title,x("/s")])),showAmount:!1},style:{width:"400px"},effect:Ci,dimensions:_e,energy:Ie===0?nt:void 0,requirements:An(()=>({resource:Cn(c),cost:qt})),visibility:Ee}));ye.push(yt);const sa=lr(yt),Qi=N(()=>s(yt.canClick)&&sa.value),oa=new g({inputs:[ue],evaluate(er){return o.sub(er,1).pow_base(2).times(je).times(o.add(er,_e.value))}}),la=dn(oa,Qi);P.push({shouldShowPreview:Qi,cost:qt});const ua=$i(c,S,()=>be(qt));Ei(yt,{display:ua,direction:G.Down}),qe[z.value]=U.evaluate(),z.value++}this.on("preUpdate",Ie=>{if(kt.value.lengthje.state.id===e)&&Le(Ee)){const je=o.times(ht.value,Ie),Ve=ye[0].effect.evaluate();nt.value=o.times(Ve,je).add(nt.value);for(let ue=1;ue<4;ue++){const qt=ye[ue].effect.evaluate();ye[ue-1].dimensions.value=o.times(qt,je).add(ye[ue-1].dimensions.value)}}}),Z.push(ye),L[q*2]=K(()=>p(ne,null,[Le(Ee)?p("div",{style:"margin: 10px"},[x("You have")," ",p("h2",{style:{color:ot,textShadow:`0px 0px 10px ${ot}`}},[me(nt.value)])," ",nt.displayName,x(","),p("br",null,null),x("providing a "),me(Je.value),x("x multiplier to previous")," ",c.displayName,x(" gain")]):null,Fs(...ye)]));break}case"prestige":{const Se=kn(r),nt=et,ot=r()/2+1.25,Ze=Y.value;U=U.pow(ot);const Je=Ii(()=>({exponent:ot,description:Se,enabled:Ee.bought}));qe[z.value]=U.evaluate(),z.value++;const it=jd(()=>({thingsToReset:Z.filter((Ie,je)=>je%2===0),onReset(){c.value=0}})),Ee=dr(()=>({display:{title:Se,description:`Reset all previous ${a} content to raise all previous ${c.displayName} gain to the ^${me(ot)}`},style:{width:"200px",minHeight:"100px"},onPurchase:it.reset,visibility:nt,requirements:An(()=>({resource:Cn(c),cost:Ze}))})),ye=Oe(()=>({multiplier:0}));le({feature:Ee,canClick:()=>s(Ee.canPurchase),modifier:Je,cost:Ze,previewCost:c,previewModifier:ye,showETA:()=>!s(Ee.bought)}),Z.push([Ee]);break}}const Tt={cache:"increaseCaches"in h?10:1,generation:"increaseGens"in h?10:1,resourceMulti:"increaseResourceMults"in h?10:1,energyMulti:"increaseEnergyMults"in h?2.5:.25,influences:Object.keys(C.influenceNodes.value).length+Me.length===Object.keys(Vt).length?0:"increaseInfluences"in h?20:2,relic:0};let on=ti(Tt,r);q===b-1&&"relic"in h&&(on="relic");let tt="",Dt,T,D,O,W,oe;switch(on){case"cache":O=Ti(r,i),tt=`Gain ${me(v)}x your current ${O}.`,T=()=>{var Ae,Ot,Dn;return C.grantResource(O,o.times((Dn=(Ot=(Ae=C.resourceNodes.value[O])==null?void 0:Ae.state)==null?void 0:Ot.amount)!=null?Dn:0,v))};break;case"generation":O=Ti(r,i);const Ft=o.div(v,120).times(Mt[O]);tt=`Gain ${me(Ft)} ${O}/s while plane is active.`,Dt=Ae=>C.grantResource(O,o.times(Ae,Ft)),D=N(()=>C.resourceNodes.value[O]);break;case"resourceMulti":W=O=Ti(r,i),oe=o.div(v,17).pow_base(2),tt=`Gain ${me(oe)}x ${O} while plane is active.`;break;case"energyMulti":W="energy",oe=o.div(v,17).add(1),tt=`Gain ${me(oe)}x energy while plane is active.`;break;case"influences":const At=Object.keys(Vt)[Math.floor(r()*Object.keys(Vt).length)];Me.push(At),tt=`Gain a new portal influence (${Vt[At].display})`,T=()=>{if(At in C.influenceNodes.value){gr.warning(`Error: ignoring duplicate portal influence (${Vt[At].display})`);return}const Ae={id:Wn(C.board),position:{...C.board.types.portal.nodes.value.find(Ot=>Ot.state.id===e).position},type:"influence",state:{type:At,data:Vt[At].initialData}};C.board.placeInAvailableSpace(Ae),C.board.nodes.value.push(Ae)};break;case"relic":tt=t==="ultimatum"?"Win the game!":`Gain the ${t}-tier planar relic (${Fi[t]})`,T=()=>{if(t==="ultimatum"){Zi.value=!0;return}if(`${t}Relic`in C.toolNodes.value)gr.warning(`Error: ignoring duplicate relic (${Fi[t]})`);else{const Ae={id:Wn(C.board),position:{...C.board.types.portal.nodes.value.find(Ot=>Ot.state.id===e).position},type:"passive",state:`${t}Relic`};C.board.placeInAvailableSpace(Ae),C.board.nodes.value.push(Ae)}}}const ge=et,Zt=Y.value,It=Td(()=>({requirements:An(()=>({resource:Cn(c),cost:Zt})),visibility:ge,display:{requirement:`${me(Zt)} ${c.displayName}`,effectDisplay:tt},style:"width: 100%",classes:{final:q===b-1},update:Dt,onComplete:T,link:D,effectedResource:W,resourceMulti:oe})),Yt=$i(c,S,Zt);Ei(It,{display:()=>It.earned.value?"":Yt.value,direction:G.Down}),Z.push([It]),et=It.earned}const Xe=ai(Z,Hi);ai(Z,Jr);const st=$t(()=>[Oe(()=>({multiplier:()=>{var q,j,xe;return o.add((xe=(j=(q=C.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:j.level)!=null?xe:0,1)},description:"Booster",enabled:()=>{var q,j,xe;return(xe=(j=(q=C.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:j.portals.includes(e))!=null?xe:!1}}))]),ht=N(()=>st.apply(1)),[bt,Wt]=Bn(()=>[{title:`${Ke(c.displayName)} Gain`,modifier:A,base:0,unit:"/s"},{title:`${Ke(c.displayName)} Time Speed`,modifier:st,base:1,visible:()=>o.gt(ht.value,1)}]),sn=V(!1),hi=K(()=>p(Ut,{modelValue:sn.value,"onUpdate:modelValue":q=>sn.value=q},{header:()=>p("h2",null,[x("Modifiers")]),body:()=>Qe(bt)}));this.on("preUpdate",q=>{if(!C.activePortals.value.some(xe=>xe.state.id===e))return;const j=o.times(ht.value,q);d.value=o.add(d.value,j),kt.value.length{var Tt;(Tt=xe.update)==null||Tt.call(xe,j)})}),Hd(this,()=>C.upgrader.value!=null&&Ne(C.upgrader.value),Xe);const Jn=N(()=>{const q=P.find(j=>j.shouldShowPreview.value);return q?o.neg(be(q.cost)):0}),Kn=N(()=>{const q=P.find(j=>j.shouldShowPreview.value);return q&&q.modifier?o.sub(q.modifier.apply(0),S.value):0}),bi=dn(g.variable(0).add(c),()=>o.neq(Jn.value,0),Jn),yi=dn(g.variable(0).add(S),()=>o.neq(Kn.value,0),Kn),wi=N(()=>{const q=[];return kt.value.forEach(j=>{j.link&&q.push(j.link)}),q}),_i=N(()=>{const q={};return kt.value.forEach(j=>{j.effectedResource!=null&&j.resourceMulti!=null&&(q[j.effectedResource]!=null?q[j.effectedResource]=o.times(q[j.effectedResource],j.resourceMulti):q[j.effectedResource]=j.resourceMulti)}),q}),kt=N(()=>{const q=[];for(let j=1;jo.lt(kt.value.length,b)&&Z.some(q=>q.some(j=>"earned"in j&&s(j.earned)||"bought"in j&&s(j.bought)?!1:("canClick"in j&&s(j.canClick)||"canPurchase"in j&&s(j.canPurchase),!0))));return{tier:ct(t),seed:ct(n),influences:ct(i),name:a,color:l,resource:c,background:u,style:{background:u,"--background":u},features:Z,resourceTabCollapsed:Wt,links:wi,resourceMultis:_i,earnedTreasures:kt,showNotif:Ht,timeActive:d,display:K(()=>p(ne,null,[p(li,{class:"nav-container",style:"z-index: 5"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",null,[a])]),p("span",{class:"nav-segment"},[p("h3",null,[t,x("-tier")])]),i.length===0?null:p("span",{class:"nav-segment"},[p(Pe,{display:i.map(q=>{const j=Vt[q.type].description;return typeof j=="function"?j(q):j}).join("
"),direction:G.Down,style:"width: 300px"},{default:()=>[p("h3",null,[i.length,x(" influences")])]})]),p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>sn.value=!0},[x("modifiers")])])]}),p(li,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[Qe(bi)])," ",c.displayName]),p("span",{class:"nav-segment"},[x("("),p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[o.gt(S.value,0)?"+":"",Qe(yi)]),x("/s)")]),o.neq(ht.value,1)?p("span",{class:"nav-segment"},[x("Speed: "),me(ht.value),x("x")]):null]}),p(Md,{height:"60px"},null),Z.map((q,j)=>j in L?Qe(L[j]):Si(...q)),Qe(hi)])),minimizedDisplay:K(()=>p("div",null,[p("span",null,[a]),p("span",{style:"font-size: large; vertical-align: sub;"},[" ",kt.value.length,x("/"),b,x(" treasures")])]))}})}function Ti(e,t){t=t.filter(u=>u.type==="increaseResources"||u.type==="decreaseResources");const n=Object.keys(Mt).reduce((u,c)=>{let d=Mt[c];return t.filter(m=>m.data===c).forEach(m=>{m.type==="increaseResources"?d*=1e3:d/=1e3}),u+d},0),i=Object.keys(Mt),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===C.board.selectedNode.value?{text:"Mining"}:Object.keys(C.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[an],progress:e=>Ne(e)?new o(e.state.progress).toNumber():0,progressDisplay:hn.Outline,progressColor:"var(--accent2)",classes:e=>({running:Ne(e)}),draggable:!0},ef={shape:Ge.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===C.board.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(e){o.gte(C.energy.value,100)&&(e.type="factory",C.energy.value=o.sub(C.energy.value,100))},confirmationLabel:()=>o.gte(C.energy.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},tf={shape:Ge.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===C.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${Te[e.state].name}`};if(((t=C.board.draggingNode.value)==null?void 0:t.type)==="resource"){const i=((n=C.board.draggingNode.value)==null?void 0:n.state).type,r=e.state===i?"Disconnect":Te[i].name,a=e.state===i||o.gte(C.energy.value,Te[i].cost)&&C.toolNodes.value[i]==null?"var(--accent2)":"var(--danger)";return{text:r,color:a}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,C.board.selectedAction.value=null,C.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${Te[e.state].name} - ${Ye(Te[e.state].cost)} energy`}),onClick(e){const t=Te[e.state];if(o.gte(C.energy.value,t.cost)&&C.toolNodes.value[e.state]==null){C.energy.value=o.sub(C.energy.value,t.cost);const n={id:Wn(C.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};C.board.placeInAvailableSpace(n),C.board.nodes.value.push(n),C.board.selectedAction.value=null,C.board.selectedNode.value=null,e.state=void 0}},fillColor:e=>o.gte(C.energy.value,Te[e.state].cost)&&C.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(C.energy.value,Te[e.state].cost)?C.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:e=>e.state==null||C.toolNodes.value[e.state]!=null?0:o.div(C.energy.value,Te[e.state].cost).clampMax(1).toNumber(),progressDisplay:hn.Fill,progressColor:e=>e.state!=null&&o.gte(C.energy.value,Te[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){return t.type==="resource"},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,C.board.selectedNode.value=e},draggable:!0},nf={shape:Ge.Circle,size:50,title:e=>Ke(e.state.type),subtitle:e=>Ye(e.state.amount),progress:e=>cd(e.state.type),onClick(){},progressDisplay:hn.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":C.dowsing.value!=null&&Ne(C.dowsing.value)&&C.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=C.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0},rf={shape:Ge.Circle,size:50,title:e=>Te[e.state].name,label:e=>e===C.board.selectedNode.value?{text:kd[e.state].description(lt(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":lt(e.state)}),draggable:!0},af={shape:Ge.Diamond,size:50,title:"\u{1F962}",label:e=>e===C.board.selectedNode.value?{text:e.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${e.state.resources.length}/${o.add(e.state.maxConnections,C.computedBonusConnectionsModifier.value)})`}:jr(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[pi,Hn(e=>e.add(2).pow_base(100),16),an],classes:e=>({running:Ne(e)}),canAccept:Ur,onDrop:Gr,draggable:!0},sf={shape:Ge.Diamond,size:50,title:"\u26CF\uFE0F",label:e=>e===C.board.selectedNode.value?{text:e.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${e.state.resources.length}/${o.add(e.state.maxConnections,C.computedBonusConnectionsModifier.value)})`}:jr(e,t=>`Gather ${pt(o.div(C.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[pi,Hn(e=>e.add(2).pow_base(1e4),16),an],progress:e=>Ne(e)?o.eq(C.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(C.quarryProgressRequired.value).toNumber():0,progressDisplay:hn.Outline,progressColor:"var(--accent2)",canAccept:Ur,onDrop:Gr,classes:e=>({running:Ne(e)}),draggable:!0},of={shape:Ge.Diamond,size:50,title:"\u{1F50C}",label:e=>e===C.board.selectedNode.value?{text:e.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${e.state.tools.length}/${o.add(e.state.maxConnections,C.computedBonusConnectionsModifier.value)})`}:od(e,t=>t.includes("Relic")?`Double ${Fi[t.slice(0,-5)]}'s effect`:`Double ${Te[t].name}'s effect`),actionDistance:Math.PI/4,actions:[pi,Hn(e=>e.add(3).pow_base(1e3),16),an],canAccept:ld,onDrop:ud,classes:e=>({running:Ne(e)}),draggable:!0},lf={shape:Ge.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===C.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=C.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${Ke(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type,{influences:i}=e.state;return i.includes(n)?{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(e){e.state={...e.state,tier:void 0,influences:[]},C.board.selectedAction.value=null,C.board.selectedNode.value=null},visibility:e=>{const{tier:t,influences:n}=e.state;return t!=null||n.length>0}},{id:"makePortal",icon:"done",tooltip:e=>({text:`Spawn ${e.state.tier}-tier portal`}),onClick(e){let t=0;for(;`portal-${t}`in we;)t++;const{tier:n,influences:i}=e.state;zi(Kr(`portal-${t}`,n,Math.floor(Math.random()*4294967296),i.map(a=>C.influenceNodes.value[a].state)),Q);const r={id:Wn(C.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};C.board.placeInAvailableSpace(r),C.board.nodes.value.push(r),C.board.selectedAction.value=null,C.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null}],canAccept(e,t){return t.type==="resource"||t.type==="influence"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,i=e.state.tier;e.state={...e.state,tier:n===i?void 0:n}}else if(t.type==="influence"){const n=t.state.type,i=e.state.influences;i.includes(n)?e.state={...e.state,influences:i.filter(r=>r!==n)}:e.state={...e.state,influences:[...i,n]}}C.board.selectedNode.value=e},draggable:!0},uf={shape:Ge.Diamond,size:50,title:"\u{1F300}",label:e=>e===C.board.selectedNode.value?{text:`Portal to ${we[e.state.id].name}`,color:we[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[an],classes:e=>({running:Ne(e),showNotif:we[e.state.id].showNotif.value,"affected-node":C.booster.value!=null&&Ne(C.booster.value)&&C.booster.value.state.portals.includes(e.state.id)}),outlineColor:e=>we[e.state.id].background,draggable:!0},cf={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?Ge.Diamond:Ge.Circle,size:50,title:e=>Vt[e.state.type].display,label:e=>{if(e===C.board.selectedNode.value){const n=e.state,i=Vt[n.type].description;return{text:typeof i=="function"?i(n):i}}const t=C.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:i,data:r}=e.state;let a;if(Array.isArray(r)&&r.includes(n))a="Disconnect";else if(i==="increaseResources")a=`Increase ${Ke(n)} odds`;else if(i==="decreaseResources")a=`Decrease ${Ke(n)} odds`;else return null;return{text:a,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[pi],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,i=e.state.data;i!=null&&(i.includes(n)?e.state={...e.state,data:i.filter(r=>r!==n)}:e.state={...e.state,data:[...i,n]},C.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},df={shape:Ge.Diamond,size:50,title:"\u231B",label:e=>e===C.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ye(o.add(1,e.state.level))}x (${e.state.portals.length}/${o.add(e.state.maxConnections,C.computedBonusConnectionsModifier.value)})`}:zr(e,t=>`Boost ${we[t].name}'s speed`),actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect portals"},onClick(e){e.state={...e.state,portals:[]},C.board.selectedAction.value=null,C.board.selectedNode.value=null},visibility:e=>{var t,n;return(n=(t=e.state)==null?void 0:t.portals.length)!=null?n:0>0}},Hn(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${Ye(xi.evaluate(e.state.level))} energy`}},confirmationLabel(e){return o.gte(C.energy.value,xi.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=xi.evaluate(e.state.level);o.gte(C.energy.value,t)&&(C.energy.value=o.sub(C.energy.value,t)),e.state={...e.state,level:o.add(e.state.level,1)},C.board.selectedAction.value=null}},an],canAccept:Wr,onDrop:Hr,classes:e=>({running:Ne(e)}),draggable:!0},ff={shape:Ge.Diamond,size:50,title:"\u{1F916}",label:e=>e===C.board.selectedNode.value?{text:e.state.portals.length===0?"Upgrader - Drag a portal to me!":`Auto-Upgrading (${e.state.portals.length}/${o.add(e.state.maxConnections,C.computedBonusConnectionsModifier.value)})`}:zr(e,t=>`Auto-buy ${we[t].name}'s upgrades`),actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect portals"},onClick(e){e.state={...e.state,portals:[]},C.board.selectedAction.value=null,C.board.selectedNode.value=null},visibility:e=>{var t,n;return(n=(t=e.state)==null?void 0:t.portals.length)!=null?n:0>0}},Hn(e=>e.add(4).pow_base(1e6)),an],canAccept:Wr,onDrop:Hr,classes:e=>({running:Ne(e)}),draggable:!0},mr=di(),pf={mine:Qd,brokenFactory:ef,factory:tf,resource:nf,passive:rf,dowsing:af,quarry:sf,empowerer:of,portalGenerator:lf,portal:uf,influence:cf,booster:df,upgrader:ff},C=ji("main",function(){const e=Mn(0,"energy"),t=N(()=>m.types.resource.nodes.value.reduce((T,D)=>(T[D.state.type]=D,T),{})),n=N(()=>({...m.types.passive.nodes.value.reduce((T,D)=>(T[D.state]=D,T),{}),sand:m.types.dowsing.nodes.value[0],wood:m.types.quarry.nodes.value[0],coal:m.types.empowerer.nodes.value[0],iron:m.types.portalGenerator.nodes.value[0],gold:m.types.booster.nodes.value[0],platinum:m.types.upgrader.nodes.value[0]})),i=N(()=>({...m.types.influence.nodes.value.reduce((T,D)=>(T[D.state.type]=D,T),{})})),r=N(()=>cn.reduce((T,D)=>{var ge,Zt,It;const O=(It=(Zt=(ge=t.value[D])==null?void 0:ge.state)==null?void 0:Zt.amount)!=null?It:0;let W=o.floor(Ln.invertIntegral(O)).sub(10).clampMin(0),oe=Lt(Ln,W,!0,0);for(;;){const Yt=Ln.evaluate(W);if(o.add(oe,Yt).lte(O))W=W.add(1),oe=o.add(oe,Yt);else break}return T[D]=W,T},{})),a=vn({}),l=vn({});jt(()=>{cn.forEach(T=>{dt(()=>r.value[T],(D,O)=>{o.gt(D,O)&&re.active===Q.id&&o.lte(D,100)&&mr.info(p("div",null,[p("h3",null,[o.eq(D,1)?`${Ke(T)} discovered`:`${Ke(T)} is now Level ${gt(D)}`,x("!")]),p("div",null,[x("Energy gain is now 1.01x higher.")])]))})})});const u=N(()=>P.filter(T=>{var D,O;return(O=(D=T.value)==null?void 0:D.state)==null?void 0:O.powered}).length+m.types.portal.nodes.value.filter(T=>T.state.powered).length),c=N(()=>o.eq(u.value,0)?10:o.add(u.value,1).pow_base(100).div(10).times(.99)),d=N(()=>v.value==null?0:v.value.state.resources.reduce((D,O)=>o.div(100,Wt[O].computedModifier.value).add(D),o.dZero)),m=ku(T=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:pf,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const D=[];if(D.push(...Object.keys(a).map(O=>({startNode:f.value,endNode:t.value[O],stroke:"var(--accent3)",strokeWidth:5}))),h.value!=null&&h.value.state!=null&&D.push({startNode:h.value,endNode:t.value[h.value.state],stroke:"var(--foreground)",strokeWidth:4}),w.value!=null&&w.value.state.resources.forEach(O=>{D.push({startNode:w.value,endNode:t.value[O],stroke:Ne(w.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),v.value!=null&&v.value.state.resources.forEach(O=>{D.push({startNode:v.value,endNode:t.value[O],stroke:"var(--foreground)",strokeWidth:4})}),D.push(...Object.keys(l).map(O=>({startNode:v.value,endNode:t.value[O],stroke:"var(--accent3)",strokeWidth:5}))),b.value!=null&&b.value.state.tools.forEach(O=>{D.push({startNode:b.value,endNode:n.value[O],stroke:Ne(b.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),I.value!=null){const O=I.value.state;O.tier!=null&&D.push({startNode:I.value,endNode:t.value[O.tier],stroke:"var(--foreground)",strokeWidth:4}),O.influences.forEach(W=>{D.push({startNode:I.value,endNode:i.value[W],stroke:"var(--foreground)",strokeWidth:4})}),T.types.portal.nodes.value.forEach(W=>{const oe=we[W.state.id];return oe.links.value.forEach(ge=>{ge.value!=null&&D.push({startNode:W,endNode:ge.value,stroke:Ne(W)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(oe.resourceMultis.value).forEach(ge=>{ge!=="energy"&&ge in t.value&&D.push({startNode:W,endNode:t.value[ge],stroke:Ne(W)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),D})}return A.value!=null&&A.value.state.portals.forEach(O=>{D.push({startNode:A.value,endNode:T.types.portal.nodes.value.find(W=>W.state.id===O),stroke:Ne(A.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),S.value!=null&&S.value.state.portals.forEach(O=>{D.push({startNode:S.value,endNode:T.types.portal.nodes.value.find(W=>W.state.id===O),stroke:"var(--foreground)",strokeWidth:4})}),Object.values(i.value).forEach(O=>{const W=O.state;(W.type==="increaseResources"||W.type==="decreaseResources")&&W.data.forEach(oe=>{D.push({startNode:O,endNode:t.value[oe],stroke:"var(--foreground)",strokeWidth:4})})}),D}})),f=N(()=>m.types.mine.nodes.value[0]),h=N(()=>m.types.factory.nodes.value[0]),w=N(()=>n.value.sand),v=N(()=>n.value.wood),b=N(()=>n.value.coal),I=N(()=>n.value.iron),A=N(()=>n.value.gold),S=N(()=>n.value.platinum),P=[f,w,v,b,A,S];function L(T,D){let O=t.value[T];if(D=o.times(D,sn[T].computedModifier.value),O==null)O={id:Wn(m),position:{...f.value.position},type:"resource",state:{type:T,amount:D}},m.placeInAvailableSpace(O),m.nodes.value.push(O);else{const W=O.state;O.state={...W,amount:o.add(W.amount,D)}}}const le=N(()=>Object.keys(Mt).reduce((T,D)=>T+new o(Wt[D].computedModifier.value).toNumber(),0)),Z=N(()=>{const T={};return m.types.portal.nodes.value.forEach(D=>{if(!Ne(D))return;const W=we[D.state.id].resourceMultis.value;Object.keys(W).forEach(oe=>{T[oe]!=null?T[oe]=o.times(T[oe],W[oe]):T[oe]=W[oe]})}),T}),z=$t(()=>[...cn.map(T=>Oe(()=>({description:()=>`${Ke(T)} (Lv. ${gt(r.value[T])}) (${me(bt.value)}x per level)`,multiplier:()=>o.pow(bt.value,r.value[T]),enabled:()=>{var D,O;return T in t.value&&o.gt((O=(D=t.value[T].state)==null?void 0:D.amount)!=null?O:0,0)}}))),Oe(()=>({multiplier:()=>lt("stone")?4:2,description:()=>(lt("stone")?"Empowered ":"")+Te.stone.name,enabled:()=>n.value.stone!=null})),Oe(()=>({multiplier:()=>{var T;return(T=Z.value.energy)!=null?T:1},description:"Planar Treasures",enabled:()=>{var T;return o.neq((T=Z.value.energy)!=null?T:1,1)}})),gn(()=>({addend:()=>o.pow(100,u.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(u.value,0)}))]),U=N(()=>z.apply(1)),qe=$t(()=>[gn(()=>({addend:()=>lt("unobtainium")?2:1,description:()=>(lt("unobtainium")?"Empowered ":"")+Te.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),et=N(()=>qe.apply(0)),Y=$t(()=>[Oe(()=>({multiplier:()=>lt("dirt")?4:2,description:()=>(lt("dirt")?"Empowered ":"")+Te.dirt.name,enabled:()=>n.value.dirt!=null}))]),Me=N(()=>Y.apply(1)),Xe=$t(()=>[Oe(()=>({multiplier:()=>lt("gravel")?4:2,description:()=>(lt("gravel")?"Empowered ":"")+Te.gravel.name,enabled:()=>n.value.gravel!=null}))]),st=N(()=>Xe.apply(1)),ht=$t(()=>[gn(()=>({addend:()=>lt("copper")?.002:.001,description:()=>(lt("copper")?"Empowered ":"")+Te.copper.name,enabled:()=>n.value.copper!=null}))]),bt=N(()=>ht.apply(1.01)),Wt=Object.keys(Mt).reduce((T,D)=>{const O=$t(()=>[Oe(()=>({multiplier:2,description:"Dowsing",enabled:()=>w.value!=null&&Ne(w.value)&&w.value.state.resources.includes(D)}))]),W=N(()=>O.apply(Mt[D])),oe={title:`${Ke(D)} Drop Rate`,modifier:O,base:Mt[D]};return T[D]={modifier:O,computedModifier:W,section:oe},T},{}),sn=Object.keys(Mt).reduce((T,D)=>{const O=$t(()=>[Oe(()=>({multiplier:()=>{var ge;return(ge=Z.value[D])!=null?ge:1},description:"Planar Treasures",enabled:()=>{var ge;return o.neq((ge=Z.value[D])!=null?ge:1,1)}}))]),W=N(()=>O.apply(1)),oe={title:`${Ke(D)} Gain`,modifier:O};return T[D]={modifier:O,computedModifier:W,section:oe},T},{}),[hi,Jn]=Bn(()=>[{title:"Energy Gain",modifier:z,base:1,unit:"/s"},{title:"Bonus Connections",modifier:qe,base:0}]),[Kn,bi]=Bn(()=>[{title:"Mining Speed",modifier:Y,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:Xe,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:ht,base:1.01,visible:()=>n.value.copper!=null}]),[yi,wi]=Bn(()=>Object.values(Wt).map(T=>T.section)),[_i,kt]=Bn(()=>Object.values(sn).map(T=>T.section)),Ht=Du({general:()=>({display:"General",glowColor(){return Ht.activeTab.value===this.tab?"white":""},tab:hi,energyTabCollapsed:Jn}),mining:()=>({display:"Mine",glowColor(){return Ht.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(n.value).length>0,tab:Kn,miningTabCollapsed:bi}),resources:()=>({display:"Mine Rates",glowColor(){return Ht.activeTab.value===this.tab?"white":""},visibility:()=>w.value!=null,tab:yi,resourcesCollapsed:wi}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return Ht.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(sn).some(T=>o.neq(T.computedModifier.value,1)),tab:_i,resourceGainCollapsed:kt})}),q=V(!1),j=K(()=>p(Ut,{modelValue:q.value,"onUpdate:modelValue":T=>q.value=T},{header:()=>p("h2",null,[x("Modifiers")]),body:()=>Qe(Ht)}));this.on("preUpdate",T=>{if(Object.keys(a).forEach(D=>{a[D]-=T,a[D]<=0&&delete a[D]}),Object.keys(l).forEach(D=>{l[D]-=T,l[D]<=0&&delete l[D]}),Ne(f.value)){const D=o.add(f.value.state.progress,o.times(Me.value,T)),O=D.floor();f.value.state={...f.value.state,progress:o.sub(D,O)};const W=O.div(le.value).floor();W.gt(0)&&cn.forEach(ge=>{L(ge,o.times(new o(Wt[ge].computedModifier.value).toNumber(),W).times(st.value)),a[ge]=.3});const oe=o.sub(O,W).toNumber();for(let ge=0;ge0){let W=o.add(D,T);const oe=o.div(D,d.value).floor();W=o.sub(W,o.times(oe,d.value)),v.value.state={...v.value.state,progress:W},o.gt(oe,0)&&O.forEach(ge=>{L(ge,oe),l[ge]=.3})}}e.value=o.add(e.value,o.times(U.value,T)),o.lt(e.value,0)&&(e.value=0,f.value.state={...f.value.state,powered:!1},mr.warning(p("div",null,[p("h3",null,[x("Ran out of energy!")]),p("div",null,[x("All machines have been turned off.")])])))});const xe=N(()=>{var T,D;return m.selectedAction.value===m.types.brokenFactory.actions[0]?-100:m.selectedAction.value===m.types.factory.actions[1]?o.neg(Te[m.selectedNode.value.state].cost):((T=m.selectedAction.value)==null?void 0:T.id)==="moreConnections"?o.neg(m.selectedAction.value.formula.evaluate(((D=m.selectedNode.value)==null?void 0:D.state).maxConnections)):0}),Tt=dn(g.variable(0).add(e),()=>o.neq(xe.value,0),xe),on=N(()=>{var T;return m.selectedAction.value===an?((T=m.selectedNode.value)==null?void 0:T.state).powered?o.eq(u.value,1)?10:o.pow(100,u.value).div(10).times(.99):o.neg(c.value):0}),tt=dn(g.variable(0).add(U),()=>o.neq(on.value,0),on),Dt=N(()=>m.types.portal.nodes.value.filter(T=>Ne(T)));return dt(Dt,T=>{jt(()=>{Q.tabs=["main",...T.map(D=>D.state.id)]})}),dt(et,(T,D)=>{o.lt(T,D)&&(Fn(T,w,"resources"),Fn(T,v,"resources"),Fn(T,b,"tools"),Fn(T,A,"portals"),Fn(T,S,"portals"))}),{name:"World",board:m,energy:e,modifierTabs:Ht,resourceNodes:t,toolNodes:n,influenceNodes:i,grantResource:L,activePortals:Dt,isEmpowered:lt,nextPowerCost:c,computedBonusConnectionsModifier:et,quarryProgressRequired:d,dropRates:Wt,dowsing:w,empowerer:b,booster:A,upgrader:S,resourceLevels:r,planarMultis:Z,display:K(()=>p(ne,null,[p(li,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[Qe(Tt)])," ",x("energy")]),p("span",{class:"nav-segment"},[x("("),p("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(U.value,0)?"+":"",Qe(tt)]),x("/s)")]),o.gt(u.value,0)?p("span",{class:"nav-segment"},[p("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[gt(u.value)])," ",x("machines powered")]):null,p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>q.value=!0},[x("modifiers")])]),Q.devSpeed===0?p("span",{class:"nav-segment"},[x("Game Paused")]):Q.devSpeed!=null&&Q.devSpeed!==1?p("span",{class:"nav-segment"},[x("Dev Speed: "),me(Q.devSpeed),x("x")]):null]}),Qe(m),Qe(j)]))}}),gf=e=>{var i,r,a,l,u;const t=[C];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(Kr(`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},Zi=V(!1);function mf(e,t){}var vf=Object.freeze(Object.defineProperty({__proto__:null,main:C,getInitialLayers:gf,hasWon:Zi,fixOldSave:mf},Symbol.toStringTag,{value:"Module"}));const Xn=e=>(bn("data-v-4a50ce42"),e=e(),yn(),e),hf={class:"game-over-modal-header"},bf=["src","alt"],yf={class:"game-over-modal-title"},wf=Xn(()=>_("h2",null,"Congratulations!",-1)),_f={key:0},Nf=Xn(()=>_("br",null,null,-1)),Cf=Xn(()=>_("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),kf=Xn(()=>_("br",null,null,-1)),Mf=["href"],Sf=Xn(()=>_("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),If=J({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:l}=fe,u=N(()=>fi(Q.timePlayed)),c=N(()=>Zi.value&&!Q.keepGoing),d=tn(Q,"autosave");function m(){Q.keepGoing=!0}function f(){fn(In())}return(h,w)=>(M(),ee(Ut,{"model-value":s(c)},{header:H(()=>[_("div",hf,[s(n)?(M(),E("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,bf)):B("",!0),_("div",yf,[wf,_("h4",null,"You've beaten "+ae(s(t))+" v"+ae(s(a))+": "+ae(s(l)),1)])])]),body:H(({shown:v})=>[v?(M(),E("div",_f,[_("div",null,"It took you "+ae(s(u))+" to beat the game.",1),Nf,Cf,kf,_("div",null,[_("a",{href:s(r),class:"game-over-modal-discord-link"},[Sf,x(" "+ae(s(i)),1)],8,Mf)]),p(Bt,{title:"Autosave",modelValue:s(d),"onUpdate:modelValue":w[0]||(w[0]=b=>De(d)?d.value=b:null)},null,8,["modelValue"])])):B("",!0)]),footer:H(()=>[_("div",{class:"game-over-footer"},[_("button",{onClick:m,class:"button"},"Keep Going"),_("button",{onClick:f,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var $f=ce(If,[["__scopeId","data-v-4a50ce42"]]);const vi=e=>(bn("data-v-2776d67d"),e=e(),yn(),e),xf=vi(()=>_("div",{class:"nan-modal-header"},[_("h2",null,"NaN value detected!")],-1)),Ef={key:0},Pf=vi(()=>_("br",null,null,-1)),Tf=["href"],Df=vi(()=>_("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Ff=vi(()=>_("br",null,null,-1)),Af={class:"nan-footer"},Of=J({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=fe,i=V(!0),r=V(!0),a=tn(Be,"hasNaN"),l=V(null);dt(a,h=>{h?(i.value=Q.autosave,r.value=Q.devSpeed===0):(Q.autosave=i.value,Q.devSpeed=r.value?0:null)});const u=N(()=>{var h;return(h=Be.NaNPath)==null?void 0:h.join(".")}),c=N(()=>Be.NaNPersistent!=null?Be.NaNPersistent.value:null);function d(){Be.NaNPersistent!=null&&(Be.NaNPersistent.value=new o(0),Be.hasNaN=!1)}function m(){Be.NaNPersistent&&(Be.NaNPersistent.value=new o(1),Be.hasNaN=!1)}function f(){Be.NaNPersistent&&(Be.NaNPersistent.value=new o(NaN),Be.hasNaN=!1)}return(h,w)=>(M(),E(ne,null,[p(Ut,zt({modelValue:s(a),"onUpdate:modelValue":w[4]||(w[4]=v=>De(a)?a.value=v:null)},h.$attrs),{header:H(()=>[xf]),body:H(()=>[_("div",null,[x(' Attempted to assign "'+ae(s(u))+'" to NaN',1),s(c)?(M(),E("span",Ef,ae(" ")+"(previously "+ae(s(me)(s(c)))+")",1)):B("",!0),x(". Auto-saving has been "+ae(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Pf,_("div",null,[_("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Df,x(" "+ae(s(t)||"The Paper Pilot Community"),1)],8,Tf)]),Ff,p(Bt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":w[0]||(w[0]=v=>i.value=v)},null,8,["modelValue"]),s(fe).enablePausing?(M(),ee(Bt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":w[1]||(w[1]=v=>r.value=v)},null,8,["modelValue"])):B("",!0)]),footer:H(()=>[_("div",Af,[_("button",{onClick:w[2]||(w[2]=v=>{var b;return(b=l.value)==null?void 0:b.open()}),class:"button"},"Open Saves Manager"),_("button",{onClick:d,class:"button"},"Set to 0"),_("button",{onClick:m,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(M(),E("button",{key:0,onClick:w[3]||(w[3]=v=>a.value=!1),class:"button"}," Set to previous ")):B("",!0),_("button",{onClick:f,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),p(Or,{ref_key:"savesManager",ref:l},null,512)],64))}});var Rf=ce(Of,[["__scopeId","data-v-2776d67d"]]);const qf={key:0,class:"tpsDisplay"},Vf={key:0,class:"low"},Bf=J({__name:"TPS",setup(e){const t=N(()=>o.div(Be.lastTenTicks.length,Be.lastTenTicks.reduce((a,l)=>a+l,0))),n=V([]);_t(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=N(()=>n.value.reduce((a,l)=>o.max(a,l),0)),r=N(()=>o.sub(t.value,i.value).gt(1));return(a,l)=>s(t).isNan()?B("",!0):(M(),E("div",qf,[x(" TPS: "+ae(s(gt)(s(t)))+" ",1),p(xn,{name:"fade"},{default:H(()=>[s(r)?(M(),E("span",Vf,ae(s(gt)(s(i))),1)):B("",!0)]),_:1})]))}});var Lf=ce(Bf,[["__scopeId","data-v-46a3ed5b"]]);var jf=J({__name:"App",setup(e){const t=fe.useHeader,n=N(()=>wt[re.theme].variables),i=tn(re,"showTPS"),r=N(()=>se(K(()=>p(ne,null,[xs.map(Qe)]))));return(a,l)=>(M(),E(ne,null,[_("div",{id:"modal-root",style:Re(s(n))},null,4),_("div",{class:pe(["app",{useHeader:s(t)}]),style:Re(s(n))},[s(t)?(M(),ee(Rr,{key:0})):B("",!0),p(Wl),s(s(i))?(M(),ee(Lf,{key:1})):B("",!0),p($f),p(Rf),(M(),ee(Ue(s(r))))],6)],64))}});var zf=ce(jf,[["__scopeId","data-v-41d15e5e"]]);function Uf(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e;let u,c,d,m;const f=async(w=!0)=>{await d,w&&(u==null||u.addEventListener("controlling",v=>{v.isUpdate&&window.location.reload()})),await(m==null?void 0:m())};async function h(){if("serviceWorker"in navigator){const{Workbox:w,messageSW:v}=await jn(()=>import("./workbox-window.4a8794bb.js"),[]);m=async()=>{c&&c.waiting&&await v(c.waiting,{type:"SKIP_WAITING"})},u=new w("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",b=>{b.isUpdate||i==null||i()});{const b=()=>{n==null||n()};u.addEventListener("waiting",b),u.addEventListener("externalwaiting",b)}u.register({immediate:t}).then(b=>{c=b,a?a("./sw.js",b):r==null||r(b)}).catch(b=>{l==null||l(b)})}}return d=h(),f}function Gf(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e,u=V(!1),c=V(!1);return{updateServiceWorker:Uf({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=fe.title;window.projInfo=fe;if(fe.id==="")throw new Error("Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json");requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c +Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await Cs();const{globalBus:e}=await jn(()=>Promise.resolve().then(function(){return _s}),void 0),{startGameLoop:t}=await jn(()=>import("./gameLoop.d76271d7.js"),["assets/gameLoop.d76271d7.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"]),n=window.vue=ba(zf);e.emit("setupVue",n),n.mount("#app"),jt(()=>{const i=di(),{updateServiceWorker:r}=Gf({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,jn as _,Be as a,fe as b,vf as c,We as g,ks as l,Q as p,re as s}; diff --git a/index.html b/index.html index f88f306..1def7a7 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ Profectus - + diff --git a/sw.js b/sw.js index 5efd334..95c35f9 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.4edcfc7f.js",revision:null},{url:"assets/index.14372fb8.js",revision:null},{url:"assets/index.6d27cf3a.css",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/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:"80a826f8f21c8e6ec42092e7a935b342"},{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.d76271d7.js",revision:null},{url:"assets/index.6d27cf3a.css",revision:null},{url:"assets/index.83d67942.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/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:"05e1fc9af27936e84574da66cbd1ee7d"},{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")))}));