mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-26 18:16:31 +00:00
19 lines
143 KiB
JavaScript
19 lines
143 KiB
JavaScript
|
/* empty css */import"./vue.804e2479.js";import{_ as x,C as a,l as ce,q as ut,t as T,b2 as Ie,ab as z,aD as sn,w as ke,b3 as Le,a9 as N,O as re,az as Vt,as as Xe,aF as w,a1 as I,aL as Ae,a2 as h,aH as St,A as le,$ as W,b7 as O,b9 as Rt,ar as Te,bv as at,a8 as P,bt as Bn,bc as ot,T as qn,u as zt,j as Rn,bw as Xt,aM as xt,a0 as F,aO as _e,J as G,G as ae,I as Me,aI as Qe,aG as et,z as qe,bo as zn,bs as Un,aK as st,bd as Qt,am as Et,H as jn,bf as Wn}from"./@vue.6f8187b0.js";import{c as ln}from"./nanoevents.1080beb7.js";import{L as Oe}from"./lz-string.dccec454.js";import{Y as Gn}from"./vue-next-select.f5f69b1a.js";import{D as Hn}from"./vuedraggable.ce650350.js";import{p as Zn}from"./vue-textarea-autosize.35804eaf.js";import{P as Yn}from"./vue-panzoom.89be130f.js";import{s as Jn,u as un}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 Kn=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 o of r)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerpolicy&&(o.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?o.credentials="include":r.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}};Kn();const Xn="modulepreload",en={},Qn="./",ht=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${Qn}${i}`,i in en)return;en[i]=!0;const r=i.endsWith(".css"),o=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${o}`))return;const s=document.createElement("link");if(s.rel=r?"stylesheet":Xn,r||(s.as="script",s.crossOrigin=""),s.href=i,document.head.appendChild(s),r)return new Promise((l,c)=>{s.addEventListener("load",l),s.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},ei="./projInfo-schema.json",ti="Planar Pioneers",ni="A game about controlling and exploiting planes!",ii="planar-pioneers",ri="thepaperpilot",ai="",oi="",si="0.0",li="Initial Commit",ui=!0,ci=!1,di=2,gi=!0,fi=null,mi="",hi=["main"],pi=3600,vi=0,bi=!0,yi="base64";var Y={$schema:ei,title:ti,description:ni,id:ii,author:ri,discordName:ai,discordLink:oi,versionNumber:si,versionTitle:li,allowGoBack:ui,defaultShowSmall:ci,defaultDecimalsShown:di,useHeader:gi,banner:fi,logo:mi,initialTabs:hi,maxTickLength:pi,offlineLimit:vi,enablePausing:bi,exportEncoding:yi};class _i{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 At=17,Ni=9e15,Ci=Math.log10(9e15),Si=1/9e15,ki=308,Ii=-324,tn=5,Mi=(1<<10)-1,xi=function(){const e=[];for(let n=Ii+1;n<=ki;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Ue=[2,Math.E,3,4,5,6,7,8,9,10],Ei=[[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 Ge(nt())}}function nt(){const e=Mt(),t=bn({id:e});return ye(t),K.saves.push(e),t}function Mt(){let e,t=0;do e=`${Y.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Xi=T(!1);async function Ge(e){console.info("Loading save",e),Xi.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await ht(()=>Promise.resolve().then(function(){return yr}),void 0),{fixOldSave:r,getInitialLayers:o}=await ht(()=>Promise.resolve().then(function(){return Jl}),void 0);for(const s in t){const l=t[s];l&&n(l)}o(e).forEach(s=>i(s,e)),e=bn(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,Y.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==Y.versionNumber&&(r(e.modVersion,e),e.modVersion=Y.versionNumber),Object.assign(B,e),K.active=B.id,ve.emit("onLoad")}setInterval(()=>{B.autosave&&ye()},1e3);window.onbeforeunload=()=>{B.autosave&&ye()};window.save=ye;const Qi=window.hardReset=async()=>{await Ge(nt())};window.deleteLowerSaves=()=>{const e=Object.values(K.saves).indexOf(B.id)+1;Object.values(K.saves).slice(e).forEach(t=>localStorage.removeItem(t)),K.saves=K.saves.slice(0,e)};const bt=ut({active:"",saves:[],showTPS:!0,theme:Wt.Nordic,unthrottled:!1,alignUnits:!1});Ie(bt,e=>{const t=Oe.compressToUTF16(JSON.stringify(e));localStorage.setItem(Y.id,t)},{deep:!0});var K=window.settings=bt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Wt.Nordic,alignUnits:!1};ve.emit("loadSettings",e),Object.assign(bt,e),Qi()};function er(){try{let e=localStorage.getItem(Y.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Oe.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(bt,t)}ve.emit("loadSettings",bt)}catch{}}const tr=ut([]),nr=ut([]),ir=ut([]);function de(e,t="span"){return typeof e=="function"?z({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),z({template:e})):z({render:()=>({})}):e}function it(e){if(Je(e))return typeof e=="function"?e():de(e);const t=e[vt];return N(t,e[Ot](),null)}function Be(e){if(Je(e))return typeof e=="function"?e():typeof e=="string"?N(re,null,[e]):N(e,null,null);const t=e[vt];return N(t,e[Ot](),null)}function Je(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[pt]===!0}function yn(e,t){const n=T(null),i=T(void 0);function r(l){n.value||(n.value=setInterval(s,250)),i.value=l}function o(){n.value&&(clearInterval(n.value),n.value=null)}function s(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return sn(o),{start:r,stop:o,handleHolding:s}}function _n(e,t="div"){const n=ke();return Le(()=>{n.value=de(he(e),t)}),n}function wt(e,t="div"){const n=ke(null);return Le(()=>{const i=he(e);n.value=i==""||i==null?null:de(i,t)}),n}function he(e){return a(a(e))}function L(...e){return e.includes(Object)||e.push(Object),e}var X=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const rr=z({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var _;const n=T({}),i=new ResizeObserver(l),r=T(null);Vt(()=>{const p=r.value;p!=null&&i.observe(p)});let o=!0,s=T((_=r.value)==null?void 0:_.getBoundingClientRect());function l(){o&&(o=!1,Xe(()=>{var p;s.value=(p=r.value)==null?void 0:p.getBoundingClientRect(),Object.values(n.value).filter(S=>S).forEach(S=>S.rect=S.element.getBoundingClientRect()),t("updateNodes",n.value),o=!0}))}ve.on("fontsLoaded",l);const c={attributes:!1,childList:!0,subtree:!1};St(Gt,(p,S)=>{const C=new MutationObserver(()=>f(p));C.observe(S,c),n.value[p]={element:S,observer:C,rect:S.getBoundingClientRect()},l()}),St(Ht,p=>{var S;(S=n.value[p])==null||S.observer.disconnect(),n.value[p]=void 0,l()}),St(Zt,n),St(Yt,s);function f(p){const S=n.value[p];S!=null&&(S.rect=S.element.getBoundingClientRect(),t("updateNodes",n.value))}return(p,S)=>(w(),I(re,null,[Ae(p.$slots,"default",{},void 0,!0),h("di
|
||
|
`).slice(3,5).map(n=>n.trim()).join(`
|
||
|
`))!=null?t:""}function on(e,t){var n;if(u.isNaN(t))throw oe.hasNaN||(B.autosave=!1,oe.hasNaN=!0,oe.NaNPath=e[He],oe.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[He])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[rt].value=t}function ct(e,t=!0){const n=ce(e)?e:T(e);ce(e)&&(e=e.value);const i=x({get(){return n.value},set(o){t?on(r,o):r[rt].value=o}});i[yt]=e;const r={get value(){return n.value},set value(o){t?on(r,o):r[rt].value=o},__v_isRef:!0,[rt]:n,[yt]:e,[Ft]:fr(),[Pt]:!1,[De]:i,[He]:void 0};return pe.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,`
|
||
|
Created at:
|
||
|
`+r[Ft]):Ke[pe[pe.length-1]].add(r),r}function mr(e){return e!=null&&typeof e=="object"&&rt in e}function hr(e){pe.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):Ke[pe[pe.length-1]].delete(e),e[Pt]=!0}ve.on("addLayer",(e,t)=>{const n=[],i=(r,o=[])=>{let s=!1;return Object.keys(r).forEach(l=>{let c=r[l];if(c!=null&&typeof c=="object"){if(c[gr]===!0)return;if(We in c&&(c=c[We]),mr(c)){if(s=!0,c[Pt]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
|
||
|
Created at:
|
||
|
`+c[Ft]);return}Ke[e.id].delete(c);const f=[e.id,...o,l];c[He]!=null&&JSON.stringify(f)!==JSON.stringify(c[He])&&console.error(`Persistent ref is being saved to \`${f.join(".")}\` when it's already present at \`${c[He].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[He]=f;const _=o.reduce((S,C)=>(C in S||(S[C]={}),S[C]),t),p=_[l];_[l]=c[rt],Rn(_)?p!=null?_[l]=p:_[l]=c[yt]:p!=null?_[l].value=p:_[l].value=c[yt]}else!(c instanceof u)&&!ce(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...o,l])&&(Xt(c)&&!Xt(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.",We in r?r[We]:r,l):s=!0))}}),s};i(e[We]),Ke[e.id].forEach(r=>{r[Pt]||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[Ft])}),Ke[e.id].clear()});const Gt=Symbol("RegisterNode"),Ht=Symbol("UnregisterNode"),Zt=Symbol("Nodes"),Yt=Symbol("Bounds"),me=zt({});window.layers=me;const Ke={},pe=[];function Nn(e,t){return Nt(()=>{const n={},i=n.emitter=ln();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=T({}),n.id=e,pe.push(e),Ke[e]=new Set,n.minimized=ct(!1,!1),Object.assign(n,t.call(n,n)),pe[pe.length-1]==null||pe[pe.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
|
||
|
Stack: ${pe}
|
||
|
Trying to pop ${n.id}`;pe.pop(),V(n,"color"),V(n,"display"),V(n,"classes"),V(n,"style"),V(n,"name"),ue(n,"name",n.id),V(n,"minWidth"),ue(n,"minWidth",600),V(n,"minimizable"),ue(n,"minimizable",!0),V(n,"minimizedDisplay");const r=n.style;return n.style=x(()=>{var s,l;let o=a(n.minWidth);return(typeof o=="number"||!Number.isNaN(parseInt(o)))&&(o=o+"px"),[(s=a(r))!=null?s:"",(l=n.minimized)!=null&&l.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:o,flexBasis:o,margin:""}]}),n})}function Cn(e,t){if(console.info("Adding layer",e.id),me[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,me[e.id]);return}ue(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),me[e.id]=e,ve.emit("addLayer",e,t.layers[e.id])}function pr(e){return me[e]}function Sn(e){console.info("Removing layer",e.id),ve.emit("removeLayer",e),me[e.id]=void 0}function vr(e){Sn(e),Cn(e,B)}function br(e){const t=T(!1);return{openModal:()=>t.value=!0,modal:ne(()=>N(ze,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>N("h2",null,[a(e.name)]),body:a(e.display)}))}}ve.on("update",function(t){Object.values(me).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(me).forEach(n=>{n==null||n.emit("update",t)}),Object.values(me).forEach(n=>{n==null||n.emit("postUpdate",t)})});var yr=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Gt,UnregisterNodeInjectionKey:Ht,NodesInjectionKey:Zt,BoundsInjectionKey:Yt,layers:me,persistentRefs:Ke,addingLayers:pe,createLayer:Nn,addLayer:Cn,getLayer:pr,removeLayer:Sn,reloadLayer:vr,setupLayerModal:br},Symbol.toStringTag,{value:"Module"}));const _r=z({components:{Context:wn},props:{index:{type:Number,required:!0},display:{type:L(Object,String,Function),required:!0},minimizedDisplay:L(Object,String,Function),minimized:{type:Object,required:!0},name:{type:L(String),required:!0},color:L(String),minimizable:L(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=le(e),o=_n(t),s=wt(r),l=x(()=>Y.allowGoBack&&n.value>0&&!he(i));function c(){B.tabs.splice(a(e.index),1/0)}function f(_){e.nodes.value=_}return{component:o,minimizedComponent:s,showGoBack:l,updateNodes:f,unref:a,goBack:c}}}),wr={key:1};function Nr(e,t,n,i,r,o){const s=xt("Context");return w(),I("div",{class:"layer-container",style:Me({"--layer-color":e.unref(e.color)})},[e.showGoBack?(w(),I("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...l)=>e.goBack&&e.goBack(...l))},"\u274C")):F("",!0),e.unref(e.minimized)?(w(),I("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=l=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(w(),W(_e(e.minimizedComponent),{key:0})):(w(),I("div",wr,G(e.unref(e.name)),1))])):(w(),I("div",{key:2,class:ae(["layer-tab",{showGoBack:e.showGoBack}])},[N(s,{onUpdateNodes:e.updateNodes},{default:O(()=>[(w(),W(_e(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(w(),I("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=l=>e.$emit("setMinimized",!0))}," \u25BC ")):F("",!0)],4)}var Cr=X(_r,[["render",Nr],["__scopeId","data-v-72dd78b1"]]);const kn=e=>(Qe("data-v-4b4bda40"),e=e(),et(),e),Sr=kn(()=>h("h2",null,"Changelog",-1)),kr=kn(()=>h("details",{open:""},[h("summary",null,[P("v0.0 Initial Commit - "),h("time",null,"2021-09-04")]),P(" This is the first release :D "),h("ul",null,[h("li",{class:"feature"},"Did everything"),h("li",{class:"fix"},"Had some fun"),h("li",{class:"breaking"},"Removed everything"),h("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Ir=z({__name:"Changelog",setup(e,{expose:t}){const n=T(!1);return t({open(){n.value=!0}}),(i,r)=>(w(),W(ze,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=o=>n.value=o)},{header:O(()=>[Sr]),body:O(()=>[kr]),_:1},8,["modelValue"]))}});var Mr=X(Ir,[["__scopeId","data-v-4b4bda40"]]),xr=z({props:{element:Object,display:{type:L(Object,String,Function),required:!0},style:L(Object,String,Array),classes:L(Object),directio
|
||
|
${E}
|
||
|
${y}`)}}return f[m]}Ie(n,m=>{m&&Object.keys(f).forEach(y=>delete f[y])});const p=x(()=>K.saves.reduce((m,y)=>(m[y]=_(y),m),{}));function S(m){let y;switch(B.id===m?y=vn(B):y=JSON.stringify(p.value[m]),Y.exportEncoding){default:console.warn(`Unknown save encoding: ${Y.exportEncoding}. Defaulting to lz`);case"lz":y=Oe.compressToUTF16(y);break;case"base64":y=btoa(unescape(encodeURIComponent(y)));break;case"plain":break}const E=document.createElement("textarea");E.value=y,document.body.appendChild(E),E.select(),E.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(E)}function C(m){B.id===m&&ye();const y={...p.value[m],id:Mt()};ye(y),K.saves.push(y.id)}function k(m){K.saves=K.saves.filter(y=>y!==m),localStorage.removeItem(m),f[m]=void 0}function b(m){p.value[B.id].time=B.time,ye(),f[B.id]=void 0,Ge(p.value[m]),f[m]=void 0}function $(m){if(s.value=m,Xe(()=>{s.value=null}),m[0]!=="{")if(m[0]==="e")m=decodeURIComponent(escape(atob(m)));else if(m[0]==="\u1BE1")m=Oe.decompressFromUTF16(m);else{console.warn("Unable to determine preset encoding",m);return}const y=JSON.parse(m);y.id=Mt(),ye(y),K.saves.push(y.id),b(y.id)}function q(m,y){const E=p.value[m];E!=null&&(E.name=y,B.id===m?(B.name=y,ye()):(ye(E),f[m]=void 0))}return(m,y)=>(w(),W(ze,{modelValue:n.value,"onUpdate:modelValue":y[4]||(y[4]=E=>n.value=E),ref_key:"modal",ref:i},{header:O(()=>[Va]),body:O(({shown:E})=>[E?(w(),W(a(Hn),{key:0,list:a(K).saves,handle:".handle",itemKey:H=>H},{item:O(({element:H})=>[N(Pa,{save:a(p)[H],onOpen:U=>b(H),onExport:U=>S(H),onEditName:U=>q(H,U),onDuplicate:U=>C(H),onDelete:U=>k(H)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):F("",!0)]),footer:O(()=>[h("div",Oa,[N(xn,{modelValue:o.value,"onUpdate:modelValue":y[0]||(y[0]=E=>o.value=E),title:"Import Save",placeholder:"Paste your save here!",class:ae({importingFailed:r.value})},null,8,["modelValue","class"]),h("div",Da,[La,h("div",Aa,[h("button",{class:"button",onClick:y[1]||(y[1]=E=>b(a(nt)().id))},"New Game"),Object.keys(a(c)).length>0?(w(),W(In,{key:0,options:a(c),modelValue:s.value,"onUpdate:modelValue":y[2]||(y[2]=E=>$(E)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):F("",!0)])]),h("div",Ba,[qa,h("button",{class:"button modal-default-button",onClick:y[3]||(y[3]=E=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var En=X(Ra,[["__scopeId","data-v-2a4275be"]]);const we=e=>(Qe("data-v-318a1c31"),e=e(),et(),e),za=["src","alt"],Ua={key:1,class:"title"},ja=we(()=>h("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Wa={class:"discord"},Ga={class:"discord-links"},Ha={key:0},Za=["href"],Ya=we(()=>h("li",null,[h("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Ja=we(()=>h("li",null,[h("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Ka={href:"https://forums.moddingtree.com/",target:"_blank"},Xa=we(()=>h("span",{class:"material-icons"},"forum",-1)),Qa=we(()=>h("span",{class:"material-icons"},"info",-1)),eo=we(()=>h("span",{class:"material-icons"},"library_books",-1)),to=we(()=>h("span",{class:"material-icons"},"settings",-1)),no=we(()=>h("span",{class:"material-icons"},"library_books",-1)),io=we(()=>h("span",{class:"material-icons"},"settings",-1)),ro=we(()=>h("span",{class:"material-icons"},"info",-1)),ao={href:"https://forums.moddingtree.com/",target:"_blank"},oo=we(()=>h("span",{class:"material-icons"},"forum",-1)),so={class:"discord"},lo={class:"discord-links"},uo={key:0},co=["href"],go=we(()=>h("li",null,[h("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),fo=we(()=>h("li",null,[h("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),mo=z({__name:"Nav",setup(e){const t=T(null),n=T(null),i=T(null),r=T(null),{useHeader:o,banner:s,title:l,discordName:c,discordLink:f,versionNumber:_}=Y;function p(){window.open(f,"mywindow")}return(S,C)=>(w(),I(re,null,[a(o)?(w(),I("div",Te({key:0,class:"nav"},S.$attrs),
|
||
|
${(-a(i)-30)*Math.sin(((e.actions.length-1)/2-S)*a(s))},
|
||
|
${(a(i)+30)*Math.cos(((e.actions.length-1)/2-S)*a(s))}
|
||
|
)`,onMousedown:b=>l(b,p),onTouchstart:b=>l(b,p),onMouseup:b=>c(b,p),onTouchend:at(b=>c(b,p),["stop"])},[h("circle",{fill:a(J)(p.fillColor,e.node),r:"20","stroke-width":((k=e.selectedAction)==null?void 0:k.id)===p.id?4:0,stroke:a(r)},null,8,So),h("text",{fill:a(o),class:"material-icons"},G(a(J)(p.icon,e.node)),9,ko)],42,Co)}),128))])):F("",!0)]),_:1}))}});var Mo=X(Io,[["__scopeId","data-v-ffe504c4"]]);const xo=["transform"],Eo={key:0},$o=["r","fill","stroke"],To=["r","fill","stroke"],Fo=["r","fill"],Po=["r","stroke-dasharray","stroke-dashoffset","stroke"],Vo={key:1,transform:"rotate(45, 0, 0)"},Oo=["width","height","transform","fill","stroke"],Do=["width","height","transform","fill","stroke"],Lo=["width","height","transform","fill"],Ao=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],Bo=["fill","y"],qo=["fill"],Ro={key:0},zo=["fill","y"],Uo=["fill","y"],jo=z({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},selectedNode:null,selectedAction:null},emits:["mouseDown","endDragging"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=le(n),o=x(()=>a(r.selectedNode)===a(r.node)),s=x(()=>J(r.nodeType.value.draggable,a(r.node)));Ie(s,j=>{const fe=a(r.node);a(r.dragging)===fe&&!j&&t("endDragging",fe.id)});const l=x(()=>{var fe;const j=a(r.node);return(fe=J(r.nodeType.value.actions,j))==null?void 0:fe.filter(be=>Re(J(be.visibility,j)))}),c=x(()=>{var fe;const j=a(r.node);if(J(r.nodeType.value.draggable,j)&&((fe=a(r.dragging))==null?void 0:fe.id)===j.id&&a(r.dragged)!=null){const{x:be,y:Se}=a(r.dragged);return{x:j.position.x+Math.round(be/25)*25,y:j.position.y+Math.round(Se/25)*25}}return j.position}),f=x(()=>J(r.nodeType.value.shape,a(r.node))),_=x(()=>J(r.nodeType.value.title,a(r.node))),p=x(()=>J(r.nodeType.value.subtitle,a(r.node))),S=x(()=>{var j;return(j=o.value?a(r.selectedAction)&&J(a(r.selectedAction).tooltip,a(r.node)):null)!=null?j:J(r.nodeType.value.label,a(r.node))}),C=x(()=>J(r.nodeType.value.size,a(r.node))),k=x(()=>{var j;return(j=J(r.nodeType.value.progress,a(r.node)))!=null?j:0}),b=x(()=>Ee[K.theme].variables["--background"]),$=x(()=>{var j;return(j=J(r.nodeType.value.outlineColor,a(r.node)))!=null?j:Ee[K.theme].variables["--outline"]}),q=x(()=>{var j;return(j=J(r.nodeType.value.fillColor,a(r.node)))!=null?j:Ee[K.theme].variables["--raised-background"]}),m=x(()=>J(r.nodeType.value.progressColor,a(r.node))),y=x(()=>{var j;return(j=J(r.nodeType.value.titleColor,a(r.node)))!=null?j:Ee[K.theme].variables["--foreground"]}),E=x(()=>J(r.nodeType.value.progressDisplay,a(r.node))),H=x(()=>a(r.dragging)!=null&&a(r.hasDragged)&&J(r.nodeType.value.canAccept,a(r.node))),U=x(()=>J(r.nodeType.value.style,a(r.node))),A=x(()=>J(r.nodeType.value.classes,a(r.node)));function Z(j){t("mouseDown",j,r.node.value.id,s.value)}function ge(j){var fe,be,Se;(fe=r.hasDragged)!=null&&fe.value||(t("endDragging",r.node.value.id),(Se=(be=r.nodeType.value).onClick)==null||Se.call(be,r.node.value),j.stopPropagation())}return(j,fe)=>{var be,Se,Kt;return w(),I("g",{class:ae(["boardnode",{[e.node.type]:!0,isSelected:a(o),isDraggable:a(s),...a(A)}]),style:Me([{opacity:((be=e.dragging)==null?void 0:be.id)===e.node.id&&e.hasDragged?.5:1},(Se=a(U))!=null?Se:[]]),transform:`translate(${a(c).x},${a(c).y})${a(o)?" scale(1.2)":""}`},[N(Mo,{actions:(Kt=a(l))!=null?Kt:[],"is-selected":a(o),node:e.node,"node-type":e.nodeType},null,8,["actions","is-selected","node","node-type"]),h("g",{class:"node-container",onMousedown:Z,onTouchstartPassive:Z,onMouseup:ge,onTouchendPassive:ge},[a(f)===a(Ze).Circle?(w(),I("g",Eo,[a(H)?(w(),I("circle",{key:0,class:"receiver",r:a(C)+8,fill:a(b),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,$o)):F("",!0),h("circle",{class:"body",r:a(C),fill:a(q),stroke:a($),"stroke-width":4},null,8,To),a(E)===a(_t).Fill?(w(),I("circle",{key:1,class:"progress progressFill",r:Math.max(a(C)*a(k)-2,0),fill:a(m)},null,8,Fo)):(w(),I("circle",{key:2,r:a(C)+4.5,class:"progress progressRing",fill:"transparent","stroke
|
||
|
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 Ki();const{globalBus:e}=await ht(()=>Promise.resolve().then(function(){return Yi}),void 0),{startGameLoop:t}=await ht(()=>import("./gameLoop.2338837c.js"),["assets/gameLoop.2338837c.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=Wn(Cu);e.emit("setupVue",n),n.mount("#app"),Xe(()=>{const i=un(),{updateServiceWorker:r}=ku({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(o){o&&setInterval(()=>o.update(),60*60*1e3)}})}),t()});export{u as D,ht as _,oe as a,Y as b,Jl as c,ve as g,Xi as l,B as p,K as s};
|