t2-mapper/docs/_next/static/chunks/5be1f91d5fe511ed.js
2026-02-19 06:10:38 -08:00

1 line
No EOL
11 KiB
JavaScript

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94247,e=>{"use strict";var t=e.i(43476),n=e.i(932),a=e.i(71645),i=e.i(11152),s=e.i(66027),l=e.i(12979),r=e.i(91996);let o=new Map;function c(e){let a,i=(0,n.c)(5),{name:s}=e;i[0]!==s?(a=function(e){let t;if(o.has(e))return o.get(e);try{t=(0,l.getUrlForPath)((0,r.getStandardTextureResourceKey)(`textures/gui/${e}`))}catch{t=null}return o.set(e,t),t}(s),i[0]=s,i[1]=a):a=i[1];let c=a;if(c){let e;return i[2]!==c?(e=(0,t.jsx)("img",{src:c,alt:"",className:"GuiMarkup-bitmap"}),i[2]=c,i[3]=e):e=i[3],e}if(/bullet/i.test(s)){let e;return i[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{className:"GuiMarkup-bullet",children:"•"}),i[4]=e):e=i[4],e}return null}function u(e){let a,i,s=(0,n.c)(8),{span:l}=e,{color:r,fontSize:o}=l.style;if(!r&&!o){let e;return s[0]!==l.text?(e=(0,t.jsx)(t.Fragment,{children:l.text}),s[0]=l.text,s[1]=e):e=s[1],e}let c=null!=o?`${o}px`:void 0;return s[2]!==r||s[3]!==c?(a={color:r,fontSize:c},s[2]=r,s[3]=c,s[4]=a):a=s[4],s[5]!==l.text||s[6]!==a?(i=(0,t.jsx)("span",{style:a,children:l.text}),s[5]=l.text,s[6]=a,s[7]=i):i=s[7],i}function p(e){let a,i,s,l=(0,n.c)(6),{markup:r}=e;l[0]!==r?(a=function(e){let t=function(e){let t,n=[],a=/<([^>]*)>/g,i=0,s=e=>{let t=e.split("\n");t.forEach((e,a)=>{e&&n.push({type:"text",value:e}),a<t.length-1&&n.push({type:"newline"})})};for(;t=a.exec(e);){t.index>i&&s(e.slice(i,t.index)),i=t.index+t[0].length;let a=t[1].trim(),l=a.indexOf(":"),r=(-1===l?a:a.slice(0,l)).toLowerCase(),o=-1===l?"":a.slice(l+1);n.push({type:"tag",name:r,arg:o})}return i<e.length&&s(e.slice(i)),n}(e),n=[],a={},i="left",s=0,l=[],r="left",o=0,c=!1,u=0,p=[],f=()=>{p.push({align:r,lmargin:o,textIndent:u,items:l}),l=[],r=i,o=s,c=!1,u=0},m=e=>{if(!e)return;let t=l[l.length-1];t?.type==="span"&&t.style.color===a.color&&t.style.fontSize===a.fontSize?t.text+=e:l.push({type:"span",text:e,style:{...a}})};for(let e of t){if("newline"===e.type){f();continue}if("text"===e.type){m(e.value.replace(/\t/g," "));continue}let{name:t,arg:p}=e;switch(t){case"spush":n.push({...a});break;case"spop":n.length>0&&(a=n.pop());break;case"color":a={...a,color:`#${p.trim()}`};break;case"font":a={...a,fontSize:function(e){let t=e.lastIndexOf(":");return Math.min(parseInt(-1===t?e:e.slice(t+1),10)||14,16)}(p)};break;case"lmargin":{let e=parseInt(p,10)||0;s=e,c&&e>0?u=e:0===l.length&&(o=e);break}case"just":{let e=p.trim().toLowerCase();("left"===e||"center"===e||"right"===e)&&(i=e,0===l.length&&(r=e));break}case"bitmap":c=!0,l.push({type:"bitmap",name:p.trim()});break;case"br":f();break;case"sbreak":l.length>0&&f(),f()}}return l.length>0&&f(),p}(r),l[0]=r,l[1]=a):a=l[1];let o=a;return l[2]!==o?(i=o.map(f),l[2]=o,l[3]=i):i=l[3],l[4]!==i?(s=(0,t.jsx)("div",{className:"GuiMarkup",children:i}),l[4]=i,l[5]=s):s=l[5],s}function f(e,n){let{align:a,lmargin:i,textIndent:s,items:l}=e,r=l.filter(y),o=l.filter(x),c=o.some(g);return r.length>0&&s>0&&c?(0,t.jsxs)("div",{className:"GuiMarkup-bulletLine",children:[(0,t.jsx)("div",{className:"GuiMarkup-bulletIcon",children:r.map(h)}),(0,t.jsx)("div",{className:"GuiMarkup-bulletText",children:o.map(d)})]},n):c||0!==r.length?(0,t.jsx)("div",{className:"GuiMarkup-line",style:{textAlign:"left"!==a?a:void 0,paddingLeft:i>0?`${i}px`:void 0},children:l.map(m)},n):(0,t.jsx)("div",{className:"GuiMarkup-spacer"},n)}function m(e,n){return"bitmap"===e.type?(0,t.jsx)(c,{name:e.name},n):(0,t.jsx)(u,{span:e},n)}function d(e,n){return(0,t.jsx)(u,{span:e},n)}function h(e,n){return(0,t.jsx)(c,{name:e.name},n)}function g(e){return e.text.trim().length>0}function x(e){return"span"===e.type}function y(e){return"bitmap"===e.type}function j(e){let i,s,l,r,o=(0,n.c)(9),{src:c,alt:u,className:p}=e,f=void 0===p?"MapInfoDialog-preview":p,m=(0,a.useRef)(null),[d,h]=(0,a.useState)(!1);o[0]!==c?(i=()=>{let e=!1;return fetch(c).then(M).then(v).then(t=>{if(e)return void t.close();let n=m.current;n?(n.width=t.width,n.height=t.height,n.getContext("2d")?.drawImage(t,0,0),t.close(),h(!0)):t.close()}).catch(b),()=>{e=!0}},s=[c],o[0]=c,o[1]=i,o[2]=s):(i=o[1],s=o[2]),(0,a.useEffect)(i,s);let g=d?"block":"none";return o[3]!==g?(l={display:g},o[3]=g,o[4]=l):l=o[4],o[5]!==u||o[6]!==f||o[7]!==l?(r=(0,t.jsx)("canvas",{ref:m,className:f,"aria-label":u,style:l}),o[5]=u,o[6]=f,o[7]=l,o[8]=r):r=o[8],r}function b(){}function v(e){return createImageBitmap(e,{colorSpaceConversion:"none"})}function M(e){return e.blob()}function k(e){let s,r,o,c,u,p,f,m,d,h,g,x=(0,n.c)(22),{track:y}=e,[j,b]=(0,a.useState)(!1),[v,M]=(0,a.useState)(!0),k=(0,a.useRef)(null);x[0]!==y?(s=y.toLowerCase(),x[0]=y,x[1]=s):s=x[1];let I=`${l.RESOURCE_ROOT_URL}music/${s}.mp3`;x[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>()=>{k.current?.pause()},o=[],x[2]=r,x[3]=o):(r=x[2],o=x[3]),(0,a.useEffect)(r,o),x[4]!==j?(c=()=>{let e=k.current;e&&(j?e.pause():e.play().catch(()=>M(!1)))},x[4]=j,x[5]=c):c=x[5];let N=c;return x[6]===Symbol.for("react.memo_cache_sentinel")?(u=()=>b(!0),p=()=>b(!1),f=()=>M(!1),x[6]=u,x[7]=p,x[8]=f):(u=x[6],p=x[7],f=x[8]),x[9]!==I?(m=(0,t.jsx)("audio",{ref:k,src:I,loop:!0,onPlay:u,onPause:p,onError:f}),x[9]=I,x[10]=m):m=x[10],x[11]!==y?(d=(0,t.jsx)("span",{className:"MusicTrackName",children:y}),x[11]=y,x[12]=d):d=x[12],x[13]!==v||x[14]!==j||x[15]!==N?(h=v&&(0,t.jsx)("button",{className:"MapInfoDialog-musicBtn",onClick:N,"aria-label":j?"Pause music":"Play music",children:j?(0,t.jsx)(i.FaVolumeUp,{}):(0,t.jsx)(i.FaVolumeMute,{})}),x[13]=v,x[14]=j,x[15]=N,x[16]=h):h=x[16],x[17]!==j||x[18]!==h||x[19]!==m||x[20]!==d?(g=(0,t.jsxs)("div",{className:"MapInfoDialog-musicTrack","data-playing":j,children:[m,d,h]}),x[17]=j,x[18]=h,x[19]=m,x[20]=d,x[21]=g):g=x[21],g}function I(e){var i;let o,c,u,f,m,d,h,g,x,y,b,v,M,I,S,C,L,E,P,R,T,_,B,K,U,$,G,O,F,q,z,A,Q,V,H,J,W,X=(0,n.c)(98),{open:Y,onClose:Z,missionName:ee,missionType:et}=e,{data:en}=((W=(0,n.c)(2))[0]!==ee?(J={queryKey:["parsedMission",ee],queryFn:()=>(0,l.loadMission)(ee)},W[0]=ee,W[1]=J):J=W[1],(0,s.useQuery)(J)),ea=(0,a.useRef)(null);if(X[0]!==Y?(o=()=>{if(Y){ea.current?.focus();try{document.exitPointerLock()}catch{}}},c=[Y],X[0]=Y,X[1]=o,X[2]=c):(o=X[1],c=X[2]),(0,a.useEffect)(o,c),X[3]!==Z||X[4]!==Y?(u=()=>{if(!Y)return;let e=e=>{if("KeyI"===e.code||"Escape"===e.key)Z();else if("k"===e.key&&(e.metaKey||e.ctrlKey))return void Z();e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",D,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",D,{capture:!0})}},f=[Y,Z],X[3]=Z,X[4]=Y,X[5]=u,X[6]=f):(u=X[5],f=X[6]),(0,a.useEffect)(u,f),!Y)return null;X[7]!==en?(m=en?function(e){for(let t of e.body){if("ObjectDeclaration"!==t.type)continue;let{instanceName:e,body:n}=t;if(e&&"Identifier"===e.type&&"missiongroup"===e.name.toLowerCase()){let e={};for(let t of n){if("Assignment"!==t.type)continue;let{target:n,value:a}=t;"Identifier"===n.type&&"StringLiteral"===a.type&&(e[n.name.toLowerCase()]=a.value)}return e}}return{}}(en.ast):{},X[7]=en,X[8]=m):m=X[8];let ei=m;X[9]!==ee||X[10]!==en?(d=en?function(e,t){if(e)try{let t=(0,r.getStandardTextureResourceKey)(`textures/gui/${e}`);return(0,l.getUrlForPath)(t)}catch{}try{let e=(0,r.getStandardTextureResourceKey)(`textures/gui/Load_${t}`);return(0,l.getUrlForPath)(e)}catch{}return null}(en.bitmap,ee):null,X[9]=ee,X[10]=en,X[11]=d):d=X[11];let es=d,el=en?.displayName??ee;X[12]!==et?(h=et.toLowerCase(),X[12]=et,X[13]=h):h=X[13];let er="singleplayer"===h,eo=ei.musictrack;if(X[14]!==es||X[15]!==el||X[16]!==er||X[17]!==et||X[18]!==Z||X[19]!==en){let e,n,a,s,l=en?.missionString?(i=en.missionString,s=et.toUpperCase(),i.split("\n").flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(s)?[]:[e.replace(/^\[[^\]]+\]/,"")]}).join("\n")):null;if(X[38]!==en?.missionQuote){for(let t of(n="",e="",en?.missionQuote?.trim().split("\n")??[])){let a=t.trim();a.match(/^-+\s/)?e=a.replace(/^-+\s*/,"").trim():a&&(n+=(n?" ":"")+a)}X[38]=en?.missionQuote,X[39]=e,X[40]=n}else e=X[39],n=X[40];_="MapInfoDialog-overlay",B=Z,I=ea,S="MapInfoDialog",C=w,L=N,E="dialog",P="true",R="Map Information",T=-1,M="MapInfoDialog-inner",K="MapInfoDialog-left",X[41]!==es||X[42]!==el||X[43]!==er?(U=es&&er&&(0,t.jsx)(j,{className:"MapInfoDialog-preview--floated",src:es,alt:`${el} preview`},es),X[41]=es,X[42]=el,X[43]=er,X[44]=U):U=X[44],X[45]!==el?(g=(0,t.jsx)("h1",{className:"MapInfoDialog-title",children:el}),X[45]=el,X[46]=g):g=X[46],X[47]!==en?(a=en?.planetName&&(0,t.jsx)("span",{className:"MapInfoDialog-planet",children:en.planetName}),X[47]=en,X[48]=a):a=X[48],X[49]!==a?(x=(0,t.jsx)("div",{className:"MapInfoDialog-meta",children:a}),X[49]=a,X[50]=x):x=X[50],X[51]!==e||X[52]!==n?(y=n&&(0,t.jsxs)("blockquote",{className:"MapInfoDialog-quote",children:[(0,t.jsx)("p",{children:n}),e&&(0,t.jsxs)("cite",{children:["— ",e]})]}),X[51]=e,X[52]=n,X[53]=y):y=X[53],X[54]!==en?(b=en?.missionBlurb&&(0,t.jsx)("p",{className:"MapInfoDialog-blurb",children:en.missionBlurb.trim()}),X[54]=en,X[55]=b):b=X[55],v=l&&l.trim()&&(0,t.jsx)("div",{className:"MapInfoDialog-section",children:(0,t.jsx)(p,{markup:l})}),X[14]=es,X[15]=el,X[16]=er,X[17]=et,X[18]=Z,X[19]=en,X[20]=g,X[21]=x,X[22]=y,X[23]=b,X[24]=v,X[25]=M,X[26]=I,X[27]=S,X[28]=C,X[29]=L,X[30]=E,X[31]=P,X[32]=R,X[33]=T,X[34]=_,X[35]=B,X[36]=K,X[37]=U}else g=X[20],x=X[21],y=X[22],b=X[23],v=X[24],M=X[25],I=X[26],S=X[27],C=X[28],L=X[29],E=X[30],P=X[31],R=X[32],T=X[33],_=X[34],B=X[35],K=X[36],U=X[37];return X[56]!==en?($=en?.missionBriefing&&(0,t.jsxs)("div",{className:"MapInfoDialog-section",children:[(0,t.jsx)("h2",{className:"MapInfoDialog-sectionTitle",children:"Mission Briefing"}),(0,t.jsx)(p,{markup:en.missionBriefing})]}),X[56]=en,X[57]=$):$=X[57],X[58]!==eo?(G=eo&&(0,t.jsx)(k,{track:eo}),X[58]=eo,X[59]=G):G=X[59],X[60]!==g||X[61]!==x||X[62]!==y||X[63]!==b||X[64]!==v||X[65]!==$||X[66]!==G||X[67]!==K||X[68]!==U?(O=(0,t.jsxs)("div",{className:K,children:[U,g,x,y,b,v,$,G]}),X[60]=g,X[61]=x,X[62]=y,X[63]=b,X[64]=v,X[65]=$,X[66]=G,X[67]=K,X[68]=U,X[69]=O):O=X[69],X[70]!==es||X[71]!==el||X[72]!==er?(F=es&&!er&&(0,t.jsx)("div",{className:"MapInfoDialog-right",children:(0,t.jsx)(j,{src:es,alt:`${el} preview`},es)}),X[70]=es,X[71]=el,X[72]=er,X[73]=F):F=X[73],X[74]!==M||X[75]!==O||X[76]!==F?(q=(0,t.jsxs)("div",{className:M,children:[O,F]}),X[74]=M,X[75]=O,X[76]=F,X[77]=q):q=X[77],X[78]!==Z?(z=(0,t.jsx)("button",{className:"MapInfoDialog-closeBtn",onClick:Z,children:"Close"}),X[78]=Z,X[79]=z):z=X[79],X[80]===Symbol.for("react.memo_cache_sentinel")?(A=(0,t.jsx)("span",{className:"MapInfoDialog-hint",children:"I or Esc to close"}),X[80]=A):A=X[80],X[81]!==z?(Q=(0,t.jsxs)("div",{className:"MapInfoDialog-footer",children:[z,A]}),X[81]=z,X[82]=Q):Q=X[82],X[83]!==I||X[84]!==S||X[85]!==C||X[86]!==L||X[87]!==E||X[88]!==P||X[89]!==R||X[90]!==T||X[91]!==q||X[92]!==Q?(V=(0,t.jsxs)("div",{ref:I,className:S,onClick:C,onKeyDown:L,role:E,"aria-modal":P,"aria-label":R,tabIndex:T,children:[q,Q]}),X[83]=I,X[84]=S,X[85]=C,X[86]=L,X[87]=E,X[88]=P,X[89]=R,X[90]=T,X[91]=q,X[92]=Q,X[93]=V):V=X[93],X[94]!==_||X[95]!==B||X[96]!==V?(H=(0,t.jsx)("div",{className:_,onClick:B,children:V}),X[94]=_,X[95]=B,X[96]=V,X[97]=H):H=X[97],H}function N(e){return e.stopPropagation()}function w(e){return e.stopPropagation()}function D(e){e.stopImmediatePropagation()}e.s(["MapInfoDialog",()=>I],94247)}]);