PageSourceSearch

https://vidsummit-production.up.railway.app/assets/GiveawayDisplay-DLq_60wG.js

js vidsummit-production.up.railway.app collected 2026-10-03 12:15:55 UTC 9,213 bytes, 15 lines download raw bytes

1import{t as E,j as e}from"./index-Bycp73E7.js";import{c as L,r as s,d as I}from"./router-BIDspSpA.js";import{g as R}from"./giveaway-Cov0oqEA.js";import{D as F,a as O,b as P,c as $,d as K}from"./dialog-CRO2DURq.js";import"./react-vendor-B-kMZTGf.js";import"./ui-D973SSVI.js";function z(){const N=L(),n=new URLSearchParams(N).get("mode")==="mobile";s.useEffect(()=>{const t=document.createElement("meta");t.name="robots",t.content="noindex, nofollow";const a=document.createElement("meta");a.name="referrer",a.content="no-referrer";const c=document.createElement("style");return c.textContent=`
2      html.giveaway-display-active,
3      html.giveaway-display-active body,
4      html.giveaway-display-active #root {
5        margin: 0; padding: 0; border: 0; outline: 0;
6        width: 100%; height: 100%; overflow: hidden;
7        background: ${n?"#000":"#08090c"}; color-scheme: dark; overscroll-behavior: none;
8      }
9      html.giveaway-display-active::backdrop { background: ${n?"#000":"#08090c"}; }
10      html.giveaway-display-active .giveaway-stage,
11      html.giveaway-display-active .giveaway-stage:focus,
12      html.giveaway-display-active .giveaway-stage:focus-visible {
13        border: 0 !important; outline: none !important; box-shadow: none !important;
14      }
15    `,document.documentElement.classList.add("giveaway-display-active"),document.head.append(t,a,c),()=>{t.remove(),a.remove(),c.remove(),document.documentElement.classList.remove("giveaway-display-active")}},[n]);const{token:g=""}=I(),r=E.giveaway.display.useQuery({token:g},{refetchInterval:2e3,retry:!1,refetchOnWindowFocus:!0}),u=E.giveaway.displayDraw.useMutation(),b=E.giveaway.displayClaim.useMutation(),[f,D]=s.useState(null),[v,d]=s.useState(""),[p,m]=s.useState(!0),C=s.useRef(null),j=s.useRef(null),[A,h]=s.useState(),y=s.useRef(null),x=s.useRef(!1),w=s.useRef(!1),l=s.useRef(null),i=A??r.data,o=s.useCallback(()=>{l.current&&clearInterval(l.current),l.current=null,D(null)},[]);s.useEffect(()=>{v&&m(!0)},[v]),s.useEffect(()=>{if(r.data?.state==="waiting")o(),y.current=null,h(void 0);else if(r.data?.state==="winner"){const t=r.data;h(a=>a?.state==="winner"&&t.drawOrder>=a.drawOrder?void 0:a)}},[r.data,o]),s.useEffect(()=>()=>{l.current&&clearInterval(l.current)},[]);const k=s.useCallback(async()=>{if(!(x.current||w.current)){x.current=!0,o(),d(""),y.current??=crypto.randomUUID();try{const t=await u.mutateAsync({token:g,requestId:y.current});h(t),y.current=null,await r.refetch()}catch(t){d(t instanceof Error?t.message:"Could not select a name. Press again to retry the same draw.")}finally{x.current=!1}}},[o,u.mutateAsync,g,r.refetch]),G=s.useCallback(t=>{if(p||x.current||w.current||r.isLoading||r.isError)return;if(n||t==="skip"||y.current){k();return}if(l.current)return;d("");const a=Date.now()+3e3;D(3),l.current=setInterval(()=>{const c=Math.max(0,Math.ceil((a-Date.now())/1e3));D(c),c===0&&(o(),k())},100)},[k,o,r.isLoading,r.isError,p,n]);s.useEffect(()=>{const t=a=>{if(p){a.code==="Space"&&a.target!==j.current&&a.preventDefault();return}if(a.key==="?"&&!a.ctrlKey&&!a.metaKey&&!a.altKey){a.preventDefault(),o(),m(!0);return}const c=R(a);(c||a.repeat&&(a.code==="Space"||/^Key[A-Z]$/.test(a.code)))&&a.preventDefault(),c&&G(c)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[G,p,o]);async function S(){if(!(i?.state!=="winner"||i.confirmed||x.current||w.current||l.current)){w.current=!0,d("");try{await b.mutateAsync({token:g,id:i.id}),h(void 0),await r.refetch()}catch(t){d(t instanceof Error?t.message:"Could not confirm winner")}finally{w.current=!1}}}return e.jsxs("main",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:217",className:"fixed inset-0 text-white flex flex-col overflow-hidden",style:{backgroundColor:n?"#000":"#08090c"},children:[!n&&e.jsx("div",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:222","aria-hidden":!0,className:"absolute inset-0 opacity-25 pointer-events-none",style:{backgroundImage:"linear-gradient(#ae17253a 1px, transparent 1px),linear-gradient(90deg,#ae17253a 1px, transparent 1px)",backgroundSize:"80px 80px"}}),e.jsx("button",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:232",ref:C,type:"button","aria-label":n?"Reveal next name":"Start countdown draw",onClick:()=>G("countdown"),className:`giveaway-stage relative z-10 flex-1 min-h-0 w-full flex flex-col items-center justify-center text-center p-[5vw] touch-manipulation select-none outline-none ${n?"cursor-pointer":"cursor-none"}`,style:n?{paddingTop:"max(5vw, env(safe-area-inset-top))",paddingBottom:"max(5vw, env(safe-area-inset-bottom))",paddingLeft:"max(5vw, env(safe-area-inset-left))",paddingRight:"max(5vw, env(safe-area-inset-right))"}:void 0,disabled:f!==null||u.isPending||b.isPending||r.isLoading||r.isError,children:r.isError?e.jsxs(e.Fragment,{children:[e.jsx("h1",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:258",className:"text-[clamp(30px,5vw,90px)] font-black",children:"Display unavailable"}),e.jsx("p",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:261",className:"text-gray-400 mt-5",children:"Check the AV link or connection."})]}):n&&u.isPending?null:f!==null?e.jsx(e.Fragment,{children:e.jsx("div",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:267","aria-live":"off",className:"text-[clamp(100px,24vw,420px)] font-black leading-none text-red-500 tabular-nums",children:f||"…"})}):i?.state==="winner"?e.jsx("div",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:275",className:"max-w-[90vw]",children:e.jsx("h1",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:276","aria-live":"polite",className:`${n?"text-[clamp(32px,min(12vw,15dvh),100px)]":"text-[clamp(40px,8vw,150px)]"} font-black leading-[1.05] break-words`,children:i.winnerName})},i.id):n?null:e.jsx(e.Fragment,{children:e.jsx("h1",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:285",className:"text-[clamp(48px,9vw,160px)] font-black leading-none",children:"GIVEAWAY"})})}),e.jsx(F,{"data-loc":"client/src/pages/GiveawayDisplay.tsx:291",open:p,onOpenChange:m,children:e.jsxs(O,{"data-loc":"client/src/pages/GiveawayDisplay.tsx:292",className:"bg-[#111318] text-white border-white/20 max-h-[90dvh] overflow-y-auto",onOpenAutoFocus:t=>{t.preventDefault(),j.current?.focus()},onCloseAutoFocus:t=>{t.preventDefault(),C.current?.focus()},children:[e.jsxs(P,{"data-loc":"client/src/pages/GiveawayDisplay.tsx:303",children:[e.jsx($,{"data-loc":"client/src/pages/GiveawayDisplay.tsx:304",children:n?"Tap to reveal":"AV screen instructions"}),e.jsx(K,{"data-loc":"client/src/pages/GiveawayDisplay.tsx:307",className:"text-gray-400",children:n?"Dismiss this popup, then tap anywhere on the black screen to reveal a name. Eac
15h tap calls the next person instantly.":"Dismiss this popup before putting the display on screen. Once a name is selected, only their name is shown."})]}),!n&&e.jsxs("ul",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:314",className:"space-y-3 text-sm text-gray-200",children:[e.jsxs("li",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:315",children:[e.jsx("strong",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:316",children:"Space or click the screen:"})," start a 3-second countdown."]}),e.jsxs("li",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:319",children:[e.jsx("strong",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:320",children:"Any letter key:"})," show the next name immediately, even during a countdown."]}),e.jsxs("li",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:323",children:[e.jsx("strong",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:324",children:"?"})," reopen these instructions and controls."]})]}),e.jsx("p",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:328",className:"text-sm text-gray-400",children:"Admin records every name as it is called. Use “Mark present & winner” there to confirm someone, even after AV moves on."}),!n&&e.jsx("p",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:333",className:"text-sm text-gray-400",children:"For the LED wall, use full screen to hide the browser’s tabs and address bar."}),e.jsxs("div",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:338",className:"flex flex-wrap gap-3",children:[i?.state==="winner"&&e.jsx("button",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:340",disabled:b.isPending||f!==null||u.isPending||i.confirmed,className:"rounded-lg border border-emerald-500/50 text-emerald-300 px-4 py-2 disabled:opacity-40",onClick:S,children:i.confirmed?`Confirmed winner #${i.winnerOrder}`:"Confirm present & winner"}),e.jsx("button",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:355",className:"rounded-lg border border-white/20 px-3 py-2 text-gray-400",onClick:async()=>{try{document.fullscreenElement||await document.documentElement.requestFullscreen(),m(!1)}catch{d("Use your browser's full-screen control.")}},children:"Full screen & dismiss"})]}),v&&e.jsx("p",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:371",role:"alert",className:"w-full text-center text-red-300",children:v}),e.jsx("button",{"data-loc":"client/src/pages/GiveawayDisplay.tsx:375",ref:j,className:"bg-red-600 hover:bg-red-500 rounded-lg px-4 py-3 font-bold",onClick:()=>m(!1),children:"Dismiss instructions"})]})})]})}export{z 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.