Planar-Pioneers/assets/index.633b0df4.js

19 lines
152 KiB
JavaScript
Raw Normal View History

/* empty css */import"./vue.804e2479.js";import{_ as I,C as a,l as ue,q as _t,t as F,b2 as Fe,ab as j,aD as $n,w as Te,b3 as Le,a9 as _,O as ie,az as Jt,as as ut,aF as N,a1 as S,aL as Je,a2 as p,aH as qt,A as me,$ as Z,b7 as O,b9 as an,ar as qe,bv as vt,a8 as D,bt as ci,bc as bt,T as di,u as on,j as gi,bw as hn,aM as jt,a0 as V,aO as Se,J as H,G as ae,I as Pe,aI as ct,aG as dt,z as Ke,bo as fi,bs as mi,aK as yt,bd as vn,am as Gt,H as pi,bf as hi}from"./@vue.6f8187b0.js";import{c as Tn}from"./nanoevents.1080beb7.js";import{L as Ze}from"./lz-string.dccec454.js";import{Y as vi}from"./vue-next-select.f5f69b1a.js";import{D as bi}from"./vuedraggable.ce650350.js";import{p as yi}from"./vue-textarea-autosize.35804eaf.js";import{P as _i}from"./vue-panzoom.89be130f.js";import{s as wi,u as Fn}from"./vue-toastification.5231d1bd.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";const Ni=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerpolicy&&(s.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?s.credentials="include":r.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}};Ni();const Ci="modulepreload",bn={},ki="./",$t=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${ki}${i}`,i in bn)return;bn[i]=!0;const r=i.endsWith(".css"),s=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${s}`))return;const l=document.createElement("link");if(l.rel=r?"stylesheet":Ci,r||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),r)return new Promise((o,c)=>{l.addEventListener("load",o),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Si="./projInfo-schema.json",xi="Planar Pioneers",Ii="A game about controlling and exploiting planes!",Mi="planar-pioneers",Ei="thepaperpilot",$i="",Ti="",Fi="0.0",Pi="Initial Commit",Di=!0,Vi=!1,Ai=2,Oi=!0,Li=null,Bi="",qi=["main"],Ri=3600,Ui=0,zi=!0,ji="base64";var J={$schema:Si,title:xi,description:Ii,id:Mi,author:Ei,discordName:$i,discordLink:Ti,versionNumber:Fi,versionTitle:Pi,allowGoBack:Di,defaultShowSmall:Vi,defaultDecimalsShown:Ai,useHeader:Oi,banner:Li,logo:Bi,initialTabs:qi,maxTickLength:Ri,offlineLimit:Ui,enablePausing:zi,exportEncoding:ji};class Gi{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const i=new Wi(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class Wi{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const tn=17,Hi=9e15,Zi=Math.log10(9e15),Yi=1/9e15,Ji=308,Ki=-324,yn=5,Xi=(1<<10)-1,Qi=function(){const e=[];for(let n=Ki+1;n<=Ji;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),tt=[2,Math.E,3,4,5,6,7,8,9,10],er=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.8804192098842727,2],[1,1.1121
`,e),await rt(pt())}}function pt(){const e=zt(),t=Rn({id:e});return ke(t),K.saves.push(e),t}function zt(){let e,t=0;do e=`${J.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Cr=F(!1);async function rt(e){console.info("Loading save",e),Cr.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await $t(()=>Promise.resolve().then(function(){return jr}),void 0),{fixOldSave:r,getInitialLayers:s}=await $t(()=>Promise.resolve().then(function(){return pu}),void 0);for(const l in t){const o=t[l];o&&n(o)}s(e).forEach(l=>i(l,e)),e=Rn(e),e.offlineProd&&e.time!=null&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,J.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==J.versionNumber&&(r(e.modVersion,e),e.modVersion=J.versionNumber),Object.assign(U,e),K.active=U.id,Ce.emit("onLoad")}setInterval(()=>{U.autosave&&ke()},1e3);window.onbeforeunload=()=>{U.autosave&&ke()};window.save=ke;const kr=window.hardReset=async()=>{await rt(pt())};window.deleteLowerSaves=()=>{const e=Object.values(K.saves).indexOf(U.id)+1;Object.values(K.saves).slice(e).forEach(t=>localStorage.removeItem(t)),K.saves=K.saves.slice(0,e)};const Dt=_t({active:"",saves:[],showTPS:!0,theme:ln.Nordic,unthrottled:!1,alignUnits:!1});Fe(Dt,e=>{const t=Ze.compressToUTF16(JSON.stringify(e));localStorage.setItem(J.id,t)},{deep:!0});var K=window.settings=Dt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:ln.Nordic,alignUnits:!1};Ce.emit("loadSettings",e),Object.assign(Dt,e),kr()};function Sr(){try{let e=localStorage.getItem(J.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Ze.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Dt,t)}Ce.emit("loadSettings",Dt)}catch{}}const xr=_t([]),Ir=_t([]),Mr=_t([]);function he(e,t="span"){return typeof e=="function"?j({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),j({template:e})):j({render:()=>({})}):e}function We(e){if(st(e))return typeof e=="function"?e():he(e);const t=e[Pt];return _(t,e[Kt](),null)}function Be(e){if(st(e))return typeof e=="function"?e():typeof e=="string"?_(ie,null,[e]):_(e,null,null);const t=e[Pt];return _(t,e[Kt](),null)}function st(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Ft]===!0}function Un(e,t){const n=F(null),i=F(void 0);function r(o){n.value||(n.value=setInterval(l,250)),i.value=o}function s(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return $n(s),{start:r,stop:s,handleHolding:l}}function zn(e,t="div"){const n=Te();return Le(()=>{n.value=he(we(e),t)}),n}function Ot(e,t="div"){const n=Te(null);return Le(()=>{const i=we(e);n.value=i==""||i==null?null:he(i,t)}),n}function we(e){return a(a(e))}function q(...e){return e.includes(Object)||e.push(Object),e}var Q=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Er=j({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var b;const n=F({}),i=new ResizeObserver(o),r=F(null);Jt(()=>{const m=r.value;m!=null&&i.observe(m)});let s=!0,l=F((b=r.value)==null?void 0:b.getBoundingClientRect());function o(){s&&(s=!1,ut(()=>{var m;l.value=(m=r.value)==null?void 0:m.getBoundingClientRect(),Object.values(n.value).filter(w=>w).forEach(w=>w.rect=w.element.getBoundingClientRect()),t("updateNodes",n.value),s=!0}))}Ce.on("fontsLoaded",o);const c={attributes:!1,childList:!0,subtree:!1};qt(un,(m,w)=>{const y=new MutationObserver(()=>d(m));y.observe(w,c),n.value[m]={element:w,observer:y,rect:w.getBoundingClientRect()},o()}),qt(cn,m=>{var w;(w=n.value[m])==null||w.observer.disconnect(),n.value[m]=void 0,o()}),qt(dn,n),qt(gn,l);function d(m){const w=n.value[m];w!=null&&(w.rect=w.element.getBoundingClientRect(),t("updateNodes",n.value))}return(m,w)=>(N(),S(ie,null,[Je(m.$slots,"default",{},void 0,!0),p("di
`).slice(3,5).map(n=>n.trim()).join(`
`))!=null?t:""}function Cn(e,t){var n;if(u.isNaN(t))throw ge.hasNaN||(U.autosave=!1,ge.hasNaN=!0,ge.NaNPath=e[at],ge.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[at])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[ht].value=t}function Nt(e,t=!0){const n=ue(e)?e:F(e);ue(e)&&(e=e.value);const i=I({get(){return n.value},set(s){t?Cn(r,s):r[ht].value=s}});i[Vt]=e;const r={get value(){return n.value},set value(s){t?Cn(r,s):r[ht].value=s},__v_isRef:!0,[ht]:n,[Vt]:e,[Zt]:Lr(),[Yt]:!1,[Ye]:i,[at]:void 0};return Ne.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,`
Created at:
`+r[Zt]):lt[Ne[Ne.length-1]].add(r),r}function Br(e){return e!=null&&typeof e=="object"&&ht in e}function qr(e){Ne.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):lt[Ne[Ne.length-1]].delete(e),e[Yt]=!0}Ce.on("addLayer",(e,t)=>{const n=[],i=(r,s=[])=>{let l=!1;return Object.keys(r).forEach(o=>{let c=r[o];if(c!=null&&typeof c=="object"){if(c[Or]===!0)return;if(it in c&&(c=c[it]),Br(c)){if(l=!0,c[Yt]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
Created at:
`+c[Zt]);return}lt[e.id].delete(c);const d=[e.id,...s,o];c[at]!=null&&JSON.stringify(d)!==JSON.stringify(c[at])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[at].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[at]=d;const b=s.reduce((w,y)=>(y in w||(w[y]={}),w[y]),t),m=b[o];b[o]=c[ht],gi(b)?m!=null?b[o]=m:b[o]=c[Vt]:m!=null?b[o].value=m:b[o].value=c[Vt]}else!(c instanceof u)&&!ue(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...s,o])&&(hn(c)&&!hn(r)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",it in r?r[it]:r,o):l=!0))}}),l};i(e[it]),lt[e.id].forEach(r=>{r[Yt]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,`
Created at:
`+r[Zt])}),lt[e.id].clear()});const un=Symbol("RegisterNode"),cn=Symbol("UnregisterNode"),dn=Symbol("Nodes"),gn=Symbol("Bounds"),_e=on({});window.layers=_e;const lt={},Ne=[];function Gn(e,t){return wt(()=>{const n={},i=n.emitter=Tn();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=F({}),n.id=e,Ne.push(e),lt[e]=new Set,n.minimized=Nt(!1,!1),Object.assign(n,t.call(n,n)),Ne[Ne.length-1]==null||Ne[Ne.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${Ne}
Trying to pop ${n.id}`;Ne.pop(),A(n,"color"),A(n,"display"),A(n,"classes"),A(n,"style"),A(n,"name"),de(n,"name",n.id),A(n,"minWidth"),de(n,"minWidth",600),A(n,"minimizable"),de(n,"minimizable",!0),A(n,"minimizedDisplay");const r=n.style;return n.style=I(()=>{var l,o;let s=a(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(l=a(r))!=null?l:"",(o=n.minimized)!=null&&o.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),n})}function Wn(e,t){if(console.info("Adding layer",e.id),_e[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,_e[e.id]);return}de(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),_e[e.id]=e,Ce.emit("addLayer",e,t.layers[e.id])}function Rr(e){return _e[e]}function Hn(e){console.info("Removing layer",e.id),Ce.emit("removeLayer",e),_e[e.id]=void 0}function Ur(e){Hn(e),Wn(e,U)}function zr(e){const t=F(!1);return{openModal:()=>t.value=!0,modal:ne(()=>_(Qe,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>_("h2",null,[a(e.name)]),body:a(e.display)}))}}Ce.on("update",function(t){Object.values(_e).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(_e).forEach(n=>{n==null||n.emit("update",t)}),Object.values(_e).forEach(n=>{n==null||n.emit("postUpdate",t)})});var jr=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:un,UnregisterNodeInjectionKey:cn,NodesInjectionKey:dn,BoundsInjectionKey:gn,layers:_e,persistentRefs:lt,addingLayers:Ne,createLayer:Gn,addLayer:Wn,getLayer:Rr,removeLayer:Hn,reloadLayer:Ur,setupLayerModal:zr},Symbol.toStringTag,{value:"Module"}));const Gr=j({components:{Context:jn},props:{index:{type:Number,required:!0},display:{type:q(Object,String,Function),required:!0},minimizedDisplay:q(Object,String,Function),minimized:{type:Object,required:!0},name:{type:q(String),required:!0},color:q(String),minimizable:q(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=me(e),s=zn(t),l=Ot(r),o=I(()=>J.allowGoBack&&n.value>0&&!we(i));function c(){U.tabs.splice(a(e.index),1/0)}function d(b){e.nodes.value=b}return{component:s,minimizedComponent:l,showGoBack:o,updateNodes:d,unref:a,goBack:c}}}),Wr={key:1};function Hr(e,t,n,i,r,s){const l=jt("Context");return N(),S("div",{class:"layer-container",style:Pe({"--layer-color":e.unref(e.color)})},[e.showGoBack?(N(),S("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...o)=>e.goBack&&e.goBack(...o))},"\u274C")):V("",!0),e.unref(e.minimized)?(N(),S("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=o=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(N(),Z(Se(e.minimizedComponent),{key:0})):(N(),S("div",Wr,H(e.unref(e.name)),1))])):(N(),S("div",{key:2,class:ae(["layer-tab",{showGoBack:e.showGoBack}])},[_(l,{onUpdateNodes:e.updateNodes},{default:O(()=>[(N(),Z(Se(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(N(),S("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=o=>e.$emit("setMinimized",!0))}," \u25BC ")):V("",!0)],4)}var Zr=Q(Gr,[["render",Hr],["__scopeId","data-v-72dd78b1"]]);const Zn=e=>(ct("data-v-4b4bda40"),e=e(),dt(),e),Yr=Zn(()=>p("h2",null,"Changelog",-1)),Jr=Zn(()=>p("details",{open:""},[p("summary",null,[D("v0.0 Initial Commit - "),p("time",null,"2021-09-04")]),D(" This is the first release :D "),p("ul",null,[p("li",{class:"feature"},"Did everything"),p("li",{class:"fix"},"Had some fun"),p("li",{class:"breaking"},"Removed everything"),p("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Kr=j({__name:"Changelog",setup(e,{expose:t}){const n=F(!1);return t({open(){n.value=!0}}),(i,r)=>(N(),Z(Qe,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s)},{header:O(()=>[Yr]),body:O(()=>[Jr]),_:1},8,["modelValue"]))}});var Xr=Q(Kr,[["__scopeId","data-v-4b4bda40"]]),Qr=j({props:{element:Object,display:{type:q(Object,String,Function),required:!0},style:q(Object,String,Array),classes:q(Object),directio
${B}
${E}`)}}return d[k]}Fe(n,k=>{k&&Object.keys(d).forEach(E=>delete d[E])});const m=I(()=>K.saves.reduce((k,E)=>(k[E]=b(E),k),{}));function w(k){let E;switch(U.id===k?E=qn(U):E=JSON.stringify(m.value[k]),J.exportEncoding){default:console.warn(`Unknown save encoding: ${J.exportEncoding}. Defaulting to lz`);case"lz":E=Ze.compressToUTF16(E);break;case"base64":E=btoa(unescape(encodeURIComponent(E)));break;case"plain":break}const B=document.createElement("textarea");B.value=E,document.body.appendChild(B),B.select(),B.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(B)}function y(k){U.id===k&&ke();const E={...m.value[k],id:zt()};ke(E),K.saves.push(E.id)}function h(k){K.saves=K.saves.filter(E=>E!==k),localStorage.removeItem(k),d[k]=void 0}function C(k){m.value[U.id].time=U.time,ke(),d[U.id]=void 0,rt(m.value[k]),d[k]=void 0}function $(k){if(l.value=k,ut(()=>{l.value=null}),k[0]!=="{")if(k[0]==="e")k=decodeURIComponent(escape(atob(k)));else if(k[0]==="\u1BE1")k=Ze.decompressFromUTF16(k);else{console.warn("Unable to determine preset encoding",k);return}const E=JSON.parse(k);E.id=zt(),ke(E),K.saves.push(E.id),C(E.id)}function P(k,E){const B=m.value[k];B!=null&&(B.name=E,U.id===k?(U.name=E,ke()):(ke(B),d[k]=void 0))}return(k,E)=>(N(),Z(Qe,{modelValue:n.value,"onUpdate:modelValue":E[4]||(E[4]=B=>n.value=B),ref_key:"modal",ref:i},{header:O(()=>[ao]),body:O(({shown:B})=>[B?(N(),Z(a(bi),{key:0,list:a(K).saves,handle:".handle",itemKey:pe=>pe},{item:O(({element:pe})=>[_(ro,{save:a(m)[pe],onOpen:se=>C(pe),onExport:se=>w(pe),onEditName:se=>P(pe,se),onDuplicate:se=>y(pe),onDelete:se=>h(pe)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):V("",!0)]),footer:O(()=>[p("div",oo,[_(Kn,{modelValue:s.value,"onUpdate:modelValue":E[0]||(E[0]=B=>s.value=B),title:"Import Save",placeholder:"Paste your save here!",class:ae({importingFailed:r.value})},null,8,["modelValue","class"]),p("div",so,[lo,p("div",uo,[p("button",{class:"button",onClick:E[1]||(E[1]=B=>C(a(pt)().id))},"New Game"),Object.keys(a(c)).length>0?(N(),Z(Yn,{key:0,options:a(c),modelValue:l.value,"onUpdate:modelValue":E[2]||(E[2]=B=>$(B)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):V("",!0)])]),p("div",co,[go,p("button",{class:"button modal-default-button",onClick:E[3]||(E[3]=B=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Xn=Q(fo,[["__scopeId","data-v-2a4275be"]]);const xe=e=>(ct("data-v-318a1c31"),e=e(),dt(),e),mo=["src","alt"],po={key:1,class:"title"},ho=xe(()=>p("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),vo={class:"discord"},bo={class:"discord-links"},yo={key:0},_o=["href"],wo=xe(()=>p("li",null,[p("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),No=xe(()=>p("li",null,[p("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Co={href:"https://forums.moddingtree.com/",target:"_blank"},ko=xe(()=>p("span",{class:"material-icons"},"forum",-1)),So=xe(()=>p("span",{class:"material-icons"},"info",-1)),xo=xe(()=>p("span",{class:"material-icons"},"library_books",-1)),Io=xe(()=>p("span",{class:"material-icons"},"settings",-1)),Mo=xe(()=>p("span",{class:"material-icons"},"library_books",-1)),Eo=xe(()=>p("span",{class:"material-icons"},"settings",-1)),$o=xe(()=>p("span",{class:"material-icons"},"info",-1)),To={href:"https://forums.moddingtree.com/",target:"_blank"},Fo=xe(()=>p("span",{class:"material-icons"},"forum",-1)),Po={class:"discord"},Do={class:"discord-links"},Vo={key:0},Ao=["href"],Oo=xe(()=>p("li",null,[p("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Lo=xe(()=>p("li",null,[p("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Bo=j({__name:"Nav",setup(e){const t=F(null),n=F(null),i=F(null),r=F(null),{useHeader:s,banner:l,title:o,discordName:c,discordLink:d,versionNumber:b}=J;function m(){window.open(d,"mywindow")}return(w,y)=>(N(),S(ie,null,[a(s)?(N(),S("div",qe({key:0,class:"n
${(-a(r)-30)*Math.sin(((e.actions.length-1)/2-y)*a(o))},
${(a(r)+30)*Math.cos(((e.actions.length-1)/2-y)*a(o))}
)`,onMousedown:$=>c($,w),onTouchstart:$=>c($,w),onMouseup:$=>d($,w),onTouchend:vt($=>d($,w),["stop"])},[p("circle",{fill:a(Y)(w.fillColor,e.node),r:"20","stroke-width":((C=e.selectedAction)==null?void 0:C.id)===w.id?4:0,stroke:a(s)},null,8,Yo),p("text",{fill:a(l),class:"material-icons"},H(a(Y)(w.icon,e.node)),9,Jo)],42,Zo)}),128))])):V("",!0)]),_:1}))}});var Xo=Q(Ko,[["__scopeId","data-v-9efb2a56"]]);const Qo=["transform"],es={key:0},ts=["r","fill","stroke"],ns=["r","fill","stroke"],is=["r","fill"],rs=["r","stroke-dasharray","stroke-dashoffset","stroke"],as={key:1,transform:"rotate(45, 0, 0)"},os=["width","height","transform","fill","stroke"],ss=["width","height","transform","fill","stroke"],ls=["width","height","transform","fill"],us=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],cs=["fill","y"],ds=["fill"],gs={key:0},fs=["fill","y"],ms=["fill","y"],ps=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=me(n),s=I(()=>a(r.selectedNode)===a(r.node)),l=I(()=>Y(r.nodeType.value.draggable,a(r.node)));Fe(l,G=>{const ce=a(r.node);a(r.dragging)===ce&&!G&&t("endDragging",ce)});const o=I(()=>{var ce;const G=a(r.node);return(ce=Y(r.nodeType.value.actions,G))==null?void 0:ce.filter($e=>Xe(Y($e.visibility,G)))}),c=I(()=>{var ce;const G=a(r.node);if(Y(r.nodeType.value.draggable,G)&&((ce=a(r.dragging))==null?void 0:ce.id)===G.id&&a(r.dragged)!=null){const{x:$e,y:Ie}=a(r.dragged);return{x:G.position.x+Math.round($e/25)*25,y:G.position.y+Math.round(Ie/25)*25}}return G.position}),d=I(()=>Y(r.nodeType.value.shape,a(r.node))),b=I(()=>Y(r.nodeType.value.title,a(r.node))),m=I(()=>Y(r.nodeType.value.subtitle,a(r.node))),w=I(()=>{var G;return(G=s.value?a(r.selectedAction)&&Y(a(r.selectedAction).tooltip,a(r.node)):null)!=null?G:Y(r.nodeType.value.label,a(r.node))}),y=I(()=>{var G,ce;return Y((ce=(G=a(r.selectedAction))==null?void 0:G.confirmationLabel)!=null?ce:{text:"Tap again to confirm"},a(r.node))}),h=I(()=>Y(r.nodeType.value.size,a(r.node))),C=I(()=>{var G;return(G=Y(r.nodeType.value.progress,a(r.node)))!=null?G:0}),$=I(()=>Ve[K.theme].variables["--background"]),P=I(()=>{var G;return(G=Y(r.nodeType.value.outlineColor,a(r.node)))!=null?G:Ve[K.theme].variables["--outline"]}),k=I(()=>{var G;return(G=Y(r.nodeType.value.fillColor,a(r.node)))!=null?G:Ve[K.theme].variables["--raised-background"]}),E=I(()=>Y(r.nodeType.value.progressColor,a(r.node))),B=I(()=>{var G;return(G=Y(r.nodeType.value.titleColor,a(r.node)))!=null?G:Ve[K.theme].variables["--foreground"]}),pe=I(()=>Y(r.nodeType.value.progressDisplay,a(r.node))),se=I(()=>r.dragging.value!=null&&a(r.hasDragged)&&Y(r.nodeType.value.canAccept,a(r.node),r.dragging.value)),X=I(()=>Y(r.nodeType.value.style,a(r.node))),te=I(()=>Y(r.nodeType.value.classes,a(r.node)));function kt(G){t("mouseDown",G,r.node.value,l.value)}function Bt(G){var ce,$e,Ie;(ce=r.hasDragged)!=null&&ce.value||(t("endDragging",r.node.value),(Ie=($e=r.nodeType.value).onClick)==null||Ie.call($e,r.node.value),G.stopPropagation())}return(G,ce)=>{var $e,Ie,ft;return N(),S("g",{class:ae(["boardnode",{[e.node.type]:!0,isSelected:a(s),isDraggable:a(l),...a(te)}]),style:Pe([{opacity:(($e=e.dragging)==null?void 0:$e.id)===e.node.id&&e.hasDragged?.5:1},(Ie=a(X))!=null?Ie:[]]),transform:`translate(${a(c).x},${a(c).y})${a(s)?" scale(1.2)":""}`},[_(Xo,{actions:(ft=a(o))!=null?ft:[],"is-selected":a(s),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ce[0]||(ce[0]=Ae=>t("clickAction",Ae))},null,8,["actions","is-selected","node","node-type","selected-action"]),p("g",{class:"node-container",onMousedown:kt,onTouchstartPassive:kt,onMouseup:Bt,onTouchendPassive:Bt},[a(d)===a(He).Circle?(N(),S("g",es,[a(se)?(N(),S("circle",{key:0,class:"receiver",r:a(h)+8,fill:a($),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,ts)):V("",!0),p("circle",{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 Nr();const{globalBus:e}=await $t(()=>Promise.resolve().then(function(){return _r}),void 0),{startGameLoop:t}=await $t(()=>import("./gameLoop.e346fc31.js"),["assets/gameLoop.e346fc31.js","assets/@fontsource.f66d05e7.css","assets/vue.804e2479.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.f5f69b1a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.ce650350.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.89be130f.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.5231d1bd.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=hi(Uu);e.emit("setupVue",n),n.mount("#app"),ut(()=>{const i=Fn(),{updateServiceWorker:r}=ju({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(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{u as D,$t as _,ge as a,J as b,pu as c,Ce as g,Cr as l,U as p,K as s};