/* empty css */import"./vue.359c6955.js";import{qasit,Casl,abasq,tasx,aFash,a1asN,aLasRe,bvasgt,Gaste,asasKe,_asE,azasyt,a2asg,JasV,OasW,aKasLe,a0as$,Iasme,a8asT,a9asy,b7asO,aIasCe,aGaske,uasOt,b2ashe,lasre,jasZn,bwasfn,aHasCt,Aasde,$asR,b9asYt,btasXn,arasPe,bcasNn,TasQn,b3asAe,aMasze,aDasCn,was_e,aOasse,zasFe,bsaser,amasMt,Hastr,yasgn,boasnr,ayasrr,bfasir}from"./@vue.6f8187b0.js";import{LasGe}from"./lz-string.bfbf8ec3.js";import{caskn}from"./nanoevents.1080beb7.js";import{iasar}from"./unofficial-galaxy-sdk.21372393.js";import{passr}from"./vue-textarea-autosize.35804eaf.js";import{Dasor}from"./vuedraggable.055200e5.js";import{Yaslr}from"./vue-next-select.68e0c605.js";import{sasur,uascr}from"./vue-toastification.45d39007.js";import"./sortablejs.20039f18.js";constdr=function(){constt=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(constiofdocument.querySelectorAll('link[rel="modulepreload"]'))r(i);newMutationObserver(i=>{for(constaofi)if(a.type==="childList")for(constsofa.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});functionn(i){consta={};returni.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}functionr(i){if(i.ep)return;i.ep=!0;consta=n(i);fetch(i.href,a)}};dr();constfr="modulepreload",mn={},gr="./",mt=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${gr}${r}`,rinmn)return;mn[r]=!0;consti=r.endsWith(".css"),a=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${a}`))return;consts=document.createElement("link");if(s.rel=i?"stylesheet":fr,i||(s.as="script",s.crossOrigin=""),s.href=r,document.head.appendChild(s),i)returnnewPromise((c,d)=>{s.addEventListener("load",c),s.addEventListener("error",()=>d(newError(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},mr="./projInfo-schema.json",hr="Profectus",pr="A project made in Profectus",vr="",br="",yr="",_r="",wr="0.0",Nr="Initial Commit",Cr=!0,kr=!1,Sr=2,Ir=!0,$r=null,Mr="",xr=["main"],Tr=3600,Pr=1,Fr=!0,Er="base64",Or=!1;varU={$schema:mr,title:hr,description:pr,id:vr,author:br,discordName:yr,discordLink:_r,versionNumber:wr,versionTitle:Nr,allowGoBack:Cr,defaultShowSmall:kr,defaultDecimalsShown:Sr,useHeader:Ir,banner:$r,logo:Mr,initialTabs:xr,maxTickLength:Tr,offlineLimit:Pr,enablePausing:Fr,exportEncoding:Er,disableHealthWarning:Or};constVr=it({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});varF=window.player=Vr;functionrt(e){returnJSON.stringify(e,(t,n)=>{varr;return(r=l(n))!=null?r:null})}varH=(e,t)=>{constn=e.__vccOpts||e;for(const[r,i]oft)n[r]=i;returnn};constLr=["onClick"],Dr=q({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){constn=x(!1),r=x(null);functioni(){t("click"),r.value&&clearTimeout(r.value),n.value=!1,Ke(()=>{n.value=!0,r.value=setTimeout(()=>n.value=!1,500)})}return(a,s)=>(h(),N("button",{onClick:gt(i,["stop"]),class:te(["feedback",{activated:n.value,left:e.left}])},[Re(a.$slots,"default",{},void0,!0)],10,Lr))}});varZt=H(Dr,[["__scopeId","data-v-01a1b95c"]]);constVt=e=>(Ce("data-v-ac351c02"),e=e(),ke(),e),Rr={class:"error"},Ar={class:"error-title"},qr={class:"error-details",style:{"margin-top":"-10px"}},Br={key:0},Ur={class:"instructions"},zr=["href"],Gr=Vt(()=>g("span",{class:"material-icons",style:{"font-size":"16px"}},"content_paste",-1)),Hr=Vt(()=>g("span",{style:{"margin-left":"8px","font-size":"medium"}},"Copy Save",-1)),jr=Vt(()=>g("br",null,null,-1)),Wr={key:0,style:{"margin-top":"20px"}},Jr=Vt(()=>g("h3",null,"Other errors",-1)),Kr=[Jr],Yr={class:"error-details"},Zr={key:0,style:{"margin-top":"10px"}},Xr={key:1,st
`))!=null?t:""}function yn(e,t){var n;u.isNaN(t)&&(j.hasNaN||(F.autosave=!1,j.hasNaN=!0,j.NaNPath=e[Je],j.NaNPersistent=e),console.error(`AttemptedtosaveNaNvalueto${(n=e[Je])==null?void0:n.join(".")}`)),e[tt].value=t}function _t(e,t=!0){const n=re(e)?e:x(e);re(e)&&(e=e.value);const r=E({get(){return n.value},set(a){t?yn(i,a):i[tt].value=a}});r[Ye]=e;const i={get value(){return n.value},set value(a){t?yn(i,a):i[tt].value=a},__v_isRef:!0,[tt]:n,[Ye]:e,[Tt]:fs(),[Wt]:!1,[De]:r,[Je]:void 0};return ye.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",i,`
Createdat:
`+i[Tt]):nt[ye[ye.length-1]].add(i),i}function gs(e){return e!=null&&typeof e=="object"&&tt in e}oe.on("addLayer",(e,t)=>{const n=[],r=(i,a=[])=>{let s=!1;return Object.keys(i).forEach(c=>{let d=i[c];if(d!=null&&typeof d=="object"){if(d[Jt]===!0)return;if(We in d&&(d=d[We]),gs(d)){if(s=!0,d[Wt]){console.warn("Deleted persistent ref present in returned object. Ignoring...",d,`
Createdat:
`+d[Tt]);return}nt[e.id].delete(d);const f=[e.id,...a,c];d[Je]!=null&&JSON.stringify(f)!==JSON.stringify(d[Je])&&console.error(`Persistentrefisbeingsavedto\`${f.join(".")}\` when it's already present at \`${d[Je].join(".")}\`.`,"This can cause unexpected behavior when loading saves between updates."),d[Je]=f;constb=a.reduce((w,k)=>(kinw||(w[k]={}),w[k]),t),v=b[c];b[c]=d[tt],Zn(b)?v!=null?b[c]=v:b[c]=d[Ye]:v!=null?b[c].value=v:b[c].value=d[Ye]}else!(dinstanceofu)&&!(dinstanceofo)&&!re(d)&&!n.includes(d)&&(typeofd.type=="symbol"&&n.push(d),r(d,[...a,c])&&(fn(d)&&!fn(i)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",Weini?i[We]:i,c):s=!0))}}),s};r(e[We]),nt[e.id].forEach(i=>{i[Wt]||console.error(`Created persistent ref in ${e.id} without registering it to the layer!`,`Make sure to include everything persistent in the returned object.
Createdat:
`+i[Tt])}),nt[e.id].clear()});const tn=Symbol("RegisterNode"),nn=Symbol("UnregisterNode"),rn=Symbol("Nodes"),an=Symbol("Bounds"),le=Ot({});window.layers=le;const nt={},ye=[];function sn(e,t){return Ze(()=>{const n={},r=n.emitter=kn();if(n.on=r.on.bind(r),n.emit=r.emit.bind(r),n.nodes=x({}),n.id=e,ye.push(e),nt[e]=new Set,n.minimized=_t(!1,!1),Object.assign(n,t.call(n,n)),ye[ye.length-1]==null||ye[ye.length-1]!==e)throw new Error(`Addinglayersstackininvalidstate.Thisshouldnothappen
Tryingtopop${n.id}`);ye.pop(),L(n,"color"),L(n,"display"),L(n,"classes"),L(n,"style"),L(n,"name"),ce(n,"name",n.id),L(n,"minWidth"),ce(n,"minWidth",600),L(n,"minimizable"),ce(n,"minimizable",!0),L(n,"minimizedDisplay");const i=n.style;return n.style=E(()=>{var s,c;let a=l(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(s=l(i))!=null?s:"",(c=n.minimized)!=null&&c.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Rn(e,t){if(console.info("Adding layer",e.id),le[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,le[e.id]);return}ce(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),le[e.id]=e,oe.emit("addLayer",e,t.layers[e.id])}function ms(e){return le[e]}function An(e){console.info("Removing layer",e.id),oe.emit("removeLayer",e),le[e.id]=void 0}function hs(e){An(e),Rn(e,F)}function ps(e){const t=x(!1);return{openModal:()=>t.value=!0,modal:ee(()=>y(Ee,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>y("h2",null,[l(e.name)]),body:l(e.display)}))}}oe.on("update",function(t){Object.values(le).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(le).forEach(n=>{n==null||n.emit("update",t)}),Object.values(le).forEach(n=>{n==null||n.emit("postUpdate",t)})});var vs=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:tn,UnregisterNodeInjectionKey:nn,NodesInjectionKey:rn,BoundsInjectionKey:an,layers:le,persistentRefs:nt,addingLayers:ye,createLayer:sn,addLayer:Rn,getLayer:ms,removeLayer:An,reloadLayer:hs,setupLayerModal:ps},Symbol.toStringTag,{value:"Module"}));const bs=q({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var b;const n=x({}),r=new ResizeObserver(c),i=x(null);yt(()=>{const v=i.value;v!=null&&r.observe(v)});let a=!0,s=x((b=i.value)==null?void 0:b.getBoundingClientRect());function c(){a&&(a=!1,Ke(()=>{var v;s.value=(v=i.value)==null?void 0:v.getBoundingClientRect(),Object.values(n.value).filter(w=>w).forEach(w=>w.rect=w.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}oe.on("fontsLoaded",c);const d={attributes:!1,childList:!0,subtree:!1};Ct(tn,(v,w)=>{const k=new MutationObserver(()=>f(v));k.observe(w,d),n.value[v]={element:w,observer:k,rect:w.getBoundingClientRect()},c()}),Ct(nn,v=>{var w;(w=n.value[v])==null||w.observer.disconnect(),n.value[v]=void 0,c()}),Ct(rn,n),Ct(an,s);function f(v){const w=n.value[v];w!=null&&(w.rect=w.element.getBoundingClientRect(),t("updateNodes",n.value))}return(v,w)=>(h(),N(W,null,[Re(v.$slots,"default",{},void 0,!0),g("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var qn=H(bs,[["__scopeId","data-v-2b1dc1bc"]]);const ys=["onPointerdown"],_s={class:"modal-wrapper"},ws=["width"],Ns={class:"modal-header"},Cs={class:"modal-body"},ks={class:"modal-footer"},Ss=g("div",{class:"modal-default-flex-grow"},null,-1),Ee=q({__name:"Modal",props:{modelValue:{type:Boolean},preventClosing:{type:Boolean},width:null},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=de(e),a=E(()=>l(i.modelValue)||c.value);function s(){l(i.preventClosing)!==!0&&n("update:modelValue",!1)}const c=x(!1),d=x(null),f=E(()=>{var b,v;return(v=(b=d.value)==null?void 0:b.nodes)!=null?v:null});return t({isOpen:a,nodes:f}),(b,v)=>(h(),R(Qn,{to:"#modal-root"},[y(Nn,{name:"modal",onBeforeEnter:v[0]||(v[0]=w=>c.value=!0),onAfterLeave:v[1]||(v[1]=w=>c.value=!1),appear:""},{default:O(()=>[Yt(g("div",Pe({class:"modal-mask",onPointerdown:gt(s,["self"])},b.$attrs),[g("div",_s,[g("div",{class:"modal-container",width:e.width},[g("div",Ns,[Re(b.$slots,"header",{shown:l(a)},()=>[T(" default header ")])]),g("div",Cs,[y(qn,{ref_key:"contextRef",ref:d},{default:O(()=>[Re(b.$slots,"body",{shown:l(a)},()=>[T(" default body ")])]),_:3},512)]),g("div",ks,[Re(b.$slots,"footer",{shown:l(a)},()=>[g("div",{class:"modal-default-footer"},[Ss,g("button",{class:"button modal-default-button",onClick:s}," Close ")])])])],8,ws)])],16,ys),[[Xn,e.modelValue]
Learnmoreatwww.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await ti();const{globalBus:e}=await mt(()=>Promise.resolve().then(function(){return ei}),void 0),{startGameLoop:t}=await mt(()=>import("./gameLoop.5decf1a9.js"),["assets/gameLoop.5decf1a9.js","assets/@fontsource.f66d05e7.css","assets/vue.359c6955.js","assets/lz-string.bfbf8ec3.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/unofficial-galaxy-sdk.21372393.js","assets/vue-textarea-autosize.35804eaf.js","assets/vuedraggable.055200e5.js","assets/sortablejs.20039f18.js","assets/vue-next-select.68e0c605.js","assets/vue-next-select.9e6f4164.css","assets/vue-toastification.45d39007.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=ir(bc);n.config.errorHandler=function(r,i,a){console.error(r,a,i)},e.emit("setupVue",n),n.mount("#app"),Ke(()=>{const r=cr(),{updateServiceWorker:i}=_c({onNeedRefresh(){r.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){r.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{u as D,mt as _,j as a,U as b,Tl as c,oe as g,en as l,F as p,G as s};