1import{e as E,r as h,j as e,B as j,U as A,k as L,h as I,b as F,d as G,R as O,l as d,N as T,p as _,m as M}from"./index-DN4Mwqf7.js";import{F as B,R as W,C as D,H as U}from"./ForgotPassword-BqRhIn67.js";import y from"./Root-DJ5wBsfL.js";import H from"./Login-BlZwUDEx.js";import X from"./LoginOAuth2-DxTRCgki.js";import q from"./Logout-BBWwnCP8.js";import Q from"./Signup-CI61Crvw.js";import J from"./ConfirmEmail-DS2DhK6W.js";import V from"./ObjectExplorer-Bl-zkk46.js";import Y from"./SysAdminApp-BiecOwVC.js";import{a as f}from"./index-CeTPcGzX.js";import"./Parameter-DD2b9kxf.js";import"./useQuery-Dya-hda-.js";import"./useMobile-D8fDk965.js";import"./AppWebsiteV2-ClyCSvQD.js";import"./Support-BHZo4W1C.js";import"./types-0x_1vaZr.js";import"./useAudioPosition-CPloxytS.js";import"./sanitizeCss-DDeV3a_4.js";import"./ThemeEditor-WHlrAEfK.js";import"./types-C-48g5o1.js";import"./index-Cu4DO8L0.js";import"./motion-j9FxiGRE.js";import"./Popup-CI8dlaUY.js";import"./installPages-Cna00ltZ.js";import"./Step-C8C3963e.js";import"./TwoFactorBanner-D4WjVwWR.js";import"./AuthUtilsHook-CYZym16x.js";import"./freePlan-6P4u8eWe.js";import"./StripeDataHandler-7dQUdFN5.js";import"./ApplicationContext-CgvY33Jd.js";import"./SplitPaneLayout-CYe7S9cP.js";import"./ParameterBuilder-D6MDV4qs.js";import"./index-Bq1GzDBn.js";import"./ace-Dlf-vt7D.js";import"./SelectOptions-CX_-i7or.js";import"./StreamSelectorV2-CMYzFjhf.js";import"./Card-cLjeqwtT.js";import"./ValidationsEditor-9eUU24Dk.js";import"./PlusScriptView-CbHSws3c.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./style-BRPsycUQ.js";import"./StreamTriggerDataHandler-Cs0IsTmf.js";import"./applications-4-Xsf5u6.js";import"./AppMenu-BKz22tte.js";import"./Placeholder-BfICVJLU.js";import"./ItemActionButtonsRunner-BhCzVyIt.js";import"./SpreadsheetViewer-0aBpyk4X.js";import"./ReceiptViewerModal-DXJRO76Y.js";import"./JobViewerModal-CKTjHPHi.js";import"./JobDetailView-BZ4JBm31.js";import"./mode-json-DGKgiNOd.js";import"./mode-text-owca_3Io.js";import"./CustomTemplateModal-Ds-_T8OI.js";import"./mode-css-ZyOVlraq.js";import"./useNavigationBlocker-DIfVhHY3.js";import"./SiteConfigurationPane-Bx7Ab4y4.js";import"./usePrompt-B0EunRfp.js";import"./toConsumableArray-u9GFSwrg.js";import"./MailingList-DYDdBp4u.js";import"./outputActions-FyfPcXwd.js";import"./Tab-UZsBiH8e.js";import"./OptimizerPane-CgzJuXhG.js";import"./AdminEditActionModal-DqdnxGQG.js";import"./StreamViewer-DTrl6OAL.js";import"./StreamEChart-xITwTqqn.js";import"./ReactECharts-BtHj0bXP.js";import"./FileViewer-vY3FOqMN.js";import"./JSONViewer-Bu0_hIJH.js";import"./papaparse.min-D6Gm67i-.js";import"./CssAiChat-BvsiERFR.js";/* empty css */function z(t){const a=E(),[m,i]=h.useState(!1),[n,r]=h.useState(null),[o,s]=h.useState(""),c=()=>Math.random().toString(36).substring(2,10).toUpperCase(),l=()=>{const u=c();r(u),i(!0)},p=()=>{r(null),i(!0)},x=()=>{if(o){const u=n||prompt("Enter Room ID");u&&a("/game/trivia/".concat(u),{state:{playerName:o}}),i(!1)}};return e.jsxs("div",{className:"Lobby",children:[e.jsx(j,{onClick:l,children:"Start new game"}),e.jsx(j,{onClick:p,children:"Join game"}),e.jsxs(f,{size:"mini",open:m,onClose:()=>i(!1),onOpen:()=>i(!0),children:[e.jsx(f.Header,{children:"Enter Player Name"}),e.jsx(f.Content,{children:e.jsx(A,{placeholder:"Enter your name",value:o,onChange:u=>s(u.target.value),fluid:!0})}),e.jsxs(f.Actions,{children:[e.jsx(j,{onClick:()=>i(!1),children:"Cancel"}),e.jsx(j,{primary:!0,onClick:x,children:"Confirm"})]})]})]})}const K=t=>{const[a,m]=h.useState([]),[i,n]=h.useState("waiting-for-players");return h.useEffect(()=>{const r=new WebSocket("ws://localhost:5000/games/".concat(t));return r.onopen=()=>{console.log("WebSocket connected"),r.send(JSON.stringify({action:"joinGame",gameId:t,playerName:"PlayerName"}))},r.onmessage=o=>{console.log({event:o});const s=JSON.parse(o.data);s.action==="updatePlayers"&&s.players&&m(s.players),s.gameStage&&n(s.gameStage)},r.onerror=o=>{console.error("WebSocket error:",o)},r.onclose=()=>{console.log("WebSocket connection closed")},()=>{r.close()}},[t]),{players:a,gameStage:i}};function $(t){const{players:a,startGame:m}=t,i=a.map((n,r)=>e.jsx("div",{children:e.jsx("p",{children:n})},r));return e.jsxs("div",{className:"WaitingForPlayers",children:[e.jsx("h1",{children:"Joined Players"}),i,e.jsx(j,{onClick:m,children:"Start"})]})}function Z(t){const{scores:a}=t,m=a.map((i,n)=>e.jsxs("div",{children:[e.jsx("b",{children:i}),": ",n]}));return e.jsx("div",{className:"Scoreboard",children:m})}function ee(t){const{question:a}=t;return e.jsx("div",{className:"QuestionArea",children:e.jsx("h1",{children:a})})}function te(t){const{answers:a,handleAnswer:m,responses:i,players:n}=t,r=a.map(c=>e.jsx(Button,{onClick:m(c),children:c})),o=[];for(const c of n)i[c]===void 0&&o.push(c);if(o.length===n.length)return e.jsx(Loader,{active:!0});const s=o.join(",");return e.jsxs("div",{className:"AnswerArea",children:[r,e.jsx("hr",{}),"Waiting for: ",s]})}function re(t){const{scores:a,currentQuestion:m,currentAnswer:i,players:n,responses:r}=t;return e.jsxs("div",{className:"AwaitingAnswers",children:[e.jsx(Z,{scores:a}),e.jsx(ee,{question:m}),e.jsx(te,{answers:currentAnswers,handleAnswer,players:n,responses:r})]})}function oe(t){const{scores:a}=t,m=Object.keys(a).map(i=>{const n=a[i];return e.jsxs("div",{children:[e.jsxs("b",{children:[i,":"]})," ",n]})});return e.jsxs("div",{className:"EndGame",children:[e.jsx("h1",{children:"Game over"}),m]})}function se(t){const{thisPlayer:a,pickingPlayer:m,startCategory:i}=t,[n,r]=h.useState("");let o;if(a==m){const s=function(){i(n)};o=e.jsxs("div",{children:[e.jsx("p",{children:"Describe the category"}),e.jsx(A,{value:n,onChange:c=>r(c.target.value)}),e.jsx(j,{onClick:s,children:"Start Round"})]})}else o=e.jsxs("div",{children:["Waiting on ",m," to pick the category"]});return e.jsxs("div",{className:"PickCategory",children:[e.jsx("h1",{children:"Category Selection"}),o]})}function ne(t){var a;const{gameId:m}=L(),n=((a=I().state)==null?void 0:a.playerName)||"",[r,o]=h.useState(n),[s,c]=h.useState(!n),[l,p]=h.useState(""),{players:x,gameStage:u}=K(m||"");console.log({players:x});const g=async()=>{setGameStage("pick-category")},S=()=>{l&&(o(l),c(!1))};return e.jsxs(e.Fragment,{children:[e.jsxs(f,{open:s,children:[e.jsx(f.Header,{children:"Enter Your Name"}),e.jsx(f.Content,{children:e.jsx(A,{placeholder:"Enter your name",value:l,onCh
1ange:v=>p(v.target.value)})}),e.jsx(f.Actions,{children:e.jsx(j,{onClick:S,disabled:!l,children:"Submit"})})]}),u==="waiting-for-players"&&e.jsx($,{players:x,startGame:g}),u==="pick-category"&&e.jsx(se,{thisPlayer:r,pickingPlayer:"kp",startCategory:()=>console.log("Start category")}),u==="active-category"&&e.jsx(re,{scores:{},currentQuestion:"Sample Question",currentAnswer:["Answer 1","Answer 2"],players:x,responses:{},handleAnswer:()=>console.log("Answer submitted")}),u==="end-game"&&e.jsx(oe,{scores:{}})]})}function ae(t,a){t.clearColor(0,0,0,1);const m=` 2 attribute vec2 coordinates; 3 void main(void) { 4 // Scale coordinates from [0, 1] to [-1, 1] 5 gl_Position = vec4(coordinates * 2.0 - 1.0, 0.0, 1.0); 6 } 7 `,i=` 8 precision mediump float; 9 uniform vec4 color; 10 void main(void) { 11 gl_FragColor = color; 12 } 13 `,n=t.createShader(t.VERTEX_SHADER);if(t.shaderSource(n,m),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){console.error("Vertex shader compilation error:",t.getShaderInfoLog(n));return}const r=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(r,i),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){console.error("Fragment shader compilation error:",t.getShaderInfoLog(r));return}const o=t.createProgram();if(t.attachShader(o,n),t.attachShader(o,r),t.linkProgram(o),t.useProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){console.error("Shader program linking error:",t.getProgramInfoLog(o));return}const s=t.getAttribLocation(o,"coordinates");t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0);const c=t.getUniformLocation(o,"color");(p=>{t.clear(t.COLOR_BUFFER_BIT);for(const x of p){const u=x.x,g=x.y,S=.005,v=.005,{r:P,g:N,b:k}=x,R=new Float32Array([u,g,u+S,g,u,g+v,u+S,g+v]),w=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,w),t.bufferData(t.ARRAY_BUFFER,R,t.STATIC_DRAW),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s),t.uniform4f(c,P,N,k,.8),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.deleteBuffer(w)}})(a)}const b=function(t,a=!1){const m=[];for(var i=0;i<t;){i+=1;const n=a?1+Math.random()*.25:Math.random(),r=Math.random(),o=Math.random()*.01+.01,s=Math.random();let c=1,l=1,p=1;s<.25?(c=1,l=1,p=0):s<.5?(c=.8,l=.8,p=.8):s<.75&&(c=.9,l=.9,p=.6);const x={x:n,y:r,velocityX:o,r:c,g:l,b:p};m.push(x)}return m};function ie(){const t=h.useRef(null),[a,m]=h.useState(0),[i,n]=h.useState(b(100));return h.useEffect(()=>{let r;return r=setInterval(()=>{m(s=>s+1);const o=[];for(const s of i){let c=s;c.x-=s.velocityX,c.x<0||o.push({...s,x:s.x-s.velocityX})}n(s=>{const c=[];let l=0;for(const p of s)p.x-p.velocityX<0?l+=1:c.push({...p,x:p.x-p.velocityX});return[...c,...b(l,!0)]})},100),()=>{clearInterval(r)}},[]),h.useEffect(()=>{const r=t.current,o=r.getContext("webgl");if(!o){console.error("WebGL not supported");return}ae(o,i);const s=c=>{const l=r.getBoundingClientRect(),p=c.clientX-l.left,x=c.clientY-l.top;console.log("Clicked at x: ".concat(p,", y: ").concat(x))};return r.addEventListener("click",s),()=>{r.removeEventListener("click",s)}},[a]),e.jsx("div",{style:{position:"relative",width:"100vw",height:"100vh"},children:e.jsx("canvas",{ref:t,width:"640",height:"480",style:{display:"block",width:"100%",height:"100%"}})})}var C;(C=void 0)==null||C.toLowerCase();function Pt(){const{hostname:t}=F(),a=G();return e.jsxs(O,{children:[e.jsx(d,{path:"/login",element:e.jsx(H,{})}),e.jsx(d,{path:"/login-google",element:e.jsx(X,{provider:"google"})}),e.jsx(d,{path:"/logout",element:e.jsx(q,{})}),e.jsx(d,{path:"/signup",element:e.jsx(Q,{})}),e.jsx(d,{path:"/reset",element:e.jsx(B,{})}),e.jsx(d,{path:"/reset-password",element:e.jsx(W,{})}),e.jsx(d,{path:"/confirm-email",element:e.jsx(J,{})}),e.jsx(d,{path:"/change-password",element:e.jsx(D,{})}),e.jsx(d,{path:"/game/trivia",element:e.jsx(z,{})}),e.jsx(d,{path:"/game/trivia/:gameId",element:e.jsx(ne,{})}),e.jsx(d,{path:"/game/shooter",element:e.jsx(ie,{})}),e.jsxs(d,{element:e.jsx(M,{}),children:[e.jsx(d,{path:"/",element:e.jsx(T,{to:"/home"})}),e.jsx(d,{path:"/home",element:e.jsx(y,{app:e.jsx(U,{dao:a})})}),e.jsx(d,{path:"/app/admin/:uniqueId",element:e.jsx(y,{app:e.jsx(Y,{})})}),e.jsx(d,{path:"/app/collections/:uniqueId",element:e.jsx(y,{app:e.jsx(V,{})})}),e.jsx(d,{path:"*",element:e.jsx(_,{})})]})]})}export{Pt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.