Planar-Pioneers/assets/index.5b056d9c.js

19 lines
218 KiB
JavaScript
Raw Normal View History

/* empty css */import"./vue.c16a309b.js";import{_ as C,C as s,l as qe,q as mn,t as z,b2 as vt,ab as Y,aF as M,a1 as D,a2 as N,aL as Ft,G as ve,aD as Cr,w as ht,b3 as Et,a9 as f,O as te,ap as ma,az as gi,as as Wt,aH as ii,A as Te,$ as K,b7 as W,b9 as ji,ar as Ht,bv as Pn,a8 as E,bt as va,bc as jn,T as ha,u as zi,j as ba,bw as Rt,aM as It,a0 as j,aO as Xe,J as se,I as Le,aI as hn,aG as bn,z as an,bo as ya,bs as wa,aK as Dn,bd as lr,am as oi,H as _a,bx as Na,bf as Ca}from"./@vue.6b211d3c.js";import{c as kr}from"./nanoevents.1080beb7.js";import{L as nn}from"./lz-string.dccec454.js";import{Y as ka}from"./vue-next-select.ded54c4a.js";import{D as Ma}from"./vuedraggable.1879de79.js";import{p as Sa}from"./vue-textarea-autosize.35804eaf.js";import{P as Ia}from"./vue-panzoom.8ce6f9b1.js";import{s as xa,u as mi}from"./vue-toastification.9c2dad53.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 $a=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}};$a();const Ea="modulepreload",ur={},Pa="./",zn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${Pa}${i}`,i in ur)return;ur[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const l=document.createElement("link");if(l.rel=r?"stylesheet":Ea,r||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),r)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Da="./projInfo-schema.json",Ta="Planar Pioneers",Aa="A game about controlling and exploiting planes!",Fa="planar-pioneers",Ra="thepaperpilot",Oa="",qa="",Va="0.0",Ba="Initial Commit",La=!1,ja=!1,za=2,Ua=!0,Ga=null,Wa="",Ha=["main"],Za=3600,Ya=0,Xa=!0,Ja="base64";var ge={$schema:Da,title:Ta,description:Aa,id:Fa,author:Ra,discordName:Oa,discordLink:qa,versionNumber:Va,versionTitle:Ba,allowGoBack:La,defaultShowSmall:ja,defaultDecimalsShown:za,useHeader:Ua,banner:Ga,logo:Wa,initialTabs:Ha,maxTickLength:Za,offlineLimit:Ya,enablePausing:Xa,exportEncoding:Ja};class Ka{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 Qa(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 Qa{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Pi=17,es=9e15,ts=Math.log10(9e15),ns=1/9e15,is=308,rs=-324,cr=5,as=(1<<10)-1,ss=function(){const e=[];for(let n=rs+1;n<=is;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),ln=[2,Math.E,3,4,5,6,7,8,9,10],os=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.880419209
`,e),await pn($n())}}function $n(){const e=si(),t=Dr({id:e});return mt(t),ae.saves.push(e),t}function si(){let e,t=0;do e=`${ge.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const $s=z(!1);async function pn(e){console.info("Loading save",e),$s.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await zn(()=>Promise.resolve().then(function(){return Qs}),void 0),{fixOldSave:r,getInitialLayers:a}=await zn(()=>Promise.resolve().then(function(){return Cp}),void 0);for(const l in t){const u=t[l];u&&n(u)}a(e).forEach(l=>i(l,e)),e=Dr(e),e.offlineProd&&e.time!=null&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,ge.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ge.versionNumber&&(r(e.modVersion,e),e.modVersion=ge.versionNumber),Object.assign(J,e),ae.active=J.id,Je.emit("onLoad")}setInterval(()=>{J.autosave&&mt()},1e3);window.onbeforeunload=()=>{J.autosave&&mt()};window.save=mt;const Es=window.hardReset=async()=>{await pn($n())};window.deleteLowerSaves=()=>{const e=Object.values(ae.saves).indexOf(J.id)+1;Object.values(ae.saves).slice(e).forEach(t=>localStorage.removeItem(t)),ae.saves=ae.saves.slice(0,e)};const Hn=mn({active:"",saves:[],showTPS:!0,theme:Ui.Nordic,unthrottled:!1,alignUnits:!1});vt(Hn,e=>{const t=nn.compressToUTF16(JSON.stringify(e));localStorage.setItem(ge.id,t)},{deep:!0});var ae=window.settings=Hn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Ui.Nordic,alignUnits:!1};Je.emit("loadSettings",e),Object.assign(Hn,e),Es()};function Ps(){try{let e=localStorage.getItem(ge.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=nn.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Hn,t)}Je.emit("loadSettings",Hn)}catch{}}const Tr=mn([]);function Ds(e){Tr.push(e)}const Ts=mn([]),As=mn([]),Fs={class:"table"},Rs=Y({__name:"Column",setup(e){const t=C(()=>kt[ae.theme].mergeAdjacent);return(n,i)=>(M(),D("div",Fs,[N("div",{class:ve(["col",{mergeAdjacent:s(t)}])},[Ft(n.$slots,"default")],2)]))}}),Os={class:"table"},qs=Y({__name:"Row",setup(e){const t=C(()=>kt[ae.theme].mergeAdjacent);return(n,i)=>(M(),D("div",Os,[N("div",{class:ve(["row",{mergeAdjacent:s(t)}])},[Ft(n.$slots,"default")],2)]))}});function Ar(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ma(e)}function oe(e,t="span"){return typeof e=="function"?Y({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),Y({template:e})):Y({render:()=>({})}):e}function rt(e){if(Pt(e))return typeof e=="function"?e():oe(e);const t=e[yt];return f(t,e[pt](),null)}function Ti(...e){let t;return f(qs,null,Ar(t=e.map(rt))?t:{default:()=>[t]})}function Vs(...e){let t;return f(Rs,null,Ar(t=e.map(rt))?t:{default:()=>[t]})}function St(e){if(Pt(e))return typeof e=="function"?e():typeof e=="string"?f(te,null,[e]):f(e,null,null);const t=e[yt];return f(t,e[pt](),null)}function gr(e,t){return e.reduce((n,i)=>f(te,null,[n,t,i]))}function Pt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Gn]===!0}function Fr(e,t){const n=z(null),i=z(void 0);function r(u){n.value||(n.value=setInterval(l,250)),i.value=u}function a(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return Cr(a),{start:r,stop:a,handleHolding:l}}function Rr(e,t="div"){const n=ht();return Et(()=>{n.value=oe($e(e),t)}),n}function Tn(e,t="div"){const n=ht(null);return Et(()=>{const i=$e(e);n.value=i==""||i==null?null:oe(i,t)}),n}function $e(e){return s(s(e))}function R(...e){return e.includes(Object)||e.push(Object),e}function mr(e){const t=z(!1),n=e[pt].bind(e);return e[pt]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var de=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Bs=Y({__name:"Context",emits:["
`).slice(3,5).map(n=>n.trim()).join(`
`))!=null?t:""}function vr(e,t){var n;if(o.isNaN(t))throw je.hasNaN||(J.autosave=!1,je.hasNaN=!0,je.NaNPath=e[fn],je.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[fn])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[rn].value=t}function dt(e,t=!0){const n=qe(e)?e:z(e);qe(e)&&(e=e.value);const i=C({get(){return n.value},set(a){t?vr(r,a):r[rn].value=a}});i[sn]=e;const r={get value(){return n.value},set value(a){t?vr(r,a):r[rn].value=a},__v_isRef:!0,[rn]:n,[sn]:e,[ui]:Zs(),[ci]:!1,[At]:i,[fn]:void 0};return ct.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,`
Created at:
`+r[ui]):gn[ct[ct.length-1]].add(r),r}function Ys(e){return e!=null&&typeof e=="object"&&rn in e}function Mn(e){return!(tn in e)&&At in e?e[At]:new Proxy(e,{get(t,n){if(n!==rn)return n===Bi?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===rn?!1:n==Bi?!0:Reflect.has(t,n)}})}function qr(e){ct.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):gn[ct[ct.length-1]].delete(e),e[ci]=!0}Je.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let l=!1;return Object.keys(r).forEach(u=>{let c=r[u];if(c!=null&&typeof c=="object"){if(c[Bi]===!0)return;if(tn in c&&(c=c[tn]),Ys(c)){if(l=!0,c[ci]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
Created at:
`+c[ui]);return}gn[e.id].delete(c);const p=[e.id,...a,u];c[fn]!=null&&JSON.stringify(p)!==JSON.stringify(c[fn])&&console.error(`Persistent ref is being saved to \`${p.join(".")}\` when it's already present at \`${c[fn].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[fn]=p;const v=a.reduce((h,m)=>(m in h||(h[m]={}),h[m]),t),d=v[u];v[u]=c[rn],ba(v)?d!=null?v[u]=d:v[u]=c[sn]:d!=null?v[u].value=d:v[u].value=c[sn]}else!(c instanceof o)&&!qe(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,u])&&(Rt(c)&&!Rt(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.",tn in r?r[tn]:r,u):l=!0))}}),l};i(e[tn]),gn[e.id].forEach(r=>{r[ci]||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[ui])}),gn[e.id].clear()});const Gi=Symbol("RegisterNode"),Wi=Symbol("UnregisterNode"),Hi=Symbol("Nodes"),Zi=Symbol("Bounds"),ye=zi({});window.layers=ye;const gn={},ct=[];function Yi(e,t){return Ke(()=>{const n={},i=n.emitter=kr();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=z({}),n.id=e,ct.push(e),gn[e]=new Set,n.minimized=dt(!1,!1),Object.assign(n,t.call(n,n)),ct[ct.length-1]==null||ct[ct.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${ct}
Trying to pop ${n.id}`;ct.pop(),x(n,"color"),x(n,"display"),x(n,"classes"),x(n,"style"),x(n,"name"),ne(n,"name",n.id),x(n,"minWidth"),ne(n,"minWidth",600),x(n,"minimizable"),ne(n,"minimizable",!0),x(n,"minimizedDisplay");const r=n.style;return n.style=C(()=>{var l,u;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(l=s(r))!=null?l:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Xi(e,t){if(console.info("Adding layer",e.id),ye[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ye[e.id]);return}ne(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ye[e.id]=e,Je.emit("addLayer",e,t.layers[e.id])}function Xs(e){return ye[e]}function Vr(e){console.info("Removing layer",e.id),Je.emit("removeLayer",e),ye[e.id]=void 0}function Js(e){Vr(e),Xi(e,J)}function Ks(e){const t=z(!1);return{openModal:()=>t.value=!0,modal:X(()=>f(Zt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>f("h2",null,[s(e.name)]),body:s(e.display)}))}}Je.on("update",function(t){Object.values(ye).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ye).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ye).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Qs=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Gi,UnregisterNodeInjectionKey:Wi,NodesInjectionKey:Hi,BoundsInjectionKey:Zi,layers:ye,persistentRefs:gn,addingLayers:ct,createLayer:Yi,addLayer:Xi,getLayer:Xs,removeLayer:Vr,reloadLayer:Js,setupLayerModal:Ks},Symbol.toStringTag,{value:"Module"}));const eo=Y({components:{Context:Or},props:{index:{type:Number,required:!0},display:{type:R(Object,String,Function),required:!0},minimizedDisplay:R(Object,String,Function),minimized:{type:Object,required:!0},name:{type:R(String),required:!0},color:R(String),minimizable:R(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=Te(e),a=Rr(t),l=Tn(r),u=C(()=>ge.allowGoBack&&n.value>0&&!$e(i));function c(){J.tabs.splice(s(e.index),1/0)}function p(v){e.nodes.value=v}return{component:a,minimizedComponent:l,showGoBack:u,updateNodes:p,unref:s,goBack:c}}}),to={key:1};function no(e,t,n,i,r,a){const l=It("Context");return M(),D("div",{class:"layer-container",style:Le({"--layer-color":e.unref(e.color)})},[e.showGoBack?(M(),D("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...u)=>e.goBack&&e.goBack(...u))},"\u274C")):j("",!0),e.unref(e.minimized)?(M(),D("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=u=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(M(),K(Xe(e.minimizedComponent),{key:0})):(M(),D("div",to,se(e.unref(e.name)),1))])):(M(),D("div",{key:2,class:ve(["layer-tab",{showGoBack:e.showGoBack}])},[f(l,{onUpdateNodes:e.updateNodes},{default:W(()=>[(M(),K(Xe(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(M(),D("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=u=>e.$emit("setMinimized",!0))}," \u25BC ")):j("",!0)],4)}var io=de(eo,[["render",no],["__scopeId","data-v-72dd78b1"]]);const Br=e=>(hn("data-v-4b4bda40"),e=e(),bn(),e),ro=Br(()=>N("h2",null,"Changelog",-1)),ao=Br(()=>N("details",{open:""},[N("summary",null,[E("v0.0 Initial Commit - "),N("time",null,"2021-09-04")]),E(" This is the first release :D "),N("ul",null,[N("li",{class:"feature"},"Did everything"),N("li",{class:"fix"},"Had some fun"),N("li",{class:"breaking"},"Removed everything"),N("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),so=Y({__name:"Changelog",setup(e,{expose:t}){const n=z(!1);return t({open(){n.value=!0}}),(i,r)=>(M(),K(Zt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:W(()=>[ro]),body:W(()=>[ao]),_:1},8,["modelValue"]))}});var oo=de(so,[["__scopeId","data-v-4b4bda40"]]),lo=Y({props:{element:Object,display:{type:R(Object,String,Function),required:!0},style:R(Object,String,Array),classes:R(Object),direc
${B}
${P}`)}}return p[S]}vt(n,S=>{S&&Object.keys(p).forEach(P=>delete p[P])});const d=C(()=>ae.saves.reduce((S,P)=>(S[P]=v(P),S),{}));function h(S){let P;switch(J.id===S?P=Pr(J):P=JSON.stringify(d.value[S]),ge.exportEncoding){default:console.warn(`Unknown save encoding: ${ge.exportEncoding}. Defaulting to lz`);case"lz":P=nn.compressToUTF16(P);break;case"base64":P=btoa(unescape(encodeURIComponent(P)));break;case"plain":break}const B=document.createElement("textarea");B.value=P,document.body.appendChild(B),B.select(),B.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(B)}function m(S){J.id===S&&mt();const P={...d.value[S],id:si()};mt(P),ae.saves.push(P.id)}function _(S){ae.saves=ae.saves.filter(P=>P!==S),localStorage.removeItem(S),p[S]=void 0}function y(S){d.value[J.id].time=J.time,mt(),p[J.id]=void 0,pn(d.value[S]),p[S]=void 0}function I(S){if(l.value=S,Wt(()=>{l.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=nn.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const P=JSON.parse(S);P.id=si(),mt(P),ae.saves.push(P.id),y(P.id)}function A(S,P){const B=d.value[S];B!=null&&(B.name=P,J.id===S?(J.name=P,mt()):(mt(B),p[S]=void 0))}return(S,P)=>(M(),K(Zt,{modelValue:n.value,"onUpdate:modelValue":P[4]||(P[4]=B=>n.value=B),ref_key:"modal",ref:i},{header:W(()=>[ml]),body:W(({shown:B})=>[B?(M(),K(s(Ma),{key:0,list:s(ae).saves,handle:".handle",itemKey:ie=>ie},{item:W(({element:ie})=>[f(gl,{save:s(d)[ie],onOpen:pe=>y(ie),onExport:pe=>h(ie),onEditName:pe=>A(ie,pe),onDuplicate:pe=>m(ie),onDelete:pe=>_(ie)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):j("",!0)]),footer:W(()=>[N("div",vl,[f(jr,{modelValue:a.value,"onUpdate:modelValue":P[0]||(P[0]=B=>a.value=B),title:"Import Save",placeholder:"Paste your save here!",class:ve({importingFailed:r.value})},null,8,["modelValue","class"]),N("div",hl,[bl,N("div",yl,[N("button",{class:"button",onClick:P[1]||(P[1]=B=>y(s($n)().id))},"New Game"),Object.keys(s(c)).length>0?(M(),K(Ji,{key:0,options:s(c),modelValue:l.value,"onUpdate:modelValue":P[2]||(P[2]=B=>I(B)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):j("",!0)])]),N("div",wl,[_l,N("button",{class:"button modal-default-button",onClick:P[3]||(P[3]=B=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var zr=de(Nl,[["__scopeId","data-v-2a4275be"]]);const wt=e=>(hn("data-v-318a1c31"),e=e(),bn(),e),Cl=["src","alt"],kl={key:1,class:"title"},Ml=wt(()=>N("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Sl={class:"discord"},Il={class:"discord-links"},xl={key:0},$l=["href"],El=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Pl=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Dl={href:"https://forums.moddingtree.com/",target:"_blank"},Tl=wt(()=>N("span",{class:"material-icons"},"forum",-1)),Al=wt(()=>N("span",{class:"material-icons"},"info",-1)),Fl=wt(()=>N("span",{class:"material-icons"},"library_books",-1)),Rl=wt(()=>N("span",{class:"material-icons"},"settings",-1)),Ol=wt(()=>N("span",{class:"material-icons"},"library_books",-1)),ql=wt(()=>N("span",{class:"material-icons"},"settings",-1)),Vl=wt(()=>N("span",{class:"material-icons"},"info",-1)),Bl={href:"https://forums.moddingtree.com/",target:"_blank"},Ll=wt(()=>N("span",{class:"material-icons"},"forum",-1)),jl={class:"discord"},zl={class:"discord-links"},Ul={key:0},Gl=["href"],Wl=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Hl=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Zl=Y({__name:"Nav",setup(e){const t=z(null),n=z(null),i=z(null),r=z(null),{useHeader:a,banner:l,title:u,discordName:c,discordLink:p,versionNumber:v}=ge;function d(){window.open(p,"mywindow")}return(h,m)=>(M(),D(te,null,[s(a)?(M(),D("div",Ht({key:
${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-m)*s(u))},
${(s(r)+30)*Math.cos(((e.actions.length-1)/2-m)*s(u))}
)`,onMousedown:I=>c(I,h),onTouchstart:I=>c(I,h),onMouseup:I=>p(I,h),onTouchend:Pn(I=>p(I,h),["stop"])},[N("circle",{fill:s(fe)(h.fillColor,e.node),r:"20","stroke-width":((y=e.selectedAction)==null?void 0:y.id)===h.id?4:0,stroke:s(a)},null,8,ru),N("text",{fill:s(l),class:"material-icons"},se(s(fe)(h.icon,e.node)),9,au)],42,iu)}),128))])):j("",!0)]),_:1}))}});var ou=de(su,[["__scopeId","data-v-9efb2a56"]]);const lu=["transform"],uu={key:0},cu=["r","fill","stroke"],du=["r","fill","stroke"],pu=["r","fill"],fu=["r","stroke-dasharray","stroke-dashoffset","stroke"],gu={key:1,transform:"rotate(45, 0, 0)"},mu=["width","height","transform","fill","stroke"],vu=["width","height","transform","fill","stroke"],hu=["width","height","transform","fill"],bu=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],yu=["fill","y"],wu=["fill"],_u={key:0},Nu=["fill","y"],Cu=["fill","y"],ku=Y({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},isSelected:{type:Boolean},selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=Te(n),a=C(()=>fe(r.nodeType.value.draggable,s(r.node)));vt(a,V=>{const re=s(r.node);s(r.dragging)===re&&!V&&t("endDragging",re)});const l=C(()=>{var re;const V=s(r.node);return(re=fe(r.nodeType.value.actions,V))==null?void 0:re.filter(Ae=>ze(fe(Ae.visibility,V)))}),u=C(()=>{var re;const V=s(r.node);if(fe(r.nodeType.value.draggable,V)&&((re=s(r.dragging))==null?void 0:re.id)===V.id&&s(r.dragged)!=null){const{x:Ae,y:Ge}=s(r.dragged);return{x:V.position.x+Math.round(Ae/25)*25,y:V.position.y+Math.round(Ge/25)*25}}return V.position}),c=C(()=>fe(r.nodeType.value.shape,s(r.node))),p=C(()=>fe(r.nodeType.value.title,s(r.node))),v=C(()=>fe(r.nodeType.value.subtitle,s(r.node))),d=C(()=>{var V;return(V=r.isSelected.value?s(r.selectedAction)&&fe(s(r.selectedAction).tooltip,s(r.node)):null)!=null?V:fe(r.nodeType.value.label,s(r.node))}),h=C(()=>{var V,re;return fe((re=(V=s(r.selectedAction))==null?void 0:V.confirmationLabel)!=null?re:{text:"Tap again to confirm"},s(r.node))}),m=C(()=>fe(r.nodeType.value.size,s(r.node))),_=C(()=>{var V;return(V=fe(r.nodeType.value.progress,s(r.node)))!=null?V:0}),y=C(()=>kt[ae.theme].variables["--background"]),I=C(()=>{var V;return(V=fe(r.nodeType.value.outlineColor,s(r.node)))!=null?V:kt[ae.theme].variables["--outline"]}),A=C(()=>{var V;return(V=fe(r.nodeType.value.fillColor,s(r.node)))!=null?V:kt[ae.theme].variables["--raised-background"]}),S=C(()=>fe(r.nodeType.value.progressColor,s(r.node))),P=C(()=>{var V;return(V=fe(r.nodeType.value.titleColor,s(r.node)))!=null?V:kt[ae.theme].variables["--foreground"]}),B=C(()=>fe(r.nodeType.value.progressDisplay,s(r.node))),ie=C(()=>r.dragging.value!=null&&s(r.hasDragged)&&fe(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),pe=C(()=>fe(r.nodeType.value.style,s(r.node))),ee=C(()=>fe(r.nodeType.value.classes,s(r.node)));function H(V){t("mouseDown",V,r.node.value,a.value)}function le(V){var re,Ae,Ge;(re=r.hasDragged)!=null&&re.value||(t("endDragging",r.node.value),(Ge=(Ae=r.nodeType.value).onClick)==null||Ge.call(Ae,r.node.value),V.stopPropagation())}return(V,re)=>{var Ae,Ge,Xt;return M(),D("g",{class:ve(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(ee)}]),style:Le([{opacity:((Ae=e.dragging)==null?void 0:Ae.id)===e.node.id&&e.hasDragged?.5:1},(Ge=s(pe))!=null?Ge:[]]),transform:`translate(${s(u).x},${s(u).y})${e.isSelected?" scale(1.2)":""}`},[f(ou,{actions:(Xt=s(l))!=null?Xt:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:re[0]||(re[0]=at=>t("clickAction",at))},null,8,["actions","is-selected","node","node-type","selected-action"]),N("g",{class:"node-container",onMousedown:H,onTouchstartPassive:H,onMouseup:le,onTouchendPassive:le},[s(c)===s(Ue).Circle?(M(),D("g",uu,[s(ie)?(M(),D("circle",{key:0,class:"receiver",r:s(m)+8,fill:s(y),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null
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 xs();const{globalBus:e}=await zn(()=>Promise.resolve().then(function(){return Ss}),void 0),{startGameLoop:t}=await zn(()=>import("./gameLoop.b6cb677f.js"),["assets/gameLoop.b6cb677f.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=Ca(Yp);e.emit("setupVue",n),n.mount("#app"),Wt(()=>{const i=mi(),{updateServiceWorker:r}=Jp({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,zn as _,je as a,ge as b,Cp as c,Je as g,$s as l,J as p,ae as s};