t2-mapper/docs/assets/KeyboardOverlay-DLT4q0GY.js
2026-03-22 21:11:02 -07:00

1 line
No EOL
11 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{r as i}from"./SettingsProvider-CCHVZuSg.js";import"./logger-z_EpIdIa.js";import"./traditional-BTL5qX2E.js";import{n as a}from"./cameraTourStore-PEzPVGnX.js";import"./mission-D8vr00S1.js";import"./engineStore-Dkm20jvr.js";import{B as o,D as s,E as c,G as l,J as u,K as d,M as f,N as p,V as m,b as h,d as g,m as _,q as v,w as y,x as b,y as x,z as S}from"./index-DBtsNu05.js";import{n as C,t as w}from"./gr-1PcjgMj0.js";var T=t(),E=e(n(),1);function D(e){return document.addEventListener(`pointerlockchange`,e),()=>document.removeEventListener(`pointerlockchange`,e)}function O(){return document.pointerLockElement!==null}function k(){return(0,E.useSyncExternalStore)(D,O,A)}function A(){return!1}var j={Root:`_Root_88qkf_1`,Column:`_Column_88qkf_13`,Row:`_Row_88qkf_25`,Spacer:`_Spacer_88qkf_31`,Sep:`_Sep_88qkf_35`,Key:`_Key_88qkf_39`,Label:`_Label_88qkf_78`,MultiInput:`_MultiInput_88qkf_120`,Input:`_Input_88qkf_128`,ColumnLabel:`_ColumnLabel_88qkf_161`,PlayPauseIcon:`_PlayPauseIcon_88qkf_170`,MouseIcon:`_MouseIcon_88qkf_174`},M=r();function N(e,t){let n=e[t];return n!=null&&`pressed`in n&&n.pressed}function P(e){let t=(0,T.c)(24),{action:n,input:r,label:i,labelPosition:a,labelSize:o,inputSize:s,size:c,disabled:l,debounce:u}=e,d=a===void 0?`hidden`:a,f=o===void 0?`fill`:o,p=s===void 0?`fill`:s,m=c===void 0?`fill`:c,h=l===void 0?!1:l,_=(0,E.useRef)(void 0),[v,y]=(0,E.useState)(!1),b;t[0]===n?b=t[1]:(b=typeof n==`function`?n:e=>N(e,n),t[0]=n,t[1]=b);let x=g(b),S,C;t[2]!==u||t[3]!==x?(S=()=>{if(u)if(x)clearTimeout(_.current),_.current=void 0,y(!0);else return _.current=setTimeout(()=>{_.current=void 0,y(!1)},u),()=>clearTimeout(_.current)},C=[x,u],t[2]=u,t[3]=x,t[4]=S,t[5]=C):(S=t[4],C=t[5]),(0,E.useEffect)(S,C);let w=u?v:x,D;t[6]!==i||t[7]!==d||t[8]!==f?(D=d===`left`?(0,M.jsx)(`span`,{className:j.Label,"data-size":f,children:i}):null,t[6]=i,t[7]=d,t[8]=f,t[9]=D):D=t[9];let O;t[10]!==r||t[11]!==p?(O=Array.isArray(r)?(0,M.jsx)(`div`,{className:j.MultiInput,"data-size":p,children:r.map(F)}):(0,M.jsx)(`span`,{className:j.Input,"data-size":p,children:r}),t[10]=r,t[11]=p,t[12]=O):O=t[12];let k;t[13]!==i||t[14]!==d||t[15]!==f?(k=d===`right`?(0,M.jsx)(`span`,{className:j.Label,"data-size":f,children:i}):null,t[13]=i,t[14]=d,t[15]=f,t[16]=k):k=t[16];let A;return t[17]!==h||t[18]!==w||t[19]!==m||t[20]!==O||t[21]!==k||t[22]!==D?(A=(0,M.jsxs)(`div`,{className:j.Key,"data-pressed":w,"data-size":m,"data-disabled":h,children:[D,O,k]}),t[17]=h,t[18]=w,t[19]=m,t[20]=O,t[21]=k,t[22]=D,t[23]=A):A=t[23],A}function F(e,t){return(0,M.jsx)(`span`,{className:j.Input,children:e},t)}function I(){let e=(0,T.c)(12),t=k(),[n,r]=(0,E.useState)(!1),i=(0,E.useRef)(!1),a,o;e[0]===t?(a=e[1],o=e[2]):(a=()=>{if(i.current&&!t){r(!0);let e=setTimeout(()=>r(!1),150);return()=>clearTimeout(e)}i.current=t},o=[t],e[0]=t,e[1]=a,e[2]=o),(0,E.useEffect)(a,o);let s=t||n,c;e[3]!==n||e[4]!==s?(c=s?()=>n:`canvasClick`,e[3]=n,e[4]=s,e[5]=c):c=e[5];let l=s?`Unlock mouse`:`Capture mouse`,u;e[6]===s?u=e[7]:(u=s?`Esc`:(0,M.jsx)(x,{className:j.MouseIcon}),e[6]=s,e[7]=u);let d;return e[8]!==c||e[9]!==l||e[10]!==u?(d=(0,M.jsx)(P,{action:c,label:l,input:u,labelPosition:`right`,inputSize:`auto`}),e[8]=c,e[9]=l,e[10]=u,e[11]=d):d=e[11],d}function L(){let e=(0,T.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsxs)(`div`,{className:j.Row,children:[(0,M.jsx)(`div`,{className:j.Spacer}),(0,M.jsx)(P,{action:`moveForward`,input:`W`,label:`Forward`}),(0,M.jsx)(`div`,{className:j.Spacer})]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsxs)(`div`,{className:j.Column,children:[t,(0,M.jsxs)(`div`,{className:j.Row,children:[(0,M.jsx)(P,{action:`moveLeft`,input:`A`,label:`Strafe left`}),(0,M.jsx)(P,{action:`moveBackward`,input:`S`,label:`Backward`}),(0,M.jsx)(P,{action:`moveRight`,input:`D`,label:`Strafe right`})]})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`moveUp`,input:`E`,label:(0,M.jsx)(m,{}),labelPosition:`left`,labelSize:`auto`})}),e[2]=r):r=e[2];let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[n,(0,M.jsxs)(`div`,{className:j.Column,children:[r,(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`moveDown`,input:`Q`,label:(0,M.jsx)(o,{}),labelPosition:`left`,labelSize:`auto`})})]})]}),e[3]=i):i=e[3],i}function R(){let e=(0,T.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(`div`,{className:j.Spacer}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsxs)(`div`,{className:j.Row,children:[t,(0,M.jsx)(P,{action:`lookUp`,input:(0,M.jsx)(u,{}),label:`Look up`}),(0,M.jsx)(`div`,{className:j.Spacer})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,M.jsx)(P,{action:`lookLeft`,input:(0,M.jsx)(d,{}),label:`Look left`}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(P,{action:`lookDown`,input:(0,M.jsx)(l,{}),label:`Look down`}),e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsxs)(`div`,{className:j.Column,children:[n,(0,M.jsxs)(`div`,{className:j.Row,children:[r,i,(0,M.jsx)(P,{action:`lookRight`,input:(0,M.jsx)(v,{}),label:`Look right`})]})]}),e[4]=a):a=e[4],a}function z(){let e=(0,T.c)(8),{speedMultiplier:t}=i(),[n,r]=(0,E.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{r(B);let e=setTimeout(()=>{r(!1)},100);return()=>clearTimeout(e)},e[0]=a):a=e[0];let o;e[1]===t?o=e[2]:(o=[t],e[1]=t,e[2]=o),(0,E.useEffect)(a,o);let s;e[3]===n?s=e[4]:(s=e=>(e.adjustSpeed?.deltaY??0)!==0&&(n??!1),e[3]=n,e[4]=s);let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,M.jsx)(h,{className:j.MouseIcon}),e[5]=c):c=e[5];let l;return e[6]===s?l=e[7]:(l=(0,M.jsx)(P,{action:s,debounce:50,label:`Adjust speed`,input:c,labelPosition:`right`,inputSize:`auto`}),e[6]=s,e[7]=l),l}function B(e){return e!=null}function V(){let e=(0,T.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{action:H,input:(0,M.jsx)(S,{className:j.MouseIcon}),label:`Rotate camera`,labelPosition:`right`,inputSize:`auto`}),e[0]=t):t=e[0],t}function H(e){return e.dragLook?.dragging??!1}function U(){let e=(0,T.c)(6),t=f()===`map`,n=p(`Camera`),r=t?n.length:0,i,a;e[0]===r?(i=e[1],a=e[2]):(i=e=>Array.from({length:r},(t,n)=>N(e,`camera${n+1}`)).some(W),a=r===1?`1`:(0,M.jsxs)(M.Fragment,{children:[`1`,r]}),e[0]=r,e[1]=i,e[2]=a);let o;return e[3]!==i||e[4]!==a?(o=(0,M.jsx)(P,{action:i,input:a,label:`Select camera`,labelPosition:`right`}),e[3]=i,e[4]=a,e[5]=o):o=e[5],o}function W(e){return e}function G(){let e=(0,T.c)(11),t=k(),n=f()===`map`,r=p(`Camera`),i=n?r.length:0,a,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsx)(L,{}),o=(0,M.jsx)(R,{}),e[0]=a,e[1]=o):(a=e[0],o=e[1]);let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(z,{})}),e[2]=s):s=e[2];let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[s,(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(I,{})})]}),e[3]=c):c=e[3];let l;e[4]===t?l=e[5]:(l=t?null:(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(V,{})}),e[4]=t,e[5]=l);let u;e[6]===i?u=e[7]:(u=i>0&&(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(U,{})}),e[6]=i,e[7]=u);let d;return e[8]!==l||e[9]!==u?(d=(0,M.jsxs)(M.Fragment,{children:[a,o,c,(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[l,u]})]}),e[8]=l,e[9]=u,e[10]=d):d=e[10],d}function K(){let e=(0,T.c)(15),t=y(),n=s(),r=b.indexOf(n)+1,i=b.indexOf(n)-1,a=r>=b.length,o=i<0,c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`<`,`,`],e[0]=c):c=e[0];let l;e[1]===o?l=e[2]:(l=(0,M.jsx)(P,{action:`decreasePlaybackSpeed`,label:`Slow down`,input:c,labelPosition:`right`,disabled:o}),e[1]=o,e[2]=l);let u;e[3]===t?u=e[4]:(u=(0,M.jsx)(P,{action:`playPause`,label:t?(0,M.jsx)(w,{className:j.PlayPauseIcon}):(0,M.jsx)(C,{className:j.PlayPauseIcon}),input:`Space`,labelPosition:`left`,size:`auto`}),e[3]=t,e[4]=u);let d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`>`,`.`],e[5]=d):d=e[5];let f;e[6]===a?f=e[7]:(f=(0,M.jsx)(P,{action:`increasePlaybackSpeed`,input:d,label:`Speed up`,labelPosition:`left`,disabled:a}),e[6]=a,e[7]=f);let p;e[8]!==l||e[9]!==u||e[10]!==f?(p=(0,M.jsx)(`div`,{className:j.Column,children:(0,M.jsxs)(`div`,{className:j.Row,children:[l,u,f]})}),e[8]=l,e[9]=u,e[10]=f,e[11]=p):p=e[11];let m;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,M.jsx)(`div`,{className:j.Column,children:(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(I,{})})}),e[12]=m):m=e[12];let h;return e[13]===p?h=e[14]:(h=(0,M.jsxs)(M.Fragment,{children:[p,m]}),e[13]=p,e[14]=h),h}function q(){let e=(0,T.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(M.Fragment,{children:(0,M.jsx)(`div`,{className:j.Column,children:(0,M.jsxs)(`div`,{className:j.Row,children:[(0,M.jsx)(P,{action:`nextStop`,label:`Skip to next stop`,input:(0,M.jsx)(x,{className:j.MouseIcon}),labelPosition:`right`}),(0,M.jsx)(P,{action:`exitTour`,label:`Exit tour`,input:`Esc`,labelPosition:`right`})]})})}),e[0]=t):t=e[0],t}function J(){let e=(0,T.c)(23),t=_(),n=k(),r;e[0]===t?r=e[1]:(r=t===`fly`?(0,M.jsx)(L,{}):null,e[0]=t,e[1]=r);let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(R,{}),e[2]=i):i=e[2];let a;e[3]===t?a=e[4]:(a=t===`fly`?(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(z,{})}):null,e[3]=t,e[4]=a);let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(I,{})}),e[5]=o):o=e[5];let s;e[6]===a?s=e[7]:(s=(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[a,o]}),e[6]=a,e[7]=s);let c;e[8]===n?c=e[9]:(c=n?null:(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(V,{})}),e[8]=n,e[9]=c);let l;e[10]!==t||e[11]!==n?(l=t===`follow`&&n?(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`nextPlayer`,label:`Next player`,input:(0,M.jsx)(x,{className:j.MouseIcon}),labelPosition:`right`,inputSize:`auto`})}):null,e[10]=t,e[11]=n,e[12]=l):l=e[12];let u=t===`follow`?`Fly mode`:`Follow mode`,d;e[13]===u?d=e[14]:(d=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`toggleObserverMode`,label:u,input:`Space`,labelPosition:`right`,inputSize:`auto`})}),e[13]=u,e[14]=d);let f;e[15]!==c||e[16]!==l||e[17]!==d?(f=(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[c,l,d]}),e[15]=c,e[16]=l,e[17]=d,e[18]=f):f=e[18];let p;return e[19]!==r||e[20]!==s||e[21]!==f?(p=(0,M.jsxs)(M.Fragment,{children:[r,i,s,f]}),e[19]=r,e[20]=s,e[21]=f,e[22]=p):p=e[22],p}function Y(){let e=(0,T.c)(13),t=c(),n=_(),r=a(X),i=t?.source===`demo`,o=t?.source===`live`,s=!t,l=o&&(n===`fly`||n===`follow`),u=s&&!r,d;e[0]===u?d=e[1]:(d=u&&(0,M.jsx)(G,{}),e[0]=u,e[1]=d);let f;e[2]===l?f=e[3]:(f=l&&(0,M.jsx)(J,{}),e[2]=l,e[3]=f);let p;e[4]===i?p=e[5]:(p=i&&(0,M.jsx)(K,{}),e[4]=i,e[5]=p);let m;e[6]===r?m=e[7]:(m=r&&(0,M.jsx)(q,{}),e[6]=r,e[7]=m);let h;return e[8]!==d||e[9]!==f||e[10]!==p||e[11]!==m?(h=(0,M.jsxs)(`div`,{className:j.Root,children:[d,f,p,m]}),e[8]=d,e[9]=f,e[10]=p,e[11]=m,e[12]=h):h=e[12],h}function X(e){return e.animation!==null}export{Y as KeyboardOverlay};