/* empty css */import"./vue.f6263579.js";import{Zasq,qasrt,Casu,tasw,b1asfe,aaasO,aEash,a0asE,a1asc,aKaspe,Gaste,wasye,b2asQt,a8asA,OasY,ayasSt,arasxe,aGaslt,Aasbe,_asU,b6asR,b8asMt,bsas_a,aqastt,buasat,bbasea,TasQa,a7asp,uaskt,jasSa,lasCe,bvasNt,aLasMa,$asM,aNasce,JasF,IasXe,aHas_e,aFasQe,zasze,braska,aJasTa,auasDa,alasGt,aCasRa,bcasAt,aoasVa,bnasPa,beasqa}from"./@vue.4ce677c2.js";import{casta}from"./nanoevents.1080beb7.js";import{LasIe}from"./lz-string.f2f3b7cf.js";import{Dasxa}from"./vuedraggable.c3acdf62.js";import{Yasza}from"./vue-next-select.0dc4e443.js";import{pasFa}from"./vue-textarea-autosize.35804eaf.js";import{Aasaa,TasGa,RasOa,BasUa,uasLa,EasOt}from"./@pixi.1eac1889.js";import{sasJa}from"./semver.83ff78cf.js";import{lasYa}from"./socket.io-client.79ce0df5.js";import{uasna,sasWa}from"./vue-toastification.b7cd620e.js";import{vasXa,nasja}from"./workbox-window.8d14e8b7.js";import"./earcut.b6f90e68.js";import"./sortablejs.cbae5b2d.js";import"./ismobilejs.5c6954b9.js";import"./eventemitter3.dc5195d7.js";import"./url.e51cb87b.js";import"./querystring.23ae9a54.js";import"./lru-cache.9a21e90b.js";import"./yallist.fd762fe7.js";import"./engine.io-client.58517560.js";import"./engine.io-parser.3f360695.js";import"./@socket.io.aec831e2.js";import"./socket.io-parser.544e37d1.js";constKa=function(){constt=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(constiofdocument.querySelectorAll('link[rel="modulepreload"]'))n(i);newMutationObserver(i=>{for(constrofi)if(r.type==="childList")for(constsofr.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});functiona(i){constr={};returni.integrity&&(r.integrity=i.integrity),i.referrerpolicy&&(r.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?r.credentials="include":i.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}functionn(i){if(i.ep)return;i.ep=!0;constr=a(i);fetch(i.href,r)}};Ka();constHa="modulepreload",Ut={},Za="./",gt=function(t,a){return!a||a.length===0?t():Promise.all(a.map(n=>{if(n=`${Za}${n}`,ninUt)return;Ut[n]=!0;consti=n.endsWith(".css"),r=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${r}`))return;consts=document.createElement("link");if(s.rel=i?"stylesheet":Ha,i||(s.as="script",s.crossOrigin=""),s.href=n,document.head.appendChild(s),i)returnnewPromise((o,d)=>{s.addEventListener("load",o),s.addEventListener("error",()=>d(newError(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},$a="./projInfo-schema.json",en="Super Auto Coots",tn="A project made in Profectus",an="superautocoots",nn="thepaperpilot and crea",rn="",sn="",on="0.0.0",ln="Initial Commit",An=!1,un=!1,cn=2,dn=!0,gn=null,mn="",fn=["main"],hn=3600,vn=1,pn=!0,yn="base64";varG={$schema:$a,title:en,description:tn,id:an,author:nn,discordName:rn,discordLink:sn,versionNumber:on,versionTitle:ln,allowGoBack:An,defaultShowSmall:un,defaultDecimalsShown:cn,useHeader:dn,banner:gn,logo:mn,initialTabs:fn,maxTickLength:hn,offlineLimit:vn,enablePausing:pn,exportEncoding:yn};classbn{constructor(t){this.map=newMap,this.first=void0,this.last=void0,this.maxSize=t}getsize(){returnthis.map.size}get(t){consta=this.map.get(t);if(a!==void0)returna!==this.first&&(a===this.last?(this.last=a.prev,this.last.next=void0):(a.prev.next=a.next,a.next.prev=a.prev),a.next=this.first,this.first.prev=a,this.first=a),a.value}set(t,a){if(this.maxSize<1)return;if(this.map.has(t))thrownewError("Cannot update existing keys in the cache");constn=newCn(t,a);for(this.first===void0?(this.first=n,this.last=n):(n.next=this.first,this.first.prev=n,this.first=n),this.map.set(t,n);this.map.size>this.maxSize;){consti=this.last;this.map.delete(i.key),this.last=i.prev,this.last.next=void0}}}classCn{constructor(t,a){this.next=void0,this.prev=void0,this.key=t,this.value=a}}constbt=17,Nn=9e15,En=Math.l
`))!=null?t:""}function Kt(e,t){var a;if(B.isNaN(t))throw Z.hasNaN||(V.autosave=!1,Z.hasNaN=!0,Z.NaNPath=e[Pe],Z.NaNPersistent=e),console.error("Attempted to save NaN value to",(a=e[Pe])==null?void 0:a.join("."),e),"Attempted to set NaN value. See above for details";e[pt].value=t}function bi(e){const t=Ce(e)?e:w(e);Ce(e)&&(e=e.value);const a=q({get(){return t.value},set(i){Kt(n,i)}});a[je]=e;const n={get value(){return t.value},set value(i){Kt(n,i)},__v_isRef:!0,[pt]:t,[je]:e,[ht]:yi(),[Bt]:!1,[wt]:a,[Pe]:void 0};return ue.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",n,`
`+n[ht]):Ye[ue[ue.length-1]].add(n),n}function Ci(e){return e!=null&&typeof e=="object"&&pt in e}$.on("addLayer",(e,t)=>{const a=[],n=(i,r=[])=>{let s=!1;return Object.keys(i).forEach(o=>{let d=i[o];if(d!=null&&typeof d=="object")if(Re in d&&(d=d[Re]),Ci(d)){if(s=!0,d[Bt]){console.warn("Deleted persistent ref present in returned object. Ignoring...",d,`
`+d[ht]);return}Ye[e.id].delete(d);const f=[e.id,...r,o];d[Pe]!=null&&JSON.stringify(f)!==JSON.stringify(d[Pe])&&console.error(`Persistentrefisbeingsavedto\`${f.join(".")}\` when it's already present at \`${d[Pe].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,d),d[Pe]=f;constb=r.reduce((N,y)=>(yinN||(N[y]={}),N[y]),t),v=b[o];b[o]=d[pt],Sa(b)?v!=null?b[o]=v:b[o]=d[je]:v!=null?b[o].value=v:b[o].value=d[je]}else!(dinstanceofB)&&!Ce(d)&&!a.includes(d)&&(typeofd.type=="symbol"&&a.push(d),n(d,[...r,o])&&(Nt(d)&&!Nt(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.",Reini?i[Re]:i,o):s=!0))}),s};n(e[Re]),Ye[e.id].forEach(i=>{i[Bt]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,i,`
Tryingtopop${a.id}`;ue.pop(),ve(a,"color"),ve(a,"display"),ve(a,"classes"),ve(a,"style"),ve(a,"name"),et(a,"name",a.id),ve(a,"minWidth"),et(a,"minWidth",600),ve(a,"minimizable"),et(a,"minimizable",!0),ve(a,"minimizedDisplay");const i=a.style;return a.style=q(()=>{var s,o;let r=u(a.minWidth);return(typeof r=="number"||!Number.isNaN(parseInt(r)))&&(r=r+"px"),[(s=u(i))!=null?s:"",(o=a.minimized)!=null&&o.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:r,flexBasis:r,margin:""}]}),a})}function ba(e,t){if(console.info("Adding layer",e.id),ee[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ee[e.id]);return}et(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ee[e.id]=e,$.emit("addLayer",e,t.layers[e.id])}function Ni(e){return ee[e]}function Ca(e){console.info("Removing layer",e.id),$.emit("removeLayer",e),ee[e.id]=void 0}function Ei(e){Ca(e),ba(e,V)}function Bi(e){const t=w(!1);return{openModal:()=>t.value=!0,modal:J(()=>A(Fe,{modelValue:t.value,"onUpdate:modelValue":a=>t.value=a},{header:()=>A("h2",null,[u(e.name)]),body:u(e.display)}))}}$.on("update",function(t){Object.values(ee).forEach(a=>{a==null||a.emit("preUpdate",t)}),Object.values(ee).forEach(a=>{a==null||a.emit("update",t)}),Object.values(ee).forEach(a=>{a==null||a.emit("postUpdate",t)})});var wi=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:qt,UnregisterNodeInjectionKey:xt,NodesInjectionKey:va,BoundsInjectionKey:pa,layers:ee,persistentRefs:Ye,addingLayers:ue,createLayer:ya,addLayer:ba,getLayer:Ni,removeLayer:Ca,reloadLayer:Ei,setupLayerModal:Bi},Symbol.toStringTag,{value:"Module"}));const Ii=O({components:{Context:ha},props:{index:{type:Number,required:!0},display:{type:ne(Object,String,Function),required:!0},minimizedDisplay:ne(Object,String,Function),minimized:{type:Object,required:!0},name:{type:ne(String),required:!0},color:ne(String),minimizable:ne(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:a,minimized:n,minimizedDisplay:i}=be(e),r=li(t),s=vt(i),o=q(()=>G.allowGoBack&&a.value>0&&!qe(n));function d(){V.tabs.splice(u(e.index),1/0)}function f(b){e.nodes.value=b}return{component:r,minimizedComponent:s,showGoBack:o,updateNodes:f,unref:u,goBack:d}}}),_i={key:1};function Qi(e,t,a,n,i,r){const s=Ma("Context");return h(),E("div",{class:"layer-container",style:Xe({"--layer-color":e.unref(e.color)})},[e.showGoBack?(h(),E("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...o)=>e.goBack&&e.goBack(...o))},"\u274C")):M("",!0),e.unref(e.minimized)?(h(),E("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=o=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(h(),U(ce(e.minimizedComponent),{key:0})):(h(),E("div",_i,F(e.unref(e.name)),1))])):(h(),E("div",{key:2,class:te(["layer-tab",{showGoBack:e.showGoBack}])},[A(s,{onUpdateNodes:e.updateNodes},{default:R(()=>[(h(),U(ce(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(h(),E("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=o=>e.$emit("setMinimized",!0))}," \u25BC ")):M("",!0)],4)}var Si=j(Ii,[["render",Qi],["__scopeId","data-v-a592996e"]]);const Na=e=>(_e("data-v-4b4bda40"),e=e(),Qe(),e),Mi=Na(()=>c("h2",null,"Changelog",-1)),ki=Na(()=>c("details",{open:""},[c("summary",null,[p("v0.0 Initial Commit - "),c("time",null,"2021-09-04")]),p(" This is the first release :D "),c("ul",null,[c("li",{class:"feature"},"Did everything"),c("li",{class:"fix"},"Had some fun"),c("li",{class:"breaking"},"Removed everything"),c("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Ti=O({__name:"Changelog",setup(e,{expose:t}){const a=w(!1);return t({open(){a.value=!0}}),(n,i)=>(h(),U(Fe,{modelValue:a.value,"onUpdate:modelValue":i[0]||(i[0]=r=>a.value=r)},{header:R(()=>[Mi]),body:R(()=>[ki]),_:1},8,["modelValue"]))}});var Di=j(Ti,[["__scopeId","data-v-4b4bda40"]]),Ri=O({props:{element:Object,display:{type:ne(Object,String,Function),required:!0},style:ne(Object,String,Array),classes:ne(Obje
${_}`)}}return f[C]}fe(a,C=>{C&&Object.keys(f).forEach(_=>delete f[_])});const v=q(()=>x.saves.reduce((C,_)=>(C[_]=b(_),C),{}));function N(C){let _;switch(V.id===C?_=da(V):_=JSON.stringify(v.value[C]),G.exportEncoding){default:console.warn(`Unknownsaveencoding:${G.exportEncoding}.Defaultingtolz`);case"lz":_=Ie.compressToUTF16(_);break;case"base64":_=btoa(unescape(encodeURIComponent(_)));break;case"plain":break}const P=document.createElement("textarea");P.value=_,document.body.appendChild(P),P.select(),P.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(P)}function y(C){V.id===C&&se();const _={...v.value[C],id:dt()};se(_),x.saves.push(_.id)}function I(C){x.saves=x.saves.filter(_=>_!==C),localStorage.removeItem(C),f[C]=void 0}function Q(C){v.value[V.id].time=V.time,se(),f[V.id]=void 0,Ve(v.value[C]),f[C]=void 0}function S(C){if(s.value=C,xe(()=>{s.value=null}),C[0]!=="{")if(C[0]==="e")C=decodeURIComponent(escape(atob(C)));else if(C[0]==="\u1BE1")C=Ie.decompressFromUTF16(C);else{console.warn("Unable to determine preset encoding",C);return}const _=JSON.parse(C);_.id=dt(),se(_),x.saves.push(_.id),Q(_.id)}function H(C,_){const P=v.value[C];P!=null&&(P.name=_,V.id===C?(V.name=_,se()):(se(P),f[C]=void 0))}return(C,_)=>(h(),U(Fe,{modelValue:a.value,"onUpdate:modelValue":_[4]||(_[4]=P=>a.value=P),ref_key:"modal",ref:n},{header:R(()=>[Pr]),body:R(({shown:P})=>[P?(h(),U(u(xa),{key:0,list:u(x).saves,handle:".handle",itemKey:ae=>ae},{item:R(({element:ae})=>[A(Vr,{save:u(v)[ae],onOpen:ge=>Q(ae),onExport:ge=>N(ae),onEditName:ge=>H(ae,ge),onDuplicate:ge=>y(ae),onDelete:ge=>I(ae)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):M("",!0)]),footer:R(()=>[c("div",qr,[A(zt,{modelValue:r.value,"onUpdate:modelValue":_[0]||(_[0]=P=>r.value=P),title:"Import Save",placeholder:"Paste your save here!",class:te({importingFailed:i.value})},null,8,["modelValue","class"]),c("div",xr,[zr,c("div",Fr,[c("button",{class:"button",onClick:_[1]||(_[1]=P=>Q(u(Le)().id))},"New Game"),Object.keys(u(d)).length>0?(h(),U(nr,{key:0,options:u(d),modelValue:s.value,"onUpdate:modelValue":_[2]||(_[2]=P=>S(P)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):M("",!0)])]),c("div",Gr,[Or,c("button",{class:"button modal-default-button",onClick:_[3]||(_[3]=P=>a.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Ea=j(Ur,[["__scopeId","data-v-5b5b1604"]]);const de=e=>(_e("data-v-269f7a94"),e=e(),Qe(),e),Lr=["src","alt"],Jr={key:1,class:"title"},Yr=de(()=>c("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Wr={class:"discord"},Xr={class:"discord-links"},jr={key:0},Kr=["href"],Hr=de(()=>c("li",null,[c("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Zr=de(()=>c("li",null,[c("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),$r={href:"https://forums.moddingtree.com/",target:"_blank"},es=de(()=>c("span",{class:"material-icons"},"forum",-1)),ts=de(()=>c("span",{class:"material-icons"},"info",-1)),as=de(()=>c("span",{class:"material-icons"},"settings",-1)),ns=de(()=>c("span",{class:"material-icons"},"settings",-1)),is=de(()=>c("span",{class:"material-icons"},"info",-1)),rs={href:"https://forums.moddingtree.com/",target:"_blank"},ss=de(()=>c("span",{class:"material-icons"},"forum",-1)),os={class:"discord"},ls={class:"discord-links"},As={key:0},us=["href"],cs=de(()=>c("li",null,[c("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),ds=de(()=>c("li",null,[c("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),gs=O({__name:"Nav",setup(e){const t=w(null),a=w(null),n=w(null),i=w(null),{useHeader:r,banner:s,title:o,discordName:d,discordLink:f,versionNumber:b}=G;function v(){window.open(f,"mywindow")}return(N,y)=>(h(),E(Y,null,[u(r)?(h(),E("div",tt({key:0,class:"nav"},N.$attrs),[u(s)?(h(),E("img",{key:0,src:u(s),class:"banner",alt:u(o)},null,8,Lr)):(h(),E("div",Jr,F(u(o)),1)),c("div",{onClick:y[0]|
Learnmoreatwww.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await Zn();const{globalBus:e}=await gt(()=>Promise.resolve().then(function(){return Kn}),void 0),{startGameLoop:t}=await gt(()=>import("./gameLoop.aa9dc104.js"),["assets/gameLoop.aa9dc104.js","assets/@fontsource.f66d05e7.css","assets/vue.f6263579.js","assets/earcut.b6f90e68.js","assets/@vue.4ce677c2.js","assets/nanoevents.1080beb7.js","assets/lz-string.f2f3b7cf.js","assets/vuedraggable.c3acdf62.js","assets/sortablejs.cbae5b2d.js","assets/vue-next-select.0dc4e443.js","assets/vue-next-select.9e6f4164.css","assets/vue-textarea-autosize.35804eaf.js","assets/@pixi.1eac1889.js","assets/ismobilejs.5c6954b9.js","assets/eventemitter3.dc5195d7.js","assets/url.e51cb87b.js","assets/querystring.23ae9a54.js","assets/semver.83ff78cf.js","assets/lru-cache.9a21e90b.js","assets/yallist.fd762fe7.js","assets/socket.io-client.79ce0df5.js","assets/engine.io-client.58517560.js","assets/engine.io-parser.3f360695.js","assets/@socket.io.aec831e2.js","assets/socket.io-parser.544e37d1.js","assets/vue-toastification.b7cd620e.js","assets/vue-toastification.4b5f8ac8.css","assets/workbox-window.8d14e8b7.js"]),a=window.vue=qa(ll);e.emit("setupVue",a),a.mount("#app"),xe(()=>{const n=na(),{updateServiceWorker:i}=ul({onNeedRefresh(){n.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(){n.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(r){r&&setInterval(()=>r.update(),60*60*1e3)}})}),t()});export{B as D,gt as _,Z as a,G as b,qo as c,$ as g,$n as l,V as p,x as s};